Re: Run pgindent now?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Run pgindent now?
Date: 2015-05-24 02:33:39
Message-ID: 20150524023339.GE28512@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, May 24, 2015 at 04:16:07AM +0200, Andres Freund wrote:
> On 2015-05-23 21:36:50 -0400, Bruce Momjian wrote:
> > pgindent run on HEAD and committed.
>
> - if (IsA(node, Aggref) || IsA(node, GroupingFunc))
> + if (IsA(node, Aggref) ||IsA(node, GroupingFunc))
>
> There's a bunch of changes like this. Looks rather odd to me? I don't
> recall seing much code looking like that?

Wow, that is quite odd. I saw another case where it might have done
this because the line was >80 characters without it, but not in this
case.

> Also, does somebody have an idea to keep pgindent from butchering inline
> asm like:
> /*
> * Perform cmpxchg and use the zero flag which it implicitly sets when
> * equal to measure the success.
> */
> - __asm__ __volatile__(
> - " lock \n"
> - " cmpxchgl %4,%5 \n"
> - " setz %2 \n"
> -: "=a" (*expected), "=m"(ptr->value), "=q" (ret)
> -: "a" (*expected), "r" (newval), "m"(ptr->value)
> -: "memory", "cc");
> + __asm__ __volatile__(
> + " lock \n"
> + " cmpxchgl %4,%5 \n"
> + " setz %2 \n"
> + : "=a"(*expected), "=m"(ptr->value), "=q"(ret)
> + : "a"(*expected), "r"(newval), "m"(ptr->value)
> + : "memory", "cc");
> +
> return (bool) ret;

Ah, we have a file /pgtop/src/tools/pgindent/exclude_file_patterns which
has excluded files, and s_lock.h is one of them. I think
/include/port/atomics/arch-x86.h needs to be added, and the pgindent
commit on the file reverted. Are there any other files with __asm__
lines like that?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-05-24 03:23:04 Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file
Previous Message Andres Freund 2015-05-24 02:16:07 Re: Run pgindent now?