Clean up bogus 'make compiler happy' code

Less code makes the compiler even happier.

Change-Id: I24cf586ba44f432b541fd17079f93dbd52314828
This commit is contained in:
Thomas Jarosch 2015-01-12 21:12:58 +01:00
parent 789df17dd9
commit a71603b4d1
2 changed files with 8 additions and 7 deletions

View file

@ -349,7 +349,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
for (n = 0; n <= length - MIN_MATCH; n++) { for (n = 0; n <= length - MIN_MATCH; n++) {
INSERT_STRING(s, n, hash_head); INSERT_STRING(s, n, hash_head);
} }
if (hash_head) hash_head = 0; /* to make compiler happy */ (void)hash_head;
return Z_OK; return Z_OK;
} }

View file

@ -215,8 +215,9 @@ local ptr_table table[MAX_PTR];
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
{ {
voidpf buf = opaque; /* just to make some compilers happy */ voidpf buf;
ulg bsize = (ulg)items*size; ulg bsize = (ulg)items*size;
(void)opaque;
/* If we allocate less than 65520 bytes, we assume that farmalloc /* If we allocate less than 65520 bytes, we assume that farmalloc
* will return a usable pointer which doesn't have to be normalized. * will return a usable pointer which doesn't have to be normalized.
@ -255,7 +256,7 @@ void zcfree (voidpf opaque, voidpf ptr)
next_ptr--; next_ptr--;
return; return;
} }
ptr = opaque; /* just to make some compilers happy */ (void)opaque;
Assert(0, "zcfree: ptr not found"); Assert(0, "zcfree: ptr not found");
} }
@ -274,13 +275,13 @@ void zcfree (voidpf opaque, voidpf ptr)
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
{ {
if (opaque) opaque = 0; /* to make compiler happy */ (void)opaque;
return _halloc((long)items, size); return _halloc((long)items, size);
} }
void zcfree (voidpf opaque, voidpf ptr) void zcfree (voidpf opaque, voidpf ptr)
{ {
if (opaque) opaque = 0; /* to make compiler happy */ (void)opaque;
_hfree(ptr); _hfree(ptr);
} }
@ -302,7 +303,7 @@ voidpf zcalloc (opaque, items, size)
unsigned items; unsigned items;
unsigned size; unsigned size;
{ {
if (opaque) items += size - size; /* make compiler happy */ (void)opaque;
return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
(voidpf)calloc(items, size); (voidpf)calloc(items, size);
} }
@ -312,7 +313,7 @@ void zcfree (opaque, ptr)
voidpf ptr; voidpf ptr;
{ {
free(ptr); free(ptr);
if (opaque) return; /* make compiler happy */ (void)opaque;
} }
#endif /* MY_ZCALLOC */ #endif /* MY_ZCALLOC */