diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/input/input_map.h | 4 | ||||
-rw-r--r-- | core/io/image.h | 2 | ||||
-rw-r--r-- | core/io/marshalls.h | 6 | ||||
-rw-r--r-- | core/math/bvh_logic.inc | 50 | ||||
-rw-r--r-- | core/math/convex_hull.cpp | 9 | ||||
-rw-r--r-- | core/math/face3.h | 14 | ||||
-rw-r--r-- | core/math/math_defs.h | 8 | ||||
-rw-r--r-- | core/math/triangulate.cpp | 11 | ||||
-rw-r--r-- | core/string/ustring.cpp | 114 | ||||
-rw-r--r-- | core/templates/hash_map.h | 6 | ||||
-rw-r--r-- | core/templates/list.h | 16 | ||||
-rw-r--r-- | core/templates/vector.h | 2 |
12 files changed, 121 insertions, 121 deletions
diff --git a/core/input/input_map.h b/core/input/input_map.h index 8bef722089..0bf572ddca 100644 --- a/core/input/input_map.h +++ b/core/input/input_map.h @@ -41,8 +41,8 @@ class InputMap : public Object { public: /** - * A special value used to signify that a given Action can be triggered by any device - */ + * A special value used to signify that a given Action can be triggered by any device + */ static int ALL_DEVICES; struct Action { diff --git a/core/io/image.h b/core/io/image.h index 8f1b251ac3..d31a065aa7 100644 --- a/core/io/image.h +++ b/core/io/image.h @@ -41,7 +41,7 @@ * Image storage class. This is used to store an image in user memory, as well as * providing some basic methods for image manipulation. * Images can be loaded from a file, or registered into the Render object as textures. -*/ + */ class Image; diff --git a/core/io/marshalls.h b/core/io/marshalls.h index 05804d5a46..9ea060e48c 100644 --- a/core/io/marshalls.h +++ b/core/io/marshalls.h @@ -44,9 +44,9 @@ typedef uint32_t uintr_t; #endif /** - * Miscellaneous helpers for marshalling data types, and encoding - * in an endian independent way - */ + * Miscellaneous helpers for marshalling data types, and encoding + * in an endian independent way + */ union MarshallFloat { uint32_t i; ///< int diff --git a/core/math/bvh_logic.inc b/core/math/bvh_logic.inc index afab08f151..c65002a9fd 100644 --- a/core/math/bvh_logic.inc +++ b/core/math/bvh_logic.inc @@ -42,24 +42,24 @@ BVHABB_CLASS _logic_abb_merge(const BVHABB_CLASS &a, const BVHABB_CLASS &b) { //-------------------------------------------------------------------------------------------------- /** -@file q3DynamicAABBTree.h -@author Randy Gaul -@date 10/10/2014 - Copyright (c) 2014 Randy Gaul http://www.randygaul.net - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not - be misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ + * @file q3DynamicAABBTree.h + * @author Randy Gaul + * @date 10/10/2014 + * Copyright (c) 2014 Randy Gaul http://www.randygaul.net + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not + * be misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ //-------------------------------------------------------------------------------------------------- // This function is based on the 'Balance' function from Randy Gaul's qu3e @@ -67,7 +67,7 @@ BVHABB_CLASS _logic_abb_merge(const BVHABB_CLASS &a, const BVHABB_CLASS &b) { // It is MODIFIED from qu3e version. // This is the only function used (and _logic_abb_merge helper function). int32_t _logic_balance(int32_t iA, uint32_t p_tree_id) { - // return iA; // uncomment this to bypass balance + //return iA; // uncomment this to bypass balance TNode *A = &_nodes[iA]; @@ -75,12 +75,12 @@ int32_t _logic_balance(int32_t iA, uint32_t p_tree_id) { return iA; } - /* A - / \ - B C - / \ / \ - D E F G - */ + /* A + * / \ + * B C + * / \ / \ + * D E F G + */ CRASH_COND(A->num_children != 2); int32_t iB = A->children[0]; diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp index 684814b1ae..8146ba9baf 100644 --- a/core/math/convex_hull.cpp +++ b/core/math/convex_hull.cpp @@ -735,8 +735,6 @@ int32_t ConvexHullInternal::Rational64::compare(const Rational64 &b) const { return 0; } - // return (numerator * b.denominator > b.numerator * denominator) ? sign : (numerator * b.denominator < b.numerator * denominator) ? -sign : 0; - #ifdef USE_X86_64_ASM int32_t result; @@ -757,10 +755,9 @@ int32_t ConvexHullInternal::Rational64::compare(const Rational64 &b) const { : "=&b"(result), [tmp] "=&r"(tmp), "=a"(dummy) : "a"(denominator), [bn] "g"(b.numerator), [tn] "g"(numerator), [bd] "g"(b.denominator) : "%rdx", "cc"); - return result ? result ^ sign // if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero) - // if sign is -1, all bits of result are inverted, which changes the sign of result (and again cannot result in zero) - : - 0; + // if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero) + // if sign is -1, all bits of result are inverted, which changes the sign of result (and again cannot result in zero) + return result ? result ^ sign : 0; #else diff --git a/core/math/face3.h b/core/math/face3.h index 9e9026e54e..0a8c1c6041 100644 --- a/core/math/face3.h +++ b/core/math/face3.h @@ -48,13 +48,13 @@ public: Vector3 vertex[3]; /** - * - * @param p_plane plane used to split the face - * @param p_res array of at least 3 faces, amount used in function return - * @param p_is_point_over array of at least 3 booleans, determining which face is over the plane, amount used in function return - * @param _epsilon constant used for numerical error rounding, to add "thickness" to the plane (so coplanar points can happen) - * @return amount of faces generated by the split, either 0 (means no split possible), 2 or 3 - */ + * + * @param p_plane plane used to split the face + * @param p_res array of at least 3 faces, amount used in function return + * @param p_is_point_over array of at least 3 booleans, determining which face is over the plane, amount used in function return + * @param _epsilon constant used for numerical error rounding, to add "thickness" to the plane (so coplanar points can happen) + * @return amount of faces generated by the split, either 0 (means no split possible), 2 or 3 + */ int split_by_plane(const Plane &p_plane, Face3 *p_res, bool *p_is_point_over) const; diff --git a/core/math/math_defs.h b/core/math/math_defs.h index c3a8f910c0..900e90a598 100644 --- a/core/math/math_defs.h +++ b/core/math/math_defs.h @@ -116,10 +116,10 @@ enum Corner { }; /** - * The "Real" type is an abstract type used for real numbers, such as 1.5, - * in contrast to integer numbers. Precision can be controlled with the - * presence or absence of the REAL_T_IS_DOUBLE define. - */ + * The "Real" type is an abstract type used for real numbers, such as 1.5, + * in contrast to integer numbers. Precision can be controlled with the + * presence or absence of the REAL_T_IS_DOUBLE define. + */ #ifdef REAL_T_IS_DOUBLE typedef double real_t; #else diff --git a/core/math/triangulate.cpp b/core/math/triangulate.cpp index fa1588dbc5..28f1d96b14 100644 --- a/core/math/triangulate.cpp +++ b/core/math/triangulate.cpp @@ -42,18 +42,13 @@ real_t Triangulate::get_area(const Vector<Vector2> &contour) { return A * 0.5; } -/* - is_inside_triangle decides if a point P is Inside of the triangle - defined by A, B, C. - */ - +/* `is_inside_triangle` decides if a point P is inside the triangle + * defined by A, B, C. */ bool Triangulate::is_inside_triangle(real_t Ax, real_t Ay, real_t Bx, real_t By, real_t Cx, real_t Cy, real_t Px, real_t Py, - bool include_edges) - -{ + bool include_edges) { real_t ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy; real_t cCROSSap, bCROSScp, aCROSSbp; diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 397743fb6e..8d6da31cf3 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -2317,28 +2317,33 @@ bool String::is_numeric() const { } template <class C> -static double built_in_strtod(const C *string, /* A decimal ASCII floating-point number, - * optionally preceded by white space. Must - * have form "-I.FE-X", where I is the integer - * part of the mantissa, F is the fractional - * part of the mantissa, and X is the - * exponent. Either of the signs may be "+", - * "-", or omitted. Either I or F may be - * omitted, or both. The decimal point isn't - * necessary unless F is present. The "E" may - * actually be an "e". E and X may both be - * omitted (but not just one). */ - C **endPtr = nullptr) /* If non-nullptr, store terminating Cacter's - * address here. */ -{ - static const int maxExponent = 511; /* Largest possible base 10 exponent. Any - * exponent larger than this will already - * produce underflow or overflow, so there's - * no need to worry about additional digits. - */ - static const double powersOf10[] = { /* Table giving binary powers of 10. Entry */ - 10., /* is 10^2^i. Used to convert decimal */ - 100., /* exponents into floating-point numbers. */ +static double built_in_strtod( + /* A decimal ASCII floating-point number, + * optionally preceded by white space. Must + * have form "-I.FE-X", where I is the integer + * part of the mantissa, F is the fractional + * part of the mantissa, and X is the + * exponent. Either of the signs may be "+", + * "-", or omitted. Either I or F may be + * omitted, or both. The decimal point isn't + * necessary unless F is present. The "E" may + * actually be an "e". E and X may both be + * omitted (but not just one). */ + const C *string, + /* If non-nullptr, store terminating Cacter's + * address here. */ + C **endPtr = nullptr) { + /* Largest possible base 10 exponent. Any + * exponent larger than this will already + * produce underflow or overflow, so there's + * no need to worry about additional digits. */ + static const int maxExponent = 511; + /* Table giving binary powers of 10. Entry + * is 10^2^i. Used to convert decimal + * exponents into floating-point numbers. */ + static const double powersOf10[] = { + 10., + 100., 1.0e4, 1.0e8, 1.0e16, @@ -2353,25 +2358,28 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point const double *d; const C *p; int c; - int exp = 0; /* Exponent read from "EX" field. */ - int fracExp = 0; /* Exponent that derives from the fractional - * part. Under normal circumstances, it is - * the negative of the number of digits in F. - * However, if I is very long, the last digits - * of I get dropped (otherwise a long I with a - * large negative exponent could cause an - * unnecessary overflow on I alone). In this - * case, fracExp is incremented one for each - * dropped digit. */ - int mantSize; /* Number of digits in mantissa. */ - int decPt; /* Number of mantissa digits BEFORE decimal - * point. */ - const C *pExp; /* Temporarily holds location of exponent in - * string. */ + /* Exponent read from "EX" field. */ + int exp = 0; + /* Exponent that derives from the fractional + * part. Under normal circumstances, it is + * the negative of the number of digits in F. + * However, if I is very long, the last digits + * of I get dropped (otherwise a long I with a + * large negative exponent could cause an + * unnecessary overflow on I alone). In this + * case, fracExp is incremented one for each + * dropped digit. */ + int fracExp = 0; + /* Number of digits in mantissa. */ + int mantSize; + /* Number of mantissa digits BEFORE decimal point. */ + int decPt; + /* Temporarily holds location of exponent in string. */ + const C *pExp; /* - * Strip off leading blanks and check for a sign. - */ + * Strip off leading blanks and check for a sign. + */ p = string; while (*p == ' ' || *p == '\t' || *p == '\n') { @@ -2388,9 +2396,9 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point } /* - * Count the number of digits in the mantissa (including the decimal - * point), and also locate the decimal point. - */ + * Count the number of digits in the mantissa (including the decimal + * point), and also locate the decimal point. + */ decPt = -1; for (mantSize = 0;; mantSize += 1) { @@ -2405,11 +2413,11 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point } /* - * Now suck up the digits in the mantissa. Use two integers to collect 9 - * digits each (this is faster than using floating-point). If the mantissa - * has more than 18 digits, ignore the extras, since they can't affect the - * value anyway. - */ + * Now suck up the digits in the mantissa. Use two integers to collect 9 + * digits each (this is faster than using floating-point). If the mantissa + * has more than 18 digits, ignore the extras, since they can't affect the + * value anyway. + */ pExp = p; p -= mantSize; @@ -2455,8 +2463,8 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point } /* - * Skim off the exponent. - */ + * Skim off the exponent. + */ p = pExp; if ((*p == 'E') || (*p == 'e')) { @@ -2486,10 +2494,10 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point } /* - * Generate a floating-point number that represents the exponent. Do this - * by processing the exponent one bit at a time to combine many powers of - * 2 of 10. Then combine the exponent with the fraction. - */ + * Generate a floating-point number that represents the exponent. Do this + * by processing the exponent one bit at a time to combine many powers of + * 2 of 10. Then combine the exponent with the fraction. + */ if (exp < 0) { expSign = true; diff --git a/core/templates/hash_map.h b/core/templates/hash_map.h index 1634219c23..45e0cc2427 100644 --- a/core/templates/hash_map.h +++ b/core/templates/hash_map.h @@ -53,7 +53,7 @@ * @param RELATIONSHIP Relationship at which the hash table is resized. if amount of elements is RELATIONSHIP * times bigger than the hash table, table is resized to solve this condition. if RELATIONSHIP is zero, table is always MIN_HASH_TABLE_POWER. * -*/ + */ template <class TKey, class TData, class Hasher = HashMapHasherDefault, class Comparator = HashMapComparatorDefault<TKey>, uint8_t MIN_HASH_TABLE_POWER = 3, uint8_t RELATIONSHIP = 8> class HashMap { @@ -458,8 +458,8 @@ public: * * print( *k ); * } - * - */ + * + */ const TKey *next(const TKey *p_key) const { if (unlikely(!hash_table)) { return nullptr; diff --git a/core/templates/list.h b/core/templates/list.h index c2e17a2f6f..afbed998c2 100644 --- a/core/templates/list.h +++ b/core/templates/list.h @@ -249,29 +249,29 @@ private: public: /** - * return a const iterator to the beginning of the list. - */ + * return a const iterator to the beginning of the list. + */ _FORCE_INLINE_ const Element *front() const { return _data ? _data->first : nullptr; } /** - * return an iterator to the beginning of the list. - */ + * return an iterator to the beginning of the list. + */ _FORCE_INLINE_ Element *front() { return _data ? _data->first : nullptr; } /** - * return a const iterator to the last member of the list. - */ + * return a const iterator to the last member of the list. + */ _FORCE_INLINE_ const Element *back() const { return _data ? _data->last : nullptr; } /** - * return an iterator to the last member of the list. - */ + * return an iterator to the last member of the list. + */ _FORCE_INLINE_ Element *back() { return _data ? _data->last : nullptr; } diff --git a/core/templates/vector.h b/core/templates/vector.h index 4b008a45a4..98982c80d3 100644 --- a/core/templates/vector.h +++ b/core/templates/vector.h @@ -35,7 +35,7 @@ * @class Vector * @author Juan Linietsky * Vector container. Regular Vector Container. Use with care and for smaller arrays when possible. Use Vector for large arrays. -*/ + */ #include "core/error/error_macros.h" #include "core/os/memory.h" |