* @param subsystem name of subsystem that created the statistic
* @param name the name of the datum
* @param value the current value
- * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
- * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
+ * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if not
+ * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
*/
static int
-stats_iterator (void *cls, const struct GNUNET_TESTBED_Peer *peer,
- const char *subsystem, const char *name,
- uint64_t value, int is_persistent)
+stats_iterator (void *cls,
+ const struct GNUNET_TESTBED_Peer *peer,
+ const char *subsystem,
+ const char *name,
+ uint64_t value,
+ int is_persistent)
{
static const char *s_sent = "# keepalives sent";
static const char *s_recv = "# keepalives received";
uint32_t i;
i = GNUNET_TESTBED_get_index (peer);
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n",
- i, subsystem, name, value);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "STATS PEER %u - %s [%s]: %llu\n",
+ i,
+ subsystem,
+ name,
+ (unsigned long long) value);
if (0 == strncmp (s_sent, name, strlen (s_sent)) && 0 == i)
ka_sent = value;
disconnect_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"gathering statistics from line %d\n",
- l);
+ (int) l);
if (NULL != ch)
{
if (NULL != th)
else
{
i++;
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "in %u ms\n", i);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "in %llu ms\n",
+ (unsigned long long) i);
data_job = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
i),
&data_task, (void *) i);
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"size %u, buf %p, data_sent %u, ack_received %u\n",
- size, buf, data_sent, ack_received);
+ (unsigned int) size,
+ buf,
+ data_sent,
+ ack_received);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ok %u, ok goal %u\n", ok, ok_goal);
GNUNET_break (ok >= ok_goal - 2);
else
data_sent++;
counter++;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, " Sent message %d size %u\n",
- counter, msg_size);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ " Sent message %u size %u\n",
+ counter,
+ (unsigned int) msg_size);
if (data_sent < TOTAL_PACKETS && SPEED == test)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Scheduling message %d\n",
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Incoming channel from %s to peer %d\n",
- GNUNET_i2s (initiator), (long) cls);
+ GNUNET_i2s (initiator),
+ (int) (long) cls);
ok++;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
if ((long) cls == peers_requested - 1)
}
else
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Unknown peer! %d\n", i);
+ "Unknown peer! %d\n",
+ (int) i);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
if (NULL != disconnect_task)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"received incoming channel on peer %d, port %u\n",
- id, port);
+ (int) id,
+ (unsigned int) port);
if (id != 2L)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
static int
-inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
+inbound_notify (void *cls,
+ const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Core provides inbound data from `%4s' %llu.\n",
- GNUNET_i2s (other), ntohs (message->size));
+ "Core provides inbound data from `%4s' %u.\n",
+ GNUNET_i2s (other),
+ (unsigned int) ntohs (message->size));
total_bytes_recv += ntohs (message->size);
return GNUNET_OK;
}
static int
-outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
+outbound_notify (void *cls,
+ const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"%u got a PUT message for key %s with %u bytes\n",
i,
- GNUNET_h2s (key), size);
+ GNUNET_h2s (key),
+ (unsigned int) size);
monitor_counter++;
}
else
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Finished download, shutting down\n",
- (unsigned long long) FILESIZE);
+ "Finished download, shutting down\n");
}
if (NULL != fn)
{
fancy);
GNUNET_free (fancy);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Finished download, shutting down\n",
- (unsigned long long) FILESIZE);
+ "Finished download, shutting down\n");
}
}
fancy);
GNUNET_free (fancy);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Finished download, shutting down\n",
- (unsigned long long) FILESIZE);
+ "Finished download, shutting down\n");
}
if (NULL != fn)
{
}
res = 0;
- len = GNUNET_GNSRECORD_records_get_size(rd_count, src);
+ len = GNUNET_GNSRECORD_records_get_size (rd_count, src);
char rd_ser[len];
- GNUNET_assert (len == GNUNET_GNSRECORD_records_serialize(rd_count, src, len, rd_ser));
+ GNUNET_assert (len ==
+ GNUNET_GNSRECORD_records_serialize (rd_count,
+ src,
+ len,
+ rd_ser));
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Serialized data len: %u\n",len);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Serialized data len: %u\n",
+ (unsigned int) len);
GNUNET_assert (rd_ser != NULL);
struct GNUNET_GNSRECORD_Data dst[rd_count];
- GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_records_deserialize (len, rd_ser, rd_count, dst));
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_GNSRECORD_records_deserialize (len,
+ rd_ser,
+ rd_count,
+ dst));
GNUNET_assert (dst != NULL);
uint16_t size = strlen (tmit->data[tmit->n]);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Transmit notify data: %u bytes available, "
- "processing fragment %u/%u (size %u).\n",
- *data_size, tmit->n + 1, tmit->data_count, size);
+ "Transmit notify data: %u bytes available, processing fragment %u/%u (size %u).\n",
+ (unsigned int) *data_size,
+ tmit->n + 1,
+ tmit->data_count,
+ size);
if (*data_size < size)
{
*data_size = 0;
const struct GNUNET_MULTICAST_MessageHeader *msg)
{
struct MemberClosure *mcls = cls;
+
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Test #%u: member_recv_message() %u/%u\n",
- test, mcls->n + 1, mcls->msgs_expected);
+ test,
+ (unsigned int) (mcls->n + 1),
+ mcls->msgs_expected);
if (++mcls->n != mcls->msgs_expected)
return;
void
-state_reset_result (void *cls, int64_t result,
- const char *err_msg, uint16_t err_msg_size)
+state_reset_result (void *cls,
+ int64_t result,
+ const char *err_msg,
+ uint16_t err_msg_size)
{
op = NULL;
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_reset_result:\t%d\n", result);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "state_reset_result:\t%d\n",
+ (int) result);
GNUNET_assert (GNUNET_OK == result);
op = GNUNET_PSYCSTORE_state_reset (h, &channel_pub_key,
{
uint16_t size = ntohs (msg->size);
uint16_t type = ntohs (msg->type);
- GNUNET_log (kind, "Message of type %d and size %u:\n", type, size);
+
+ GNUNET_log (kind,
+ "Message of type %d and size %u:\n",
+ type,
+ size);
switch (type)
{
case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE:
{
- struct GNUNET_PSYC_MessageHeader *pmsg
- = (struct GNUNET_PSYC_MessageHeader *) msg;
- GNUNET_log (kind, "\tID: %" PRIu64 "\tflags: %x" PRIu32 "\n",
- GNUNET_ntohll (pmsg->message_id), ntohl (pmsg->flags));
+ const struct GNUNET_PSYC_MessageHeader *pmsg
+ = (const struct GNUNET_PSYC_MessageHeader *) msg;
+ GNUNET_log (kind,
+ "\tID: %" PRIu64 "\tflags: %x" PRIu32 "\n",
+ GNUNET_ntohll (pmsg->message_id),
+ ntohl (pmsg->flags));
break;
}
case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD:
{
- struct GNUNET_PSYC_MessageMethod *meth
- = (struct GNUNET_PSYC_MessageMethod *) msg;
+ const struct GNUNET_PSYC_MessageMethod *meth
+ = (const struct GNUNET_PSYC_MessageMethod *) msg;
GNUNET_log (kind,
"\t%.*s\n",
(int) (size - sizeof (*meth)),
- &meth[1]);
+ (const char *) &meth[1]);
break;
}
case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MODIFIER:
{
- struct GNUNET_PSYC_MessageModifier *mod
- = (struct GNUNET_PSYC_MessageModifier *) msg;
+ const struct GNUNET_PSYC_MessageModifier *mod
+ = (const struct GNUNET_PSYC_MessageModifier *) msg;
uint16_t name_size = ntohs (mod->name_size);
char oper = ' ' < mod->oper ? mod->oper : ' ';
GNUNET_log (kind,
"\t%c%.*s\t%.*s\n",
oper,
(int) name_size,
- &mod[1],
+ (const char *) &mod[1],
(int) (size - sizeof (*mod) - name_size),
- ((char *) &mod[1]) + name_size);
+ ((const char *) &mod[1]) + name_size);
break;
}
case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MOD_CONT:
case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_DATA:
- GNUNET_log (kind, "\t%.*s\n", size - sizeof (*msg), &msg[1]);
+ GNUNET_log (kind,
+ "\t%.*s\n",
+ (int) (size - sizeof (*msg)),
+ (const char *) &msg[1]);
break;
}
}
struct GNUNET_PSYC_TransmitHandle *
GNUNET_PSYC_transmit_create (struct GNUNET_CLIENT_MANAGER_Connection *client)
{
- struct GNUNET_PSYC_TransmitHandle *tmit = GNUNET_malloc (sizeof (*tmit));
+ struct GNUNET_PSYC_TransmitHandle *tmit = GNUNET_new (struct GNUNET_PSYC_TransmitHandle);
+
tmit->client = client;
return tmit;
}
watch_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
int is_persistent)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received value `%s' `%s' %llu\n",
- subsystem, name, value);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received value `%s' `%s' %llu\n",
+ subsystem,
+ name,
+ (unsigned long long) value);
GNUNET_assert (0 == strcmp (name, "test-1"));
if ((0 == value) && (3 == ok))
{
static int
-watch_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
+watch_2 (void *cls,
+ const char *subsystem,
+ const char *name,
+ uint64_t value,
int is_persistent)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received value `%s' `%s' %llu\n",
- subsystem, name, value);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received value `%s' `%s' %llu\n",
+ subsystem,
+ name,
+ (unsigned long long) value);
GNUNET_assert (0 == strcmp (name, "test-2"));
if ((42 == value) && (1 == ok2))
}
else
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received unexpected value %llu\n", value);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Received unexpected value %llu\n",
+ (unsigned long long) value);
GNUNET_break (0);
GNUNET_SCHEDULER_cancel (shutdown_task);
GNUNET_STATISTICS_set (h2, "test-2", 42, GNUNET_NO);
shutdown_task =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &force_shutdown,
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
+ &force_shutdown,
NULL);
}
GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
"Plugin creates different address length when converting address->string->address: %u != %u\n",
(unsigned int) w->address->address_length,
- s2a_len);
+ (unsigned int) s2a_len);
}
else if (0 != memcmp (s2a, w->address->address, s2a_len))
{