Browse Source

* Patch from Silvio Clecio to remove some hints/warnings

git-svn-id: trunk@33175 -
michael 9 years ago
parent
commit
94f8db4951
2 changed files with 9 additions and 18 deletions
  1. 0 13
      packages/fcl-pdf/examples/testfppdf.lpr
  2. 9 5
      packages/fcl-pdf/src/fpparsettf.pp

+ 0 - 13
packages/fcl-pdf/examples/testfppdf.lpr

@@ -43,19 +43,6 @@ begin
   end;
   end;
 end;
 end;
 
 
-Procedure EmptyPage;
-Var
-  D : TPDFDocument;
-begin
-  D:=SetupDocument;
-  try
-    SaveDocument(D);
-  finally
-    D.Free;
-  end;
-end;
-
-
 { all units of measure are in millimeters }
 { all units of measure are in millimeters }
 Procedure SimpleText(D: TPDFDocument; APage: integer);
 Procedure SimpleText(D: TPDFDocument; APage: integer);
 Var
 Var

+ 9 - 5
packages/fcl-pdf/src/fpparsettf.pp

@@ -765,7 +765,7 @@ begin
   S:=TMemoryStream.Create;
   S:=TMemoryStream.Create;
   try
   try
     // Speed up the process, read everything in a single mem block.
     // Speed up the process, read everything in a single mem block.
-    S.CopyFrom(AStream,FUnicodeMap.Length-4);
+    S.CopyFrom(AStream,Int64(FUnicodeMap.Length)-4);
     S.Position:=0;
     S.Position:=0;
     FUnicodeMap.LanguageID:=ReadUShort(S);
     FUnicodeMap.LanguageID:=ReadUShort(S);
     FUnicodeMap.SegmentCount2:=ReadUShort(S);            // 2 bytes - Segments count
     FUnicodeMap.SegmentCount2:=ReadUShort(S);            // 2 bytes - Segments count
@@ -828,19 +828,23 @@ var
   TableStartPos: LongWord;
   TableStartPos: LongWord;
   S : AnsiString;
   S : AnsiString;
   W : Widestring;
   W : Widestring;
-  FMT : Word;
   N : TNameRecord;
   N : TNameRecord;
   E : TNameEntries;
   E : TNameEntries;
   WA : Array of word;
   WA : Array of word;
 
 
 begin
 begin
   TableStartPos:= AStream.Position;                   // memorize Table start position
   TableStartPos:= AStream.Position;                   // memorize Table start position
-  Fmt:=ReadUShort(AStream);                  // skip 2 bytes - Format
+  ReadUShort(AStream);                  // skip 2 bytes - Format
   Count:=ReadUShort(AStream);                        // 2 bytes
   Count:=ReadUShort(AStream);                        // 2 bytes
   StringOffset:=ReadUShort(AStream);                 // 2 bytes
   StringOffset:=ReadUShort(AStream);                 // 2 bytes
   E := FNameEntries;
   E := FNameEntries;
   SetLength(E,Count);
   SetLength(E,Count);
   //  Read Descriptors
   //  Read Descriptors
+{$IFDEF VER3}  
+  N := Default(TNameRecord);
+{$ELSE}  
+  FillChar(N,SizeOf(TNameRecord),0)
+{$ENDIF}
   for I:=0 to Count-1 do
   for I:=0 to Count-1 do
   begin
   begin
     AStream.ReadBuffer(N,SizeOf(TNameRecord));
     AStream.ReadBuffer(N,SizeOf(TNameRecord));
@@ -855,7 +859,7 @@ begin
   //  Read Values
   //  Read Values
   for I:=0 to Count-1 do
   for I:=0 to Count-1 do
   begin
   begin
-    AStream.Position:=TableStartPos+StringOffset+E[i].Info.StringOffset;
+    AStream.Position:=Int64(TableStartPos)+StringOffset+E[i].Info.StringOffset;
     if E[i].Info.EncodingID=1 then
     if E[i].Info.EncodingID=1 then
     begin
     begin
       SetLength(WA,E[i].Info.StringLength div 2);
       SetLength(WA,E[i].Info.StringLength div 2);
@@ -863,7 +867,7 @@ begin
       AStream.Read(WA[0],SizeOf(Word)*Length(W));    // 1 byte
       AStream.Read(WA[0],SizeOf(Word)*Length(W));    // 1 byte
       For J:=0 to Length(WA)-1 do
       For J:=0 to Length(WA)-1 do
         W[J+1]:=WideChar(Beton(WA[J]));
         W[J+1]:=WideChar(Beton(WA[J]));
-      E[i].Value:=W;
+      E[i].Value:=string(W);
     end
     end
     else
     else
     begin
     begin