Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.
This commit is contained in:
parent
226d80b821
commit
cbeb0b26e4
492 changed files with 3218 additions and 3167 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
enum
|
||||
{
|
||||
Slop = 100, /* room to grow with reallocation */
|
||||
Slop = 100 /* room to grow with reallocation */
|
||||
};
|
||||
|
||||
static
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ struct cmdtab cmdtab[]={
|
|||
'|', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd,
|
||||
'=', 0, 0, 0, 0, aDot, 0, linex, eq_cmd,
|
||||
'c'|0x100,0, 0, 0, 0, aNo, 0, wordx, cd_cmd,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
Cmd *parsecmd(int);
|
||||
Addr *compoundaddr(void);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static char *emsg[]={
|
|||
"temporary file too large",
|
||||
"file is append-only",
|
||||
"no destination for plumb message",
|
||||
"internal read error in buffer load",
|
||||
"internal read error in buffer load"
|
||||
};
|
||||
static char *wmsg[]={
|
||||
/* warn_s */
|
||||
|
|
@ -63,7 +63,7 @@ static char *wmsg[]={
|
|||
"null characters elided",
|
||||
"can't run pwd",
|
||||
"last char not newline",
|
||||
"exit status not 0",
|
||||
"exit status not 0"
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ typedef enum Err{
|
|||
Etmpovfl,
|
||||
Eappend,
|
||||
Ecantplumb,
|
||||
Ebufload,
|
||||
Ebufload
|
||||
}Err;
|
||||
typedef enum Warn{
|
||||
/* warn_s */
|
||||
|
|
@ -61,5 +61,5 @@ typedef enum Warn{
|
|||
Wnulls,
|
||||
Wpwd,
|
||||
Wnotnewline,
|
||||
Wbadstatus,
|
||||
Wbadstatus
|
||||
}Warn;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ struct Merge
|
|||
enum
|
||||
{
|
||||
Maxmerge = 50,
|
||||
Undosize = sizeof(Undo)/sizeof(Rune),
|
||||
Undosize = sizeof(Undo)/sizeof(Rune)
|
||||
};
|
||||
|
||||
static Merge merge;
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ connectto(char *machine, char **argv)
|
|||
char **av;
|
||||
int ac;
|
||||
|
||||
// count args
|
||||
/* count args */
|
||||
for(av = argv; *av; av++)
|
||||
;
|
||||
av = malloc(sizeof(char*)*((av-argv) + 5));
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ char *hname[] = {
|
|||
[Hsnarflen] "Hsnarflen",
|
||||
[Hack] "Hack",
|
||||
[Hexit] "Hexit",
|
||||
[Hplumb] "Hplumb",
|
||||
[Hplumb] "Hplumb"
|
||||
};
|
||||
|
||||
char *tname[] = {
|
||||
|
|
@ -72,7 +72,7 @@ char *tname[] = {
|
|||
[Tsetsnarf] "Tsetsnarf",
|
||||
[Tack] "Tack",
|
||||
[Texit] "Texit",
|
||||
[Tplumb] "Tplumb",
|
||||
[Tplumb] "Tplumb"
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ typedef enum Tmesg
|
|||
Tack, /* acknowledge Hack */
|
||||
Texit, /* exit */
|
||||
Tplumb, /* send plumb message */
|
||||
TMAX,
|
||||
TMAX
|
||||
}Tmesg;
|
||||
/*
|
||||
* Messages originating at the host
|
||||
|
|
@ -67,7 +67,7 @@ typedef enum Hmesg
|
|||
Hack, /* request acknowledgement */
|
||||
Hexit,
|
||||
Hplumb, /* return plumb message to terminal - version 1 */
|
||||
HMAX,
|
||||
HMAX
|
||||
}Hmesg;
|
||||
typedef struct Header{
|
||||
uchar type; /* one of the above */
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ extern struct cmdtab{
|
|||
enum Defaddr{ /* default addresses */
|
||||
aNo,
|
||||
aDot,
|
||||
aAll,
|
||||
aAll
|
||||
};
|
||||
|
||||
int nl_cmd(File*, Cmd*), a_cmd(File*, Cmd*), b_cmd(File*, Cmd*);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ enum State
|
|||
{
|
||||
Clean = ' ',
|
||||
Dirty = '\'',
|
||||
Unread = '-',
|
||||
Unread = '-'
|
||||
};
|
||||
|
||||
struct Range
|
||||
|
|
@ -97,7 +97,7 @@ enum
|
|||
Maxblock = 8*1024,
|
||||
|
||||
BUFSIZE = Maxblock, /* size from fbufalloc() */
|
||||
RBUFSIZE = BUFSIZE/sizeof(Rune),
|
||||
RBUFSIZE = BUFSIZE/sizeof(Rune)
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ enum
|
|||
Insert = 'i',
|
||||
Filename = 'f',
|
||||
Dot = 'D',
|
||||
Mark = 'm',
|
||||
Mark = 'm'
|
||||
};
|
||||
|
||||
struct Block
|
||||
|
|
@ -168,10 +168,12 @@ struct File
|
|||
int mod; /* file appears modified in menu */
|
||||
char rescuing; /* sam exiting; this file unusable */
|
||||
|
||||
#if 0
|
||||
// Text *curtext; /* most recently used associated text */
|
||||
// Text **text; /* list of associated texts */
|
||||
// int ntext;
|
||||
// int dumpid; /* used in dumping zeroxed windows */
|
||||
#endif
|
||||
|
||||
Posn hiposn; /* highest address touched this Mod */
|
||||
Address dot; /* current position */
|
||||
|
|
@ -187,10 +189,10 @@ struct File
|
|||
long prevseq;
|
||||
int prevmod;
|
||||
};
|
||||
//File* fileaddtext(File*, Text*);
|
||||
/*File* fileaddtext(File*, Text*); */
|
||||
void fileclose(File*);
|
||||
void filedelete(File*, uint, uint);
|
||||
//void filedeltext(File*, Text*);
|
||||
/*void filedeltext(File*, Text*); */
|
||||
void fileinsert(File*, uint, Rune*, uint);
|
||||
uint fileload(File*, uint, int, int*);
|
||||
void filemark(File*);
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ statfd(int fd, ulong *dev, uvlong *id, long *time, long *length, long *appendonl
|
|||
void
|
||||
hup(int sig)
|
||||
{
|
||||
panicking = 1; // ???
|
||||
panicking = 1; /* ??? */
|
||||
rescue();
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ int
|
|||
notify(void(*f)(void *, char *))
|
||||
{
|
||||
signal(SIGINT, SIG_IGN);
|
||||
signal(SIGPIPE, SIG_IGN); // XXX - bpipeok?
|
||||
signal(SIGPIPE, SIG_IGN); /* XXX - bpipeok? */
|
||||
signal(SIGHUP, hup);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue