gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r19563 - in gnunet/src: ats hello include


From: gnunet
Subject: [GNUnet-SVN] r19563 - in gnunet/src: ats hello include
Date: Tue, 31 Jan 2012 09:25:37 +0100

Author: wachs
Date: 2012-01-31 09:25:37 +0100 (Tue, 31 Jan 2012)
New Revision: 19563

Modified:
   gnunet/src/ats/ats_api_scheduling.c
   gnunet/src/hello/address.c
   gnunet/src/include/gnunet_ats_service.h
Log:
fixing const api and add check to address


Modified: gnunet/src/ats/ats_api_scheduling.c
===================================================================
--- gnunet/src/ats/ats_api_scheduling.c 2012-01-31 08:19:58 UTC (rev 19562)
+++ gnunet/src/ats/ats_api_scheduling.c 2012-01-31 08:25:37 UTC (rev 19563)
@@ -759,7 +759,7 @@
  * @return location as GNUNET_ATS_Information
  */
 
-struct GNUNET_ATS_Information
+const struct GNUNET_ATS_Information
 GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const 
struct sockaddr * addr, socklen_t addrlen)
 {
   GNUNET_assert (sh != NULL);
@@ -868,7 +868,7 @@
 
   ats.type = htonl (GNUNET_ATS_NETWORK_TYPE);
   ats.value = htonl (type);
-  return ats;
+  return (const struct GNUNET_ATS_Information) ats;
 }
 
 /**

Modified: gnunet/src/hello/address.c
===================================================================
--- gnunet/src/hello/address.c  2012-01-31 08:19:58 UTC (rev 19562)
+++ gnunet/src/hello/address.c  2012-01-31 08:25:37 UTC (rev 19563)
@@ -46,6 +46,8 @@
   size_t slen;
   char *end;
 
+  GNUNET_assert (transport_name != NULL);
+
   slen = strlen (transport_name) + 1;
   addr =
       GNUNET_malloc (sizeof (struct GNUNET_HELLO_Address) + address_length +

Modified: gnunet/src/include/gnunet_ats_service.h
===================================================================
--- gnunet/src/include/gnunet_ats_service.h     2012-01-31 08:19:58 UTC (rev 
19562)
+++ gnunet/src/include/gnunet_ats_service.h     2012-01-31 08:25:37 UTC (rev 
19563)
@@ -542,7 +542,7 @@
  * @param addrlen address length
  * @return location as GNUNET_ATS_Information
  */
-struct GNUNET_ATS_Information
+const struct GNUNET_ATS_Information
 GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh,
                              const struct sockaddr * addr,
                              socklen_t addrlen);




reply via email to

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