Commit f95be92d authored by Daniel Marmier's avatar Daniel Marmier Committed by Alexandre Julliard

Fixed warnings with gcc option "-Wwrite-strings".

parent 3156df85
......@@ -2398,7 +2398,7 @@ void MSVCRT_setbuf(MSVCRT_FILE* file, char *buf)
char *MSVCRT_tmpnam(char *s)
{
char tmpbuf[MAX_PATH];
char* prefix = "TMP";
const char* prefix = "TMP";
if (!GetTempPathA(MAX_PATH,tmpbuf) ||
!GetTempFileNameA(tmpbuf,prefix,0,MSVCRT_tmpname))
{
......
......@@ -335,12 +335,13 @@ static void test_exception(void)
if (pe)
{
/* vector dtor, multiple elements */
char name[] = "a constant";
*((int*)pe) = 3;
pe = (exception*)((int*)pe + 1);
call_func2(pexception_ctor, &pe[0], &e_name);
call_func2(pexception_ctor, &pe[1], &e_name);
call_func2(pexception_ctor, &pe[2], &e_name);
pe[3].name = "a constant";
pe[3].name = name;
pe[3].do_free = 1; /* Crash if we try to free this */
call_func2(pexception_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
}
......
......@@ -280,7 +280,7 @@ extern int mkstemps(char *template, int suffix_len);
# define _P_DETACH 4
#endif
#ifndef HAVE_SPAWNVP
extern int spawnvp(int mode, const char *cmdname, char *const argv[]);
extern int spawnvp(int mode, const char *cmdname, const char * const argv[]);
#endif
/* Interlocked functions */
......
......@@ -32,7 +32,7 @@
#endif
#ifndef HAVE_SPAWNVP
int spawnvp(int mode, const char *cmdname, char *const argv[])
int spawnvp(int mode, const char *cmdname, const char *const argv[])
{
#ifndef HAVE__SPAWNVP
int pid = 0, status, wret;
......@@ -40,7 +40,7 @@ int spawnvp(int mode, const char *cmdname, char *const argv[])
if (mode == _P_OVERLAY)
{
execvp(cmdname, argv);
execvp(cmdname, (char **)argv);
return -1; /* if we get here it failed */
}
......@@ -54,7 +54,7 @@ int spawnvp(int mode, const char *cmdname, char *const argv[])
if (pid == 0)
{
sigaction( SIGPIPE, &dfl_act, NULL );
execvp(cmdname, argv);
execvp(cmdname, (char **)argv);
_exit(1);
}
......
......@@ -578,7 +578,7 @@ static int fork_and_wait( char *linker, char *link_name, char *path,
char *workdir, char *description )
{
int pos = 0;
char *argv[20];
const char *argv[20];
WINE_TRACE( "linker app='%s' link='%s' mode=%s "
"path='%s' args='%s' icon='%s' workdir='%s' descr='%s'\n",
......
......@@ -99,7 +99,7 @@ void strarray_free(strarray* arr)
free(arr);
}
void strarray_add(strarray* arr, char* str)
void strarray_add(strarray* arr, const char* str)
{
if (arr->size == arr->maximum)
{
......@@ -109,10 +109,10 @@ void strarray_add(strarray* arr, char* str)
arr->base[arr->size++] = str;
}
void spawn(strarray* arr)
void spawn(const strarray* arr)
{
int i, status;
char **argv = arr->base;
const char **argv = arr->base;
if (verbose)
{
......
......@@ -30,13 +30,13 @@ char *strmake(const char *fmt, ...);
typedef struct {
size_t maximum;
size_t size;
char** base;
const char** base;
} strarray;
strarray *strarray_alloc(void);
void strarray_free(strarray* arr);
void strarray_add(strarray* arr, char* str);
void strarray_add(strarray* arr, const char* str);
void spawn(strarray* arr);
void spawn(const strarray* arr);
extern int verbose;
......@@ -215,7 +215,7 @@ static const char *wrapper_code =
"}\n"
;
static char *output_name = "a.out";
static const char *output_name = "a.out";
static strarray *arh_files, *dll_files, *lib_files, *llib_paths, *lib_paths, *obj_files;
static int keep_generated = 0;
......@@ -345,7 +345,8 @@ static void add_lib_file(const char* library)
static void create_the_wrapper(char* base_file, char* base_name, char* app_name, int gui_mode)
{
char *wrp_temp_name, *wspec_name, *wspec_c_name, *wspec_o_name;
char *wrap_c_name, *wrap_o_name, *dlls = "";
char *wrap_c_name, *wrap_o_name;
const char *dlls = "";
strarray *wwrap_args, *wspec_args, *wcomp_args, *wlink_args;
int i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment