emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master a486fab: Avoid compilation warnings in nt/*.c files


From: Eli Zaretskii
Subject: [Emacs-diffs] master a486fab: Avoid compilation warnings in nt/*.c files
Date: Sat, 3 Dec 2016 09:55:03 +0000 (UTC)

branch: master
commit a486fabb41cdbaa5813c2687fd4008945297d71d
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Avoid compilation warnings in nt/*.c files
    
    * nt/cmdproxy.c (fail, vfprintf, fprintf, printf, warn)
    (console_event_handler): Add prototypes.
    (canon_filename, skip_space, skip_nonspace, get_next_token)
    (batch_file_p, search_dir, make_absolute, try_dequote_cmdline)
    (spawn, get_env_size): Now static.
    * nt/ddeclient.c (DdeCallback): Provide prototype.
    * nt/addpm.c (DdeCallback): Provide prototype.
    (add_registry): Now static.
---
 nt/addpm.c     |    5 ++++-
 nt/cmdproxy.c  |   32 ++++++++++++++++++++++----------
 nt/ddeclient.c |    3 +++
 3 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/nt/addpm.c b/nt/addpm.c
index 2161ea7..14a77d5 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -53,6 +53,9 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "../src/epaths.h"
 #endif
 
+HDDEDATA CALLBACK DdeCallback (UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, DWORD,
+                              DWORD);
+
 HDDEDATA CALLBACK
 DdeCallback (UINT uType, UINT uFmt, HCONV hconv,
             HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
@@ -101,7 +104,7 @@ env_vars[] =
 #endif
 };
 
-void
+static void
 add_registry (const char *path)
 {
   HKEY hrootkey = NULL;
diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c
index 411a409..d0298da 100644
--- a/nt/cmdproxy.c
+++ b/nt/cmdproxy.c
@@ -46,6 +46,16 @@ extern int _snprintf (char *buffer, size_t count, const char 
*format, ...);
 #define stdout GetStdHandle (STD_OUTPUT_HANDLE)
 #define stderr GetStdHandle (STD_ERROR_HANDLE)
 
+#if __GNUC__ + (__GNUC_MINOR__ >= 4) >= 5
+void fail (const char *, ...) __attribute__((noreturn));
+#else
+void fail (const char *, ...);
+#endif
+int vfprintf (HANDLE, const char *, va_list);
+int fprintf (HANDLE, const char *, ...);
+int printf (const char *, ...);
+void warn (const char *, ...);
+
 int
 vfprintf (HANDLE hnd, const char * msg, va_list args)
 {
@@ -106,7 +116,7 @@ warn (const char * msg, ...)
 
 /******************************************************************/
 
-char *
+static char *
 canon_filename (char *fname)
 {
   char *p = fname;
@@ -121,14 +131,14 @@ canon_filename (char *fname)
   return fname;
 }
 
-const char *
+static const char *
 skip_space (const char *str)
 {
   while (isspace (*str)) str++;
   return str;
 }
 
-const char *
+static const char *
 skip_nonspace (const char *str)
 {
   while (*str && !isspace (*str)) str++;
@@ -141,7 +151,7 @@ skip_nonspace (const char *str)
 const int escape_char = '\\';
 
 /* Get next token from input, advancing pointer.  */
-int
+static int
 get_next_token (char * buf, const char ** pSrc)
 {
   const char * p = *pSrc;
@@ -244,7 +254,7 @@ get_next_token (char * buf, const char ** pSrc)
 }
 
 /* Return TRUE if PROGNAME is a batch file. */
-BOOL
+static BOOL
 batch_file_p (const char *progname)
 {
   const char *exts[] = {".bat", ".cmd"};
@@ -267,7 +277,7 @@ batch_file_p (const char *progname)
 
 /* Search for EXEC file in DIR.  If EXEC does not have an extension,
    DIR is searched for EXEC with the standard extensions appended.  */
-int
+static int
 search_dir (const char *dir, const char *exec, int bufsize, char *buffer)
 {
   const char *exts[] = {".bat", ".cmd", ".exe", ".com"};
@@ -320,7 +330,7 @@ search_dir (const char *dir, const char *exec, int bufsize, 
char *buffer)
 /* Return the absolute name of executable file PROG, including
    any file extensions.  If an absolute name for PROG cannot be found,
    return NULL.  */
-char *
+static char *
 make_absolute (const char *prog)
 {
   char absname[MAX_PATH];
@@ -393,7 +403,7 @@ make_absolute (const char *prog)
    success, return 1 with cmdline dequoted.  Otherwise, when we've
    found constructs only cmd can properly interpret, return 0 and
    leave cmdline unchanged.  */
-int
+static int
 try_dequote_cmdline (char* cmdline)
 {
   /* Dequoting can only subtract characters, so the length of the
@@ -491,6 +501,8 @@ setup_argv (void)
 PROCESS_INFORMATION child;
 int interactive = TRUE;
 
+BOOL console_event_handler (DWORD);
+
 BOOL
 console_event_handler (DWORD event)
 {
@@ -527,7 +539,7 @@ console_event_handler (DWORD event)
 
 /* Change from normal usage; return value indicates whether spawn
    succeeded or failed - program return code is returned separately.  */
-int
+static int
 spawn (const char *progname, char *cmdline, const char *dir, int *retcode)
 {
   BOOL success = FALSE;
@@ -572,7 +584,7 @@ spawn (const char *progname, char *cmdline, const char 
*dir, int *retcode)
 }
 
 /* Return size of current environment block.  */
-int
+static int
 get_env_size (void)
 {
   char * start = GetEnvironmentStrings ();
diff --git a/nt/ddeclient.c b/nt/ddeclient.c
index 7bbbdb0..a9ad6d6 100644
--- a/nt/ddeclient.c
+++ b/nt/ddeclient.c
@@ -21,6 +21,9 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <stdlib.h>
 #include <stdio.h>
 
+HDDEDATA CALLBACK DdeCallback (UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, DWORD,
+                              DWORD);
+
 HDDEDATA CALLBACK
 DdeCallback (UINT uType, UINT uFmt, HCONV hconv,
             HSZ hsz1, HSZ hsz2, HDDEDATA hdata,



reply via email to

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