diff 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
line wrap: on
line diff
--- a/lib-src/emacsclient.c	Mon Oct 04 00:37:37 2010 +0200
+++ b/lib-src/emacsclient.c	Sun Oct 03 16:35:22 2010 -0700
@@ -39,6 +39,9 @@
 # define CLOSE_SOCKET closesocket
 # define INITIALIZE() (initialize_sockets ())
 
+char *w32_getenv (char *);
+#define egetenv(VAR) w32_getenv(VAR)
+
 #else /* !WINDOWSNT */
 
 # include "syswait.h"
@@ -62,6 +65,8 @@
 #  define WCONTINUED 8
 # endif
 
+#define egetenv(VAR) getenv(VAR)
+
 #endif /* !WINDOWSNT */
 
 #undef signal
@@ -86,13 +91,6 @@
 char *(getcwd) (char *, size_t);
 #endif
 
-#ifdef WINDOWSNT
-char *w32_getenv (char *);
-#define egetenv(VAR) w32_getenv(VAR)
-#else
-#define egetenv(VAR) getenv(VAR)
-#endif
-
 #ifndef VERSION
 #define VERSION "unspecified"
 #endif
@@ -119,7 +117,7 @@
 
 
 /* Name used to invoke this program.  */
-char *progname;
+const char *progname;
 
 /* The second argument to main. */
 char **main_argv;
@@ -752,7 +750,7 @@
 {
   while (data)
     {
-      int dlen = strlen (data);
+      size_t dlen = strlen (data);
       if (dlen + sblen >= SEND_BUFFER_SIZE)
 	{
 	  int part = SEND_BUFFER_SIZE - sblen;