stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r641823 - in /stdcxx/trunk/tests/src: 23.containers.cpp ctype.cpp fnmatch.cpp locale.cpp opt_lines.cpp printf.cpp
Date Thu, 27 Mar 2008 14:08:41 GMT
Author: faridz
Date: Thu Mar 27 07:08:39 2008
New Revision: 641823

URL: http://svn.apache.org/viewvc?rev=641823&view=rev
Log:
2008-03-27  Farid Zaripov  <farid_zaripov@epam.com>

	* tests/src/23.containers.cpp (_rw_vector_sigcat): Silenced warning
	about unused variable.
	(_rw_deque_sigcat): Same.
	(_rw_queue_sigcat): Same.
	(_rw_stack_sigcat): Same.
	* tests/src/ctype.cpp (_rw_throw): Same.
	* tests/src/opt_lines.cpp (_rw_enable_line): Same.
	* tests/src/fnmatch.cpp (_rw_bracketmatch): ch parameted declared as
	const unsigned char instead of unsigned int. Silenced conversion warnings.
	Added svn:eol-slyle=native property.
	* tests/src/locale.cpp (rw_get_wchars): Fill wbuf array with requested wide
	characters.
	* tests/src/printf.cpp (_rw_fmt_pointer): Check return value from rw_fmtlong()
	before adding it to len.

Modified:
    stdcxx/trunk/tests/src/23.containers.cpp
    stdcxx/trunk/tests/src/ctype.cpp
    stdcxx/trunk/tests/src/fnmatch.cpp   (contents, props changed)
    stdcxx/trunk/tests/src/locale.cpp
    stdcxx/trunk/tests/src/opt_lines.cpp
    stdcxx/trunk/tests/src/printf.cpp

Modified: stdcxx/trunk/tests/src/23.containers.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/23.containers.cpp?rev=641823&r1=641822&r2=641823&view=diff
==============================================================================
--- stdcxx/trunk/tests/src/23.containers.cpp (original)
+++ stdcxx/trunk/tests/src/23.containers.cpp Thu Mar 27 07:08:39 2008
@@ -532,6 +532,16 @@
                    const ContainerTestCase &tcase)
 {
     // temporary empty
+
+	_RWSTD_UNUSED (pbuf);
+	_RWSTD_UNUSED (pbufsize);
+	_RWSTD_UNUSED (which);
+	_RWSTD_UNUSED (self);
+	_RWSTD_UNUSED (str);
+	_RWSTD_UNUSED (str_len);
+	_RWSTD_UNUSED (arg);
+	_RWSTD_UNUSED (arg_len);
+	_RWSTD_UNUSED (tcase);
 }
 
 /**************************************************************************/
@@ -551,6 +561,16 @@
                   const ContainerTestCase &tcase)
 {
     // temporary empty
+
+	_RWSTD_UNUSED (pbuf);
+	_RWSTD_UNUSED (pbufsize);
+	_RWSTD_UNUSED (which);
+	_RWSTD_UNUSED (self);
+	_RWSTD_UNUSED (str);
+	_RWSTD_UNUSED (str_len);
+	_RWSTD_UNUSED (arg);
+	_RWSTD_UNUSED (arg_len);
+	_RWSTD_UNUSED (tcase);
 }
 
 /**************************************************************************/
@@ -570,6 +590,16 @@
                   const ContainerTestCase &tcase)
 {
     // temporary empty
+
+	_RWSTD_UNUSED (pbuf);
+	_RWSTD_UNUSED (pbufsize);
+	_RWSTD_UNUSED (which);
+	_RWSTD_UNUSED (self);
+	_RWSTD_UNUSED (str);
+	_RWSTD_UNUSED (str_len);
+	_RWSTD_UNUSED (arg);
+	_RWSTD_UNUSED (arg_len);
+	_RWSTD_UNUSED (tcase);
 }
 
 /**************************************************************************/
@@ -589,6 +619,16 @@
                   const ContainerTestCase &tcase)
 {
     // temporary empty
+
+	_RWSTD_UNUSED (pbuf);
+	_RWSTD_UNUSED (pbufsize);
+	_RWSTD_UNUSED (which);
+	_RWSTD_UNUSED (self);
+	_RWSTD_UNUSED (str);
+	_RWSTD_UNUSED (str_len);
+	_RWSTD_UNUSED (arg);
+	_RWSTD_UNUSED (arg_len);
+	_RWSTD_UNUSED (tcase);
 }
 
 /**************************************************************************/

