diff options
| author | Anatol Belski <ab@php.net> | 2015-08-15 11:26:20 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2015-08-15 11:27:07 +0200 |
| commit | 228eaf5bc44eb9b91e1bd08862973fcad547e919 (patch) | |
| tree | fb3f6953d96d15188577ec934fbade4d547b4440 | |
| parent | 0bd7d7a3691cee4e916d1008500cf21b80e03056 (diff) | |
| download | php-git-228eaf5bc44eb9b91e1bd08862973fcad547e919.tar.gz | |
fix pointer truncation cases
| -rw-r--r-- | ext/mbstring/oniguruma/regint.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/mbstring/oniguruma/regint.h b/ext/mbstring/oniguruma/regint.h index 0fba09bb58..7ab233aeb4 100644 --- a/ext/mbstring/oniguruma/regint.h +++ b/ext/mbstring/oniguruma/regint.h @@ -227,17 +227,17 @@ } while(0) /* sizeof(OnigCodePoint) */ -#define WORD_ALIGNMENT_SIZE SIZEOF_LONG +#define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T #define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\ (pad_size) = WORD_ALIGNMENT_SIZE \ - - ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\ + - ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\ if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\ } while (0) #define ALIGNMENT_RIGHT(addr) do {\ (addr) += (WORD_ALIGNMENT_SIZE - 1);\ - (addr) -= ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\ + (addr) -= ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\ } while (0) #endif /* PLATFORM_UNALIGNED_WORD_ACCESS */ @@ -688,7 +688,11 @@ typedef struct { BBuf* mbuf; /* multi-byte info or NULL */ } CClassNode; +#ifdef _WIN64 +typedef __int64 OnigStackIndex; +#else typedef long OnigStackIndex; +#endif typedef struct _OnigStackType { unsigned int type; |
