Skip to content

Commit

Permalink
+ Fix warnings due to unused variables (used only in asserts) using _…
Browse files Browse the repository at this point in the history
…UNUSED macro

+ Comment out few unused variables
  • Loading branch information
Joy Arulraj committed Sep 7, 2013
1 parent 755beb3 commit b6714a9
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 6 deletions.
5 changes: 4 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@
CTX.CPPFLAGS += " -Wno-ignored-qualifiers -fno-strict-aliasing"

# linker flags
CTX.LDFLAGS = """-g3 -rdynamic -ldl"""
CTX.LDFLAGS = """-g3 -ldl"""
# Done by default on Darwin -- unrecognized option for the linker on Darwin
if CTX.PLATFORM == "Linux":
CTX.LDFLAGS +=" -rdynamic"
if CTX.COVERAGE:
CTX.LDFLAGS += " -ftest-coverage -fprofile-arcs"
# for the google perftools profiler and the recommended stack unwinder
Expand Down
2 changes: 1 addition & 1 deletion src/ee/execution/VoltDBEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ bool VoltDBEngine::rebuildTableCollections() {
// need to re-map all the table ids.
getStatsManager().unregisterStatsSource(STATISTICS_SELECTOR_TYPE_TABLE);

map<string, catalog::Table*>::const_iterator it = m_database->tables().begin();
//map<string, catalog::Table*>::const_iterator it = m_database->tables().begin();
map<string, CatalogDelegate*>::iterator cdIt = m_catalogDelegates.begin();

// walk the table delegates and update local table collections
Expand Down
4 changes: 2 additions & 2 deletions src/ee/executors/abstractexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ bool AbstractExecutor::init(VoltDBEngine *engine, const catalog::Database* catal

AbstractScanPlanNode *scan_node = dynamic_cast<AbstractScanPlanNode*>(abstract_node);
AbstractOperationPlanNode *oper_node = dynamic_cast<AbstractOperationPlanNode*>(abstract_node);
bool requires_target_table = false;
//bool requires_target_table = false;
if (scan_node || oper_node) {
requires_target_table = true;
//requires_target_table = true;
Table* target_table = NULL;

std::string targetTableName;
Expand Down
8 changes: 8 additions & 0 deletions src/ee/plannodes/PlanColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "PlanColumn.h"

#define _UNUSED(x) ((void)x)

using namespace json_spirit;
using namespace std;
using namespace voltdb;
Expand All @@ -28,6 +30,12 @@ PlanColumn::PlanColumn(Object& colObject) : m_colObject(colObject)
bool contains_type = false;
bool contains_size = false;
bool contains_input_column_name = false;

_UNUSED (contains_guid);
_UNUSED (contains_name);
_UNUSED (contains_type);
_UNUSED (contains_size);

for (int attr = 0; attr < m_colObject.size(); attr++)
{
if (m_colObject[attr].name_ == "GUID")
Expand Down
8 changes: 8 additions & 0 deletions src/ee/plannodes/aggregatenode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#include <sstream>
#include <stdexcept>

#define _UNUSED(x) ((void)x)

using namespace json_spirit;
using namespace std;
using namespace voltdb;
Expand Down Expand Up @@ -319,6 +321,12 @@ AggregatePlanNode::loadFromJSONObject(Object &obj,
bool containsName = false;
bool containsGuid = false;
bool containsOutputColumn = false;

_UNUSED (containsType);
_UNUSED (containsName);
_UNUSED (containsGuid);
_UNUSED (containsOutputColumn);

for (int zz = 0; zz < aggregateColumn.size(); zz++)
{
if (aggregateColumn[zz].name_ == "AGGREGATE_TYPE")
Expand Down
6 changes: 6 additions & 0 deletions src/ee/plannodes/orderbynode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#include <stdexcept>
#include <string>

#define _UNUSED(x) ((void)x)

using namespace std;
using namespace voltdb;

Expand Down Expand Up @@ -172,6 +174,10 @@ OrderByPlanNode::loadFromJSONObject(json_spirit::Object& obj,
{
json_spirit::Object sortColumn = sortColumnsArray[ii].get_obj();
bool hasName = false, hasDirection = false;

_UNUSED (hasName);
_UNUSED (hasDirection);

for (int zz = 0; zz < sortColumn.size(); zz++)
{
if (sortColumn[zz].name_ == "COLUMN_NAME")
Expand Down
4 changes: 2 additions & 2 deletions src/ee/storage/persistenttable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ bool PersistentTable::evictBlockToDisk(const long block_size, int num_blocks) {
// int64_t origEvictedTableSize = m_evictedTable->activeTupleCount();
#endif

size_t current_tuple_start_position;
//size_t current_tuple_start_position;

int32_t num_tuples_evicted = 0;
out.writeInt(num_tuples_evicted); // reserve first 4 bytes in buffer for number of tuples in block
Expand All @@ -236,7 +236,7 @@ bool PersistentTable::evictBlockToDisk(const long block_size, int num_blocks) {
tuple_length = tuple.tupleLength();
}

current_tuple_start_position = out.position();
//current_tuple_start_position = out.position();

// remove the tuple from the eviction chain
eviction_manager->removeTuple(this, &tuple);
Expand Down

0 comments on commit b6714a9

Please sign in to comment.