Re: [HACKERS] [GENERAL] pgindented tsearch2 for 7.3.4

2003-09-27 Thread Bruce Momjian
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
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] [GENERAL] pgindented tsearch2 for 7.3.4

2003-09-24 Thread Bruce Momjian
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
[EMAIL PROTECTED]: Unbalanced parens
[EMAIL PROTECTED]: Extra )
[EMAIL PROTECTED]: Unbalanced parens
[EMAIL PROTECTED]: Extra )
[EMAIL PROTECTED]: Unbalanced parens
[EMAIL PROTECTED]: Extra )
[EMAIL PROTECTED]: Unbalanced parens
[EMAIL PROTECTED]: Extra )
[EMAIL PROTECTED]: Unbalanced parens
[EMAIL PROTECTED]: Extra )
[EMAIL PROTECTED]: Unbalanced parens
[EMAIL PROTECTED]: Extra )
[EMAIL PROTECTED]: Unbalanced parens
[EMAIL PROTECTED]: 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;iSIGLEN;i++) {\
a;\
}

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

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

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] [GENERAL] pgindented tsearch2 for 7.3.4

2003-09-24 Thread Andrew Dunstan
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;iSIGLEN;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



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] [GENERAL] pgindented tsearch2 for 7.3.4

2003-09-24 Thread Nigel J. Andrews
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
   [EMAIL PROTECTED]: Unbalanced parens
   [EMAIL PROTECTED]: Extra )
   [EMAIL PROTECTED]: 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


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster