[Bf-blender-cvs] [414596cd830] master: Cleanup, LineArt: Fix MSVC compiler warnings.

Nikhil Shringarpurey noreply at git.blender.org
Mon Mar 22 11:30:40 CET 2021


Commit: 414596cd8306720f9df1cd2de0b97eb1f1fe18f1
Author: Nikhil Shringarpurey
Date:   Mon Mar 22 11:28:04 2021 +0100
Branches: master
https://developer.blender.org/rB414596cd8306720f9df1cd2de0b97eb1f1fe18f1

Cleanup, LineArt: Fix MSVC compiler warnings.

Currently 3 of the printf lines use the format specifier "%lu" for data
of type size_t instead of "%zu". While this works, this creates compiler
warnings.

This diff fixes those warnings by using the correct format specifier.
Tested using MSVC, but should be correct on any compliant compiler.

Reviewed By: Sebastian Parborg

Differential Revision: http://developer.blender.org/D10761

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

M	source/blender/gpencil_modifiers/intern/lineart/lineart_util.c

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

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_util.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_util.c
index fc96b8dc087..4d136fe0d0e 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_util.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_util.c
@@ -213,7 +213,7 @@ void lineart_count_and_print_render_buffer_memory(LineartRenderBuffer *rb)
     count_this++;
     sum_this += LRT_MEMORY_POOL_64MB;
   }
-  printf("LANPR Memory allocated %lu Standalone nodes, total %lu Bytes.\n", count_this, sum_this);
+  printf("LANPR Memory allocated %zu Standalone nodes, total %zu Bytes.\n", count_this, sum_this);
   total += sum_this;
   sum_this = 0;
   count_this = 0;
@@ -222,7 +222,7 @@ void lineart_count_and_print_render_buffer_memory(LineartRenderBuffer *rb)
     count_this++;
     sum_this += reln->element_count * sizeof(LineartEdge);
   }
-  printf("             allocated %lu edge blocks, total %lu Bytes.\n", count_this, sum_this);
+  printf("             allocated %zu edge blocks, total %zu Bytes.\n", count_this, sum_this);
   total += sum_this;
   sum_this = 0;
   count_this = 0;
@@ -231,7 +231,7 @@ void lineart_count_and_print_render_buffer_memory(LineartRenderBuffer *rb)
     count_this++;
     sum_this += reln->element_count * rb->triangle_size;
   }
-  printf("             allocated %lu triangle blocks, total %lu Bytes.\n", count_this, sum_this);
+  printf("             allocated %zu triangle blocks, total %zu Bytes.\n", count_this, sum_this);
   total += sum_this;
   sum_this = 0;
   count_this = 0;



More information about the Bf-blender-cvs mailing list