X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=charset%2Fmp-charconv.c;h=642ff81e4557cef54c2793a8714fb311163282f1;hb=a6368763d08042207963c941b1c52b5fafcb0cb3;hp=ef0adf951c83a0b5de0a026763bccb5b1c7f0a06;hpb=16df176fa4667d17146479219ba8816d89d1d78b;p=libucw.git diff --git a/charset/mp-charconv.c b/charset/mp-charconv.c index ef0adf95..642ff81e 100644 --- a/charset/mp-charconv.c +++ b/charset/mp-charconv.c @@ -7,21 +7,21 @@ * of the GNU Lesser General Public License. */ -#include "lib/lib.h" -#include "charset/mp-charconv.h" +#include +#include #include #include byte * -mp_strconv(struct mempool *mp, byte *s, uns in_cs, uns out_cs) +mp_strconv(struct mempool *mp, const byte *s, uint in_cs, uint out_cs) { if (in_cs == out_cs) return mp_strdup(mp, s); struct conv_context c; char *b[32]; - uns bs[32], n = 0, sum = 0; - uns l = strlen(s) + 1; + uint bs[32], n = 0, sum = 0; + uint l = strlen(s) + 1; conv_init(&c); conv_set_charset(&c, in_cs, out_cs); @@ -33,12 +33,12 @@ mp_strconv(struct mempool *mp, byte *s, uns in_cs, uns out_cs) l <<= 1; c.dest_start = c.dest = b[n] = alloca(l); c.dest_end = c.dest_start+ l; - uns r = conv_run(&c); + uint r = conv_run(&c); sum += bs[n++] = c.dest - c.dest_start; if (r & CONV_SOURCE_END) { c.dest_start = c.dest = mp_alloc(mp, sum); - for (uns i = 0; i < n; i++) + for (uint i = 0; i < n; i++) { memcpy(c.dest, b[i], bs[i]); c.dest += bs[i];