diff --git a/backtrace_null.cpp b/backtrace_null.cpp index f82ec4c0..8fbd55f2 100644 --- a/backtrace_null.cpp +++ b/backtrace_null.cpp @@ -6,7 +6,7 @@ using namespace std; debug::backtrace::backtrace (void): - m_frames (DEFAULT_DEPTH) + m_frames (DEFAULT_DEPTH) { ; } diff --git a/bitwise.hpp b/bitwise.hpp index 80caae3c..d77a8287 100644 --- a/bitwise.hpp +++ b/bitwise.hpp @@ -66,5 +66,5 @@ reverse (T value) { return out; } -#endif +#endif diff --git a/debug.cpp b/debug.cpp index 5a38dbd1..27755796 100644 --- a/debug.cpp +++ b/debug.cpp @@ -79,7 +79,7 @@ unreachable (void) { void unreachable (const std::string& what) { - panic (" Unreachable code executed: " + what); + panic (" Unreachable code executed: " + what); } diff --git a/except.hpp b/except.hpp index 55858a6c..73b64ea9 100644 --- a/except.hpp +++ b/except.hpp @@ -79,4 +79,4 @@ namespace util { } #endif -#endif +#endif diff --git a/exe.cpp b/exe.cpp index f40801c2..e6ee2fca 100644 --- a/exe.cpp +++ b/exe.cpp @@ -38,7 +38,6 @@ util::image_path (void) { // We can't use lstat to check the size of the link in proc, as Linux // will return 0 for most entries under proc. Instead we've got to // iterate for a correct size. - std::vector resolved (256); retry: diff --git a/float.cpp b/float.cpp index 5bc723fc..4a870b0a 100644 --- a/float.cpp +++ b/float.cpp @@ -19,7 +19,7 @@ ieee_float::ieee_float (floating_t _floating): template -ieee_float::ieee_float (const ieee_float &rhs): +ieee_float::ieee_float (const ieee_float &rhs): m_bits (rhs.m_bits) { ; } @@ -56,7 +56,7 @@ ieee_float::is_nan (void) const { template bool -ieee_float::operator==(floating_t _floating) const { +ieee_float::operator==(floating_t _floating) const { // TODO: This method really shouldn't be generated if there's no // representative native floating point type. But I'm sick of // C++'s template bullshit for tonight. @@ -79,7 +79,7 @@ ieee_float::operator==(floating_t _floating) const { //template //bool //ieee_float::almost_equal (floating_t a, -// floating_t b) { +// floating_t b) { // // Static cast to avoid integer casting warnings when using uint16_t for half // static const floating_t epsilon = static_cast (0.001); // const floating_t diff = static_cast (std::fabs (a - b)); diff --git a/guid.cpp b/guid.cpp index 3cff1fb1..551e626b 100644 --- a/guid.cpp +++ b/guid.cpp @@ -196,7 +196,7 @@ operator>> (std::istream &is, guid &g) { g.data4[5] = data4 & 0xFF; data4 >>= 8u; g.data4[6] = data4 & 0xFF; data4 >>= 8u; g.data4[7] = data4 & 0xFF; - + if (braces) is.get (); diff --git a/hash/crc.cpp b/hash/crc.cpp index 08ec88d3..b22453dc 100644 --- a/hash/crc.cpp +++ b/hash/crc.cpp @@ -39,13 +39,13 @@ crc32 (const void *restrict, size_t) { case 2: bits |= static_cast(data[1]) << 48U; case 1: bits |= static_cast(data[0]) << 56U; } - + for (size_t i = 0; i < size; ++i) { for (unsigned j = 0; j < 32; ++j) { bool mix = bits 0x7000000000000000ULL; bits <<= 1; - if (mix) + if (mix) bits ^= POLYNOMIAL << 32; } diff --git a/hash/md2.cpp b/hash/md2.cpp index 478e74b2..35d04bc2 100644 --- a/hash/md2.cpp +++ b/hash/md2.cpp @@ -134,7 +134,7 @@ MD2::transform (void) { for (size_t i = 0; i < 18; ++i) { for (size_t j = 0; j < 48; ++j) t = X[j] = X[j] ^ S[t]; - + t = (t + i) % 256; } } diff --git a/hash/md4.cpp b/hash/md4.cpp index eb70931c..0b46eea7 100644 --- a/hash/md4.cpp +++ b/hash/md4.cpp @@ -110,7 +110,7 @@ MD4::digest_t MD4::digest (void) const { digest_t d; memcpy (d.data (), ABCD.data(), sizeof (ABCD)); - return d; + return d; } @@ -130,17 +130,17 @@ MD4::transform (void) { ROUND1(D,A,B,C, 1, 7); ROUND1(C,D,A,B, 2, 11); ROUND1(B,C,D,A, 3, 19); - + ROUND1(A,B,C,D, 4, 3); ROUND1(D,A,B,C, 5, 7); ROUND1(C,D,A,B, 6, 11); ROUND1(B,C,D,A, 7, 19); - + ROUND1(A,B,C,D, 8, 3); ROUND1(D,A,B,C, 9, 7); ROUND1(C,D,A,B, 10, 11); ROUND1(B,C,D,A, 11, 19); - + ROUND1(A,B,C,D, 12, 3); ROUND1(D,A,B,C, 13, 7); ROUND1(C,D,A,B, 14, 11); diff --git a/hash/md5.cpp b/hash/md5.cpp index b50b9cd4..7c4d922a 100644 --- a/hash/md5.cpp +++ b/hash/md5.cpp @@ -39,7 +39,7 @@ G (uint32_t x, uint32_t y, uint32_t z) static inline uint32_t H (uint32_t x, uint32_t y, uint32_t z) - { return x ^ y ^ z; } + { return x ^ y ^ z; } static inline uint32_t @@ -57,19 +57,19 @@ const std::array T = { { 0xf57c0fafu, 0x4787c62au, 0xa8304613u, 0xfd469501u, 0x698098d8u, 0x8b44f7afu, 0xffff5bb1u, 0x895cd7beu, 0x6b901122u, 0xfd987193u, 0xa679438eu, 0x49b40821u, - + // Round 2 0xf61e2562u, 0xc040b340u, 0x265e5a51u, 0xe9b6c7aau, 0xd62f105du, 0x02441453u, 0xd8a1e681u, 0xe7d3fbc8u, 0x21e1cde6u, 0xc33707d6u, 0xf4d50d87u, 0x455a14edu, 0xa9e3e905u, 0xfcefa3f8u, 0x676f02d9u, 0x8d2a4c8au, - + // Round 3 0xfffa3942u, 0x8771f681u, 0x6d9d6122u, 0xfde5380cu, 0xa4beea44u, 0x4bdecfa9u, 0xf6bb4b60u, 0xbebfbc70u, 0x289b7ec6u, 0xeaa127fau, 0xd4ef3085u, 0x04881d05u, 0xd9d4d039u, 0xe6db99e5u, 0x1fa27cf8u, 0xc4ac5665u, - + // Round 4 0xf4292244u, 0x432aff97u, 0xab9423a7u, 0xfc93a039u, 0x655b59c3u, 0x8f0ccc92u, 0xffeff47du, 0x85845dd1u, @@ -243,12 +243,12 @@ MD5::transform (void) { ROUNDx(D,A,B,C, 8, 11, 34, H); ROUNDx(C,D,A,B, 11, 16, 35, H); ROUNDx(B,C,D,A, 14, 23, 36, H); - + ROUNDx(A,B,C,D, 1, 4, 37, H); ROUNDx(D,A,B,C, 4, 11, 38, H); ROUNDx(C,D,A,B, 7, 16, 39, H); ROUNDx(B,C,D,A, 10, 23, 40, H); - + ROUNDx(A,B,C,D, 13, 4, 41, H); ROUNDx(D,A,B,C, 0, 11, 42, H); ROUNDx(C,D,A,B, 3, 16, 43, H); diff --git a/hash/ripemd.cpp b/hash/ripemd.cpp index 0bdea9e3..c032a240 100644 --- a/hash/ripemd.cpp +++ b/hash/ripemd.cpp @@ -1,4 +1,4 @@ -/* +/* * This file is part of libgim * * This Source Code Form is subject to the terms of the Mozilla Public @@ -110,7 +110,7 @@ RIPEMD::transform (void) { #define R2a(a,b,c,d,e,x,s) ROUND(f2,a,b,c,d,e,0x5A827999u,x,s) #define R3a(a,b,c,d,e,x,s) ROUND(f3,a,b,c,d,e,0x6ED9EBA1u,x,s) #define R4a(a,b,c,d,e,x,s) ROUND(f4,a,b,c,d,e,0x8F1BBCDCu,x,s) - #define R5a(a,b,c,d,e,x,s) ROUND(f5,a,b,c,d,e,0xA953FD4Eu,x,s) + #define R5a(a,b,c,d,e,x,s) ROUND(f5,a,b,c,d,e,0xA953FD4Eu,x,s) #define R1b(a,b,c,d,e,x,s) ROUND(f5,a,b,c,d,e,0x50A28BE6u,x,s) #define R2b(a,b,c,d,e,x,s) ROUND(f4,a,b,c,d,e,0x5C4DD124u,x,s) @@ -236,7 +236,7 @@ RIPEMD::transform (void) { R1b(a2, b2, c2, d2, e2, 12, 6); // Right round 2 - R2b(e2, a2, b2, c2, d2, 6, 9); + R2b(e2, a2, b2, c2, d2, 6, 9); R2b(d2, e2, a2, b2, c2, 11, 13); R2b(c2, d2, e2, a2, b2, 3, 15); R2b(b2, c2, d2, e2, a2, 7, 7); @@ -351,7 +351,7 @@ RIPEMD::finish (void) { memset (d32, 0, sizeof (d32)); d32[14] = length & 0xFFFFFFFF; d32[15] = length >> 32u; - + // Do the final update size_t offset = sizeof(d08) - remaining; update (d08 + offset, remaining); diff --git a/hash/ripemd.hpp b/hash/ripemd.hpp index c78bb940..ef2b7750 100644 --- a/hash/ripemd.hpp +++ b/hash/ripemd.hpp @@ -1,4 +1,4 @@ -/* +/* * This file is part of libgim * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/hash/sha2.cpp b/hash/sha2.cpp index d1067702..3d762496 100644 --- a/hash/sha2.cpp +++ b/hash/sha2.cpp @@ -1,4 +1,4 @@ -/* +/* * This file is part of libgim * * This Source Code Form is subject to the terms of the Mozilla Public @@ -267,7 +267,7 @@ SHA256::process (void) { SHA256::digest_t SHA256::digest (void) const { digest_t out; - + auto cursor = out.begin (); for (auto i: H) { *cursor++ = (i >> 24) & 0xFF; diff --git a/hash/sha2.hpp b/hash/sha2.hpp index d5ce2327..73d21406 100644 --- a/hash/sha2.hpp +++ b/hash/sha2.hpp @@ -1,4 +1,4 @@ -/* +/* * This file is part of libgim * * This Source Code Form is subject to the terms of the Mozilla Public @@ -39,7 +39,6 @@ namespace util { std::array M; std::array C; }; - }; } } diff --git a/io.hpp b/io.hpp index 59283a6d..8333cb46 100644 --- a/io.hpp +++ b/io.hpp @@ -38,7 +38,7 @@ namespace util { ACCESS_WRITE = 1 << 1, ACCESS_READWRITE = ACCESS_READ | ACCESS_WRITE }; - + /// Reads an entire file into memory. Caller frees the result. Guarantees a /// null trailing byte. std::unique_ptr @@ -130,7 +130,6 @@ namespace util { void set_cwd (const boost::filesystem::path &); - //------------------------------------------------------------------------- class path_error : public std::runtime_error { public: diff --git a/io_posix.hpp b/io_posix.hpp index 0bb2906e..3df417f4 100644 --- a/io_posix.hpp +++ b/io_posix.hpp @@ -50,7 +50,6 @@ namespace util { const uint8_t* cbegin (void) const; const uint8_t* cend (void) const; }; - } } typedef detail::posix::mapped_file mapped_file; diff --git a/ip.hpp b/ip.hpp index 7bf2b7a5..e341814c 100644 --- a/ip.hpp +++ b/ip.hpp @@ -45,7 +45,7 @@ namespace ipv4 { static const ip ANY; }; - + typedef uint16_t port; typedef uint32_t mask; diff --git a/iterator.hpp b/iterator.hpp index f70ac5a9..22e831a3 100644 --- a/iterator.hpp +++ b/iterator.hpp @@ -36,7 +36,7 @@ class referencing_iterator { typedef typename Base::difference_type difference_type ; typedef value_type& reference ; typedef value_type* pointer; - typedef typename Base::iterator_category iterator_category; + typedef typename Base::iterator_category iterator_category; protected: Base m_base; diff --git a/json/except.hpp b/json/except.hpp index 810ddca4..8556cb26 100644 --- a/json/except.hpp +++ b/json/except.hpp @@ -13,7 +13,6 @@ * * Copyright 2015 Danny Robson */ - #ifndef __UTIL_JSON_EXCEPT_HPP #define __UTIL_JSON_EXCEPT_HPP diff --git a/lerp.hpp b/lerp.hpp index e7e2acb9..5aa81101 100644 --- a/lerp.hpp +++ b/lerp.hpp @@ -27,4 +27,4 @@ namespace lerp { double trunc (double a, double b, double weight); } -#endif +#endif diff --git a/log.cpp b/log.cpp index 4435696b..a082d5f8 100644 --- a/log.cpp +++ b/log.cpp @@ -116,7 +116,7 @@ util::detail::log (level_t level, boost::format &&format) { return; static const boost::format LEVEL_FORMAT ("%s [%s] "); - + static const size_t time_len = strlen("YYYY-mm-dd HHMMhSS") + 1; std::string time_string (time_len - 1, '\0'); time_t unix_time = time (nullptr); diff --git a/log.hpp b/log.hpp index c5e95948..a9f5f28c 100644 --- a/log.hpp +++ b/log.hpp @@ -36,7 +36,7 @@ namespace util { ALERT, /** action must be taken immediately */ CRITICAL, /** critical conditions */ ERROR, /** error conditions */ - WARNING, + WARNING, WARN = WARNING, /** warning conditions */ NOTICE, /** normal but significant condition */ INFORMATIONAL, diff --git a/maths/matrix.hpp b/maths/matrix.hpp index c9318bf3..84f1eb6b 100644 --- a/maths/matrix.hpp +++ b/maths/matrix.hpp @@ -52,7 +52,7 @@ namespace maths { double * operator [] (unsigned int row); const double * data (void) const; - + matrix& operator =(const matrix &rhs); matrix operator * (double scalar) const; matrix& operator *=(double scalar); @@ -65,7 +65,7 @@ namespace maths { bool operator ==(const matrix &rhs) const; //matrix transpose (void) const { ; } - + size_t rows (void) const; size_t columns (void) const; size_t size (void) const; @@ -107,7 +107,7 @@ namespace maths { class not_invertible : public std::runtime_error { public: - not_invertible (): + not_invertible (): std::runtime_error ("not_invertible") { ; } }; diff --git a/maths/vector.cpp b/maths/vector.cpp index cbd60130..b75c840f 100644 --- a/maths/vector.cpp +++ b/maths/vector.cpp @@ -43,7 +43,7 @@ vector::~vector (void) /* element accessors */ const double* -vector::data (void) const +vector::data (void) const { return &m_data[0]; } @@ -72,7 +72,7 @@ double vector::dot (const double *restrict A, vector vector::cross (const double *restrict A, const double *restrict B, - unsigned int size) { + unsigned int size) { CHECK_EQ (size, 3); (void)size; return vector ({ A[1] * B[2] - A[2] * B[1], diff --git a/net/address.cpp b/net/address.cpp index 6f6998be..f2ebaea0 100644 --- a/net/address.cpp +++ b/net/address.cpp @@ -53,7 +53,7 @@ const char* inet_ntop(int af, const void* src, char* dst, int size){ //----------------------------------------------------------------------------- template typename address::port_type -address::port (void) const +address::port (void) const { return m_port; } diff --git a/net/except.cpp b/net/except.cpp index 2793c13d..0ac211c5 100644 --- a/net/except.cpp +++ b/net/except.cpp @@ -121,5 +121,5 @@ net::error_code::error_code (void): template int -net::error_code::code (void) const +net::error_code::code (void) const { return CODE; } diff --git a/net/except.hpp b/net/except.hpp index d5db24ed..0fe4e66b 100644 --- a/net/except.hpp +++ b/net/except.hpp @@ -61,7 +61,7 @@ namespace net { last_code (void); }; - + template class error_code : public error { public: diff --git a/net/socket.cpp b/net/socket.cpp index d7204dc9..1558d364 100644 --- a/net/socket.cpp +++ b/net/socket.cpp @@ -168,8 +168,8 @@ net::socket::send (const uint8_t *restrict data, size_t len) { for (size_t sent = 0; sent < len; ) { ssize_t result = ::send (this->m_fd, static_cast(data + sent), len - sent, 0); - - if (result < 0) + + if (result < 0) net::error::throw_code (); sent += sign_cast (result); diff --git a/net/types.hpp b/net/types.hpp index a36440d2..ecc69fec 100644 --- a/net/types.hpp +++ b/net/types.hpp @@ -79,7 +79,7 @@ namespace net { /// Indicates the wire transmission protocol to use. - /// + /// /// This DOES NOT mean what you think it does! It is included for completeness sake, and unless /// you're doing something funky with the C API you really just want DEFAULT. /// Values retrieved from /etc/protocols diff --git a/noise/basis.cpp b/noise/basis.cpp index 1e754fff..0699cb49 100644 --- a/noise/basis.cpp +++ b/noise/basis.cpp @@ -92,7 +92,7 @@ value::bounds (void) const template -double +double value::eval (double x, double y) const { intmax_t x_int = static_cast (x); intmax_t y_int = static_cast (y); @@ -146,7 +146,7 @@ gradient::bounds (void) const template -double +double gradient::eval (double x, double y) const { intmax_t x_int = static_cast (x); intmax_t y_int = static_cast (y); diff --git a/noise/fractal.cpp b/noise/fractal.cpp index e3501825..936723db 100644 --- a/noise/fractal.cpp +++ b/noise/fractal.cpp @@ -129,7 +129,7 @@ util::noise::musgrave::eval (double x, double y) const { for (size_t i = 1; i < this->octaves; ++i) { f *= 2.0; a *= this->lacunarity; - + weight = signal * gain; weight = max (0.0, min (1.0, weight)); diff --git a/options.hpp b/options.hpp index 43b5e446..1007842b 100644 --- a/options.hpp +++ b/options.hpp @@ -155,7 +155,7 @@ namespace util { m_data (_data) { ; } - virtual void execute(void) + virtual void execute(void) { option::execute(); } virtual void execute(const std::string& data) { get_arg(data, m_data); @@ -253,7 +253,7 @@ namespace util { * * parse_args will perform minimal interpretation of the arguments to allow * dispatch to registered options. No direct actions upon any input is - * performed within this class, merely dispatch and tokenisation. + * performed within this class, merely dispatch and tokenisation. */ class processor { protected: diff --git a/platform.hpp b/platform.hpp index abdafb4c..c9ce06d0 100644 --- a/platform.hpp +++ b/platform.hpp @@ -25,7 +25,7 @@ #error "Unknown platform" #endif -// Clang needs to be checked before GCC as it pretends to be GCC +// Clang needs to be checked before GCC as it pretends to be GCC #if defined(__clang__) #define COMPILER_CLANG #elif defined(__GNUC__) diff --git a/raii.hpp b/raii.hpp index a8dc7fb7..52ad5903 100644 --- a/raii.hpp +++ b/raii.hpp @@ -36,7 +36,7 @@ namespace util { T &counter; }; - + /// Executes a function upon object destruction template struct scoped_function { diff --git a/range.cpp b/range.cpp index 0b9fd0c9..da564b1a 100644 --- a/range.cpp +++ b/range.cpp @@ -122,7 +122,7 @@ namespace util { { double pos = ::rand () / (double)(RAND_MAX); return (max - min) * pos + min; - } + } template <> float @@ -174,7 +174,7 @@ util::range::operator ==(const util::range &rhs) const /////////////////////////////////////////////////////////////////////////////// -template +template const util::range util::range::UNLIMITED (std::numeric_limits::has_infinity ? -std::numeric_limits::infinity () : std::numeric_limits::lowest (), diff --git a/range.hpp b/range.hpp index 10976f98..9b868fc6 100644 --- a/range.hpp +++ b/range.hpp @@ -70,7 +70,7 @@ namespace util { range operator- (T) const; /// Return a pseudo-random uniformly distributed value within the range. - /// There are no statistical randomness guarantees whatsoever. + /// There are no statistical randomness guarantees whatsoever. T random (void) const; bool operator ==(const range& rhs) const; diff --git a/si.hpp b/si.hpp index b11f8c83..ff4496ab 100644 --- a/si.hpp +++ b/si.hpp @@ -27,4 +27,4 @@ uintmax_t from_KiB (uintmax_t bytes); uintmax_t from_MiB (uintmax_t bytes); uintmax_t from_GiB (uintmax_t bytes); -#endif +#endif diff --git a/signal.ipp b/signal.ipp index 7549d8d3..26311758 100644 --- a/signal.ipp +++ b/signal.ipp @@ -131,7 +131,7 @@ namespace util { /// Disconnect all callbacks template class C> void - signal::clear (void) + signal::clear (void) { m_children.clear (); } diff --git a/stringid.cpp b/stringid.cpp index c5dd8e33..18a734c2 100644 --- a/stringid.cpp +++ b/stringid.cpp @@ -37,7 +37,7 @@ stringid::add (const std::string key) { id_t id = m_map.size (); m_map[key] = id; - return id; + return id; } diff --git a/test/aabb.cpp b/test/aabb.cpp index f35e9cb8..efdf8d53 100644 --- a/test/aabb.cpp +++ b/test/aabb.cpp @@ -30,7 +30,7 @@ main (int, char**) }; box.expand (2.f); - + tap.expect_eq (box, { { 1, 1 }, { 9, 9 }}, "expansion"); } diff --git a/test/colour.cpp b/test/colour.cpp index b9345ae9..f429ccc2 100644 --- a/test/colour.cpp +++ b/test/colour.cpp @@ -1,5 +1,5 @@ #include "colour.hpp" - + #include "tap.hpp" int diff --git a/test/float.cpp b/test/float.cpp index d729197e..3dd1b65a 100644 --- a/test/float.cpp +++ b/test/float.cpp @@ -40,7 +40,7 @@ test_double (void) { } -void +void test_single (void) { struct sized_test { ieee_single::uint_t bits; @@ -57,7 +57,7 @@ test_single (void) { { 0x7f800000, numeric_limits::infinity () }, { 0xff800000, -numeric_limits::infinity () }, - + { 0x3eaaaaab, 1.0f / 3.0f } }; diff --git a/test/hotp.cpp b/test/hotp.cpp index ecd2eb2d..9a50a2d2 100644 --- a/test/hotp.cpp +++ b/test/hotp.cpp @@ -1,5 +1,5 @@ #include "hash/hotp.hpp" - + #include "debug.hpp" #include "tap.hpp" #include "types.hpp" diff --git a/test/hton.cpp b/test/hton.cpp index 3f8dd91e..f1719268 100644 --- a/test/hton.cpp +++ b/test/hton.cpp @@ -14,7 +14,7 @@ #endif -int +int main (int, char **) { uint16_t u16 = 0x1358; diff --git a/test/options.cpp b/test/options.cpp index 69dd5791..2827e220 100644 --- a/test/options.cpp +++ b/test/options.cpp @@ -186,7 +186,7 @@ test_bytes_opt(void) { }; - static const char *argv[] = { + static const char *argv[] = { "./foo", "-b", NULL @@ -197,7 +197,7 @@ test_bytes_opt(void) { p->add_option(make_unique ( 'b', "bytes", "testing sizeof bytes", &size, commands[i].type, - commands[i].mod + commands[i].mod )); argv[elems (argv) - 1] = commands[i].param; diff --git a/test/pool.cpp b/test/pool.cpp index 0a1a954e..34be8629 100644 --- a/test/pool.cpp +++ b/test/pool.cpp @@ -29,7 +29,7 @@ check_unique_ptr (void) { CHECK (success); } - for (auto i = uintset.begin (); i != uintset.end (); ++i) + for (auto i = uintset.begin (); i != uintset.end (); ++i) uintpool.release (*i); uintset.clear (); @@ -39,7 +39,7 @@ check_unique_ptr (void) { CHECK (success); } - for (auto i = uintset.begin (); i != uintset.end (); ++i) + for (auto i = uintset.begin (); i != uintset.end (); ++i) uintpool.release (*i); } @@ -79,7 +79,7 @@ check_keep_value (void) { } -int +int main (int, char **) { check_single (); check_unique_ptr (); diff --git a/test/rand.cpp b/test/rand.cpp index 5e63fb90..919d9bef 100644 --- a/test/rand.cpp +++ b/test/rand.cpp @@ -15,7 +15,7 @@ void test_bool (void) { static const unsigned ITERATIONS = 8192; static const unsigned THRESHOLD = ITERATIONS / 10; - + unsigned counts[2] = { 0, 0 }; for (unsigned i = 0; i < ITERATIONS; ++i) ++counts[util::random () ? 0 : 1]; diff --git a/test/ray.cpp b/test/ray.cpp index b0d695d1..6ccc1195 100644 --- a/test/ray.cpp +++ b/test/ray.cpp @@ -37,7 +37,7 @@ test_intersect_aabb (void) void test_intersect_sphere (void) { - + ; } diff --git a/test/sha1.cpp b/test/sha1.cpp index dbcde5f9..dfa7d398 100644 --- a/test/sha1.cpp +++ b/test/sha1.cpp @@ -68,7 +68,7 @@ main (int, char**) { CHECK (obj.digest () == i.output); } - + util::TAP::logger tap; tap.skip ("convert to TAP"); } diff --git a/test/uri.cpp b/test/uri.cpp index fec2ebae..05f457aa 100644 --- a/test/uri.cpp +++ b/test/uri.cpp @@ -35,7 +35,7 @@ main (void) CHECK_EQ (i.query, u.get (util::uri::QUERY)); CHECK_EQ (i.fragment, u.get (util::uri::FRAGMENT)); } - + static const char* BAD[] = { "www.google.com.au", }; diff --git a/time.cpp b/time.cpp index d44c2bd0..f90bc1d4 100644 --- a/time.cpp +++ b/time.cpp @@ -36,7 +36,7 @@ uint64_t util::nanoseconds (void) { LARGE_INTEGER freq, count; QueryPerformanceFrequency (&freq); - QueryPerformanceCounter (&count); + QueryPerformanceCounter (&count); return ((double)count.QuadPart / freq.QuadPart) * SECOND; } @@ -131,7 +131,7 @@ util::rate_limiter::poll (void) { util::polled_duration::polled_duration (std::string name, uint64_t interval): m_name (name), m_interval (interval), - m_next (nanoseconds () + interval) + m_next (nanoseconds () + interval) { ; } diff --git a/types.hpp b/types.hpp index 05e1bbaf..b2c98c77 100644 --- a/types.hpp +++ b/types.hpp @@ -24,7 +24,7 @@ //----------------------------------------------------------------------------- /// Returns the number of elements of a statically allocated array -template +template constexpr size_t elems(const T (&)[N]) { return N; } diff --git a/zlib.cpp b/zlib.cpp index ccce1e72..ef0b2540 100644 --- a/zlib.cpp +++ b/zlib.cpp @@ -38,7 +38,7 @@ util::zlib::uncompress (uint8_t *dst, size_t dst_len, const uint8_t *src, size_t src_len) { size_t actual_len = dst_len; uLongf zlib_actual = actual_len; - + int err = ::uncompress (dst, &zlib_actual, src, src_len); error::try_code (err);