From e9e643934507ed2205cbbaf24dcadacf637a6072 Mon Sep 17 00:00:00 2001
From: sergei <gorelkin@nanoreflex.ru>
Date: Sat, 29 Aug 2009 18:11:08 +0000
Subject: [PATCH] * dom.pp: fixed one possible reason of crashing in Delphi
 2009 * xmlutils.pp: clean up

git-svn-id: trunk@13604 -
---
 packages/fcl-xml/src/dom.pp      |  2 +-
 packages/fcl-xml/src/xmlutils.pp | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/packages/fcl-xml/src/dom.pp b/packages/fcl-xml/src/dom.pp
index 6c1e3d0d27..f011e2eade 100644
--- a/packages/fcl-xml/src/dom.pp
+++ b/packages/fcl-xml/src/dom.pp
@@ -3217,7 +3217,7 @@ begin
     if Pointer(FCurrBlock) = Pointer(FCurrExtent) + sizeof(TExtent) then
       AddExtent(FCurrExtentSize * 2);
     Result := FCurrBlock;
-    Dec(PChar(FCurrBlock), FElementSize);
+    Dec(PAnsiChar(FCurrBlock), FElementSize);
   end;
   AClass.InitInstance(Result);
   Result.FPool := Self;        // mark as used
diff --git a/packages/fcl-xml/src/xmlutils.pp b/packages/fcl-xml/src/xmlutils.pp
index 89aa8fc0e2..0810d3f6fa 100644
--- a/packages/fcl-xml/src/xmlutils.pp
+++ b/packages/fcl-xml/src/xmlutils.pp
@@ -55,7 +55,7 @@ type
     FBucketCount: LongWord;
     FBucket: PPHashItem;
     FOwnsObjects: Boolean;
-    function Lookup(Key: PWideChar; KeyLength: Integer; var Found: Boolean; CanCreate: Boolean): PHashItem;
+    function Lookup(Key: PWideChar; KeyLength: Integer; out Found: Boolean; CanCreate: Boolean): PHashItem;
     procedure Resize(NewCapacity: LongWord);
   public
     constructor Create(InitSize: Integer; OwnObjects: Boolean);
@@ -73,7 +73,6 @@ type
 
 { another hash, for detecting duplicate namespaced attributes without memory allocations }
 
-  PWideString = ^WideString;
   PExpHashEntry = ^TExpHashEntry;
   TExpHashEntry = record
     rev: LongWord;
@@ -129,7 +128,7 @@ begin
   Result := Xml11Pg;
 end;
 
-function IsXml11Char(Value: PWideChar; var Index: Integer): Boolean; overload;
+function IsXml11Char(Value: PWideChar; var Index: Integer): Boolean;
 begin
   if (Value[Index] >= #$D800) and (Value[Index] <= #$DB7F) then
   begin
@@ -140,7 +139,7 @@ begin
     Result := False;
 end;
 
-function IsXml11Char(const Value: WideString; var Index: Integer): Boolean; overload;
+function IsXml11Char(const Value: WideString; var Index: Integer): Boolean;
 begin
   if (Value[Index] >= #$D800) and (Value[Index] <= #$DB7F) then
   begin
@@ -156,7 +155,7 @@ begin
   Result := IsXmlName(PWideChar(Value), Length(Value), Xml11);
 end;
 
-function IsXmlName(Value: PWideChar; Len: Integer; Xml11: Boolean = False): Boolean; overload;
+function IsXmlName(Value: PWideChar; Len: Integer; Xml11: Boolean = False): Boolean;
 var
   Pages: PByteArray;
   I: Integer;
@@ -424,7 +423,7 @@ begin
 end;
 
 function THashTable.Lookup(Key: PWideChar; KeyLength: Integer;
-  var Found: Boolean; CanCreate: Boolean): PHashItem;
+  out Found: Boolean; CanCreate: Boolean): PHashItem;
 var
   Entry: PPHashItem;
   h: LongWord;