Skip to content

Commit 3225389

Browse files
committed
Correct casting issue of notifyCode->nmhdr.hwndFrom as void* could not be stored and retrieved in boost::python::dict
1 parent ea3c646 commit 3225389

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PythonScript/src/NotepadPlusWrapper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void NotepadPlusWrapper::notify(SCNotification *notifyCode)
109109
break;
110110

111111
case NPPN_READONLYCHANGED:
112-
params["bufferID"] = notifyCode->nmhdr.hwndFrom;
112+
params["bufferID"] = reinterpret_cast<uintptr_t>(notifyCode->nmhdr.hwndFrom);
113113
params["readonly"] = (notifyCode->nmhdr.idFrom & 1) ? true : false;
114114
params["dirty"] = (notifyCode->nmhdr.idFrom & 2) ? true : false;
115115
break;
@@ -128,14 +128,14 @@ void NotepadPlusWrapper::notify(SCNotification *notifyCode)
128128
break;
129129

130130
case NPPN_DOCORDERCHANGED:
131-
params["newIndex"] = notifyCode->nmhdr.hwndFrom;
131+
params["newIndex"] = reinterpret_cast<uintptr_t>(notifyCode->nmhdr.hwndFrom);
132132
params["bufferID"] = notifyCode->nmhdr.idFrom;
133133
break;
134134

135135
default:
136136
// Unknown notification, so just fill in the parameters as integers.
137137
params["idFrom"] = notifyCode->nmhdr.idFrom;
138-
params["hwndFrom"] = notifyCode->nmhdr.hwndFrom;
138+
params["hwndFrom"] = reinterpret_cast<uintptr_t>(notifyCode->nmhdr.hwndFrom);
139139
break;
140140
}
141141

0 commit comments

Comments
 (0)