Convert K&R definitions to ANSI C

This commit is contained in:
Nishi 2026-06-18 14:01:01 +09:00
commit a2161ba1b0
45 changed files with 521 additions and 1073 deletions

45
sjrc.c
View file

@ -62,8 +62,8 @@ struct functbl {
{NULL, NULL}};
#define TOLOWER(c) (isupper(c) ? tolower(c) : (c))
int sjset_code() {
int sjset_code(void)
{
char* loc;
#ifdef LACKOF_SETLOCALE
@ -93,8 +93,8 @@ int sjset_code() {
#endif
return 1;
}
int getsjrc() {
int getsjrc(void)
{
FILE* fd;
char* p;
@ -126,9 +126,7 @@ int getsjrc() {
return FALSE;
}
void
setrc(file, fd) char* file;
FILE* fd;
void setrc(char * file, FILE * fd)
{
char line[MAXLINE];
int w;
@ -151,9 +149,7 @@ FILE* fd;
}
}
}
int much(s1, s2)
char *s1, *s2;
int much(char * s1, char * s2)
{
char c1, c2;
@ -167,10 +163,7 @@ char *s1, *s2;
}
return 1;
}
int getword(s, word)
char* s;
struct wordent word[];
int getword(char * s, struct wordent word[])
{
unsigned char c, cc;
char* p;
@ -256,39 +249,27 @@ struct wordent word[];
word[++wcount].word_str[0] = '\0';
return wcount;
}
int IsTerminator(c)
unsigned char c;
int IsTerminator(unsigned char c)
{
return (c == '\n') ? 1 : 0;
}
int isTerminator(c)
unsigned char c;
int isTerminator(unsigned char c)
{
return (c == '#') ? 1 : 0;
}
int IsEscape(c)
unsigned char c;
int IsEscape(unsigned char c)
{
return (c == '\\') ? 1 : 0;
}
int IsDelimitor(c)
unsigned char c;
int IsDelimitor(unsigned char c)
{
return (c == ' ' || c == '\t' || c == '.') ? 1 : 0;
}
int set_dict(word)
struct wordent word[];
int set_dict(struct wordent word[])
{
setdicname(word[1].word_str);
}
int set_server(word)
struct wordent word[];
int set_server(struct wordent word[])
{
setsjserv(word[1].word_str);
}