Skip to content
Snippets Groups Projects
Commit e3f4311c authored by Jean Meurice's avatar Jean Meurice
Browse files

Fixes

parent 2936405d
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ int get_socket_id(const std::string &ip, int32_t max_count) {
#ifdef NO_ERR_OUT
std::cerr << "'N-to-N' IP '" << ip << "' outside of range [1:"<< (max_count) << "]. Ignoring packet." << std::endl;
#else
print_cerr("Id '%PRIi32' of 'N-to-N' IP '%s' outside of range [1:%PRIi32]. Ignoring packet.", ip.c_str(), max_count);
print_cerr("Id '%" PRIi32 "' of 'N-to-N' IP '%s' outside of range [1:%" PRIi32 "]. Ignoring packet.", ip.c_str(), max_count);
#endif
return -1;
}
......
......@@ -27,9 +27,11 @@ extern print_func ERR_OUT_print_cerr;
void ERR_OUT_set_functions(throw_func throw_error_ptr, print_func print_cout_ptr, print_func print_cerr_ptr);
#ifndef NO_ERR_OUT
void throw_error(const char *type, const char *msg_format, ...);
void print_cout(const char *msg_format, ...);
void print_cerr(const char *msg_format, ...);
#endif
#ifdef __cplusplus
}
......
......@@ -280,7 +280,7 @@ void JsonTraverser::parsing_exception(const char *msg_format, ...) {
break;
}
}
snprintf(LOCAL_BUFFER+written, LOCAL_BUFFER_SIZE-written, "\n at [Line %PRIi32] %s %.*s[>]%.*s %s", line, dots_before, before_length, context_before, after_length, pos, dots_after);
snprintf(LOCAL_BUFFER+written, LOCAL_BUFFER_SIZE-written, "\n at [Line %" PRIi32 "] %s %.*s[>]%.*s %s", line, dots_before, before_length, context_before, after_length, pos, dots_after);
ERR_OUT_throw_error("JsonParsingException",LOCAL_BUFFER);
}
......@@ -385,7 +385,7 @@ int64_t JsonTraverser::get_long() {
void JsonTraverser::expect_valid_integer(int64_t l) {
if (l > (int64_t) INT32_MAX || l < (int64_t) INT32_MIN)
parsing_exception("The int64_t '%PRIi64' doesn't fit in an int32_t", l);
parsing_exception("The int64_t '%" PRIi64 "' doesn't fit in an int32_t", l);
}
void JsonTraverser::get_value_type() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment