diff options
Diffstat (limited to 'ACE')
-rw-r--r-- | ACE/ACEXML/common/HttpCharStream.cpp | 6 | ||||
-rw-r--r-- | ACE/ChangeLog | 8 | ||||
-rw-r--r-- | ACE/apps/gperf/src/Options.cpp | 44 | ||||
-rw-r--r-- | ACE/apps/gperf/src/Options.h | 13 |
4 files changed, 40 insertions, 31 deletions
diff --git a/ACE/ACEXML/common/HttpCharStream.cpp b/ACE/ACEXML/common/HttpCharStream.cpp index 811709ecd27..b22d5a77a5f 100644 --- a/ACE/ACEXML/common/HttpCharStream.cpp +++ b/ACE/ACEXML/common/HttpCharStream.cpp @@ -412,10 +412,10 @@ ACEXML_HttpCharStream::read (ACEXML_Char *str, if (this->stream_ == 0) return -1; len = len * sizeof (ACEXML_Char); - char* temp = const_cast<char*> (this->stream_->recv (len)); - str = ACE_TEXT_CHAR_TO_TCHAR (temp); - if (str == 0) + const char* temp = this->stream_->recv (len); + if (temp == 0) return -1; + ACE_OS::strncpy (str, ACE_TEXT_CHAR_TO_TCHAR (temp), len); return static_cast<int> (len); } diff --git a/ACE/ChangeLog b/ACE/ChangeLog index aca214234a8..8c3c631beae 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,11 @@ +Tue Oct 21 12:41:09 UTC 2008 Vladimir Zykov <vzykov@prismtech.com> + + * apps/gperf/src/Options.h: + * apps/gperf/src/Options.cpp: + * ACEXML/common/HttpCharStream.cpp: + + Fixed incorrect use of ACE_TEXT_* conversion macros. + Tue Oct 21 11:25:00 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> * bin/fuzz.pl: diff --git a/ACE/apps/gperf/src/Options.cpp b/ACE/apps/gperf/src/Options.cpp index 44c233f7fcc..77a99186d02 100644 --- a/ACE/apps/gperf/src/Options.cpp +++ b/ACE/apps/gperf/src/Options.cpp @@ -72,12 +72,12 @@ int Options::initial_asso_value_; int Options::argc_; ACE_TCHAR **Options::argv_; int Options::iterations_; -const char *Options::function_name_; -const char *Options::fill_default_; -const char *Options::key_name_; -const char *Options::class_name_; -const char *Options::hash_name_; -const char *Options::delimiters_; +ACE_CString Options::function_name_; +ACE_CString Options::fill_default_; +ACE_CString Options::key_name_; +ACE_CString Options::class_name_; +ACE_CString Options::hash_name_; +ACE_CString Options::delimiters_; char Options::key_positions_[MAX_KEY_POS]; // Prints program usage to standard error stream. @@ -190,14 +190,14 @@ Options::~Options (void) "\nLINEARSEARCH is: %s" "\nBINARYSEARCH is: %s" "\niterations = %d" - "\nlookup function name = %s" - "\nfill default = %s" - "\nhash function name = %s" - "\nkey name = %s" + "\nlookup function name = %C" + "\nfill default = %C" + "\nhash function name = %C" + "\nkey name = %C" "\njump value = %d" "\nmax associcated value = %d" "\ninitial associated value = %d" - "\ndelimiters = %s" + "\ndelimiters = %C" "\nnumber of switch statements = %d" "\n", ACE_BIT_ENABLED (option_word_, DEBUGGING) ? "enabled" : "disabled", @@ -225,14 +225,14 @@ Options::~Options (void) ACE_BIT_ENABLED (option_word_, LINEARSEARCH) ? "enabled" : "disabled", ACE_BIT_ENABLED (option_word_, BINARYSEARCH) ? "enabled" : "disabled", iterations_, - function_name_, - fill_default_, - hash_name_, - key_name_, + function_name_.c_str (), + fill_default_.c_str (), + hash_name_.c_str (), + key_name_.c_str (), jump_, size_ - 1, initial_asso_value_, - delimiters_, + delimiters_.c_str (), total_switches_); if (ACE_BIT_ENABLED (option_word_, ALLCHARS)) ACE_OS::fprintf (stderr, @@ -803,7 +803,7 @@ Options::jump (void) const char * Options::function_name (void) { - return function_name_; + return function_name_.c_str (); } // Returns the fill default @@ -811,7 +811,7 @@ Options::function_name (void) const char * Options::fill_default (void) { - return fill_default_; + return fill_default_.c_str (); } // Returns the keyword key name. @@ -819,7 +819,7 @@ Options::fill_default (void) const char * Options::key_name (void) { - return key_name_; + return key_name_.c_str (); } // Returns the hash function name. @@ -827,7 +827,7 @@ Options::key_name (void) const char * Options::hash_name (void) { - return hash_name_; + return hash_name_.c_str (); } // Returns the generated class name. @@ -835,7 +835,7 @@ Options::hash_name (void) const char * Options::class_name (void) { - return class_name_; + return class_name_.c_str (); } // Returns the initial associated character value. @@ -859,7 +859,7 @@ Options::iterations (void) const char * Options::delimiter (void) { - return delimiters_; + return delimiters_.c_str (); } // Gets the total number of switch statements to generate. diff --git a/ACE/apps/gperf/src/Options.h b/ACE/apps/gperf/src/Options.h index ce264e859bc..78dfccafdab 100644 --- a/ACE/apps/gperf/src/Options.h +++ b/ACE/apps/gperf/src/Options.h @@ -25,6 +25,7 @@ #define OPTIONS_H #include "ace/Log_Msg.h" +#include "ace/SString.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -155,22 +156,22 @@ private: static ACE_TCHAR **argv_; // Stores a pointer to command-line vector. - static const char *function_name_; + static ACE_CString function_name_; // Names used for generated lookup function. - static const char *fill_default_; + static ACE_CString fill_default_; // Expression used to assign default values in keyword table. - static const char *key_name_; + static ACE_CString key_name_; // Name used for keyword key. - static const char *class_name_; + static ACE_CString class_name_; // Name used for generated C++ class. - static const char *hash_name_; + static ACE_CString hash_name_; // Name used for generated hash function. - static const char *delimiters_; + static ACE_CString delimiters_; // Separates keywords from other attributes. static char key_positions_[MAX_KEY_POS]; |