From 70e0c09fcffa5520d3cfdc4708c81248b135c796 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 1 Dec 2014 12:56:22 +0000 Subject: - more warning fixes; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@11191 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/mTextControl/src/textusers.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'plugins/mTextControl/src/textusers.cpp') diff --git a/plugins/mTextControl/src/textusers.cpp b/plugins/mTextControl/src/textusers.cpp index 96dad7d8c6..a5a5e89897 100644 --- a/plugins/mTextControl/src/textusers.cpp +++ b/plugins/mTextControl/src/textusers.cpp @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA HANDLE htuDefault = 0; -TextUser *textUserFirst=0; -TextUser *textUserLast=0; +TextUser *textUserFirst = 0; +TextUser *textUserLast = 0; void LoadTextUsers() { @@ -31,34 +31,30 @@ void LoadTextUsers() void UnloadTextUsers() { - while (textUserFirst) - { - delete [] textUserFirst->name; + while (textUserFirst) { + delete[] textUserFirst->name; TextUser *next = textUserFirst->next; - delete [] textUserFirst; + delete[] textUserFirst; textUserFirst = next; } } -HANDLE DLL_CALLCONV -MTI_TextUserAdd(const char *userTitle, DWORD options) +HANDLE DLL_CALLCONV MTI_TextUserAdd(const char *userTitle, DWORD options) { TextUser *textUserNew = new TextUser; - textUserNew->name = new char [mir_strlen(userTitle)+1]; + textUserNew->name = new char[mir_strlen(userTitle) + 1]; mir_strcpy(textUserNew->name, userTitle); textUserNew->options = (db_get_dw(0, MODULNAME, userTitle, options)&MTEXT_FANCY_MASK) | (textUserNew->options&MTEXT_SYSTEM_MASK); db_set_dw(0, MODULNAME, userTitle, textUserNew->options); textUserNew->prev = textUserLast; textUserNew->next = 0; - if (textUserLast) - { + if (textUserLast) { textUserLast->next = textUserNew; textUserLast = textUserNew; - } else - { - textUserFirst = textUserLast = textUserNew; } + else textUserFirst = textUserLast = textUserNew; + return (HANDLE)textUserNew; } @@ -84,5 +80,5 @@ void TextUsersReset() { for (TextUser *textUser = textUserFirst; textUser; textUser = textUser->next) textUser->options = - (db_get_dw(0, MODULNAME, textUser->name, 0)&MTEXT_FANCY_MASK) | (textUser->options&MTEXT_SYSTEM_MASK); + (db_get_dw(0, MODULNAME, textUser->name, 0)&MTEXT_FANCY_MASK) | (textUser->options&MTEXT_SYSTEM_MASK); } -- cgit v1.2.3