From c599eba727ff59aba06b81ca774444dba462cc90 Mon Sep 17 00:00:00 2001 From: gstamac Date: Wed, 16 Aug 2017 15:43:54 +0200 Subject: [PATCH 1/2] fixed annoying compiler typecast warning --- src/RestJsonUtils.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/RestJsonUtils.pas b/src/RestJsonUtils.pas index f46a587..dfbbc13 100644 --- a/src/RestJsonUtils.pas +++ b/src/RestJsonUtils.pas @@ -30,7 +30,7 @@ TJsonUtil = class function JavaToDelphiDateTime(const dt: int64): TDateTime; function DelphiToJavaDateTime(const dt: TDateTime): int64; function ISO8601DateToJavaDateTime(const str: String; var ms: Int64): Boolean; -function ISO8601DateToDelphiDateTime(const str: string; var dt: TDateTime): Boolean; +function ISO8601DateToDelphiDateTime(const str: String; var dt: TDateTime): Boolean; function DelphiDateTimeToISO8601Date(dt: TDateTime): string; implementation @@ -356,9 +356,11 @@ TDateTimeInfo = record {$IFNDEF UNICODE} PSOChar = PWideChar; SOChar = WideChar; + SOString = WideString; {$ELSE} SOChar = Char; PSOChar = PChar; + SOString = String; {$ENDIF} var @@ -968,7 +970,7 @@ TDateTimeInfo = record Result := False; end; -function ISO8601DateToDelphiDateTime(const str: string; var dt: TDateTime): Boolean; +function ISO8601DateToDelphiDateTime(const str: String; var dt: TDateTime): Boolean; var ms: Int64; begin From 6149a53edcaf2170a862826a38d3db662f08a761 Mon Sep 17 00:00:00 2001 From: gstamac Date: Wed, 16 Aug 2017 15:45:58 +0200 Subject: [PATCH 2/2] fixed annoying compiler typecast warning --- src/RestJsonUtils.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RestJsonUtils.pas b/src/RestJsonUtils.pas index dfbbc13..75c6863 100644 --- a/src/RestJsonUtils.pas +++ b/src/RestJsonUtils.pas @@ -385,7 +385,7 @@ TDateTimeInfo = record label error; begin - p := PSOChar(str); + p := PSOChar(SOString(str)); sep := perhaps; state := stStart; pos := 0;