gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36103 - in gnunet/src: include psyc social util


From: gnunet
Subject: [GNUnet-SVN] r36103 - in gnunet/src: include psyc social util
Date: Sun, 19 Jul 2015 17:35:07 +0200

Author: amatus
Date: 2015-07-19 17:35:07 +0200 (Sun, 19 Jul 2015)
New Revision: 36103

Modified:
   gnunet/src/include/gnunet_common.h
   gnunet/src/psyc/gnunet-service-psyc.c
   gnunet/src/psyc/psyc_api.c
   gnunet/src/social/gnunet-service-social.c
   gnunet/src/social/social_api.c
   gnunet/src/util/common_endian.c
Log:
Remove this GNUNET_htonl_signed nonsense


Modified: gnunet/src/include/gnunet_common.h
===================================================================
--- gnunet/src/include/gnunet_common.h  2015-07-19 15:33:15 UTC (rev 36102)
+++ gnunet/src/include/gnunet_common.h  2015-07-19 15:35:07 UTC (rev 36103)
@@ -727,9 +727,9 @@
  * Convert double to network byte order.
  *
  * @param d
- *        The value in network byte order.
+ *        The value in host byte order.
  *
- * @return The same value in host byte order.
+ * @return The same value in network byte order.
  */
 double
 GNUNET_hton_double (double d);
@@ -747,78 +747,6 @@
 GNUNET_ntoh_double (double d);
 
 
