1
0
Fork 0

(svn r27607) [1.6] -Backport from trunk:

- Fix: Compilation and optimisation issues with GCC6 (r27606, r27605, r27595)
- Fix: Compilation with --disable-network [FS#6481] (r27602)
- Fix: [NewGRF] shift-and-add-divide/modulo varadjusts use signed division/modulo (r27600)
- Fix: Company 0 could accept engine previews before they were offered (r27598)
release/1.6
frosch 2016-06-30 18:36:01 +00:00
parent 4b508ccbe8
commit c271eb89d8
5 changed files with 18 additions and 6 deletions

View File

@ -1380,7 +1380,7 @@ make_compiler_cflags() {
flags="$flags -Wnon-virtual-dtor" flags="$flags -Wnon-virtual-dtor"
fi fi
if [ $cc_version -ge 43 ]; then if [ $cc_version -ge 43 ] && [ $cc_version -lt 60 ]; then
# Use gnu++0x mode so static_assert() is available. # Use gnu++0x mode so static_assert() is available.
# Don't use c++0x, it breaks mingw (with gcc 4.4.0). # Don't use c++0x, it breaks mingw (with gcc 4.4.0).
cxxflags="$cxxflags -std=gnu++0x" cxxflags="$cxxflags -std=gnu++0x"
@ -1401,6 +1401,12 @@ make_compiler_cflags() {
flags="$flags -Wno-free-nonheap-object" flags="$flags -Wno-free-nonheap-object"
fi fi
if [ $cc_version -ge 60 ]; then
# -flifetime-dse=2 (default since GCC 6) doesn't play
# well with our custom pool item allocator
cxxflags="$cxxflags -flifetime-dse=1 -std=gnu++14"
fi
if [ "$enable_lto" != "0" ]; then if [ "$enable_lto" != "0" ]; then
# GCC 4.5 outputs '%{flto}', GCC 4.6 outputs '%{flto*}' # GCC 4.5 outputs '%{flto}', GCC 4.6 outputs '%{flto*}'
has_lto=`$1 -dumpspecs | grep '\%{flto'` has_lto=`$1 -dumpspecs | grep '\%{flto'`

View File

@ -798,7 +798,8 @@ SQRESULT sq_setdelegate(HSQUIRRELVM v,SQInteger idx)
switch(type) { switch(type) {
case OT_TABLE: case OT_TABLE:
if(type(mt) == OT_TABLE) { if(type(mt) == OT_TABLE) {
if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, "delagate cycle"); v->Pop();} if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, "delagate cycle");
v->Pop();}
else if(type(mt)==OT_NULL) { else if(type(mt)==OT_NULL) {
_table(self)->SetDelegate(NULL); v->Pop(); } _table(self)->SetDelegate(NULL); v->Pop(); }
else return sq_aux_invalidtype(v,type); else return sq_aux_invalidtype(v,type);

View File

@ -85,6 +85,7 @@ Engine::Engine(VehicleType type, EngineID base)
this->type = type; this->type = type;
this->grf_prop.local_id = base; this->grf_prop.local_id = base;
this->list_position = base; this->list_position = base;
this->preview_company = INVALID_COMPANY;
/* Check if this base engine is within the original engine data range */ /* Check if this base engine is within the original engine data range */
if (base >= _engine_counts[type]) { if (base >= _engine_counts[type]) {
@ -902,7 +903,7 @@ CommandCost CmdSetVehicleVisibility(TileIndex tile, DoCommandFlag flags, uint32
CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{ {
Engine *e = Engine::GetIfValid(p1); Engine *e = Engine::GetIfValid(p1);
if (e == NULL || e->preview_company != _current_company) return CMD_ERROR; if (e == NULL || !(e->flags & ENGINE_EXCLUSIVE_PREVIEW) || e->preview_company != _current_company) return CMD_ERROR;
if (flags & DC_EXEC) AcceptEnginePreview(p1, _current_company); if (flags & DC_EXEC) AcceptEnginePreview(p1, _current_company);

View File

@ -204,8 +204,8 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ScopeResolver
if (adjust->type != DSGA_TYPE_NONE) value += (S)adjust->add_val; if (adjust->type != DSGA_TYPE_NONE) value += (S)adjust->add_val;
switch (adjust->type) { switch (adjust->type) {
case DSGA_TYPE_DIV: value /= (S)adjust->divmod_val; break; case DSGA_TYPE_DIV: value = (S)value / (S)adjust->divmod_val; break;
case DSGA_TYPE_MOD: value %= (U)adjust->divmod_val; break; case DSGA_TYPE_MOD: value = (S)value % (S)adjust->divmod_val; break;
case DSGA_TYPE_NONE: break; case DSGA_TYPE_NONE: break;
} }

View File

@ -35,7 +35,9 @@
#include "window_func.h" #include "window_func.h"
#include "debug.h" #include "debug.h"
#include "game/game_text.hpp" #include "game/game_text.hpp"
#include "network/network_content_gui.h" #ifdef ENABLE_NETWORK
# include "network/network_content_gui.h"
#endif /* ENABLE_NETWORK */
#include <stack> #include <stack>
#include "table/strings.h" #include "table/strings.h"
@ -1815,7 +1817,9 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
SortIndustryTypes(); SortIndustryTypes();
BuildIndustriesLegend(); BuildIndustriesLegend();
SortNetworkLanguages(); SortNetworkLanguages();
#ifdef ENABLE_NETWORK
BuildContentTypeStringList(); BuildContentTypeStringList();
#endif /* ENABLE_NETWORK */
InvalidateWindowClassesData(WC_BUILD_VEHICLE); // Build vehicle window. InvalidateWindowClassesData(WC_BUILD_VEHICLE); // Build vehicle window.
InvalidateWindowClassesData(WC_TRAINS_LIST); // Train group window. InvalidateWindowClassesData(WC_TRAINS_LIST); // Train group window.
InvalidateWindowClassesData(WC_ROADVEH_LIST); // Road vehicle group window. InvalidateWindowClassesData(WC_ROADVEH_LIST); // Road vehicle group window.