Navigation Menu

Skip to content

Commit

Permalink
further warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Oct 8, 2013
1 parent 6b69058 commit e6012a2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
17 changes: 12 additions & 5 deletions src/shogun/features/CombinedFeatures.cpp
Expand Up @@ -96,11 +96,18 @@ bool CCombinedFeatures::check_feature_obj_compatibility(CCombinedFeatures* comb_
}
else
{
SG_WARNING("number of features in combined feature objects differs (%d != %d)\n", this->get_num_feature_obj(), comb_feat->get_num_feature_obj())
SG_INFO("compare\n")
comb_feat->list_feature_objs();
SG_INFO("vs this\n")
this->list_feature_objs();
if (!comb_feat)
{
SG_WARNING("comb_feat is NULL \n");
}
else
{
SG_WARNING("number of features in combined feature objects differs (%d != %d)\n", this->get_num_feature_obj(), comb_feat->get_num_feature_obj())
SG_INFO("compare\n")
comb_feat->list_feature_objs();
SG_INFO("vs this\n")
this->list_feature_objs();
}
}

return result;
Expand Down
3 changes: 3 additions & 0 deletions src/shogun/io/SerializableHdf5Reader00.cpp
Expand Up @@ -24,6 +24,9 @@ bool
SerializableHdf5Reader00::read_scalar_wrapped(
const TSGDataType* type, void* param)
{
ASSERT(type);
ASSERT(param);

CSerializableHdf5File::type_item_t* m
= m_file->m_stack_type.back();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/io/streaming/StreamingAsciiFile.cpp
Expand Up @@ -610,6 +610,8 @@ template <class T>
void CStreamingAsciiFile::append_item(
DynArray<T>* items, char* ptr_data, char* ptr_item)
{
REQUIRE(ptr_data && ptr_item, "Data and Item to append should not be NULL\n");

size_t len=(ptr_data-ptr_item)/sizeof(char);
char* item=SG_MALLOC(char, len+1);
memset(item, 0, sizeof(char)*(len+1));
Expand Down
9 changes: 2 additions & 7 deletions src/shogun/kernel/Kernel.cpp
Expand Up @@ -97,18 +97,13 @@ void CKernel::resize_kernel_cache(KERNELCACHE_IDX size, bool regression_hack)

bool CKernel::init(CFeatures* l, CFeatures* r)
{
SG_DEBUG("entering CKernel::init(%p, %p)\n", l, r)

REQUIRE(l != NULL, "Left hand side features are NULL\n")
REQUIRE(r != NULL, "Right hand side features are NULL\n")

/* make sure that features are not deleted if same ones are used */
SG_REF(l);
SG_REF(r);

//make sure features were indeed supplied
REQUIRE(l, "CKernel::init(%p, %p): LHS features required!\n", l, r)
REQUIRE(r, "CKernel::init(%p, %p): RHS features required!\n", l, r)
REQUIRE(l, "CKernel::init(%p, %p): Left hand side features required!\n", l, r)
REQUIRE(r, "CKernel::init(%p, %p): Right hand side features required!\n", l, r)

//make sure features are compatible
ASSERT(l->get_feature_class()==r->get_feature_class())
Expand Down

0 comments on commit e6012a2

Please sign in to comment.