Patch for implicit assumption that cyg_bool and int are interchangeable

Andrew Lunn andrew@lunn.ch
Tue Sep 23 11:40:00 GMT 2003


On Mon, Sep 22, 2003 at 03:32:52PM +0200, Eric Doenges wrote:
> I've found (and fixed) two more packages that had functions
> returning a cyg_bool declared as returning int in the prototype.

I've committed the following for the httpd package. I removed an
unused variable and updated the documentation so that its in line with
the change.

The select code is not so simple, so im hoping Nick can take a look.

    Andrew
-------------- next part --------------
Index: current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/httpd/current/ChangeLog,v
retrieving revision 1.7
diff -u -r1.7 ChangeLog
--- current/ChangeLog	14 Jun 2003 18:04:55 -0000	1.7
+++ current/ChangeLog	23 Sep 2003 11:38:03 -0000
@@ -1,3 +1,13 @@
+2003-09-23  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/httpd.c (cyg_httpd_server): Removed unused variable.
+	* doc/httpd.sgml: Updated documentation for previous change.
+
+2003-09-22  Eric Doenges  <Eric.Doenges@DynaPel.com>
+	
+        * include/httpd.h: changed prototype of cyg_httpd_send_html and
+        cyg_httpd_send_data to match implementation.
+
 2003-06-09  Nick Garnett  <nickg@balti.calivar.com>
 
 	* src/httpd.c: Fixed a problem with closing the client socket --
Index: current/doc/httpd.sgml
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/httpd/current/doc/httpd.sgml,v
retrieving revision 1.2
diff -u -r1.2 httpd.sgml
--- current/doc/httpd.sgml	12 May 2003 10:24:23 -0000	1.2
+++ current/doc/httpd.sgml	23 Sep 2003 11:38:05 -0000
@@ -434,7 +434,7 @@
 <title>Predefined Handlers</title>
 <programlisting width=72>
 
-int cyg_httpd_send_html( FILE *client, char *filename, char *request, void *arg );
+cyg_bool cyg_httpd_send_html( FILE *client, char *filename, char *request, void *arg );
 
 typedef struct
 {
@@ -444,7 +444,7 @@
 } cyg_httpd_data;
 #define CYG_HTTPD_DATA( __name, __type, __length, __data )
 
-int cyg_httpd_send_data( FILE *client, char *filename, char *request, void *arg );
+cyg_bool cyg_httpd_send_data( FILE *client, char *filename, char *request, void *arg );
 
 </programlisting>
 <para>
Index: current/include/httpd.h
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/httpd/current/include/httpd.h,v
retrieving revision 1.2
diff -u -r1.2 httpd.h
--- current/include/httpd.h	14 Feb 2003 02:27:35 -0000	1.2
+++ current/include/httpd.h	23 Sep 2003 11:38:06 -0000
@@ -92,8 +92,8 @@
 /*
  */
 
-__externC int cyg_httpd_send_html( FILE *client, char *filename,
-                                   char *request, void *arg );
+__externC cyg_bool cyg_httpd_send_html( FILE *client, char *filename,
+                                        char *request, void *arg );
 
 /* ----------------------------------------------------------------- */
 /*
@@ -106,8 +106,8 @@
     cyg_uint8   *data;
 } cyg_httpd_data;
 
-__externC int cyg_httpd_send_data( FILE *client, char *filename,
-                                   char *request, void *arg );
+__externC cyg_bool cyg_httpd_send_data( FILE *client, char *filename,
+                                        char *request, void *arg );
 
 #define CYG_HTTPD_DATA( __name, __type, __length, __data ) \
 cyg_httpd_data __name = { __type, __length, __data }
Index: current/src/httpd.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/httpd/current/src/httpd.c,v
retrieving revision 1.3
diff -u -r1.3 httpd.c
--- current/src/httpd.c	14 Jun 2003 18:04:55 -0000	1.3
+++ current/src/httpd.c	23 Sep 2003 11:38:07 -0000
@@ -265,7 +265,6 @@
 {
     do
     {
-        int err;
         int client_socket;
         struct sockaddr client_address;
         int calen = sizeof(client_address);


More information about the Ecos-patches mailing list