From: David Lichteblau Date: Mon, 12 Nov 2012 16:01:08 +0000 (+0100) Subject: LLP64: change long to uword_t (thereby flipping signedness) X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=37da4165c0e4af1aa559762ea8b65ae061cd310f;p=sbcl.git LLP64: change long to uword_t (thereby flipping signedness) Replace `long' with `uword_t' in the runtime where applicable. In these cases, signed long could have been translated literally as sword_t to support LLP64 platforms, but uword_t seems clearer. Thanks to Anton Kovalenko. --- diff --git a/src/runtime/dynbind.c b/src/runtime/dynbind.c index 9e928a3..8d8da8c 100644 --- a/src/runtime/dynbind.c +++ b/src/runtime/dynbind.c @@ -40,7 +40,7 @@ void bind_variable(lispobj symbol, lispobj value, void *th) &((struct symbol *)native_pointer(TLS_INDEX_LOCK))->value; FSHOW_SIGNAL((stderr, "entering dynbind tls alloc\n")); set_pseudo_atomic_atomic(thread); - get_spinlock(tls_index_lock,(long)th); + get_spinlock(tls_index_lock,(uword_t)th); if(!sym->tls_index) { sym->tls_index=SymbolValue(FREE_TLS_INDEX,0); SetSymbolValue(FREE_TLS_INDEX, sym->tls_index+N_WORD_BYTES, 0); diff --git a/src/runtime/gc-common.c b/src/runtime/gc-common.c index 887337e..1fe6400 100644 --- a/src/runtime/gc-common.c +++ b/src/runtime/gc-common.c @@ -236,7 +236,7 @@ trans_code(struct code *code) { struct code *new_code; lispobj first, l_code, l_new_code; - long nheader_words, ncode_words, nwords; + uword_t nheader_words, ncode_words, nwords; unsigned long displacement; lispobj fheaderl, *prev_pointer; diff --git a/src/runtime/monitor.c b/src/runtime/monitor.c index 45a9b00..9ae58cd 100644 --- a/src/runtime/monitor.c +++ b/src/runtime/monitor.c @@ -240,7 +240,7 @@ search_cmd(char **ptr) return; } if (more_p(ptr)) { - addr = (lispobj *)native_pointer((long)parse_addr(ptr)); + addr = (lispobj *)native_pointer((uword_t)parse_addr(ptr)); if (more_p(ptr)) { count = parse_number(ptr); } @@ -274,7 +274,7 @@ search_cmd(char **ptr) addr = end; end += 2; if (widetag_of(obj) == SIMPLE_FUN_HEADER_WIDETAG) { - print((long)addr | FUN_POINTER_LOWTAG); + print((uword_t)addr | FUN_POINTER_LOWTAG); } else if (other_immediate_lowtag_p(obj)) { print((lispobj)addr | OTHER_POINTER_LOWTAG); } else { diff --git a/src/runtime/os.h b/src/runtime/os.h index 7efc80d..d6d34bc 100644 --- a/src/runtime/os.h +++ b/src/runtime/os.h @@ -156,12 +156,12 @@ extern void os_deallocate(os_vm_address_t addr, os_vm_size_t len); * be functions. */ #define os_trunc_to_page(addr) \ - (os_vm_address_t)(((long)(addr))&~(os_vm_page_size-1)) + (os_vm_address_t)(((uword_t)(addr))&~(os_vm_page_size-1)) #define os_round_up_to_page(addr) \ os_trunc_to_page((addr)+(os_vm_page_size-1)) #define os_trunc_size_to_page(size) \ - (os_vm_size_t)(((long)(size))&~(os_vm_page_size-1)) + (os_vm_size_t)(((uword_t)(size))&~(os_vm_page_size-1)) #define os_round_up_size_to_page(size) \ os_trunc_size_to_page((size)+(os_vm_page_size-1)) diff --git a/src/runtime/parse.c b/src/runtime/parse.c index 66292af..1edfe18 100644 --- a/src/runtime/parse.c +++ b/src/runtime/parse.c @@ -49,10 +49,10 @@ static void skip_ws(char **ptr) (*ptr)++; } -static boolean string_to_long(char *token, long *value) +static boolean string_to_long(char *token, uword_t *value) { int base, digit; - long num; + uword_t num; char *ptr; if (token == 0) @@ -196,11 +196,11 @@ char *token; } #endif -long parse_number(ptr) +uword_t parse_number(ptr) char **ptr; { char *token = parse_token(ptr); - long result; + uword_t result; if (token == NULL) { printf("expected a number\n"); @@ -233,7 +233,7 @@ char **ptr; result &= ~7; } else { - long value; + uword_t value; if (!string_to_long(token, &value)) { printf("invalid number: ``%s''\n", token); throw_to_monitor(); @@ -316,9 +316,9 @@ char **ptr; { struct thread *thread=arch_os_get_current_thread(); char *token = parse_token(ptr); - long pointer; + uword_t pointer; lispobj result; - long value; + uword_t value; if (token == NULL) { printf("expected an object\n"); diff --git a/src/runtime/parse.h b/src/runtime/parse.h index 510f91f..96adef5 100644 --- a/src/runtime/parse.h +++ b/src/runtime/parse.h @@ -14,4 +14,4 @@ extern boolean more_p(char **ptr); extern char *parse_token(char **ptr); extern lispobj parse_lispobj(char **ptr); extern char *parse_addr(char **ptr); -extern long parse_number(char **ptr); +extern uword_t parse_number(char **ptr); diff --git a/src/runtime/save.c b/src/runtime/save.c index 8520eb9..1dc6918 100644 --- a/src/runtime/save.c +++ b/src/runtime/save.c @@ -197,7 +197,7 @@ output_space(FILE *file, int id, lispobj *addr, lispobj *end, core_compression_level); write_lispobj(data, file); - write_lispobj((long)addr / os_vm_page_size, file); + write_lispobj((uword_t)addr / os_vm_page_size, file); write_lispobj((bytes + os_vm_page_size - 1) / os_vm_page_size, file); }