2010-10-03 Dan Nicolaescu <dann@ics.uci.edu>
+ * test-distrib.c (cool_read):
+ * movemail.c (main, concat):
+ * make-docfile.c (scan_file, write_c_args):
+ * emacsclient.c (get_server_config): Fix -Wconversion warning.
+ (egetenv): Move conditional definition earlier.
+ (progname): Use const.
+ * sorted-doc.c (xstrdup): Use const.
+
* Makefile.in: Remove ^L, old makes choke on it.
2010-10-02 Wolfgang Schnerring <wosc@wosc.de> (tiny change)
# define CLOSE_SOCKET closesocket
# define INITIALIZE() (initialize_sockets ())
+char *w32_getenv (char *);
+#define egetenv(VAR) w32_getenv(VAR)
+
#else /* !WINDOWSNT */
# include "syswait.h"
# define WCONTINUED 8
# endif
+#define egetenv(VAR) getenv(VAR)
+
#endif /* !WINDOWSNT */
#undef signal
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
\f
/* Name used to invoke this program. */
-char *progname;
+const char *progname;
/* The second argument to main. */
char **main_argv;
{
while (data)
{
- int dlen = strlen (data);
+ size_t dlen = strlen (data);
if (dlen + sblen >= SEND_BUFFER_SIZE)
{
int part = SEND_BUFFER_SIZE - sblen;
int
scan_file (char *filename)
{
- int len = strlen (filename);
+
+ size_t len = strlen (filename);
put_filename (filename);
if (len > 4 && !strcmp (filename + len - 4, ".elc"))
register char *p;
int in_ident = 0;
char *ident_start;
- int ident_length = 0;
+ size_t ident_length = 0;
fprintf (out, "(fn");
{
char *inname, *outname;
int indesc, outdesc;
- int nread;
+ ssize_t nread;
int status;
int c, preserve_mail = 0;
string-comparing the two paths, because one or both of them might
be symbolic links pointing to some other directory. */
static char *
-mail_spool_name (inname)
- char *inname;
+mail_spool_name (char *inname)
{
struct stat stat1, stat2;
char *indir, *fname;
static char *
concat (const char *s1, const char *s2, const char *s3)
{
- int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
+ size_t len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
strcpy (result, s1);
}
char *
-xstrdup (char *str)
+xstrdup (const char *str)
{
char *buf = xmalloc (strlen (str) + 1);
(void) strcpy (buf, str);
/* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */
int
-cool_read (int fd, char *buf, int size)
+cool_read (int fd, char *buf, size_t size)
{
- int num, sofar = 0;
+ ssize_t num;
+ size_t sofar = 0;
while (1)
{