NuttX: fixes for printing size_t and int64_t

Added definition of PRId64 for C99 compatibility.
Used %zd for portable wat to print size_t.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-07-01 07:51:24 -07:00
parent 1e46f44123
commit 63f7995b41
3 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -174,7 +174,7 @@ decode_callback(bson_decoder_t decoder, void *private, bson_node_t node)
len = bson_decoder_data_pending(decoder);
if (len != strlen(sample_string) + 1) {
PX4_ERR("FAIL: decoder: string1 length %d wrong, expected %ld", len, strlen(sample_string) + 1);
PX4_ERR("FAIL: decoder: string1 length %d wrong, expected %zd", len, strlen(sample_string) + 1);
return 1;
}
@@ -213,7 +213,7 @@ decode_callback(bson_decoder_t decoder, void *private, bson_node_t node)
len = bson_decoder_data_pending(decoder);
if (len != sizeof(sample_data)) {
PX4_ERR("FAIL: decoder: data1 length %d, expected %lu", len, sizeof(sample_data));
PX4_ERR("FAIL: decoder: data1 length %d, expected %zu", len, sizeof(sample_data));
return 1;
}
+1 -1
View File
@@ -37,13 +37,13 @@
****************************************************************************/
#include <px4_config.h>
#include <px4_defines.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>