]> granicus.if.org Git - imagemagick/commitdiff
Fix compiler warning about unused function.
authorFlorian Margaine <ralt@users.noreply.github.com>
Sun, 19 Aug 2018 21:42:57 +0000 (23:42 +0200)
committerDirk Lemstra <dirk@lemstra.org>
Tue, 28 Aug 2018 19:40:27 +0000 (21:40 +0200)
When neither of those compiler macros are available, the compiler is going to spit a warning about the unused static function.

```
coders/miff.c:164:14: warning: 'AcquireCompressionMemory' defined but not used [-Wunused-function]
 static void *AcquireCompressionMemory(void *context,const size_t items,
```

Fix this by making sure the static function is only defined when it's going to be used.

coders/miff.c

index 7d8ceaccd17a51ba9cee30fae0298ee4695547f3..5c5fc41cd5fa247fb0422827cfc6af33089746e2 100644 (file)
@@ -161,6 +161,7 @@ static MagickBooleanType IsMIFF(const unsigned char *magick,const size_t length)
 %
 */
 
+#if defined(MAGICKCORE_BZLIB_DELEGATE) || defined(MAGICKCORE_LZMA_DELEGATE) || defined(MAGICKCORE_ZLIB_DELEGATE)
 static void *AcquireCompressionMemory(void *context,const size_t items,
   const size_t size)
 {
@@ -175,6 +176,7 @@ static void *AcquireCompressionMemory(void *context,const size_t items,
     return((void *) NULL);
   return(AcquireMagickMemory(extent));
 }
+#endif
 
 #if defined(MAGICKCORE_BZLIB_DELEGATE)
 static void *AcquireBZIPMemory(void *context,int items,int size)