Commit Graph

43 Commits

Author SHA1 Message Date
rubidium42 4718971ccc Codechange: use std::size instead of lengthof for town names 2024-04-07 23:08:07 +02:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Patric Stout 6860a86d45
Codechange: remove all u8 prefix in favour of compile-time option (#11807) 2024-01-16 21:33:53 +00:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Rubidium 3e8f8c55c2 Codechange: make creating temporary StringParameters easier 2023-06-20 17:37:24 +02:00
Rubidium 0a5e58451b Codechange: pass string parameters by reference 2023-06-14 06:14:08 +02:00
Rubidium e32f0aa20b Cleanup: minimum string length for town name generator is not needed anymore 2023-06-05 23:26:12 +02:00
Rubidium affceea0ae Codechange: switch StringBuilder to use std::string as backend 2023-06-05 23:26:12 +02:00
rubidium42 921f5afc4d Codechange: Apply suggestions from code review 2023-06-05 17:07:39 +02:00
Rubidium 2dd2b698d2 Codechange: convert C-style GetTownName API to std::string returning API 2023-06-05 17:07:39 +02:00
Rubidium 4e39a58c59 Codechange: let town name generation use StringBuilder 2023-06-04 21:42:59 +02:00
rubidium42 bfcb027cb9
Fix 2dffa7d: fmt::format_to copies the iterator, so some text does not remain during formatting (#10940) 2023-06-04 19:55:47 +02:00
Rubidium 36aaa9d683 Codechange: let GetStringWithArgs use StringBuilder 2023-06-04 18:00:23 +02:00
Charles Pigott b282664242 Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives 2023-04-15 16:57:00 +01:00
Rubidium 3373128233 Codechange: pass the randomizer directly to the town name generation 2023-01-14 22:00:11 +01:00
Patric Stout 28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
2021-06-03 17:30:00 +02:00
Charles Pigott dd798d688b
Fix #8919: Release builds with asserts enabled (#8925) 2021-04-01 23:57:49 +01:00
Patric Stout fece1c57ca
Codechange: Suppress warnings when asserts are disabled (#8917) 2021-04-01 11:16:19 +02:00
Patric Stout 68f9925cd4
Codechange: use \u to indicate unicode chars in strings (#8379)
With \x, we sometimes had to do the "" trick, as the length is not
predefined. With C++11 bringing \u to the specs, which has a preset
length, we no longer need the "" trick.

We set the strings to u8, to ensure all compilers use UTF-8 encoding
for the \u characters.

This was triggered by newer CLangs, which start to warn if you
use "" in the middle of a string, wondering if that was your
intention. It is a good question. And this is our answer :)
2020-12-14 20:25:01 +01:00
Michael Lutz 63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 2020-05-21 20:02:34 +02:00
glx ee7a8eebca Codechange: Replace FOR_ALL_TOWNS with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
nikolas 4fc1b2baae Fix: Grammar in a bunch of comments (#7054) 2019-01-13 07:38:48 +00:00
frosch bed0370ad1 (svn r27187) -Fix: Code style. 2015-03-15 12:19:58 +00:00
rubidium 6ad6845f8c (svn r26510) -Codechange: use memcpy instead of strncpy in the town name replace word function since we never want to add a '\0' anyway, and we know the exact length too 2014-04-25 17:35:29 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
frosch 55502341ac (svn r26346) -Fix [FS#5870]: Call Layouter::ReduceLineCache from GenerateTownName in all cases. 2014-02-16 17:45:24 +00:00
rubidium 9f6b8aea49 (svn r26313) -Codechange: use a set for finding unique town names instead of iterating all just created town names (MJP) 2014-02-06 21:06:59 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
smatz 597ef4e7b1 (svn r23759) -Fix (r17612)[FS#4951]: the check for duplicate town names wasn't really working 2012-01-05 19:56:48 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
alberth 4af8c2d5e1 (svn r23704) -Doc: Doxygen comment fixes and additions. 2012-01-01 17:22:32 +00:00
rubidium 1a515e6344 (svn r22405) -Document: some more "random-ish" tidbits 2011-05-01 19:14:12 +00:00
yexo 0e17cbc9f8 (svn r22258) -Codechange: introduce a wrapper class to clean up the arguments to FormatString 2011-03-18 13:34:52 +00:00
yexo 12e0f28229 (svn r21440) -Codechange: pass a pointer to just past the end of the argv array around in FormatString and friends 2010-12-09 00:15:38 +00:00
rubidium 5c9c3f1acf (svn r21414) -Codechange: limit town name by amount of characters, not bytes 2010-12-05 22:25:21 +00:00
frosch 478da38d2b (svn r21192) -Fix (r15505)[FS#4226]: Use non-interactive randomness for townnames on map generation, so they are controlled by the generation-seed as well. 2010-11-14 16:16:28 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
rubidium d6cded5380 (svn r17693) -Cleanup: remove some unneeded includes 2009-10-04 17:16:41 +00:00
smatz 1da745c9ad (svn r17612) -Feature: possibility to choose (randomise or enter custom) town name before its creation (original patch by Terkhen) 2009-09-22 13:54:54 +00:00
smatz 662ef3173b (svn r17597) -Codechange: rename namegen* to townname* 2009-09-21 11:01:16 +00:00
Renamed from src/namegen.cpp (Browse further)