[Bf-blender-cvs] [af7967b010d] blender2.8: CPython: py_capi_utils: format char utilities do not need to be inline.
mano-wii
noreply at git.blender.org
Sun Oct 7 17:26:05 CEST 2018
Commit: af7967b010d3dff6ecdece7e5fd1932d1cd0c23d
Author: mano-wii
Date: Sun Oct 7 12:22:17 2018 -0300
Branches: blender2.8
https://developer.blender.org/rBaf7967b010d3dff6ecdece7e5fd1932d1cd0c23d
CPython: py_capi_utils: format char utilities do not need to be inline.
===================================================================
M source/blender/python/generic/py_capi_utils.c
M source/blender/python/generic/py_capi_utils.h
===================================================================
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 62b24618d3f..047ff9807a6 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -1327,6 +1327,84 @@ uint32_t PyC_Long_AsU32(PyObject *value)
* PyC_Long_AsU64
*/
+/* -------------------------------------------------------------------- */
+
+/** \name Py_buffer Utils
+ *
+ * \{ */
+
+char PyC_Formatchar_get(const char *typestr)
+{
+ switch (typestr[0]) {
+ case '!':
+ case '<':
+ case '=':
+ case '>':
+ case '@':
+ return typestr[1];
+ default:
+ return typestr[0];
+ }
+}
+
+bool PyC_Formatchar_is_floating_type(char format)
+{
+ switch (format) {
+ case 'f':
+ case 'd':
+ case 'e':
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool PyC_Formatchar_is_integer_type(char format)
+{
+ switch (format) {
+ case 'i':
+ case 'I':
+ case 'l':
+ case 'L':
+ case 'h':
+ case 'H':
+ case 'b':
+ case 'B':
+ case 'q':
+ case 'Q':
+ case 'n':
+ case 'N':
+ case 'P':
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool PyC_Formatchar_is_byte_type(char format)
+{
+ switch (format) {
+ case 'c':
+ case 's':
+ case 'p':
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool PyC_Formatchar_is_boolean_type(char format)
+{
+ switch (format) {
+ case '?':
+ return true;
+ default:
+ return false;
+ }
+}
+
+/** \} */
+
#ifdef __GNUC__
# pragma warning(pop)
#endif
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index 5ff070d3b75..7631dc3f3a6 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -132,74 +132,10 @@ Py_LOCAL_INLINE(int64_t) PyC_Long_AsI64(PyObject *value) { return (int64_t)PyLo
Py_LOCAL_INLINE(uint64_t) PyC_Long_AsU64(PyObject *value) { return (uint64_t)PyLong_AsUnsignedLongLong(value); }
/* utils for format string in `struct` module style syntax */
-Py_LOCAL_INLINE(char) PyC_Formatchar_get(const char *typestr)
-{
- switch (typestr[0]) {
- case '!':
- case '<':
- case '=':
- case '>':
- case '@':
- return typestr[1];
- default:
- return typestr[0];
- }
-}
-
-Py_LOCAL_INLINE(bool) PyC_Formatchar_is_floating_type(char format)
-{
- switch (format) {
- case 'f':
- case 'd':
- case 'e':
- return true;
- default:
- return false;
- }
-}
-
-Py_LOCAL_INLINE(bool) PyC_Formatchar_is_integer_type(char format)
-{
- switch (format) {
- case 'i':
- case 'I':
- case 'l':
- case 'L':
- case 'h':
- case 'H':
- case 'b':
- case 'B':
- case 'q':
- case 'Q':
- case 'n':
- case 'N':
- case 'P':
- return true;
- default:
- return false;
- }
-}
-
-Py_LOCAL_INLINE(bool) PyC_Formatchar_is_byte_type(char format)
-{
- switch (format) {
- case 'c':
- case 's':
- case 'p':
- return true;
- default:
- return false;
- }
-}
-
-Py_LOCAL_INLINE(bool) PyC_Formatchar_is_boolean_type(char format)
-{
- switch (format) {
- case '?':
- return true;
- default:
- return false;
- }
-}
+char PyC_Formatchar_get(const char *typestr);
+bool PyC_Formatchar_is_floating_type(char format);
+bool PyC_Formatchar_is_integer_type(char format);
+bool PyC_Formatchar_is_byte_type(char format);
+bool PyC_Formatchar_is_boolean_type(char format);
#endif /* __PY_CAPI_UTILS_H__ */
More information about the Bf-blender-cvs
mailing list