stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r366949 - /incubator/stdcxx/trunk/tests/src/localedef.cpp
Date Sun, 08 Jan 2006 00:17:06 GMT
Author: sebor
Date: Sat Jan  7 16:17:03 2006
New Revision: 366949

URL: http://svn.apache.org/viewcvs?rev=366949&view=rev
Log:
2006-01-07  Martin Sebor  <sebor@roguewave.com>

	* localedef.cpp (rw_set_locale_root): Removed a gratuitous std::
	qualification from strcat.
	* Avoided accidentally including /usr/include/localedef.h on HP-UX.

Modified:
    incubator/stdcxx/trunk/tests/src/localedef.cpp

Modified: incubator/stdcxx/trunk/tests/src/localedef.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/src/localedef.cpp?rev=366949&r1=366948&r2=366949&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/src/localedef.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/localedef.cpp Sat Jan  7 16:17:03 2006
@@ -16,13 +16,21 @@
  * CONDITIONS OF  ANY KIND, either  express or implied.  See  the License
  * for the specific language governing permissions  and limitations under
  * the License.
- *
+ * 
  **************************************************************************/
 
 // expand _TEST_EXPORT macros
 #define _RWSTD_TEST_SRC
 
-#include <localedef.h>
+
+#ifdef _RWSTD_USE_CONFIG
+   // FIXME: use one style of #include paths consistently throughout
+   // the whole test suite (this form prevents #including the HP-UX
+   // /usr/include/localedef.h header)
+#  include "../include/localedef.h"
+#else
+#  include <localedef.h>
+#endif
 
 #include <environ.h>    // for rw_putenv()
 #include <file.h>       // for SHELL_RM_RF, rw_tmpnam
@@ -292,7 +300,7 @@
     char envvar [sizeof LOCALE_ROOT_ENVAR + sizeof rw_locale_root] =
         LOCALE_ROOT_ENVAR "=";
 
-    std::strcat (envvar, locale_root);
+    strcat (envvar, locale_root);
 
     // remove temporary file if mkstemp() rw_tmpnam() called mkstemp()
     if (rw_system (SHELL_RM_RF " %s", locale_root)) {
@@ -326,9 +334,9 @@
 {
     static char* slocname = 0;
 
-    static int size       = 0;         // the number of elements in the array
-    static int total_size = 5120;      // the size of the array
-    static int last_cat   = loc_cat;   // last category
+    static size_t size       = 0;         // the number of elements in the array
+    static size_t total_size = 5120;      // the size of the array
+    static int    last_cat   = loc_cat;   // last category
 
     // allocate first time through
     if (!slocname) {
@@ -410,7 +418,7 @@
 #endif   // _RWSTD_OS_SUNOS
 
             // if our buffer is full then dynamically allocate a new one
-            if ((size += (strlen (linebuf) + 1)) > total_size) {
+            if (total_size < (size += (strlen (linebuf) + 1))) {
                 total_size += 5120;
 
                 char* tmp =



Mime
View raw message