diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-26 18:20:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-26 18:25:15 +0400 |
commit | 483d8da9bcfa1eeef950ba45633c5fb49fb7f93b (patch) | |
tree | 7401d2e6b3fab99a2738a7497ef851117b455e02 /source/blender/blenlib | |
parent | a2c107aef1c8aaf7deb17dd0319bc07e55cb4293 (diff) |
Code cleanup: use 'const' for arrays (blenlib)
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 10 | ||||
-rw-r--r-- | source/blender/blenlib/intern/scanfill.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string_utf8.c | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 85a2974fa50..5638d8e0360 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -95,8 +95,8 @@ float normal_quad_v3(float n[3], const float v1[3], const float v2[3], const flo */ float normal_poly_v3(float n[3], const float verts[][3], unsigned int nr) { - float const *v_prev = verts[nr - 1]; - float const *v_curr = verts[0]; + const float const *v_prev = verts[nr - 1]; + const float const *v_curr = verts[0]; unsigned int i; zero_v3(n); @@ -2554,7 +2554,7 @@ void interp_weights_poly_v3(float *w, float v[][3], const int n, const float co[ { const float eps = 0.00001f; /* take care, low values cause [#36105] */ const float eps_sq = eps * eps; - float *v_curr, *v_next; + const float *v_curr, *v_next; float ht_prev, ht; /* half tangents */ float totweight = 0.0f; int i = 0; @@ -2623,7 +2623,7 @@ void interp_weights_poly_v2(float *w, float v[][2], const int n, const float co[ { const float eps = 0.00001f; /* take care, low values cause [#36105] */ const float eps_sq = eps * eps; - float *v_curr, *v_next; + const float *v_curr, *v_next; float ht_prev, ht; /* half tangents */ float totweight = 0.0f; int i = 0; diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 118cd50a2a4..0be2e84b35b 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -646,8 +646,8 @@ void BLI_path_rel(char *file, const char *relfile) if (lslash) { /* find the prefix of the filename that is equal for both filenames. * This is replaced by the two slashes at the beginning */ - char *p = temp; - char *q = file; + const char *p = temp; + const char *q = file; char *r = res; #ifdef WIN32 @@ -1723,7 +1723,7 @@ bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch) char pattern[16]; while (ext_step[0]) { - char *ext_next; + const char *ext_next; int len_ext; if ((ext_next = strchr(ext_step, ';'))) { @@ -2057,8 +2057,8 @@ int BLI_rebase_path(char *abs, size_t abs_len, */ const char *BLI_first_slash(const char *string) { - char * const ffslash = strchr(string, '/'); - char * const fbslash = strchr(string, '\\'); + const char * const ffslash = strchr(string, '/'); + const char * const fbslash = strchr(string, '\\'); if (!ffslash) return fbslash; else if (!fbslash) return ffslash; diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index 69049b51f87..05e4984d9a3 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -865,7 +865,7 @@ unsigned int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const /* Newell's Method */ /* Similar code used elsewhere, but this checks for double ups * which historically this function supports so better not change */ - float *v_prev; + const float *v_prev; zero_v3(n); eve = sf_ctx->fillvertbase.last; diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index bbc135479ef..892bb16a543 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -289,7 +289,7 @@ escape_finish: char *BLI_str_quoted_substrN(const char *__restrict str, const char *__restrict prefix) { size_t prefixLen = strlen(prefix); - char *startMatch, *endMatch; + const char *startMatch, *endMatch; /* get the starting point (i.e. where prefix starts, and add prefixLen+1 to it to get be after the first " */ startMatch = strstr(str, prefix) + prefixLen + 1; diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index be933269fb5..74e979a8579 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -536,7 +536,7 @@ unsigned int BLI_str_utf8_as_unicode_step(const char *__restrict p, size_t *__re if (UNLIKELY(len == -1)) { /* when called with NULL end, result will never be NULL, * checks for a NULL character */ - char *p_next = BLI_str_find_next_char_utf8(p, NULL); + const char *p_next = BLI_str_find_next_char_utf8(p, NULL); /* will never return the same pointer unless '\0', * eternal loop is prevented */ *index += (size_t)(p_next - p); |