Module Name: src
Committed By: christos
Date: Fri Feb 3 21:36:41 UTC 2012
Modified Files:
src/external/bsd/ntp/dist/libopts: autoopts.h
src/external/bsd/ntp/dist/sntp/libopts: autoopts.c autoopts.h
configfile.c enumeration.c file.c load.c makeshell.c nested.c
parse-duration.c putshell.c reset.c save.c streqvcmp.c tokenize.c
src/external/bsd/ntp/dist/sntp/libopts/autoopts: options.h
src/external/bsd/ntp/dist/sntp/libopts/compat: pathfind.c
Log Message:
cleanup compilation (not TRT, but the expedient way)
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/libopts/autoopts.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/ntp/dist/sntp/libopts/autoopts.c \
src/external/bsd/ntp/dist/sntp/libopts/configfile.c \
src/external/bsd/ntp/dist/sntp/libopts/enumeration.c \
src/external/bsd/ntp/dist/sntp/libopts/file.c \
src/external/bsd/ntp/dist/sntp/libopts/load.c \
src/external/bsd/ntp/dist/sntp/libopts/makeshell.c \
src/external/bsd/ntp/dist/sntp/libopts/putshell.c \
src/external/bsd/ntp/dist/sntp/libopts/reset.c \
src/external/bsd/ntp/dist/sntp/libopts/streqvcmp.c \
src/external/bsd/ntp/dist/sntp/libopts/tokenize.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/sntp/libopts/autoopts.h \
src/external/bsd/ntp/dist/sntp/libopts/nested.c \
src/external/bsd/ntp/dist/sntp/libopts/save.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/ntp/dist/sntp/libopts/parse-duration.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/ntp/dist/sntp/libopts/compat/pathfind.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/ntp/dist/libopts/autoopts.h
diff -u src/external/bsd/ntp/dist/libopts/autoopts.h:1.2 src/external/bsd/ntp/dist/libopts/autoopts.h:1.3
--- src/external/bsd/ntp/dist/libopts/autoopts.h:1.2 Sat Dec 4 18:08:34 2010
+++ src/external/bsd/ntp/dist/libopts/autoopts.h Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: autoopts.h,v 1.2 2010/12/04 23:08:34 christos Exp $ */
+/* $NetBSD: autoopts.h,v 1.3 2012/02/03 21:36:40 christos Exp $ */
/*
@@ -215,10 +215,7 @@ typedef struct {
#define AGALOC( c, w ) ao_malloc((size_t)c)
#define AGREALOC( p, c, w ) ao_realloc((void*)p, (size_t)c)
-#define AGFREE(_p) do{ \
- void *X = (void*)(intptr_t)_p; \
- ao_free(X);\
-} while (/*CONSTCOND*/0)
+#define AGFREE(_p) ao_free((void*)(intptr_t)(p))
#define AGDUPSTR( p, s, w ) (p = ao_strdup(s))
static void *
Index: src/external/bsd/ntp/dist/sntp/libopts/autoopts.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/autoopts.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/autoopts.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/autoopts.c:1.1.1.2 Tue Jan 31 16:27:48 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/autoopts.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: autoopts.c,v 1.1.1.2 2012/01/31 21:27:48 kardel Exp $ */
+/* $NetBSD: autoopts.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/**
@@ -37,7 +37,7 @@
#endif
static char const zNil[] = "";
-static arg_types_t argTypes = { NULL };
+static arg_types_t argTypes = { .pzStr = NULL };
static char zOptFmtLine[16] = { NUL };
static ag_bool displayEnum = AG_FALSE;
static char const pkgdatadir_default[] = PKGDATADIR;
@@ -180,7 +180,8 @@ handle_opt(tOptions* pOpts, tOptState* p
* THEN we have a usage problem.
*/
if (p->optActualIndex != pOD->optIndex) {
- fprintf(stderr, (char*)zMultiEquiv, p->pz_Name, pOD->pz_Name,
+ fprintf(stderr, (const char*)zMultiEquiv, p->pz_Name,
+ pOD->pz_Name,
(pOpts->pOptDesc + p->optActualIndex)->pz_Name);
return FAILURE;
}
@@ -273,7 +274,7 @@ longOptionFind(tOptions* pOpts, char* pz
int idxLim = pOpts->optCt;
int matchCt = 0;
int matchIdx = 0;
- int nameLen;
+ size_t nameLen;
char opt_name_buf[128];
/*
@@ -281,7 +282,7 @@ longOptionFind(tOptions* pOpts, char* pz
* copy it off so we can NUL terminate.
*/
if (pzEq != NULL) {
- nameLen = (int)(pzEq - pzOptName);
+ nameLen = (size_t)(pzEq - pzOptName);
if (nameLen >= sizeof(opt_name_buf))
return FAILURE;
memcpy(opt_name_buf, pzOptName, nameLen);
@@ -517,7 +518,7 @@ findOptDesc(tOptions* pOpts, tOptState*
* strip off the "const" quality of the "default_opt" field.
*/
while (*(++pz) == '-') ;
- def_opt = (void *)&(pOpts->specOptIdx.default_opt);
+ def_opt = (void *)(intptr_t)&(pOpts->specOptIdx.default_opt);
def = *def_opt;
*def_opt = NO_EQUIVALENT;
res = longOptionFind(pOpts, pz, pOptState);
Index: src/external/bsd/ntp/dist/sntp/libopts/configfile.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/configfile.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/configfile.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/configfile.c:1.1.1.2 Tue Jan 31 16:27:51 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/configfile.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: configfile.c,v 1.1.1.2 2012/01/31 21:27:51 kardel Exp $ */
+/* $NetBSD: configfile.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/**
* \file configfile.c
@@ -179,7 +179,7 @@ optionFindValue(const tOptDesc* pOptDesc
else do {
tArgList* pAL = pOptDesc->optCookie;
int ct = pAL->useCt;
- void** ppOV = (void**)(pAL->apzArgs);
+ void** ppOV = (void**)(intptr_t)(pAL->apzArgs);
if (ct == 0) {
errno = ENOENT;
@@ -256,7 +256,7 @@ optionFindNextValue(const tOptDesc * pOp
else do {
tArgList* pAL = pOptDesc->optCookie;
int ct = pAL->useCt;
- void** ppOV = (void**)pAL->apzArgs;
+ void** ppOV = (void**)(intptr_t)pAL->apzArgs;
if (ct == 0) {
errno = ENOENT;
@@ -319,7 +319,7 @@ optionGetValue(const tOptionValue* pOld,
if (pAL->useCt > 0) {
int ct = pAL->useCt;
- void** papOV = (void**)(pAL->apzArgs);
+ void** papOV = (void**)(intptr_t)(pAL->apzArgs);
if (pzValName == NULL) {
pRes = (tOptionValue*)*papOV;
@@ -380,7 +380,7 @@ optionNextValue(tOptionValue const * pOV
pAL = pOVList->v.nestVal;
{
int ct = pAL->useCt;
- void** papNV = (void**)(pAL->apzArgs);
+ void** papNV = (void**)(intptr_t)(pAL->apzArgs);
while (ct-- > 0) {
tOptionValue* pNV = *(papNV++);
@@ -1099,7 +1099,7 @@ optionFileLoad(tOptions* pOpts, char con
{
char const ** pp =
- (char const **)(void *)&(pOpts->pzProgName);
+ (char const **)(intptr_t)&(pOpts->pzProgName);
*pp = pzProgram;
}
@@ -1384,12 +1384,12 @@ validateOptionsStruct(tOptions* pOpts, c
if (pOpts->pzProgName == NULL) {
char const * pz = strrchr(pzProgram, DIRCH);
char const ** pp =
- (char const **)(void **)&(pOpts->pzProgName);
+ (char const **)(intptr_t)&(pOpts->pzProgName);
if (pz == NULL)
*pp = pzProgram;
else *pp = pz+1;
- pp = (char const **)(void **)&(pOpts->pzProgPath);
+ pp = (char const **)(intptr_t)&(pOpts->pzProgPath);
*pp = pzProgram;
/*
Index: src/external/bsd/ntp/dist/sntp/libopts/enumeration.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/enumeration.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/enumeration.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/enumeration.c:1.1.1.2 Tue Jan 31 16:27:45 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/enumeration.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: enumeration.c,v 1.1.1.2 2012/01/31 21:27:45 kardel Exp $ */
+/* $NetBSD: enumeration.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/**
@@ -127,7 +127,7 @@ enum_err(tOptions * pOpts, tOptDesc * pO
* Otherwise, columnize the output
*/
else {
- int ent_no = 0;
+ size_t ent_no = 0;
char zFmt[16]; /* format for all-but-last entries on a line */
sprintf(zFmt, "%%-%ds", (int)max_len);
@@ -178,11 +178,11 @@ find_name(char const * pzName, tOptions
* The result gets stashed in a char* pointer.
*/
uintptr_t res = name_ct;
- size_t len = strlen((char*)pzName);
+ size_t len = strlen(pzName);
uintptr_t idx;
if (IS_DEC_DIGIT_CHAR(*pzName)) {
- char * pz = (char *)(void *)pzName;
+ char * pz = (char *)(intptr_t)pzName;
unsigned long val = strtoul(pz, &pz, 0);
if ((*pz == NUL) && (val < name_ct))
return (uintptr_t)val;
@@ -195,11 +195,11 @@ find_name(char const * pzName, tOptions
* Multiple partial matches means we have an ambiguous match.
*/
for (idx = 0; idx < name_ct; idx++) {
- if (strncmp((char*)paz_names[idx], (char*)pzName, len) == 0) {
+ if (strncmp(paz_names[idx], pzName, len) == 0) {
if (paz_names[idx][len] == NUL)
return idx; /* full match */
- res = (res != name_ct) ? ~0 : idx; /* save partial match */
+ res = (res != name_ct) ? (uintptr_t)~0 : idx; /* save partial match */
}
}
@@ -330,7 +330,7 @@ set_memb_shell(tOptions * pOpts, tOptDes
/*
* print the name string.
*/
- int ix = 0;
+ size_t ix = 0;
uintptr_t bits = (uintptr_t)pOD->optCookie;
size_t len = 0;
@@ -355,7 +355,7 @@ set_memb_names(tOptions * pOpts, tOptDes
char * pz;
uintptr_t bits = (uintptr_t)pOD->optCookie;
- int ix = 0;
+ size_t ix = 0;
size_t len = sizeof(none);
bits &= ((uintptr_t)1 << (uintptr_t)name_ct) - (uintptr_t)1;
@@ -479,7 +479,7 @@ optionSetMembers(tOptions * pOpts, tOptD
if (pz != pzArg + len) {
char z[ AO_NAME_SIZE ];
char const* p;
- int shift_ct;
+ size_t shift_ct;
if (*pz != NUL) {
if (len >= AO_NAME_LIMIT)
Index: src/external/bsd/ntp/dist/sntp/libopts/file.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/file.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/file.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/file.c:1.1.1.2 Tue Jan 31 16:27:51 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/file.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: file.c,v 1.1.1.2 2012/01/31 21:27:51 kardel Exp $ */
+/* $NetBSD: file.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/**
@@ -136,7 +136,7 @@ optionFileCheck(tOptions* pOpts, tOptDes
}
if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0)
- pOD->optCookie = (void *)pOD->optArg.argString;
+ pOD->optCookie = (void *)(intptr_t)pOD->optArg.argString;
else
AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name");
@@ -156,7 +156,7 @@ optionFileCheck(tOptions* pOpts, tOptDes
}
if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0)
- pOD->optCookie = (void *)pOD->optArg.argString;
+ pOD->optCookie = (void *)(intptr_t)pOD->optArg.argString;
else
AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name");
Index: src/external/bsd/ntp/dist/sntp/libopts/load.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/load.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/load.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/load.c:1.1.1.2 Tue Jan 31 16:27:50 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/load.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: load.c,v 1.1.1.2 2012/01/31 21:27:50 kardel Exp $ */
+/* $NetBSD: load.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/**
@@ -32,11 +32,11 @@
/* = = = START-STATIC-FORWARD = = = */
static ag_bool
-insertProgramPath(char * pzBuf, int bufSize, char const * pzName,
+insertProgramPath(char * pzBuf, size_t bufSize, char const * pzName,
char const * pzProgPath);
static ag_bool
-insertEnvVal(char * pzBuf, int bufSize, char const * pzName,
+insertEnvVal(char * pzBuf, size_t bufSize, char const * pzName,
char const * pzProgPath);
static char*
@@ -95,7 +95,7 @@ assembleArgValue(char* pzTxt, tOptionLoa
* errors (cannot resolve the resulting path).
=*/
ag_bool
-optionMakePath(char * pzBuf, int bufSize, char const * pzName,
+optionMakePath(char * pzBuf, size_t bufSize, char const * pzName,
char const * pzProgPath)
{
size_t name_len = strlen(pzName);
@@ -137,7 +137,7 @@ optionMakePath(char * pzBuf, int bufSize
if (program_pkgdatadir[0] == NUL)
return AG_FALSE;
- if (snprintf(pzBuf, bufSize, "%s%s", program_pkgdatadir, pzName + 2)
+ if ((size_t)snprintf(pzBuf, bufSize, "%s%s", program_pkgdatadir, pzName + 2)
>= bufSize)
return AG_FALSE;
break;
@@ -183,7 +183,7 @@ optionMakePath(char * pzBuf, int bufSize
static ag_bool
-insertProgramPath(char * pzBuf, int bufSize, char const * pzName,
+insertProgramPath(char * pzBuf, size_t bufSize, char const * pzName,
char const * pzProgPath)
{
char const* pzPath;
@@ -207,7 +207,7 @@ insertProgramPath(char * pzBuf, int bufS
if (strchr(pzProgPath, DIRCH) != NULL)
pzPath = pzProgPath;
else {
- pzPath = pathfind(getenv("PATH"), (char*)pzProgPath, "rx");
+ pzPath = pathfind(getenv("PATH"), pzProgPath, "rx");
if (pzPath == NULL)
return AG_FALSE;
@@ -245,7 +245,7 @@ insertProgramPath(char * pzBuf, int bufS
static ag_bool
-insertEnvVal(char * pzBuf, int bufSize, char const * pzName,
+insertEnvVal(char * pzBuf, size_t bufSize, char const * pzName,
char const * pzProgPath)
{
char* pzDir = pzBuf;
Index: src/external/bsd/ntp/dist/sntp/libopts/makeshell.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/makeshell.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/makeshell.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/makeshell.c:1.1.1.2 Tue Jan 31 16:27:47 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/makeshell.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: makeshell.c,v 1.1.1.2 2012/01/31 21:27:47 kardel Exp $ */
+/* $NetBSD: makeshell.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/**
@@ -653,13 +653,13 @@ emitUsage(tOptions* pOpts)
char ** pp;
for (;;) {
- if ((*pzPN++ = tolower(*pz++)) == '\0')
+ if ((*pzPN++ = tolower((unsigned char)*pz++)) == '\0')
break;
}
- pp = (char **)(void *)&(pOpts->pzProgPath);
+ pp = (char **)(intptr_t)&(pOpts->pzProgPath);
*pp = zTimeBuf;
- pp = (char **)(void *)&(pOpts->pzProgName);
+ pp = (char **)(intptr_t)&(pOpts->pzProgName);
*pp = zTimeBuf;
}
@@ -871,8 +871,8 @@ emitMatchExpr(tCC* pzMatchName, tOptDesc
* They must not be the same. They cannot be, because it would
* not compile correctly if they were.
*/
- while ( toupper(pOD->pz_Name[matchCt])
- == toupper(pzMatchName[matchCt]))
+ while ( toupper((unsigned char)pOD->pz_Name[matchCt])
+ == toupper((unsigned char)pzMatchName[matchCt]))
matchCt++;
if (matchCt > min)
@@ -883,8 +883,8 @@ emitMatchExpr(tCC* pzMatchName, tOptDesc
*/
if (pOD->pz_DisableName != NULL) {
matchCt = 0;
- while ( toupper(pOD->pz_DisableName[matchCt])
- == toupper(pzMatchName[matchCt]))
+ while ( toupper((unsigned char)pOD->pz_DisableName[matchCt])
+ == toupper((unsigned char)pzMatchName[matchCt]))
matchCt++;
if (matchCt > min)
min = matchCt;
@@ -1099,11 +1099,11 @@ genshelloptUsage(tOptions * pOpts, int e
*/
{
char * pz;
- char ** pp = (char **)(void *)&(optionParseShellOptions->pzProgName);
+ char ** pp = (char **)(intptr_t)&(optionParseShellOptions->pzProgName);
AGDUPSTR(pz, optionParseShellOptions->pzPROGNAME, "program name");
*pp = pz;
while (*pz != NUL) {
- *pz = tolower(*pz);
+ *pz = tolower((unsigned char)*pz);
pz++;
}
}
Index: src/external/bsd/ntp/dist/sntp/libopts/putshell.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/putshell.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/putshell.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/putshell.c:1.1.1.2 Tue Jan 31 16:27:55 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/putshell.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: putshell.c,v 1.1.1.2 2012/01/31 21:27:55 kardel Exp $ */
+/* $NetBSD: putshell.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/**
@@ -192,7 +192,7 @@ print_stacked_arg(tOptions * pOpts, tOpt
static void
print_reordering(tOptions * pOpts)
{
- int optIx;
+ size_t optIx;
fputs("set --", stdout);
Index: src/external/bsd/ntp/dist/sntp/libopts/reset.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/reset.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/reset.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/reset.c:1.1.1.2 Tue Jan 31 16:27:48 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/reset.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: reset.c,v 1.1.1.2 2012/01/31 21:27:48 kardel Exp $ */
+/* $NetBSD: reset.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/**
@@ -110,7 +110,7 @@ optionResetOpt( tOptions* pOpts, tOptDes
assert(0 == 1);
}
} else {
- succ = longOptionFind(pOpts, (char *)pzArg, &opt_state);
+ succ = longOptionFind(pOpts, (char *)(intptr_t)pzArg, &opt_state);
if (! SUCCESSFUL(succ)) {
fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg);
pOpts->pUsageProc(pOpts, EXIT_FAILURE);
Index: src/external/bsd/ntp/dist/sntp/libopts/streqvcmp.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/streqvcmp.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/streqvcmp.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/streqvcmp.c:1.1.1.2 Tue Jan 31 16:27:54 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/streqvcmp.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: streqvcmp.c,v 1.1.1.2 2012/01/31 21:27:54 kardel Exp $ */
+/* $NetBSD: streqvcmp.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/**
@@ -194,8 +194,8 @@ streqvmap(char From, char To, int ct)
}
else {
- int chTo = (int)To & 0xFF;
- int chFrom = (int)From & 0xFF;
+ size_t chTo = (int)To & 0xFF;
+ size_t chFrom = (int)From & 0xFF;
do {
charmap[ chFrom ] = (unsigned)chTo;
Index: src/external/bsd/ntp/dist/sntp/libopts/tokenize.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/tokenize.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/tokenize.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/tokenize.c:1.1.1.2 Tue Jan 31 16:27:45 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/tokenize.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: tokenize.c,v 1.1.1.2 2012/01/31 21:27:45 kardel Exp $ */
+/* $NetBSD: tokenize.c,v 1.2 2012/02/03 21:36:40 christos Exp $ */
/*
* This file defines the string_tokenize interface
@@ -54,7 +54,7 @@ copy_cooked(ch_t** ppDest, char const **
case NUL: *ppSrc = NULL; return;
case '"': goto done;
case '\\':
- pSrc += ao_string_cook_escape_char((char*)pSrc, (char*)&ch, 0x7F);
+ pSrc += ao_string_cook_escape_char((char*)(intptr_t)pSrc, (char*)(intptr_t)&ch, 0x7F);
if (ch == 0x7F)
break;
/* FALLTHROUGH */
Index: src/external/bsd/ntp/dist/sntp/libopts/autoopts.h
diff -u src/external/bsd/ntp/dist/sntp/libopts/autoopts.h:1.3 src/external/bsd/ntp/dist/sntp/libopts/autoopts.h:1.4
--- src/external/bsd/ntp/dist/sntp/libopts/autoopts.h:1.3 Wed Feb 1 02:46:23 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/autoopts.h Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: autoopts.h,v 1.3 2012/02/01 07:46:23 kardel Exp $ */
+/* $NetBSD: autoopts.h,v 1.4 2012/02/03 21:36:40 christos Exp $ */
/*
@@ -185,7 +185,7 @@ typedef struct {
#define AGALOC(c, w) ao_malloc((size_t)c)
#define AGREALOC(p, c, w) ao_realloc((void*)p, (size_t)c)
-#define AGFREE(_p) free((void *)_p)
+#define AGFREE(p) free((void *)(intptr_t)p)
#define AGDUPSTR(p, s, w) (p = ao_strdup(s))
static void *
Index: src/external/bsd/ntp/dist/sntp/libopts/nested.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/nested.c:1.3 src/external/bsd/ntp/dist/sntp/libopts/nested.c:1.4
--- src/external/bsd/ntp/dist/sntp/libopts/nested.c:1.3 Wed Feb 1 02:46:23 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/nested.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: nested.c,v 1.3 2012/02/01 07:46:23 kardel Exp $ */
+/* $NetBSD: nested.c,v 1.4 2012/02/03 21:36:40 christos Exp $ */
/**
@@ -426,7 +426,7 @@ scan_xml(char const* pzName, tOptionValu
case ' ':
case '\t':
pzScan = parseAttributes(
- NULL, (char*)pzScan, &option_load_mode, &valu );
+ NULL, (char *)(intptr_t)pzScan, &option_load_mode, &valu );
if (*pzScan == '>') {
pzScan++;
break;
@@ -541,7 +541,7 @@ unload_arg_list(tArgList* pAL)
tCC** ppNV = pAL->apzArgs;
while (ct-- > 0) {
- tOptionValue* pNV = (tOptionValue*)(void*)*(ppNV++);
+ tOptionValue* pNV = (tOptionValue*)(intptr_t)*(ppNV++);
if (pNV->valType == OPARG_TYPE_HIERARCHY)
unload_arg_list(pNV->v.nestVal);
AGFREE(pNV);
@@ -571,7 +571,7 @@ optionUnloadNested(tOptionValue const *
unload_arg_list(pOV->v.nestVal);
- AGFREE((void*)pOV);
+ AGFREE(pOV);
}
/**
@@ -590,8 +590,8 @@ sort_list(tArgList* pAL)
*/
for (ix = 0; ++ix < lm;) {
int iy = ix-1;
- tOptionValue* pNewNV = (tOptionValue*)(void*)(pAL->apzArgs[ix]);
- tOptionValue* pOldNV = (tOptionValue*)(void*)(pAL->apzArgs[iy]);
+ tOptionValue* pNewNV = (tOptionValue*)(intptr_t)(pAL->apzArgs[ix]);
+ tOptionValue* pOldNV = (tOptionValue*)(intptr_t)(pAL->apzArgs[iy]);
/*
* For as long as the new entry precedes the "old" entry,
@@ -600,7 +600,7 @@ sort_list(tArgList* pAL)
*/
while (strcmp(pOldNV->pzName, pNewNV->pzName) > 0) {
pAL->apzArgs[iy+1] = (void*)pOldNV;
- pOldNV = (tOptionValue*)(void*)(pAL->apzArgs[--iy]);
+ pOldNV = (tOptionValue*)(intptr_t)(pAL->apzArgs[--iy]);
if (iy < 0)
break;
}
@@ -727,7 +727,7 @@ optionNestedVal(tOptions* pOpts, tOptDes
av = pAL->apzArgs;
while (--ct >= 0) {
- void * p = (void *)*(av++);
+ void * p = (void *)(intptr_t)*(av++);
optionUnloadNested((tOptionValue const *)p);
}
@@ -762,7 +762,7 @@ get_special_char(char const ** ppz, int
base = 16;
pz++;
}
- retch = (int)strtoul(pz, (char **)&pz, base);
+ retch = (int)strtoul(pz, (char **)(intptr_t)&pz, base);
if (*pz != ';')
return '&';
base = ++pz - *ppz;
Index: src/external/bsd/ntp/dist/sntp/libopts/save.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/save.c:1.3 src/external/bsd/ntp/dist/sntp/libopts/save.c:1.4
--- src/external/bsd/ntp/dist/sntp/libopts/save.c:1.3 Wed Feb 1 02:46:23 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/save.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: save.c,v 1.3 2012/02/01 07:46:23 kardel Exp $ */
+/* $NetBSD: save.c,v 1.4 2012/02/03 21:36:40 christos Exp $ */
/*
@@ -186,7 +186,7 @@ findFileName(tOptions * pOpts, int * p_f
fprintf(stderr, zWarn, pOpts->pzProgName);
fprintf(stderr, zNoStat, errno, strerror(errno), pzDir);
if (free_dir_name)
- AGFREE((void*)pzDir);
+ AGFREE(pzDir);
return NULL;
}
@@ -200,7 +200,7 @@ findFileName(tOptions * pOpts, int * p_f
break; /* found directory -- viz., "." */
}
- if ((dirchp - pzDir) >= sizeof(z))
+ if ((size_t)(dirchp - pzDir) >= sizeof(z))
goto bogus_name;
memcpy(z, pzDir, (size_t)(dirchp - pzDir));
@@ -226,7 +226,7 @@ findFileName(tOptions * pOpts, int * p_f
sprintf(pzPath, "%s/%s", pzDir, pOpts->pzRcName);
#endif
if (free_dir_name)
- AGFREE((void*)pzDir);
+ AGFREE(pzDir);
pzDir = pzPath;
free_dir_name = 1;
}
@@ -240,7 +240,7 @@ findFileName(tOptions * pOpts, int * p_f
fprintf(stderr, zWarn, pOpts->pzProgName);
fprintf(stderr, zNoStat, errno, strerror(errno),
pzDir);
- AGFREE((void*)pzDir);
+ AGFREE(pzDir);
return NULL;
}
@@ -259,7 +259,7 @@ findFileName(tOptions * pOpts, int * p_f
fprintf(stderr, zWarn, pOpts->pzProgName);
fprintf(stderr, zNotFile, pzDir);
if (free_dir_name)
- AGFREE((void*)pzDir);
+ AGFREE(pzDir);
return NULL;
}
@@ -378,7 +378,7 @@ print_a_value(FILE * fp, int depth, tOpt
/*
* set membership strings get allocated
*/
- AGFREE((void*)pOD->optArg.argString);
+ AGFREE(pOD->optArg.argString);
}
}
@@ -454,7 +454,7 @@ printValueList(FILE * fp, char const * n
if (al == NULL)
return;
opt_ct = al->useCt;
- opt_list = (void **)al->apzArgs;
+ opt_list = (void **)(intptr_t)al->apzArgs;
if (opt_ct <= 0) {
fprintf(fp, "<%s/>\n", name);
@@ -488,7 +488,7 @@ printHierarchy(FILE * fp, tOptDesc * p)
return;
opt_ct = al->useCt;
- opt_list = (void **)al->apzArgs;
+ opt_list = (void **)(intptr_t)al->apzArgs;
if (opt_ct <= 0)
return;
@@ -529,12 +529,12 @@ openSaveFile(tOptions* pOpts)
fprintf(stderr, zWarn, pOpts->pzProgName);
fprintf(stderr, zNoCreat, errno, strerror(errno), pzFName);
if (free_name)
- AGFREE( pzFName );
+ AGFREE(pzFName);
return fp;
}
if (free_name)
- AGFREE((void*)pzFName);
+ AGFREE(pzFName);
}
{
@@ -613,7 +613,7 @@ printEnumArg(FILE * fp, tOptDesc * pOD)
* bit flag values back into a string suitable for printing.
*/
(*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD);
- printEntry(fp, pOD, (void*)(pOD->optArg.argString));
+ printEntry(fp, pOD, (void*)(intptr_t)(pOD->optArg.argString));
pOD->optArg.argEnum = val;
}
@@ -628,13 +628,13 @@ printSetMemberArg(FILE * fp, tOptDesc *
* bit flag values back into a string suitable for printing.
*/
(*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD);
- printEntry(fp, pOD, (void*)(pOD->optArg.argString));
+ printEntry(fp, pOD, (void*)(intptr_t)(pOD->optArg.argString));
if (pOD->optArg.argString != NULL) {
/*
* set membership strings get allocated
*/
- AGFREE((void*)pOD->optArg.argString);
+ AGFREE(pOD->optArg.argString);
pOD->fOptState &= ~OPTST_ALLOC_ARG;
}
Index: src/external/bsd/ntp/dist/sntp/libopts/parse-duration.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/parse-duration.c:1.2 src/external/bsd/ntp/dist/sntp/libopts/parse-duration.c:1.3
--- src/external/bsd/ntp/dist/sntp/libopts/parse-duration.c:1.2 Wed Feb 1 02:46:23 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/parse-duration.c Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: parse-duration.c,v 1.2 2012/02/01 07:46:23 kardel Exp $ */
+/* $NetBSD: parse-duration.c,v 1.3 2012/02/03 21:36:40 christos Exp $ */
/* Parse a time duration and return a seconds count
Copyright (C) 2008-2011 Free Software Foundation, Inc.
@@ -59,20 +59,20 @@ typedef enum {
inline static unsigned long
str_const_to_ul (cch_t * str, cch_t ** ppz, int base)
{
- return strtoul (str, (char **)ppz, base);
+ return strtoul (str, (char **)(intptr_t)ppz, base);
}
/* Wrapper around strtol that does not require a cast. */
-static long inline
+inline static long
str_const_to_l (cch_t * str, cch_t ** ppz, int base)
{
- return strtol (str, (char **)ppz, base);
+ return strtol (str, (char **)(intptr_t)ppz, base);
}
/* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME
with errno set as an error situation, and returning BAD_TIME
with errno set in an error situation. */
-static time_t inline
+inline static time_t
scale_n_add (time_t base, time_t val, int scale)
{
if (base == BAD_TIME)
Index: src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h
diff -u src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.4 src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.5
--- src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.4 Wed Feb 1 15:48:01 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h Fri Feb 3 16:36:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: options.h,v 1.4 2012/02/01 20:48:01 kardel Exp $ */
+/* $NetBSD: options.h,v 1.5 2012/02/03 21:36:40 christos Exp $ */
/* -*- buffer-read-only: t -*- vi: set ro:
*
@@ -1022,7 +1022,7 @@ extern char const * optionKeywordName(tO
extern void optionLoadOpt(tOptions*, tOptDesc*);
-extern ag_bool optionMakePath(char*, int, char const*, char const*);
+extern ag_bool optionMakePath(char*, size_t, char const*, char const*);
extern void optionNestedVal(tOptions*, tOptDesc*);
Index: src/external/bsd/ntp/dist/sntp/libopts/compat/pathfind.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/compat/pathfind.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/compat/pathfind.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/compat/pathfind.c:1.1.1.2 Tue Jan 31 16:27:55 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/compat/pathfind.c Fri Feb 3 16:36:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pathfind.c,v 1.1.1.2 2012/01/31 21:27:55 kardel Exp $ */
+/* $NetBSD: pathfind.c,v 1.2 2012/02/03 21:36:41 christos Exp $ */
/* -*- Mode: C -*- */
@@ -311,7 +311,7 @@ extract_colon_unit( char* pzDir, char co
goto copy_done;
}
- if ((pzDest - pzDir) >= AG_PATH_MAX)
+ if ((size_t)(pzDest - pzDir) >= AG_PATH_MAX)
break;
} copy_done:;