Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2018-10-07 18:22:17 +0300
committermano-wii <germano.costa@ig.com.br>2018-10-07 18:22:17 +0300
commitaf7967b010d3dff6ecdece7e5fd1932d1cd0c23d (patch)
tree6986a6681606daa0c2d9a9f8060b300d91032dbe /source/blender/python
parent91bfea5b052a6276654eb4f71c71707cda3d4305 (diff)
CPython: py_capi_utils: format char utilities do not need to be inline.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/generic/py_capi_utils.c78
-rw-r--r--source/blender/python/generic/py_capi_utils.h74
2 files changed, 83 insertions, 69 deletions
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__ */