[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50645] trunk/blender: code cleanup: quiet warnings for gcc's -Wundef, -Wmissing-declarations

Campbell Barton ideasman42 at gmail.com
Sun Sep 16 02:26:36 CEST 2012


Revision: 50645
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50645
Author:   campbellbarton
Date:     2012-09-16 00:26:36 +0000 (Sun, 16 Sep 2012)
Log Message:
-----------
code cleanup: quiet warnings for gcc's -Wundef, -Wmissing-declarations

Modified Paths:
--------------
    trunk/blender/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
    trunk/blender/intern/cycles/blender/blender_python.cpp
    trunk/blender/intern/dualcon/intern/Projections.cpp
    trunk/blender/intern/dualcon/intern/dualcon_c_api.cpp
    trunk/blender/intern/dualcon/intern/octree.cpp
    trunk/blender/intern/raskter/raskter.c
    trunk/blender/intern/smoke/intern/smoke_API.cpp
    trunk/blender/source/blender/blenkernel/intern/tracking.c
    trunk/blender/source/blender/bmesh/intern/bmesh_mesh.c
    trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.cpp
    trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp
    trunk/blender/source/blender/compositor/intern/COM_compositor.cpp
    trunk/blender/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
    trunk/blender/source/blender/editors/render/render_internal.c
    trunk/blender/source/blender/editors/space_nla/nla_edit.c
    trunk/blender/source/blender/ikplugin/intern/itasc_plugin.cpp
    trunk/blender/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
    trunk/blender/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
    trunk/blender/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
    trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c

Modified: trunk/blender/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
===================================================================
--- trunk/blender/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp	2012-09-16 00:26:36 UTC (rev 50645)
@@ -767,7 +767,7 @@
 /**************************** Threading Code **********************************/
 /******************************************************************************/
 
-void* AUD_openalRunThread(void* device)
+static void *AUD_openalRunThread(void *device)
 {
 	AUD_OpenALDevice* dev = (AUD_OpenALDevice*)device;
 	dev->updateStreams();
@@ -993,7 +993,7 @@
 		AUD_THROW(AUD_ERROR_OPENAL, open_error);
 
 	// at least try to set the frequency
-	ALCint attribs[] = { ALC_FREQUENCY, specs.rate, 0 };
+	ALCint attribs[] = { ALC_FREQUENCY, (ALCint)specs.rate, 0 };
 	ALCint* attributes = attribs;
 	if(specs.rate == AUD_RATE_INVALID)
 		attributes = NULL;

Modified: trunk/blender/intern/cycles/blender/blender_python.cpp
===================================================================
--- trunk/blender/intern/cycles/blender/blender_python.cpp	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/intern/cycles/blender/blender_python.cpp	2012-09-16 00:26:36 UTC (rev 50645)
@@ -183,7 +183,7 @@
 	NULL, NULL, NULL, NULL
 };
 
