Win64: please check my changes if you ran across them ;) But should be fine since no additional crashes were reported!
This commit is contained in:
@@ -256,11 +256,7 @@ int BLI_ghashutil_ptrcmp(void *a, void *b) {
|
||||
}
|
||||
|
||||
unsigned int BLI_ghashutil_inthash(void *ptr) {
|
||||
#if defined(_WIN64)
|
||||
unsigned __int64 key = (unsigned __int64)ptr;
|
||||
#else
|
||||
unsigned long key = (unsigned long)ptr;
|
||||
#endif
|
||||
uintptr_t key = (uintptr_t)ptr;
|
||||
|
||||
key += ~(key << 16);
|
||||
key ^= (key >> 5);
|
||||
|
||||
@@ -62,6 +62,8 @@
|
||||
#include "BKE_utildefines.h"
|
||||
#include <errno.h>
|
||||
|
||||
#include "BLO_sys_types.h" // for intptr_t support
|
||||
|
||||
/* implementations: */
|
||||
char *first_slash(char *string) {
|
||||
char *ffslash, *fbslash;
|
||||
@@ -72,7 +74,7 @@ char *first_slash(char *string) {
|
||||
if (!ffslash) return fbslash;
|
||||
else if (!fbslash) return ffslash;
|
||||
|
||||
if ((long)ffslash < (long)fbslash) return ffslash;
|
||||
if ((intptr_t)ffslash < (intptr_t)fbslash) return ffslash;
|
||||
else return fbslash;
|
||||
}
|
||||
|
||||
@@ -85,7 +87,7 @@ char *BLI_last_slash(const char *string) {
|
||||
if (!lfslash) return lbslash;
|
||||
else if (!lbslash) return lfslash;
|
||||
|
||||
if ((long)lfslash < (long)lbslash) return lbslash;
|
||||
if ((intptr_t)lfslash < (intptr_t)lbslash) return lbslash;
|
||||
else return lfslash;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ typedef struct chardesc {
|
||||
short llx, lly; /* bounding box */
|
||||
short urx, ury;
|
||||
short *data; /* char data */
|
||||
long datalen;
|
||||
intptr_t datalen;
|
||||
} chardesc;
|
||||
|
||||
typedef struct objfnt {
|
||||
|
||||
@@ -1970,7 +1970,7 @@ void BLI_timestr(double _time, char *str)
|
||||
|
||||
int BLI_int_from_pointer(void *poin)
|
||||
{
|
||||
long lval= (long)poin;
|
||||
intptr_t lval= (intptr_t)poin;
|
||||
|
||||
return (int)(lval>>3);
|
||||
}
|
||||
@@ -1978,17 +1978,17 @@ int BLI_int_from_pointer(void *poin)
|
||||
void *BLI_pointer_from_int(int val)
|
||||
{
|
||||
static int firsttime= 1;
|
||||
static long basevalue= 0;
|
||||
static intptr_t basevalue= 0;
|
||||
|
||||
if(firsttime) {
|
||||
void *poin= malloc(10000);
|
||||
basevalue= (long)poin;
|
||||
basevalue= (intptr_t)poin;
|
||||
basevalue &= ~PMASK;
|
||||
printf("base: %d pointer %p\n", basevalue, poin); /* debug */
|
||||
firsttime= 0;
|
||||
free(poin);
|
||||
}
|
||||
return (void *)(basevalue | (((long)val)<<3));
|
||||
return (void *)(basevalue | (((intptr_t)val)<<3));
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user