From: teodor Date: Thu, 19 Oct 2006 11:55:54 +0000 (+0000) Subject: Fix warnings on x86_64 X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=172f787b7c99ced4f9ea9d35f2bfa6953d25dc8b;p=tedtools.git Fix warnings on x86_64 --- diff --git a/expected/mem b/expected/mem index c3578c6..3291825 100644 --- a/expected/mem +++ b/expected/mem @@ -6,7 +6,7 @@ mixed:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz free:1048380 mixed:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz free:1048320 mixed:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz free:1048320 freenew:0 mixed:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz free:1048320 freechild:1048508 -Child: 0 +Child: IS NULL lc:abcdefghijklmnopqrstuvwxyz uc:ABCDEFGHIJKLMNOPQRSTUVWXYZ free:1048500 lc:abcdefghijklmnopqrstuvwxyz free:1048536 uc:ABCDEFGHIJKLMNOPQRSTUVWXYZ free:1048500 @@ -15,4 +15,4 @@ mixed:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz free:1048396 mixed:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz free:1048336 mixed:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz free:1048336 freenew:0 mixed:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz free:1048336 freechild:1048512 -Child: 0 +Child: IS NULL diff --git a/flatdbtest.c b/flatdbtest.c index ec6fb69..383d81e 100644 --- a/flatdbtest.c +++ b/flatdbtest.c @@ -89,7 +89,7 @@ main(int argn, char *argv[]) { tlog(TL_CRIT|TL_EXIT, "FDBPut failed: %d", rc); } tfree(record); - printf("Put: off:%d len:%d '%s'\n", (int)offset, len-RECHDRSZ, optarg); + printf("Put: off:%d len:%d '%s'\n", (int)offset, (int)(len-RECHDRSZ), optarg); break; case 'g': if (!isopened) {usage();} @@ -98,7 +98,7 @@ main(int argn, char *argv[]) { FDBClose(&db); tlog(TL_CRIT|TL_EXIT, "FDBGet failed: %d", rc); } - printf("Get: off:%d len:%d '", (int)offset, record->length - RECHDRSZ); + printf("Get: off:%d len:%d '", (int)offset, (int)(record->length - RECHDRSZ)); fwrite(record->data, record->length - RECHDRSZ, 1, stdout); puts("'"); tfree(record); @@ -117,7 +117,7 @@ main(int argn, char *argv[]) { if ( db.listcur ) { puts("List of free space:"); for(i=0;ichunk->freesize); + printf("lc:%s uc:%s free:%d\n", ptr, ptr1, (int)base->chunk->freesize); mcfree(ptr1); - printf("lc:%s free:%d\n", ptr, base->chunk->freesize); + printf("lc:%s free:%d\n", ptr, (int)base->chunk->freesize); ptr1 = mcstrdup(base, ptr); mcfree(ptr); strupper(ptr1); - printf("uc:%s free:%d\n", ptr1, base->chunk->freesize); + printf("uc:%s free:%d\n", ptr1, (int)base->chunk->freesize); ptr= mcstrdup(base, ptr1); strlower(ptr); ptr1 =mcrealloc(ptr1, 60); strcat(ptr1, ptr); - printf("mixed:%s free:%d\n", ptr1, base->chunk->freesize); + printf("mixed:%s free:%d\n", ptr1, (int)base->chunk->freesize); ptr = mcrealloc(ptr1, 59); tassert( ptr==ptr1 ); - printf("mixed:%s free:%d\n", ptr, base->chunk->freesize); + printf("mixed:%s free:%d\n", ptr, (int)base->chunk->freesize); ptr = mcrealloc(ptr1, 120); tassert( ptr==ptr1 ); - printf("mixed:%s free:%d\n", ptr, base->chunk->freesize); + printf("mixed:%s free:%d\n", ptr, (int)base->chunk->freesize); ptr1 = mcalloc(base, CNTXCHUNK); strcpy(ptr1, ptr); - printf("mixed:%s free:%d freenew:%d\n", ptr1, base->chunk->freesize, base->chunk->next->freesize); + printf("mixed:%s free:%d freenew:%d\n", ptr1, (int)base->chunk->freesize, (int)base->chunk->next->freesize); ptr1= mcstrdup(child, ptr); - printf("mixed:%s free:%d freechild:%d\n", ptr1, base->chunk->freesize, child->chunk->freesize); + printf("mixed:%s free:%d freechild:%d\n", ptr1, (int)base->chunk->freesize, (int)child->chunk->freesize); freeMemoryContext(child); - printf("Child: %d\n", (int)(base->child)); + printf("Child: IS %sNULL\n", (base->child == NULL) ? "" : "NOT "); child = allocMemoryContext(base, flags); freeMemoryContext(base); diff --git a/shmem.c b/shmem.c index 933dc4b..696db8d 100644 --- a/shmem.c +++ b/shmem.c @@ -68,7 +68,7 @@ attachSharedMemory(int key, char *path, int size, int rdonly) { flags = ( rdonly ) ? SHM_RDONLY : 0; shm = shmat(shm_id, 0, flags); /* Attach SHM segment */ - if ( (int)shm == -1 ) + if ( shm == (void*)-1 ) tlog(TL_CRIT|TL_EXIT, "shmat error: %s", strerror(errno)); return shm; diff --git a/tbtree.c b/tbtree.c index af12db5..416cabc 100644 --- a/tbtree.c +++ b/tbtree.c @@ -420,8 +420,8 @@ dumpPage(TBTree *db, TBTPage *page, int follow) { TBTPointer *ptr= (TBTPointer*)(page->data+db->pointersize*i); for(j=0;jkeylen) ? db->keylen : ptr->key.varlen.length, (db->keylen) ? 0 : ptr->key.varlen.offset );