From c49ae76837e64b8fd798c9ac5aafd5e2b5d7d5bf Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 27 Jun 2013 21:37:58 +0000 Subject: [PATCH] * 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 - --- rtl/objpas/sysutils/syspch.inc | 4 ++-- rtl/objpas/sysutils/syspchh.inc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rtl/objpas/sysutils/syspch.inc b/rtl/objpas/sysutils/syspch.inc index 2ffc5beffc..69b161e997 100644 --- a/rtl/objpas/sysutils/syspch.inc +++ b/rtl/objpas/sysutils/syspch.inc @@ -103,10 +103,10 @@ end; { StrBufSize returns the amount of memory allocated for pchar Str allocated with StrAlloc } -function StrBufSize(Str: PChar): SizeUInt; +function StrBufSize(Str: PChar): Cardinal; begin if Str <> Nil then - result := SizeUInt(pointer(Str - SizeOf(SizeUInt))^)-sizeof(SizeUInt) + result := cardinal(pointer(Str - SizeOf(cardinal))^)-sizeof(cardinal) else result := 0; end ; diff --git a/rtl/objpas/sysutils/syspchh.inc b/rtl/objpas/sysutils/syspchh.inc index 5fa808410d..82a83a5665 100644 --- a/rtl/objpas/sysutils/syspchh.inc +++ b/rtl/objpas/sysutils/syspchh.inc @@ -39,6 +39,6 @@ function StrPas(Str: PChar): string;overload; function StrPCopy(Dest: PChar; Source: string): PChar;overload; function StrPLCopy(Dest: PChar; Source: string; MaxLen: SizeUInt): PChar;overload; function StrAlloc(Size: cardinal): PChar; -function StrBufSize(Str: PChar): SizeUInt; +function StrBufSize(Str: PChar): Cardinal; procedure StrDispose(Str: PChar);