[syslinux] [Syslinux-GSoC] Successed in converting the cache code to C

H. Peter Anvin hpa at zytor.com
Wed Jun 3 19:08:21 PDT 2009


Hi liu,

Looked at your code as of this morning, my time, and I'm really happy
with your progress.  You have done an absolutely great job.

Renaming open to core_open makes sense.

A few minor style nitpicks; please don't take this as anything other
than a nitpick.

Please don't put "extern" statements or function prototypes inside .c
files.  They belong in .h files, which in turn should be put in the
include/ directory.  Use #include "foo.h" for private includes (in the
core directory), #include <bar.h> for includes loaded from elsewhere.

We probably want to separate the different filesystems out in separate
subdirectories.

In one checkin comment you say something about merging things into a
larger file.  Overall, it's better to have a lot of smaller source files
than can be understood in isolation -- large source files are a problem.
 Syslinux has too many of them as it is :)

Some of your source files have large chunks of blank lines, which is
probably excessive.

I suggest introducing the SECTOR_SHIFT and SECTOR_SIZE macros as soon as
possible; it's a lot easier to deal with than tracking down things like:

	int sec_per_block = block_size >> 9; /* 512==sector size */

later on, and it's always better to make the code document itself.

+	memset(&regs, 0, sizeof(regs) );

Preferred style is:

	memset(&regs, 0, sizeof regs);

 - No space before the final parens
 - No parens around the argument to sizeof, unless it is a type.

I suspect we should already now define a sector_t type for the sector
number.  At some point we're going to need 64-bit sector numbers, and
making that a typedef already now will make it a lot easier.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.




More information about the Syslinux mailing list