resolve some warnings

This commit is contained in:
James E. King III
2018-07-17 14:00:08 +00:00
parent 867cc5f0fc
commit 39f1cc0238
8 changed files with 21 additions and 12 deletions

View File

@ -39,7 +39,7 @@ int main()
{
char buf[256];
regerrorA(result, &re, buf, sizeof(buf));
printf(buf);
puts(buf);
return result;
}
assert(re.re_nsub == 0);
@ -50,7 +50,7 @@ int main()
{
char buf[256];
regerrorA(result, &re, buf, sizeof(buf));
printf(buf);
puts(buf);
regfreeA(&re);
return result;
}

View File

@ -50,7 +50,7 @@ int main()
regerror(result, &re, buf, sizeof(buf));
for(i = 0; i < 256; ++i)
nbuf[i] = (char)(buf[i]);
printf(nbuf);
puts(nbuf);
return result;
}
if(re.re_nsub != 0)
@ -66,7 +66,7 @@ int main()
regerror(result, &re, buf, sizeof(buf));
for(i = 0; i < 256; ++i)
nbuf[i] = (char)(buf[i]);
printf(nbuf);
puts(nbuf);
regfree(&re);
return result;
}

View File

@ -29,9 +29,9 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
template <int N>
int array_size(const char* (&p)[N])
size_t array_size(const char* (&p)[N])
{
for(int i = 0; i < N; ++i)
for(size_t i = 0; i < N; ++i)
if(p[i] == 0)
return i;
return N;

View File

@ -65,8 +65,8 @@ void report_unexpected_exception(const E& e, int severity, const char* file, int
}
#define BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity) \
catch(const std::exception& e) \
{ report_unexpected_exception(e, severity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); }\
catch(const std::exception& __e) \
{ report_unexpected_exception(__e, severity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); }\
catch(...)\
{ BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Exception of unknown type was thrown" << std::endl; report_severity(severity); }

View File

@ -157,22 +157,30 @@ void spot_checks()
void test(const std::vector< ::boost::uint32_t>& v)
{
typedef std::vector< ::boost::uint32_t> vector32_type;
#ifdef TEST_UTF16
typedef std::vector< ::boost::uint16_t> vector16_type;
#endif
typedef std::vector< ::boost::uint8_t> vector8_type;
#ifdef TEST_UTF16
typedef boost::u32_to_u16_iterator<vector32_type::const_iterator, ::boost::uint16_t> u32to16type;
typedef boost::u16_to_u32_iterator<vector16_type::const_iterator, ::boost::uint32_t> u16to32type;
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR) && !defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
typedef std::reverse_iterator<u32to16type> ru32to16type;
typedef std::reverse_iterator<u16to32type> ru16to32type;
#endif
#endif // TEST_UTF16
#ifdef TEST_UTF8
typedef boost::u32_to_u8_iterator<vector32_type::const_iterator, ::boost::uint8_t> u32to8type;
typedef boost::u8_to_u32_iterator<vector8_type::const_iterator, ::boost::uint32_t> u8to32type;
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR) && !defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
typedef std::reverse_iterator<u32to8type> ru32to8type;
typedef std::reverse_iterator<u8to32type> ru8to32type;
#endif
#endif // TEST_UTF8
vector8_type v8;
#ifdef TEST_UTF16
vector16_type v16;
#endif
vector32_type v32;
vector32_type::const_iterator i, j, k;