- Status Closed
- Percent Complete
- Task Type Patches
- Category Operating System/Drivers
- Assigned To No-one
- Operating System All players
- Severity Low
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#7030 - Adds the printf format for pointers (%p or %P)
This adds the printf format for pointers. Use %p or %P.
Example:
int *p;
printf(”Int value at %p is %d”, p, *p);
Also corrected the code indentation and factored out duplicated code.
Closed by petur
2007-04-16 11:33
Reason for closing: Rejected
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
2007-04-16 11:33
Reason for closing: Rejected
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
the addition to the bin size just
isn\'t worth it
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
With this patch, %x and %p produce lower case hex and %X and %P produce upper case hex.
Also fixed copy&paste error.
This also adds %i as a synonym for %d.
Unless there’s any real use to this, this patch only increases binary size.
For example, H300 went from 414528 to 414868 (+340 bytes)
Apart from that, I did look at the patch and enhanced it a bit, so here’s my version.
The inline is used because performance is important
Removed %P since it doesn’t seem to be in the printf spec. Making funcs inline would probably increase the binary size.
I’ve added the %p tag because I wanted to investigate how pointers are affected by IRAM attributes and found out that the tag isn’t present in RB. Should I cast pointers to long to display them?
BTW: to further reduce the binary size, %i (for int) can be removed. I introduced it to be as near as possible to the ‘official’ printf spec, but if RB doesn’t need it (and I think it doesnt’t) it can be removed.
@petur: why do you think performance in printf is so important? Could we trade a little bit of speed for binary size?
Petur, I tried some combinations of code changes and you are right: the binary size increases. I don’t undestand why but it does. So we can refuse on this change and use conversion to long instead.
Well I give up on this. I tried to just write some parts of the SVN version nicer and more compact, but whatever I try, the binsize grows. Attached is my last try, but I’ll probably close this patch anyway as it’s grown pretty useless.
Same here. And agreed on closing. But it’s weird, no?