Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 89C6F429E50 for ; Wed, 14 Dec 2011 15:21:00 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8NNrh6RQIb6s for ; Wed, 14 Dec 2011 15:21:00 -0800 (PST) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id F17DF429E4E for ; Wed, 14 Dec 2011 15:20:59 -0800 (PST) Received: from zancas.localnet (fctnnbsc36w-156034079193.pppoe-dynamic.High-Speed.nb.bellaliant.net [156.34.79.193]) (authenticated bits=0) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pBENKL5a031074 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Wed, 14 Dec 2011 19:20:22 -0400 Received: from bremner by zancas.localnet with local (Exim 4.77) (envelope-from ) id 1Ray7Z-0003KP-0Q; Wed, 14 Dec 2011 19:20:21 -0400 From: David Bremner To: Dmitry Kurochkin , notmuch@notmuchmail.org Subject: Re: [Alpha Patch 2/2] test: update dump-restore tests for 8 bit characters. In-Reply-To: <87pqfqubzd.fsf@gmail.com> References: <1323808075-7417-7-git-send-email-david@tethera.net> <1323893641-4677-1-git-send-email-david@tethera.net> <1323893641-4677-2-git-send-email-david@tethera.net> <87pqfqubzd.fsf@gmail.com> User-Agent: Notmuch/0.10.2+80~g144897e (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Wed, 14 Dec 2011 19:20:20 -0400 Message-ID: <874nx2kaff.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: pere@hungry.com X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2011 23:21:00 -0000 On Thu, 15 Dec 2011 00:36:38 +0400, Dmitry Kurochkin wrote: > > I did not do a proper review. But I think the encoder and decoder > should accept and return the same type, either char* or unsigned char*. > The decision should be based on what type strings (that would be fed to > the encoder and decoder) have in notmuch code. I guess it is char*, so > the encoder and decoder should take and return char*. Internally we > would cast char* to unsigned char*. After staring at the draft C99 standard a bit, I'm inclined to agree. I think char is the generic, which to my horror is really either unsigned char or signed char is an implementation dependent way. The info I was missing was in the description of ,---- | 3 For all functions in this subclause, each character shall be interpreted as if it had the type | unsigned char (and therefore every possible object representation is valid and has a | different value). `---- I'll fix this in git, but I probably won't bother with another round of patches yet.