Update fast_atof.h

fix typo
pull/1793/head
Kim Kulling 2018-02-23 18:59:38 +01:00 committed by GitHub
parent 437ae0c839
commit d00c4a54e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 10 deletions

View File

@ -26,15 +26,13 @@
#include "StringComparison.h" #include "StringComparison.h"
#include <assimp/DefaultLogger.hpp> #include <assimp/DefaultLogger.hpp>
#ifdef _MSC_VER #ifdef _MSC_VER
# include <stdint.h> # include <stdint.h>
#else #else
# include <assimp/Compiler/pstdint.h> # include <assimp/Compiler/pstdint.h>
#endif #endif
namespace Assimp namespace Assimp {
{
const double fast_atof_table[16] = { // we write [16] here instead of [] to work around a swig bug const double fast_atof_table[16] = { // we write [16] here instead of [] to work around a swig bug
0.0, 0.0,
@ -64,8 +62,9 @@ unsigned int strtoul10( const char* in, const char** out=0) {
unsigned int value = 0; unsigned int value = 0;
for ( ;; ) { for ( ;; ) {
if ( *in < '0' || *in > '9' ) if ( *in < '0' || *in > '9' ) {
break; break;
}
value = ( value * 10 ) + ( *in - '0' ); value = ( value * 10 ) + ( *in - '0' );
++in; ++in;
@ -109,8 +108,7 @@ unsigned int strtoul16( const char* in, const char** out=0) {
value = ( value << 4u ) + ( *in - 'A' ) + 10; value = ( value << 4u ) + ( *in - 'A' ) + 10;
} else if (*in >= 'a' && *in <= 'f') { } else if (*in >= 'a' && *in <= 'f') {
value = ( value << 4u ) + ( *in - 'a' ) + 10; value = ( value << 4u ) + ( *in - 'a' ) + 10;
} } else {
else {
break; break;
} }
++in; ++in;
@ -284,7 +282,7 @@ const char* fast_atoreal_move(const char* c, Real& out, bool check_comma = true)
c += 5; c += 5;
} }
return c; return c;
}
if (!(c[0] >= '0' && c[0] <= '9') && if (!(c[0] >= '0' && c[0] <= '9') &&
!((c[0] == '.' || (check_comma && c[0] == ',')) && c[1] >= '0' && c[1] <= '9')) { !((c[0] == '.' || (check_comma && c[0] == ',')) && c[1] >= '0' && c[1] <= '9')) {
@ -322,7 +320,6 @@ const char* fast_atoreal_move(const char* c, Real& out, bool check_comma = true)
// A major 'E' must be allowed. Necessary for proper reading of some DXF files. // A major 'E' must be allowed. Necessary for proper reading of some DXF files.
// Thanks to Zhao Lei to point out that this if() must be outside the if (*c == '.' ..) // Thanks to Zhao Lei to point out that this if() must be outside the if (*c == '.' ..)
if (*c == 'e' || *c == 'E') { if (*c == 'e' || *c == 'E') {
++c; ++c;
const bool einv = (*c=='-'); const bool einv = (*c=='-');
if (einv || *c=='+') { if (einv || *c=='+') {