1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Remove most 'register' use in C++

Modern compilers (such as GCC 8) emit warnings that the
'register' keyword is deprecated and not valid C++17.

Let us remove most use of the 'register' keyword.
Code in 'extra/' is not touched.
This commit is contained in:
Marko Mäkelä
2018-04-24 12:14:35 +03:00
parent 2a00bdeb4a
commit 39a4985520
33 changed files with 107 additions and 113 deletions

View File

@ -613,8 +613,8 @@ int String::strstr(const String &s,uint32 offset)
if (!s.length())
return ((int) offset); // Empty string is always found
register const char *str = Ptr+offset;
register const char *search=s.ptr();
const char *str = Ptr+offset;
const char *search=s.ptr();
const char *end=Ptr+str_length-s.length()+1;
const char *search_end=s.ptr()+s.length();
skip:
@ -622,7 +622,7 @@ skip:
{
if (*str++ == *search)
{
register char *i,*j;
char *i,*j;
i=(char*) str; j=(char*) search+1;
while (j != search_end)
if (*i++ != *j++) goto skip;
@ -643,8 +643,8 @@ int String::strrstr(const String &s,uint32 offset)
{
if (!s.length())
return offset; // Empty string is always found
register const char *str = Ptr+offset-1;
register const char *search=s.ptr()+s.length()-1;
const char *str = Ptr+offset-1;
const char *search=s.ptr()+s.length()-1;
const char *end=Ptr+s.length()-2;
const char *search_end=s.ptr()-1;
@ -653,7 +653,7 @@ skip:
{
if (*str-- == *search)
{
register char *i,*j;
char *i,*j;
i=(char*) str; j=(char*) search-1;
while (j != search_end)
if (*i-- != *j--) goto skip;