unu, muri now build under gcc-2.92; full build works under Haiku/BeOS (disable GOPHER in rre first)

FossilOrigin-Name: b24fcc586b4c07494bfaeb882c9cf1ac37289c1e3afc51348090937a2a17b7cd
This commit is contained in:
crc 2018-01-27 20:36:11 +00:00
parent e97886ee65
commit 97e4cdfcb0
4 changed files with 15 additions and 8 deletions

View file

@ -244,10 +244,12 @@ part of pass1()).
~~~
void pass2(char *fname) {
char *buffer = (char *)source;
char *buffer;
FILE *fp;
int inBlock;
inBlock = 0;
buffer = (char *)source;
here = 0;
int inBlock = 0;
fp = fopen(fname, "r");
while (!feof(fp)) {
read_line(fp, buffer);

View file

@ -29,14 +29,16 @@ I use this for readability purposes.
~~~
void read_line(FILE *file, char *line_buffer) {
int ch, count;
if (file == NULL || line_buffer == NULL)
{
printf("Error: file or line buffer pointer is null.");
exit(1);
}
int ch = getc(file);
int count = 0;
ch = getc(file);
count = 0;
while ((ch != '\n') && (ch != EOF)) {
line_buffer[count] = ch;

View file

@ -126,10 +126,12 @@ void pass1(char *fname) {
fclose(fp);
}
void pass2(char *fname) {
char *buffer = (char *)source;
char *buffer;
FILE *fp;
int inBlock;
inBlock = 0;
buffer = (char *)source;
here = 0;
int inBlock = 0;
fp = fopen(fname, "r");
while (!feof(fp)) {
read_line(fp, buffer);

View file

@ -4,13 +4,14 @@
#include <ctype.h>
#define KiB * 1024
void read_line(FILE *file, char *line_buffer) {
int ch, count;
if (file == NULL || line_buffer == NULL)
{
printf("Error: file or line buffer pointer is null.");
exit(1);
}
int ch = getc(file);
int count = 0;
ch = getc(file);
count = 0;
while ((ch != '\n') && (ch != EOF)) {
line_buffer[count] = ch;
count++;