HAPPY 7000th COMMIT HEDGEWARS
authorkoda
Thu, 03 May 2012 16:04:38 +0100
changeset 7016 8b34f46e10c1
parent 7015 08642c7da4a3
child 7017 19a434fc91fc
HAPPY 7000th COMMIT HEDGEWARS - enforce strong typechecking for strings - disable embedded fpc exceptions (binary size savings of ~5k) - add stack check in debug mode
CMakeLists.txt
hedgewars/SDLh.pas
hedgewars/options.inc
hedgewars/uTypes.pas
hedgewars/uWorld.pas
--- 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)
 
--- 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;
--- 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}
--- 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;
--- 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