summaryrefslogtreecommitdiff
path: root/ACEXML
diff options
context:
space:
mode:
authorsjiang <sjiang@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-14 21:22:43 +0000
committersjiang <sjiang@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-14 21:22:43 +0000
commit8adc5b88a8d515d7a7760a1fb5b1bb28e57f068b (patch)
treefc8c0b45480d2e514c37dfdebb9c7fb5ef32068e /ACEXML
parent73a57af7425eeeb36ea0d049ac9c8cfd06cb6234 (diff)
downloadATCD-8adc5b88a8d515d7a7760a1fb5b1bb28e57f068b.tar.gz
ChangeLog Tag: Tue Mar 14 20:58:12 UTC 2006 jiang,shanshan <shanshan.jiang@vanderbilt.edu>
Diffstat (limited to 'ACEXML')
-rw-r--r--ACEXML/common/FileCharStream.cpp4
-rw-r--r--ACEXML/common/HttpCharStream.cpp2
-rw-r--r--ACEXML/common/Transcode.cpp29
-rw-r--r--ACEXML/common/XML_Macros.h4
-rw-r--r--ACEXML/parser/parser/Parser.cpp2
-rw-r--r--ACEXML/parser/parser/Parser.i2
6 files changed, 21 insertions, 22 deletions
diff --git a/ACEXML/common/FileCharStream.cpp b/ACEXML/common/FileCharStream.cpp
index 2e3fc8abc5c..cafc0696b5c 100644
--- a/ACEXML/common/FileCharStream.cpp
+++ b/ACEXML/common/FileCharStream.cpp
@@ -130,7 +130,7 @@ ACEXML_FileCharStream::close (void)
int
ACEXML_FileCharStream::getchar_i (char& ch)
{
- ch = ACE_OS::fgetc (this->infile_);
+ ch = static_cast<char> (ACE_OS::fgetc (this->infile_));
return (feof(this->infile_) ? -1 : 0);
}
@@ -166,7 +166,7 @@ ACEXML_FileCharStream::peek (void)
return this->peek_i();
#else
- ACEXML_Char ch = ACE_OS::fgetc (this->infile_);
+ ACEXML_Char ch = static_cast<ACEXML_Char> (ACE_OS::fgetc (this->infile_));
::ungetc (ch, this->infile_);
return ch;
#endif /* ACE_USES_WCHAR */
diff --git a/ACEXML/common/HttpCharStream.cpp b/ACEXML/common/HttpCharStream.cpp
index 42015f16213..b6f5e6aa423 100644
--- a/ACEXML/common/HttpCharStream.cpp
+++ b/ACEXML/common/HttpCharStream.cpp
@@ -321,7 +321,7 @@ ACEXML_HttpCharStream::determine_encoding (void)
char input[4] = {0, 0, 0, 0};
int i = 0;
for (; i < 4 && input[i] != (char)-1; ++i)
- input[i] = this->stream_->peek_char(i);
+ input[i] = static_cast<char> (this->stream_->peek_char(i));
if (i < 4)
return -1;
const ACEXML_Char* temp = ACEXML_Encoding::get_encoding (input);
diff --git a/ACEXML/common/Transcode.cpp b/ACEXML/common/Transcode.cpp
index e43a407d2e3..f94d93bba32 100644
--- a/ACEXML/common/Transcode.cpp
+++ b/ACEXML/common/Transcode.cpp
@@ -26,8 +26,8 @@ ACEXML_Transcoder::utf162utf8 (ACEXML_UTF16 src,
if (len < 2)
return ACEXML_DESTINATION_TOO_SHORT;
- *dst = 0xc0 | (src / 0x40);
- *(dst+1) = 0x80 | (src % 0x40);
+ *dst = 0xc0 | (static_cast<ACEXML_UTF8> (src) / 0x40);
+ *(dst+1) = 0x80 | (static_cast<ACEXML_UTF8> (src) % 0x40);
return 2;
}
else
@@ -39,13 +39,12 @@ ACEXML_Transcoder::utf162utf8 (ACEXML_UTF16 src,
if (src >= 0xD800 && src < 0xE000)
return ACEXML_IS_SURROGATE;
- *dst = 0xe0 | (src / 0x1000);
- *(dst+1) = 0x80 | ((src % 0x1000) / 0x40);
- *(dst+2) = 0x80 | (src % 0x40);
+ *dst = 0xe0 | (static_cast<ACEXML_UTF8> (src) / 0x1000);
+ *(dst+1) = 0x80 | ((static_cast<ACEXML_UTF8> (src) % 0x1000) / 0x40);
+ *(dst+2) = 0x80 | (static_cast<ACEXML_UTF8> (src) % 0x40);
return 3;
}
- ACE_NOTREACHED (return ACEXML_NON_UNICODE;)
- }
+}
int
ACEXML_Transcoder::ucs42utf8 (ACEXML_UCS4 src,
@@ -67,10 +66,10 @@ ACEXML_Transcoder::ucs42utf8 (ACEXML_UCS4 src,
if (dst == 0)
return ACEXML_INVALID_ARGS;
- *dst = 0xf0 | (src / 0x40000);
- *(dst+1) = 0x80 | ((src % 0x40000) / 0x1000);
- *(dst+2) = 0x80 | ((src % 0x1000) / 0x40);
- *(dst+3) = 0x80 | (src % 0x40);
+ *dst = 0xf0 | (static_cast<ACEXML_UTF8> (src / 0x40000));
+ *(dst+1) = 0x80 | ((static_cast<ACEXML_UTF8> (src % 0x40000)) / 0x1000);
+ *(dst+2) = 0x80 | ((static_cast<ACEXML_UTF8> (src % 0x1000)) / 0x40);
+ *(dst+3) = 0x80 | (static_cast<ACEXML_UTF8> (src % 0x40));
return 4;
}
return ACEXML_NON_UNICODE;
@@ -102,8 +101,8 @@ ACEXML_Transcoder::ucs42utf16 (ACEXML_UCS4 src,
if (len < 2)
return ACEXML_DESTINATION_TOO_SHORT;
- *dst = 0xD800 | (src / 0x400);
- *(dst+1) = 0xDC00 | (src % 0x400);
+ *dst = 0xD800 | (static_cast<ACEXML_UTF16> (src) / 0x400);
+ *(dst+1) = 0xDC00 | (static_cast<ACEXML_UTF16> (src) % 0x400);
return 2;
}
@@ -125,8 +124,8 @@ ACEXML_Transcoder::surrogate2utf8 (ACEXML_UTF16 high,
return ACEXML_INVALID_ARGS;
ACEXML_UCS4 src = (high - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000;
- *dst = 0xD800 | (src / 0x400);
- *(dst+1) = 0xDC00 | (src % 0x400);
+ *dst = static_cast<ACEXML_UTF8> (0xD800 | (src / 0x400));
+ *(dst+1) = static_cast<ACEXML_UTF8> (0xDC00 | (src % 0x400));
return 2;
}
diff --git a/ACEXML/common/XML_Macros.h b/ACEXML/common/XML_Macros.h
index 028bc590395..50ec6857b3a 100644
--- a/ACEXML/common/XML_Macros.h
+++ b/ACEXML/common/XML_Macros.h
@@ -88,12 +88,12 @@
throw EXCEPTION
// Throwing an exception when the function reqires a return value.
-# if defined (WIN32) || defined (__HP_aCC)
+# if defined (__HP_aCC)
# define ACEXML_THROW_RETURN(EXCEPTION, RETV) \
do \
{ \
throw EXCEPTION; \
- return RETV; \
+ return RETV; \
} while (0)
# else /* WIN32 */
# define ACEXML_THROW_RETURN(EXCEPTION,RETV) \
diff --git a/ACEXML/parser/parser/Parser.cpp b/ACEXML/parser/parser/Parser.cpp
index c9cc164c1cf..6573f019b17 100644
--- a/ACEXML/parser/parser/Parser.cpp
+++ b/ACEXML/parser/parser/Parser.cpp
@@ -3161,7 +3161,7 @@ void
ACEXML_Parser::parse_encoding_decl (ACEXML_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((ACEXML_SAXException))
{
- ACEXML_Char* astring;
+ ACEXML_Char* astring = 0;
if ((this->parse_token (ACE_TEXT("ncoding")) < 0)
|| this->skip_equal () != 0
|| this->parse_encname (astring) != 0)
diff --git a/ACEXML/parser/parser/Parser.i b/ACEXML/parser/parser/Parser.i
index 0857aa37835..97896a68388 100644
--- a/ACEXML/parser/parser/Parser.i
+++ b/ACEXML/parser/parser/Parser.i
@@ -238,7 +238,7 @@ ACEXML_Parser::peek (void)
ACEXML_Char ch = 0;
const ACEXML_InputSource* ip = this->current_->getInputSource();
ACEXML_CharStream* instream = ip->getCharStream();
- ch = instream->peek ();
+ ch = static_cast<ACEXML_Char> (instream->peek ());
return (ch > 0 ? ch : 0);
}