Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5518,7 +5518,6 @@ PyObject* meth_get_component_versions(PyObject* self, PyObject* args) // icsneoG
char buffer[512];
return set_ics_exception(exception_runtime_error(), dll_get_error(buffer));
}
uint64_t imei = 0;
ice::Function<int __stdcall(void*, VersionReport*, uint64_t*, bool)> icsneoGetComponentVersions(lib, "icsneoGetComponentVersions");
auto gil = PyAllowThreads();
std::vector<VersionReport> version_reports;
Expand All @@ -5534,7 +5533,7 @@ PyObject* meth_get_component_versions(PyObject* self, PyObject* args) // icsneoG
if (!tuple) {
return NULL;
}
for (int i = 0; i < length; ++i) {
for (uint64_t i = 0; i < length; ++i) {
PyObject* obj = _getPythonModuleObject("ics.structures.version_report", "version_report");
if (!obj) {
return set_ics_exception(exception_runtime_error(), "Failed to allocate version_report");
Expand Down
6 changes: 3 additions & 3 deletions src/object_spy_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static int spy_message_object_setattr(PyObject* o, PyObject* name, PyObject* val
if (!data && !PyLong_Check(data)) {
obj->msg.AckBytes[i] = 0;
} else {
obj->msg.AckBytes[i] = (unsigned char)PyLong_AsLong(data);
obj->msg.AckBytes[i] = static_cast<uint8_t>(PyLong_AsLong(data));
}
}
return 0;
Expand All @@ -163,8 +163,8 @@ static int spy_message_object_setattr(PyObject* o, PyObject* name, PyObject* val
} else {
((spy_message_j1850_object*)obj)->msg.Header[i] = (unsigned char)PyLong_AsLong(data);
}
obj->msg.NumberBytesHeader = static_cast<uint8_t>(PyObject_Length(value));
}
obj->msg.NumberBytesHeader = static_cast<uint8_t>(PyObject_Length(value));
return 0;
} else if (PyUnicode_CompareWithASCIIString(name, "Protocol") == 0) {
// Ethernet behavior is backward to CAN and will crash if enabled.
Expand All @@ -181,7 +181,7 @@ static int spy_message_object_setattr(PyObject* o, PyObject* name, PyObject* val
return -1;
}
// Get tuple items and place them in array, set as 0 if error.
size_t length = static_cast<uint8_t>(PyObject_Length(value));
size_t length = static_cast<uint16_t>(PyObject_Length(value));
if (obj->msg.ExtraDataPtr != NULL)
delete[] (unsigned char*)obj->msg.ExtraDataPtr;
obj->msg.ExtraDataPtr = new unsigned char[length];
Expand Down
Loading