diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-07-25 18:47:40 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:28:59 -0500 |
commit | 70faa40a2dc67344d530dec8d12186cdf177ee4a (patch) | |
tree | 8aae9ae02b5572e30c2e58205347412bb808c2c7 /source3/popt/poptparse.c | |
parent | 5e066d5ee1b2e8d15a7af80313eb2b622a511b00 (diff) | |
download | samba-70faa40a2dc67344d530dec8d12186cdf177ee4a.tar.gz samba-70faa40a2dc67344d530dec8d12186cdf177ee4a.tar.bz2 samba-70faa40a2dc67344d530dec8d12186cdf177ee4a.zip |
r24048: Fix the C++ warnings in our version of popt
(This used to be commit fd3683c1b3d89a47d59643b0f5751726cb2c89f9)
Diffstat (limited to 'source3/popt/poptparse.c')
-rw-r--r-- | source3/popt/poptparse.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/popt/poptparse.c b/source3/popt/poptparse.c index 537ec44398..b03deef085 100644 --- a/source3/popt/poptparse.c +++ b/source3/popt/poptparse.c @@ -27,10 +27,10 @@ int poptDupArgv(int argc, const char **argv, nb += strlen(argv[i]) + 1; } - dst = malloc(nb); + dst = (char *)malloc(nb); if (dst == NULL) /* XXX can't happen */ return POPT_ERROR_MALLOC; - argv2 = (void *) dst; + argv2 = (const char **) dst; dst += (argc + 1) * sizeof(*argv); /*@-branchstate@*/ @@ -59,10 +59,10 @@ int poptParseArgvString(const char * s, int * argcPtr, const char *** argvPtr) const char * src; char quote = '\0'; int argvAlloced = POPT_ARGV_ARRAY_GROW_DELTA; - const char ** argv = malloc(sizeof(*argv) * argvAlloced); + const char ** argv = (const char **)malloc(sizeof(*argv) * argvAlloced); int argc = 0; int buflen = strlen(s) + 1; - char * buf = memset(alloca(buflen), 0, buflen); + char * buf = (char*)memset(alloca(buflen), 0, buflen); int rc = POPT_ERROR_MALLOC; if (argv == NULL) return rc; @@ -86,7 +86,7 @@ int poptParseArgvString(const char * s, int * argcPtr, const char *** argvPtr) buf++, argc++; if (argc == argvAlloced) { argvAlloced += POPT_ARGV_ARRAY_GROW_DELTA; - argv = realloc(argv, sizeof(*argv) * argvAlloced); + argv = (const char **)realloc(argv, sizeof(*argv) * argvAlloced); if (argv == NULL) goto exit; } argv[argc] = buf; @@ -149,7 +149,7 @@ int poptConfigFileToString(FILE *fp, char ** argstrp, /*@unused@*/ int flags) if (fp == NULL) return POPT_ERROR_NULLARG; - argstr = calloc(maxargvlen, sizeof(*argstr)); + argstr = (char *)calloc(maxargvlen, sizeof(*argstr)); if (argstr == NULL) return POPT_ERROR_MALLOC; while (fgets(line, (int)maxlinelen, fp) != NULL) { @@ -183,7 +183,7 @@ int poptConfigFileToString(FILE *fp, char ** argstrp, /*@unused@*/ int flags) argvlen += (t = q - p) + (sizeof(" --")-1); if (argvlen >= maxargvlen) { maxargvlen = (t > maxargvlen) ? t*2 : maxargvlen*2; - argstr = realloc(argstr, maxargvlen); + argstr = (char *)realloc(argstr, maxargvlen); if (argstr == NULL) return POPT_ERROR_MALLOC; } strcat(argstr, " --"); @@ -212,7 +212,7 @@ int poptConfigFileToString(FILE *fp, char ** argstrp, /*@unused@*/ int flags) argvlen += t + (sizeof("' --='")-1); if (argvlen >= maxargvlen) { maxargvlen = (t > maxargvlen) ? t*2 : maxargvlen*2; - argstr = realloc(argstr, maxargvlen); + argstr = (char *)realloc(argstr, maxargvlen); if (argstr == NULL) return POPT_ERROR_MALLOC; } strcat(argstr, " --"); |