Openttd Jgr



Tasklist

FS#4623 - Assumptions that sizeof(void *) is 4 bytes breaking 64 bit built (mingw64)

Attached to Project: OpenTTD
Opened by J G Rennison (JGR) - Sunday, 22 May 2011, 07:57 GMT
Last edited by Jose Soler (Terkhen) - Wednesday, 25 May 2011, 16:51 GMT
TypeBug
Category Core
Status Closed
Assigned To No-one
Operating SystemAll
SeverityLow
PriorityNormal
Reported Versiontrunk
Due in Version Undecided
Due Date Undecided
Percent Complete
Votes 0
Private No

Details

At the top of trunk/src/3rdparty/squirrel/include/squirrel.h, SQInteger, SQUnsignedInteger and SQHash are incorrectly typedefd to be (unsigned) long instead of (unsigned) long long for non MSVC compilers. This will cause an error when the code tries to store a pointer in said integer type.
#ifdef _SQ64
#ifdef _MSC_VER
typedef __int64 SQInteger;
typedef unsigned __int64 SQUnsignedInteger;
typedef unsigned __int64 SQHash; /*should be the same size of a pointer*/
#else
typedef long SQInteger;
typedef unsigned long SQUnsignedInteger;
typedef unsigned long SQHash; /*should be the same size of a pointer*/
#endif
typedef int SQInt32;
#else
typedef int SQInteger;
typedef int SQInt32; /*must be 32 bits(also on 64bits processors)*/
typedef unsigned int SQUnsignedInteger;
typedef unsigned int SQHash; /*should be the same size of a pointer*/
#endif
In trunk/src/settings.cpp:IniSaveSettings, 'unsigned long' should probably be 'size_t', as otherwise mingw64 halts with a precision loss error.
case SDT_MANYOFMANY:
switch (GetVarMemType(sld->conv)) {
case SLE_VAR_BL:
if (*(bool*)ptr (p != NULL)) continue;
break;
case SLE_VAR_I8:
case SLE_VAR_U8:
if (*(byte*)ptr (byte)(unsigned long)p) continue;
break;
case SLE_VAR_I16:
case SLE_VAR_U16:
if (*(uint16*)ptr (uint16)(unsigned long)p) continue;
break;
case SLE_VAR_I32:
case SLE_VAR_U32:
if (*(uint32*)ptr (uint32)(unsigned long)p) continue;
break;
default: NOT_REACHED();
}
Compilation using mingw64 gcc 20110516 pre-release 4.5.4
Openttd

MWBS for JGR PatchPack adds three new modular bridges that can be used to make wide bridges. WILL ONLY WORK ON A RECENT VERSION OF JGR PATCHPACK, NOT REGULAR OpenTTD!!!! Version Upload date MD5 (partial) License Download; 2: 2020-10-15T12:38:43+00:00: c7bdae69: GPL v2: Available ingame: 1: 2020-10-15T08:37:56+00:00: aeb3bc61. n y Hunk #1 FAILED at 99. 1 out of 1 hunk FAILED - saving rejects to file findversion.sh.rej patching file projects/openttdvs100.vcxproj patching file projects/openttdvs100.vcxproj.filters patching file projects/openttdvs80.vcproj patching file projects/openttdvs90.vcproj patching file source.list patching file src/aircraft.h patching.

Openttd jgr windows
Closed by Jose Soler (Terkhen)
Wednesday, 25 May 2011, 16:51 GMT
Reason for closing: Fixed
Additional comments about closing: In r22489, r22490 and r22491.

Jgr Patch Pack

Download

Openttd Jgr Android

Tasks related to this task (0)
Duplicate tasks of this task (0)