Tabs to spaces and minor cleanup

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6514 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2014-07-05 11:55:28 +00:00
parent 41fd62105e
commit edd80964a7
15 changed files with 317 additions and 326 deletions

View file

@ -39,7 +39,7 @@ struct langstring {
class LangStringList : public SortedStringListND<struct langstring>
{
public:
/* Default constructor */
/* Default constructor */
LangStringList() : m_count(0) {}
/**
@ -52,7 +52,7 @@ class LangStringList : public SortedStringListND<struct langstring>
*/
int add(const TCHAR *name, int *sn=0);
/**
/**
* Gets the values in the langstring struct that is mapped to the string
* 'name'. Sets sn, index, and uindex to -1 before looking for the
* 'name'. If not found, -1 is returned. If found, then the values
@ -64,91 +64,91 @@ class LangStringList : public SortedStringListND<struct langstring>
* @param index [out] Set to index value in langstring.
* @param uindex [out] Set to uindex value in langstring.
* @param process [out] Set to process value in langstring.
* @return The index into langstring array. -1 if not found.
*/
* @return The index into langstring array. -1 if not found.
*/
int get(const TCHAR *name, int *sn=0, int *index=0, int *uindex=0, int *process=0);
/**
* Sets the values in the langstring struct that is in the position 'pos'.
*
* @param pos The langstring index into m_gr.
* @param index Value to set langstring[pos].index.
* @param uindex Value to set langstring[pos].uindex.
* @param process Value to set langstring[pos].process.
*/
/**
* Sets the values in the langstring struct that is in the position 'pos'.
*
* @param pos The langstring index into m_gr.
* @param index Value to set langstring[pos].index.
* @param uindex Value to set langstring[pos].uindex.
* @param process Value to set langstring[pos].process.
*/
void set(int pos, int index=-1, int uindex=-1, int process=-1);
/**
* Sets the values in the langstring struct that is mapped to the string
* 'name'.
*
* @param name The string key to lookup langstring.
* @param index Value to set langstring[pos].index.
* @param uindex Value to set langstring[pos].uindex.
* @param process Value to set langstring[pos].process.
*/
/**
* Sets the values in the langstring struct that is mapped to the string
* 'name'.
*
* @param name The string key to lookup langstring.
* @param index Value to set langstring[pos].index.
* @param uindex Value to set langstring[pos].uindex.
* @param process Value to set langstring[pos].process.
*/
void set(const TCHAR *name, int index, int uindex=-1, int process=-1);
/**
* From the position index, get the pointer to the key string.
* Basically, get the string referenced by langstring[pos].name.
*
* @param pos The position index.
* @return The TCHAR* to the string referenced by pos.
*/
/**
* From the position index, get the pointer to the key string.
* Basically, get the string referenced by langstring[pos].name.
*
* @param pos The position index.
* @return The TCHAR* to the string referenced by pos.
*/
const TCHAR *pos2name(int pos);
/**
* From the index into the strings, get the pointer to the
* key string. Note: the positional index into the storage of
* key strings probably should not be exposed to the outside.
*
* @param name Index into the m_strings array.
* @return The TCHAR* to the string referenced by name.
*/
/**
* From the index into the strings, get the pointer to the
* key string. Note: the positional index into the storage of
* key strings probably should not be exposed to the outside.
*
* @param name Index into the m_strings array.
* @return The TCHAR* to the string referenced by name.
*/
const TCHAR *offset2name(int name);
/**
* Get the number of entries.
*
* @return The number of langstring entries.
*/
/**
* Get the number of entries.
*
* @return The number of langstring entries.
*/
int getnum();
/**
* Compare two langstring structs pointed by item1 and item2 by looking at
* their .index values via their difference (item1->index - item2->index).
*
* @return 0 if equal, negative value if item1 is smaller, positive value
* if item1 is bigger.
*/
/**
* Compare two langstring structs pointed by item1 and item2 by looking at
* their .index values via their difference (item1->index - item2->index).
*
* @return 0 if equal, negative value if item1 is smaller, positive value
* if item1 is bigger.
*/
static int compare_index(const void *item1, const void *item2);
/**
* Sorts the langstrings by their index. Then return the sorted array
* via m_sortbuf. Warning: This function is not thread-safe!
*
* @param num [out] Set to the size of langstring items in the array.
* @return The sorted langstring array via m_sortbuf.
*/
/**
* Sorts the langstrings by their index. Then return the sorted array
* via m_sortbuf. Warning: This function is not thread-safe!
*
* @param num [out] Set to the size of langstring items in the array.
* @return The sorted langstring array via m_sortbuf.
*/
langstring *sort_index(int *num);
/**
* Compare two langstring structs pointed by item1 and item2 by looking at
* their .uindex values via their difference (item1->uindex - item2->uindex).
*
* @return 0 if equal, negative value if item1 is smaller, positive value
* if item1 is bigger.
*/
/**
* Compare two langstring structs pointed by item1 and item2 by looking at
* their .uindex values via their difference (item1->uindex - item2->uindex).
*
* @return 0 if equal, negative value if item1 is smaller, positive value
* if item1 is bigger.
*/
static int compare_uindex(const void *item1, const void *item2);
/**
* Sorts the langstrings by their index. Then return the sorted array
* via m_sortbuf. Warning: This function is not thread-safe!
*
* @param num [out] Set to the size of langstring items in the array.
* @return The sorted langstring array via m_sortbuf.
*/
/**
* Sorts the langstrings by their index. Then return the sorted array
* via m_sortbuf. Warning: This function is not thread-safe!
*
* @param num [out] Set to the size of langstring items in the array.
* @return The sorted langstring array via m_sortbuf.
*/
langstring *sort_uindex(int *num);
private:
@ -168,30 +168,30 @@ class StringsArray
public:
StringsArray();
/**
* Resizes the m_offsets so that the index num is valid.
*
* @param num New size.
*/
/**
* Resizes the m_offsets so that the index num is valid.
*
* @param num New size.
*/
void resize(int num);
/**
/**
* Set the string 'str' at index idx. This class cannot really delete
* strings. It can "overwrite" them in the sense that the string is no
* longer referenceable via the index but they are never gone.
*
* @param idx The index position to set the string to.
* @param str The string value to set.
* @return If overwriting, the position in m_strings of the old string.
*/
*
* @param idx The index position to set the string to.
* @param str The string value to set.
* @return If overwriting, the position in m_strings of the old string.
*/
int set(int idx, const TCHAR *str);
/**
* Get the string at index 'idx'.
*
* @param idx The logical index to the string.
* @return Returns the TCHAR* to the string.
*/
/**
* Get the string at index 'idx'.
*
* @param idx The logical index to the string.
* @return Returns the TCHAR* to the string.
*/
const TCHAR *get(int idx);
private:
@ -305,17 +305,14 @@ enum {
};
struct NLF {
bool m_bLoaded; /* Is the table loaded? */
TCHAR *m_szName; /* The language name */
bool m_bLoaded; /* Is the table loaded? */
TCHAR *m_szName; /* The language name */
TCHAR *m_szFont;
int m_iFontSize;
unsigned int m_uCodePage; /* Code page associated with language. When
* using Unicode, this value will be 1200.
*/
bool m_bRTL; /* Is this a right-to-left language like
Hebrew? */
* using Unicode, this value will be 1200.
*/
bool m_bRTL; /* Is this a right-to-left language like Hebrew? */
TCHAR *m_szStrings[NLF_STRINGS];
};
@ -324,7 +321,7 @@ struct NLF {
* variables for that specific language.
*/
struct LanguageTable {
LANGID lang_id; /* Windows Language ID identifier */
LANGID lang_id; /* Windows Language ID identifier */
int dlg_offset;