[Top][All Lists]

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

Line length bug and missing parameter

From: Benjamin Drung
Subject: Line length bug and missing parameter
Date: Thu, 13 Jan 2011 23:46:22 +0100


I failed in selecting my preferred set of options for indent. These
options are missing or I didn't saw them:

1) No space between function pointer name and parameter. Example:

int foo(double (*bar)(int));

instead of

int foo(double (*bar) (int));

2) No space between the pointer star and the name. Example:

static char *format_size_base10(const prefix_t *units);

instead of

static char *format_size_base10(const prefix_t * units);

3) One space between code and one-line comment. Example:

    } else { // size >= 1000

instead of

    } else {                    // size >= 1000

4) No space around braces for initial array values. Example:

static const char *prefix[PREFIX_TYPES] = {"base10", "base2",

instead of

static const char *prefix[PREFIX_TYPES] = { "base10", "base2",
"historic" };

5) I found a bug: indent with the -l80 did not wrap this line correctly:

int kibi_n_format_transfer_rate(char *dest, size_t n, filesize_t
transfer_rate) {

Here's how you can reproduce all above:

bzr branch lp:libkibi
cd libkibi
INDENT_PARAM="-kr --no-tabs --braces-on-func-def-line
--no-space-after-for \
        --no-space-after-if --no-space-after-while --no-space-after-casts \
        -l80 -cp0"
indent -v $INDENT_PARAM kibi/kibi.h kibi/kibi.c test/test.c
bzr diff

bzr diff shouldn't show a difference (with the correct indent
parameters). Attached the diffs it produces.

Benjamin Drung
Debian & Ubuntu Developer

Attachment: indent.patch
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

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