瀏覽代碼

Fix usage of sizeof() in test/testgles*.c files

Sylvain 2 年之前
父節點
當前提交
71f2864b3a
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      test/testgles.c
  2. 1 1
      test/testgles2.c
  3. 1 1
      test/testgles2_sdf.c

+ 1 - 1
test/testgles.c

@@ -173,7 +173,7 @@ main(int argc, char *argv[])
         quit(2);
     }
 
-    context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context));
+    context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context));
     if (context == NULL) {
         SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
         quit(2);

+ 1 - 1
test/testgles2.c

@@ -614,7 +614,7 @@ main(int argc, char *argv[])
         return 0;
     }
 
-    context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context));
+    context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context));
     if (context == NULL) {
         SDL_Log("Out of memory!\n");
         quit(2);

+ 1 - 1
test/testgles2_sdf.c

@@ -522,7 +522,7 @@ main(int argc, char *argv[])
         return 0;
     }
 
-    context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context));
+    context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context));
     if (context == NULL) {
         SDL_Log("Out of memory!\n");
         quit(2);