# HG changeset patch # User frosch # Date 1281512567 0 # Node ID aa1cd3bbb0b0c28f4c196fbbe90b863caa6efeb0 # Parent ecdb897e3cd545c9e76c6b9b03bd0c1c5d30aa7a (svn r20445) -Codechange (r20435): Some compilers (esp. mine) do not comply to the specs. diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -141,7 +141,13 @@ */ template 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 @@ 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. */