Ignore:
Timestamp:
Apr 17, 2019, 10:42:18 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Updated Graphics32 library.
Location:
GraphicTest/Packages/Graphics32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/Packages/Graphics32

    • Property svn:ignore set to
      lib
  • GraphicTest/Packages/Graphics32/GR32_Containers.pas

    r450 r522  
    4040uses
    4141{$IFDEF FPC}
    42   Types,
    4342  {$IFDEF Windows}
    4443  Windows,
     44  {$ELSE}
     45  Types,
    4546  {$ENDIF}
    4647{$ELSE}
    47   Windows,
     48  Types, Windows,
    4849{$ENDIF}
    4950  RTLConsts,
    50   GR32, SysUtils, GR32_LowLevel, Classes, TypInfo;
     51  GR32, SysUtils, Classes, TypInfo;
    5152
    5253const
     
    180181    function First: TClass;
    181182    function Last: TClass;
    182     function Find(AClassName: string): TClass;
     183    function Find(const AClassName: string): TClass;
    183184    procedure GetClassNames(Strings: TStrings);
    184185    procedure Insert(Index: Integer; AClass: TClass);
     
    231232implementation
    232233
     234uses
     235  GR32_LowLevel;
     236
    233237procedure SmartAssign(Src, Dst: TPersistent; TypeKinds: TTypeKinds = tkProperties);
    234238var
     
    247251    Count := GetPropList(Src.ClassInfo, TypeKinds, Props, False);
    248252
     253    {$IFNDEF NEXTGEN}
    249254    for I := 0 to Count - 1 do
    250255    with Props^[I]^ do
     
    262267        SetPropValue(Dst, string(Name), GetPropValue(Src, string(Name), True));
    263268    end;
     269    {$ENDIF}
    264270  finally
    265271    FreeMem(Props, Count * SizeOf(PPropInfo));
     
    422428  I: Integer;
    423429begin
     430{$IFDEF HAS_NATIVEINT}
     431  BucketIndex := NativeUInt(Item) shr 8 and BUCKET_MASK; // KISS pointer hash(TM)
     432{$ELSE}
    424433  BucketIndex := Cardinal(Item) shr 8 and BUCKET_MASK; // KISS pointer hash(TM)
     434{$ENDIF}
    425435  // due to their randomness, pointers most commonly differ at byte 1, we use
    426436  // this characteristic for our hash and just apply the mask to it.
     
    444454begin
    445455  if not Exists(Item, BucketIndex, ItemIndex) then
     456{$IFDEF FPC}
     457    raise EListError.CreateFmt(SItemNotFound, [Item])
     458{$ELSE}
     459{$IFDEF HAS_NATIVEINT}
     460    raise EListError.CreateFmt(SItemNotFound, [NativeInt(Item)])
     461{$ELSE}
    446462    raise EListError.CreateFmt(SItemNotFound, [Integer(Item)])
     463{$ENDIF}
     464{$ENDIF}
    447465  else
    448466    Result := FBuckets[BucketIndex].Items[ItemIndex].Data;
     
    454472begin
    455473  if not Exists(Item, BucketIndex, ItemIndex) then
     474{$IFDEF FPC}
     475    raise EListError.CreateFmt(SItemNotFound, [Item])
     476{$ELSE}
     477{$IFDEF HAS_NATIVEINT}
     478    raise EListError.CreateFmt(SItemNotFound, [NativeInt(Item)])
     479{$ELSE}
    456480    raise EListError.CreateFmt(SItemNotFound, [Integer(Item)])
     481{$ENDIF}
     482{$ENDIF}
    457483  else
    458484    FBuckets[BucketIndex].Items[ItemIndex].Data := Data;
     
    644670end;
    645671
    646 function TClassList.Find(AClassName: string): TClass;
     672function TClassList.Find(const AClassName: string): TClass;
    647673var
    648674  I: Integer;
Note: See TracChangeset for help on using the changeset viewer.