OSDN Git Service

Fix signed/unsigned conversion warning
authorGeorge Burgess IV <gbiv@google.com>
Wed, 12 Jul 2017 22:55:18 +0000 (15:55 -0700)
committerGeorge Burgess IV <gbiv@google.com>
Wed, 12 Jul 2017 22:55:18 +0000 (15:55 -0700)
sizeof(T) hands back size_t; clang got upset that we were comparing it
to an int.

Bug: None
Test: mma. Warning disappeared.
Change-Id: I8f201f85a03fcf1070a091a5692eeb00ec13961c

opengl/tests/configdump/configdump.cpp

index c423105..a4bb879 100644 (file)
@@ -78,7 +78,7 @@ int main(int /*argc*/, char** /*argv*/) {
 
     for (EGLint i=0 ; i<n ; i++) {
         printf("EGLConfig[%d]\n", i);
-        for (int attr = 0 ; attr<sizeof(attributes)/sizeof(Attribute) ; attr++) {
+        for (unsigned attr = 0 ; attr<sizeof(attributes)/sizeof(Attribute) ; attr++) {
             EGLint value;
             eglGetConfigAttrib(dpy, configs[i], attributes[attr].attribute, &value);
             printf("\t%-32s: %10d (0x%08x)\n", attributes[attr].name, value, value);