From b67a0345014079ca4d6d2ffc95d55086abc5b96b Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Thu, 14 Feb 2013 13:22:47 +0000 Subject: minor cleanup and typos (by Basil) git-svn-id: http://svn.miranda-ng.org/main/trunk@3600 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/src/contact.cpp | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'plugins/Variables/src/contact.cpp') diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index bfe4da507e..d392cb78ff 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -427,22 +427,18 @@ int getContactFromString( CONTACTSINFO* ci ) /* keep cache consistent */ static int contactSettingChanged(WPARAM wParam, LPARAM lParam) { - int i; - DBCONTACTWRITESETTING *dbw; - char *szProto, *uid; - - uid = NULL; + DBCONTACTWRITESETTING *dbw = (DBCONTACTWRITESETTING*)lParam; + HANDLE hContact = (HANDLE) wParam; EnterCriticalSection(&csContactCache); - for (i=0;iszSetting, "Nick")) && (cce[i].flags&CI_NICK)) || ((!strcmp(dbw->szSetting, "FirstName")) && (cce[i].flags&CI_FIRSTNAME)) || ((!strcmp(dbw->szSetting, "LastName")) && (cce[i].flags&CI_LASTNAME)) || @@ -495,21 +491,19 @@ int deinitContactModule() // result must be freed TCHAR *encodeContactToString(HANDLE hContact) { - char *szProto; - TCHAR *tszUniqueId, *tszResult, *tszProto; DBVARIANT dbv; ZeroMemory(&dbv, sizeof(DBVARIANT)); - szProto = GetContactProto(hContact); - tszUniqueId = getContactInfoT(CNF_UNIQUEID, hContact); + char *szProto = GetContactProto(hContact); + TCHAR *tszUniqueId = getContactInfoT(CNF_UNIQUEID, hContact); if (szProto == NULL || tszUniqueId == NULL) return NULL; - tszResult = (TCHAR*)mir_calloc((_tcslen(tszUniqueId) + strlen(szProto) + 4) * sizeof(TCHAR)); + TCHAR *tszResult = (TCHAR*)mir_calloc((_tcslen(tszUniqueId) + strlen(szProto) + 4) * sizeof(TCHAR)); if (tszResult == NULL) return NULL; - tszProto = mir_a2t(szProto); + TCHAR *tszProto = mir_a2t(szProto); if (tszProto == NULL) return NULL; @@ -525,16 +519,13 @@ TCHAR *encodeContactToString(HANDLE hContact) // returns INVALID_HANDLE_VALUE in case of an error. HANDLE *decodeContactFromString(TCHAR *tszContact) { - int count; - HANDLE hContact; + HANDLE hContact = INVALID_HANDLE_VALUE; CONTACTSINFO ci; - - hContact = INVALID_HANDLE_VALUE; ZeroMemory(&ci, sizeof(CONTACTSINFO)); ci.cbSize = sizeof(CONTACTSINFO); ci.tszContact = tszContact; ci.flags = CI_PROTOID|CI_TCHAR; - count = getContactFromString( &ci ); + int count = getContactFromString( &ci ); if (count != 1) { if (ci.hContacts != NULL) mir_free(ci.hContacts); -- cgit v1.2.3