Browse Source

Small changes to chmbase. Changes parameter to const. Small formating changes.

git-svn-id: trunk@36912 -
andrew 8 years ago
parent
commit
9bff5e1d2f
1 changed files with 14 additions and 12 deletions
  1. 14 12
      packages/chm/src/chmbase.pas

+ 14 - 12
packages/chm/src/chmbase.pas

@@ -125,7 +125,7 @@ const
   function WriteCompressedInteger(Buffer: Pointer; ANumber: DWord): DWord;
   function WriteCompressedInteger(Buffer: Pointer; ANumber: DWord): DWord;
   
   
   // stupid needed function
   // stupid needed function
-  function ChmCompareText(S1, S2: String): Integer; inline;
+  function ChmCompareText(const S1, S2: String): Integer; inline;
 
 
 
 
 implementation
 implementation
@@ -137,18 +137,20 @@ var
   Sanity: Integer = 0;
   Sanity: Integer = 0;
 begin
 begin
   try
   try
-  temp := Stream.ReadByte;
-  while temp >= $80 do begin
-    total := total shl 7;
-    total := total + temp and $7f;
     temp := Stream.ReadByte;
     temp := Stream.ReadByte;
-    Inc(Sanity);
-    if Sanity > 8 then begin
-      Result := 0;
-      Exit;
+    while temp >= $80 do
+    begin
+      total := total shl 7;
+      total := total + temp and $7f;
+      temp := Stream.ReadByte;
+      Inc(Sanity);
+      if Sanity > 8 then
+      begin
+        Result := 0;
+        Exit;
+      end;
     end;
     end;
-  end;
-  Result := (total shl 7) + temp;
+    Result := (total shl 7) + temp;
   except
   except
     Result := 0;
     Result := 0;
   end;
   end;
@@ -200,7 +202,7 @@ begin
   {$endif}
   {$endif}
 end;
 end;
 
 
-function ChmCompareText(S1, S2: String): Integer; inline;
+function ChmCompareText(const S1, S2: String): Integer;
 begin
 begin
   // for our purposes the CompareText function will not work.
   // for our purposes the CompareText function will not work.
   Result := CompareStr(LowerCase(S1), Lowercase(S2));
   Result := CompareStr(LowerCase(S1), Lowercase(S2));