diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-01-10 05:40:24 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-01-10 05:40:24 +0300 |
commit | d9c6f51ee25e4c3d56a9e06fb8e544f230174744 (patch) | |
tree | 9368fbf812fd9428850988b405786d51d2e8b49a | |
parent | 83806d40429f3c847a3265cdb1cfe20bf6b08c3d (diff) |
Compiler warning fixes for the same point cache things Joshua tried to fix earlier, don't know why I didn't notice these before.
-rw-r--r-- | source/blender/blenkernel/BKE_pointcache.h | 22 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 7 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 14 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 24 |
4 files changed, 38 insertions, 29 deletions
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index a4ce46409a1..c8e967e8a9a 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -32,7 +32,6 @@ #include "DNA_ID.h" #include "DNA_object_force.h" #include "DNA_boid_types.h" -#include "DNA_particle_types.h" #include <stdio.h> /* for FILE */ /* Point cache clearing option, for BKE_ptcache_id_clear, before @@ -100,27 +99,6 @@ typedef struct PTCacheData { struct BoidData boids; } PTCacheData; -static char *ptcache_datastruct[] = { - "", // BPHYS_DATA_INDEX - "", // BPHYS_DATA_LOCATION - "", // BPHYS_DATA_VELOCITY - "", // BPHYS_DATA_ROTATION - "", // BPHYS_DATA_AVELOCITY / BPHYS_DATA_XCONST */ - "", // BPHYS_DATA_SIZE: - "", // BPHYS_DATA_TIMES: - "BoidData" // case BPHYS_DATA_BOIDS: -}; - -static char *ptcache_extra_datastruct[] = { - "", - "ParticleSpring" -}; - -static int ptcache_extra_datasize[] = { - 0, - sizeof(ParticleSpring) -}; - typedef struct PTCacheFile { FILE *fp; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index c4f1690e474..6b3584c1832 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -97,7 +97,7 @@ /* could be made into a pointcache option */ #define DURIAN_POINTCACHE_LIB_OK 1 -int ptcache_data_size[] = { +static int ptcache_data_size[] = { sizeof(unsigned int), // BPHYS_DATA_INDEX 3 * sizeof(float), // BPHYS_DATA_LOCATION 3 * sizeof(float), // BPHYS_DATA_VELOCITY @@ -108,6 +108,11 @@ int ptcache_data_size[] = { sizeof(BoidData) // case BPHYS_DATA_BOIDS }; +static int ptcache_extra_datasize[] = { + 0, + sizeof(ParticleSpring) +}; + /* forward declerations */ static int ptcache_file_compressed_read(PTCacheFile *pf, unsigned char *result, unsigned int len); static int ptcache_file_compressed_write(PTCacheFile *pf, unsigned char *in, unsigned int in_len, unsigned char *out, int mode); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a86363cf7ad..0ad36d31e8c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2924,7 +2924,17 @@ static void direct_link_material(FileData *fd, Material *ma) } /* ************ READ PARTICLE SETTINGS ***************** */ - +/* update this also to writefile.c */ +static char *ptcache_data_struct[] = { + "", // BPHYS_DATA_INDEX + "", // BPHYS_DATA_LOCATION + "", // BPHYS_DATA_VELOCITY + "", // BPHYS_DATA_ROTATION + "", // BPHYS_DATA_AVELOCITY / BPHYS_DATA_XCONST */ + "", // BPHYS_DATA_SIZE: + "", // BPHYS_DATA_TIMES: + "BoidData" // case BPHYS_DATA_BOIDS: +}; static void direct_link_pointcache(FileData *fd, PointCache *cache) { if((cache->flag & PTCACHE_DISK_CACHE)==0) { @@ -2941,7 +2951,7 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache) pm->data[i] = newdataadr(fd, pm->data[i]); /* the cache saves non-struct data without DNA */ - if(pm->data[i] && strcmp(ptcache_datastruct[i], "")==0 && (fd->flags & FD_FLAGS_SWITCH_ENDIAN)) { + if(pm->data[i] && strcmp(ptcache_data_struct[i], "")==0 && (fd->flags & FD_FLAGS_SWITCH_ENDIAN)) { int j, tot= (BKE_ptcache_data_size (i) * pm->totpoint)/4; /* data_size returns bytes */ int *poin= pm->data[i]; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index fd8fb8ad8a6..0e6adf74cd3 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -768,6 +768,22 @@ static void write_boid_state(WriteData *wd, BoidState *state) //for(; cond; cond=cond->next) // writestruct(wd, DATA, "BoidCondition", 1, cond); } + +/* update this also to readfile.c */ +static char *ptcache_data_struct[] = { + "", // BPHYS_DATA_INDEX + "", // BPHYS_DATA_LOCATION + "", // BPHYS_DATA_VELOCITY + "", // BPHYS_DATA_ROTATION + "", // BPHYS_DATA_AVELOCITY / BPHYS_DATA_XCONST */ + "", // BPHYS_DATA_SIZE: + "", // BPHYS_DATA_TIMES: + "BoidData" // case BPHYS_DATA_BOIDS: +}; +static char *ptcache_extra_struct[] = { + "", + "ParticleSpring" +}; static void write_pointcaches(WriteData *wd, ListBase *ptcaches) { PointCache *cache = ptcaches->first; @@ -786,18 +802,18 @@ static void write_pointcaches(WriteData *wd, ListBase *ptcaches) for(i=0; i<BPHYS_TOT_DATA; i++) { if(pm->data[i] && pm->data_types & (1<<i)) { - if(strcmp(ptcache_datastruct[i], "")==0) + if(strcmp(ptcache_data_struct[i], "")==0) writedata(wd, DATA, MEM_allocN_len(pm->data[i]), pm->data[i]); else - writestruct(wd, DATA, ptcache_datastruct[i], pm->totpoint, pm->data[i]); + writestruct(wd, DATA, ptcache_data_struct[i], pm->totpoint, pm->data[i]); } } for(; extra; extra=extra->next) { - if(strcmp(ptcache_extra_datastruct[extra->type], "")==0) + if(strcmp(ptcache_extra_struct[extra->type], "")==0) continue; writestruct(wd, DATA, "PTCacheExtra", 1, extra); - writestruct(wd, DATA, ptcache_extra_datastruct[extra->type], extra->totdata, extra->data); + writestruct(wd, DATA, ptcache_extra_struct[extra->type], extra->totdata, extra->data); } } } |