You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by el...@apache.org on 2008/05/07 23:30:35 UTC
svn commit: r654289 -
/stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.cpp
Author: elemings
Date: Wed May 7 14:30:34 2008
New Revision: 654289
URL: http://svn.apache.org/viewvc?rev=654289&view=rev
Log:
2008-05-07 Eric Lemings <er...@roguewave.com>
STDCXX-915
* branches/4.2.x/tests/localization/22.locale.codecvt.cpp
(rwtest_codecvt_result): Swap order of definitions for function
overloads.
(test_inout): Fix unused parameter warning and add parentheses
around logical operators to fix precedence warnings.
Modified:
stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.cpp
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.cpp?rev=654289&r1=654288&r2=654289&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.cpp Wed May 7 14:30:34 2008
@@ -387,6 +387,25 @@
// facet operations results
static const char*
+rwtest_codecvt_result (int res)
+{
+ // allow the function to be called up to 8 times in the same expression
+ // without overwriting the static buffer (each call will return a pointer
+ // to a new array)
+ static char buf [8][16];
+
+ static std::size_t index;
+
+ std::size_t inx = index;
+
+ index = (index + 1) % sizeof buf / sizeof *buf;
+
+ std::sprintf (buf [inx], "%#x", res);
+
+ return buf [inx];
+}
+
+static const char*
rwtest_codecvt_result (CodecvtResult res)
{
static const struct {
@@ -403,31 +422,9 @@
if (res == results [i].res)
return results [i].str;
- const char* rwtest_codecvt_result (int);
-
return rwtest_codecvt_result (int (res));
}
-// overload for genericity
-static const char*
-rwtest_codecvt_result (int res)
-{
- // allow the function to be called up to 8 times in the same expression
- // without overwriting the static buffer (each call will return a pointer
- // to a new array)
- static char buf [8][16];
-
- static std::size_t index;
-
- std::size_t inx = index;
-
- index = (index + 1) % sizeof buf / sizeof *buf;
-
- std::sprintf (buf [inx], "%#x", res);
-
- return buf [inx];
-}
-
/****************************************************************************/
static bool
@@ -1348,6 +1345,8 @@
const internT* sint, std::size_t int_len, std::size_t int_num,
std::codecvt_base::result expect)
{
+ _RWSTD_UNUSED (line);
+
char namebuf [256];
assert (255 >= std::strlen (name));
std::strcpy (namebuf, name);
@@ -1457,8 +1456,8 @@
// including the values of function arguments
static char fcall [4096];
- if ( 'I' == which || 'i' == which
- || 'o' == which && std::codecvt_base::ok == expect) {
+ if ( ('I' == which || 'i' == which
+ || 'o' == which) && std::codecvt_base::ok == expect) {
// exercise do_in():
// * the type of `sext' is char
// * ext_len is the number of bytes in the external sequence
@@ -1554,8 +1553,8 @@
delete[] int_lo;
}
- if ( 'O' == which || 'o' == which
- || 'i' == which && std::codecvt_base::ok == expect) {
+ if ( ('O' == which || 'o' == which
+ || 'i' == which) && std::codecvt_base::ok == expect) {
// exercise do_out():
// * the type of `sint' is internT (i.e., either char or wchar_t)
// * int_len is the number of internT characters