comparison lib-src/emacsclient.c @ 110746:5c1a707ab452

Fix compilation warnings. * lib-src/test-distrib.c (cool_read): * lib-src/movemail.c (main, concat): * lib-src/make-docfile.c (scan_file, write_c_args): * emacsclient.c (get_server_config): Fix -Wconversion warning. (egetenv): Move conditional definition earlier. (progname): Use const. * lib-src/sorted-doc.c (xstrdup): Use const.
author Dan Nicolaescu <dann@ics.uci.edu>
date Sun, 03 Oct 2010 16:35:22 -0700
parents ab3815920cc5
children bec49af30c2f
comparison
equal deleted inserted replaced
110745:af2db97ca17a 110746:5c1a707ab452
36 # define NO_SOCKETS_IN_FILE_SYSTEM 36 # define NO_SOCKETS_IN_FILE_SYSTEM
37 37
38 # define HSOCKET SOCKET 38 # define HSOCKET SOCKET
39 # define CLOSE_SOCKET closesocket 39 # define CLOSE_SOCKET closesocket
40 # define INITIALIZE() (initialize_sockets ()) 40 # define INITIALIZE() (initialize_sockets ())
41
42 char *w32_getenv (char *);
43 #define egetenv(VAR) w32_getenv(VAR)
41 44
42 #else /* !WINDOWSNT */ 45 #else /* !WINDOWSNT */
43 46
44 # include "syswait.h" 47 # include "syswait.h"
45 48
60 63
61 # ifndef WCONTINUED 64 # ifndef WCONTINUED
62 # define WCONTINUED 8 65 # define WCONTINUED 8
63 # endif 66 # endif
64 67
68 #define egetenv(VAR) getenv(VAR)
69
65 #endif /* !WINDOWSNT */ 70 #endif /* !WINDOWSNT */
66 71
67 #undef signal 72 #undef signal
68 73
69 #include <stdarg.h> 74 #include <stdarg.h>
84 char *getenv (const char *), *getwd (char *); 89 char *getenv (const char *), *getwd (char *);
85 #ifdef HAVE_GETCWD 90 #ifdef HAVE_GETCWD
86 char *(getcwd) (char *, size_t); 91 char *(getcwd) (char *, size_t);
87 #endif 92 #endif
88 93
89 #ifdef WINDOWSNT
90 char *w32_getenv (char *);
91 #define egetenv(VAR) w32_getenv(VAR)
92 #else
93 #define egetenv(VAR) getenv(VAR)
94 #endif
95
96 #ifndef VERSION 94 #ifndef VERSION
97 #define VERSION "unspecified" 95 #define VERSION "unspecified"
98 #endif 96 #endif
99 97
100 98
117 /* Additional space when allocating buffers for filenames, etc. */ 115 /* Additional space when allocating buffers for filenames, etc. */
118 #define EXTRA_SPACE 100 116 #define EXTRA_SPACE 100
119 117
120 118
121 /* Name used to invoke this program. */ 119 /* Name used to invoke this program. */
122 char *progname; 120 const char *progname;
123 121
124 /* The second argument to main. */ 122 /* The second argument to main. */
125 char **main_argv; 123 char **main_argv;
126 124
127 /* Nonzero means don't wait for a response from Emacs. --no-wait. */ 125 /* Nonzero means don't wait for a response from Emacs. --no-wait. */
750 void 748 void
751 send_to_emacs (HSOCKET s, const char *data) 749 send_to_emacs (HSOCKET s, const char *data)
752 { 750 {
753 while (data) 751 while (data)
754 { 752 {
755 int dlen = strlen (data); 753 size_t dlen = strlen (data);
756 if (dlen + sblen >= SEND_BUFFER_SIZE) 754 if (dlen + sblen >= SEND_BUFFER_SIZE)
757 { 755 {
758 int part = SEND_BUFFER_SIZE - sblen; 756 int part = SEND_BUFFER_SIZE - sblen;
759 strncpy (&send_buffer[sblen], data, part); 757 strncpy (&send_buffer[sblen], data, part);
760 data += part; 758 data += part;