Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
riannucci committed Nov 30, 2012
1 parent 14b3e10 commit cc53120
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/build_log.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ uint64_t MurmurHash64A(const void* key, size_t len) {
uint64_t h = seed ^ (len * m); uint64_t h = seed ^ (len * m);
const uint64_t * data = (const uint64_t *)key; const uint64_t * data = (const uint64_t *)key;
const uint64_t * end = data + (len/8); const uint64_t * end = data + (len/8);
while(data != end) { while (data != end) {
uint64_t k = *data++; uint64_t k = *data++;
k *= m; k *= m;
k ^= k >> r; k ^= k >> r;
Expand All @@ -65,7 +65,7 @@ uint64_t MurmurHash64A(const void* key, size_t len) {
h *= m; h *= m;
} }
const unsigned char* data2 = (const unsigned char*)data; const unsigned char* data2 = (const unsigned char*)data;
switch(len & 7) switch (len & 7)
{ {
case 7: h ^= uint64_t(data2[6]) << 48; case 7: h ^= uint64_t(data2[6]) << 48;
case 6: h ^= uint64_t(data2[5]) << 40; case 6: h ^= uint64_t(data2[5]) << 40;
Expand Down
12 changes: 6 additions & 6 deletions src/build_test.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ TEST_F(PlanTest, PoolsWithDepthTwo) {
"build allTheThings: cat out1 out2 out3 outb1 outb2 outb3\n" "build allTheThings: cat out1 out2 out3 outb1 outb2 outb3\n"
)); ));
// Mark all the out* nodes dirty // Mark all the out* nodes dirty
for(int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {
GetNode("out"+string(1, '1'+i))->MarkDirty(); GetNode("out" + string(1, '1' + i))->MarkDirty();
GetNode("outb"+string(1, '1'+i))->MarkDirty(); GetNode("outb" + string(1, '1' + i))->MarkDirty();
} }
GetNode("allTheThings")->MarkDirty(); GetNode("allTheThings")->MarkDirty();


Expand All @@ -252,13 +252,13 @@ TEST_F(PlanTest, PoolsWithDepthTwo) {


// Grab the first 4 edges, out1 out2 outb1 outb2 // Grab the first 4 edges, out1 out2 outb1 outb2
deque<Edge*> edges; deque<Edge*> edges;
for(int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
ASSERT_TRUE(plan_.more_to_do()); ASSERT_TRUE(plan_.more_to_do());
Edge* edge = plan_.FindWork(); Edge* edge = plan_.FindWork();
ASSERT_TRUE(edge); ASSERT_TRUE(edge);
ASSERT_EQ("in", edge->inputs_[0]->path()); ASSERT_EQ("in", edge->inputs_[0]->path());
string base_name(i < 2 ? "out" : "outb"); string base_name(i < 2 ? "out" : "outb");
ASSERT_EQ(base_name+string(1, '1'+(i%2)), edge->outputs_[0]->path()); ASSERT_EQ(base_name + string(1, '1' + (i % 2)), edge->outputs_[0]->path());
edges.push_back(edge); edges.push_back(edge);
} }


Expand Down Expand Up @@ -288,7 +288,7 @@ TEST_F(PlanTest, PoolsWithDepthTwo) {


ASSERT_FALSE(plan_.FindWork()); ASSERT_FALSE(plan_.FindWork());


for(deque<Edge*>::iterator it = edges.begin(); it != edges.end(); ++it) { for (deque<Edge*>::iterator it = edges.begin(); it != edges.end(); ++it) {
plan_.EdgeFinished(*it); plan_.EdgeFinished(*it);
} }


Expand Down
4 changes: 2 additions & 2 deletions src/hash_map.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ unsigned int MurmurHash2(const void* key, size_t len) {
const int r = 24; const int r = 24;
unsigned int h = seed ^ len; unsigned int h = seed ^ len;
const unsigned char * data = (const unsigned char *)key; const unsigned char * data = (const unsigned char *)key;
while(len >= 4) { while (len >= 4) {
unsigned int k = *(unsigned int *)data; unsigned int k = *(unsigned int *)data;
k *= m; k *= m;
k ^= k >> r; k ^= k >> r;
Expand All @@ -35,7 +35,7 @@ unsigned int MurmurHash2(const void* key, size_t len) {
data += 4; data += 4;
len -= 4; len -= 4;
} }
switch(len) { switch (len) {
case 3: h ^= data[2] << 16; case 3: h ^= data[2] << 16;
case 2: h ^= data[1] << 8; case 2: h ^= data[1] << 8;
case 1: h ^= data[0]; case 1: h ^= data[0];
Expand Down
6 changes: 3 additions & 3 deletions src/state.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ void Pool::DelayEdge(Edge* edge) {
} }


void Pool::RetrieveReadyEdges(set<Edge*>* ready_queue) { void Pool::RetrieveReadyEdges(set<Edge*>* ready_queue) {
while(!delayed_.empty()) { while (!delayed_.empty()) {
Edge* edge = delayed_.front(); Edge* edge = delayed_.front();
if(current_use_ + edge->weight() > depth_) if (current_use_ + edge->weight() > depth_)
break; break;
delayed_.pop_front(); delayed_.pop_front();
ready_queue->insert(edge); ready_queue->insert(edge);
Expand Down Expand Up @@ -198,7 +198,7 @@ void State::Dump() {
node->status_known() ? (node->dirty() ? "dirty" : "clean") node->status_known() ? (node->dirty() ? "dirty" : "clean")
: "unknown"); : "unknown");
} }
if(!pools_.empty()) { if (!pools_.empty()) {
printf("resource_pools:\n"); printf("resource_pools:\n");
for (map<string, Pool*>::const_iterator it = pools_.begin(); for (map<string, Pool*>::const_iterator it = pools_.begin();
it != pools_.end(); ++it) it != pools_.end(); ++it)
Expand Down

0 comments on commit cc53120

Please sign in to comment.