Jim Park's Unicode NSIS merging - Step 1 : switch to TCHARs where relevant.
Compiler output is identical before & after this step git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/branches/wizou@6036 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
4e48722b63
commit
752d7d239a
209 changed files with 9698 additions and 7658 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "strlist.h"
|
||||
|
||||
int StringList::add(const char *str, int case_sensitive)
|
||||
int StringList::add(const TCHAR *str, int case_sensitive)
|
||||
{
|
||||
int a=find(str,case_sensitive);
|
||||
if (a >= 0 && case_sensitive!=-1) return a;
|
||||
|
@ -24,9 +24,9 @@ int StringList::add(const char *str, int case_sensitive)
|
|||
}
|
||||
|
||||
// use 2 for case sensitive end-of-string matches too
|
||||
int StringList::find(const char *str, int case_sensitive, int *idx/*=NULL*/) const // returns -1 if not found
|
||||
int StringList::find(const TCHAR *str, int case_sensitive, int *idx/*=NULL*/) const // returns -1 if not found
|
||||
{
|
||||
const char *s=get();
|
||||
const TCHAR *s=get();
|
||||
int ml=getlen();
|
||||
int offs=0;
|
||||
if (idx) *idx=0;
|
||||
|
@ -51,7 +51,7 @@ int StringList::find(const char *str, int case_sensitive, int *idx/*=NULL*/) con
|
|||
|
||||
void StringList::delbypos(int pos)
|
||||
{
|
||||
char *s=(char*)gr.get();
|
||||
TCHAR *s=(TCHAR*)gr.get();
|
||||
int len=strlen(s+pos)+1;
|
||||
if (pos+len < gr.getlen()) memcpy(s+pos,s+pos+len,gr.getlen()-(pos+len));
|
||||
gr.resize(gr.getlen()-len);
|
||||
|
@ -59,7 +59,7 @@ void StringList::delbypos(int pos)
|
|||
|
||||
int StringList::idx2pos(int idx) const
|
||||
{
|
||||
char *s=(char*)gr.get();
|
||||
TCHAR *s=(TCHAR*)gr.get();
|
||||
int offs=0;
|
||||
int cnt=0;
|
||||
if (idx>=0) while (offs < gr.getlen())
|
||||
|
@ -72,7 +72,7 @@ int StringList::idx2pos(int idx) const
|
|||
|
||||
int StringList::getnum() const
|
||||
{
|
||||
char *s=(char*)gr.get();
|
||||
TCHAR *s=(TCHAR*)gr.get();
|
||||
int ml=gr.getlen();
|
||||
int offs=0;
|
||||
int idx=0;
|
||||
|
@ -84,9 +84,9 @@ int StringList::getnum() const
|
|||
return idx;
|
||||
}
|
||||
|
||||
const char *StringList::get() const
|
||||
const TCHAR *StringList::get() const
|
||||
{
|
||||
return (const char*)gr.get();
|
||||
return (const TCHAR*)gr.get();
|
||||
}
|
||||
|
||||
int StringList::getlen() const
|
||||
|
@ -108,7 +108,7 @@ DefineList::~DefineList()
|
|||
}
|
||||
}
|
||||
|
||||
int DefineList::add(const char *name, const char *value/*=""*/)
|
||||
int DefineList::add(const TCHAR *name, const TCHAR *value/*=_T("")*/)
|
||||
{
|
||||
int pos=SortedStringList<struct define>::add(name);
|
||||
if (pos == -1)
|
||||
|
@ -116,8 +116,8 @@ int DefineList::add(const char *name, const char *value/*=""*/)
|
|||
return 1;
|
||||
}
|
||||
|
||||
char **newvalue=&(((struct define*)gr.get())[pos].value);
|
||||
*newvalue=(char*)malloc(strlen(value)+1);
|
||||
TCHAR **newvalue=&(((struct define*)gr.get())[pos].value);
|
||||
*newvalue=(TCHAR*)malloc(strlen(value)+1);
|
||||
if (!(*newvalue))
|
||||
{
|
||||
extern FILE *g_output;
|
||||
|
@ -125,7 +125,7 @@ int DefineList::add(const char *name, const char *value/*=""*/)
|
|||
extern void quit();
|
||||
if (g_display_errors)
|
||||
{
|
||||
fprintf(g_output,"\nInternal compiler error #12345: GrowBuf realloc/malloc(%lu) failed.\n",(unsigned long)strlen(value)+1);
|
||||
fprintf(g_output,_T("\nInternal compiler error #12345: GrowBuf realloc/malloc(%lu) failed.\n"),(unsigned long)strlen(value)+1);
|
||||
fflush(g_output);
|
||||
}
|
||||
quit();
|
||||
|
@ -134,7 +134,7 @@ int DefineList::add(const char *name, const char *value/*=""*/)
|
|||
return 0;
|
||||
}
|
||||
|
||||
char *DefineList::find(const char *name)
|
||||
TCHAR *DefineList::find(const TCHAR *name)
|
||||
{
|
||||
int v=SortedStringList<struct define>::find(name);
|
||||
if (v==-1)
|
||||
|
@ -145,7 +145,7 @@ char *DefineList::find(const char *name)
|
|||
}
|
||||
|
||||
// returns 0 on success, 1 otherwise
|
||||
int DefineList::del(const char *str)
|
||||
int DefineList::del(const TCHAR *str)
|
||||
{
|
||||
int pos=SortedStringList<struct define>::find(str);
|
||||
if (pos==-1) return 1;
|
||||
|
@ -162,14 +162,14 @@ int DefineList::getnum()
|
|||
return gr.getlen()/sizeof(define);
|
||||
}
|
||||
|
||||
char *DefineList::getname(int num)
|
||||
TCHAR *DefineList::getname(int num)
|
||||
{
|
||||
if ((unsigned int)getnum() <= (unsigned int)num)
|
||||
return 0;
|
||||
return ((struct define*)gr.get())[num].name;
|
||||
}
|
||||
|
||||
char *DefineList::getvalue(int num)
|
||||
TCHAR *DefineList::getvalue(int num)
|
||||
{
|
||||
if ((unsigned int)getnum() <= (unsigned int)num)
|
||||
return 0;
|
||||
|
@ -180,16 +180,16 @@ char *DefineList::getvalue(int num)
|
|||
// FastStringList
|
||||
// ==============
|
||||
|
||||
int FastStringList::add(const char *name, int case_sensitive/*=0*/)
|
||||
int FastStringList::add(const TCHAR *name, int case_sensitive/*=0*/)
|
||||
{
|
||||
int pos = SortedStringListND<struct string_t>::add(name, case_sensitive);
|
||||
if (pos == -1) return -1;
|
||||
return ((struct string_t*)gr.get())[pos].name;
|
||||
}
|
||||
|
||||
char *FastStringList::get() const
|
||||
TCHAR *FastStringList::get() const
|
||||
{
|
||||
return (char*)strings.get();
|
||||
return (TCHAR*)strings.get();
|
||||
}
|
||||
|
||||
int FastStringList::getlen() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue