Recognize 'L' as a length modifier for scanf.

Conversions using it will not actually work right yet (unless assignment is suppressed), because the necessary changes have not been made in SysFloat, but the infrastructure is now in place to allow for those changes.
This commit is contained in:
Stephen Heumann 2021-02-09 14:32:20 -06:00
parent 2f68708b47
commit 375d664ae1

View File

@ -5590,29 +5590,31 @@ fm1 inc4 format skip the '%'
fm2 jsr GetSize get the field width specifier fm2 jsr GetSize get the field width specifier
sta ~scanWidth sta ~scanWidth
lda [format] if the char is 'l', 'z', 't', or 'j' then lda [format]
and #$00FF and #$00FF
cmp #'l' cmp #'l' 'l' specifies long int or double
bne fm2a bne fm2a
inc ~size inc ~size
inc4 format check for 'll' inc4 format unless it is 'll' for long long
lda [format] lda [format]
and #$00FF and #$00FF
cmp #'l' cmp #'l'
bne fm6 bne fm6
bra fm2b bra fm2c
fm2a cmp #'z' fm2a cmp #'z' 'z' specifies size_t (long int)
beq fm2c
cmp #'t' 't' specifies ptrdiff_t (long int)
beq fm2c
cmp #'j' 'j' specifies intmax_t (long long)
beq fm2b beq fm2b
cmp #'t' cmp #'L' 'L' specifies long double
beq fm2b
cmp #'j' 'j' also specifies a long long size
bne fm3 bne fm3
inc ~size fm2b inc ~size
fm2b inc ~size long specifier fm2c inc ~size
bra fm4 bra fm4
fm3 cmp #'h' else if it is an 'h' then fm3 cmp #'h' 'h' specifies short int
bne fm5 bne fm5
inc4 format check for 'hh' inc4 format unless it is 'hh' for char types
lda [format] lda [format]
and #$00FF and #$00FF
cmp #'h' cmp #'h'
@ -5738,7 +5740,7 @@ ch ds 2 temp storage
~scanError ds 2 set to 1 by scanners if an error occurs ~scanError ds 2 set to 1 by scanners if an error occurs
~scanWidth ds 2 max # characters to scan ~scanWidth ds 2 max # characters to scan
~size ds 2 size specifier; -1 -> char, 0 -> default, ~size ds 2 size specifier; -1 -> char, 0 -> default,
! 1 -> long, 2 -> long long ! 1 -> long, 2 -> long long/long double
end end
**************************************************************** ****************************************************************