diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-08-17 20:36:37 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-08-17 20:36:37 +0400 |
commit | 68765dc94bbb1bf924caa753d62d3f6029c60db5 (patch) | |
tree | bb0077c2fea6a4bf949c0cb83b50f432772430b2 /source/blender/blenloader | |
parent | fda00bc034de33371c4c7471467889f7d33c780b (diff) |
Win64 commit: first little commit to test how it compiles on other plattforms - I'll then commit the other changes if all is fine :)
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/BLO_sys_types.h | 8 | ||||
-rw-r--r-- | source/blender/blenloader/intern/genfile.c | 10 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 6 |
4 files changed, 20 insertions, 8 deletions
diff --git a/source/blender/blenloader/BLO_sys_types.h b/source/blender/blenloader/BLO_sys_types.h index a1885894fe3..a519183a1e1 100644 --- a/source/blender/blenloader/BLO_sys_types.h +++ b/source/blender/blenloader/BLO_sys_types.h @@ -64,6 +64,14 @@ typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; +#ifdef _WIN64 +typedef __int64 intptr_t; +typedef unsigned __int64 uintptr_t; +#else +typedef long intptr_t; +typedef unsigned long uintptr_t; +#endif + #elif defined(__linux__) /* Linux-i386, Linux-Alpha, Linux-ppc */ diff --git a/source/blender/blenloader/intern/genfile.c b/source/blender/blenloader/intern/genfile.c index 87c859de839..86338ca9e89 100644 --- a/source/blender/blenloader/intern/genfile.c +++ b/source/blender/blenloader/intern/genfile.c @@ -58,6 +58,8 @@ #include "genfile.h" +#include "BLO_sys_types.h" // for intptr_t support + /* gcc 4.1 on mingw was complaining that __int64 was alredy defined actually is saw the line below as typedef long long long long... Anyhow, since its alredy defined, its safe to do an ifndef here- Cambpell*/ @@ -315,7 +317,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap) /* in sdna->data the data, now we convert that to something understandable */ { int *data, *verg; - long nr; + intptr_t nr; short *sp; char str[8], *cp; @@ -351,7 +353,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap) cp++; nr++; } - nr= (long)cp; /* prevent BUS error */ + nr= (intptr_t)cp; /* prevent BUS error */ nr= (nr+3) & ~3; cp= (char *)nr; @@ -389,7 +391,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap) cp++; nr++; } - nr= (long)cp; /* prevent BUS error */ + nr= (intptr_t)cp; /* prevent BUS error */ nr= (nr+3) & ~3; cp= (char *)nr; @@ -1098,7 +1100,7 @@ int dna_elem_offset(struct SDNA *sdna, char *stype, char *vartype, char *name) int SDNAnr= dna_findstruct_nr(sdna, stype); short *spo= sdna->structs[SDNAnr]; char *cp= find_elem(sdna, vartype, name, spo, NULL, NULL); - return (int)((long)cp); + return (int)((intptr_t)cp); } diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index f56b261efe2..5a75b5c8b11 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -63,6 +63,8 @@ #include "BLO_readblenfile.h" +#include "BLO_sys_types.h" // needed for intptr_t + /** * IDType stuff, I plan to move this * out into its own file + prefix, and @@ -193,7 +195,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp) buf[2]= buf[2]?buf[2]:' '; buf[3]= buf[3]?buf[3]:' '; - fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long)bhead->len+sizeof(BHead)); + fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (intptr_t)bhead->len+sizeof(BHead)); } } fprintf(fp, "]\n"); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ad19cde3c9b..495a35bbe4c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3593,9 +3593,9 @@ static void direct_link_scene(FileData *fd, Scene *sce) { Sequence temp; char *poin; - long offset; + intptr_t offset; - offset= ((long)&(temp.seqbase)) - ((long)&temp); + offset= ((intptr_t)&(temp.seqbase)) - ((intptr_t)&temp); /* root pointer */ if(ed->seqbasep == old_seqbasep) { @@ -4094,7 +4094,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc) while(se) { se->v1= newdataadr(fd, se->v1); se->v2= newdataadr(fd, se->v2); - if( (long)se->v1 > (long)se->v2) { + if( (intptr_t)se->v1 > (intptr_t)se->v2) { sv= se->v1; se->v1= se->v2; se->v2= sv; |