Wednesday, July 21, 2010

Re: format c program

indent gnu tools

2010/7/17 bill lam <cbill.lam@gmail.com>:
> Сбт, 17 Июл 2010, Tony Mechelynck писал(а):
>> On 17/07/10 03:41, bill lam wrote:
>> >I want to edit and format (pretty print) someone else c programs.
>> >It should use hard-tab and tabstop=8, but indentation sometime use tab
>> >while sometime use spaces, like
>> >
>> >/* return a pointer to a cell's [struct ent *], creating if needed */
>> >struct ent *
>> >lookat(int row, int col)
>> >{
>
> This work, but some minor issue.
> 1. an extra TAB was insert before return type. Is this coding style
>   non-standard? I found it is convenient to locate the definition of a
>   function without the help of ctags.
>
> ^Itruct ent *
> lookat(int row, int col)
> {
>
> 2. #if was not counted
>   this was originally indented at the same level
>
> #ifdef MSDOS
>        if ((revi = strrchr(argv[0], '\\')) != NULL)
> #else
> #ifdef VMS
>                if ((revi = strrchr(argv[0], ']')) != NULL)
>
> And a related problem, how to expand all tabs (using current ts) that
> are not at the beginning of a line.
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: