summaryrefslogtreecommitdiff
path: root/sql/structs.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-03-01 08:27:39 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-03-07 19:07:27 +0200
commit89d80c1b0be94639d0913dee7b6a284c32787b09 (patch)
treea08340d45a09b067df4490259f68b5a3f9d2fa03 /sql/structs.h
parentd2f5e624223fe502ddf4c6f42062c29edb988627 (diff)
downloadmariadb-git-89d80c1b0be94639d0913dee7b6a284c32787b09.tar.gz
Fix many -Wconversion warnings.
Define my_thread_id as an unsigned type, to avoid mismatch with ulonglong. Change some parameters to this type. Use size_t in a few more places. Declare many flag constants as unsigned to avoid sign mismatch when shifting bits or applying the unary ~ operator. When applying the unary ~ operator to enum constants, explictly cast the result to an unsigned type, because enum constants can be treated as signed. In InnoDB, change the source code line number parameters from ulint to unsigned type. Also, make some InnoDB functions return a narrower type (unsigned or uint32_t instead of ulint; bool instead of ibool).
Diffstat (limited to 'sql/structs.h')
-rw-r--r--sql/structs.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/sql/structs.h b/sql/structs.h
index ea47d6255de..98eb0f2585d 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -2,6 +2,7 @@
#define STRUCTS_INCLUDED
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -331,26 +332,26 @@ typedef struct st_index_stats
/* Bits in form->update */
-#define REG_MAKE_DUPP 1 /* Make a copy of record when read */
-#define REG_NEW_RECORD 2 /* Write a new record if not found */
-#define REG_UPDATE 4 /* Uppdate record */
-#define REG_DELETE 8 /* Delete found record */
-#define REG_PROG 16 /* User is updating database */
-#define REG_CLEAR_AFTER_WRITE 32
-#define REG_MAY_BE_UPDATED 64
-#define REG_AUTO_UPDATE 64 /* Used in D-forms for scroll-tables */
-#define REG_OVERWRITE 128
-#define REG_SKIP_DUP 256
+#define REG_MAKE_DUPP 1U /* Make a copy of record when read */
+#define REG_NEW_RECORD 2U /* Write a new record if not found */
+#define REG_UPDATE 4U /* Uppdate record */
+#define REG_DELETE 8U /* Delete found record */
+#define REG_PROG 16U /* User is updating database */
+#define REG_CLEAR_AFTER_WRITE 32U
+#define REG_MAY_BE_UPDATED 64U
+#define REG_AUTO_UPDATE 64U /* Used in D-forms for scroll-tables */
+#define REG_OVERWRITE 128U
+#define REG_SKIP_DUP 256U
/* Bits in form->status */
-#define STATUS_NO_RECORD (1+2) /* Record isn't usably */
-#define STATUS_GARBAGE 1
-#define STATUS_NOT_FOUND 2 /* No record in database when needed */
-#define STATUS_NO_PARENT 4 /* Parent record wasn't found */
-#define STATUS_NOT_READ 8 /* Record isn't read */
-#define STATUS_UPDATED 16 /* Record is updated by formula */
-#define STATUS_NULL_ROW 32 /* table->null_row is set */
-#define STATUS_DELETED 64
+#define STATUS_NO_RECORD (1U+2U) /* Record isn't usable */
+#define STATUS_GARBAGE 1U
+#define STATUS_NOT_FOUND 2U /* No record in database when needed */
+#define STATUS_NO_PARENT 4U /* Parent record wasn't found */
+#define STATUS_NOT_READ 8U /* Record isn't read */
+#define STATUS_UPDATED 16U /* Record is updated by formula */
+#define STATUS_NULL_ROW 32U /* table->null_row is set */
+#define STATUS_DELETED 64U
/*
Such interval is "discrete": it is the set of