diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-07-31 23:38:28 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-07-31 23:38:28 +0000 |
commit | 6aaa863432967b99d0e2c87116b4ec844b90436f (patch) | |
tree | 40d8a50800514332aab7e469c351e4491cab6dfe /src/network.c | |
parent | ab02f47a297693752e1d68d5eaf914c77cfb652c (diff) |
Added appropriate casts from (void*) so that the code will compile
cleanly with a C++ compiler. (Tested using GCC 3.3)
Diffstat (limited to 'src/network.c')
-rw-r--r-- | src/network.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/network.c b/src/network.c index db3000c..a66857d 100644 --- a/src/network.c +++ b/src/network.c @@ -1,4 +1,4 @@ -/* $Id: network.c,v 1.1 2002-05-23 04:41:48 rjkaes Exp $ +/* $Id: network.c,v 1.2 2003-07-31 23:38:28 rjkaes Exp $ * * The functions found here are used for communicating across a * network. They include both safe reading and writing (which are @@ -90,7 +90,7 @@ write_message(int fd, const char *fmt, ...) char *buf, *tmpbuf; va_list ap; - if ((buf = safemalloc(size)) == NULL) + if ((buf = (char*)safemalloc(size)) == NULL) return -1; while (1) { @@ -110,7 +110,7 @@ write_message(int fd, const char *fmt, ...) /* twice the old size (glibc2.0) */ size *= 2; - if ((tmpbuf = saferealloc(buf, size)) == NULL) { + if ((tmpbuf = (char*)saferealloc(buf, size)) == NULL) { safefree(buf); return -1; } else @@ -154,7 +154,8 @@ readline(int fd, char **whole_buffer) }; struct read_lines_s *first_line, *line_ptr; - first_line = safecalloc(sizeof(struct read_lines_s), 1); + first_line = + (struct read_lines_s*)safecalloc(sizeof(struct read_lines_s), 1); if (!first_line) return -ENOMEM; @@ -166,7 +167,7 @@ readline(int fd, char **whole_buffer) if (ret <= 0) goto CLEANUP; - ptr = memchr(buffer, '\n', ret); + ptr = (char*)memchr(buffer, '\n', ret); if (ptr) diff = ptr - buffer + 1; else @@ -183,7 +184,7 @@ readline(int fd, char **whole_buffer) goto CLEANUP; } - line_ptr->data = safemalloc(diff); + line_ptr->data = (char*)safemalloc(diff); if (!line_ptr->data) { ret = -ENOMEM; goto CLEANUP; @@ -197,7 +198,8 @@ readline(int fd, char **whole_buffer) break; } - line_ptr->next = safecalloc(sizeof(struct read_lines_s), 1); + line_ptr->next = + (struct read_lines_s*)safecalloc(sizeof(struct read_lines_s), 1); if (!line_ptr->next) { ret = -ENOMEM; goto CLEANUP; @@ -205,7 +207,7 @@ readline(int fd, char **whole_buffer) line_ptr = line_ptr->next; } - *whole_buffer = safemalloc(whole_buffer_len + 1); + *whole_buffer = (char*)safemalloc(whole_buffer_len + 1); if (!*whole_buffer) { ret = -ENOMEM; goto CLEANUP; |