diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 10:04:52 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 11:26:27 +0300 |
commit | 891949cbb47143420f4324cb60efc05ef5d70b39 (patch) | |
tree | fe70a45612ae96f9ce1f37378ef5ff035d3127f5 /source/blender/blenlib/intern | |
parent | c9e35c2ced92082c86f1ecb9ecd16c6230218c7c (diff) |
Cleanup: use 'u' prefixed integer types for brevity & cast style
To use function style cast '(unsigned char)x' can't be replaced by
'unsigned char(x)'.
Diffstat (limited to 'source/blender/blenlib/intern')
23 files changed, 160 insertions, 178 deletions
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index 61447ab1a9e..3c745716ec8 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -57,7 +57,7 @@ static uint case_strhash(const void *ptr) { const char *s = ptr; uint i = 0; - unsigned char c; + uchar c; while ((c = tolower(*s++))) { i = i * 37 + c; diff --git a/source/blender/blenlib/intern/BLI_filelist.c b/source/blender/blenlib/intern/BLI_filelist.c index c6178ebb3a0..526c14d5e33 100644 --- a/source/blender/blenlib/intern/BLI_filelist.c +++ b/source/blender/blenlib/intern/BLI_filelist.c @@ -215,7 +215,7 @@ static void bli_builddir(struct BuildDirCtx *dir_ctx, const char *dirname) } } -unsigned int BLI_filelist_dir_contents(const char *dirname, struct direntry **r_filelist) +uint BLI_filelist_dir_contents(const char *dirname, struct direntry **r_filelist) { struct BuildDirCtx dir_ctx; diff --git a/source/blender/blenlib/intern/BLI_ghash_utils.c b/source/blender/blenlib/intern/BLI_ghash_utils.c index e12e272832f..806d58df260 100644 --- a/source/blender/blenlib/intern/BLI_ghash_utils.c +++ b/source/blender/blenlib/intern/BLI_ghash_utils.c @@ -63,7 +63,7 @@ uint BLI_ghashutil_uinthash_v4(const uint key[4]) uint BLI_ghashutil_uinthash_v4_murmur(const uint key[4]) { - return BLI_hash_mm2((const unsigned char *)key, sizeof(int[4]) /* sizeof(key) */, 0); + return BLI_hash_mm2((const uchar *)key, sizeof(int[4]) /* sizeof(key) */, 0); } bool BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b) @@ -101,7 +101,7 @@ uint BLI_ghashutil_inthash_p_murmur(const void *ptr) { uintptr_t key = (uintptr_t)ptr; - return BLI_hash_mm2((const unsigned char *)&key, sizeof(key), 0); + return BLI_hash_mm2((const uchar *)&key, sizeof(key), 0); } uint BLI_ghashutil_inthash_p_simple(const void *ptr) @@ -143,7 +143,7 @@ uint BLI_ghashutil_strhash_p(const void *ptr) } uint BLI_ghashutil_strhash_p_murmur(const void *ptr) { - const unsigned char *key = ptr; + const uchar *key = ptr; return BLI_hash_mm2(key, strlen((const char *)key) + 1, 0); } diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 71c48ed994b..de71147f015 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -58,7 +58,7 @@ /** \name Struct Definitions * \{ */ -typedef unsigned char axis_t; +typedef uchar axis_t; typedef struct BVHNode { struct BVHNode **children; diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index 71a5dd0e044..f423eff60cb 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -38,7 +38,7 @@ struct MemBuf { }; struct MemArena { - unsigned char *curbuf; + uchar *curbuf; const char *name; struct MemBuf *bufs; @@ -106,9 +106,9 @@ void BLI_memarena_free(MemArena *ma) /** Align alloc'ed memory (needed if `align > 8`). */ static void memarena_curbuf_align(MemArena *ma) { - unsigned char *tmp; + uchar *tmp; - tmp = (unsigned char *)PADUP((intptr_t)ma->curbuf, (int)ma->align); + tmp = (uchar *)PADUP((intptr_t)ma->curbuf, (int)ma->align); ma->cursize -= (size_t)(tmp - ma->curbuf); ma->curbuf = tmp; } diff --git a/source/blender/blenlib/intern/array_store_utils.c b/source/blender/blenlib/intern/array_store_utils.c index 9ac8630204a..51b5ce0519f 100644 --- a/source/blender/blenlib/intern/array_store_utils.c +++ b/source/blender/blenlib/intern/array_store_utils.c @@ -27,9 +27,9 @@ BArrayStore *BLI_array_store_at_size_ensure(struct BArrayStore_AtSize *bs_stride if ((*bs_p) == NULL) { /* calculate best chunk-count to fit a power of two */ - unsigned int chunk_count = chunk_size; + uint chunk_count = chunk_size; { - unsigned int size = chunk_count * stride; + uint size = chunk_count * stride; size = power_of_2_max_u(size); size = MEM_SIZE_OPTIMAL(size); chunk_count = size / stride; diff --git a/source/blender/blenlib/intern/endian_switch.c b/source/blender/blenlib/intern/endian_switch.c index 10d0bfb815b..c1a5b69fb23 100644 --- a/source/blender/blenlib/intern/endian_switch.c +++ b/source/blender/blenlib/intern/endian_switch.c @@ -18,7 +18,7 @@ void BLI_endian_switch_int16_array(short *val, const int size) } } -void BLI_endian_switch_uint16_array(unsigned short *val, const int size) +void BLI_endian_switch_uint16_array(ushort *val, const int size) { if (size > 0) { int i = size; @@ -38,7 +38,7 @@ void BLI_endian_switch_int32_array(int *val, const int size) } } -void BLI_endian_switch_uint32_array(unsigned int *val, const int size) +void BLI_endian_switch_uint32_array(uint *val, const int size) { if (size > 0) { int i = size; diff --git a/source/blender/blenlib/intern/hash_mm2a.c b/source/blender/blenlib/intern/hash_mm2a.c index 8411b49ef38..d13c20e4edb 100644 --- a/source/blender/blenlib/intern/hash_mm2a.c +++ b/source/blender/blenlib/intern/hash_mm2a.c @@ -41,7 +41,7 @@ } \ (void)0 -static void mm2a_mix_tail(BLI_HashMurmur2A *mm2, const unsigned char **data, size_t *len) +static void mm2a_mix_tail(BLI_HashMurmur2A *mm2, const uchar **data, size_t *len) { while (*len && ((*len < 4) || mm2->count)) { mm2->tail |= (uint32_t)(**data) << (mm2->count * 8); @@ -66,7 +66,7 @@ void BLI_hash_mm2a_init(BLI_HashMurmur2A *mm2, uint32_t seed) mm2->size = 0; } -void BLI_hash_mm2a_add(BLI_HashMurmur2A *mm2, const unsigned char *data, size_t len) +void BLI_hash_mm2a_add(BLI_HashMurmur2A *mm2, const uchar *data, size_t len) { mm2->size += (uint32_t)len; @@ -83,7 +83,7 @@ void BLI_hash_mm2a_add(BLI_HashMurmur2A *mm2, const unsigned char *data, size_t void BLI_hash_mm2a_add_int(BLI_HashMurmur2A *mm2, int data) { - BLI_hash_mm2a_add(mm2, (const unsigned char *)&data, sizeof(data)); + BLI_hash_mm2a_add(mm2, (const uchar *)&data, sizeof(data)); } uint32_t BLI_hash_mm2a_end(BLI_HashMurmur2A *mm2) @@ -96,7 +96,7 @@ uint32_t BLI_hash_mm2a_end(BLI_HashMurmur2A *mm2) return mm2->hash; } -uint32_t BLI_hash_mm2(const unsigned char *data, size_t len, uint32_t seed) +uint32_t BLI_hash_mm2(const uchar *data, size_t len, uint32_t seed) { /* Initialize the hash to a 'random' value */ uint32_t h = seed ^ len; diff --git a/source/blender/blenlib/intern/jitter_2d.c b/source/blender/blenlib/intern/jitter_2d.c index 8fa0f2c1e15..4b86f3cfeef 100644 --- a/source/blender/blenlib/intern/jitter_2d.c +++ b/source/blender/blenlib/intern/jitter_2d.c @@ -70,7 +70,7 @@ void BLI_jitterate1(float (*jit1)[2], float (*jit2)[2], int num, float radius1) jit2[i][0] = x; jit2[i][1] = y; } - memcpy(jit1, jit2, 2 * (unsigned int)num * sizeof(float)); + memcpy(jit1, jit2, 2 * (uint)num * sizeof(float)); } void BLI_jitterate2(float (*jit1)[2], float (*jit2)[2], int num, float radius2) @@ -120,7 +120,7 @@ void BLI_jitterate2(float (*jit1)[2], float (*jit2)[2], int num, float radius2) jit2[i][0] = x; jit2[i][1] = y; } - memcpy(jit1, jit2, (unsigned int)num * sizeof(float[2])); + memcpy(jit1, jit2, (uint)num * sizeof(float[2])); } void BLI_jitter_init(float (*jitarr)[2], int num) @@ -138,12 +138,12 @@ void BLI_jitter_init(float (*jitarr)[2], int num) number_fl = (float)num; number_fl_sqrt = sqrtf(number_fl); - jit2 = MEM_mallocN(12 + (unsigned int)num * sizeof(float[2]), "initjit"); + jit2 = MEM_mallocN(12 + (uint)num * sizeof(float[2]), "initjit"); rad1 = 1.0f / number_fl_sqrt; rad2 = 1.0f / number_fl; rad3 = number_fl_sqrt / number_fl; - rng = BLI_rng_new(31415926 + (unsigned int)num); + rng = BLI_rng_new(31415926 + (uint)num); x = 0; for (i = 0; i < num; i++) { diff --git a/source/blender/blenlib/intern/lasso_2d.c b/source/blender/blenlib/intern/lasso_2d.c index 13b0e416b76..4752864ea3a 100644 --- a/source/blender/blenlib/intern/lasso_2d.c +++ b/source/blender/blenlib/intern/lasso_2d.c @@ -12,9 +12,9 @@ #include "BLI_lasso_2d.h" /* own include */ -void BLI_lasso_boundbox(rcti *rect, const int mcoords[][2], const unsigned int mcoords_len) +void BLI_lasso_boundbox(rcti *rect, const int mcoords[][2], const uint mcoords_len) { - unsigned int a; + uint a; rect->xmin = rect->xmax = mcoords[0][0]; rect->ymin = rect->ymax = mcoords[0][1]; @@ -36,7 +36,7 @@ void BLI_lasso_boundbox(rcti *rect, const int mcoords[][2], const unsigned int m } bool BLI_lasso_is_point_inside(const int mcoords[][2], - const unsigned int mcoords_len, + const uint mcoords_len, const int sx, const int sy, const int error_value) @@ -50,7 +50,7 @@ bool BLI_lasso_is_point_inside(const int mcoords[][2], } bool BLI_lasso_is_edge_inside(const int mcoords[][2], - const unsigned int mcoords_len, + const uint mcoords_len, int x0, int y0, int x1, @@ -77,7 +77,7 @@ bool BLI_lasso_is_edge_inside(const int mcoords[][2], if (isect_seg_seg_v2_int(mcoords[0], mcoords[mcoords_len - 1], v1, v2) > 0) { return true; } - for (unsigned int a = 0; a < mcoords_len - 1; a++) { + for (uint a = 0; a < mcoords_len - 1; a++) { if (isect_seg_seg_v2_int(mcoords[a], mcoords[a + 1], v1, v2) > 0) { return true; } diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 9058ef43604..e4b352dc22c 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -176,7 +176,7 @@ void ycc_to_rgb(float y, float cb, float cr, float *r_r, float *r_g, float *r_b, void hex_to_rgb(const char *hexcol, float *r_r, float *r_g, float *r_b) { - unsigned int ri, gi, bi; + uint ri, gi, bi; if (hexcol[0] == '#') { hexcol++; @@ -329,29 +329,29 @@ void hsv_clamp_v(float hsv[3], float v_max) CLAMP(hsv[2], 0.0f, v_max); } -unsigned int hsv_to_cpack(float h, float s, float v) +uint hsv_to_cpack(float h, float s, float v) { - unsigned int r, g, b; + uint r, g, b; float rf, gf, bf; - unsigned int col; + uint col; hsv_to_rgb(h, s, v, &rf, &gf, &bf); - r = (unsigned int)(rf * 255.0f); - g = (unsigned int)(gf * 255.0f); - b = (unsigned int)(bf * 255.0f); + r = (uint)(rf * 255.0f); + g = (uint)(gf * 255.0f); + b = (uint)(bf * 255.0f); col = (r + (g * 256) + (b * 256 * 256)); return col; } -unsigned int rgb_to_cpack(float r, float g, float b) +uint rgb_to_cpack(float r, float g, float b) { - unsigned int ir, ig, ib; + uint ir, ig, ib; - ir = (unsigned int)floorf(255.0f * max_ff(r, 0.0f)); - ig = (unsigned int)floorf(255.0f * max_ff(g, 0.0f)); - ib = (unsigned int)floorf(255.0f * max_ff(b, 0.0f)); + ir = (uint)floorf(255.0f * max_ff(r, 0.0f)); + ig = (uint)floorf(255.0f * max_ff(g, 0.0f)); + ib = (uint)floorf(255.0f * max_ff(b, 0.0f)); if (ir > 255) { ir = 255; @@ -366,21 +366,21 @@ unsigned int rgb_to_cpack(float r, float g, float b) return (ir + (ig * 256) + (ib * 256 * 256)); } -void cpack_to_rgb(unsigned int col, float *r_r, float *r_g, float *r_b) +void cpack_to_rgb(uint col, float *r_r, float *r_g, float *r_b) { *r_r = ((float)(col & 0xFF)) * (1.0f / 255.0f); *r_g = ((float)((col >> 8) & 0xFF)) * (1.0f / 255.0f); *r_b = ((float)((col >> 16) & 0xFF)) * (1.0f / 255.0f); } -void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3]) +void rgb_uchar_to_float(float r_col[3], const uchar col_ub[3]) { r_col[0] = ((float)col_ub[0]) * (1.0f / 255.0f); r_col[1] = ((float)col_ub[1]) * (1.0f / 255.0f); r_col[2] = ((float)col_ub[2]) * (1.0f / 255.0f); } -void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4]) +void rgba_uchar_to_float(float r_col[4], const uchar col_ub[4]) { r_col[0] = ((float)col_ub[0]) * (1.0f / 255.0f); r_col[1] = ((float)col_ub[1]) * (1.0f / 255.0f); @@ -388,12 +388,12 @@ void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4]) r_col[3] = ((float)col_ub[3]) * (1.0f / 255.0f); } -void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3]) +void rgb_float_to_uchar(uchar r_col[3], const float col_f[3]) { unit_float_to_uchar_clamp_v3(r_col, col_f); } -void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4]) +void rgba_float_to_uchar(uchar r_col[4], const float col_f[4]) { unit_float_to_uchar_clamp_v4(r_col, col_f); } @@ -500,7 +500,7 @@ void rgb_float_set_hue_float_offset(float rgb[3], float hue_offset) hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2); } -void rgb_byte_set_hue_float_offset(unsigned char rgb[3], float hue_offset) +void rgb_byte_set_hue_float_offset(uchar rgb[3], float hue_offset) { float rgb_float[3]; @@ -515,13 +515,13 @@ void rgb_byte_set_hue_float_offset(unsigned char rgb[3], float hue_offset) */ float BLI_color_from_srgb_table[256]; -unsigned short BLI_color_to_srgb_table[0x10000]; +ushort BLI_color_to_srgb_table[0x10000]; -static unsigned short hipart(const float f) +static ushort hipart(const float f) { union { float f; - unsigned short us[2]; + ushort us[2]; } tmp; tmp.f = f; @@ -533,12 +533,12 @@ static unsigned short hipart(const float f) #endif } -static float index_to_float(const unsigned short i) +static float index_to_float(const ushort i) { union { float f; - unsigned short us[2]; + ushort us[2]; } tmp; /* positive and negative zeros, and all gradual underflow, turn into zero: */ @@ -567,7 +567,7 @@ static float index_to_float(const unsigned short i) void BLI_init_srgb_conversion(void) { static bool initialized = false; - unsigned int i, b; + uint i, b; if (initialized) { return; @@ -576,12 +576,12 @@ void BLI_init_srgb_conversion(void) /* Fill in the lookup table to convert floats to bytes: */ for (i = 0; i < 0x10000; i++) { - float f = linearrgb_to_srgb(index_to_float((unsigned short)i)) * 255.0f; + float f = linearrgb_to_srgb(index_to_float((ushort)i)) * 255.0f; if (f <= 0) { BLI_color_to_srgb_table[i] = 0; } else if (f < 255) { - BLI_color_to_srgb_table[i] = (unsigned short)(f * 0x100 + 0.5f); + BLI_color_to_srgb_table[i] = (ushort)(f * 0x100 + 0.5f); } else { BLI_color_to_srgb_table[i] = 0xff00; @@ -594,6 +594,6 @@ void BLI_init_srgb_conversion(void) BLI_color_from_srgb_table[b] = f; i = hipart(f); /* replace entries so byte->float->byte does not change the data: */ - BLI_color_to_srgb_table[i] = (unsigned short)(b * 0x100); + BLI_color_to_srgb_table[i] = (ushort)(b * 0x100); } } diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 03f9b6441be..2da8d3d7bc8 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -68,7 +68,7 @@ float normal_quad_v3( return normalize_v3(n); } -float normal_poly_v3(float n[3], const float verts[][3], unsigned int nr) +float normal_poly_v3(float n[3], const float verts[][3], uint nr) { cross_poly_v3(n, verts, nr); return normalize_v3(n); @@ -122,14 +122,14 @@ float area_tri_signed_v3(const float v1[3], return area; } -float area_poly_v3(const float verts[][3], unsigned int nr) +float area_poly_v3(const float verts[][3], uint nr) { float n[3]; cross_poly_v3(n, verts, nr); return len_v3(n) * 0.5f; } -float area_squared_poly_v3(const float verts[][3], unsigned int nr) +float area_squared_poly_v3(const float verts[][3], uint nr) { float n[3]; @@ -138,9 +138,9 @@ float area_squared_poly_v3(const float verts[][3], unsigned int nr) return len_squared_v3(n); } -float cross_poly_v2(const float verts[][2], unsigned int nr) +float cross_poly_v2(const float verts[][2], uint nr) { - unsigned int a; + uint a; float cross; const float *co_curr, *co_prev; @@ -157,11 +157,11 @@ float cross_poly_v2(const float verts[][2], unsigned int nr) return cross; } -void cross_poly_v3(float n[3], const float verts[][3], unsigned int nr) +void cross_poly_v3(float n[3], const float verts[][3], uint nr) { const float *v_prev = verts[nr - 1]; const float *v_curr = verts[0]; - unsigned int i; + uint i; zero_v3(n); @@ -171,17 +171,17 @@ void cross_poly_v3(float n[3], const float verts[][3], unsigned int nr) } } -float area_poly_v2(const float verts[][2], unsigned int nr) +float area_poly_v2(const float verts[][2], uint nr) { return fabsf(0.5f * cross_poly_v2(verts, nr)); } -float area_poly_signed_v2(const float verts[][2], unsigned int nr) +float area_poly_signed_v2(const float verts[][2], uint nr) { return (0.5f * cross_poly_v2(verts, nr)); } -float area_squared_poly_v2(const float verts[][2], unsigned int nr) +float area_squared_poly_v2(const float verts[][2], uint nr) { float area = area_poly_signed_v2(verts, nr); return area * area; @@ -1458,12 +1458,12 @@ int isect_line_sphere_v2(const float l1[2], bool isect_point_poly_v2(const float pt[2], const float verts[][2], - const unsigned int nr, + const uint nr, const bool UNUSED(use_holes)) { /* Keep in sync with #isect_point_poly_v2_int. */ - unsigned int i, j; + uint i, j; bool isect = false; for (i = 0, j = nr - 1; i < nr; j = i++) { if (((verts[i][1] > pt[1]) != (verts[j][1] > pt[1])) && @@ -1477,12 +1477,12 @@ bool isect_point_poly_v2(const float pt[2], } bool isect_point_poly_v2_int(const int pt[2], const int verts[][2], - const unsigned int nr, + const uint nr, const bool UNUSED(use_holes)) { /* Keep in sync with #isect_point_poly_v2. */ - unsigned int i, j; + uint i, j; bool isect = false; for (i = 0, j = nr - 1; i < nr; j = i++) { if (((verts[i][1] > pt[1]) != (verts[j][1] > pt[1])) && diff --git a/source/blender/blenlib/intern/math_interp.c b/source/blender/blenlib/intern/math_interp.c index 34fcb583232..6867c2ac022 100644 --- a/source/blender/blenlib/intern/math_interp.c +++ b/source/blender/blenlib/intern/math_interp.c @@ -56,7 +56,7 @@ static void vector_from_float(const float *data, float vector[4], int components } } -static void vector_from_byte(const unsigned char *data, float vector[4], int components) +static void vector_from_byte(const uchar *data, float vector[4], int components) { if (components == 1) { vector[0] = data[0]; @@ -75,9 +75,9 @@ static void vector_from_byte(const unsigned char *data, float vector[4], int com } /* BICUBIC INTERPOLATION */ -BLI_INLINE void bicubic_interpolation(const unsigned char *byte_buffer, +BLI_INLINE void bicubic_interpolation(const uchar *byte_buffer, const float *float_buffer, - unsigned char *byte_output, + uchar *byte_output, float *float_output, int width, int height, @@ -135,7 +135,7 @@ BLI_INLINE void bicubic_interpolation(const unsigned char *byte_buffer, vector_from_float(float_data, data, components); } else { - const unsigned char *byte_data = byte_buffer + width * y1 * components + components * x1; + const uchar *byte_data = byte_buffer + width * y1 * components + components * x1; vector_from_byte(byte_data, data, components); } @@ -211,18 +211,18 @@ BLI_INLINE void bicubic_interpolation(const unsigned char *byte_buffer, } else { if (components == 1) { - byte_output[0] = (unsigned char)(out[0] + 0.5f); + byte_output[0] = (uchar)(out[0] + 0.5f); } else if (components == 3) { - byte_output[0] = (unsigned char)(out[0] + 0.5f); - byte_output[1] = (unsigned char)(out[1] + 0.5f); - byte_output[2] = (unsigned char)(out[2] + 0.5f); + byte_output[0] = (uchar)(out[0] + 0.5f); + byte_output[1] = (uchar)(out[1] + 0.5f); + byte_output[2] = (uchar)(out[2] + 0.5f); } else { - byte_output[0] = (unsigned char)(out[0] + 0.5f); - byte_output[1] = (unsigned char)(out[1] + 0.5f); - byte_output[2] = (unsigned char)(out[2] + 0.5f); - byte_output[3] = (unsigned char)(out[3] + 0.5f); + byte_output[0] = (uchar)(out[0] + 0.5f); + byte_output[1] = (uchar)(out[1] + 0.5f); + byte_output[2] = (uchar)(out[2] + 0.5f); + byte_output[3] = (uchar)(out[3] + 0.5f); } } } @@ -233,21 +233,16 @@ void BLI_bicubic_interpolation_fl( bicubic_interpolation(NULL, buffer, NULL, output, width, height, components, u, v); } -void BLI_bicubic_interpolation_char(const unsigned char *buffer, - unsigned char *output, - int width, - int height, - int components, - float u, - float v) +void BLI_bicubic_interpolation_char( + const uchar *buffer, uchar *output, int width, int height, int components, float u, float v) { bicubic_interpolation(buffer, NULL, output, NULL, width, height, components, u, v); } /* BILINEAR INTERPOLATION */ -BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, +BLI_INLINE void bilinear_interpolation(const uchar *byte_buffer, const float *float_buffer, - unsigned char *byte_output, + uchar *byte_output, float *float_output, int width, int height, @@ -351,8 +346,8 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, } } else { - const unsigned char *row1, *row2, *row3, *row4; - unsigned char empty[4] = {0, 0, 0, 0}; + const uchar *row1, *row2, *row3, *row4; + uchar empty[4] = {0, 0, 0, 0}; /* pixel value must be already wrapped, however values at boundaries may flip */ if (wrap_x) { @@ -418,26 +413,26 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, ma_mb = (1.0f - a) * (1.0f - b); if (components == 1) { - byte_output[0] = (unsigned char)(ma_mb * row1[0] + a_mb * row3[0] + ma_b * row2[0] + - a_b * row4[0] + 0.5f); + byte_output[0] = (uchar)(ma_mb * row1[0] + a_mb * row3[0] + ma_b * row2[0] + a_b * row4[0] + + 0.5f); } else if (components == 3) { - byte_output[0] = (unsigned char)(ma_mb * row1[0] + a_mb * row3[0] + ma_b * row2[0] + - a_b * row4[0] + 0.5f); - byte_output[1] = (unsigned char)(ma_mb * row1[1] + a_mb * row3[1] + ma_b * row2[1] + - a_b * row4[1] + 0.5f); - byte_output[2] = (unsigned char)(ma_mb * row1[2] + a_mb * row3[2] + ma_b * row2[2] + - a_b * row4[2] + 0.5f); + byte_output[0] = (uchar)(ma_mb * row1[0] + a_mb * row3[0] + ma_b * row2[0] + a_b * row4[0] + + 0.5f); + byte_output[1] = (uchar)(ma_mb * row1[1] + a_mb * row3[1] + ma_b * row2[1] + a_b * row4[1] + + 0.5f); + byte_output[2] = (uchar)(ma_mb * row1[2] + a_mb * row3[2] + ma_b * row2[2] + a_b * row4[2] + + 0.5f); } else { - byte_output[0] = (unsigned char)(ma_mb * row1[0] + a_mb * row3[0] + ma_b * row2[0] + - a_b * row4[0] + 0.5f); - byte_output[1] = (unsigned char)(ma_mb * row1[1] + a_mb * row3[1] + ma_b * row2[1] + - a_b * row4[1] + 0.5f); - byte_output[2] = (unsigned char)(ma_mb * row1[2] + a_mb * row3[2] + ma_b * row2[2] + - a_b * row4[2] + 0.5f); - byte_output[3] = (unsigned char)(ma_mb * row1[3] + a_mb * row3[3] + ma_b * row2[3] + - a_b * row4[3] + 0.5f); + byte_output[0] = (uchar)(ma_mb * row1[0] + a_mb * row3[0] + ma_b * row2[0] + a_b * row4[0] + + 0.5f); + byte_output[1] = (uchar)(ma_mb * row1[1] + a_mb * row3[1] + ma_b * row2[1] + a_b * row4[1] + + 0.5f); + byte_output[2] = (uchar)(ma_mb * row1[2] + a_mb * row3[2] + ma_b * row2[2] + a_b * row4[2] + + 0.5f); + byte_output[3] = (uchar)(ma_mb * row1[3] + a_mb * row3[3] + ma_b * row2[3] + a_b * row4[3] + + 0.5f); } } } @@ -449,13 +444,8 @@ void BLI_bilinear_interpolation_fl( NULL, buffer, NULL, output, width, height, components, u, v, false, false); } -void BLI_bilinear_interpolation_char(const unsigned char *buffer, - unsigned char *output, - int width, - int height, - int components, - float u, - float v) +void BLI_bilinear_interpolation_char( + const uchar *buffer, uchar *output, int width, int height, int components, float u, float v) { bilinear_interpolation( buffer, NULL, output, NULL, width, height, components, u, v, false, false); @@ -475,8 +465,8 @@ void BLI_bilinear_interpolation_wrap_fl(const float *buffer, NULL, buffer, NULL, output, width, height, components, u, v, wrap_x, wrap_y); } -void BLI_bilinear_interpolation_wrap_char(const unsigned char *buffer, - unsigned char *output, +void BLI_bilinear_interpolation_wrap_char(const uchar *buffer, + uchar *output, int width, int height, int components, diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 3f072c153ad..91b07639e9b 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -1477,7 +1477,7 @@ void compatible_eul(float eul[3], const float oldrot[3]) const float pi_x2 = (2.0f * (float)M_PI); float deul[3]; - unsigned int i; + uint i; /* correct differences of about 360 degrees first */ for (i = 0; i < 3; i++) { diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc index e8aa359fbe4..a48df0aa977 100644 --- a/source/blender/blenlib/intern/mesh_intersect.cc +++ b/source/blender/blenlib/intern/mesh_intersect.cc @@ -2032,10 +2032,10 @@ static Array<Face *> polyfill_triangulate_poly(Face *f, IMeshArena *arena) } /* Project along negative face normal so (x,y) can be used in 2d. */ float axis_mat[3][3]; float(*projverts)[2]; - unsigned int(*tris)[3]; + uint(*tris)[3]; const int totfilltri = flen - 2; /* Prepare projected vertices and array to receive triangles in tessellation. */ - tris = static_cast<unsigned int(*)[3]>(MEM_malloc_arrayN(totfilltri, sizeof(*tris), __func__)); + tris = static_cast<uint(*)[3]>(MEM_malloc_arrayN(totfilltri, sizeof(*tris), __func__)); projverts = static_cast<float(*)[2]>(MEM_malloc_arrayN(flen, sizeof(*projverts), __func__)); axis_dominant_v3_to_m3_negate(axis_mat, no); for (int j = 0; j < flen; ++j) { @@ -2047,7 +2047,7 @@ static Array<Face *> polyfill_triangulate_poly(Face *f, IMeshArena *arena) /* Put tessellation triangles into Face form. Record original edges where they exist. */ Array<Face *> ans(totfilltri); for (int t = 0; t < totfilltri; ++t) { - unsigned int *tri = tris[t]; + uint *tri = tris[t]; int eo[3]; const Vert *v[3]; for (int k = 0; k < 3; k++) { diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index 3ec7c3f9804..182c21ca76c 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -115,8 +115,8 @@ static const float hashpntf[768] = { 0.713870, 0.555261, 0.951333, }; -extern const unsigned char BLI_noise_hash_uchar_512[512]; /* Quiet warning. */ -const unsigned char BLI_noise_hash_uchar_512[512] = { +extern const uchar BLI_noise_hash_uchar_512[512]; /* Quiet warning. */ +const uchar BLI_noise_hash_uchar_512[512] = { 0xA2, 0xA0, 0x19, 0x3B, 0xF8, 0xEB, 0xAA, 0xEE, 0xF3, 0x1C, 0x67, 0x28, 0x1D, 0xED, 0x0, 0xDE, 0x95, 0x2E, 0xDC, 0x3F, 0x3A, 0x82, 0x35, 0x4D, 0x6C, 0xBA, 0x36, 0xD0, 0xF6, 0xC, 0x79, 0x32, 0xD1, 0x59, 0xF4, 0x8, 0x8B, 0x63, 0x89, 0x2F, 0xB8, 0xB4, 0x97, 0x83, 0xF2, 0x8F, 0x18, 0xC7, diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 9b91636b055..a3be9732a68 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -121,7 +121,7 @@ int BLI_path_sequence_decode(const char *string, char *head, char *tail, ushort } void BLI_path_sequence_encode( - char *string, const char *head, const char *tail, unsigned short numlen, int pic) + char *string, const char *head, const char *tail, ushort numlen, int pic) { sprintf(string, "%s%.*d%s", head, numlen, MAX2(0, pic), tail); } diff --git a/source/blender/blenlib/intern/rand.cc b/source/blender/blenlib/intern/rand.cc index f6d91cdcc4f..40bbe14101b 100644 --- a/source/blender/blenlib/intern/rand.cc +++ b/source/blender/blenlib/intern/rand.cc @@ -24,7 +24,7 @@ #include "BLI_strict_flags.h" #include "BLI_sys_types.h" -extern "C" unsigned char BLI_noise_hash_uchar_512[512]; /* noise.c */ +extern "C" uchar BLI_noise_hash_uchar_512[512]; /* noise.c */ #define hash BLI_noise_hash_uchar_512 /** @@ -36,14 +36,14 @@ struct RNG { MEM_CXX_CLASS_ALLOC_FUNCS("RNG") }; -RNG *BLI_rng_new(unsigned int seed) +RNG *BLI_rng_new(uint seed) { RNG *rng = new RNG(); rng->rng.seed(seed); return rng; } -RNG *BLI_rng_new_srandom(unsigned int seed) +RNG *BLI_rng_new_srandom(uint seed) { RNG *rng = new RNG(); rng->rng.seed_random(seed); @@ -60,12 +60,12 @@ void BLI_rng_free(RNG *rng) delete rng; } -void BLI_rng_seed(RNG *rng, unsigned int seed) +void BLI_rng_seed(RNG *rng, uint seed) { rng->rng.seed(seed); } -void BLI_rng_srandom(RNG *rng, unsigned int seed) +void BLI_rng_srandom(RNG *rng, uint seed) { rng->rng.seed_random(seed); } @@ -80,7 +80,7 @@ int BLI_rng_get_int(RNG *rng) return rng->rng.get_int32(); } -unsigned int BLI_rng_get_uint(RNG *rng) +uint BLI_rng_get_uint(RNG *rng) { return rng->rng.get_uint32(); } @@ -117,21 +117,21 @@ void BLI_rng_get_tri_sample_float_v3( copy_v3_v3(r_pt, rng->rng.get_triangle_sample_3d(v1, v2, v3)); } -void BLI_rng_shuffle_array(RNG *rng, void *data, unsigned int elem_size_i, unsigned int elem_num) +void BLI_rng_shuffle_array(RNG *rng, void *data, uint elem_size_i, uint elem_num) { if (elem_num <= 1) { return; } const uint elem_size = elem_size_i; - unsigned int i = elem_num; + uint i = elem_num; void *temp = malloc(elem_size); while (i--) { - const unsigned int j = BLI_rng_get_uint(rng) % elem_num; + const uint j = BLI_rng_get_uint(rng) % elem_num; if (i != j) { - void *iElem = (unsigned char *)data + i * elem_size_i; - void *jElem = (unsigned char *)data + j * elem_size_i; + void *iElem = (uchar *)data + i * elem_size_i; + void *jElem = (uchar *)data + j * elem_size_i; memcpy(temp, iElem, elem_size); memcpy(iElem, jElem, elem_size); memcpy(jElem, temp, elem_size); @@ -141,15 +141,15 @@ void BLI_rng_shuffle_array(RNG *rng, void *data, unsigned int elem_size_i, unsig free(temp); } -void BLI_rng_shuffle_bitmap(struct RNG *rng, BLI_bitmap *bitmap, unsigned int bits_num) +void BLI_rng_shuffle_bitmap(struct RNG *rng, BLI_bitmap *bitmap, uint bits_num) { if (bits_num <= 1) { return; } - unsigned int i = bits_num; + uint i = bits_num; while (i--) { - const unsigned int j = BLI_rng_get_uint(rng) % bits_num; + const uint j = BLI_rng_get_uint(rng) % bits_num; if (i != j) { const bool i_bit = BLI_BITMAP_TEST(bitmap, i); const bool j_bit = BLI_BITMAP_TEST(bitmap, j); @@ -166,7 +166,7 @@ void BLI_rng_skip(RNG *rng, int n) /***/ -void BLI_array_frand(float *ar, int count, unsigned int seed) +void BLI_array_frand(float *ar, int count, uint seed) { RNG rng; @@ -177,7 +177,7 @@ void BLI_array_frand(float *ar, int count, unsigned int seed) } } -float BLI_hash_frand(unsigned int seed) +float BLI_hash_frand(uint seed) { RNG rng; @@ -185,10 +185,7 @@ float BLI_hash_frand(unsigned int seed) return BLI_rng_get_float(&rng); } -void BLI_array_randomize(void *data, - unsigned int elem_size, - unsigned int elem_num, - unsigned int seed) +void BLI_array_randomize(void *data, uint elem_size, uint elem_num, uint seed) { RNG rng; @@ -196,7 +193,7 @@ void BLI_array_randomize(void *data, BLI_rng_shuffle_array(&rng, data, elem_size, elem_num); } -void BLI_bitmap_randomize(BLI_bitmap *bitmap, unsigned int bits_num, unsigned int seed) +void BLI_bitmap_randomize(BLI_bitmap *bitmap, uint bits_num, uint seed) { RNG rng; @@ -208,7 +205,7 @@ void BLI_bitmap_randomize(BLI_bitmap *bitmap, unsigned int bits_num, unsigned in static RNG rng_tab[BLENDER_MAX_THREADS]; -void BLI_thread_srandom(int thread, unsigned int seed) +void BLI_thread_srandom(int thread, uint seed) { if (thread >= BLENDER_MAX_THREADS) { thread = 0; @@ -237,12 +234,12 @@ struct RNG_THREAD_ARRAY { RNG_THREAD_ARRAY *BLI_rng_threaded_new() { - unsigned int i; + uint i; RNG_THREAD_ARRAY *rngarr = (RNG_THREAD_ARRAY *)MEM_mallocN(sizeof(RNG_THREAD_ARRAY), "random_array"); for (i = 0; i < BLENDER_MAX_THREADS; i++) { - BLI_rng_srandom(&rngarr->rng_tab[i], (unsigned int)clock()); + BLI_rng_srandom(&rngarr->rng_tab[i], (uint)clock()); } return rngarr; @@ -284,7 +281,7 @@ BLI_INLINE double halton_ex(double invprimes, double *offset) return *offset; } -void BLI_halton_1d(unsigned int prime, double offset, int n, double *r) +void BLI_halton_1d(uint prime, double offset, int n, double *r) { const double invprime = 1.0 / (double)prime; @@ -295,7 +292,7 @@ void BLI_halton_1d(unsigned int prime, double offset, int n, double *r) } } -void BLI_halton_2d(const unsigned int prime[2], double offset[2], int n, double *r) +void BLI_halton_2d(const uint prime[2], double offset[2], int n, double *r) { const double invprimes[2] = {1.0 / (double)prime[0], 1.0 / (double)prime[1]}; @@ -308,7 +305,7 @@ void BLI_halton_2d(const unsigned int prime[2], double offset[2], int n, double } } -void BLI_halton_3d(const unsigned int prime[3], double offset[3], int n, double *r) +void BLI_halton_3d(const uint prime[3], double offset[3], int n, double *r) { const double invprimes[3] = { 1.0 / (double)prime[0], 1.0 / (double)prime[1], 1.0 / (double)prime[2]}; @@ -322,7 +319,7 @@ void BLI_halton_3d(const unsigned int prime[3], double offset[3], int n, double } } -void BLI_halton_2d_sequence(const unsigned int prime[2], double offset[2], int n, double *r) +void BLI_halton_2d_sequence(const uint prime[2], double offset[2], int n, double *r) { const double invprimes[2] = {1.0 / (double)prime[0], 1.0 / (double)prime[1]}; @@ -335,7 +332,7 @@ void BLI_halton_2d_sequence(const unsigned int prime[2], double offset[2], int n /* From "Sampling with Hammersley and Halton Points" TT Wong * Appendix: Source Code 1 */ -BLI_INLINE double radical_inverse(unsigned int n) +BLI_INLINE double radical_inverse(uint n) { double u = 0; @@ -350,14 +347,14 @@ BLI_INLINE double radical_inverse(unsigned int n) return u; } -void BLI_hammersley_1d(unsigned int n, double *r) +void BLI_hammersley_1d(uint n, double *r) { *r = radical_inverse(n); } -void BLI_hammersley_2d_sequence(unsigned int n, double *r) +void BLI_hammersley_2d_sequence(uint n, double *r) { - for (unsigned int s = 0; s < n; s++) { + for (uint s = 0; s < n; s++) { r[s * 2 + 0] = (double)(s + 0.5) / (double)n; r[s * 2 + 1] = radical_inverse(s); } diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index 33d387a5447..00ac1c0ecd7 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -33,9 +33,9 @@ /* local types */ typedef struct PolyFill { - unsigned int edges, verts; + uint edges, verts; float min_xy[2], max_xy[2]; - unsigned short nr; + ushort nr; bool f; } PolyFill; @@ -304,9 +304,7 @@ static bool addedgetoscanvert(ScanFillVertLink *sc, ScanFillEdge *eed) return true; } -static ScanFillVertLink *addedgetoscanlist(ScanFillVertLink *scdata, - ScanFillEdge *eed, - unsigned int len) +static ScanFillVertLink *addedgetoscanlist(ScanFillVertLink *scdata, ScanFillEdge *eed, uint len) { /* inserts edge at correct location in ScanFillVertLink list */ /* returns sc when edge already exists */ @@ -428,10 +426,7 @@ static void testvertexnearedge(ScanFillContext *sf_ctx) } } -static void splitlist(ScanFillContext *sf_ctx, - ListBase *tempve, - ListBase *temped, - unsigned short nr) +static void splitlist(ScanFillContext *sf_ctx, ListBase *tempve, ListBase *temped, ushort nr) { /* Everything is in temp-list, write only poly nr to fill-list. */ ScanFillVert *eve, *eve_next; @@ -457,14 +452,14 @@ static void splitlist(ScanFillContext *sf_ctx, } } -static unsigned int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag) +static uint scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag) { ScanFillVertLink *scdata; ScanFillVertLink *sc = NULL, *sc1; ScanFillVert *eve, *v1, *v2, *v3; ScanFillEdge *eed, *eed_next, *ed1, *ed2, *ed3; - unsigned int a, b, verts, maxface, totface; - const unsigned short nr = pf->nr; + uint a, b, verts, maxface, totface; + const ushort nr = pf->nr; bool twoconnected = false; /* PRINTS */ diff --git a/source/blender/blenlib/intern/scanfill_utils.c b/source/blender/blenlib/intern/scanfill_utils.c index 1d2225a5b56..3550854eabd 100644 --- a/source/blender/blenlib/intern/scanfill_utils.c +++ b/source/blender/blenlib/intern/scanfill_utils.c @@ -41,7 +41,7 @@ typedef struct ScanFillIsect { #define EFLAG_SET(eed, val) \ { \ CHECK_TYPE(eed, ScanFillEdge *); \ - (eed)->user_flag = (eed)->user_flag | (unsigned int)val; \ + (eed)->user_flag = (eed)->user_flag | (uint)val; \ } \ (void)0 #if 0 @@ -56,7 +56,7 @@ typedef struct ScanFillIsect { #define VFLAG_SET(eve, val) \ { \ CHECK_TYPE(eve, ScanFillVert *); \ - (eve)->user_flag = (eve)->user_flag | (unsigned int)val; \ + (eve)->user_flag = (eve)->user_flag | (uint)val; \ } \ (void)0 #if 0 @@ -130,7 +130,7 @@ static int edge_isect_ls_sort_cb(void *thunk, const void *def_a_ptr, const void } static ScanFillEdge *edge_step(PolyInfo *poly_info, - const unsigned short poly_nr, + const ushort poly_nr, ScanFillVert *v_prev, ScanFillVert *v_curr, ScanFillEdge *e_curr) @@ -158,7 +158,7 @@ static ScanFillEdge *edge_step(PolyInfo *poly_info, static bool scanfill_preprocess_self_isect(ScanFillContext *sf_ctx, PolyInfo *poly_info, - const unsigned short poly_nr, + const ushort poly_nr, ListBase *filledgebase) { PolyInfo *pi = &poly_info[poly_nr]; diff --git a/source/blender/blenlib/intern/stack.c b/source/blender/blenlib/intern/stack.c index ff34cfe41cb..a7bc57ab95f 100644 --- a/source/blender/blenlib/intern/stack.c +++ b/source/blender/blenlib/intern/stack.c @@ -141,7 +141,7 @@ void BLI_stack_pop(BLI_Stack *stack, void *dst) BLI_stack_discard(stack); } -void BLI_stack_pop_n(BLI_Stack *stack, void *dst, unsigned int n) +void BLI_stack_pop_n(BLI_Stack *stack, void *dst, uint n) { BLI_assert(n <= BLI_stack_count(stack)); diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 17fb451e422..4fb8311048f 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -55,11 +55,11 @@ ptrdiff_t BLI_str_utf8_invalid_byte(const char *str, size_t length) * length is in bytes, since without knowing whether the string is valid * it's hard to know how many characters there are! */ - const unsigned char *p, *perr, *pend = (const unsigned char *)str + length; - unsigned char c; + const uchar *p, *perr, *pend = (const uchar *)str + length; + uchar c; int ab; - for (p = (const unsigned char *)str; p < pend; p++, length--) { + for (p = (const uchar *)str; p < pend; p++, length--) { c = *p; perr = p; /* Erroneous char is always the first of an invalid utf8 sequence... */ if (ELEM(c, 0xfe, 0xff, 0x00)) { diff --git a/source/blender/blenlib/intern/threads.cc b/source/blender/blenlib/intern/threads.cc index 37fccf6f4fe..e7470ed86f8 100644 --- a/source/blender/blenlib/intern/threads.cc +++ b/source/blender/blenlib/intern/threads.cc @@ -108,7 +108,7 @@ static pthread_mutex_t _colormanage_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _fftw_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _view3d_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_t mainid; -static unsigned int thread_levels = 0; /* threads can be invoked inside threads */ +static uint thread_levels = 0; /* threads can be invoked inside threads */ static int threads_override_num = 0; /* just a max for security reasons */ @@ -153,7 +153,7 @@ void BLI_threadpool_init(ListBase *threadbase, void *(*do_thread)(void *), int t } } - unsigned int level = atomic_fetch_and_add_u(&thread_levels, 1); + uint level = atomic_fetch_and_add_u(&thread_levels, 1); if (level == 0) { #ifdef USE_APPLE_OMP_FIX /* Workaround for Apple gcc 4.2.1 OMP vs background thread bug, @@ -524,7 +524,7 @@ void BLI_rw_mutex_free(ThreadRWMutex *mutex) struct TicketMutex { pthread_cond_t cond; pthread_mutex_t mutex; - unsigned int queue_head, queue_tail; + uint queue_head, queue_tail; }; TicketMutex *BLI_ticket_mutex_alloc() @@ -547,7 +547,7 @@ void BLI_ticket_mutex_free(TicketMutex *ticket) void BLI_ticket_mutex_lock(TicketMutex *ticket) { - unsigned int queue_me; + uint queue_me; pthread_mutex_lock(&ticket->mutex); queue_me = ticket->queue_tail++; |