Some fixes to make Pas2C happy again
authorWuzzy <Wuzzy2@mail.ru>
Sat, 04 May 2019 21:37:22 +0200
changeset 14899 4e3d81af71bf
parent 14898 421eed52a8e1
child 14900 002f7d41f5ce
Some fixes to make Pas2C happy again
hedgewars/uGears.pas
hedgewars/uGearsHandlersMess.pas
hedgewars/uSound.pas
--- a/hedgewars/uGears.pas	Sat May 04 21:03:26 2019 +0200
+++ b/hedgewars/uGears.pas	Sat May 04 21:37:22 2019 +0200
@@ -283,7 +283,7 @@
                     if curHandledGear^.Tex = nil then
                         if (curHandledGear^.Karma = 1) and (not (GameType in [gmtDemo, gmtRecord])) then
                             // Secret mine timer
-                            curHandledGear^.Tex:= RenderStringTex(ansistring(trmsg[sidUnknownGearValue]), $ff808080, fntSmall)
+                            curHandledGear^.Tex:= RenderStringTex(trmsg[sidUnknownGearValue], $ff808080, fntSmall)
                         else
                             begin
                             // Display mine timer with up to 1 decimal point of precision (rounded down)
--- a/hedgewars/uGearsHandlersMess.pas	Sat May 04 21:03:26 2019 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Sat May 04 21:37:22 2019 +0200
@@ -2498,7 +2498,7 @@
                 if i = 1 then
                     Gear^.Tex := RenderStringTex(ansistring(inttostr(Gear^.Health)), $ff80ff80, fnt16)
                 else
-                    Gear^.Tex := RenderStringTex(ansistring(trmsg[sidUnknownGearValue]), $ff80ff80, fnt16)
+                    Gear^.Tex := RenderStringTex(trmsg[sidUnknownGearValue], $ff80ff80, fnt16)
                 end;
             end;
         if Gear^.Timer = 500 then
--- a/hedgewars/uSound.pas	Sat May 04 21:03:26 2019 +0200
+++ b/hedgewars/uSound.pas	Sat May 04 21:37:22 2019 +0200
@@ -380,6 +380,7 @@
 procedure InitSound;
 const channels: LongInt = 2;
 var success: boolean;
+    s: shortstring;
 begin
     if not (isSoundEnabled or isMusicEnabled) then
         begin
@@ -412,7 +413,8 @@
 
     if (Mix_Init(MIX_INIT_OGG or MIX_INIT_OPUS) and MIX_INIT_OPUS) = 0 then
     begin
-      WriteToConsole('Cannot init OPUS: ' + SDL_GetError());
+      s:= SDL_GetError();
+      WriteToConsole('Cannot init OPUS: ' + s);
 
       if SDLCheck(Mix_Init(MIX_INIT_OGG) <> 0, 'Mix_Init', true) then exit;
     end;