This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10087 - Improvements to rocklife: file loading; code readability
Attached to Project:
Rockbox
Opened by Alexander Levin (fml2) - Wednesday, 01 April 2009, 23:52 GMT+2
Last edited by Alexander Levin (fml2) - Friday, 03 April 2009, 22:26 GMT+2
Opened by Alexander Levin (fml2) - Wednesday, 01 April 2009, 23:52 GMT+2
Last edited by Alexander Levin (fml2) - Friday, 03 April 2009, 22:26 GMT+2
|
DetailsThe patch does the following:
1. Reading of the file is now done char by char. This makes it not dangerous if the file is big 2. Code readability is improved via introducing of get_cell 3. Slight speed improvement in calculating the next generation (n[4] is taken from the previous generation) 4. A first step is made in decoupling of the grid size from the LCD size |
This task depends upon
Closed by Alexander Levin (fml2)
Friday, 03 April 2009, 22:26 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed in r20610
Friday, 03 April 2009, 22:26 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed in r20610
char is unsigned by default on ARM, so checking buf <= 0 (implicating signed) might be problematic. Shouldn't it be checking for EOF anyway?
Yes, that sounds right. I am trying to teach myself C on-the-fly, so please make whatever changes seem appropriate and I will learn by example.
@kugel: read returns the number of bytes read, or 0 on EOF, or a negative value on error. The return value is stored in an int and then tested. Where do you see a problem?
Sync to r20608