Commit Graph

51 Commits

Author SHA1 Message Date
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Loïc Guilloux bf4b669628
Fix: [Script] Improve ScriptText validation (#11721)
The validation is now done in two steps:
 - First we get the list of parameters in the same order they used to be in encoded string
 - Then we validate the parameter types like FormatString would use them while encoding the string
2024-01-18 18:06:30 +01:00
Peter Nelson 49dae08a3b Codechange: Add missing override specifiers. 2023-09-25 21:27:45 +01:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Rubidium 6d597879d0 Codechange: let ReadLine return a string instead of passing a buffer 2023-06-09 19:58:29 +02:00
Rubidium 13cdf5fffa Codechange: use std::filesystem::path for the language file's path 2023-06-08 23:20:28 +02:00
Rubidium 802d6cb509 Fix: memory leak when parsing (strgen) commands by moving to C++ containers 2023-06-02 11:57:23 +02:00
Rubidium 4f94655cc2 Codechange: use vector/unorder_map over custom implementation 2023-06-02 11:57:23 +02:00
Rubidium 234a143ee5 Codechange: use std::string for LangString over C-style strings 2023-06-02 11:57:23 +02:00
Peter Nelson 83f2ad500e Codechange: stdarg.h include not needed as cstdarg is included. 2023-05-17 10:14:41 +01:00
Rubidium 6e3d3c0e7c Codechange: introduce std::string variant of sq_pushstring 2023-05-09 23:14:48 +02:00
Rubidium 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
Rubidium dfe52da1ea Codechange: use string/fmt instead of print for strgen warnings/errors/fatals 2023-04-18 23:20:53 +02:00
glx22 9a957f1d4b Change: [Script] Improve ScriptText validation error messages 2023-03-05 22:24:08 +01:00
glx22 af15dca316 Change: [Script] Extract params info from GS strings 2023-02-28 18:53:17 +01:00
Rubidium 90f1768006 Codechange: add non-nullptr asserts in cases where it should never be nullptr
Though where similar calls are checked for nullptr as in those instances of
the use of that function it can actually return nullptr. In other words, write
down the assumption that the function never returns nullptr in an assert.
2023-01-14 21:15:23 +01:00
Rubidium d31a535c87 Cleanup: remove some unneeded c_str() calls 2021-06-15 06:13:00 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
glx22 34215f7faa Codechange: Replace FOR_ALL_TARS with range-based for loops 2021-05-03 19:46:57 +02:00
Michael Lutz b408fe77f7 Codechange: Use std::string in file scanners. 2020-12-27 13:19:25 +01:00
Michael Lutz 5cbb2da794 Codechange: Even more std::string usage in file IO. 2020-12-27 13:19:25 +01:00
Michael Lutz 9b6f5e3bb8 Codechange: Store GS lang texts in std::strings. 2020-05-21 20:02:34 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Michael Lutz b73622a01c Fix #7600: Don't read uninitialised memory when parsing GS language files. 2019-05-23 00:08:39 +02:00
glx22 76788a1eb3
Fix 2bb80d2: really increase the maximum number of GameScript texts to 64k (#7555) 2019-05-01 19:31:30 +02:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Michael Lutz e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 2019-04-09 22:45:15 +02:00
Michael Lutz d3e113eb5f Codechange: Use std::vector instead of AutoDeleteSmallVector in GS text handling. 2019-04-09 22:45:15 +02:00
Michael Lutz d95c7083ea Fix: Don't crash if reading a GS string file from disk produces an error.
The raw_strings vector may not include NULLs as no consumer can deal with it.
2019-04-09 22:45:15 +02:00
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 2019-03-26 20:15:57 +00:00
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
2019-03-24 16:10:04 +01:00
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
rubidium 33ab505567 (svn r26774) -Cleanup [Squirrel]: remove _SC macro 2014-09-06 17:46:56 +00:00
rubidium 7c4e9dd71d (svn r26771) -Cleanup: remove OTTD2SQ and SQ2OTTD 2014-09-06 17:30:33 +00:00
rubidium 5e90054f20 (svn r26511) -Codechange: use strecpy in game_text 2014-04-25 17:43:09 +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
frosch fad2d3c709 (svn r26505) -Fix (r23634, r26493): Incorrect usage of strecpy/strecat 2014-04-24 19:09:17 +00:00
frosch d71cc434e4 (svn r26504) -Fix (r26499): Obiwan and his gang. 2014-04-24 18:58:47 +00:00
rubidium 8960939b22 (svn r26499) -Codechange: replace strndup with stredup 2014-04-24 18:37:39 +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
rubidium c54a70cce8 (svn r26090) -Fix: leaking of file descriptor when reading strings for game texts 2013-11-24 15:25:41 +00:00
frosch bf0f5345ea (svn r25818) -Fix [FS#5750]: [GS] Language file scanner considered filenames starting with '.' as valid translations, resulting in languages with empty name, which causes trouble. 2013-10-06 12:13:20 +00:00
frosch 5046922f61 (svn r25117) -Fix [FS#5511]: Silence warning. 2013-03-24 11:04:58 +00:00
frosch 9eab26a1a1 (svn r25114) -Fix [FS#5509]: GS lang files did not work, when inside a tar. 2013-03-22 21:21:45 +00:00
frosch 16760cff8b (svn r24516) -Add: [GS] Support ##plural pragma in GS lang files. 2012-09-09 15:55:20 +00:00
frosch 2ec6136113 (svn r24515) -Fix: GStexts were compied incompletely when containing certain string codes. 2012-09-09 15:52:49 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00