lazutils: less hints

This commit is contained in:
mattias 2024-03-05 15:13:20 +01:00
parent 3ec604cc99
commit 7d3626f6d7
7 changed files with 45 additions and 42 deletions

View File

@ -12,7 +12,7 @@
The clipboard is able to work with the windows and gtk behaviour/features.
}
function DBCSToUTF8(const s: string; const ArrayUni, ArrayCP: array of word; CodeP: integer): string;
function DBCSToUTF8(const s: string; const {%H-}ArrayUni, ArrayCP: array of word; CodeP: integer): string;
const
cp936unodered:array[0..254] of Uint32=($a2ab,$a2ac,$a2ad,$a2ae,$a2af,$a2b0,$a2e3,$a2e4,$a2ef,$a2f0,$a2fd,$a2fe,$a4f4,$a4f5,$a4f6,$a4f7,$a4f8,$a4f9,$a4fa,$a4fb,$a4fc,$a4fd,$a4fe,$a5f7,$a5f8,$a5f9,$a5fa,$a5fb,$a5fc,$a5fd,$a5fe,$a6b9,$a6ba,$a6bb,$a6bc,$a6bd,$a6be,$a6bf,$a6c0,$a6d9,$a6da,$a6db,$a6dc,$a6dd,$a6de,$a6df,$a6ec,$a6ed,$a6f3,$a6f6,$a6f7,$a6f8,$a6f9,$a6fa,$a6fb,$a6fc,$a6fd,$a6fe,$a7c2,$a7c3,$a7c4,$a7c5,$a7c6,$a7c7,$a7c8,$a7c9,$a7ca,$a7cb,$a7cc,$a7cd,$a7ce,$a7cf,$a7d0,$a7f2,$a7f3,$a7f4,$a7f5,$a7f6,$a7f7,$a7f8,$a7f9,$a7fa,$a7fb,$a7fc,$a7fd,$a7fe,$a896,$a897,$a898,$a899,$a89a,$a89b,$a89c,$a89d,$a89e,$a89f,$a8a0,$a8bc,$a8bf,$a8c1,$a8c2,$a8c3,$a8c4,$a8ea,$a8eb,$a8ec,$a8ed,$a8ee,$a8ef,$a8f0,$a8f1,$a8f2,$a8f3,$a8f4,$a8f5,$a8f6,$a8f7,$a8f8,$a8f9,$a8fa,$a8fb,$a8fc,$a8fd,$a8fe,$a958,$a95b,$a95d,$a95e,$a95f,$a989,$a98a,$a98b,$a98c,$a98d,$a98e,$a98f,$a990,$a991,$a992,$a993,$a994,$a995,$a997,$a998,$a999,$a99a,$a99b,$a99c,$a99d,$a99e,$a99f,$a9a0,$a9a1,$a9a2,$a9a3,$a9f0,$a9f1,$a9f2,$a9f3,$a9f4,$a9f5,$a9f6,$a9f7,$a9f8,$a9f9,$a9fa,$a9fb,$a9fc,$a9fd,$a9fe,$d7fa,$d7fb,$d7fc,$d7fd,$d7fe,$fe50,$fe51,$fe52,$fe53,$fe54,$fe55,$fe56,$fe57,$fe58,$fe59,$fe5a,$fe5b,$fe5c,$fe5d,$fe5e,$fe5f,$fe60,$fe61,$fe62,$fe63,$fe64,$fe65,$fe66,$fe67,$fe68,$fe69,$fe6a,$fe6b,$fe6c,$fe6d,$fe6e,$fe6f,$fe70,$fe71,$fe72,$fe73,$fe74,$fe75,$fe76,$fe77,$fe78,$fe79,$fe7a,$fe7b,$fe7c,$fe7d,$fe7e,$fe80,$fe81,$fe82,$fe83,$fe84,$fe85,$fe86,$fe87,$fe88,$fe89,$fe8a,$fe8b,$fe8c,$fe8d,$fe8e,$fe8f,$fe90,$fe91,$fe92,$fe93,$fe94,$fe95,$fe96,$fe97,$fe98,$fe99,$fe9a,$fe9b,$fe9c,$fe9d,$fe9e,$fe9f,$fea0);
cp936unoderedstart:Uint32=$e766;

View File