-CCLDeviceInfo *compute_device_list(DeviceType type)
+static CCLDeviceInfo *compute_device_list(DeviceType type)
 {
 	/* device list stored static */
 	static ccl::vector<CCLDeviceInfo> device_list;

Modified: trunk/blender/intern/dualcon/intern/Projections.cpp
===================================================================
--- trunk/blender/intern/dualcon/intern/Projections.cpp	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/intern/dualcon/intern/Projections.cpp	2012-09-16 00:26:36 UTC (rev 50645)
@@ -92,12 +92,12 @@
 /**
  * Method to perform dot product
  */
-int64_t dotProduct(const int64_t a[3], const int64_t b[3])
+static int64_t dotProduct(const int64_t a[3], const int64_t b[3])
 {
 	return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
 }
 
-void normalize(double a[3])
+static void normalize(double a[3])
 {
 	double mag = a[0] * a[0] + a[1] * a[1] + a[2] * a[2];
 	if (mag > 0) {

Modified: trunk/blender/intern/dualcon/intern/dualcon_c_api.cpp
===================================================================
--- trunk/blender/intern/dualcon/intern/dualcon_c_api.cpp	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/intern/dualcon/intern/dualcon_c_api.cpp	2012-09-16 00:26:36 UTC (rev 50645)
@@ -32,7 +32,7 @@
 #define isnan(n) _isnan(n)
 #endif
 
-void veccopy(float dst[3], const float src[3])
+static void veccopy(float dst[3], const float src[3])
 {
 	dst[0] = src[0];
 	dst[1] = src[1];

Modified: trunk/blender/intern/dualcon/intern/octree.cpp
===================================================================
--- trunk/blender/intern/dualcon/intern/octree.cpp	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/intern/dualcon/intern/octree.cpp	2012-09-16 00:26:36 UTC (rev 50645)
@@ -345,11 +345,13 @@
 	delete proj;
 }
 
-void print_depth(int height, int maxDepth)
+#if 0
+static void print_depth(int height, int maxDepth)
 {
 	for (int i = 0; i < maxDepth - height; i++)
 		printf("  ");
 }
+#endif
 
 InternalNode *Octree::addTriangle(InternalNode *node, CubeTriangleIsect *p, int height)
 {
@@ -2108,8 +2110,8 @@
 	         svd.matrixU().adjoint();
 }
 
-void solve_least_squares(const float halfA[], const float b[],
-                         const float midpoint[], float rvalue[])
+static void solve_least_squares(const float halfA[], const float b[],
+                                const float midpoint[], float rvalue[])
 {
 	/* calculate pseudo-inverse */
 	Eigen::MatrixXf A(3, 3), pinv(3, 3);
@@ -2126,8 +2128,8 @@
 		rvalue[i] = result(i);
 }
 
-void minimize(float rvalue[3], float mp[3], const float pts[12][3],
-              const float norms[12][3], const int parity[12])
+static void minimize(float rvalue[3], float mp[3], const float pts[12][3],
+                     const float norms[12][3], const int parity[12])
 {
 	float ata[6] = {0, 0, 0, 0, 0, 0};
 	float atb[3] = {0, 0, 0};

Modified: trunk/blender/intern/raskter/raskter.c
===================================================================
--- trunk/blender/intern/raskter/raskter.c	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/intern/raskter/raskter.c	2012-09-16 00:26:36 UTC (rev 50645)
@@ -417,7 +417,8 @@
 }
 
 int PLX_raskterize(float(*base_verts)[2], int num_base_verts,
-                   float *buf, int buf_x, int buf_y) {
+                   float *buf, int buf_x, int buf_y)
+{
 	int i;                                   /* i: Loop counter. */
 	struct PolyVert *ply;                   /* ply: Pointer to a list of integer buffer-space vertex coordinates. */
 	struct r_FillContext ctx = {0};

Modified: trunk/blender/intern/smoke/intern/smoke_API.cpp
===================================================================
--- trunk/blender/intern/smoke/intern/smoke_API.cpp	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/intern/smoke/intern/smoke_API.cpp	2012-09-16 00:26:36 UTC (rev 50645)
@@ -28,7 +28,6 @@
  *  \ingroup smoke
  */
 
-
 #include "FLUID_3D.h"
 #include "WTURBULENCE.h"
 
@@ -36,6 +35,8 @@
 #include <stdlib.h>
 #include <math.h>
 
+#include "../extern/smoke_API.h"  /* to ensure valid prototypes */
+
 // y in smoke is z in blender
 extern "C" FLUID_3D *smoke_init(int *res, float *p0, float dtdef)
 {
@@ -283,10 +284,12 @@
 	*z = fluid->_zVelocityOb;
 }
 
+#if 0
 extern "C" unsigned char *smoke_get_obstacle_anim(FLUID_3D *fluid)
 {
 	return fluid->_obstaclesAnim;
 }
+#endif
 
 extern "C" void smoke_turbulence_set_noise(WTURBULENCE *wt, int type)
 {

Modified: trunk/blender/source/blender/blenkernel/intern/tracking.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/tracking.c	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/source/blender/blenkernel/intern/tracking.c	2012-09-16 00:26:36 UTC (rev 50645)
@@ -2029,7 +2029,7 @@
 {
 	TrackContext *track_context = (TrackContext *)customdata;
 
-#if WITH_LIBMV
+#ifdef WITH_LIBMV
 	if (track_context->search_area)
 		MEM_freeN(track_context->search_area);
 
@@ -2776,7 +2776,7 @@
 
 int BKE_tracking_reconstruction_check(MovieTracking *tracking, MovieTrackingObject *object, char *error_msg, int error_size)
 {
-#if WITH_LIBMV
+#ifdef WITH_LIBMV
 	ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, object);
 
 	if (tracking->settings.motion_flag & TRACKING_MOTION_MODAL) {

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_mesh.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_mesh.c	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_mesh.c	2012-09-16 00:26:36 UTC (rev 50645)
@@ -356,7 +356,7 @@
 	 * (loop cuts, edge subdivides, etc) are not reflected in the higher levels of
 	 * the mesh at all, which doesn't seem right. Turning off completely for now,
 	 * until this is shown to be better for certain types of mesh edits. */
-#if BMOP_UNTAN_MULTIRES_ENABLED
+#ifdef BMOP_UNTAN_MULTIRES_ENABLED
 	/* switch multires data out of tangent space */
 	if ((type_flag & BMO_OP_FLAG_UNTAN_MULTIRES) && CustomData_has_layer(&bm->ldata, CD_MDISPS)) {
 		bmesh_mdisps_space_set(bm, MULTIRES_SPACE_TANGENT, MULTIRES_SPACE_ABSOLUTE);
@@ -374,7 +374,7 @@
 void bmesh_edit_end(BMesh *bm, int UNUSED(flag))
 {
 	/* BMO_OP_FLAG_UNTAN_MULTIRES disabled for now, see comment above in bmesh_edit_begin. */
-#if BMOP_UNTAN_MULTIRES_ENABLED
+#ifdef BMOP_UNTAN_MULTIRES_ENABLED
 	/* switch multires data into tangent space */
 	if ((flag & BMO_OP_FLAG_UNTAN_MULTIRES) && CustomData_has_layer(&bm->ldata, CD_MDISPS)) {
 		/* set normals to their previous winding */

Modified: trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.cpp	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.cpp	2012-09-16 00:26:36 UTC (rev 50645)
@@ -253,7 +253,7 @@
 	}
 }
 
-float clipuv(float x, float limit)
+static float clipuv(float x, float limit)
 {
 	x = (x < 0) ? 0 : ((x >= limit) ? (limit - 1) : x);
 	return x;

Modified: trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp	2012-09-16 00:26:36 UTC (rev 50645)
@@ -25,6 +25,7 @@
 
 #include "BKE_global.h"
 
+#include "COM_compositor.h"
 #include "COM_WorkScheduler.h"
 #include "COM_CPUDevice.h"
 #include "COM_OpenCLDevice.h"
@@ -265,7 +266,7 @@
 #endif
 }
 
-extern void clContextError(const char *errinfo, const void *private_info, size_t cb, void *user_data)
+static void clContextError(const char *errinfo, const void *private_info, size_t cb, void *user_data)
 {
 	printf("OPENCL error: %s\n", errinfo);
 }

Modified: trunk/blender/source/blender/compositor/intern/COM_compositor.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_compositor.cpp	2012-09-16 00:22:55 UTC (rev 50644)
+++ trunk/blender/source/blender/compositor/intern/COM_compositor.cpp	2012-09-16 00:26:36 UTC (rev 50645)
@@ -37,7 +37,7 @@
 static ThreadMutex s_compositorMutex;
 static char is_compositorMutex_init = FALSE;
 
-void intern_freeCompositorCaches() 
+static void intern_freeCompositorCaches()
 {
 	deintializeDistortionCache();
 }
@@ -93,7 +93,7 @@
 	BLI_mutex_unlock(&s_compositorMutex);
 }
 
-void COM_freeCaches() 
+static void UNUSED_FUNCTION(COM_freeCaches)()
 {
 	if (is_compositorMutex_init) {
 		BLI_mutex_lock(&s_compositorMutex);
@@ -102,7 +102,7 @@
 	}
 }
 
-void COM_deinitialize() 
+void COM_deinitialize()
 {
 	if (is_compositorMutex_init) {
 		BLI_mutex_lock(&s_compositorMutex);

Modified: trunk/blender/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
===================================================================

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list