On Thu, 12 Jun 2008 21:00:21 -0400 Pavel Roskin <[EMAIL PROTECTED]> wrote: > On Thu, 2008-06-12 at 15:58 -0700, Colin D Bennett wrote: > > I highly recommend running > > > > indent --no-tabs > > Why no tabs? Tabs are heavily used in the code. GNU indent is > supposed to default to GNU Coding Standards, and it uses tabs.
The video module code uses only spaces for indentation. Since I've been working mostly on the video module, so far, I was misled to believe that spaces are the preferred GRUB style. I checked all the C files in GRUB2 CVS and found that you are right, tabs are heavily used, except in the code that I have been focused on. The following C files do not contains any tabs: ./kern/i386/efi/init.c ./commands/videotest.c ./util/powerpc/ieee1275/misc.c ./util/i386/pc/misc.c ./util/i386/get_disk_name.c ./util/ieee1275/get_disk_name.c ./util/lvm.c ./video/video.c ./video/i386/pc/vbeutil.c ./video/i386/pc/vbefill.c ./video/i386/pc/vbeblit.c ./video/i386/pc/vbe.c ./video/readers/tga.c ./video/bitmap.c ./disk/ieee1275/nand.c > > on your source code, as long as it doesn't cause too many spurious > > changes to pre-existing code. > > It will. This depends on the file. Running format (with the same choice of tabs+spaces or spaces-only for indentation) on a GRUB source file usually results in minimal changes, in my experience. > > This should take care of most formatting > > inconsistencies and frees you a little but from concerning yourself > > with trivial details. > > We can use a script to re-indent everything. Then new patches could > be easily run through the same script. Otherwise, it's not going to > be simple. Interesting idea! Anyway, my point is not to get into the religious war of spaces vs. tabs in indentation, since I am comfortable with both, although I think that mixing spaces and tabs together (using TAB characters as a substitute for 8 spaces) negates the benefits of both approaches. But that's all I'll say on that. I will indent code that I work on with the same style that it already has, so that my patches are clean and contain, in general, only changes related to actual features that the patch adds. Colin _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel