mirror of
https://github.com/curl/curl.git
synced 2026-07-23 13:47:16 +03:00
tidy-up: miscellaneous
- INSTALL-CMAKE.md: add missing periods, text fixes. - md4, md5: sync variables names. - curl_trc: sync an argument type. - docs/examples: sync debug/trace function copies, constify, tidy-ups. - replace commented code with `#if 0`. - drop redundant parenthesis (macro values, `return`, around single variables, function calls). - fix indentation, apply clang-format in places. Closes #20481
This commit is contained in:
parent
ca5efd02b6
commit
3003c32cb2
62 changed files with 291 additions and 281 deletions
|
|
@ -39,7 +39,6 @@
|
|||
* get_terminal_columns() returns the number of columns in the current
|
||||
* terminal. It will return 79 on failure. Also, the number can be big.
|
||||
*/
|
||||
|
||||
unsigned int get_terminal_columns(void)
|
||||
{
|
||||
unsigned int width = 0;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
# ifdef S_IFCHR
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
# else
|
||||
# define S_ISCHR(m) (0) /* cannot tell if file is a device */
|
||||
# define S_ISCHR(m) 0 /* cannot tell if file is a device */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2880,7 +2880,7 @@ static ParameterError opt_string(struct OperationConfig *config,
|
|||
/* detect e2 80 80 - e2 80 ff */
|
||||
static bool has_leading_unicode(const unsigned char *arg)
|
||||
{
|
||||
return ((arg[0] == 0xe2) && (arg[1] == 0x80) && (arg[2] & 0x80));
|
||||
return (arg[0] == 0xe2) && (arg[1] == 0x80) && (arg[2] & 0x80);
|
||||
}
|
||||
|
||||
/* the longest command line option, excluding the leading -- */
|
||||
|
|
@ -3081,7 +3081,7 @@ ParameterError parse_args(int argc, argv_item_t argv[])
|
|||
}
|
||||
|
||||
err = getparameter(orig_opt, nextarg, &passarg, config,
|
||||
CONFIG_MAX_LEVELS);
|
||||
CONFIG_MAX_LEVELS);
|
||||
|
||||
unicodefree(CURL_UNCONST(nextarg));
|
||||
config = global->last;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
static bool has_trailing_slash(const char *input)
|
||||
{
|
||||
size_t len = strlen(input);
|
||||
return (len && input[len - 1] == '/');
|
||||
return len && input[len - 1] == '/';
|
||||
}
|
||||
|
||||
static char *ipfs_gateway(void)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ bool output_expected(const char *url, const char *uploadfile)
|
|||
if(!uploadfile)
|
||||
return TRUE; /* download */
|
||||
if(checkprefix("http://", url) || checkprefix("https://", url))
|
||||
return TRUE; /* HTTP(S) upload */
|
||||
return TRUE; /* HTTP(S) upload */
|
||||
|
||||
return FALSE; /* non-HTTP upload, probably no output should be expected */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ CURLcode tool_setopt_bitmask(CURL *curl, const char *name, CURLoption tag,
|
|||
/* all value flags contained in rest */
|
||||
rest &= ~nv->value; /* remove bits handled here */
|
||||
result = easysrc_addf(&easysrc_code, "%s(long)%s%s",
|
||||
preamble, nv->name, rest ? " |" : ");");
|
||||
preamble, nv->name, rest ? " |" : ");");
|
||||
if(!rest || result)
|
||||
break; /* handled them all */
|
||||
/* replace with all spaces for continuation line */
|
||||
|
|
@ -707,6 +707,7 @@ CURLcode tool_setopt_str(CURL *curl, struct OperationConfig *config,
|
|||
/* return TRUE if the error code is "lethal" */
|
||||
bool setopt_bad(CURLcode result)
|
||||
{
|
||||
return (result && (result != CURLE_NOT_BUILT_IN) &&
|
||||
(result != CURLE_UNKNOWN_OPTION));
|
||||
return result &&
|
||||
(result != CURLE_NOT_BUILT_IN) &&
|
||||
(result != CURLE_UNKNOWN_OPTION);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern,
|
|||
if(curlx_dyn_len(&glob->buf)) {
|
||||
/* we got a literal string, add it as a single-item list */
|
||||
result = glob_fixed(glob, curlx_dyn_ptr(&glob->buf),
|
||||
curlx_dyn_len(&glob->buf));
|
||||
curlx_dyn_len(&glob->buf));
|
||||
if(!result)
|
||||
result = add_glob(glob, pos);
|
||||
curlx_dyn_reset(&glob->buf);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ int is_vms_shell(void);
|
|||
void vms_special_exit(int code, int vms_show);
|
||||
|
||||
#undef exit
|
||||
#define exit(__code) vms_special_exit((__code), (0))
|
||||
#define exit(__code) vms_special_exit(__code, 0)
|
||||
|
||||
#define VMS_STS(c, f, e, s) \
|
||||
(((c & 0xF) << 28) | ((f & 0xFFF) << 16) | ((e & 0x1FFF) < 3) | (s & 7))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue