diff options
Diffstat (limited to 'ndb/src/common/util')
-rw-r--r-- | ndb/src/common/util/Bitmask.cpp | 30 | ||||
-rw-r--r-- | ndb/src/common/util/ConfigValues.cpp | 8 | ||||
-rw-r--r-- | ndb/src/common/util/File.cpp | 4 | ||||
-rw-r--r-- | ndb/src/common/util/Properties.cpp | 4 | ||||
-rw-r--r-- | ndb/src/common/util/SocketClient.cpp | 2 | ||||
-rw-r--r-- | ndb/src/common/util/random.c | 8 | ||||
-rw-r--r-- | ndb/src/common/util/socket_io.cpp | 4 |
7 files changed, 30 insertions, 30 deletions
diff --git a/ndb/src/common/util/Bitmask.cpp b/ndb/src/common/util/Bitmask.cpp index f5b822ff08e..4b90e5a01f4 100644 --- a/ndb/src/common/util/Bitmask.cpp +++ b/ndb/src/common/util/Bitmask.cpp @@ -16,21 +16,6 @@ #include <Bitmask.hpp> #include <NdbOut.hpp> -static -void print(const Uint32 src[], Uint32 len, Uint32 pos = 0) -{ - printf("b'"); - for(unsigned i = 0; i<len; i++) - { - if(BitmaskImpl::get((pos + len + 31) >> 5, src, i+pos)) - printf("1"); - else - printf("0"); - if((i & 31) == 31) - printf(" "); - } -} - #ifndef __TEST_BITMASK__ void @@ -95,6 +80,21 @@ BitmaskImpl::setFieldImpl(Uint32 dst[], } #else +static +void print(const Uint32 src[], Uint32 len, Uint32 pos = 0) +{ + printf("b'"); + for(unsigned i = 0; i<len; i++) + { + if(BitmaskImpl::get((pos + len + 31) >> 5, src, i+pos)) + printf("1"); + else + printf("0"); + if((i & 31) == 31) + printf(" "); + } +} + #define DEBUG 0 #include <Vector.hpp> static void do_test(int bitmask_size); diff --git a/ndb/src/common/util/ConfigValues.cpp b/ndb/src/common/util/ConfigValues.cpp index cf6dcf904a6..cc1ce0d1519 100644 --- a/ndb/src/common/util/ConfigValues.cpp +++ b/ndb/src/common/util/ConfigValues.cpp @@ -90,18 +90,18 @@ bool ConfigValues::getByPos(Uint32 pos, Entry * result) const { assert(pos < (2 * m_size)); Uint32 keypart = m_values[pos]; - Uint32 val = m_values[pos+1]; + Uint32 val2 = m_values[pos+1]; switch(::getTypeOf(keypart)){ case IntType: case SectionType: - result->m_int = val; + result->m_int = val2; break; case StringType: - result->m_string = * getString(val); + result->m_string = * getString(val2); break; case Int64Type: - result->m_int64 = * get64(val); + result->m_int64 = * get64(val2); break; case InvalidType: default: diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index 23bf3415df9..a75fa5ae463 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -162,9 +162,9 @@ File_class::readChar(char* buf) } int -File_class::write(const void* buf, size_t size, size_t nitems) +File_class::write(const void* buf, size_t size_arg, size_t nitems) { - return ::fwrite(buf, size, nitems, m_file); + return ::fwrite(buf, size_arg, nitems, m_file); } int diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp index 8d5c56affd3..11a1d8690ae 100644 --- a/ndb/src/common/util/Properties.cpp +++ b/ndb/src/common/util/Properties.cpp @@ -627,11 +627,11 @@ PropertiesImpl::getPropsPut(const char * name, if(nvp == 0){ Properties * tmpP = new Properties(); PropertyImpl * tmpPI = new PropertyImpl(tmp2, tmpP); - PropertyImpl * nvp = put(tmpPI); + PropertyImpl * nvp2 = put(tmpPI); delete tmpP; free(tmp2); - return ((Properties*)nvp->value)->impl->getPropsPut(tmp+1, impl); + return ((Properties*)nvp2->value)->impl->getPropsPut(tmp+1, impl); } free(tmp2); if(nvp->valueType != PropertiesType_Properties){ diff --git a/ndb/src/common/util/SocketClient.cpp b/ndb/src/common/util/SocketClient.cpp index c2825901929..3d1fd07d581 100644 --- a/ndb/src/common/util/SocketClient.cpp +++ b/ndb/src/common/util/SocketClient.cpp @@ -88,7 +88,7 @@ SocketClient::bind(const char* bindaddress, unsigned short localport) int ret = errno; NDB_CLOSE_SOCKET(m_sockfd); m_sockfd= NDB_INVALID_SOCKET; - return errno; + return ret; } if (::bind(m_sockfd, (struct sockaddr*)&local, sizeof(local)) == -1) diff --git a/ndb/src/common/util/random.c b/ndb/src/common/util/random.c index 3d4a48e7ef0..20ef537d89a 100644 --- a/ndb/src/common/util/random.c +++ b/ndb/src/common/util/random.c @@ -197,7 +197,7 @@ int initSequence(RandomSequence *seq, SequenceValues *inputValues) unsigned int i; unsigned int j; unsigned int totalLength; - unsigned int index; + unsigned int idx; if( !seq || !inputValues ) return(-1); @@ -219,12 +219,12 @@ int initSequence(RandomSequence *seq, SequenceValues *inputValues) /*----------------------*/ /* set the array values */ /*----------------------*/ - index = 0; + idx = 0; for(i = 0; inputValues[i].length != 0; i++) { for(j = 0; j < inputValues[i].length; j++ ) { - seq->values[index] = inputValues[i].value; - index++; + seq->values[idx] = inputValues[i].value; + idx++; } } diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp index 9bc6b4d53fb..2dd2a9f31a8 100644 --- a/ndb/src/common/util/socket_io.cpp +++ b/ndb/src/common/util/socket_io.cpp @@ -164,8 +164,8 @@ write_socket(NDB_SOCKET_TYPE socket, int timeout_millis, FD_SET(socket, &writeset); timeout.tv_sec = 1; timeout.tv_usec = 0; - const int selectRes = select(socket + 1, 0, &writeset, 0, &timeout); - if(selectRes != 1){ + const int selectRes2 = select(socket + 1, 0, &writeset, 0, &timeout); + if(selectRes2 != 1){ return -1; } } |