projects/guix·blob python-team · refs

131 lines · 3.8 KiB

1Taken from upstream.
2
3From 4c2369083c5941ffada100e4a7e4702e681585e3 Mon Sep 17 00:00:00 2001
4From: taozuhong <[email protected]>
5Date: Tue, 11 Jan 2022 15:03:28 +0800
6Subject: [PATCH] fixed compile error
7
8---
9 libgda/Gda-6.0-custom.vala | 3 +++
10 libgda/sql-parser/lemon.c | 39 +++++++++++++++++++-------------------
11 2 files changed, 22 insertions(+), 20 deletions(-)
12
13diff --git a/libgda/Gda-6.0-custom.vala b/libgda/Gda-6.0-custom.vala
14index d046c5c24..4d1408648 100644
15--- a/libgda/Gda-6.0-custom.vala
16+++ b/libgda/Gda-6.0-custom.vala
17@@ -92,7 +92,10 @@ namespace Gda {
18 [CCode (cheader_filename = "libgda.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gda_sql_statement_get_type ()")]
19 [Compact]
20 public class SqlStatement {
21+ #if VALA_0_50
22+ #else
23 public static Gda.SqlStatementContentsInfo get_contents_infos (Gda.SqlStatementType type);
24+ #endif
25 }
26
27 }
28diff --git a/libgda/sql-parser/lemon.c b/libgda/sql-parser/lemon.c
29index a6fe75bb9..a3c727777 100644
30--- a/libgda/sql-parser/lemon.c
31+++ b/libgda/sql-parser/lemon.c
32@@ -11,6 +11,7 @@
33 #include <string.h>
34 #include <ctype.h>
35 #include <stdlib.h>
36+#include <stdint.h>
37 #include <assert.h>
38 #include <gio/gio.h>
39
40@@ -40,7 +41,7 @@ static const char **made_files = NULL;
41 static int made_files_count = 0;
42 static int successful_exit = 0;
43
44-static char *msort(char*,char**,int(*)(const char*,const char*));
45+static uintptr_t msort(uintptr_t, uintptr_t*, int(*)(const uintptr_t, const uintptr_t));
46
47 /*
48 ** Compilers are getting increasingly pedantic about type conversions
49@@ -396,8 +397,7 @@ static int actioncmp(
50 static struct action *Action_sort(
51 struct action *ap
52 ){
53- ap = (struct action *)msort((char *)ap,(char **)&ap->next,
54- (int(*)(const char*,const char*))actioncmp);
55+ ap = (struct action *)msort(ap, &ap->next, actioncmp);
56 return ap;
57 }
58
59@@ -1277,14 +1277,14 @@ void Configlist_closure(struct lemon *lemp)
60
61 /* Sort the configuration list */
62 void Configlist_sort(){
63- current = (struct config *)msort((char *)current,(char **)&(current->next),Configcmp);
64+ current = (struct config *)msort(current, &(current->next), Configcmp);
65 currentend = 0;
66 return;
67 }
68
69 /* Sort the basis configuration list */
70 void Configlist_sortbasis(){
71- basis = (struct config *)msort((char *)current,(char **)&(current->bp),Configcmp);
72+ basis = (struct config *)msort(current, &(current->bp), Configcmp);
73 basisend = 0;
74 return;
75 }
76@@ -1577,7 +1577,7 @@ int main(G_GNUC_UNUSED int argc, char **argv)
77 /*
78 ** Return a pointer to the next structure in the linked list.
79 */
80-#define NEXT(A) (*(char**)(((unsigned long)A)+offset))
81+#define NEXT(A) (*(uintptr_t *)(((uintptr_t)A)+offset))
82
83 /*
84 ** Inputs:
85@@ -1594,13 +1594,13 @@ int main(G_GNUC_UNUSED int argc, char **argv)
86 ** The "next" pointers for elements in the lists a and b are
87 ** changed.
88 */
89-static char *merge(
90- char *a,
91- char *b,
92- int (*cmp)(const char*,const char*),
93- int offset
94+static uintptr_t merge(
95+ uintptr_t a,
96+ uintptr_t b,
97+ int (*cmp)(const uintptr_t, const uintptr_t),
98+ uintptr_t offset
99 ){
100- char *ptr, *head;
101+ uintptr_t ptr, *head;
102
103 if( a==0 ){
104 head = b;
105@@ -1646,16 +1646,15 @@ static char *merge(
106 ** The "next" pointers for elements in list are changed.
107 */
108 #define LISTSIZE 30
109-static char *msort(
110- char *list,
111- char **next,
112- int (*cmp)(const char*,const char*)
113+static uintptr_t msort(
114+ uintptr_t list,
115+ uintptr_t *next,
116+ int (*cmp)(const uintptr_t, const uintptr_t)
117 ){
118- unsigned long offset;
119- char *ep;
120- char *set[LISTSIZE];
121+ uintptr_t ep;
122+ uintptr_t set[LISTSIZE];
123 int i;
124- offset = (unsigned long)next - (unsigned long)list;
125+ uintptr_t offset = (uintptr_t)next - (uintptr_t)list;
126 for(i=0; i<LISTSIZE; i++) set[i] = 0;
127 while( list ){
128 ep = list;
129--
130GitLab
131