From ca4ef8aa263a356a0e900ba81af4ff7e4207ddb9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 17 Feb 2012 17:47:10 +0000 Subject: add note to avoid confusion with angle_v3v3v3, also minor change with angle comparison, convert constant values to radians (not resulting angle to deg). --- source/blender/blenlib/intern/math_vector.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c index 47deb705def..ce9896b99cc 100644 --- a/source/blender/blenlib/intern/math_vector.c +++ b/source/blender/blenlib/intern/math_vector.c @@ -112,8 +112,12 @@ void mid_v3_v3v3(float v[3], const float v1[3], const float v2[3]) /********************************** Angles ***********************************/ /* Return the angle in radians between vecs 1-2 and 2-3 in radians - If v1 is a shoulder, v2 is the elbow and v3 is the hand, - this would return the angle at the elbow */ + * If v1 is a shoulder, v2 is the elbow and v3 is the hand, + * this would return the angle at the elbow. + * + * note that when v1/v2/v3 represent 3 points along a straight line + * that the angle returned will be pi (180deg), rather then 0.0 + */ float angle_v3v3v3(const float v1[3], const float v2[3], const float v3[3]) { float vec1[3], vec2[3]; -- cgit v1.2.3 From 2b7ca2304a9b17568fac57a0bceba72b9c9ab580 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 17 Feb 2012 18:59:41 +0000 Subject: unify include guard defines, __$FILENAME__ without the underscores these clogged up the namespace for autocompleation which was annoying. --- source/blender/blenlib/BLI_args.h | 4 ++-- source/blender/blenlib/BLI_blenlib.h | 4 ++-- source/blender/blenlib/BLI_boxpack2d.h | 4 ++-- source/blender/blenlib/BLI_bpath.h | 6 +++--- source/blender/blenlib/BLI_callbacks.h | 6 +++--- source/blender/blenlib/BLI_cpu.h | 4 ++-- source/blender/blenlib/BLI_dlrbTree.h | 6 +++--- source/blender/blenlib/BLI_dynstr.h | 4 ++-- source/blender/blenlib/BLI_edgehash.h | 4 ++-- source/blender/blenlib/BLI_editVert.h | 4 ++-- source/blender/blenlib/BLI_fileops.h | 4 ++-- source/blender/blenlib/BLI_fileops_types.h | 6 +++--- source/blender/blenlib/BLI_fnmatch.h | 6 +++--- source/blender/blenlib/BLI_ghash.h | 6 +++--- source/blender/blenlib/BLI_graph.h | 6 +++--- source/blender/blenlib/BLI_gsqueue.h | 6 +++--- source/blender/blenlib/BLI_heap.h | 4 ++-- source/blender/blenlib/BLI_jitter.h | 4 ++-- source/blender/blenlib/BLI_kdopbvh.h | 6 +++--- source/blender/blenlib/BLI_kdtree.h | 4 ++-- source/blender/blenlib/BLI_linklist.h | 4 ++-- source/blender/blenlib/BLI_listbase.h | 4 ++-- source/blender/blenlib/BLI_math.h | 6 +++--- source/blender/blenlib/BLI_math_base.h | 8 ++++---- source/blender/blenlib/BLI_math_color.h | 8 ++++---- source/blender/blenlib/BLI_math_geom.h | 8 ++++---- source/blender/blenlib/BLI_math_inline.h | 10 +++++----- source/blender/blenlib/BLI_math_matrix.h | 6 +++--- source/blender/blenlib/BLI_math_rotation.h | 6 +++--- source/blender/blenlib/BLI_math_vector.h | 8 ++++---- source/blender/blenlib/BLI_md5.h | 4 ++-- source/blender/blenlib/BLI_memarena.h | 4 ++-- source/blender/blenlib/BLI_mempool.h | 4 ++-- source/blender/blenlib/BLI_noise.h | 4 ++-- source/blender/blenlib/BLI_path_util.h | 4 ++-- source/blender/blenlib/BLI_pbvh.h | 6 +++--- source/blender/blenlib/BLI_rand.h | 4 ++-- source/blender/blenlib/BLI_rect.h | 4 ++-- source/blender/blenlib/BLI_scanfill.h | 4 ++-- source/blender/blenlib/BLI_string.h | 4 ++-- source/blender/blenlib/BLI_string_utf8.h | 4 ++-- source/blender/blenlib/BLI_threads.h | 4 ++-- source/blender/blenlib/BLI_utildefines.h | 6 +++--- source/blender/blenlib/BLI_uvproject.h | 4 ++-- source/blender/blenlib/BLI_vfontdata.h | 4 ++-- source/blender/blenlib/BLI_voxel.h | 6 +++--- source/blender/blenlib/BLI_winstuff.h | 6 +++--- source/blender/blenlib/PIL_time.h | 6 +++--- source/blender/blenlib/intern/dynamiclist.h | 4 ++-- 49 files changed, 126 insertions(+), 126 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h index 3b8b60be1b9..7a7529fa3c3 100644 --- a/source/blender/blenlib/BLI_args.h +++ b/source/blender/blenlib/BLI_args.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_ARGS_H -#define BLI_ARGS_H +#ifndef __BLI_ARGS_H__ +#define __BLI_ARGS_H__ /** \file BLI_args.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index 515c2444e80..c802b083f1f 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -55,8 +55,8 @@ * standard libraries. */ -#ifndef BLI_BLENLIB_H -#define BLI_BLENLIB_H +#ifndef __BLI_BLENLIB_H__ +#define __BLI_BLENLIB_H__ struct ListBase; diff --git a/source/blender/blenlib/BLI_boxpack2d.h b/source/blender/blenlib/BLI_boxpack2d.h index 886965f66b3..7f92047b312 100644 --- a/source/blender/blenlib/BLI_boxpack2d.h +++ b/source/blender/blenlib/BLI_boxpack2d.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef _BLI_BOXPACK2D_H_ -#define _BLI_BOXPACK2D_H_ +#ifndef __BLI_BOXPACK2D_H__ +#define __BLI_BOXPACK2D_H__ /** \file BLI_boxpack2d.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h index e850db5a171..f1639bdb3c1 100644 --- a/source/blender/blenlib/BLI_bpath.h +++ b/source/blender/blenlib/BLI_bpath.h @@ -31,8 +31,8 @@ * so for BPath we dont need to malloc */ -#ifndef BLI_BPATH_H -#define BLI_BPATH_H +#ifndef __BLI_BPATH_H__ +#define __BLI_BPATH_H__ struct ID; struct ListBase; @@ -64,4 +64,4 @@ void makeFilesRelative(struct Main *bmain, const char *basedir, struct ReportLis void makeFilesAbsolute(struct Main *bmain, const char *basedir, struct ReportList *reports); void findMissingFiles(struct Main *bmain, const char *searchpath, struct ReportList *reports); -#endif // BLI_BPATH_H +#endif // __BLI_BPATH_H__ diff --git a/source/blender/blenlib/BLI_callbacks.h b/source/blender/blenlib/BLI_callbacks.h index 201ada45acf..f4f92a0cbee 100644 --- a/source/blender/blenlib/BLI_callbacks.h +++ b/source/blender/blenlib/BLI_callbacks.h @@ -29,8 +29,8 @@ * \ingroup bli */ -#ifndef BLI_CALLBACKS_H -#define BLI_CALLBACKS_H +#ifndef __BLI_CALLBACKS_H__ +#define __BLI_CALLBACKS_H__ struct bContext; struct Main; @@ -70,4 +70,4 @@ void BLI_cb_finalize(void); /* This is blenlib internal only, unrelated to above */ void callLocalErrorCallBack(const char* msg); -#endif /* BLI_CALLBACKS_H */ +#endif /* __BLI_CALLBACKS_H__ */ diff --git a/source/blender/blenlib/BLI_cpu.h b/source/blender/blenlib/BLI_cpu.h index de04a2a6cc6..fa29162e59e 100644 --- a/source/blender/blenlib/BLI_cpu.h +++ b/source/blender/blenlib/BLI_cpu.h @@ -18,8 +18,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_CPU_H -#define BLI_CPU_H +#ifndef __BLI_CPU_H__ +#define __BLI_CPU_H__ /** \file BLI_cpu.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h index cde2058b200..bad74a1e5a8 100644 --- a/source/blender/blenlib/BLI_dlrbTree.h +++ b/source/blender/blenlib/BLI_dlrbTree.h @@ -23,8 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_DLRB_TREE_H -#define BLI_DLRB_TREE_H +#ifndef __BLI_DLRBTREE_H__ +#define __BLI_DLRBTREE_H__ /** \file BLI_dlrbTree.h * \ingroup bli @@ -158,4 +158,4 @@ void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node); /* ********************************************** */ -#endif // BLI_DLRB_TREE_H +#endif // __BLI_DLRBTREE_H__ diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h index 32c4e012d1d..6b499c3bbcf 100644 --- a/source/blender/blenlib/BLI_dynstr.h +++ b/source/blender/blenlib/BLI_dynstr.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_DYNSTR_H -#define BLI_DYNSTR_H +#ifndef __BLI_DYNSTR_H__ +#define __BLI_DYNSTR_H__ /** \file BLI_dynstr.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h index 9153155e359..b00ac683eb1 100644 --- a/source/blender/blenlib/BLI_edgehash.h +++ b/source/blender/blenlib/BLI_edgehash.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_EDGEHASH_H -#define BLI_EDGEHASH_H +#ifndef __BLI_EDGEHASH_H__ +#define __BLI_EDGEHASH_H__ /** \file BLI_edgehash.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h index 0ddea230b84..b5096abc5bc 100644 --- a/source/blender/blenlib/BLI_editVert.h +++ b/source/blender/blenlib/BLI_editVert.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_EDITVERT_H -#define BLI_EDITVERT_H +#ifndef __BLI_EDITVERT_H__ +#define __BLI_EDITVERT_H__ /** \file BLI_editVert.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index 2e8f1a5512e..8fe8456e845 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -30,8 +30,8 @@ * \brief File and directory operations. * */ -#ifndef BLI_FILEOPS_H -#define BLI_FILEOPS_H +#ifndef __BLI_FILEOPS_H__ +#define __BLI_FILEOPS_H__ #ifdef __cplusplus extern "C" { diff --git a/source/blender/blenlib/BLI_fileops_types.h b/source/blender/blenlib/BLI_fileops_types.h index 443ba654cb6..8e4b5b3e411 100644 --- a/source/blender/blenlib/BLI_fileops_types.h +++ b/source/blender/blenlib/BLI_fileops_types.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_FILEOPS_TYPES_H -#define BLI_FILEOPS_TYPES_H +#ifndef __BLI_FILEOPS_TYPES_H__ +#define __BLI_FILEOPS_TYPES_H__ /** \file BLI_fileops_types.h * \ingroup bli @@ -74,5 +74,5 @@ struct dirlink char *name; }; -#endif /* BLI_FILEOPS_TYPES_H */ +#endif /* __BLI_FILEOPS_TYPES_H__ */ diff --git a/source/blender/blenlib/BLI_fnmatch.h b/source/blender/blenlib/BLI_fnmatch.h index ac8960ff9c9..711d1aa756b 100644 --- a/source/blender/blenlib/BLI_fnmatch.h +++ b/source/blender/blenlib/BLI_fnmatch.h @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _FNMATCH_H -#define _FNMATCH_H 1 +#ifndef __BLI_FNMATCH_H__ +#define __BLI_FNMATCH_H__ /** \file BLI_fnmatch.h * \ingroup bli @@ -69,4 +69,4 @@ extern int fnmatch __P ((const char *__pattern, const char *__string, } #endif -#endif /* fnmatch.h */ +#endif /* __BLI_FNMATCH_H__ */ diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index f2a7e73e5e0..ccad3250a5f 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_GHASH_H -#define BLI_GHASH_H +#ifndef __BLI_GHASH_H__ +#define __BLI_GHASH_H__ /** \file BLI_ghash.h * \ingroup bli @@ -156,4 +156,4 @@ void BLI_ghashutil_pairfree (void *ptr); } #endif -#endif /* BLI_GHASH_H */ +#endif /* __BLI_GHASH_H__ */ diff --git a/source/blender/blenlib/BLI_graph.h b/source/blender/blenlib/BLI_graph.h index 056bba71dea..5995daebc61 100644 --- a/source/blender/blenlib/BLI_graph.h +++ b/source/blender/blenlib/BLI_graph.h @@ -22,8 +22,8 @@ * * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_GRAPH_H_ -#define BLI_GRAPH_H_ +#ifndef __BLI_GRAPH_H__ +#define __BLI_GRAPH_H__ /** \file BLI_graph.h * \ingroup bli @@ -184,4 +184,4 @@ void BLI_mirrorAlongAxis(float v[3], float center[3], float axis[3]); /* Anything higher is the order in radial symmetry */ #define SYM_SIDE_RADIAL 3 -#endif /*BLI_GRAPH_H_*/ +#endif /*__BLI_GRAPH_H__*/ diff --git a/source/blender/blenlib/BLI_gsqueue.h b/source/blender/blenlib/BLI_gsqueue.h index 425ecb79899..53fdb5a541a 100644 --- a/source/blender/blenlib/BLI_gsqueue.h +++ b/source/blender/blenlib/BLI_gsqueue.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_GSQUEUE_H -#define BLI_GSQUEUE_H +#ifndef __BLI_GSQUEUE_H__ +#define __BLI_GSQUEUE_H__ /** \file BLI_gsqueue.h * \ingroup bli @@ -95,5 +95,5 @@ void BLI_gsqueue_pushback (GSQueue *gq, void *item); */ void BLI_gsqueue_free (GSQueue *gq); -#endif /* BLI_GSQUEUE_H */ +#endif /* __BLI_GSQUEUE_H__ */ diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h index 0124c997d91..5c67bf52b9a 100644 --- a/source/blender/blenlib/BLI_heap.h +++ b/source/blender/blenlib/BLI_heap.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_HEAP_H -#define BLI_HEAP_H +#ifndef __BLI_HEAP_H__ +#define __BLI_HEAP_H__ /** \file BLI_heap.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_jitter.h b/source/blender/blenlib/BLI_jitter.h index f432a51de9f..9aa21a89521 100644 --- a/source/blender/blenlib/BLI_jitter.h +++ b/source/blender/blenlib/BLI_jitter.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_JITTER_H -#define BLI_JITTER_H +#ifndef __BLI_JITTER_H__ +#define __BLI_JITTER_H__ /** \file BLI_jitter.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 8ead7bf5f17..ff3017fef03 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -26,8 +26,8 @@ */ -#ifndef BLI_KDOPBVH_H -#define BLI_KDOPBVH_H +#ifndef __BLI_KDOPBVH_H__ +#define __BLI_KDOPBVH_H__ /** \file BLI_kdopbvh.h * \ingroup bli @@ -111,5 +111,5 @@ int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHT } #endif -#endif // BLI_KDOPBVH_H +#endif // __BLI_KDOPBVH_H__ diff --git a/source/blender/blenlib/BLI_kdtree.h b/source/blender/blenlib/BLI_kdtree.h index 9ffc64e8812..0ec514b4480 100644 --- a/source/blender/blenlib/BLI_kdtree.h +++ b/source/blender/blenlib/BLI_kdtree.h @@ -26,8 +26,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_KDTREE_H -#define BLI_KDTREE_H +#ifndef __BLI_KDTREE_H__ +#define __BLI_KDTREE_H__ /** \file BLI_kdtree.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_linklist.h b/source/blender/blenlib/BLI_linklist.h index 6886dff0da3..664beb4eb98 100644 --- a/source/blender/blenlib/BLI_linklist.h +++ b/source/blender/blenlib/BLI_linklist.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_LINKLIST_H -#define BLI_LINKLIST_H +#ifndef __BLI_LINKLIST_H__ +#define __BLI_LINKLIST_H__ /** \file BLI_linklist.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h index 88ee79d7b97..b0a5e80d850 100644 --- a/source/blender/blenlib/BLI_listbase.h +++ b/source/blender/blenlib/BLI_listbase.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_LISTBASE_H -#define BLI_LISTBASE_H +#ifndef __BLI_LISTBASE_H__ +#define __BLI_LISTBASE_H__ /** \file BLI_listbase.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_math.h b/source/blender/blenlib/BLI_math.h index 1fe700492be..89c37daae84 100644 --- a/source/blender/blenlib/BLI_math.h +++ b/source/blender/blenlib/BLI_math.h @@ -23,8 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#ifndef BLI_MATH_H -#define BLI_MATH_H +#ifndef __BLI_MATH_H__ +#define __BLI_MATH_H__ /** \file BLI_math.h * \ingroup bli @@ -59,5 +59,5 @@ #include "BLI_math_vector.h" #include "BLI_math_geom.h" -#endif /* BLI_MATH_H */ +#endif /* __BLI_MATH_H__ */ diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index 53db77dc203..d0a1311f2bc 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -23,8 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#ifndef BLI_MATH_BASE_H -#define BLI_MATH_BASE_H +#ifndef __BLI_MATH_BASE_H__ +#define __BLI_MATH_BASE_H__ /** \file BLI_math_base.h * \ingroup bli @@ -142,7 +142,7 @@ #define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c) #endif -#ifdef BLI_MATH_INLINE_H +#ifdef __BLI_MATH_INLINE_H__ #include "intern/math_base_inline.c" #endif @@ -181,5 +181,5 @@ extern double round(double x); double double_round(double x, int ndigits); -#endif /* BLI_MATH_BASE_H */ +#endif /* __BLI_MATH_BASE_H__ */ diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index f4d6882b5d8..4771fdbcb69 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -23,8 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#ifndef BLI_MATH_COLOR_H -#define BLI_MATH_COLOR_H +#ifndef __BLI_MATH_COLOR_H__ +#define __BLI_MATH_COLOR_H__ /** \file BLI_math_color.h * \ingroup bli @@ -113,7 +113,7 @@ void rgba_float_to_uchar(unsigned char col_r[4], const float col_f[4]); void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power); -#ifdef BLI_MATH_INLINE_H +#ifdef __BLI_MATH_INLINE_H__ #include "intern/math_color_inline.c" #endif @@ -121,5 +121,5 @@ void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *o } #endif -#endif /* BLI_MATH_COLOR_H */ +#endif /* __BLI_MATH_COLOR_H__ */ diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 8d18f5253c4..61e34b7cb75 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -23,8 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#ifndef BLI_MATH_GEOM_H -#define BLI_MATH_GEOM_H +#ifndef __BLI_MATH_GEOM_H__ +#define __BLI_MATH_GEOM_H__ /** \file BLI_math_geom.h * \ingroup bli @@ -36,7 +36,7 @@ extern "C" { #include "BLI_math_inline.h" -#ifdef BLI_MATH_INLINE_H +#ifdef __BLI_MATH_INLINE_H__ #include "intern/math_geom_inline.c" #endif @@ -273,5 +273,5 @@ void axis_dominant_v3(int *axis_a, int *axis_b, const float axis[3]); } #endif -#endif /* BLI_MATH_GEOM_H */ +#endif /* __BLI_MATH_GEOM_H__ */ diff --git a/source/blender/blenlib/BLI_math_inline.h b/source/blender/blenlib/BLI_math_inline.h index 83aeb6cb735..fcc5fb744bb 100644 --- a/source/blender/blenlib/BLI_math_inline.h +++ b/source/blender/blenlib/BLI_math_inline.h @@ -23,8 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#ifndef BLI_MATH_INLINE_H -#define BLI_MATH_INLINE_H +#ifndef __BLI_MATH_INLINE_H__ +#define __BLI_MATH_INLINE_H__ /** \file BLI_math_inline.h * \ingroup bli @@ -35,9 +35,9 @@ extern "C" { #endif /* add platform/compiler checks here if it is not supported */ -#define BLI_MATH_INLINE_H +#define __BLI_MATH_INLINE_H__ -#ifdef BLI_MATH_INLINE_H +#ifdef __BLI_MATH_INLINE_H__ #ifdef _MSC_VER #define MINLINE static __forceinline #define MALWAYS_INLINE MINLINE @@ -59,5 +59,5 @@ extern "C" { } #endif -#endif /* BLI_MATH_INLINE_H */ +#endif /* __BLI_MATH_INLINE_H__ */ diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index 4d3a4dfe445..8c19941e18c 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -23,8 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#ifndef BLI_MATH_MATRIX_H -#define BLI_MATH_MATRIX_H +#ifndef __BLI_MATH_MATRIX_H__ +#define __BLI_MATH_MATRIX_H__ /** \file BLI_math_matrix.h * \ingroup bli @@ -179,5 +179,5 @@ void print_m4(const char *str, float M[3][4]); } #endif -#endif /* BLI_MATH_MATRIX_H */ +#endif /* __BLI_MATH_MATRIX_H__ */ diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h index fca7c3469a1..62b81530c65 100644 --- a/source/blender/blenlib/BLI_math_rotation.h +++ b/source/blender/blenlib/BLI_math_rotation.h @@ -23,8 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#ifndef BLI_MATH_ROTATION_H -#define BLI_MATH_ROTATION_H +#ifndef __BLI_MATH_ROTATION_H__ +#define __BLI_MATH_ROTATION_H__ /** \file BLI_math_rotation.h * \ingroup bli @@ -189,5 +189,5 @@ float angle_wrap_deg(float angle); } #endif -#endif /* BLI_MATH_ROTATION_H */ +#endif /* __BLI_MATH_ROTATION_H__ */ diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 12a0b1892a1..af8b52a7edf 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -23,8 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#ifndef BLI_MATH_VECTOR_H -#define BLI_MATH_VECTOR_H +#ifndef __BLI_MATH_VECTOR_H__ +#define __BLI_MATH_VECTOR_H__ /** \file BLI_math_vector.h * \ingroup bli @@ -36,7 +36,7 @@ extern "C" { #include "BLI_math_inline.h" -#ifdef BLI_MATH_INLINE_H +#ifdef __BLI_MATH_INLINE_H__ #include "intern/math_vector_inline.c" #endif @@ -216,5 +216,5 @@ void fill_vn_fl(float *array_tar, const int size, const float val); } #endif -#endif /* BLI_MATH_VECTOR_H */ +#endif /* __BLI_MATH_VECTOR_H__ */ diff --git a/source/blender/blenlib/BLI_md5.h b/source/blender/blenlib/BLI_md5.h index afcc3cdfa3e..51211d548cd 100644 --- a/source/blender/blenlib/BLI_md5.h +++ b/source/blender/blenlib/BLI_md5.h @@ -18,8 +18,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_MD5_H -#define BLI_MD5_H +#ifndef __BLI_MD5_H__ +#define __BLI_MD5_H__ /** \file BLI_md5.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_memarena.h b/source/blender/blenlib/BLI_memarena.h index ceb7b17f7ef..8306a69e567 100644 --- a/source/blender/blenlib/BLI_memarena.h +++ b/source/blender/blenlib/BLI_memarena.h @@ -35,8 +35,8 @@ * data, which are all freed at the same moment. */ -#ifndef BLI_MEMARENA_H -#define BLI_MEMARENA_H +#ifndef __BLI_MEMARENA_H__ +#define __BLI_MEMARENA_H__ #ifdef __cplusplus extern "C" { diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h index 77896709285..d80d46e9ae5 100644 --- a/source/blender/blenlib/BLI_mempool.h +++ b/source/blender/blenlib/BLI_mempool.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_MEMPOOL_H -#define BLI_MEMPOOL_H +#ifndef __BLI_MEMPOOL_H__ +#define __BLI_MEMPOOL_H__ /** \file BLI_mempool.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_noise.h b/source/blender/blenlib/BLI_noise.h index de2efb18216..9f5475ced25 100644 --- a/source/blender/blenlib/BLI_noise.h +++ b/source/blender/blenlib/BLI_noise.h @@ -26,8 +26,8 @@ * */ -#ifndef BLI_NOISE_H -#define BLI_NOISE_H +#ifndef __BLI_NOISE_H__ +#define __BLI_NOISE_H__ /** \file BLI_noise.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 68bb1a7280d..a2d432b492a 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -24,8 +24,8 @@ * * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_PATH_UTIL_H -#define BLI_PATH_UTIL_H +#ifndef __BLI_PATH_UTIL_H__ +#define __BLI_PATH_UTIL_H__ /** \file BLI_path_util.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h index e17a37c0a12..ef32ec03a61 100644 --- a/source/blender/blenlib/BLI_pbvh.h +++ b/source/blender/blenlib/BLI_pbvh.h @@ -18,8 +18,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_PBVH_H -#define BLI_PBVH_H +#ifndef __BLI_PBVH_H__ +#define __BLI_PBVH_H__ /** \file BLI_pbvh.h * \ingroup bli @@ -246,5 +246,5 @@ void BLI_pbvh_gather_proxies(PBVH* pbvh, PBVHNode*** nodes, int* totnode); //void BLI_pbvh_node_BB_reset(PBVHNode* node); //void BLI_pbvh_node_BB_expand(PBVHNode* node, float co[3]); -#endif /* BLI_PBVH_H */ +#endif /* __BLI_PBVH_H__ */ diff --git a/source/blender/blenlib/BLI_rand.h b/source/blender/blenlib/BLI_rand.h index 7ce0031bcf9..1749bbcc38a 100644 --- a/source/blender/blenlib/BLI_rand.h +++ b/source/blender/blenlib/BLI_rand.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_RAND_H -#define BLI_RAND_H +#ifndef __BLI_RAND_H__ +#define __BLI_RAND_H__ /** \file BLI_rand.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h index 25b7f193105..4ff203737a0 100644 --- a/source/blender/blenlib/BLI_rect.h +++ b/source/blender/blenlib/BLI_rect.h @@ -26,8 +26,8 @@ * */ -#ifndef BLI_RECT_H -#define BLI_RECT_H +#ifndef __BLI_RECT_H__ +#define __BLI_RECT_H__ /** \file BLI_rect.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h index 8af98b2d348..5c788bc6bb7 100644 --- a/source/blender/blenlib/BLI_scanfill.h +++ b/source/blender/blenlib/BLI_scanfill.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_SCANFILL_H -#define BLI_SCANFILL_H +#ifndef __BLI_SCANFILL_H__ +#define __BLI_SCANFILL_H__ /** \file BLI_scanfill.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index 46389a9259e..25eb2ebecc2 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_STRING_H -#define BLI_STRING_H +#ifndef __BLI_STRING_H__ +#define __BLI_STRING_H__ /** \file BLI_string.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index 6eba7d5eb49..7799c32c4b7 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -20,8 +20,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_STRING_UTF8_H -#define BLI_STRING_UTF8_H +#ifndef __BLI_STRING_UTF8_H__ +#define __BLI_STRING_UTF8_H__ /** \file BLI_string_utf8.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index a513b9f9e85..8e75a2db629 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -27,8 +27,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_THREADS_H -#define BLI_THREADS_H +#ifndef __BLI_THREADS_H__ +#define __BLI_THREADS_H__ /** \file BLI_threads.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 6d9188c1848..4a5ccd311c6 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_UTILDEFINES_H -#define BLI_UTILDEFINES_H +#ifndef __BLI_UTILDEFINES_H__ +#define __BLI_UTILDEFINES_H__ /** \file BLI_utildefines.h * \ingroup bli @@ -310,4 +310,4 @@ # define UNLIKELY(x) (x) #endif -#endif // BLI_UTILDEFINES_H +#endif // __BLI_UTILDEFINES_H__ diff --git a/source/blender/blenlib/BLI_uvproject.h b/source/blender/blenlib/BLI_uvproject.h index d4a34a9e290..5abad87452c 100644 --- a/source/blender/blenlib/BLI_uvproject.h +++ b/source/blender/blenlib/BLI_uvproject.h @@ -17,8 +17,8 @@ * * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BKE_UVPROJECT_H -#define BKE_UVPROJECT_H +#ifndef __BLI_UVPROJECT_H__ +#define __BLI_UVPROJECT_H__ /** \file BLI_uvproject.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_vfontdata.h b/source/blender/blenlib/BLI_vfontdata.h index e858e784991..5f7b7c39036 100644 --- a/source/blender/blenlib/BLI_vfontdata.h +++ b/source/blender/blenlib/BLI_vfontdata.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_VFONTDATA_H -#define BLI_VFONTDATA_H +#ifndef __BLI_VFONTDATA_H__ +#define __BLI_VFONTDATA_H__ /** \file BLI_vfontdata.h * \ingroup bli diff --git a/source/blender/blenlib/BLI_voxel.h b/source/blender/blenlib/BLI_voxel.h index 8dd95a897ae..4a13810a705 100644 --- a/source/blender/blenlib/BLI_voxel.h +++ b/source/blender/blenlib/BLI_voxel.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BLI_VOXEL_H -#define BLI_VOXEL_H +#ifndef __BLI_VOXEL_H__ +#define __BLI_VOXEL_H__ /** \file BLI_voxel.h * \ingroup bli @@ -41,4 +41,4 @@ float voxel_sample_trilinear(float *data, const int res[3], const float co[3]); float voxel_sample_triquadratic(float *data, const int res[3], const float co[3]); float voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline); -#endif /* BLI_VOXEL_H */ +#endif /* __BLI_VOXEL_H__ */ diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index 0eb2f86b668..d939882b105 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -25,8 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef __WINSTUFF_H__ -#define __WINSTUFF_H__ +#ifndef __BLI_WINSTUFF_H__ +#define __BLI_WINSTUFF_H__ /** \file BLI_winstuff.h * \ingroup bli @@ -150,5 +150,5 @@ int BLI_getInstallationDir(char *str); #endif /* _WIN32 */ -#endif /* __WINSTUFF_H__ */ +#endif /* __BLI_WINSTUFF_H__ */ diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h index 0a777a80b2a..fa2ad8644e9 100644 --- a/source/blender/blenlib/PIL_time.h +++ b/source/blender/blenlib/PIL_time.h @@ -32,8 +32,8 @@ */ -#ifndef PIL_TIME_H -#define PIL_TIME_H +#ifndef __PIL_TIME_H__ +#define __PIL_TIME_H__ #ifdef __cplusplus extern "C" { @@ -78,4 +78,4 @@ void PIL_sleep_ms (int ms); } #endif -#endif /* !PIL_TIME_H */ +#endif /* !__PIL_TIME_H__ */ diff --git a/source/blender/blenlib/intern/dynamiclist.h b/source/blender/blenlib/intern/dynamiclist.h index 83b5aac963c..64c4a8fd61a 100644 --- a/source/blender/blenlib/intern/dynamiclist.h +++ b/source/blender/blenlib/intern/dynamiclist.h @@ -29,8 +29,8 @@ */ -#ifndef B_DYNAMIC_LIST_H -#define B_DYNAMIC_LIST_H +#ifndef __DYNAMICLIST_H__ +#define __DYNAMICLIST_H__ #define PAGE_SIZE 4 -- cgit v1.2.3 From 61596d5bb365a96b4b19adf0ef72ec1ea47212aa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 17 Feb 2012 19:21:47 +0000 Subject: patch [#30227] Various MSVC (32-bit) Warning and Typo Fixes made some small edits - removed changes to AVI reading since the data types are apart of the format spec. - absf -> abs for a double value in render code. --- source/blender/blenlib/BLI_utildefines.h | 11 +++++++---- source/blender/blenlib/intern/math_color_inline.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 4a5ccd311c6..ef8a6015adb 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -225,10 +225,13 @@ #define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i)) /* Macro to convert a value to string in the preprocessor - * STRINGIFY_ARG: gives the defined name in the string - * STRINGIFY: gives the defined value. */ -#define STRINGIFY_ARG(x) #x -#define STRINGIFY(x) STRINGIFY_ARG(x) + * STRINGIFY_ARG: gives the argument as a string + * STRINGIFY_APPEND: appends any argument 'b' onto the string argument 'a', + * used by STRINGIFY because some preprocessors warn about zero arguments + * STRINGIFY: gives the argument's value as a string */ +#define STRINGIFY_ARG(x) "" #x +#define STRINGIFY_APPEND(a, b) "" a #b +#define STRINGIFY(x) STRINGIFY_APPEND("", x) /* useful for debugging */ #define AT __FILE__ ":" STRINGIFY(__LINE__) diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c index 386452ed592..f8b986e799b 100644 --- a/source/blender/blenlib/intern/math_color_inline.c +++ b/source/blender/blenlib/intern/math_color_inline.c @@ -163,7 +163,7 @@ MINLINE void linearrgb_to_srgb_ushort4_predivide(unsigned short srgb[4], const f for(i=0; i<3; ++i) { t = linear[i] * inv_alpha; - srgb[i] = (t < 1.0f)? to_srgb_table_lookup(t) * alpha : FTOUSHORT(linearrgb_to_srgb(t) * alpha); + srgb[i] = (t < 1.0f)? (unsigned short)(to_srgb_table_lookup(t) * alpha) : FTOUSHORT(linearrgb_to_srgb(t) * alpha); } srgb[3] = FTOUSHORT(linear[3]); -- cgit v1.2.3