Unverified Commit 4032c5da authored by Marcel Raad's avatar Marcel Raad
Browse files

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]
parent 07fd7871
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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;
+4 −4
Original line number Diff line number Diff line
@@ -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)
+2 −2
Original line number Diff line number Diff line
@@ -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. */