diff options
author | Mataes <mataes2007@gmail.com> | 2020-04-04 01:08:35 +0300 |
---|---|---|
committer | Mataes <mataes2007@gmail.com> | 2020-04-04 01:08:35 +0300 |
commit | 28108cf449cb49c4f969f615032522badd071734 (patch) | |
tree | e99ee51220f1f1aab9207e8fb1a34cc221b74cee /plugins/NewStory/src/history_array.h | |
parent | 067cd1176e7b6e57107e3926ddaba3a7e7880949 (diff) |
newstory: minor cleanup
Diffstat (limited to 'plugins/NewStory/src/history_array.h')
-rw-r--r-- | plugins/NewStory/src/history_array.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/plugins/NewStory/src/history_array.h b/plugins/NewStory/src/history_array.h index 955e63b1b5..9410c686b2 100644 --- a/plugins/NewStory/src/history_array.h +++ b/plugins/NewStory/src/history_array.h @@ -41,8 +41,8 @@ public: DBEVENTINFO dbe; bool atext_del = false, wtext_del = false; - char *atext = 0; - WCHAR *wtext = 0; + char* atext = 0; + wchar_t* wtext = 0; HANDLE data = 0; @@ -56,21 +56,21 @@ public: return load(mode); return true; } - inline TCHAR *getTBuf() + inline wchar_t* getTBuf() { loadInline(ELM_DATA); - #ifdef UNICODE +#ifdef UNICODE return wtext; - #else +#else return atext; - #endif +#endif } - inline char *getBuf() + inline char* getBuf() { loadInline(ELM_DATA); return atext; } - inline WCHAR *getWBuf() + inline wchar_t* getWBuf() { loadInline(ELM_DATA); return wtext; @@ -79,9 +79,9 @@ public: struct ItemBlock { - ItemData *items; + ItemData* items; int count; - ItemBlock *prev, *next; + ItemBlock* prev, * next; }; class Filter @@ -98,35 +98,35 @@ public: EVENTTEXT = 0x080, EVENTONLY = 0x100, }; - Filter(WORD aFlags, TCHAR *aText) + Filter(WORD aFlags, wchar_t* aText) { refCount = new int(0); flags = aFlags; - text = new TCHAR[lstrlen(aText) + 1]; - lstrcpy(text, aText); + text = new wchar_t[mir_wstrlen(aText) + 1]; + mir_wstrcpy(text, aText); } - Filter(const Filter &other) + Filter(const Filter& other) { flags = other.flags; refCount = other.refCount; text = other.text; - ++*refCount; + ++* refCount; } - Filter &operator=(const Filter &other) + Filter& operator=(const Filter& other) { flags = other.flags; refCount = other.refCount; text = other.text; - ++*refCount; + ++* refCount; } ~Filter() { - if (!--*refCount) { + if (!-- * refCount) { delete refCount; if (text) delete[] text; } } - inline bool check(ItemData *item) + inline bool check(ItemData* item) { if (!item) return false; if (!(flags & EVENTONLY)) { @@ -165,13 +165,13 @@ public: private: WORD flags; - int *refCount; - TCHAR *text; + int* refCount; + wchar_t* text; }; private: - ItemBlock *head = 0, *tail = 0; - ItemBlock *preBlock = 0; + ItemBlock* head = 0, * tail = 0; + ItemBlock* preBlock = 0; int preIndex = 0; bool allocateBlock(int count); @@ -185,9 +185,9 @@ public: // bool preloadEvents(int count = 10); - ItemData *get(int id, EventLoadMode mode = ELM_NOTHING); - ItemData *operator[] (int id) { return get(id, ELM_DATA); } - ItemData *operator() (int id) { return get(id, ELM_INFO); } + ItemData* get(int id, EventLoadMode mode = ELM_NOTHING); + ItemData* operator[] (int id) { return get(id, ELM_DATA); } + ItemData* operator() (int id) { return get(id, ELM_INFO); } int FindRel(int id, int dir, Filter filter) { @@ -203,7 +203,7 @@ public: int getCount() { int res = 0; - for (ItemBlock *p = head; p; p = p->next) + for (ItemBlock* p = head; p; p = p->next) res += p->count; return res; } |