+ Patch from Dean Zobec to change Int64 to longword in tfphashtable.

git-svn-id: trunk@4753 -
This commit is contained in:
michael 2006-09-29 22:18:05 +00:00
parent 262f60e67d
commit 728b4bcf11

View File

@ -208,15 +208,15 @@ Type
FHashTable: TFPObjectList; FHashTable: TFPObjectList;
FHashTableSize: Longword; FHashTableSize: Longword;
FHashFunction: THashFunction; FHashFunction: THashFunction;
FCount: Int64; FCount: Longword;
function GetDensity: Longword; function GetDensity: Longword;
function GetNumberOfCollisions: Int64; function GetNumberOfCollisions: Longword;
procedure SetHashTableSize(const Value: Longword); procedure SetHashTableSize(const Value: Longword);
procedure InitializeHashTable; procedure InitializeHashTable;
function GetVoidSlots: Longword; function GetVoidSlots: Longword;
function GetLoadFactor: double; function GetLoadFactor: double;
function GetAVGChainLen: double; function GetAVGChainLen: double;
function GetMaxChainLength: Int64; function GetMaxChainLength: Longword;
function Chain(const index: Longword):TFPObjectList; function Chain(const index: Longword):TFPObjectList;
protected protected
function ChainLength(const ChainIndex: Longword): Longword; virtual; function ChainLength(const ChainIndex: Longword): Longword; virtual;
@ -236,15 +236,15 @@ Type
function Find(const aKey: string): THTNode; function Find(const aKey: string): THTNode;
function IsEmpty: boolean; function IsEmpty: boolean;
property HashFunction: THashFunction read FHashFunction write SetHashFunction; property HashFunction: THashFunction read FHashFunction write SetHashFunction;
property Count: Int64 read FCount; property Count: Longword read FCount;
property HashTableSize: Longword read FHashTableSize write SetHashTableSize; property HashTableSize: Longword read FHashTableSize write SetHashTableSize;
property Items[const index: string]: Pointer read GetData write SetData; default; property Items[const index: string]: Pointer read GetData write SetData; default;
property HashTable: TFPObjectList read FHashTable; property HashTable: TFPObjectList read FHashTable;
property VoidSlots: Longword read GetVoidSlots; property VoidSlots: Longword read GetVoidSlots;
property LoadFactor: double read GetLoadFactor; property LoadFactor: double read GetLoadFactor;
property AVGChainLen: double read GetAVGChainLen; property AVGChainLen: double read GetAVGChainLen;
property MaxChainLength: Int64 read GetMaxChainLength; property MaxChainLength: Longword read GetMaxChainLength;
property NumberOfCollisions: Int64 read GetNumberOfCollisions; property NumberOfCollisions: Longword read GetNumberOfCollisions;
property Density: Longword read GetDensity; property Density: Longword read GetDensity;
end; end;
@ -894,7 +894,7 @@ begin
Result := FHashTableSize - VoidSlots Result := FHashTableSize - VoidSlots
end; end;
function TFPHashTable.GetNumberOfCollisions: Int64; function TFPHashTable.GetNumberOfCollisions: Longword;
begin begin
Result := FCount -(FHashTableSize - VoidSlots) Result := FCount -(FHashTableSize - VoidSlots)
end; end;
@ -1157,7 +1157,7 @@ begin
result := Count / (FHashTableSize - VoidSlots); result := Count / (FHashTableSize - VoidSlots);
end; end;
function TFPHashTable.GetMaxChainLength: Int64; function TFPHashTable.GetMaxChainLength: Longword;
var var
i: Longword; i: Longword;
begin begin