@ -129,10 +129,10 @@ type
const AValue, DefValue: extended);
// Set/Enum/Named-Int
procedure SetValue(const APath: String; const AValue; const APTypeInfo: PTypeInfo);
procedure SetValue(const APath: String; const {%H-}AValue; const APTypeInfo: PTypeInfo);
procedure SetDeleteValue(const APath: String; const AValue, DefValue; const APTypeInfo: PTypeInfo);
procedure SetDeleteValue(const APath: String; const AValue; DefValue: Int64; const APTypeInfo: PTypeInfo);
procedure SetDeleteValue(const APath: String; const AValue; const APTypeInfo: PTypeInfo);
procedure SetDeleteValue(const APath: String; const {%H-}AValue; const APTypeInfo: PTypeInfo);
procedure DeletePath(const APath: string);
procedure DeleteValue(const APath: string);

View File

@ -133,7 +133,7 @@ type
Private
F : TStream;
Protected
Procedure Write(Const Buffer; Count : Longint);override;
Procedure Write(Const {%H-}Buffer; Count : Longint);override;
Public
constructor Create(AStream: TStream);
end;

View File

@ -71,7 +71,7 @@ type
procedure BeginProperty(const PropName: String); override;
procedure EndProperty; override;
procedure WriteBinary(const Buffer; Count: Longint); override;
procedure WriteBinary(const {%H-}Buffer; Count: Longint); override;
procedure WriteBoolean(Value: Boolean); override;
// procedure WriteChar(Value: Char);
procedure WriteFloat(const Value: Extended); override;

View File

