fix(style): fix warnings produced by cpplint.py, disable sizeof(type) warning

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-10-16 17:04:39 -07:00
parent 105f55c68b
commit 1097bbfb22
4 changed files with 8 additions and 8 deletions

View file

@ -3534,12 +3534,13 @@ def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
if not match:
return False
# Disabled by Leonardo de Moura, 2013/10/16
# e.g., sizeof(int)
sizeof_match = Match(r'.*sizeof\s*$', line[0:match.start(1) - 1])
if sizeof_match:
error(filename, linenum, 'runtime/sizeof', 1,
'Using sizeof(type). Use sizeof(varname) instead if possible')
return True
# sizeof_match = Match(r'.*sizeof\s*$', line[0:match.start(1) - 1])
# if sizeof_match:
# error(filename, linenum, 'runtime/sizeof', 1,
# 'Using sizeof(type). Use sizeof(varname) instead if possible')
# return True
# operator++(int) and operator--(int)
if (line[0:match.start(1) - 1].endswith(' operator++') or

View file

@ -43,7 +43,6 @@ static void tst1() {
std::cout << "exp(d, UP ) = |" << exp(d, MPFR_RNDU) << "|" << std::endl;
std::cout << "exp(d, NEAR) = |" << exp(d, MPFR_RNDN) << "|" << std::endl;
std::cout << "exp(d, DOWN) = |" << exp(d, MPFR_RNDD) << "|" << std::endl;
}
static void tst2() {

View file

@ -24,7 +24,7 @@ void tst_num(T const & a) {
}
static void tst1() {
tst_num(mpq(1,2));
tst_num(mpq(1, 2));
tst_num(mpq(0));
tst_num(mpz(3));
tst_num(mpz(0));

View file

@ -6,5 +6,5 @@ Author: Leonardo de Moura
*/
namespace lean {
typedef unsigned long long uint64;
static_assert(sizeof(uint64) == 8, "unexpected uint64 size");
static_assert(sizeof(uint64 ) == 8, "unexpected uint64 size");
}