mirror of
https://github.com/curl/curl.git
synced 2026-07-24 14:57:17 +03:00
lib/src: white space edits to comply better with code style
... as checksrc now finds and complains about these. Closes #14921
This commit is contained in:
parent
a57b45c386
commit
fbf5d507ce
128 changed files with 854 additions and 837 deletions
|
|
@ -282,8 +282,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
if(current_form->name)
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
char *name = array_state?
|
||||
array_value:va_arg(params, char *);
|
||||
char *name = array_state ?
|
||||
array_value : va_arg(params, char *);
|
||||
if(name)
|
||||
current_form->name = name; /* store for the moment */
|
||||
else
|
||||
|
|
@ -295,7 +295,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->namelength =
|
||||
array_state?(size_t)array_value:(size_t)va_arg(params, long);
|
||||
array_state ? (size_t)array_value : (size_t)va_arg(params, long);
|
||||
break;
|
||||
|
||||
/*
|
||||
|
|
@ -309,7 +309,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
char *value =
|
||||
array_state?array_value:va_arg(params, char *);
|
||||
array_state ? array_value : va_arg(params, char *);
|
||||
if(value)
|
||||
current_form->value = value; /* store for the moment */
|
||||
else
|
||||
|
|
@ -318,13 +318,14 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
break;
|
||||
case CURLFORM_CONTENTSLENGTH:
|
||||
current_form->contentslength =
|
||||
array_state?(size_t)array_value:(size_t)va_arg(params, long);
|
||||
array_state ? (size_t)array_value : (size_t)va_arg(params, long);
|
||||
break;
|
||||
|
||||
case CURLFORM_CONTENTLEN:
|
||||
current_form->flags |= CURL_HTTPPOST_LARGE;
|
||||
current_form->contentslength =
|
||||
array_state?(curl_off_t)(size_t)array_value:va_arg(params, curl_off_t);
|
||||
array_state ? (curl_off_t)(size_t)array_value :
|
||||
va_arg(params, curl_off_t);
|
||||
break;
|
||||
|
||||
/* Get contents from a given filename */
|
||||
|
|
@ -332,8 +333,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
if(current_form->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_READFILE))
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
const char *filename = array_state?
|
||||
array_value:va_arg(params, char *);
|
||||
const char *filename = array_state ?
|
||||
array_value : va_arg(params, char *);
|
||||
if(filename) {
|
||||
current_form->value = strdup(filename);
|
||||
if(!current_form->value)
|
||||
|
|
@ -351,7 +352,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
/* We upload a file */
|
||||
case CURLFORM_FILE:
|
||||
{
|
||||
const char *filename = array_state?array_value:
|
||||
const char *filename = array_state ? array_value :
|
||||
va_arg(params, char *);
|
||||
|
||||
if(current_form->value) {
|
||||
|
|
@ -401,7 +402,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
char *buffer =
|
||||
array_state?array_value:va_arg(params, char *);
|
||||
array_state ? array_value : va_arg(params, char *);
|
||||
if(buffer) {
|
||||
current_form->buffer = buffer; /* store for the moment */
|
||||
current_form->value = buffer; /* make it non-NULL to be accepted
|
||||
|
|
@ -417,7 +418,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->bufferlength =
|
||||
array_state?(size_t)array_value:(size_t)va_arg(params, long);
|
||||
array_state ? (size_t)array_value : (size_t)va_arg(params, long);
|
||||
break;
|
||||
|
||||
case CURLFORM_STREAM:
|
||||
|
|
@ -426,7 +427,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
char *userp =
|
||||
array_state?array_value:va_arg(params, char *);
|
||||
array_state ? array_value : va_arg(params, char *);
|
||||
if(userp) {
|
||||
current_form->userp = userp;
|
||||
current_form->value = userp; /* this is not strictly true but we
|
||||
|
|
@ -442,7 +443,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
case CURLFORM_CONTENTTYPE:
|
||||
{
|
||||
const char *contenttype =
|
||||
array_state?array_value:va_arg(params, char *);
|
||||
array_state ? array_value : va_arg(params, char *);
|
||||
if(current_form->contenttype) {
|
||||
if(current_form->flags & HTTPPOST_FILENAME) {
|
||||
if(contenttype) {
|
||||
|
|
@ -485,8 +486,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
{
|
||||
/* this "cast increases required alignment of target type" but
|
||||
we consider it OK anyway */
|
||||
struct curl_slist *list = array_state?
|
||||
(struct curl_slist *)(void *)array_value:
|
||||
struct curl_slist *list = array_state ?
|
||||
(struct curl_slist *)(void *)array_value :
|
||||
va_arg(params, struct curl_slist *);
|
||||
|
||||
if(current_form->contentheader)
|
||||
|
|
@ -499,7 +500,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
case CURLFORM_FILENAME:
|
||||
case CURLFORM_BUFFER:
|
||||
{
|
||||
const char *filename = array_state?array_value:
|
||||
const char *filename = array_state ? array_value :
|
||||
va_arg(params, char *);
|
||||
if(current_form->showfilename)
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
|
|
@ -569,7 +570,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
if(((form->flags & HTTPPOST_FILENAME) ||
|
||||
(form->flags & HTTPPOST_BUFFER)) &&
|
||||
!form->contenttype) {
|
||||
char *f = (form->flags & HTTPPOST_BUFFER)?
|
||||
char *f = (form->flags & HTTPPOST_BUFFER) ?
|
||||
form->showfilename : form->value;
|
||||
char const *type;
|
||||
type = Curl_mime_contenttype(f);
|
||||
|
|
@ -603,8 +604,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
app passed in a bad combo, so we better check for that first. */
|
||||
if(form->name) {
|
||||
/* copy name (without strdup; possibly not null-terminated) */
|
||||
form->name = Curl_memdup0(form->name, form->namelength?
|
||||
form->namelength:
|
||||
form->name = Curl_memdup0(form->name, form->namelength ?
|
||||
form->namelength :
|
||||
strlen(form->name));
|
||||
}
|
||||
if(!form->name) {
|
||||
|
|
@ -896,7 +897,8 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
|
|||
}
|
||||
else if(post->flags & HTTPPOST_BUFFER)
|
||||
result = curl_mime_data(part, post->buffer,
|
||||
post->bufferlength? post->bufferlength: -1);
|
||||
post->bufferlength ?
|
||||
post->bufferlength : -1);
|
||||
else if(post->flags & HTTPPOST_CALLBACK) {
|
||||
/* the contents should be read with the callback and the size is set
|
||||
with the contentslength */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue