Commit 4034ff36 authored by Daniel Marmier's avatar Daniel Marmier Committed by Alexandre Julliard

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

parent 9bd1dbd0
......@@ -36,7 +36,7 @@
#define YYLEX_PARAM info
#define YYPARSE_PARAM info
extern int yyerror(char *str);
extern int yyerror(const char *str);
WINE_DEFAULT_DEBUG_CHANNEL(msi);
......@@ -392,7 +392,7 @@ INT yygetint( yyinput *sql )
return atoiW( p );
}
int yyerror(char *str)
int yyerror(const char *str)
{
return 0;
}
......
......@@ -23,8 +23,8 @@
#include "wrctypes.h"
char *get_typename(resource_t* r);
void dump_resources(resource_t *top);
char *get_nameid_str(name_id_t *n);
const char *get_typename(const resource_t* r);
void dump_resources(const resource_t *top);
const char *get_nameid_str(const name_id_t *n);
#endif
......@@ -1620,7 +1620,7 @@ static res_t *versioninfo2res(name_id_t *name, versioninfo_t *ver)
assert(ver != NULL);
vsvi.type = str_char;
vsvi.str.cstr = "VS_VERSION_INFO";
vsvi.str.cstr = xstrdup("VS_VERSION_INFO");
vsvi.size = 15; /* Excl. termination */
res = new_res();
......@@ -1661,6 +1661,7 @@ static res_t *versioninfo2res(name_id_t *name, versioninfo_t *ver)
if(win32)
put_pad(res);
free(vsvi.str.cstr);
return res;
}
......@@ -1762,7 +1763,7 @@ static res_t *dlginit2res(name_id_t *name, dlginit_t *dit)
/*
*****************************************************************************
* Function : prep_nid_for_label
* Syntax : char *prep_nid_for_label(name_id_t *nid)
* Syntax : char *prep_nid_for_label(const name_id_t *nid)
* Input :
* Output :
* Description : Converts a resource name into the first 32 (or less)
......@@ -1771,7 +1772,7 @@ static res_t *dlginit2res(name_id_t *name, dlginit_t *dit)
*****************************************************************************
*/
#define MAXNAMELEN 32
char *prep_nid_for_label(name_id_t *nid)
char *prep_nid_for_label(const name_id_t *nid)
{
static char buf[MAXNAMELEN+1];
......@@ -1822,7 +1823,7 @@ char *prep_nid_for_label(name_id_t *nid)
/*
*****************************************************************************
* Function : make_c_name
* Syntax : char *make_c_name(char *base, name_id_t *nid, language_t *lan)
* Syntax : char *make_c_name(const char *base, const name_id_t *nid, const language_t *lan)
* Input :
* Output :
* Description : Converts a resource name into a valid c-identifier in the
......@@ -1830,7 +1831,7 @@ char *prep_nid_for_label(name_id_t *nid)
* Remarks :
*****************************************************************************
*/
char *make_c_name(char *base, name_id_t *nid, language_t *lan)
char *make_c_name(const char *base, const name_id_t *nid, const language_t *lan)
{
int nlen;
char *buf;
......@@ -1854,7 +1855,7 @@ char *make_c_name(char *base, name_id_t *nid, language_t *lan)
/*
*****************************************************************************
* Function : get_c_typename
* Syntax : char *get_c_typename(enum res_e type)
* Syntax : const char *get_c_typename(enum res_e type)
* Input :
* Output :
* Description : Convert resource enum to char string to be used in c-name
......@@ -1862,7 +1863,7 @@ char *make_c_name(char *base, name_id_t *nid, language_t *lan)
* Remarks :
*****************************************************************************
*/
char *get_c_typename(enum res_e type)
const char *get_c_typename(enum res_e type)
{
switch(type)
{
......
......@@ -29,8 +29,8 @@ void put_byte(res_t *res, unsigned c);
void put_word(res_t *res, unsigned w);
void put_dword(res_t *res, unsigned d);
void resources2res(resource_t *top);
char *get_c_typename(enum res_e type);
char *make_c_name(char *base, name_id_t *nid, language_t *lan);
char *prep_nid_for_label(name_id_t *nid);
const char *get_c_typename(enum res_e type);
char *make_c_name(const char *base, const name_id_t *nid, const language_t *lan);
char *prep_nid_for_label(const name_id_t *nid);
#endif
......@@ -157,7 +157,7 @@ static int wanted_id = 0;
static int save_wanted_id; /* To save across comment reductions */
struct keyword {
char *keyword;
const char *keyword;
int token;
int isextension;
int needcase;
......@@ -243,7 +243,7 @@ static struct keyword keywords[] = {
};
#define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0]))
#define KWP(p) ((struct keyword *)(p))
#define KWP(p) ((const struct keyword *)(p))
static int kw_cmp_func(const void *s1, const void *s2)
{
int ret;
......
......@@ -2763,7 +2763,7 @@ static resource_t *build_fontdirs(resource_t *tail)
nid.type = name_str;
nid.name.s_name = &str;
str.type = str_char;
str.str.cstr = "FONTDIR";
str.str.cstr = xstrdup("FONTDIR");
str.size = 7;
/* Extract all fonts and fontdirs */
......@@ -2888,6 +2888,7 @@ clean:
free(fnt);
if(fnd)
free(fnd);
free(str.str.cstr);
return lst;
}
......@@ -2919,7 +2920,7 @@ clean:
static int rsrcid_to_token(int lookahead)
{
int token;
char *type = "?";
const char *type = "?";
/* Get a token if we don't have one yet */
if(lookahead == YYEMPTY)
......
......@@ -100,7 +100,7 @@ int read_data(FILE *fp, size_t size, void *buf)
* Remarks :
*****************************************************************************
*/
enum res_e res_type_from_id(name_id_t *nid)
enum res_e res_type_from_id(const name_id_t *nid)
{
if(nid->type == name_str)
return res_usr;
......
......@@ -204,14 +204,14 @@ char *xstrdup(const char *str)
/*
*****************************************************************************
* Function : compare_name_id
* Syntax : int compare_name_id(name_id_t *n1, name_id_t *n2)
* Syntax : int compare_name_id(const name_id_t *n1, const name_id_t *n2)
* Input :
* Output :
* Description :
* Remarks :
*****************************************************************************
*/
int compare_name_id(name_id_t *n1, name_id_t *n2)
int compare_name_id(const name_id_t *n1, const name_id_t *n2)
{
if(n1->type == name_ord && n2->type == name_ord)
{
......
......@@ -41,7 +41,7 @@ void warning(const char *s, ...) __attribute__((format (printf, 1, 2)));
void chat(const char *s, ...) __attribute__((format (printf, 1, 2)));
char *dup_basename(const char *name, const char *ext);
int compare_name_id(name_id_t *n1, name_id_t *n2);
int compare_name_id(const name_id_t *n1, const name_id_t *n2);
string_t *convert_string(const string_t *str, enum str_e type, int codepage);
void free_string( string_t *str );
int check_unicode_conversion( const string_t *str_a, const string_t *str_w, int codepage );
......
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