maint: omit ‘register’

The ‘register’ keyword is no longer needed for optimization.
With GCC 13.1 x86-64 compiled with -O2, omitting ‘register’ did not
change the generated code.
This commit is contained in:
Paul Eggert 2023-05-29 21:00:10 -07:00
parent 8587626636
commit cb018ecff2
6 changed files with 20 additions and 21 deletions

View File

@ -113,7 +113,7 @@ discard_confusing_lines (struct file_data filevec[])
for (int f = 0; f < 2; f++)
{
lin end = filevec[f].buffered_lines;
register char *discards = discarded[f];
char *discards = discarded[f];
for (lin i = 0; i < end; i++)
{
@ -123,8 +123,7 @@ discard_confusing_lines (struct file_data filevec[])
else if (discards[i] != 0)
{
/* We have found a nonprovisional discard. */
register lin j;
lin provisional = 0;
lin provisional = 0, j;
/* Find end of this run of discardable lines.
Count how many are provisionally discardable. */

View File

@ -840,8 +840,8 @@ copy_stringlist (char *const fromptrs[], idx_t const fromlengths[],
char *toptrs[], idx_t tolengths[],
lin copynum)
{
register char *const *f = fromptrs;
register char **t = toptrs;
char *const *f = fromptrs;
char **t = toptrs;
idx_t const *fl = fromlengths;
idx_t *tl = tolengths;

View File

@ -64,7 +64,7 @@ dir_read (struct file_data const *dir, struct dirdata *dirdata)
if (dir->desc != -1)
{
/* Open the directory and check for errors. */
register DIR *reading = opendir (dir->name);
DIR *reading = opendir (dir->name);
if (!reading)
return false;

View File

@ -110,10 +110,10 @@ format_ifdef (char const *format, lin beg0, lin end0, lin beg1, lin end1)
If OUT is zero, do not actually print anything; just scan the format. */
static char const *
format_group (register FILE *out, char const *format, char endchar,
format_group (FILE *out, char const *format, char endchar,
struct group const *groups)
{
register char const *f = format;
char const *f = format;
for (char c; (c = *f) != endchar && c != 0; )
{
@ -225,7 +225,7 @@ groups_letter_value (struct group const *g, char letter)
/* Print to file OUT, using FORMAT to print the line group GROUP.
But do nothing if OUT is zero. */
static void
print_ifdef_lines (register FILE *out, char const *format,
print_ifdef_lines (FILE *out, char const *format,
struct group const *group)
{
if (!out)
@ -255,8 +255,8 @@ print_ifdef_lines (register FILE *out, char const *format,
for (; from < upto; from++)
{
register char c;
register char const *f = format;
char c;
char const *f = format;
while ((c = *f++) != 0)
{
@ -376,7 +376,7 @@ do_printf_spec (FILE *out, char const *spec,
static char const *
scan_char_literal (char const *lit, char *valptr)
{
register char const *p = lit;
char const *p = lit;
char value;
char c = *p++;

View File

@ -75,14 +75,14 @@ print_half_line (char const *const *line, intmax_t indent, intmax_t out_bound)
FILE *out = outfile;
intmax_t in_position = 0;
intmax_t out_position = 0;
register char const *text_pointer = line[0];
register char const *text_limit = line[1];
char const *text_pointer = line[0];
char const *text_limit = line[1];
mbstate_t mbstate = { 0 };
while (text_pointer < text_limit)
{
char const *tp0 = text_pointer;
register char c = *text_pointer++;
char c = *text_pointer++;
switch (c)
{

View File

@ -1060,14 +1060,14 @@ finish_output (void)
bool
lines_differ (char const *s1, char const *s2)
{
register char const *t1 = s1;
register char const *t2 = s2;
char const *t1 = s1;
char const *t2 = s2;
intmax_t tab = 0, column = 0;
while (1)
{
register unsigned char c1 = *t1++;
register unsigned char c2 = *t2++;
unsigned char c1 = *t1++;
unsigned char c2 = *t2++;
/* Test for exact char equality first, since it's a common case. */
if (c1 != c2)
@ -1364,8 +1364,8 @@ output_1_line (char const *base, char const *limit, char const *flag_format,
}
else
{
register FILE *out = outfile;
register char const *t = base;
FILE *out = outfile;
char const *t = base;
intmax_t tab = 0, column = 0, tab_size = tabsize;
int counter_proc_signals = 0;