Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix literal and identifier spacing as dictated by C++11 #385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void display::display_realtime_stats(const file_data_hasher_t *fdht, const hash_

ss << mb_read << "MB of " << fdht->stat_megs() << "MB done, ";
char msg[64];
snprintf(msg,sizeof(msg),"%02"PRIu64":%02"PRIu64":%02"PRIu64" left", hour, min, seconds);
snprintf(msg,sizeof(msg),"%02" PRIu64 ":%02" PRIu64 ":%02" PRIu64 " left", hour, min, seconds);
ss << msg;
}
ss << "\r";
Expand Down Expand Up @@ -424,14 +424,14 @@ void display::display_audit_results()

if (opt_verbose) {
if(opt_verbose >= MORE_VERBOSE){
status(" Input files examined: %"PRIu64, this->match.total);
status(" Known files expecting: %"PRIu64, this->match.expect);
status(" Input files examined: %" PRIu64, this->match.total);
status(" Known files expecting: %" PRIu64, this->match.expect);
}
status(" Files matched: %"PRIu64, this->match.exact);
status("Files partially matched: %"PRIu64, this->match.partial);
status(" Files moved: %"PRIu64, this->match.moved);
status(" New files found: %"PRIu64, this->match.unknown);
status(" Known files not found: %"PRIu64, this->match.unused);
status(" Files matched: %" PRIu64, this->match.exact);
status("Files partially matched: %" PRIu64, this->match.partial);
status(" Files moved: %" PRIu64, this->match.moved);
status(" New files found: %" PRIu64, this->match.unknown);
status(" Known files not found: %" PRIu64, this->match.unused);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ int state::parse_encase_file(const char *fn, FILE *handle,uint32_t expected_hash

// Users expect the line numbers to start at one, not zero.
if ((!ocb.opt_silent) || (mode_warn_only)) {
ocb.error("%s: No hash found in line %"PRIu32, fn, count + 1);
ocb.error("%s: No hash found in line %" PRIu32, fn, count + 1);
ocb.error("%s: %s", fn, strerror(errno));
return status_t::STATUS_USER_ERROR;
}
Expand Down Expand Up @@ -542,7 +542,7 @@ int state::parse_encase_file(const char *fn, FILE *handle,uint32_t expected_hash
}

if (expected_hashes != count){
ocb.error("%s: Expecting %"PRIu32" hashes, found %"PRIu32"\n",
ocb.error("%s: Expecting %" PRIu32 " hashes, found %" PRIu32 "\n",
fn, expected_hashes, count);
}
return status_t::status_ok;
Expand Down
2 changes: 1 addition & 1 deletion src/hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ bool file_data_hasher_t::compute_hash(uint64_t request_start,uint64_t request_le

// If an error occured, display a message and see if we need to quit.
if ((current_read_bytes<0) || (this->handle && ferror(this->handle))){
ocb->error_filename(this->file_name,"error at offset %"PRIu64": %s",
ocb->error_filename(this->file_name,"error at offset %" PRIu64 ": %s",
request_start, strerror(errno));

if (file_fatal_error()){
Expand Down
4 changes: 2 additions & 2 deletions src/hashlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ hashlist::load_hash_file(display *ocb,const std::string &fn)
file_data_t *t = new (std::nothrow) file_data_t();
if (NULL == t)
{
ocb->fatal_error("%s: Out of memory in line %"PRIu64,
ocb->fatal_error("%s: Out of memory in line %" PRIu64,
fn.c_str(), line_number);
}

Expand Down Expand Up @@ -390,7 +390,7 @@ hashlist::load_hash_file(display *ocb,const std::string &fn)
if ( !algorithm_t::valid_hash(hash_column[column_number],word))
{
if (ocb)
ocb->error("%s: Invalid %s hash in line %"PRIu64,
ocb->error("%s: Invalid %s hash in line %" PRIu64,
fn.c_str(),
hashes[hash_column[column_number]].name.c_str(),
line_number);
Expand Down
2 changes: 1 addition & 1 deletion src/xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class XML {
void xmlout(const std::string &tag,const std::string &value){ xmlout(tag,value,"",true); }
void xmlout(const std::string &tag,const int value){ xmlprintf(tag,"","%d",value); }
void xmloutl(const std::string &tag,const long value){ xmlprintf(tag,"","%ld",value); }
void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,"","%"PRId64,value); }
void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,"","%" PRId64,value); }
void xmlout(const std::string &tag,const double value){ xmlprintf(tag,"","%f",value); }
void xmlout(const std::string &tag,const struct timeval &ts){
xmlprintf(tag,"","%d.%06d",(int)ts.tv_sec, (int)ts.tv_usec);
Expand Down