bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-indent] argument formatting


From: stefan
Subject: [Bug-indent] argument formatting
Date: Thu, 19 Sep 2002 09:02:44 +0200 (CEST)

Hello Indent'ers,

first of all:  Thanks for great and useful software.  I am using it to get
obfuscated C source readable.

I found the following (mis)behaviour in formatting function arguments:
Original source:

===========================================================================
#define BIT_MASK(x) ((0xFFFFFFFF>>(31-((1?x)&31)+((0?x)&31)))<<((0?x)&31))
void main (void) {
  unsigned int a,b,c;

  a = BIT_MASK(7:4);
  b = BIT_MASK ( 31 : 28);
  c = BIT_MASK(0:0) | BIT_MASK ( 31 : 28) | BIT_MASK ( 7 : 4 );
  printf("0x%08X, 0x%08X, 0x%08X\n", a, b, c);
}
===========================================================================

Using
        $ indent -st bittest.c 

produces:

===========================================================================
#define BIT_MASK(x) ((0xFFFFFFFF>>(31-((1?x)&31)+((0?x)&31)))<<((0?x)&31))
void
main (void)
{
  unsigned int a, b, c;

a = BIT_MASK (7:4);
b = BIT_MASK (31:28);
c = BIT_MASK (0: 0) | BIT_MASK (31: 28) | BIT_MASK (7:4);
  printf ("0x%08X, 0x%08X, 0x%08X\n", a, b, c);
}
===========================================================================

Watch the arguments of BIT_MASK() when assigned to 'c'.  In the last place
it is as I like it, but the previous one have a space inserted.  Thus
you get different formatting in the same line.  Is this correct behaviour
or can you easily change it?

Can you please also reply to me directly for I do not read the mailing
list...

Thanks in advance,
        address@hidden





reply via email to

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