Rockbox

Tasklist

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

Attached to Project: Rockbox
Opened by Jonathan Gordon (jdgordon) - Sunday, 02 July 2006, 01:30 GMT
Last edited by Jonathan Gordon (jdgordon) - Sunday, 20 May 2007, 08:38 GMT
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

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.
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Sunday, 20 May 2007, 08:38 GMT
Reason for closing:  Out of Date
Additional comments about closing:  very out of date and probably not worth adding anyway
Comment by Jonathan Gordon (jdgordon) - Sunday, 02 July 2006, 02:02 GMT
ok, realised the recurse variable was completly unnescacery
Comment by Jonathan Gordon (jdgordon) - Sunday, 02 July 2006, 04:51 GMT
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
Comment by Jonathan Gordon (jdgordon) - Wednesday, 19 July 2006, 05:50 GMT
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
Comment by Jonathan Gordon (jdgordon) - Wednesday, 19 July 2006, 05:58 GMT
woops, forgot the 2 most important files, which for some reason didnt get added to the .patch
Comment by Jonathan Gordon (jdgordon) - Monday, 24 July 2006, 08:51 GMT
synced, fixed and renamed to fileutils.[ch]
Comment by Jonathan Gordon (jdgordon) - Monday, 24 July 2006, 08:56 GMT
woops,
fixed again.. now its ready to go!
Comment by Jonathan Gordon (jdgordon) - Monday, 14 August 2006, 07:00 GMT
synced to cvs,
also changed some minor bits so its hopefully faster and smaller...
tested on my h300 and it works perfectly
Comment by Matthias Mohr (aka Massa) (mmohr) - Tuesday, 22 August 2006, 10:46 GMT
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.
Comment by Jonathan Gordon (jdgordon) - Saturday, 30 September 2006, 10:54 GMT
synced to cvs

Loading...