Commit Graph

65 Commits

Author SHA1 Message Date
Michael Lutz a05fd7aa50 Change: [Network] Transfer command data as serialized byte stream without fixed structure.
The data will be transmitted as the length followed by the serialized data. This allows the command
data to be different for every command type in the future.
2021-12-16 22:28:32 +01:00
rubidium42 fed3e3305f Codechange: add function to determine whether are string starts or ends with a given other string 2021-06-13 10:26:58 +02:00
rubidium42 b4aedef848 Codechange: add std::string variant of Utf8StringLength 2021-05-29 19:02:18 +02:00
Patric Stout 7713c3e3cc Codechange: move casting a "const char *" to "char *" to the caller
It is not nice to have your definition say you won't change a value
while in fact the whole reason for your existance is to change it.
2021-05-29 16:23:59 +02:00
Patric Stout ca9a7df752
Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not
returns yes/no.
2021-05-29 11:21:38 +02:00
rubidium42 16437b7c0d Codechange: move client name in settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42 dc05917287 Add: [[nodiscard]] to std::string str_validate 2021-05-06 20:31:02 +02:00
Milek7 8e9eca6ddd
Codechange: Use __attribute__ access none to silence GCC 11 -Wmaybe-uninitialized warnings (#9124) 2021-04-28 22:06:47 +01:00
rubidium42 5202869f0f Add: String functionality to trim spaces from C-style strings 2021-04-24 08:02:54 +02:00
Patric Stout fda1fbf61c
Revert c1fddb9, 639cfa4: "Codechange: Check if access __attribute__ is supported before trying to use it." (#8526)
This reverts commit c1fddb9a6a and 639cfa43d2.

access_mode "none" is only supported by GCC11, but introduced
after it branched. So there are GCC11.0s out there that do not
support it. We will have to wait for GCC11.1 to hit before we
can re-add this.
2021-01-08 15:25:44 +01:00
milek7 639cfa43d2 Codechange: Use access __attribute__ to silence warnings in GCC 2021-01-08 00:40:45 +00:00
Michael Lutz 0c6e8a8123 Codechange: Store file search paths as std::string. 2020-12-27 13:19:25 +01:00
Charles Pigott 64b1c70fdd Codechange: Add WARN_FORMAT to vseprintf and fix the cascade of warnings that followed 2020-06-27 14:51:14 +01:00
Michael Lutz 715aa67a9c Codechange: Use std::string in INI file parsing. 2020-05-21 20:02:34 +02:00
Michael Lutz c082f570ce Codechange: Use std::string when translating TTDP NewGRF string codes. 2020-05-21 20:02:34 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
frosch 08eeec15be (svn r26513) -Fix: 9x compilation, maybe 2014-04-25 19:25:38 +00:00
rubidium db8d208bfc (svn r26507) -Cleanup: remove now unused custom strndup implementation 2014-04-25 15:17:17 +00:00
rubidium e61fe21237 (svn r26506) -Codechange: replace most of vsnprintf with vseprintf 2014-04-24 19:51:45 +00:00
rubidium 382ca0941f (svn r26498) -Add: method for duplicating strings with similar behaviours as strecpy and strecat; give end pointer instead of a size 2014-04-24 18:21:32 +00:00
frosch ef4c2ce031 (svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat. 2014-04-23 20:44:42 +00:00
michi_cc 76367f6bf1 (svn r25653) -Add: Caret movement by words for CJK languages. 2013-08-05 20:35:31 +00:00
michi_cc e7dc14b25a (svn r25652) -Fix: Improve text caret movement for complex scripts. 2013-08-05 20:35:27 +00:00
rubidium 4c443bce5c (svn r25555) -Fix [FS#5632]: [Script] Texts from scripts were not validated before they were shown, causing an assertion to trigger 2013-07-04 16:36:47 +00:00
frosch 3e02890b73 (svn r24983) -Change: Apply the same name sorting rules to content and NewGRF list as for the server list. 2013-02-09 17:31:07 +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
yexo 2c99805117 (svn r23816) -Fix (r23635, r23805): make SCC_ENCODED the first entry in the StringControlCode enum since it's value is not allowed to change 2012-01-16 22:29:25 +00:00
rubidium fefe22b4aa (svn r23590) -Codechange: make the string validation settings better expandable 2011-12-18 18:37:54 +00:00
planetmaker 5188587a04 (svn r22889) -Fix [FS#4751]: [OSX] MacOSX 10.7 knows already about strndup (leecbaker) 2011-09-04 11:28:43 +00:00
alberth d55b380b69 (svn r22669) -Codechange: For non-windows, only test for file existence again if strtolower actually changed the name. 2011-07-16 18:43:22 +00:00
rubidium 46c242b1dc (svn r22385) -Fix [FS#4603]: strnatcmp is in string.cpp, so it ought to be declared in string_func.h. 2011-04-30 14:24:23 +00:00
rubidium 9ca4b629cd (svn r21846) -Codechange: move documentation towards the code to make it more likely to be updated [o-s]. 2011-01-18 23:09:43 +00:00
rubidium 440a529701 (svn r21404) -Add: method for getting the length of an Utf8 string in characters 2010-12-05 22:17:25 +00:00
rubidium 3330dee7e0 (svn r21310) -Fix [FS#4259]: apparantly even earlier FreeBSDs had strndup 2010-11-24 08:08:23 +00:00
rubidium 3cf9f175d8 (svn r21295) -Fix [FS#4259]: FreeBSD introduced strndup as well (MicRO) 2010-11-22 17:59:11 +00:00
alberth ab50f74d7f (svn r21273) -Codechange: Return values should start at the same line. 2010-11-20 15:44:24 +00:00
rubidium 17b514ccd1 (svn r21133) -Add: function to check the validity of a string (without modifying it) 2010-11-10 17:49:14 +00:00
rubidium b933819b0b (svn r21006) -Fix (r21004): don't print the text direction character when ICU isn't linked and thus doesn't remove them 2010-10-22 12:15:58 +00:00
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 2010-08-01 19:22:34 +00:00
rubidium e3df7caf18 (svn r19874) -Fix [FS#3845]: NetBSD compilation was still broken in some cases (Krille) 2010-05-21 15:56:19 +00:00
glx 45cb7fe55c (svn r19859) -Fix (r19853): preprocessor warning 2010-05-19 17:04:02 +00:00
rubidium 2de9e2d16b (svn r19853) -Fix [FS#3840]: revert r19781 and apply a more sensible version with the same effect 2010-05-18 21:17:25 +00:00
glx 918b3aff5e (svn r18919) -Fix (r15371): strcasestr() return should not be const 2010-01-26 14:04:56 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
rubidium 0d99b6c71c (svn r16421) -Codechange: do not unnecessarily remove constness or unnecessarily add it. 2009-05-24 20:29:04 +00:00
smatz f5316c5cbd (svn r16269) -Codechange: use gcc's ability to check parameters sent to printf-like functions
-Fix: wrong number of parameters or wrong parameter types sent to printf-like functions at several places
2009-05-10 17:27:25 +00:00
rubidium 86ca408d46 (svn r15626) -Fix [FS#2698]: UTF8 string handling could cause buffer overruns. 2009-03-06 01:23:25 +00:00
rubidium cecc3863cd (svn r15376) -Fix [FS#2608] (r15371): OSX/BSD also seems to define strcasecmp under some circumstances. 2009-02-06 15:53:48 +00:00
rubidium 35c5da08c5 (svn r15371) -Codechange: add an implementation of strcasestr for when _GNU_SOURCE isn't defined. 2009-02-06 11:58:52 +00:00