Browse Source

[global] fixed some warnings & hints

Exilon 3 years ago
parent
commit
339940b39a
3 changed files with 15 additions and 12 deletions
  1. 2 2
      Quick.JSON.Utils.pas
  2. 2 2
      Quick.SMTP.pas
  3. 11 8
      QuickLib.inc

+ 2 - 2
Quick.JSON.Utils.pas

@@ -99,7 +99,7 @@ begin
         '{','[' :
           begin
             LIndent := LIndent + INDENT;
-            if json[i+1] in ['}',']'] then Result := Result + c
+            if (json[i+1] = '}') or (json[i+1] = ']') then Result := Result + c
               else Result := Result + c + sLineBreak  + LIndent;
             isEOL := True;
           end;
@@ -113,7 +113,7 @@ begin
             Delete(LIndent, 1, Length(INDENT));
             if not isEOL then Result := Result + sLineBreak ;
             if (i<json.Length) and (json[i+1] = ',') then Result := Result + LIndent + c
-              else if json[i-1] in ['{','['] then Result := Result + c + sLineBreak
+              else if (json[i-1] = '}') or (json[i-1] = ']') then Result := Result + c + sLineBreak
                 else Result := Result + LIndent + c + sLineBreak ;
             isEOL := True;
           end;

+ 2 - 2
Quick.SMTP.pas

@@ -244,11 +244,11 @@ begin
   Result := False;
   SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
   try
+    idattach := nil;
+    mBody := nil;
     msg := TIdMessage.Create(nil);
     try
       //create mail msg
-      idattach := nil;
-      mBody := nil;
       msg.From.Address := aMail.From;
       if aMail.SenderName <> '' then msg.From.Name := aMail.SenderName;
       msg.Subject := aMail.Subject;

+ 11 - 8
QuickLib.inc

@@ -21,14 +21,6 @@
      ***************************************************************************
 }
 
-{$ifdef QUICK_WARNOFF}
-	{$WARNINGS OFF}
-{$endif}
-
-{$ifdef QUICK_HINTSOFF}
-	{$HINTS OFF}
-{$endif}
-
 {$ifdef FPC}
   {$MODE DELPHI}
 
@@ -183,4 +175,15 @@
   {.$DEFINE DEBUG_REDIS}
 {$ENDIF}
 
+{.$DEFINE QUICK_HINTSOFF}
+{.$DEFINE QUICK_WARNOFF}
+
+{$ifdef QUICK_HINTSOFF}
+	{$HINTS OFF}
+{$endif}
+
+{$ifdef QUICK_WARNOFF}
+	{$WARNINGS OFF}
+{$endif}
+