Skip to content

Commit

Permalink
version bump; some more Coverity stuff [ci cov]
Browse files Browse the repository at this point in the history
Coverity complained about the for loop being useless, and that's right
  • Loading branch information
White-Tiger committed Nov 27, 2015
1 parent e1c6ba5 commit 575041e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
28 changes: 14 additions & 14 deletions src/common/autoversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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) {
Expand Down
32 changes: 16 additions & 16 deletions src/common/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 575041e

Please sign in to comment.