bug-indent
[Top][All Lists]
Advanced

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

"random" extra space formatting for pointers


From: Romain Vimont
Subject: "random" extra space formatting for pointers
Date: Thu, 14 Aug 2014 16:22:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0

Hi,

I have a problem with formatting C pointers.
I always want:
  int *i; // not int * i
  struct mystruct *s; // not struct mystruct *s

But it does not always work.

For instance, take this file :
https://github.com/rom1v/delay/blob/928a546862e8c20fdd39910fb20c6570277d1d5b/dtbuf.c

Execute:
  indent -nut -fca -br -npcs -ce -brf -npsl dtbuf.c

It changes :
  time_ms dtbuf_next_timestamp(struct dtbuf *dtbuf) {
into:
  time_ms dtbuf_next_timestamp(struct dtbuf * dtbuf) {

And:
  ssize_t dtbuf_write_chunk(struct dtbuf *dtbuf, …
into:
  ssize_t dtbuf_write_chunk(struct dtbuf * dtbuf, …

But it keep unchanged:
  int dtbuf_init(struct dtbuf *dtbuf, size_t capacity) {
(and others)

More stranger: replace the return type "time_ms" by "void" in my first
example, and it will format:
  time_ms dtbuf_next_timestamp(struct dtbuf *dtbuf) {
(without the extra space)

$ indent --version
GNU indent: 2.2.11

Thank you for your help ;)



reply via email to

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