Skip to content

Commit

Permalink
Minor tweaks to avoid compile-time warnings.
Browse files Browse the repository at this point in the history
Initialize certain local variables for the benefit of compilers that
don't see `assert' as non-returning.  Add a file-ending newline where
one was missing.
  • Loading branch information
eeide committed Nov 22, 2011
1 parent ee7a170 commit dd96f02
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/AbsRndNumGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ AbsRndNumGenerator::~AbsRndNumGenerator()
AbsRndNumGenerator*
AbsRndNumGenerator::make_rndnum_generator(RNDNUM_GENERATOR impl, const unsigned long seed)
{
AbsRndNumGenerator *rImpl;
AbsRndNumGenerator *rImpl = 0;

AbsRndNumGenerator::seedrand(seed);
switch (impl) {
Expand Down
4 changes: 2 additions & 2 deletions src/Probabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,8 @@ bool
Probabilities::parse_line(std::string &error_msg, string &line)
{
char c = StringUtils::first_nonspace_char(line);
bool rv;
bool is_equal;
bool rv = false;
bool is_equal = false;
if (c == '\0') {
assert("parse empty line, cannot happen!\n" && 0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ Type::get_bitfield_length(int length_flag)
{
int max_length = CGOptions::int_size() * 8;
assert(max_length > 0);
int length;
int length = 0;
switch (length_flag) {
case ZERO_BITFIELD:
length = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/VectorFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ VectorFilter::lookup(int v) const
if (!this->valid_filter() || ptable == NULL)
return v;
return v = ptable->rnd_num_to_key(v);
}
}

0 comments on commit dd96f02

Please sign in to comment.