summaryrefslogtreecommitdiff
path: root/src/conversation
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-06 15:24:26 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-06 15:24:26 +0000
commit3d7bae58c4b9b128e6000a2fe1fe65595235bb14 (patch)
treed50cfa569c5d447da5663333e61964c47ac09f73 /src/conversation
parent6cef8fea0c3b6756870786ebc4db0588373c8f65 (diff)
misc fixes
Diffstat (limited to 'src/conversation')
-rw-r--r--src/conversation/conversation.h8
-rw-r--r--src/conversation/conversation_api.c2
-rw-r--r--src/conversation/gnunet-service-conversation.c4
3 files changed, 11 insertions, 3 deletions
diff --git a/src/conversation/conversation.h b/src/conversation/conversation.h
index aaeed1df3..1bd358e78 100644
--- a/src/conversation/conversation.h
+++ b/src/conversation/conversation.h
@@ -40,6 +40,14 @@ extern "C"
/**
+ * Highest bit in a 32-bit unsigned integer,
+ * bit set if we are making an outgoing call,
+ * bit unset for local lines.
+ */
+#define HIGH_BIT ((uint32_t) (1LL << 31))
+
+
+/**
* Message to transmit the audio (between client and helpers).
*/
struct AudioMessage
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c
index 730cf1c70..e3bab295e 100644
--- a/src/conversation/conversation_api.c
+++ b/src/conversation/conversation_api.c
@@ -609,7 +609,7 @@ GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
"LINE");
return NULL;
}
- if (line >= (1 << 31))
+ if (line >= HIGH_BIT)
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
"CONVERSATION",
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
index 425f0a3c2..3b2237229 100644
--- a/src/conversation/gnunet-service-conversation.c
+++ b/src/conversation/gnunet-service-conversation.c
@@ -285,7 +285,7 @@ handle_client_register_message (void *cls,
GNUNET_CONTAINER_DLL_insert (lines_head,
lines_tail,
line);
- line->local_line = ntohl (msg->line) & (~ (1 << 31));
+ line->local_line = ntohl (msg->line) & (~ HIGH_BIT);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@ -703,7 +703,7 @@ handle_client_call_message (void *cls,
}
line = GNUNET_new (struct Line);
line->client = client;
- line->local_line = (local_line_cnt++) | (1 << 31);
+ line->local_line = (local_line_cnt++) | HIGH_BIT;
GNUNET_SERVER_client_set_user_context (client, line);
GNUNET_SERVER_notification_context_add (nc, client);
GNUNET_CONTAINER_DLL_insert (lines_head,