Fix errors and warnings found on VisualStudio 2005
This commit is contained in:
@@ -538,13 +538,23 @@ namespace chaiscript
|
||||
|
||||
BOOST_ASSERT(sizeof(long) == sizeof(boost::uint64_t) || sizeof(long) * 2 == sizeof(boost::uint64_t));
|
||||
|
||||
if ((sizeof(long) < sizeof(boost::uint64_t))
|
||||
&& (u >> ((sizeof(uint64_t) - sizeof(long)) * 8)) > 0)
|
||||
#ifdef BOOST_MSVC
|
||||
//Thank you MSVC, yes we know that a constant value is being used in the if
|
||||
// statment in this compiler / architecture
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
|
||||
if ( sizeof(long) < sizeof(boost::uint64_t) && (u >> ((sizeof(boost::uint64_t) - sizeof(long)) * 8)) > 0)
|
||||
{
|
||||
//requires something bigger than long
|
||||
longlong_ = true;
|
||||
}
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
if (longlong_)
|
||||
{
|
||||
size = sizeof(boost::int64_t) * 8;
|
||||
@@ -631,7 +641,7 @@ namespace chaiscript
|
||||
}
|
||||
if (Binary_()) {
|
||||
std::string match(start, m_input_pos);
|
||||
int64_t temp_int = 0;
|
||||
boost::int64_t temp_int = 0;
|
||||
size_t pos = 0, end = match.length();
|
||||
|
||||
while ((pos < end) && (pos < (2 + sizeof(int) * 8))) {
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <list>
|
||||
#include <algorithm>
|
||||
|
||||
#include <chaiscript/chaiscript.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
@@ -67,7 +68,7 @@ int main()
|
||||
std::vector<boost::shared_ptr<boost::thread> > threads;
|
||||
|
||||
// Ensure at least two, but say only 7 on an 8 core processor
|
||||
int num_threads = std::max(boost::thread::hardware_concurrency() - 1, 2u);
|
||||
int num_threads = std::max<unsigned int>(boost::thread::hardware_concurrency() - 1, 2u);
|
||||
|
||||
for (int i = 0; i < num_threads; ++i)
|
||||
{
|
||||
|
Reference in New Issue
Block a user