diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-17 19:39:01 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-17 19:39:01 +0000 |
commit | 4a6b3a2acf91421a958b9946e15a149cac29e7b5 (patch) | |
tree | 88860b2bf9b9a85c932c7dd2c2e73445d200745c /plugins/IEView/src | |
parent | d0ceb5768ff3146499a0318ffe03c867c0845592 (diff) |
warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@14980 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src')
-rw-r--r-- | plugins/IEView/src/Options.cpp | 4 | ||||
-rw-r--r-- | plugins/IEView/src/Template.cpp | 126 | ||||
-rw-r--r-- | plugins/IEView/src/Template.h | 56 |
3 files changed, 79 insertions, 107 deletions
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 08f4948d52..444966f79a 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -1083,9 +1083,9 @@ void ProtocolSettings::copyFromTemp() setHistoryEnable(isHistoryEnableTemp());
}
-void ProtocolSettings::setNext(ProtocolSettings *next)
+void ProtocolSettings::setNext(ProtocolSettings *_next)
{
- this->next = next;
+ next = _next;
}
const char *ProtocolSettings::getProtocolName()
diff --git a/plugins/IEView/src/Template.cpp b/plugins/IEView/src/Template.cpp index 3355a4ec13..705ba6ddc3 100644 --- a/plugins/IEView/src/Template.cpp +++ b/plugins/IEView/src/Template.cpp @@ -77,43 +77,28 @@ const char* Token::getText() Template::Template(const char *name, const char *text)
{
- next = NULL;
- tokens = NULL;
- this->text = mir_strdup(text);
- this->name = mir_strdup(name);
+ m_next = NULL;
+ m_tokens = NULL;
+ m_text = mir_strdup(text);
+ m_name = mir_strdup(name);
tokenize();
}
Template::~Template()
{
- mir_free(text);
- mir_free(name);
- Token *ptr = tokens, *ptr2;
- tokens = NULL;
+ mir_free(m_text);
+ mir_free(m_name);
+ Token *ptr = m_tokens, *ptr2;
+ m_tokens = NULL;
for (; ptr != NULL; ptr = ptr2) {
ptr2 = ptr->getNext();
delete ptr;
}
}
-const char* Template::getText()
-{
- return text;
-}
-
-const char* Template::getName()
-{
- return name;
-}
-
-Template* Template::getNext()
-{
- return next;
-}
-
bool Template::equals(const char *name)
{
- if (!mir_strcmp(name, this->name))
+ if (!mir_strcmp(m_name, name))
return true;
return false;
@@ -163,10 +148,10 @@ static TokenDef tokenNames[] = { void Template::tokenize()
{
- if (text == NULL)
+ if (m_text == NULL)
return;
- char *str = mir_strdup(text);
+ char *str = mir_strdup(m_text);
Token *lastToken = NULL;
int lastTokenType = Token::PLAIN;
int lastTokenEscape = 0;
@@ -211,7 +196,7 @@ void Template::tokenize() if (lastToken != NULL)
lastToken->setNext(newToken);
else
- tokens = newToken;
+ m_tokens = newToken;
lastToken = newToken;
lastTokenStart = i;
@@ -223,27 +208,22 @@ void Template::tokenize() mir_free(str);
}
-Token* Template::getTokens()
-{
- return tokens;
-}
-
-TemplateMap* TemplateMap::mapList = NULL;
+TemplateMap* TemplateMap::m_mapList = NULL;
TemplateMap::TemplateMap(const char *name)
{
- entries = NULL;
- next = NULL;
- filename = NULL;
- this->name = mir_strdup(name);
- this->grouping = false;
- this->rtl = false;
+ m_entries = NULL;
+ m_next = NULL;
+ m_filename = NULL;
+ m_name = mir_strdup(name);
+ m_grouping = false;
+ m_rtl = false;
}
TemplateMap::~TemplateMap()
{
- mir_free(name);
- mir_free(filename);
+ mir_free(m_name);
+ mir_free(m_filename);
clear();
}
@@ -251,8 +231,8 @@ TemplateMap::~TemplateMap() TemplateMap* TemplateMap::add(const char *id, const char *filename)
{
TemplateMap *map;
- for (map = mapList; map != NULL; map = map->next) {
- if (!mir_strcmp(map->name, id)) {
+ for (map = m_mapList; map != NULL; map = map->m_next) {
+ if (!mir_strcmp(map->m_name, id)) {
map->clear();
map->setFilename(filename);
return map;
@@ -260,23 +240,23 @@ TemplateMap* TemplateMap::add(const char *id, const char *filename) }
map = new TemplateMap(id);
map->setFilename(filename);
- map->next = mapList;
- mapList = map;
+ map->m_next = m_mapList;
+ m_mapList = map;
return map;
}
void TemplateMap::addTemplate(const char *name, const char *text)
{
Template *tmplate = new Template(name, text);
- tmplate->next = entries;
- entries = tmplate;
+ tmplate->m_next = m_entries;
+ m_entries = tmplate;
}
void TemplateMap::clear()
{
Template *ptr, *ptr2;
- ptr = entries;
- entries = NULL;
+ ptr = m_entries;
+ m_entries = NULL;
for (; ptr != NULL; ptr = ptr2) {
ptr2 = ptr->getNext();
delete ptr;
@@ -338,7 +318,6 @@ static TokenDef templateNames[] = { TemplateMap* TemplateMap::loadTemplateFile(const char *id, const char *filename, bool onlyInfo)
{
char lastTemplate[1024], tmp2[1024];
- unsigned int i = 0;
if (filename == NULL || mir_strlen(filename) == 0)
return NULL;
@@ -385,37 +364,27 @@ TemplateMap* TemplateMap::loadTemplateFile(const char *id, const char *filename, "hMessageInGroupStart", "hMessageInGroupInner",
"MessageOutGroupStart", "MessageOutGroupInner",
"hMessageOutGroupStart", "hMessageOutGroupInner" };
- tmap->grouping = true;
- for (i = 0; i < _countof(groupTemplates); i++) {
+ tmap->m_grouping = true;
+ for (int i = 0; i < _countof(groupTemplates); i++) {
if (tmap->getTemplate(groupTemplates[i]) == NULL) {
- tmap->grouping = false;
+ tmap->m_grouping = false;
break;
}
}
static const char *rtlTemplates[] = { "MessageInRTL", "MessageOutRTL" }; //"HTMLStartRTL",
- tmap->rtl = true;
- for (i = 0; i < _countof(rtlTemplates); i++) {
+ tmap->m_rtl = true;
+ for (int i = 0; i < _countof(rtlTemplates); i++) {
if (tmap->getTemplate(rtlTemplates[i]) == NULL) {
- tmap->rtl = false;
+ tmap->m_rtl = false;
break;
}
}
return tmap;
}
-bool TemplateMap::isGrouping()
-{
- return grouping;
-}
-
-bool TemplateMap::isRTL()
-{
- return rtl;
-}
-
Template* TemplateMap::getTemplate(const char *text)
{
- for (Template *ptr = entries; ptr != NULL; ptr = ptr->getNext())
+ for (Template *ptr = m_entries; ptr != NULL; ptr = ptr->getNext())
if (ptr->equals(text))
return ptr;
@@ -424,8 +393,8 @@ Template* TemplateMap::getTemplate(const char *text) Template* TemplateMap::getTemplate(const char *proto, const char *text)
{
- for (TemplateMap *ptr = mapList; ptr != NULL; ptr = ptr->next)
- if (!mir_strcmp(ptr->name, proto))
+ for (TemplateMap *ptr = m_mapList; ptr != NULL; ptr = ptr->m_next)
+ if (!mir_strcmp(ptr->m_name, proto))
return ptr->getTemplate(text);
return NULL;
@@ -433,22 +402,17 @@ Template* TemplateMap::getTemplate(const char *proto, const char *text) TemplateMap* TemplateMap::getTemplateMap(const char *proto)
{
- for (TemplateMap *ptr = mapList; ptr != NULL; ptr = ptr->next)
- if (!mir_strcmp(ptr->name, proto))
+ for (TemplateMap *ptr = m_mapList; ptr != NULL; ptr = ptr->m_next)
+ if (!mir_strcmp(ptr->m_name, proto))
return ptr;
return NULL;
}
-const char *TemplateMap::getFilename()
-{
- return filename;
-}
-
-void TemplateMap::setFilename(const char *_filename)
+void TemplateMap::setFilename(const char *filename)
{
- replaceStr(filename, _filename);
- Utils::convertPath(filename);
+ replaceStr(m_filename, filename);
+ Utils::convertPath(m_filename);
}
TemplateMap* TemplateMap::loadTemplates(const char *id, const char *filename, bool onlyInfo)
@@ -458,8 +422,8 @@ TemplateMap* TemplateMap::loadTemplates(const char *id, const char *filename, bo void TemplateMap::dropTemplates()
{
- for (TemplateMap *p = mapList, *p1; p != NULL; p = p1) {
- p1 = p->next;
+ for (TemplateMap *p = m_mapList, *p1; p != NULL; p = p1) {
+ p1 = p->m_next;
delete p;
}
}
diff --git a/plugins/IEView/src/Template.h b/plugins/IEView/src/Template.h index 18ebf40c52..87117c0a45 100644 --- a/plugins/IEView/src/Template.h +++ b/plugins/IEView/src/Template.h @@ -74,34 +74,39 @@ public: void setNext(Token *);
};
-class Template {
-private:
- char *name;
- char *text;
- Template *next;
- Token *tokens;
+class Template
+{
+ char *m_name;
+ char *m_text;
+ Template *m_next;
+ Token *m_tokens;
+
protected:
friend class TemplateMap;
- bool equals(const char *name);
- void tokenize();
- Template * getNext();
+ bool equals(const char *name);
+ void tokenize();
+
Template(const char *name, const char *text);
+
public:
~Template();
- const char *getText();
- const char *getName();
- Token *getTokens();
+
+ __forceinline Template* getNext() { return m_next; }
+ __forceinline const char* getText() const { return m_text; }
+ __forceinline const char* getName() const { return m_name; }
+ __forceinline Token* getTokens() const { return m_tokens; }
};
-class TemplateMap {
-private:
- static TemplateMap *mapList;
- char *name;
- char *filename;
- bool grouping;
- bool rtl;
- Template *entries;
- TemplateMap *next;
+class TemplateMap
+{
+ static TemplateMap *m_mapList;
+ char *m_name;
+ char *m_filename;
+ bool m_grouping;
+ bool m_rtl;
+ Template *m_entries;
+ TemplateMap *m_next;
+
TemplateMap(const char *name);
void addTemplate(const char *name, const char *text);
void setFilename(const char *filename);
@@ -109,6 +114,7 @@ private: static TemplateMap* add(const char *id, const char *filename);
static void appendText(char **str, int *sizeAlloced, const char *fmt, ...);
static TemplateMap* loadTemplateFile(const char *proto, const char *filename, bool onlyInfo);
+
public:
~TemplateMap();
static Template* getTemplate(const char *id, const char *name);
@@ -116,9 +122,11 @@ public: static TemplateMap* loadTemplates(const char *id, const char *filename, bool onlyInfo);
static void dropTemplates();
Template* getTemplate(const char *text);
- const char* getFilename();
- bool isGrouping();
- bool isRTL();
+
+ __forceinline const char* getFilename() { return m_filename; }
+
+ __forceinline bool isGrouping() const { return m_grouping; }
+ __forceinline bool isRTL() const { return m_rtl; }
};
|