Re: [GENERAL] pgindented tsearch2 for 7.3.4

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] pgindented tsearch2 for 7.3.4
Date: 2003-09-24 16:20:05
Message-ID: 200309241620.h8OGK5o13366@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Nigel J. Andrews wrote:
>
>
> I never knew running indent was so damn complicated. All three of my
> development systems can not manage it without throughing a fault (I've
> absolutely no idea why indent in the shell works but doesn't in pgindent on
> one).
>
> Anyway, has anyone pgindented the version of tsearch2 that runs with 7.3.4? If
> so please email it to me. The tar file is tsearch-v2-stable.tar.gz, just for
> clarity and I can supply it if someone volunteers but doesn't have it.

There are about 6 files that can't be run through pgindent, and tsearch2
has one of them:

$ pgindent *.c
Hope you installed /src/tools/pgindent/indent.bsd.patch.

gistidx.c
Error(at)186: Unbalanced parens
Warning(at)187: Extra )
Error(at)314: Unbalanced parens
Warning(at)315: Extra )
Error(at)386: Unbalanced parens
Warning(at)390: Extra )
Error(at)427: Unbalanced parens
Warning(at)429: Extra )
Error(at)439: Unbalanced parens
Warning(at)440: Extra )
Error(at)670: Unbalanced parens
Warning(at)671: Extra )
Error(at)682: Unbalanced parens
Warning(at)683: Extra )

It is actually this code that is causing it:

LOOPBYTE(
if ((sign[i] & 0xff) != 0xff)
PG_RETURN_POINTER(retval);
);

With the macro being:

#define LOOPBYTE(a) \
for(i=0;i<SIGLEN;i++) {\
a;\
}

If you ask me, this is just _weird_ code and should not be allowed.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-09-24 16:26:29 Re: pltcl problem
Previous Message Bruce Momjian 2003-09-24 16:11:29 Re: This mail list and its policies

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2003-09-24 16:21:23 Re: creating/accessing new runtime parameters
Previous Message Tom Lane 2003-09-24 16:15:29 Re: invalid tid errors in latest 7.3.4 stable.