Skip to content

Commit fb38a5d

Browse files
committed
Remove un-needed #include's from *.c files.
1 parent 353eb3d commit fb38a5d

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

src/backend/utils/adt/arrayfuncs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.44 1999/07/15 15:20:07 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.45 1999/07/15 19:21:41 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -27,7 +27,6 @@
2727
#include "storage/fd.h"
2828
#include "fmgr.h"
2929
#include "utils/array.h"
30-
3130
#include "libpq/libpq-fs.h"
3231
#include "libpq/be-fsstubs.h"
3332

src/backend/utils/adt/arrayutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayutils.c,v 1.8 1999/07/15 15:20:10 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayutils.c,v 1.9 1999/07/15 19:21:42 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414

1515
#define WEAK_C_OPTIMIZER
1616

1717
#include "postgres.h"
18-
18+
#include "utils/array.h"
1919
int
2020
GetOffset(int n, int *dim, int *lb, int *indx)
2121
{

src/tools/pginclude/pginclude

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ do
55
sed 's/->[a-zA-Z0-9_\.]*//g' "$FILE" >/tmp/$$a
66
echo "#include \"postgres.h\"" >/tmp/$$.c
77
echo "#include \"/tmp/$$a\"" >>/tmp/$$.c
8+
echo "void include_test(void);" >>/tmp/$$.c
89
echo "void include_test() {" >>/tmp/$$.c
910
pgdefine "$FILE" >>/tmp/$$.c
1011
echo "}" >>/tmp/$$.c
11-
cc -Werror -Wall -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
12+
cc -fsyntax-only -Werror -Wall -Wmissing-prototypes -Wmissing-declarations -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
1213
if [ "$?" -ne 0 ]
1314
then echo "$FILE"
1415
if [ "$1" = "-v" ]

src/tools/pginclude/pgnoinclude

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
:
22
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
3-
find . \( -name CVS -a -prune \) -o -type f -print | grep -v postgres.h |
3+
find . \( -name CVS -a -prune \) -o -type f -print | grep -v '\./postgres.h' |
44
while read FILE
55
do
66
if [ "`echo $FILE | sed -n 's/^.*\.\([^\.]*\)$/\1/p'`" = "h" ]
@@ -18,24 +18,26 @@ do
1818
while read INCLUDE
1919
do
2020
[ -s /usr/include/$INCLUDE ] && continue
21+
[ "$INCLUDE" = postgres.h ] && continue
2122
cat /tmp/$$a |
2223
grep -v '^#include[ ]*[<"]'"$INCLUDE"'[>"]' >/tmp/$$b
2324
if [ "$IS_INCLUDE" = "Y" ]
2425
then echo "#include \"postgres.h\"" >/tmp/$$.c
2526
else >/tmp/$$.c
2627
fi
2728
echo "#include \"/tmp/$$b\"" >>/tmp/$$.c
29+
echo "void include_test(void);" >>/tmp/$$.c
2830
echo "void include_test() {" >>/tmp/$$.c
2931
if [ "$IS_INCLUDE" = "Y" ]
3032
then pgdefine "$FILE" >>/tmp/$$.c
3133
fi
3234
echo "}" >>/tmp/$$.c
33-
cc -Werror -Wall -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
35+
cc -fsyntax-only -Werror -Wall -Wmissing-prototypes -Wmissing-declarations -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
3436
if [ "$?" -eq 0 ]
3537
then echo "$FILE $INCLUDE"
3638
if [ "$IS_INCLUDE" = "N" ]
37-
then grep -v '#include[ ]*[<"]$FILE[>"]' >/tmp/$$a
38-
mv /tmp/$$a "$FILE"
39+
then grep -v '#include[ ]*[<"]$INCLUDE[>"]' $FILE >/tmp/$$b
40+
mv /tmp/$$b "$FILE"
3941
fi
4042
if [ "$1" = "-v" ]
4143
then cat /tmp/$$

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy