pgpool2.git / summary / log / commit / refs
commit bb96b767624ff43a1d3ea18a2aae7147ac1cc801
Author: Yugo Nagata <nagata@sraoss.co.jp>
Date: Fri Oct 16 04:31:43 2015 +0000
Fix compiler warnings
src/parser/scan.c | 28 +++++++---------------------
src/parser/snprintf.c | 3 +--
src/utils/pool_path.c | 5 ++++-
src/utils/statistics.c | 1 +
4 files changed, 13 insertions(+), 24 deletions(-)
diff --git a/src/parser/scan.c b/src/parser/scan.c
index 9a913ad7f..6a0fe139a 100644
--- a/src/parser/scan.c
+++ b/src/parser/scan.c
@@ -54,6 +54,7 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -84,8 +85,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
-#endif /* ! C99 */
-
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -159,15 +158,7 @@ typedef void* yyscan_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#define YY_BUF_SIZE 32768
-#else
#define YY_BUF_SIZE 16384
-#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -1085,7 +1076,7 @@ extern void core_yyset_column(int column_no, yyscan_t yyscanner);
* Note that xcstart must appear before operator, as explained above!
* Also whitespace (comment) must appear before operator.
*/
-#line 1089 "scan.c"
+#line 1080 "scan.c"
#define INITIAL 0
#define xb 1
@@ -1232,12 +1223,7 @@ static int input (yyscan_t yyscanner );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#define YY_READ_BUF_SIZE 16384
-#else
#define YY_READ_BUF_SIZE 8192
-#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -1256,7 +1242,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ unsigned n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -1344,7 +1330,7 @@ YY_DECL
#line 395 "scan.l"
-#line 1348 "scan.c"
+#line 1334 "scan.c"
yylval = yylval_param;
@@ -2358,7 +2344,7 @@ YY_RULE_SETUP
#line 1012 "scan.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 2362 "scan.c"
+#line 2348 "scan.c"
case YY_END_OF_BUFFER:
{
@@ -3087,8 +3073,8 @@ YY_BUFFER_STATE core_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
/** Setup the input buffer state to scan the given bytes. The next call to core_yylex() will
* scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
diff --git a/src/parser/snprintf.c b/src/parser/snprintf.c
index ad18dc6b7..4694598af 100644
--- a/src/parser/snprintf.c
+++ b/src/parser/snprintf.c
@@ -31,8 +31,8 @@
*/
#if 0
-
#include "c.h"
+#endif
#include <ctype.h>
#ifdef _MSC_VER
@@ -45,7 +45,6 @@
#endif
#include <sys/param.h>
-#endif
#ifndef NL_ARGMAX
#define NL_ARGMAX 16
diff --git a/src/utils/pool_path.c b/src/utils/pool_path.c
index b1d88e479..f2829ccb4 100644
--- a/src/utils/pool_path.c
+++ b/src/utils/pool_path.c
@@ -24,7 +24,7 @@
*
*/
-#include "pool_type.h"
+#include "pool.h"
#include "utils/pool_path.h"
#include <stdio.h>
#include <string.h>
@@ -78,6 +78,9 @@ get_os_username(char *buf, int bufsize)
return true;
}
+/* stolen from PostgreSQL src/port/thread.c
+ * XXX: This is from 9.4 but the latest pgsql have changed this.
+ */
/*
* Wrapper around getpwuid() or getpwuid_r() to mimic POSIX getpwuid_r()
* behaviour, if it is not available or required.
diff --git a/src/utils/statistics.c b/src/utils/statistics.c
index 331cb25fc..63684de83 100644
--- a/src/utils/statistics.c
+++ b/src/utils/statistics.c
@@ -17,6 +17,7 @@
*/
#include <unistd.h>
+#include <string.h>
#include "pool.h"
#include "parser/nodes.h"
[parent: 06f726845ea9]