From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3055 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] String: expand to word size && refactor || refactor Date: Sun, 7 Apr 2013 15:29:44 +0200 Message-ID: <20130407132944.GR30576@port70.net> References: <1365280696-16525-1-git-send-email-nwmcsween@gmail.com> <1365280696-16525-2-git-send-email-nwmcsween@gmail.com> <20130407092327.GQ30576@port70.net> <1365327528.8848.28.camel@eris.loria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1365341397 24619 80.91.229.3 (7 Apr 2013 13:29:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Apr 2013 13:29:57 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3059-gllmg-musl=m.gmane.org@lists.openwall.com Sun Apr 07 15:29:59 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UOpfS-0006iA-SO for gllmg-musl@plane.gmane.org; Sun, 07 Apr 2013 15:29:59 +0200 Original-Received: (qmail 24398 invoked by uid 550); 7 Apr 2013 13:29:56 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 24390 invoked from network); 7 Apr 2013 13:29:56 -0000 Content-Disposition: inline In-Reply-To: <1365327528.8848.28.camel@eris.loria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3055 Archived-At: * Jens Gustedt [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)