[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 121/254: tool: fix remaining -Wcast-qual warnings
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 121/254: tool: fix remaining -Wcast-qual warnings |
Date: |
Sat, 17 Jun 2017 16:52:33 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit 4dc8499494dc16bf336c1055f2ae4b78c709c87d
Author: Marcel Raad <address@hidden>
AuthorDate: Tue May 9 19:20:28 2017 +0200
tool: fix remaining -Wcast-qual warnings
Avoid casting away low-level const.
---
src/tool_formparse.c | 4 ++--
src/tool_getparam.c | 10 +++++-----
src/tool_getparam.h | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/tool_formparse.c b/src/tool_formparse.c
index 1bcd4c563..952377c49 100644
--- a/src/tool_formparse.c
+++ b/src/tool_formparse.c
@@ -154,7 +154,7 @@ int formparse(struct OperationConfig *config,
char type_major[128] = "";
char type_minor[128] = "";
char *contp;
- const char *type = NULL;
+ char *type = NULL;
char *sep;
if((1 == sscanf(input, "%255[^=]=", name)) &&
@@ -215,7 +215,7 @@ int formparse(struct OperationConfig *config,
}
/* 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
specified and if not we simply assume that it is text that
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index fde819e8d..56bbbf18f 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -420,10 +420,10 @@ GetFileAndPassword(char *nextarg, char **file, char
**password)
cleanarg(nextarg);
}
-ParameterError getparameter(char *flag, /* f or -long-flag */
- char *nextarg, /* NULL if unset */
- bool *usedarg, /* set to TRUE if the arg
- has been used */
+ParameterError getparameter(const char *flag, /* f or -long-flag */
+ char *nextarg, /* NULL if unset */
+ bool *usedarg, /* set to TRUE if the arg
+ has been used */
struct GlobalConfig *global,
struct OperationConfig *config)
{
@@ -444,7 +444,7 @@ ParameterError getparameter(char *flag, /* f or
-long-flag */
if(('-' != flag[0]) ||
(('-' == flag[0]) && ('-' == flag[1]))) {
/* 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);
int numhits = 0;
diff --git a/src/tool_getparam.h b/src/tool_getparam.h
index 4e97721ed..29e158816 100644
--- a/src/tool_getparam.h
+++ b/src/tool_getparam.h
@@ -47,7 +47,7 @@ typedef enum {
struct GlobalConfig;
struct OperationConfig;
-ParameterError getparameter(char *flag, char *nextarg, bool *usedarg,
+ParameterError getparameter(const char *flag, char *nextarg, bool *usedarg,
struct GlobalConfig *global,
struct OperationConfig *operation);
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 47/254: tool_cb_prg: fix double-promotion warning, (continued)
- [GNUnet-SVN] [gnurl] 47/254: tool_cb_prg: fix double-promotion warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 63/254: http-proxy: use a dedicated CONNECT response buffer, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 94/254: curl_slist_append.3: clarify a NULL input creates a new list, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 112/254: libtest: fix MinGW-w64 warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 91/254: runtests: add -o to run test cases in scrambled order, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 115/254: tests: give each stunnel.conf file a unique name, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 113/254: tftpd: fix signed/unsigned mismatch warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 79/254: typecheck-gcc: add missing string options, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 83/254: CURLINFO_REDIRECT_URL.3: add example, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 65/254: upload: UPLOAD_BUFSIZE is now for the upload buffer, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 121/254: tool: fix remaining -Wcast-qual warnings,
gnunet <=
- [GNUnet-SVN] [gnurl] 132/254: FAQ: add 7.4 to toc, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 126/254: multi: use a fixed array of timers instead of malloc, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 48/254: tests: declare TU-local variables static, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 119/254: tests: list the primary server first in the server section, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 134/254: THANKS: add a few missing names, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 109/254: runtests: fix "use of undefined value" warning in -R handling, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 31/254: Makefile: fix make dist, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 59/254: http2: use the correct set buffer size, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 95/254: tests/server: run checksrc by default in debug-builds, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 85/254: test559: verify use of minimum CURLOPT_BUFFERSIZE, gnunet, 2017/06/17