mirror of
https://git.sr.ht/~crc_/retroforth
synced 2024-11-16 19:48:56 +01:00
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:
parent
e97886ee65
commit
97e4cdfcb0
4 changed files with 15 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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++;
|
||||
|
|
Loading…
Reference in a new issue