Commit Graph

84 Commits (75f21065c97bc8da765c0ec2fe592ffc48e82db9)

Author SHA1 Message Date
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 8 months ago
Rubidium c9276c2959 Codechange: replace x.size() == 0 with x.empty() 9 months ago
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
12 months ago
Rubidium fbd71a9d72 Codechange: replace C-style string processing with C++-style for the listing callbacks 1 year ago
Rubidium 275ebf4509 Codechange: replace fprintf(<FILE*> with fmt::print(<FILE*> 1 year ago
Rubidium c518293135 Codechange: replace printf with fmt::print 1 year ago
Peter Nelson 83f2ad500e Codechange: stdarg.h include not needed as cstdarg is included. 1 year ago
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 1 year ago
Rubidium b1b578f988 Cleanup: stredup-ing string variant for calling scripts 1 year ago
Rubidium ab51175db2 Codechange: use std::string for script config 1 year ago
Rubidium a30f7c83bd Codechange: use std::string for script names to load 1 year ago
Rubidium 3d8d99ba11 Add: method to call script functions with std::string 1 year ago
Rubidium 8f24901843 Codechange: replace printf with PRINTF macros by fmt::format for scripts 1 year ago
Rubidium 8b93e45e22 Codechange: use string/fmt instead of printf for squirrel's PRINTFUNC 1 year ago
Charles Pigott b282664242 Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives 1 year ago
Loïc Guilloux 9642e87bc8
Fix: [Script] Access to enum/consts defined outside of main.nut (#10573) 1 year ago
Loïc Guilloux a53cfeef13
Fix #9548, e5fedcd: [Squirrel] Crash during engine cleanup after reaching memory limit on realloc (#9592) 3 years ago
Loïc Guilloux ccd586a736
Fix #9588, 140a96b: [Squirrel] Reaching memory limit during script registration could prevent further script detections (#9589)
Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
3 years ago
Rubidium 3237e97b35 Cleanup: [Script] Use nullptr instead of 0 or NULL 3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
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.
3 years ago
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.
3 years ago
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.
3 years ago
Loïc Guilloux 356bbbb90a
Fix: [MinGW] Set minimum OS version to Windows XP (#9135) 3 years ago
Rubidium e5fedcd6da Fix #6322: [Script] Try to let the script die when no memory can be allocated instead of crashing the whole game 3 years ago
Rasmus Jonsson 0b2dd2c5cd Fix: [NoAI] don't notify caught exceptions 4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
glx aac4255d43 Fix #7590: decrement allocated_size in ScriptAllocator::Free() 5 years ago
Niels Martin Hansen 140a96b3a0 Change: Limit memory allocations for each Squirrel instance
This can avoid out-of-memory situations due to single scripts using up the entire address space.
Instead, scripts that go above the maximum are killed.
The maximum is default 1 GB per script, but can be configured by a setting.
5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Niels Martin Hansen 12ba56c5a3 Fix 6accbf9: Silence warnings about unused fread() result 6 years ago
Charles Pigott 6accbf9afc Fix #6969: Account for BOM when reading script files 6 years ago
rubidium 876cc82f33 (svn r26797) -Codechange: rewrite the UTF8 reading code to make use of already existing functions instead of partially trying to implemented them 10 years ago
rubidium 385d3d3947 (svn r26796) -Fix: reading of high byte of "ASCII" files yielded a negative int8, then casted to an uint32 which caused the Squirrel lexer to bail out. Regardless... the file isn't actually ASCII, but that's beyond the point for now 10 years ago
rubidium f41b4a8e1b (svn r26784) -Codechange [Squirrel]: use WChar for the lexer 10 years ago
rubidium b5f5e88d57 (svn r26782) -Fix (r26781): was in the wrong folder when commiting 10 years ago
rubidium 962c1a3242 (svn r26776) -Codechange: use safe string functions in script/squirrel*.cpp 10 years ago
rubidium e63ca12ab8 (svn r26775) -Cleanup [Squirrel]: "resolve" several of the unicode wrapper defines 10 years ago
rubidium 33ab505567 (svn r26774) -Cleanup [Squirrel]: remove _SC macro 10 years ago
rubidium 7c4e9dd71d (svn r26771) -Cleanup: remove OTTD2SQ and SQ2OTTD 10 years ago
rubidium 7a00d2e849 (svn r26769) -Codechange [Squirrel]: remove the difference between some platforms having wchar for SQChar and others just char; always use char (and UTF-8) like in the rest of (internal) OpenTTD 10 years ago
rubidium a6b4e59963 (svn r26617) -Fix [FS#5973]: [Script] Loading/parsing of info .nuts was done in the same VM, causing e.g. constants to break the loading of info of other scripts 10 years ago
rubidium 39e90ec6e0 (svn r26584) -Codechange: [Squirrel] Make the internal integer for scripts always 64 bits, so scripts behave the same on 32 or 64 bits architectures 10 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 10 years ago
rubidium e61fe21237 (svn r26506) -Codechange: replace most of vsnprintf with vseprintf 10 years ago
rubidium 24fdd0b7bb (svn r26494) -Codechange: replace some further usages of s(n)printf with seprintf 10 years ago
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 10 years ago
rubidium 43f76dcabb (svn r26113) -Fix: unhandled seek error, and leaking file descriptor 11 years ago
rubidium 0e9c992104 (svn r26058) -Fix: handle the return value of a number of functions better 11 years ago
rubidium 4c443bce5c (svn r25555) -Fix [FS#5632]: [Script] Texts from scripts were not validated before they were shown, causing an assertion to trigger 11 years ago