Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed annoying compiler typecast warning #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/RestJsonUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -356,9 +356,11 @@ TDateTimeInfo = record
{$IFNDEF UNICODE}
PSOChar = PWideChar;
SOChar = WideChar;
SOString = WideString;
{$ELSE}
SOChar = Char;
PSOChar = PChar;
SOString = String;
{$ENDIF}

var
Expand All @@ -383,7 +385,7 @@ TDateTimeInfo = record
label
error;
begin
p := PSOChar(str);
p := PSOChar(SOString(str));
sep := perhaps;
state := stStart;
pos := 0;
Expand Down Expand Up @@ -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
Expand Down