Alexander Valyalkin wrote:
:) Are you sure? I'm not. Look on declaration of [nr] variable:
int nr;
And answer, please, which value will be assigned to nr, if length of
a string will be greater than 0x7fffffff on 32-bit architecture?

The funny thing is that in this case, it doesn't matter if 'nr' is signed or unsigned, as it is decremented by 1 until it becomes zero. This will also work as expected for negative values. So the function will be correct for strings of up to 4GB.


It is only idle talk. Can you provide any string from my code which
violates your "coding standards"?

All of the one-liners, basically. You should use more braces & whitespace.

By the way, your "coding standards" violates C standards on type
of string (and any other byte arrays) length. Why are you use int
instead of size_t?:

Why should PHP strings conform to C string standards ?

And there is no reason to expand that macro at all

Is significant speed improvement silly reason for you?


You mean at compile-time ? Macros are expanded by the pre-processor, so the expanded code that is processed by the compiler is *identical* to your inlined code. So no speed increase here.


--
Ard

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to