• 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
Attached to Project: Rockbox
Opened by jdgordon - 2006-07-02
Last edited by jdgordon - 2007-05-20

FS#5623 - add a directory walker functoin to reduce code reuse

this patch adds a directory walker function to reduce lots of code reuse (the same sort of function apears about a half-dozen times in playlist.c alone.. )

this patch also updates the stats plugin to use the dir walker.

edit: may as well mention i did it iterativly in the ope its a bit faster on the player than recursive.

Closed by  jdgordon
2007-05-20 08:38
Reason for closing:  Out of Date
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

very out of date and probably not worth adding anyway

ok, realised the recurse variable was completly unnescacery

new version, this one includes the needed tchanges to playlist.c to use the dirwalker.

im not 100% sure why, but get_next_directory doesnt work exactly as it used to now, but that can be figured out later.
also, i was hopeing it would drop the filesize a bit, but apparently not..

h300 size comparisson
-rw-r–r– 1 jonno users 331980 2006-07-02 14:50 rockbox.iriver ← with patch
-rw-r–r– 1 jonno users 331700 2006-07-02 14:49 rockbox.iriver.cvs ← without patch

recorder comparisson
-rw-r–r– 1 jonno users 146732 2006-07-05 00:47 rockbox.ucl ← with patch
-rw-r–r– 1 jonno users 146692 2006-07-05 00:46 rockbox.ucl.cvs ← without patch

but, imo its worth the extra 280bytes to make it easier later.

ive been told to do speed comparissions, so ill do em tomroow maybe

synced to latest cvs, fixed some minor bugs
fixed he newly added playlist catalog to use this.

edit: you need the 2 files in the next comment also, forgot to add them and you cant add files to an existing comment

woops, forgot the 2 most important files, which for some reason didnt get added to the .patch

synced, fixed and renamed to fileutils.[ch]

fixed again.. now its ready to go!

synced to cvs,
also changed some minor bits so its hopefully faster and smaller… tested on my h300 and it works perfectly

mmohr commented on 2006-08-22 10:46

Currently I didn’t test it - but it seems to be a very good idea for me!
I had a look at the patch and it makes the code much more understandable
which is IMHO always a good idea :-)

I also like the idea of a fileutil.c -
I assume there are a lot more currently internally used functions/code parts
which which do something for or with files and could be moved to general usage.

synced to cvs


Available keyboard shortcuts


Task Details

Task Editing