

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.


-- 
Nigel J. Andrews


Fri, 19 Sep 2003 07:43:53 +0100 (BST)
"Nigel J. Andrews" <nandrews@investsystems.co.uk>
pgindented tsearch2 for 7.3.4
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@186: Unbalanced parens
	Warning@187: Extra )
	Error@314: Unbalanced parens
	Warning@315: Extra )
	Error@386: Unbalanced parens
	Warning@390: Extra )
	Error@427: Unbalanced parens
	Warning@429: Extra )
	Error@439: Unbalanced parens
	Warning@440: Extra )
	Error@670: Unbalanced parens
	Warning@671: Extra )
	Error@682: Unbalanced parens
	Warning@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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Wed, 24 Sep 2003 12:20:05 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [GENERAL] pgindented tsearch2 for 7.3.4
Bruce Momjian wrote:

>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.
>
>  
>
Amen :-)

This reminds me of the famous "Real Programmers Don't Use Pascal", which 
says:

"If you ignore the fact that it's "structured", even 'C' programming can 
be appreciated by the Real Programmer: after all, there's no type 
checking, variable names are seven (ten? eight?) characters long, and 
the added bonus of the Pointer data type is thrown inï¿½-like having the 
best parts of *FORTRAN * and assembly language in one place (not to 
mention some of the more creative uses for *#DEFINE*)."

:-)


cheers

andrew




Wed, 24 Sep 2003 12:47:15 -0400
Andrew Dunstan <andrew@dunslane.net>
Re: [GENERAL] pgindented tsearch2 for 7.3.4
On Wed, 24 Sep 2003, Bruce Momjian wrote:

> 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
> ...
> 
> 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@186: Unbalanced parens
> 	Warning@187: Extra )
> 	Error@314: Unbalanced parens
> ...

It was a far more basic problem than that! I'd have been pleased if I'd got as
far as that. You developers of today don't know you're born. Back in my day we
used to have to get up before noon just to turn the computer on...

Actually, I had a problem in that I only had GNU indent and BSD indent that was
core dumping but it was unpatched, plus I couldn't find the BSD indent source
on the web. Eventually found it, in a linux distribution of all places, and
then I got the above errors, by which time I was quite prepared to not count
those as such.

There are a few macro's defined that make me think of fortran programmers
moving to C.

Anyway Bruce, you'll see the patch eventually generated lower down you inbox.


-- 
Nigel J. Andrews


Wed, 24 Sep 2003 18:56:16 +0100 (BST)
"Nigel J. Andrews" <nandrews@investsystems.co.uk>
Re: [GENERAL] pgindented tsearch2 for 7.3.4
Nigel J. Andrews wrote:
> It was a far more basic problem than that! I'd have been pleased if I'd got as
> far as that. You developers of today don't know you're born. Back in my day we
> used to have to get up before noon just to turn the computer on...
> 
> Actually, I had a problem in that I only had GNU indent and BSD indent that was
> core dumping but it was unpatched, plus I couldn't find the BSD indent source
> on the web. Eventually found it, in a linux distribution of all places, and
> then I got the above errors, by which time I was quite prepared to not count
> those as such.
> 
> There are a few macro's defined that make me think of fortran programmers
> moving to C.
> 
> Anyway Bruce, you'll see the patch eventually generated lower down you inbox.

I have put a patched NetBSD indent on our ftp server in /pub/dev so if
anyone wants it, they can download it from there.

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

Sat, 27 Sep 2003 17:49:32 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [GENERAL] pgindented tsearch2 for 7.3.4