[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#512658: ITP: coccinelle -- semantic patching tool for C



On Fri, Jan 23, 2009 at 12:30:19AM +0100, Eugeniy Meshcheryakov wrote:
> pycaml version in coccinelle is modified. Diff can be found in 
> pycaml/modif-orig.txt (not complete). The most important part,
> it seems, is:

I guess you've already seen it, but I posted an additional patch that
is needed for Python 2.6.  HOWEVER I'm not very confident that the
patch is correct :-(

Rich.

-- 
Richard Jones
Red Hat
diff -ur coccinelle-0.1.4.orig/pycaml/pycaml_ml.c coccinelle-0.1.4/pycaml/pycaml_ml.c
--- coccinelle-0.1.4.orig/pycaml/pycaml_ml.c	2008-03-29 20:25:26.000000000 +0000
+++ coccinelle-0.1.4/pycaml/pycaml_ml.c	2009-01-21 21:58:21.000000000 +0000
@@ -173,7 +173,7 @@
     int fd;
     int x;
     int ret_int;
-    char *rvs;
+    const char *rvs;
     int fmt = Int_val(Field(format,1));
     PyObject *ob1,*ob2,*ob3;
     void *func = getcustom(Field(format,0));
@@ -1184,7 +1184,12 @@
 { (void *)PyImport_AddModule, 28, "PyImport_AddModule" },
 { (void *)PyImport_ImportModule, 28, "PyImport_ImportModule" },
 /* 51 */
+#ifndef PyImport_ImportModuleEx
+    /* In Python 2.6, this because a #define so we cannot take
+     * the address of the function.  - RWMJ.
+     */
 { (void *)PyImport_ImportModuleEx, 51, "PyImport_ImportModuleEx" },
+#endif
 /* 28 */
 { (void *)PyImport_Import, 28, "PyImport_Import" },
 /* 14 */

Reply to: