Remove deprecated register qualifier.
This commit is contained in:
parent
c86c4abf99
commit
90af6a724e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98771
@ -164,7 +164,7 @@ struct pro {
|
||||
void
|
||||
set_profile(void)
|
||||
{
|
||||
register FILE *f;
|
||||
FILE *f;
|
||||
char fname[BUFSIZ];
|
||||
static char prof[] = ".indent.pro";
|
||||
|
||||
@ -181,10 +181,10 @@ set_profile(void)
|
||||
}
|
||||
|
||||
static void
|
||||
scan_profile(register FILE *f)
|
||||
scan_profile(FILE *f)
|
||||
{
|
||||
register int i;
|
||||
register char *p;
|
||||
int i;
|
||||
char *p;
|
||||
char buf[BUFSIZ];
|
||||
|
||||
while (1) {
|
||||
@ -219,7 +219,7 @@ eqin(const char *s1, const char *s2)
|
||||
void
|
||||
set_defaults(void)
|
||||
{
|
||||
register struct pro *p;
|
||||
struct pro *p;
|
||||
|
||||
/*
|
||||
* Because ps.case_indent is a float, we can't initialize it from the
|
||||
@ -234,7 +234,7 @@ set_defaults(void)
|
||||
void
|
||||
set_option(char *arg)
|
||||
{
|
||||
register struct pro *p;
|
||||
struct pro *p;
|
||||
|
||||
arg++; /* ignore leading "-" */
|
||||
for (p = pro; p->p_name; p++)
|
||||
@ -267,7 +267,7 @@ set_option(char *arg)
|
||||
if (*param_start == 0)
|
||||
goto need_param;
|
||||
{
|
||||
register char *str = (char *) malloc(strlen(param_start) + 1);
|
||||
char *str = (char *) malloc(strlen(param_start) + 1);
|
||||
strcpy(str, param_start);
|
||||
addkey(str, 4);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ main(int argc, char **argv)
|
||||
int force_nl; /* when true, code must be broken */
|
||||
int hd_type = 0; /* used to store type of stmt for if (...),
|
||||
* for (...), etc */
|
||||
register int i; /* local loop counter */
|
||||
int i; /* local loop counter */
|
||||
int scase; /* set to true when we see a case, so we will
|
||||
* know what to do with the following colon */
|
||||
int sp_sw; /* when true, we are in the expressin of
|
||||
@ -251,8 +251,8 @@ main(int argc, char **argv)
|
||||
|
||||
parse(semicolon);
|
||||
{
|
||||
register char *p = buf_ptr;
|
||||
register int col = 1;
|
||||
char *p = buf_ptr;
|
||||
int col = 1;
|
||||
|
||||
while (1) {
|
||||
if (*p == ' ')
|
||||
@ -1072,7 +1072,7 @@ main(int argc, char **argv)
|
||||
|
||||
if (strncmp(s_lab, "#if", 3) == 0) {
|
||||
if (blanklines_around_conditional_compilation) {
|
||||
register int c;
|
||||
int c;
|
||||
prefix_blankline_requested++;
|
||||
while ((c = getc(input)) == '\n');
|
||||
ungetc(c, input);
|
||||
|
@ -56,7 +56,7 @@ FILE *output; /* the output file */
|
||||
|
||||
#define CHECK_SIZE_CODE \
|
||||
if (e_code >= l_code) { \
|
||||
register int nsize = l_code-s_code+400; \
|
||||
int nsize = l_code-s_code+400; \
|
||||
codebuf = (char *) realloc(codebuf, nsize); \
|
||||
e_code = codebuf + (e_code-s_code) + 1; \
|
||||
l_code = codebuf + nsize - 5; \
|
||||
@ -64,7 +64,7 @@ FILE *output; /* the output file */
|
||||
}
|
||||
#define CHECK_SIZE_COM \
|
||||
if (e_com >= l_com) { \
|
||||
register int nsize = l_com-s_com+400; \
|
||||
int nsize = l_com-s_com+400; \
|
||||
combuf = (char *) realloc(combuf, nsize); \
|
||||
e_com = combuf + (e_com-s_com) + 1; \
|
||||
l_com = combuf + nsize - 5; \
|
||||
@ -72,7 +72,7 @@ FILE *output; /* the output file */
|
||||
}
|
||||
#define CHECK_SIZE_LAB \
|
||||
if (e_lab >= l_lab) { \
|
||||
register int nsize = l_lab-s_lab+400; \
|
||||
int nsize = l_lab-s_lab+400; \
|
||||
labbuf = (char *) realloc(labbuf, nsize); \
|
||||
e_lab = labbuf + (e_lab-s_lab) + 1; \
|
||||
l_lab = labbuf + nsize - 5; \
|
||||
@ -80,7 +80,7 @@ FILE *output; /* the output file */
|
||||
}
|
||||
#define CHECK_SIZE_TOKEN \
|
||||
if (e_token >= l_token) { \
|
||||
register int nsize = l_token-s_token+400; \
|
||||
int nsize = l_token-s_token+400; \
|
||||
tokenbuf = (char *) realloc(tokenbuf, nsize); \
|
||||
e_token = tokenbuf + (e_token-s_token) + 1; \
|
||||
l_token = tokenbuf + nsize - 5; \
|
||||
|
@ -60,7 +60,7 @@ dump_line(void)
|
||||
* prints the label section, followed by the
|
||||
* code section with the appropriate nesting
|
||||
* level, followed by any comments */
|
||||
register int cur_col,
|
||||
int cur_col,
|
||||
target_col = 1;
|
||||
static int not_first_line;
|
||||
|
||||
@ -118,7 +118,7 @@ dump_line(void)
|
||||
cur_col = pad_output(1, compute_label_target());
|
||||
if (s_lab[0] == '#' && (strncmp(s_lab, "#else", 5) == 0
|
||||
|| strncmp(s_lab, "#endif", 6) == 0)) {
|
||||
register char *s = s_lab;
|
||||
char *s = s_lab;
|
||||
if (e_lab[-1] == '\n') e_lab--;
|
||||
do putc(*s++, output);
|
||||
while (s < e_lab && 'a' <= *s && *s<='z');
|
||||
@ -137,7 +137,7 @@ dump_line(void)
|
||||
ps.pcase = false;
|
||||
|
||||
if (s_code != e_code) { /* print code section, if any */
|
||||
register char *p;
|
||||
char *p;
|
||||
|
||||
if (comment_open) {
|
||||
comment_open = 0;
|
||||
@ -145,7 +145,7 @@ dump_line(void)
|
||||
}
|
||||
target_col = compute_code_target();
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ps.p_l_follow; i++)
|
||||
if (ps.paren_indents[i] >= 0)
|
||||
@ -162,7 +162,7 @@ dump_line(void)
|
||||
if (s_com != e_com) {
|
||||
if (troff) {
|
||||
int all_here = 0;
|
||||
register char *p;
|
||||
char *p;
|
||||
|
||||
if (e_com[-1] == '/' && e_com[-2] == '*')
|
||||
e_com -= 2, all_here++;
|
||||
@ -188,7 +188,7 @@ dump_line(void)
|
||||
if ('a' <= *p && *p <= 'z')
|
||||
*p = *p + 'A' - 'a';
|
||||
if (e_com - p < 50 && all_here == 2) {
|
||||
register char *follow = p;
|
||||
char *follow = p;
|
||||
fprintf(output, "\n.nr C! \\w\1");
|
||||
while (follow < e_com) {
|
||||
switch (*follow) {
|
||||
@ -218,8 +218,8 @@ dump_line(void)
|
||||
}
|
||||
}
|
||||
else { /* print comment, if any */
|
||||
register int target = ps.com_col;
|
||||
register char *com_st = s_com;
|
||||
int target = ps.com_col;
|
||||
char *com_st = s_com;
|
||||
|
||||
target += ps.comment_delta;
|
||||
while (*com_st == '\t')
|
||||
@ -290,14 +290,14 @@ dump_line(void)
|
||||
int
|
||||
compute_code_target(void)
|
||||
{
|
||||
register int target_col = ps.ind_size * ps.ind_level + 1;
|
||||
int target_col = ps.ind_size * ps.ind_level + 1;
|
||||
|
||||
if (ps.paren_level)
|
||||
if (!lineup_to_parens)
|
||||
target_col += continuation_indent * ps.paren_level;
|
||||
else {
|
||||
register int w;
|
||||
register int t = paren_target;
|
||||
int w;
|
||||
int t = paren_target;
|
||||
|
||||
if ((w = count_spaces(t, s_code) - max_col) > 0
|
||||
&& count_spaces(target_col, s_code) <= max_col) {
|
||||
@ -341,9 +341,9 @@ compute_label_target(void)
|
||||
void
|
||||
fill_buffer(void)
|
||||
{ /* this routine reads stuff from the input */
|
||||
register char *p;
|
||||
register int i;
|
||||
register FILE *f = input;
|
||||
char *p;
|
||||
int i;
|
||||
FILE *f = input;
|
||||
|
||||
if (bp_save != 0) { /* there is a partly filled input buffer left */
|
||||
buf_ptr = bp_save; /* dont read anything, just switch buffers */
|
||||
@ -355,8 +355,8 @@ fill_buffer(void)
|
||||
}
|
||||
for (p = in_buffer;;) {
|
||||
if (p >= in_buffer_limit) {
|
||||
register int size = (in_buffer_limit - in_buffer) * 2 + 10;
|
||||
register int offset = p - in_buffer;
|
||||
int size = (in_buffer_limit - in_buffer) * 2 + 10;
|
||||
int offset = p - in_buffer;
|
||||
in_buffer = realloc(in_buffer, size);
|
||||
if (in_buffer == 0)
|
||||
err(1, "input line too long");
|
||||
@ -461,8 +461,8 @@ pad_output(int current, int target)
|
||||
/* current: the current column value */
|
||||
/* target: position we want it at */
|
||||
{
|
||||
register int curr; /* internal column pointer */
|
||||
register int tcur;
|
||||
int curr; /* internal column pointer */
|
||||
int tcur;
|
||||
|
||||
if (troff)
|
||||
fprintf(output, "\\h'|%dp'", (target - 1) * 7);
|
||||
@ -507,8 +507,8 @@ count_spaces(int current, char *buffer)
|
||||
* printing the text in buffer starting at column "current"
|
||||
*/
|
||||
{
|
||||
register char *buf; /* used to look thru buffer */
|
||||
register int cur; /* current character counter */
|
||||
char *buf; /* used to look thru buffer */
|
||||
int cur; /* current character counter */
|
||||
|
||||
cur = current;
|
||||
|
||||
|
@ -153,7 +153,7 @@ lexi(void)
|
||||
const char *j; /* used for searching thru list of
|
||||
*
|
||||
* reserved words */
|
||||
register struct templ *p;
|
||||
struct templ *p;
|
||||
|
||||
if (isdigit(*buf_ptr) || (buf_ptr[0] == '.' && isdigit(buf_ptr[1]))) {
|
||||
int seendot = 0,
|
||||
@ -315,7 +315,7 @@ lexi(void)
|
||||
} /* end of switch */
|
||||
} /* end of if (found_it) */
|
||||
if (*buf_ptr == '(' && ps.tos <= 1 && ps.ind_level == 0) {
|
||||
register char *tp = buf_ptr;
|
||||
char *tp = buf_ptr;
|
||||
while (tp < buf_end)
|
||||
if (*tp++ == ')' && (*tp == ';' || *tp == ','))
|
||||
goto not_proc;
|
||||
@ -588,7 +588,7 @@ lexi(void)
|
||||
void
|
||||
addkey(char *key, int val)
|
||||
{
|
||||
register struct templ *p = specials;
|
||||
struct templ *p = specials;
|
||||
while (p->rwd)
|
||||
if (p->rwd[0] == key[0] && strcmp(p->rwd, key) == 0)
|
||||
return;
|
||||
|
@ -251,7 +251,7 @@ parse(int tk) /* tk: the code for the construct scanned */
|
||||
static void
|
||||
reduce(void)
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
for (;;) { /* keep looping until there is nothing left to
|
||||
* reduce */
|
||||
|
@ -136,7 +136,7 @@ pr_comment(void)
|
||||
ps.com_col = 1 + !format_col1_comments;
|
||||
}
|
||||
else {
|
||||
register int target_col;
|
||||
int target_col;
|
||||
break_delim = 0;
|
||||
if (s_code != e_code)
|
||||
target_col = count_spaces(compute_code_target(), s_code);
|
||||
|
Loading…
Reference in New Issue
Block a user