Mesa (master): mesa: move assertion after declarations in texstore.c

Brian Paul brianp at kemper.freedesktop.org
Mon Feb 16 15:39:29 UTC 2015


Module: Mesa
Branch: master
Commit: 9ac370014698fda062b41e86a6c20306d6573292
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9ac370014698fda062b41e86a6c20306d6573292

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Feb 16 08:38:56 2015 -0700

mesa: move assertion after declarations in texstore.c

To fix MSVC build.

---

 src/mesa/main/texstore.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index f25c0d7..7039cdf 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -729,9 +729,9 @@ texstore_rgba(TEXSTORE_PARAMS)
       GLint swapSize = _mesa_sizeof_packed_type(srcType);
       if (swapSize == 2 || swapSize == 4) {
          int bytesPerPixel = _mesa_bytes_per_pixel(srcFormat, srcType);
-         assert(bytesPerPixel % swapSize == 0);
          int swapsPerPixel = bytesPerPixel / swapSize;
          int elementCount = srcWidth * srcHeight * srcDepth;
+         assert(bytesPerPixel % swapSize == 0);
          tempImage = malloc(elementCount * bytesPerPixel);
          if (!tempImage)
             return GL_FALSE;




More information about the mesa-commit mailing list