# HG changeset patch # User mas01cr # Date 1226503412 0 # Node ID 6564be3109c5bc199e227a4bd3035cbd71791672 # Parent 6fd52a9a149060c597f4b7cc3d18eec30a53971a gcc-4.3 warning cleanups for lshlib.cpp (I do not believe that any of these changes contain significant copyrightable "intellectual property". However, to the extent that they do, the changes are hereby released into the Public Domain, and may be therefore be used by anyone for any purpose without need for consideration of any kind.) diff -r 6fd52a9a1490 -r 6564be3109c5 lshlib.cpp --- a/lshlib.cpp Wed Nov 12 15:23:31 2008 +0000 +++ b/lshlib.cpp Wed Nov 12 15:23:32 2008 +0000 @@ -22,7 +22,7 @@ return (Uns32T)log2((double)pagesz); } -unsigned align_up(unsigned x, unsigned w){ return ((x) + ((1<t2&LSH_CORE_ARRAY_BIT) + if(bPtr->t2&LSH_CORE_ARRAY_BIT) { retrieve_from_core_hashtable_array((Uns32T*)(bPtr->next), qpos); - else + } else { bucket_chain_point( bPtr->next, qpos); + } #else - bucket_chain_point( bPtr , qpos); + bucket_chain_point( bPtr , qpos); #endif + } } } @@ -684,18 +686,19 @@ error("Unrecognized serial file format request: ", "serialize()"); // Test to see if file exists - if((dbfid = open (filename, O_RDONLY)) < 0) + if((dbfid = open (filename, O_RDONLY)) < 0) { // If it doesn't, then create the file (CREATE) - if(errno == ENOENT){ + if(errno == ENOENT) { // Create the file std::cout << "Creating new serialized LSH database:" << filename << "..."; std::cout.flush(); serial_create(filename, serialFormat); dbIsNew=1; - } - else + } else { // The file can't be opened error("Can't open the file", filename, "open"); + } + } // Load the on-disk header into core dbfid = serial_open(filename, 1); // open for write @@ -846,17 +849,19 @@ pe=pt+y*lshHeader->numCols; colCount=0; - if(bucket* bPtr = h[x][y]) - if(merge) + if(bucket* bPtr = h[x][y]) { + if(merge) { #ifdef LSH_LIST_HEAD_COUNTERS serial_merge_hashtable_row_format1(pe, bPtr->next, colCount); // skip collision counter bucket - else + } else { serial_write_hashtable_row_format1(pe, bPtr->next, colCount); // skip collision counter bucket #else - serial_merge_hashtable_row_format1(pe, bPtr, colCount); - else - serial_write_hashtable_row_format1(pe, bPtr, colCount); + serial_merge_hashtable_row_format1(pe, bPtr, colCount); + } else { + serial_write_hashtable_row_format1(pe, bPtr, colCount); #endif + } + } if(colCount){ if(colCount