You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2016/01/29 10:11:19 UTC

thrift git commit: THRIFT-3524 dcc32 warning "W1000 Symbol 'IsLowSurrogate' is deprecated: 'Use TCharHelper'" in Thrift.Protocol.JSON.pas Client: Delphi Patch: Jens Geyer

Repository: thrift
Updated Branches:
  refs/heads/master a9346a308 -> 710704328


THRIFT-3524 dcc32 warning "W1000 Symbol 'IsLowSurrogate' is deprecated: 'Use TCharHelper'" in Thrift.Protocol.JSON.pas
Client: Delphi
Patch: Jens Geyer


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/71070432
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/71070432
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/71070432

Branch: refs/heads/master
Commit: 710704328838e6c4e22e9638d729141be2d7daf8
Parents: a9346a3
Author: Jens Geyer <je...@apache.org>
Authored: Fri Jan 29 10:08:39 2016 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Fri Jan 29 10:10:47 2016 +0100

----------------------------------------------------------------------
 lib/delphi/src/Thrift.Protocol.JSON.pas |  4 ++--
 lib/delphi/src/Thrift.Utils.pas         | 32 +++++++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/71070432/lib/delphi/src/Thrift.Protocol.JSON.pas
----------------------------------------------------------------------
diff --git a/lib/delphi/src/Thrift.Protocol.JSON.pas b/lib/delphi/src/Thrift.Protocol.JSON.pas
index 36c3d72..896dfcc 100644
--- a/lib/delphi/src/Thrift.Protocol.JSON.pas
+++ b/lib/delphi/src/Thrift.Protocol.JSON.pas
@@ -868,12 +868,12 @@ begin
            +  HexVal(tmp[3]);
 
       // we need to make UTF8 bytes from it, to be decoded later
-      if Character.IsHighSurrogate(char(wch)) then begin
+      if CharUtils.IsHighSurrogate(char(wch)) then begin
         if highSurogate <> #0
         then raise TProtocolException.Create( TProtocolException.INVALID_DATA, 'Expected low surrogate char');
         highSurogate := char(wch);
       end
-      else if Character.IsLowSurrogate(char(wch)) then begin
+      else if CharUtils.IsLowSurrogate(char(wch)) then begin
         if highSurogate = #0
         then TProtocolException.Create( TProtocolException.INVALID_DATA, 'Expected high surrogate char');
         surrogatePairs[0] := highSurogate;

http://git-wip-us.apache.org/repos/asf/thrift/blob/71070432/lib/delphi/src/Thrift.Utils.pas
----------------------------------------------------------------------
diff --git a/lib/delphi/src/Thrift.Utils.pas b/lib/delphi/src/Thrift.Utils.pas
index 15ea36f..17131ef 100644
--- a/lib/delphi/src/Thrift.Utils.pas
+++ b/lib/delphi/src/Thrift.Utils.pas
@@ -22,7 +22,7 @@ unit Thrift.Utils;
 interface
 
 uses
-  Classes, Windows, SysUtils, SyncObjs;
+  Classes, Windows, SysUtils, Character, SyncObjs;
 
 type
   IOverlappedHelper = interface
@@ -56,6 +56,14 @@ type
   end;
 
 
+  CharUtils = class sealed
+  public
+    class function IsHighSurrogate( const c : Char) : Boolean; static; inline;
+    class function IsLowSurrogate( const c : Char) : Boolean; static; inline;
+  end;
+
+
+
 implementation
 
 { TOverlappedHelperImpl }
@@ -186,4 +194,26 @@ begin
 end;
 
 
+class function CharUtils.IsHighSurrogate( const c : Char) : Boolean;
+begin
+  {$IF RTLVersion  >= 28.0}  // XE7+
+  result := c.IsHighSurrogate();
+  {$ELSE}
+  result := Character.IsHighSurrogate( c);
+  {$IFEND}
+end;
+
+
+class function CharUtils.IsLowSurrogate( const c : Char) : Boolean;
+begin
+  {$IF RTLVersion  >= 28.0}  // XE7+
+  result := c.IsLowSurrogate();
+  {$ELSE}
+  result := Character.IsLowSurrogate( c);
+  {$IFEND}
+end;
+
+
+
+
 end.