Browse files

all: Misc warning fixes for Clang

1.) image: Fix warning in TestFilter, Unused parameter

2.) fileio: Fix clang error in MIR unit tests

Clang through a:
warning: parentheses were disambiguated as a function declarator

This was fixed by added extra parentheses

3.) Math: Fix clang warning in MatrixSparseSkyline

4.) Core: Fixing warnings from -pendantic flag

Can't handle them all yet. I don't understand why our type system
knows about long long.
  • Loading branch information...
1 parent 5449f91 commit 84a6df92da95bc80dd313cc8caf77277748b71a4 Zack Moratto committed Apr 30, 2012
View
2 src/test/Helpers.h
@@ -41,7 +41,7 @@ namespace vw { namespace test { }}
namespace t = vw::test;
namespace vw {
- namespace test {
+namespace test {
using namespace ::testing;
View
2 src/vw/Core/Settings.h
@@ -44,7 +44,7 @@ namespace vw {
bool m_ ## Name ## _override; \
public: \
Type Name(); \
- void set_ ## Name(const Type& x);
+ void set_ ## Name(const Type& x)
// The default number of threads used in block processing operations.
VW_DECLARE_SETTING(default_num_threads, uint32);
View
6 src/vw/Core/TypeDeduction.h
@@ -45,13 +45,13 @@ namespace vw {
template <> \
struct TypeDeductionIndex<Type> { \
typedef boost::mpl::int_<Number> type; \
- BOOST_STATIC_CONSTANT(unsigned, value = type::value); \
- }; \
+ BOOST_STATIC_CONSTANT(uint32, value = type::value); \
+ } \
template <class T>
struct TypeDeductionIndex {
typedef unknown_type_tag type;
- BOOST_STATIC_CONSTANT(unsigned, value = type::value);
+ BOOST_STATIC_CONSTANT(uint32, value = type::value);
};
_VW_INTERNAL_TYPE_DEDUCTION( char, 100);
View
6 src/vw/FileIO/tests/TestMemoryImageResource.cxx
@@ -4,8 +4,6 @@
// All Rights Reserved.
// __END_LICENSE__
-
-#include <gtest/gtest_VW.h>
#include <test/Helpers.h>
#include <vw/FileIO/MemoryImageResource.h>
#include <vw/FileIO/DiskImageResource.h>
@@ -88,7 +86,7 @@ TEST_P(MemoryImageResourceTest, BasicWriteRead) {
}
}
// jpeg is lossy, and has trouble with noise-free images. Add some noise and blur to help it out.
- boost::rand48 gen(uint64(test::get_random_seed()));
+ boost::rand48 gen((uint64(t::get_random_seed())));
src_ += gaussian_noise_view(gen, 0.008, 0.004, src_);
src = gaussian_filter(pixel_cast<Px>(normalize(src_, 0, 255)), 2, 2, 4, 4);
vw::fill(vw::select_channel(src, 3), 255);
@@ -163,7 +161,7 @@ class MemoryOpenEXR : public ::testing::Test {
}
}
- boost::rand48 gen(uint64(test::get_random_seed()));
+ boost::rand48 gen((uint64(t::get_random_seed())));
src_ += gaussian_noise_view(gen, 0.008, 0.004, src_);
src = gaussian_filter(src_, 2, 2, 4, 4);
vw::fill(vw::select_channel(src,CompoundNumChannels<PixelT>::value - 1), 0.788);
View
2 src/vw/Image/PerPixelViews.h
@@ -289,6 +289,6 @@ namespace vw {
/// \endcond
};
-};
+}
#endif // __VW_IMAGE_PERPIXELVIEWS_H__
View
2 src/vw/Image/tests/TestFilter.cxx
@@ -17,7 +17,7 @@
using namespace vw;
template <template<class> class TraitT, class T>
-static bool bool_trait( T const& arg ) {
+static bool bool_trait( T const& /*arg*/ ) {
return TraitT<T>::value;
}
View
6 src/vw/Math/Functors.h
@@ -258,8 +258,8 @@ namespace math {
template <class FuncT> struct result<FuncT(float)> { typedef float type; };
template <class FuncT> struct result<FuncT(long double)> { typedef long double type; };
- template <class FuncT> struct result<FuncT(long)> { typedef long type; };
- template <class FuncT> struct result<FuncT(long long)> { typedef long long type; };
+ template <class FuncT> struct result<FuncT(int32)> { typedef int32 type; };
+ template <class FuncT> struct result<FuncT(int64)> { typedef int64 type; };
template <class FuncT, class ValT> struct result<FuncT(std::complex<ValT>)> { typedef ValT type; };
template <class ValT>
@@ -274,7 +274,7 @@ namespace math {
inline long double operator()( long double val ) const { return ::fabsl(val); }
#endif
#ifdef VW_HAVE_LLABS
- inline long long operator()( long long val ) const { return ::llabs(val); }
+ inline int64 operator()( int64 val ) const { return ::llabs(val); }
#endif
template <class ValT>
View
6 src/vw/Math/MatrixSparseSkyline.h
@@ -142,7 +142,7 @@ namespace math {
size_t cols() const { return m_matrix.size2(); }
/// Change the size of the matrix
- void set_size( size_t new_rows, size_t new_cols, bool preserve = false ) {
+ void set_size( size_t /*new_rows*/, size_t /*new_cols*/, bool /*preserve*/ = false ) {
vw_throw( NoImplErr() << "MatrixSparseSkyline::set_size, code has not been written yet." );
}
@@ -473,7 +473,7 @@ namespace math {
// Standard Properties
size_t size() const { return m_vector.size(); }
- void set_size( size_t new_size, bool preserve=false ) {
+ void set_size( size_t new_size, bool /*preserve*/=false ) {
VW_ASSERT( new_size==size(),
ArgumentErr() << "Cannot resize vector reorganize." );
}
@@ -554,7 +554,7 @@ namespace math {
// Standard properties
size_t rows() const { return m_matrix.rows(); }
size_t cols() const { return m_matrix.cols(); }
- void set_size( size_t new_rows, size_t new_cols, bool preserve=false ) {
+ void set_size( size_t new_rows, size_t new_cols, bool /*preserve*/=false ) {
VW_ASSERT( new_rows==rows() && new_cols==cols(),
ArgumentErr() << "Cannot resize matrix reorganize." );
}

0 comments on commit 84a6df9

Please sign in to comment.