-/**
- * Convert signed 64-bit integer to network byte order.
- *
- * @param n
- *        The value in host byte order.
- *
- * @return The same value in network byte order.
- */
-uint64_t
-GNUNET_htonll_signed (int64_t n);
-
-
-/**
- * Convert signed 64-bit integer to host byte order.
- *
- * @param n
- *        The value in network byte order.
- *
- * @return The same value in host byte order.
- */
-int64_t
-GNUNET_ntohll_signed (uint64_t n);
-
-
-/**
- * Convert signed 32-bit integer to network byte order.
- *
- * @param n
- *        The value in host byte order.
- *
- * @return The same value in network byte order.
- */
-uint32_t
-GNUNET_htonl_signed (int32_t n);
-
-
-/**
- * Convert signed 32-bit integer to host byte order.
- *
- * @param n
- *        The value in network byte order.
- *
- * @return The same value in host byte order.
- */
-int32_t
-GNUNET_ntohl_signed (uint32_t n);
-
-
-/**
- * Convert signed 16-bit integer to network byte order.
- *
- * @param n
- *        The value in host byte order.
- *
- * @return The same value in network byte order.
- */
-uint16_t
-GNUNET_htons_signed (int16_t n);
-
-
-/**
- * Convert signed 16-bit integer to host byte order.
- *
- * @param n
- *        The value in network byte order.
- *
- * @return The same value in host byte order.
- */
-int16_t
-GNUNET_ntohs_signed (uint16_t n);
-
-
 /* ************************* allocation functions ****************** */
 
 /**

Modified: gnunet/src/psyc/gnunet-service-psyc.c
===================================================================
--- gnunet/src/psyc/gnunet-service-psyc.c       2015-07-19 15:33:15 UTC (rev 
36102)
+++ gnunet/src/psyc/gnunet-service-psyc.c       2015-07-19 15:35:07 UTC (rev 
36103)
@@ -653,7 +653,7 @@
   res = GNUNET_malloc (sizeof (*res) + data_size);
   res->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE);
   res->header.size = htons (sizeof (*res) + data_size);
-  res->result_code = GNUNET_htonll_signed (result_code);
+  res->result_code = GNUNET_htonll (result_code);
   res->op_id = op_id;
   if (0 < data_size)
     memcpy (&res[1], data, data_size);
@@ -1544,7 +1544,7 @@
   struct GNUNET_PSYC_CountersResultMessage res;
   res.header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_MASTER_START_ACK);
   res.header.size = htons (sizeof (res));
-  res.result_code = GNUNET_htonl_signed (result);
+  res.result_code = htonl (result);
   res.max_message_id = GNUNET_htonll (max_message_id);
 
   if (GNUNET_OK == result || GNUNET_NO == result)
@@ -1590,7 +1590,7 @@
   struct GNUNET_PSYC_CountersResultMessage res;
   res.header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN_ACK);
   res.header.size = htons (sizeof (res));
-  res.result_code = GNUNET_htonl_signed (result);
+  res.result_code = htonl (result);
   res.max_message_id = GNUNET_htonll (max_message_id);
 
   if (GNUNET_OK == result || GNUNET_NO == result)
@@ -1680,7 +1680,7 @@
     struct GNUNET_PSYC_CountersResultMessage res;
     res.header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_MASTER_START_ACK);
     res.header.size = htons (sizeof (res));
-    res.result_code = GNUNET_htonl_signed (GNUNET_OK);
+    res.result_code = htonl (GNUNET_OK);
     res.max_message_id = GNUNET_htonll (mst->max_message_id);
 
     GNUNET_SERVER_notification_context_add (nc, client);
@@ -1791,7 +1791,7 @@
     struct GNUNET_PSYC_CountersResultMessage res;
     res.header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN_ACK);
     res.header.size = htons (sizeof (res));
-    res.result_code = GNUNET_htonl_signed (GNUNET_OK);
+    res.result_code = htonl (GNUNET_OK);
     res.max_message_id = GNUNET_htonll (chn->max_message_id);
 
     GNUNET_SERVER_notification_context_add (nc, client);
@@ -2310,7 +2310,7 @@
   res->header.size = htons (sizeof (*res) + psize);
   res->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT);
   res->op_id = op->op_id;
-  res->result_code = GNUNET_htonll_signed (GNUNET_OK);
+  res->result_code = GNUNET_htonll (GNUNET_OK);
 
   pmsg = (struct GNUNET_PSYC_MessageHeader *) &res[1];
   psyc_msg_init (pmsg, mmsg, flags | GNUNET_PSYC_MESSAGE_HISTORIC);

Modified: gnunet/src/psyc/psyc_api.c
===================================================================
--- gnunet/src/psyc/psyc_api.c  2015-07-19 15:33:15 UTC (rev 36102)
+++ gnunet/src/psyc/psyc_api.c  2015-07-19 15:35:07 UTC (rev 36103)
@@ -263,7 +263,7 @@
   uint16_t data_size = size - sizeof (*res);
   const char *data = (0 < data_size) ? (void *) &res[1] : NULL;
   GNUNET_CLIENT_MANAGER_op_result (chn->client, GNUNET_ntohll (res->op_id),
-                                   GNUNET_ntohll_signed (res->result_code),
+                                   GNUNET_ntohll (res->result_code),
                                    data, data_size);
 }
 
@@ -433,7 +433,7 @@
 
   struct GNUNET_PSYC_CountersResultMessage *
     cres = (struct GNUNET_PSYC_CountersResultMessage *) msg;
-  int32_t result = GNUNET_ntohl_signed (cres->result_code);
+  int32_t result = ntohl (cres->result_code);
   if (GNUNET_OK != result && GNUNET_NO != result)
   {
     LOG (GNUNET_ERROR_TYPE_ERROR, "Could not start master: %ld\n", result);
@@ -486,7 +486,7 @@
                                                    sizeof (struct 
GNUNET_PSYC_Channel));
   struct GNUNET_PSYC_CountersResultMessage *
     cres = (struct GNUNET_PSYC_CountersResultMessage *) msg;
-  int32_t result = GNUNET_ntohl_signed (cres->result_code);
+  int32_t result = ntohl (cres->result_code);
   if (GNUNET_YES != result && GNUNET_NO != result)
   {
     LOG (GNUNET_ERROR_TYPE_ERROR, "Could not join slave.\n");

Modified: gnunet/src/social/gnunet-service-social.c
===================================================================
--- gnunet/src/social/gnunet-service-social.c   2015-07-19 15:33:15 UTC (rev 
36102)
+++ gnunet/src/social/gnunet-service-social.c   2015-07-19 15:35:07 UTC (rev 
36103)
@@ -497,7 +497,7 @@
   res = GNUNET_malloc (sizeof (*res) + data_size);
   res->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE);
   res->header.size = htons (sizeof (*res) + data_size);
-  res->result_code = GNUNET_htonll_signed (result_code);
+  res->result_code = GNUNET_htonll (result_code);
   res->op_id = op_id;
   if (0 < data_size)
     memcpy (&res[1], data, data_size);
@@ -1558,7 +1558,7 @@
   res->header.size = htons (sizeof (*res) + size);
   res->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT);
   res->op_id = opcls->op_id;
-  res->result_code = GNUNET_htonll_signed (GNUNET_OK);
+  res->result_code = GNUNET_htonll (GNUNET_OK);
 
   memcpy (&res[1], msg, size);
 

Modified: gnunet/src/social/social_api.c
===================================================================
--- gnunet/src/social/social_api.c      2015-07-19 15:33:15 UTC (rev 36102)
+++ gnunet/src/social/social_api.c      2015-07-19 15:35:07 UTC (rev 36103)
@@ -661,7 +661,7 @@
   uint16_t data_size = size - sizeof (*res);
   const char *data = (0 < data_size) ? (const char *) &res[1] : NULL;
   GNUNET_CLIENT_MANAGER_op_result (plc->client, GNUNET_ntohll (res->op_id),
-                                   GNUNET_ntohll_signed (res->result_code),
+                                   GNUNET_ntohll (res->result_code),
                                    data, data_size);
 }
 

Modified: gnunet/src/util/common_endian.c
===================================================================
--- gnunet/src/util/common_endian.c     2015-07-19 15:33:15 UTC (rev 36102)
+++ gnunet/src/util/common_endian.c     2015-07-19 15:35:07 UTC (rev 36103)
@@ -93,47 +93,4 @@
 }
 
 
-uint64_t
-GNUNET_htonll_signed (int64_t n)
-{
-  return GNUNET_htonll (n - INT64_MIN);
-}
-
-
-int64_t
-GNUNET_ntohll_signed (uint64_t n)
-{
-  return GNUNET_ntohll (n) + INT64_MIN;
-}
-
-
-uint32_t
-GNUNET_htonl_signed (int32_t n)
-{
-  return htonl (n - INT32_MIN);
-}
-
-
-int32_t
-GNUNET_ntohl_signed (uint32_t n)
-{
-  return ntohl (n) + INT32_MIN;
-}
-
-
-uint16_t
-GNUNET_htons_signed (int16_t n)
-{
-  return htons (n - INT16_MIN);
-}
-
-
-int16_t
-GNUNET_ntohs_signed (uint16_t n)
-{
-  return ntohs (n) + INT16_MIN;
-}
-
-
-
 /* end of common_endian.c */




reply via email to

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