From 024823d0f3da0755babeccdbba9c358d6b89efd4 Mon Sep 17 00:00:00 2001 From: Mika Lindqvist Date: Wed, 13 May 2015 21:34:32 +0300 Subject: [PATCH] Fix MinGW failing to find infcover.exe when stripping the executable. Fix compiling infcover.c under MinGW --- Makefile.in | 4 ++-- test/infcover.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index de277546..fadf353c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -136,13 +136,13 @@ test64: all64 infcover.o: $(SRCDIR)/test/infcover.c $(SRCDIR)/zlib.h zconf.h $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/infcover.c -infcover: infcover.o $(STATICLIB) +infcover$(EXE): infcover.o $(STATICLIB) $(CC) $(CFLAGS) -o $@ infcover.o $(STATICLIB) $(BSDLIBS) ifneq ($(STRIP),) $(STRIP) $@ endif -cover: infcover +cover: infcover$(EXE) rm -f *.gcda ./infcover gcov inf*.c diff --git a/test/infcover.c b/test/infcover.c index eca68677..c1a8d213 100644 --- a/test/infcover.c +++ b/test/infcover.c @@ -191,7 +191,7 @@ local void mem_used(z_stream *strm, char *prefix) { struct mem_zone *zone = strm->opaque; - fprintf(stderr, "%s: %lu allocated\n", prefix, zone->total); + fprintf(stderr, "%s: %zu allocated\n", prefix, zone->total); } /* show the high water allocation in bytes */ @@ -199,7 +199,7 @@ local void mem_high(z_stream *strm, char *prefix) { struct mem_zone *zone = strm->opaque; - fprintf(stderr, "%s: %lu high water mark\n", prefix, zone->highwater); + fprintf(stderr, "%s: %zu high water mark\n", prefix, zone->highwater); } /* release the memory allocation zone -- if there are any surprises, notify */ @@ -224,7 +224,7 @@ local void mem_done(z_stream *strm, char *prefix) /* issue alerts about anything unexpected */ if (count || zone->total) - fprintf(stderr, "** %s: %lu bytes in %d blocks not freed\n", + fprintf(stderr, "** %s: %zu bytes in %d blocks not freed\n", prefix, zone->total, count); if (zone->notlifo) fprintf(stderr, "** %s: %d frees not LIFO\n", prefix, zone->notlifo); @@ -378,7 +378,7 @@ local void cover_support(void) mem_setup(&strm); strm.avail_in = 0; strm.next_in = Z_NULL; - ret = inflateInit_(&strm, ZLIB_VERSION - 1, (int)sizeof(z_stream)); + ret = inflateInit_(&strm, ZLIB_VERSION + 1, (int)sizeof(z_stream)); assert(ret == Z_VERSION_ERROR); mem_done(&strm, "wrong version"); @@ -449,7 +449,7 @@ local void cover_wrap(void) } /* input and output functions for inflateBack() */ -local unsigned pull(void *desc, unsigned char **buf) +local unsigned pull(void *desc, const unsigned char **buf) { static unsigned int next = 0; static unsigned char dat[] = {0x63, 0, 2, 0}; -- 2.47.2