Selaa lähdekoodia

- Remove redundant inttohex function.

git-svn-id: trunk@3483 -
daniel 19 vuotta sitten
vanhempi
commit
2341cae336
5 muutettua tiedostoa jossa 6 lisäystä ja 33 poistoa
  1. 1 3
      ide/fpini.pas
  2. 1 1
      ide/fpkeys.pas
  3. 1 1
      ide/fpsymbol.pas
  4. 0 25
      ide/wutils.pas
  5. 3 3
      ide/wwinhelp.pas

+ 1 - 3
ide/fpini.pas

@@ -209,9 +209,7 @@ var C: string;
 begin
 begin
   C:='';
   C:='';
   for I:=1 to length(S) do
   for I:=1 to length(S) do
-    begin
-      Insert('#$'+IntToHex(ord(S[I]),2),C,Length(C)+1);
-    end;
+    Insert('#$'+hexstr(ord(S[I]),2),C,Length(C)+1);
   PaletteToStr:=C;
   PaletteToStr:=C;
 end;
 end;
 
 

+ 1 - 1
ide/fpkeys.pas

@@ -287,7 +287,7 @@ begin
                       if (OldKey=WantedKeys[i]) and (i<>j) then
                       if (OldKey=WantedKeys[i]) and (i<>j) then
                         begin
                         begin
                           If ConfirmBox('"'+St+'" is used for'+#13+
                           If ConfirmBox('"'+St+'" is used for'+#13+
-                            'key $'+IntToHex(OldKey,4)+' '+WantedKeysLabels[i]+#13+
+                            'key $'+hexstr(oldKey,4)+' '+WantedKeysLabels[i]+#13+
                             'Change it to '+WantedKeysLabels[j],nil,true)=cmYes then
                             'Change it to '+WantedKeysLabels[j],nil,true)=cmYes then
                             begin
                             begin
                               KeyEscape[i]:='';
                               KeyEscape[i]:='';

+ 1 - 1
ide/fpsymbol.pas

@@ -1025,7 +1025,7 @@ function AddrStr(Addr: longint): string;
 type TLongint = record LoW,HiW: word; end;
 type TLongint = record LoW,HiW: word; end;
 begin
 begin
   with TLongint(Addr) do
   with TLongint(Addr) do
-  AddrStr:='$'+IntToHex(HiW,4)+IntToHex(LoW,4);
+  AddrStr:='$'+hexstr(HiW,4)+hexstr(LoW,4);
 end;
 end;
 begin
 begin
   ClearFormatParams;
   ClearFormatParams;

+ 0 - 25
ide/wutils.pas

@@ -146,7 +146,6 @@ function FloatToStr(D: Double; Decimals: byte): string;
 function FloatToStrL(D: Double; Decimals: byte; MinLen: byte): string;
 function FloatToStrL(D: Double; Decimals: byte; MinLen: byte): string;
 function HexToInt(S: string): longint;
 function HexToInt(S: string): longint;
 function HexToCard(S: string): cardinal;
 function HexToCard(S: string): cardinal;
-function IntToHex(L: longint; MinLen: integer): string;
 function GetStr(P: PString): string;
 function GetStr(P: PString): string;
 function GetPChar(P: PChar): string;
 function GetPChar(P: PChar): string;
 function BoolToStr(B: boolean; const TrueS, FalseS: string): string;
 function BoolToStr(B: boolean; const TrueS, FalseS: string): string;
@@ -504,30 +503,6 @@ begin
   HexToCard:=L;
   HexToCard:=L;
 end;
 end;
 
 
-function IntToHex(L: longint; MinLen: integer): string;
-const HexNums : string[16] = '0123456789ABCDEF';
-var S: string;
-    R: real;
-function DivF(Mit,Mivel: real): longint;
-begin
-  DivF:=trunc(Mit/Mivel);
-end;
-function ModF(Mit,Mivel: real): longint;
-begin
-  ModF:=trunc(Mit-DivF(Mit,Mivel)*Mivel);
-end;
-begin
-  S:='';
-  R:=L; if R<0 then begin R:=R+2147483647+2147483647+2; end;
-  repeat
-    Insert(HexNums[ModF(R,16)+1],S,1);
-    R:=DivF(R,16);
-  until R=0;
-  while length(S)<MinLen do
-    Insert('0',S,1);
-  IntToHex:=S;
-end;
-
 function FloatToStr(D: Double; Decimals: byte): string;
 function FloatToStr(D: Double; Decimals: byte): string;
 var S: string;
 var S: string;
     L: byte;
     L: byte;

+ 3 - 3
ide/wwinhelp.pas

@@ -1511,11 +1511,11 @@ begin
                     begin
                     begin
                       if LastEmittedChar<>ord(hscLineBreak) then
                       if LastEmittedChar<>ord(hscLineBreak) then
                         EmitText(hscLineBreak);
                         EmitText(hscLineBreak);
-                      EmitDebugText('[tag0x'+IntToHex(Cmd,2)+']');
+                      EmitDebugText('[tag0x'+hexstr(Cmd,2)+']');
                     end;
                     end;
               $80 : begin
               $80 : begin
                       FontNumber:=ReadSHORT;
                       FontNumber:=ReadSHORT;
-                      EmitDebugText('[font'+IntToStr(FontNumber)+']');
+                      EmitDebugText('[font'+inttostr(FontNumber)+']');
                     end;
                     end;
               $81 : {LineBreak}
               $81 : {LineBreak}
                     begin
                     begin
@@ -1614,7 +1614,7 @@ begin
                         AddLinkToTopic(T,ID,LinkOfs);
                         AddLinkToTopic(T,ID,LinkOfs);
                       end;
                       end;
                     end;
                     end;
-              else EmitDebugText('[tag0x'+IntToHex(Cmd,2)+']');
+              else EmitDebugText('[tag0x'+hexstr(Cmd,2)+']');
             end;
             end;
           end;
           end;
           if SLen>0 then
           if SLen>0 then