Modified: stdcxx/trunk/tests/src/ctype.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/ctype.cpp?rev=641823&r1=641822&r2=641823&view=diff
==============================================================================
--- stdcxx/trunk/tests/src/ctype.cpp (original)
+++ stdcxx/trunk/tests/src/ctype.cpp Thu Mar 27 07:08:39 2008
@@ -43,7 +43,10 @@
 static void
 _rw_throw (const char *file, int line, const char *fmt, ...)
 {
-    struct Exception: UserCtypeBase::Exception {
+	_RWSTD_UNUSED (file);
+	_RWSTD_UNUSED (line);
+
+	struct Exception: UserCtypeBase::Exception {
         char what_ [256];
 
         /* virtual */ const char* what () const {

Modified: stdcxx/trunk/tests/src/fnmatch.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/fnmatch.cpp?rev=641823&r1=641822&r2=641823&view=diff
==============================================================================
--- stdcxx/trunk/tests/src/fnmatch.cpp (original)
+++ stdcxx/trunk/tests/src/fnmatch.cpp Thu Mar 27 07:08:39 2008
@@ -34,7 +34,7 @@
 
 // matches a character against a POSIX bracket expression
 static const char*
-_rw_bracketmatch (const char *pattern, unsigned ch, int)
+_rw_bracketmatch (const char *pattern, const unsigned char ch, int)
 {
     const char *pc = pattern;
 
@@ -52,7 +52,7 @@
         // the '-' and ']' lose their special meaning when they occur
         // first in the bracket expression, after the initial '!', if
         // any
-        if (ch == *pc) {
+        if (ch == UChar (*pc)) {
             if (neg)
                 return 0;
 
@@ -75,7 +75,7 @@
     for ( ; *pc; ++pc) {
         if ('\\' == *pc) {
             if (esc) {
-                if (*pc == ch) {
+                if (ch == UChar (*pc)) {
                     if (neg)
                         return 0;
 
@@ -108,7 +108,7 @@
 
             first = 0;
         }
-        else if (ch == *pc) {
+        else if (ch == UChar (*pc)) {
             if (neg)
                 return 0;
 
@@ -190,9 +190,9 @@
                 esc = false;
             }
             else {
-                if ('\0' == *next)
-                    return 1;
-
+                if ('\0' == *next)
+                    return 1;
+
                 pc = _rw_bracketmatch (pc + 1, UChar (*next), arg);
                 if (0 == pc)
                     return 1;

Propchange: stdcxx/trunk/tests/src/fnmatch.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: stdcxx/trunk/tests/src/locale.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/locale.cpp?rev=641823&r1=641822&r2=641823&view=diff
==============================================================================
--- stdcxx/trunk/tests/src/locale.cpp (original)
+++ stdcxx/trunk/tests/src/locale.cpp Thu Mar 27 07:08:39 2008
@@ -641,7 +641,8 @@
         // determine whether the wide character is valid
         // and if so, the length of the multibyte character
         // that corresponds to it
-        const int len = wctomb (tmp, wchar_t (i));
+		const wchar_t wc = wchar_t (i);
+        const int len = wctomb (tmp, wc);
 
         if (nbytes == 0 && 0 < len || nbytes != 0 && nbytes == len) {
             // if the requested length is 0 (i.e., the caller doesn't
@@ -650,7 +651,7 @@
             // and the value returned from mblen() is the same, store
             // it (this makes it possible to find invalid characters
             // as well as valid ones)
-            wbuf [nchars++];
+            wbuf [nchars++] = wc;
             if (nchars == bufsize)
                 return nchars;
         }
@@ -671,10 +672,10 @@
             wc |= wchar_t (rand ());
         }
 
-        const int len = wctomb (tmp, wchar_t (i));
+        const int len = wctomb (tmp, wc);
 
         if (nbytes == 0 && 0 < len || nbytes != 0 && nbytes == len) {
-            wbuf [nchars++];
+            wbuf [nchars++] = wc;
             if (nchars == bufsize)
                 return nchars;
         }

Modified: stdcxx/trunk/tests/src/opt_lines.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/opt_lines.cpp?rev=641823&r1=641822&r2=641823&view=diff
==============================================================================
--- stdcxx/trunk/tests/src/opt_lines.cpp (original)
+++ stdcxx/trunk/tests/src/opt_lines.cpp Thu Mar 27 07:08:39 2008
@@ -93,6 +93,8 @@
 static int
 _rw_enable_line (int argc, char *argv[], int flags)
 {
+	_RWSTD_UNUSED (argc);
+
     char *parg = strchr (argv [0], '=');
     assert (0 != parg);
 

Modified: stdcxx/trunk/tests/src/printf.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/printf.cpp?rev=641823&r1=641822&r2=641823&view=diff
==============================================================================
--- stdcxx/trunk/tests/src/printf.cpp (original)
+++ stdcxx/trunk/tests/src/printf.cpp Thu Mar 27 07:08:39 2008
@@ -1588,19 +1588,17 @@
     for (size_t i = 0; i != nelems; ++i) {
         const size_t inx = _rw_big_endian ? nelems - i - 1 : i;
 
-        len += _rw_fmtlong (newspec, buf, uptr.lptr [inx]);
+        int n = _rw_fmtlong (newspec, buf, uptr.lptr [inx]);
+        if (n < 0) 
+			return -1;
 
-        if (len < 0) {
-            break;
-        }
+        len += n;
 
         // separate pointer components with colons
-        int n = 0;
+        n = 0;
         if (i + 1 < nelems) {
-            if (0 == _rw_bufcat (buf, ":", size_t (n = 1))) {
-                len = -1;
-                break;
-            }
+            if (0 == _rw_bufcat (buf, ":", size_t (n = 1)))
+				return -1;
         }
 
         len += n;



Mime
View raw message