Package: fnord Version: 1.10-2 Severity: minor Tags: patch This patch silences a few compiler warnings. I'm not sure if the patch introduces portability problems, but it seems to work here.
-- Martin Rudat
--- fnord-1.10-2/debian/diff/warnings.diff 1970-01-01 10:00:00.000000000 +1000 +++ fnord-1.10/debian/diff/warnings.diff 2007-02-24 14:13:11.000000000 +1100 @@ -0,0 +1,114 @@ +diff -u buffer_flush.c buffer_flush.c +--- buffer_flush.c 2002-03-25 07:13:59.000000000 +1100 ++++ buffer_flush.c 2007-02-24 13:58:29.000000000 +1100 +@@ -1,6 +1,6 @@ + #include "buffer.h" + +-extern int buffer_stubborn(int (*op)(),int fd,const char* buf, unsigned int len); ++extern int buffer_stubborn(ssize_t (*op)(int, const void*,size_t),int fd,const char* buf, unsigned int len); + + extern int buffer_flush(buffer* b) { + register int p; +diff -u buffer.h buffer.h +--- buffer.h 2003-01-21 23:33:19.000000000 +1100 ++++ buffer.h 2007-02-24 13:54:01.000000000 +1100 +@@ -1,13 +1,15 @@ + #ifndef BUFFER_H + #define BUFFER_H + ++#include <unistd.h> ++ + typedef struct buffer { + char *x; + unsigned int p; + unsigned int n; + unsigned int a; + int fd; +- int (*op)(); ++ ssize_t (*op)(int, const void *, size_t); + } buffer; + + #define BUFFER_INIT(op,fd,buf,len) { (buf), 0, 0, (len), (fd), (op) } +@@ -15,7 +17,7 @@ + #define BUFFER_INSIZE 8192 + #define BUFFER_OUTSIZE 8192 + +-extern void buffer_init(buffer* b,int (*op)(),int fd,char* y,unsigned int ylen); ++extern void buffer_init(buffer* b,ssize_t (*op)(int, const void*, size_t),int fd,char* y,unsigned int ylen); + + extern int buffer_flush(buffer* b); + extern int buffer_put(buffer* b,const char* x,unsigned int len); +diff -u buffer_put.c buffer_put.c +--- buffer_put.c 2002-03-25 07:13:59.000000000 +1100 ++++ buffer_put.c 2007-02-24 13:57:45.000000000 +1100 +@@ -1,7 +1,7 @@ + #include "byte.h" + #include "buffer.h" + +-extern int buffer_stubborn(int (*op)(),int fd,const char* buf, unsigned int len); ++extern int buffer_stubborn(ssize_t (*op)(int, const void*, size_t),int fd,const char* buf, unsigned int len); + + int buffer_put(buffer* b,const char* buf,unsigned int len) { + if (len>b->a-b->p) { /* doesn't fit */ +diff -u buffer_stubborn.c buffer_stubborn.c +--- buffer_stubborn.c 2002-03-25 07:13:59.000000000 +1100 ++++ buffer_stubborn.c 2007-02-24 13:51:59.000000000 +1100 +@@ -1,7 +1,7 @@ + #include <errno.h> + #include "buffer.h" + +-int buffer_stubborn(int (*op)(),int fd,const char* buf, unsigned int len) { ++int buffer_stubborn(ssize_t (*op)(int, const void*, size_t),int fd,const char* buf, unsigned int len) { + int w; + while (len) { + if ((w=op(fd,buf,len))<0) { +diff -u httpd.c httpd.c +--- httpd.c 2005-10-05 20:37:41.000000000 +1000 ++++ httpd.c 2007-02-24 13:59:11.000000000 +1100 +@@ -312,13 +312,13 @@ + return 0; + } + +-static unsigned int elen(register const char *const *e) { ++static unsigned int elen(register char *const e[]) { + register unsigned int i=0; + while (e[i]) i++; + return i; + } + +-static void do_cgi(const char* pathinfo,const char* const* envp) { ++static void do_cgi(const char* pathinfo,char *const envp[]) { + const char *method_name[]={ "?", "GET", "HEAD", "POST"}; + char cgi_env_buf[MAXHEADERLEN*2+PATH_MAX+200]; + register unsigned int en=elen(envp); +@@ -515,7 +515,7 @@ + buffer_put(buffer_1,s+i,sl-i); + } + +-static void start_cgi(int nph,const char* pathinfo,const char *const *envp) { ++static void start_cgi(int nph,const char* pathinfo,char *const envp[]) { + size_t size=0; + int n; + int pid; +@@ -1278,7 +1278,7 @@ + #endif + } + +-int main(int argc,char *argv[],const char *const *envp) { ++int main(int argc,char *argv[],char *const envp[]) { + char buf[MAXHEADERLEN]; + #if 0 + char buf2[MAXHEADERLEN]; +@@ -1530,10 +1530,11 @@ + if(child < 0) { + badrequest(500, "Internal Server Error", "Server Resource problem."); + } else if(child == 0) { +- const char *argv[5] = { auth_script, host, url, authorization, NULL }; ++ char *const argv[5] = { auth_script, host, url, strdup(authorization), NULL }; + + dup2(2, 1); + execve(auth_script, argv, envp); ++ free(argv[3]); + _exit(1); + } else { + int status;
signature.asc
Description: PGP signature