# HG changeset patch # User koda # Date 1336057478 -3600 # Node ID 8b34f46e10c1677c5c774ea69062f09a6b1afa77 # Parent 08642c7da4a3b5e05be51a8b45995e799bbc4bbf HAPPY 7000th COMMIT HEDGEWARS - enforce strong typechecking for strings - disable embedded fpc exceptions (binary size savings of ~5k) - add stack check in debug mode diff -r 08642c7da4a3 -r 8b34f46e10c1 CMakeLists.txt --- a/CMakeLists.txt Thu May 03 13:25:40 2012 +0200 +++ b/CMakeLists.txt Thu May 03 16:04:38 2012 +0100 @@ -162,7 +162,7 @@ set(pascal_compiler_flags_cmn "-Os" "-Ooregvar" "-Xs" "-Si" ${pascal_compiler_flags_cmn}) set(haskell_compiler_flags_cmn "-w" "-fno-warn-unused-do-bind" ${haskell_compiler_flags_cmn}) else(Optz) - set(pascal_compiler_flags_cmn "-O-" "-g" "-gl" "-gv" "-dDEBUGFILE" ${pascal_compiler_flags_cmn}) + set(pascal_compiler_flags_cmn "-O-" "-g" "-gl" "-gv" "-Ct" "-dDEBUGFILE" ${pascal_compiler_flags_cmn}) set(haskell_compiler_flags_cmn "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind" ${haskell_compiler_flags_cmn}) endif(Optz) diff -r 08642c7da4a3 -r 8b34f46e10c1 hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Thu May 03 13:25:40 2012 +0200 +++ b/hedgewars/SDLh.pas Thu May 03 16:04:38 2012 +0100 @@ -944,7 +944,7 @@ function SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV'; function SDL_GL_SetAttribute(attr: TSDL_GLattr; value: LongInt): LongInt; cdecl; external SDLLibName; -procedure SDL_GL_SwapBuffers(); cdecl; external SDLLibName; +procedure SDL_GL_SwapBuffers; cdecl; external SDLLibName; function SDL_NumJoysticks: LongInt; cdecl; external SDLLibName; function SDL_JoystickName(idx: LongInt): PChar; cdecl; external SDLLibName; diff -r 08642c7da4a3 -r 8b34f46e10c1 hedgewars/options.inc --- a/hedgewars/options.inc Thu May 03 13:25:40 2012 +0200 +++ b/hedgewars/options.inc Thu May 03 16:04:38 2012 +0100 @@ -17,14 +17,15 @@ *) {$IFDEF FPC} - {$WRITEABLECONST OFF} + {$WRITEABLECONST OFF} + {$IMPLICITEXCEPTIONS OFF} + {$VARSTRINGCHECKS ON} {$MODE OBJFPC} {$ELSE} {$ERROR Only Free Pascal supported!} {$ENDIF} {$MACRO ON} - {$DEFINE GLunit:=GL} {$IFDEF ANDROID} diff -r 08642c7da4a3 -r 8b34f46e10c1 hedgewars/uTypes.pas --- a/hedgewars/uTypes.pas Thu May 03 13:25:40 2012 +0200 +++ b/hedgewars/uTypes.pas Thu May 03 16:04:38 2012 +0100 @@ -326,7 +326,7 @@ THHAmmo = array[0..cMaxSlotIndex, 0..cMaxSlotAmmoIndex] of TAmmo; THedgehog = record - Name: string[192]; + Name: shortstring; Gear: PGear; GearHidden: PGear; SpeechGear: PVisualGear; @@ -352,7 +352,7 @@ TTeam = record Clan: PClan; - TeamName: string[192]; + TeamName: shortstring; ExtDriven: boolean; Binds: TBinds; Hedgehogs: array[0..cMaxHHIndex] of THedgehog; diff -r 08642c7da4a3 -r 8b34f46e10c1 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Thu May 03 13:25:40 2012 +0200 +++ b/hedgewars/uWorld.pas Thu May 03 16:04:38 2012 +0100 @@ -1107,7 +1107,7 @@ var i, t, h: LongInt; r: TSDL_Rect; tdx, tdy: Double; - s: string[15]; + s: shortstring; highlight: Boolean; smallScreenOffset, offsetX, offsetY, screenBottom: LongInt; VertexBuffer: array [0..3] of TVertex2f; @@ -1464,7 +1464,7 @@ inc(CountTicks, Lag); if (GameType = gmtDemo) and (CountTicks >= 1000) then begin - i:=GameTicks div 1000; + i:= GameTicks div 1000; t:= i mod 60; s:= inttostr(t); if t < 10 then