gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31675 - in libmicrohttpd: . src/examples src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r31675 - in libmicrohttpd: . src/examples src/microhttpd
Date: Sun, 22 Dec 2013 14:55:17 +0100

Author: grothoff
Date: 2013-12-22 14:55:17 +0100 (Sun, 22 Dec 2013)
New Revision: 31675

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/examples/demo.c
   libmicrohttpd/src/examples/digest_auth_example.c
   libmicrohttpd/src/examples/fileserver_example_external_select.c
   libmicrohttpd/src/microhttpd/daemon.c
   libmicrohttpd/src/microhttpd/digestauth.c
Log:
-work around compiler warnings

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2013-12-22 13:31:31 UTC (rev 31674)
+++ libmicrohttpd/ChangeLog     2013-12-22 13:55:17 UTC (rev 31675)
@@ -1,3 +1,6 @@
+Sun Dec 22 14:54:30 CET 2013
+       Adding a few lines to avoid warnings from picky compilers. -CG
+
 Sat Dec 21 17:26:08 CET 2013
        Fixed an issue with a missing argument in the postexample.
        Fixed issue with bogus offset increment involving sendfile

Modified: libmicrohttpd/src/examples/demo.c
===================================================================
--- libmicrohttpd/src/examples/demo.c   2013-12-22 13:31:31 UTC (rev 31674)
+++ libmicrohttpd/src/examples/demo.c   2013-12-22 13:55:17 UTC (rev 31675)
@@ -258,7 +258,7 @@
     {
       if ('.' == de->d_name[0])
        continue;
-      if (sizeof (fullname) <=
+      if (sizeof (fullname) <= (size_t)
          snprintf (fullname, sizeof (fullname),
                    "%s/%s",
                    dirname, de->d_name))
@@ -557,7 +557,7 @@
       uc->filename = strdup (fn);
     }
   if ( (0 != size) &&
-       (size != write (uc->fd, data, size)) )
+       (size != (size_t) write (uc->fd, data, size)) )
     {
       /* write failed; likely: disk full */
       fprintf (stderr,

Modified: libmicrohttpd/src/examples/digest_auth_example.c
===================================================================
--- libmicrohttpd/src/examples/digest_auth_example.c    2013-12-22 13:31:31 UTC 
(rev 31674)
+++ libmicrohttpd/src/examples/digest_auth_example.c    2013-12-22 13:55:17 UTC 
(rev 31675)
@@ -47,41 +47,41 @@
   int ret;
 
   username = MHD_digest_auth_get_username(connection);
-  if (username == NULL) 
+  if (username == NULL)
     {
-      response = MHD_create_response_from_buffer(strlen (DENIED), 
+      response = MHD_create_response_from_buffer(strlen (DENIED),
                                                 DENIED,
-                                                MHD_RESPMEM_PERSISTENT);  
+                                                MHD_RESPMEM_PERSISTENT);
       ret = MHD_queue_auth_fail_response(connection, realm,
                                         MY_OPAQUE_STR,
                                         response,
-                                        MHD_NO);    
-      MHD_destroy_response(response);  
+                                        MHD_NO);
+      MHD_destroy_response(response);
       return ret;
     }
   ret = MHD_digest_auth_check(connection, realm,
-                             username, 
-                             password, 
+                             username,
+                             password,
                              300);
   free(username);
   if ( (ret == MHD_INVALID_NONCE) ||
        (ret == MHD_NO) )
     {
-      response = MHD_create_response_from_buffer(strlen (DENIED), 
+      response = MHD_create_response_from_buffer(strlen (DENIED),
                                                 DENIED,
-                                                MHD_RESPMEM_PERSISTENT);  
-      if (NULL == response) 
+                                                MHD_RESPMEM_PERSISTENT);
+      if (NULL == response)
        return MHD_NO;
       ret = MHD_queue_auth_fail_response(connection, realm,
                                         MY_OPAQUE_STR,
                                         response,
-                                        (ret == MHD_INVALID_NONCE) ? MHD_YES : 
MHD_NO);  
-      MHD_destroy_response(response);  
+                                        (ret == MHD_INVALID_NONCE) ? MHD_YES : 
MHD_NO);
+      MHD_destroy_response(response);
       return ret;
     }
   response = MHD_create_response_from_buffer(strlen(PAGE), PAGE,
                                             MHD_RESPMEM_PERSISTENT);
-  ret = MHD_queue_response(connection, MHD_HTTP_OK, response);  
+  ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
   MHD_destroy_response(response);
   return ret;
 }
@@ -91,7 +91,7 @@
 {
   int fd;
   char rnd[8];
-  size_t len;
+  ssize_t len;
   size_t off;
   struct MHD_Daemon *d;
 

Modified: libmicrohttpd/src/examples/fileserver_example_external_select.c
===================================================================
--- libmicrohttpd/src/examples/fileserver_example_external_select.c     
2013-12-22 13:31:31 UTC (rev 31674)
+++ libmicrohttpd/src/examples/fileserver_example_external_select.c     
2013-12-22 13:55:17 UTC (rev 31675)
@@ -134,12 +134,11 @@
       if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
        break; /* fatal internal error */
       if (MHD_get_timeout (d, &mhd_timeout) == MHD_YES)
-
         {
-          if (tv.tv_sec * 1000 < mhd_timeout)
+          if (((MHD_UNSIGNED_LONG_LONG)tv.tv_sec) < mhd_timeout / 1000LL)
             {
-              tv.tv_sec = mhd_timeout / 1000;
-              tv.tv_usec = (mhd_timeout - (tv.tv_sec * 1000)) * 1000;
+              tv.tv_sec = mhd_timeout / 1000LL;
+              tv.tv_usec = (mhd_timeout - (tv.tv_sec * 1000LL)) * 1000LL;
             }
         }
       select (max + 1, &rs, &ws, &es, &tv);

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2013-12-22 13:31:31 UTC (rev 
31674)
+++ libmicrohttpd/src/microhttpd/daemon.c       2013-12-22 13:55:17 UTC (rev 
31675)
@@ -1878,6 +1878,7 @@
 #endif
 
   have_timeout = MHD_NO;
+  earliest_deadline = 0; /* avoid compiler warnings */
   for (pos = daemon->manual_timeout_head; NULL != pos; pos = pos->nextX)
     {
       if (0 != pos->connection_timeout)
@@ -2457,7 +2458,7 @@
 #endif
          return MHD_NO;
        }
-      for (i=0;i<num_events;i++)
+      for (i=0;i<(unsigned int) num_events;i++)
        {
          if (NULL == events[i].data.ptr)
            continue; /* shutdown signal! */

Modified: libmicrohttpd/src/microhttpd/digestauth.c
===================================================================
--- libmicrohttpd/src/microhttpd/digestauth.c   2013-12-22 13:31:31 UTC (rev 
31674)
+++ libmicrohttpd/src/microhttpd/digestauth.c   2013-12-22 13:55:17 UTC (rev 
31675)
@@ -258,7 +258,7 @@
            }
          else
            {
-             if (size > (q2 - q1) + 1)
+             if (size > (size_t) ((q2 - q1) + 1))
                size = (q2 - q1) + 1;
              size--;
              memcpy (dest,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]