[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47493] branches/soc-2012-swiss_cheese/ source/blender/blenlib: Patch [#30962] Change inline math source files to header files
Jason Wilkins
Jason.A.Wilkins at gmail.com
Wed Jun 6 05:24:16 CEST 2012
Revision: 47493
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47493
Author: jwilkins
Date: 2012-06-06 03:24:02 +0000 (Wed, 06 Jun 2012)
Log Message:
-----------
Patch [#30962] Change inline math source files to header files
There is a linker warning generated because the following files have no externally linkable symbols:
math_base_inline.c
math_color_inline.c
math_geom_inline.c
math_vector_inline.c
This patch just removes them from the build process so the compiler does not waste time or generate a warning.
The scons build does not appear to need any changes.
Modified Paths:
--------------
branches/soc-2012-swiss_cheese/source/blender/blenlib/CMakeLists.txt
Added Paths:
-----------
branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_base_inline.h
branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_color_inline.h
branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_geom_inline.h
branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_vector_inline.h
Removed Paths:
-------------
branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_base_inline.c
branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_color_inline.c
branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_geom_inline.c
branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_vector_inline.c
Modified: branches/soc-2012-swiss_cheese/source/blender/blenlib/CMakeLists.txt
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/blenlib/CMakeLists.txt 2012-06-06 01:39:20 UTC (rev 47492)
+++ branches/soc-2012-swiss_cheese/source/blender/blenlib/CMakeLists.txt 2012-06-06 03:24:02 UTC (rev 47493)
@@ -64,15 +64,11 @@
intern/lasso.c
intern/listbase.c
intern/math_base.c
- intern/math_base_inline.c
intern/math_color.c
- intern/math_color_inline.c
intern/math_geom.c
- intern/math_geom_inline.c
intern/math_matrix.c
intern/math_rotation.c
intern/math_vector.c
- intern/math_vector_inline.c
intern/md5.c
intern/noise.c
intern/path_util.c
@@ -91,6 +87,11 @@
intern/voxel.c
intern/winstuff.c
+ intern/math_base_inline.h
+ intern/math_color_inline.h
+ intern/math_geom_inline.h
+ intern/math_vector_inline.h
+
BLI_args.h
BLI_array.h
BLI_bitmap.h
Deleted: branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_base_inline.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_base_inline.c 2012-06-06 01:39:20 UTC (rev 47492)
+++ branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_base_inline.c 2012-06-06 03:24:02 UTC (rev 47493)
@@ -1,158 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * 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.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: some of this file.
- *
- * ***** END GPL LICENSE BLOCK *****
- * */
-
-/** \file blender/blenlib/intern/math_base_inline.c
- * \ingroup bli
- */
-
-
-#include <float.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "BLI_math.h"
-
-#ifndef __MATH_BASE_INLINE_C__
-#define __MATH_BASE_INLINE_C__
-
-/* A few small defines. Keep'em local! */
-#define SMALL_NUMBER 1.e-8f
-
-MINLINE float sqrt3f(float f)
-{
- if (f == 0.0f) return 0.0f;
- if (f < 0) return (float)(-exp(log(-f) / 3));
- else return (float)(exp(log(f) / 3));
-}
-
-MINLINE double sqrt3d(double d)
-{
- if (d == 0.0) return 0;
- if (d < 0) return -exp(log(-d) / 3);
- else return exp(log(d) / 3);
-}
-
-MINLINE float saacos(float fac)
-{
- if (fac <= -1.0f) return (float)M_PI;
- else if (fac >= 1.0f) return 0.0;
- else return (float)acos(fac);
-}
-
-MINLINE float saasin(float fac)
-{
- if (fac <= -1.0f) return (float)-M_PI / 2.0f;
- else if (fac >= 1.0f) return (float)M_PI / 2.0f;
- else return (float)asin(fac);
-}
-
-MINLINE float sasqrt(float fac)
-{
- if (fac <= 0.0f) return 0.0f;
- return (float)sqrt(fac);
-}
-
-MINLINE float saacosf(float fac)
-{
- if (fac <= -1.0f) return (float)M_PI;
- else if (fac >= 1.0f) return 0.0f;
- else return (float)acosf(fac);
-}
-
-MINLINE float saasinf(float fac)
-{
- if (fac <= -1.0f) return (float)-M_PI / 2.0f;
- else if (fac >= 1.0f) return (float)M_PI / 2.0f;
- else return (float)asinf(fac);
-}
-
-MINLINE float sasqrtf(float fac)
-{
- if (fac <= 0.0f) return 0.0f;
- return sqrtf(fac);
-}
-
-MINLINE float interpf(float target, float origin, float fac)
-{
- return (fac * target) + (1.0f - fac) * origin;
-}
-
-/* useful to calculate an even width shell, by taking the angle between 2 planes.
- * The return value is a scale on the offset.
- * no angle between planes is 1.0, as the angle between the 2 planes approaches 180d
- * the distance gets very high, 180d would be inf, but this case isn't valid */
-MINLINE float shell_angle_to_dist(const float angle)
-{
- return (angle < SMALL_NUMBER) ? 1.0f : fabsf(1.0f / cosf(angle));
-}
-
-/* used for zoom values*/
-MINLINE float power_of_2(float val)
-{
- return (float)pow(2.0, ceil(log((double)val) / M_LN2));
-}
-
-MINLINE int is_power_of_2_i(int n)
-{
- return (n & (n - 1)) == 0;
-}
-
-MINLINE int power_of_2_max_i(int n)
-{
- if (is_power_of_2_i(n))
- return n;
-
- while (!is_power_of_2_i(n))
- n = n & (n - 1);
-
- return n * 2;
-}
-
-MINLINE int power_of_2_min_i(int n)
-{
- while (!is_power_of_2_i(n))
- n = n & (n - 1);
-
- return n;
-}
-
-MINLINE float minf(float a, float b)
-{
- return (a < b) ? a : b;
-}
-
-MINLINE float maxf(float a, float b)
-{
- return (a > b) ? a : b;
-}
-
-MINLINE float signf(float f)
-{
- return (f < 0.f) ? -1.f : 1.f;
-}
-
-
-#endif /* __MATH_BASE_INLINE_C__ */
Copied: branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_base_inline.h (from rev 47388, branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_base_inline.c)
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_base_inline.h (rev 0)
+++ branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_base_inline.h 2012-06-06 03:24:02 UTC (rev 47493)
@@ -0,0 +1,158 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: some of this file.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ * */
+
+/** \file blender/blenlib/intern/math_base_inline.h
+ * \ingroup bli
+ */
+
+
+#include <float.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "BLI_math.h"
+
+#ifndef __MATH_BASE_INLINE_C__
+#define __MATH_BASE_INLINE_C__
+
+/* A few small defines. Keep'em local! */
+#define SMALL_NUMBER 1.e-8f
+
+MINLINE float sqrt3f(float f)
+{
+ if (f == 0.0f) return 0.0f;
+ if (f < 0) return (float)(-exp(log(-f) / 3));
+ else return (float)(exp(log(f) / 3));
+}
+
+MINLINE double sqrt3d(double d)
+{
+ if (d == 0.0) return 0;
+ if (d < 0) return -exp(log(-d) / 3);
+ else return exp(log(d) / 3);
+}
+
+MINLINE float saacos(float fac)
+{
+ if (fac <= -1.0f) return (float)M_PI;
+ else if (fac >= 1.0f) return 0.0;
+ else return (float)acos(fac);
+}
+
+MINLINE float saasin(float fac)
+{
+ if (fac <= -1.0f) return (float)-M_PI / 2.0f;
+ else if (fac >= 1.0f) return (float)M_PI / 2.0f;
+ else return (float)asin(fac);
+}
+
+MINLINE float sasqrt(float fac)
+{
+ if (fac <= 0.0f) return 0.0f;
+ return (float)sqrt(fac);
+}
+
+MINLINE float saacosf(float fac)
+{
+ if (fac <= -1.0f) return (float)M_PI;
+ else if (fac >= 1.0f) return 0.0f;
+ else return (float)acosf(fac);
+}
+
+MINLINE float saasinf(float fac)
+{
+ if (fac <= -1.0f) return (float)-M_PI / 2.0f;
+ else if (fac >= 1.0f) return (float)M_PI / 2.0f;
+ else return (float)asinf(fac);
+}
+
+MINLINE float sasqrtf(float fac)
+{
+ if (fac <= 0.0f) return 0.0f;
+ return sqrtf(fac);
+}
+
+MINLINE float interpf(float target, float origin, float fac)
+{
+ return (fac * target) + (1.0f - fac) * origin;
+}
+
+/* useful to calculate an even width shell, by taking the angle between 2 planes.
+ * The return value is a scale on the offset.
+ * no angle between planes is 1.0, as the angle between the 2 planes approaches 180d
+ * the distance gets very high, 180d would be inf, but this case isn't valid */
+MINLINE float shell_angle_to_dist(const float angle)
+{
+ return (angle < SMALL_NUMBER) ? 1.0f : fabsf(1.0f / cosf(angle));
+}
+
+/* used for zoom values*/
+MINLINE float power_of_2(float val)
+{
+ return (float)pow(2.0, ceil(log((double)val) / M_LN2));
+}
+
+MINLINE int is_power_of_2_i(int n)
+{
+ return (n & (n - 1)) == 0;
+}
+
+MINLINE int power_of_2_max_i(int n)
+{
+ if (is_power_of_2_i(n))
+ return n;
+
+ while (!is_power_of_2_i(n))
+ n = n & (n - 1);
+
+ return n * 2;
+}
+
+MINLINE int power_of_2_min_i(int n)
+{
+ while (!is_power_of_2_i(n))
+ n = n & (n - 1);
+
+ return n;
+}
+
+MINLINE float minf(float a, float b)
+{
+ return (a < b) ? a : b;
+}
+
+MINLINE float maxf(float a, float b)
+{
+ return (a > b) ? a : b;
+}
+
+MINLINE float signf(float f)
+{
+ return (f < 0.f) ? -1.f : 1.f;
+}
+
+
+#endif /* __MATH_BASE_INLINE_C__ */
Deleted: branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_color_inline.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_color_inline.c 2012-06-06 01:39:20 UTC (rev 47492)
+++ branches/soc-2012-swiss_cheese/source/blender/blenlib/intern/math_color_inline.c 2012-06-06 03:24:02 UTC (rev 47493)
@@ -1,218 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * 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.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list