mirror of
https://github.com/moparisthebest/curl
synced 2025-01-11 14:08:07 -05:00
OS400/ccsidcurl.c: code style fixes
This commit is contained in:
parent
bccf1dce53
commit
0c56faf43d
@ -94,7 +94,7 @@ iconv_open_CCSID(unsigned int ccsidout, unsigned int ccsidin,
|
|||||||
|
|
||||||
makeOS400IconvCode(fromcode, ccsidin);
|
makeOS400IconvCode(fromcode, ccsidin);
|
||||||
makeOS400IconvCode(tocode, ccsidout);
|
makeOS400IconvCode(tocode, ccsidout);
|
||||||
memset(tocode + 13, 0, sizeof tocode - 13); /* Dest. code id format. */
|
memset(tocode + 13, 0, sizeof(tocode) - 13); /* Dest. code id format. */
|
||||||
|
|
||||||
if(cstr)
|
if(cstr)
|
||||||
fromcode[18] = '1'; /* Set null-terminator flag. */
|
fromcode[18] = '1'; /* Set null-terminator flag. */
|
||||||
@ -254,7 +254,8 @@ curl_version_ccsid(unsigned int ccsid)
|
|||||||
i = strlen(aversion) + 1;
|
i = strlen(aversion) + 1;
|
||||||
i *= MAX_CONV_EXPANSION;
|
i *= MAX_CONV_EXPANSION;
|
||||||
|
|
||||||
if(!(eversion = Curl_thread_buffer(LK_CURL_VERSION, i)))
|
eversion = Curl_thread_buffer(LK_CURL_VERSION, i);
|
||||||
|
if(!eversion)
|
||||||
return (char *) NULL;
|
return (char *) NULL;
|
||||||
|
|
||||||
if(convert(eversion, i, ccsid, aversion, -1, ASCII_CCSID) < 0)
|
if(convert(eversion, i, ccsid, aversion, -1, ASCII_CCSID) < 0)
|
||||||
@ -468,17 +469,17 @@ curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid)
|
|||||||
|
|
||||||
cp = Curl_thread_buffer(LK_VERSION_INFO_DATA, n);
|
cp = Curl_thread_buffer(LK_VERSION_INFO_DATA, n);
|
||||||
id = (curl_version_info_data *) Curl_thread_buffer(LK_VERSION_INFO,
|
id = (curl_version_info_data *) Curl_thread_buffer(LK_VERSION_INFO,
|
||||||
sizeof *id);
|
sizeof(*id));
|
||||||
|
|
||||||
if(!id || !cp)
|
if(!id || !cp)
|
||||||
return (curl_version_info_data *) NULL;
|
return (curl_version_info_data *) NULL;
|
||||||
|
|
||||||
/* Copy data and convert strings. */
|
/* Copy data and convert strings. */
|
||||||
|
|
||||||
memcpy((char *) id, (char *) p, sizeof *p);
|
memcpy((char *) id, (char *) p, sizeof(*p));
|
||||||
|
|
||||||
if(id->protocols) {
|
if(id->protocols) {
|
||||||
int i = nproto * sizeof id->protocols[0];
|
int i = nproto * sizeof(id->protocols[0]);
|
||||||
|
|
||||||
id->protocols = (const char * const *) cp;
|
id->protocols = (const char * const *) cp;
|
||||||
memcpy(cp, (char *) p->protocols, i);
|
memcpy(cp, (char *) p->protocols, i);
|
||||||
@ -531,7 +532,8 @@ curl_easy_strerror_ccsid(CURLcode error, unsigned int ccsid)
|
|||||||
|
|
||||||
i = MAX_CONV_EXPANSION * (strlen(s) + 1);
|
i = MAX_CONV_EXPANSION * (strlen(s) + 1);
|
||||||
|
|
||||||
if(!(buf = Curl_thread_buffer(LK_EASY_STRERROR, i)))
|
buf = Curl_thread_buffer(LK_EASY_STRERROR, i);
|
||||||
|
if(!buf)
|
||||||
return (const char *) NULL;
|
return (const char *) NULL;
|
||||||
|
|
||||||
if(convert(buf, i, ccsid, s, -1, ASCII_CCSID) < 0)
|
if(convert(buf, i, ccsid, s, -1, ASCII_CCSID) < 0)
|
||||||
@ -556,7 +558,8 @@ curl_share_strerror_ccsid(CURLSHcode error, unsigned int ccsid)
|
|||||||
|
|
||||||
i = MAX_CONV_EXPANSION * (strlen(s) + 1);
|
i = MAX_CONV_EXPANSION * (strlen(s) + 1);
|
||||||
|
|
||||||
if(!(buf = Curl_thread_buffer(LK_SHARE_STRERROR, i)))
|
buf = Curl_thread_buffer(LK_SHARE_STRERROR, i);
|
||||||
|
if(!buf)
|
||||||
return (const char *) NULL;
|
return (const char *) NULL;
|
||||||
|
|
||||||
if(convert(buf, i, ccsid, s, -1, ASCII_CCSID) < 0)
|
if(convert(buf, i, ccsid, s, -1, ASCII_CCSID) < 0)
|
||||||
@ -581,7 +584,8 @@ curl_multi_strerror_ccsid(CURLMcode error, unsigned int ccsid)
|
|||||||
|
|
||||||
i = MAX_CONV_EXPANSION * (strlen(s) + 1);
|
i = MAX_CONV_EXPANSION * (strlen(s) + 1);
|
||||||
|
|
||||||
if(!(buf = Curl_thread_buffer(LK_MULTI_STRERROR, i)))
|
buf = Curl_thread_buffer(LK_MULTI_STRERROR, i);
|
||||||
|
if(!buf)
|
||||||
return (const char *) NULL;
|
return (const char *) NULL;
|
||||||
|
|
||||||
if(convert(buf, i, ccsid, s, -1, ASCII_CCSID) < 0)
|
if(convert(buf, i, ccsid, s, -1, ASCII_CCSID) < 0)
|
||||||
@ -653,7 +657,8 @@ curl_easy_getinfo_ccsid(CURL * curl, CURLINFO info, ...)
|
|||||||
case CURLINFO_CERTINFO:
|
case CURLINFO_CERTINFO:
|
||||||
cipf = *(struct curl_certinfo * *) paramp;
|
cipf = *(struct curl_certinfo * *) paramp;
|
||||||
if(cipf) {
|
if(cipf) {
|
||||||
if(!(cipt = (struct curl_certinfo *) malloc(sizeof *cipt)))
|
cipt = (struct curl_certinfo *) malloc(sizeof(*cipt));
|
||||||
|
if(!cipt)
|
||||||
ret = CURLE_OUT_OF_MEMORY;
|
ret = CURLE_OUT_OF_MEMORY;
|
||||||
else {
|
else {
|
||||||
cipt->certinfo = (struct curl_slist **)
|
cipt->certinfo = (struct curl_slist **)
|
||||||
@ -693,9 +698,11 @@ curl_easy_getinfo_ccsid(CURL * curl, CURLINFO info, ...)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
slp = (struct curl_slist **) paramp;
|
slp = (struct curl_slist **) paramp;
|
||||||
if(*slp)
|
if(*slp) {
|
||||||
if(!(*slp = slist_convert(ccsid, *slp, ASCII_CCSID)))
|
*slp = slist_convert(ccsid, *slp, ASCII_CCSID);
|
||||||
|
if(!*slp)
|
||||||
ret = CURLE_OUT_OF_MEMORY;
|
ret = CURLE_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -823,7 +830,7 @@ curl_formadd_ccsid(struct curl_httppost * * httppost,
|
|||||||
/* Allocate the local curl_forms array. */
|
/* Allocate the local curl_forms array. */
|
||||||
|
|
||||||
lformlen = ALLOC_GRANULE;
|
lformlen = ALLOC_GRANULE;
|
||||||
lforms = malloc(lformlen * sizeof *lforms);
|
lforms = malloc(lformlen * sizeof(*lforms));
|
||||||
|
|
||||||
if(!lforms)
|
if(!lforms)
|
||||||
return CURL_FORMADD_MEMORY;
|
return CURL_FORMADD_MEMORY;
|
||||||
@ -845,7 +852,7 @@ curl_formadd_ccsid(struct curl_httppost * * httppost,
|
|||||||
|
|
||||||
if(nargs >= lformlen) {
|
if(nargs >= lformlen) {
|
||||||
lformlen += ALLOC_GRANULE;
|
lformlen += ALLOC_GRANULE;
|
||||||
tforms = realloc(lforms, lformlen * sizeof *lforms);
|
tforms = realloc(lforms, lformlen * sizeof(*lforms));
|
||||||
|
|
||||||
if(!tforms) {
|
if(!tforms) {
|
||||||
result = CURL_FORMADD_MEMORY;
|
result = CURL_FORMADD_MEMORY;
|
||||||
|
Loading…
Reference in New Issue
Block a user