Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message(STATUS "LINUX ENVIRONMENT DETECTED")

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -Wall -Werror -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS ${HZ_BIT_FLAG} ${HZ_CODE_COVERAGE_COMPILE_FLAGS} ${HZ_VALGRIND_COMPILE_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS ${HZ_BIT_FLAG} ${HZ_CODE_COVERAGE_COMPILE_FLAGS} ${HZ_VALGRIND_COMPILE_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -Wall -Werror ${HZ_BIT_FLAG} ${HZ_CODE_COVERAGE_COMPILE_FLAGS} ${HZ_VALGRIND_COMPILE_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall ${HZ_BIT_FLAG} ${HZ_CODE_COVERAGE_COMPILE_FLAGS} ${HZ_VALGRIND_COMPILE_FLAGS}")

link_libraries(${HZ_LIB_NAME} pthread rt )

Expand Down
25 changes: 11 additions & 14 deletions hazelcast/include/hazelcast/util/LittleEndianBufferWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,16 @@ namespace hazelcast {
class HAZELCAST_API LittleEndianBufferWrapper {
public:
enum TypeSizes {
INT8_SIZE = INT32_C(1),
UINT8_SIZE = INT32_C(1),
INT16_SIZE = INT32_C(2),
UINT16_SIZE = INT32_C(2),
INT32_SIZE = INT32_C(4),
UINT32_SIZE = INT32_C(4),
UINT64_SIZE = INT32_C(8),
INT64_SIZE = INT32_C(8)
INT8_SIZE = 1,
UINT8_SIZE = 1,
INT16_SIZE = 2,
UINT16_SIZE = 2,
INT32_SIZE = 4,
UINT32_SIZE = 4,
UINT64_SIZE = 8,
INT64_SIZE = 8
};

#define BUFFER_TRUE UINT8_C(1)
#define BUFFER_FALSE UINT8_C(0)

inline void wrapForWrite(byte *buf, int32_t size, int32_t offset) {
buffer = buf;
capacity = size;
Expand Down Expand Up @@ -78,7 +75,7 @@ namespace hazelcast {
}

inline bool getBoolean() {
return BUFFER_FALSE != getUint8();
return 0 != getUint8();
}

inline uint16_t getUint16() {
Expand Down Expand Up @@ -155,9 +152,9 @@ namespace hazelcast {
inline void set(bool value) {
assert(checkWriteAvailable(UINT8_SIZE));
if (value) {
set((uint8_t)BUFFER_TRUE);
set((uint8_t)1);
} else {
set((uint8_t)BUFFER_FALSE);
set((uint8_t)0);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace hazelcast {
: clientContext(clientContext), inSelector(*this), outSelector(*this), inSelectorThread(NULL),
outSelectorThread(NULL), live(true), heartBeater(clientContext),
heartBeatThread(NULL), smartRouting(smartRouting), ownerConnectionFuture(clientContext),
callIdGenerator(UINT32_C(0)) {
callIdGenerator(0) {
const byte protocol_bytes[3] = {'C', 'B', '2'};
PROTOCOL.insert(PROTOCOL.begin(), &protocol_bytes[0], &protocol_bytes[3]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace hazelcast {
#define LARGE_BUFFER_SIZE 20
#define START_BYTE_NUMBER 5

uint64_t ONE = UINT64_C(1);
uint64_t ONE = 1;
uint64_t oneByteFactor = ONE << 8;
uint64_t twoBytesFactor = ONE << 16;
uint64_t threeBytesFactor = ONE << 24;
Expand Down
2 changes: 1 addition & 1 deletion hazelcast/test/util/BitsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace hazelcast {
}

void BitsTest::testLittleEndian() {
uint64_t ONE = UINT64_C(1);
uint64_t ONE = 1;
uint64_t oneByteFactor = ONE << 8;
uint64_t twoBytesFactor = ONE << 16;
uint64_t threeBytesFactor = ONE << 24;
Expand Down