Skip to content
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

Merged

Conversation

awild82
Copy link
Contributor

@awild82 awild82 commented Jan 23, 2018

Replaced depreciated is_error(ptr) macro with ptr == nullptr.

Copy link
Member

@vigsterkr vigsterkr left a 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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nullptr

@karlnapf
Copy link
Member

@awild82 just asking: this solves the problem in #4098 for you?

@awild82
Copy link
Contributor Author

awild82 commented Jan 23, 2018

@karlnapf Yep! I have been successfully compiling and testing with -DENABLE_JSON=ON.

@vigsterkr vigsterkr merged commit 9540a1d into shogun-toolbox:develop Jan 23, 2018
@awild82 awild82 deleted the feature/update_json-c-0.13 branch January 23, 2018 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants