aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Raad <raad@teamviewer.com>2017-05-04 20:19:10 +0200
committerMarcel Raad <raad@teamviewer.com>2017-05-04 20:26:06 +0200
commit4032c5da8473fc7d55e9a96471b697c62663c194 (patch)
treeedd13339335320c3c30e5a6f5a77b4ec88a5c2fe
parent07fd7871b38cc8472c3806e254ba4062e3adeae0 (diff)
tests/server: make string literals const
assign string literals to const char * instead of char * in order to avoid a lot of these warnings: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
-rw-r--r--tests/server/fake_ntlm.c6
-rw-r--r--tests/server/rtspd.c2
-rw-r--r--tests/server/sockfilt.c4
-rw-r--r--tests/server/sws.c8
-rw-r--r--tests/server/tftpd.c4
5 files changed, 12 insertions, 12 deletions
diff --git a/tests/server/fake_ntlm.c b/tests/server/fake_ntlm.c
index 87118b315..b5f375e46 100644
--- a/tests/server/fake_ntlm.c
+++ b/tests/server/fake_ntlm.c
@@ -120,9 +120,9 @@ int main(int argc, char *argv[])
long testnum;
const char *env;
int arg = 1;
- char *helper_user = (char *)"unknown";
- char *helper_proto = (char *)"unknown";
- char *helper_domain = (char *)"unknown";
+ const char *helper_user = "unknown";
+ const char *helper_proto = "unknown";
+ const char *helper_domain = "unknown";
bool use_cached_creds = FALSE;
char *msgbuf;
diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c
index ea231da3d..ae42f5a5f 100644
--- a/tests/server/rtspd.c
+++ b/tests/server/rtspd.c
@@ -1190,7 +1190,7 @@ int main(int argc, char *argv[])
int wrotepidfile = 0;
int flag;
unsigned short port = DEFAULT_PORT;
- char *pidname= (char *)".rtsp.pid";
+ const char *pidname = ".rtsp.pid";
struct httprequest req;
int rc;
int error;
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 78588d3ab..926784ff4 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -405,7 +405,7 @@ static ssize_t fullwrite(int filedes, const void *buffer, size_t nbytes)
ssize_t nwrite = 0;
do {
- wc = write(filedes, (unsigned char *)buffer + nwrite, nbytes - nwrite);
+ wc = write(filedes, (const unsigned char *)buffer + nwrite, nbytes - nwrite);
if(got_exit_signal) {
logmsg("signalled to die");
@@ -1338,7 +1338,7 @@ int main(int argc, char *argv[])
curl_socket_t sock = CURL_SOCKET_BAD;
curl_socket_t msgsock = CURL_SOCKET_BAD;
int wrotepidfile = 0;
- char *pidname= (char *)".sockfilt.pid";
+ const char *pidname = ".sockfilt.pid";
bool juggle_again;
int rc;
int error;
diff --git a/tests/server/sws.c b/tests/server/sws.c
index 9f03fb6d1..163fe8b2b 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -130,7 +130,7 @@ static curl_socket_t all_sockets[MAX_SOCKETS];
static size_t num_sockets = 0;
static int ProcessRequest(struct httprequest *req);
-static void storerequest(char *reqbuf, size_t totalsize);
+static void storerequest(const char *reqbuf, size_t totalsize);
#define DEFAULT_PORT 8999
@@ -843,7 +843,7 @@ static int ProcessRequest(struct httprequest *req)
}
/* store the entire request in a file */
-static void storerequest(char *reqbuf, size_t totalsize)
+static void storerequest(const char *reqbuf, size_t totalsize)
{
int res;
int error = 0;
@@ -1965,7 +1965,7 @@ int main(int argc, char *argv[])
const char *unix_socket = NULL;
bool unlink_socket = false;
#endif
- char *pidname= (char *)".http.pid";
+ const char *pidname = ".http.pid";
struct httprequest req;
int rc = 0;
int error;
@@ -2315,7 +2315,7 @@ int main(int argc, char *argv[])
if(req.connmon) {
const char *keepopen="[DISCONNECT]\n";
- storerequest((char *)keepopen, strlen(keepopen));
+ storerequest(keepopen, strlen(keepopen));
}
if(!req.open)
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index c8667437e..0cd00c799 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -208,7 +208,7 @@ static bool use_ipv6 = FALSE;
static const char *ipv_inuse = "IPv4";
const char *serverlogfile = DEFAULT_LOGFILE;
-static char *pidname= (char *)".tftpd.pid";
+static const char *pidname = ".tftpd.pid";
static int serverlogslocked = 0;
static int wrotepidfile = 0;
@@ -960,7 +960,7 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size)
#ifdef USE_WINSOCK
DWORD recvtimeout, recvtimeoutbak;
#endif
- char *option = (char *)"mode"; /* mode is implicit */
+ const char *option = "mode"; /* mode is implicit */
int toggle = 1;
/* Open request dump file. */