[Bf-blender-cvs] [bb1d5849d22] override-recursive-resync: Cleanup: rename 'unsigned int' -> 'uint'

Campbell Barton noreply at git.blender.org
Mon Jun 14 16:35:03 CEST 2021


Commit: bb1d5849d22430941ecea6bd5474e7aee833e06e
Author: Campbell Barton
Date:   Sun Jun 13 14:47:25 2021 +1000
Branches: override-recursive-resync
https://developer.blender.org/rBbb1d5849d22430941ecea6bd5474e7aee833e06e

Cleanup: rename 'unsigned int' -> 'uint'

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

M	source/blender/datatoc/datatoc_icon.c

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

diff --git a/source/blender/datatoc/datatoc_icon.c b/source/blender/datatoc/datatoc_icon.c
index f4f510891e0..0f5b155e343 100644
--- a/source/blender/datatoc/datatoc_icon.c
+++ b/source/blender/datatoc/datatoc_icon.c
@@ -66,9 +66,9 @@ static bool path_test_extension(const char *str, const char *ext)
   return !(a == 0 || b == 0 || b >= a) && (strcmp(ext, str + a - b) == 0);
 }
 
-static void endian_switch_uint32(unsigned int *val)
+static void endian_switch_uint32(uint *val)
 {
-  unsigned int tval = *val;
+  uint tval = *val;
   *val = ((tval >> 24)) | ((tval << 8) & 0x00ff0000) | ((tval >> 8) & 0x0000ff00) | ((tval << 24));
 }
 
@@ -96,10 +96,7 @@ static const char *path_basename(const char *path)
 /* -------------------------------------------------------------------- */
 /* Write a PNG from RGBA pixels */
 
-static bool write_png(const char *name,
-                      const unsigned int *pixels,
-                      const int width,
-                      const int height)
+static bool write_png(const char *name, const uint *pixels, const int width, const int height)
 {
   png_structp png_ptr;
   png_infop info_ptr;
@@ -199,9 +196,9 @@ static bool write_png(const char *name,
 /* Merge icon-data from files */
 
 struct IconHead {
-  unsigned int icon_w, icon_h;
-  unsigned int orig_x, orig_y;
-  unsigned int canvas_w, canvas_h;
+  uint icon_w, icon_h;
+  uint orig_x, orig_y;
+  uint canvas_w, canvas_h;
 };
 
 struct IconInfo {
@@ -289,10 +286,10 @@ static bool icon_decode_head(FILE *f_src, struct IconHead *r_head)
   return false;
 }
 
-static bool icon_decode(FILE *f_src, struct IconHead *r_head, unsigned int **r_pixels)
+static bool icon_decode(FILE *f_src, struct IconHead *r_head, uint **r_pixels)
 {
-  unsigned int *pixels;
-  unsigned int pixels_size;
+  uint *pixels;
+  uint pixels_size;
 
   if (!icon_decode_head(f_src, r_head)) {
     printf("%s: failed to read header\n", __func__);
@@ -316,7 +313,7 @@ static bool icon_decode(FILE *f_src, struct IconHead *r_head, unsigned int **r_p
   return true;
 }
 
-static bool icon_read(const char *file_src, struct IconHead *r_head, unsigned int **r_pixels)
+static bool icon_read(const char *file_src, struct IconHead *r_head, uint **r_pixels)
 {
   FILE *f_src;
   bool success;
@@ -335,18 +332,18 @@ static bool icon_read(const char *file_src, struct IconHead *r_head, unsigned in
 
 static bool icon_merge(struct IconMergeContext *context,
                        const char *file_src,
-                       unsigned int **r_pixels_canvas,
-                       unsigned int *r_canvas_w,
-                       unsigned int *r_canvas_h)
+                       uint **r_pixels_canvas,
+                       uint *r_canvas_w,
+                       uint *r_canvas_h)
 {
   struct IconHead head;
-  unsigned int *pixels;
+  uint *pixels;
 
-  unsigned int x, y;
+  uint x, y;
 
   /* canvas */
-  unsigned int *pixels_canvas;
-  unsigned int canvas_w, canvas_h;
+  uint *pixels_canvas;
+  uint canvas_w, canvas_h;
 
   if (!icon_read(file_src, &head, &pixels)) {
     return false;
@@ -377,9 +374,9 @@ static bool icon_merge(struct IconMergeContext *context,
 
   for (x = 0; x < head.icon_w; x++) {
     for (y = 0; y < head.icon_h; y++) {
-      unsigned int pixel;
-      unsigned int dst_x, dst_y;
-      unsigned int pixel_xy_dst;
+      uint pixel;
+      uint dst_x, dst_y;
+      uint pixel_xy_dst;
 
       /* get pixel */
       pixel = pixels[(y * head.icon_w) + x];
@@ -413,8 +410,8 @@ static bool icondir_to_png(const char *path_src, const char *file_dst)
 
   struct IconMergeContext context;
 
-  unsigned int *pixels_canvas = NULL;
-  unsigned int canvas_w = 0, canvas_h = 0;
+  uint *pixels_canvas = NULL;
+  uint canvas_w = 0, canvas_h = 0;
 
   icon_merge_context_init(&context);



More information about the Bf-blender-cvs mailing list