silence -Wwrite-strings in visualtest

This commit is contained in:
Ozkan Sezer 2021-12-21 20:01:02 +03:00
parent 71c497a3a3
commit 8a355116d1
7 changed files with 12 additions and 12 deletions

View File

@ -137,7 +137,7 @@ int SDLVisualTest_InsertIntoActionQueue(SDLVisualTest_ActionQueue* queue,
*
* \return 1 on success, 0 on failure.
*/
int SDLVisualTest_ParseActionConfig(char* file, SDLVisualTest_ActionQueue* queue);
int SDLVisualTest_ParseActionConfig(const char* file, SDLVisualTest_ActionQueue* queue);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@ -259,7 +259,7 @@ SDLVisualTest_InsertIntoActionQueue(SDLVisualTest_ActionQueue* queue,
}
int
SDLVisualTest_ParseActionConfig(char* file, SDLVisualTest_ActionQueue* queue)
SDLVisualTest_ParseActionConfig(const char* file, SDLVisualTest_ActionQueue* queue)
{
char line[MAX_ACTION_LINE_LENGTH];
SDLVisualTest_RWHelperBuffer buffer;

View File

@ -19,7 +19,7 @@
/* String compare s1 and s2 ignoring leading hyphens */
static int
StrCaseCmpIgnoreHyphen(char* s1, char* s2)
StrCaseCmpIgnoreHyphen(const char* s1, const char* s2)
{
/* treat NULL pointer as empty strings */
if(!s1)
@ -199,7 +199,7 @@ ParseArg(char** argv, int index, SDLVisualTest_HarnessState* state)
/* TODO: Trailing/leading spaces and spaces between equals sign not supported. */
static int
ParseConfig(char* file, SDLVisualTest_HarnessState* state)
ParseConfig(const char* file, SDLVisualTest_HarnessState* state)
{
SDL_RWops* rw;
SDLVisualTest_RWHelperBuffer buffer;

View File

@ -20,9 +20,9 @@
#include <errno.h>
static void
LogLastError(char* str)
LogLastError(const char* str)
{
char* error = (char*)strerror(errno);
const char* error = strerror(errno);
if(!str || !error)
return;
SDLTest_LogError("%s: %s", str, error);

View File

@ -49,8 +49,8 @@ static SDLVisualTest_ActionNode* current; /* the current action being performed
static SDL_TimerID action_timer, kill_timer;
/* returns a char* to be passed as the format argument of a printf-style function. */
static char*
usage()
static const char*
usage(void)
{
return "Usage: \n%s --sutapp xyz"
" [--sutargs abc | --parameter-config xyz.parameters"
@ -462,7 +462,7 @@ main(int argc, char* argv[])
if(state.sut_config.num_options > 0)
{
char* variator_name = state.variator_type == SDL_VARIATOR_RANDOM ?
const char* variator_name = (state.variator_type == SDL_VARIATOR_RANDOM) ?
"RANDOM" : "EXHAUSTIVE";
if(state.num_variations > 0)
SDLTest_Log("Testing SUT with variator: %s for %d variations",

View File

@ -15,7 +15,7 @@
#if defined(__WIN32__)
void
LogLastError(char* str)
LogLastError(const char* str)
{
LPVOID buffer;
DWORD dw = GetLastError();

View File

@ -16,7 +16,7 @@
#if defined(__WIN32__)
#include <windows.h>
void LogLastError(char* str);
void LogLastError(const char* str);
static int img_num;
static SDL_ProcessInfo screenshot_pinfo;