diff options
| author | Dan Nicolaescu | 2010-10-03 16:35:22 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-10-03 16:35:22 -0700 |
| commit | 728a982db42d06c3c9db5f920336709387a54cda (patch) | |
| tree | 1ab67f96611e906e40ae57a7e81b8d3db9b03afa /lib-src | |
| parent | c1ae068bbb12dfadbe5f7198fa6584e9c4d7d054 (diff) | |
| download | emacs-728a982db42d06c3c9db5f920336709387a54cda.tar.gz emacs-728a982db42d06c3c9db5f920336709387a54cda.zip | |
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.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 8 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 16 | ||||
| -rw-r--r-- | lib-src/make-docfile.c | 5 | ||||
| -rw-r--r-- | lib-src/movemail.c | 7 | ||||
| -rw-r--r-- | lib-src/sorted-doc.c | 2 | ||||
| -rw-r--r-- | lib-src/test-distrib.c | 5 |
6 files changed, 25 insertions, 18 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index cca90f9a8a9..6d5bf6c4e5b 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2010-10-03 Dan Nicolaescu <dann@ics.uci.edu> | 1 | 2010-10-03 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 2 | ||
| 3 | * test-distrib.c (cool_read): | ||
| 4 | * movemail.c (main, concat): | ||
| 5 | * make-docfile.c (scan_file, write_c_args): | ||
| 6 | * emacsclient.c (get_server_config): Fix -Wconversion warning. | ||
| 7 | (egetenv): Move conditional definition earlier. | ||
| 8 | (progname): Use const. | ||
| 9 | * sorted-doc.c (xstrdup): Use const. | ||
| 10 | |||
| 3 | * Makefile.in: Remove ^L, old makes choke on it. | 11 | * Makefile.in: Remove ^L, old makes choke on it. |
| 4 | 12 | ||
| 5 | 2010-10-02 Wolfgang Schnerring <wosc@wosc.de> (tiny change) | 13 | 2010-10-02 Wolfgang Schnerring <wosc@wosc.de> (tiny change) |
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index d3d6f1cacd8..b20710e110c 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -39,6 +39,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 39 | # define CLOSE_SOCKET closesocket | 39 | # define CLOSE_SOCKET closesocket |
| 40 | # define INITIALIZE() (initialize_sockets ()) | 40 | # define INITIALIZE() (initialize_sockets ()) |
| 41 | 41 | ||
| 42 | char *w32_getenv (char *); | ||
| 43 | #define egetenv(VAR) w32_getenv(VAR) | ||
| 44 | |||
| 42 | #else /* !WINDOWSNT */ | 45 | #else /* !WINDOWSNT */ |
| 43 | 46 | ||
| 44 | # include "syswait.h" | 47 | # include "syswait.h" |
| @@ -62,6 +65,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 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 |
| @@ -86,13 +91,6 @@ char *getenv (const char *), *getwd (char *); | |||
| 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 |
| @@ -119,7 +117,7 @@ char *w32_getenv (char *); | |||
| 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; |
| @@ -752,7 +750,7 @@ 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; |
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 4824731672b..e2dc99214d2 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -204,7 +204,8 @@ put_filename (char *filename) | |||
| 204 | int | 204 | int |
| 205 | scan_file (char *filename) | 205 | scan_file (char *filename) |
| 206 | { | 206 | { |
| 207 | int len = strlen (filename); | 207 | |
| 208 | size_t len = strlen (filename); | ||
| 208 | 209 | ||
| 209 | put_filename (filename); | 210 | put_filename (filename); |
| 210 | if (len > 4 && !strcmp (filename + len - 4, ".elc")) | 211 | if (len > 4 && !strcmp (filename + len - 4, ".elc")) |
| @@ -442,7 +443,7 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs) | |||
| 442 | register char *p; | 443 | register char *p; |
| 443 | int in_ident = 0; | 444 | int in_ident = 0; |
| 444 | char *ident_start; | 445 | char *ident_start; |
| 445 | int ident_length = 0; | 446 | size_t ident_length = 0; |
| 446 | 447 | ||
| 447 | fprintf (out, "(fn"); | 448 | fprintf (out, "(fn"); |
| 448 | 449 | ||
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 4ccdc93688c..f300942427e 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -169,7 +169,7 @@ main (int argc, char **argv) | |||
| 169 | { | 169 | { |
| 170 | char *inname, *outname; | 170 | char *inname, *outname; |
| 171 | int indesc, outdesc; | 171 | int indesc, outdesc; |
| 172 | int nread; | 172 | ssize_t nread; |
| 173 | int status; | 173 | int status; |
| 174 | int c, preserve_mail = 0; | 174 | int c, preserve_mail = 0; |
| 175 | 175 | ||
| @@ -551,8 +551,7 @@ main (int argc, char **argv) | |||
| 551 | string-comparing the two paths, because one or both of them might | 551 | string-comparing the two paths, because one or both of them might |
| 552 | be symbolic links pointing to some other directory. */ | 552 | be symbolic links pointing to some other directory. */ |
| 553 | static char * | 553 | static char * |
| 554 | mail_spool_name (inname) | 554 | mail_spool_name (char *inname) |
| 555 | char *inname; | ||
| 556 | { | 555 | { |
| 557 | struct stat stat1, stat2; | 556 | struct stat stat1, stat2; |
| 558 | char *indir, *fname; | 557 | char *indir, *fname; |
| @@ -632,7 +631,7 @@ pfatal_and_delete (char *name) | |||
| 632 | static char * | 631 | static char * |
| 633 | concat (const char *s1, const char *s2, const char *s3) | 632 | concat (const char *s1, const char *s2, const char *s3) |
| 634 | { | 633 | { |
| 635 | int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); | 634 | size_t len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); |
| 636 | char *result = (char *) xmalloc (len1 + len2 + len3 + 1); | 635 | char *result = (char *) xmalloc (len1 + len2 + len3 + 1); |
| 637 | 636 | ||
| 638 | strcpy (result, s1); | 637 | strcpy (result, s1); |
diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c index db3f3029532..4fe830e4013 100644 --- a/lib-src/sorted-doc.c +++ b/lib-src/sorted-doc.c | |||
| @@ -93,7 +93,7 @@ xmalloc (int size) | |||
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | char * | 95 | char * |
| 96 | xstrdup (char *str) | 96 | xstrdup (const char *str) |
| 97 | { | 97 | { |
| 98 | char *buf = xmalloc (strlen (str) + 1); | 98 | char *buf = xmalloc (strlen (str) + 1); |
| 99 | (void) strcpy (buf, str); | 99 | (void) strcpy (buf, str); |
diff --git a/lib-src/test-distrib.c b/lib-src/test-distrib.c index 880bd115882..1487c2bab57 100644 --- a/lib-src/test-distrib.c +++ b/lib-src/test-distrib.c | |||
| @@ -52,9 +52,10 @@ char buf[300]; | |||
| 52 | 52 | ||
| 53 | /* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */ | 53 | /* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */ |
| 54 | int | 54 | int |
| 55 | cool_read (int fd, char *buf, int size) | 55 | cool_read (int fd, char *buf, size_t size) |
| 56 | { | 56 | { |
| 57 | int num, sofar = 0; | 57 | ssize_t num; |
| 58 | size_t sofar = 0; | ||
| 58 | 59 | ||
| 59 | while (1) | 60 | while (1) |
| 60 | { | 61 | { |