# HG changeset patch # User crestani # Date 1187345808 0 # Node ID 93bd75c45dca412646d7fa2b7eb2ef9e1f2f7322 # Parent 9a633a00c3f235ae9528f6f5ac12ed42450e16b2 [xemacs-hg @ 2007-08-17 10:16:46 by crestani] 2007-08-17 Marcus Crestani * mc-alloc.c (L1_INDEX): * mc-alloc.c (PAGE_SIZE_ALIGNMENT): * mc-alloc.c (set_bit): * mc-alloc.c (init_mc_allocator): Use EMACS_UINT with bit shifting. diff -r 9a633a00c3f2 -r 93bd75c45dca src/ChangeLog --- a/src/ChangeLog Fri Aug 17 08:08:10 2007 +0000 +++ b/src/ChangeLog Fri Aug 17 10:16:48 2007 +0000 @@ -1,3 +1,11 @@ +2007-08-17 Marcus Crestani + + * mc-alloc.c (L1_INDEX): + * mc-alloc.c (PAGE_SIZE_ALIGNMENT): + * mc-alloc.c (set_bit): + * mc-alloc.c (init_mc_allocator): Use EMACS_UINT with bit + shifting. + 2007-08-15 Marcus Crestani * database.c (dbm_map): Add typecast. diff -r 9a633a00c3f2 -r 93bd75c45dca src/mc-alloc.c --- a/src/mc-alloc.c Fri Aug 17 08:08:10 2007 +0000 +++ b/src/mc-alloc.c Fri Aug 17 10:16:48 2007 +0000 @@ -179,11 +179,11 @@ #ifdef USE_HASH_TABLE # define HASH(hi) ((hi) & (LEVEL1_SIZE - 1)) -# define L1_INDEX(p) HASH ((EMACS_INT) p >> (LOG_LEVEL2_SIZE + LOG_PAGE_SIZE)) +# define L1_INDEX(p) HASH ((EMACS_UINT) p >> (LOG_LEVEL2_SIZE + LOG_PAGE_SIZE)) #else -# define L1_INDEX(p) ((EMACS_INT) p >> (LOG_LEVEL2_SIZE + LOG_PAGE_SIZE)) +# define L1_INDEX(p) ((EMACS_UINT) p >> (LOG_LEVEL2_SIZE + LOG_PAGE_SIZE)) #endif -#define L2_INDEX(p) (((EMACS_INT) p >> LOG_PAGE_SIZE) & (LEVEL2_SIZE - 1)) +#define L2_INDEX(p) (((EMACS_UINT) p >> LOG_PAGE_SIZE) & (LEVEL2_SIZE - 1)) @@ -393,7 +393,7 @@ #define BYTES_TO_PAGES(bytes) (div_PAGE_SIZE ((bytes + (PAGE_SIZE - 1)))) #define PAGE_SIZE_ALIGNMENT(address) \ - (void *) ((((EMACS_INT) (address)) + PAGE_SIZE) & ~(PAGE_SIZE - 1)) + (void *) ((((EMACS_UINT) (address)) + PAGE_SIZE) & ~(PAGE_SIZE - 1)) #define PH_ON_FREE_LIST_P(ph) \ (ph && PH_PLH (ph) && (PLH_LIST_TYPE (PH_PLH (ph)) == FREE_LIST)) @@ -618,7 +618,7 @@ /* Bit_Arrays bit at pos to val. */ static void -set_bit (Rawbyte *bit_array, EMACS_INT pos, EMACS_INT val) +set_bit (Rawbyte *bit_array, EMACS_INT pos, EMACS_UINT val) { #if N_MARK_BITS > 1 EMACS_INT i; @@ -1648,7 +1648,7 @@ ABORT (); } - page_size_div_2 = (EMACS_INT) SYS_PAGE_SIZE >> 1; + page_size_div_2 = (EMACS_UINT) SYS_PAGE_SIZE >> 1; mc_allocator_globals.used_heap_pages = (page_list_header *) xmalloc_and_zero ((N_USED_PAGE_LISTS + 1)