summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-09-19 17:45:17 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-09-28 17:20:46 +0000
commiteba44874ca9fc317696630cb371623142289fa99 (patch)
treef67cd5dbcaf102abef2fb26f76357d14feaded04 /extra
parentde7c2e5e545df90fc9814c60a8a5a8d20f22b2c3 (diff)
downloadmariadb-git-eba44874ca9fc317696630cb371623142289fa99.tar.gz
MDEV-13844 : Fix Windows warnings. Fix DBUG_PRINT.
- Fix win64 pointer truncation warnings (usually coming from misusing 0x%lx and long cast in DBUG) - Also fix printf-format warnings Make the above mentioned warnings fatal. - fix pthread_join on Windows to set return value.
Diffstat (limited to 'extra')
-rw-r--r--extra/innochecksum.cc6
-rw-r--r--extra/mariabackup/xbstream.c6
-rw-r--r--extra/mariabackup/xtrabackup.cc8
3 files changed, 10 insertions, 10 deletions
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index a0976970db7..6b4fc73d049 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -93,7 +93,7 @@ static bool use_end_page;
static bool do_one_page;
static my_bool do_leaf;
static my_bool per_page_details;
-static ulong n_merge;
+static ulint n_merge;
extern ulong srv_checksum_algorithm;
static ulong physical_page_size; /* Page size in bytes on disk. */
static ulong logical_page_size; /* Page size when uncompressed. */
@@ -1538,7 +1538,7 @@ int main(
byte* buf = NULL;
byte* xdes = NULL;
/* bytes read count */
- ulong bytes;
+ ulint bytes;
/* current time */
time_t now;
/* last time */
@@ -1675,7 +1675,7 @@ int main(
}
/* Read the minimum page size. */
- bytes = ulong(fread(buf, 1, UNIV_ZIP_SIZE_MIN, fil_in));
+ bytes = fread(buf, 1, UNIV_ZIP_SIZE_MIN, fil_in);
partial_page_read = true;
if (bytes != UNIV_ZIP_SIZE_MIN) {
diff --git a/extra/mariabackup/xbstream.c b/extra/mariabackup/xbstream.c
index f3880f9ec03..fa250132c04 100644
--- a/extra/mariabackup/xbstream.c
+++ b/extra/mariabackup/xbstream.c
@@ -531,8 +531,8 @@ mode_extract(int n_threads, int argc __attribute__((unused)),
ctxt.ds_ctxt = ds_ctxt;
ctxt.mutex = &mutex;
- tids = malloc(sizeof(pthread_t) * n_threads);
- retvals = malloc(sizeof(void*) * n_threads);
+ tids = calloc(n_threads, sizeof(pthread_t));
+ retvals = calloc(n_threads, sizeof(void*));
for (i = 0; i < n_threads; i++)
pthread_create(tids + i, NULL, extract_worker_thread_func,
@@ -542,7 +542,7 @@ mode_extract(int n_threads, int argc __attribute__((unused)),
pthread_join(tids[i], retvals + i);
for (i = 0; i < n_threads; i++) {
- if ((ulong)retvals[i] == XB_STREAM_READ_ERROR) {
+ if ((size_t)retvals[i] == XB_STREAM_READ_ERROR) {
ret = 1;
goto exit;
}
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 6fc37ead4f6..f4c0af45cd7 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -1859,9 +1859,9 @@ xb_write_delta_metadata(const char *filename, const xb_delta_info_t *info)
MY_STAT mystat;
snprintf(buf, sizeof(buf),
- "page_size = %lu\n"
- "zip_size = %lu\n"
- "space_id = %lu\n",
+ "page_size = " ULINTPF "\n"
+ "zip_size = " ULINTPF " \n"
+ "space_id = " ULINTPF "\n",
info->page_size.logical(),
info->page_size.is_compressed()
? info->page_size.physical() : 0,
@@ -4174,7 +4174,7 @@ exit:
char tmpname[FN_REFLEN];
- snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%lu",
+ snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#" ULINTPF,
dbname, fil_space->id);
msg("xtrabackup: Renaming %s to %s.ibd\n",