Fix --enable-gcc-warnings errors introduced in 2013-08-13 commit.
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 14 Aug 2013 04:27:32 +0000 (08:27 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Wed, 14 Aug 2013 04:27:32 +0000 (08:27 +0400)
* image.c (imagemagick_filename_hint): Use `const char *' and
prefer SSDATA to SDATA to avoid warnings.

src/ChangeLog
src/image.c

index af08834..cf73204 100644 (file)
@@ -1,3 +1,9 @@
+2013-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Fix --enable-gcc-warnings errors introduced in 2013-08-13 commit.
+       * image.c (imagemagick_filename_hint): Use `const char *' and
+       prefer SSDATA to SDATA to avoid warnings.
+
 2013-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
 
        Cleanup window fringes, margins and scroll bars adjustments.
index e767d54..99bb9d8 100644 (file)
@@ -7851,9 +7851,9 @@ static char*
 imagemagick_filename_hint (Lisp_Object spec)
 {
   Lisp_Object format = image_spec_value (spec, intern (":format"), NULL);
-  Lisp_Object symbol = intern ("image-format-suffixes");
-  Lisp_Object val;
-  char *name, *prefix = "/tmp/foo.";
+  Lisp_Object val, symbol = intern ("image-format-suffixes");
+  const char *prefix = "/tmp/foo.";
+  char *name;
 
   if (NILP (Fboundp (symbol)))
     return NULL;
@@ -7871,8 +7871,8 @@ imagemagick_filename_hint (Lisp_Object spec)
     return NULL;
 
   name = xmalloc (strlen (prefix) + SBYTES (val) + 1);
-  strcpy(name, prefix);
-  strcat(name, SDATA (val));
+  strcpy (name, prefix);
+  strcat (name, SSDATA (val));
   return name;
 }