-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply patch for _PyFloat_Unpack4 error for mlat-client
- Loading branch information
1 parent
219425d
commit 68fa6ac
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,8 @@ piaware*.buildinfo | |
piaware*.ddeb | ||
package-* | ||
|
||
# package directories | ||
package-*/ | ||
|
||
# PyCharm stuff | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff -ur mlat-client/modes_reader.c mlat-client.new/modes_reader.c | ||
--- mlat-client/modes_reader.c 2023-07-19 16:16:39.000000000 +0200 | ||
+++ mlat-client.new/modes_reader.c 2023-07-19 16:20:36.640656745 +0200 | ||
@@ -503,6 +503,19 @@ | ||
{ | ||
float lat, lon, alt; | ||
|
||
+#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >=11 | ||
+ lat = PyFloat_Unpack4(data + 4, 1); | ||
+ if (lat == -1.0 && PyErr_Occurred()) | ||
+ return NULL; | ||
+ | ||
+ lon = PyFloat_Unpack4(data + 8, 1); | ||
+ if (lon == -1.0 && PyErr_Occurred()) | ||
+ return NULL; | ||
+ | ||
+ alt = PyFloat_Unpack4(data + 12, 1); | ||
+ if (alt == -1.0 && PyErr_Occurred()) | ||
+ return NULL; | ||
+#else | ||
lat = _PyFloat_Unpack4(data + 4, 1); | ||
if (lat == -1.0 && PyErr_Occurred()) | ||
return NULL; | ||
@@ -514,6 +527,7 @@ | ||
alt = _PyFloat_Unpack4(data + 12, 1); | ||
if (alt == -1.0 && PyErr_Occurred()) | ||
return NULL; | ||
+#endif | ||
|
||
return Py_BuildValue("{s:f,s:f,s:f}", | ||
"lat", lat, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters