diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-03-15 20:24:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-03-15 20:26:23 +0400 |
commit | 2097e621edcf7658895b9f6ba9cc4e51f5538369 (patch) | |
tree | 9f112e8a2b35fed01734ed355d3832cd857de826 /source/blender/blenlib/intern | |
parent | 38244166b03bc4a01d8c0b99e2fd2cb2c9b60012 (diff) |
Code cleanup: use r_ prefix for return args
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/edgehash.c | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 26 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 22 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string_utf8.c | 4 |
5 files changed, 31 insertions, 31 deletions
diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index 1d0c9b20550..c12efbd80f6 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -465,11 +465,11 @@ void BLI_edgehashIterator_free(EdgeHashIterator *ehi) /** * Retrieve the key from an iterator. */ -void BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *v0_r, unsigned int *v1_r) +void BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *r_v0, unsigned int *r_v1) { if (ehi->curEntry) { - *v0_r = ehi->curEntry->v0; - *v1_r = ehi->curEntry->v1; + *r_v0 = ehi->curEntry->v0; + *r_v1 = ehi->curEntry->v1; } } diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 55726565f59..4702b384211 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -116,7 +116,7 @@ int BLI_file_gzip(const char *from, const char *to) /* gzip the file in from_file and write it to memory to_mem, at most size bytes. * return the unziped size */ -char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r) +char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size) { gzFile gzfile; int readsize, size, alloc_size = 0; @@ -154,7 +154,7 @@ char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r) else if (alloc_size != size) mem = MEM_reallocN(mem, size); - *size_r = size; + *r_size = size; return mem; } diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 43f6d4c29ae..093b82e9126 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -508,29 +508,29 @@ void cpack_to_rgb(unsigned int col, float *r, float *g, float *b) *b = ((float)(((col) >> 16) & 0xFF)) * (1.0f / 255.0f); } -void rgb_uchar_to_float(float col_r[3], const unsigned char col_ub[3]) +void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3]) { - col_r[0] = ((float)col_ub[0]) * (1.0f / 255.0f); - col_r[1] = ((float)col_ub[1]) * (1.0f / 255.0f); - col_r[2] = ((float)col_ub[2]) * (1.0f / 255.0f); + 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 col_r[4], const unsigned char col_ub[4]) +void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4]) { - col_r[0] = ((float)col_ub[0]) * (1.0f / 255.0f); - col_r[1] = ((float)col_ub[1]) * (1.0f / 255.0f); - col_r[2] = ((float)col_ub[2]) * (1.0f / 255.0f); - col_r[3] = ((float)col_ub[3]) * (1.0f / 255.0f); + 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); + r_col[3] = ((float)col_ub[3]) * (1.0f / 255.0f); } -void rgb_float_to_uchar(unsigned char col_r[3], const float col_f[3]) +void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3]) { - F3TOCHAR3(col_f, col_r); + F3TOCHAR3(col_f, r_col); } -void rgba_float_to_uchar(unsigned char col_r[4], const float col_f[4]) +void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4]) { - F4TOCHAR4(col_f, col_r); + F4TOCHAR4(col_f, r_col); } /* ********************************* color transforms ********************************* */ diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 3b49ad5db8d..2a19584cdb3 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -295,49 +295,49 @@ float dist_to_line_segment_v2(const float p[2], const float l1[2], const float l } /* point closest to v1 on line v2-v3 in 2D */ -void closest_to_line_segment_v2(float close_r[2], const float p[2], const float l1[2], const float l2[2]) +void closest_to_line_segment_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2]) { float lambda, cp[2]; lambda = closest_to_line_v2(cp, p, l1, l2); if (lambda <= 0.0f) - copy_v2_v2(close_r, l1); + copy_v2_v2(r_close, l1); else if (lambda >= 1.0f) - copy_v2_v2(close_r, l2); + copy_v2_v2(r_close, l2); else - copy_v2_v2(close_r, cp); + copy_v2_v2(r_close, cp); } /* point closest to v1 on line v2-v3 in 3D */ -void closest_to_line_segment_v3(float close_r[3], const float v1[3], const float v2[3], const float v3[3]) +void closest_to_line_segment_v3(float r_close[3], const float v1[3], const float v2[3], const float v3[3]) { float lambda, cp[3]; lambda = closest_to_line_v3(cp, v1, v2, v3); if (lambda <= 0.0f) - copy_v3_v3(close_r, v2); + copy_v3_v3(r_close, v2); else if (lambda >= 1.0f) - copy_v3_v3(close_r, v3); + copy_v3_v3(r_close, v3); else - copy_v3_v3(close_r, cp); + copy_v3_v3(r_close, cp); } /** * Find the closest point on a plane. * - * \param close_r Return coordinate + * \param r_close Return coordinate * \param plane The plane to test against. * \param pt The point to find the nearest of * * \note non-unit-length planes are supported. */ -void closest_to_plane_v3(float close_r[3], const float plane[4], const float pt[3]) +void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3]) { const float len_sq = len_squared_v3(plane); const float side = plane_point_side_v3(plane, pt); - madd_v3_v3v3fl(close_r, pt, plane, -side / len_sq); + madd_v3_v3v3fl(r_close, pt, plane, -side / len_sq); } float dist_squared_to_plane_v3(const float pt[3], const float plane[4]) diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index e7beaaa33a0..e97f0d8bdaf 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -195,7 +195,7 @@ static const size_t utf8_skip_data[256] = { char *BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) { - char *dst_r = dst; + char *r_dst = dst; BLI_assert(maxncpy != 0); @@ -206,7 +206,7 @@ char *BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t /* note: currently we don't attempt to deal with invalid utf8 chars */ BLI_STR_UTF8_CPY(dst, src, maxncpy); - return dst_r; + return r_dst; } char *BLI_strncat_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) |