File: Fix-too-many-args-to-gpps-compilation-error.patch

package info (click to toggle)
sqliteodbc 0.99991-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,320 kB
  • sloc: ansic: 59,154; sh: 12,780; makefile: 952; sql: 313
file content (177 lines) | stat: -rw-r--r-- 5,185 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
From: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
Date: Tue, 21 Jan 2025 22:28:16 +0100
Subject: Fix too many args to gpps() compilation error
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Fixes the following error:
 sqliteodbc.c: In function ‘drvgpps’:
 sqliteodbc.c:747:16: error: too many arguments to function ‘d->gpps’;
  expected 0, have 6
   747 |         return d->gpps(sect, ent, def, buf, bufsiz, fname);
       |                ^       ~~~~
 In file included from sqliteodbc.c:15:
 sqliteodbc.h:158:11: note: declared here
   158 |     int (*gpps)();
       |           ^~~~

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
Origin: Fedora
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1097926
---
 sqlite3odbc.c |  3 +--
 sqlite3odbc.h | 10 +++++++++-
 sqlite4odbc.c |  3 +--
 sqlite4odbc.h | 10 +++++++++-
 sqliteodbc.c  |  3 +--
 sqliteodbc.h  | 10 +++++++++-
 6 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/sqlite3odbc.c b/sqlite3odbc.c
index 9b001ad..fd174c6 100644
--- a/sqlite3odbc.c
+++ b/sqlite3odbc.c
@@ -1240,7 +1240,6 @@ static void
 drvgetgpps(DBC *d)
 {
     void *lib;
-    int (*gpps)();
 
     lib = dlopen("libodbcinst.so.2", RTLD_LAZY);
     if (!lib) {
@@ -1256,7 +1255,7 @@ drvgetgpps(DBC *d)
 	lib = dlopen("libiodbcinst.so", RTLD_LAZY);
     }
     if (lib) {
-	gpps = (int (*)()) dlsym(lib, "SQLGetPrivateProfileString");
+	gpps_t gpps = (gpps_t) dlsym(lib, "SQLGetPrivateProfileString");
 	if (!gpps) {
 	    dlclose(lib);
 	    return;
diff --git a/sqlite3odbc.h b/sqlite3odbc.h
index f398ad5..f7d8489 100644
--- a/sqlite3odbc.h
+++ b/sqlite3odbc.h
@@ -103,6 +103,14 @@ typedef struct {
     struct dbc *dbcs;		/**< Pointer to first DBC */
 } ENV;
 
+/* Based on SQLGetPrivateProfileString from the odbcinst.h */
+typedef int (*gpps_t)(const char *lpszSection,
+                const char *lpszEntry,
+                const char *lpszDefault,
+                const char *RetBuffer,
+                int cbRetBuffer,
+                const char *lpszFilename);
+
 /**
  * @typedef DBC
  * @struct dbc
@@ -147,7 +155,7 @@ typedef struct dbc {
     int pwdLen;			/**< Length of password */
 #ifdef USE_DLOPEN_FOR_GPPS
     void *instlib;
-    int (*gpps)();
+    gpps_t gpps;
 #endif
 #if defined(_WIN32) || defined(_WIN64)
     CRITICAL_SECTION cs;	/**< For serializing most APIs */
diff --git a/sqlite4odbc.c b/sqlite4odbc.c
index c4ac684..cbce62b 100644
--- a/sqlite4odbc.c
+++ b/sqlite4odbc.c
@@ -1210,7 +1210,6 @@ static void
 drvgetgpps(DBC *d)
 {
     void *lib;
-    int (*gpps)();
 
     lib = dlopen("libodbcinst.so.2", RTLD_LAZY);
     if (!lib) {
@@ -1226,7 +1225,7 @@ drvgetgpps(DBC *d)
 	lib = dlopen("libiodbcinst.so", RTLD_LAZY);
     }
     if (lib) {
-	gpps = (int (*)()) dlsym(lib, "SQLGetPrivateProfileString");
+	gpps_t gpps = (gpps_t) dlsym(lib, "SQLGetPrivateProfileString");
 	if (!gpps) {
 	    dlclose(lib);
 	    return;
diff --git a/sqlite4odbc.h b/sqlite4odbc.h
index 79917e0..ef0d14c 100644
--- a/sqlite4odbc.h
+++ b/sqlite4odbc.h
@@ -103,6 +103,14 @@ typedef struct {
     struct dbc *dbcs;		/**< Pointer to first DBC */
 } ENV;
 
+/* Based on SQLGetPrivateProfileString from the odbcinst.h */
+typedef int (*gpps_t)(const char *lpszSection,
+                const char *lpszEntry,
+                const char *lpszDefault,
+                const char *RetBuffer,
+                int cbRetBuffer,
+                const char *lpszFilename);
+
 /**
  * @typedef DBC
  * @struct dbc
@@ -145,7 +153,7 @@ typedef struct dbc {
     int pwdLen;			/**< Length of password */
 #ifdef USE_DLOPEN_FOR_GPPS
     void *instlib;
-    int (*gpps)();
+    gpps_t gpps;
 #endif
 #if defined(_WIN32) || defined(_WIN64)
     CRITICAL_SECTION cs;	/**< For serializing most APIs */
diff --git a/sqliteodbc.c b/sqliteodbc.c
index ad30b4a..021d7bb 100644
--- a/sqliteodbc.c
+++ b/sqliteodbc.c
@@ -704,7 +704,6 @@ static void
 drvgetgpps(DBC *d)
 {
     void *lib;
-    int (*gpps)();
 
     lib = dlopen("libodbcinst.so.2", RTLD_LAZY);
     if (!lib) {
@@ -720,7 +719,7 @@ drvgetgpps(DBC *d)
 	lib = dlopen("libiodbcinst.so", RTLD_LAZY);
     }
     if (lib) {
-	gpps = (int (*)()) dlsym(lib, "SQLGetPrivateProfileString");
+	gpps_t gpps = (gpps_t) dlsym(lib, "SQLGetPrivateProfileString");
 	if (!gpps) {
 	    dlclose(lib);
 	    return;
diff --git a/sqliteodbc.h b/sqliteodbc.h
index 61af597..88d74b7 100644
--- a/sqliteodbc.h
+++ b/sqliteodbc.h
@@ -118,6 +118,14 @@ typedef struct {
     struct dbc *dbcs;		/**< Pointer to first DBC */
 } ENV;
 
+/* Based on SQLGetPrivateProfileString from the odbcinst.h */
+typedef int (*gpps_t)(const char *lpszSection,
+                const char *lpszEntry,
+                const char *lpszDefault,
+                const char *RetBuffer,
+                int cbRetBuffer,
+                const char *lpszFilename);
+
 /**
  * @typedef DBC
  * @struct dbc
@@ -155,7 +163,7 @@ typedef struct dbc {
 #endif
 #ifdef USE_DLOPEN_FOR_GPPS
     void *instlib;
-    int (*gpps)();
+    gpps_t gpps;
 #endif
 #if defined(_WIN32) || defined(_WIN64)
     CRITICAL_SECTION cs;	/**< For serializing most APIs */