@ -111,8 +111,8 @@ type
procedure DebuglnStack(const {%H-}s: string = '');
procedure DbgOut(const {%H-}s: string = ''); overload;
procedure DbgOut({%H-}const Args: array of const); overload;
procedure DbgOut(const {%H-}S: String; {%H-}const Args: array of const); overload;// similar to Format(s,Args)
procedure DbgOut({%H-}const {%H-}Args: array of const); overload;
procedure DbgOut(const {%H-}S: String; {%H-}const {%H-}Args: array of const); overload;// similar to Format(s,Args)
procedure DbgOut(const {%H-}s1, {%H-}s2: string; const {%H-}s3: string = '';
const {%H-}s4: string = ''; const {%H-}s5: string = ''; const {%H-}s6: string = '';
const {%H-}s7: string = ''; const {%H-}s8: string = ''; const {%H-}s9: string = '';
@ -121,8 +121,8 @@ type
const {%H-}s16: string = ''; const {%H-}s17: string = ''; const {%H-}s18: string = ''); overload;
procedure DebugLn(const {%H-}s: string = ''); overload;
procedure DebugLn({%H-}const Args: array of const); overload;
procedure DebugLn(const {%H-}S: String; {%H-}const Args: array of const); overload;// similar to Format(s,Args)
procedure DebugLn({%H-}const {%H-}Args: array of const); overload;
procedure DebugLn(const {%H-}S: String; {%H-}const {%H-}Args: array of const); overload;// similar to Format(s,Args)
procedure DebugLn(const {%H-}s1, {%H-}s2: string; const {%H-}s3: string = '';
const {%H-}s4: string = ''; const {%H-}s5: string = ''; const {%H-}s6: string = '';
const {%H-}s7: string = ''; const {%H-}s8: string = ''; const {%H-}s9: string = '';
@ -131,8 +131,8 @@ type
const {%H-}s16: string = ''; const {%H-}s17: string = ''; const {%H-}s18: string = ''); overload;
procedure DebugLnEnter(const {%H-}s: string = ''); overload;
procedure DebugLnEnter({%H-}const Args: array of const); overload;
procedure DebugLnEnter({%H-}s: string; {%H-}const Args: array of const); overload;
procedure DebugLnEnter({%H-}const {%H-}Args: array of const); overload;
procedure DebugLnEnter({%H-}s: string; {%H-}const {%H-}Args: array of const); overload;
procedure DebugLnEnter(const {%H-}s1, {%H-}s2: string; const {%H-}s3: string = '';
const {%H-}s4: string = ''; const {%H-}s5: string = ''; const {%H-}s6: string = '';
const {%H-}s7: string = ''; const {%H-}s8: string = ''; const {%H-}s9: string = '';
@ -141,8 +141,8 @@ type
const {%H-}s16: string = ''; const {%H-}s17: string = ''; const {%H-}s18: string = ''); overload;
procedure DebugLnExit(const {%H-}s: string = ''); overload;
procedure DebugLnExit({%H-}const Args: array of const); overload;
procedure DebugLnExit({%H-}s: string; {%H-}const Args: array of const); overload;
procedure DebugLnExit({%H-}const {%H-}Args: array of const); overload;
procedure DebugLnExit({%H-}s: string; {%H-}const {%H-}Args: array of const); overload;
procedure DebugLnExit(const {%H-}s1, {%H-}s2: string; const {%H-}s3: string = '';
const {%H-}s4: string = ''; const {%H-}s5: string = ''; const {%H-}s6: string = '';
const {%H-}s7: string = ''; const {%H-}s8: string = ''; const {%H-}s9: string = '';
@ -154,8 +154,8 @@ type
procedure DebuglnStack({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}s: string = '');
procedure DbgOut({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}s: string = ''); overload;
procedure DbgOut({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}const Args: array of const); overload;
procedure DbgOut({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}S: String; {%H-}const Args: array of const); overload;// similar to Format(s,Args)
procedure DbgOut({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}const {%H-}Args: array of const); overload;
procedure DbgOut({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}S: String; {%H-}const {%H-}Args: array of const); overload;// similar to Format(s,Args)
procedure DbgOut({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}s1, {%H-}s2: string; const {%H-}s3: string = '';
const {%H-}s4: string = ''; const {%H-}s5: string = ''; const {%H-}s6: string = '';
const {%H-}s7: string = ''; const {%H-}s8: string = ''; const {%H-}s9: string = '';
@ -164,8 +164,8 @@ type
const {%H-}s16: string = ''; const {%H-}s17: string = ''; const {%H-}s18: string = ''); overload;
procedure DebugLn({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}s: string = ''); overload;
procedure DebugLn({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}const Args: array of const); overload;
procedure DebugLn({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}S: String; {%H-}const Args: array of const); overload;// similar to Format(s,Args)
procedure DebugLn({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}const {%H-}Args: array of const); overload;
procedure DebugLn({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}S: String; {%H-}const {%H-}Args: array of const); overload;// similar to Format(s,Args)
procedure DebugLn({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}s1, {%H-}s2: string; const {%H-}s3: string = '';
const {%H-}s4: string = ''; const {%H-}s5: string = ''; const {%H-}s6: string = '';
const {%H-}s7: string = ''; const {%H-}s8: string = ''; const {%H-}s9: string = '';
@ -174,8 +174,8 @@ type
const {%H-}s16: string = ''; const {%H-}s17: string = ''; const {%H-}s18: string = ''); overload;
procedure DebugLnEnter({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}s: string = ''); overload;
procedure DebugLnEnter({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}const Args: array of const); overload;
procedure DebugLnEnter({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}s: string; {%H-}const Args: array of const); overload;
procedure DebugLnEnter({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}const {%H-}Args: array of const); overload;
procedure DebugLnEnter({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}s: string; {%H-}const {%H-}Args: array of const); overload;
procedure DebugLnEnter({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}s1, {%H-}s2: string; const {%H-}s3: string = '';
const {%H-}s4: string = ''; const {%H-}s5: string = ''; const {%H-}s6: string = '';
const {%H-}s7: string = ''; const {%H-}s8: string = ''; const {%H-}s9: string = '';
@ -184,8 +184,8 @@ type
const {%H-}s16: string = ''; const {%H-}s17: string = ''; const {%H-}s18: string = ''); overload;
procedure DebugLnExit({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}s: string = ''); overload;
procedure DebugLnExit({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}const Args: array of const); overload;
procedure DebugLnExit({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}s: string; {%H-}const Args: array of const); overload;
procedure DebugLnExit({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}const {%H-}Args: array of const); overload;
procedure DebugLnExit({%H-}LogEnabled: TLazLoggerLogEnabled; {%H-}s: string; {%H-}const {%H-}Args: array of const); overload;
procedure DebugLnExit({%H-}LogEnabled: TLazLoggerLogEnabled; const {%H-}s1, {%H-}s2: string; const {%H-}s3: string = '';
const {%H-}s4: string = ''; const {%H-}s5: string = ''; const {%H-}s6: string = '';
const {%H-}s7: string = ''; const {%H-}s8: string = ''; const {%H-}s9: string = '';

View File

@ -100,8 +100,8 @@ type
FLast: PMapItem; // Last element of our linkedlist
FIterators: TList; // A List of iterators iterating us
FLocked: integer;
function FindNode(const AId): TAvlTreeNode;
function FindItem(const AId): PMapItem;
function FindNode(const {%H-}AId): TAvlTreeNode;
function FindItem(const {%H-}AId): PMapItem;
procedure FreeData(ANode: TAvlTreeNode);
function TreeCompareID(Sender: TAvlTree; AItem1, AItem2: Pointer): Integer;
//--
@ -110,17 +110,17 @@ type
protected
procedure LockMap;
procedure UnLockMap;
procedure InternalAdd(const AId, AData);
procedure InternalAdd(const AId, {%H-}AData);
function InternalGetData(AItem: PMapItem; out AData): Boolean;
function InternalGetDataPtr(AItem: PMapItem): Pointer;
function InternalGetId(AItem: PMapItem; out AID): Boolean;
function InternalSetData(AItem: PMapItem; const AData): Boolean;
function InternalSetData(AItem: PMapItem; const {%H-}AData): Boolean;
procedure ReleaseData({%H-}ADataPtr: Pointer); virtual;
public
constructor Create(AIdType: TMapIdType; ADataSize: Cardinal);
procedure Clear;
function Count: SizeInt;
function Delete(const AId): Boolean;
function Delete(const {%H-}AId): Boolean;
destructor Destroy; override;
end;
@ -141,7 +141,7 @@ type
procedure AddToMap; virtual;
procedure RemoveFromMap; virtual;
procedure InternalCreate(AMap: TBaseMap);
function InternalLocate(const AId): Boolean; //True if match found. If not found, current is next and Invalid is set
function InternalLocate(const {%H-}AId): Boolean; //True if match found. If not found, current is next and Invalid is set
procedure Validate;
procedure ValidateMap;
property Current: PMapItem read FCurrent;
@ -163,11 +163,11 @@ type
private
protected
public
procedure Add(const AId, AData);
function HasId(const AID): Boolean;
function GetData(const AId; out AData): Boolean;
function GetDataPtr(const AId): Pointer;
function SetData(const AId, AData): Boolean;
procedure Add(const {%H-}AId, {%H-}AData);
function HasId(const {%H-}AID): Boolean;
function GetData(const {%H-}AId; out AData): Boolean;
function GetDataPtr(const {%H-}AId): Pointer;
function SetData(const {%H-}AId, {%H-}AData): Boolean;
end;
{ TMapIterator }
@ -180,8 +180,8 @@ type
function DataPtr: Pointer;
procedure GetData(out AData);
procedure GetID(out AID);
function Locate(const AId): Boolean;
procedure SetData(const AData);
function Locate(const {%H-}AId): Boolean;
procedure SetData(const {%H-}AData);
end;
{ TLockedMapIterator
@ -204,13 +204,13 @@ type
function InternalSetData(AItem: PMapItem; const AData): Boolean;
procedure ReleaseData(ADataPtr: Pointer); override;
public
procedure Add(const AId, AData);
procedure Add(const {%H-}AId, AData);
constructor Create(AIdType: TMapIdType; ATypeInfo: PTypeInfo);
destructor Destroy; override;
function HasId(const AID): Boolean;
function GetData(const AId; out AData): Boolean;
function GetDataPtr(const AId): Pointer;
function SetData(const AId, AData): Boolean;
function HasId(const {%H-}AID): Boolean;
function GetData(const {%H-}AId; out AData): Boolean;
function GetDataPtr(const {%H-}AId): Pointer;
function SetData(const {%H-}AId, {%H-}AData): Boolean;
end;
{ TTypedMapIterator }
@ -222,8 +222,8 @@ type
constructor Create(AMap: TTypedMap);
procedure GetData(out AData);
procedure GetID(out AID);
function Locate(const AId): Boolean;
procedure SetData(const AData);
function Locate(const {%H-}AId): Boolean;
procedure SetData(const {%H-}AData);
end;

View File

@ -17,7 +17,10 @@ interface
uses
Classes, SysUtils, Process,
FileUtil, LazFileUtils, LazUTF8, LazUtilsStrConsts;
{$IFDEF UseTProcessW}
LazUTF8,
{$ENDIF}
FileUtil, LazFileUtils, LazUtilsStrConsts;
{$IF DEFINED(MSWINDOWS) AND NOT DECLARED(poDetached)} // we need to work around the poNoConsole->poDetached change
// more info: issue #32055, #35991; FPC r45228, https://forum.lazarus.freepascal.org/index.php/topic,49631.0