Re: Re: crc32() improvements
| From: | Ard Biesheuvel | Date: | Mon, 14 Jun 2004 11:49:16 +0000 |
| Subject: | Re: Re: crc32() improvements | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-10437@lists.php.net to get a copy of this message | ||
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 ?
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. -- ArdAnd there is no reason to expand that macro at allIs significant speed improvement silly reason for you?