From bd95c176fa268a336dc1d60c55449a37afb624ff Mon Sep 17 00:00:00 2001 From: Deyan Dobromirov Date: Wed, 9 Apr 2025 13:40:28 +0300 Subject: [PATCH 1/2] Fixed: worning for explicit pointer to int conversion --- strbuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/strbuf.c b/strbuf.c index 73cd9b89..8d2bd232 100644 --- a/strbuf.c +++ b/strbuf.c @@ -85,8 +85,8 @@ strbuf_t *strbuf_new(size_t len) static inline void debug_stats(strbuf_t *s) { if (s->debug) { - fprintf(stderr, "strbuf(%lx) reallocs: %d, length: %zd, size: %zd\n", - (long)s, s->reallocs, s->length, s->size); + fprintf(stderr, "strbuf(%p) reallocs: %d, length: %zd, size: %zd\n", + s, s->reallocs, s->length, s->size); } } @@ -164,8 +164,8 @@ void strbuf_resize(strbuf_t *s, size_t len) newsize = calculate_new_size(s, len); if (s->debug > 1) { - fprintf(stderr, "strbuf(%lx) resize: %zd => %zd\n", - (long)s, s->size, newsize); + fprintf(stderr, "strbuf(%) resize: %zd => %zd\n", + s, s->size, newsize); } s->size = newsize; From 127719bd425f74be6c0cdcf60bea79c29589d669 Mon Sep 17 00:00:00 2001 From: Deyan Dobromirov Date: Wed, 9 Apr 2025 13:55:56 +0300 Subject: [PATCH 2/2] Fixed typo when printing debig pointer --- strbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strbuf.c b/strbuf.c index 8d2bd232..704f7021 100644 --- a/strbuf.c +++ b/strbuf.c @@ -164,7 +164,7 @@ void strbuf_resize(strbuf_t *s, size_t len) newsize = calculate_new_size(s, len); if (s->debug > 1) { - fprintf(stderr, "strbuf(%) resize: %zd => %zd\n", + fprintf(stderr, "strbuf(%p) resize: %zd => %zd\n", s, s->size, newsize); }