Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] slight optimisation at client/packhand.c
Home

[Freeciv-Dev] Re: [PATCH] slight optimisation at client/packhand.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Kevin Brown <kevin@xxxxxxxxxxxxxx>
Cc: Trent Piepho <xyzzy@xxxxxxxxxxxxx>, Gaute B Strokkenes <gs234@xxxxxxxxx>, Markus Linnala <maage@xxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] slight optimisation at client/packhand.c
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 Aug 2001 22:14:26 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Thu, Aug 16, 2001 at 12:30:40PM -0700, Kevin Brown wrote:
> Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > On Wed, Aug 15, 2001 at 07:18:35PM -0700, Trent Piepho wrote:
> > > On Thu, 16 Aug 2001, Gaute B Strokkenes wrote:
> > > > This needs more spaces.  Also, the && should be at the beginning of
> > > > the line, not the end.
> > > 
> > > Other people (like me) like && at the end better, and it's more common 
> > > that
> > > way in the code.
> > 
> > I also like the && at the end and some other things. However you have
> > to follow the rules. This is easy if you use emacs and something like:
> 
> [...]
> 
> Oooh...I like!  Very cool.  Just one thing:
> 
> >    "indent -kr -i2 2>&1 | grep -v Unexpected" 1)
> 
> Shouldn't you be directing stderr to /dev/null?  Or perhaps not at
> all?  Will emacs Just Do The Right Thing if it sees output on stderr?

Since indent will only see a region of code it will complain if the
construct isn't closed:

$ cat a.c

for (;;)
  {
    int i;
  }
$ indent a.c
$ cat b.c

for (;;)
  {
    int i;
$ indent b.c
indent: b.c:5: Error:Unexpected end of file

Another error which shows up from time to time is:

$ cat c.c
int i=-1;
$ indent c.c
indent: c.c:1: Warning:old style assignment ambiguity in "=-".  Assuming "= -"

> in any case, what do you do if your source contains the word
> "Unexpected"?  :-) :-)

Problem.

> Of course, Emacs uses the K&R 2-character indentation mode for C/C++
> by default anyway, doesn't it?  So indent-region should just work,
> right?

If will only do the "leading" intention. It wouldn't insert spaces
between "int i=-1" or "a=b+c".

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Like the ad says, at 300 dpi you can tell she's wearing a
  swimsuit. At 600 dpi you can tell it's wet. At 1200 dpi you
  can tell it's painted on. I suppose at 2400 dpi you can tell
  if the paint is giving her a rash."
    -- Joshua R. Poulson


[Prev in Thread] Current Thread [Next in Thread]