cURL / Mailing Lists / curl-library / Single Mail

curl-library

Non-ASCII portability (was "Porting to OS/400: new patch")

From: Patrick Monnerat <Patrick.Monnerat_at_datasphere.ch>
Date: Fri, 3 Aug 2007 17:18:21 +0200

> ... there's a great opportunity for abstraction by creating a
Curl_isalnum macro. You might even be able to rework it so it could be
used in get_char instead of the valchars array, speeding it up at the
same time.

So! as I already answered, an efficient universal Curl_isalnum macro
will never exist...

I improved the code fixing the alphanum characters portability problem
(note it does not impact my OS400 port since it is an ASCII port :-)

_ The big switch/case in escape.c has been retained, since it is
optimized (at least by GNU C) to range tests on ASCII platforms.
_ strtoofft checks at compile time if range tests are applicable. If so,
they are used as before. Else memchr() is used on the valchars[] array.

Please find the patch in attachment.

Received on 2007-08-03