From: cuz Date: Mon, 25 Nov 2002 21:59:35 +0000 (+0000) Subject: Use the constants from _file.inc X-Git-Tag: V2.12.0~1997 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0edf53fd2f3344a6bf62717c17e6a1b9ee07b301;p=cc65 Use the constants from _file.inc git-svn-id: svn://svn.cc65.org/cc65/trunk@1650 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/common/fmisc.s b/libsrc/common/fmisc.s index 185a4ec9c..a8c913b5e 100644 --- a/libsrc/common/fmisc.s +++ b/libsrc/common/fmisc.s @@ -1,4 +1,4 @@ -; +; ; Ullrich von Bassewitz, 31.05.1998 ; ; Several small file stream functions @@ -9,17 +9,19 @@ .import __errno .importzp ptr1 + .include "_file.inc" + ; ; Get the FILE* parameter, check if the file is open ; getf: sta ptr1 stx ptr1+1 - ldy #1 - lda (ptr1),y ; get f->f_flags - and #$01 ; file open? - beq @L1 ; jump if no - clc ; ok + ldy #_FILE_f_flags + lda (ptr1),y ; get f->f_flags + and #_FOPEN ; file open? + beq @L1 ; jump if no + clc ; ok rts @L1: sec rts @@ -32,7 +34,7 @@ _clearerr: jsr getf bcs err lda (ptr1),y - and #$F9 + and #<~(_FEOF | _FERROR) sta (ptr1),y err: rts @@ -44,7 +46,7 @@ _feof: jsr getf ; bcs err lda (ptr1),y - and #$02 + and #_FEOF ldx #0 rts @@ -56,7 +58,7 @@ _ferror: jsr getf ; bcs err lda (ptr1),y - and #$04 + and #_FERROR ldx #0 rts