[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31097 - gnunet/src/scalarproduct
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31097 - gnunet/src/scalarproduct |
Date: |
Thu, 5 Dec 2013 22:00:43 +0100 |
Author: grothoff
Date: 2013-12-05 22:00:43 +0100 (Thu, 05 Dec 2013)
New Revision: 31097
Modified:
gnunet/src/scalarproduct/gnunet-scalarproduct.c
Log:
-fixing indentation
Modified: gnunet/src/scalarproduct/gnunet-scalarproduct.c
===================================================================
--- gnunet/src/scalarproduct/gnunet-scalarproduct.c 2013-12-05 20:57:02 UTC
(rev 31096)
+++ gnunet/src/scalarproduct/gnunet-scalarproduct.c 2013-12-05 21:00:43 UTC
(rev 31097)
@@ -55,22 +55,22 @@
/**
* Option -p: destination peer identity for checking message-ids with
*/
-static char *input_peer_id = NULL;
+static char *input_peer_id;
/**
* Option -p: destination peer identity for checking message-ids with
*/
-static char *input_key = NULL;
+static char *input_key;
/**
* Option -e: vector to calculate a scalarproduct with
*/
-static char *input_elements = NULL;
+static char *input_elements;
/**
* Option -m: message-ids to calculate a scalarproduct with
*/
-static char *input_mask = NULL;
+static char *input_mask;
/**
* Global return value
@@ -179,11 +179,11 @@
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- char * begin = input_elements;
- char * end;
+ char *begin = input_elements;
+ char *end;
int32_t element;
int i;
- int32_t * elements;
+ int32_t *elements;
unsigned char * mask;
uint32_t mask_bytes;
uint32_t element_count = 0;
@@ -191,29 +191,35 @@
if (NULL == input_elements)
{
- LOG (GNUNET_ERROR_TYPE_ERROR, _ ("You must specify at least one message ID
to check!\n"));
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ _ ("You must specify at least one message ID to check!\n"));
return;
}
if (NULL == input_key)
{
- LOG (GNUNET_ERROR_TYPE_ERROR, _ ("This program needs a session identifier
for comparing vectors.\n"));
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ _ ("This program needs a session identifier for comparing
vectors.\n"));
return;
}
if (1 > strnlen (input_key, sizeof (struct GNUNET_HashCode)))
{
- LOG (GNUNET_ERROR_TYPE_ERROR, _ ("Please give a session key for
--input_key!\n"));
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ _ ("Please give a session key for --input_key!\n"));
return;
}
closure = GNUNET_new (struct ScalarProductCallbackClosure);
GNUNET_CRYPTO_hash (input_key, strlen (input_key), &closure->key);
- if (input_peer_id && GNUNET_OK != GNUNET_CRYPTO_hash_from_string
(input_peer_id,
- (struct
GNUNET_HashCode *) &closure->peer))
+ if (input_peer_id &&
+ (GNUNET_OK !=
+ GNUNET_CRYPTO_hash_from_string (input_peer_id,
+ (struct GNUNET_HashCode *)
&closure->peer)))
{
- LOG (GNUNET_ERROR_TYPE_ERROR, _ ("Tried to set initiator mode, as peer ID
was given. "
- "However, `%s' is not a valid peer
identifier.\n"),
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ _ ("Tried to set initiator mode, as peer ID was given. "
+ "However, `%s' is not a valid peer identifier.\n"),
input_peer_id);
return;
}
@@ -236,14 +242,16 @@
}
else
{
- LOG (GNUNET_ERROR_TYPE_ERROR, _ ("Could not convert `%s' to
int32_t.\n"), begin);
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ _ ("Could not convert `%s' to int32_t.\n"), begin);
return;
}
}
while (1);
if (0 == element_count)
{
- LOG (GNUNET_ERROR_TYPE_ERROR, _ ("Need elements to compute the
vectorproduct, got none.\n"));
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ _ ("Need elements to compute the vectorproduct, got none.\n"));
return;
}
@@ -294,7 +302,8 @@
}
else
{
- LOG (GNUNET_ERROR_TYPE_ERROR, _ ("Could not convert `%s' to
int32_t.\n"), begin);
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ _ ("Could not convert `%s' to integer.\n"), begin);
return;
}
@@ -308,22 +317,23 @@
for (i = 0; i <= mask_bytes; i++)
mask[i] = UCHAR_MAX; // all 1's
- if (input_peer_id && (NULL == GNUNET_SCALARPRODUCT_request (cfg,
- &closure->key,
- &closure->peer,
- elements,
element_count,
- mask, mask_bytes,
-
&requester_callback,
- (void *)
&closure)))
+ if (input_peer_id &&
+ (NULL == GNUNET_SCALARPRODUCT_request (cfg,
+ &closure->key,
+ &closure->peer,
+ elements, element_count,
+ mask, mask_bytes,
+ &requester_callback,
+ (void *) &closure)))
return;
- if ((NULL == input_peer_id) && (NULL == GNUNET_SCALARPRODUCT_response (cfg,
-
&closure->key,
-
elements, element_count,
-
&responder_callback,
- (void
*) &closure)))
+ if ((NULL == input_peer_id) &&
+ (NULL == GNUNET_SCALARPRODUCT_response (cfg,
+ &closure->key,
+ elements, element_count,
+ &responder_callback,
+ (void *) &closure)))
return;
-
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&shutdown_task,
NULL);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31097 - gnunet/src/scalarproduct,
gnunet <=