Skip to content

Commit 555b9ff

Browse files
updated libicsneo and fixed more compiler warnings
Signed-off-by: David Rebbe <[email protected]>
1 parent 4668b4b commit 555b9ff

File tree

9 files changed

+700
-724
lines changed

9 files changed

+700
-724
lines changed

build_libicsneo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
LIBUSB_BUILD = f"{LIBUSB_ROOT}/build"
1515
LIBUSB_INSTALL = f"{LIBUSB_ROOT}/install"
1616

17-
LIBICSNEO_VERSION = "06f6861"
17+
LIBICSNEO_VERSION = "02b5daf"
1818
LIBICSNEO_ROOT = f"{ROOT}/libicsneo/{LIBICSNEO_VERSION}"
1919
LIBICSNEO_SOURCE = f"{LIBICSNEO_ROOT}/source"
2020
LIBICSNEO_BUILD = f"{LIBICSNEO_ROOT}/build"

include/exceptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern "C"
88
#endif
99

1010
int initialize_exceptions(PyObject* module);
11-
PyObject* _set_ics_exception(PyObject* exception, char* msg, const char* func_name);
11+
PyObject* _set_ics_exception(PyObject* exception, const char* msg, const char* func_name);
1212
#define set_ics_exception(exception, msg) _set_ics_exception(exception, msg, __FUNCTION__);
1313

1414
PyObject* exception_argument_error(void);

include/methods.h

Lines changed: 2 additions & 527 deletions
Large diffs are not rendered by default.

include/object_spy_message.h

Lines changed: 0 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -50,165 +50,6 @@ typedef struct
5050
} spy_message_j1850_object;
5151
#pragma pack(pop)
5252

