Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-06-13 07:47:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-13 07:54:54 +0300
commit452590571c5d87e9abb3388d83bfee780c28a1c4 (patch)
tree181730d5dcf6987261d243f0b97243fcfe7e0ad5 /source/blender/datatoc
parentab382230471c6ee94e82d0fac3f5093e30710628 (diff)
Cleanup: rename 'unsigned int' -> 'uint'
Diffstat (limited to 'source/blender/datatoc')
-rw-r--r--source/blender/datatoc/datatoc_icon.c47
1 files changed, 22 insertions, 25 deletions
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);