[Bf-blender-cvs] [cda4cd0705f] master: Cleanup: comments (long lines) in blenlib

Campbell Barton noreply at git.blender.org
Sun Apr 21 22:35:09 CEST 2019


Commit: cda4cd0705f92dd0aac760071a4f71b98935d19f
Author: Campbell Barton
Date:   Mon Apr 22 00:54:27 2019 +1000
Branches: master
https://developer.blender.org/rBcda4cd0705f92dd0aac760071a4f71b98935d19f

Cleanup: comments (long lines) in blenlib

===================================================================

M	source/blender/blenlib/BLI_astar.h
M	source/blender/blenlib/BLI_dlrbTree.h
M	source/blender/blenlib/BLI_math_base.h
M	source/blender/blenlib/BLI_mempool.h
M	source/blender/blenlib/BLI_utildefines.h
M	source/blender/blenlib/PIL_time_utildefines.h
M	source/blender/blenlib/intern/BLI_ghash.c
M	source/blender/blenlib/intern/BLI_kdopbvh.c
M	source/blender/blenlib/intern/BLI_linklist_lockfree.c
M	source/blender/blenlib/intern/BLI_mempool.c
M	source/blender/blenlib/intern/array_store.c
M	source/blender/blenlib/intern/array_utils.c
M	source/blender/blenlib/intern/astar.c
M	source/blender/blenlib/intern/freetypefont.c
M	source/blender/blenlib/intern/hash_md5.c
M	source/blender/blenlib/intern/hash_mm2a.c
M	source/blender/blenlib/intern/kdtree_impl.h
M	source/blender/blenlib/intern/listbase.c
M	source/blender/blenlib/intern/math_base_inline.c
M	source/blender/blenlib/intern/math_color.c
M	source/blender/blenlib/intern/math_color_inline.c
M	source/blender/blenlib/intern/math_geom.c
M	source/blender/blenlib/intern/math_interp.c
M	source/blender/blenlib/intern/math_matrix.c
M	source/blender/blenlib/intern/math_solvers.c
M	source/blender/blenlib/intern/math_statistics.c
M	source/blender/blenlib/intern/path_util.c
M	source/blender/blenlib/intern/polyfill_2d_beautify.c
M	source/blender/blenlib/intern/rct.c
M	source/blender/blenlib/intern/smallhash.c
M	source/blender/blenlib/intern/string.c
M	source/blender/blenlib/intern/string_utils.c
M	source/blender/blenlib/intern/task.c

===================================================================

diff --git a/source/blender/blenlib/BLI_astar.h b/source/blender/blenlib/BLI_astar.h
index 320c450a78a..3fe37d7886b 100644
--- a/source/blender/blenlib/BLI_astar.h
+++ b/source/blender/blenlib/BLI_astar.h
@@ -88,8 +88,10 @@ void BLI_astar_solution_clear(BLI_AStarSolution *as_solution);
 void BLI_astar_solution_free(BLI_AStarSolution *as_solution);
 
 /**
- * Callback computing the current cost (distance) to next node, and the estimated overall cost to destination node
- * (A* expects this estimation to always be less or equal than actual shortest path from next node to destination one).
+ * Callback computing the current cost (distance) to next node,
+ * and the estimated overall cost to destination node
+ * (A* expects this estimation to always be less or equal than actual shortest path
+ * from next node to destination one).
  *
  * \param link: the graph link between current node and next one.
  * \param node_idx_curr: current node index.
diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h
index 222cdea10cc..11e5e2c70e9 100644
--- a/source/blender/blenlib/BLI_dlrbTree.h
+++ b/source/blender/blenlib/BLI_dlrbTree.h
@@ -68,20 +68,23 @@ typedef struct DLRBT_Tree {
 
 /* Callback Types --------------------------------- */
 
-/* return -1, 0, 1 for whether the given data is less than, equal to, or greater than the given node
+/* Return -1, 0, 1 for whether the given data is less than,
+ * equal to, or greater than the given node.
  * - node: <DLRBT_Node> the node to compare to
- * - data: pointer to the relevant data or values stored in the bitpattern dependent on the function
+ * - data: pointer to the relevant data or values stored in the bitpattern
+ *   dependent on the function.
  */
 typedef short (*DLRBT_Comparator_FP)(void *node, void *data);
 
