Skip to content

Commit a42fdae

Browse files
committed
[global] fixed more warnings & hints
1 parent e1b3f72 commit a42fdae

17 files changed

+289
-133
lines changed

Quick.Commons.pas

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{ ***************************************************************************
22
3-
Copyright (c) 2016-2021 Kike P�rez
3+
Copyright (c) 2016-2022 Kike P�rez
44
55
Unit : Quick.Commons
66
Description : Common functions
77
Author : Kike P�rez
88
Version : 2.0
99
Created : 14/07/2017
10-
Modified : 03/10/2021
10+
Modified : 19/01/2022
1111
1212
This file is part of QuickLib: https://github.com/exilon/QuickLib
1313
@@ -1042,7 +1042,11 @@ function GetLoggedUserName : string;
10421042
{$IFDEF POSIX}
10431043
try
10441044
plogin := getlogin;
1045+
{$IFDEF NEXTGEN}
1046+
Result := string(plogin);
1047+
{$ELSE}
10451048
Result := Copy(plogin,1,Length(Trim(plogin)));
1049+
{$ENDIF}
10461050
except
10471051
Result := 'N/A';
10481052
end;

Quick.Config.Base.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ TAppConfigProvider = class(TInterfacedObject,IAppConfigProvider)
5959
procedure Load(cConfig : TAppConfig); virtual; abstract;
6060
procedure Save(cConfig : TAppConfig); virtual; abstract;
6161
public
62-
constructor Create; virtual;
62+
constructor Create;
6363
property CreateIfNotExists : Boolean read fCreateIfNotExists write fCreateIfNotExists;
6464
property SerializeLevel : TSerializeProperty read fSerializeLevel write fSerializeLevel;
6565
property UseEnumNames : Boolean read fUseEnumNames write fUseEnumNames;
@@ -75,7 +75,7 @@ TAppConfig = class
7575
protected
7676
fProvider : TAppConfigProvider;
7777
public
78-
constructor Create(aConfigProvider : TAppConfigProvider); virtual;
78+
constructor Create(aConfigProvider : TAppConfigProvider);
7979
destructor Destroy; override;
8080
{$IFNDEF FPC}[TNotSerializableProperty]{$ENDIF}
8181
property OnApplyConfig : TApplyConfigEvent read fOnApplyConfig write fOnApplyConfig;

Quick.Config.YAML.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ TAppConfigYMALProvider = class(TAppConfigProvider)
7777
procedure Load(cConfig : TAppConfig); override;
7878
procedure Save(cConfig : TAppConfig); override;
7979
public
80-
constructor Create(const aFilename : string; aReloadIfFileChanged : Boolean = False); virtual;
80+
constructor Create(const aFilename : string; aReloadIfFileChanged : Boolean = False); overload;
8181
destructor Destroy; override;
8282
property Filename : string read fFilename write SetFileName;
8383
property ReloadIfFileChanged : Boolean read fReloadIfFileChanged write SetReloadIfFileChanged;
@@ -92,7 +92,7 @@ TAppConfigYAML = class(TAppConfig)
9292
function GetProvider : TAppConfigYMALProvider;
9393
procedure ReloadNotify;
9494
public
95-
constructor Create(const aFilename : string; aReloadIfFileChanged : Boolean = False); virtual;
95+
constructor Create(const aFilename : string; aReloadIfFileChanged : Boolean = False);
9696
destructor Destroy; override;
9797
property Provider : TAppConfigYMALProvider read GetProvider;
9898
function ToYAML : string;

Quick.Data.Redis.pas

+5-5
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ TRedisClient = class
110110
function Command(const aCommand, aArgumentsFormat : string; aValues : array of const) : IRedisResponse; overload;
111111
function Command(const aCommand : string) : IRedisResponse; overload;
112112
function EscapeString(const json: string) : string;
113-
function BulkString(const aValue : string) : string;
113+
//function BulkString(const aValue : string) : string;
114114
public
115115
constructor Create;
116116
destructor Destroy; override;
@@ -275,10 +275,10 @@ function TRedisClient.EscapeString(const json: string): string;
275275
//Result := StringReplace(Result,'/','\/"',[rfReplaceAll]);
276276
end;
277277

278-
function TRedisClient.BulkString(const aValue : string) : string;
279-
begin
280-
Result := Format('$%d%s%s%s',[aValue.Length,CRLF,aValue,CRLF]);
281-
end;
278+
//function TRedisClient.BulkString(const aValue : string) : string;
279+
//begin
280+
// Result := Format('$%d%s%s%s',[aValue.Length,CRLF,aValue,CRLF]);
281+
//end;
282282

283283
procedure TRedisClient.SetConnectionTimeout(const Value: Integer);
284284
begin

Quick.HttpServer.Response.pas

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ interface
6262
property ContentType : string read GetContentType write SetContentType;
6363
end;
6464

65+
{$M+}
6566
THttpResponse = class(TInterfacedObject,IHttpResponse)
6667
private
6768
fHeaders : TPairList;
@@ -94,6 +95,7 @@ THttpResponse = class(TInterfacedObject,IHttpResponse)
9495
property ContentText : string read GetContentText write SetContentText;
9596
property ContentType : string read GetContentType write SetContentType;
9697
end;
98+
{$M-}
9799

98100
implementation
99101

Quick.IOC.pas

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{ ***************************************************************************
22
3-
Copyright (c) 2016-2021 Kike Pérez
3+
Copyright (c) 2016-2022 Kike Pérez
44
55
Unit : Quick.IoC
66
Description : IoC Dependency Injector
77
Author : Kike Pérez
88
Version : 1.0
99
Created : 19/10/2019
10-
Modified : 07/02/2021
10+
Modified : 19/01/2022
1111
1212
This file is part of QuickLib: https://github.com/exilon/QuickLib
1313
@@ -185,7 +185,6 @@ TIocContainer = class(TInterfacedObject,IIocContainer)
185185
fResolver : TIocResolver;
186186
fInjector : TIocInjector;
187187
fLogger : ILogger;
188-
function InterfaceTypeInfo(const AGUID : TGUID) : PTypeInfo;
189188
class var
190189
GlobalInstance: TIocContainer;
191190
protected
@@ -334,23 +333,6 @@ destructor TIocContainer.Destroy;
334333
inherited;
335334
end;
336335

337-
function TIocContainer.InterfaceTypeInfo(const AGUID : TGUID) : PTypeInfo;
338-
var
339-
ctx : TRttiContext;
340-
rtype : TRttiType;
341-
rtypei : TRttiInterfaceType;
342-
begin
343-
for rtype in ctx.GetTypes do
344-
begin
345-
if rtype.TypeKind = TTypeKind.tkInterface then
346-
begin
347-
rtypei := (rtype as TRttiInterfaceType);
348-
if IsEqualGUID(rtypei.GUID,AGUID) then Exit(rtypei.Handle);
349-
end;
350-
end;
351-
Result := nil;
352-
end;
353-
354336
function TIocContainer.IsRegistered<TInterface, TImplementation>(const aName: string): Boolean;
355337
begin
356338
Result := fRegistrator.IsRegistered<TInterface,TImplementation>(aName);

Quick.Linq.pas

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{ ***************************************************************************
22
3-
Copyright (c) 2016-2019 Kike Pérez
3+
Copyright (c) 2016-2022 Kike Pérez
44
55
Unit : Quick.Linq
66
Description : Arrays and Generic Lists Linq functions
77
Author : Kike Pérez
88
Version : 1.0
99
Created : 04/04/2019
10-
Modified : 22/03/20120
10+
Modified : 19/01/2022
1111
1212
This file is part of QuickLib: https://github.com/exilon/QuickLib
1313
@@ -499,9 +499,9 @@ function TLinqQuery<T>.FormatParams(const aWhereClause : string; aWhereParams :
499499
vtAnsiString : Result := StringReplace(Result,'?',string(aWhereParams[i].VAnsiString),[]);
500500
vtWideString : Result := StringReplace(Result,'?',string(aWhereParams[i].VWideString^),[]);
501501
{$IFNDEF NEXTGEN}
502-
vtString : Result := StringReplace(Result,'?',aWhereParams[i].VString^,[]);
502+
vtString : Result := StringReplace(Result,'?',string(aWhereParams[i].VString^),[]);
503503
{$ENDIF}
504-
vtChar : Result := StringReplace(Result,'?',aWhereParams[i].VChar,[]);
504+
vtChar : Result := StringReplace(Result,'?',string(aWhereParams[i].VChar),[]);
505505
vtPChar : Result := StringReplace(Result,'?',string(aWhereParams[i].VPChar),[]);
506506
else Result := StringReplace(Result,'?', DbQuotedStr(string(aWhereParams[i].VUnicodeString)),[]);
507507
end;

Quick.Log.pas

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ interface
4949
{$ENDIF}
5050
{$IF Defined(NEXTGEN) OR Defined(LINUX) or Defined(MACOS)}
5151
syncObjs,
52+
Posix.Unistd,
5253
{$ENDIF}
5354
SysUtils;
5455

Quick.Logger.Intf.pas

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ TNullLogger = class(TInterfacedObject,ILogger)
8484
procedure &Except(const aMsg : string; aValues : array of const); overload;
8585
procedure &Except(const aMsg, aException, aStackTrace : string); overload;
8686
procedure &Except(const aMsg : string; aValues: array of const; const aException, aStackTrace: string); overload;
87+
procedure &Except(MsgObject : TObject); overload;
8788
end;
8889

8990
implementation
@@ -151,6 +152,11 @@ procedure TNullLogger.Critical(const aMsg: string);
151152

152153
end;
153154

155+
procedure TNullLogger.&Except(MsgObject: TObject);
156+
begin
157+
158+
end;
159+
154160
procedure TNullLogger.Critical(const aMsg: string; aParams: array of const);
155161
begin
156162

Quick.Options.Serializer.Json.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Author : Kike Pérez
88
Version : 1.0
99
Created : 18/10/2019
10-
Modified : 30/08/2021
10+
Modified : 15/12/2021
1111
1212
This file is part of QuickLib: https://github.com/exilon/QuickLib
1313

Quick.Options.Serializer.Yaml.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Author : Kike Pérez
88
Version : 1.0
99
Created : 18/10/2019
10-
Modified : 05/04/2020
10+
Modified : 15/12/2021
1111
1212
This file is part of QuickLib: https://github.com/exilon/QuickLib
1313

Quick.Parameters.pas

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ TColorizeHelp = class
123123
end;
124124
{$ENDIF}
125125

126+
{$M+}
126127
TParameters = class
127128
type
128129
TValueType = (vtString, vtInteger, vtFloat, vtBoolean, vtEnumeration);
@@ -188,6 +189,7 @@ TParam = class
188189
property Help : Boolean read fHelp write fHelp;
189190
function ExistsParam(const aParam : string): Boolean; overload;
190191
end;
192+
{$M-}
191193

192194
TServiceParameters = class(TParameters)
193195
private

0 commit comments

Comments
 (0)