You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by vi...@apache.org on 2008/06/07 05:43:42 UTC
svn commit: r664271 - in /stdcxx/branches/4.3.x: etc/config/src/
examples/manual/ src/ tests/algorithms/ tests/containers/
tests/localization/ tests/numerics/ tests/regress/ tests/src/
tests/strings/ util/
Author: vitek
Date: Fri Jun 6 20:43:41 2008
New Revision: 664271
URL: http://svn.apache.org/viewvc?rev=664271&view=rev
Log:
2008-06-06 Travis Vitek <vi...@roguewave.com>
Merge revision 659253 from 4.2.x
2008-05-22 Eric Lemings <er...@roguewave.com>
STDCXX-550
* src/num_put.cpp (__rw_itoa): Silence 64-bit conversion warning
with explicit cast to `unsigned' type.
* tests/src/locale.cpp (rw_locales, _rw_all_locales),
util/runall.cpp (main), util/aliases.cpp (get_installed_locales):
Silence 64-bit conversion warnings by explicitly casting `size_t'
result from `sizeof' operator to `int' type expected by second
size parameter in fgets() function.
* tests/src/thread.cpp (rw_thread_pool): First parameter in
rw_alarm() is `unsigned'. Explicit cast `size_t' timeout value
to silence warning.
* tests/src/value.cpp (_rw_fmtxarrayv): Explicitly cast `long'
return value from strtol() function to `int' to silence warning.
* tests/src/char.cpp (_rw_fmtstringv): Likewise.
* tests/src/rand.cpp (rw_seed32): Explicitly cast `clock_t'
return value from clock() function to `unsigned' value.
* tests/src/cmdopt.cpp (_rw_getbounds, _rw_getarg): Explicitly
cast `long' value to `int' type of minval_, maxval_, and pcntr_
members.
* tests/src/23.containers.cpp (_rw_sigcat, _rw_argno): Explicitly
cast `which' value from `size_t' type to `int' type used by
`argmap' variable.
* tests/src/opt_lines.cpp (_rw_enable_lines): Explicitly cast
`first' value from `long' type to `int' type used by first
parameter of _rw_enable_lines() function.
* tests/src/process.cpp (rw_waitpid): Explicitly cast PID from
`rw_pid_t' type to system `pid_t' type used by first parameter
of waitpid() function. Also cast `time_t' expression to `int'
type of local variable `delta'.
(rw_process_kill): Cast `size_t' expression to `unsigned' type
of `sigcount' variable. Cast `rw_pid_t' value to system's
`pid_t' type used by first parameter of kill() function.
* tests/src/opt_trace.cpp (_rw_setopt_trace_mask): Changed type
of loop index from `int' to `long'.
* tests/algorithms/25.generate.cpp (test_generate_n): Explicitly
convert `size_t' value to `int' type to silence 64-bit conversion
warnings.
* tests/algorithms/25.fill.cpp (test_fill_n): First parameter in
`Size' constructor should be an `int'.
* tests/algorithms/25.random.shuffle.cpp (test_random_shuffle):
Change line parameter from `size_t' type to `int' type.
* tests/containers/23.deque.modifiers.cpp: Explicitly cast
expressions involving `UserClass::n_total_copy_ctor_' and
`UserClass::n_total_op_assign_' members to `int' type of lhs of
assignment.
(test_erase): Cast `size_t' argument used as 7th parameter in
exception_loop() function to `int' type.
* tests/containers/23.bitset.cons.cpp (test_string_ctor): Cast
result of pointer arithmetic expression to `int' type of rhs of
assignment operator.
* tests/containers/23.vector.cons.cpp (test_ctors): Assign to
`val' using temporary `T' value constructed from `i' rather than
directly from `i'.
* tests/localization/22.locale.synopsis.cpp (test_locale): Change
loop index type from `unsigned' to `size_t' resulting from
pointer arithmetic in initializer.
* tests/localization/22.locale.codecvt.length.cpp
(test_wcodecvt_byname_libc_based) [TEST]: Next to last parameter
type in test_length() function is an `int', not `size_t'.
* tests/localization/22.locale.num.get.cpp (test_errno)
[TEST_ERRNO]: Fourth from last parameter type in do_test()
function is an `int'. Cast `size_t' result of sizeof operator.
(test_long): Cast `size_t' result from sizeof operator to
`int' type of local `NC' variable. Define INTSIZE() macro to
cast `size_t' result from sizeof operator to `int' type in test
cases. (This parameter defaults to negative value or its type
would be changed to `size_t' type.)
(test_pvoid) [PVOIDSTR], (test_ldbl): Use INSTIZE() macro.
* tests/numerics/26.c.math.cpp (check_bits): Changed `unsigned'
parameter type to `size_t' parameter type.
(test_behavior): Remove SIZE() macro and replaced with sizeof
operator.
* tests/regress/24.operations.stdcxx-234.cpp (main): Cast
iterator `difference_type' to return type of main() function.
* tests/strings/21.string.io.cpp (test_io): Cast rhs of
assignments to `int' type of `throw_when_' array elements.
* util/monetary.cpp (Def::write_monetary): Cast expressions in
rhs of assignments to `unsigned' type of `_RW::__rw_punct_t'
members.
* util/time.cpp (Def::write_time): Ditto for `time_out_` members.
* util/locale.cpp (print_toupper, print_tolower): Cast return
value of _RW::__rw_ctype_t::wtoupper_s() function to `int'
return type of function.
(print_charmap): Change loop index type from `size_t' to
`unsigned'.
* util/numeric.cpp (Def::write_numeric): Same change as above
to monetary and time for `num_punct_out_' members.
* util/messages.cpp (Def::write_messages): Same change as above
to monetary, time, and numeric for 'messages_out_' members.
* util/ctype.cpp (Def::write_ctype): Same change as facets above.
* util/exec.cpp (get_signo): Cast return type from strtol()
function to `int' return type of function.
* util/cmdopt.cpp: Explicitly cast return value of sysconf()
function to `float' type used by `TICKS_PER_SEC' global.
(eval_options): Cast return value of strtol() function to
`unsigned' type. Second parameter of get_long_val() function
expects `unsigned' type (go figure). Cast return value of
sizeof operator. exit() function expects `int' status code.
Parameter type of rw_sleep() function is `int'.
* util/codecvt.cpp (gen_wchar_tables, gen_xlit_data): Cast
string::size_type values to `unsigned' type of offset variables.
(write_codecvt): Add UINT() macro for casting values to
`unsigned' type expected by lhs of several assignments.
* util/charmap.cp (Charmap::increment_wchar): Cast
string::size_type values to `int' type of local `last_elm' which
can be negative.
(increment_encoding): Cast return value of convert_escape()
function to `unsigned' type of `last_byte' variable.
* util/collate.cpp (Def::process_weights): Change loop index
type from `size_t' to `int'.
(Def::write_collate): Cast wstring::size_type and size of
intrinsic types to `unsigned' type. Also moved definition of
local variable `i' closer to point of use.
(Def::get_weight): Changed type of local `c' from `size_t' to
`unsigned'. Cast return value of convert_escape() function to
`unsigned' type of `weight' array elements.
* examples/manual/strstream.cpp (main): Change local `gcount'
variable from `int' type to `std::streamsize' type.
Modified:
stdcxx/branches/4.3.x/etc/config/src/headers.inc
stdcxx/branches/4.3.x/examples/manual/strstream.cpp
stdcxx/branches/4.3.x/src/num_put.cpp
stdcxx/branches/4.3.x/tests/algorithms/25.random.shuffle.cpp
stdcxx/branches/4.3.x/tests/containers/23.bitset.cons.cpp
stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp
stdcxx/branches/4.3.x/tests/containers/23.vector.cons.cpp
stdcxx/branches/4.3.x/tests/localization/22.locale.codecvt.length.cpp
stdcxx/branches/4.3.x/tests/localization/22.locale.num.get.cpp
stdcxx/branches/4.3.x/tests/numerics/26.c.math.cpp
stdcxx/branches/4.3.x/tests/regress/24.operations.stdcxx-234.cpp
stdcxx/branches/4.3.x/tests/regress/27.stringbuf.members.stdcxx-427.cpp
stdcxx/branches/4.3.x/tests/src/char.cpp
stdcxx/branches/4.3.x/tests/src/cmdopt.cpp
stdcxx/branches/4.3.x/tests/src/locale.cpp
stdcxx/branches/4.3.x/tests/src/opt_lines.cpp
stdcxx/branches/4.3.x/tests/src/opt_trace.cpp
stdcxx/branches/4.3.x/tests/src/process.cpp
stdcxx/branches/4.3.x/tests/src/rand.cpp
stdcxx/branches/4.3.x/tests/src/thread.cpp
stdcxx/branches/4.3.x/tests/src/value.cpp
stdcxx/branches/4.3.x/tests/strings/21.cwctype.cpp
stdcxx/branches/4.3.x/tests/strings/21.string.io.cpp
stdcxx/branches/4.3.x/util/aliases.cpp
stdcxx/branches/4.3.x/util/charmap.cpp
stdcxx/branches/4.3.x/util/cmdopt.cpp
stdcxx/branches/4.3.x/util/cmdopt.h
stdcxx/branches/4.3.x/util/codecvt.cpp
stdcxx/branches/4.3.x/util/collate.cpp
stdcxx/branches/4.3.x/util/ctype.cpp
stdcxx/branches/4.3.x/util/display.cpp
stdcxx/branches/4.3.x/util/exec.cpp
stdcxx/branches/4.3.x/util/locale.cpp
stdcxx/branches/4.3.x/util/messages.cpp
stdcxx/branches/4.3.x/util/monetary.cpp
stdcxx/branches/4.3.x/util/numeric.cpp
stdcxx/branches/4.3.x/util/path.h
stdcxx/branches/4.3.x/util/runall.cpp
stdcxx/branches/4.3.x/util/time.cpp
Modified: stdcxx/branches/4.3.x/etc/config/src/headers.inc
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/etc/config/src/headers.inc?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/etc/config/src/headers.inc (original)
+++ stdcxx/branches/4.3.x/etc/config/src/headers.inc Fri Jun 6 20:43:41 2008
@@ -21,10 +21,8 @@
##############################################################################
# list of headers
-hdrs="assert complex ctype errno fenv float inttypes iso646 limits locale \
- math setjmp signal stdarg stdbool stddef stdio stdint stdlib string \
- tgmath time uchar wchar wctype new typeinfo"
-
+hdrs="assert ctype errno float iso646 limits locale math setjmp signal \
+ stdarg stddef stdio stdlib string time wchar wctype new typeinfo"
hdrs="$hdrs ieeefp.h pthread.h"
Modified: stdcxx/branches/4.3.x/examples/manual/strstream.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/examples/manual/strstream.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/examples/manual/strstream.cpp (original)
+++ stdcxx/branches/4.3.x/examples/manual/strstream.cpp Fri Jun 6 20:43:41 2008
@@ -53,7 +53,7 @@
inout.freeze (false);
// keep track of the number of characters extracted by getline
- int gcount = 0;
+ std::streamsize gcount = 0;
// extract lines from the stream, one at a time
for (int i = 1; inout.getline (line, sizeof line); ++i) {
Modified: stdcxx/branches/4.3.x/src/num_put.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/num_put.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/num_put.cpp (original)
+++ stdcxx/branches/4.3.x/src/num_put.cpp Fri Jun 6 20:43:41 2008
@@ -463,7 +463,7 @@
j = 0;
do {
- const unsigned dig = (i >> (j * bits)) & basemask;
+ const unsigned dig = unsigned ((i >> (j * bits)) & basemask);
_RWSTD_ASSERT (dig <= basemask);
Modified: stdcxx/branches/4.3.x/tests/algorithms/25.random.shuffle.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/algorithms/25.random.shuffle.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/algorithms/25.random.shuffle.cpp (original)
+++ stdcxx/branches/4.3.x/tests/algorithms/25.random.shuffle.cpp Fri Jun 6 20:43:41 2008
@@ -137,7 +137,7 @@
// exercises 25.2.11 -- std::random_shuffle()
template <class T, class Iterator, class RandomNumberGenerator>
-void test_random_shuffle (const std::size_t line,
+void test_random_shuffle (const int line,
const std::size_t N,
const Iterator &it,
const RandomNumberGenerator*,
@@ -224,7 +224,7 @@
/**************************************************************************/
-void test_random_shuffle (const std::size_t line)
+void test_random_shuffle (const int line)
{
#ifndef _RWSTD_NO_EXT_PORTABLE_RANDOM_SEQUENCE
Modified: stdcxx/branches/4.3.x/tests/containers/23.bitset.cons.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/containers/23.bitset.cons.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/containers/23.bitset.cons.cpp (original)
+++ stdcxx/branches/4.3.x/tests/containers/23.bitset.cons.cpp Fri Jun 6 20:43:41 2008
@@ -359,7 +359,8 @@
};
// compute which exception, if any, the ctor is expected to throw
- const int except = bitstr - (char*)0 < 3 ? bitstr - (char*)0 : 0;
+ const int except = int (bitstr - (char*)0) < 3 ?
+ int (bitstr - (char*)0) : 0;
if (except && opt_no_exceptions)
return;
Modified: stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp (original)
+++ stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp Fri Jun 6 20:43:41 2008
@@ -1107,7 +1107,8 @@
end - deq.begin ());
exception_loop (line, EraseRange, funcall, 0,
- deq, start, len, 0, (UserClass*)0, (UserClass*)0,
+ deq, start, int (len), 0,
+ (UserClass*)0, (UserClass*)0,
&n_copy, &n_asgn);
}
Modified: stdcxx/branches/4.3.x/tests/containers/23.vector.cons.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/containers/23.vector.cons.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/containers/23.vector.cons.cpp (original)
+++ stdcxx/branches/4.3.x/tests/containers/23.vector.cons.cpp Fri Jun 6 20:43:41 2008
@@ -569,7 +569,7 @@
for (typename Vector::size_type i = 0; i != rw_opt_nloops; ++i) {
- const T val = i;
+ const T val = T (i);
Vector v0 (i, val);
Vector v1 (i, val, alloc);
Modified: stdcxx/branches/4.3.x/tests/localization/22.locale.codecvt.length.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/localization/22.locale.codecvt.length.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/localization/22.locale.codecvt.length.cpp (original)
+++ stdcxx/branches/4.3.x/tests/localization/22.locale.codecvt.length.cpp Fri Jun 6 20:43:41 2008
@@ -510,7 +510,7 @@
#undef TEST
#define TEST(from, nc, maxi, res) \
test_length (wchar_t (), __LINE__, 0, cvt_libc, \
- from, std::size_t (nc), std::size_t (maxi), res)
+ from, std::size_t (nc), maxi, res)
TEST (0, 0, 0, 0);
TEST ("", 0, 0, 0);
Modified: stdcxx/branches/4.3.x/tests/localization/22.locale.num.get.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/localization/22.locale.num.get.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/localization/22.locale.num.get.cpp (original)
+++ stdcxx/branches/4.3.x/tests/localization/22.locale.num.get.cpp Fri Jun 6 20:43:41 2008
@@ -528,7 +528,7 @@
for (i = 0; i != sizeof errnos / sizeof *errnos; ++i) { \
errno = errnos [i]; \
TEST (T, numT (val), _RWSTD_STR (val), \
- sizeof (_RWSTD_STR (val)) -1, 0, Eof); \
+ int (sizeof (_RWSTD_STR (val))) -1, 0, Eof); \
rw_assert (errnos [i] == errno, 0, __LINE__, \
"%d. errno unexpectedly changed from %d to %d", \
i, errnos [i], errno); \
@@ -1174,7 +1174,7 @@
"1"
};
- static const std::size_t NC = sizeof many_groups - 1;
+ static const int NC = int (sizeof many_groups - 1);
const int nfail = TEST (T, 1L, many_groups + i, NC - i, dec, Eof, "\1");
@@ -1322,18 +1322,20 @@
const char vflow_1[] = "999999999999999999990";
#endif
- TEST (T, LONG_MIN, lmin, sizeof lmin - 1, 0, Eof);
- TEST (T, LONG_MIN, lmin_minus_1, sizeof lmin_minus_1 - 1, 0, Eof | Fail);
- TEST (T, LONG_MIN, lmin_minus_2, sizeof lmin_minus_2 - 1, 0, Eof | Fail);
- TEST (T, LONG_MIN, lmin_minus_3, sizeof lmin_minus_3 - 1, 0, Eof | Fail);
-
- TEST (T, LONG_MAX, lmax, sizeof lmax - 1, 0, Eof);
- TEST (T, LONG_MAX, lmax_plus_1, sizeof lmax_plus_1 - 1, 0, Eof | Fail);
- TEST (T, LONG_MAX, lmax_plus_2, sizeof lmax_plus_2 - 1, 0, Eof | Fail);
- TEST (T, LONG_MAX, lmax_plus_3, sizeof lmax_plus_3 - 1, 0, Eof | Fail);
- TEST (T, LONG_MAX, lmax_x_f, sizeof lmax_x_f - 1, 0, Eof | Fail);
+#define INTSIZE(x) _RWSTD_STATIC_CAST(int, sizeof (x))
- TEST (T, LONG_MAX, vflow_1, sizeof vflow_1 - 1, 0, Eof | Fail);
+ TEST (T, LONG_MIN, lmin, INTSIZE (lmin - 1), 0, Eof);
+ TEST (T, LONG_MIN, lmin_minus_1, INTSIZE (lmin_minus_1 - 1), 0, Eof | Fail);
+ TEST (T, LONG_MIN, lmin_minus_2, INTSIZE (lmin_minus_2 - 1), 0, Eof | Fail);
+ TEST (T, LONG_MIN, lmin_minus_3, INTSIZE (lmin_minus_3 - 1), 0, Eof | Fail);
+
+ TEST (T, LONG_MAX, lmax, INTSIZE (lmax - 1), 0, Eof);
+ TEST (T, LONG_MAX, lmax_plus_1, INTSIZE (lmax_plus_1 - 1), 0, Eof | Fail);
+ TEST (T, LONG_MAX, lmax_plus_2, INTSIZE (lmax_plus_2 - 1), 0, Eof | Fail);
+ TEST (T, LONG_MAX, lmax_plus_3, INTSIZE (lmax_plus_3 - 1), 0, Eof | Fail);
+ TEST (T, LONG_MAX, lmax_x_f, INTSIZE (lmax_x_f - 1), 0, Eof | Fail);
+
+ TEST (T, LONG_MAX, vflow_1, INTSIZE (vflow_1 - 1), 0, Eof | Fail);
// verify that the combination of ERANGE and LONG_MAX
@@ -1533,13 +1535,13 @@
const char vflow_1[] = "999999999999999999990";
#endif
- TEST (T, ULONG_MAX, ulmax, sizeof ulmax - 1, 0, Eof);
- TEST (T, ULONG_MAX, ulmax_plus_1, sizeof ulmax_plus_1 - 1, 0, Eof | Fail);
- TEST (T, ULONG_MAX, ulmax_plus_2, sizeof ulmax_plus_2 - 1, 0, Eof | Fail);
- TEST (T, ULONG_MAX, ulmax_plus_3, sizeof ulmax_plus_3 - 1, 0, Eof | Fail);
- TEST (T, ULONG_MAX, ulmax_x_f, sizeof ulmax_x_f - 1, 0, Eof | Fail);
+ TEST (T, ULONG_MAX, ulmax, INTSIZE (ulmax - 1), 0, Eof);
+ TEST (T, ULONG_MAX, ulmax_plus_1, INTSIZE (ulmax_plus_1 - 1), 0, Eof | Fail);
+ TEST (T, ULONG_MAX, ulmax_plus_2, INTSIZE (ulmax_plus_2 - 1), 0, Eof | Fail);
+ TEST (T, ULONG_MAX, ulmax_plus_3, INTSIZE (ulmax_plus_3 - 1), 0, Eof | Fail);
+ TEST (T, ULONG_MAX, ulmax_x_f, INTSIZE (ulmax_x_f - 1), 0, Eof | Fail);
- TEST (T, ULONG_MAX, vflow_1, sizeof vflow_1 - 1, 0, Eof | Fail);
+ TEST (T, ULONG_MAX, vflow_1, INTSIZE (vflow_1 - 1), 0, Eof | Fail);
// verify that the combination of ERANGE and ULONG_MAX
// doesn't trip the facet up if it uses strtoul()
@@ -2119,7 +2121,7 @@
const char pvmax_plus_1[] = "0xffffffffffffffffffffffffffffffff";
#endif
-#define PVOIDSTR(name) name, sizeof name - 1
+#define PVOIDSTR(name) name, INTSIZE (name - 1)
TEST (T, PVoid (~0), PVOIDSTR (pvmax), 0, Eof);
TEST (T, PVoid (~0), PVOIDSTR (pvmax_plus_1), 0, Eof | Fail);
@@ -2825,7 +2827,7 @@
long_str [sizeof long_str - 1] = '\0';
// parse a string of LDBL_MAX_10_EXP + 1 zeros
- TEST (T, 0.0L, long_str, sizeof long_str - 1, 0, Eof);
+ TEST (T, 0.0L, long_str, INTSIZE (long_str - 1), 0, Eof);
const char *start;
@@ -2836,7 +2838,7 @@
TEST (T, 1.0e+38L, start, 39, 0, Eof);
// parse the same as above but preceded by a bunch of zeros
- TEST (T, 1.0e+38L, long_str, sizeof long_str - 1, 0, Eof);
+ TEST (T, 1.0e+38L, long_str, INTSIZE (long_str - 1), 0, Eof);
long_str [sizeof long_str - 40] = '0';
# endif // _RWSTD_LDBL_MAX_10_EXP > 129
@@ -2849,7 +2851,7 @@
TEST (T, 1.0e+128L, start, 129, 0, Eof);
// parse the same as above but preceded by a bunch of zeros
- TEST (T, 1.0e+128L, long_str, sizeof long_str - 1, 0, Eof);
+ TEST (T, 1.0e+128L, long_str, INTSIZE (long_str - 1), 0, Eof);
long_str [sizeof long_str - 130] = '0';
# endif // _RWSTD_LDBL_MAX_10_EXP > 129
@@ -2861,7 +2863,7 @@
TEST (T, 1.0e+308L, start, 309, 0, Eof);
// parse the same as above but preceded by a bunch of zeros
- TEST (T, 1.0e+308L, long_str, sizeof long_str - 1, 0, Eof);
+ TEST (T, 1.0e+308L, long_str, INTSIZE (long_str - 1), 0, Eof);
long_str [sizeof long_str - 310] = '0';
# endif // _RWSTD_LDBL_MAX_10_EXP > 308
@@ -2876,7 +2878,7 @@
long_str [0] = '1';
long_val = CAT (CAT (1.0e+, _RWSTD_LDBL_MAX_10_EXP), L);
- TEST (T, long_val, long_str, sizeof long_str - 1, 0, Eof);
+ TEST (T, long_val, long_str, INTSIZE (long_str - 1), 0, Eof);
# endif // _RWSTD_NO_LONG_DOUBLE
Modified: stdcxx/branches/4.3.x/tests/numerics/26.c.math.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/numerics/26.c.math.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/numerics/26.c.math.cpp (original)
+++ stdcxx/branches/4.3.x/tests/numerics/26.c.math.cpp Fri Jun 6 20:43:41 2008
@@ -131,7 +131,7 @@
// returns true if all `size' bytes starting at `s' are 0
static bool
-check_bits (const char *s, unsigned size)
+check_bits (const char *s, std::size_t size)
{
while (size-- && !s [size]);
return unsigned (-1) == size;
@@ -168,8 +168,8 @@
const float f = std::modf (3.141592f, &u.f);
rw_assert ( 3000 == int (u.f * 1000) && 141592 == int (f * 1000000)
- && check_bits (u.buf + sizeof u.f, sizeof u - sizeof u.f),
- 0, __LINE__, "float std::modf (float)");
+ && check_bits (u.buf + sizeof (u.f), sizeof (u) - sizeof (u.f)),
+ __FILE__, __LINE__, "float std::modf (float)");
#endif // SunPro > 5.3
@@ -177,8 +177,8 @@
const double d = std::modf (3.1415926, &u.d);
rw_assert ( 3000 == int (u.d * 1000) && 1415926 == int (d * 10000000)
- && check_bits (u.buf + sizeof u.d, sizeof u - sizeof u.d),
- 0, __LINE__, "double std::modf (double)");
+ && check_bits (u.buf + sizeof (u.d), sizeof (u) - sizeof (u.d)),
+ __FILE__, __LINE__, "double std::modf (double)");
#ifndef _RWSTD_NO_LONG_DOUBLE
@@ -188,14 +188,13 @@
const long double l = std::modf (3.1415926L, &u.l);
rw_assert ( 3000 == int (u.l * 1000) && 1415926 == int (l * 10000000)
- && check_bits (u.buf + sizeof u.l, sizeof u - sizeof u.l),
- 0, __LINE__, "long double std::modf (long double)");
+ && check_bits (u.buf + sizeof (u.l), sizeof (u) - sizeof (u.l)),
+ __FILE__, __LINE__, "long double std::modf (long double)");
# endif // SunPro > 5.3
#endif // _RWSTD_NO_LONG_DOUBLE
-
// check overloads of std::pow()
for (int i = -10; i != 10; ++i) {
Modified: stdcxx/branches/4.3.x/tests/regress/24.operations.stdcxx-234.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/regress/24.operations.stdcxx-234.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/regress/24.operations.stdcxx-234.cpp (original)
+++ stdcxx/branches/4.3.x/tests/regress/24.operations.stdcxx-234.cpp Fri Jun 6 20:43:41 2008
@@ -43,5 +43,5 @@
int main ()
{
- return std::distance (X (), X ());
+ return int (std::distance (X (), X ()));
}
Modified: stdcxx/branches/4.3.x/tests/regress/27.stringbuf.members.stdcxx-427.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/regress/27.stringbuf.members.stdcxx-427.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/regress/27.stringbuf.members.stdcxx-427.cpp (original)
+++ stdcxx/branches/4.3.x/tests/regress/27.stringbuf.members.stdcxx-427.cpp Fri Jun 6 20:43:41 2008
@@ -25,6 +25,7 @@
**************************************************************************/
#include <cassert>
+#include <cstdio>
#include <sstream>
int main ()
@@ -46,15 +47,18 @@
{
Buf buf ("abcde", std::ios::in);
buf.setget (1, 2, 4);
+ std::printf ("%s\n", buf.str ().c_str ());
assert ("bcd" == buf.str ());
}
{
Buf buf ("abcde", std::ios::out);
buf.setput (1, 2, 4);
+ std::printf ("%s\n", buf.str ().c_str ());
assert ("bcde" == buf.str ());
}
{
Buf buf ("abcde", std::ios::openmode ());
+ std::printf ("%s\n", buf.str ().c_str ());
assert ("" == buf.str ());
}
}
Modified: stdcxx/branches/4.3.x/tests/src/char.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/char.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/char.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/char.cpp Fri Jun 6 20:43:41 2008
@@ -1204,7 +1204,7 @@
else if (isdigit (UChar (*fmt))) {
// process positional parameter or width
char* end = 0;
- const int arg = strtol (fmt, &end, 10);
+ const int arg = int (strtol (fmt, &end, 10));
if ('$' == *end)
paramno = arg;
else
Modified: stdcxx/branches/4.3.x/tests/src/cmdopt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/cmdopt.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/cmdopt.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/cmdopt.cpp Fri Jun 6 20:43:41 2008
@@ -364,10 +364,10 @@
if (have_maxval) {
_rw_cmdopts [_rw_ncmdopts].minval_ = 0;
- _rw_cmdopts [_rw_ncmdopts].maxval_ = val;
+ _rw_cmdopts [_rw_ncmdopts].maxval_ = int (val);
}
else
- _rw_cmdopts [_rw_ncmdopts].minval_ = val;
+ _rw_cmdopts [_rw_ncmdopts].minval_ = int (val);
if (sep == *next && !have_maxval) {
++next;
@@ -704,7 +704,7 @@
else if (optspec->pcntr_) {
// set the counter
- *optspec->pcntr_ = optval;
+ *optspec->pcntr_ = int (optval);
}
return status;
Modified: stdcxx/branches/4.3.x/tests/src/locale.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/locale.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/locale.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/locale.cpp Fri Jun 6 20:43:41 2008
@@ -454,7 +454,7 @@
}
// if successful, construct a char array with the locales
- while (fgets (linebuf, sizeof linebuf, file)) {
+ while (fgets (linebuf, int (sizeof linebuf), file)) {
const size_t linelen = strlen (linebuf);
@@ -1147,7 +1147,7 @@
}
char locale [128];
- while (fgets (locale, sizeof (locale), file)) {
+ while (fgets (locale, int (sizeof (locale)), file)) {
// ensure sufficient space in array
if (! (size < capacity)) {
Modified: stdcxx/branches/4.3.x/tests/src/opt_lines.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/opt_lines.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/opt_lines.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/opt_lines.cpp Fri Jun 6 20:43:41 2008
@@ -187,7 +187,7 @@
parg = end;
if (0 <= first && first < line) {
- _rw_enable_lines (first, line, flags);
+ _rw_enable_lines (int (first), int (line), flags);
first = -1;
}
}
Modified: stdcxx/branches/4.3.x/tests/src/opt_trace.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/opt_trace.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/opt_trace.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/opt_trace.cpp Fri Jun 6 20:43:41 2008
@@ -172,7 +172,7 @@
parg = end;
if (0 <= first && first < severity) {
- for (int i = first; i != severity; ++i)
+ for (long i = first; i != severity; ++i)
diag_set |= 1 << i;
severity = -1;
}
Modified: stdcxx/branches/4.3.x/tests/src/process.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/process.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/process.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/process.cpp Fri Jun 6 20:43:41 2008
@@ -572,7 +572,7 @@
rw_pid_t ret = 0;
do {
- ret = waitpid (pid, &status, 0);
+ ret = waitpid (pid_t (pid), &status, 0);
if (-1 == ret) {
@@ -635,7 +635,7 @@
if (0 < timeout) {
if (prev_alarm_timeout) {
- const int delta = time(0) - start;
+ const int delta = int (time(0) - start);
if (delta < prev_alarm_timeout)
prev_alarm_timeout -= delta;
@@ -706,14 +706,14 @@
const int* const signals = (-1 == signo) ? signals_ : &signo;
const unsigned sigcount =
- (-1 == signo) ? sizeof (signals_) / sizeof (*signals_) : 1;
+ (-1 == signo) ? unsigned (sizeof (signals_) / sizeof (*signals_)) : 1;
int ret = -1;
for (unsigned i = 0; i < sigcount; ++i) {
// send signal
- ret = kill (pid, signals [i]);
+ ret = kill (pid_t (pid), signals [i]);
if (-1 == ret) {
rw_error (0, __FILE__, __LINE__,
Modified: stdcxx/branches/4.3.x/tests/src/rand.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/rand.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/rand.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/rand.cpp Fri Jun 6 20:43:41 2008
@@ -44,7 +44,7 @@
rw_seed32 (_RWSTD_UINT32_T seed)
{
if (0xffffffffUL == seed)
- seed = clock ();
+ seed = unsigned (clock ());
table32 [TABLE_SIZE - 1] = seed;
Modified: stdcxx/branches/4.3.x/tests/src/thread.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/thread.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/thread.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/thread.cpp Fri Jun 6 20:43:41 2008
@@ -490,7 +490,7 @@
// apply timeout if one was specified
if (0 != timeout) {
_rw_timeout_expired = 0;
- rw_alarm (timeout, _rw_timeout_handler);
+ rw_alarm (unsigned (timeout), _rw_timeout_handler);
}
// small buffer for thread ids when invoked with (thr_id == 0)
Modified: stdcxx/branches/4.3.x/tests/src/value.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/value.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/value.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/value.cpp Fri Jun 6 20:43:41 2008
@@ -740,7 +740,7 @@
else if (isdigit (*fmt)) {
// process positional parameter or width
char* end = 0;
- const int arg = strtol (fmt, &end, 10);
+ const int arg = int (strtol (fmt, &end, 10));
if ('$' != *end)
nelems = arg;
@@ -774,7 +774,7 @@
}
else if (isdigit (*fmt)) {
char* end = 0;
- cursor = strtol (fmt, &end, 10);
+ cursor = int (strtol (fmt, &end, 10));
fmt = end;
}
Modified: stdcxx/branches/4.3.x/tests/strings/21.cwctype.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/strings/21.cwctype.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/strings/21.cwctype.cpp (original)
+++ stdcxx/branches/4.3.x/tests/strings/21.cwctype.cpp Fri Jun 6 20:43:41 2008
@@ -83,6 +83,7 @@
"iswlower",
#else
"",
+#endif
#ifdef iswprint
# undef iswprint
@@ -119,8 +120,6 @@
"",
#endif
-#endif
-
#ifdef tolower
# undef tolower
"tolower",
Modified: stdcxx/branches/4.3.x/tests/strings/21.string.io.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/strings/21.string.io.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/strings/21.string.io.cpp (original)
+++ stdcxx/branches/4.3.x/tests/strings/21.string.io.cpp Fri Jun 6 20:43:41 2008
@@ -994,14 +994,15 @@
else if (0 == tcase.bthrow) {
// set on which call of which method to throw
sbuf.throw_when_ [sbuf.memfun_inx (
- test_inserter ? Overflow : Underflow) ] = throw_on [throw_inx];
+ test_inserter ? Overflow : Underflow) ] =
+ int (throw_on [throw_inx]);
sbuf.throw_when_ [sbuf.memfun_inx (Xsgetn)] =
- throw_count [0];
+ int (throw_count [0]);
sbuf.throw_when_ [sbuf.memfun_inx (Sync)] =
- throw_count [1];
+ int (throw_count [1]);
sbuf.throw_when_ [sbuf.memfun_inx (Xsputn)] =
- throw_count [2];
+ int (throw_count [2]);
}
else {
// exceptions disabled for this test case
Modified: stdcxx/branches/4.3.x/util/aliases.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/aliases.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/aliases.cpp (original)
+++ stdcxx/branches/4.3.x/util/aliases.cpp Fri Jun 6 20:43:41 2008
@@ -615,7 +615,7 @@
*last_name = '\0';
// if successful, construct a char array with the locales
- while (std::fgets (cmd, sizeof cmd, f)) {
+ while (std::fgets (cmd, int (sizeof cmd), f)) {
cmd [std::strlen (cmd) - 1] = '\0';
// if our buffer is full then dynamically allocate a new one
Modified: stdcxx/branches/4.3.x/util/charmap.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/charmap.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/charmap.cpp (original)
+++ stdcxx/branches/4.3.x/util/charmap.cpp Fri Jun 6 20:43:41 2008
@@ -510,7 +510,7 @@
// NOTE: this will not detect errors in the sequence, since the program
// will continue until it finds a valid character
do {
- int last_elm = encoding.size () - 1;
+ int last_elm = int (encoding.size ()) - 1;
while (last_elm >= 0) {
@@ -559,8 +559,8 @@
// convert the last character in the multibyte character to a numeric
// value representing the last byte of the sequence
- unsigned long last_byte =
- scanner_.convert_escape (encoding.c_str () + pos, &end);
+ unsigned last_byte =
+ unsigned (scanner_.convert_escape (encoding.c_str () + pos, &end));
// POSIX requires that the incremented value be non-NUL
if (UCHAR_MAX <= last_byte || *end)
Modified: stdcxx/branches/4.3.x/util/cmdopt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/cmdopt.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/cmdopt.cpp (original)
+++ stdcxx/branches/4.3.x/util/cmdopt.cpp Fri Jun 6 20:43:41 2008
@@ -53,26 +53,20 @@
#include "cmdopt.h"
const char* exe_name; /**< Alias for process argv [0]. */
-#if !defined (_WIN32) && !defined (_WIN64)
+
+#ifndef _WIN32
+
const char escape_code = '\\';
const char default_path_sep = '/';
const char suffix_sep = '.';
const size_t exe_suffix_len = 0;
-#if defined (_SC_CLK_TCK)
-const float TICKS_PER_SEC = sysconf (_SC_CLK_TCK);
-#elif defined (CLK_TCK)
-const float TICKS_PER_SEC = CLK_TCK;
-#elif defined (CLOCKS_PER_SEC)
-const float TICKS_PER_SEC = CLOCKS_PER_SEC;
-#else
-# error Unable to determine number of clock ticks in a second.
-#endif
-#else
+
+#else /* Win32 */
+
const char escape_code = '^';
const char default_path_sep = '\\';
const char suffix_sep = '.';
const size_t exe_suffix_len = 4; /* strlen(".exe") == 4 */
-const float TICKS_PER_SEC = CLOCKS_PER_SEC;
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
@@ -521,7 +515,7 @@
bad_value (optname, optarg);
errno = 0;
- defaults->timeout = strtol (optarg, &end, 10);
+ defaults->timeout = unsigned (strtol (optarg, &end, 10));
if (*end || errno)
bad_value (optname, optarg);
}
@@ -581,7 +575,7 @@
errno = 0;
const long code = strtol (optarg, &end, 10);
if ('\0' == *end && !errno)
- exit (code);
+ exit (int (code));
}
}
else if ( sizeof opt_help - 1 == arglen
@@ -603,7 +597,7 @@
errno = 0;
const long nsec = strtol (optarg, &end, 10);
if ('\0' == *end && 0 <= nsec && !errno) {
- rw_sleep (nsec);
+ rw_sleep (int (nsec));
break;
}
}
Modified: stdcxx/branches/4.3.x/util/cmdopt.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/cmdopt.h?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/cmdopt.h (original)
+++ stdcxx/branches/4.3.x/util/cmdopt.h Fri Jun 6 20:43:41 2008
@@ -34,7 +34,7 @@
extern const char default_path_sep; /**< Primary path seperator */
extern const char suffix_sep; /**< File suffix seperator. */
extern const size_t exe_suffix_len; /**< Length of executable suffix. */
-extern const float TICKS_PER_SEC; /**< Number of clock ticks in a second. */
+
/**
Parses command line arguments for switches and options.
Modified: stdcxx/branches/4.3.x/util/codecvt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/codecvt.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/codecvt.cpp (original)
+++ stdcxx/branches/4.3.x/util/codecvt.cpp Fri Jun 6 20:43:41 2008
@@ -163,7 +163,7 @@
off_map->insert (std::make_pair (it->first, off));
- off += it->first.size () + 1;
+ off += unsigned (it->first.size ()) + 1;
std::string utf = utf8_encode (it->second);
@@ -337,7 +337,7 @@
std::list<std::string>::const_iterator sit =
it->second.begin ();
for (; sit != it->second.end (); ++sit) {
- data_offset += sit->size () + 1;
+ data_offset += unsigned (sit->size ()) + 1;
}
++data_offset;
}
@@ -401,7 +401,7 @@
table.offset_table [i] = UINT_MAX;
// insert it into the map
- unsigned int tmp = xlit_table_map_.size ();
+ unsigned int tmp = unsigned (xlit_table_map_.size ());
xlit_table_map_.insert (std::make_pair(tmp, table));
// store its index at correct position in current table
@@ -468,29 +468,31 @@
_RW::__rw_codecvt_t codecvt_out;
std::memset (&codecvt_out, 0, sizeof codecvt_out);
+#define UINT(x) _RWSTD_STATIC_CAST(unsigned, x)
+
// calculate byte offsets within the structure
codecvt_out.n_to_w_tab_off = 0;
- codecvt_out.w_to_n_tab_off = codecvt_out.n_to_w_tab_off
- + mbchar_offs.size () * (UCHAR_MAX + 1) * sizeof (unsigned);
+ codecvt_out.w_to_n_tab_off = UINT (codecvt_out.n_to_w_tab_off
+ + mbchar_offs.size () * (UCHAR_MAX + 1) * sizeof (unsigned));
- codecvt_out.utf8_to_ext_tab_off = codecvt_out.w_to_n_tab_off
- + wchar_offs.size () * (UCHAR_MAX + 1) * sizeof (unsigned);
+ codecvt_out.utf8_to_ext_tab_off = UINT (codecvt_out.w_to_n_tab_off
+ + wchar_offs.size () * (UCHAR_MAX + 1) * sizeof (unsigned));
// insert the transliteration tables here
- codecvt_out.xliteration_off = codecvt_out.utf8_to_ext_tab_off
- + uchar_offs.size () * (UCHAR_MAX + 1) * sizeof (unsigned);
+ codecvt_out.xliteration_off = UINT (codecvt_out.utf8_to_ext_tab_off
+ + uchar_offs.size () * (UCHAR_MAX + 1) * sizeof (unsigned));
- codecvt_out.wchar_off = codecvt_out.xliteration_off
- + xlit_table_map_.size () * (UCHAR_MAX + 1) * sizeof (unsigned);
+ codecvt_out.wchar_off = UINT (codecvt_out.xliteration_off
+ + xlit_table_map_.size () * (UCHAR_MAX + 1) * sizeof (unsigned));
- codecvt_out.codeset_off = codecvt_out.wchar_off
- + charmap_.get_mb_cmap ().size () * 2 * sizeof (wchar_t);
+ codecvt_out.codeset_off = UINT (codecvt_out.wchar_off
+ + charmap_.get_mb_cmap ().size () * 2 * sizeof (wchar_t));
- codecvt_out.charmap_off = codecvt_out.codeset_off
- + charmap_.get_code_set_name ().size () + 1 /* NUL */;
+ codecvt_out.charmap_off = UINT (codecvt_out.codeset_off
+ + charmap_.get_code_set_name ().size () + 1 /* NUL */);
- const std::size_t mb_offset = codecvt_out.charmap_off
- + charmap_.get_charmap_name ().size () + 1 /* NUL */;
+ const std::size_t mb_offset = UINT (codecvt_out.charmap_off
+ + charmap_.get_charmap_name ().size () + 1 /* NUL */);
// compute the size of narrow strings map which added to
// mb_offset will give the start of the transliteration data
@@ -514,7 +516,7 @@
if (xit->second.offset_table [i] & 0x80000000)
continue;
// add the offset for xliteration data
- xit->second.offset_table [i] += xlit_data_offset;
+ xit->second.offset_table [i] += UINT (xlit_data_offset);
}
}
@@ -565,7 +567,7 @@
unsigned off = it->second->off [i];
if (!(off & 0x80000000))
- off += mb_offset;
+ off += UINT (mb_offset);
out.write ((const char*)&off, sizeof off);
}
@@ -590,7 +592,7 @@
unsigned off = it->second->off [i];
if (!(off & 0x80000000))
- off += mb_offset;
+ off += UINT (mb_offset);
out.write ((const char*)&off, sizeof off);
}
Modified: stdcxx/branches/4.3.x/util/collate.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/collate.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/collate.cpp (original)
+++ stdcxx/branches/4.3.x/util/collate.cpp Fri Jun 6 20:43:41 2008
@@ -75,7 +75,7 @@
Weights_t* weights = new Weights_t[collate_out_.num_weights];
- std::size_t i = 0;
+ int i = 0;
for (i = 0; i < collate_out_.num_weights && w_it != entry.second.end ();
++i, ++w_it){
get_weight (*w_it, weights, i);
@@ -1179,7 +1179,8 @@
// check to see of the largest_ce needs to be changed
if (ce_mit->second.ce_wstr.size() + 1
> collate_out_.largest_ce)
- collate_out_.largest_ce = ce_mit->second.ce_wstr.size();
+ collate_out_.largest_ce =
+ unsigned (ce_mit->second.ce_wstr.size());
ce_strs.insert (it->first);
}
@@ -1204,12 +1205,10 @@
std::ofstream out (dir_name.c_str(), std::ios::binary);
out.exceptions (std::ios::failbit | std::ios::badbit);
- unsigned int i;
-
// calculate the size of an individual weight element
collate_out_.elm_size = collate_out_.num_weights
- * collate_out_.longest_weight * sizeof (unsigned int) +
- sizeof (unsigned int);
+ * collate_out_.longest_weight * unsigned (sizeof (unsigned int)) +
+ unsigned (sizeof (unsigned int));
// the first section of the collate database is the collating
// element information
@@ -1219,7 +1218,8 @@
for (n_ce_offs_it = n_ce_offs_.begin();
n_ce_offs_it != n_ce_offs_.end (); ++n_ce_offs_it) {
collate_out_.w_ce_tab_off += (n_ce_offs_it->second.last_offset
- - n_ce_offs_it->second.first_offset + 1)* sizeof (int);
+ - n_ce_offs_it->second.first_offset + 1)
+ * unsigned (sizeof (int));
}
// next comes the weight information
@@ -1228,12 +1228,13 @@
for (w_ce_offs_it = w_ce_offs_.begin();
w_ce_offs_it != w_ce_offs_.end(); ++w_ce_offs_it) {
collate_out_.weight_tab_off += (w_ce_offs_it->second.last_offset
- - w_ce_offs_it->second.first_offset + 1)* sizeof (int);
+ - w_ce_offs_it->second.first_offset + 1)
+ * unsigned (sizeof (int));
}
coll_map_iter coll_map_pos;
- collate_out_.num_elms = off_mapr_.size();
+ collate_out_.num_elms = unsigned (off_mapr_.size());
if (collate_out_.undefined_optimization)
++collate_out_.num_elms;
@@ -1249,7 +1250,7 @@
char_offs_it != char_offs_.end(); ++char_offs_it) {
char_offs_size += (UCHAR_MAX + 1
- char_offs_it->second.first_offset)
- * sizeof (unsigned int);
+ * unsigned (sizeof (unsigned int));
}
collate_out_.w_char_tab_off = collate_out_.n_char_tab_off
@@ -1263,7 +1264,7 @@
w_to_n_coll_it != w_to_n_coll_.end(); ++w_to_n_coll_it) {
w_to_n_size += (UCHAR_MAX + 1
- w_to_n_coll_it->second.first_offset)
- * sizeof (unsigned int);
+ * unsigned (sizeof (unsigned int));
}
collate_out_.n_char_off_tab_off = collate_out_.w_char_tab_off
@@ -1271,53 +1272,54 @@
// now calculate the offset for the wide character offset table
collate_out_.w_char_off_tab_off = collate_out_.n_char_off_tab_off
- + char_offs_.size() * sizeof (unsigned int);
+ + unsigned (char_offs_.size() * sizeof (unsigned int));
// calculate the offset for the narrow collating element offset table
collate_out_.n_ce_off_tab_off = collate_out_.w_char_off_tab_off
- + w_to_n_coll_.size() * sizeof (unsigned int);
+ + unsigned (w_to_n_coll_.size() * sizeof (unsigned int));
// calculate the offset for the wide collating element offset table
collate_out_.w_ce_off_tab_off = collate_out_.n_ce_off_tab_off
- + n_ce_offs_.size() * sizeof (unsigned int);
+ + unsigned (n_ce_offs_.size() * sizeof (unsigned int));
// now calculate the offset of the first character information
collate_out_.n_char_first_char_off = collate_out_.w_ce_off_tab_off
- + w_ce_offs_.size() * sizeof (unsigned int);
+ + unsigned (w_ce_offs_.size() * sizeof (unsigned int));
// now calculate the offset of the wide table first char info
collate_out_.w_char_first_char_off = collate_out_.n_char_first_char_off
- + char_offs_.size() * sizeof (unsigned char);
+ + unsigned (char_offs_.size() * sizeof (unsigned char));
// now calculate the offset of the narrow ce first character info
collate_out_.n_ce_first_char_off = collate_out_.w_char_first_char_off
- + w_to_n_coll_.size() * sizeof (unsigned char);
+ + unsigned (w_to_n_coll_.size() * sizeof (unsigned char));
// now calculate the offset of the wide ce first character info
collate_out_.w_ce_first_char_off = collate_out_.n_ce_first_char_off
- + n_ce_offs_.size() * sizeof (unsigned char);
+ + unsigned (n_ce_offs_.size() * sizeof (unsigned char));
// now calculate the offset of the narrow ce last character info
collate_out_.n_ce_last_char_off = collate_out_.w_ce_first_char_off
- + w_ce_offs_.size() * sizeof (unsigned char);
+ + unsigned (w_ce_offs_.size() * sizeof (unsigned char));
// now calculate the offset of the wide ce last character info
collate_out_.w_ce_last_char_off = collate_out_.n_ce_last_char_off
- + n_ce_offs_.size() * sizeof (unsigned char);
+ + unsigned (n_ce_offs_.size() * sizeof (unsigned char));
// now calculate the offset of the codeset name
collate_out_.codeset_off = collate_out_.w_ce_last_char_off
- + w_ce_offs_.size() * sizeof (unsigned char);
+ + unsigned (w_ce_offs_.size() * sizeof (unsigned char));
// finally calculate the offset of the charmap name
collate_out_.charmap_off = collate_out_.codeset_off
- + charmap_.get_code_set_name().size() + 1;
+ + unsigned (charmap_.get_code_set_name().size()) + 1;
// print out the collate struct
out.write ((char*)&collate_out_, sizeof(collate_out_));
+ unsigned int i;
for (n_ce_offs_it = n_ce_offs_.begin();
n_ce_offs_it != n_ce_offs_.end(); ++n_ce_offs_it) {
for (i = (unsigned int)n_ce_offs_it->second.first_offset;
@@ -2096,14 +2098,14 @@
while (weight_num < collate_out_.num_weights) {
- std::size_t c;
+ unsigned c;
for (c = 0; *next_val && (!next_wt || next_val < next_wt); ++c) {
const char* end = 0;
weights [weight_num].weight [c] =
- scanner_.convert_escape (next_val, &end, true);
+ unsigned (scanner_.convert_escape (next_val, &end, true));
assert (0 != end);
@@ -2196,7 +2198,7 @@
const char* end = 0;
weights [weight_num].weight [k++] =
- scanner_.convert_escape (beg, &end, true);
+ unsigned (scanner_.convert_escape (beg, &end, true));
assert (0 != end);
Modified: stdcxx/branches/4.3.x/util/ctype.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/ctype.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/ctype.cpp (original)
+++ stdcxx/branches/4.3.x/util/ctype.cpp Fri Jun 6 20:43:41 2008
@@ -845,18 +845,18 @@
// calculate the offsets for the wchar_t arrays
ctype_out_.wtoupper_off = 0;
- ctype_out_.wtolower_off = ctype_out_.wtoupper_off
- + upper_.size() * sizeof (_RW::__rw_upper_elm);
- ctype_out_.wmask_off = ctype_out_.wtolower_off
- + lower_.size() * sizeof (_RW::__rw_lower_elm);
- ctype_out_.wmask_s = mask_.size();
+ ctype_out_.wtolower_off = unsigned (ctype_out_.wtoupper_off
+ + upper_.size() * sizeof (_RW::__rw_upper_elm));
+ ctype_out_.wmask_off = unsigned (ctype_out_.wtolower_off
+ + lower_.size() * sizeof (_RW::__rw_lower_elm));
+ ctype_out_.wmask_s = unsigned (mask_.size());
// calculate the offsets for the codeset name string and character
// map name string
- ctype_out_.codeset_off = ctype_out_.wmask_off
- + mask_.size() * sizeof (_RW::__rw_mask_elm);
- ctype_out_.charmap_off = ctype_out_.codeset_off
- + charmap_.get_code_set_name().size() + 1;
+ ctype_out_.codeset_off = unsigned (ctype_out_.wmask_off
+ + mask_.size() * sizeof (_RW::__rw_mask_elm));
+ ctype_out_.charmap_off = unsigned (ctype_out_.codeset_off
+ + charmap_.get_code_set_name().size() + 1);
ctype_out_.mb_cur_max = charmap_.get_mb_cur_max();
std::size_t i;
Modified: stdcxx/branches/4.3.x/util/display.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/display.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/display.cpp (original)
+++ stdcxx/branches/4.3.x/util/display.cpp Fri Jun 6 20:43:41 2008
@@ -34,6 +34,34 @@
#include "display.h"
#include "target.h" /* for target_status */
+#include <time.h> /* for CLK_TCK, CLOCKS_PER_SEC */
+
+#ifndef _WIN32
+# include <unistd.h> /* for _SC_CLK_TCK, sysconf() */
+#endif
+
+#if defined (_SC_CLK_TCK)
+
+/* dynamically determine the number of clock ticks per second */
+static const float TICKS_PER_SEC = float (sysconf (_SC_CLK_TCK));
+
+#elif defined CLOCKS_PER_SEC
+
+/* use the POSIX (and MSVC 6.0) CLOCKS_PER_SEC constant */
+static const float TICKS_PER_SEC = CLOCKS_PER_SEC;
+
+#elif defined CLK_TCK
+
+/* use CLK_TCK if it's defined (e.g., pre-MSVC 6.0) */
+static const float TICKS_PER_SEC = CLK_TCK;
+
+#else
+
+/* if all else fails, assume the standard 1 million ticks per second */
+static const float TICKS_PER_SEC = 1000000UL;
+
+#endif
+
/**
ProcessStatus enum lookup table for 'short' (6 character) strings.
Modified: stdcxx/branches/4.3.x/util/exec.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/exec.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/exec.cpp (original)
+++ stdcxx/branches/4.3.x/util/exec.cpp Fri Jun 6 20:43:41 2008
@@ -371,7 +371,7 @@
if (isdigit (signame [0])) {
char *junk;
- int trans = strtol (signame, &junk, 10);
+ int trans = int (strtol (signame, &junk, 10));
if (0 == *junk && 0 == errno)
return trans;
Modified: stdcxx/branches/4.3.x/util/locale.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/locale.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/locale.cpp (original)
+++ stdcxx/branches/4.3.x/util/locale.cpp Fri Jun 6 20:43:41 2008
@@ -1184,7 +1184,7 @@
const std::size_t count = ctype_st->wtoupper_s ();
- nchars += count;
+ nchars += int (count);
// print out each pair in the toupper table.
// the wide char table is used because it contains all characters
@@ -1236,7 +1236,7 @@
const std::size_t count = ctype_st->wtolower_s ();
- nchars += count;
+ nchars += int (count);
for (std::size_t j = 0; j < count; ++j) {
out += '(';
@@ -2569,7 +2569,7 @@
unsigned last_wchar [2] = { 0, 0 };
// print out all multibyte characters in this map
- for (std::size_t i = 0; i != UCHAR_MAX + 1U; ++i) {
+ for (unsigned i = 0; i != UCHAR_MAX + 1U; ++i) {
if (tab [i] & 0x80000000) {
Modified: stdcxx/branches/4.3.x/util/messages.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/messages.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/messages.cpp (original)
+++ stdcxx/branches/4.3.x/util/messages.cpp Fri Jun 6 20:43:41 2008
@@ -140,19 +140,19 @@
// now calculate the offsets for the wide string representations
messages_out_.yesexpr_off[1] = 0;
- messages_out_.noexpr_off[1] = messages_out_.yesexpr_off[1]
- + (messages_st_.wyesexpr.size() + 1) * sizeof (wchar_t) ;
+ messages_out_.noexpr_off[1] = unsigned (messages_out_.yesexpr_off[1]
+ + (messages_st_.wyesexpr.size() + 1) * sizeof (wchar_t));
// now calculate the offsets for the narrow string representations
- messages_out_.yesexpr_off[0] = messages_out_.noexpr_off[1]
- + (messages_st_.wnoexpr.size() + 1) * sizeof (wchar_t);
- messages_out_.noexpr_off[0] = messages_out_.yesexpr_off[0]
- + (messages_st_.yesexpr.size() + 1) * sizeof (char);
+ messages_out_.yesexpr_off[0] = unsigned (messages_out_.noexpr_off[1]
+ + (messages_st_.wnoexpr.size() + 1) * sizeof (wchar_t));
+ messages_out_.noexpr_off[0] = unsigned (messages_out_.yesexpr_off[0]
+ + (messages_st_.yesexpr.size() + 1) * sizeof (char));
- messages_out_.codeset_off = messages_out_.noexpr_off[0]
- + (messages_st_.noexpr.size() + 1) * sizeof (char);
- messages_out_.charmap_off = messages_out_.codeset_off
- + (charmap_.get_code_set_name().size() + 1) * sizeof (char);
+ messages_out_.codeset_off = unsigned (messages_out_.noexpr_off[0]
+ + (messages_st_.noexpr.size() + 1) * sizeof (char));
+ messages_out_.charmap_off = unsigned (messages_out_.codeset_off
+ + (charmap_.get_code_set_name().size() + 1) * sizeof (char));
// first write out the messages structure
out.write ((char*)&messages_out_, sizeof(messages_out_));
Modified: stdcxx/branches/4.3.x/util/monetary.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/monetary.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/monetary.cpp (original)
+++ stdcxx/branches/4.3.x/util/monetary.cpp Fri Jun 6 20:43:41 2008
@@ -414,24 +414,24 @@
punct.decimal_point_off [1] = 0;
punct.thousands_sep_off [1] =
- punct.decimal_point_off [1]
- + (mon_st_.wmon_decimal_point.size () + 1) * sizeof (wchar_t);
+ unsigned (punct.decimal_point_off [1]
+ + (mon_st_.wmon_decimal_point.size () + 1) * sizeof (wchar_t));
punct.decimal_point_off [0] =
- punct.thousands_sep_off [1]
- + (mon_st_.wmon_thousands_sep.size () + 1) * sizeof (wchar_t);
+ unsigned (punct.thousands_sep_off [1]
+ + (mon_st_.wmon_thousands_sep.size () + 1) * sizeof (wchar_t));
punct.thousands_sep_off [0] =
- punct.decimal_point_off [0]
- + mon_st_.mon_decimal_point.size () + 1;
+ unsigned (punct.decimal_point_off [0]
+ + mon_st_.mon_decimal_point.size () + 1);
punct.grouping_off =
- punct.thousands_sep_off [0]
- + mon_st_.mon_thousands_sep.size () + 1;
+ unsigned (punct.thousands_sep_off [0]
+ + mon_st_.mon_thousands_sep.size () + 1);
punct.punct_ext_off =
- punct.grouping_off
- + mon_st_.mon_grouping.size () + 1;
+ unsigned (punct.grouping_off
+ + mon_st_.mon_grouping.size () + 1);
// compute the alignment requirement of any offset member
const std::size_t align = sizeof punct.punct_ext_off;
@@ -442,47 +442,45 @@
// compute the amount of padding between the two structs
const std::size_t pad = misalign ? align - misalign : 0;
- punct.punct_ext_off += pad;
+ punct.punct_ext_off += unsigned (pad);
mon_out_.curr_symbol_off [1][1] = 0;
mon_out_.curr_symbol_off [0][1] =
- mon_out_.curr_symbol_off [1][1]
- + (mon_st_.wint_curr_symbol.size () + 1) * sizeof (wchar_t);
+ unsigned (mon_out_.curr_symbol_off [1][1]
+ + (mon_st_.wint_curr_symbol.size () + 1) * sizeof (wchar_t));
mon_out_.positive_sign_off [1] =
- mon_out_.curr_symbol_off [0][1]
- + (mon_st_.wcurrency_symbol.size () + 1) * sizeof (wchar_t);
+ unsigned (mon_out_.curr_symbol_off [0][1]
+ + (mon_st_.wcurrency_symbol.size () + 1) * sizeof (wchar_t));
mon_out_.negative_sign_off [1] =
- mon_out_.positive_sign_off [1]
- + (mon_st_.wpositive_sign.size () + 1) * sizeof (wchar_t);
+ unsigned (mon_out_.positive_sign_off [1]
+ + (mon_st_.wpositive_sign.size () + 1) * sizeof (wchar_t));
// calculate all the narrow character string offsets
mon_out_.curr_symbol_off [1][0] =
- mon_out_.negative_sign_off [1]
- + (mon_st_.wnegative_sign.size () + 1) * sizeof (wchar_t);
+ unsigned (mon_out_.negative_sign_off [1]
+ + (mon_st_.wnegative_sign.size () + 1) * sizeof (wchar_t));
mon_out_.curr_symbol_off [0][0] =
- mon_out_.curr_symbol_off [1][0]
- + mon_st_.int_curr_symbol.size () + 1;
+ unsigned (mon_out_.curr_symbol_off [1][0]
+ + mon_st_.int_curr_symbol.size () + 1);
mon_out_.positive_sign_off [0] =
- mon_out_.curr_symbol_off [0][0]
- + mon_st_.currency_symbol.size() + 1;
+ unsigned (mon_out_.curr_symbol_off [0][0]
+ + mon_st_.currency_symbol.size() + 1);
mon_out_.negative_sign_off [0] =
- mon_out_.positive_sign_off [0]
- + mon_st_.positive_sign.size () + 1;
+ unsigned (mon_out_.positive_sign_off [0]
+ + mon_st_.positive_sign.size () + 1);
- mon_out_.codeset_off =
- mon_out_.negative_sign_off [0]
- + mon_st_.negative_sign.size () + 1;
-
- mon_out_.charmap_off =
- mon_out_.codeset_off
- + charmap_.get_code_set_name ().size () + 1;
+ mon_out_.codeset_off = unsigned (mon_out_.negative_sign_off [0]
+ + mon_st_.negative_sign.size () + 1);
+
+ mon_out_.charmap_off = unsigned (mon_out_.codeset_off
+ + charmap_.get_code_set_name ().size () + 1);
issue_diag (I_WRITE, false, 0,
"%s layout:\n"
Modified: stdcxx/branches/4.3.x/util/numeric.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/numeric.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/numeric.cpp (original)
+++ stdcxx/branches/4.3.x/util/numeric.cpp Fri Jun 6 20:43:41 2008
@@ -163,24 +163,24 @@
num_punct_out_.decimal_point_off [1] = 0;
num_punct_out_.thousands_sep_off [1] =
- num_punct_out_.decimal_point_off [1]
- + (num_st_.wdecimal_point.size () + 1) * sizeof (wchar_t);
+ unsigned (num_punct_out_.decimal_point_off [1]
+ + (num_st_.wdecimal_point.size () + 1) * sizeof (wchar_t));
num_punct_out_.decimal_point_off [0] =
- num_punct_out_.thousands_sep_off [1]
- + (num_st_.wthousands_sep.size() + 1) * sizeof (wchar_t);
+ unsigned (num_punct_out_.thousands_sep_off [1]
+ + (num_st_.wthousands_sep.size() + 1) * sizeof (wchar_t));
num_punct_out_.thousands_sep_off [0] =
- num_punct_out_.decimal_point_off [0]
- + num_st_.decimal_point.size () + 1;
+ unsigned (num_punct_out_.decimal_point_off [0]
+ + num_st_.decimal_point.size () + 1);
num_punct_out_.grouping_off =
- num_punct_out_.thousands_sep_off [0]
- + num_st_.thousands_sep.size () + 1;
+ unsigned (num_punct_out_.thousands_sep_off [0]
+ + num_st_.thousands_sep.size () + 1);
num_punct_out_.punct_ext_off =
- num_punct_out_.grouping_off
- + num_st_.grouping.size () + 1;
+ unsigned (num_punct_out_.grouping_off
+ + num_st_.grouping.size () + 1);
// compute the alignment requirement of any offset member
const std::size_t align = sizeof num_punct_out_.punct_ext_off;
@@ -191,31 +191,31 @@
// compute the amount of padding between the two structs
const std::size_t pad = misalign ? align - misalign : 0;
- num_punct_out_.punct_ext_off += pad;
+ num_punct_out_.punct_ext_off += unsigned (pad);
// calculate the offsets of members of the numeric extension struct
num_out_.truename_off [1] = 0;
num_out_.falsename_off [1] =
- num_out_.truename_off [1]
- + (num_st_.wtruename.size() + 1) * sizeof (wchar_t);
+ unsigned (num_out_.truename_off [1]
+ + (num_st_.wtruename.size() + 1) * sizeof (wchar_t));
num_out_.truename_off [0] =
- num_out_.falsename_off [1]
- + (num_st_.wfalsename.size() + 1) * sizeof (wchar_t);
+ unsigned (num_out_.falsename_off [1]
+ + (num_st_.wfalsename.size() + 1) * sizeof (wchar_t));
num_out_.falsename_off [0] =
- num_out_.truename_off [0]
- + num_st_.truename.size() + 1;
+ unsigned (num_out_.truename_off [0]
+ + num_st_.truename.size() + 1);
num_out_.codeset_off =
- num_out_.falsename_off [0]
- + num_st_.falsename.size() + 1;
+ unsigned (num_out_.falsename_off [0]
+ + num_st_.falsename.size() + 1);
num_out_.charmap_off =
- num_out_.codeset_off
- + charmap_.get_code_set_name().size() + 1;
+ unsigned (num_out_.codeset_off
+ + charmap_.get_code_set_name().size() + 1);
issue_diag (I_WRITE, false, 0,
"%s layout:\n"
Modified: stdcxx/branches/4.3.x/util/path.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/path.h?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/path.h (original)
+++ stdcxx/branches/4.3.x/util/path.h Fri Jun 6 20:43:41 2008
@@ -2,7 +2,7 @@
*
* path.h
*
- * $Id:$
+ * $Id$
*
***************************************************************************
*
Modified: stdcxx/branches/4.3.x/util/runall.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/runall.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/runall.cpp (original)
+++ stdcxx/branches/4.3.x/util/runall.cpp Fri Jun 6 20:43:41 2008
@@ -573,7 +573,7 @@
while (!feof (lst)) {
char buf [PATH_MAX];
- target = fgets (buf, sizeof (buf), lst);
+ target = fgets (buf, int (sizeof buf), lst);
if (ferror (lst)) {
warn ("Error reading %s: %s\n", lst_name, strerror (errno));
Modified: stdcxx/branches/4.3.x/util/time.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/util/time.cpp?rev=664271&r1=664270&r2=664271&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/util/time.cpp (original)
+++ stdcxx/branches/4.3.x/util/time.cpp Fri Jun 6 20:43:41 2008
@@ -372,171 +372,173 @@
int i;
- time_out_.num_alt_digits = alt_digits_.size();
+#define UINT(x) _RWSTD_STATIC_CAST(unsigned, x)
+
+ time_out_.num_alt_digits = UINT (alt_digits_.size());
time_out_.era_off = 0;
- time_out_.alt_digits_off = time_out_.era_off +
- sizeof (_RW::__rw_time_t::era_t) * era_list_.size();
+ time_out_.alt_digits_off = UINT (time_out_.era_off +
+ sizeof (_RW::__rw_time_t::era_t) * era_list_.size());
// now calculate all the offsets for the wide string representations
- time_out_.abday_off[1][0] = time_out_.alt_digits_off +
- 2 * sizeof (unsigned int) * time_out_.num_alt_digits;
+ time_out_.abday_off[1][0] = UINT (time_out_.alt_digits_off +
+ 2 * sizeof (unsigned int) * time_out_.num_alt_digits);
for (i = 1; i < 7; i++) {
- time_out_.abday_off[1][i] = time_out_.abday_off[1][i-1]
+ time_out_.abday_off[1][i] = UINT (time_out_.abday_off[1][i-1]
+ (time_st_.wabday[i-1].size() * sizeof (wchar_t))
- + sizeof(wchar_t);
+ + sizeof(wchar_t));
}
- time_out_.day_off[1][0] = time_out_.abday_off[1][6]
+ time_out_.day_off[1][0] = UINT (time_out_.abday_off[1][6]
+ time_st_.wabday[6].size() * sizeof (wchar_t)
- + sizeof (wchar_t);
+ + sizeof (wchar_t));
for (i = 1; i < 7; i++) {
- time_out_.day_off[1][i] = time_out_.day_off[1][i-1]
+ time_out_.day_off[1][i] = UINT (time_out_.day_off[1][i-1]
+ time_st_.wday[i-1].size() * sizeof (wchar_t)
- + sizeof (wchar_t);
+ + sizeof (wchar_t));
}
- time_out_.abmon_off[1][0] = time_out_.day_off[1][6]
- + time_st_.wday[6].size() * sizeof (wchar_t) + sizeof (wchar_t);
+ time_out_.abmon_off[1][0] = UINT (time_out_.day_off[1][6]
+ + time_st_.wday[6].size() * sizeof (wchar_t) + sizeof (wchar_t));
for (i = 1; i < 12; i++) {
- time_out_.abmon_off[1][i] = time_out_.abmon_off[1][i-1]
+ time_out_.abmon_off[1][i] = UINT (time_out_.abmon_off[1][i-1]
+ time_st_.wabmon[i-1].size() * sizeof (wchar_t)
- + sizeof (wchar_t);
+ + sizeof (wchar_t));
}
- time_out_.mon_off[1][0] = time_out_.abmon_off[1][11]
+ time_out_.mon_off[1][0] = UINT (time_out_.abmon_off[1][11]
+ time_st_.wabmon[11].size() * sizeof (wchar_t)
- + sizeof (wchar_t);
+ + sizeof (wchar_t));
for (i = 1; i < 12; i++) {
- time_out_.mon_off[1][i] = time_out_.mon_off[1][i-1]
+ time_out_.mon_off[1][i] = UINT (time_out_.mon_off[1][i-1]
+ time_st_.wmon[i-1].size() * sizeof (wchar_t)
- + sizeof (wchar_t);
+ + sizeof (wchar_t));
}
- time_out_.am_pm_off[1][0] = time_out_.mon_off[1][11]
- + time_st_.wmon[11].size() * sizeof (wchar_t) + sizeof (wchar_t);
- time_out_.am_pm_off[1][1] = time_out_.am_pm_off[1][0]
- + time_st_.wam_pm[0].size() * sizeof (wchar_t) + sizeof (wchar_t);
+ time_out_.am_pm_off[1][0] = UINT (time_out_.mon_off[1][11]
+ + time_st_.wmon[11].size() * sizeof (wchar_t) + sizeof (wchar_t));
+ time_out_.am_pm_off[1][1] = UINT (time_out_.am_pm_off[1][0]
+ + time_st_.wam_pm[0].size() * sizeof (wchar_t) + sizeof (wchar_t));
- time_out_.d_t_fmt_off[1] = time_out_.am_pm_off[1][1]
+ time_out_.d_t_fmt_off[1] = UINT (time_out_.am_pm_off[1][1]
+ time_st_.wam_pm[1].size() * sizeof (wchar_t)
- + sizeof (wchar_t);
- time_out_.d_fmt_off[1] = time_out_.d_t_fmt_off[1]
- + time_st_.wd_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
- time_out_.t_fmt_off[1] = time_out_.d_fmt_off[1]
- + time_st_.wd_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
- time_out_.t_fmt_ampm_off[1] = time_out_.t_fmt_off[1]
- + time_st_.wt_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
+ + sizeof (wchar_t));
+ time_out_.d_fmt_off[1] = UINT (time_out_.d_t_fmt_off[1]
+ + time_st_.wd_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
+ time_out_.t_fmt_off[1] = UINT (time_out_.d_fmt_off[1]
+ + time_st_.wd_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
+ time_out_.t_fmt_ampm_off[1] = UINT (time_out_.t_fmt_off[1]
+ + time_st_.wt_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
- time_out_.era_d_t_fmt_off[1] = time_out_.t_fmt_ampm_off[1]
+ time_out_.era_d_t_fmt_off[1] = UINT (time_out_.t_fmt_ampm_off[1]
+ time_st_.wt_fmt_ampm.size() * sizeof (wchar_t)
- + sizeof (wchar_t);
- time_out_.era_d_fmt_off[1] = time_out_.era_d_t_fmt_off[1]
+ + sizeof (wchar_t));
+ time_out_.era_d_fmt_off[1] = UINT (time_out_.era_d_t_fmt_off[1]
+ time_st_.wera_d_t_fmt.size() * sizeof (wchar_t)
- + sizeof (wchar_t);
- time_out_.era_t_fmt_off[1] = time_out_.era_d_fmt_off[1]
- + time_st_.wera_d_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
+ + sizeof (wchar_t));
+ time_out_.era_t_fmt_off[1] = UINT (time_out_.era_d_fmt_off[1]
+ + time_st_.wera_d_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
- unsigned int next_off = time_out_.era_t_fmt_off[1]
- + time_st_.wera_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t);
+ unsigned int next_off = UINT (time_out_.era_t_fmt_off[1]
+ + time_st_.wera_t_fmt.size() * sizeof (wchar_t) + sizeof (wchar_t));
era_list_iter era_list_it;
for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
era_list_it ++) {
era_list_it->era_out.name_off[1] = next_off;
- next_off += era_list_it->wname.size()
- * sizeof (wchar_t) + sizeof (wchar_t);
+ next_off += UINT (era_list_it->wname.size()
+ * sizeof (wchar_t) + sizeof (wchar_t));
era_list_it->era_out.fmt_off[1] = next_off;
- next_off += era_list_it->wfmt.size()
- * sizeof (wchar_t) + sizeof (wchar_t);
+ next_off += UINT (era_list_it->wfmt.size()
+ * sizeof (wchar_t) + sizeof (wchar_t));
}
alt_digits_iter alt_digits_it;
for (alt_digits_it = alt_digits_.begin();
alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
alt_digits_it->w_offset = next_off;
- next_off += (alt_digits_it->w_alt_digit.size() + 1)
- * sizeof(wchar_t);
+ next_off += UINT ((alt_digits_it->w_alt_digit.size() + 1)
+ * sizeof(wchar_t));
}
time_out_.abday_off[0][0] = next_off;
for (i = 1; i < 7; i++) {
// calculate the offsets for the abreviated days
- time_out_.abday_off[0][i] = time_out_.abday_off[0][i-1]
- + time_st_.abday[i - 1].size() + 1;
+ time_out_.abday_off[0][i] = UINT (time_out_.abday_off[0][i-1]
+ + time_st_.abday[i - 1].size() + 1);
}
- time_out_.day_off[0][0] = time_out_.abday_off[0][6]
- + time_st_.abday[6].size() + 1;
+ time_out_.day_off[0][0] = UINT (time_out_.abday_off[0][6]
+ + time_st_.abday[6].size() + 1);
for (i = 1; i < 7; i++) {
// calculate the offsets for the days
- time_out_.day_off[0][i] = time_out_.day_off[0][i-1]
- + time_st_.day[i-1].size() + 1;
+ time_out_.day_off[0][i] = UINT (time_out_.day_off[0][i-1]
+ + time_st_.day[i-1].size() + 1);
}
- time_out_.abmon_off[0][0] = time_out_.day_off[0][6]
- + time_st_.day[6].size() + 1;
+ time_out_.abmon_off[0][0] = UINT (time_out_.day_off[0][6]
+ + time_st_.day[6].size() + 1);
for (i = 1; i < 12; i++) {
// calculate the offsets for the abreviated months
- time_out_.abmon_off[0][i] = time_out_.abmon_off[0][i-1]
- + time_st_.abmon[i-1].size() + 1;
+ time_out_.abmon_off[0][i] = UINT (time_out_.abmon_off[0][i-1]
+ + time_st_.abmon[i-1].size() + 1);
}
- time_out_.mon_off[0][0] = time_out_.abmon_off[0][11]
- + time_st_.abmon[11].size() + 1;
+ time_out_.mon_off[0][0] = UINT (time_out_.abmon_off[0][11]
+ + time_st_.abmon[11].size() + 1);
for (i = 1; i < 12; i++) {
// calculate the offsets for the months
- time_out_.mon_off[0][i] = time_out_.mon_off[0][i-1]
- + time_st_.mon[i-1].size() + 1;
+ time_out_.mon_off[0][i] = UINT (time_out_.mon_off[0][i-1]
+ + time_st_.mon[i-1].size() + 1);
}
// calculate the offsets for am and pm
- time_out_.am_pm_off[0][0] = time_out_.mon_off[0][11]
- + time_st_.mon[11].size() + 1;
- time_out_.am_pm_off[0][1] = time_out_.am_pm_off[0][0]
- + time_st_.am_pm[0].size() + 1;
+ time_out_.am_pm_off[0][0] = UINT (time_out_.mon_off[0][11]
+ + time_st_.mon[11].size() + 1);
+ time_out_.am_pm_off[0][1] = UINT (time_out_.am_pm_off[0][0]
+ + time_st_.am_pm[0].size() + 1);
- time_out_.d_t_fmt_off[0] = time_out_.am_pm_off[0][1]
- + time_st_.am_pm[1].size() + 1;
- time_out_.d_fmt_off[0] = time_out_.d_t_fmt_off[0]
- + time_st_.d_t_fmt.size() + 1;
- time_out_.t_fmt_off[0] = time_out_.d_fmt_off[0]
- + time_st_.d_fmt.size() + 1;
- time_out_.t_fmt_ampm_off[0] = time_out_.t_fmt_off[0]
- + time_st_.t_fmt.size() + 1;
-
- time_out_.era_d_t_fmt_off[0] = time_out_.t_fmt_ampm_off[0]
- + time_st_.t_fmt_ampm.size() + 1;
- time_out_.era_d_fmt_off[0] = time_out_.era_d_t_fmt_off[0]
- + time_st_.era_d_t_fmt.size() + 1;
- time_out_.era_t_fmt_off[0] = time_out_.era_d_fmt_off[0]
- + time_st_.era_d_fmt.size() + 1;
+ time_out_.d_t_fmt_off[0] = UINT (time_out_.am_pm_off[0][1]
+ + time_st_.am_pm[1].size() + 1);
+ time_out_.d_fmt_off[0] = UINT (time_out_.d_t_fmt_off[0]
+ + time_st_.d_t_fmt.size() + 1);
+ time_out_.t_fmt_off[0] = UINT (time_out_.d_fmt_off[0]
+ + time_st_.d_fmt.size() + 1);
+ time_out_.t_fmt_ampm_off[0] = UINT (time_out_.t_fmt_off[0]
+ + time_st_.t_fmt.size() + 1);
+
+ time_out_.era_d_t_fmt_off[0] = UINT (time_out_.t_fmt_ampm_off[0]
+ + time_st_.t_fmt_ampm.size() + 1);
+ time_out_.era_d_fmt_off[0] = UINT (time_out_.era_d_t_fmt_off[0]
+ + time_st_.era_d_t_fmt.size() + 1);
+ time_out_.era_t_fmt_off[0] = UINT (time_out_.era_d_fmt_off[0]
+ + time_st_.era_d_fmt.size() + 1);
- next_off = time_out_.era_t_fmt_off[0]
- + time_st_.era_t_fmt.size() + 1;
+ next_off = UINT (time_out_.era_t_fmt_off[0]
+ + time_st_.era_t_fmt.size() + 1);
for (era_list_it = era_list_.begin(); era_list_it != era_list_.end();
era_list_it ++) {
era_list_it->era_out.name_off[0] = next_off;
- next_off += era_list_it->name.size() + 1;
+ next_off += UINT (era_list_it->name.size() + 1);
era_list_it->era_out.fmt_off[0] = next_off;
- next_off += era_list_it->fmt.size() + 1;
+ next_off += UINT (era_list_it->fmt.size() + 1);
}
for (alt_digits_it = alt_digits_.begin();
alt_digits_it != alt_digits_.end(); alt_digits_it ++ ){
alt_digits_it->n_offset = next_off;
- next_off += alt_digits_it->n_alt_digit.size() + 1;
+ next_off += UINT (alt_digits_it->n_alt_digit.size() + 1);
}
time_out_.codeset_off = next_off;
- time_out_.charmap_off = time_out_.codeset_off
- + charmap_.get_code_set_name().size() + 1;
+ time_out_.charmap_off = UINT (time_out_.codeset_off
+ + charmap_.get_code_set_name().size() + 1);
// write the time struct
out.write ((char*)&time_out_, sizeof(time_out_));