[Toybox] RFC: od toy
Rob Landley
rob at landley.net
Thu Jun 28 09:47:46 PDT 2012
Remembering to click "send" would be a good thing...
On 06/26/2012 09:25 PM, Andre Renaud wrote:
>>> Does anyone have any comments about an alternative method to do this?
>>
>> Well, "toybox od -t a filename" doesn't work. And the number in the
>> front has one more digit of zero padding than the ubuntu one. I'll have
>> to read the spec to see what's expected...
>
> The parsing of the -t parameter is currently very crude - so you have
> to specify both the type and the width. I didn't go any further
> because I wasn't happy with the other bits.
I checked in what you sent and I've already started fixing it up. I can
take it from here if you like, this is a pretty good basis. (Optimizing
something that works is usually easier for me than getting it to work in
the first place.)
For integer, short, and char we could just promote to int and always
send that as the printf() argument, with a variable string, because
those types are promoted when passed on the stack anyway. The problem is
long and double. There should be a way to combine it all. Hmmm...
Rob
--
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation. Pick one.
1340902066.0
More information about the Toybox
mailing list