code cleanup: quiet warnings for gcc's -Wundef, -Wmissing-declarations

This commit is contained in:
Campbell Barton
2012-09-16 00:26:36 +00:00
parent beac985ab7
commit d724d0adfe
20 changed files with 43 additions and 35 deletions

View File

@@ -767,7 +767,7 @@ bool AUD_OpenALDevice::AUD_OpenALHandle::setConeVolumeOuter(float volume)
/**************************** 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_OpenALDevice::AUD_OpenALDevice(AUD_DeviceSpecs specs, int buffersize)
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;

View File

@@ -183,7 +183,7 @@ static struct PyModuleDef module = {
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;

View File

@@ -92,12 +92,12 @@ static void crossProduct(double res[3], const double a[3], const double b[3])
/**
* 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) {

View File

@@ -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];

View File

@@ -345,11 +345,13 @@ void Octree::addTriangle(Triangle *trian, int triind)
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 @@ void pseudoInverse(const _Matrix_Type_ &a,
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 @@ void solve_least_squares(const float halfA[], const float b[],
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};

View File

@@ -417,7 +417,8 @@ static int rast_scan_fill(struct r_FillContext *ctx, struct PolyVert *verts, int
}
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};

View File

@@ -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 @@ extern "C" void smoke_get_ob_velocity(FLUID_3D *fluid, float **x, float **y, flo
*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)
{

View File

@@ -2029,7 +2029,7 @@ static void track_context_free(void *customdata)
{
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 @@ static int reconstruct_count_tracks_on_both_keyframes(MovieTracking *tracking, L
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) {

View File

@@ -356,7 +356,7 @@ void bmesh_edit_begin(BMesh *UNUSED(bm), int UNUSED(type_flag))
* (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_begin(BMesh *UNUSED(bm), int UNUSED(type_flag))
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 */

View File

@@ -253,7 +253,7 @@ static void imp2radangle(float A, float B, float C, float F, float *a, float *b,
}
}
float clipuv(float x, float limit)
static float clipuv(float x, float limit)
{
x = (x < 0) ? 0 : ((x >= limit) ? (limit - 1) : x);
return x;

View File

@@ -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 @@ bool WorkScheduler::hasGPUDevices()
#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);
}

View File

@@ -37,7 +37,7 @@ extern "C" {
static ThreadMutex s_compositorMutex;
static char is_compositorMutex_init = FALSE;
void intern_freeCompositorCaches()
static void intern_freeCompositorCaches()
{
deintializeDistortionCache();
}
@@ -93,7 +93,7 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering,
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_freeCaches()
}
}
void COM_deinitialize()
void COM_deinitialize()
{
if (is_compositorMutex_init) {
BLI_mutex_lock(&s_compositorMutex);

View File

@@ -244,7 +244,7 @@ static void fht_convolve(fREAL *d1, fREAL *d2, unsigned int M, unsigned int N)
}
//------------------------------------------------------------------------------
void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
{
fREAL *data1, *data2, *fp;
unsigned int w2, h2, hw, hh, log2_w, log2_h;

View File

@@ -80,7 +80,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat
float *rectf = NULL;
int ymin, ymax, xmin, xmax;
int rymin, rxmin;
unsigned char *rectc;
/* unsigned char *rectc; */ /* UNUSED */
/* if renrect argument, we only refresh scanlines */
if (renrect) {
@@ -137,7 +137,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat
imb_addrectImBuf(ibuf);
rectf += 4 * (rr->rectx * ymin + xmin);
rectc = (unsigned char *)(ibuf->rect + ibuf->x * rymin + rxmin);
/* rectc = (unsigned char *)(ibuf->rect + ibuf->x * rymin + rxmin); */ /* UNUSED */
IMB_partial_display_buffer_update(ibuf, rectf, NULL, rr->rectx, rxmin, rymin,
&scene->view_settings, &scene->display_settings,

View File

@@ -1170,7 +1170,8 @@ static int nlaedit_bake_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
static void NLA_OT_bake(wmOperatorType *ot)
/* why isn't this used? */
static void UNUSED_FUNCTION(NLA_OT_bake)(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Bake Strips";

View File

@@ -393,7 +393,7 @@ static bool constraint_valid(bConstraint *con)
return true;
}
int initialize_scene(Object *ob, bPoseChannel *pchan_tip)
static int initialize_scene(Object *ob, bPoseChannel *pchan_tip)
{
bConstraint *con;
int treecount;

View File

@@ -305,7 +305,7 @@ static const uint DDPF_SRGB = 0x40000000U;
};
const char * getDxgiFormatString(DXGI_FORMAT dxgiFormat)
static const char * getDxgiFormatString(DXGI_FORMAT dxgiFormat)
{
#define CASE(format) case DXGI_FORMAT_##format: return #format
switch (dxgiFormat)
@@ -429,7 +429,7 @@ static const uint DDPF_SRGB = 0x40000000U;
#undef CASE
}
const char * getD3d10ResourceDimensionString(D3D10_RESOURCE_DIMENSION resourceDimension)
static const char * getD3d10ResourceDimensionString(D3D10_RESOURCE_DIMENSION resourceDimension)
{
switch (resourceDimension)
{
@@ -534,7 +534,7 @@ namespace
} // namespace
uint findD3D9Format(uint bitcount, uint rmask, uint gmask, uint bmask, uint amask)
static uint findD3D9Format(uint bitcount, uint rmask, uint gmask, uint bmask, uint amask)
{
for (int i = 0; i < s_d3dFormatCount; i++)
{

View File

@@ -185,7 +185,7 @@ RTBuilder *rtbuild_get_child(RTBuilder *b, int child, RTBuilder *tmp)
return tmp;
}
void rtbuild_calc_bb(RTBuilder *b)
static void rtbuild_calc_bb(RTBuilder *b)
{
if (b->bb[0] == 1.0e30f) {
for (RTBuilder::Object **index = b->sorted_begin[0]; index != b->sorted_end[0]; index++)

View File

@@ -152,7 +152,7 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(m
}
}
void bfree(VBVHTree *tree)
static void bfree(VBVHTree *tree)
{
if (tot_pushup + tot_pushdown + tot_hints + tot_moves) {
if (G.debug & G_DEBUG) {

View File

@@ -32,8 +32,8 @@
#include <stdio.h>
#include <string.h>
#if WIN32
#include <Windows.h>
#ifdef WIN32
# include <Windows.h>
#endif
#include "MEM_guardedalloc.h"
@@ -340,7 +340,7 @@ extern void free_anim_copybuf(void);
extern void free_anim_drivers_copybuf(void);
extern void free_fmodifiers_copybuf(void);
#if WIN32
#ifdef WIN32
/* Read console events until there is a key event. Also returns on any error. */
static void wait_for_console_key(void)
{