diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-21 12:16:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-21 12:16:37 +0400 |
commit | 7db1d6556d2aefcf4e5e787477b7cd22104e15ac (patch) | |
tree | b1cf518de6a88886e9566aae62dec168d2a96f20 /source/blender/blenlib/intern | |
parent | 3ec1daaa77f20e1aeaae30b5beab675659e873f2 (diff) |
code cleanup: add break statements in switch ()'s, (even at the last case).
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/noise.c | 10 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string.c | 4 |
6 files changed, 24 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 3f802c492c2..8cfe4706937 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -150,6 +150,7 @@ void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr, in break; default: assert(!"invalid colorspace"); + break; } *ly = y; @@ -183,7 +184,8 @@ void ycc_to_rgb(float y, float cb, float cr, float *lr, float *lg, float *lb, in b = y + 1.772f * cb - 226.816f; break; default: - assert(!"invalid colorspace"); + BLI_assert(0); + break; } *lr = r / 255.0f; *lg = g / 255.0f; diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index cd7dfdc6d2f..312805e23f6 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -839,6 +839,7 @@ void orthogonalize_m3(float mat[3][3], int axis) break; default: BLI_assert(0); + break; } mul_v3_fl(mat[0], size[0]); mul_v3_fl(mat[1], size[1]); @@ -922,6 +923,7 @@ void orthogonalize_m4(float mat[4][4], int axis) break; default: BLI_assert(0); + break; } mul_v3_fl(mat[0], size[0]); mul_v3_fl(mat[1], size[1]); diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index dc0c48cf33f..9fd8c479d6e 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -857,7 +857,8 @@ void single_axis_angle_to_mat3(float mat[3][3], const char axis, const float ang mat[2][2] = 1.0f; break; default: - assert(0); + BLI_assert(0); + break; } } diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index 6e52145c653..2f94e833e9d 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -1252,6 +1252,7 @@ void voronoi(float x, float y, float z, float *da, float *pa, float me, int dtyp case 0: default: distfunc = dist_Real; + break; } xi = (int)(floor(x)); @@ -1467,6 +1468,7 @@ float BLI_gNoise(float noisesize, float x, float y, float z, int hard, int noise x += 1; y += 1; z += 1; + break; } } @@ -1522,6 +1524,7 @@ float BLI_gTurbulence(float noisesize, float x, float y, float z, int oct, int h x += 1; y += 1; z += 1; + break; } if (noisesize != 0.0f) { @@ -1596,6 +1599,7 @@ float mg_fBm(float x, float y, float z, float H, float lacunarity, float octaves default: { noisefunc = orgBlenderNoiseS; + break; } } @@ -1667,6 +1671,7 @@ float mg_MultiFractal(float x, float y, float z, float H, float lacunarity, floa default: { noisefunc = orgBlenderNoiseS; + break; } } @@ -1734,6 +1739,7 @@ float mg_HeteroTerrain(float x, float y, float z, float H, float lacunarity, flo default: { noisefunc = orgBlenderNoiseS; + break; } } @@ -1808,6 +1814,7 @@ float mg_HybridMultiFractal(float x, float y, float z, float H, float lacunarity default: { noisefunc = orgBlenderNoiseS; + break; } } @@ -1884,6 +1891,7 @@ float mg_RidgedMultiFractal(float x, float y, float z, float H, float lacunarity default: { noisefunc = orgBlenderNoiseS; + break; } } @@ -1950,6 +1958,7 @@ float mg_VLNoise(float x, float y, float z, float distortion, int nbas1, int nba default: { noisefunc1 = orgBlenderNoiseS; + break; } } @@ -1985,6 +1994,7 @@ float mg_VLNoise(float x, float y, float z, float distortion, int nbas1, int nba default: { noisefunc2 = orgBlenderNoiseS; + break; } } diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 4c089e99202..c5205ed5d18 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1228,6 +1228,7 @@ const char *BLI_get_folder(int folder_id, const char *subfolder) default: BLI_assert(0); + break; } return path; @@ -1256,7 +1257,9 @@ const char *BLI_get_user_folder_notest(int folder_id, const char *subfolder) break; default: BLI_assert(0); + break; } + if ('\0' == path[0]) { return NULL; } @@ -1306,6 +1309,7 @@ const char *BLI_get_folder_version(const int id, const int ver, const bool do_ch path[0] = '\0'; /* in case do_check is false */ ok = false; BLI_assert(!"incorrect ID"); + break; } if (!ok && do_check) { diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 24e14d04c68..cb0d4ae307d 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -240,6 +240,7 @@ size_t BLI_strescape(char *__restrict dst, const char *__restrict src, const siz goto escape_finish; case '\\': case '"': + /* fall-through */ /* less common but should also be support */ case '\t': @@ -253,9 +254,10 @@ size_t BLI_strescape(char *__restrict dst, const char *__restrict src, const siz /* not enough space to escape */ break; } - /* intentionally pass through */ + /* fall-through */ default: *dst = *src; + break; } dst++; src++; |