[pypy-commit] cffi cffi-1.0: Use uintptr_t instead of unsigned long
arigo
noreply at buildbot.pypy.org
Tue Apr 14 15:35:21 CEST 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1696:ee25743d7af9
Date: 2015-04-11 20:33 +0200
http://bitbucket.org/cffi/cffi/changeset/ee25743d7af9/
Log: Use uintptr_t instead of unsigned long
diff --git a/new/parse_c_type.c b/new/parse_c_type.c
--- a/new/parse_c_type.c
+++ b/new/parse_c_type.c
@@ -45,7 +45,7 @@
enum token_e kind;
size_t size;
_cffi_opcode_t *output;
- unsigned long output_index;
+ size_t output_index;
} token_t;
static int is_space(char x)
diff --git a/new/parse_c_type.h b/new/parse_c_type.h
--- a/new/parse_c_type.h
+++ b/new/parse_c_type.h
@@ -3,9 +3,9 @@
typedef void *_cffi_opcode_t;
-#define _CFFI_OP(opcode, arg) (_cffi_opcode_t)(opcode | (((unsigned long)(arg)) << 8))
-#define _CFFI_GETOP(cffi_opcode) ((unsigned char)(unsigned long)cffi_opcode)
-#define _CFFI_GETARG(cffi_opcode) (((unsigned long)cffi_opcode) >> 8)
+#define _CFFI_OP(opcode, arg) (_cffi_opcode_t)(opcode | (((uintptr_t)(arg)) << 8))
+#define _CFFI_GETOP(cffi_opcode) ((unsigned char)(uintptr_t)cffi_opcode)
+#define _CFFI_GETARG(cffi_opcode) (((uintptr_t)cffi_opcode) >> 8)
#define _CFFI_OP_PRIMITIVE 1
#define _CFFI_OP_POINTER 3
More information about the pypy-commit
mailing list