From 575041e96bbcdb121487216f9049ce2386a8b115 Mon Sep 17 00:00:00 2001 From: White-Tiger Date: Fri, 27 Nov 2015 20:36:20 +0100 Subject: [PATCH] version bump; some more Coverity stuff [ci cov] Coverity complained about the for loop being useless, and that's right --- src/common/autoversion.cpp | 28 ++++++++++++++-------------- src/common/version.h | 32 ++++++++++++++++---------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/common/autoversion.cpp b/src/common/autoversion.cpp index 7b1d39c1..e6b15b0a 100644 --- a/src/common/autoversion.cpp +++ b/src/common/autoversion.cpp @@ -508,22 +508,27 @@ bool ReadHeader(const char* filepath,Version &ver) size_t def_found, def_num=7;const char def[]="define "; size_t attrib_len = 0; char attrib[32]; size_t value_len = 0; char value[64]; - for(char* c=buf; *c; ++c) { - nextloop: - if(attrib_len>=31) {attrib_len=0; *attrib='\0'; goto nextline;} - switch(*c) { - case '#': + char* c = buf; + while(*c) { + if(attrib_len >= 31) { + attrib_len = 0; attrib[0] = '\0'; + goto nextline; + } + if(*c == '#') { for(++c; *c==' '||*c=='\t'; ++c); for(def_found=0; *c&&*c==def[def_found]; c++,def_found++); - if(def_found != def_num) goto nextline; - attrib_len=0; *attrib='\0'; + if(def_found != def_num) + goto nextline; + attrib_len = 0; attrib[0] = '\0'; for(; *c && *c!=' ' && *c!='\n'; attrib[attrib_len++]=*c++); - if(*c == '\n') goto nextline; + if(*c == '\n') + goto nextline; attrib[attrib_len] = '\0'; for(++c; *c==' '||*c=='\t'; ++c); value_len = 0; *value = '\0'; for(; *c && *c!='\n'; ++c) { - if(value_len>=63) break; + if(value_len >= 63) + break; value[value_len++] = *c; } if(*c == '\n') { @@ -569,15 +574,10 @@ bool ReadHeader(const char* filepath,Version &ver) ver.timestamp = atoi(value); } } - /* fall through */ - default: - goto nextline; } nextline: for(; *c && *c!='\n'; ++c); for(; *c=='\r'||*c=='\n'||*c==' '||*c=='\t'; ++c); - if(!*c) break; - goto nextloop; } ver.flags_=0; if(cmajor!=ver.major || cminor!=ver.minor || cbuild!=ver.build || cstatus!=ver.status) { diff --git a/src/common/version.h b/src/common/version.h index 2203f549..73e65766 100644 --- a/src/common/version.h +++ b/src/common/version.h @@ -18,35 +18,35 @@ # define VER_STATUS_FULL "RC" # define VER_STATUS_SHORT "rc" # define VER_STATUS_GREEK "гc" -# define VER_REVISION 369 +# define VER_REVISION 384 # define VER_FULL "2.4.0 RC" # define VER_SHORT "2.4rc0" # define VER_SHORT_DOTS "2.4.0" # define VER_SHORT_GREEK "2.4гc0" -# define VER_RC_REVISION 2, 4, 0, 369 +# define VER_RC_REVISION 2, 4, 0, 384 # define VER_RC_STATUS 2, 4, 0, 2 /**** Subversion Information ****/ # define VER_REVISION_URL "git@github.com:White-Tiger/T-Clock.git" -# define VER_REVISION_DATE "2015-11-13 15:42:08 +0000 (Fri, Nov 13 2015)" -# define VER_REVISION_HASH "c7353c4" -# define VER_REVISION_TAG "v2.4.0#369-rc" +# define VER_REVISION_DATE "2015-11-27 19:36:20 +0000 (Fri, Nov 27 2015)" +# define VER_REVISION_HASH "df0efd7" +# define VER_REVISION_TAG "v2.4.0#384-rc" /**** Date/Time ****/ -# define VER_TIMESTAMP 1447429391 -# define VER_TIME_SEC 11 -# define VER_TIME_MIN 43 -# define VER_TIME_HOUR 15 -# define VER_TIME_DAY 13 +# define VER_TIMESTAMP 1448652989 +# define VER_TIME_SEC 29 +# define VER_TIME_MIN 36 +# define VER_TIME_HOUR 19 +# define VER_TIME_DAY 27 # define VER_TIME_MONTH 11 # define VER_TIME_YEAR 2015 # define VER_TIME_WDAY 5 -# define VER_TIME_YDAY 316 +# define VER_TIME_YDAY 330 # define VER_TIME_WDAY_SHORT "Fri" # define VER_TIME_WDAY_FULL "Friday" # define VER_TIME_MONTH_SHORT "Nov" # define VER_TIME_MONTH_FULL "November" -# define VER_TIME "15:43:11" -# define VER_DATE "2015-11-13" -# define VER_DATE_LONG "Fri, Nov 13, 2015 15:43:11 UTC" -# define VER_DATE_SHORT "2015-11-13 15:43:11 UTC" -# define VER_DATE_ISO "2015-11-13T15:43:11Z" +# define VER_TIME "19:36:29" +# define VER_DATE "2015-11-27" +# define VER_DATE_LONG "Fri, Nov 27, 2015 19:36:29 UTC" +# define VER_DATE_SHORT "2015-11-27 19:36:29 UTC" +# define VER_DATE_ISO "2015-11-27T19:36:29Z" #endif