summaryrefslogtreecommitdiff
path: root/src/newgrf_commons.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-08-11 07:42:47 +0000
committerfrosch <frosch@openttd.org>2010-08-11 07:42:47 +0000
commit43d6740f2d68af2223796eb2324086be18487b88 (patch)
treeac31b14848d59c67336adf713cccfdd0172c403b /src/newgrf_commons.h
parent6245a9556b1c88950dfdde24425703e7f699531e (diff)
downloadopenttd-43d6740f2d68af2223796eb2324086be18487b88.tar.xz
(svn r20445) -Codechange (r20435): Some compilers (esp. mine) do not comply to the specs.
Diffstat (limited to 'src/newgrf_commons.h')
-rw-r--r--src/newgrf_commons.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h
index 129e662b4..665d64dd6 100644
--- a/src/newgrf_commons.h
+++ b/src/newgrf_commons.h
@@ -141,7 +141,13 @@ uint32 GetNearbyTileInformation(TileIndex tile);
*/
template <size_t Tcnt>
struct GRFFilePropsBase {
- /* The lack of constructor means the default zero-ing constructor is used. */
+ GRFFilePropsBase() : local_id(0), grffile(0)
+ {
+ /* The lack of some compilers to provide default constructors complying to the specs
+ * requires us to zero the stuff ourself. */
+ memset(spritegroup, 0, sizeof(spritegroup));
+ }
+
uint16 local_id; ///< id defined by the grf file for this entity
const struct GRFFile *grffile; ///< grf file that introduced this entity
const struct SpriteGroup *spritegroup[Tcnt]; ///< pointer to the different sprites of the entity
@@ -153,8 +159,6 @@ struct GRFFileProps : GRFFilePropsBase<1> {
GRFFileProps(uint16 subst_id) :
GRFFilePropsBase<1>(), subst_id(subst_id), override(subst_id)
{
- /* Check whether the constructor did comply with the specs. */
- assert(this->spritegroup[0] == NULL);
}
/** Simple constructor for the props. */