linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Stupid luser question
@ 2002-10-01 18:14 jbradford
  2002-10-01 18:29 ` Eli Carter
  0 siblings, 1 reply; 4+ messages in thread
From: jbradford @ 2002-10-01 18:14 UTC (permalink / raw)
  To: linux-kernel

Just wondering, what is the purpose of the comment /* { */ which is found in various seemingly random places in the kernel:

# grep -F -r "/* { */" *

drivers/video/font_acorn_8x8.c:/* 7B */  0x0C, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0C, 0x00, /* { */
drivers/scsi/scsi_syms.c:#if defined(CONFIG_SCSI_LOGGING)       /* { */
drivers/scsi/scsi.c:#ifdef CONFIG_SCSI_LOGGING          /* { */
drivers/scsi/scsi.c:#ifdef CONFIG_SCSI_LOGGING          /* { */
drivers/message/fusion/mptbase.h:#ifdef __KERNEL__      /* { */
drivers/message/fusion/mptscsih.c:#ifndef MPT_SCSI_USE_NEW_EH   /* { */
drivers/message/fusion/mptscsih.c:#ifdef MPT_SCSI_USE_NEW_EH            /* { */
drivers/message/fusion/mptscsih.c:#if 0         /* { */
drivers/message/fusion/mptbase.c:#ifdef CONFIG_PROC_FS              /* { */

John.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Stupid luser question
  2002-10-01 18:14 Stupid luser question jbradford
@ 2002-10-01 18:29 ` Eli Carter
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Carter @ 2002-10-01 18:29 UTC (permalink / raw)
  To: jbradford; +Cc: linux-kernel

jbradford@dial.pipex.com wrote:
> Just wondering, what is the purpose of the comment /* { */ which is found in various seemingly random places in the kernel:
> 
> # grep -F -r "/* { */" *
> 
> drivers/video/font_acorn_8x8.c:/* 7B */  0x0C, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0C, 0x00, /* { */
[snip]

Probably folding... possibly from vim/gvim.

If you're curious, look at: http://vim.sourceforge.net/htmldoc/fold.html
:set foldmethod=marker
:set foldmarker={,}
:set foldcolumn=6
Gets folding "mostly right" for C/C++ code.  Manually added folds add in 
a C comment containing the foldmarker, in this case "/* { */"
and "/* } */"

emacs probably has this feature as well, but I'm a vim person myself. :)

If you are not familiar with folding, look into it.  I find it very 
useful when dealing with unfamiliar code or looking at program structure.

HTH,

Eli
--------------------. "If it ain't broke now,
Eli Carter           \                  it will be soon." -- crypto-gram
eli.carter(a)inet.com `-------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Stupid luser question
@ 2002-10-01 18:36 John Hall
  0 siblings, 0 replies; 4+ messages in thread
From: John Hall @ 2002-10-01 18:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: jbradford

On 01 October 2002 19:14 jbradford@dial.pipex.com
<jbradford@dial.pipex.com> wrote:

> Just wondering, what is the purpose of the comment /* { */ which is
> found in various seemingly random places in the kernel:
> 
> # grep -F -r "/* { */" *

I would guess that they were put there by someone who uses a folding
editor. If you look for matching #endif's you will find a /* } */.

regards,
john

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Stupid luser question
@ 2002-10-01 18:30 Petr Vandrovec
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Vandrovec @ 2002-10-01 18:30 UTC (permalink / raw)
  To: jbradford; +Cc: linux-kernel

On  1 Oct 02 at 19:14, jbradford@dial.pipex.com wrote:

> Just wondering, what is the purpose of the comment /* { */ which is found in various seemingly random places in the kernel:
> 
> # grep -F -r "/* { */" *
> 
> drivers/video/font_acorn_8x8.c:/* 7B */  0x0C, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0C, 0x00, /* { */

Body of character "{"...

> drivers/scsi/scsi_syms.c:#if defined(CONFIG_SCSI_LOGGING)       /* { */
> drivers/scsi/scsi.c:#ifdef CONFIG_SCSI_LOGGING          /* { */
> drivers/scsi/scsi.c:#ifdef CONFIG_SCSI_LOGGING          /* { */
> drivers/message/fusion/mptbase.h:#ifdef __KERNEL__      /* { */
> drivers/message/fusion/mptscsih.c:#ifndef MPT_SCSI_USE_NEW_EH   /* { */
> drivers/message/fusion/mptscsih.c:#ifdef MPT_SCSI_USE_NEW_EH            /* { */
> drivers/message/fusion/mptscsih.c:#if 0         /* { */
> drivers/message/fusion/mptbase.c:#ifdef CONFIG_PROC_FS              /* { */

All these are for cooperation with editors which find matching 
brace/bracket/... for you:

#ifdef __KERNEL__   /* { */
...
#endif /* } __KERNEL__ */

and then you can quickly jump from ifdef to endif and back even in
editor which does not know about #if/ifdef/else/elif/ifndef/endif...
                                            Best regards,
                                                        Petr Vandrovec
                                                        vandrove@vc.cvut.cz
                                                                                        

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-01 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-01 18:14 Stupid luser question jbradford
2002-10-01 18:29 ` Eli Carter
2002-10-01 18:30 Petr Vandrovec
2002-10-01 18:36 John Hall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).