drop the error checked StrToInt as non-critical - pas2c did not implement it.
authornemo
Tue, 09 Oct 2018 12:54:40 -0400
changeset 13900 6b2c87490f0a
parent 13899 0ce8aad17c24
child 13901 5753ed5fb83a
child 13903 5f819b90d479
drop the error checked StrToInt as non-critical - pas2c did not implement it.
hedgewars/uStore.pas
hedgewars/uUtils.pas
--- a/hedgewars/uStore.pas	Tue Oct 09 11:28:07 2018 -0400
+++ b/hedgewars/uStore.pas	Tue Oct 09 12:54:40 2018 -0400
@@ -774,7 +774,6 @@
     key, value, l, temp: shortstring;
     color, tempColor: Longword;
     clanID, tempClanID: byte;
-    conversionSuccess: boolean;
 begin
     if cOnlyStats then exit;
 
@@ -787,7 +786,6 @@
         while (not pfsEOF(f)) and (l <> '[colors]') do
             pfsReadLn(f, l);
 
-        conversionSuccess:= false;
         while (not pfsEOF(f)) and (l <> '') do
             begin
             pfsReadLn(f, l);
@@ -803,11 +801,8 @@
             if temp = 'color' then
                 begin
                 temp:= copy(key, 6, length(key) - 5);
-                tempClanID:= StrToInt(temp, conversionSuccess);
-                if conversionSuccess then
-                    clanID:= tempClanID
-                else
-                    continue;
+                tempClanID:= StrToInt(temp);
+                clanID:= tempClanID
                 end
             else
                 continue;
@@ -822,11 +817,8 @@
                 if value[1] <> '#' then
                     continue;
                 temp:= copy(value, 2, length(value) - 1);
-                tempColor:= StrToInt('0x'+temp, conversionSuccess);
-                if conversionSuccess then
-                    color:= tempColor
-                else
-                    continue;
+                tempColor:= StrToInt('0x'+temp);
+				color:= tempColor
                 end;
 
             if clanID <= cClanColors then
--- a/hedgewars/uUtils.pas	Tue Oct 09 11:28:07 2018 -0400
+++ b/hedgewars/uUtils.pas	Tue Oct 09 12:54:40 2018 -0400
@@ -50,7 +50,7 @@
 
 function  IntToStr(n: LongInt): shortstring;
 function  StrToInt(s: shortstring): LongInt;
-function  StrToInt(s: shortstring; var success: boolean): LongInt;
+//function  StrToInt(s: shortstring; var success: boolean): LongInt;
 function  FloatToStr(n: hwFloat): shortstring;
 
 function  DxDy2Angle(const _dY, _dX: hwFloat): real; inline;
@@ -335,18 +335,17 @@
 // Convert string to longint, with error checking.
 // Success will be set to false when conversion failed.
 // See documentation on Val procedure for syntax of s
-function StrToInt(s: shortstring; var success: boolean): LongInt;
-begin
-val(s, StrToInt);
-success:= StrToInt <> nil;
-end;
+//function StrToInt(s: shortstring; var success: boolean): LongInt;
+//var Code: Word;
+//begin
+//val(s, StrToInt, Code);
+//success:= Code = 0;
+//end;
 
 // Convert string to longint, without error checking
 function StrToInt(s: shortstring): LongInt;
-var success: boolean; // ignored
 begin
-success:= true; // avoid compiler hint
-StrToInt:= StrToInt(s, success);
+val(s, StrToInt);
 end;
 
 function FloatToStr(n: hwFloat): shortstring;