Mercurial > hg > svcore
comparison base/RealTime.cpp @ 928:6a94bb528e9d warnfix_no_size_t
Remove size_t's, fix compiler warnings
author | Chris Cannam |
---|---|
date | Tue, 17 Jun 2014 13:52:07 +0100 |
parents | 0f363d0fbdc3 |
children | df83865d886f |
comparison
equal
deleted
inserted
replaced
917:49618f39ff09 | 928:6a94bb528e9d |
---|---|
87 const char *s = xsdd.c_str(); | 87 const char *s = xsdd.c_str(); |
88 int len = xsdd.length(); | 88 int len = xsdd.length(); |
89 | 89 |
90 bool negative = false, afterT = false; | 90 bool negative = false, afterT = false; |
91 | 91 |
92 int valstart = 0; | |
93 | |
94 while (i < len) { | 92 while (i < len) { |
95 | 93 |
96 if (s[i] == '-') { | 94 if (s[i] == '-') { |
97 if (i == 0) negative = true; | 95 if (i == 0) negative = true; |
98 ++i; | 96 ++i; |
101 | 99 |
102 double value = 0.0; | 100 double value = 0.0; |
103 char *eptr = 0; | 101 char *eptr = 0; |
104 | 102 |
105 if (isdigit(s[i]) || s[i] == '.') { | 103 if (isdigit(s[i]) || s[i] == '.') { |
106 valstart = i; | |
107 value = strtod(&s[i], &eptr); | 104 value = strtod(&s[i], &eptr); |
108 i = eptr - s; | 105 i = eptr - s; |
109 } | 106 } |
110 | 107 |
111 if (i == len) break; | 108 if (i == len) break; |
149 t = t + RealTime(minute * 60, 0); | 146 t = t + RealTime(minute * 60, 0); |
150 } | 147 } |
151 | 148 |
152 t = t + fromSeconds(second); | 149 t = t + fromSeconds(second); |
153 | 150 |
154 return t; | 151 if (negative) { |
152 return -t; | |
153 } else { | |
154 return t; | |
155 } | |
155 } | 156 } |
156 | 157 |
157 double | 158 double |
158 RealTime::toDouble() const | 159 RealTime::toDouble() const |
159 { | 160 { |