Author: tabish
Date: Mon Mar 8 16:23:32 2010
New Revision: 920384
URL: http://svn.apache.org/viewvc?rev=920384&view=rev
Log:
Fix some warnings on Windows and change Enum names to avoid clash with windows
defines.
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp?rev=920384&r1=920383&r2=920384&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp
Mon Mar 8 16:23:32 2010
@@ -55,11 +55,11 @@
*/
enum ParsingMode {
- NONE = 0,
- SLASH = 1,
- CONTINUE = 2,
- KEY_DONE = 3,
- IGNORE = 4
+ PARSE_MODE_NONE = 0,
+ PARSE_MODE_SLASH = 1,
+ PARSE_MODE_CONTINUE = 2,
+ PARSE_MODE_KEY_DONE = 3,
+ PARSE_MODE_IGNORE = 4
};
void dumpString( std::ostringstream& buffer, const std::string& string,
bool key ) {
@@ -336,7 +336,7 @@
"The Stream instance passed was Null" );
}
- int mode = NONE;
+ int mode = PARSE_MODE_NONE;
char nextChar;
std::vector<char> buf;
int offset = 0;
@@ -355,15 +355,15 @@
nextChar = (char) ( intVal & 0xFF );
- if( mode == SLASH ) {
+ if( mode == PARSE_MODE_SLASH ) {
- mode = NONE;
+ mode = PARSE_MODE_NONE;
switch( nextChar ) {
case '\r':
- mode = CONTINUE; // Look for a following \n
+ mode = PARSE_MODE_CONTINUE; // Look for a following \n
continue;
case '\n':
- mode = IGNORE; // Ignore whitespace on the next line
+ mode = PARSE_MODE_IGNORE; // Ignore whitespace on the
next line
continue;
case 'b':
nextChar = '\b';
@@ -404,13 +404,13 @@
}
break;
case '\n':
- if( mode == CONTINUE) { // Part of a \r\n sequence
- mode = IGNORE; // Ignore whitespace on the next
line
+ if( mode == PARSE_MODE_CONTINUE) { // Part of a \r\n
sequence
+ mode = PARSE_MODE_IGNORE; // Ignore whitespace on
the next line
continue;
}
// fall into the next case
case '\r':
- mode = NONE;
+ mode = PARSE_MODE_NONE;
firstChar = true;
if( offset > 0 || ( offset == 0 && keyLength == 0 ) ) {
@@ -428,43 +428,43 @@
buf.clear();
continue;
case '\\':
- if( mode == KEY_DONE ) {
+ if( mode == PARSE_MODE_KEY_DONE ) {
keyLength = offset;
}
- mode = SLASH;
+ mode = PARSE_MODE_SLASH;
continue;
case ':':
case '=':
if( keyLength == -1 ) { // if parsing the key
- mode = NONE;
+ mode = PARSE_MODE_NONE;
keyLength = offset;
continue;
}
break;
}
if( Character::isWhitespace( nextChar ) ) {
- if( mode == CONTINUE ) {
- mode = IGNORE;
+ if( mode == PARSE_MODE_CONTINUE ) {
+ mode = PARSE_MODE_IGNORE;
}
// if key length == 0 or value length == 0
if( offset == 0 || offset == keyLength || mode == IGNORE )
{
continue;
}
if( keyLength == -1 ) { // if parsing the key
- mode = KEY_DONE;
+ mode = PARSE_MODE_KEY_DONE;
continue;
}
}
- if( mode == IGNORE || mode == CONTINUE ) {
- mode = NONE;
+ if( mode == PARSE_MODE_IGNORE || mode == PARSE_MODE_CONTINUE )
{
+ mode = PARSE_MODE_NONE;
}
}
firstChar = false;
- if( mode == KEY_DONE ) {
+ if( mode == PARSE_MODE_KEY_DONE ) {
keyLength = offset;
- mode = NONE;
+ mode = PARSE_MODE_NONE;
}
offset += 1;
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp?rev=920384&r1=920383&r2=920384&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp
(original)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp
Mon Mar 8 16:23:32 2010
@@ -36,7 +36,7 @@
////////////////////////////////////////////////////////////////////////////////
void Adler32::reset() {
- this->value = adler32( this->value, NULL, 0 );
+ this->value = adler32( (uLong)this->value, NULL, 0 );
}
////////////////////////////////////////////////////////////////////////////////
@@ -63,7 +63,7 @@
////////////////////////////////////////////////////////////////////////////////
void Adler32::update( int byte ) {
- this->value = adler32( this->value, (const Bytef*)&byte, 1 );
+ this->value = adler32( (uLong)this->value, (const Bytef*)&byte, 1 );
}
////////////////////////////////////////////////////////////////////////////////
@@ -76,5 +76,5 @@
__FILE__, __LINE__, "Given offset + length exceeds the length of
the buffer." );
}
- this->value = (long long)adler32( this->value, (const Bytef*)( buffer +
offset ), (uInt)length );
+ this->value = adler32( (uLong)this->value, (const Bytef*)( buffer + offset
), (uInt)length );
}
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp?rev=920384&r1=920383&r2=920384&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp
Mon Mar 8 16:23:32 2010
@@ -36,7 +36,7 @@
////////////////////////////////////////////////////////////////////////////////
void CRC32::reset() {
- this->value = crc32( this->value, NULL, 0 );
+ this->value = crc32( (uLong)this->value, NULL, 0 );
}
////////////////////////////////////////////////////////////////////////////////
@@ -63,7 +63,7 @@
////////////////////////////////////////////////////////////////////////////////
void CRC32::update( int byte ) {
- this->value = crc32( this->value, (const Bytef*)&byte, 1 );
+ this->value = crc32( (uLong)this->value, (const Bytef*)&byte, 1 );
}
////////////////////////////////////////////////////////////////////////////////
@@ -76,7 +76,7 @@
__FILE__, __LINE__, "Given offset + length exceeds the length of
the buffer." );
}
- this->value = (long long)crc32( this->value, (const Bytef*)( buffer +
offset ), (uInt)length );
+ this->value = crc32( (uLong)this->value, (const Bytef*)( buffer + offset
), (uInt)length );
}