This is used to differentiate LOG_ERROR (which is a *non* fatal error, but a error none the less) and fatal errors which result in program termination with no *visible* output (on windows/macs) on our end because of the crappy GUI functions so we usually dump it to stderr.txt and there is no clue that the program had to exit for whatever reason.
Hopefully, this will be helpful to windows people so they can differentiate between *our* exit/abort routines, and crashes that occur in drivers which look exactly the same since they get dumped back to the desktop with no visible clue why.
LOG_FATAL is *always* on in both debug & release builds.
On LOG_FATAL debug lines, on windows, we now throw up a modal dialog box with the current error message. At this time, this only happens when we have a error, and we use abort() right after the error, which makes it fatal.
That explains why this touches ~60 files :)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8320 4a71c877-e1ca-e34f-864e-861f7616d084
In C++ enums are treated differently from integers in some cases, causing GCC to emit some rather nasty abort()-like code (x86/x64 instruction "ud2a") when used as the type for va_arg().
This was the compiler message generated:
{{{
stack.c:339: warning: ‘INTERP_TYPE’ is promoted to ‘int’ when passed through ‘...’
stack.c:339: note: (so you should pass ‘int’ not ‘INTERP_TYPE’ to ‘va_arg’)
stack.c:339: note: if this code is reached, the program will abort
}}}
NOTE: Compiling as C++ now works (as does the produced code), using: {{{./configure CC=g++ CFLAGS=-fpermissive --enable-debug=relaxed}}}
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6957 4a71c877-e1ca-e34f-864e-861f7616d084
Extension functions dealing with ...
* strings are in string_ext.h
* stdio (namely printf variants) are in stdio_ext.h
* math are in math_ext.h
These headers are no longer included by frame.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6613 4a71c877-e1ca-e34f-864e-861f7616d084
- This reduces the complexity of those functions ''significantly''
* Mark yyerror functions with printf formatting with WZ_DECL_FORMAT(printf, ...)
(@trunk = the original intented target for r6430)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6432 4a71c877-e1ca-e34f-864e-861f7616d084
(Normally, it dumps only when LOG_SCRIPT is defined, but we can't determine where the script errors are when LOG_SCRIPT isn't used)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6212 4a71c877-e1ca-e34f-864e-861f7616d084
* Missing returns from function
* Functions that are defined in both DEBUG and NDEBUG builds but only used in DEBUG builds
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6179 4a71c877-e1ca-e34f-864e-861f7616d084
* Mark several parameters that aren't being used (but shouldn't be removed) with WZ_DECL_UNUSED
* Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
* Instead of "(X - Y) >= 0" use the logically equivalent and more readable "X >= Y"
* Remove redundant function prototypes
* Move variables into a more local scope where possible
* Assign the result of an expression to a variable once so that the expression doesn't have to be duplicated several times
* Move constant UNALLOCATED_OBJECT out of the header and into the only source file where it's ever used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6160 4a71c877-e1ca-e34f-864e-861f7616d084
* Const correctness
* Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6158 4a71c877-e1ca-e34f-864e-861f7616d084
* The lexers depend on the parser's headers so make sure to compile the parsers first
* Move a misplaced line-wrapping backslash in src/makefile.win32
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6153 4a71c877-e1ca-e34f-864e-861f7616d084
* Make sure to call va_end on all instances of va_list when we're done with it
Similar to r5930 (which fixed ticket:50)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5931 4a71c877-e1ca-e34f-864e-861f7616d084
* Update build systems: autotools, raw win32 makefiles, Code::Blocks project and MSVC project
* Rename _droid and _base_object forward declaration types to DROID and BASE_OBJECT respectively
* Add two forward declarations for BASE_OBJECT and DROID to scriptfuncs.h so that it can declare pointers to these types
* src/messagedef.h depends on lib/ivis_common/ivisdef.h and src/positiondef.h so #include those
* Don't #include stuff from src/ in lib/script/chat_processing.h
* Remove all unnecessary #inlucdes from src/ from lib/script/chat_lexer.l
NOTE: Build systems not mentioned above might need updating.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5531 4a71c877-e1ca-e34f-864e-861f7616d084
Clean scriptFreeCode's formating and remove unnecessary checks for ptr!=NULL before freeing.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5400 4a71c877-e1ca-e34f-864e-861f7616d084
Exception is when generating the .wz files, where we need the path to the build directory and building a reverse relative path to $(srcdir) will be messy.
Also silence submake.mk a great deal.
Bug #11883 should be fixed now for the most part.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5325 4a71c877-e1ca-e34f-864e-861f7616d084
Their use is currently flawed, since it will not work in directories with spaces in them... (
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5319 4a71c877-e1ca-e34f-864e-861f7616d084
- Use PACKAGE, PACKAGE_VERSION, remove VERSION
- Allow out-of-source-dir builds (mkdir build && cd build && make -f ../Makefile.raw)
- Move config.mk from $(top_srcdir)/makerules/config.mk to $(top_builddir)/config.mk
When keeping current behaviour (srcdir=builddir), this means: Move it from makerules into the main directory
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5308 4a71c877-e1ca-e34f-864e-861f7616d084
* Get rid of lexer function parseGetErrorData and use audp_get_lineno() and audp_get_text() instead
* Add a WZ_DECL_FORMAT declaration to audp_error to enable GCC's printf format checking
* In audp_error allocate the buffer on the stack using alloca() instead of an auto 1kB text buffer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5094 4a71c877-e1ca-e34f-864e-861f7616d084
* Update file-level comment for chat_lexer.l for the change in r899 (i.e. the flex option `-i` doesn't need to be specified anymore)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5059 4a71c877-e1ca-e34f-864e-861f7616d084
-allow creation of unit templates on the fly
-allow direct access to major weapon stats from within scripts
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5014 4a71c877-e1ca-e34f-864e-861f7616d084
* Make log output use LOG_SCRIPT instead of LOG_NEVER and LOG_WARNING
* Some random cleanups
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4788 4a71c877-e1ca-e34f-864e-861f7616d084
* Use strlcpy for copying strings instead of snprintf "%s"
* Don't cast the return value from vsnprintf to (void)
* When we use va_start make sure to use va_end as well...
* Fix indentation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4785 4a71c877-e1ca-e34f-864e-861f7616d084
* Replace "nstr = malloc(strlen(str) + 1); strcpy(nstr, str);" by using "nstr = strdup(str);" instead
* Remove a non-sensical self-assignment ("pIdent = pIdent;")
* In scriptAddVariable:
* "Overallocate" for the new VAR_SYMBOL so that we can store the identifier in that single chunk of memory
* This allows deallocating the entire structure with a single free() call (which prevents problems with the constness change to VAR_SYMBOL mentioned above)
* Don't take ownership of the memory pointed to by psVarIdent->pIdent, just copy its contents instead
* Make FREE_VARIDENTDECL a function instead: freeVARIDENTDECL
* In this function also free psDcl->pIdent
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4696 4a71c877-e1ca-e34f-864e-861f7616d084
* Remove unused function scriptClearLocalVariables() (which was effectively a NOP due to psLocalVars being NULL)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4691 4a71c877-e1ca-e34f-864e-861f7616d084
Allow global variable declarations to be mixed with trigger and event/function declaration. This allows us to #include script files which variable/event declaration.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4667 4a71c877-e1ca-e34f-864e-861f7616d084
- Strings are not equivalent to anything, only convertible (mistake in one of my last commits)
- Clarify names
- Print user types
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4339 4a71c877-e1ca-e34f-864e-861f7616d084
You still should not call traceOn() from a script or enable interpTrace in the code...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4328 4a71c877-e1ca-e34f-864e-861f7616d084
-AI became more talkative
-more phrases can be recognized and used as commands
-cleanups
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4158 4a71c877-e1ca-e34f-864e-861f7616d084