got rid of a zillion warnings on gcc
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5958 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
f56537a20b
commit
a203e2e981
10 changed files with 41 additions and 41 deletions
|
@ -304,7 +304,7 @@ int CResourceVersionInfo::GetCodePage(int Index)
|
|||
return m_ChildStringLists.get_codepage(Index);
|
||||
}
|
||||
|
||||
char *CResourceVersionInfo::FindKey(LANGID LangID, int codepage, char *pKeyName)
|
||||
char *CResourceVersionInfo::FindKey(LANGID LangID, int codepage, const char *pKeyName)
|
||||
{
|
||||
int pos = m_ChildStringLists.find(LangID, codepage);
|
||||
if ( pos == -1 )
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
int GetStringTablesCount();
|
||||
LANGID GetLangID(int Index);
|
||||
int GetCodePage(int Index);
|
||||
char *FindKey(LANGID LangID, int codepage, char *pKeyName);
|
||||
char *FindKey(LANGID LangID, int codepage, const char *pKeyName);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -933,7 +933,7 @@ int CEXEBuild::add_label(const char *name)
|
|||
if (*name == '.') ERROR_MSG("Error: global label \"%s\" already declared\n",name);
|
||||
else
|
||||
{
|
||||
char *t = "section";
|
||||
const char *t = "section";
|
||||
if (build_cursection_isfunc)
|
||||
t = "function";
|
||||
ERROR_MSG("Error: label \"%s\" already declared in %s\n",name,t);
|
||||
|
@ -1485,7 +1485,7 @@ int CEXEBuild::resolve_coderefs(const char *str)
|
|||
// resolve callbacks
|
||||
{
|
||||
struct {
|
||||
char *name;
|
||||
const char *name;
|
||||
int *p;
|
||||
} callbacks[] = {
|
||||
{"%s.onInit", &cur_header->code_onInit},
|
||||
|
@ -1604,7 +1604,7 @@ int CEXEBuild::add_page(int type)
|
|||
struct {
|
||||
int wndproc_id;
|
||||
int dlg_id;
|
||||
char *name;
|
||||
const char *name;
|
||||
} ids[] = {
|
||||
{PWP_CUSTOM, 0, "custom"}, // custom
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
|
@ -1680,7 +1680,7 @@ int CEXEBuild::AddVersionInfo()
|
|||
LANGID lang_id = rVersionInfo.GetLangID(i);
|
||||
int code_page = rVersionInfo.GetCodePage(i);
|
||||
|
||||
char *lang_name = GetLangNameAndCP(lang_id);
|
||||
const char *lang_name = GetLangNameAndCP(lang_id);
|
||||
|
||||
if ( !rVersionInfo.FindKey(lang_id, code_page, "FileVersion") )
|
||||
warning("Generating version information for language \"%04d-%s\" without standard key \"FileVersion\"", lang_id, lang_name);
|
||||
|
|
|
@ -105,8 +105,8 @@ class CEXEBuild {
|
|||
|
||||
// process a script (you can process as many scripts as you want,
|
||||
// it is as if they are concatenated)
|
||||
int process_script(FILE *fp, char *curfilename);
|
||||
int process_oneline(char *line, char *curfilename, int lineptr);
|
||||
int process_script(FILE *fp, const char *curfilename);
|
||||
int process_oneline(char *line, const char *curfilename, int lineptr);
|
||||
|
||||
// you only get to call write_output once, so use it wisely.
|
||||
int write_output(void);
|
||||
|
@ -121,7 +121,7 @@ class CEXEBuild {
|
|||
int display_info;
|
||||
|
||||
int linecnt;
|
||||
char *curfilename;
|
||||
const char *curfilename;
|
||||
FILE *fp;
|
||||
|
||||
HWND notify_hwnd;
|
||||
|
@ -145,9 +145,9 @@ class CEXEBuild {
|
|||
// script.cpp
|
||||
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
|
||||
// Added by Sunil Kamath 11 June 2003
|
||||
char* set_file_predefine(char *);
|
||||
char* set_file_predefine(const char *);
|
||||
void restore_file_predefine(char *);
|
||||
char* set_timestamp_predefine(char *);
|
||||
char* set_timestamp_predefine(const char *);
|
||||
void restore_timestamp_predefine(char *);
|
||||
char* set_line_predefine(int, BOOL);
|
||||
void restore_line_predefine(char *);
|
||||
|
@ -261,8 +261,8 @@ class CEXEBuild {
|
|||
// lang.cpp functions and variables
|
||||
void InitLangTables();
|
||||
LanguageTable *GetLangTable(LANGID &lang, bool create = true);
|
||||
char *GetLangNameAndCP(LANGID lang, unsigned int *codepage = NULL);
|
||||
int DefineLangString(char *name, int process=-1);
|
||||
const char *GetLangNameAndCP(LANGID lang, unsigned int *codepage = NULL);
|
||||
int DefineLangString(const char *name, int process=-1);
|
||||
int DefineInnerLangString(int id, int process=-1);
|
||||
int SetLangString(char *name, LANGID lang, char *string);
|
||||
int SetInnerString(int id, char *string);
|
||||
|
|
|
@ -478,7 +478,7 @@ typedef struct {
|
|||
#define NS_LANG_CODE 255
|
||||
#define NS_CODES_START NS_SKIP_CODE
|
||||
|
||||
#define CODE_SHORT(x) (WORD)((((WORD)x & 0x7F) | (((WORD)x & 0x3F80) << 1) | 0x8080))
|
||||
#define CODE_SHORT(x) (WORD)((((WORD)(x) & 0x7F) | (((WORD)(x) & 0x3F80) << 1) | 0x8080))
|
||||
#define MAX_CODED 16383
|
||||
|
||||
#define NSIS_INSTDIR_INVALID 1
|
||||
|
|
|
@ -37,8 +37,8 @@ typedef enum {
|
|||
} STATICID;
|
||||
|
||||
struct NLFString {
|
||||
char *szLangStringName;
|
||||
char *szDefault;
|
||||
const char *szLangStringName;
|
||||
const char *szDefault;
|
||||
STATICID eStaticID;
|
||||
};
|
||||
|
||||
|
@ -163,7 +163,7 @@ int LangStringList::add(const char *name, int *sn/*=0*/)
|
|||
return pos;
|
||||
}
|
||||
|
||||
int LangStringList::get(char *name, int *sn/*=0*/, int *index/*=0*/, int *uindex/*=0*/, int *process/*=0*/)
|
||||
int LangStringList::get(const char *name, int *sn/*=0*/, int *index/*=0*/, int *uindex/*=0*/, int *process/*=0*/)
|
||||
{
|
||||
if (index) *index = -1;
|
||||
if (uindex) *uindex = -1;
|
||||
|
@ -192,7 +192,7 @@ void LangStringList::set(int pos, int index/*=-1*/, int uindex/*=-1*/, int proce
|
|||
data[pos].process = process;
|
||||
}
|
||||
|
||||
void LangStringList::set(char *name, int index, int uindex/*=-1*/, int process/*=-1*/)
|
||||
void LangStringList::set(const char *name, int index, int uindex/*=-1*/, int process/*=-1*/)
|
||||
{
|
||||
set(get(name), index, uindex, process);
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ void StringsArray::resize(int num)
|
|||
offsets.resize(num * sizeof(int));
|
||||
}
|
||||
|
||||
int StringsArray::set(int idx, char *str)
|
||||
int StringsArray::set(int idx, const char *str)
|
||||
{
|
||||
if (idx < 0)
|
||||
return 0;
|
||||
|
@ -363,7 +363,7 @@ LanguageTable* CEXEBuild::GetLangTable(LANGID &lang, bool create/*=true*/) {
|
|||
return table;
|
||||
}
|
||||
|
||||
char *CEXEBuild::GetLangNameAndCP(LANGID lang, unsigned int *codepage/*=NULL*/) {
|
||||
const char *CEXEBuild::GetLangNameAndCP(LANGID lang, unsigned int *codepage/*=NULL*/) {
|
||||
LanguageTable *table = GetLangTable(lang, false);
|
||||
|
||||
if (table && table->nlf.m_bLoaded) {
|
||||
|
@ -383,7 +383,7 @@ char *CEXEBuild::GetLangNameAndCP(LANGID lang, unsigned int *codepage/*=NULL*/)
|
|||
}
|
||||
}
|
||||
|
||||
int CEXEBuild::DefineLangString(char *name, int process/*=-1*/) {
|
||||
int CEXEBuild::DefineLangString(const char *name, int process/*=-1*/) {
|
||||
int index, uindex, pos, ret, sn;
|
||||
pos = build_langstrings.get(name, &sn, &index, &uindex);
|
||||
if (pos < 0) {
|
||||
|
@ -822,7 +822,7 @@ void CEXEBuild::FillLanguageTable(LanguageTable *table) {
|
|||
table->lang_strings->set(sn, (char *) us);
|
||||
}
|
||||
else {
|
||||
char *dstr = table->nlf.m_szStrings[i] ? table->nlf.m_szStrings[i] : NLFStrings[i].szDefault;
|
||||
const char *dstr = table->nlf.m_szStrings[i] ? table->nlf.m_szStrings[i] : NLFStrings[i].szDefault;
|
||||
if (!dstr)
|
||||
continue;
|
||||
if (i == NLF_BRANDING) {
|
||||
|
|
|
@ -40,9 +40,9 @@ class LangStringList : public SortedStringListND<struct langstring>
|
|||
LangStringList();
|
||||
|
||||
int add(const char *name, int *sn=0);
|
||||
int get(char *name, int *sn=0, int *index=0, int *uindex=0, int *process=0);
|
||||
int get(const char *name, int *sn=0, int *index=0, int *uindex=0, int *process=0);
|
||||
void set(int pos, int index=-1, int uindex=-1, int process=-1);
|
||||
void set(char *name, int index, int uindex=-1, int process=-1);
|
||||
void set(const char *name, int index, int uindex=-1, int process=-1);
|
||||
const char *pos2name(int pos);
|
||||
const char *offset2name(int name);
|
||||
int getnum();
|
||||
|
@ -62,7 +62,7 @@ class StringsArray
|
|||
StringsArray();
|
||||
|
||||
void resize(int num);
|
||||
int set(int idx, char *str);
|
||||
int set(int idx, const char *str);
|
||||
const char *get(int idx);
|
||||
|
||||
private:
|
||||
|
|
|
@ -113,7 +113,7 @@ int LineParser::gettoken_int(int token, int *success/*=0*/)
|
|||
char* LineParser::gettoken_str(int token)
|
||||
{
|
||||
token+=m_eat;
|
||||
if (token < 0 || token >= m_nt) return "";
|
||||
if (token < 0 || token >= m_nt) return (char*)"";
|
||||
return m_tokens[token];
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ using namespace std;
|
|||
|
||||
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
|
||||
// Added by Sunil Kamath 11 June 2003
|
||||
char *CEXEBuild::set_file_predefine(char *filename)
|
||||
char *CEXEBuild::set_file_predefine(const char *filename)
|
||||
{
|
||||
char *oldfilename = definedlist.find("__FILE__");
|
||||
if(oldfilename)
|
||||
|
@ -60,7 +60,7 @@ char *CEXEBuild::set_file_predefine(char *filename)
|
|||
oldfilename = strdup(oldfilename);
|
||||
definedlist.del("__FILE__");
|
||||
}
|
||||
char *p = strrchr(filename,'\\');
|
||||
const char *p = strrchr(filename,'\\');
|
||||
if(p) {
|
||||
p++;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ void CEXEBuild::restore_file_predefine(char *oldfilename)
|
|||
}
|
||||
}
|
||||
|
||||
char *CEXEBuild::set_timestamp_predefine(char *filename)
|
||||
char *CEXEBuild::set_timestamp_predefine(const char *filename)
|
||||
{
|
||||
char *oldtimestamp = definedlist.find("__TIMESTAMP__");
|
||||
if(oldtimestamp) {
|
||||
|
@ -200,7 +200,7 @@ void CEXEBuild::del_date_time_predefines()
|
|||
}
|
||||
#endif
|
||||
|
||||
int CEXEBuild::process_script(FILE *filepointer, char *filename)
|
||||
int CEXEBuild::process_script(FILE *filepointer, const char *filename)
|
||||
{
|
||||
linecnt = 0;
|
||||
fp = filepointer;
|
||||
|
@ -762,7 +762,7 @@ int CEXEBuild::includeScript(char *f)
|
|||
|
||||
int last_linecnt=linecnt;
|
||||
linecnt=0;
|
||||
char *last_filename=curfilename;
|
||||
const char *last_filename=curfilename;
|
||||
curfilename=f;
|
||||
FILE *last_fp=fp;
|
||||
fp=incfp;
|
||||
|
@ -823,9 +823,9 @@ int CEXEBuild::MacroExists(const char *macroname)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CEXEBuild::process_oneline(char *line, char *filename, int linenum)
|
||||
int CEXEBuild::process_oneline(char *line, const char *filename, int linenum)
|
||||
{
|
||||
char *last_filename=curfilename;
|
||||
const char *last_filename=curfilename;
|
||||
curfilename=filename;
|
||||
int last_linecnt=linecnt;
|
||||
linecnt=linenum;
|
||||
|
@ -3825,7 +3825,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
return add_entry(&ent);
|
||||
case TOK_SETOUTPATH:
|
||||
{
|
||||
char *op=line.gettoken_str(1);
|
||||
const char *op=line.gettoken_str(1);
|
||||
if (!strcmp(op,"-"))
|
||||
{
|
||||
op="$INSTDIR";
|
||||
|
@ -3988,7 +3988,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
struct
|
||||
{
|
||||
int id;
|
||||
char *str;
|
||||
const char *str;
|
||||
} list[]=
|
||||
{
|
||||
MBD(MB_ABORTRETRYIGNORE)
|
||||
|
@ -4661,7 +4661,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
struct
|
||||
{
|
||||
int id;
|
||||
char *str;
|
||||
const char *str;
|
||||
} list[]=
|
||||
{
|
||||
MBD(FILE_ATTRIBUTE_NORMAL)
|
||||
|
@ -4967,8 +4967,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
case TOK_DELETEINISEC:
|
||||
case TOK_DELETEINISTR:
|
||||
{
|
||||
char *vname="";
|
||||
char *space="";
|
||||
const char *vname="";
|
||||
const char *space="";
|
||||
ent.which=EW_WRITEINI;
|
||||
ent.offsets[0]=add_string(line.gettoken_str(2)); // section name
|
||||
if (line.getnumtokens() > 3)
|
||||
|
@ -5475,7 +5475,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
return add_entry(&ent);
|
||||
case TOK_FILESEEK:
|
||||
{
|
||||
char *modestr;
|
||||
const char *modestr;
|
||||
int tab[3]={FILE_BEGIN,FILE_CURRENT,FILE_END};
|
||||
int mode=line.gettoken_enum(3,"SET\0CUR\0END\0");
|
||||
ent.which=EW_FSEEK;
|
||||
|
@ -5774,7 +5774,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
warning_fl("%s: %s language not loaded, using default \"1033-English\"", line.gettoken_str(0), line.gettoken_str(1));
|
||||
|
||||
unsigned int codepage;
|
||||
char *lang_name = GetLangNameAndCP(LangID, &codepage);
|
||||
const char *lang_name = GetLangNameAndCP(LangID, &codepage);
|
||||
|
||||
if ( rVersionInfo.SetKeyValue(LangID, codepage, pKey, pValue) )
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ class UserVarsStringList : public SortedStringListND<struct uservarstring>
|
|||
return temp;
|
||||
}
|
||||
|
||||
int get(char *name, int n_chars = -1)
|
||||
int get(const char *name, int n_chars = -1)
|
||||
{
|
||||
int v=SortedStringListND<struct uservarstring>::find(name, n_chars);
|
||||
if (v==-1) return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue