]> git.kaiwu.me - nginx.git/commitdiff
Merge of r4760, r4761: -Wmissing-prototypes.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Aug 2012 17:07:28 +0000 (17:07 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Aug 2012 17:07:28 +0000 (17:07 +0000)
Fixed compilation with -Wmissing-prototypes.  Added a commented
out -Wmissing-prototypes to CFLAGS.  It is commented out to not break
builds with 3rd party modules.

15 files changed:
auto/cc/gcc
src/core/ngx_conf_file.c
src/core/ngx_crypt.c
src/event/modules/ngx_epoll_module.c
src/event/modules/ngx_eventport_module.c
src/event/modules/ngx_rtsig_module.c
src/event/ngx_event.c
src/http/modules/ngx_http_log_module.c
src/http/modules/ngx_http_upstream_least_conn_module.c
src/http/ngx_http_parse_time.c
src/mail/ngx_mail_parse.c
src/misc/ngx_cpp_test_module.cpp
src/os/unix/ngx_atomic.h
src/os/unix/ngx_posix_init.c
src/os/unix/ngx_solaris_sendfilev_chain.c

index 1676641f3824dc7fe2148b808402971da6090466..c27d857e3ecef5e833ffe5c5b9c5cf72012f3806 100644 (file)
@@ -149,6 +149,7 @@ CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W"
 CFLAGS="$CFLAGS -Wall -Wpointer-arith"
 #CFLAGS="$CFLAGS -Wconversion"
 #CFLAGS="$CFLAGS -Winline"
+#CFLAGS="$CFLAGS -Wmissing-prototypes"
 
 
 case "$NGX_GCC_VER" in
index 892fa4719a83512c5a5831dcd09335472ce35a9e..01715af353217b2801df418753af4c3a854c8c84 100644 (file)
@@ -1448,12 +1448,16 @@ ngx_conf_set_bitmask_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 }
 
 
+#if 0
+
 char *
 ngx_conf_unsupported(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     return "unsupported on this platform";
 }
 
+#endif
+
 
 char *
 ngx_conf_deprecated(ngx_conf_t *cf, void *post, void *data)
index 9564c3618cbb809020e863100959751ecc3b2382..365f9c82a8e8ea460bac2340da0d72dabe8b475f 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <ngx_config.h>
 #include <ngx_core.h>
+#include <ngx_crypt.h>
 #include <ngx_md5.h>
 #if (NGX_HAVE_SHA1)
 #include <ngx_sha1.h>
index a73394906d1a6117dca9f029ab923a49b3fd6408..ee77d8e4afff4e91473419ad54416f9809a7e34c 100644 (file)
@@ -44,16 +44,25 @@ struct epoll_event {
     epoll_data_t  data;
 };
 
+
+int epoll_create(int size);
+
 int epoll_create(int size)
 {
     return -1;
 }
 
+
+int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
+
 int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
 {
     return -1;
 }
 
+
+int epoll_wait(int epfd, struct epoll_event *events, int nevents, int timeout);
+
 int epoll_wait(int epfd, struct epoll_event *events, int nevents, int timeout)
 {
     return -1;
@@ -76,11 +85,6 @@ struct io_event {
 };
 
 
-int eventfd(u_int initval)
-{
-    return -1;
-}
-
 #endif
 #endif
 
index bbcd6dd6bae9e80e49d0e1d2efbc3b8702b4babb..d6dcb0bedf4cbb8cb4ae87f52fd1af35b597f89c 100644 (file)
 #define ushort_t  u_short
 #define uint_t    u_int
 
+#ifndef CLOCK_REALTIME
+#define CLOCK_REALTIME          0
+typedef int     clockid_t;
+typedef void *  timer_t;
+#endif
+
 /* Solaris declarations */
 
 #define PORT_SOURCE_AIO         1
@@ -24,7 +30,9 @@
 #define PORT_SOURCE_ALERT       5
 #define PORT_SOURCE_MQ          6
 
+#ifndef ETIME
 #define ETIME                   64
+#endif
 
 #define SIGEV_PORT              4
 
@@ -50,39 +58,62 @@ typedef struct itimerspec {     /* definition per POSIX.4 */
 
 #endif
 
+int port_create(void);
+
 int port_create(void)
 {
     return -1;
 }
 
+
+int port_associate(int port, int source, uintptr_t object, int events,
+    void *user);
+
 int port_associate(int port, int source, uintptr_t object, int events,
     void *user)
 {
     return -1;
 }
 
+
+int port_dissociate(int port, int source, uintptr_t object);
+
 int port_dissociate(int port, int source, uintptr_t object)
 {
     return -1;
 }
 
+
+int port_getn(int port, port_event_t list[], uint_t max, uint_t *nget,
+    struct timespec *timeout);
+
 int port_getn(int port, port_event_t list[], uint_t max, uint_t *nget,
     struct timespec *timeout)
 {
     return -1;
 }
 
+
+int timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid);
+
 int timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
 {
     return -1;
 }
 
+
+int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
+    struct itimerspec *ovalue);
+
 int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
     struct itimerspec *ovalue)
 {
     return -1;
 }
 
