aboutsummaryrefslogtreecommitdiffstats
path: root/nt/cmdproxy.c
diff options
context:
space:
mode:
authorEli Zaretskii2016-12-03 11:54:24 +0200
committerEli Zaretskii2016-12-03 11:54:24 +0200
commita486fabb41cdbaa5813c2687fd4008945297d71d (patch)
tree36983292ee4f45657839efe6f317abecb707d9bf /nt/cmdproxy.c
parent143a4306759a91e84b486a9e4c52f83d96d8d23d (diff)
downloademacs-a486fabb41cdbaa5813c2687fd4008945297d71d.tar.gz
emacs-a486fabb41cdbaa5813c2687fd4008945297d71d.zip
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.
Diffstat (limited to 'nt/cmdproxy.c')
-rw-r--r--nt/cmdproxy.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c
index 411a409baca..d0298da36b9 100644
--- a/nt/cmdproxy.c
+++ b/nt/cmdproxy.c
@@ -46,6 +46,16 @@ extern int _snprintf (char *buffer, size_t count, const char *format, ...);
46#define stdout GetStdHandle (STD_OUTPUT_HANDLE) 46#define stdout GetStdHandle (STD_OUTPUT_HANDLE)
47#define stderr GetStdHandle (STD_ERROR_HANDLE) 47#define stderr GetStdHandle (STD_ERROR_HANDLE)
48 48
49#if __GNUC__ + (__GNUC_MINOR__ >= 4) >= 5
50void fail (const char *, ...) __attribute__((noreturn));
51#else
52void fail (const char *, ...);
53#endif
54int vfprintf (HANDLE, const char *, va_list);
55int fprintf (HANDLE, const char *, ...);
56int printf (const char *, ...);
57void warn (const char *, ...);
58
49int 59int
50vfprintf (HANDLE hnd, const char * msg, va_list args) 60vfprintf (HANDLE hnd, const char * msg, va_list args)
51{ 61{
@@ -106,7 +116,7 @@ warn (const char * msg, ...)
106 116
107/******************************************************************/ 117/******************************************************************/
108 118
109char * 119static char *
110canon_filename (char *fname) 120canon_filename (char *fname)
111{ 121{
112 char *p = fname; 122 char *p = fname;
@@ -121,14 +131,14 @@ canon_filename (char *fname)
121 return fname; 131 return fname;
122} 132}
123 133
124const char * 134static const char *
125skip_space (const char *str) 135skip_space (const char *str)
126{ 136{
127 while (isspace (*str)) str++; 137 while (isspace (*str)) str++;
128 return str; 138 return str;
129} 139}
130 140
131const char * 141static const char *
132skip_nonspace (const char *str) 142skip_nonspace (const char *str)
133{ 143{
134 while (*str && !isspace (*str)) str++; 144 while (*str && !isspace (*str)) str++;
@@ -141,7 +151,7 @@ skip_nonspace (const char *str)
141const int escape_char = '\\'; 151const int escape_char = '\\';
142 152
143/* Get next token from input, advancing pointer. */ 153/* Get next token from input, advancing pointer. */
144int 154static int
145get_next_token (char * buf, const char ** pSrc) 155get_next_token (char * buf, const char ** pSrc)
146{ 156{
147 const char * p = *pSrc; 157 const char * p = *pSrc;
@@ -244,7 +254,7 @@ get_next_token (char * buf, const char ** pSrc)
244} 254}
245 255
246/* Return TRUE if PROGNAME is a batch file. */ 256/* Return TRUE if PROGNAME is a batch file. */
247BOOL 257static BOOL
248batch_file_p (const char *progname) 258batch_file_p (const char *progname)
249{ 259{
250 const char *exts[] = {".bat", ".cmd"}; 260 const char *exts[] = {".bat", ".cmd"};
@@ -267,7 +277,7 @@ batch_file_p (const char *progname)
267 277
268/* Search for EXEC file in DIR. If EXEC does not have an extension, 278/* Search for EXEC file in DIR. If EXEC does not have an extension,
269 DIR is searched for EXEC with the standard extensions appended. */ 279 DIR is searched for EXEC with the standard extensions appended. */
270int 280static int
271search_dir (const char *dir, const char *exec, int bufsize, char *buffer) 281search_dir (const char *dir, const char *exec, int bufsize, char *buffer)
272{ 282{
273 const char *exts[] = {".bat", ".cmd", ".exe", ".com"}; 283 const char *exts[] = {".bat", ".cmd", ".exe", ".com"};
@@ -320,7 +330,7 @@ search_dir (const char *dir, const char *exec, int bufsize, char *buffer)
320/* Return the absolute name of executable file PROG, including 330/* Return the absolute name of executable file PROG, including
321 any file extensions. If an absolute name for PROG cannot be found, 331 any file extensions. If an absolute name for PROG cannot be found,
322 return NULL. */ 332 return NULL. */
323char * 333static char *
324make_absolute (const char *prog) 334make_absolute (const char *prog)
325{ 335{
326 char absname[MAX_PATH]; 336 char absname[MAX_PATH];
@@ -393,7 +403,7 @@ make_absolute (const char *prog)
393 success, return 1 with cmdline dequoted. Otherwise, when we've 403 success, return 1 with cmdline dequoted. Otherwise, when we've
394 found constructs only cmd can properly interpret, return 0 and 404 found constructs only cmd can properly interpret, return 0 and
395 leave cmdline unchanged. */ 405 leave cmdline unchanged. */
396int 406static int
397try_dequote_cmdline (char* cmdline) 407try_dequote_cmdline (char* cmdline)
398{ 408{
399 /* Dequoting can only subtract characters, so the length of the 409 /* Dequoting can only subtract characters, so the length of the
@@ -491,6 +501,8 @@ setup_argv (void)
491PROCESS_INFORMATION child; 501PROCESS_INFORMATION child;
492int interactive = TRUE; 502int interactive = TRUE;
493 503
504BOOL console_event_handler (DWORD);
505
494BOOL 506BOOL
495console_event_handler (DWORD event) 507console_event_handler (DWORD event)
496{ 508{
@@ -527,7 +539,7 @@ console_event_handler (DWORD event)
527 539
528/* Change from normal usage; return value indicates whether spawn 540/* Change from normal usage; return value indicates whether spawn
529 succeeded or failed - program return code is returned separately. */ 541 succeeded or failed - program return code is returned separately. */
530int 542static int
531spawn (const char *progname, char *cmdline, const char *dir, int *retcode) 543spawn (const char *progname, char *cmdline, const char *dir, int *retcode)
532{ 544{
533 BOOL success = FALSE; 545 BOOL success = FALSE;
@@ -572,7 +584,7 @@ spawn (const char *progname, char *cmdline, const char *dir, int *retcode)
572} 584}
573 585
574/* Return size of current environment block. */ 586/* Return size of current environment block. */
575int 587static int
576get_env_size (void) 588get_env_size (void)
577{ 589{
578 char * start = GetEnvironmentStrings (); 590 char * start = GetEnvironmentStrings ();