mirror of
https://github.com/curl/curl.git
synced 2026-07-25 12:27:16 +03:00
tidy-up: miscellaneous
- vms/curlmsg_vms.h: delete unused/commented code. - vtls/schannel_verify: sort includes. - typecheck-gcc.h: fix indent and alignment. - lib/config-win32.h: drop idle `#undef`. - spacecheck: check for stray empty lines before after curly braces. - make literals more readable: 1048576 -> 1024 * 1024 - scope variables. - use ISO date in a comment. - drop redundant parentheses. - drop empty comments. - unfold lines. - duplicate/stray spaces in comments. - fix indent, whitespace, minor typos. Closes #20690
This commit is contained in:
parent
ac46392f44
commit
af78b199b2
89 changed files with 424 additions and 448 deletions
|
|
@ -32,10 +32,10 @@
|
|||
#define MAX_PARAMETERS 128 /* number of input arguments */
|
||||
#define MAX_SEGMENTS 128 /* number of output segments */
|
||||
|
||||
/* Lower-case digits. */
|
||||
/* Lower-case digits. */
|
||||
const unsigned char Curl_ldigits[] = "0123456789abcdef";
|
||||
|
||||
/* Upper-case digits. */
|
||||
/* Upper-case digits. */
|
||||
const unsigned char Curl_udigits[] = "0123456789ABCDEF";
|
||||
|
||||
#define OUTCHAR(x) \
|
||||
|
|
@ -131,9 +131,9 @@ struct asprintf {
|
|||
};
|
||||
|
||||
/* the provided input number is 1-based but this returns the number 0-based.
|
||||
|
||||
returns -1 if no valid number was provided.
|
||||
*/
|
||||
*
|
||||
* returns -1 if no valid number was provided.
|
||||
*/
|
||||
static int dollarstring(const char *p, const char **end)
|
||||
{
|
||||
curl_off_t num;
|
||||
|
|
@ -596,8 +596,8 @@ static int parsefmt(const char *format,
|
|||
}
|
||||
|
||||
struct mproperty {
|
||||
int width; /* Width of a field. */
|
||||
int prec; /* Precision of a field. */
|
||||
int width; /* Width of a field. */
|
||||
int prec; /* Precision of a field. */
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
|
|
@ -722,7 +722,7 @@ static bool out_number(void *userp,
|
|||
char *w;
|
||||
|
||||
if(flags & FLAGS_CHAR) {
|
||||
/* Character. */
|
||||
/* Character. */
|
||||
if(!(flags & FLAGS_LEFT))
|
||||
while(--width > 0)
|
||||
OUTCHAR(' ');
|
||||
|
|
@ -746,11 +746,11 @@ static bool out_number(void *userp,
|
|||
;
|
||||
|
||||
else {
|
||||
/* Decimal integer. */
|
||||
/* Decimal integer. */
|
||||
is_neg = (nums < 0);
|
||||
if(is_neg) {
|
||||
/* signed_num might fail to hold absolute negative minimum by 1 */
|
||||
int64_t signed_num; /* Used to convert negative in positive. */
|
||||
int64_t signed_num; /* Used to convert negative in positive. */
|
||||
signed_num = nums + (int64_t)1;
|
||||
signed_num = -signed_num;
|
||||
num = (uint64_t)signed_num;
|
||||
|
|
@ -758,11 +758,11 @@ static bool out_number(void *userp,
|
|||
}
|
||||
}
|
||||
|
||||
/* Supply a default precision if none was given. */
|
||||
/* Supply a default precision if none was given. */
|
||||
if(prec == -1)
|
||||
prec = 1;
|
||||
|
||||
/* Put the number in WORK. */
|
||||
/* Put the number in WORK. */
|
||||
w = workend;
|
||||
DEBUGASSERT(base <= 16);
|
||||
switch(base) {
|
||||
|
|
@ -822,7 +822,7 @@ static bool out_number(void *userp,
|
|||
while(width-- > 0)
|
||||
OUTCHAR('0');
|
||||
|
||||
/* Write the number. */
|
||||
/* Write the number. */
|
||||
while(++w <= workend) {
|
||||
OUTCHAR(*w);
|
||||
}
|
||||
|
|
@ -848,7 +848,7 @@ static bool out_string(void *userp,
|
|||
size_t len;
|
||||
|
||||
if(!str) {
|
||||
/* Write null string if there is space. */
|
||||
/* Write null string if there is space. */
|
||||
if(prec == -1 || prec >= (int)sizeof(nilstr) - 1) {
|
||||
str = nilstr;
|
||||
len = sizeof(nilstr) - 1;
|
||||
|
|
@ -895,17 +895,17 @@ static bool out_pointer(void *userp,
|
|||
char *work,
|
||||
int *donep)
|
||||
{
|
||||
/* Generic pointer. */
|
||||
/* Generic pointer. */
|
||||
if(ptr) {
|
||||
size_t num = (size_t)ptr;
|
||||
|
||||
/* If the pointer is not NULL, write it as a %#x spec. */
|
||||
/* If the pointer is not NULL, write it as a %#x spec. */
|
||||
p->flags |= FLAGS_HEX | FLAGS_ALT;
|
||||
if(out_number(userp, stream, p, num, 0, work, donep))
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
/* Write "(nil)" for a nil pointer. */
|
||||
/* Write "(nil)" for a nil pointer. */
|
||||
const char *point;
|
||||
int width = p->width;
|
||||
int flags = p->flags;
|
||||
|
|
@ -946,7 +946,7 @@ static int formatf(void *userp, /* untouched by format(), just sent to the
|
|||
const char *format, /* %-formatted string */
|
||||
va_list ap_save) /* list of parameters */
|
||||
{
|
||||
int done = 0; /* number of characters written */
|
||||
int done = 0; /* number of characters written */
|
||||
int i;
|
||||
int ocount = 0; /* number of output segments */
|
||||
int icount = 0; /* number of input arguments */
|
||||
|
|
@ -1042,7 +1042,7 @@ static int formatf(void *userp, /* untouched by format(), just sent to the
|
|||
break;
|
||||
|
||||
case MTYPE_INTPTR:
|
||||
/* Answer the count of characters written. */
|
||||
/* Answer the count of characters written. */
|
||||
if(p.flags & FLAGS_LONGLONG)
|
||||
*(int64_t *)iptr->val.ptr = (int64_t)done;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue