[Bf-blender-cvs] [d1e1d6c4916] master: Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")

Campbell Barton noreply at git.blender.org
Wed Jul 21 13:00:26 CEST 2021


Commit: d1e1d6c4916addd078f6ec7fb944829652e6a39a
Author: Campbell Barton
Date:   Wed Jul 21 20:59:19 2021 +1000
Branches: master
https://developer.blender.org/rBd1e1d6c4916addd078f6ec7fb944829652e6a39a

Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")

===================================================================

M	source/blender/editors/armature/pose_lib_2.c
M	source/blender/gpu/intern/gpu_texture_private.hh
M	source/blender/gpu/opengl/gl_texture.hh

===================================================================

diff --git a/source/blender/editors/armature/pose_lib_2.c b/source/blender/editors/armature/pose_lib_2.c
index 84e49a6f42b..e146799a23c 100644
--- a/source/blender/editors/armature/pose_lib_2.c
+++ b/source/blender/editors/armature/pose_lib_2.c
@@ -422,7 +422,7 @@ static void poselib_blend_cleanup(bContext *C, wmOperator *op)
     case POSE_BLEND_BLENDING:
     case POSE_BLEND_ORIGINAL:
       /* Cleanup should not be called directly from these states. */
-      BLI_assert(!"poselib_blend_cleanup: unexpected pose blend state");
+      BLI_assert_msg(0, "poselib_blend_cleanup: unexpected pose blend state");
       BKE_report(op->reports, RPT_ERROR, "Internal pose library error, cancelling operator");
       ATTR_FALLTHROUGH;
     case POSE_BLEND_CANCEL:
diff --git a/source/blender/gpu/intern/gpu_texture_private.hh b/source/blender/gpu/intern/gpu_texture_private.hh
index 2b8a5a5cc12..26be6f57312 100644
--- a/source/blender/gpu/intern/gpu_texture_private.hh
+++ b/source/blender/gpu/intern/gpu_texture_private.hh
@@ -316,7 +316,7 @@ inline size_t to_bytesize(eGPUTextureFormat format)
     case GPU_RGBA8_DXT5:
       return 1; /* Incorrect but actual size is fractional. */
     default:
-      BLI_assert(!"Texture format incorrect or unsupported\n");
+      BLI_assert_msg(0, "Texture format incorrect or unsupported");
       return 0;
   }
 }
@@ -333,7 +333,7 @@ inline size_t to_block_size(eGPUTextureFormat data_type)
     case GPU_RGBA8_DXT5:
       return 16;
     default:
-      BLI_assert(!"Texture format is not a compressed format\n");
+      BLI_assert_msg(0, "Texture format is not a compressed format");
       return 0;
   }
 }
@@ -407,7 +407,7 @@ inline size_t to_bytesize(eGPUDataFormat data_format)
     case GPU_DATA_2_10_10_10_REV:
       return 4;
     default:
-      BLI_assert(!"Data format incorrect or unsupported\n");
+      BLI_assert_msg(0, "Data format incorrect or unsupported");
       return 0;
   }
 }
@@ -503,7 +503,7 @@ inline eGPUFrameBufferBits to_framebuffer_bits(eGPUTextureFormat tex_format)
 static inline eGPUTextureFormat to_texture_format(const GPUVertFormat *format)
 {
   if (format->attr_len > 1 || format->attr_len == 0) {
-    BLI_assert(!"Incorrect vertex format for buffer texture");
+    BLI_assert_msg(0, "Incorrect vertex format for buffer texture");
     return GPU_DEPTH_COMPONENT24;
   }
   switch (format->attrs[0].comp_len) {
@@ -584,7 +584,7 @@ static inline eGPUTextureFormat to_texture_format(const GPUVertFormat *format)
     default:
       break;
   }
-  BLI_assert(!"Unsupported vertex format for buffer texture");
+  BLI_assert_msg(0, "Unsupported vertex format for buffer texture");
   return GPU_DEPTH_COMPONENT24;
 }
 
diff --git a/source/blender/gpu/opengl/gl_texture.hh b/source/blender/gpu/opengl/gl_texture.hh
index dc048ea05c0..2a480e71017 100644
--- a/source/blender/gpu/opengl/gl_texture.hh
+++ b/source/blender/gpu/opengl/gl_texture.hh
@@ -192,7 +192,7 @@ inline GLenum to_gl_internal_format(eGPUTextureFormat format)
     case GPU_DEPTH_COMPONENT16:
       return GL_DEPTH_COMPONENT16;
     default:
-      BLI_assert(!"Texture format incorrect or unsupported\n");
+      BLI_assert_msg(0, "Texture format incorrect or unsupported");
       return 0;
   }
 }
@@ -287,7 +287,7 @@ inline GLenum to_gl(eGPUDataFormat format)
     case GPU_DATA_10_11_11_REV:
       return GL_UNSIGNED_INT_10F_11F_11F_REV;
     default:
-      BLI_assert(!"Unhandled data format");
+      BLI_assert_msg(0, "Unhandled data format");
       return GL_FLOAT;
   }
 }
@@ -359,7 +359,7 @@ inline GLenum to_gl_data_format(eGPUTextureFormat format)
     case GPU_RGBA8_DXT5:
       return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
     default:
-      BLI_assert(!"Texture format incorrect or unsupported\n");
+      BLI_assert_msg(0, "Texture format incorrect or unsupported\n");
       return 0;
   }
 }
@@ -377,7 +377,7 @@ inline GLenum channel_len_to_gl(int channel_len)
     case 4:
       return GL_RGBA;
     default:
-      BLI_assert(!"Wrong number of texture channels");
+      BLI_assert_msg(0, "Wrong number of texture channels");
       return GL_RED;
   }
 }



More information about the Bf-blender-cvs mailing list