diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-26 14:35:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-26 14:50:48 +0300 |
commit | f1e49038543cf75766f4a220f62cdc6cdbc0e27d (patch) | |
tree | 0cec2c64739a6a4ca246fe26bed6fe629ea315cb /source/blender/blenlib | |
parent | fae5a907d4d1380f087f1226ebbd65d9d0718cc6 (diff) |
Cleanup: full sentences in comments, improve comment formatting
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_array.h | 5 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_buffer.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_strict_flags.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_threads.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/boxpack_2d.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 24 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 12 | ||||
-rw-r--r-- | source/blender/blenlib/intern/winstuff.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/tests/BLI_kdopbvh_test.cc | 2 |
11 files changed, 30 insertions, 29 deletions
diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h index 4e37314ed3e..e40a79dad21 100644 --- a/source/blender/blenlib/BLI_array.h +++ b/source/blender/blenlib/BLI_array.h @@ -105,8 +105,9 @@ void _bli_array_grow_func(void **arr_p, ((void)BLI_array_grow_one(arr), (void)(arr[_##arr##_len - 1] = item)) /** - * appends an item to the array and returns a pointer to the item in the array. - * item is not a pointer, but actual data value.*/ + * Appends an item to the array and returns a pointer to the item in the array. + * item is not a pointer, but actual data value. + */ #define BLI_array_append_r(arr, item) \ ((void)BLI_array_grow_one(arr), (void)(arr[_##arr##_len - 1] = item), (&arr[_##arr##_len - 1])) diff --git a/source/blender/blenlib/BLI_buffer.h b/source/blender/blenlib/BLI_buffer.h index f641c89e53b..9d66fe9a14e 100644 --- a/source/blender/blenlib/BLI_buffer.h +++ b/source/blender/blenlib/BLI_buffer.h @@ -42,7 +42,7 @@ enum { BLI_Buffer name_ = { \ (name_##_static_), sizeof(type_), 0, static_count_, BLI_BUFFER_USE_STATIC | (flag_)} -/* never use static*/ +/* Never use static. */ #define BLI_buffer_declare(type_, name_, flag_) \ bool name_##user; /* warn for free only */ \ BLI_Buffer name_ = {NULL, sizeof(type_), 0, 0, (flag_)} diff --git a/source/blender/blenlib/BLI_strict_flags.h b/source/blender/blenlib/BLI_strict_flags.h index 6cee6b64797..b967d7e494d 100644 --- a/source/blender/blenlib/BLI_strict_flags.h +++ b/source/blender/blenlib/BLI_strict_flags.h @@ -30,7 +30,7 @@ # pragma GCC diagnostic error "-Wconversion" # endif # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 -/* gcc4.8+ only (behavior changed to ignore globals)*/ +/* gcc4.8+ only (behavior changed to ignore globals). */ # pragma GCC diagnostic error "-Wshadow" /* older gcc changed behavior with ternary */ # pragma GCC diagnostic error "-Wsign-conversion" diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index eefde1afefb..4f71e3aa6e4 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -38,7 +38,7 @@ struct ListBase; /* Threading API */ -/*this is run once at startup*/ +/* This is run once at startup. */ void BLI_threadapi_init(void); void BLI_threadapi_exit(void); diff --git a/source/blender/blenlib/intern/boxpack_2d.c b/source/blender/blenlib/intern/boxpack_2d.c index 58889827b96..ea6c2d8d498 100644 --- a/source/blender/blenlib/intern/boxpack_2d.c +++ b/source/blender/blenlib/intern/boxpack_2d.c @@ -298,8 +298,8 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r bool isect; float tot_x = 0.0f, tot_y = 0.0f; - BoxPack *box, *box_test; /*current box and another for intersection tests*/ - BoxVert *vert; /* the current vert */ + BoxPack *box, *box_test; /* Current box and another for intersection tests. */ + BoxVert *vert; /* The current vert. */ struct VertSortContext vs_ctx; diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index 5114d548b9c..58b109eca10 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -199,7 +199,7 @@ MINLINE float scalenorm(float a, float b, float x) return (x * (b - a)) + a; } -/* used for zoom values*/ +/* Used for zoom values. */ MINLINE float power_of_2(float val) { return (float)pow(2.0, ceil(log((double)val) / M_LN2)); diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index abcb3139dc7..67c4ad95d79 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -478,7 +478,7 @@ void minmax_rgb(short c[3]) * accessible from the given triple of primaries. Desaturate * it by adding white, equal quantities of R, G, and B, enough * to make RGB all positive. The function returns 1 if the - * components were modified, zero otherwise.*/ + * components were modified, zero otherwise. */ int constrain_rgb(float *r, float *g, float *b) { /* Amount of white needed */ diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 272623ab4ec..3175bf116a0 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -856,7 +856,7 @@ void dist_squared_to_projected_aabb_precalc(struct DistProjectedAABBPrecalc *pre } #else if (!isect_plane_plane_v3(px, py, precalc->ray_origin, precalc->ray_direction)) { - /* Matrix with weird coplanar planes. Undetermined origin.*/ + /* Matrix with weird co-planar planes. Undetermined origin. */ zero_v3(precalc->ray_origin); precalc->ray_direction[0] = precalc->pmat[0][3]; precalc->ray_direction[1] = precalc->pmat[1][3]; @@ -2133,7 +2133,7 @@ bool isect_ray_line_v3(const float ray_origin[3], const float nlen = len_squared_v3(n); if (nlen == 0.0f) { - /* the lines are parallel.*/ + /* The lines are parallel. */ return false; } @@ -2903,7 +2903,7 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3], /*---test edges---*/ sub_v3_v3v3(e3, v2, v1); /* wasn't yet calculated */ - /*e1*/ + /* `e1` */ sub_v3_v3v3(bv, v0, p1); elen2 = dot_v3v3(e1, e1); @@ -2926,8 +2926,8 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3], } } - /*e2*/ - /*bv is same*/ + /* `e2` */ + /* `bv` is same. */ elen2 = dot_v3v3(e2, e2); edotv = dot_v3v3(e2, vel); edotbv = dot_v3v3(e2, bv); @@ -2948,11 +2948,11 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3], } } - /*e3*/ - /* sub_v3_v3v3(bv, v0, p1); */ /* UNUSED */ - /* elen2 = dot_v3v3(e1, e1); */ /* UNUSED */ - /* edotv = dot_v3v3(e1, vel); */ /* UNUSED */ - /* edotbv = dot_v3v3(e1, bv); */ /* UNUSED */ + /* `e3` */ + // sub_v3_v3v3(bv, v0, p1); /* UNUSED */ + // elen2 = dot_v3v3(e1, e1); /* UNUSED */ + // edotv = dot_v3v3(e1, vel); /* UNUSED */ + // edotbv = dot_v3v3(e1, bv); /* UNUSED */ sub_v3_v3v3(bv, v1, p1); elen2 = dot_v3v3(e3, e3); @@ -4642,7 +4642,7 @@ void resolve_quad_uv_v2_deriv(float r_uv[2], (st3[0] * st0[1] - st3[1] * st0[0]); /* X is 2D cross product (determinant) - * A = (p0 - p) X (p0 - p3)*/ + * A = (p0 - p) X (p0 - p3) */ const double a = (st0[0] - st[0]) * (st0[1] - st3[1]) - (st0[1] - st[1]) * (st0[0] - st3[0]); /* B = ( (p0 - p) X (p1 - p2) + (p1 - p) X (p0 - p3) ) / 2 */ @@ -4731,7 +4731,7 @@ float resolve_quad_u_v2(const float st[2], (st3[0] * st0[1] - st3[1] * st0[0]); /* X is 2D cross product (determinant) - * A = (p0 - p) X (p0 - p3)*/ + * A = (p0 - p) X (p0 - p3) */ const double a = (st0[0] - st[0]) * (st0[1] - st3[1]) - (st0[1] - st[1]) * (st0[0] - st3[0]); /* B = ( (p0 - p) X (p1 - p2) + (p1 - p) X (p0 - p3) ) / 2 */ diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index d447da4de64..5eb0125062d 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -2665,7 +2665,7 @@ void loc_eul_size_to_mat4(float R[4][4], size_to_mat3(smat, size); mul_m3_m3m3(tmat, rmat, smat); - /* copy rot/scale part to output matrix*/ + /* Copy rot/scale part to output matrix. */ copy_m4_m3(R, tmat); /* copy location to matrix */ @@ -2686,18 +2686,18 @@ void loc_eulO_size_to_mat4(float R[4][4], { float rmat[3][3], smat[3][3], tmat[3][3]; - /* initialize new matrix */ + /* Initialize new matrix. */ unit_m4(R); - /* make rotation + scaling part */ + /* Make rotation + scaling part. */ eulO_to_mat3(rmat, eul, rotOrder); size_to_mat3(smat, size); mul_m3_m3m3(tmat, rmat, smat); - /* copy rot/scale part to output matrix*/ + /* Copy rot/scale part to output matrix. */ copy_m4_m3(R, tmat); - /* copy location to matrix */ + /* Copy location to matrix. */ R[3][0] = loc[0]; R[3][1] = loc[1]; R[3][2] = loc[2]; @@ -2722,7 +2722,7 @@ void loc_quat_size_to_mat4(float R[4][4], size_to_mat3(smat, size); mul_m3_m3m3(tmat, rmat, smat); - /* copy rot/scale part to output matrix*/ + /* Copy rot/scale part to output matrix. */ copy_m4_m3(R, tmat); /* copy location to matrix */ diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index d40f665ba0d..beeae175869 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -45,7 +45,7 @@ int BLI_windows_get_executable_dir(char *str) { char dir[FILE_MAXDIR]; int a; - /*change to utf support*/ + /* Change to utf support. */ GetModuleFileName(NULL, str, FILE_MAX); BLI_split_dir_part(str, dir, sizeof(dir)); /* shouldn't be relative */ a = strlen(dir); diff --git a/source/blender/blenlib/tests/BLI_kdopbvh_test.cc b/source/blender/blenlib/tests/BLI_kdopbvh_test.cc index f921c3ae2a4..04e4c3a1625 100644 --- a/source/blender/blenlib/tests/BLI_kdopbvh_test.cc +++ b/source/blender/blenlib/tests/BLI_kdopbvh_test.cc @@ -2,7 +2,7 @@ #include "testing/testing.h" -/* TODO: ray intersection, overlap ... etc.*/ +/* TODO: ray intersection, overlap ... etc. */ #include "MEM_guardedalloc.h" |