mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-29 13:03:36 +01:00
kprint: add support for L modifier in %f
This is just a parsing trick because long double and double are the same type on this platform.
This commit is contained in:
parent
21e91b30d5
commit
bc3b8f5602
1 changed files with 4 additions and 2 deletions
|
@ -69,7 +69,7 @@ void kprint_register(int spec, kprint_formatter_t kformat)
|
|||
/* Non-letters */
|
||||
if(spec < 'a' || spec > 'z') return;
|
||||
/* Size-specifying letters */
|
||||
if(spec == 'h' || spec == 'l' || spec == 'z') return;
|
||||
if(spec == 'h' || spec == 'l' || spec == 'L' || spec == 'z') return;
|
||||
|
||||
kprint_formatters[spec - 'a'] = kformat;
|
||||
}
|
||||
|
@ -142,7 +142,8 @@ kprint_options_t kprint_opt(char const **options_ptr)
|
|||
for(int c; (c = *options); options++)
|
||||
{
|
||||
int c_low = c | 0x20;
|
||||
if(c_low >= 'a' && c_low <= 'z' && c != 'h' && c != 'l') break;
|
||||
if(c_low >= 'a' && c_low <= 'z' && c != 'h' && c != 'l' &&
|
||||
c != 'L') break;
|
||||
|
||||
if(c == '.')
|
||||
{
|
||||
|
@ -178,6 +179,7 @@ kprint_options_t kprint_opt(char const **options_ptr)
|
|||
if(c == 'h') opt.size--;
|
||||
if(c == 'l') opt.size++;
|
||||
if(c == 'z') opt.size = 3;
|
||||
if(c == 'L') {}
|
||||
|
||||
if(c >= '1' && c <= '9') state = length, options--;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue