Skip to content

Commit

Permalink
Clean up some clang compiler warnings
Browse files Browse the repository at this point in the history
Mostly about losing precision from 64-bit unsigned long to int.
  • Loading branch information
jasonroelofs committed Jan 30, 2014
1 parent 9e3a50f commit 91a1563
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions rice/to_from_ruby.ipp
Expand Up @@ -39,7 +39,7 @@ template<>
inline
int from_ruby<int>(Rice::Object x)
{
return Rice::protect(Rice::detail::num2int, x);
return Rice::detail::num2int(x);
}

template<>
Expand Down Expand Up @@ -101,7 +101,7 @@ template<>
inline
unsigned int from_ruby<unsigned int>(Rice::Object x)
{
return Rice::protect(Rice::detail::num2uint, x);
return Rice::detail::num2uint(x);
}

template<>
Expand Down
12 changes: 6 additions & 6 deletions test/test_Data_Type.cpp
Expand Up @@ -46,15 +46,15 @@ namespace {

int process() {
std::vector<Listener*>::iterator i = mListeners.begin();
int accum = 0;
int accum = 0;
for(; i != mListeners.end(); i++) {
accum += (*i)->getValue();
}

return accum;
}

int listenerCount() { return mListeners.size(); }
size_t listenerCount() { return mListeners.size(); }

private:
std::vector<Listener*> mListeners;
Expand Down Expand Up @@ -100,7 +100,7 @@ TESTCASE(can_send_ruby_instance_back_into_rice)
* The following test SEGFAULTs right now
*/
/*
TESTCASE(no_super_in_constructor_still_works)
TESTCASE(no_super_in_constructor_still_works)
{
Module m = define_module("TestingModule");
Object handler = m.instance_eval("@handler = ListenerHandler.new");
Expand All @@ -127,14 +127,14 @@ TESTCASE(no_super_in_constructor_still_works)
* Two ways of defining if types are implicitly castable
*
* 1) operator
* 2) constructor
* 2) constructor
*/

/**
* Examples here taken from Ogre's Math library.
* This uses the constructor method of casting types.
*/
namespace
namespace
{
const int degree2Radians = (3.14 / 180.0);
const int radian2Degrees = (180.0 / 3.14);
Expand All @@ -157,7 +157,7 @@ namespace
class Radian
{
public:
explicit Radian(float r) : val_(r) {}
explicit Radian(float r) : val_(r) {}
Radian(const Degree& d) : val_(d.valueRadians()) {}

float valueRadians() const { return val_; }
Expand Down

0 comments on commit 91a1563

Please sign in to comment.