Changeset 72 for trunk/Packages


Ignore:
Timestamp:
Mar 6, 2016, 12:10:38 AM (9 years ago)
Author:
chronos
Message:
  • Modified: Built with FPC 3.0.0. Fixed various compiler messages.
Location:
trunk/Packages
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Common.lpk

    r61 r72  
    44    <PathDelim Value="\"/>
    55    <Name Value="Common"/>
     6    <Type Value="RunAndDesignTime"/>
    67    <AddToProjectUsesSection Value="True"/>
    78    <Author Value="Chronos (robie@centrum.cz)"/>
     
    1213        <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
    1314      </SearchPaths>
     15      <Other>
     16        <CompilerMessages>
     17          <IgnoredMessages idx5024="True"/>
     18        </CompilerMessages>
     19      </Other>
    1420    </CompilerOptions>
    1521    <Description Value="Various libraries"/>
     
    110116      <OutDir Value="Languages"/>
    111117    </i18n>
    112     <Type Value="RunAndDesignTime"/>
    113118    <RequiredPkgs Count="2">
    114119      <Item1>
  • trunk/Packages/Common/Common.pas

    r61 r72  
    55unit Common;
    66
     7{$warn 5023 off : no warning about unused units}
    78interface
    89
  • trunk/Packages/Common/UApplicationInfo.pas

    r59 r72  
    66
    77uses
    8   SysUtils, Registry, Classes, Forms, URegistry;
     8  SysUtils, Classes, Forms, URegistry;
    99
    1010type
  • trunk/Packages/Common/UCommon.pas

    r59 r72  
    88  {$IFDEF Windows}Windows,{$ENDIF}
    99  Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf,
    10   FileUtil; //, ShFolder, ShellAPI;
     10  FileUtil, LazFileUtils; //, ShFolder, ShellAPI;
    1111
    1212type
     
    9191  I: Integer;
    9292begin
     93  Result := '';
    9394  for I := 1 to Length(Source) do begin
    9495    Result := Result + LowerCase(IntToHex(Ord(Source[I]), 2));
     
    105106  Path := IncludeTrailingPathDelimiter(APath);
    106107
    107   Find := FindFirst(UTF8Decode(Path + AFileSpec), faAnyFile xor faDirectory, SearchRec);
     108  Find := FindFirst(Path + AFileSpec, faAnyFile xor faDirectory, SearchRec);
    108109  while Find = 0 do begin
    109     DeleteFileUTF8(Path + UTF8Encode(SearchRec.Name));
     110    DeleteFileUTF8(Path + SearchRec.Name);
    110111
    111112    Find := SysUtils.FindNext(SearchRec);
     
    416417
    417418procedure OpenWebPage(URL: string);
    418 var
    419   Process: TProcess;
    420   Browser, Params: string;
    421419begin
    422420  OpenURL(URL);
    423   {try
    424     Process := TProcess.Create(nil);
    425     Browser := '';
    426     //FindDefaultBrowser(Browser, Params);
    427     //Process.Executable := Browser;
    428     //Process.Parameters.Add(Format(Params, [ApplicationInfo.HomePage]);
    429     Process.CommandLine := 'cmd.exe /c start ' + URL;
    430     Process.Options := [poNoConsole];
    431     Process.Execute;
    432   finally
    433     Process.Free;
    434   end;}
    435421end;
    436422
  • trunk/Packages/Common/UDebugLog.pas

    r59 r72  
    66
    77uses
    8   Classes, SysUtils, FileUtil, SpecializedList, SyncObjs;
     8  Classes, SysUtils, FileUtil, SpecializedList, SyncObjs, LazFileUtils;
    99
    1010type
     
    104104    if ExtractFileDir(FileName) <> '' then
    105105      ForceDirectoriesUTF8(ExtractFileDir(FileName));
    106     if FileExistsUTF8(FileName) then LogFile := TFileStream.Create(UTF8Decode(FileName), fmOpenWrite)
    107       else LogFile := TFileStream.Create(UTF8Decode(FileName), fmCreate);
     106    if FileExistsUTF8(FileName) then LogFile := TFileStream.Create(FileName, fmOpenWrite)
     107      else LogFile := TFileStream.Create(FileName, fmCreate);
    108108    LogFile.Seek(0, soFromEnd);
    109109    Text := FormatDateTime('hh:nn:ss.zzz', Now) + ': ' + Text + LineEnding;
  • trunk/Packages/Common/UFindFile.pas

    r59 r72  
    2424
    2525uses
    26   SysUtils, Classes, Graphics, Controls, Forms, Dialogs, FileCtrl;
     26  SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
    2727
    2828type
     
    116116  if ffaAnyFile in FileAttr then Attr := Attr + faAnyFile;
    117117
    118   if SysUtils.FindFirst(UTF8Decode(inPath + FileMask), Attr, Rec) = 0 then
     118  if SysUtils.FindFirst(inPath + FileMask, Attr, Rec) = 0 then
    119119  try
    120120    repeat
     
    127127  If not InSubFolders then Exit;
    128128
    129   if SysUtils.FindFirst(UTF8Decode(inPath + '*.*'), faDirectory, Rec) = 0 then
     129  if SysUtils.FindFirst(inPath + '*.*', faDirectory, Rec) = 0 then
    130130  try
    131131    repeat
  • trunk/Packages/Common/ULastOpenedList.pas

    r59 r72  
    139139    OpenKey(Context.Key, True);
    140140    for I := 0 to Items.Count - 1 do
    141       WriteString('File' + IntToStr(I), UTF8Decode(Items[I]));
     141      WriteString('File' + IntToStr(I), Items[I]);
    142142  finally
    143143    Free;
  • trunk/Packages/Common/UListViewSort.pas

    r59 r72  
    119119var
    120120  I: Integer;
    121   NewColumn: TGridColumn;
    122121begin
    123122  with FStringGrid1 do begin
    124123    Columns.Clear;
    125124    while Columns.Count > ListView.Columns.Count do Columns.Delete(Columns.Count - 1);
    126     while Columns.Count < ListView.Columns.Count do NewColumn := Columns.Add;
     125    while Columns.Count < ListView.Columns.Count do Columns.Add;
    127126    for I := 0 to ListView.Columns.Count - 1 do begin
    128127      Columns[I].Width := ListView.Columns[I].Width;
  • trunk/Packages/Common/UScaleDPI.pas

    r61 r72  
    2727    function ScaleX(Size: Integer; FromDPI: Integer): Integer;
    2828    function ScaleY(Size: Integer; FromDPI: Integer): Integer;
    29     constructor Create(AOwner: TComponent);
     29    constructor Create(AOwner: TComponent); override;
    3030  published
    3131    property AutoDetect: Boolean read FAutoDetect write SetAutoDetect;
  • trunk/Packages/Common/UURI.pas

    r59 r72  
    8989function LeftCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean;
    9090var
    91   I, J: Integer;
     91  I: Integer;
    9292  Matched: Boolean;
    9393begin
     
    113113function RightCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean;
    114114var
    115   I, J: Integer;
     115  I: Integer;
    116116  Matched: Boolean;
    117117begin
     
    202202
    203203procedure TURI.SetAsString(Value: string);
    204 var
    205   HostAddr: string;
    206   HostPort: string;
    207204begin
    208205  LeftCutString(Value, Scheme, ':');
  • trunk/Packages/Common/UXMLUtils.pas

    r54 r72  
    1010
    1111function XMLTimeToDateTime(XMLDateTime: string): TDateTime;
    12 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): WideString;
     12function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): string;
    1313
    1414
     
    3535function LeftCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean;
    3636var
    37   I, J: Integer;
     37  I: Integer;
    3838  Matched: Boolean;
    3939begin
     
    106106end;
    107107
    108 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): WideString;
     108function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): string;
    109109const
    110110  Neg: array[Boolean] of string =  ('+', '-');
  • trunk/Packages/CoolTranslator/CoolTranslator.pas

    r54 r72  
    33 }
    44
    5 unit CoolTranslator; 
     5unit CoolTranslator;
    66
     7{$warn 5023 off : no warning about unused units}
    78interface
    89
     
    1213implementation
    1314
    14 procedure Register; 
     15procedure Register;
    1516begin
    16   RegisterUnit('UCoolTranslator', @UCoolTranslator.Register); 
    17 end; 
     17  RegisterUnit('UCoolTranslator', @UCoolTranslator.Register);
     18end;
    1819
    1920initialization
    20   RegisterPackage('CoolTranslator', @Register); 
     21  RegisterPackage('CoolTranslator', @Register);
    2122end.
  • trunk/Packages/CoolTranslator/UCoolTranslator.pas

    r54 r72  
    66
    77uses
    8   Classes, SysUtils, Forms, StdCtrls, ExtCtrls, StrUtils, Controls, Contnrs,
    9   Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType;
     8  Classes, SysUtils, Forms, ExtCtrls, Controls, Contnrs,
     9  Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType,
     10  LazFileUtils, LazUTF8;
    1011
    1112type
     
    190191  PropInfo: PPropInfo;
    191192  PropList: PPropList;
    192   Excludes: TComponentExcludes;
    193193begin
    194194  Count := GetTypeData(Component.ClassInfo)^.PropCount;
     
    223223var
    224224  PropType: PTypeInfo;
    225   Parent: TObject;
    226225  Obj: TObject;
    227226  I: Integer;
     
    244243          if (UpperCase(PropType.Name) = 'TTRANSLATESTRING') then
    245244          //if not IsExcluded(Component, PropInfo^.Name) then
    246               SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, GetWideStrProp(Component, PropInfo)));
     245              SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, GetStrProp(Component, PropInfo)));
    247246        end;
    248247        tkClass: begin
     
    382381  T: string;
    383382begin
     383  T := '';
     384
    384385  // Win32 user may decide to override locale with LANG variable.
    385386  Lang := GetEnvironmentVariableUTF8('LANG');
     
    396397  end;
    397398  if Lang = '' then
    398     LCLGetLanguageIDs(Lang, T);
     399    LazGetLanguageIDs(Lang, T);
    399400
    400401  if Assigned(Language) and (Language.Code = '') and Assigned(FOnAutomaticLanguage) then begin
     
    414415function TCoolTranslator.FindLocaleFileName(LCExt: string): string;
    415416var
    416   T: string;
    417   I: Integer;
    418417  Lang: string;
    419418begin
  • trunk/Packages/TemplateGenerics/Additional/UBinarySerializer.pas

    r54 r72  
    6565  StringLength: Longint;
    6666begin
     67  StringLength  := 0;
    6768  FStream.ReadBuffer(StringLength, SizeOf(StringLength));
    6869  Result := ReadString(StringLength);
     
    9495function TBinarySerializer.ReadByte: Byte;
    9596begin
     97  Result := 0;
    9698  FStream.ReadBuffer(Result, SizeOf(Byte));
    9799end;
     
    99101function TBinarySerializer.ReadCardinal: Cardinal;
    100102begin
     103  Result := 0;
    101104  FStream.ReadBuffer(Result, SizeOf(Cardinal));
    102105  if SwapData then Result := SwapEndian(Result);
     
    105108function TBinarySerializer.ReadInt64: Int64;
    106109begin
     110  Result := 0;
    107111  FStream.ReadBuffer(Result, SizeOf(Int64));
    108112  if SwapData then Result := SwapEndian(Result);
     
    121125  Count: Byte;
    122126begin
     127  Count := 0;
    123128  FStream.ReadBuffer(Count, 1);
    124129  Result := ReadString(Count);
     
    206211function TBinarySerializer.ReadDouble: Double;
    207212begin
     213  Result := 0;
    208214  FStream.ReadBuffer(Result, SizeOf(Double));
    209215end;
     
    211217function TBinarySerializer.ReadSingle: Single;
    212218begin
     219  Result := 0;
    213220  FStream.ReadBuffer(Result, SizeOf(Single));
    214221end;
     
    216223function TBinarySerializer.ReadWord: Word;
    217224begin
     225  Result := 0;
    218226  FStream.ReadBuffer(Result, SizeOf(Word));
    219227  if SwapData then Result := SwapEndian(Result);
     
    262270procedure TBinarySerializer.WriteByte(Data: Byte);
    263271begin
     272  Data := 0;
    264273  FStream.WriteBuffer(Data, SizeOf(Byte));
    265274end;
  • trunk/Packages/TemplateGenerics/Generic/GenericMatrix.inc

    r54 r72  
    4949    function Implode(RowSeparator, ColSeparator: string; Converter: TGMatrixToStringConverter): string;
    5050    procedure Explode(Text, Separator: string; Converter: TGMatrixFromStringConverter; SlicesCount: Integer = -1);
    51     function IndexOf(Item: TGMatrixItem; Start: TGMatrixIndex = 0): TGMatrixIndex;
    52     function IndexOfList(List: TGMatrix; Start: TGMatrixIndex = 0): TGMatrixIndex;
     51    function IndexOf(Item: TGMatrixItem; Start: TGMatrixIndex): TGMatrixIndex;
     52    function IndexOfList(List: TGMatrix; Start: TGMatrixIndex): TGMatrixIndex;
    5353    procedure Insert(Index: TGMatrixIndex; Item: TGMatrixItem);
    5454    procedure InsertList(Index: TGMatrixIndex; List: TGMatrix);
  • trunk/Packages/TemplateGenerics/TemplateGenerics.lpk

    r54 r72  
    1 <?xml version="1.0"?>
     1<?xml version="1.0" encoding="UTF-8"?>
    22<CONFIG>
    33  <Package Version="4">
    44    <PathDelim Value="\"/>
    55    <Name Value="TemplateGenerics"/>
     6    <Type Value="RunAndDesignTime"/>
    67    <AddToProjectUsesSection Value="True"/>
    78    <Author Value="Chronos (robie@centrum.cz)"/>
     
    1617      <CodeGeneration>
    1718        <Optimizations>
     19          <OptimizationLevel Value="3"/>
    1820          <VariablesInRegisters Value="True"/>
    19           <OptimizationLevel Value="3"/>
    2021        </Optimizations>
    2122      </CodeGeneration>
    2223      <Other>
    2324        <CompilerMessages>
    24           <UseMsgFile Value="True"/>
     25          <IgnoredMessages idx5024="True"/>
    2526        </CompilerMessages>
    26         <CompilerPath Value="$(CompPath)"/>
    2727      </Other>
    2828    </CompilerOptions>
     
    139139      </Item27>
    140140    </Files>
    141     <Type Value="RunAndDesignTime"/>
    142141    <RequiredPkgs Count="2">
    143142      <Item1>
  • trunk/Packages/TemplateGenerics/TemplateGenerics.pas

    r54 r72  
    55unit TemplateGenerics;
    66
     7{$warn 5023 off : no warning about unused units}
    78interface
    89
Note: See TracChangeset for help on using the changeset viewer.