Commit Graph

157 Commits

Author SHA1 Message Date
frosch 484ea62a62 Cleanup: use std::optional instead of custom implementation. 2020-12-14 23:50:50 +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
Niels Martin Hansen 9895ced6af Fix: Silence some warnings when building with clang-cl on VS 2019
Clang-cl presents as both _MSC_VER and __clang__ in the preprocessor which makes some things confusing.
2020-06-18 08:56:27 +01:00
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
2020-06-05 19:36:05 +02:00
Michael Lutz 8aef14386f Add: Optional implementation of std::optional for pre-C++17 compilers.
Sourced from https://github.com/akrzemi1/Optional, Boost Software License, Version 1.0.
2020-05-21 20:02:34 +02:00
glx 196157b29e Fix #7966: SQInteger is 64-bit, print it as 64-bit 2020-02-01 10:14:51 +00:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Charles Pigott 6378a78817 Codechange: Explicitly move a few variables to avoid a copy constructor (fixes warning from clang) 2019-09-30 14:00:06 +01:00
Charles Pigott 71a3e83468 Fix: GCC9's warnings about deprecated implicit assignment operators 2019-09-30 14:00:06 +01:00
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.
2019-05-11 15:34:33 +02:00
Charles Pigott 5f86e1a390 Codechange: Silence -Wclass-memaccess warnings with GCC8 2018-06-27 22:54:46 +02:00
Niels Martin Hansen 836d25e738 Codechange: Address some MSVC compiler warnings 2018-06-15 22:36:55 +02:00
frosch 062c736437 (svn r27896) -Fix: some warnings 2017-08-20 21:04:21 +00:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
rubidium ac6312d33c (svn r27605) -Fix: GCC 6 warning about misleading indentation 2016-06-27 17:52:30 +00:00
matthijs 576005b714 (svn r27561) -Fix [Squirrel]: Fix typos in error messages 2016-05-11 21:28:39 +00:00
rubidium d05ac99d52 (svn r27289) -Fix: some uninitialised instance variables 2015-05-20 18:17:50 +00:00
rubidium 5ed8ac8a81 (svn r27233) -Fix [FS#6272]: crash when no AIs were installed due to improper handling of non-ASCII characters by the string pointer lexer 2015-04-11 19:33:36 +00:00
frosch 396dde1636 (svn r27092) -Fix/Add [FS#6186]: Compilation on OS/2 (smedles) 2014-12-24 17:17:18 +00:00
rubidium 771dcf3b7b (svn r27003) -Cleanup: fix the use of spaces and asterices "around" some comments 2014-10-12 18:41:53 +00:00
rubidium 79ca66eb67 (svn r26853) -Cleanup [Squirrel]: remove some stuff that we never did and especially never should use 2014-09-19 20:06:51 +00:00
rubidium dba98e85cb (svn r26845) -Fix [Squirrel]: more uninitialized variables in constructors 2014-09-17 18:35:45 +00:00
rubidium 6defde275c (svn r26844) -Fix: clang compile error 2014-09-17 17:52:50 +00:00
rubidium 3c85109c49 (svn r26842) -Codechange [Squirrel]: other simple cases of non-initialised instance variables 2014-09-16 21:14:18 +00:00
rubidium a1d4148be5 (svn r26841) -Codechange [Squirrel]: move the actual initialisation of instance variables of SQString into the constructor 2014-09-16 21:13:24 +00:00
rubidium 1685118169 (svn r26840) -Fix [Squirrel]: merge Init and constructor of SQSharedState 2014-09-16 21:11:14 +00:00
rubidium 22fc96ad6b (svn r26839) -Fix [Squirrel]: some dead code and making switch fall throughs more explicit 2014-09-16 21:10:01 +00:00
rubidium 0291a1be11 (svn r26838) -Fix (r26831): attempt to make MSVC like the code again 2014-09-16 20:14:03 +00:00
rubidium 74ceffd3c5 (svn r26837) -Fix [Squirrel]: remove some pointless assignments 2014-09-16 20:09:20 +00:00
rubidium 9f249cfff9 (svn r26836) -Fix [Squirrel]: merge SQLexer::Init with the constructor; there's no need to construct first and then call init in the next line 2014-09-16 20:08:44 +00:00
rubidium 0d0c4461ce (svn r26835) -Fix [Squirrel]: remove dead code from the lexer 2014-09-16 20:07:47 +00:00
rubidium 7176f65edf (svn r26834) -Fix [Squirrel]: prevent unitialized memory warning by moving code from (static) Init to constructure for SQFunctionProto 2014-09-16 20:07:19 +00:00
rubidium 12bd7532ba (svn r26833) -Fix [Squirrel]: remove a few bits of dead code 2014-09-16 20:06:28 +00:00
rubidium 5cec030d4d (svn r26832) -Fix [Squirrel]: ensure instance variable of SQNativeClosure is properly initialized 2014-09-16 20:06:05 +00:00
rubidium ff880a420d (svn r26831) -Fix [Squirrel]: (bogus) warning about falling through in a switch 2014-09-16 20:05:21 +00:00
rubidium f41b4a8e1b (svn r26784) -Codechange [Squirrel]: use WChar for the lexer 2014-09-07 06:46:03 +00:00
rubidium 6bf8a63ed9 (svn r26783) -Fix (r26781): removed one include too many 2014-09-06 20:38:39 +00:00
rubidium 9b0c01e9bf (svn r26781) -Codechange [Squirrel]: remove includes/definitions that are already in stdafx.h 2014-09-06 20:20:35 +00:00
rubidium 7ece56c347 (svn r26780) -Cleanup: remove unused SQUIRREL_API macro 2014-09-06 20:11:00 +00:00
rubidium a47874754c (svn r26779) -Cleanup [Squirrel]: remove extern "C" statements; we won't be exporting things to C from our squirrel 2014-09-06 20:05:07 +00:00
rubidium 9543f4ed1e (svn r26778) -Codechange: remove pointless rsl macro 2014-09-06 19:57:01 +00:00
rubidium eb52e65bec (svn r26777) -Codechange: use safe string functions in squirrel code as well, and prevent using the ones that are deemed unsafe 2014-09-06 19:54:35 +00:00
rubidium e63ca12ab8 (svn r26775) -Cleanup [Squirrel]: "resolve" several of the unicode wrapper defines 2014-09-06 18:10:36 +00:00
rubidium 33ab505567 (svn r26774) -Cleanup [Squirrel]: remove _SC macro 2014-09-06 17:46:56 +00:00
rubidium ad315ef6d9 (svn r26772) -Cleanup [Squirrel]: remove traces to SQUNICODE define 2014-09-06 17:36:29 +00:00
rubidium 3f9525ff0e (svn r26770) -Fix [Squirrel]: in case SQChar is a char (previously everything non-Windows or non-Unicode, now everything), the lexer throws away the higher bytes of characters 2014-09-06 17:22:06 +00:00
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 2014-09-06 17:20:45 +00:00
frosch 43e82ded9a (svn r26764) -Fix: Buffer overrun in SQCompiler::Error. (kalenz) 2014-08-31 10:20:30 +00:00
rubidium 8e87ae9120 (svn r26609) -Fix: compile warnings on MSVC for 32 bits builds due to assigning values to variables with smaller integer size 2014-05-24 17:58:32 +00:00
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 2014-05-11 20:16:37 +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
matthijs 282d3778ad (svn r25781) -Doc: Add licensing section to readme.txt. 2013-09-19 07:42:15 +00:00
rubidium 2d459b2fc0 (svn r25585) -Fix [FS#5320]: [Squirrel] Stack overflow did not show an error, due to the stack to throw the error already being full 2013-07-11 17:29:51 +00:00
rubidium 3f7fdd738b (svn r25558) -Fix [FS#5568]: [Squirrel] Infinite recursion loop in freeing data via a looping set of references 2013-07-04 20:06:27 +00:00
rubidium 124f0fc7a3 (svn r24970) -Fix [FS#5346]: crash when infinite loop occured during loading a script 2013-02-05 20:52:28 +00:00
frosch dafff99b2a (svn r24928) -Fix [FS#5408]: [Squirrel] Update line information before processing 'while' token of 'do'-'while' statement. 2013-01-20 17:23:08 +00:00
rubidium a355e123fc (svn r24153) -Fix [FS#5160]: [Squirrel] Crash when trying to create an array with negative size 2012-04-18 19:22:32 +00:00
rubidium 703ef5b7b6 (svn r23962) -Fix [FS#5068]: [Script] Infinite recursion within a script wasn't caught properly, so they could cause crashes of OpenTTD instead of the AI 2012-02-17 21:49:53 +00:00
rubidium cd735fb613 (svn r23870) -Fix [FS#5004]: scripts with a bad comparator could lock up OpenTTD 2012-01-29 14:27:21 +00:00
yexo f5b6a9db5c (svn r23801) -Fix: reading the utf-8 BOM from AI/GS files on big-endian machines failed 2012-01-15 11:31:34 +00:00
truebrain 1c9bec1999 (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) 2011-12-20 17:57:56 +00:00
yexo 8f36e70e35 (svn r23496) -Fix: [Squirrel] Provide a proper error message when the _cmp meta-function doesn't return an integer 2011-12-11 15:52:18 +00:00
truebrain 0c2bbdde5c (svn r23383) -Update: bring Squirrel to 2.2.5; besides some nice bug fixes, it mostly solves the sort() issues 2011-12-01 12:03:20 +00:00
rubidium 4f87d2e88c (svn r23194) -Codechange: don't cast away const needlessly 2011-11-12 08:26:30 +00:00
rubidium 624c8a6173 (svn r23190) -Fix: compile error due to Squirrel define messing up another included file 2011-11-11 18:59:47 +00:00
yexo 72b1fffe82 (svn r23187) -Fix (r23186): MSVC allowed non-const where const was mandatory 2011-11-10 20:07:14 +00:00
yexo 37797164ca (svn r23186) -Fix [FS#4830]: [Squirrel] replace custom qsort by std::sort to fix stack overflow 2011-11-10 19:40:49 +00:00
terkhen 1f3853249d (svn r22490) -Fix [FS#4623]: [Squirrel] Fix compilation under MinGW-w64. (JGR) 2011-05-25 16:35:23 +00:00
smatz 2447efdefd (svn r22481) -Fix: compilation with recent GCC 2011-05-21 08:40:50 +00:00
yexo 5f18d6d828 (svn r22055) -Fix [FS#4490]: [Squirrel] some invalid squirrel code caused the squirrel compiler to crash 2011-02-11 06:18:39 +00:00
rubidium 92da292fbc (svn r20162) -Fix [FS#3954]: integer comparison failed in case the difference was more than "MAX_UINT"/2 2010-07-16 17:42:58 +00:00
yexo 7c51a82020 (svn r19166) -Change: don't print the absolute path to AI script files in the AI debug window, use the relative path from /ai/ instead 2010-02-20 13:28:56 +00:00
frosch c07c7a3818 (svn r18832) -Fix: some indentation whitespace. 2010-01-16 20:51:35 +00:00
rubidium 3ca0937c1c (svn r18769) -Codechange: replace MiniLZO with the real library. If you're using MSVC update openttd-useful, otherwise make sure you've got liblzo2 and it's development files installed. 2010-01-10 13:12:34 +00:00
rubidium 9574371e53 (svn r18639) -Update: Squirrel from 2.2.3 to 2.2.4
-Revert (r17273): this fix is included in Squirrel 2.2.4
2009-12-26 09:59:32 +00:00
rubidium 6db598e408 (svn r18025) -Fix (r17217): more missing/extra parentheses (for compilers I've never heard of) 2009-11-08 23:56:39 +00:00
rubidium 29ee106efa (svn r18024) -Fix (r17217): missing ( 2009-11-08 22:24:33 +00:00
smatz 1bc7684ff0 (svn r17883) -Codechange: little cleaning in md5.cpp and md5.h 2009-10-26 23:03:03 +00:00
rubidium d6cded5380 (svn r17693) -Cleanup: remove some unneeded includes 2009-10-04 17:16:41 +00:00
rubidium afc7f576f7 (svn r17515) -Fix [FS#3189]: [Squirrel] In some cases the call stack would not be cleaned up properly during crash handling. Occasionally this causes asserts to be triggered or crashes. 2009-09-12 20:31:41 +00:00
yexo c9a25c88fa (svn r17499) -Fix (r17498): remove 2 unused functions so some compilers stop warning about them 2009-09-10 23:14:21 +00:00
yexo ca6c4ee98a (svn r17498) -Add [NoAI]: Enable the squirrel std math library 2009-09-10 20:19:12 +00:00
rubidium 5607a610d7 (svn r17403) -Fix [Squirrel]: guard against squirrel stack overflows; if assert is enabled assert (catch possible overflow bugs in nightlies/RCs), otherwise just increase the stack's size (don't get into invalid reads/writes in releases) 2009-09-03 11:48:08 +00:00
rubidium 4ac4c28a3b (svn r17284) -Fix [Squirrel]: stack was not always cleared properly with tail recursion 2009-08-25 15:09:27 +00:00
yexo b9536e933f (svn r17283) -Cleanup [Squirrel]: remove a few unneeded changes to squirrel code 2009-08-25 12:47:50 +00:00
yexo c46c0a7c86 (svn r17282) -Fix (r17195): the squirrel documentation files were not updated 2009-08-25 11:43:05 +00:00
yexo f9c18ccc48 (svn r17273) -Fix [Squirrel]: calling a function that has default parameters with not enough parameters can cause a crash 2009-08-23 19:25:52 +00:00
rubidium 60a3bc9034 (svn r17247) -Change: move '3rd party' MD5 implementation also to the 3rdparty directory. 2009-08-21 20:15:17 +00:00
rubidium d680be454e (svn r17243) -Fix (r17216): undo 'damage' by svn:keywords 2009-08-20 19:54:03 +00:00
yexo 14b5862c22 (svn r17230) -Fix (r15027): don't assert when an AI uses AI*Mode objects incorrectly but crash the AI instead 2009-08-20 10:39:39 +00:00
yexo a4afa140f3 (svn r17223) -Change [NoAI] [FS#2980]: Crash an AI when it uses a DoCommand / Sleep instead of just printing an error message in the AI Debug Window 2009-08-19 16:14:15 +00:00
glx 0fa0286ebb (svn r17218) -Fix (r17216): missing '(' causing compile error 2009-08-18 23:08:16 +00:00
rubidium 40d1f1fedf (svn r17217) -Fix (r17216): silence some warnings for the more exotic GCC-alikes 2009-08-18 22:51:43 +00:00
rubidium d4adee0b1d (svn r17216) -Update: MiniLZO from 1.08 to 2.03. 2009-08-18 22:26:38 +00:00
rubidium 82105604c3 (svn r17212) -Change: move minilzo to its 'own' 3rdparty directory as it belongs there 2009-08-18 17:49:28 +00:00
yexo 03d711add3 (svn r17195) -Update: squirrel to 2.2.3 stable 2009-08-15 21:21:52 +00:00
yexo 1df029de1d (svn r16534) -Fix [Squirrel] [FS#2942]: fix crash that occured when an AI was halted while one or more generators were still in a 'running' state 2009-06-07 20:20:22 +00:00
yexo 9db1f5925c (svn r16532) -Fix [Squirrel]: Don't copy an object when we just checked that the pointer to it is NULL 2009-06-07 15:54:37 +00:00
yexo 13c69b897e (svn r16509) -Fix (r16502): All Sleep/DoCommand calls failed instead of only those via a call/acall/pcall function 2009-06-03 15:59:26 +00:00
yexo 4ea3e511bd (svn r16502) -Fix [FS#2935]: when an AI was suspended while in a function called (indirectly) via call/acall/pcall OpenTTD crashed. Fix this by disallowing AIs to be suspended while called via call/acall/pcall.
IMPORTANT FOR AI WRITERS: AIs can no longer call any DoCommand functions (change anything, build vehicles, etc.) in a function called (indirectly) via call/acall/pcall. Where possible, please rewrite your code so it doesn't use call/acall/pcall
2009-06-01 22:00:47 +00:00