+2000-11-28 Ulrich Drepper <drepper@redhat.com>
+
+ * time/strftime.c: Add const where necessary to avoid warnings.
+ * time/strptime.c (strptime_internal): Add casts to avoid warnings.
+
2000-11-22 Paul Eggert <eggert@twinsun.com>
* time/strftime.c (my_strftime): Do not invoke mbrlen with a
else if (to_uppcase) \
memcpy_uppcase (p, (s), _n); \
else \
- MEMCPY ((PTR) p, (PTR) (s), _n))
+ MEMCPY ((PTR) p, (const PTR) (s), _n))
#ifdef COMPILE_WIDE
# define widen(os, ws, l) \
goto bad_format;
#ifdef _NL_CURRENT
if (! (modifier == 'E'
- && (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
- NLW(ERA_D_T_FMT)))
+ && (*(subfmt =
+ (const CHAR_T *) _NL_CURRENT (LC_TIME,
+ NLW(ERA_D_T_FMT)))
!= '\0')))
- subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
+ subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
#else
# if HAVE_STRFTIME
goto underlying_strftime;
goto bad_format;
#ifdef _NL_CURRENT
if (! (modifier == L_('E')
- && (*(subfmt = (CHAR_T *)_NL_CURRENT (LC_TIME,
- NLW(ERA_D_FMT)))
+ && (*(subfmt =
+ (const CHAR_T *)_NL_CURRENT (LC_TIME, NLW(ERA_D_FMT)))
!= L_('\0'))))
- subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
+ subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
goto subformat;
#else
# if HAVE_STRFTIME
case L_('r'): /* POSIX.2 extension. */
#ifdef _NL_CURRENT
- if (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
- NLW(T_FMT_AMPM))) == L_('\0'))
+ if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME,
+ NLW(T_FMT_AMPM)))
+ == L_('\0'))
#endif
subfmt = L_("%I:%M:%S %p");
goto subformat;
goto bad_format;
#ifdef _NL_CURRENT
if (! (modifier == L_('E')
- && (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
- NLW(ERA_T_FMT)))
+ && (*(subfmt =
+ (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_T_FMT)))
!= L_('\0'))))
- subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
+ subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
goto subformat;
#else
# if HAVE_STRFTIME
{
num_eras = _NL_CURRENT_WORD (LC_TIME,
_NL_TIME_ERA_NUM_ENTRIES);
- for (era_cnt = 0; era_cnt < num_eras;
+ for (era_cnt = 0; era_cnt < (int) num_eras;
++era_cnt, rp = rp_backup)
{
era = _nl_select_era_entry (era_cnt);
break;
}
}
- if (era_cnt == num_eras)
+ if (era_cnt == (int) num_eras)
{
era_cnt = -1;
if (*decided == loc)
{
num_eras = _NL_CURRENT_WORD (LC_TIME,
_NL_TIME_ERA_NUM_ENTRIES);
- for (era_cnt = 0; era_cnt < num_eras;
+ for (era_cnt = 0; era_cnt < (int) num_eras;
++era_cnt, rp = rp_backup)
{
era = _nl_select_era_entry (era_cnt);
if (recursive (era->era_format))
break;
}
- if (era_cnt == num_eras)
+ if (era_cnt == (int) num_eras)
{
era_cnt = -1;
if (*decided == loc)