summaryrefslogtreecommitdiffstats
path: root/src/StringUtils.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Overhaul endian handling in ByteBuffer and FastNBT (#5543)Ash2 days1-13/+1
| | | | | | | | | | | | | | | * Overhaul endian handling in ByteBuffer and FastNBT Rather than juggling "swapped" and "unswapped" versions of integers, different library functions, #defines, etc., simply always read everything byte-by-byte. This works regardless of host CPU endian, got optimised down to either a normal load or a byteswap on every compiler I tested - only 1 instruction on most CPU architectures. This commit introduces a "Bytes" array type to keep endian-sensitive data seperate from host data, alongside the needed C++ template machinery for it to work seamlessly. This approach is a little bit safer as well since you get length- and type-checking for most callsites. * Remove remaining references to old-style endianness conversion, remove functions themselves. --------- Co-authored-by: Alexander Harkness <me@bearbin.net>
* Removed all Printf-family functions from StringUtils.Mattes D2023-05-161-27/+0
| | | | | Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code.
* Use more URL-Encoding when sending API requests.Alexander Harkness2021-08-231-0/+3
|
* zlib -> libdeflate (#5085)Tiger Wang2021-01-111-3/+3
| | | | | | + Use libdeflate + Use std::byte * Fix passing temporary to string_view + Emulate make_unique_for_overwrite
* Deleted BiomeDef.h and ChunkDef.h from Globals.h (#4885)KingCol132020-09-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Removed BiomeDef.h * Removed ChunkDef.h from Globals.h * Added to CONTRIBUTORS. * Re-added empty last line to Globals.h * Included stddef and StringUtils in BiomeDef.h * Fixed build tools compiling. It compiles, but at what cost? * Added include to src/Generating/Trees.h * Include added in ChunkGeneratorThread.h * Moved rearranged includes in LineBlockTracer.cpp * Re-arrange headers in ChunkInterface.cpp * Included ChunkDef.h in Path.h * Included ChunkDef.h in NBTChunkSerializer.h * Rearranged included and added required includes to headers. * Removed unnecessary included in StringUtils.h.
* Update submodulesTiger Wang2020-07-231-7/+7
|
* Update fmt to 6.2.0 (#4718)peterbell102020-05-051-7/+15
| | | * Update fmt to 6.2.0
* StringUtils: Added note to StringsConcat about StringJoin.Mattes D2020-01-071-1/+2
|
* Ignore whitespace only lines in brewing and furnace recipes (#4332)peterbell102019-06-111-0/+3
|
* CheckBasicStyle: Check number of empty lines between functions (#4267)peterbell102018-07-261-1/+0
| | | | Add check for number of empty lines between functions and fix the corresponding failures
* Smelting Gives Experience (#4094)Alex Sweet2018-04-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Smelting Exp Smelting now gives experience * Furnace.txt update Exp rewards are entered in furnace.txt, Reward calculation is now done is the furnaceentity class * furnace.txt update Changed alignment tabs to spaces Included documentation of exp in recipe * Updated StringToFloat changed strtod to strtof * Explicit Float to Int * Reworked Smelting Rewards * No C casts -Adds new function to the api -Sets reward counter to 0 in furnace constructor * Style and exp lock removed -Fixed style mistakes accoring to PR notes -XP isn't locked to a single player anymore * No Smelter API -Removed SetLastSmelter and GetLastSmelter -Fixed comments -Fixed log reward amounts
* Add the fmt library (#4065)peterbell102018-01-031-11/+13
| | | | | | | * Replaces AppendVPrintf with fmt::sprintf * fmt::ArgList now used as a type safe alternative to varargs. * Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu. * Adds FLOG functions to log with fmt's native formatting style.
* Represent cItem::m_Lore as an AStringVector (#3882)peterbell102017-08-181-0/+3
| | | | | | | | * Replace cItem::m_Lore with AStringVector * Reword deprecation warning * Fix lua bindings
* Remove double includes part 2 (#3890)peterbell102017-08-031-3/+0
|
* PieceGenerator: Added rotation-aware vertical connectors.Mattes D2017-02-131-3/+3
|
* Refactored to put URL Encoding / Decoding in a single place. (#3491)Mattes D2016-12-251-2/+13
|
* Added PieceStructures generator.Mattes D2015-12-011-0/+37
|
* Improved types of utf 16 stringstycho2015-10-021-1/+1
|
* Unified the doxy-comment format.Mattes D2015-07-311-7/+7
|
* Fix FreeBSD/clang errors caused by -Werrorlinnemannr2015-05-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With FreeBSD/clang, -Werror combined with the configured warning flags yields some fatal errors, specifically related to signed conversion, 64 to 32 bit conversion, and tautological compares. CONTRIBUTORS Add myself to the contributor list src/Generating/FinishGen.cpp In cFinishGenPassiveMobs::GetRandomMob(), change the type of RandMob from size_t to the difference_type of the ListOfSpawnables iterator MobIter. Using size_t triggers a 64 bit to 32 bit conversion if the difference_type of the iterator class is 64 bit Also explicitly cast the noise expression to unsigned long so we don't get a signed conversion warning from the modulo against ListOfSpawnables.size() src/OSSupport/StackTrace.cpp FreeBSD 10 and above includes a non glibc implementation of benchmark() for which size_t, not int, is the return type. To account for this and prevent a signed conversion warning, abstract the type for numItems with a macro btsize src/StringUtils.h In StringToInteger(), correct a tautological compare warning for unsigned types with the template. If T is unsigned, comparing std::numeric_limits<T>::min() to the unsigned result is always false. That control can enter this branch in an evaluated template with an unsigned type T may also permit a signed number to be parsed and erroneously stripped of its signedness at runtime. To guard against this and avoid the warning in the case that the number parsed from the string is non-positive, return false and don't try to parse if T is unsigned and control enters the non-positive branch
* Fixed a lot of warningstycho2015-05-191-2/+2
|
* CheckBasicStyle: checks spaces around * and &.Mattes D2015-05-091-1/+1
|
* Fixes #493 and #490flx52015-03-111-0/+5
|
* StringUtils: Added string vector manipulation.Mattes D2015-01-271-1/+10
|
* Fixed warnings in StringUtils.Mattes D2015-01-211-20/+31
|
* Bug fixTiger Wang2014-09-271-2/+2
|
* Initial BungeeCord support.madmaxoft2014-09-171-0/+5
| | | | Ref.: #1392
* Fixed spaces.Mattes D2014-08-291-1/+1
|
* Hotfixed recipe.txt loading.Hownaer2014-08-291-2/+2
|
* More template keyword fixes.Mattes D2014-08-281-2/+2
|
* Merge remote-tracking branch 'origin/master' into CraftingFixesMattes D2014-08-281-1/+0
|\
| * First Implementatation of new Loggin frameworkTycho2014-08-101-1/+0
| |
* | Fixed spaces after "template" keyword.Mattes D2014-08-281-1/+1
| |
* | Fixed commentsTycho2014-08-131-5/+5
| |
* | Added missing headerTycho2014-08-131-0/+1
| |
* | Fixed Integer pasing warnings in CraftingRecipies.cppTycho2014-08-131-0/+62
|/
* Refactored case-conversion functions.madmaxoft2014-08-041-2/+5
| | | | StrToLower() returns a modified copy of the string, InPlaceLowercase() modifies the string in-place.
* Attempting a compilation fix for gcc / clang.madmaxoft2014-08-031-0/+3
|
* Fixed basic whitespace problems.madmaxoft2014-07-171-9/+1
| | | | Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
* Merge branch 'master' into chunksparsing/structsTycho2014-05-101-2/+2
|\ | | | | | | | | Conflicts: src/Chunk.h
| * Fixed MSVC 64-bit build warnings.Mattes D2014-05-091-2/+2
| |
* | cCHunkBuffer that compiles with TestGlobals.hTycho2014-05-031-0/+3
|/
* Fixed CreateHexDump's signedness.madmaxoft2014-04-041-1/+1
|
* More Clang warning fixes in the protocols.madmaxoft2014-04-041-1/+1
|
* Exported the Base64 encoding and decoding functions to Lua API.madmaxoft2014-04-011-2/+2
|
* Fixed xofts issuesTycho2014-03-141-4/+4
|
* Fixed more Format issuesTycho2014-03-111-1/+1
|
* Added macros to follow format string checking through wrappersTycho2014-03-111-3/+3
|
* Fixed Alignment issue in ByteBufferTycho2014-03-101-1/+1
|
* Another VarArgs fix.madmaxoft2014-01-161-6/+2
| | | | This time using va_copy() on platforms that have it and simple assignment on platforms that don't.
* Using a 2nd argument instead of va_copy().madmaxoft2014-01-151-2/+6
| | | | This seems to be the only reasonable C++03-only solution.
* Added Base64Encode().madmaxoft2014-01-071-0/+3
|
* Fixed unaligned memory access in FastNBT.madmaxoft2014-01-021-0/+9
| | | | This should fix #420.
* Merge remote-tracking branch 'origin/master' into foldermove2Alexander Harkness2013-11-241-3/+0
| | | | | Conflicts: GNUmakefile
* Moved source to srcAlexander Harkness2013-11-241-0/+96