[fpc-devel] strcopy, strlcopy for PWideChar

LacaK lacak at zoznam.sk
Tue Aug 16 07:06:26 CEST 2011


Hans-Peter Diettrich  wrote / napĂ­sal(a):
> LacaK schrieb:
>
>>>> Or do you not like these "wide" versions at all ?
>>>
>>> It's not a matter of liking, I'm afraid. If Delphi has them, we'll 
>>> have to add them too :-)
>>>
>>> Can you please add an entry in the bug tracker, so we don't forget ?
>>>
>> http://bugs.freepascal.org/view.php?id=19989
>> Do you think, that it is realistic expect them in 1-2 months ?
>
> Supply an patch, to speed up the implementation.
Ok, I can try prepare patch, but only "generic" i.e. which uses only Pascal.
Processor specific implementations (which use assembler, like it is done 
for AnsiString versions) I am afraid  is too dificult for me ATM ;-)
And also decision where to put (in which units) these functions I will 
leave to somebody more familiar with unit dependencies.

>
> But first the Delphi implementations should be explored, since the 
> following looks not okay to me:
>
> "StrLCopy copies a maximum MaxLen characters from Source to Dest, then 
> adds a null terminator to Dest and returns Dest. The SizeOf standard 
> function (Delphi) or the sizeof operator (C++) can be used to 
> determine the MaxLen parameter. Usually, MaxLen equals SizeOf(Dest)-1."
>
> The mix (or equivalence) of character and byte counts obviously is 
> inappropriate for "wide" versions. Perhaps "sizeof" should read "Length"?
>
Yes, I will do it. I expect, that length is in this case "character 
length", so "byte length" is "character length"*sizeof(widechar)

-Laco.
> DoDi
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>




More information about the fpc-devel mailing list