diff options
| author | Adriana Kobylak <anoo@us.ibm.com> | 2015-02-18 16:14:28 -0600 |
|---|---|---|
| committer | Adriana Kobylak <anoo@us.ibm.com> | 2015-02-18 16:14:28 -0600 |
| commit | 76ce4aadee1a7a890001affed54a0fb1110b1793 (patch) | |
| tree | 14a358904909e8fe0f631d414333c26de81e5042 /clib/src | |
| parent | aa8354ef7ee6606fe32453e3eedce9af8038230a (diff) | |
| download | ffs-76ce4aadee1a7a890001affed54a0fb1110b1793.tar.gz ffs-76ce4aadee1a7a890001affed54a0fb1110b1793.zip | |
Support to compile in 64bit for Ubuntu Little Endian
Diffstat (limited to 'clib/src')
| -rw-r--r-- | clib/src/array.c | 2 | ||||
| -rw-r--r-- | clib/src/crc32_main.c | 2 | ||||
| -rw-r--r-- | clib/src/ecc.c | 20 | ||||
| -rw-r--r-- | clib/src/list.c | 10 | ||||
| -rw-r--r-- | clib/src/memory_leak_detection.c | 40 | ||||
| -rw-r--r-- | clib/src/slab.c | 14 | ||||
| -rw-r--r-- | clib/src/table.c | 4 | ||||
| -rw-r--r-- | clib/src/tree.c | 6 | ||||
| -rw-r--r-- | clib/src/value.c | 8 | ||||
| -rw-r--r-- | clib/src/vector.c | 44 | ||||
| -rw-r--r-- | clib/src/vector_iter.c | 2 |
11 files changed, 71 insertions, 81 deletions
diff --git a/clib/src/array.c b/clib/src/array.c index 19659cb..4a0581a 100644 --- a/clib/src/array.c +++ b/clib/src/array.c @@ -99,7 +99,7 @@ const char *__array_msg[] = { #define __index_to_page_hashed(i,s) \ ({ \ - typeof(i) _h = int32_hash1(__index_to_page((i),(s))); \ + typeof(i) _h = int64_hash1(__index_to_page((i),(s))); \ _h; \ }) diff --git a/clib/src/crc32_main.c b/clib/src/crc32_main.c index d848eab..889d096 100644 --- a/clib/src/crc32_main.c +++ b/clib/src/crc32_main.c @@ -65,7 +65,7 @@ int main(int argc, const char *argv[]) void *in_buf = mmap(NULL, filesize, PROT_READ, MAP_PRIVATE, fd, 0); if (in_buf == MAP_FAILED) { /* FIXME could still try to use read().... */ - printf("mmap %d failed: %s\n", filesize, strerror(errno)); + printf("mmap %d failed: %s\n", (uint32_t)filesize, strerror(errno)); return 1; } diff --git a/clib/src/ecc.c b/clib/src/ecc.c index a161668..c9a5f38 100644 --- a/clib/src/ecc.c +++ b/clib/src/ecc.c @@ -50,17 +50,7 @@ #include "ecc.h" #include "builtin.h" #include "attribute.h" - -#ifndef be64toh -#include <byteswap.h> -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define be64toh(x) __bswap_64(x) -#define htobe64(x) __bswap_64(x) -#else -#define be64toh(x) (x) -#define htobe64(x) (x) -#endif -#endif +#include "misc.h" /* * This is an alternative way to calculate the ECC byte taken @@ -185,11 +175,11 @@ static void __ecc_dump(FILE * __out, uint32_t __addr, fprintf(__out, "[%.8s_%.8s %.*s%.2s%.*s %.8s_%.8s %.*s%.2s%.*s] ", - hex + 0, hex + 8, (c1 != e1) ? strlen(ansi_red) : 0, - ansi_red, hex + 16, (c1 != e1) ? strlen(ansi_norm) : 0, + hex + 0, hex + 8, (c1 != e1) ? (uint32_t)strlen(ansi_red) : 0, + ansi_red, hex + 16, (c1 != e1) ? (uint32_t)strlen(ansi_norm) : 0, ansi_norm, hex + 18, hex + 26, - (c2 != e2) ? strlen(ansi_red) : 0, ansi_red, hex + 34, - (c2 != e2) ? strlen(ansi_norm) : 0, ansi_norm); + (c2 != e2) ? (uint32_t)strlen(ansi_red) : 0, ansi_red, hex + 34, + (c2 != e2) ? (uint32_t)strlen(ansi_norm) : 0, ansi_norm); fprintf(__out, "[%.8s %.8s]\n", ascii + 0, ascii + 9); } diff --git a/clib/src/list.c b/clib/src/list.c index 03f6a20..5c33a48 100644 --- a/clib/src/list.c +++ b/clib/src/list.c @@ -40,14 +40,14 @@ void list_dump(list_t * self, FILE * out) fprintf(out, "===================================================================\n"); - fprintf(out, "head: %8x node: %8x\n", (uint32_t) self, - (uint32_t) & self->node); + fprintf(out, "head: %8lx node: %8lx\n", (ulong) self, + (ulong) & self->node); list_node_t *node = &self->node; do { - fprintf(out, " node: %8x - prev: %8x - next: %8x\n", - (uint32_t) node, (uint32_t) node->prev, - (uint32_t) node->next); + fprintf(out, " node: %8lx - prev: %8lx - next: %8lx\n", + (ulong) node, (ulong) node->prev, + (ulong) node->next); node = node->next; } while (node != &self->node); diff --git a/clib/src/memory_leak_detection.c b/clib/src/memory_leak_detection.c index 2705ef1..07c6bd3 100644 --- a/clib/src/memory_leak_detection.c +++ b/clib/src/memory_leak_detection.c @@ -148,7 +148,7 @@ static int Check_Leak_List(const void *p) /* Check the ending sentinel. */ Ending_Sentinel = - (Sentinel_t *) ((unsigned int)Current_Item + + (Sentinel_t *) ((unsigned long)Current_Item + sizeof(Memory_Leak_Data_t) + Current_Item->User_Size); if (*Ending_Sentinel == SENTINEL_VALUE) { @@ -165,7 +165,7 @@ static int Check_Leak_List(const void *p) Data_Start = (unsigned long)((unsigned - int) + long) Current_Item + sizeof @@ -216,7 +216,7 @@ static int Check_Leak_List(const void *p) " Size: %d\n" " Allocated in module %s, function %s, at line %d\n", Current_Item, - (void *)((unsigned int) + (void *)((unsigned long) Current_Item + sizeof (Memory_Leak_Data_t)), @@ -235,7 +235,7 @@ static int Check_Leak_List(const void *p) " Address: %p\n" " Size: %d\n" " Allocated in module %s, function %s, at line %d\n", Current_Item, - (void *)((unsigned int)Current_Item + + (void *)((unsigned long)Current_Item + sizeof(Memory_Leak_Data_t)), Current_Item->User_Size, Current_Item->Module_Name, @@ -261,7 +261,7 @@ static int Check_Leak_List(const void *p) Current_Item->Signature, Current_Item->Signature, LEAK_SIGNATURE, LEAK_SIGNATURE, - (void *)((unsigned int)Current_Item + + (void *)((unsigned long)Current_Item + sizeof(Memory_Leak_Data_t)), Current_Item->User_Size, Current_Item->User_Size, @@ -428,7 +428,7 @@ static void Remove_Memory_Allocation_From_Chain(Memory_Leak_Data_t * /* Calculate the address of the ending sentinel so that we can access it. */ Ending_Sentinel = - (Sentinel_t *) ((unsigned int)Memory_Leak_Data + + (Sentinel_t *) ((unsigned long)Memory_Leak_Data + sizeof(Memory_Leak_Data_t) + Memory_Leak_Data->User_Size); @@ -506,7 +506,7 @@ void Print_Leak_List(void) /* Check the ending sentinel. */ Ending_Sentinel = - (Sentinel_t *) ((unsigned int)Current_Item + + (Sentinel_t *) ((unsigned long)Current_Item + sizeof(Memory_Leak_Data_t) + Current_Item->User_Size); if (*Ending_Sentinel == SENTINEL_VALUE) { @@ -526,7 +526,7 @@ void Print_Leak_List(void) " Allocated in module %s, function %s, at line %d\n\n", Current_Item->Mem_Address, Current_Item, - (void *)((unsigned int)Current_Item + + (void *)((unsigned long)Current_Item + sizeof(Memory_Leak_Data_t)), Current_Item->Alignment, Current_Item->User_Size, @@ -543,7 +543,7 @@ void Print_Leak_List(void) " Alignment: %u\n" " Size: %d\n" " Allocated in module %s, function %s, at line %d\n\n", Current_Item->Mem_Address, Current_Item, - (void *)((unsigned int)Current_Item + + (void *)((unsigned long)Current_Item + sizeof(Memory_Leak_Data_t)), Current_Item->Alignment, Current_Item->User_Size, @@ -569,7 +569,7 @@ void Print_Leak_List(void) Current_Item->Signature, Current_Item->Signature, LEAK_SIGNATURE, LEAK_SIGNATURE, - (void *)((unsigned int)Current_Item + + (void *)((unsigned long)Current_Item + sizeof(Memory_Leak_Data_t)), Current_Item->Alignment, Current_Item->User_Size, @@ -677,7 +677,7 @@ int MEMORY_func(size_t sz, if (sz == 0) { Error = EINVAL; fprintf(stderr, - "MALLOC: request is invalid - size[%u] in module %s, function %s at line %d\n", + "MALLOC: request is invalid - size[%lu] in module %s, function %s at line %d\n", sz, mod_name, func, line); print_backtrace(); } @@ -702,7 +702,7 @@ int MEMORY_func(size_t sz, if (Error) { fprintf(stderr, - "MEMORY_func: request for aligned memory uses invalid alignment! size[%u], alignment [%u] in module %s, function %s at line %d\n", + "MEMORY_func: request for aligned memory uses invalid alignment! size[%lu], alignment [%u] in module %s, function %s at line %d\n", sz, Alignment, mod_name, func, line); } @@ -711,7 +711,7 @@ int MEMORY_func(size_t sz, if (Memory_Location == NULL) { Error = EINVAL; fprintf(stderr, - "MEMORY_func: Location to place address of allocated memory is NULL! size[%u], alignment [%u] in module %s, function %s at line %d\n", + "MEMORY_func: Location to place address of allocated memory is NULL! size[%lu], alignment [%u] in module %s, function %s at line %d\n", sz, Alignment, mod_name, func, line); } else *Memory_Location = NULL; @@ -748,13 +748,13 @@ int MEMORY_func(size_t sz, Memory_Leak_Data = (Memory_Leak_Data_t *) ptr; } else { Proposed_User_Address = - (unsigned int)ptr + + (unsigned long)ptr + sizeof(Memory_Leak_Data_t); Shift_Amount = Alignment - (Proposed_User_Address % Alignment); Memory_Leak_Data = - (Memory_Leak_Data_t *) ((unsigned int)ptr + + (Memory_Leak_Data_t *) ((unsigned long)ptr + Shift_Amount); } @@ -764,12 +764,12 @@ int MEMORY_func(size_t sz, /* Create the address to return to the caller. This address should be the first byte after our memory leak data. */ ptr = - (void *)((unsigned int)Memory_Leak_Data + + (void *)((unsigned long)Memory_Leak_Data + sizeof(Memory_Leak_Data_t)); /* Calculate the address of the trailing sentinel. */ Ending_Sentinel = - (Sentinel_t *) ((unsigned int)ptr + sz); + (Sentinel_t *) ((unsigned long)ptr + sz); /* Initialize our memory leak data. */ Memory_Leak_Data->Signature = LEAK_SIGNATURE; @@ -920,7 +920,7 @@ void FREE_func(const void *p, const char *mod_name, const char *func, * prevent wrap around when we subtract sizeof(Memory_Leak_Data_t) to get the starting address of * the memory leak data associated with p. */ - if ((p == NULL) || ((unsigned int)p <= sizeof(Memory_Leak_Data_t))) { + if ((p == NULL) || ((unsigned long)p <= sizeof(Memory_Leak_Data_t))) { fprintf(stderr, "FREE: request has invalid user address [%p]. Request came from module %s, function %s, line %d\n", p, mod_name, func, line); @@ -942,7 +942,7 @@ void FREE_func(const void *p, const char *mod_name, const char *func, if (!Check_Leak_List(p)) { /* Get access to the memory leak data. */ Memory_Leak_Data = - (Memory_Leak_Data_t *) ((unsigned int)p - + (Memory_Leak_Data_t *) ((unsigned long)p - sizeof(Memory_Leak_Data_t)); USER3_PRINT_LINE @@ -1178,7 +1178,7 @@ void *Realloc_func(void *p, size_t size, const char *mod_name, const char *func, /* Get access to the memory leak data. */ Memory_Leak_Data = (Memory_Leak_Data_t - *) ((unsigned int)p - + *) ((unsigned long)p - sizeof (Memory_Leak_Data_t)); diff --git a/clib/src/slab.c b/clib/src/slab.c index 1e5e5a8..9ee4353 100644 --- a/clib/src/slab.c +++ b/clib/src/slab.c @@ -63,7 +63,7 @@ typedef struct slab_node slab_node_t; struct slab_node { uint8_t magic[4]; - size_t free; + uint32_t free; tree_node_t node; uint32_t bitmap[]; @@ -98,7 +98,7 @@ static slab_node_t *__slab_grow(slab_t * self) node->free = SLAB_ALLOC_COUNT(self); - tree_node_init(&node->node, (const void *)int32_hash1((int32_t) node)); + tree_node_init(&node->node, (const void *)int64_hash1((int64_t) node)); splay_insert(&self->tree, &node->node); self->hdr.page_count++; @@ -108,21 +108,21 @@ static slab_node_t *__slab_grow(slab_t * self) /* ======================================================================= */ -int slab_init3(slab_t * self, const char *name, size_t alloc_size) +int slab_init3(slab_t * self, const char *name, uint32_t alloc_size) { size_t page_size = max(sysconf(_SC_PAGESIZE), __round_pow2(alloc_size * SLAB_PAGE_DIVISOR)); return slab_init5(self, name, alloc_size, page_size, page_size); } -int slab_init4(slab_t * self, const char *name, size_t alloc_size, +int slab_init4(slab_t * self, const char *name, uint32_t alloc_size, size_t page_size) { size_t align_size = (size_t) sysconf(_SC_PAGESIZE); return slab_init5(self, name, alloc_size, page_size, align_size); } -int slab_init5(slab_t * self, const char *name, size_t alloc_size, +int slab_init5(slab_t * self, const char *name, uint32_t alloc_size, size_t page_size, size_t align_size) { assert(self != NULL); @@ -144,7 +144,7 @@ int slab_init5(slab_t * self, const char *name, size_t alloc_size, return -1; } - size_t __page_size = (size_t) sysconf(_SC_PAGESIZE); + uint32_t __page_size = (uint32_t) sysconf(_SC_PAGESIZE); align_size = __round_pow2(align_size); if (align_size % __page_size) { @@ -286,7 +286,7 @@ int slab_free(slab_t * self, void *ptr) assert(node != NULL); if (unlikely(SLAB_NODE_MAGIC_CHECK(node->magic))) { - int32_t hash = int32_hash1((int32_t) node); + int64_t hash = int64_hash1((int64_t) node); if (splay_find(&self->tree, (const void *)hash) == NULL) { UNEXPECTED("'%s' invalid slab_node pointer, %p", self->hdr.name, ptr); diff --git a/clib/src/table.c b/clib/src/table.c index ee848cb..82a35aa 100644 --- a/clib/src/table.c +++ b/clib/src/table.c @@ -49,7 +49,7 @@ #define TABLE_PAGE_DIVISOR 32 /* ======================================================================= */ -int table_init(table_t * self, const char *name, size_t col_nr) +int table_init(table_t * self, const char *name, uint32_t col_nr) { assert(self != NULL); assert(name != NULL); @@ -635,7 +635,7 @@ void table_dump(table_t * self, FILE * out) } fprintf(out, - "table: [ size: %d cols: %d rows: %d name: '%s']\n", + "table: [ size: %ld cols: %ld rows: %ld name: '%s']\n", sizeof(value_t), table_columns(self), table_rows(self), self->hdr.name); diff --git a/clib/src/tree.c b/clib/src/tree.c index cb86ee3..5cd4c08 100644 --- a/clib/src/tree.c +++ b/clib/src/tree.c @@ -385,7 +385,7 @@ void tree_dump(tree_t * self, FILE * out) int __tree_node_dump(tree_node_t * node) { if (node != NULL) return fprintf(out, "node[%p] left[%p] right[%p] " - "parent[%p] -- key[%d]\n", + "parent[%p] -- key[%ld]\n", node, node->left, node->right, node->parent, (intptr_t) node->key); else @@ -414,7 +414,7 @@ void tree_node_dump(tree_node_t * node, FILE * out) } fprintf(out, "node:[%p] left[%p] right[%p] parent[%p] " - "key[%d]\n", root, root->left, root->right, + "key[%ld]\n", root, root->left, root->right, root->parent, (intptr_t) node->key); level++; @@ -591,7 +591,7 @@ int splay_remove(tree_t * self, tree_node_t * node) } #else if (self->root->left != NULL && self->root->right != NULL) { - if (parity(int32_hash1((int32_t) self->root))) { + if (parity(int64_hash1((int64_t) self->root))) { x = splay(self->root->left, node->key, self->compare); x->right = self->root->right; diff --git a/clib/src/value.c b/clib/src/value.c index cadf8fd..899221e 100644 --- a/clib/src/value.c +++ b/clib/src/value.c @@ -74,7 +74,7 @@ void value_dump(const value_t * self, FILE * out) break; case VT_I64: fprintf(out, "value: [ data: %lld size: %d type: %s ] %p\n", - self->i64, self->size, type_name[self->type], self); + (long long)self->i64, self->size, type_name[self->type], self); break; case VT_U8: fprintf(out, "value: [ data: %ud size: %d type: %s ] %p\n", @@ -90,7 +90,7 @@ void value_dump(const value_t * self, FILE * out) break; case VT_U64: fprintf(out, "value: [ data: %lld size: %d type: %s ] %p\n", - self->u64, self->size, type_name[self->type], self); + (long long)self->u64, self->size, type_name[self->type], self); break; case VT_REAL32: fprintf(out, "value: [ data: %f size: %d type: %s ] %p\n", @@ -112,7 +112,7 @@ void value_dump(const value_t * self, FILE * out) break; case VT_STR_OFF: fprintf(out, "value: [ data: %llu size: %d type: %s ] %p\n", - self->u64, self->size, type_name[self->type], self); + (long long)self->u64, self->size, type_name[self->type], self); break; case VT_STR_CONST: fprintf(out, "value: [ data: '%s' size: %d type: %s ] %p\n", @@ -133,7 +133,7 @@ void value_dump(const value_t * self, FILE * out) break; case VT_BLOB_OFF: fprintf(out, "value: [ data: %llu size: %d type: %s ] %p\n", - self->u64, self->size, type_name[self->type], self); + (long long)self->u64, self->size, type_name[self->type], self); break; case VT_BLOB_FILE: fprintf(out, "value: [ data: '%s' size: %d type: %s ] %p\n", diff --git a/clib/src/vector.c b/clib/src/vector.c index c4f44cc..73aa5c4 100644 --- a/clib/src/vector.c +++ b/clib/src/vector.c @@ -83,21 +83,21 @@ struct vector_node { #define __index_to_page_hashed(i,s) \ ({ \ - typeof(i) _h = int32_hash1(__index_to_page((i),(s))); \ + typeof(i) _h = int64_hash1(__index_to_page((i),(s))); \ _h; \ }) /*! @endcond */ /* ======================================================================= */ -static vector_node_t *__vector_find_page(vector_t * self, size_t idx) +static vector_node_t *__vector_find_page(vector_t * self, uint64_t idx) { const void *hash; hash = (const void *)__index_to_page_hashed(idx, self->hdr.elem_num); tree_node_t *node = tree_find(&self->tree, hash); if (unlikely(node == NULL)) { - UNEXPECTED("'%d' index out of range", idx); + UNEXPECTED("'%ld' index out of range", idx); return NULL; } @@ -140,9 +140,9 @@ static vector_node_t *__vector_grow(vector_t * self) node->magic[2] = VECTOR_NODE_MAGIC[2]; node->magic[3] = VECTOR_NODE_MAGIC[3]; - node->address = (uint32_t) node; + node->address = (ulong) node; - size_t hash = __index_to_page_hashed(vector_capacity(self), + uint64_t hash = __index_to_page_hashed(vector_capacity(self), self->hdr.elem_num); tree_node_init(&node->node, (const void *)hash); @@ -162,15 +162,15 @@ static int __vector_compare(const int i1, const int i2) /* ======================================================================= */ -int vector_init3(vector_t * self, const char *name, size_t elem_size) +int vector_init3(vector_t * self, const char *name, uint32_t elem_size) { - size_t page_size = max(sysconf(_SC_PAGESIZE), + uint32_t page_size = max(sysconf(_SC_PAGESIZE), __round_pow2(elem_size * VECTOR_PAGE_DIVISOR)); return vector_init4(self, name, elem_size, page_size); } -int vector_init4(vector_t * self, const char *name, size_t elem_size, - size_t page_size) +int vector_init4(vector_t * self, const char *name, uint32_t elem_size, + uint32_t page_size) { assert(self != NULL); @@ -251,7 +251,7 @@ int vector_delete(vector_t * self) return 0; } -const void *vector_at(vector_t * self, size_t idx) +const void *vector_at(vector_t * self, uint32_t idx) { assert(self != NULL); assert(!MAGIC_CHECK(self->hdr.id, VECTOR_MAGIC)); @@ -261,12 +261,12 @@ const void *vector_at(vector_t * self, size_t idx) return node->data + (self->hdr.elem_size * (idx % self->hdr.elem_num)); } -int vector_get3(vector_t * self, size_t idx, void *ptr) +int vector_get3(vector_t * self, uint32_t idx, void *ptr) { return vector_get4(self, idx, ptr, 1); } -int vector_get4(vector_t * self, size_t idx, void *ptr, size_t count) +int vector_get4(vector_t * self, uint32_t idx, void *ptr, uint32_t count) { assert(self != NULL); assert(!MAGIC_CHECK(self->hdr.id, VECTOR_MAGIC)); @@ -283,7 +283,7 @@ int vector_get4(vector_t * self, size_t idx, void *ptr, size_t count) return 0; } -static inline int __vector_put(vector_t * self, size_t idx, const void *ptr) +static inline int __vector_put(vector_t * self, uint32_t idx, const void *ptr) { assert(self != NULL); assert(!MAGIC_CHECK(self->hdr.id, VECTOR_MAGIC)); @@ -303,12 +303,12 @@ static inline int __vector_put(vector_t * self, size_t idx, const void *ptr) return 0; } -int vector_put3(vector_t * self, size_t idx, const void *ptr) +int vector_put3(vector_t * self, uint32_t idx, const void *ptr) { return vector_put4(self, idx, ptr, 1); } -int vector_put4(vector_t * self, size_t idx, const void *ptr, size_t count) +int vector_put4(vector_t * self, uint32_t idx, const void *ptr, uint32_t count) { assert(self != NULL); assert(!MAGIC_CHECK(self->hdr.id, VECTOR_MAGIC)); @@ -327,13 +327,13 @@ int vector_put4(vector_t * self, size_t idx, const void *ptr, size_t count) return 0; } -size_t vector_size1(vector_t * self) +uint32_t vector_size1(vector_t * self) { assert(self != NULL); return self->hdr.size; } -int vector_size2(vector_t * self, size_t size) +int vector_size2(vector_t * self, uint32_t size) { assert(self != NULL); assert(!MAGIC_CHECK(self->hdr.id, VECTOR_MAGIC)); @@ -355,21 +355,21 @@ int vector_size2(vector_t * self, size_t size) return self->hdr.size = size; } -size_t vector_pages(vector_t * self) +uint32_t vector_pages(vector_t * self) { assert(self != NULL); assert(!MAGIC_CHECK(self->hdr.id, VECTOR_MAGIC)); return self->hdr.page_count; } -size_t vector_capacity(vector_t * self) +uint32_t vector_capacity(vector_t * self) { assert(self != NULL); assert(!MAGIC_CHECK(self->hdr.id, VECTOR_MAGIC)); return self->hdr.page_count * self->hdr.elem_num; } -size_t vector_elem_size(vector_t * self) +uint32_t vector_elem_size(vector_t * self) { assert(self != NULL); assert(!MAGIC_CHECK(self->hdr.id, VECTOR_MAGIC)); @@ -557,7 +557,7 @@ ssize_t vector_load(vector_t * self, FILE * in) return -1; } - node->address = (uint32_t) node; + node->address = (ulong) node; tree_node_init(&node->node, node->node.key); splay_insert(&self->tree, &node->node); @@ -626,7 +626,7 @@ int vector_receive(vector_t * self, mqueue_t * mq) assert(!VECTOR_NODE_MAGIC_CHECK(node->magic)); - node->address = (uint32_t) node; + node->address = (ulong) node; tree_node_init(&node->node, node->node.key); splay_insert(&self->tree, &node->node); diff --git a/clib/src/vector_iter.c b/clib/src/vector_iter.c index c7d0c50..f3db641 100644 --- a/clib/src/vector_iter.c +++ b/clib/src/vector_iter.c @@ -173,7 +173,7 @@ int vector_iter_pos2(vector_iter_t * self, size_t pos) assert(self != NULL); if (vector_size(self->vector) <= pos) { - UNEXPECTED("'%d' index out-of-range", pos); + UNEXPECTED("'%ld' index out-of-range", pos); return -1; } |

