Win64 commit: first little commit to test how it compiles on other plattforms - I'll then commit the other changes if all is fine :)

This commit is contained in:
Daniel Genrich 2008-08-17 16:36:37 +00:00
parent fda00bc034
commit 68765dc94b
4 changed files with 20 additions and 8 deletions

@ -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 */

@ -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);
}

@ -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");

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