Bug 1277647 - return the correct type from ANativeWindow_setBuffersGeometry; r=snorp
authorNathan Froyd <froydnj@gmail.com>
Fri, 03 Jun 2016 18:31:05 -0400
changeset 375197 b0139b57d0ccf65b95b7a3c60a693a0422c232dd
parent 375196 7f5e5e52d06fdb6c2b3ac864a310f934541ab8b9
child 375198 648a8ccff0394235e2a21b02824be6a87dd66210
push id20189
push userjlund@mozilla.com
push dateFri, 03 Jun 2016 17:40:55 +0000
reviewerssnorp
bugs1277647
milestone49.0a1
Bug 1277647 - return the correct type from ANativeWindow_setBuffersGeometry; r=snorp This function returns a boolean, so let's return that, rather than relying on pointer-to-boolean coercion.
gfx/gl/AndroidNativeWindow.cpp
--- a/gfx/gl/AndroidNativeWindow.cpp
+++ b/gfx/gl/AndroidNativeWindow.cpp
@@ -57,17 +57,17 @@ public:
     }
 
     fANativeWindow_release(aWindow);
   }
 
   bool ANativeWindow_setBuffersGeometry(void* aWindow, int32_t aWidth, int32_t aHeight, int32_t aFormat) {
     ALOG("%s: window=%p, width=%d, height=%d, format=%d\n", __PRETTY_FUNCTION__, aWindow, aWidth, aHeight, aFormat);
     if (!Initialized()) {
-      return nullptr;
+      return false;
     }
 
     return fANativeWindow_setBuffersGeometry(aWindow, aWidth, aHeight, (int32_t)aFormat) == 0;
   }
 
   bool ANativeWindow_lock(void* aWindow, void* out_buffer, void*in_out_dirtyBounds) {
     ALOG("%s: window=%p, out_buffer=%p, in_out_dirtyBounds=%p\n", __PRETTY_FUNCTION__,
          aWindow, out_buffer, in_out_dirtyBounds);
@@ -273,9 +273,9 @@ AndroidNativeWindow::UnlockAndPost()
     return false;
   }
 
   return sLibrary->ANativeWindow_unlockAndPost(mWindow);
 }
 
 }
 
-#endif // MOZ_WIDGET_ANDROID
\ No newline at end of file
+#endif // MOZ_WIDGET_ANDROID