浏览代码

* let StrBufSize return a cardinal rather than a sizeuint, and also change
its internal pointer arithmetic to use cardinal, because that's also what
stralloc uses to initialize that value

git-svn-id: branches/cpstrrtl@24996 -

Jonas Maebe 12 年之前
父节点
当前提交
c49ae76837
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      rtl/objpas/sysutils/syspch.inc
  2. 1 1
      rtl/objpas/sysutils/syspchh.inc

+ 2 - 2
rtl/objpas/sysutils/syspch.inc

@@ -103,10 +103,10 @@ end;
 
 
 {  StrBufSize returns the amount of memory allocated for pchar Str allocated with StrAlloc  }
 {  StrBufSize returns the amount of memory allocated for pchar Str allocated with StrAlloc  }
 
 
-function StrBufSize(Str: PChar): SizeUInt;
+function StrBufSize(Str: PChar): Cardinal;
 begin
 begin
   if Str <> Nil then
   if Str <> Nil then
-   result := SizeUInt(pointer(Str - SizeOf(SizeUInt))^)-sizeof(SizeUInt)
+   result := cardinal(pointer(Str - SizeOf(cardinal))^)-sizeof(cardinal)
   else
   else
    result := 0;
    result := 0;
 end ;
 end ;

+ 1 - 1
rtl/objpas/sysutils/syspchh.inc

@@ -39,6 +39,6 @@ function StrPas(Str: PChar): string;overload;
 function StrPCopy(Dest: PChar; Source: string): PChar;overload;
 function StrPCopy(Dest: PChar; Source: string): PChar;overload;
 function StrPLCopy(Dest: PChar; Source: string; MaxLen: SizeUInt): PChar;overload;
 function StrPLCopy(Dest: PChar; Source: string; MaxLen: SizeUInt): PChar;overload;
 function StrAlloc(Size: cardinal): PChar;
 function StrAlloc(Size: cardinal): PChar;
-function StrBufSize(Str: PChar): SizeUInt;
+function StrBufSize(Str: PChar): Cardinal;
 procedure StrDispose(Str: PChar);
 procedure StrDispose(Str: PChar);