Skip to content

Lots of mechanical cleanup. #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ BUILDDIR ?= $(ACK_TEMP_DIR)/ack-build
CFLAGS ?= -g \
-Werror=return-type \
-Werror=implicit-function-declaration \
-Werror=strict-prototypes \
-fsanitize=unreachable
-Werror=strict-prototypes

LDFLAGS ?= -g \
-fsanitize=unreachable
LDFLAGS ?= -g

# Various commands.

Expand Down
2 changes: 1 addition & 1 deletion doc/em/even.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
main() {
register int l,j ;
int l,j ;

for ( j=0 ; (l=getchar()) != -1 ; j++ ) {
if ( j%16 == 15 ) printf("%3d\n",l&0377 ) ;
Expand Down
6 changes: 3 additions & 3 deletions doc/em/int/emdmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ long getaddr();

main(argc,argv) char **argv;
{
register i ;
i ;
long line,fileaddr;
char tok ;

Expand Down Expand Up @@ -168,7 +168,7 @@ int read2() {

long readaddr() {
long res ;
register int i ;
int i ;

res=0 ;
for (i=0 ; i<asize ; i++ ) res |= getb()<<(8*i) ;
Expand All @@ -177,7 +177,7 @@ long readaddr() {

long readword() {
long res ;
register int i ;
int i ;

res=0 ;
for (i=0 ; i<wsize ; i++ ) res |= getb()<<(8*i) ;
Expand Down
4 changes: 2 additions & 2 deletions doc/em/int/mktables.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ char *ident() {
*/

static char array[200] ;
register int c ;
register char *cc ;
int c ;
char *cc ;

do {
c=readchar() ;
Expand Down
16 changes: 8 additions & 8 deletions doc/em/mkdispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void ckop(int, int, int, int);
int readchar(void);
void pushback(int);
void writeout(void);
void prx(register int, int, int);
void prx(int, int, int);
void readin(void);
int getmnem(char *);
void error(char *str, ...);
Expand Down Expand Up @@ -90,7 +90,7 @@ int main(int argc, char **argv)

void readin(void)
{
register struct opform *nextform;
struct opform *nextform;
char *firstid;

for (nextform = intable; !feof(stdin) && nextform < &intable[NOTAB];)
Expand Down Expand Up @@ -131,8 +131,8 @@ char *ident(void)
*/

static char array[200];
register int c;
register char *cc;
int c;
char *cc;

do
{
Expand Down Expand Up @@ -346,8 +346,8 @@ char negc[NMNEM], zc[NMNEM], posc[NMNEM], lnegc[NMNEM], lposc[NMNEM];

void checkall(void)
{
register int i, flag;
register struct opform *next;
int i, flag;
struct opform *next;
int opc, low;

for (i = 0; i < NMNEM; i++)
Expand Down Expand Up @@ -571,7 +571,7 @@ void pushback(int c)

void writeout(void)
{
register int i;
int i;

printf("DISPATCH1");
for (i = 0; i < 256;)
Expand Down Expand Up @@ -616,7 +616,7 @@ void writeout(void)
putchar('\n');
}

void prx(register int flg, int low, int opc)
void prx(int flg, int low, int opc)
{
int arg = opc - low;

Expand Down
12 changes: 6 additions & 6 deletions emtest/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ stop() {
}

main(argc,argv) char **argv; {
register *p;
register char *s;
int *p;
char *s;

prog = *argv++; --argc;
mktemp(name1);
Expand Down Expand Up @@ -109,7 +109,7 @@ main(argc,argv) char **argv; {
}

select() {
register FILE *f;
FILE *f;
int i;

if (sscanf(line, "TEST %d", &i) != 1)
Expand Down Expand Up @@ -212,7 +212,7 @@ copy(s) char *s; {
}

getline() {
register len;
len;

if (fgets(line, LINSIZ, stdin) == NULL)
return(0);
Expand Down Expand Up @@ -243,10 +243,10 @@ usage() {

char *
to3dig(i)
register int i;
int i;
{
static char buf[4];
register char *s = buf;
char *s = buf;

*s++ = (i % 1000) / 100 + '0';
*s++ = (i % 100) / 10 + '0';
Expand Down
10 changes: 5 additions & 5 deletions examples/startrek.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ new_quadrant(void)
void
course_control(void)
{
register i;
int i;
/* @@@ int c2, c3, q4, q5; */
int q4, q5;
string sTemp;
Expand Down Expand Up @@ -826,7 +826,7 @@ maneuver_energy(void)
void
short_range_scan(void)
{
register i, j;
int i, j;

strcpy(sC, "GREEN");

Expand Down Expand Up @@ -898,7 +898,7 @@ short_range_scan(void)
void
long_range_scan(void)
{
register i, j;
int i, j;

if (d[3] < 0.0)
{
Expand Down Expand Up @@ -928,7 +928,7 @@ long_range_scan(void)
void
phaser_control(void)
{
register i;
int i;
int iEnergy;
int h1, h;
string sTemp;
Expand Down Expand Up @@ -1183,7 +1183,7 @@ damage_control(void)
{
int a1;
double d3 = 0.0;
register i;
int i;

if (d[6] < 0.0)
{
Expand Down
32 changes: 16 additions & 16 deletions fast/driver/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ static char *expand_string(char *s, struct system_information *);
static void error(char *, char *, char *);
static void warning(char *, char *, char *);
static void panic(char *);
static void append(register struct arglist *, char *);
static void expand(register struct arglist *, struct system_information *);
static void append(struct arglist *, char *);
static void expand(struct arglist *, struct system_information *);
static void concat(struct arglist *, struct arglist *);
static int runvec(struct arglist *, char *);
static int needsprep(char *);
Expand Down Expand Up @@ -549,7 +549,7 @@ int main(int argc, char *argv[])
int libs_count;
char *ext;
FILE* fd;
register struct arglist *call = &CALL_VEC;
struct arglist *call = &CALL_VEC;
char tmpbuffer[256];
char *file;
char *ldfile;
Expand Down Expand Up @@ -763,7 +763,7 @@ int main(int argc, char *argv[])
/* For argument file */
while (count-- > 0)
{
register char *f;
char *f;
sys_basename(file = *argvec++, BASE);

ext = extension(file);
Expand Down Expand Up @@ -977,8 +977,8 @@ static char * alloc(unsigned int u)
static char * expand_string(char *s, struct system_information *sysinfo)
{
char buf[1024];
register char *p = s;
register char *q = &buf[0];
char *p = s;
char *q = &buf[0];
int expanded = 0;

if (!p)
Expand Down Expand Up @@ -1024,7 +1024,7 @@ static char * expand_string(char *s, struct system_information *sysinfo)
return strcpy(p, buf);
}

static void append(register struct arglist *al, char *arg)
static void append(struct arglist *al, char *arg)
{
if (!arg || !*arg)
return;
Expand All @@ -1033,10 +1033,10 @@ static void append(register struct arglist *al, char *arg)
al->al_argv[(al->al_argc)++] = arg;
}

static void expand(register struct arglist *al, struct system_information *sysinfo)
static void expand(struct arglist *al, struct system_information *sysinfo)
{
register int i = al->al_argc;
register char **p = &(al->al_argv[0]);
int i = al->al_argc;
char **p = &(al->al_argv[0]);

while (i-- > 0)
{
Expand All @@ -1047,9 +1047,9 @@ static void expand(register struct arglist *al, struct system_information *sysin

static void concat(struct arglist *al1, struct arglist *al2)
{
register int i = al2->al_argc;
register char **p = &(al1->al_argv[al1->al_argc]);
register char **q = &(al2->al_argv[0]);
int i = al2->al_argc;
char **p = &(al1->al_argv[al1->al_argc]);
char **q = &(al2->al_argv[0]);

if ((al1->al_argc += i) >= MAXARGC)
panic("argument list overflow");
Expand All @@ -1065,8 +1065,8 @@ char *mkstr(char *dst, ...)

va_start(ap, dst);
{
register char *p;
register char *q;
char *p;
char *q;

q = dst;
p = va_arg(ap, char *);
Expand All @@ -1086,7 +1086,7 @@ char *mkstr(char *dst, ...)

static char *extension(char *fn)
{
register char *c = fn;
char *c = fn;

while (*c++)
;
Expand Down
Loading
Loading