Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shared_cpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
monticore
EmbeddedMontiArc
simulators
shared_cpp
Commits
e3f4311c
Commit
e3f4311c
authored
Jun 21, 2021
by
Jean Meurice
Browse files
Options
Downloads
Patches
Plain Diff
Fixes
parent
2936405d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
buffer.cpp
+1
-1
1 addition, 1 deletion
buffer.cpp
err_out.h
+2
-0
2 additions, 0 deletions
err_out.h
json.cpp
+2
-2
2 additions, 2 deletions
json.cpp
with
5 additions
and
3 deletions
buffer.cpp
+
1
−
1
View file @
e3f4311c
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
err_out.h
+
2
−
0
View file @
e3f4311c
...
...
@@ -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
}
...
...
This diff is collapsed.
Click to expand it.
json.cpp
+
2
−
2
View file @
e3f4311c
...
...
@@ -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
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment