From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] * image.c: Fix compiler warning due to missing const Date: Thu, 10 Sep 2015 02:52:05 -0700 Organization: UCLA Computer Science Department Message-ID: <55F152C5.9050306@cs.ucla.edu> References: <1441856303-4171-1-git-send-email-mitch.special@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010501070006050008090501" X-Trace: ger.gmane.org 1441878771 20554 80.91.229.3 (10 Sep 2015 09:52:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Sep 2015 09:52:51 +0000 (UTC) To: Mitchel Humpherys , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 10 11:52:41 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZZyWy-0004ix-4m for ged-emacs-devel@m.gmane.org; Thu, 10 Sep 2015 11:52:36 +0200 Original-Received: from localhost ([::1]:48132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZyWx-0005N7-9Y for ged-emacs-devel@m.gmane.org; Thu, 10 Sep 2015 05:52:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZyWh-0005Jp-PU for emacs-devel@gnu.org; Thu, 10 Sep 2015 05:52:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZyWc-0006dH-RN for emacs-devel@gnu.org; Thu, 10 Sep 2015 05:52:19 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:49559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZyWc-0006cl-IF for emacs-devel@gnu.org; Thu, 10 Sep 2015 05:52:14 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8454A161073; Thu, 10 Sep 2015 02:52:12 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id A_GtZOETwWTH; Thu, 10 Sep 2015 02:52:11 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3AFF116106F; Thu, 10 Sep 2015 02:52:11 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id UGUV2LkW-KXn; Thu, 10 Sep 2015 02:52:11 -0700 (PDT) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1732F161068; Thu, 10 Sep 2015 02:52:11 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: <1441856303-4171-1-git-send-email-mitch.special@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:189794 Archived-At: This is a multi-part message in MIME format. --------------010501070006050008090501 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the bug reports. I installed patches that should address the two issues you raised, though not quite in the ways you suggested. GIFLIB before 5.1 has problems with GifErrorString's signature; a simple workaround is to avoid using GifErrorString in GIFLIB 5.0.x. Please see: http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6ee7eabb5dbdf39f2d7471c9e42fc90c315e6a9f http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=f962c5d6472804f788cdd54631bcc46aab5f59ce --------------010501070006050008090501 Content-Type: text/x-diff; name="0001-Port-to-GIFLIB-5.0.6-and-later.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Port-to-GIFLIB-5.0.6-and-later.patch" >From 6db8d94a896ceef473b8883ab4252778163b8f51 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 10 Sep 2015 02:39:13 -0700 Subject: [PATCH 1/2] Port to GIFLIB 5.0.6 and later Problem reported by Mitchel Humpherys in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00420.html * src/image.c (HAVE_GIFERRORSTRING) [HAVE_GIF]: New macro. (GifErrorString, init_gif_functions) [HAVE_GIF && WINDOWSNT]: (gif_load) [HAVE_GIF]: Use it. --- src/image.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/image.c b/src/image.c index 85cf801..2aa01e4 100644 --- a/src/image.c +++ b/src/image.c @@ -7499,6 +7499,12 @@ gif_image_p (Lisp_Object object) # define GIFLIB_MAJOR 4 # endif +/* GifErrorString is declared to return char const * when GIFLIB_MAJOR + and GIFLIB_MINOR indicate 5.1 or later. Do not bother using it in + earlier releases, where either it returns char * or GIFLIB_MINOR + may be incorrect. */ +# define HAVE_GIFERRORSTRING (5 < GIFLIB_MAJOR + (1 <= GIFLIB_MINOR)) + # ifdef WINDOWSNT /* GIF library details. */ @@ -7514,7 +7520,9 @@ DEF_DLL_FN (GifFileType *, DGifOpenFileName, (const char *)); # else DEF_DLL_FN (GifFileType *, DGifOpen, (void *, InputFunc, int *)); DEF_DLL_FN (GifFileType *, DGifOpenFileName, (const char *, int *)); -DEF_DLL_FN (char *, GifErrorString, (int)); +# endif +# if HAVE_GIFERRORSTRING +DEF_DLL_FN (char const *, GifErrorString, (int)); # endif static bool @@ -7529,7 +7537,7 @@ init_gif_functions (void) LOAD_DLL_FN (library, DGifSlurp); LOAD_DLL_FN (library, DGifOpen); LOAD_DLL_FN (library, DGifOpenFileName); -# if GIFLIB_MAJOR >= 5 +# if HAVE_GIFERRORSTRING LOAD_DLL_FN (library, GifErrorString); # endif return 1; @@ -7641,20 +7649,19 @@ gif_load (struct frame *f, struct image *img) /* Open the GIF file. */ #if GIFLIB_MAJOR < 5 gif = DGifOpenFileName (SSDATA (encoded_file)); - if (gif == NULL) - { - image_error ("Cannot open `%s'", file); - return 0; - } #else gif = DGifOpenFileName (SSDATA (encoded_file), &gif_err); +#endif if (gif == NULL) { +#if HAVE_GIFERRORSTRING image_error ("Cannot open `%s': %s", file, build_string (GifErrorString (gif_err))); +#else + image_error ("Cannot open `%s'", file); +#endif return 0; } -#endif } else { @@ -7672,20 +7679,19 @@ gif_load (struct frame *f, struct image *img) #if GIFLIB_MAJOR < 5 gif = DGifOpen (&memsrc, gif_read_from_memory); - if (!gif) - { - image_error ("Cannot open memory source `%s'", img->spec); - return 0; - } #else gif = DGifOpen (&memsrc, gif_read_from_memory, &gif_err); +#endif if (!gif) { +#if HAVE_GIFERRORSTRING image_error ("Cannot open memory source `%s': %s", img->spec, build_string (GifErrorString (gif_err))); +#else + image_error ("Cannot open memory source `%s'", img->spec); +#endif return 0; } -#endif } /* Before reading entire contents, check the declared image size. */ @@ -7980,8 +7986,8 @@ gif_load (struct frame *f, struct image *img) if (gif_close (gif, &gif_err) == GIF_ERROR) { -#if 5 <= GIFLIB_MAJOR - char *error_text = GifErrorString (gif_err); +#if HAVE_GIFERRORSTRING + char const *error_text = GifErrorString (gif_err); if (error_text) image_error ("Error closing `%s': %s", -- 2.1.0 --------------010501070006050008090501 Content-Type: text/x-diff; name="0002-Add-patch-sending-instructions-to-git-workflow.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Add-patch-sending-instructions-to-git-workflow.patch" >From 556a16fc5dd9996460fea9d7ff7df281723b3ff6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 10 Sep 2015 02:43:59 -0700 Subject: [PATCH 2/2] Add patch-sending instructions to git-workflow >From a suggestion by Mitchel Humpherys in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00421.html * admin/notes/git-workflow (Sending patches): New section. --- admin/notes/git-workflow | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow index d1d105a..40dfa6b 100644 --- a/admin/notes/git-workflow +++ b/admin/notes/git-workflow @@ -46,6 +46,24 @@ top of that. Then say git push +Sending patches +=============== + +If you lack push access or would like feedback before pushing a patch, +you can send a patch file as a bug report. After committing your +change locally, do: + +git format-patch -1 + +This creates a file 0001-DESCRIPTION.patch containing the patch, where +DESCRIPTION comes from the first line of your patch's commit message. +You can attach the patch file to email that you send to +bug-gnu-emacs@gnu.org. You can also configure git to email patches +directly (see ) and do: + +git send-email --to=bug-gnu-emacs@gnu.org 0001-DESCRIPTION.patch + + Backporting to emacs-24 ======================= -- 2.1.0 --------------010501070006050008090501--