From: Christos Zoulas Date: Tue, 10 Mar 2009 11:44:29 +0000 (+0000) Subject: avoid c99 syntax. X-Git-Tag: FILE5_01~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea0e28ef98fc0f2ff9721adc26b09f1818568b7a;p=file avoid c99 syntax. --- diff --git a/ChangeLog b/ChangeLog index 07e19dc9..11438e86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-03-10 7:45 Christos Zoulas + + * avoid c99 syntax. + 2009-02-23 15:45 Christos Zoulas * make the cdf code use the buffer first if available, diff --git a/src/cdf.c b/src/cdf.c index 6f35b33b..e107737e 100644 --- a/src/cdf.c +++ b/src/cdf.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: cdf.c,v 1.18 2009/02/23 20:44:47 christos Exp $") +FILE_RCSID("@(#)$File: cdf.c,v 1.19 2009/02/23 20:51:55 christos Exp $") #endif #include @@ -257,8 +257,9 @@ cdf_read(const cdf_info_t *info, off_t off, void *buf, size_t len) int cdf_read_header(const cdf_info_t *info, cdf_header_t *h) { - (void)memcpy(cdf_bo.s, "\01\02\03\04", 4); char buf[512]; + + (void)memcpy(cdf_bo.s, "\01\02\03\04", 4); if (cdf_read(info, (off_t)0, buf, sizeof(buf)) == -1) return -1; cdf_unpack_header(h, buf); @@ -415,7 +416,7 @@ cdf_read_long_sector_chain(const cdf_info_t *info, const cdf_header_t *h, return 0; out: free(scn->sst_tab); - return (size_t)-1; + return -1; } int @@ -450,7 +451,7 @@ cdf_read_short_sector_chain(const cdf_header_t *h, return 0; out: free(scn->sst_tab); - return (size_t)-1; + return -1; } int diff --git a/src/cdf_time.c b/src/cdf_time.c index 9dbcad1f..3ddf8a72 100644 --- a/src/cdf_time.c +++ b/src/cdf_time.c @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: cdf_time.c,v 1.4 2008/11/04 16:38:28 christos Exp $") +FILE_RCSID("@(#)$File: cdf_time.c,v 1.5 2009/02/03 20:27:51 christos Exp $") #endif #include @@ -102,6 +102,7 @@ cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t) #ifdef HAVE_STRUCT_TM_TM_ZONE static char UTC[] = "UTC"; #endif + int rdays; /* Unit is 100's of nanoseconds */ ts->tv_nsec = (t % CDF_TIME_PREC) * 100; @@ -119,7 +120,7 @@ cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t) // XXX: Approx tm.tm_year = CDF_BASE_YEAR + (t / 365); - int rdays = cdf_getdays(tm.tm_year); + rdays = cdf_getdays(tm.tm_year); t -= rdays; tm.tm_mday = cdf_getday(tm.tm_year, t); tm.tm_mon = cdf_getmonth(tm.tm_year, t);