[MPlayer-dev-eng] the great reformatting

Clément Bœsch ubitux at gmail.com
Tue Feb 22 13:51:35 CET 2011


On Tue, Feb 22, 2011 at 12:45:02PM +0100, Ingo Brückl wrote:
> Clément Boesch wrote on Tue, 22 Feb 2011 12:18:21 +0100:
> 
> >> (BTW, I don't get whether aligning of var_def is favored, while var_struct
> >> isn't. I, as mentioned, would vote against all aligning :), but if that's
> >> convention, shouldn't it be consistent?)
> 
> > The var align set to 1 seems to force only 1 space, so in fact, no
> > alignment. Do you see a better option?
> 
> I'm not sure I get your point here. [...]

afaik the only things to vertical align are:

1. variable assignment:

    int i     = 0;
    char c    = 'x';
    char *str = "hello";
    void *foobar;

    // [...]

    foobar = &bla;
    zzz    = ptr;

2. structure fields:

    struct { .. } foo = {
        .i   = 0,
        .c   = 'x',
        .str = "hello",
    };

3. on line break:

    func(foobar, "xxxxxxx",
         x, &i);

4. you are also allowed to vertical align when you think it's worth like:

    buf[i    ] = input[j + 3] ^ output[j    ]
    buf[i + 1] = input[j    ] ^ output[j + 3]

> > The issue is not the inside parens, fntRead(char *path, char *fname) is
> > correct, the spaces between the type and the function name isn't.
> 
> Oh! I see. You're looking for sp_func_def_paren.
> 

Oh, thanks :)

> > Also, this means a lot of extra spaces have to be removed but aren't
> > (typedef       foo       bar    ; for instance).
> 
> sp_after_type (at least for the "foo bar;" part). I'm not sure there is one
> for the typedef part.
> 

Ok, I'll update those.

> >> [...]
> >> int fntRead(char *path, char *fname)
> >> {
> >>     FILE          *f;
> >>     unsigned char  tmp[512];
> >>     unsigned char *ptmp;
> >>     unsigned char  command[32];
> >>     unsigned char  param[256];
> >>     int            id, n;
> >>
> 
> > This alignement is wrong, we need to remove it; it's relative to what I
> > said previously.
> 
> It's the align_var_def_span you changed earlier.
> 

That's not what I intended to then :p

> So, should variable declaration be aligned or not?
> 
> >>             if (!utf8 && (Fonts[id]->nonASCIIidx[i][0] == (*uchar >> 6 | 0xc0) && Fonts[id]->nonASCIIidx[i][1] == ((*uchar & 0x3f) | 0x80) && Fonts[id]->nonASCIIidx[i][2] == 0))
> 
> > Huh? We need the 80 column setting too if it exists...
> 
> I'm afraid that's up to the programmer. Manually changed to:
> 

Ok.

>             if (!utf8 &&
>                 (Fonts[id]->nonASCIIidx[i][0] == (*uchar >> 6 | 0xc0) &&
>                  Fonts[id]->nonASCIIidx[i][1] == (*uchar & 0x3f | 0x80) &&
>                  Fonts[id]->nonASCIIidx[i][2] == 0))
>                 c = i + ASCII_CHRS;
> 
> What's the general convention concerning 80 columns? For example, I don't
> like breaking function arguments into different lines if only the last
> argument reaches a little bit beyond this 80-column-border.
> 

It's the convention here, not sure of the details, and don't care about
very much. "Please stop the bikesheddings"© will be the answer. Let's
avoid those endless discussions :)

-- 
Clément B.


More information about the MPlayer-dev-eng mailing list