# HG changeset patch # User sheepluva # Date 1418316605 -3600 # Node ID 79fa79c77c3842156fa0b0223e0f95b47fb56a14 # Parent 79e466c393f768b5e3f443c422f043971fa920e5 fix size of PtrInt. enable tests for pas2c (all passing now) diff -r 79e466c393f7 -r 79fa79c77c38 CMakeLists.txt --- a/CMakeLists.txt Thu Dec 11 15:20:23 2014 +0100 +++ b/CMakeLists.txt Thu Dec 11 17:50:05 2014 +0100 @@ -230,9 +230,8 @@ include(${CMAKE_MODULE_PATH}/cpackvars.cmake) -if(NOT BUILD_ENGINE_C) enable_testing() -endif(NOT BUILD_ENGINE_C) + add_custom_target(test COMMAND ${CMAKE_CTEST_COMMAND} -E '^todo/' --timeout 300 --schedule-random) add_custom_target(test_verbose COMMAND ${CMAKE_CTEST_COMMAND} -E '^todo/' --timeout 300 --schedule-random -V) diff -r 79e466c393f7 -r 79fa79c77c38 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Thu Dec 11 15:20:23 2014 +0100 +++ b/hedgewars/uScript.pas Thu Dec 11 17:50:05 2014 +0100 @@ -2277,17 +2277,17 @@ function lc_addPoint(L : Plua_State) : LongInt; Cdecl; -var np, param: integer; +var np, param: LongInt; begin if CheckAndFetchParamCountRange(L, 2, 4, 'AddPoint', 'x, y [, width [, erase] ]', np) then begin // x - param:= lua_tointeger(L,1); - PointsBuffer:= PointsBuffer + char((param and $FF00) shr 8); + param:= LongInt(lua_tointeger(L,1)); + PointsBuffer:= PointsBuffer + char((param shr 8) and $FF); PointsBuffer:= PointsBuffer + char((param and $FF)); // y - param:= lua_tointeger(L,2); - PointsBuffer:= PointsBuffer + char((param and $FF00) shr 8); + param:= LongInt(lua_tointeger(L,2)); + PointsBuffer:= PointsBuffer + char((param shr 8) and $FF); PointsBuffer:= PointsBuffer + char((param and $FF)); // width if np > 2 then diff -r 79e466c393f7 -r 79fa79c77c38 project_files/hwc/rtl/pas2c.h --- a/project_files/hwc/rtl/pas2c.h Thu Dec 11 15:20:23 2014 +0100 +++ b/project_files/hwc/rtl/pas2c.h Thu Dec 11 17:50:05 2014 +0100 @@ -61,7 +61,7 @@ typedef LongInt * PLongInt; typedef LongWord * PLongWord; typedef Integer * PInteger; -typedef int PtrInt; +typedef ptrdiff_t PtrInt; typedef wchar_t widechar; typedef wchar_t* PWideChar; typedef char Char;