Fix clang 10 warnings
_ma_fetch_keypage(): Correct an assertion that used to always hold. Thanks to clang -Wint-in-bool-context for flagging this. double_to_datetime_with_warn(): Suppress -Wimplicit-int-float-conversion by adding a cast. LONGLONG_MAX converted to double will actually be LONGLONG_MAX+1.
This commit is contained in:
parent
6a3fc1101c
commit
758fbec6e3
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2013 Monty Program Ab.
|
||||
Copyright (c) 2009, 2020, 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
|
||||
@ -402,7 +402,7 @@ bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime,
|
||||
if (neg)
|
||||
value= -value;
|
||||
|
||||
if (value > LONGLONG_MAX)
|
||||
if (value > static_cast<double>(LONGLONG_MAX))
|
||||
value= static_cast<double>(LONGLONG_MAX);
|
||||
|
||||
longlong nr= static_cast<ulonglong>(floor(value));
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
Copyright (c) 2020, 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
|
||||
@ -112,7 +113,7 @@ my_bool _ma_fetch_keypage(MARIA_PAGE *page, MARIA_HA *info,
|
||||
|
||||
if (lock != PAGECACHE_LOCK_LEFT_UNLOCKED)
|
||||
{
|
||||
DBUG_ASSERT(lock == PAGECACHE_LOCK_WRITE || PAGECACHE_LOCK_READ);
|
||||
DBUG_ASSERT(lock == PAGECACHE_LOCK_WRITE || lock == PAGECACHE_LOCK_READ);
|
||||
page_link.unlock= (lock == PAGECACHE_LOCK_WRITE ?
|
||||
PAGECACHE_LOCK_WRITE_UNLOCK :
|
||||
PAGECACHE_LOCK_READ_UNLOCK);
|
||||
|
Loading…
x
Reference in New Issue
Block a user