Commit Graph

114 Commits

Author SHA1 Message Date
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
Peter Nelson 28ef5146ba Fix #11646: Non-thread safe shared buffer returned from GetLogPrefix().
Return string from GetLogPrefix instead of shared string's buffer.
2024-01-18 17:40:25 +01:00
Loïc Guilloux 37610af0e4
Fix: Don't replace stripped characters with '?' in console (#11777) 2024-01-14 21:49:42 +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 f333372dd1 Codechange: let IConsoleCmdExec accept std::string 2023-06-29 06:06:15 +02:00
Rubidium 3f35787458 Codechange: replace stredup + StrMakeValidInPlace with std::string + StrMakeValid 2023-06-08 19:32:15 +02:00
Rubidium e762855201 Cleanup: remove str_strip_colours; StrMakeValid also removes the colours
Essentially str_strip_colours followed by StrMakeValid makes the calling of
str_strip_colours useless, as StrMakeValid would have removed them too.
2023-06-08 19:32:15 +02:00
Rubidium 35f7f7e8dc Codechange: use std::string for executing the console aliases 2023-06-03 18:15:55 +02:00
Rubidium 275ebf4509 Codechange: replace fprintf(<FILE*> with fmt::print(<FILE*> 2023-05-21 15:12:02 +02:00
Peter Nelson 83f2ad500e Codechange: stdarg.h include not needed as cstdarg is included. 2023-05-17 10:14:41 +01:00
Charles Pigott 80bd5ad727
Codechange: Use std::strto* variants everywhere (#10720) 2023-04-26 12:56:14 +01:00
Jonathan G Rennison 0a7ffae0d9 Fix #10010: Memory leak in IConsolePrint in non-dedicated case 2022-09-21 12:32:07 +02:00
rubidium42 75afd25e16 Change: do not print the '-' in front of help messages and make help messages more uniform 2021-06-13 15:25:31 +02:00
rubidium42 eb6cdadc4d Codechange: replace IConsolePrintF with IConsolePrint and fmt formatting
Also make some strings more consistent with the rest of the console strings.
2021-06-13 15:25:31 +02:00
rubidium42 b280a3a0ed Cleanup: remove IConsoleWarning/IConsoleError helpers
Both did not support format parameters, so in many places IConsolePrint(CC_ERROR, "message") was used with a style different from what IConsoleError would do.
2021-06-13 15:25:31 +02:00
rubidium42 efd4ba4797 Change: unify the style of console error messages and convert to fmt
Always start with a capital, do not add "ERROR: " in front of it.
2021-06-13 15:25:31 +02:00
rubidium42 121b037054 Codechange: remove single use IConsoleDebug 2021-06-13 15:25:31 +02:00
rubidium42 6b757c716a Codechange: add an IConsolePrint overload that does formatting with fmt 2021-06-13 15:25:31 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +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
Loïc Guilloux 888389c28d
Codechange: Use std::string in console commands/aliases registration, and std::map instead our sorted linked list (#9057)
* Codechange: Use std::string in console commands and aliases registration

* Codechange: Use std::map to register console commands

* Codechange: Use std::map to register console aliases

* Cleanup: Remove now unused function
2021-04-24 15:19:57 +02:00
glx b5d56559d2 Fix #7969: limit recursion during alias execution 2020-02-04 18:41:38 +01: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
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
2019-03-20 19:24:55 +01:00
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
frosch 80d10598c1 (svn r27884) -Fix: Console command parser failed when the command had many parameters, and also did not print any error messages about it. 2017-06-22 16:32:50 +00:00
frosch bb02505fb3 (svn r27883) -Fix [FS#6576]: Console command parser passed invalid strings to the debug output, if command lines had many parameters. 2017-06-22 16:31:04 +00:00
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00:00
rubidium e61fe21237 (svn r26506) -Codechange: replace most of vsnprintf with vseprintf 2014-04-24 19:51:45 +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 9041473814 (svn r26284) -Fix: Comparison of NULL and char 0. (lbalbalba) 2014-01-28 20:03:12 +00:00
rubidium 573f6dcd34 (svn r26100) -Fix: possible buffer overflow in console handling of aliases 2013-11-25 10:13: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
rubidium d8d2f74559 (svn r23741) -Revert (r23740): the few parts that the Windows / non-network compiles stumble on 2012-01-03 21:47:01 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
rubidium b25cf57542 (svn r21701) -Codechange: ConsoleColour = TextColour, so make it that way and remove some unneeded casts 2011-01-03 12:01:41 +00:00
smatz cae28bf8eb (svn r21688) -Codechange: verify the colour code passed to IConsolePrint()/IConsolePrintF() is valid 2011-01-01 17:06:59 +00:00
smatz 62bc55cf7b (svn r21686) -Cleanup: remove unused constants and comment used ones 2011-01-01 16:35:32 +00:00
rubidium cca0ca3d70 (svn r20977) -Fix (r20975): compilation didn't get to the link stage if you, or config.lib, decided you don't need network support 2010-10-17 17:50:40 +00:00
rubidium a5d414a734 (svn r20975) -Add: logging of console output for remote admins (dihedral) 2010-10-17 17:43:01 +00:00
rubidium ad12a91cda (svn r20974) -Add: remote console (rcon) for remote admins (dihedral) 2010-10-17 17:41:52 +00:00
rubidium d98ff7c4c4 (svn r20515) -Feature: ignore _ in console command names so there is no "inconsistent" behaviour w.r.t. underscores anymore without breaking backwards compatability greatly 2010-08-16 15:18:21 +00:00
rubidium 605f6d0ed3 (svn r20280) -Fix: indentation of some switch cases 2010-08-01 18:48:00 +00:00
terkhen 88ca183191 (svn r20239) -Doc: Give a common name to all fall throughs (FALL THROUGH). 2010-07-29 14:26:28 +00:00
alberth ef17c6042f (svn r20021) -Codechange: Move variable declarations. 2010-06-26 15:12:51 +00:00
rubidium 9440f9f4c4 (svn r19862) -Change: allow "" and " " as arguments meaning nothing and space for the in-game console 2010-05-20 15:10:33 +00:00
frosch 9a00f6961f (svn r19514) -Codechange: Allow console hooks to deny existance of commands. 2010-03-24 20:43:31 +00:00