From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Replace XChar2b with unsigned in all font backends Date: Mon, 20 May 2019 20:20:02 +0100 Message-ID: <9A8FC3EE-ED24-49CC-8B13-294FF7F4D4BD@gnu.org> References: <87v9y5uh63.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="170322"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: K-9 Mail for Android To: emacs-devel@gnu.org,Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 20 21:21:06 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSnqM-000iDH-D0 for ged-emacs-devel@m.gmane.org; Mon, 20 May 2019 21:21:06 +0200 Original-Received: from localhost ([127.0.0.1]:40852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSnqL-0005A7-Ce for ged-emacs-devel@m.gmane.org; Mon, 20 May 2019 15:21:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSnpd-00058P-7L for emacs-devel@gnu.org; Mon, 20 May 2019 15:20:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSnpZ-0005zq-AJ; Mon, 20 May 2019 15:20:18 -0400 Original-Received: from [176.12.228.152] (port=38088 helo=[10.208.105.103]) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1hSnpP-0002r8-M9; Mon, 20 May 2019 15:20:13 -0400 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236818 Archived-At: On May 20, 2019 7:29:34 PM GMT+01:00, Andy Moreton wrote: > On Mon 20 May 2019, Alex Gramiak wrote: >=20 > > Andy Moreton writes: > > > >> Confirmed=2E This patch replaces use of XChar2b (a 16bit type) with > >> unsigned (usually 32bit) which seems wrong=2E > >> > >> AndyM > > > > I originally used unsigned short for this patch, but Eli[1] nudged > me > > towards unsigned=2E Unsigned fits better with other parts of the font > > system, e=2Eg=2E, *encode_char returns unsigned, and *text_extents tak= es > a > > pointer to unsigned=2E > > > > [1] > https://lists=2Egnu=2Eorg/archive/html/emacs-devel/2019-05/msg00457=2Eht= ml >=20 > Yes, but Eli was concerned with efficiency, but correctness comes > first=2E > If you are calling APIs that expect a pointer to an array of 16bit > values, then an array of 32bit values will not suffice=2E >=20 > Many of the comments around this code talk of 2-byte values, so > changing the code to use 4-byte values is surprising to the reader=2E >=20 > The changes also removed the explicit packing/unpacking of 16bit > values, > which may give rise to endianness issues on some systems=2E >=20 > Please revert this patch to fix the build on master, and then revisit > these changes after that=2E >=20 > AndyM You ask to revert because you don't think there's a way of fixing this wi= thout reverting? Or fof some other reason?