53-
static PyMemberDef spy_message_object_members[] = {
54-
{ "StatusBitField", T_UINT, offsetof(spy_message_object, msg.StatusBitField), 0, "StatusBitField" },
55-
{ "StatusBitField2", T_UINT, offsetof(spy_message_object, msg.StatusBitField2), 0, "StatusBitField2" },
56-
{ "TimeHardware",
57-
T_UINT,
58-
offsetof(spy_message_object, msg.TimeHardware),
59-
0,
60-
"Hardware time stamp. The TimeStamp is reset on device open" },
61-
{ "TimeHardware2",
62-
T_UINT,
63-
offsetof(spy_message_object, msg.TimeHardware2),
64-
0,
65-
"Hardware time stamp. The TimeStamp is reset on device open" },
66-
{ "TimeSystem",
67-
T_UINT,
68-
offsetof(spy_message_object, msg.TimeSystem),
69-
0,
70-
"TimeSystem is loaded with the value received from the timeGetTime call in the WIN32 multimedia API." },
71-
{ "TimeSystem2",
72-
T_UINT,
73-
offsetof(spy_message_object, msg.TimeSystem2),
74-
0,
75-
"TimeSystem is loaded with the value received from the timeGetTime call in the WIN32 multimedia API." },
76-
{ "TimeStampHardwareID",
77-
T_UBYTE,
78-
offsetof(spy_message_object, msg.TimeStampHardwareID),
79-
0,
80-
"This is an identifier of what type of hardware timestamp is used. Since neoVI's timestamp is always the same, "
81-
"this doesn't change." },
82-
{ "TimeStampSystemID",
83-
T_UBYTE,
84-
offsetof(spy_message_object, msg.TimeStampSystemID),
85-
0,
86-
"This is an identifier of what type of system timestamp is used. Since WIN32 neoVI's timestamp is always the "
87-
"same, "
88-
"from the timeGetTime API, this doesn't change." },
89-
{ "NetworkID",
90-
T_UBYTE,
91-
offsetof(spy_message_object, msg.NetworkID),
92-
0,
93-
"This value is used to identify which network this message was received on." },
94-
{ "NodeID", T_UBYTE, offsetof(spy_message_object, msg.NodeID), 0, "Not Used" },
95-
{ "Protocol",
96-
T_UBYTE,
97-
offsetof(spy_message_object, msg.Protocol),
98-
0,
99-
"Valid values are SPY_PROTOCOL_CAN, SPY_PROTOCOL_J1850VPW, and SPY_PROTOCOL_ISO9141." },
100-
{ "MessagePieceID", T_UBYTE, offsetof(spy_message_object, msg.MessagePieceID), 0, "Not Used" },
101-
{ "ExtraDataPtrEnabled", T_UBYTE, offsetof(spy_message_object, msg.ExtraDataPtrEnabled), 0, "" },
102-
{ "NumberBytesHeader",
103-
T_UBYTE,
104-
offsetof(spy_message_object, msg.NumberBytesHeader),
105-
0,
106-
" Used for J1850/ISO messages. It indicates how many bytes are stored in the Header(1 to 4) array." },
107-
{ "NumberBytesData",
108-
T_UBYTE,
109-
offsetof(spy_message_object, msg.NumberBytesData),
110-
0,
111-
"Holds the number of bytes in the Data(1 to 8) array or the number of bytes in a CAN remote frame (The DLC)." },
112-
{ "NetworkID2",
113-
T_UBYTE,
114-
offsetof(spy_message_object, msg.NetworkID2),
115-
0,
116-
"This value is used to identify which network this message was received on." },
117-
{ "DescriptionID", T_SHORT, offsetof(spy_message_object, msg.DescriptionID), 0, "Not Used" },
118-
{ "ArbIDOrHeader", T_UINT, offsetof(spy_message_object, msg.ArbIDOrHeader), 0, "" },
119-
{ "Data", T_OBJECT_EX, 0, 0, "" },
120-
{ "StatusBitField3", T_UINT, offsetof(spy_message_object, msg.StatusBitField3), 0, "StatusBitField3" },
121-
{ "StatusBitField4", T_UINT, offsetof(spy_message_object, msg.StatusBitField4), 0, "StatusBitField4" },
122-
{ "AckBytes", T_OBJECT_EX, 0, 0, "" },
123-
{ "ExtraDataPtr", T_OBJECT_EX, offsetof(spy_message_object, msg.ExtraDataPtr), 0, "" },
124-
{ "MiscData", T_UBYTE, offsetof(spy_message_object, msg.MiscData), 0, "" },
125-
{ "noExtraDataPtrCleanup",
126-
T_BOOL,
127-
offsetof(spy_message_object, noExtraDataPtrCleanup),
128-
0,
129-
"Tells Python to not clean up ExtraDataPtrMemory, If this is enabled. Ignore, if unsure." },
130-
{ NULL, 0, 0, 0, NULL },
131-
};
132-
133-
static PyMemberDef spy_message_j1850_object_members[] = {
134-
{ "StatusBitField", T_UINT, offsetof(spy_message_j1850_object, msg.StatusBitField), 0, "StatusBitField" },
135-
{ "StatusBitField2", T_UINT, offsetof(spy_message_j1850_object, msg.StatusBitField2), 0, "StatusBitField2" },
136-
{ "TimeHardware",
137-
T_UINT,
138-
offsetof(spy_message_j1850_object, msg.TimeHardware),
139-
0,
140-
"Hardware time stamp. The TimeStamp is reset on device open" },
141-
{ "TimeHardware2",
142-
T_UINT,
143-
offsetof(spy_message_j1850_object, msg.TimeHardware2),
144-
0,
145-
"Hardware time stamp. The TimeStamp is reset on device open" },
146-
{ "TimeSystem",
147-
T_UINT,
148-
offsetof(spy_message_j1850_object, msg.TimeSystem),
149-
0,
150-
"TimeSystem is loaded with the value received from the timeGetTime call in the WIN32 multimedia API." },
151-
{ "TimeSystem2",
152-
T_UINT,
153-
offsetof(spy_message_j1850_object, msg.TimeSystem2),
154-
0,
155-
"TimeSystem is loaded with the value received from the timeGetTime call in the WIN32 multimedia API." },
156-
{ "TimeStampHardwareID",
157-
T_UBYTE,
158-
offsetof(spy_message_j1850_object, msg.TimeStampHardwareID),
159-
0,
160-
"This is an identifier of what type of hardware timestamp is used. Since neoVI's timestamp is always the same, "
161-
"this doesn't change." },
162-
{ "TimeStampSystemID",
163-
T_UBYTE,
164-
offsetof(spy_message_j1850_object, msg.TimeStampSystemID),
165-
0,
166-
"This is an identifier of what type of system timestamp is used. Since WIN32 neoVI's timestamp is always the "
167-
"same, "
168-
"from the timeGetTime API, this doesn't change." },
169-
{ "NetworkID",
170-
T_UBYTE,
171-
offsetof(spy_message_j1850_object, msg.NetworkID),
172-
0,
173-
"This value is used to identify which network this message was received on." },
174-
{ "NodeID", T_UBYTE, offsetof(spy_message_j1850_object, msg.NodeID), 0, "Not Used" },
175-
{ "Protocol",
176-
T_UBYTE,
177-
offsetof(spy_message_j1850_object, msg.Protocol),
178-
0,
179-
"Valid values are SPY_PROTOCOL_CAN, SPY_PROTOCOL_J1850VPW, and SPY_PROTOCOL_ISO9141." },
180-
{ "MessagePieceID", T_UBYTE, offsetof(spy_message_j1850_object, msg.MessagePieceID), 0, "Not Used" },
181-
{ "ExtraDataPtrEnabled", T_UBYTE, offsetof(spy_message_j1850_object, msg.ExtraDataPtrEnabled), 0, "" },
182-
{ "NumberBytesHeader",
183-
T_UBYTE,
184-
offsetof(spy_message_j1850_object, msg.NumberBytesHeader),
185-
0,
186-
" Used for J1850/ISO messages. It indicates how many bytes are stored in the Header(1 to 4) array." },
187-
{ "NumberBytesData",
188-
T_UBYTE,
189-
offsetof(spy_message_j1850_object, msg.NumberBytesData),
190-
0,
191-
"Holds the number of bytes in the Data(1 to 8) array or the number of bytes in a CAN remote frame (The DLC)." },
192-
{ "NetworkID2",
193-
T_UBYTE,
194-
offsetof(spy_message_object, msg.NetworkID2),
195-
0,
196-
"This value is used to identify which network this message was received on." },
197-
{ "DescriptionID", T_SHORT, offsetof(spy_message_j1850_object, msg.DescriptionID), 0, "Not Used" },
198-
{ "Header", T_OBJECT_EX, 0, 0, "" },
199-
{ "Data", T_OBJECT_EX, 0, 0, "" },
200-
{ "StatusBitField3", T_UINT, offsetof(spy_message_j1850_object, msg.StatusBitField3), 0, "StatusBitField3" },
201-
{ "StatusBitField4", T_UINT, offsetof(spy_message_j1850_object, msg.StatusBitField4), 0, "StatusBitField4" },
202-
{ "AckBytes", T_OBJECT_EX, 0, 0, "" },
203-
{ "ExtraDataPtr", T_OBJECT_EX, offsetof(spy_message_j1850_object, msg.ExtraDataPtr), 0, "" },
204-
{ "MiscData", T_UBYTE, offsetof(spy_message_j1850_object, msg.MiscData), 0, "" },
205-
{ "noExtraDataPtrCleanup",
206-
T_BOOL,
207-
offsetof(spy_message_object, noExtraDataPtrCleanup),
208-
0,
209-
"Tells Python to not clean up ExtraDataPtrMemory, If this is enabled. Ignore, if unsure." },
210-
{ NULL, 0, 0, 0, NULL },
211-
};
21253

