|
Line 0
Link Here
|
|
|
1 |
From c3badbdb282a5ffb411ee2b5062ed345896fb149 Mon Sep 17 00:00:00 2001 |
| 2 |
From: Paul J Stevens <p.stevens@lukkien.com> |
| 3 |
Date: Fri, 8 Jan 2016 18:42:24 +0100 |
| 4 |
Subject: [PATCH 2/7] fix compiler warnings for GCC5 |
| 5 |
|
| 6 |
--- |
| 7 |
src/dm_db.c | 26 +++++++++++++------------- |
| 8 |
src/dm_mailbox.c | 6 +++--- |
| 9 |
src/dm_mailboxstate.c | 4 ++-- |
| 10 |
src/dm_message.c | 12 ++++++------ |
| 11 |
src/dm_misc.c | 6 +++--- |
| 12 |
src/dm_sievescript.c | 2 +- |
| 13 |
src/maintenance.c | 2 +- |
| 14 |
src/modules/authsql.c | 12 ++++++------ |
| 15 |
src/pop3.c | 2 +- |
| 16 |
9 files changed, 36 insertions(+), 36 deletions(-) |
| 17 |
|
| 18 |
diff --git ./src/dm_db.c ./src/dm_db.c |
| 19 |
index 8d72214..feb0b34 100644 |
| 20 |
--- ./src/dm_db.c |
| 21 |
+++ ./src/dm_db.c |
| 22 |
@@ -1047,7 +1047,7 @@ int db_check_version(void) |
| 23 |
/* test existence of usermap table */ |
| 24 |
int db_use_usermap(void) |
| 25 |
{ |
| 26 |
- int use_usermap = TRUE; |
| 27 |
+ volatile int use_usermap = TRUE; |
| 28 |
Connection_T c = db_con_get(); |
| 29 |
TRY |
| 30 |
if (! db_query(c, db_get_sql(SQL_TABLE_EXISTS), DBPFX, "usermap")) |
| 31 |
@@ -1214,7 +1214,7 @@ static int dm_quota_user_validate(uint64_t user_idnr, uint64_t msg_size) |
| 32 |
int dm_quota_rebuild_user(uint64_t user_idnr) |
| 33 |
{ |
| 34 |
Connection_T c; ResultSet_T r; volatile int t = DM_SUCCESS; |
| 35 |
- uint64_t quotum = 0; |
| 36 |
+ volatile uint64_t quotum = 0; |
| 37 |
|
| 38 |
c = db_con_get(); |
| 39 |
TRY |
| 40 |
@@ -1257,7 +1257,7 @@ int dm_quota_rebuild() |
| 41 |
|
| 42 |
GList *quota = NULL; |
| 43 |
struct used_quota *q; |
| 44 |
- int i = 0; |
| 45 |
+ volatile int i = 0; |
| 46 |
int result; |
| 47 |
|
| 48 |
c = db_con_get(); |
| 49 |
@@ -1375,7 +1375,7 @@ int db_get_reply_body(uint64_t user_idnr, char **reply_body) |
| 50 |
uint64_t db_get_useridnr(uint64_t message_idnr) |
| 51 |
{ |
| 52 |
Connection_T c; ResultSet_T r; |
| 53 |
- uint64_t user_idnr = 0; |
| 54 |
+ volatile uint64_t user_idnr = 0; |
| 55 |
c = db_con_get(); |
| 56 |
TRY |
| 57 |
r = db_query(c, "SELECT %smailboxes.owner_idnr FROM %smailboxes, %smessages " |
| 58 |
@@ -1397,7 +1397,7 @@ uint64_t db_get_useridnr(uint64_t message_idnr) |
| 59 |
int db_log_ip(const char *ip) |
| 60 |
{ |
| 61 |
Connection_T c; ResultSet_T r; PreparedStatement_T s; volatile int t = DM_SUCCESS; |
| 62 |
- uint64_t id = 0; |
| 63 |
+ volatile uint64_t id = 0; |
| 64 |
|
| 65 |
c = db_con_get(); |
| 66 |
TRY |
| 67 |
@@ -1444,8 +1444,8 @@ int db_empty_mailbox(uint64_t user_idnr, int only_empty) |
| 68 |
Connection_T c; ResultSet_T r; volatile int t = DM_SUCCESS; |
| 69 |
GList *mboxids = NULL; |
| 70 |
uint64_t *id; |
| 71 |
- unsigned i = 0; |
| 72 |
- int result = 0; |
| 73 |
+ volatile unsigned i = 0; |
| 74 |
+ volatile int result = 0; |
| 75 |
|
| 76 |
c = db_con_get(); |
| 77 |
|
| 78 |
@@ -2165,7 +2165,7 @@ static int mailboxes_by_regex(uint64_t user_idnr, int only_subscribed, const cha |
| 79 |
char *spattern; |
| 80 |
char *namespace, *username; |
| 81 |
GString *qs = NULL; |
| 82 |
- int n_rows = 0; |
| 83 |
+ volatile int n_rows = 0; |
| 84 |
PreparedStatement_T stmt; |
| 85 |
int prml; |
| 86 |
|
| 87 |
@@ -2862,7 +2862,7 @@ int db_movemsg(uint64_t mailbox_to, uint64_t mailbox_from) |
| 88 |
#define EXPIRE_DAYS 3 |
| 89 |
int db_mailbox_has_message_id(uint64_t mailbox_idnr, const char *messageid) |
| 90 |
{ |
| 91 |
- int rows = 0; |
| 92 |
+ volatile int rows = 0; |
| 93 |
Connection_T c; ResultSet_T r; PreparedStatement_T s; |
| 94 |
char expire[DEF_FRAGSIZE], partial[DEF_FRAGSIZE]; |
| 95 |
INIT_QUERY; |
| 96 |
@@ -2909,7 +2909,7 @@ int db_mailbox_has_message_id(uint64_t mailbox_idnr, const char *messageid) |
| 97 |
static uint64_t message_get_size(uint64_t message_idnr) |
| 98 |
{ |
| 99 |
Connection_T c; ResultSet_T r; |
| 100 |
- uint64_t size = 0; |
| 101 |
+ volatile uint64_t size = 0; |
| 102 |
|
| 103 |
c = db_con_get(); |
| 104 |
TRY |
| 105 |
@@ -3443,8 +3443,8 @@ int db_usermap_resolve(ClientBase_T *ci, const char *username, char *real_userna |
| 106 |
{ |
| 107 |
char clientsock[DM_SOCKADDR_LEN]; |
| 108 |
const char *userid = NULL, *sockok = NULL, *sockno = NULL, *login = NULL; |
| 109 |
- unsigned row = 0; |
| 110 |
- int result = TRUE; |
| 111 |
+ volatile unsigned row = 0; |
| 112 |
+ volatile int result = TRUE; |
| 113 |
int score, bestscore = -1; |
| 114 |
char *bestlogin = NULL, *bestuserid = NULL; |
| 115 |
Connection_T c; ResultSet_T r; PreparedStatement_T s; |
| 116 |
@@ -3653,7 +3653,7 @@ int db_user_validate(ClientBase_T *ci, const char *pwfield, uint64_t *user_idnr, |
| 117 |
{ |
| 118 |
int is_validated = 0; |
| 119 |
char salt[13], cryptres[35]; |
| 120 |
- int t = FALSE; |
| 121 |
+ volatile int t = FALSE; |
| 122 |
char dbpass[COLUMN_WIDTH+1]; |
| 123 |
char encode[COLUMN_WIDTH+1]; |
| 124 |
char hashstr[FIELDSIZE]; |
| 125 |
diff --git ./src/dm_mailbox.c ./src/dm_mailbox.c |
| 126 |
index 3558b8e..6f4b99c 100644 |
| 127 |
--- ./src/dm_mailbox.c |
| 128 |
+++ ./src/dm_mailbox.c |
| 129 |
@@ -181,7 +181,7 @@ static int _mimeparts_dump(DbmailMailbox *self, GMimeStream *ostream) |
| 130 |
uint64_t msgid, physid, *id; |
| 131 |
DbmailMessage *m; |
| 132 |
GTree *uids; |
| 133 |
- int count = 0; |
| 134 |
+ volatile int count = 0; |
| 135 |
PreparedStatement_T stmt; |
| 136 |
Connection_T c; |
| 137 |
ResultSet_T r; |
| 138 |
@@ -475,7 +475,7 @@ char * dbmail_mailbox_sorted_as_string(DbmailMailbox *self) |
| 139 |
uint64_t *msn; |
| 140 |
|
| 141 |
l = g_list_first(self->sorted); |
| 142 |
- if (! g_list_length(l)>0) |
| 143 |
+ if (! (g_list_length(l) > 0)) |
| 144 |
return s; |
| 145 |
|
| 146 |
t = g_string_new(""); |
| 147 |
@@ -1224,7 +1224,7 @@ static GTree * mailbox_search(DbmailMailbox *self, search_key *s) |
| 148 |
char partial[DEF_FRAGSIZE]; |
| 149 |
Connection_T c; ResultSet_T r; PreparedStatement_T st; |
| 150 |
GTree *ids; |
| 151 |
- char *inset = NULL; |
| 152 |
+ volatile char *inset = NULL; |
| 153 |
|
| 154 |
GString *t; |
| 155 |
String_T q; |
| 156 |
diff --git ./src/dm_mailboxstate.c ./src/dm_mailboxstate.c |
| 157 |
index 2ef3fd3..723689a 100644 |
| 158 |
--- ./src/dm_mailboxstate.c |
| 159 |
+++ ./src/dm_mailboxstate.c |
| 160 |
@@ -977,7 +977,7 @@ int MailboxState_hasPermission(T M, uint64_t userid, const char *right_flag) |
| 161 |
if (! owner_id) { |
| 162 |
result = db_get_mailbox_owner(mboxid, &owner_id); |
| 163 |
MailboxState_setOwner(M, owner_id); |
| 164 |
- if (! result > 0) |
| 165 |
+ if (! (result > 0)) |
| 166 |
return result; |
| 167 |
} |
| 168 |
|
| 169 |
@@ -1116,7 +1116,7 @@ int MailboxState_build_recent(T M) |
| 170 |
return 0; |
| 171 |
} |
| 172 |
|
| 173 |
-static long long int _update_recent(GList *slices, uint64_t seq) |
| 174 |
+static long long int _update_recent(volatile GList *slices, uint64_t seq) |
| 175 |
{ |
| 176 |
INIT_QUERY; |
| 177 |
Connection_T c; |
| 178 |
diff --git ./src/dm_message.c ./src/dm_message.c |
| 179 |
index 066634a..9d30d52 100644 |
| 180 |
--- ./src/dm_message.c |
| 181 |
+++ ./src/dm_message.c |
| 182 |
@@ -361,11 +361,11 @@ static DbmailMessage * _mime_retrieve(DbmailMessage *self) |
| 183 |
ResultSet_T r; |
| 184 |
char internal_date[SQL_INTERNALDATE_LEN]; |
| 185 |
GMimeContentType *mimetype = NULL; |
| 186 |
- int prevdepth, depth = 0, row = 0; |
| 187 |
+ volatile int prevdepth, depth = 0, row = 0; |
| 188 |
volatile int t = FALSE; |
| 189 |
- gboolean got_boundary = FALSE, prev_boundary = FALSE, is_header = TRUE, prev_header, finalized=FALSE; |
| 190 |
- gboolean prev_is_message = FALSE, is_message = FALSE; |
| 191 |
- String_T m = NULL, n = NULL; |
| 192 |
+ volatile gboolean got_boundary = FALSE, prev_boundary = FALSE, is_header = TRUE, prev_header, finalized=FALSE; |
| 193 |
+ volatile gboolean prev_is_message = FALSE, is_message = FALSE; |
| 194 |
+ volatile String_T m = NULL, n = NULL; |
| 195 |
const void *blob; |
| 196 |
Field_T frag; |
| 197 |
|
| 198 |
@@ -530,7 +530,7 @@ static gboolean store_mime_multipart(GMimeObject *object, DbmailMessage *m, cons |
| 199 |
{ |
| 200 |
const char *boundary; |
| 201 |
const char *preface = NULL, *postface = NULL; |
| 202 |
- int n, i, c; |
| 203 |
+ int n = 0, i, c; |
| 204 |
|
| 205 |
g_return_val_if_fail(GMIME_IS_OBJECT(object), TRUE); |
| 206 |
|
| 207 |
@@ -1977,7 +1977,7 @@ DbmailMessage * dbmail_message_construct(DbmailMessage *self, |
| 208 |
|
| 209 |
static int get_mailbox_from_filters(DbmailMessage *message, uint64_t useridnr, const char *mailbox, char *into, size_t into_n) |
| 210 |
{ |
| 211 |
- int t = FALSE; |
| 212 |
+ volatile int t = FALSE; |
| 213 |
uint64_t anyone = 0; |
| 214 |
PreparedStatement_T stmt; |
| 215 |
Connection_T c; |
| 216 |
diff --git ./src/dm_misc.c ./src/dm_misc.c |
| 217 |
index e6ca9a0..1294930 100644 |
| 218 |
--- ./src/dm_misc.c |
| 219 |
+++ ./src/dm_misc.c |
| 220 |
@@ -1029,7 +1029,7 @@ int g_tree_merge(GTree *a, GTree *b, int condition) |
| 221 |
|
| 222 |
type=g_strdup("AND"); |
| 223 |
|
| 224 |
- if (! g_tree_nnodes(a) > 0) |
| 225 |
+ if (! (g_tree_nnodes(a) > 0)) |
| 226 |
break; |
| 227 |
|
| 228 |
/* delete from A all keys not in B */ |
| 229 |
@@ -1053,7 +1053,7 @@ int g_tree_merge(GTree *a, GTree *b, int condition) |
| 230 |
case IST_SUBSEARCH_OR: |
| 231 |
type=g_strdup("OR"); |
| 232 |
|
| 233 |
- if (! g_tree_nnodes(b) > 0) |
| 234 |
+ if (! (g_tree_nnodes(b) > 0)) |
| 235 |
break; |
| 236 |
|
| 237 |
merger->tree = a; |
| 238 |
@@ -1081,7 +1081,7 @@ int g_tree_merge(GTree *a, GTree *b, int condition) |
| 239 |
case IST_SUBSEARCH_NOT: |
| 240 |
type=g_strdup("NOT"); |
| 241 |
|
| 242 |
- if (! g_tree_nnodes(b) > 0) |
| 243 |
+ if (! (g_tree_nnodes(b) > 0)) |
| 244 |
break; |
| 245 |
|
| 246 |
keys = g_tree_keys(b); |
| 247 |
diff --git ./src/dm_sievescript.c ./src/dm_sievescript.c |
| 248 |
index e163413..80f333d 100644 |
| 249 |
--- ./src/dm_sievescript.c |
| 250 |
+++ ./src/dm_sievescript.c |
| 251 |
@@ -132,7 +132,7 @@ int dm_sievescript_list(uint64_t user_idnr, GList **scriptlist) |
| 252 |
|
| 253 |
int dm_sievescript_rename(uint64_t user_idnr, char *scriptname, char *newname) |
| 254 |
{ |
| 255 |
- int active = 0; |
| 256 |
+ volatile int active = 0; |
| 257 |
Connection_T c; ResultSet_T r; PreparedStatement_T s; volatile int t = FALSE; |
| 258 |
assert(scriptname); |
| 259 |
|
| 260 |
diff --git ./src/maintenance.c ./src/maintenance.c |
| 261 |
index 2e46453..b4a020b 100644 |
| 262 |
--- ./src/maintenance.c |
| 263 |
+++ ./src/maintenance.c |
| 264 |
@@ -1012,7 +1012,7 @@ int do_migrate(int migrate_limit) |
| 265 |
{ |
| 266 |
Connection_T c; ResultSet_T r; |
| 267 |
int id = 0; |
| 268 |
- int count = 0; |
| 269 |
+ volatile int count = 0; |
| 270 |
DbmailMessage *m; |
| 271 |
|
| 272 |
qprintf ("Migrate legacy 2.2.x messageblks to mimeparts...\n"); |
| 273 |
diff --git ./src/modules/authsql.c ./src/modules/authsql.c |
| 274 |
index 49e1dc9..8e4829e 100644 |
| 275 |
--- ./src/modules/authsql.c |
| 276 |
+++ ./src/modules/authsql.c |
| 277 |
@@ -97,7 +97,7 @@ int auth_getclientid(uint64_t user_idnr, uint64_t * client_idnr) |
| 278 |
{ |
| 279 |
assert(client_idnr != NULL); |
| 280 |
*client_idnr = 0; |
| 281 |
- C c; R r; int t = TRUE; |
| 282 |
+ C c; R r; volatile int t = TRUE; |
| 283 |
|
| 284 |
c = db_con_get(); |
| 285 |
TRY |
| 286 |
@@ -118,7 +118,7 @@ int auth_getmaxmailsize(uint64_t user_idnr, uint64_t * maxmail_size) |
| 287 |
{ |
| 288 |
assert(maxmail_size != NULL); |
| 289 |
*maxmail_size = 0; |
| 290 |
- C c; R r; int t = TRUE; |
| 291 |
+ C c; R r; volatile int t = TRUE; |
| 292 |
|
| 293 |
c = db_con_get(); |
| 294 |
TRY |
| 295 |
@@ -361,7 +361,7 @@ uint64_t auth_md5_validate(ClientBase_T *ci UNUSED, char *username, |
| 296 |
uint64_t user_idnr = 0; |
| 297 |
const char *dbpass; |
| 298 |
C c; R r; |
| 299 |
- int t = FALSE; |
| 300 |
+ volatile int t = FALSE; |
| 301 |
|
| 302 |
/* lookup the user_idnr */ |
| 303 |
if (! auth_user_exists(username, &user_idnr)) |
| 304 |
@@ -430,7 +430,7 @@ char *auth_get_userid(uint64_t user_idnr) |
| 305 |
|
| 306 |
int auth_check_userid(uint64_t user_idnr) |
| 307 |
{ |
| 308 |
- C c; R r; gboolean t = TRUE; |
| 309 |
+ C c; R r; volatile gboolean t = TRUE; |
| 310 |
|
| 311 |
c = db_con_get(); |
| 312 |
TRY |
| 313 |
@@ -570,7 +570,7 @@ int auth_addalias_ext(const char *alias, |
| 314 |
|
| 315 |
int auth_removealias(uint64_t user_idnr, const char *alias) |
| 316 |
{ |
| 317 |
- C c; S s; gboolean t = FALSE; |
| 318 |
+ C c; S s; volatile gboolean t = FALSE; |
| 319 |
|
| 320 |
c = db_con_get(); |
| 321 |
TRY |
| 322 |
@@ -590,7 +590,7 @@ int auth_removealias(uint64_t user_idnr, const char *alias) |
| 323 |
|
| 324 |
int auth_removealias_ext(const char *alias, const char *deliver_to) |
| 325 |
{ |
| 326 |
- C c; S s; gboolean t = FALSE; |
| 327 |
+ C c; S s; volatile gboolean t = FALSE; |
| 328 |
|
| 329 |
c = db_con_get(); |
| 330 |
TRY |
| 331 |
diff --git ./src/pop3.c ./src/pop3.c |
| 332 |
index d03f71a..b7106d3 100644 |
| 333 |
--- ./src/pop3.c |
| 334 |
+++ ./src/pop3.c |
| 335 |
@@ -99,7 +99,7 @@ static int db_createsession(uint64_t user_idnr, ClientSession_T * session) |
| 336 |
{ |
| 337 |
Connection_T c; ResultSet_T r; volatile int t = DM_SUCCESS; |
| 338 |
struct message *tmpmessage; |
| 339 |
- int message_counter = 0; |
| 340 |
+ volatile int message_counter = 0; |
| 341 |
const char *query_result; |
| 342 |
uint64_t mailbox_idnr; |
| 343 |
INIT_QUERY; |
| 344 |
-- |
| 345 |
2.7.4 (Apple Git-66) |
| 346 |
|