From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 64e25cd: More robust NS hex colour string parsing Date: Fri, 12 Jun 2020 22:25:14 +0300 Message-ID: <83o8po3x45.fsf@gnu.org> References: <20200608120746.30163.87810@vcs0.savannah.gnu.org> <20200608120747.80E8E20A2E@vcs0.savannah.gnu.org> <83r1uk429y.fsf@gnu.org> <3C92A091-F389-4179-B2F0-B3AA5ABD6CCE@acm.org> <83pna43xrl.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="32840"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pipcet@gmail.com, emacs-devel@gnu.org To: mattiase@acm.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 12 21:25:57 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjpJM-0008Qz-G9 for ged-emacs-devel@m.gmane-mx.org; Fri, 12 Jun 2020 21:25:56 +0200 Original-Received: from localhost ([::1]:40490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjpJL-0004mp-Gz for ged-emacs-devel@m.gmane-mx.org; Fri, 12 Jun 2020 15:25:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjpIt-0004MC-Ct for emacs-devel@gnu.org; Fri, 12 Jun 2020 15:25:27 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41975) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjpIs-0002Ib-S1; Fri, 12 Jun 2020 15:25:26 -0400 Original-Received: from [176.228.60.248] (port=2526 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jjpIs-0005mm-18; Fri, 12 Jun 2020 15:25:26 -0400 In-Reply-To: <83pna43xrl.fsf@gnu.org> (message from Eli Zaretskii on Fri, 12 Jun 2020 22:11:10 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252149 Archived-At: > Date: Fri, 12 Jun 2020 22:11:10 +0300 > From: Eli Zaretskii > Cc: pipcet@gmail.com, emacs-devel@gnu.org > > The error checking aside, are the return values of the original code > the same as of the proposed unified code? If not, which of the 4 > current versions differ, and how? Also, the return value in case of error seems to change the externally-visible behavior: > +If STRING is not in one of the above forms, return nil. */) > + (Lisp_Object string) > +{ > + unsigned short r, g, b; > + return (parse_color_spec (SSDATA (string), &r, &g, &b) > + ? list3i (r, g, b) > + : Qnil); > +} At least tty-color-standard-values seems to never return nil for an RGB spec, but now it will, right? Can its callers cope with such a return value? And I wonder how the other callers of parse_color_spec will behave if it detects an error and returns false. Did you audit the code of the callers to see if this could cause trouble?