emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b90e890: Avoid compiler warnings


From: Ken Brown
Subject: [Emacs-diffs] master b90e890: Avoid compiler warnings
Date: Sat, 28 May 2016 17:57:09 +0000 (UTC)

branch: master
commit b90e8904092eb7aa5b4cb3ede822d10422b70976
Author: Ken Brown <address@hidden>
Commit: Ken Brown <address@hidden>

    Avoid compiler warnings
    
    * src/cygw32.c (chdir_to_default_directory): Use "void" as
    argument list.  Use SSDATA instead of SDATA.
    
    * src/unexcw.c (fixup_executable): Use %td as format specifier for
    argument of type ptrdiff_t.  Use %zu for argument of type size_t.
---
 src/cygw32.c |    4 ++--
 src/unexcw.c |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/cygw32.c b/src/cygw32.c
index 6822320..ca9069a 100644
--- a/src/cygw32.c
+++ b/src/cygw32.c
@@ -31,7 +31,7 @@ fchdir_unwind (int dir_fd)
 }
 
 static void
-chdir_to_default_directory ()
+chdir_to_default_directory (void)
 {
   Lisp_Object new_cwd;
   int old_cwd_fd = emacs_open (".", O_RDONLY | O_DIRECTORY, 0);
@@ -46,7 +46,7 @@ chdir_to_default_directory ()
   if (!STRINGP (new_cwd))
     new_cwd = build_string ("/");
 
-  if (chdir (SDATA (ENCODE_FILE (new_cwd))))
+  if (chdir (SSDATA (ENCODE_FILE (new_cwd))))
     error ("could not chdir: %s", strerror (errno));
 }
 
diff --git a/src/unexcw.c b/src/unexcw.c
index ea678dd..6343b38 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -147,7 +147,7 @@ fixup_executable (int fd)
          assert (ret == my_edata - (char *) start_address);
          ++found_data;
          if (debug_unexcw)
-           printf ("         .data, mem start %#lx mem length %d\n",
+           printf ("         .data, mem start %#lx mem length %td\n",
                    start_address, my_edata - (char *) start_address);
          if (debug_unexcw)
            printf ("         .data, file start %d file length %d\n",
@@ -213,7 +213,7 @@ fixup_executable (int fd)
                       sizeof (exe_header->section_header[i]));
              assert (ret == sizeof (exe_header->section_header[i]));
              if (debug_unexcw)
-               printf ("         seek to %ld, write %d\n",
+               printf ("         seek to %ld, write %zu\n",
                        (long) ((char *) &exe_header->section_header[i] -
                                (char *) exe_header),
                        sizeof (exe_header->section_header[i]));
@@ -228,7 +228,7 @@ fixup_executable (int fd)
                   my_endbss - (char *) start_address);
          assert (ret == (my_endbss - (char *) start_address));
          if (debug_unexcw)
-           printf ("         .bss, mem start %#lx mem length %d\n",
+           printf ("         .bss, mem start %#lx mem length %td\n",
                    start_address, my_endbss - (char *) start_address);
          if (debug_unexcw)
            printf ("         .bss, file start %d file length %d\n",



reply via email to

[Prev in Thread] Current Thread [Next in Thread]