From 07c3f00b142fd5ee011909c55665469a268cd572 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 26 Nov 2001 21:42:24 +0000 Subject: Rename find_baddefs to find_badmacros --- doc/src/FAQ/FAQ_DEV.html | 15 ++++++++++----- src/tools/find_baddefs | 20 -------------------- src/tools/find_badmacros | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 25 deletions(-) delete mode 100755 src/tools/find_baddefs create mode 100755 src/tools/find_badmacros diff --git a/doc/src/FAQ/FAQ_DEV.html b/doc/src/FAQ/FAQ_DEV.html index 179f6168438..94306bdbe45 100644 --- a/doc/src/FAQ/FAQ_DEV.html +++ b/doc/src/FAQ/FAQ_DEV.html @@ -76,6 +76,7 @@ make_mkid make mkid ID files mkldexport create AIX exports file pgindent indents C source files + pgjindent indents Java source files pginclude scripts for adding/removing include files unused_oids in pgsql/src/include/catalog @@ -112,7 +113,7 @@ Others prefer glimpse.

make_diff has tools to create patch diff files that can - be applied to the distribution. This produces context diffs, which + be applied to the distribution. This produces context diffs, which is our preferred format.

Our standard format is to indent each code level with one tab, @@ -163,10 +164,14 @@ consistent. Comment blocks that need specific line breaks should be formatted as block comments, where the comment starts as /*------. These comments will not be reformatted in - any way. pginclude contains scripts used to add needed - #include's to include files, and removed unneeded #include's. When - adding system types, you will need to assign oids to them. There is - also a script called unused_oids in + any way.

+ +

pginclude contains scripts used to add needed + #include's to include files, and removed unneeded + #include's.

+ +

When adding system types, you will need to assign oids to them. + There is also a script called unused_oids in pgsql/src/include/catalog that shows the unused oids.

2) What books are good for developers?

diff --git a/src/tools/find_baddefs b/src/tools/find_baddefs deleted file mode 100755 index 8a12b59becf..00000000000 --- a/src/tools/find_baddefs +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# This script attempts to find bad ifdef's, i.e. ifdef's that use braces -# but not the do { ... } while (0) syntax -# -# This is useful for running before pgindent - -for FILE -do - awk ' BEGIN {was_define = "N"} - { if (was_define == "Y" && - $0 ~ /^{/) - printf "%s %d\n", FILENAME, NR - if ($0 ~ /^#define/) - was_define = "Y" - else - was_define = "N" - }' "$FILE" - grep -on '^#define.*{' "$FILE" | grep -v 'do[ ]*{' -done - diff --git a/src/tools/find_badmacros b/src/tools/find_badmacros new file mode 100755 index 00000000000..8a12b59becf --- /dev/null +++ b/src/tools/find_badmacros @@ -0,0 +1,20 @@ +#!/bin/sh +# This script attempts to find bad ifdef's, i.e. ifdef's that use braces +# but not the do { ... } while (0) syntax +# +# This is useful for running before pgindent + +for FILE +do + awk ' BEGIN {was_define = "N"} + { if (was_define == "Y" && + $0 ~ /^{/) + printf "%s %d\n", FILENAME, NR + if ($0 ~ /^#define/) + was_define = "Y" + else + was_define = "N" + }' "$FILE" + grep -on '^#define.*{' "$FILE" | grep -v 'do[ ]*{' +done + -- cgit v1.2.3