瀏覽代碼

stb_image.h: Suppress warnings about out_size, delay_size

These two variables are unused on some targets, resulting in
warnings. Add STBI_NOTUSED around them to suppress those
warnings.
Jacko Dirks 5 年之前
父節點
當前提交
c62af85657
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      stb_image.h

+ 8 - 2
stb_image.h

@@ -116,6 +116,8 @@ RECENT REVISION HISTORY:
     Ryan C. Gordon          [reserved]                              [reserved]
     Ryan C. Gordon          [reserved]                              [reserved]
                      DO NOT ADD YOUR NAME HERE
                      DO NOT ADD YOUR NAME HERE
 
 
+                     Jacko Dirks
+
   To add your name to the credits, pick a random blank space in the middle and fill it.
   To add your name to the credits, pick a random blank space in the middle and fill it.
   80% of merge conflicts on stb PRs are due to people adding their name at the end
   80% of merge conflicts on stb PRs are due to people adding their name at the end
   of the credits.
   of the credits.
@@ -6786,6 +6788,10 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
       int stride;
       int stride;
       int out_size = 0;
       int out_size = 0;
       int delays_size = 0;
       int delays_size = 0;
+
+      STBI_NOTUSED(out_size);
+      STBI_NOTUSED(delays_size);
+
       memset(&g, 0, sizeof(g));
       memset(&g, 0, sizeof(g));
       if (delays) {
       if (delays) {
          *delays = 0;
          *delays = 0;
@@ -7215,8 +7221,8 @@ static int stbi__psd_is16(stbi__context *s)
        stbi__rewind( s );
        stbi__rewind( s );
        return 0;
        return 0;
    }
    }
-   (void) stbi__get32be(s);
-   (void) stbi__get32be(s);
+   STBI_NOTUSED(stbi__get32be(s));
+   STBI_NOTUSED(stbi__get32be(s));
    depth = stbi__get16be(s);
    depth = stbi__get16be(s);
    if (depth != 16) {
    if (depth != 16) {
        stbi__rewind( s );
        stbi__rewind( s );