mirror of
https://github.com/curl/curl.git
synced 2025-09-19 18:42:42 +03:00
tool: fix remaining -Wcast-qual warnings
Avoid casting away low-level const.
This commit is contained in:
parent
158d701641
commit
4dc8499494
|
@ -154,7 +154,7 @@ int formparse(struct OperationConfig *config,
|
||||||
char type_major[128] = "";
|
char type_major[128] = "";
|
||||||
char type_minor[128] = "";
|
char type_minor[128] = "";
|
||||||
char *contp;
|
char *contp;
|
||||||
const char *type = NULL;
|
char *type = NULL;
|
||||||
char *sep;
|
char *sep;
|
||||||
|
|
||||||
if((1 == sscanf(input, "%255[^=]=", name)) &&
|
if((1 == sscanf(input, "%255[^=]=", name)) &&
|
||||||
|
@ -215,7 +215,7 @@ int formparse(struct OperationConfig *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now point beyond the content-type specifier */
|
/* now point beyond the content-type specifier */
|
||||||
sep = (char *)type + strlen(type_major)+strlen(type_minor)+1;
|
sep = type + strlen(type_major)+strlen(type_minor)+1;
|
||||||
|
|
||||||
/* there's a semicolon following - we check if it is a filename
|
/* there's a semicolon following - we check if it is a filename
|
||||||
specified and if not we simply assume that it is text that
|
specified and if not we simply assume that it is text that
|
||||||
|
|
|
@ -420,7 +420,7 @@ GetFileAndPassword(char *nextarg, char **file, char **password)
|
||||||
cleanarg(nextarg);
|
cleanarg(nextarg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ParameterError getparameter(char *flag, /* f or -long-flag */
|
ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||||
char *nextarg, /* NULL if unset */
|
char *nextarg, /* NULL if unset */
|
||||||
bool *usedarg, /* set to TRUE if the arg
|
bool *usedarg, /* set to TRUE if the arg
|
||||||
has been used */
|
has been used */
|
||||||
|
@ -444,7 +444,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
||||||
if(('-' != flag[0]) ||
|
if(('-' != flag[0]) ||
|
||||||
(('-' == flag[0]) && ('-' == flag[1]))) {
|
(('-' == flag[0]) && ('-' == flag[1]))) {
|
||||||
/* this should be a long name */
|
/* this should be a long name */
|
||||||
char *word = ('-' == flag[0]) ? flag+2 : flag;
|
const char *word = ('-' == flag[0]) ? flag+2 : flag;
|
||||||
size_t fnam = strlen(word);
|
size_t fnam = strlen(word);
|
||||||
int numhits = 0;
|
int numhits = 0;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ typedef enum {
|
||||||
struct GlobalConfig;
|
struct GlobalConfig;
|
||||||
struct OperationConfig;
|
struct OperationConfig;
|
||||||
|
|
||||||
ParameterError getparameter(char *flag, char *nextarg, bool *usedarg,
|
ParameterError getparameter(const char *flag, char *nextarg, bool *usedarg,
|
||||||
struct GlobalConfig *global,
|
struct GlobalConfig *global,
|
||||||
struct OperationConfig *operation);
|
struct OperationConfig *operation);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user