diff src/if_py_both.h @ 28226:89c181c99e23 v8.2.4639

patch 8.2.4639: not sufficient parenthesis in preprocessor macros Commit: https://github.com/vim/vim/commit/9dac9b1751dd43c02470cc6a2aecaeea27abcc80 Author: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Sun Mar 27 20:05:17 2022 +0100 patch 8.2.4639: not sufficient parenthesis in preprocessor macros Problem: Not sufficient parenthesis in preprocessor macros. Solution: Add more parenthesis. (closes https://github.com/vim/vim/issues/10031)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Mar 2022 21:15:04 +0200
parents dc21c2f9c659
children c0403cd5ca06
line wrap: on
line diff
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -30,9 +30,9 @@ static const char *vim_special_path = "_
 #define PyErr_FORMAT2(exc, str, arg1, arg2) PyErr_Format(exc, _(str), arg1,arg2)
 #define PyErr_VIM_FORMAT(str, arg) PyErr_FORMAT(VimError, str, arg)
 
-#define Py_TYPE_NAME(obj) (obj->ob_type->tp_name == NULL \
+#define Py_TYPE_NAME(obj) ((obj)->ob_type->tp_name == NULL \
 	? "(NULL)" \
-	: obj->ob_type->tp_name)
+	: (obj)->ob_type->tp_name)
 
 #define RAISE_NO_EMPTY_KEYS PyErr_SET_STRING(PyExc_ValueError, \
 					    N_("empty keys are not allowed"))
@@ -6686,7 +6686,7 @@ init_structs(void)
 }
 
 #define PYTYPE_READY(type) \
-    if (PyType_Ready(&type)) \
+    if (PyType_Ready(&(type))) \
 	return -1;
 
     static int