From 28c8e5e38346920e93159862a479a40934c18c54 Mon Sep 17 00:00:00 2001 From: "H.Merijn Brand" Date: Tue, 14 Feb 2012 09:17:02 +0100 Subject: [PATCH] mixing declarations and assignments not allowed in C89 --- ext/POSIX/POSIX.xs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 34e712e..945c345 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1969,9 +1969,10 @@ strptime(str, fmt, sec=-1, min=-1, hour=-1, mday=-1, mon=-1, year=-1, wday=-1, y if(tm.tm_mday > -1 && tm.tm_mon > -1 && tm.tm_year > -1) { /* if we leave sec/min/hour == -1, then these will be * normalised to the previous day */ - int was_sec = tm.tm_sec; tm.tm_sec = 0; - int was_min = tm.tm_min; tm.tm_min = 0; - int was_hour = tm.tm_hour; tm.tm_hour = 0; + int was_sec, was_min, was_hour; + was_sec = tm.tm_sec; tm.tm_sec = 0; + was_min = tm.tm_min; tm.tm_min = 0; + was_hour = tm.tm_hour; tm.tm_hour = 0; if(mktime(&tm) == (time_t)-1) XSRETURN(0); -- 2.7.4