Skip to content

Commit

Permalink
Merge pull request #39 from uburuntu/master
Browse files Browse the repository at this point in the history
Some small fixes: compilation, null ptr derefence and const qualifiers
  • Loading branch information
floitsch authored Nov 23, 2016
2 parents 79fb300 + 48b5e70 commit d8d4e66
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion double-conversion/fixed-dtoa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class UInt128 {
return high_bits_ == 0 && low_bits_ == 0;
}

int BitAt(int position) {
int BitAt(int position) const {
if (position >= 64) {
return static_cast<int>(high_bits_ >> (position - 64)) & 1;
} else {
Expand Down
2 changes: 1 addition & 1 deletion double-conversion/ieee.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Double {
}

double PreviousDouble() const {
if (d64_ == (kInfinity | kSignMask)) return -Double::Infinity();
if (d64_ == (kInfinity | kSignMask)) return -Infinity();
if (Sign() < 0) {
return Double(d64_ + 1).value();
} else {
Expand Down
15 changes: 9 additions & 6 deletions test/cctest/cctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ static inline void CheckEqualsHelper(const char* file, int line,
const char* value_source,
const char* value) {
if ((expected == NULL && value != NULL) ||
(expected != NULL && value == NULL) ||
(expected != NULL && value != NULL && strcmp(expected, value) != 0)) {
(expected != NULL && value == NULL)) {
abort();
}

if ((expected != NULL && value != NULL && strcmp(expected, value) != 0)) {
printf("%s:%d:\n CHECK_EQ(%s, %s) failed\n"
"# Expected: %s\n"
"# Found: %s\n",
Expand Down Expand Up @@ -124,10 +127,10 @@ class CcTest {
static int test_count();
static CcTest* last() { return last_; }
CcTest* prev() { return prev_; }
const char* file() { return file_; }
const char* name() { return name_; }
const char* dependency() { return dependency_; }
bool enabled() { return enabled_; }
const char* file() const { return file_; }
const char* name() const { return name_; }
const char* dependency() const { return dependency_; }
bool enabled() const { return enabled_; }
private:
TestFunction* callback_;
const char* file_;
Expand Down

0 comments on commit d8d4e66

Please sign in to comment.