Commit: 3dc1f1aa23a1d94601187c9855825d6a92920f04
Author: Antonio Vazquez
Date:   Sat Aug 15 19:36:53 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rB3dc1f1aa23a1d94601187c9855825d6a92920f04

GPencil: Use uintxx_t instead of generic uint

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

M       source/blender/io/gpencil/intern/gpencil_io_capi.cc
M       source/blender/io/gpencil/intern/gpencil_io_export_base.cc
M       source/blender/io/gpencil/intern/gpencil_io_export_svg.cc

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

diff --git a/source/blender/io/gpencil/intern/gpencil_io_capi.cc 
b/source/blender/io/gpencil/intern/gpencil_io_capi.cc
index a2da035f84b..dd9a820f5f2 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_capi.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_capi.cc
@@ -147,12 +147,12 @@ static bool gpencil_io_export_storyboard(Main *bmain,
   const float gap[2] = {frame_box[0] / ((float)blocks[0] + 1.0f), ysize};
   float frame_offset[2] = {gap[0], gap[1]};
 
-  uint col = 1;
-  uint row = 1;
-  uint page = 1;
+  uint8_t col = 1;
+  uint8_t row = 1;
+  uint8_t page = 1;
   bool header = true;
   bool pending_save = false;
-  uint shot = 0;
+  uint8_t shot = 0;
 
   const bool use_markers = ((iparams->flag & GP_EXPORT_MARKERS) != 0);
 
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_base.cc 
b/source/blender/io/gpencil/intern/gpencil_io_export_base.cc
index 47cf4f4fa60..1bc584c740a 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_base.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_base.cc
@@ -254,7 +254,7 @@ float GpencilExporter::stroke_average_pressure_get(struct 
bGPDstroke *gps)
   }
 
   float tot = 0.0f;
-  for (uint i = 0; i < gps->totpoints; i++) {
+  for (uint32_t i = 0; i < gps->totpoints; i++) {
     pt = &gps->points[i];
     tot += pt->pressure;
   }
@@ -276,7 +276,7 @@ bool GpencilExporter::is_stroke_thickness_constant(struct 
bGPDstroke *gps)
   bGPDspoint *pt = &gps->points[0];
   float prv_pressure = pt->pressure;
 
-  for (uint i = 0; i < gps->totpoints; i++) {
+  for (uint32_t i = 0; i < gps->totpoints; i++) {
     pt = &gps->points[i];
     if (pt->pressure != prv_pressure) {
       return false;
@@ -321,9 +321,9 @@ float GpencilExporter::stroke_point_radius_get(struct 
bGPDstroke *gps)
  */
 std::string GpencilExporter::rgb_to_hexstr(float color[3])
 {
-  uint r = color[0] * 255.0f;
-  uint g = color[1] * 255.0f;
-  uint b = color[2] * 255.0f;
+  uint8_t r = color[0] * 255.0f;
+  uint8_t g = color[1] * 255.0f;
+  uint8_t b = color[2] * 255.0f;
   char hex_string[20];
   sprintf(hex_string, "#%02X%02X%02X", r, g, b);
 
@@ -408,7 +408,7 @@ void GpencilExporter::gps_current_set(struct Object *ob,
     avg_opacity = 0;
     /* Get average vertex color and apply. */
     float avg_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
-    for (uint i = 0; i < gps->totpoints; i++) {
+    for (uint32_t i = 0; i < gps->totpoints; i++) {
       bGPDspoint *pt = &gps->points[i];
       add_v4_v4(avg_color, pt->vert_color);
       avg_opacity += pt->strength;
@@ -455,7 +455,7 @@ void GpencilExporter::selected_objects_boundbox_set(void)
 {
   const float gap = 10.0f;
   const bGPDspoint *pt;
-  uint i;
+  uint32_t i;
 
   float screen_co[2];
   float r_min[2], r_max[2];
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc 
b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
index f043c7738db..2d758d0ff26 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
@@ -395,7 +395,7 @@ void 
GpencilExporterSVG::export_stroke_to_path(pugi::xml_node gpl_node, const bo
   gps_node.append_attribute("stroke").set_value("none");
 
   std::string txt = "M";
-  for (uint i = 0; i < gps->totpoints; i++) {
+  for (uint16_t i = 0; i < gps->totpoints; i++) {
     if (i > 0) {
       txt.append("L");
     }
@@ -453,7 +453,7 @@ void 
GpencilExporterSVG::export_stroke_to_polyline(pugi::xml_node gpl_node, cons
   }
 
   std::string txt;
-  for (uint i = 0; i < gps->totpoints; i++) {
+  for (uint16_t i = 0; i < gps->totpoints; i++) {
     if (i > 0) {
       txt.append(" ");
     }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to