diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-03 17:14:28 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-03 17:14:28 -0300 |
commit | e8fbf39f886b2b5dbf5e14f07cd1dbefe8d48bf4 (patch) | |
tree | f767c7db6b089cdc6d4c56cce09a2c65fa68e274 /core | |
parent | b988f016fd2ae1fc6fab4daa1eb580e1446dbd8d (diff) |
-Replaced tinyjpg for jpgd (public domain), fixes progressive encoded jpgs and speeds up. Closes #2040
-Removed support of loading BitMap as image, now it must be load as a pnm, also closes #2040
Diffstat (limited to 'core')
-rw-r--r-- | core/ustring.cpp | 10 | ||||
-rw-r--r-- | core/ustring.h | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index c93fb80ca8..21c0d78fdb 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -1636,12 +1636,16 @@ int64_t String::to_int64() const { return integer*sign; } -int String::to_int(const char* p_str) { +int String::to_int(const char* p_str,int p_len) { int to=0; - while(p_str[to]!=0 && p_str[to]!='.') - to++; + if (p_len>=0) + to=p_len; + else { + while(p_str[to]!=0 && p_str[to]!='.') + to++; + } int integer=0; diff --git a/core/ustring.h b/core/ustring.h index 4c76b8e863..2b967d368a 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -144,7 +144,7 @@ public: int to_int() const; int64_t to_int64() const; - static int to_int(const char* p_str); + static int to_int(const char* p_str, int p_len=-1); static double to_double(const char* p_str); static double to_double(const CharType* p_str, const CharType **r_end=NULL); static int64_t to_int(const CharType* p_str,int p_len=-1); |