X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fmempool-fmt.c;h=1b98a2d39df9d5ffabac8f6b17b983fc9f585271;hb=6c4c397f94ec5f5df6bcc178fb5fa4e84d3505fc;hp=dbda703d60350c1427b4fec7d6d1eb48099bd4ab;hpb=4b1b33e6ab0d5bf3cd7a8f58d8a95dc8d2932238;p=libucw.git diff --git a/ucw/mempool-fmt.c b/ucw/mempool-fmt.c index dbda703d..1b98a2d3 100644 --- a/ucw/mempool-fmt.c +++ b/ucw/mempool-fmt.c @@ -16,7 +16,7 @@ #include static char * -mp_vprintf_at(struct mempool *mp, uns ofs, const char *fmt, va_list args) +mp_vprintf_at(struct mempool *mp, size_t ofs, const char *fmt, va_list args) { char *ret = mp_grow(mp, ofs + 1) + ofs; va_list args2; @@ -35,7 +35,7 @@ mp_vprintf_at(struct mempool *mp, uns ofs, const char *fmt, va_list args) } while (cnt < 0); } - else if ((uns)cnt >= mp_avail(mp) - ofs) + else if ((uint)cnt >= mp_avail(mp) - ofs) { ret = mp_grow(mp, ofs + cnt + 1) + ofs; va_copy(args2, args); @@ -67,7 +67,7 @@ mp_printf(struct mempool *p, const char *fmt, ...) char * mp_append_vprintf(struct mempool *mp, char *ptr, const char *fmt, va_list args) { - uns ofs = mp_open(mp, ptr); + size_t ofs = mp_open(mp, ptr); ASSERT(ofs && !ptr[ofs - 1]); return mp_vprintf_at(mp, ofs - 1, fmt, args); } @@ -91,7 +91,7 @@ int main(void) fputs(x, stdout); x = mp_append_printf(mp, x, ""); fputs(x, stdout); - x = mp_append_printf(mp, "\n", "World"); + x = mp_printf(mp, "\n", "World"); fputs(x, stdout); return 0; }