Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f3bacd70
Commit
f3bacd70
authored
Jul 05, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: make Name and STRING_WITH_LEN usable in constexpr
parent
15a42a0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
include/m_string.h
include/m_string.h
+1
-1
sql/sql_type.h
sql/sql_type.h
+6
-11
No files found.
include/m_string.h
View file @
f3bacd70
...
...
@@ -201,7 +201,7 @@ extern ulonglong strtoull(const char *str, char **ptr, int base);
#ifdef __cplusplus
#include <type_traits>
template
<
typename
T
>
inline
const
char
*
_swl_check
(
T
s
)
template
<
typename
T
>
inline
const
expr
const
char
*
_swl_check
(
T
s
)
{
static_assert
(
std
::
is_same
<
T
,
const
char
(
&
)[
sizeof
(
T
)]
>::
value
||
std
::
is_same
<
T
,
const
char
[
sizeof
(
T
)]
>::
value
,
...
...
sql/sql_type.h
View file @
f3bacd70
...
...
@@ -3384,17 +3384,12 @@ class Type_cast_attributes
class
Name
:
private
LEX_CSTRING
{
public:
Name
(
const
char
*
str_arg
,
uint
length_arg
)
{
DBUG_ASSERT
(
length_arg
<
UINT_MAX32
);
LEX_CSTRING
::
str
=
str_arg
;
LEX_CSTRING
::
length
=
length_arg
;
}
Name
(
const
LEX_CSTRING
&
lcs
)
{
LEX_CSTRING
::
str
=
lcs
.
str
;
LEX_CSTRING
::
length
=
lcs
.
length
;
}
constexpr
Name
(
const
char
*
str_arg
,
uint
length_arg
)
:
LEX_CSTRING
({
str_arg
,
length_arg
})
{
}
constexpr
Name
(
const
LEX_CSTRING
&
lcs
)
:
LEX_CSTRING
(
lcs
)
{
}
const
char
*
ptr
()
const
{
return
LEX_CSTRING
::
str
;
}
uint
length
()
const
{
return
(
uint
)
LEX_CSTRING
::
length
;
}
const
LEX_CSTRING
&
lex_cstring
()
const
{
return
*
this
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment