2.5: various warning fixes.

This commit is contained in:
2009-01-17 00:51:42 +00:00
parent de9495e519
commit 9bcdb4b758
28 changed files with 76 additions and 68 deletions

View File

@@ -97,8 +97,8 @@ extern unsigned int SND_GetSampleFormat(void* sample);
extern unsigned int SND_GetNumberOfChannels(void* sample);
extern unsigned int SND_GetSampleRate(void* sample);
extern unsigned int SND_GetBitRate(void* sample);
extern unsigned int SND_GetNumberOfSamples(void* sample, int sample_length);
extern unsigned int SND_GetHeaderSize(void* sample, int sample_length);
extern unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length);
extern unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length);
extern unsigned int SND_GetExtraChunk(void* sample);
extern void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot);

View File

@@ -290,7 +290,7 @@ unsigned int SND_GetBitRate(void* sample)
/* gets the length of the actual sample data (without the header) */
unsigned int SND_GetNumberOfSamples(void* sample, int sample_length)
unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length)
{
unsigned int chunklength, length = 0, offset;
unsigned short block_align;
@@ -330,7 +330,7 @@ unsigned int SND_GetNumberOfSamples(void* sample, int sample_length)
/* gets the size of the entire header (file - sampledata) */
unsigned int SND_GetHeaderSize(void* sample, int sample_length)
unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length)
{
unsigned int chunklength, headersize = 0, offset = 16;
unsigned short block_align;

View File

@@ -41,8 +41,8 @@ LOD_ExternNormalEditor(
LOD_Decimation_InfoPtr extern_info,
LOD_ManMesh2 &mesh
) :
m_extern_info (extern_info),
m_mesh(mesh)
m_mesh(mesh),
m_extern_info (extern_info)
{
}

View File

@@ -546,7 +546,7 @@ DeleteEdge(
// edges[e] should already have been removed from the heap
MT_assert(edges[e].HeapPos() == 0xffffffff);
MT_assert(edges[e].HeapPos() == -1);
edges[e] = edges[last];
// also have to swap there heap positions.!!!!!

View File

@@ -91,10 +91,10 @@ LOD_QSDecimator(
LOD_ExternNormalEditor &face_editor,
LOD_ExternBufferEditor &extern_editor
) :
m_is_armed (false),
m_mesh(mesh),
m_face_editor(face_editor),
m_extern_editor(extern_editor),
m_is_armed (false)
m_extern_editor(extern_editor)
{
m_deg_edges.reserve(32);
m_deg_faces.reserve(32);
@@ -318,7 +318,7 @@ UpdateHeap(
LOD_Edge &e = edge_set[*edge_it];
m_heap->Remove(&edge_set[0],e.HeapPos());
e.HeapPos() = 0xffffffff;
e.HeapPos() = -1;
}
}

View File

@@ -1401,7 +1401,7 @@ void LbmFsgrSolver::initMovingObstacles(bool staticInit) {
debMsgStd("LbmFsgrSolver::initMovingObstacles",DM_MSG," obj "<<obj->getName()<<" skip:"<<skip<<", static:"<<staticInit<<" anim:"<<obj->getIsAnimated()<<" gid:"<<obj->getGeoInitId()<<" simgid:"<<mLbmInitId, 10);
if( (obj->getGeoInitType()&FGI_ALLBOUNDS) ||
(obj->getGeoInitType()&FGI_FLUID) && staticInit ) {
((obj->getGeoInitType()&FGI_FLUID) && staticInit) ) {
otype = ntype = CFInvalid;
switch(obj->getGeoInitType()) {

View File

@@ -719,17 +719,17 @@ void GHOST_WindowX11::netwmMaximized(bool set)
bool GHOST_WindowX11::netwmIsMaximized(void) const
{
unsigned char *prop_ret;
unsigned long bytes_after, num_ret;
unsigned long bytes_after, num_ret, i;
Atom type_ret;
bool st;
int format_ret, count, i;
int format_ret, ret, count;
prop_ret = NULL;
st = False;
i = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
ret = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
0x7fffffff, False, XA_ATOM, &type_ret, &format_ret,
&num_ret, &bytes_after, &prop_ret);
if ((i == Success) && (prop_ret) && (format_ret == 32)) {
if ((ret == Success) && (prop_ret) && (format_ret == 32)) {
count = 0;
for (i = 0; i < num_ret; i++) {
if (((unsigned long *) prop_ret)[i] == m_system->m_net_max_horz)
@@ -775,17 +775,17 @@ void GHOST_WindowX11::netwmFullScreen(bool set)
bool GHOST_WindowX11::netwmIsFullScreen(void) const
{
unsigned char *prop_ret;
unsigned long bytes_after, num_ret;
unsigned long bytes_after, num_ret, i;
Atom type_ret;
bool st;
int format_ret, i;
int format_ret, ret;
prop_ret = NULL;
st = False;
i = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
ret = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
0x7fffffff, False, XA_ATOM, &type_ret, &format_ret,
&num_ret, &bytes_after, &prop_ret);
if ((i == Success) && (prop_ret) && (format_ret == 32)) {
if ((ret == Success) && (prop_ret) && (format_ret == 32)) {
for (i = 0; i < num_ret; i++) {
if (((unsigned long *) prop_ret)[i] == m_system->m_net_fullscreen) {
st = True;
@@ -868,7 +868,6 @@ GHOST_TSuccess GHOST_WindowX11::setState(GHOST_TWindowState state)
{
GHOST_TWindowState cur_state;
bool is_max, is_full, is_motif_full;
int icccm_state;
cur_state = getState();
if (state == (int)cur_state)

View File

@@ -175,11 +175,12 @@ void IK_SetLimit(IK_Segment *seg, IK_SegmentAxis axis, float lmin, float lmax)
IK_QSegment *qseg = (IK_QSegment*)seg;
if (axis >= IK_TRANS_X) {
if(!qseg->Translational())
if(!qseg->Translational()) {
if(qseg->Composite() && qseg->Composite()->Translational())
qseg = qseg->Composite();
else
return;
}
if(axis == IK_TRANS_X) axis = IK_X;
else if(axis == IK_TRANS_Y) axis = IK_Y;
@@ -201,11 +202,12 @@ void IK_SetStiffness(IK_Segment *seg, IK_SegmentAxis axis, float stiffness)
MT_Scalar weight = 1.0-stiffness;
if (axis >= IK_TRANS_X) {
if(!qseg->Translational())
if(!qseg->Translational()) {
if(qseg->Composite() && qseg->Composite()->Translational())
qseg = qseg->Composite();
else
return;
}
if(axis == IK_TRANS_X) axis = IK_X;
else if(axis == IK_TRANS_Y) axis = IK_Y;

View File

@@ -34,7 +34,7 @@ float DenseSize(int n, float sum_nw);
void superlu_abort_and_exit(char* msg)
{
fprintf(stderr, msg);
fprintf(stderr, "%s", msg);
exit (-1);
}

View File

@@ -127,10 +127,10 @@ void CTX_data_list_add(bContextDataResult *result, void *data);
BLI_freelistN(&ctx_data_list); \
}
#define CTX_DATA_COUNT(C, member, i) \
CTX_DATA_BEGIN(C, void*, unused, member) \
i++; \
CTX_DATA_END
int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase*));
#define CTX_DATA_COUNT(C, member) \
ctx_data_list_count(C, CTX_data_##member)
/* Data Context Members */

View File

@@ -1635,7 +1635,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
}
/* create an orco derivedmesh in parallel */
mask= (CustomDataMask)curr->link;
mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
if(mask & CD_MASK_ORCO) {
if(!orcodm)
orcodm= create_orco_dm(ob, me, NULL);
@@ -1655,7 +1655,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
DM_set_only_copy(dm, mask);
/* add an origspace layer if needed */
if(((CustomDataMask)curr->link) & CD_MASK_ORIGSPACE)
if(((CustomDataMask)GET_INT_FROM_POINTER(curr->link)) & CD_MASK_ORIGSPACE)
if(!CustomData_has_layer(&dm->faceData, CD_ORIGSPACE))
DM_add_face_layer(dm, CD_ORIGSPACE, CD_DEFAULT, NULL);
@@ -1847,7 +1847,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri
}
/* create an orco derivedmesh in parallel */
mask= (CustomDataMask)curr->link;
mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
if(mask & CD_MASK_ORCO) {
if(!orcodm)
orcodm= create_orco_dm(ob, ob->data, em);
@@ -1864,9 +1864,9 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri
}
/* set the DerivedMesh to only copy needed data */
DM_set_only_copy(dm, (CustomDataMask)curr->link);
DM_set_only_copy(dm, (CustomDataMask)GET_INT_FROM_POINTER(curr->link));
if(((CustomDataMask)curr->link) & CD_MASK_ORIGSPACE)
if(((CustomDataMask)GET_INT_FROM_POINTER(curr->link)) & CD_MASK_ORIGSPACE)
if(!CustomData_has_layer(&dm->faceData, CD_ORIGSPACE))
DM_add_face_layer(dm, CD_ORIGSPACE, CD_DEFAULT, NULL);

View File

@@ -310,6 +310,16 @@ void CTX_data_list_add(bContextDataResult *result, void *data)
BLI_addtail(&result->list, link);
}
int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase*))
{
ListBase list;
if(func(C, &list))
return BLI_countlist(&list);
else
return 0;
}
/* data context */
Main *CTX_data_main(const bContext *C)

View File

@@ -3329,7 +3329,7 @@ static int read_groupf(char *str)
}
//XXX error() is now printf until we have a callback error
#define id_test(id) if(id<0) {char errmsg[128];fclose(dxf_fp); if(id==-1) sprintf(errmsg, "Error inputting dxf, near line %d", dxf_line); else if(id==-2) sprintf(errmsg, "Error reading dxf, near line %d", dxf_line);printf(errmsg); return;}
#define id_test(id) if(id<0) {char errmsg[128];fclose(dxf_fp); if(id==-1) sprintf(errmsg, "Error inputting dxf, near line %d", dxf_line); else if(id==-2) sprintf(errmsg, "Error reading dxf, near line %d", dxf_line);printf("%s", errmsg); return;}
#define read_group(id,str) {id= read_groupf(str); id_test(id);}

View File

@@ -8604,7 +8604,7 @@ LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask)
if(mti->requiredDataMask) mask = mti->requiredDataMask(md);
BLI_linklist_prepend(&dataMasks, (void *)mask);
BLI_linklist_prepend(&dataMasks, SET_INT_IN_POINTER(mask));
}
/* build the list of required data masks - each mask in the list must
@@ -8615,14 +8615,14 @@ LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask)
*/
for(curr = dataMasks, prev = NULL; curr; prev = curr, curr = curr->next) {
if(prev) {
CustomDataMask prev_mask = (CustomDataMask)prev->link;
CustomDataMask curr_mask = (CustomDataMask)curr->link;
CustomDataMask prev_mask = (CustomDataMask)GET_INT_FROM_POINTER(prev->link);
CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
curr->link = (void *)(curr_mask | prev_mask);
curr->link = SET_INT_IN_POINTER(curr_mask | prev_mask);
} else {
CustomDataMask curr_mask = (CustomDataMask)curr->link;
CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
curr->link = (void *)(curr_mask | dataMask);
curr->link = SET_INT_IN_POINTER(curr_mask | dataMask);
}
}

View File

@@ -245,7 +245,7 @@ void BKE_reports_print(ReportList *reports, ReportType level)
if (cstring == NULL)
return;
printf(cstring);
printf("%s", cstring);
fflush(stdout);
MEM_freeN(cstring);
}

View File

@@ -253,7 +253,7 @@ int BLI_ghashIterator_isDone(GHashIterator *ghi) {
/***/
unsigned int BLI_ghashutil_ptrhash(void *key) {
return (unsigned int) key;
return (unsigned int)(intptr_t)key;
}
int BLI_ghashutil_ptrcmp(void *a, void *b) {
if (a==b)

View File

@@ -478,6 +478,7 @@ static void node_join(BVHTree *tree, BVHNode *node)
/*
* Debug and information functions
*/
#if 0
static void bvhtree_print_tree(BVHTree *tree, BVHNode *node, int depth)
{
int i;
@@ -509,6 +510,7 @@ static void bvhtree_info(BVHTree *tree)
// bvhtree_print_tree(tree, tree->nodes[tree->totleaf], 0);
}
#endif
#if 0
@@ -1238,7 +1240,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
int i;
float nearest[3];
if(data->proj[ node->main_axis ] <= node->children[0]->bv[node->main_axis*2+1])
if(data->proj[ (int)node->main_axis ] <= node->children[0]->bv[(int)node->main_axis*2+1])
{
for(i=0; i != node->totnode; i++)
@@ -1267,6 +1269,7 @@ static void dfs_find_nearest_begin(BVHNearestData *data, BVHNode *node)
}
#if 0
static void NodeDistance_push_heap(NodeDistance *heap, int heap_size)
PUSH_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size)
@@ -1350,7 +1353,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
if(heap != default_heap)
free(heap);
}
#endif
int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
{
@@ -1463,7 +1466,7 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node)
else
{
//pick loop direction to dive into the tree (based on ray direction and split axis)
if(data->ray_dot_axis[ node->main_axis ] > 0.0f)
if(data->ray_dot_axis[ (int)node->main_axis ] > 0.0f)
{
for(i=0; i != node->totnode; i++)
{

View File

@@ -4263,6 +4263,7 @@ float lambda_cp_line_ex(float p[3], float l1[3], float l2[3], float cp[3])
return lambda;
}
#if 0
/* little sister we only need to know lambda */
static float lambda_cp_line(float p[3], float l1[3], float l2[3])
{
@@ -4271,6 +4272,7 @@ static float lambda_cp_line(float p[3], float l1[3], float l2[3])
VecSubf(h, p, l1);
return(Inpf(u,h)/Inpf(u,u));
}
#endif
/* Similar to LineIntersectsTriangleUV, except it operates on a quad and in 2d, assumes point is in quad */
void PointInQuad2DUV(float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv)
@@ -4423,7 +4425,7 @@ int IsPointInTri2D(float v0[2], float v1[2], float v2[2], float pt[2])
Vec2Copyf(v2_3d, v2);
/* Doing this in 3D is not nice */
return LineIntersectsTriangle(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, &uv);
return LineIntersectsTriangle(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, uv);
}
/*
@@ -4505,6 +4507,7 @@ but see a 'spat' which is a deformed cube with paired parallel planes needs only
return 1;
}
#if 0
/*adult sister defining the slice planes by the origin and the normal
NOTE |normal| may not be 1 but defining the thickness of the slice*/
static int point_in_slice_as(float p[3],float origin[3],float normal[3])
@@ -4525,6 +4528,7 @@ static int point_in_slice_m(float p[3],float origin[3],float normal[3],float lns
if (h < 0.0f || h > 1.0f) return 0;
return 1;
}
#endif
int point_in_tri_prism(float p[3], float v1[3], float v2[3], float v3[3])

View File

@@ -240,10 +240,7 @@ fnmatch (const char *pattern, const char *string, int flags)
#else
static void BLI_FNMATCH_C_IS_EMPTY_FOR_UNIX(void)
{
/*intentionally empty*/
}
/* intentionally empty for UNIX */
#endif /* WIN32 */

View File

@@ -465,8 +465,6 @@ int subtreeShape(BNode *node, BArc *rootArc, int include_root)
int BLI_subtreeShape(BGraph *graph, BNode *node, BArc *rootArc, int include_root)
{
BNode *test_node;
BLI_flagNodes(graph, 0);
return subtreeShape(node, rootArc, include_root);
}

View File

@@ -43,8 +43,6 @@
#include "BLI_listbase.h"
static int add_win32_extension(char *name);
/* implementation */
/* Ripped this from blender.c */

View File

@@ -219,9 +219,6 @@ int check_file_chars(char *filename)
#else
static void BLI_WINSTUFF_C_IS_EMPTY_FOR_UNIX(void)
{
/*intentionally empty*/
}
/* intentionally empty for UNIX */
#endif

View File

@@ -5366,7 +5366,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
}
case SPACE_FILE:
{
SpaceFile *sfile= (SpaceFile *)sl;
// SpaceFile *sfile= (SpaceFile *)sl;
ar->v2d.tot.xmin = ar->v2d.tot.ymin = 0;
ar->v2d.tot.xmax = ar->winx;
ar->v2d.tot.ymax = ar->winy;

View File

@@ -1416,7 +1416,7 @@ static short incl_v3d_ob_shapekey (bKeyingSet *ks, const char mode[])
/* if ks is shapekey entry (this could be callled for separator before too!) */
if (ks->flag == -3)
sprintf(ks->name, newname);
BLI_strncpy(ks->name, newname, sizeof(ks->name));
/* if it gets here, it's ok */
return 1;

View File

@@ -747,7 +747,7 @@ int join_armature(Scene *scene, View3D *v3d)
joined_armature_fix_links(ob, base->object, pchan, curbone);
/* Rename pchan */
sprintf(pchan->name, curbone->name);
BLI_strncpy(pchan->name, curbone->name, sizeof(pchan->name));
/* Jump Ship! */
BLI_remlink(curarm->edbo, curbone);

View File

@@ -4153,7 +4153,7 @@ void createTransNodeData(bContext *C, TransInfo *t)
TransData *td;
TransData2D *td2d;
CTX_DATA_COUNT(C, selected_nodes, t->total)
t->total= CTX_DATA_COUNT(C, selected_nodes);
td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransNode TransData");
td2d = t->data2d = MEM_callocN(t->total*sizeof(TransData2D), "TransNode TransData2D");

View File

@@ -558,7 +558,7 @@ cineonOpen(const char* filename) {
cineon->pixelBuffer = malloc(cineon->lineBufferLength * 3 * sizeof(unsigned short));
if (cineon->pixelBuffer == 0) {
if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
(cineon->width * cineon->depth) * sizeof(unsigned short));
(cineon->width * cineon->depth) * (int)sizeof(unsigned short));
cineonClose(cineon);
return 0;
}
@@ -658,7 +658,7 @@ cineonOpenFromMem(unsigned char *mem, unsigned int size) {
cineon->pixelBuffer = malloc(cineon->lineBufferLength * 3 * sizeof(unsigned short));
if (cineon->pixelBuffer == 0) {
if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
(cineon->width * cineon->depth) * sizeof(unsigned short));
(cineon->width * cineon->depth) * (int)sizeof(unsigned short));
cineonClose(cineon);
return 0;
}
@@ -744,7 +744,7 @@ cineonCreate(const char* filename, int width, int height, int depth) {
cineon->pixelBuffer = malloc(cineon->lineBufferLength * 3 * sizeof(unsigned short));
if (cineon->pixelBuffer == 0) {
if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
(cineon->width * cineon->depth) * sizeof(unsigned short));
(cineon->width * cineon->depth) * (int)sizeof(unsigned short));
cineonClose(cineon);
return 0;
}

View File

@@ -240,7 +240,7 @@ dpxGetRowBytes(DpxFile* dpx, unsigned short* row, int y) {
/* read enough longwords */
readLongs = pixelsToLongs(numPixels - dpx->pixelBufferUsed);
if (logimage_fread(dpx->lineBuffer, 4, readLongs, dpx) != readLongs) {
if (verbose) d_printf("Couldn't read line %d length %d\n", y, readLongs * 4);
if (verbose) d_printf("Couldn't read line %d length %d\n", y, (int)readLongs * 4);
return 1;
}
++dpx->fileYPos;
@@ -352,7 +352,7 @@ dpxSetRowBytes(DpxFile* dpx, const unsigned short* row, int y) {
/* write them */
if (fwrite(dpx->lineBuffer, 4, writeLongs, dpx->file) != writeLongs) {
if (verbose) d_printf("Couldn't write line %d length %d\n", y, writeLongs * 4);
if (verbose) d_printf("Couldn't write line %d length %d\n", y, (int)writeLongs * 4);
return 1;
}
++dpx->fileYPos;
@@ -462,7 +462,7 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) {
dpx->pixelBuffer = malloc((dpx->lineBufferLength * 3 + 2) * sizeof(unsigned short));
if (dpx->pixelBuffer == 0) {
if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
(dpx->width * dpx->depth + 2 + 2) * sizeof(unsigned short));
(dpx->width * dpx->depth + 2 + 2) * (int)sizeof(unsigned short));
dpxClose(dpx);
return 0;
}
@@ -574,7 +574,7 @@ dpxCreate(const char* filename, int width, int height, int depth) {
dpx->pixelBuffer = malloc((dpx->lineBufferLength * 3 + 2) * sizeof(unsigned short));
if (dpx->pixelBuffer == 0) {
if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n",
(dpx->width * dpx->depth + 2 + 2) * sizeof(unsigned short));
(dpx->width * dpx->depth + 2 + 2) * (int)sizeof(unsigned short));
dpxClose(dpx);
return 0;
}