-/* return a new node instance wrapping the given data
- * - data: pointer to the relevant data to create a subclass of node from
+/* Return a new node instance wrapping the given data
+ * - data: Pointer to the relevant data to create a subclass of node from
  */
 typedef DLRBT_Node *(*DLRBT_NAlloc_FP)(void *data);
 
-/* update an existing node instance accordingly to be in sync with the given data *
- * - node: <DLRBT_Node> the node to update
- * - data: pointer to the relevant data or values stored in the bitpattern dependent on the function
+/* Update an existing node instance accordingly to be in sync with the given data *
+ * - node: <DLRBT_Node> the node to update.
+ * - data: Pointer to the relevant data or values stored in the bitpattern
+ *   dependent on the function.
  */
 typedef void (*DLRBT_NUpdate_FP)(void *node, void *data);
 
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index aff01622f35..177a1a84b16 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -200,8 +200,9 @@ double double_round(double x, int ndigits);
 /** \note 0.0001 is too small becaues normals may be converted from short's: see T34322. */
 #  define BLI_ASSERT_UNIT_EPSILON 0.0002f
 /**
- * \note Checks are flipped so NAN doesn't assert. This is done because we're making sure the value was normalized
- * and in the case we don't want NAN to be raising asserts since there is nothing to be done in that case.
+ * \note Checks are flipped so NAN doesn't assert.
+ * This is done because we're making sure the value was normalized and in the case we
+ * don't want NAN to be raising asserts since there is nothing to be done in that case.
  */
 #  define BLI_ASSERT_UNIT_V3(v) \
     { \
diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h
index fca3d268981..67851a63f8f 100644
--- a/source/blender/blenlib/BLI_mempool.h
+++ b/source/blender/blenlib/BLI_mempool.h
@@ -77,8 +77,10 @@ enum {
   BLI_MEMPOOL_NOP = 0,
   /** allow iterating on this mempool.
    *
-   * \note this requires that the first four bytes of the elements never begin with 'free' (FREEWORD).
-   * \note order of iteration is only assured to be the order of allocation when no chunks have been freed.
+   * \note this requires that the first four bytes of the elements
+   * never begin with 'free' (#FREEWORD).
+   * \note order of iteration is only assured to be the
+   * order of allocation when no chunks have been freed.
    */
   BLI_MEMPOOL_ALLOW_ITER = (1 << 0),
 };
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 970c64e012e..216e409aee6 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -703,7 +703,8 @@ extern bool BLI_memory_is_zero(const void *arr, const size_t arr_size);
  *     args = [(chr(ord('a') + (c % 26)) + (chr(ord('0') + (c // 26)))) for c in range(i + 1)]
  *     print("#define _VA_UNUSED_VARS_%d(%s) \\" % (i + 1, ", ".join(args)))
  *     print("\t((void)(%s)%s)" %
- *             (args[0], ((", _VA_UNUSED_VARS_" + str(i) + "(%s)") if i else "%s") % ", ".join((args[1:]))))
+ *             (args[0], ((", _VA_UNUSED_VARS_" + str(i) + "(%s)") if i else "%s") %
+ *              ", ".join((args[1:]))))
  * \endcode
  */
 
diff --git a/source/blender/blenlib/PIL_time_utildefines.h b/source/blender/blenlib/PIL_time_utildefines.h
index cfdea54bf37..198b6d1bb21 100644
--- a/source/blender/blenlib/PIL_time_utildefines.h
+++ b/source/blender/blenlib/PIL_time_utildefines.h
@@ -62,8 +62,9 @@
   (void)0
 
 /**
- * _AVERAGED variants do same thing as their basic counterpart, but additionally add elapsed time to an averaged
- * static value, useful to get sensible timing of code running fast and often.
+ * _AVERAGED variants do same thing as their basic counterpart,
+ * but additionally add elapsed time to an averaged static value,
+ * useful to get sensible timing of code running fast and often.
  */
 #define TIMEIT_START_AVERAGED(var) \
   { \
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index c0ec1eba9c0..769bb02e2b9 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -73,7 +73,8 @@ BLI_STATIC_ASSERT(ARRAY_SIZE(hashsizes) == GHASH_MAX_SIZE, "Invalid 'hashsizes'
 /**
  * \note Max load #GHASH_LIMIT_GROW used to be 3. (pre 2.74).
  * Python uses 0.6666, tommyhashlib even goes down to 0.5.
- * Reducing our from 3 to 0.75 gives huge speedup (about twice quicker pure GHash insertions/lookup,
+ * Reducing our from 3 to 0.75 gives huge speedup
+ * (about twice quicker pure GHash insertions/lookup,
  * about 25% - 30% quicker 'dynamic-topology' stroke drawing e.g.).
  * Min load #GHASH_LIMIT_SHRINK is a quarter of max load, to avoid resizing to quickly.
  */
@@ -379,7 +380,8 @@ BLI_INLINE void ghash_buckets_reset(GHash *gh, const uint nentries)
 
 /**
  * Internal lookup function.
- * Takes hash and bucket_index arguments to avoid calling #ghash_keyhash and #ghash_bucket_index multiple times.
+ * Takes hash and bucket_index arguments to avoid calling #ghash_keyhash and #ghash_bucket_index
+ * multiple times.
  */
 BLI_INLINE Entry *ghash_lookup_entry_ex(GHash *gh, const void *key, const uint bucket_index)
 {
@@ -397,7 +399,8 @@ BLI_INLINE Entry *ghash_lookup_entry_ex(GHash *gh, const void *key, const uint b
 
 /**
  * Internal lookup function, returns previous entry of target one too.
- * Takes bucket_index argument to avoid calling #ghash_keyhash and #ghash_bucket_index multiple times.
+ * Takes bucket_index argument to avoid calling #ghash_keyhash and #ghash_bucket_index
+ * multiple times.
  * Useful when modifying buckets somehow (like removing an entry...).
  */
 BLI_INLINE Entry *ghash_lookup_entry_prev_ex(GHash *gh,
@@ -451,7 +454,8 @@ static GHash *ghash_new(GHashHashFP hashfp,
 
 /**
  * Internal insert function.
- * Takes hash and bucket_index arguments to avoid calling #ghash_keyhash and #ghash_bucket_index multiple times.
+ * Takes hash and bucket_index arguments to avoid calling #ghash_keyhash and #ghash_bucket_index
+ * multiple times.
  */
 BLI_INLINE void ghash_insert_ex(GHash *gh, void *key, void *val, const uint bucket_index)
 {
@@ -723,7 +727,8 @@ GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info)
 }
 
 /**
- * Copy given GHash. Keys and values are also copied if relevant callback is provided, else pointers remain the same.
+ * Copy given GHash. Keys and values are also copied if relevant callback is provided,
+ * else pointers remain the same.
  */
 GHash *BLI_ghash_copy(GHash *gh, GHashKeyCopyFP keycopyfp, GHashValCopyFP valcopyfp)
 {
@@ -951,7 +956,8 @@ bool BLI_ghash_haskey(GHash *gh, const void *key)
 }
 
 /**
- * Remove a random entry from \a gh, returning true if a key/value pair could be removed, false otherwise.
+ * Remove a random entry from \a gh, returning true
+ * if a key/value pair could be removed, false otherwise.
  *
  * \param r_key: The removed key.
  * \param r_val: The removed value.
@@ -1332,7 +1338,8 @@ int BLI_gset_buckets_len(GSet *gs)
 
 /**
  * Measure how well the hash function performs (1.0 is approx as good as random distribution),
- * and return a few other stats like load, variance of the distribution of the entries in the buckets, etc.
+ * and return a few other stats like load,
+ * variance of the distribution of the entries in the buckets, etc.
  *
  * Smaller is better!
  */
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index 22e64d6717b..98e8a5ee425 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -622,9 +622,12 @@ static int implicit_leafs_index(const BVHBuildHelper *data, const int depth, con
 /**
  * Generalized implicit tree build
  *
- * An implicit tree is a tree where its structure is implied, thus there is no need to store child pointers or indexs.
- * Its possible to find the position of the child or the parent with simple maths (multiplication and adittion).
- * This type of tree is for example used on heaps.. where node N has its childs at indexs N*2 and N*2+1.
+ * An implicit tree is a tree where its structure is implied,
+ * thus there is no need to store child pointers or inde

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list