From 9112a632f6791ffc3c3c1aadd214cbaba8fe816e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 4 Dec 2004 13:56:25 +0000 Subject: r4063: - change char * -> uint8_t in struct request_buffer - change smbcli_read/write to take void * for the buffers to match read(2)/write(2) all this fixes a lot of gcc-4 warnings metze (This used to be commit b94f92bc6637f748d6f7049f4f9a30b0b8d18a7a) --- source4/client/client.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source4/client') diff --git a/source4/client/client.c b/source4/client/client.c index dae24ce927..f17586f994 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -138,8 +138,9 @@ void dos_clean_name(char *s) write to a local file with CR/LF->LF translation if appropriate. return the number taken from the buffer. This may not equal the number written. ****************************************************************************/ -static int writefile(int f, char *b, int n) +static int writefile(int f, const void *_b, int n) { + const uint8_t *b = _b; int i; if (!translation) { @@ -165,8 +166,9 @@ static int writefile(int f, char *b, int n) read from a file with LF->CR/LF translation if appropriate. return the number read. read approx n bytes. ****************************************************************************/ -static int readfile(char *b, int n, XFILE *f) +static int readfile(void *_b, int n, XFILE *f) { + uint8_t *b = _b; int i; int c; @@ -719,7 +721,7 @@ static int do_get(char *rname, const char *lname, BOOL reget) { int handle = 0, fnum; BOOL newhandle = False; - char *data; + uint8_t *data; struct timeval tp_start; int read_size = io_bufsize; uint16_t attr; @@ -775,7 +777,7 @@ static int do_get(char *rname, const char *lname, BOOL reget) DEBUG(2,("getting file %s of size %.0f as %s ", rname, (double)size, lname)); - if(!(data = (char *)malloc(read_size))) { + if(!(data = (uint8_t *)malloc(read_size))) { d_printf("malloc fail for size %d\n", read_size); smbcli_close(cli->tree, fnum); return 1; @@ -1149,7 +1151,7 @@ static int do_put(char *rname, char *lname, BOOL reput) XFILE *f; size_t start = 0; off_t nread = 0; - char *buf = NULL; + uint8_t *buf = NULL; int maxwrite = io_bufsize; int rc = 0; @@ -1202,7 +1204,7 @@ static int do_put(char *rname, char *lname, BOOL reput) DEBUG(1,("putting file %s as %s ",lname, rname)); - buf = (char *)malloc(maxwrite); + buf = (uint8_t *)malloc(maxwrite); if (!buf) { d_printf("ERROR: Not enough memory!\n"); return 1; -- cgit