COMP: Remove warnings about shadow variables
This commit is contained in:
parent
8946d2f55e
commit
588653c4e8
@ -320,12 +320,12 @@ CURLcode Curl_file(struct connectdata *conn)
|
|||||||
#ifdef HAVE_STRFTIME
|
#ifdef HAVE_STRFTIME
|
||||||
if(fstated) {
|
if(fstated) {
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
time_t clock = (time_t)statbuf.st_mtime;
|
time_t cuClock = (time_t)statbuf.st_mtime;
|
||||||
#ifdef HAVE_GMTIME_R
|
#ifdef HAVE_GMTIME_R
|
||||||
struct tm buffer;
|
struct tm buffer;
|
||||||
tm = (struct tm *)gmtime_r(&clock, &buffer);
|
tm = (struct tm *)gmtime_r(&cuClock, &buffer);
|
||||||
#else
|
#else
|
||||||
tm = gmtime(&clock);
|
tm = gmtime(&cuClock);
|
||||||
#endif
|
#endif
|
||||||
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
|
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
|
||||||
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",
|
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",
|
||||||
|
@ -2203,12 +2203,12 @@ CURLcode ftp_perform(struct connectdata *conn,
|
|||||||
#ifdef HAVE_STRFTIME
|
#ifdef HAVE_STRFTIME
|
||||||
if(data->set.get_filetime && (data->info.filetime>=0) ) {
|
if(data->set.get_filetime && (data->info.filetime>=0) ) {
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
time_t clock = (time_t)data->info.filetime;
|
time_t cuClock = (time_t)data->info.filetime;
|
||||||
#ifdef HAVE_GMTIME_R
|
#ifdef HAVE_GMTIME_R
|
||||||
struct tm buffer;
|
struct tm buffer;
|
||||||
tm = (struct tm *)gmtime_r(&clock, &buffer);
|
tm = (struct tm *)gmtime_r(&cuClock, &buffer);
|
||||||
#else
|
#else
|
||||||
tm = gmtime(&clock);
|
tm = gmtime(&cuClock);
|
||||||
#endif
|
#endif
|
||||||
/* format: "Tue, 15 Nov 1994 12:45:26" */
|
/* format: "Tue, 15 Nov 1994 12:45:26" */
|
||||||
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",
|
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",
|
||||||
|
@ -1410,8 +1410,8 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
uses the encoded host name! */
|
uses the encoded host name! */
|
||||||
if(conn->host.dispname != conn->host.name) {
|
if(conn->host.dispname != conn->host.name) {
|
||||||
char *url = data->change.url;
|
char *url = data->change.url;
|
||||||
char *ptr = strstr(url, conn->host.dispname);
|
char *iPtr = strstr(url, conn->host.dispname);
|
||||||
if(ptr) {
|
if(iPtr) {
|
||||||
/* This is where the display name starts in the URL, now replace this
|
/* This is where the display name starts in the URL, now replace this
|
||||||
part with the encoded name. TODO: This method of replacing the host
|
part with the encoded name. TODO: This method of replacing the host
|
||||||
name is rather crude as I believe there's a slight risk that the
|
name is rather crude as I believe there's a slight risk that the
|
||||||
@ -1426,13 +1426,13 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
newurl = malloc(urllen + newlen - currlen + 1);
|
newurl = malloc(urllen + newlen - currlen + 1);
|
||||||
if(newurl) {
|
if(newurl) {
|
||||||
/* copy the part before the host name */
|
/* copy the part before the host name */
|
||||||
memcpy(newurl, url, ptr - url);
|
memcpy(newurl, url, iPtr - url);
|
||||||
/* append the new host name instead of the old */
|
/* append the new host name instead of the old */
|
||||||
memcpy(newurl + (ptr - url), conn->host.name, newlen);
|
memcpy(newurl + (iPtr - url), conn->host.name, newlen);
|
||||||
/* append the piece after the host name */
|
/* append the piece after the host name */
|
||||||
memcpy(newurl + newlen + (ptr - url),
|
memcpy(newurl + newlen + (iPtr - url),
|
||||||
ptr + currlen, /* copy the trailing zero byte too */
|
iPtr + currlen, /* copy the trailing zero byte too */
|
||||||
urllen - (ptr-url) - currlen + 1);
|
urllen - (iPtr-url) - currlen + 1);
|
||||||
if(data->change.url_alloc)
|
if(data->change.url_alloc)
|
||||||
free(data->change.url);
|
free(data->change.url);
|
||||||
data->change.url = newurl;
|
data->change.url = newurl;
|
||||||
|
@ -88,10 +88,10 @@ struct curl_slist *curl_slist_append(struct curl_slist *list,
|
|||||||
|
|
||||||
new_item = (struct curl_slist *) malloc(sizeof(struct curl_slist));
|
new_item = (struct curl_slist *) malloc(sizeof(struct curl_slist));
|
||||||
if (new_item) {
|
if (new_item) {
|
||||||
char *dup = strdup(data);
|
char *cuDup = strdup(data);
|
||||||
if(dup) {
|
if(cuDup) {
|
||||||
new_item->next = NULL;
|
new_item->next = NULL;
|
||||||
new_item->data = dup;
|
new_item->data = cuDup;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
free(new_item);
|
free(new_item);
|
||||||
|
@ -83,7 +83,7 @@ typedef struct kwsysProcessCreateInformation_s
|
|||||||
static int kwsysProcessInitialize(kwsysProcess* cp);
|
static int kwsysProcessInitialize(kwsysProcess* cp);
|
||||||
static void kwsysProcessCleanup(kwsysProcess* cp, int error);
|
static void kwsysProcessCleanup(kwsysProcess* cp, int error);
|
||||||
static void kwsysProcessCleanupDescriptor(int* pfd);
|
static void kwsysProcessCleanupDescriptor(int* pfd);
|
||||||
static int kwsysProcessCreate(kwsysProcess* cp, int index,
|
static int kwsysProcessCreate(kwsysProcess* cp, int prIndex,
|
||||||
kwsysProcessCreateInformation* si, int* readEnd);
|
kwsysProcessCreateInformation* si, int* readEnd);
|
||||||
static int kwsysProcessSetupOutputPipeFile(int* p, const char* name);
|
static int kwsysProcessSetupOutputPipeFile(int* p, const char* name);
|
||||||
static int kwsysProcessGetTimeoutTime(kwsysProcess* cp, double* userTimeout,
|
static int kwsysProcessGetTimeoutTime(kwsysProcess* cp, double* userTimeout,
|
||||||
@ -397,14 +397,14 @@ int kwsysProcess_SetWorkingDirectory(kwsysProcess* cp, const char* dir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
int kwsysProcess_SetPipeFile(kwsysProcess* cp, int pipe, const char* file)
|
int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, const char* file)
|
||||||
{
|
{
|
||||||
char** pfile;
|
char** pfile;
|
||||||
if(!cp)
|
if(!cp)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
switch(pipe)
|
switch(prPipe)
|
||||||
{
|
{
|
||||||
case kwsysProcess_Pipe_STDIN: pfile = &cp->PipeFileSTDIN; break;
|
case kwsysProcess_Pipe_STDIN: pfile = &cp->PipeFileSTDIN; break;
|
||||||
case kwsysProcess_Pipe_STDOUT: pfile = &cp->PipeFileSTDOUT; break;
|
case kwsysProcess_Pipe_STDOUT: pfile = &cp->PipeFileSTDOUT; break;
|
||||||
@ -429,20 +429,20 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int pipe, const char* file)
|
|||||||
/* If we are redirecting the pipe, do not share it. */
|
/* If we are redirecting the pipe, do not share it. */
|
||||||
if(*pfile)
|
if(*pfile)
|
||||||
{
|
{
|
||||||
kwsysProcess_SetPipeShared(cp, pipe, 0);
|
kwsysProcess_SetPipeShared(cp, prPipe, 0);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
void kwsysProcess_SetPipeShared(kwsysProcess* cp, int pipe, int shared)
|
void kwsysProcess_SetPipeShared(kwsysProcess* cp, int prPipe, int shared)
|
||||||
{
|
{
|
||||||
if(!cp)
|
if(!cp)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(pipe)
|
switch(prPipe)
|
||||||
{
|
{
|
||||||
case kwsysProcess_Pipe_STDIN: cp->PipeSharedSTDIN = shared?1:0; break;
|
case kwsysProcess_Pipe_STDIN: cp->PipeSharedSTDIN = shared?1:0; break;
|
||||||
case kwsysProcess_Pipe_STDOUT: cp->PipeSharedSTDOUT = shared?1:0; break;
|
case kwsysProcess_Pipe_STDOUT: cp->PipeSharedSTDOUT = shared?1:0; break;
|
||||||
@ -453,7 +453,7 @@ void kwsysProcess_SetPipeShared(kwsysProcess* cp, int pipe, int shared)
|
|||||||
/* If we are sharing the pipe, do not redirect it to a file. */
|
/* If we are sharing the pipe, do not redirect it to a file. */
|
||||||
if(shared)
|
if(shared)
|
||||||
{
|
{
|
||||||
kwsysProcess_SetPipeFile(cp, pipe, 0);
|
kwsysProcess_SetPipeFile(cp, prPipe, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -954,7 +954,7 @@ int kwsysProcess_WaitForExit(kwsysProcess* cp, double* userTimeout)
|
|||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
int pipe = 0;
|
int prPipe = 0;
|
||||||
|
|
||||||
/* Make sure we are executing a process. */
|
/* Make sure we are executing a process. */
|
||||||
if(!cp || cp->State != kwsysProcess_State_Executing)
|
if(!cp || cp->State != kwsysProcess_State_Executing)
|
||||||
@ -963,9 +963,9 @@ int kwsysProcess_WaitForExit(kwsysProcess* cp, double* userTimeout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for all the pipes to close. Ignore all data. */
|
/* Wait for all the pipes to close. Ignore all data. */
|
||||||
while((pipe = kwsysProcess_WaitForData(cp, 0, 0, userTimeout)) > 0)
|
while((prPipe = kwsysProcess_WaitForData(cp, 0, 0, userTimeout)) > 0)
|
||||||
{
|
{
|
||||||
if(pipe == kwsysProcess_Pipe_Timeout)
|
if(prPipe == kwsysProcess_Pipe_Timeout)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1215,11 +1215,11 @@ static void kwsysProcessCleanupDescriptor(int* pfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
static int kwsysProcessCreate(kwsysProcess* cp, int index,
|
static int kwsysProcessCreate(kwsysProcess* cp, int prIndex,
|
||||||
kwsysProcessCreateInformation* si, int* readEnd)
|
kwsysProcessCreateInformation* si, int* readEnd)
|
||||||
{
|
{
|
||||||
/* Setup the process's stdin. */
|
/* Setup the process's stdin. */
|
||||||
if(index > 0)
|
if(prIndex > 0)
|
||||||
{
|
{
|
||||||
si->StdIn = *readEnd;
|
si->StdIn = *readEnd;
|
||||||
*readEnd = 0;
|
*readEnd = 0;
|
||||||
@ -1269,7 +1269,7 @@ static int kwsysProcessCreate(kwsysProcess* cp, int index,
|
|||||||
|
|
||||||
/* Replace the stdout pipe with a file if requested. In this case
|
/* Replace the stdout pipe with a file if requested. In this case
|
||||||
the select call will report that stdout is closed immediately. */
|
the select call will report that stdout is closed immediately. */
|
||||||
if(index == cp->NumberOfCommands-1 && cp->PipeFileSTDOUT)
|
if(prIndex == cp->NumberOfCommands-1 && cp->PipeFileSTDOUT)
|
||||||
{
|
{
|
||||||
if(!kwsysProcessSetupOutputPipeFile(&si->StdOut, cp->PipeFileSTDOUT))
|
if(!kwsysProcessSetupOutputPipeFile(&si->StdOut, cp->PipeFileSTDOUT))
|
||||||
{
|
{
|
||||||
@ -1280,7 +1280,7 @@ static int kwsysProcessCreate(kwsysProcess* cp, int index,
|
|||||||
/* Replace the stdout pipe with the parent's if requested. In this
|
/* Replace the stdout pipe with the parent's if requested. In this
|
||||||
case the select call will report that stderr is closed
|
case the select call will report that stderr is closed
|
||||||
immediately. */
|
immediately. */
|
||||||
if(index == cp->NumberOfCommands-1 && cp->PipeSharedSTDOUT)
|
if(prIndex == cp->NumberOfCommands-1 && cp->PipeSharedSTDOUT)
|
||||||
{
|
{
|
||||||
kwsysProcessCleanupDescriptor(&si->StdOut);
|
kwsysProcessCleanupDescriptor(&si->StdOut);
|
||||||
si->StdOut = 1;
|
si->StdOut = 1;
|
||||||
@ -1299,13 +1299,13 @@ static int kwsysProcessCreate(kwsysProcess* cp, int index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Fork off a child process. */
|
/* Fork off a child process. */
|
||||||
cp->ForkPIDs[index] = kwsysProcessFork(cp, si);
|
cp->ForkPIDs[prIndex] = kwsysProcessFork(cp, si);
|
||||||
if(cp->ForkPIDs[index] < 0)
|
if(cp->ForkPIDs[prIndex] < 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cp->ForkPIDs[index] == 0)
|
if(cp->ForkPIDs[prIndex] == 0)
|
||||||
{
|
{
|
||||||
/* Close the read end of the error reporting pipe. */
|
/* Close the read end of the error reporting pipe. */
|
||||||
close(si->ErrorPipe[0]);
|
close(si->ErrorPipe[0]);
|
||||||
@ -1340,7 +1340,7 @@ static int kwsysProcessCreate(kwsysProcess* cp, int index,
|
|||||||
kwsysProcessRestoreDefaultSignalHandlers();
|
kwsysProcessRestoreDefaultSignalHandlers();
|
||||||
|
|
||||||
/* Execute the real process. If successful, this does not return. */
|
/* Execute the real process. If successful, this does not return. */
|
||||||
execvp(cp->Commands[index][0], cp->Commands[index]);
|
execvp(cp->Commands[prIndex][0], cp->Commands[prIndex]);
|
||||||
|
|
||||||
/* Failure. Report error to parent and terminate. */
|
/* Failure. Report error to parent and terminate. */
|
||||||
kwsysProcessChildErrorExit(si->ErrorPipe[1]);
|
kwsysProcessChildErrorExit(si->ErrorPipe[1]);
|
||||||
@ -1378,7 +1378,7 @@ static int kwsysProcessCreate(kwsysProcess* cp, int index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Successfully created this child process. */
|
/* Successfully created this child process. */
|
||||||
if(index > 0 || si->StdIn > 0)
|
if(prIndex > 0 || si->StdIn > 0)
|
||||||
{
|
{
|
||||||
/* The parent process does not need the input pipe read end. */
|
/* The parent process does not need the input pipe read end. */
|
||||||
kwsysProcessCleanupDescriptor(&si->StdIn);
|
kwsysProcessCleanupDescriptor(&si->StdIn);
|
||||||
|
@ -472,7 +472,7 @@ xmlrpc_array_append_item (xmlrpc_env* const env,
|
|||||||
void
|
void
|
||||||
xmlrpc_array_read_item(xmlrpc_env * const envP,
|
xmlrpc_array_read_item(xmlrpc_env * const envP,
|
||||||
const xmlrpc_value * const arrayP,
|
const xmlrpc_value * const arrayP,
|
||||||
unsigned int const index,
|
unsigned int const xmIndex,
|
||||||
xmlrpc_value ** const valuePP);
|
xmlrpc_value ** const valuePP);
|
||||||
|
|
||||||
/* Get an item from an XML-RPC array.
|
/* Get an item from an XML-RPC array.
|
||||||
@ -482,7 +482,7 @@ xmlrpc_array_read_item(xmlrpc_env * const envP,
|
|||||||
xmlrpc_value *
|
xmlrpc_value *
|
||||||
xmlrpc_array_get_item(xmlrpc_env * const env,
|
xmlrpc_array_get_item(xmlrpc_env * const env,
|
||||||
const xmlrpc_value * const array,
|
const xmlrpc_value * const array,
|
||||||
int const index);
|
int const xmIndex);
|
||||||
|
|
||||||
/* Not implemented--we don't need it yet.
|
/* Not implemented--we don't need it yet.
|
||||||
extern
|
extern
|
||||||
@ -609,7 +609,7 @@ xmlrpc_struct_set_value_v(xmlrpc_env * const env,
|
|||||||
void
|
void
|
||||||
xmlrpc_struct_read_member(xmlrpc_env * const envP,
|
xmlrpc_struct_read_member(xmlrpc_env * const envP,
|
||||||
xmlrpc_value * const structP,
|
xmlrpc_value * const structP,
|
||||||
unsigned int const index,
|
unsigned int const xmIndex,
|
||||||
xmlrpc_value ** const keyvalP,
|
xmlrpc_value ** const keyvalP,
|
||||||
xmlrpc_value ** const valueP);
|
xmlrpc_value ** const valueP);
|
||||||
|
|
||||||
@ -622,7 +622,7 @@ xmlrpc_struct_read_member(xmlrpc_env * const envP,
|
|||||||
void
|
void
|
||||||
xmlrpc_struct_get_key_and_value(xmlrpc_env * const env,
|
xmlrpc_struct_get_key_and_value(xmlrpc_env * const env,
|
||||||
xmlrpc_value * const strct,
|
xmlrpc_value * const strct,
|
||||||
int const index,
|
int const xmIndex,
|
||||||
xmlrpc_value ** const out_keyval,
|
xmlrpc_value ** const out_keyval,
|
||||||
xmlrpc_value ** const out_value);
|
xmlrpc_value ** const out_value);
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@ xmlrpc_abort_if_array_bad(xmlrpc_value * const arrayP) {
|
|||||||
if (contents == NULL)
|
if (contents == NULL)
|
||||||
abort();
|
abort();
|
||||||
else {
|
else {
|
||||||
unsigned int index;
|
unsigned int xmIndex;
|
||||||
|
|
||||||
for (index = 0; index < arraySize; ++index) {
|
for (xmIndex = 0; xmIndex < arraySize; ++xmIndex) {
|
||||||
xmlrpc_value * const itemP = contents[index];
|
xmlrpc_value * const itemP = contents[xmIndex];
|
||||||
if (itemP == NULL)
|
if (itemP == NULL)
|
||||||
abort();
|
abort();
|
||||||
else if (itemP->_refcount < 1)
|
else if (itemP->_refcount < 1)
|
||||||
@ -56,13 +56,13 @@ xmlrpc_destroyArrayContents(xmlrpc_value * const arrayP) {
|
|||||||
xmlrpc_value ** const contents =
|
xmlrpc_value ** const contents =
|
||||||
XMLRPC_MEMBLOCK_CONTENTS(xmlrpc_value*, &arrayP->_block);
|
XMLRPC_MEMBLOCK_CONTENTS(xmlrpc_value*, &arrayP->_block);
|
||||||
|
|
||||||
unsigned int index;
|
unsigned int xmIndex;
|
||||||
|
|
||||||
XMLRPC_ASSERT_ARRAY_OK(arrayP);
|
XMLRPC_ASSERT_ARRAY_OK(arrayP);
|
||||||
|
|
||||||
/* Release our reference to each item in the array */
|
/* Release our reference to each item in the array */
|
||||||
for (index = 0; index < arraySize; ++index) {
|
for (xmIndex = 0; xmIndex < arraySize; ++xmIndex) {
|
||||||
xmlrpc_value * const itemP = contents[index];
|
xmlrpc_value * const itemP = contents[xmIndex];
|
||||||
xmlrpc_DECREF(itemP);
|
xmlrpc_DECREF(itemP);
|
||||||
}
|
}
|
||||||
XMLRPC_MEMBLOCK_CLEAN(xmlrpc_value *, &arrayP->_block);
|
XMLRPC_MEMBLOCK_CLEAN(xmlrpc_value *, &arrayP->_block);
|
||||||
@ -125,7 +125,7 @@ xmlrpc_array_append_item(xmlrpc_env * const envP,
|
|||||||
void
|
void
|
||||||
xmlrpc_array_read_item(xmlrpc_env * const envP,
|
xmlrpc_array_read_item(xmlrpc_env * const envP,
|
||||||
const xmlrpc_value * const arrayP,
|
const xmlrpc_value * const arrayP,
|
||||||
unsigned int const index,
|
unsigned int const xmIndex,
|
||||||
xmlrpc_value ** const valuePP) {
|
xmlrpc_value ** const valuePP) {
|
||||||
|
|
||||||
XMLRPC_ASSERT_ENV_OK(envP);
|
XMLRPC_ASSERT_ENV_OK(envP);
|
||||||
@ -142,12 +142,12 @@ xmlrpc_array_read_item(xmlrpc_env * const envP,
|
|||||||
size_t const size =
|
size_t const size =
|
||||||
XMLRPC_MEMBLOCK_SIZE(xmlrpc_value *, &arrayP->_block);
|
XMLRPC_MEMBLOCK_SIZE(xmlrpc_value *, &arrayP->_block);
|
||||||
|
|
||||||
if (index >= size)
|
if (xmIndex >= size)
|
||||||
xmlrpc_env_set_fault_formatted(
|
xmlrpc_env_set_fault_formatted(
|
||||||
envP, XMLRPC_INDEX_ERROR, "Array index %u is beyond end "
|
envP, XMLRPC_INDEX_ERROR, "Array index %u is beyond end "
|
||||||
"of %u-item array", index, (unsigned int)size);
|
"of %u-item array", xmIndex, (unsigned int)size);
|
||||||
else {
|
else {
|
||||||
*valuePP = contents[index];
|
*valuePP = contents[xmIndex];
|
||||||
xmlrpc_INCREF(*valuePP);
|
xmlrpc_INCREF(*valuePP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -158,15 +158,15 @@ xmlrpc_array_read_item(xmlrpc_env * const envP,
|
|||||||
xmlrpc_value *
|
xmlrpc_value *
|
||||||
xmlrpc_array_get_item(xmlrpc_env * const envP,
|
xmlrpc_array_get_item(xmlrpc_env * const envP,
|
||||||
const xmlrpc_value * const arrayP,
|
const xmlrpc_value * const arrayP,
|
||||||
int const index) {
|
int const xmIndex) {
|
||||||
|
|
||||||
xmlrpc_value * valueP;
|
xmlrpc_value * valueP;
|
||||||
|
|
||||||
if (index < 0)
|
if (xmIndex < 0)
|
||||||
xmlrpc_env_set_fault_formatted(
|
xmlrpc_env_set_fault_formatted(
|
||||||
envP, XMLRPC_INDEX_ERROR, "Index %d is negative.");
|
envP, XMLRPC_INDEX_ERROR, "Index %d is negative.");
|
||||||
else {
|
else {
|
||||||
xmlrpc_array_read_item(envP, arrayP, index, &valueP);
|
xmlrpc_array_read_item(envP, arrayP, xmIndex, &valueP);
|
||||||
|
|
||||||
if (!envP->fault_occurred)
|
if (!envP->fault_occurred)
|
||||||
xmlrpc_DECREF(valueP);
|
xmlrpc_DECREF(valueP);
|
||||||
|
@ -368,12 +368,12 @@ performCurlTransaction(xmlrpc_env * const envP,
|
|||||||
"HTTP POST request. curl_easy_perform() says: %s",
|
"HTTP POST request. curl_easy_perform() says: %s",
|
||||||
curlTransactionP->curlError);
|
curlTransactionP->curlError);
|
||||||
else {
|
else {
|
||||||
CURLcode res;
|
CURLcode crRes;
|
||||||
long http_result;
|
long http_result;
|
||||||
res = curl_easy_getinfo(curlSessionP, CURLINFO_HTTP_CODE,
|
crRes = curl_easy_getinfo(curlSessionP, CURLINFO_HTTP_CODE,
|
||||||
&http_result);
|
&http_result);
|
||||||
|
|
||||||
if (res != CURLE_OK)
|
if (crRes != CURLE_OK)
|
||||||
xmlrpc_env_set_fault_formatted(
|
xmlrpc_env_set_fault_formatted(
|
||||||
envP, XMLRPC_INTERNAL_ERROR,
|
envP, XMLRPC_INTERNAL_ERROR,
|
||||||
"Curl performed the HTTP POST request, but was "
|
"Curl performed the HTTP POST request, but was "
|
||||||
|
@ -110,7 +110,7 @@ get_child_by_name (xmlrpc_env *env, xml_element *parent, char *name)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static xmlrpc_int32
|
static xmlrpc_int32
|
||||||
xmlrpc_atoi(xmlrpc_env *env, char *str, size_t strlen,
|
xmlrpc_atoi(xmlrpc_env *env, char *str, size_t stringLength,
|
||||||
xmlrpc_int32 min, xmlrpc_int32 max)
|
xmlrpc_int32 min, xmlrpc_int32 max)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
@ -128,7 +128,7 @@ xmlrpc_atoi(xmlrpc_env *env, char *str, size_t strlen,
|
|||||||
"\"%s\" must not contain whitespace", str);
|
"\"%s\" must not contain whitespace", str);
|
||||||
|
|
||||||
/* Convert the value. */
|
/* Convert the value. */
|
||||||
end = str + strlen;
|
end = str + stringLength;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
i = strtol(str, &end, 10);
|
i = strtol(str, &end, 10);
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ xmlrpc_atoi(xmlrpc_env *env, char *str, size_t strlen,
|
|||||||
"\"%s\" must be in range %d to %d", str, min, max);
|
"\"%s\" must be in range %d to %d", str, min, max);
|
||||||
|
|
||||||
/* Check for unused characters. */
|
/* Check for unused characters. */
|
||||||
if (end != str + strlen)
|
if (end != str + stringLength)
|
||||||
XMLRPC_FAIL1(env, XMLRPC_PARSE_ERROR,
|
XMLRPC_FAIL1(env, XMLRPC_PARSE_ERROR,
|
||||||
"\"%s\" contained trailing data", str);
|
"\"%s\" contained trailing data", str);
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ xmlrpc_atoi(xmlrpc_env *env, char *str, size_t strlen,
|
|||||||
|
|
||||||
|
|
||||||
static double
|
static double
|
||||||
xmlrpc_atod(xmlrpc_env *env, char *str, size_t strlen)
|
xmlrpc_atod(xmlrpc_env *env, char *str, size_t stringLength)
|
||||||
{
|
{
|
||||||
double d;
|
double d;
|
||||||
char *end;
|
char *end;
|
||||||
@ -176,7 +176,7 @@ xmlrpc_atod(xmlrpc_env *env, char *str, size_t strlen)
|
|||||||
"\"%s\" must not contain whitespace", str);
|
"\"%s\" must not contain whitespace", str);
|
||||||
|
|
||||||
/* Convert the value. */
|
/* Convert the value. */
|
||||||
end = str + strlen;
|
end = str + stringLength;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
d = strtod(str, &end);
|
d = strtod(str, &end);
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ xmlrpc_atod(xmlrpc_env *env, char *str, size_t strlen)
|
|||||||
str, strerror(errno), errno);
|
str, strerror(errno), errno);
|
||||||
|
|
||||||
/* Check for unused characters. */
|
/* Check for unused characters. */
|
||||||
if (end != str + strlen)
|
if (end != str + stringLength)
|
||||||
XMLRPC_FAIL1(env, XMLRPC_PARSE_ERROR,
|
XMLRPC_FAIL1(env, XMLRPC_PARSE_ERROR,
|
||||||
"\"%s\" contained trailing data", str);
|
"\"%s\" contained trailing data", str);
|
||||||
|
|
||||||
|
@ -216,22 +216,22 @@ xmlrpc_struct_has_key_n(xmlrpc_env * const envP,
|
|||||||
xmlrpc_value * const strctP,
|
xmlrpc_value * const strctP,
|
||||||
const char * const key,
|
const char * const key,
|
||||||
size_t const key_len) {
|
size_t const key_len) {
|
||||||
int index;
|
int xmIndex;
|
||||||
|
|
||||||
/* Suppress a compiler warning about uninitialized variables. */
|
/* Suppress a compiler warning about uninitialized variables. */
|
||||||
index = 0;
|
xmIndex = 0;
|
||||||
|
|
||||||
XMLRPC_ASSERT_ENV_OK(envP);
|
XMLRPC_ASSERT_ENV_OK(envP);
|
||||||
XMLRPC_ASSERT_VALUE_OK(strctP);
|
XMLRPC_ASSERT_VALUE_OK(strctP);
|
||||||
XMLRPC_ASSERT(key != NULL);
|
XMLRPC_ASSERT(key != NULL);
|
||||||
|
|
||||||
XMLRPC_TYPE_CHECK(envP, strctP, XMLRPC_TYPE_STRUCT);
|
XMLRPC_TYPE_CHECK(envP, strctP, XMLRPC_TYPE_STRUCT);
|
||||||
index = find_member(strctP, key, key_len);
|
xmIndex = find_member(strctP, key, key_len);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (envP->fault_occurred)
|
if (envP->fault_occurred)
|
||||||
return 0;
|
return 0;
|
||||||
return (index >= 0);
|
return (xmIndex >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -266,16 +266,16 @@ xmlrpc_struct_find_value(xmlrpc_env * const envP,
|
|||||||
envP, XMLRPC_TYPE_ERROR, "Value is not a struct. It is type #%d",
|
envP, XMLRPC_TYPE_ERROR, "Value is not a struct. It is type #%d",
|
||||||
structP->_type);
|
structP->_type);
|
||||||
else {
|
else {
|
||||||
int index;
|
int xmIndex;
|
||||||
|
|
||||||
/* Get our member index. */
|
/* Get our member index. */
|
||||||
index = find_member(structP, key, strlen(key));
|
xmIndex = find_member(structP, key, strlen(key));
|
||||||
if (index < 0)
|
if (xmIndex < 0)
|
||||||
*valuePP = NULL;
|
*valuePP = NULL;
|
||||||
else {
|
else {
|
||||||
_struct_member * const members =
|
_struct_member * const members =
|
||||||
XMLRPC_MEMBLOCK_CONTENTS(_struct_member, &structP->_block);
|
XMLRPC_MEMBLOCK_CONTENTS(_struct_member, &structP->_block);
|
||||||
*valuePP = members[index].value;
|
*valuePP = members[xmIndex].value;
|
||||||
|
|
||||||
XMLRPC_ASSERT_VALUE_OK(*valuePP);
|
XMLRPC_ASSERT_VALUE_OK(*valuePP);
|
||||||
|
|
||||||
@ -310,18 +310,18 @@ xmlrpc_struct_find_value_v(xmlrpc_env * const envP,
|
|||||||
"It is type #%d",
|
"It is type #%d",
|
||||||
keyP->_type);
|
keyP->_type);
|
||||||
else {
|
else {
|
||||||
int index;
|
int xmIndex;
|
||||||
|
|
||||||
/* Get our member index. */
|
/* Get our member index. */
|
||||||
index = find_member(structP,
|
xmIndex = find_member(structP,
|
||||||
XMLRPC_MEMBLOCK_CONTENTS(char, &keyP->_block),
|
XMLRPC_MEMBLOCK_CONTENTS(char, &keyP->_block),
|
||||||
XMLRPC_MEMBLOCK_SIZE(char, &keyP->_block)-1);
|
XMLRPC_MEMBLOCK_SIZE(char, &keyP->_block)-1);
|
||||||
if (index < 0)
|
if (xmIndex < 0)
|
||||||
*valuePP = NULL;
|
*valuePP = NULL;
|
||||||
else {
|
else {
|
||||||
_struct_member * const members =
|
_struct_member * const members =
|
||||||
XMLRPC_MEMBLOCK_CONTENTS(_struct_member, &structP->_block);
|
XMLRPC_MEMBLOCK_CONTENTS(_struct_member, &structP->_block);
|
||||||
*valuePP = members[index].value;
|
*valuePP = members[xmIndex].value;
|
||||||
|
|
||||||
XMLRPC_ASSERT_VALUE_OK(*valuePP);
|
XMLRPC_ASSERT_VALUE_OK(*valuePP);
|
||||||
|
|
||||||
@ -487,7 +487,7 @@ xmlrpc_struct_set_value_v(xmlrpc_env * const envP,
|
|||||||
|
|
||||||
char *key;
|
char *key;
|
||||||
size_t key_len;
|
size_t key_len;
|
||||||
int index;
|
int xmIndex;
|
||||||
_struct_member *members, *member, new_member;
|
_struct_member *members, *member, new_member;
|
||||||
xmlrpc_value *old_value;
|
xmlrpc_value *old_value;
|
||||||
|
|
||||||
@ -501,14 +501,14 @@ xmlrpc_struct_set_value_v(xmlrpc_env * const envP,
|
|||||||
|
|
||||||
key = XMLRPC_MEMBLOCK_CONTENTS(char, &keyvalP->_block);
|
key = XMLRPC_MEMBLOCK_CONTENTS(char, &keyvalP->_block);
|
||||||
key_len = XMLRPC_MEMBLOCK_SIZE(char, &keyvalP->_block) - 1;
|
key_len = XMLRPC_MEMBLOCK_SIZE(char, &keyvalP->_block) - 1;
|
||||||
index = find_member(strctP, key, key_len);
|
xmIndex = find_member(strctP, key, key_len);
|
||||||
|
|
||||||
if (index >= 0) {
|
if (xmIndex >= 0) {
|
||||||
/* Change the value of an existing member. (But be careful--the
|
/* Change the value of an existing member. (But be careful--the
|
||||||
** original and new values might be the same object, so watch
|
** original and new values might be the same object, so watch
|
||||||
** the order of INCREF and DECREF calls!) */
|
** the order of INCREF and DECREF calls!) */
|
||||||
members = XMLRPC_MEMBLOCK_CONTENTS(_struct_member, &strctP->_block);
|
members = XMLRPC_MEMBLOCK_CONTENTS(_struct_member, &strctP->_block);
|
||||||
member = &members[index];
|
member = &members[xmIndex];
|
||||||
|
|
||||||
/* Juggle our references. */
|
/* Juggle our references. */
|
||||||
old_value = member->value;
|
old_value = member->value;
|
||||||
@ -540,7 +540,7 @@ cleanup:
|
|||||||
void
|
void
|
||||||
xmlrpc_struct_read_member(xmlrpc_env * const envP,
|
xmlrpc_struct_read_member(xmlrpc_env * const envP,
|
||||||
xmlrpc_value * const structP,
|
xmlrpc_value * const structP,
|
||||||
unsigned int const index,
|
unsigned int const xmIndex,
|
||||||
xmlrpc_value ** const keyvalP,
|
xmlrpc_value ** const keyvalP,
|
||||||
xmlrpc_value ** const valueP) {
|
xmlrpc_value ** const valueP) {
|
||||||
|
|
||||||
@ -559,12 +559,12 @@ xmlrpc_struct_read_member(xmlrpc_env * const envP,
|
|||||||
size_t const size =
|
size_t const size =
|
||||||
XMLRPC_MEMBLOCK_SIZE(_struct_member, &structP->_block);
|
XMLRPC_MEMBLOCK_SIZE(_struct_member, &structP->_block);
|
||||||
|
|
||||||
if (index >= size)
|
if (xmIndex >= size)
|
||||||
xmlrpc_env_set_fault_formatted(
|
xmlrpc_env_set_fault_formatted(
|
||||||
envP, XMLRPC_INDEX_ERROR, "Index %u is beyond the end of "
|
envP, XMLRPC_INDEX_ERROR, "Index %u is beyond the end of "
|
||||||
"the %u-member structure", index, (unsigned int)size);
|
"the %u-member structure", xmIndex, (unsigned int)size);
|
||||||
else {
|
else {
|
||||||
_struct_member * const memberP = &members[index];
|
_struct_member * const memberP = &members[xmIndex];
|
||||||
*keyvalP = memberP->key;
|
*keyvalP = memberP->key;
|
||||||
xmlrpc_INCREF(memberP->key);
|
xmlrpc_INCREF(memberP->key);
|
||||||
*valueP = memberP->value;
|
*valueP = memberP->value;
|
||||||
@ -578,7 +578,7 @@ xmlrpc_struct_read_member(xmlrpc_env * const envP,
|
|||||||
void
|
void
|
||||||
xmlrpc_struct_get_key_and_value(xmlrpc_env * const envP,
|
xmlrpc_struct_get_key_and_value(xmlrpc_env * const envP,
|
||||||
xmlrpc_value * const structP,
|
xmlrpc_value * const structP,
|
||||||
int const index,
|
int const xmIndex,
|
||||||
xmlrpc_value ** const keyvalP,
|
xmlrpc_value ** const keyvalP,
|
||||||
xmlrpc_value ** const valueP) {
|
xmlrpc_value ** const valueP) {
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
@ -592,11 +592,11 @@ xmlrpc_struct_get_key_and_value(xmlrpc_env * const envP,
|
|||||||
XMLRPC_ASSERT_PTR_OK(keyvalP);
|
XMLRPC_ASSERT_PTR_OK(keyvalP);
|
||||||
XMLRPC_ASSERT_PTR_OK(valueP);
|
XMLRPC_ASSERT_PTR_OK(valueP);
|
||||||
|
|
||||||
if (index < 0)
|
if (xmIndex < 0)
|
||||||
xmlrpc_env_set_fault_formatted(
|
xmlrpc_env_set_fault_formatted(
|
||||||
envP, XMLRPC_INDEX_ERROR, "Index %d is negative.");
|
envP, XMLRPC_INDEX_ERROR, "Index %d is negative.");
|
||||||
else {
|
else {
|
||||||
xmlrpc_struct_read_member(envP, structP, index, keyvalP, valueP);
|
xmlrpc_struct_read_member(envP, structP, xmIndex, keyvalP, valueP);
|
||||||
if (!envP->fault_occurred) {
|
if (!envP->fault_occurred) {
|
||||||
xmlrpc_DECREF(*keyvalP);
|
xmlrpc_DECREF(*keyvalP);
|
||||||
xmlrpc_DECREF(*valueP);
|
xmlrpc_DECREF(*valueP);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user