summaryrefslogtreecommitdiff
path: root/src/utilities.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-10-11 03:36:25 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-10-11 03:36:25 +0300
commite249aaeb9de2b3465053996f7d228e6b46f913bf (patch)
tree2130d2bf7a41789fe9bab6b8c14bd313366e3010 /src/utilities.cpp
parent2a6bd5dea23c3e41b3d2ce126de14183584778ac (diff)
merged with miranda_ng main repo
Diffstat (limited to 'src/utilities.cpp')
-rwxr-xr-xsrc/utilities.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/utilities.cpp b/src/utilities.cpp
index 3685091..ae1d8ab 100755
--- a/src/utilities.cpp
+++ b/src/utilities.cpp
@@ -113,7 +113,7 @@ void RemoveExcludedUsers()
{
HANDLE hContact;
hContact_entry *first, *plist, *tmp;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
first = new hContact_entry;
plist = first;
plist->hContact = INVALID_HANDLE_VALUE;
@@ -127,7 +127,7 @@ void RemoveExcludedUsers()
plist = plist->next;
plist->hContact = INVALID_HANDLE_VALUE;
}
- }while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0));
+ }while(hContact = db_find_next(hContact));
plist = first;
while(plist->hContact != INVALID_HANDLE_VALUE)
@@ -154,7 +154,7 @@ void RemoveTemporaryUsers()
{
HANDLE hContact;
hContact_entry *first, *plist, *tmp;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
first = new hContact_entry;
plist = first;
plist->hContact = INVALID_HANDLE_VALUE;
@@ -170,7 +170,7 @@ void RemoveTemporaryUsers()
plist = plist->next;
plist->hContact = INVALID_HANDLE_VALUE;
}
- }while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0));
+ }while(hContact = db_find_next(hContact));
plist = first;
while(plist->hContact != INVALID_HANDLE_VALUE)
@@ -407,7 +407,7 @@ void CleanProtocolTmpThread(std::string proto)
boost::this_thread::sleep(boost::posix_time::seconds(2));
}
std::list<HANDLE> contacts;
- for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for(HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
{
char *proto_tmp = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if(proto_tmp)
@@ -437,7 +437,7 @@ void CleanProtocolExclThread(std::string proto)
boost::this_thread::sleep(boost::posix_time::seconds(2));
}
std::list<HANDLE> contacts;
- for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for(HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
{
char *proto_tmp = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if(proto_tmp)
@@ -511,7 +511,7 @@ std::string toUTF8(std::wstring str)
try{
utf8::utf16to8(str.begin(), str.end(), back_inserter(ustr));
}
- catch(const std::exception &e)
+ catch(const std::exception&)
{
//TODO: handle utf8cpp exceptions
}
@@ -532,7 +532,7 @@ std::wstring toUTF16(std::string str) //convert as much as possible
utf8::replace_invalid(str.begin(), str.end(), back_inserter(tmpstr));
utf8::utf8to16(tmpstr.begin(), tmpstr.end(), back_inserter(ustr));
}
- catch(const std::exception &e)
+ catch(const std::exception &)
{
//TODO: handle utf8cpp exceptions
}