control: tags -1 patch upstream patches attached to this bug.
G.
commit 38e580d6845351de258d1dded693321c7d94aa40 Author: Björn Esser <bjoern.es...@gmail.com> Date: Fri Apr 24 13:57:00 2015 +0100 replace obsolete `json_object_object_get` with `json_object_object_get_ex` diff --git a/src/shogun/io/SerializableJsonFile.cpp b/src/shogun/io/SerializableJsonFile.cpp index 1596e2adb..2d8418f57 100644 --- a/src/shogun/io/SerializableJsonFile.cpp +++ b/src/shogun/io/SerializableJsonFile.cpp @@ -41,8 +41,10 @@ CSerializableJsonFile::new_reader(char* dest_version, size_t n) const char* ftype; json_object* buf; - if ((buf = json_object_object_get( - m_stack_stream.back(), STR_KEY_FILETYPE)) == NULL + bool success = json_object_object_get_ex( + m_stack_stream.back(), STR_KEY_FILETYPE, &buf); + + if (!success || buf == NULL || is_error(buf) || (ftype = json_object_get_string(buf)) == NULL) return NULL; @@ -71,18 +73,17 @@ bool CSerializableJsonFile::get_object_any( json_object** dest, json_object* src, const char* key) { - *dest = json_object_object_get(src, key); - - return !is_error(*dest); + return json_object_object_get_ex(src, key, & *dest); } bool CSerializableJsonFile::get_object(json_object** dest, json_object* src, const char* key, json_type t) { - *dest = json_object_object_get(src, key); + bool success = true ; + success = json_object_object_get_ex(src, key, & *dest); - return *dest != NULL && !is_error(*dest) + return success && *dest != NULL && !is_error(*dest) && json_object_is_type(*dest, t); }
commit 365ce4c4c700736d2eec8ba6c975327a5ac2cd9b Author: Andrew Wildman <a...@uw.edu> Date: Mon Jan 22 22:56:29 2018 -0800 Removed is_error macro dependency (#4098) Index: shogun-3.2.0/src/shogun/io/SerializableJsonFile.cpp =================================================================== --- shogun-3.2.0.orig/src/shogun/io/SerializableJsonFile.cpp +++ shogun-3.2.0/src/shogun/io/SerializableJsonFile.cpp @@ -45,7 +45,6 @@ m_stack_stream.back(), STR_KEY_FILETYPE, &buf); if (!success || buf == NULL - || is_error(buf) || (ftype = json_object_get_string(buf)) == NULL) return NULL; @@ -80,11 +79,10 @@ CSerializableJsonFile::get_object(json_object** dest, json_object* src, const char* key, json_type t) { - bool success = true ; - success = json_object_object_get_ex(src, key, & *dest); + bool success = true; + success = json_object_object_get_ex(src, key, &*dest); - return success && *dest != NULL && !is_error(*dest) - && json_object_is_type(*dest, t); + return success && *dest != nullptr && json_object_is_type(*dest, t); } void @@ -100,7 +98,8 @@ switch (m_task) { case 'r': buf = json_object_from_file((char*) fname); - if (is_error(buf)) { + if (buf == nullptr) + { SG_ERROR("Could not open file `%s' for reading!\n", fname); return; @@ -204,7 +203,7 @@ break; } - if (is_error(m_stack_stream.back())) + if (m_stack_stream.back() == nullptr) return false; return true; @@ -274,7 +273,7 @@ push_object(json_object_new_object()); json_object* buf = json_object_new_array(); - if (is_error(buf)) + if (buf == nullptr) return false; json_object_object_add(m_stack_stream.back(), @@ -304,7 +303,7 @@ push_object(buf); buf = json_object_new_int(feat_index); - if (is_error(buf)) + if (buf == nullptr) return false; json_object_object_add(m_stack_stream.back(), @@ -365,7 +364,7 @@ json_object* buf; buf = json_object_new_string(sgserializable_name); - if (is_error(buf)) + if (buf == nullptr) return false; json_object_object_add(m_stack_stream.back(), @@ -375,7 +374,7 @@ 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 == nullptr) return false; json_object_object_add(m_stack_stream.back(), @@ -383,7 +382,7 @@ } buf = json_object_new_object(); - if (is_error(buf)) + if (buf == nullptr) return false; json_object_object_add(m_stack_stream.back(), STR_KEY_INSTANCE, buf); @@ -408,7 +407,7 @@ const TSGDataType* type, const char* name, const char* prefix) { json_object* buf = json_object_new_object(); - if (is_error(buf)) + if (buf == nullptr) return false; json_object_object_add(m_stack_stream.back(), name, buf); @@ -417,7 +416,7 @@ string_t str_buf; type->to_string(str_buf, STRING_LEN); buf = json_object_new_string(str_buf); - if (is_error(buf)) + if (buf == nullptr) return false; json_object_object_add(m_stack_stream.back(), STR_KEY_TYPE, buf); Index: shogun-3.2.0/src/shogun/io/SerializableJsonReader00.cpp =================================================================== --- shogun-3.2.0.orig/src/shogun/io/SerializableJsonReader00.cpp +++ shogun-3.2.0/src/shogun/io/SerializableJsonReader00.cpp @@ -155,7 +155,8 @@ json_object* m = m_file->m_stack_stream.back(); json_object* buf = json_object_array_get_idx(m, y); - if (is_error(buf)) return false; + if (buf == nullptr) + return false; m_file->push_object(buf); return true; @@ -203,7 +204,8 @@ json_object* buf_obj = json_object_array_get_idx(m, y); - if (is_error(buf_obj)) return false; + if (buf_obj == nullptr) + return false; if (!json_object_is_type(buf_obj, json_type_object)) return false; json_object* buf;
disable_sse.diff eigen3.3.patch 38e580d6845351de258d1dded693321c7d94aa40.patch 365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch