|
Message-ID: <20130407132944.GR30576@port70.net> Date: Sun, 7 Apr 2013 15:29:44 +0200 From: Szabolcs Nagy <nsz@...t70.net> To: musl@...ts.openwall.com Subject: Re: [PATCH] String: expand to word size && refactor || refactor * Jens Gustedt <jens.gustedt@...ia.fr> [2013-04-07 11:38:48 +0200]: > Am Sonntag, den 07.04.2013, 11:23 +0200 schrieb Szabolcs Nagy: > > #define ONES ((size_t)-1/255) > > just a nitpick, wouldn't > > #define ONES (SIZE_MAX/255) > > be clearer it is two chars shorter at least :) the unsigned -1 idiom is used a lot in musl anyway the really clear definition would be (size_t)0x0101..01 but it depends on the word size btw i was going to suggest to just use unsigned long everywhere so no size_t, uintptr_t and stdint.h since it is guaranteed to do the right thing due to the syscall abi.. then realized that there is x32 and i'm wondering what's the right thing there, since pointer, long, size_t, wordsize are all 32bit, but it can use 64bit registers.. (ie either using unsigned long or size_t etc would mean 32bit word at a time in the string functions, which is fine but probably not the best)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.