Skip to content

Commit 5a10730

Browse files
bmjones2drebbe-intrepid
authored andcommitted
Fix set_reflash_callback since icsneoSetReflashCallback has a void return type
update signature for icsneoSetReflashCallback
1 parent b108b67 commit 5a10730

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

src/methods.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,19 +2137,13 @@ PyObject* meth_set_reflash_callback(PyObject* self, PyObject* args)
21372137
char buffer[512];
21382138
return set_ics_exception(exception_runtime_error(), dll_get_error(buffer));
21392139
}
2140-
ice::Function<int __stdcall(void (*)(const wchar_t*, unsigned long))> icsneoSetReflashCallback(
2140+
ice::Function<void __stdcall(void (*)(const wchar_t*, unsigned long))> icsneoSetReflashCallback(
21412141
lib, "icsneoSetReflashCallback");
21422142
auto gil = PyAllowThreads();
21432143
if (callback == Py_None) {
2144-
if (!icsneoSetReflashCallback(NULL)) {
2145-
gil.restore();
2146-
return set_ics_exception(exception_runtime_error(), "icsneoSetReflashCallback() Failed");
2147-
}
2144+
icsneoSetReflashCallback(NULL);
21482145
} else {
2149-
if (!icsneoSetReflashCallback(&message_reflash_callback)) {
2150-
gil.restore();
2151-
return set_ics_exception(exception_runtime_error(), "icsneoSetReflashCallback() Failed");
2152-
}
2146+
icsneoSetReflashCallback(&message_reflash_callback);
21532147
}
21542148
gil.restore();
21552149
Py_RETURN_NONE;

0 commit comments

Comments
 (0)