aboutsummaryrefslogtreecommitdiff
path: root/src/psycutil
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-06 15:20:10 +0000
committerChristian Grothoff <christian@grothoff.org>2016-05-06 15:20:10 +0000
commit8e325aefdaab6aae4567762bd639dfa1db3c4f15 (patch)
treee18e0515ffab51e8871dbf371750b21382691bdc /src/psycutil
parent221996eb735384bb5478819e4358d2c648a16d7b (diff)
downloadgnunet-8e325aefdaab6aae4567762bd639dfa1db3c4f15.tar.gz
gnunet-8e325aefdaab6aae4567762bd639dfa1db3c4f15.zip
fix compiler warnings
Diffstat (limited to 'src/psycutil')
-rw-r--r--src/psycutil/psyc_message.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/psycutil/psyc_message.c b/src/psycutil/psyc_message.c
index 3dba05b3f..9f0a0c7da 100644
--- a/src/psycutil/psyc_message.c
+++ b/src/psycutil/psyc_message.c
@@ -267,45 +267,54 @@ GNUNET_PSYC_log_message (enum GNUNET_ErrorType kind,
267{ 267{
268 uint16_t size = ntohs (msg->size); 268 uint16_t size = ntohs (msg->size);
269 uint16_t type = ntohs (msg->type); 269 uint16_t type = ntohs (msg->type);
270 GNUNET_log (kind, "Message of type %d and size %u:\n", type, size); 270
271 GNUNET_log (kind,
272 "Message of type %d and size %u:\n",
273 type,
274 size);
271 switch (type) 275 switch (type)
272 { 276 {
273 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE: 277 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE:
274 { 278 {
275 struct GNUNET_PSYC_MessageHeader *pmsg 279 const struct GNUNET_PSYC_MessageHeader *pmsg
276 = (struct GNUNET_PSYC_MessageHeader *) msg; 280 = (const struct GNUNET_PSYC_MessageHeader *) msg;
277 GNUNET_log (kind, "\tID: %" PRIu64 "\tflags: %x" PRIu32 "\n", 281 GNUNET_log (kind,
278 GNUNET_ntohll (pmsg->message_id), ntohl (pmsg->flags)); 282 "\tID: %" PRIu64 "\tflags: %x" PRIu32 "\n",
283 GNUNET_ntohll (pmsg->message_id),
284 ntohl (pmsg->flags));
279 break; 285 break;
280 } 286 }
281 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD: 287 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD:
282 { 288 {
283 struct GNUNET_PSYC_MessageMethod *meth 289 const struct GNUNET_PSYC_MessageMethod *meth
284 = (struct GNUNET_PSYC_MessageMethod *) msg; 290 = (const struct GNUNET_PSYC_MessageMethod *) msg;
285 GNUNET_log (kind, 291 GNUNET_log (kind,
286 "\t%.*s\n", 292 "\t%.*s\n",
287 (int) (size - sizeof (*meth)), 293 (int) (size - sizeof (*meth)),
288 &meth[1]); 294 (const char *) &meth[1]);
289 break; 295 break;
290 } 296 }
291 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MODIFIER: 297 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MODIFIER:
292 { 298 {
293 struct GNUNET_PSYC_MessageModifier *mod 299 const struct GNUNET_PSYC_MessageModifier *mod
294 = (struct GNUNET_PSYC_MessageModifier *) msg; 300 = (const struct GNUNET_PSYC_MessageModifier *) msg;
295 uint16_t name_size = ntohs (mod->name_size); 301 uint16_t name_size = ntohs (mod->name_size);
296 char oper = ' ' < mod->oper ? mod->oper : ' '; 302 char oper = ' ' < mod->oper ? mod->oper : ' ';
297 GNUNET_log (kind, 303 GNUNET_log (kind,
298 "\t%c%.*s\t%.*s\n", 304 "\t%c%.*s\t%.*s\n",
299 oper, 305 oper,
300 (int) name_size, 306 (int) name_size,
301 &mod[1], 307 (const char *) &mod[1],
302 (int) (size - sizeof (*mod) - name_size), 308 (int) (size - sizeof (*mod) - name_size),
303 ((char *) &mod[1]) + name_size); 309 ((const char *) &mod[1]) + name_size);
304 break; 310 break;
305 } 311 }
306 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MOD_CONT: 312 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MOD_CONT:
307 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_DATA: 313 case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_DATA:
308 GNUNET_log (kind, "\t%.*s\n", size - sizeof (*msg), &msg[1]); 314 GNUNET_log (kind,
315 "\t%.*s\n",
316 (int) (size - sizeof (*msg)),
317 (const char *) &msg[1]);
309 break; 318 break;
310 } 319 }
311} 320}
@@ -320,7 +329,8 @@ GNUNET_PSYC_log_message (enum GNUNET_ErrorType kind,
320struct GNUNET_PSYC_TransmitHandle * 329struct GNUNET_PSYC_TransmitHandle *
321GNUNET_PSYC_transmit_create (struct GNUNET_CLIENT_MANAGER_Connection *client) 330GNUNET_PSYC_transmit_create (struct GNUNET_CLIENT_MANAGER_Connection *client)
322{ 331{
323 struct GNUNET_PSYC_TransmitHandle *tmit = GNUNET_malloc (sizeof (*tmit)); 332 struct GNUNET_PSYC_TransmitHandle *tmit = GNUNET_new (struct GNUNET_PSYC_TransmitHandle);
333
324 tmit->client = client; 334 tmit->client = client;
325 return tmit; 335 return tmit;
326} 336}