diff options
| author | Eli Zaretskii | 2016-12-03 11:54:24 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-12-03 11:54:24 +0200 |
| commit | a486fabb41cdbaa5813c2687fd4008945297d71d (patch) | |
| tree | 36983292ee4f45657839efe6f317abecb707d9bf /nt/cmdproxy.c | |
| parent | 143a4306759a91e84b486a9e4c52f83d96d8d23d (diff) | |
| download | emacs-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.c | 32 |
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 | ||
| 50 | void fail (const char *, ...) __attribute__((noreturn)); | ||
| 51 | #else | ||
| 52 | void fail (const char *, ...); | ||
| 53 | #endif | ||
| 54 | int vfprintf (HANDLE, const char *, va_list); | ||
| 55 | int fprintf (HANDLE, const char *, ...); | ||
| 56 | int printf (const char *, ...); | ||
| 57 | void warn (const char *, ...); | ||
| 58 | |||
| 49 | int | 59 | int |
| 50 | vfprintf (HANDLE hnd, const char * msg, va_list args) | 60 | vfprintf (HANDLE hnd, const char * msg, va_list args) |
| 51 | { | 61 | { |
| @@ -106,7 +116,7 @@ warn (const char * msg, ...) | |||
| 106 | 116 | ||
| 107 | /******************************************************************/ | 117 | /******************************************************************/ |
| 108 | 118 | ||
| 109 | char * | 119 | static char * |
| 110 | canon_filename (char *fname) | 120 | canon_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 | ||
| 124 | const char * | 134 | static const char * |
| 125 | skip_space (const char *str) | 135 | skip_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 | ||
| 131 | const char * | 141 | static const char * |
| 132 | skip_nonspace (const char *str) | 142 | skip_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) | |||
| 141 | const int escape_char = '\\'; | 151 | const int escape_char = '\\'; |
| 142 | 152 | ||
| 143 | /* Get next token from input, advancing pointer. */ | 153 | /* Get next token from input, advancing pointer. */ |
| 144 | int | 154 | static int |
| 145 | get_next_token (char * buf, const char ** pSrc) | 155 | get_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. */ |
| 247 | BOOL | 257 | static BOOL |
| 248 | batch_file_p (const char *progname) | 258 | batch_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. */ |
| 270 | int | 280 | static int |
| 271 | search_dir (const char *dir, const char *exec, int bufsize, char *buffer) | 281 | search_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. */ |
| 323 | char * | 333 | static char * |
| 324 | make_absolute (const char *prog) | 334 | make_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. */ |
| 396 | int | 406 | static int |
| 397 | try_dequote_cmdline (char* cmdline) | 407 | try_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) | |||
| 491 | PROCESS_INFORMATION child; | 501 | PROCESS_INFORMATION child; |
| 492 | int interactive = TRUE; | 502 | int interactive = TRUE; |
| 493 | 503 | ||
| 504 | BOOL console_event_handler (DWORD); | ||
| 505 | |||
| 494 | BOOL | 506 | BOOL |
| 495 | console_event_handler (DWORD event) | 507 | console_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. */ |
| 530 | int | 542 | static int |
| 531 | spawn (const char *progname, char *cmdline, const char *dir, int *retcode) | 543 | spawn (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. */ |
| 575 | int | 587 | static int |
| 576 | get_env_size (void) | 588 | get_env_size (void) |
| 577 | { | 589 | { |
| 578 | char * start = GetEnvironmentStrings (); | 590 | char * start = GetEnvironmentStrings (); |