aboutsummaryrefslogtreecommitdiff
path: root/srcpkgs/pilot-link/patches/fix-swig_const_char_ptr.patch
blob: 8df5f2b59379e8d18fab3364ada2995032275fa8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
--- a/bindings/Python/src/pisock_wrap.c	2006-03-24 21:07:52.000000000 +0100
+++ b/bindings/Python/src/pisock_wrap.c	2016-12-20 15:03:35.066297623 +0100
@@ -1211,7 +1211,7 @@
     obj = pyobj;
     if (PyCFunction_Check(obj)) {
       /* here we get the method pointer for callbacks */
-      char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+      const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
       c = doc ? strstr(doc, "swig_ptr: ") : 0;
       if (c) {
 	c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0;
@@ -5827,18 +5827,16 @@
 
 static PyObject *_wrap_delete_PilotUser(PyObject *self, PyObject *args) {
     PyObject *resultobj = NULL;
-    struct PilotUser *arg1 = (struct PilotUser *) 0 ;
-    struct PilotUser temp1 ;
-    
-    
-    arg1 = &temp1;
+    struct PilotUser *arg1 = (struct PilotUser *) malloc(sizeof(struct PilotUser));
+
+    if(!arg1) goto fail;
     
     if(!PyArg_ParseTuple(args,(char *)":delete_PilotUser")) goto fail;
-    free((char *) arg1);
     
     Py_INCREF(Py_None); resultobj = Py_None;
     
     if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1));
+    free(arg1);
     
     return resultobj;
     fail:
@@ -6337,18 +6335,16 @@
 
 static PyObject *_wrap_delete_SysInfo(PyObject *self, PyObject *args) {
     PyObject *resultobj = NULL;
-    struct SysInfo *arg1 = (struct SysInfo *) 0 ;
-    struct SysInfo temp1 ;
+    struct SysInfo *arg1 = (struct SysInfo *) malloc(sizeof(struct SysInfo));
     
-    
-    arg1 = &temp1;
+    if(!arg1) goto fail;
     
     if(!PyArg_ParseTuple(args,(char *)":delete_SysInfo")) goto fail;
-    free((char *) arg1);
     
     Py_INCREF(Py_None); resultobj = Py_None;
     
     if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1));
+    free(arg1);
     
     return resultobj;
     fail:
@@ -12905,7 +12905,7 @@
     swig_type_info **types_initial) {
         size_t i;
         for (i = 0; methods[i].ml_name; ++i) {
-            char *c = methods[i].ml_doc;
+            const char *c = methods[i].ml_doc;
             if (c && (c = strstr(c, "swig_ptr: "))) {
                 int j;
                 swig_const_info *ci = 0;
@@ -12909,7 +12909,7 @@
             if (c && (c = strstr(c, "swig_ptr: "))) {
                 int j;
                 swig_const_info *ci = 0;
-                char *name = c + 10;
+                const char *name = c + 10;
                 for (j = 0; const_table[j].type; ++j) {
                     if (strncmp(const_table[j].name, name, 
                     strlen(const_table[j].name)) == 0) {