Skip to content

Commit

Permalink
Correct return type for TPTScriptInterface::parseInt
Browse files Browse the repository at this point in the history
so that large integers don't get changed into slightly different values by rounding caused by conversion to a float and back again.
  • Loading branch information
jacksonmj committed Mar 1, 2015
1 parent a422e43 commit 8f57c9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lua/TPTScriptInterface.cpp
Expand Up @@ -124,7 +124,7 @@ ValueType TPTScriptInterface::testType(std::string word)
return TypeString;
}

float TPTScriptInterface::parseNumber(char * stringData)
int TPTScriptInterface::parseNumber(char * stringData)
{
char cc;
int base = 10;
Expand Down
2 changes: 1 addition & 1 deletion src/lua/TPTScriptInterface.h
Expand Up @@ -7,7 +7,7 @@
class TPTScriptInterface: public CommandInterface {
protected:
AnyType eval(std::deque<std::string> * words);
float parseNumber(char * stringData);
int parseNumber(char * stringData);
AnyType tptS_set(std::deque<std::string> * words);
AnyType tptS_create(std::deque<std::string> * words);
AnyType tptS_delete(std::deque<std::string> * words);
Expand Down

0 comments on commit 8f57c9a

Please sign in to comment.