Remove duplicate storing, which was clearing the already stored
unit from the gamestate variables again. Silene forgot to delete
the line in 2010-08-06T17:31:14Z!guillaume.melquiond@gmail.com.
The problem was when the cleared index was 0 the entire array was
cleared. The fix was to correctly set explicit_index_ to true even
when the index is 0.
If the variable index is absent it now defaults to 0.
This fixes bug #18728. It might also fix all FOREACH and lua while
loops as Gambit described but I need to double check.
Some compilers are calling destructors for static objects before other
static objects use them in their destructors. This patch initializes
static t_interned objects with new and intentionally doesn't call
delete in order to guarrantee their existence throughout the static
de-initialization phase. It creates a new function
generate_safe_static_const_t_interned for this purpose. It might
address bug #18666, although I can not duplicate the crash with gcc on
fedora 15.
...of config::attribute_value & to tstring & or t_token reference
causes crashes. Some compilers were generating a temporary object and
binding a reference to the temporary when creating an implicit cast to
an attribute value. I removed the implicit cast and replaced all (I
think) instances of the implicit cast with explicit 2 step operation.
This fixes bugs like bug #18663, bug #18684
thonsew: You are sure it's a gooc idea to throw such a lot from here ?
Since that line is clearly not the only one which gets
skipped. WRN_NGs are emitted to the console in any case, even in
normal play without debug mode or log domains set.
1. Fixed some Mandatory WML child missing errors due to parsing errors
when new t_token parsing was added to variable_info.
2. Upgraded all WML errors to console errors to increase their visibility.
Changed assertion to a wml_syntax_exception that provides an error to
user informing them of invalid wml syntax and then continues with the
variable marked as invalid.
...in place of std:string in order to speed up comparisons, copies and
hashing which are 1 cycle operations.
Added z_sub t_token.
Added lru_cache unit test
...t_token in place of std::string. t_token compares, copies, copy
constructs and hashes in 1 operation instead of proportional to the
length of the string.
...to return translatable strings after variable expansion.
In particular, the engine no longer tries to expand variables inside
plain numbers or booleans.
...empty_vconfig(), the latter of which is backed by an empty config
object, rather than NULL.
This should eliminate segfaults due to accidental dereferencing of
the nullpointer in default-constructed vconfigs
...smaller effective types when they are not translatable.
This patch considerably reduces the memory footprint of WML and speeds it up.
It should not change any WML behavior, except for a few corner cases
detailled below:
- "off" is no longer a synonym for "no" (it wasn't used anyway),
- _"42" is no longer an integer,
- untranslatable "true" and "false" are stored as booleans, hence
displayed as "yes" and "no",
- "042" is now understood as octal notation (hence 34) rather than decimal,
- hexadecimal notation "0x42" is now recognized.
(Original patch #1139 by Frank Richter.)
This avoids leaking an implementation detail from the config class and
opens the door to a considerable reduction of the memory footprint of
lexical data.