stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r508263 - /incubator/stdcxx/trunk/tests/src/printf.cpp
Date Fri, 16 Feb 2007 01:09:18 GMT
Author: sebor
Date: Thu Feb 15 17:09:18 2007
New Revision: 508263

URL: http://svn.apache.org/viewvc?view=rev&rev=508263
Log:
2007-02-15  Martin Sebor  <sebor@roguewave.com>

	* printf.cpp (VarArgs): Made pargs_ non-const.
	(VA_ARG): Removed a const cast obviated by the above.
	(_rw_fmtexp): Simplified/corrected the uses of VA_ARG.

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

Modified: incubator/stdcxx/trunk/tests/src/printf.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/src/printf.cpp?view=diff&rev=508263&r1=508262&r2=508263
==============================================================================
--- incubator/stdcxx/trunk/tests/src/printf.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/printf.cpp Thu Feb 15 17:09:18 2007
@@ -104,8 +104,8 @@
 
 struct VarArgs {
     union {
-        va_list    *pva_;
-        const void *pargs_;
+        va_list *pva_;
+        void    *pargs_;
     } arg_;
 
     enum {
@@ -115,7 +115,7 @@
 
 #define VA_ARG(va, T) \
     (VarArgs::VA_list == (va).kind_ ? va_arg (*(va).arg_.pva_, T) \
-                                    : *((const T*&)(va).arg_.pargs_)++)
+                                    : *((T*&)(va).arg_.pargs_)++)
 
 
 static int
@@ -2996,14 +2996,14 @@
 
     if ('*' == *param) {
         // extract the name of the parameter from the argument list
-        param = _RWSTD_CONST_CAST (char*, VA_ARG (*pva, const char*));
+        param = VA_ARG (*pva, char*);
     }
 
     char* fmtword = 0;
 
     if ('*' == *word) {
         // extract "word" from the argument list
-        word = _RWSTD_CONST_CAST (char*, VA_ARG (*pva, const char*));
+        word = VA_ARG (*pva, char*);
     }
     else if ('@' == *word) {
         // extract formatting directive from the argument list
@@ -3204,7 +3204,7 @@
 
     if (spec.mod_ext_A == spec.mod) {
         tmparg.kind_       = VarArgs::VA_array;
-        tmparg.arg_.pargs_ = VA_ARG (*pva, const void*);
+        tmparg.arg_.pargs_ = VA_ARG (*pva, void*);
     }
 
     int len = 0;



Mime
View raw message