Skip to content

Commit 339940b

Browse files
committed
[global] fixed some warnings & hints
1 parent f5c6545 commit 339940b

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

Quick.JSON.Utils.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class function TJsonUtils.JsonFormat(const json : string) : string;
9999
'{','[' :
100100
begin
101101
LIndent := LIndent + INDENT;
102-
if json[i+1] in ['}',']'] then Result := Result + c
102+
if (json[i+1] = '}') or (json[i+1] = ']') then Result := Result + c
103103
else Result := Result + c + sLineBreak + LIndent;
104104
isEOL := True;
105105
end;
@@ -113,7 +113,7 @@ class function TJsonUtils.JsonFormat(const json : string) : string;
113113
Delete(LIndent, 1, Length(INDENT));
114114
if not isEOL then Result := Result + sLineBreak ;
115115
if (i<json.Length) and (json[i+1] = ',') then Result := Result + LIndent + c
116-
else if json[i-1] in ['{','['] then Result := Result + c + sLineBreak
116+
else if (json[i-1] = '}') or (json[i-1] = ']') then Result := Result + c + sLineBreak
117117
else Result := Result + LIndent + c + sLineBreak ;
118118
isEOL := True;
119119
end;

Quick.SMTP.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ function TSMTP.SendMail(aMail : TMailMessage) : Boolean;
244244
Result := False;
245245
SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
246246
try
247+
idattach := nil;
248+
mBody := nil;
247249
msg := TIdMessage.Create(nil);
248250
try
249251
//create mail msg
250-
idattach := nil;
251-
mBody := nil;
252252
msg.From.Address := aMail.From;
253253
if aMail.SenderName <> '' then msg.From.Name := aMail.SenderName;
254254
msg.Subject := aMail.Subject;

QuickLib.inc

+11-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@
2121
***************************************************************************
2222
}
2323

24-
{$ifdef QUICK_WARNOFF}
25-
{$WARNINGS OFF}
26-
{$endif}
27-
28-
{$ifdef QUICK_HINTSOFF}
29-
{$HINTS OFF}
30-
{$endif}
31-
3224
{$ifdef FPC}
3325
{$MODE DELPHI}
3426

@@ -183,4 +175,15 @@
183175
{.$DEFINE DEBUG_REDIS}
184176
{$ENDIF}
185177

178+
{.$DEFINE QUICK_HINTSOFF}
179+
{.$DEFINE QUICK_WARNOFF}
180+
181+
{$ifdef QUICK_HINTSOFF}
182+
{$HINTS OFF}
183+
{$endif}
184+
185+
{$ifdef QUICK_WARNOFF}
186+
{$WARNINGS OFF}
187+
{$endif}
188+
186189

0 commit comments

Comments
 (0)