Author: hwright
Date: Wed Apr 4 15:54:32 2012
New Revision: 1309469
URL: http://svn.apache.org/viewvc?rev=1309469&view=rev
Log:
Some more casting to get rid of integer width mismatch warnings.
* subversion/libsvn_subr/time.c
(find_matching_string): Return what callers expect, and cast to such.
(svn_time_from_cstring): Cast strtol() return values to APR-expected sizes.
Modified:
subversion/trunk/subversion/libsvn_subr/time.c
Modified: subversion/trunk/subversion/libsvn_subr/time.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/time.c?rev=1309469&r1=1309468&r2=1309469&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/time.c (original)
+++ subversion/trunk/subversion/libsvn_subr/time.c Wed Apr 4 15:54:32 2012
@@ -116,14 +116,14 @@ svn_time_to_cstring(apr_time_t when, apr
}
-static int
+static apr_int32_t
find_matching_string(char *str, apr_size_t size, const char strings[][4])
{
apr_size_t i;
for (i = 0; i < size; i++)
if (strings[i] && (strcmp(str, strings[i]) == 0))
- return i;
+ return (apr_int32_t) i;
return -1;
}
@@ -140,19 +140,19 @@ svn_time_from_cstring(apr_time_t *when,
/* Open-code parsing of the new timestamp format, as this
is a hot path for reading the entries file. This format looks
like: "2001-08-31T04:24:14.966996Z" */
- exploded_time.tm_year = strtol(data, &c, 10);
+ exploded_time.tm_year = (apr_int32_t) strtol(data, &c, 10);
if (*c++ != '-') goto fail;
- exploded_time.tm_mon = strtol(c, &c, 10);
+ exploded_time.tm_mon = (apr_int32_t) strtol(c, &c, 10);
if (*c++ != '-') goto fail;
- exploded_time.tm_mday = strtol(c, &c, 10);
+ exploded_time.tm_mday = (apr_int32_t) strtol(c, &c, 10);
if (*c++ != 'T') goto fail;
- exploded_time.tm_hour = strtol(c, &c, 10);
+ exploded_time.tm_hour = (apr_int32_t) strtol(c, &c, 10);
if (*c++ != ':') goto fail;
- exploded_time.tm_min = strtol(c, &c, 10);
+ exploded_time.tm_min = (apr_int32_t) strtol(c, &c, 10);
if (*c++ != ':') goto fail;
- exploded_time.tm_sec = strtol(c, &c, 10);
+ exploded_time.tm_sec = (apr_int32_t) strtol(c, &c, 10);
if (*c++ != '.') goto fail;
- exploded_time.tm_usec = strtol(c, &c, 10);
+ exploded_time.tm_usec = (apr_int32_t) strtol(c, &c, 10);
if (*c++ != 'Z') goto fail;
exploded_time.tm_year -= 1900;