diff options
author | George Hazan <george.hazan@gmail.com> | 2012-08-15 20:29:07 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-08-15 20:29:07 +0000 |
commit | 50091223b8c0ed404968441c728e400e43ac6b8a (patch) | |
tree | f89833bd530fd63655e7d0575435212d2152ff7b | |
parent | f5a524f750e1dc0c16d82df546557d9d7fe703f8 (diff) |
- patch from pescuma for NULL handles
git-svn-id: http://svn.miranda-ng.org/main/trunk@1470 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/ExtraIcons/src/DefaultExtraIcons.cpp | 4 | ||||
-rw-r--r-- | plugins/ExtraIcons/src/ExtraIcon.cpp | 2 | ||||
-rw-r--r-- | plugins/ExtraIcons/src/ExtraIconGroup.cpp | 2 | ||||
-rw-r--r-- | plugins/ExtraIcons/src/IcolibExtraIcon.cpp | 4 | ||||
-rw-r--r-- | plugins/ExtraIcons/src/extraicons.cpp | 2 | ||||
-rw-r--r-- | plugins/ExtraIcons/src/options.cpp | 2 | ||||
-rw-r--r-- | plugins/ExtraIcons/src/usedIcons.cpp | 4 | ||||
-rw-r--r-- | plugins/FingerPrintModPlus/src/fingerprint.cpp | 6 |
8 files changed, 11 insertions, 15 deletions
diff --git a/plugins/ExtraIcons/src/DefaultExtraIcons.cpp b/plugins/ExtraIcons/src/DefaultExtraIcons.cpp index 8839aa64ae..d9bb6f951b 100644 --- a/plugins/ExtraIcons/src/DefaultExtraIcons.cpp +++ b/plugins/ExtraIcons/src/DefaultExtraIcons.cpp @@ -343,7 +343,7 @@ static ProtoInfo *FindProto(const char * proto) return NULL;
HANDLE hImage = (HANDLE) CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM) hIcon, 0);
- if (hImage == NULL)
+ if (hImage == (HANDLE) -1)
return NULL;
ProtoInfo tmp;
@@ -364,7 +364,7 @@ static int ProtocolApplyIcon(WPARAM wParam, LPARAM lParam) ProtoInfo *pi = FindProto(proto);
- HANDLE hImage = NULL;
+ HANDLE hImage = (HANDLE) -1;
if (pi != NULL)
hImage = pi->hImage;
diff --git a/plugins/ExtraIcons/src/ExtraIcon.cpp b/plugins/ExtraIcons/src/ExtraIcon.cpp index 1aaab01e2a..a06fa6f446 100644 --- a/plugins/ExtraIcons/src/ExtraIcon.cpp +++ b/plugins/ExtraIcons/src/ExtraIcon.cpp @@ -67,7 +67,7 @@ void ExtraIcon::applyIcons() while (hContact != NULL)
{
// Clear to assert that it will be cleared
- Clist_SetExtraIcon(hContact, slot, NULL);
+ Clist_SetExtraIcon(hContact, slot, (HANDLE) -1);
applyIcon(hContact);
diff --git a/plugins/ExtraIcons/src/ExtraIconGroup.cpp b/plugins/ExtraIcons/src/ExtraIconGroup.cpp index e5d785008a..5d1a93541b 100644 --- a/plugins/ExtraIcons/src/ExtraIconGroup.cpp +++ b/plugins/ExtraIcons/src/ExtraIconGroup.cpp @@ -205,7 +205,7 @@ int ExtraIconGroup::getType() const int ExtraIconGroup::ClistSetExtraIcon(HANDLE hContact, HANDLE hImage)
{
- if (hImage != NULL && hImage != (HANDLE) -1)
+ if (hImage != (HANDLE) -1)
setValidExtraIcon = true;
return Clist_SetExtraIcon(hContact, slot, hImage);
diff --git a/plugins/ExtraIcons/src/IcolibExtraIcon.cpp b/plugins/ExtraIcons/src/IcolibExtraIcon.cpp index f7dc03ca24..66ade61f2d 100644 --- a/plugins/ExtraIcons/src/IcolibExtraIcon.cpp +++ b/plugins/ExtraIcons/src/IcolibExtraIcon.cpp @@ -46,7 +46,7 @@ void IcolibExtraIcon::applyIcon(HANDLE hContact) if (!isEnabled() || hContact == NULL)
return;
- HANDLE hImage = NULL;
+ HANDLE hImage = (HANDLE) -1;
DBVARIANT dbv = { 0 };
if (!DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv))
@@ -85,7 +85,7 @@ int IcolibExtraIcon::setIcon(int id, HANDLE hContact, void *icon) HANDLE hImage;
if (IsEmpty(icolibName))
- hImage = NULL;
+ hImage = (HANDLE) -1;
else
hImage = AddIcon(icolibName);
diff --git a/plugins/ExtraIcons/src/extraicons.cpp b/plugins/ExtraIcons/src/extraicons.cpp index e468137300..c1affd39ac 100644 --- a/plugins/ExtraIcons/src/extraicons.cpp +++ b/plugins/ExtraIcons/src/extraicons.cpp @@ -157,7 +157,7 @@ int Clist_SetExtraIcon(HANDLE hContact, int slot, HANDLE hImage) IconExtraColumn iec = { 0 };
iec.cbSize = sizeof(iec);
iec.ColumnType = ConvertToClistSlot(slot);
- iec.hImage = (hImage == NULL ? (HANDLE) -1 : hImage);
+ iec.hImage = hImage;
return CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) hContact, (LPARAM) &iec);
}
diff --git a/plugins/ExtraIcons/src/options.cpp b/plugins/ExtraIcons/src/options.cpp index 83228a2a72..ae0fa2620a 100644 --- a/plugins/ExtraIcons/src/options.cpp +++ b/plugins/ExtraIcons/src/options.cpp @@ -91,7 +91,7 @@ static void RemoveExtraIcons(int slot) HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact != NULL)
{
- Clist_SetExtraIcon(hContact, slot, NULL);
+ Clist_SetExtraIcon(hContact, slot, (HANDLE) -1);
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
diff --git a/plugins/ExtraIcons/src/usedIcons.cpp b/plugins/ExtraIcons/src/usedIcons.cpp index 173117b865..7f7b84b5b7 100644 --- a/plugins/ExtraIcons/src/usedIcons.cpp +++ b/plugins/ExtraIcons/src/usedIcons.cpp @@ -26,7 +26,7 @@ struct Icon HANDLE hImage;
Icon(const char *icolibName) :
- name(icolibName), refCount(0), hImage(NULL)
+ name(icolibName), refCount(0), hImage((HANDLE) -1)
{
}
};
@@ -105,6 +105,6 @@ void ResetIcons() usedIcons.erase(std::remove_if(usedIcons.begin(), usedIcons.end(), NotUsedIcon), usedIcons.end());
for (unsigned int i = 0; i < usedIcons.size(); ++i)
- usedIcons[i].hImage = NULL;
+ usedIcons[i].hImage = (HANDLE) -1;
}
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp index c135659cea..89825499db 100644 --- a/plugins/FingerPrintModPlus/src/fingerprint.cpp +++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp @@ -1133,11 +1133,7 @@ HANDLE FASTCALL GetIconIndexFromFI(LPTSTR szMirVer) fiList[nFICount].dwArray = val;
if (hIcon != NULL) {
- do {
- hFoundImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0);
- }
- while (hFoundImage == 0);
-
+ hFoundImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0);
fiList[nFICount].hRegisteredImage = hFoundImage;
DestroyIcon(hIcon);
}
|