On Sun, Sep 30, 2018 at 7:03 PM Yegappan Lakshmanan <[email protected]> wrote:
>
> Hi Bram,
>
> On Sun, Sep 30, 2018 at 8:12 AM Bram Moolenaar <[email protected]> wrote:
> >
> > Yegappan wrote:
> >
> > > The quickfix.c file uses several function prototypes for static
> > > functions in the file. The attached patch removes these
> > > prototypes by moving the functions around. Even though the
> > > diff is large, no new functionality is introduced in this diff
> > > and the contents of the functions are not changed.
> >
> > I'm not a fan of moving functions around just to remove the function
> > prototype.  It's better to keep functions in an order that makes it easy
> > to overview their relation.
> >
>
> Even though some of the functions are moved, I kept the related
> functions together by functionality.
>
> >
> > There is a conflict in this: It's natural to first start with the main
> > entry point, and have lower level functions below it.  But to avoid
> > prototypes one has to do it the other way around.
> >
>
> Yes. Currently some static functions have prototypes and others don't.
>
> >
> > I know some people who write C put main() at the bottom and everything
> > it needs above it, but that does feel like it's upside down.  Especially
> > if you have worked with a language that doesn't have this requirement
> > (or function prototypes at all).
> >
>
> I thought removing the static function prototypes will reduce the clutter.
> But I will leave it up to you to decide whether to merge it or not.
>
> Regards,
> Yegappan
>
> >
> > I've been thinking of generating the prototypes automatically, like we
> > do for the files in src/proto.  But never got around getting all the
> > details right (e.g., need some way to skip certain functions, recognize
> > #ifdefs, etc.).
> >

Oh, I thought we had (automatically generated) prototypes in
src/proto/*.pro for all functions in src/*.c — and BTW I thought it
rather neat; no "clutter" at all since those prototypes are in
different source files after all.

Well, one learns something new every day.

Best regards,
Tony.

-- 
-- 
You received this message from the "vim_dev" 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 because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui