Parse only a float, and return as float bits.
| 153 | |
| 154 | // Parse only a float, and return as float bits. |
| 155 | static bool parseFloat(const char *str, int len, u64 &result) |
| 156 | { |
| 157 | bool foundDecimal = false; |
| 158 | for (int i = 0; i < len; ++i) |
| 159 | { |
| 160 | if (str[i] == '.') |
| 161 | { |
| 162 | if (foundDecimal) |
| 163 | return false; |
| 164 | foundDecimal = true; |
| 165 | continue; |
| 166 | } |
| 167 | if (str[i] < '0' || str[i] > '9') |
| 168 | return false; |
| 169 | } |
| 170 | |
| 171 | result = 0; |
| 172 | float f = (float)atof(str); |
| 173 | memcpy(&result, &f, sizeof(float)); |
| 174 | return foundDecimal; |
| 175 | } |
| 176 | |
| 177 | ExpressionOpcodeType getExpressionOpcode(const char* str, int& ReturnLen, ExpressionOpcodeType LastOpcode) |
| 178 | { |
no outgoing calls
no test coverage detected