21354
extern PyTypeObject spy_message_object_type;
21455
extern PyTypeObject spy_message_j1850_object_type;

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ def get_ics_extension_compiler_arguments() -> List[str]:
7070
"""Return a list of compiler arguments to append for compiling the ics extension module"""
7171
# gcc and clang arguments
7272
GCC_COMPILE_ARGS = [
73-
"-fpermissive",
74-
"-Wno-unused-variable",
75-
"-Wno-unused-function",
76-
"-Wno-write-strings",
73+
"-Wno-unknown-pragmas",
7774
]
7875
# Set compiler flags here
7976
if "WINDOWS" in platform.system().upper():

src/exceptions.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,6 @@
55
static PyObject* IcsArgumentError = NULL;
66
static PyObject* IcsRuntimeError = NULL;
77

8-
char* pyics_base36enc(int sn)
9-
{
10-
#if PY_MAJOR_VERSION >= 3
11-
PyObject* name = PyUnicode_FromString("ics.ics");
12-
#else
13-
PyObject* name = PyString_FromString("ics.ics");
14-
#endif
15-
PyObject* module = PyImport_Import(name);
16-
PyObject* dict = PyModule_GetDict(module);
17-
PyObject* base36enc = PyDict_GetItemString(dict, "base36enc");
18-
if (PyCallable_Check(base36enc)) {
19-
PyObject* return_value = PyObject_CallFunction(base36enc, "i", sn);
20-
if (return_value == NULL) {
21-
// We failed for some reason...
22-
PyErr_Print();
23-
Py_DECREF(module);
24-
Py_DECREF(name);
25-
return NULL;
26-
} else {
27-
return PyUniStr_AsStrOrUTF8(return_value);
28-
}
29-
}
30-
Py_DECREF(module);
31-
Py_DECREF(name);
32-
return "";
33-
}
34-
358
int initialize_exceptions(PyObject* module)
369
{
3710
if (!module && IcsArgumentError && IcsRuntimeError) {

src/ice

0 commit comments

Comments
 (0)