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 ;)

_______________________________________________
bug-indent mailing list
bug-indent@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-indent

Reply via email to