| 173 | } // namespace |
| 174 | |
| 175 | S32 xStrParseFloatList(F32* dest, const char* strbuf, S32 max) |
| 176 | { |
| 177 | char* str = (char*)strbuf; |
| 178 | S32 index; |
| 179 | S32 digits; |
| 180 | bool negate; |
| 181 | char* numstart; |
| 182 | char savech; |
| 183 | |
| 184 | if (!str) |
| 185 | { |
| 186 | return 0; |
| 187 | } |
| 188 | |
| 189 | for (index = 0; *str != '\0' && index < max; index++) |
| 190 | { |
| 191 | while (*str == '\t' || *str == ' ' || *str == '[' || *str == ']' || *str == '{' || |
| 192 | *str == '}' || *str == '(' || *str == ')' || *str == '+' || *str == ',' || |
| 193 | *str == ':' || *str == ';') |
| 194 | { |
| 195 | str++; |
| 196 | } |
| 197 | |
| 198 | if (*str == '\0') |
| 199 | { |
| 200 | return index; |
| 201 | } |
| 202 | |
| 203 | if (*str == '-') |
| 204 | { |
| 205 | negate = TRUE; |
| 206 | str++; |
| 207 | |
| 208 | while (*str == '\t' || *str == ' ') |
| 209 | { |
| 210 | str++; |
| 211 | } |
| 212 | } |
| 213 | else |
| 214 | { |
| 215 | negate = FALSE; |
| 216 | } |
| 217 | |
| 218 | numstart = str; |
| 219 | digits = 0; |
| 220 | |
| 221 | while ((*str >= '0' && *str <= '9') || *str == '.' || *str == 'E' || *str == 'e' || |
| 222 | *str == 'f') |
| 223 | { |
| 224 | if (*str >= '0' && *str <= '9') |
| 225 | { |
| 226 | digits++; |
| 227 | } |
| 228 | |
| 229 | str++; |
| 230 | } |
| 231 | |
| 232 | if (digits == 0) |
no test coverage detected