MOD5213 iprintf() error for UL and ULL types?

Discussion to talk about software related topics only.
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: MOD5213 iprintf() error for UL and ULL types?

Post by pbreed »

For a variety of reasons, I can't check in the fix right now....
My personal Git state is in the middle of a differnt project...

go to nburn\nbrtos\source\nbprintf.cpp

About 571 lines after the copyright (our git repo and the code I work on has a place holder for copy right)
You will find a switch statement that looks like:

switch (f)
{
case 'f': ret = OutputFFloat(pf, data, d, pfs); break;
case 'e':
case 'E': ret = OutputEFloat(pf, data, d, pfs, f); break;
case 'g': ret = OutputgFloat(pf, data, d, pfs, gc);



Add another case to it so it looks like:

switch (f)
{
case 'f': ret = OutputFFloat(pf, data, d, pfs); break;
case 'e':
case 'E': ret = OutputEFloat(pf, data, d, pfs, f); break;
case 'G': ret = OutputgFloat(pf, data, d, pfs, gc); break;
case 'g': ret = OutputgFloat(pf, data, d, pfs, gc);

By the way if your using 'G' and the exponential version would be shorter ... that works with the correct E/e for G/g as is
its just that when it determines that the f format would be shorter it fails...

Paul
KE5FX
Posts: 22
Joined: Tue Dec 10, 2019 11:17 pm

Re: MOD5213 iprintf() error for UL and ULL types?

Post by KE5FX »

Thanks, Paul, looks good now. I just added case 'G': and let it fall through to the 'g' case.
Post Reply