+
+int timer_delete(timer_t timerid);
+
 int timer_delete(timer_t timerid)
 {
     return -1;
index 2f0f9970f39ae22e2288b91992997d96c3bfb5a8..b36230c76505372cedf68cec8d3a01bc8de11130 100644 (file)
 
 #if (NGX_TEST_BUILD_RTSIG)
 
+#if (NGX_DARWIN)
+
+#define SIGRTMIN       33
+#define si_fd          __pad[0]
+
+#else
+
 #ifdef  SIGRTMIN
 #define si_fd          _reason.__spare__.__spare2__[0]
 #else
 #define si_fd          __spare__[0]
 #endif
 
+#endif
+
 #define F_SETSIG       10
 #define KERN_RTSIGNR   30
 #define KERN_RTSIGMAX  31
 
+int sigtimedwait(const sigset_t *set, siginfo_t *info,
+                 const struct timespec *timeout);
+
 int sigtimedwait(const sigset_t *set, siginfo_t *info,
                  const struct timespec *timeout)
 {
index c584dd87d93346293314c0deb87e77dec5a5cd82..2120ed7a2cd5ecf48e76164eac904509e77fd41f 100644 (file)
@@ -567,7 +567,7 @@ ngx_event_module_init(ngx_cycle_t *cycle)
 
 #if !(NGX_WIN32)
 
-void
+static void
 ngx_timer_signal_handler(int signo)
 {
     ngx_event_timer_alarm = 1;
index edb145992a60ba0fe2b93f37704e0c193bbacee3..5b9c7998696ef76372963d7d817fa48b400a495e 100644 (file)
@@ -218,7 +218,7 @@ static ngx_http_log_var_t  ngx_http_log_vars[] = {
 };
 
 
-ngx_int_t
+static ngx_int_t
 ngx_http_log_handler(ngx_http_request_t *r)
 {
     u_char                   *line, *p;
index 50e68b21b90468cb226259cb4a3ebb29b3a4cdc9..21156ae1aefbfb9bf6a6827b109a69419314299d 100644 (file)
@@ -81,7 +81,7 @@ ngx_module_t  ngx_http_upstream_least_conn_module = {
 };
 
 
-ngx_int_t
+static ngx_int_t
 ngx_http_upstream_init_least_conn(ngx_conf_t *cf,
     ngx_http_upstream_srv_conf_t *us)
 {
index 3801df2fd641644dab4f66a03b73b0b25e6c3c60..985af31725b74646ceae26d5ba4386b6adeb1507 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <ngx_config.h>
 #include <ngx_core.h>
+#include <ngx_http.h>
 
 
 static ngx_uint_t  mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
index ae0f7e39a923dc0ad48612ffd6b4d4d9a4fc39a3..eb16d5b4fe91673aa183f8c5b7e72c3f0668916b 100644 (file)
@@ -9,6 +9,9 @@
 #include <ngx_core.h>
 #include <ngx_event.h>
 #include <ngx_mail.h>
+#include <ngx_mail_pop3_module.h>
+#include <ngx_mail_imap_module.h>
+#include <ngx_mail_smtp_module.h>
 
 
 ngx_int_t
index 8f87dcdad609576fe19aabae6738dc98368f48d2..3cbc0a8111a74de5a052bf93c73374b5f71e92e1 100644 (file)
@@ -20,6 +20,8 @@ extern "C" {
 // #include <string>
 
 
+void ngx_cpp_test_handler(void *data);
+
 void
 ngx_cpp_test_handler(void *data)
 {
index 104ac376a2cded35b043a2954009c36f7b5aa6c1..417cd86ff29fe6156bc8f926663d048826abb06d 100644 (file)
@@ -48,7 +48,9 @@ typedef volatile ngx_atomic_uint_t  ngx_atomic_t;
 #include <libkern/OSAtomic.h>
 
 /* "bool" conflicts with perl's CORE/handy.h */
+#if 0
 #undef bool
+#endif
 
 
 #define NGX_HAVE_ATOMIC_OPS  1
index eea65a9034e3038a34ab8af5c009b387d95adc46..58e6f76143bff3bfd28fec20c6459015d49f29e8 100644 (file)
@@ -98,6 +98,8 @@ ngx_os_status(ngx_log_t *log)
 }
 
 
+#if 0
+
 ngx_int_t
 ngx_posix_post_conf_init(ngx_log_t *log)
 {
@@ -122,3 +124,5 @@ ngx_posix_post_conf_init(ngx_log_t *log)
 
     return NGX_OK;
 }
+
+#endif
index f800c15f5c9dc959b98c645dc379151d195297ab..520eaaab4c787868a5067fe83065da9dee526626 100644 (file)
@@ -29,6 +29,9 @@ static ssize_t sendfilev(int fd, const struct sendfilevec *vec,
     return -1;
 }
 
+ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in,
+    off_t limit);
+
 #endif