I'm drowning in PHP

David Cantrell david at cantrell.org.uk
Tue May 15 13:56:29 BST 2007


On Tue, May 15, 2007 at 01:12:38PM +0100, Andy Armstrong wrote:
> On 15 May 2007, at 13:00, David Cantrell wrote:
> >FFS, they could at least have chosen 0xFF which isn't a legal ASCII
> >character.
> Then you'd trip over the 'are characters signed or unsigned?'  
> confusion that reigned for a few years.

You would?  0xFF == 0xFF regardless of whether it's signed or not.

> And in times when memory was tighter it /was/ nice to be able to write
> const char *strip_z(const char *s) {
>    while (*s == '0') { s++; }
>    return s;
> }
> 
> which you can't do if you have a counted string.

Yes and changing ASCIIZ to ASCII0xFF doesn't make any difference.

Anyway, if you want to be efficient, you don't use a marker character,
you use a marker bit.  Just set the high bit of the last character to 1
like we used to in the good old days when men were men and computers had
cassette players.

-- 
David Cantrell | Hero of the Information Age

    I caught myself pulling grey hairs out of my beard.
    I'm definitely not going grey, but I am going vain.


More information about the london.pm mailing list