From 12f65badc907096eee2696f47ba4fe9347d0856e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 21 Aug 2008 10:43:34 -0500 Subject: [svn-r15502] Description: Clean up warnings. Tested on: Mac OS X/32 10.5.4 (amazon) Too minor to require h5committest --- c++/test/ttypes.cpp | 2 +- c++/test/tvlstr.cpp | 43 ++++++++++++++++++++++--------------------- test/tvlstr.c | 18 +++++++++--------- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 557f400..c9f70e7 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -411,7 +411,7 @@ static void test_named () itype.commit(file, "native-int"); // Check that it is committed. - if (itype.committed() <= 0) + if (itype.committed() == false) cerr << "IntType::committed() returned false" << endl; // We should not be able to modify a type after it has been committed. diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index d4d0fd1..71b16a6 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -68,8 +68,8 @@ void test_vlstr_free_custom(void *mem, void *info); ****************************************************************/ void *test_vlstr_alloc_custom(size_t size, void *info) { - void *ret_value=NULL; // Pointer to return - int *mem_used=(int *)info; // Get the pointer to the memory used + void *ret_value = NULL; // Pointer to return + size_t *mem_used = (size_t *)info; // Get the pointer to the memory used size_t extra; // Extra space needed /* @@ -77,13 +77,14 @@ void *test_vlstr_alloc_custom(size_t size, void *info) * alignment correct - QAK */ - extra=MAX(sizeof(void *),sizeof(size_t)); + extra = MAX(sizeof(void *),sizeof(size_t)); - if((ret_value=HDmalloc(extra+size))!=NULL) { - *(size_t *)ret_value=size; - *mem_used+=size; + if((ret_value = HDmalloc(extra + size)) != NULL) { + *(size_t *)ret_value = size; + *mem_used += size; } // end if - ret_value=((unsigned char *)ret_value)+extra; + ret_value = ((unsigned char *)ret_value) + extra; + return(ret_value); } @@ -100,7 +101,7 @@ void *test_vlstr_alloc_custom(size_t size, void *info) void test_vlstr_free_custom(void *_mem, void *info) { unsigned char *mem; - int *mem_used=(int *)info; // Get the pointer to the memory used + size_t *mem_used=(size_t *)info; // Get the pointer to the memory used size_t extra; // Extra space needed /* @@ -174,14 +175,14 @@ static void test_vlstrings_basic() // Change to the custom memory allocation routines for reading // VL string. DSetMemXferPropList xfer; - int mem_used = 0; // Memory used during allocation + size_t mem_used = 0; // Memory used during allocation xfer.setVlenMemManager(test_vlstr_alloc_custom, &mem_used, test_vlstr_free_custom, &mem_used); // Make certain the correct amount of memory will be used. hsize_t vlsize = dataset.getVlenBufSize(tid1, sid1); // Count the actual number of bytes used by the strings. - int str_used; // String data in memory + size_t str_used; // String data in memory hsize_t i; // counting variable for (i=0,str_used=0; i