New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed is_error macro dependency (#4098) #4104
Removed is_error macro dependency (#4098) #4104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thnx for the patch! could you make sure that you use nullptr
instead of NULL
macro. i've tried to mark some places but not all in the patch
@@ -51,7 +51,7 @@ CNeuralNetwork* CNeuralNetworkFileReader::read_file(const char* file_path) | |||
{ | |||
json_object* json_network = json_object_from_file(file_path); | |||
|
|||
if (is_error(json_network)) | |||
if (json_network == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we are c++11 use nullptr
@@ -68,7 +68,7 @@ CNeuralNetwork* CNeuralNetworkFileReader::read_string(const char* str) | |||
{ | |||
json_object* json_network = json_tokener_parse(str); | |||
|
|||
if (is_error(json_network)) | |||
if (json_network == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullptr
@@ -97,7 +95,8 @@ CSerializableJsonFile::init(const char* fname) | |||
switch (m_task) { | |||
case 'r': | |||
buf = json_object_from_file((char*) fname); | |||
if (is_error(buf)) { | |||
if (buf == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullptr
@@ -219,7 +218,7 @@ CSerializableJsonFile::write_scalar_wrapped( | |||
break; | |||
} | |||
|
|||
if (is_error(m_stack_stream.back())) | |||
if (m_stack_stream.back() == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullptr
@@ -289,7 +288,7 @@ CSerializableJsonFile::write_sparse_begin_wrapped( | |||
push_object(json_object_new_object()); | |||
|
|||
json_object* buf = json_object_new_array(); | |||
if (is_error(buf)) | |||
if (buf == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullptr
@@ -319,7 +318,7 @@ CSerializableJsonFile::write_sparseentry_begin_wrapped( | |||
push_object(buf); | |||
|
|||
buf = json_object_new_int(feat_index); | |||
if (is_error(buf)) | |||
if (buf == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullptr
@@ -380,7 +379,7 @@ CSerializableJsonFile::write_sgserializable_begin_wrapped( | |||
|
|||
json_object* buf; | |||
buf = json_object_new_string(sgserializable_name); | |||
if (is_error(buf)) | |||
if (buf == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullptr
@@ -390,15 +389,15 @@ CSerializableJsonFile::write_sgserializable_begin_wrapped( | |||
string_t buf_str; | |||
TSGDataType::ptype_to_string(buf_str, generic, STRING_LEN); | |||
buf = json_object_new_string(buf_str); | |||
if (is_error(buf)) | |||
if (buf == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullptr
ede8c87
to
365ce4c
Compare
@karlnapf Yep! I have been successfully compiling and testing with |
Replaced depreciated
is_error(ptr)
macro withptr == nullptr
.