From: Paul Eggert Date: Fri, 11 Mar 2011 07:54:50 +0000 (-0800) Subject: * image.c (xpm_load): Redo to avoid "discards qualifiers" gcc warning. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~602 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e22cffbc1c9ff76a9870311fb6b9fcd49d013933;p=emacs.git * image.c (xpm_load): Redo to avoid "discards qualifiers" gcc warning. --- diff --git a/src/ChangeLog b/src/ChangeLog index d1e2fea4edb..158c5ff5330 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,7 @@ * image.c (clear_image_cache): Now static. (DIM, HAVE_STDLIB_H_1): Remove unused macros. + (xpm_load): Redo to avoid "discards qualifiers" gcc warning. 2011-03-11 Paul Eggert diff --git a/src/image.c b/src/image.c index e25cef52957..4befadd44ef 100644 --- a/src/image.c +++ b/src/image.c @@ -3425,11 +3425,12 @@ xpm_load (struct frame *f, struct image *img) { Lisp_Object name; Lisp_Object color; + char *empty_string = (char *) ""; if (!CONSP (XCAR (tail))) { - xpm_syms[i].name = ""; - xpm_syms[i].value = ""; + xpm_syms[i].name = empty_string; + xpm_syms[i].value = empty_string; continue; } name = XCAR (XCAR (tail)); @@ -3440,14 +3441,14 @@ xpm_load (struct frame *f, struct image *img) strcpy (xpm_syms[i].name, SSDATA (name)); } else - xpm_syms[i].name = ""; + xpm_syms[i].name = empty_string; if (STRINGP (color)) { xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1); strcpy (xpm_syms[i].value, SSDATA (color)); } else - xpm_syms[i].value = ""; + xpm_syms[i].value = empty_string; } }