Make lwlocknames.h generated file less ugly
authorÁlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 13 Mar 2025 16:38:21 +0000 (17:38 +0100)
committerÁlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 13 Mar 2025 16:38:21 +0000 (17:38 +0100)
We can make the output look a bit better by aligning each lock's
definition, so add some padding space to achieve that.  This change
makes no practical difference, but casual onlookers will be less
distracted by (lack of) whitespace.

Author: Gurjeet Singh <gurjeet@singh.im>
Discussion: https://postgr.es/m/CABwTF4VxfwDtRV-H22_XK4XeDogaV-Vaobu+af5U=8ZAZn9ZZQ@mail.gmail.com

src/backend/storage/lmgr/generate-lwlocknames.pl

index 084da2ea6e0d4a7ecdab90a83b8cc397118e1402..4441b7cba0c5fc87340fbff31ec967bfc3ce7ef1 100644 (file)
@@ -108,7 +108,8 @@ while (<$lwlocklist>)
    $continue = ",\n";
 
    # Add a "Lock" suffix to each lock name, as the C code depends on that
-   print $h "#define ${lockname}Lock (&MainLWLockArray[$lockidx].lock)\n";
+   printf $h "#define %-32s (&MainLWLockArray[$lockidx].lock)\n",
+     $lockname . "Lock";
 }
 
 die