Skip to content

Commit

Permalink
Replaced some more uint8_t, where it may concern a body-literal index…
Browse files Browse the repository at this point in the history
…/count
  • Loading branch information
CerielJacobs committed Apr 27, 2021
1 parent b2de178 commit 386f5f8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions include/vlog/concepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class Rule {
return heads[0];
}

Literal getHead(uint8_t pos) const {
Literal getHead(unsigned pos) const {
return heads[pos];
}

Expand All @@ -416,8 +416,8 @@ class Rule {
return body;
}

uint8_t getNIDBPredicates() const {
uint8_t i = 0;
unsigned getNIDBPredicates() const {
unsigned i = 0;
for (std::vector<Literal>::const_iterator itr = body.begin(); itr != body.end();
++itr) {
if (itr->getPredicate().getType() == IDB) {
Expand All @@ -427,8 +427,8 @@ class Rule {
return i;
}

uint8_t getNIDBNotMagicPredicates() const {
uint8_t i = 0;
unsigned getNIDBNotMagicPredicates() const {
unsigned i = 0;
for (std::vector<Literal>::const_iterator itr = body.begin(); itr != body.end();
++itr) {
if (itr->getPredicate().getType() == IDB && !itr->getPredicate().isMagic()) {
Expand All @@ -438,8 +438,8 @@ class Rule {
return i;
}

uint8_t getNEDBPredicates() const {
uint8_t i = 0;
unsigned getNEDBPredicates() const {
unsigned i = 0;
for (std::vector<Literal>::const_iterator itr = body.begin(); itr != body.end();
++itr) {
if (itr->getPredicate().getType() == EDB) {
Expand All @@ -449,8 +449,8 @@ class Rule {
return i;
}

uint8_t numberOfNegatedLiteralsInBody() {
uint8_t result = 0;
unsigned numberOfNegatedLiteralsInBody() {
unsigned result = 0;
for (std::vector<Literal>::const_iterator itr = getBody().begin();
itr != getBody().end(); ++itr) {
if (itr->isNegated()){
Expand Down
12 changes: 6 additions & 6 deletions include/vlog/fctable.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ struct FCBlock {
std::shared_ptr<const FCInternalTable> table;

Literal query;
uint8_t posQueryInRule;
const RuleExecutionDetails *rule;
const uint8_t ruleExecOrder;
unsigned posQueryInRule;
const unsigned ruleExecOrder;

bool isCompleted;

FCBlock(size_t iteration, std::shared_ptr<const FCInternalTable> table,
Literal query, uint8_t posQueryInRule, const RuleExecutionDetails *rule,
const uint8_t ruleExecOrder, bool isCompleted) : iteration(iteration),
Literal query, unsigned posQueryInRule, const RuleExecutionDetails *rule,
const unsigned ruleExecOrder, bool isCompleted) : iteration(iteration),
table(table), query(query), posQueryInRule(posQueryInRule),
rule(rule), ruleExecOrder(ruleExecOrder),
isCompleted(isCompleted) {
Expand Down Expand Up @@ -153,8 +153,8 @@ class FCTable {
void addBlock(FCBlock block);

bool add(std::shared_ptr<const FCInternalTable> t, const Literal &literal,
const uint8_t posLiteralInRule, const RuleExecutionDetails *detailsRule,
const uint8_t ruleExecOrder,
const unsigned posLiteralInRule, const RuleExecutionDetails *detailsRule,
const unsigned ruleExecOrder,
const size_t iteration, const bool isCompleted, int nthreads);

int nBlocks() {
Expand Down
6 changes: 3 additions & 3 deletions src/vlog/forward/fctable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ std::shared_ptr<const FCTable> FCTable::filter(const Literal &literal,
uint8_t nVarsToCopy = 0;
uint8_t posVarsToCopy[256];

for (int i = 0; i < (uint8_t) literal.getTupleSize(); ++i) {
for (int i = 0; i < literal.getTupleSize(); ++i) {
VTerm t = literal.getTermAtPos(i);
if (!t.isVariable()) {
posConstantsToFilter[nConstantsToFilter] = i;
Expand Down Expand Up @@ -363,9 +363,9 @@ std::shared_ptr<const Segment> FCTable::retainFrom(

bool FCTable::add(std::shared_ptr<const FCInternalTable> t,
const Literal &literal,
const uint8_t posLiteralInRule,
const unsigned posLiteralInRule,
const RuleExecutionDetails *rule,
const uint8_t ruleExecOrder,
const unsigned ruleExecOrder,
const size_t iteration, const bool isCompleted,
int nthreads) {
assert(t->getRowSize() == this->getSizeRow());
Expand Down

0 comments on commit 386f5f8

Please sign in to comment.