workarounds for cc65's non-standard const correctness rules.
bflag = 1;
break;
case 'h':
- execv("/usr/lib/diffh", (const char**)args);
+ execv("/usr/lib/diffh", (char**)args);
mesg("cannot find diffh", empty);
done();
}
exit(1);
}
if (p == 0) {
- execvp(argv[1], &argv[1]);
+ execvp(argv[1], (char**) &argv[1]);
perror(argv[1]);
_exit(1);
}
int time_zone = 0;
long timezone = 0;
-int errx(int exv, char *str)
+void errx(int exv, char *str)
{
fprintf(stderr, "cal: %s\n", str);
exit(exv);
"September", "October", "November", "December"
};
+static int days[12][MAXDAYS];
+static char lineout[80];
+
/* leap year -- account for gregorian reformation in 1752 */
#define leap_year(yr) \
((yr) <= 1752 ? !((yr) % 4) : \
j_yearly(year);
else
yearly(year);
- exit(0);
+ return(0);
}
#define DAY_LEN 3 /* 3 spaces per day */
{
char *p;
int col, *dp, i, month, row, which_cal;
- int days[12][MAXDAYS];
- char lineout[80];
sprintf(lineout, "%d", year);
center(lineout, J_WEEK_LEN * 2 + J_HEAD_SEP, 0);
{
char *p;
int col, *dp, i, month, row, which_cal;
- int days[12][MAXDAYS];
- char lineout[80];
sprintf(lineout, "%d", year);
center(lineout, WEEK_LEN * 3 + HEAD_SEP * 2, 0);
#define BUFFER_SIZE 512
+static char buff[BUFFER_SIZE];
/* The name of the file currently being displayed, "-" indicates stdin. */
int output_file(int fd)
{
int bytes_read;
- char buff[BUFFER_SIZE];
while ((bytes_read = read(fd, buff, BUFFER_SIZE)) > 0)
write(STDOUT_FILENO, buff, bytes_read);
struct stat st;
char path[PATH_MAX + 1];
-int main(int argc, char **argv);
+int main(int argc, char *argv[]);
mode_t parsemode(char *symbolic, mode_t oldmode);
int do_change(char *name);
void usage(void);
};
-
+static unsigned char buffer[1024];
static int aux;
/* Routine straight out of 4.9.10 */
off_t f_size;
unsigned long crc;
int nb;
- unsigned char buffer[1024];
if (fd < 0) {
perror(name);
#define putstr(x) write(1, x, strlen(x))
#define eputstr(x) write(2, x, strlen(x))
+static char buf1[512];
+static char buf2[512];
+
void main(int argc, char *argv[])
{
int fd1;
long pos;
char *bp1;
char *bp2;
- char buf1[512];
- char buf2[512];
struct stat statbuf1;
struct stat statbuf2;
printf("%-16s %6u %6u %6u %5u%% %s\n",
dn, Total, Used, Free, Percent,
- fsys.s_mntpt ? mntpoint(dn) : "/");
+ fsys.s_mntpt ? mntpoint(dn) : (const char*) "/");
}
void df_all(void)
unsigned c2u2(const unsigned char *ucarray);
unsigned long c4u4(const unsigned char *ucarray);
void determine(void);
-int main(int argc, const char *argv []);
+int main(int argc, char *argv []);
DIRECTORY *directory(DIRECTORY *dir, int entries, BOOL function, char *pathname);
void extract(DIRECTORY *entry);
void delete(DIRECTORY *entry);
}
}
-int main(int argc, const char *argv[])
+int main(int argc, char *argv[])
{
register char *arg_ptr = slash(argv[0]);
DIRECTORY *entry;
nlink_t al_nlink;
} ALREADY;
-int main(int argc, char **argv);
+int main(int argc, char *argv[]);
int makedname(char *d, char *f, char *out, int outlen);
int done(dev_t dev, ino_t inum, nlink_t nlink);
long dodir(char *d, int thislev, dev_t dev);
long total;
DIR *dp;
struct dirent *entry;
- char dent[LINELEN];
+ static char dent[LINELEN];
if (lstat(d, &s) < 0) {
fprintf(stderr, "%s: %s: %s\n", prog, d, strerror(errno));
static char *filename;
static char searchstring[USERSIZE];
+static char buf[USERSIZE+1];
static char *bufbase;
static char *bufp;
static LEN bufused;
NUM num2;
BOOL have1;
BOOL have2;
- char buf[USERSIZE];
while (TRUE) {
intflag = FALSE;
static void addlines(NUM num)
{
int len;
- char buf[USERSIZE + 1];
while (fgets(buf, sizeof(buf), stdin)) {
if ((buf[0] == '.') && (buf[1] == '\n') && (buf[2] == '\0'))
uint16_t j;
int c;
int nentries;
- char ename[150];
+ static char ename[150];
iread(inum, &ino);
if ((ino.i_mode & S_IFMT) != S_IFDIR)
int d, st;
struct _uzidirent buf;
struct stat statbuf;
- char dname[512];
+ static char dname[512];
if (stat(path, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) {
printf("ls: can't stat %s\n", path);
struct passwd *pwd;
struct group *grp;
- char buf[PATHLEN], *cp = buf;
+ static char buf[PATHLEN];
+ char *cp = buf;
int len;
*cp = '\0';
BOOL endslash;
DIR *dirp;
int i;
- char *cp, *name, **newlist, fullname[PATHLEN];
+ char *cp, *name, **newlist;
+ static char fullname[PATHLEN];
if ((list = (char **) malloc(LISTSIZE * sizeof(char *))) == NULL) {
fprintf(stderr, "No memory for ls buffer\n");
*/
{
static char page[256], section[32];
- char alias[256];
+ static char alias[256];
int found= 0;
int c;
*/
{
FILE *wf;
- char whatis[1024], pagename[1024], *wpage, *wsection;
+ static char whatis[1024], pagename[1024];
+ char *wpage, *wsection;
int rsw, rsp;
int ntries;
int (*searchidx)(FILE *, char *, char **, char **);
* may have manual pages that override the ones in the major directory.
*/
{
- char submandir[1024];
+ static char submandir[1024];
DIR *md;
struct dirent *entry;
void searchmanpath(char *title, char *section)
/* Search the manual path for a manual page describing "title." */
{
- char mandir[1024];
+ static char mandir[1024];
char *pp= manpath, *pd;
for (;;) {
int make_dir(const char *name, int f)
{
char *line;
- char iname[256];
+ static char iname[256];
int l = strlen(name) - 1;
int bytespresent;
-int main(int argc, char **argv);
+int main(int argc, char *argv[]);
long offset(int argc, char *argv[], int k);
void dumpfile(void);
void wdump(short *words, int k, int radix);
int i, j, uid, pfd, ptsize;
struct passwd *pwd;
struct p_tab *pp;
- struct p_tab ptab[PTABSIZE];
- char name[10], uname[20];
+ static struct p_tab ptab[PTABSIZE];
+ static char name[10], uname[20];
uid = getuid();
*tp++ = '/';
for (i = 0; (*tp++ = cmd[i++]) != '\0'; )
;
- execve(eline, argv, (const char**) environ);
+ execve(eline, (char**) argv, (char**) environ);
}
write(2, "ssh: ", 5);
write(2, cmd, strlen(cmd));
struct termios termios;
int column= 0, max_column=80; /* Assume 80 character terminals. */
-void main(int argc, char **argv);
+void main(int argc, char *argv[]);
void report(int flags);
int option(char *opt, char *next);
int match(const char *s1, const char *s2);
void sum(int fd, const char *fname)
{
- char buf[BUFFER_SIZE];
+ static char buf[BUFFER_SIZE];
register int i, n;
long size = 0;
unsigned crc = 0;
int main(int argc, char *argv[])
{
char iflag = 0, aflag = 0;
- char buf[CHUNK_SIZE];
+ static char buf[CHUNK_SIZE];
int i, s, n;
argv++;
short in_index, out_index;
-int main(int argc, char **argv);
+int main(int argc, char *argv[]);
void convert(void);
void map(unsigned char *string1, unsigned char *string2);
void expand(char *arg, unsigned char *buffer);
{
register unsigned char *ptr;
register short i, index;
- unsigned char conv[ASCII + 2];
+ static unsigned char conv[ASCII + 2];
index = 0;
for (i = 1; i <= ASCII; i++) {
int split = 0;
int fileln = 32000;
-int main(int argc, char **argv);
+int main(int argc, char *argv[]);
void maketable(void);
void makename(void);
void encode(void);
int quit, found;
char *envpath;
char *path, *cp;
- char buf[512];
- char patbuf[512];
+ static char buf[512];
+ static char patbuf[512];
if (argc < 2) {
fprintf(stderr, "Usage: which cmd [cmd, ..]\n");
int main(int argc, char ** argv)
{
- char ttyname[12];
+ static char ttyname[12];
struct passwd * pwdent;
int ofd = -1;
- char buf[255];
+ static char buf[255];
int n;
if ((argc > 3) || (argc < 2)) {