summaryrefslogtreecommitdiffstats
path: root/core/ustring.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added plurals and context support to TranslationSkyJJ2020-08-191-7/+54
|
* Make all String float conversion methods be 64-bitAaron Franke2020-07-271-9/+5
|
* Docs: Ignore OS specific values (constants, project settings, properties).bruvzg2020-07-151-0/+6
|
* Remove String::find_last (same as rfind)Stijn Hinlopen2020-07-031-19/+7
|
* Fix overflow and underflow checks for string conversion to intMaganty Rushyendra2020-07-021-6/+10
| | | | | | | | Current error checks for to_int and to_int64 do not issue overflow error messages for INT64_MAX + 1, INT64_MAX + 2, and other numbers close to the integer limits. Likewise, error checks for hex_to_int, hex_to_int64 and bin_to_int64 issue false positive error messages for INT64_MIN or INT32_MIN. This commit fixes these error checks.
* Merge pull request #38713 from aaronfranke/string-64bitRémi Verschelde2020-07-011-76/+9
|\ | | | | Make all String integer conversion methods be 64-bit
| * Rename String bin_to_int64 to bin_to_intAaron Franke2020-06-031-5/+5
| | | | | | | | And also change String static to_int(const char *) to return int64_t
| * Remove 32-bit String hex_to_int methodAaron Franke2020-06-031-44/+2
| |
| * Remove 32-bit String to_int methodAaron Franke2020-06-031-27/+2
| |
* | String: Use ABS macro in padding codeRémi Verschelde2020-06-111-1/+1
| | | | | | | | Follow-up to #39261.
* | Enable zero padding with float specifier for format stringsMaganty Rushyendra2020-06-031-9/+22
|/ | | | | | | | | | | | | Godot currently supports zero padding for integers, octals and hexadecimals when using format strings, but not for floats. This commit adds support for zero padding for floats, thus ensuring consistent behavior for all types, and making Godot's format specifiers' behavior closer to c's `printf()`. Before: `print("<%07.2f>" % -0.2345)` prints `< -0.23>`. Now: `print("<%07.2f>" % -0.2345)` prints `<-000.23>`. `print("<%7.2f>" % -0.2345)` prints `< -0.23>`.
* Use translated docs in PropertySelectorRémi Verschelde2020-05-281-3/+4
| | | | | | And do the dedent and stripping for both translated and non-translated strings for consistency, and so that we don't need to do it at the call site.
* Style: Remove unnecessary semicolons from `core`Rémi Verschelde2020-05-191-26/+18
| | | | | | | | | | Semicolons are not necessary after function definitions or control flow blocks, and having some code use them makes things inconsistent (and occasionally can mess up `clang-format`'s formatting). Removing them is tedious work though, I had to do this manually (regex + manual review) as I couldn't find a tool for that. All other code folders would need to get the same treatment.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-273/+484
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+12
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-311/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-4/+4
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* New lightmapperJuan Linietsky2020-05-101-4/+12
| | | | | | | -Added LocalVector (needed it) -Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too) -Fixes and changes all around the place -Added library for 128 bits fixed point (required for Delaunay3D)
* Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-101-3/+8
| | | | Part of #33027.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-1/+2
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* Improve the shader error console outputHugo Locurcio2020-04-041-2/+2
| | | | | This makes the line gutter look more like an actual line gutter, which makes it less confusing.
* Replace NULL with nullptrlupoDharkael2020-04-021-7/+7
|
* i18n: Add support for translating the class referenceRémi Verschelde2020-03-201-2/+9
| | | | | | | | | | | | | | - Parse `.po` files from `doc/translations/*.po` like already done with `editor/translations/*.po`. - Add logic to register a doc translation mapping in `TranslationServer` and `EditorSettings`. - Add `DTR()` to lookup the doc translation mapping (similar to `TTR()`). Strings are automatically dedented and stripped of whitespace to ensure that they would match the translation catalog. - Use `DTR()` to translate relevant strings in `EditorHelp`, `EditorInspector`, `CreateDialog`, `ConnectionsDialog`. - Small simplification to `TranslationLoaderPO`, the path argument was not really meaningful.
* Tweak the invalid Unicode error message to be more descriptiveHugo Locurcio2020-03-161-1/+1
| | | | This closes #28503.
* Replace FALLTHROUGH macro by C++17 [[fallthrough]]Rémi Verschelde2020-02-231-0/+1
| | | | | | | | | | This attribute is now part of the standard we target so we no longer need compiler-specific hacks. Also enables -Wimplicit-fallthrough for Clang now that we can properly support it. It's already on by default for GCC's -Wextra. Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
* A lot of progress with canvas rendering, still far from working.Juan Linietsky2020-02-111-0/+11
|
* Merge pull request #33731 from madmiraal/fix-c4996-warningRémi Verschelde2020-02-111-2/+4
|\ | | | | Fix Visual Studio throwing C4996 warning in ustring.cpp.
| * Fix Visual Studio throwing C4996 warning in ustring.cpp.Marcel Admiraal2019-11-191-2/+4
| |
* | Fixed String::humanize_size crash.dankan18902020-02-031-1/+1
| | | | | | | | Close #35872
* | Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* | Encodes property names properly in project.godotHaoyu Qiu2019-12-201-0/+13
| |
* | Fix build warning in ustring.cpp on Windows/MSVC platformYuri Roubinsky2019-12-181-0/+4
| |
* | Fixed issues with using a relative path in the export window.Catchawink2019-12-161-1/+2
| | | | | | | | Before this fix, opening relative export paths inside of an EditorFileDialog was not possible. This was fixed by modifying String::path_to_file() to save relative paths in EditorExportPreset::set_export_path() more appropriately and changing EditorFileDialog::set_current_dir() to open relative paths.
* | Removed unused variables, add some constants numbersRafał Mikrut2019-12-101-1/+1
| |
* | Fix some overflows and unitialized variablesRafał Mikrut2019-11-201-1/+1
|/
* Fix MinGW/clang/LLD/UCRT build.bruvzg2019-11-081-2/+2
|
* Fix #24137 Different number of leading zeros on MINGW printf("%lg")Jamie Pate2019-11-071-0/+10
| | | | | | | Use _set_output_format() on MINGW platform to force _snprintf_s() to conform to the C99 standard and match the other platforms. Fixes #24137
* Fix some crashes, overflows and using variables without valuesRafał Mikrut2019-11-011-0/+5
|
* Remove redundant condition in `String::_humanize_digits()`Hugo Locurcio2019-10-041-3/+1
|
* Bind the `String::humanize_size` methodAndrii Doroshenko (Xrayez)2019-10-041-1/+1
| | | | | The method signature is also changed to use `uint64_t` instead of `size_t` for it to be Variant-compatible.
* Merge pull request #31883 from aole/create-string-function-repeatRémi Verschelde2019-09-241-0/+16
|\ | | | | Create a GDScript String function repeat
| * Create a GDScript String function repeatBhupendra Aole2019-09-031-0/+16
| | | | | | | | Fixes #30610
* | Merge pull request #32273 from Calinou/humanize-size-fix-i18nRémi Verschelde2019-09-231-5/+13
|\ \ | | | | | | Fix i18n in `String::humanize_size()`
| * | Fix i18n in `String::humanize_size()`Hugo Locurcio2019-09-231-5/+13
| | | | | | | | | | | | | | | Calls to `RTR()` must be added to each string so the PO file generator can pick them up.
* | | Changed some code found by Clang Tidy and Coverityqarmin2019-09-221-2/+2
|/ /
* / Improve the `String::humanize_size()` methodHugo Locurcio2019-09-051-2/+2
|/ | | | | | | | | - Use "B" insted of "Bytes" to be more compact - Use suffixes that denote a binary prefix - Make suffixes localizable This removes the need for the custom `EditorNetworkProfiler:_format_bandwidth()` method.
* Add forgotten pointer checkingqarmin2019-08-241-1/+1
|
* Merge pull request #31513 from qarmin/int_overflowRémi Verschelde2019-08-231-0/+15
|\ | | | | Prevent int overflow and underflow
| * Prevent int overflow and underflowqarmin2019-08-221-0/+15
| |
* | Move CryptoCore to it's own folder.Fabio Alessandrelli2019-08-191-1/+1
|/ | | | Crypto classes will be placed in core/crypto.