diff options
author | Thomas Jarosch <tomj@simonv.com> | 2015-01-12 21:12:58 +0100 |
---|---|---|
committer | Thomas Jarosch <tomj@simonv.com> | 2015-01-12 21:13:00 +0100 |
commit | a71603b4d17b1f7da06c77176a795a7464dc859a (patch) | |
tree | 00559e9671d863e104adce5b3f0785feff019a4d /utils/zenutils/libraries/zlib123 | |
parent | 789df17dd9f5f6f940ffc1b1db11c4e777400767 (diff) | |
download | rockbox-a71603b4d17b1f7da06c77176a795a7464dc859a.tar.gz rockbox-a71603b4d17b1f7da06c77176a795a7464dc859a.zip |
Clean up bogus 'make compiler happy' code
Less code makes the compiler even happier.
Change-Id: I24cf586ba44f432b541fd17079f93dbd52314828
Diffstat (limited to 'utils/zenutils/libraries/zlib123')
-rw-r--r-- | utils/zenutils/libraries/zlib123/zlib/deflate.c | 2 | ||||
-rw-r--r-- | utils/zenutils/libraries/zlib123/zlib/zutil.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/utils/zenutils/libraries/zlib123/zlib/deflate.c b/utils/zenutils/libraries/zlib123/zlib/deflate.c index 29ce1f64a5..e2886abda3 100644 --- a/utils/zenutils/libraries/zlib123/zlib/deflate.c +++ b/utils/zenutils/libraries/zlib123/zlib/deflate.c @@ -349,7 +349,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) for (n = 0; n <= length - MIN_MATCH; n++) { INSERT_STRING(s, n, hash_head); } - if (hash_head) hash_head = 0; /* to make compiler happy */ + (void)hash_head; return Z_OK; } diff --git a/utils/zenutils/libraries/zlib123/zlib/zutil.c b/utils/zenutils/libraries/zlib123/zlib/zutil.c index d55f5948a3..f82e53ba59 100644 --- a/utils/zenutils/libraries/zlib123/zlib/zutil.c +++ b/utils/zenutils/libraries/zlib123/zlib/zutil.c @@ -215,8 +215,9 @@ local ptr_table table[MAX_PTR]; voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) { - voidpf buf = opaque; /* just to make some compilers happy */ + voidpf buf; ulg bsize = (ulg)items*size; + (void)opaque; /* If we allocate less than 65520 bytes, we assume that farmalloc * will return a usable pointer which doesn't have to be normalized. @@ -255,7 +256,7 @@ void zcfree (voidpf opaque, voidpf ptr) next_ptr--; return; } - ptr = opaque; /* just to make some compilers happy */ + (void)opaque; Assert(0, "zcfree: ptr not found"); } @@ -274,13 +275,13 @@ void zcfree (voidpf opaque, voidpf ptr) voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) { - if (opaque) opaque = 0; /* to make compiler happy */ + (void)opaque; return _halloc((long)items, size); } void zcfree (voidpf opaque, voidpf ptr) { - if (opaque) opaque = 0; /* to make compiler happy */ + (void)opaque; _hfree(ptr); } @@ -302,7 +303,7 @@ voidpf zcalloc (opaque, items, size) unsigned items; unsigned size; { - if (opaque) items += size - size; /* make compiler happy */ + (void)opaque; return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : (voidpf)calloc(items, size); } @@ -312,7 +313,7 @@ void zcfree (opaque, ptr) voidpf ptr; { free(ptr); - if (opaque) return; /* make compiler happy */ + (void)opaque; } #endif /* MY_ZCALLOC */ |