1 Star 0 Fork 9

HKGY/zbar

forked from src-openEuler/zbar 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
py311.patch 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
HKGY 提交于 2022-11-09 15:26 +08:00 . v0.23
--- python/enum.c~ 2022-01-12 10:07:02.151116991 -0600
+++ python/enum.c 2022-01-12 10:14:04.093001534 -0600
@@ -23,6 +23,12 @@
#include "zbarmodule.h"
+#if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_SIZE)
+static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size)
+{ ob->ob_size = size; }
+#define Py_SET_SIZE(ob, size) _Py_SET_SIZE((PyVarObject*)(ob), size)
+#endif
+
static char enumitem_doc[] = PyDoc_STR(
"simple enumeration item.\n"
"\n"
--- python/enum.c~ 2022-01-12 10:16:29.670271662 -0600
+++ python/enum.c 2022-01-12 10:52:11.671258442 -0600
@@ -58,7 +58,7 @@
/* we assume the "fast path" for a single-digit ints (see longobject.c) */
/* this also holds if we get a small_int preallocated long */
- Py_SIZE(&self->val) = Py_SIZE(longval);
+ Py_SET_SIZE(&self->val, longval);
self->val.ob_digit[0] = longval->ob_digit[0];
Py_DECREF(longval);
#else
@@ -148,7 +148,7 @@
/* we assume the "fast path" for a single-digit ints (see longobject.c) */
/* this also holds if we get a small_int preallocated long */
- Py_SIZE(&self->val) = Py_SIZE(longval);
+ Py_SET_SIZE(&self->val, longval);
self->val.ob_digit[0] = longval->ob_digit[0];
Py_DECREF(longval);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hkgy/zbar.git
[email protected]:hkgy/zbar.git
hkgy
zbar
zbar
master

搜索帮助