2.5: warning fixes

Mostly harmless ones, except for one about "gzopen64" being
undeclared. This needs some defines in BLI_storage.h to be set
before <unistd.h> is included. Might fix a crash in compressed
file reading, though I'm not sure since it's hard to repeat
the crash consistently.
This commit is contained in:
2009-06-22 18:19:18 +00:00
parent bce3f7e019
commit e7d02e5679
14 changed files with 40 additions and 19 deletions

View File

@@ -3028,7 +3028,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
if (VALID_CONS_TARGET(ct)) {
float loc[3], eul[3], size[3];
float dvec[3], sval[3];
short i;
int i;
/* obtain target effect */
switch (data->from) {
@@ -3075,7 +3075,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
switch (data->to) {
case 2: /* scaling */
for (i=0; i<3; i++)
size[i]= data->to_min[i] + (sval[data->map[i]] * (data->to_max[i] - data->to_min[i]));
size[i]= data->to_min[i] + (sval[(int)data->map[i]] * (data->to_max[i] - data->to_min[i]));
break;
case 1: /* rotation */
for (i=0; i<3; i++) {
@@ -3085,7 +3085,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
tmax= data->to_max[i];
/* all values here should be in degrees */
eul[i]= tmin + (sval[data->map[i]] * (tmax - tmin));
eul[i]= tmin + (sval[(int)data->map[i]] * (tmax - tmin));
/* now convert final value back to radians */
eul[i] = (float)(eul[i] / 180 * M_PI);
@@ -3094,7 +3094,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
default: /* location */
/* get new location */
for (i=0; i<3; i++)
loc[i]= (data->to_min[i] + (sval[data->map[i]] * (data->to_max[i] - data->to_min[i])));
loc[i]= (data->to_min[i] + (sval[(int)data->map[i]] * (data->to_max[i] - data->to_min[i])));
/* add original location back on (so that it can still be moved) */
VecAddf(loc, cob->matrix[3], loc);

View File

@@ -29,6 +29,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
#include <math.h>
#include <stdlib.h>

View File

@@ -29,6 +29,7 @@
*
* ***** END GPL LICENSE BLOCK *****/
#include "BLI_storage.h"
#include <ctype.h> /* isdigit, isspace */
#include <math.h>

View File

@@ -28,6 +28,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"

View File

@@ -230,16 +230,16 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
*/
newsize = (newsize >> 3) + (newsize < 9 ? 3 : 6) + newsize;
newarr = MEM_callocN(idp_size_table[prop->subtype]*newsize, "idproperty array resized");
newarr = MEM_callocN(idp_size_table[(int)prop->subtype]*newsize, "idproperty array resized");
if (newlen >= prop->len) {
/* newlen is bigger*/
memcpy(newarr, prop->data.pointer, prop->len*idp_size_table[prop->subtype]);
memcpy(newarr, prop->data.pointer, prop->len*idp_size_table[(int)prop->subtype]);
idp_resize_group_array(prop, newlen, newarr);
}
else {
/* newlen is smaller*/
idp_resize_group_array(prop, newlen, newarr);
memcpy(newarr, prop->data.pointer, newlen*prop->len*idp_size_table[prop->subtype]);
memcpy(newarr, prop->data.pointer, newlen*prop->len*idp_size_table[(int)prop->subtype]);
}
MEM_freeN(prop->data.pointer);
@@ -546,7 +546,7 @@ int IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
return BSTR_EQ(IDP_String(prop1), IDP_String(prop2));
else if(prop1->type == IDP_ARRAY) {
if(prop1->len == prop2->len && prop1->subtype == prop2->subtype)
return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[prop1->subtype]*prop1->len);
return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[(int)prop1->subtype]*prop1->len);
else
return 0;
}

View File

@@ -29,6 +29,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
#include <stdlib.h>
#include <math.h>
#include <string.h>
@@ -2203,12 +2205,15 @@ void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra
*sfra = MAX2(1, (int)part->sta);
*efra = MIN2((int)(part->end + part->lifetime + 1.0), scene->r.efra);
}
static float *particle_state_ptr(int index, ParticleSystem *psys)
static float *particle_state_ptr(int index, void *psys_ptr)
{
ParticleSystem *psys= psys_ptr;
return (float *)(&(psys->particles+index)->state);
}
static void particle_read_state(int index, ParticleSystem *psys, float *data)
static void particle_read_state(int index, void *psys_ptr, float *data)
{
ParticleSystem *psys= psys_ptr;
ParticleData *pa = psys->particles + index;
ParticleKey *key = (ParticleKey *)data;
@@ -2217,8 +2222,9 @@ static void particle_read_state(int index, ParticleSystem *psys, float *data)
copy_particle_key(&pa->state, key, 1);
}
static void particle_cache_interpolate(int index, ParticleSystem *psys, float frs_sec, float cfra, int cfra1, int cfra2, float *data1, float *data2)
static void particle_cache_interpolate(int index, void *psys_ptr, float frs_sec, float cfra, int cfra1, int cfra2, float *data1, float *data2)
{
ParticleSystem *psys= psys_ptr;
ParticleData *pa = psys->particles + index;
ParticleKey keys[4];
float dfra;

View File

@@ -1050,7 +1050,6 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
int endframe = CFRA;
int bake = baker->bake;
int render = baker->render;
int end = 0;
G.afbreek = 0;
@@ -1162,7 +1161,6 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) {
int totelem=0;
int float_count=0;
int tot;
int write_error=0;
if (!G.relbase_valid){
cache->flag &= ~PTCACHE_DISK_CACHE;
@@ -1243,4 +1241,4 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) {
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
cache->flag &= ~PTCACHE_DISK_CACHE;
}
}
}

View File

@@ -25,15 +25,20 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef BLI_STORAGE_H
#define BLI_STORAGE_H
/* NOTE: these have to be defined before including unistd.h! */
#ifndef __APPLE__
#ifndef WIN32
#define _LARGEFILE_SOURCE 1
#ifndef _LARGEFILE_SOURCE
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#endif
#endif
#endif
struct direntry;

View File

@@ -837,7 +837,7 @@ static int decodetype1(PackedFile * pf, char *outname)
while(newfgets(oneline, LINELEN, pf)) {
hptr = (char *)oneline;
while(*hptr) {
if(hextab[*hptr] != NOTHEX)
if(hextab[(int)*hptr] != NOTHEX)
hexdat[hexbytes++] = *hptr;
hptr++;
}
@@ -853,7 +853,7 @@ static int decodetype1(PackedFile * pf, char *outname)
bptr = bindat;
c = datbytes;
while(c--) {
*bptr++ = (hextab[hptr[0]]<<4)+hextab[hptr[1]];
*bptr++ = (hextab[(int)hptr[0]]<<4)+hextab[(int)hptr[1]];
hptr += 2;
}

View File

@@ -32,6 +32,8 @@
#include <config.h>
#endif
#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

View File

@@ -88,6 +88,7 @@
/* ************************ header area region *********************** */
#ifndef DISABLE_PYTHON
#if 0
static void do_text_template_scriptsmenu(bContext *C, void *arg, int event)
{
// XXX BPY_menu_do_python(PYMENU_SCRIPTTEMPLATE, event);
@@ -154,6 +155,7 @@ static uiBlock *text_plugin_scriptsmenu(bContext *C, void *args_unused)
return block;
}
#endif
#endif
/************************** properties ******************************/

View File

@@ -76,11 +76,12 @@
#include "UI_resources.h"
#include "UI_view2d.h"
#include "GPU_draw.h"
#include "PIL_time.h" /* smoothview */
#include "view3d_intern.h" // own include
/* use this call when executing an operator,
event system doesn't set for each event the
opengl drawing context */

View File

@@ -694,7 +694,7 @@ int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **na
int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
{
const EnumPropertyItem *item;
int totitem, i;
int totitem;
RNA_property_enum_items(ptr, prop, &item, &totitem);

View File

@@ -50,6 +50,8 @@ struct bConstraintTarget; /* DNA_constraint_types.h*/
struct Script; /* DNA_screen_types.h */
struct BPyMenu;
struct bContext;
struct ReportList;
#ifdef __cplusplus
extern "C" {
#endif