summaryrefslogtreecommitdiff
path: root/storage/innobase/include/sync0policy.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 /storage/innobase/include/sync0policy.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 'storage/innobase/include/sync0policy.h')
-rw-r--r--storage/innobase/include/sync0policy.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/storage/innobase/include/sync0policy.h b/storage/innobase/include/sync0policy.h
index 0eaefc7167a..1a430328f0e 100644
--- a/storage/innobase/include/sync0policy.h
+++ b/storage/innobase/include/sync0policy.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2013, 2015, 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 the Free Software
@@ -70,7 +71,7 @@ public:
void locked(
const Mutex* mutex,
const char* filename,
- ulint line)
+ unsigned line)
UNIV_NOTHROW
{
m_mutex = mutex;
@@ -92,7 +93,7 @@ public:
m_filename = NULL;
- m_line = ULINT_UNDEFINED;
+ m_line = 0;
}
/** Print information about the latch
@@ -134,7 +135,7 @@ public:
const char* m_filename;
/** Line mumber in filename */
- ulint m_line;
+ unsigned m_line;
/** Thread ID of the thread that own(ed) the mutex */
os_thread_id_t m_thread_id;
@@ -176,7 +177,7 @@ public:
void enter(
const Mutex* mutex,
const char* filename,
- ulint line)
+ unsigned line)
UNIV_NOTHROW;
/** Called when the mutex is locked
@@ -186,7 +187,7 @@ public:
void locked(
const Mutex* mutex,
const char* filename,
- ulint line)
+ unsigned line)
UNIV_NOTHROW;
/** Called when the mutex is released
@@ -210,7 +211,7 @@ public:
}
/** @return the name of the file from the mutex was acquired */
- ulint get_enter_line() const
+ unsigned get_enter_line() const
UNIV_NOTHROW
{
return(m_context.m_line);
@@ -240,7 +241,7 @@ struct NoPolicy {
void init(const Mutex&, latch_id_t, const char*, uint32_t)
UNIV_NOTHROW { }
void destroy() UNIV_NOTHROW { }
- void enter(const Mutex&, const char*, ulint line) UNIV_NOTHROW { }
+ void enter(const Mutex&, const char*, unsigned line) UNIV_NOTHROW { }
void add(uint32_t, uint32_t) UNIV_NOTHROW { }
void locked(const Mutex&, const char*, ulint) UNIV_NOTHROW { }
void release(const Mutex&) UNIV_NOTHROW { }
@@ -293,7 +294,7 @@ public:
meta.get_counter()->single_register(&m_count);
- sync_file_created_register(this, filename, line);
+ sync_file_created_register(this, filename, uint16_t(line));
ut_d(MutexDebug<MutexType>::init(m_id));
}
@@ -341,7 +342,7 @@ public:
void enter(
const MutexType& mutex,
const char* filename,
- ulint line)
+ unsigned line)
UNIV_NOTHROW
{
ut_d(MutexDebug<MutexType>::enter(&mutex, filename, line));
@@ -354,7 +355,7 @@ public:
void locked(
const MutexType& mutex,
const char* filename,
- ulint line)
+ unsigned line)
UNIV_NOTHROW
{
ut_d(MutexDebug<MutexType>::locked(&mutex, filename, line));
@@ -492,7 +493,7 @@ public:
void locked(
const MutexType& mutex,
const char* filename,
- ulint line)
+ unsigned line)
UNIV_NOTHROW
{
ut_d(MutexDebug<MutexType>::locked(&mutex, filename, line));
@@ -513,7 +514,7 @@ public:
void enter(
const MutexType& mutex,
const char* filename,
- ulint line)
+ unsigned line)
UNIV_NOTHROW
{
ut_d(MutexDebug<MutexType>::enter(&mutex, filename, line));