summaryrefslogtreecommitdiffstats
path: root/fixes/ob_type.cocci
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2009-11-20 14:15:30 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2009-11-20 14:15:30 -0500
commite9365c606a134c4ea96986066d4f9df26d2af896 (patch)
tree03aefc2ee09a19e6143110d8bc9d4705ea9c16d6 /fixes/ob_type.cocci
parent39ef6a95320335630b7c82f8686ed62fde6f970c (diff)
download2to3c-e9365c606a134c4ea96986066d4f9df26d2af896.tar.gz
2to3c-e9365c606a134c4ea96986066d4f9df26d2af896.tar.xz
2to3c-e9365c606a134c4ea96986066d4f9df26d2af896.zip
Move .cocci files and typeobject.py into a new "fixes" subdirectory
Diffstat (limited to 'fixes/ob_type.cocci')
-rw-r--r--fixes/ob_type.cocci27
1 files changed, 27 insertions, 0 deletions
diff --git a/fixes/ob_type.cocci b/fixes/ob_type.cocci
new file mode 100644
index 0000000..daf6d96
--- /dev/null
+++ b/fixes/ob_type.cocci
@@ -0,0 +1,27 @@
+// Convert non-PyObject* deferences of "ob_type" to use Py_TYPE macro instead
+@@
+PyObject *py_obj_ptr;
+type T;
+T non_py_obj_ptr;
+@@
+(
+ py_obj_ptr->ob_type
+|
+- non_py_obj_ptr->ob_type
++ Py_TYPE(non_py_obj_ptr)
+)
+
+@@
+identifier F; // FIXME: must be an initial field of a struct
+type T;
+T non_py_obj_ptr;
+@@
+- non_py_obj_ptr->F.ob_type
++ Py_TYPE(non_py_obj_ptr)
+
+@@
+PyTypeObject typeobj;
+@@
+- typeobj.ob_type
++ Py_TYPE(&typeobj)
+