sheepluva's inline patch, fix a crash in overlay
authorkoda
Wed, 30 Jun 2010 23:27:18 +0200
changeset 3599 715a43602da8
parent 3598 a8aa06bae895
child 3600 b16a9c8461ec
sheepluva's inline patch, fix a crash in overlay
hedgewars/uFloat.pas
hedgewars/uMisc.pas
project_files/HedgewarsMobile/Classes/OverlayViewController.m
--- a/hedgewars/uFloat.pas	Wed Jun 30 22:42:55 2010 +0200
+++ b/hedgewars/uFloat.pas	Wed Jun 30 23:27:18 2010 +0200
@@ -22,6 +22,7 @@
 interface
 
 {$IFDEF FPC}
+{$INLINE ON}
 {$IFDEF ENDIAN_LITTLE}
 type hwFloat = record
                isNegative: boolean;
@@ -38,14 +39,14 @@
                end;
 {$ENDIF}
 
-function int2hwFloat (const i: LongInt) : hwFloat;
+function int2hwFloat (const i: LongInt) : hwFloat; inline;
 
-operator + (const z1, z2: hwFloat) z : hwFloat;
-operator - (const z1, z2: hwFloat) z : hwFloat;
+operator + (const z1, z2: hwFloat) z : hwFloat; inline;
+operator - (const z1, z2: hwFloat) z : hwFloat; inline;
 operator - (const z1: hwFloat) z : hwFloat;
 
 operator * (const z1, z2: hwFloat) z : hwFloat;
-operator * (const z1: hwFloat; const z2: LongInt) z : hwFloat;
+operator * (const z1: hwFloat; const z2: LongInt) z : hwFloat; inline;
 operator / (const z1: hwFloat; z2: hwFloat) z : hwFloat;
 operator / (const z1: hwFloat; const z2: LongInt) z : hwFloat;
 
@@ -55,8 +56,8 @@
 function cstr(const z: hwFloat): shortstring;
 function hwRound(const t: hwFloat): LongInt;
 function hwAbs(const t: hwFloat): hwFloat;
-function hwSqr(const t: hwFloat): hwFloat;
-function hwSqrt(const t: hwFloat): hwFloat;
+function hwSqr(const t: hwFloat): hwFloat; inline;
+function hwSqrt(const t: hwFloat): hwFloat; inline;
 function Distance(const dx, dy: hwFloat): hwFloat;
 function DistanceI(const dx, dy: LongInt): hwFloat;
 function AngleSin(const Angle: Longword): hwFloat;
@@ -149,6 +150,7 @@
 implementation
 uses uMisc;
 
+
 {$IFDEF FPC}
 
 function int2hwFloat (const i: LongInt) : hwFloat;
--- a/hedgewars/uMisc.pas	Wed Jun 30 22:42:55 2010 +0200
+++ b/hedgewars/uMisc.pas	Wed Jun 30 23:27:18 2010 +0200
@@ -17,6 +17,7 @@
 *)
 
 {$INCLUDE "options.inc"}
+{$INLINE ON}
 
 unit uMisc;
 interface
@@ -147,7 +148,7 @@
 function  Min(a, b: LongInt): LongInt;
 function  Max(a, b: LongInt): LongInt;
 procedure OutError(Msg: shortstring; isFatalError: boolean);
-procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean);
+procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); inline;
 procedure SDLTry(Assert: boolean; isFatal: boolean);
 function  IntToStr(n: LongInt): shortstring;
 function  FloatToStr(n: hwFloat): shortstring;
@@ -163,7 +164,7 @@
 function  NewTexture(width, height: Longword; buf: Pointer): PTexture;
 function  Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture;
 procedure FreeTexture(tex: PTexture);
-function  toPowerOf2(i: Longword): Longword;
+function  toPowerOf2(i: Longword): Longword; inline;
 function  DecodeBase64(s: shortstring): shortstring;
 function  doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
 function  endian(independent: LongWord): LongWord;
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Wed Jun 30 22:42:55 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Wed Jun 30 23:27:18 2010 +0200
@@ -148,6 +148,7 @@
 
 -(void) viewDidUnload {
     self.writeChatTextField = nil;
+    [popoverController dismissPopoverAnimated:NO];
     self.popoverController = nil;
     self.popupMenu = nil;
     self.spinningWheel = nil;