Try eliminating warnings in macOS and Windows CI builds.

MacOS warnings are format warnings, e.g., `format specifies type 'long' but the argument has type 'Version' (aka 'long long')`.
Windows warnings are `ACTOR does not contain a wait() statement`.
This commit is contained in:
Renxuan Wang 2022-02-25 13:28:29 -08:00
parent 079de5ba57
commit f7eb66441d
19 changed files with 75 additions and 79 deletions

View File

@ -616,7 +616,7 @@ int64_t granule_start_load(const char* filename,
// don't seek if offset == 0 // don't seek if offset == 0
if (offset && fseek(fp, offset, SEEK_SET)) { if (offset && fseek(fp, offset, SEEK_SET)) {
// if fseek was non-zero, it failed // if fseek was non-zero, it failed
fprintf(stderr, "ERROR: BG could not seek to %ld in file %s\n", offset, full_fname); fprintf(stderr, "ERROR: BG could not seek to %lld in file %s\n", offset, full_fname);
fclose(fp); fclose(fp);
return -1; return -1;
} }
@ -626,7 +626,7 @@ int64_t granule_start_load(const char* filename,
fclose(fp); fclose(fp);
if (readSize != length) { if (readSize != length) {
fprintf(stderr, "ERROR: BG could not read %ld bytes from file: %s\n", length, full_fname); fprintf(stderr, "ERROR: BG could not read %lld bytes from file: %s\n", length, full_fname);
return -1; return -1;
} }
@ -637,7 +637,7 @@ int64_t granule_start_load(const char* filename,
uint8_t* granule_get_load(int64_t loadId, void* userContext) { uint8_t* granule_get_load(int64_t loadId, void* userContext) {
BGLocalFileContext* context = (BGLocalFileContext*)userContext; BGLocalFileContext* context = (BGLocalFileContext*)userContext;
if (context->data_by_id[loadId] == 0) { if (context->data_by_id[loadId] == 0) {
fprintf(stderr, "ERROR: BG loadId invalid for get_load: %ld\n", loadId); fprintf(stderr, "ERROR: BG loadId invalid for get_load: %lld\n", loadId);
return 0; return 0;
} }
return context->data_by_id[loadId]; return context->data_by_id[loadId];
@ -646,7 +646,7 @@ uint8_t* granule_get_load(int64_t loadId, void* userContext) {
void granule_free_load(int64_t loadId, void* userContext) { void granule_free_load(int64_t loadId, void* userContext) {
BGLocalFileContext* context = (BGLocalFileContext*)userContext; BGLocalFileContext* context = (BGLocalFileContext*)userContext;
if (context->data_by_id[loadId] == 0) { if (context->data_by_id[loadId] == 0) {
fprintf(stderr, "ERROR: BG loadId invalid for free_load: %ld\n", loadId); fprintf(stderr, "ERROR: BG loadId invalid for free_load: %lld\n", loadId);
} }
free(context->data_by_id[loadId]); free(context->data_by_id[loadId]);
context->data_by_id[loadId] = 0; context->data_by_id[loadId] = 0;
@ -1120,7 +1120,7 @@ int run_workload(FDBTransaction* transaction,
if (tracetimer == dotrace) { if (tracetimer == dotrace) {
fdb_error_t err; fdb_error_t err;
tracetimer = 0; tracetimer = 0;
snprintf(traceid, 32, "makotrace%019ld", total_xacts); snprintf(traceid, 32, "makotrace%019lld", total_xacts);
fprintf(debugme, "DEBUG: txn tracing %s\n", traceid); fprintf(debugme, "DEBUG: txn tracing %s\n", traceid);
err = fdb_transaction_set_option(transaction, err = fdb_transaction_set_option(transaction,
FDB_TR_OPTION_DEBUG_TRANSACTION_IDENTIFIER, FDB_TR_OPTION_DEBUG_TRANSACTION_IDENTIFIER,
@ -1284,7 +1284,7 @@ void* worker_thread(void* thread_args) {
} }
fprintf(debugme, fprintf(debugme,
"DEBUG: worker_id:%d (%d) thread_id:%d (%d) database_index:%lu (tid:%lu)\n", "DEBUG: worker_id:%d (%d) thread_id:%d (%d) database_index:%lu (tid:%llu)\n",
worker_id, worker_id,
args->num_processes, args->num_processes,
thread_id, thread_id,
@ -2251,9 +2251,9 @@ void print_stats(mako_args_t* args, mako_stats_t* stats, struct timespec* now, s
for (op = 0; op < MAX_OP; op++) { for (op = 0; op < MAX_OP; op++) {
if (args->txnspec.ops[op][OP_COUNT] > 0) { if (args->txnspec.ops[op][OP_COUNT] > 0) {
uint64_t ops_total_diff = ops_total[op] - ops_total_prev[op]; uint64_t ops_total_diff = ops_total[op] - ops_total_prev[op];
printf("%" STR(STATS_FIELD_WIDTH) "lu ", ops_total_diff); printf("%" STR(STATS_FIELD_WIDTH) "llu ", ops_total_diff);
if (fp) { if (fp) {
fprintf(fp, "\"%s\": %lu,", get_ops_name(op), ops_total_diff); fprintf(fp, "\"%s\": %llu,", get_ops_name(op), ops_total_diff);
} }
errors_diff[op] = errors_total[op] - errors_total_prev[op]; errors_diff[op] = errors_total[op] - errors_total_prev[op];
print_err = (errors_diff[op] > 0); print_err = (errors_diff[op] > 0);
@ -2281,7 +2281,7 @@ void print_stats(mako_args_t* args, mako_stats_t* stats, struct timespec* now, s
printf("%" STR(STATS_TITLE_WIDTH) "s ", "Errors"); printf("%" STR(STATS_TITLE_WIDTH) "s ", "Errors");
for (op = 0; op < MAX_OP; op++) { for (op = 0; op < MAX_OP; op++) {
if (args->txnspec.ops[op][OP_COUNT] > 0) { if (args->txnspec.ops[op][OP_COUNT] > 0) {
printf("%" STR(STATS_FIELD_WIDTH) "lu ", errors_diff[op]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", errors_diff[op]);
if (fp) { if (fp) {
fprintf(fp, ",\"errors\": %.2f", conflicts_diff); fprintf(fp, ",\"errors\": %.2f", conflicts_diff);
} }
@ -2430,10 +2430,10 @@ void print_report(mako_args_t* args,
break; break;
} }
} }
printf("Total Xacts: %8lu\n", totalxacts); printf("Total Xacts: %8llu\n", totalxacts);
printf("Total Conflicts: %8lu\n", conflicts); printf("Total Conflicts: %8llu\n", conflicts);
printf("Total Errors: %8lu\n", totalerrors); printf("Total Errors: %8llu\n", totalerrors);
printf("Overall TPS: %8lu\n\n", totalxacts * 1000000000 / duration_nsec); printf("Overall TPS: %8llu\n\n", totalxacts * 1000000000 / duration_nsec);
if (fp) { if (fp) {
fprintf(fp, "\"results\": {"); fprintf(fp, "\"results\": {");
@ -2441,10 +2441,10 @@ void print_report(mako_args_t* args,
fprintf(fp, "\"totalProcesses\": %d,", args->num_processes); fprintf(fp, "\"totalProcesses\": %d,", args->num_processes);
fprintf(fp, "\"totalThreads\": %d,", args->num_threads); fprintf(fp, "\"totalThreads\": %d,", args->num_threads);
fprintf(fp, "\"targetTPS\": %d,", args->tpsmax); fprintf(fp, "\"targetTPS\": %d,", args->tpsmax);
fprintf(fp, "\"totalXacts\": %lu,", totalxacts); fprintf(fp, "\"totalXacts\": %llu,", totalxacts);
fprintf(fp, "\"totalConflicts\": %lu,", conflicts); fprintf(fp, "\"totalConflicts\": %llu,", conflicts);
fprintf(fp, "\"totalErrors\": %lu,", totalerrors); fprintf(fp, "\"totalErrors\": %llu,", totalerrors);
fprintf(fp, "\"overallTPS\": %lu,", totalxacts * 1000000000 / duration_nsec); fprintf(fp, "\"overallTPS\": %llu,", totalxacts * 1000000000 / duration_nsec);
} }
/* per-op stats */ /* per-op stats */
@ -2457,14 +2457,14 @@ void print_report(mako_args_t* args,
} }
for (op = 0; op < MAX_OP; op++) { for (op = 0; op < MAX_OP; op++) {
if ((args->txnspec.ops[op][OP_COUNT] > 0 && op != OP_TRANSACTION) || op == OP_COMMIT) { if ((args->txnspec.ops[op][OP_COUNT] > 0 && op != OP_TRANSACTION) || op == OP_COMMIT) {
printf("%" STR(STATS_FIELD_WIDTH) "lu ", ops_total[op]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", ops_total[op]);
if (fp) { if (fp) {
if (first_op) { if (first_op) {
first_op = 0; first_op = 0;
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), ops_total[op]); fprintf(fp, "\"%s\": %llu", get_ops_name(op), ops_total[op]);
} }
} }
} }
@ -2486,14 +2486,14 @@ void print_report(mako_args_t* args,
first_op = 1; first_op = 1;
for (op = 0; op < MAX_OP; op++) { for (op = 0; op < MAX_OP; op++) {
if (args->txnspec.ops[op][OP_COUNT] > 0 && op != OP_TRANSACTION) { if (args->txnspec.ops[op][OP_COUNT] > 0 && op != OP_TRANSACTION) {
printf("%" STR(STATS_FIELD_WIDTH) "lu ", errors_total[op]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", errors_total[op]);
if (fp) { if (fp) {
if (first_op) { if (first_op) {
first_op = 0; first_op = 0;
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), errors_total[op]); fprintf(fp, "\"%s\": %llu", get_ops_name(op), errors_total[op]);
} }
} }
} }
@ -2511,7 +2511,7 @@ void print_report(mako_args_t* args,
for (op = 0; op < MAX_OP; op++) { for (op = 0; op < MAX_OP; op++) {
if (args->txnspec.ops[op][OP_COUNT] > 0 || op == OP_TRANSACTION || op == OP_COMMIT) { if (args->txnspec.ops[op][OP_COUNT] > 0 || op == OP_TRANSACTION || op == OP_COMMIT) {
if (lat_total[op]) { if (lat_total[op]) {
printf("%" STR(STATS_FIELD_WIDTH) "lu ", lat_samples[op]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", lat_samples[op]);
} else { } else {
printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A"); printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A");
} }
@ -2521,7 +2521,7 @@ void print_report(mako_args_t* args,
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), lat_samples[op]); fprintf(fp, "\"%s\": %llu", get_ops_name(op), lat_samples[op]);
} }
} }
} }
@ -2538,14 +2538,14 @@ void print_report(mako_args_t* args,
if (lat_min[op] == -1) { if (lat_min[op] == -1) {
printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A"); printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A");
} else { } else {
printf("%" STR(STATS_FIELD_WIDTH) "lu ", lat_min[op]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", lat_min[op]);
if (fp) { if (fp) {
if (first_op) { if (first_op) {
first_op = 0; first_op = 0;
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), lat_min[op]); fprintf(fp, "\"%s\": %llu", get_ops_name(op), lat_min[op]);
} }
} }
} }
@ -2561,14 +2561,14 @@ void print_report(mako_args_t* args,
for (op = 0; op < MAX_OP; op++) { for (op = 0; op < MAX_OP; op++) {
if (args->txnspec.ops[op][OP_COUNT] > 0 || op == OP_TRANSACTION || op == OP_COMMIT) { if (args->txnspec.ops[op][OP_COUNT] > 0 || op == OP_TRANSACTION || op == OP_COMMIT) {
if (lat_total[op]) { if (lat_total[op]) {
printf("%" STR(STATS_FIELD_WIDTH) "lu ", lat_total[op] / lat_samples[op]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", lat_total[op] / lat_samples[op]);
if (fp) { if (fp) {
if (first_op) { if (first_op) {
first_op = 0; first_op = 0;
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), lat_total[op] / lat_samples[op]); fprintf(fp, "\"%s\": %llu", get_ops_name(op), lat_total[op] / lat_samples[op]);
} }
} else { } else {
printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A"); printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A");
@ -2588,14 +2588,14 @@ void print_report(mako_args_t* args,
if (lat_max[op] == 0) { if (lat_max[op] == 0) {
printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A"); printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A");
} else { } else {
printf("%" STR(STATS_FIELD_WIDTH) "lu ", lat_max[op]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", lat_max[op]);
if (fp) { if (fp) {
if (first_op) { if (first_op) {
first_op = 0; first_op = 0;
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), lat_max[op]); fprintf(fp, "\"%s\": %llu", get_ops_name(op), lat_max[op]);
} }
} }
} }
@ -2646,14 +2646,14 @@ void print_report(mako_args_t* args,
} else { } else {
median = (dataPoints[op][num_points[op] / 2] + dataPoints[op][num_points[op] / 2 - 1]) >> 1; median = (dataPoints[op][num_points[op] / 2] + dataPoints[op][num_points[op] / 2 - 1]) >> 1;
} }
printf("%" STR(STATS_FIELD_WIDTH) "lu ", median); printf("%" STR(STATS_FIELD_WIDTH) "llu ", median);
if (fp) { if (fp) {
if (first_op) { if (first_op) {
first_op = 0; first_op = 0;
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), median); fprintf(fp, "\"%s\": %llu", get_ops_name(op), median);
} }
} else { } else {
printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A"); printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A");
@ -2676,14 +2676,14 @@ void print_report(mako_args_t* args,
} }
if (lat_total[op]) { if (lat_total[op]) {
point_95pct = ((float)(num_points[op]) * 0.95) - 1; point_95pct = ((float)(num_points[op]) * 0.95) - 1;
printf("%" STR(STATS_FIELD_WIDTH) "lu ", dataPoints[op][point_95pct]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", dataPoints[op][point_95pct]);
if (fp) { if (fp) {
if (first_op) { if (first_op) {
first_op = 0; first_op = 0;
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), dataPoints[op][point_95pct]); fprintf(fp, "\"%s\": %llu", get_ops_name(op), dataPoints[op][point_95pct]);
} }
} else { } else {
printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A"); printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A");
@ -2706,14 +2706,14 @@ void print_report(mako_args_t* args,
} }
if (lat_total[op]) { if (lat_total[op]) {
point_99pct = ((float)(num_points[op]) * 0.99) - 1; point_99pct = ((float)(num_points[op]) * 0.99) - 1;
printf("%" STR(STATS_FIELD_WIDTH) "lu ", dataPoints[op][point_99pct]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", dataPoints[op][point_99pct]);
if (fp) { if (fp) {
if (first_op) { if (first_op) {
first_op = 0; first_op = 0;
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), dataPoints[op][point_99pct]); fprintf(fp, "\"%s\": %llu", get_ops_name(op), dataPoints[op][point_99pct]);
} }
} else { } else {
printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A"); printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A");
@ -2736,14 +2736,14 @@ void print_report(mako_args_t* args,
} }
if (lat_total[op]) { if (lat_total[op]) {
point_99_9pct = ((float)(num_points[op]) * 0.999) - 1; point_99_9pct = ((float)(num_points[op]) * 0.999) - 1;
printf("%" STR(STATS_FIELD_WIDTH) "lu ", dataPoints[op][point_99_9pct]); printf("%" STR(STATS_FIELD_WIDTH) "llu ", dataPoints[op][point_99_9pct]);
if (fp) { if (fp) {
if (first_op) { if (first_op) {
first_op = 0; first_op = 0;
} else { } else {
fprintf(fp, ","); fprintf(fp, ",");
} }
fprintf(fp, "\"%s\": %lu", get_ops_name(op), dataPoints[op][point_99_9pct]); fprintf(fp, "\"%s\": %llu", get_ops_name(op), dataPoints[op][point_99_9pct]);
} }
} else { } else {
printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A"); printf("%" STR(STATS_FIELD_WIDTH) "s ", "N/A");

View File

@ -67,25 +67,25 @@ void runTests(struct ResultSet* rs) {
fdb_transaction_set(tr, keys[i], KEY_SIZE, valueStr, VALUE_SIZE); fdb_transaction_set(tr, keys[i], KEY_SIZE, valueStr, VALUE_SIZE);
e = getSize(rs, tr, sizes + i); e = getSize(rs, tr, sizes + i);
checkError(e, "transaction get size", rs); checkError(e, "transaction get size", rs);
printf("size %d: %ld\n", i, sizes[i]); printf("size %d: %lld\n", i, sizes[i]);
i++; i++;
fdb_transaction_set(tr, keys[i], KEY_SIZE, valueStr, VALUE_SIZE); fdb_transaction_set(tr, keys[i], KEY_SIZE, valueStr, VALUE_SIZE);
e = getSize(rs, tr, sizes + i); e = getSize(rs, tr, sizes + i);
checkError(e, "transaction get size", rs); checkError(e, "transaction get size", rs);
printf("size %d: %ld\n", i, sizes[i]); printf("size %d: %lld\n", i, sizes[i]);
i++; i++;
fdb_transaction_clear(tr, keys[i], KEY_SIZE); fdb_transaction_clear(tr, keys[i], KEY_SIZE);
e = getSize(rs, tr, sizes + i); e = getSize(rs, tr, sizes + i);
checkError(e, "transaction get size", rs); checkError(e, "transaction get size", rs);
printf("size %d: %ld\n", i, sizes[i]); printf("size %d: %lld\n", i, sizes[i]);
i++; i++;
fdb_transaction_clear_range(tr, keys[i], KEY_SIZE, keys[i + 1], KEY_SIZE); fdb_transaction_clear_range(tr, keys[i], KEY_SIZE, keys[i + 1], KEY_SIZE);
e = getSize(rs, tr, sizes + i); e = getSize(rs, tr, sizes + i);
checkError(e, "transaction get size", rs); checkError(e, "transaction get size", rs);
printf("size %d: %ld\n", i, sizes[i]); printf("size %d: %lld\n", i, sizes[i]);
i++; i++;
for (j = 0; j + 1 < i; j++) { for (j = 0; j + 1 < i; j++) {

View File

@ -413,7 +413,7 @@ ACTOR Future<Void> logThroughput(int64_t* v, Key* next) {
loop { loop {
state int64_t last = *v; state int64_t last = *v;
wait(delay(1)); wait(delay(1));
printf("throughput: %ld bytes/s, next: %s\n", *v - last, printable(*next).c_str()); printf("throughput: %lld bytes/s, next: %s\n", *v - last, printable(*next).c_str());
} }
} }

View File

@ -2754,7 +2754,7 @@ ACTOR Future<Void> queryBackup(const char* name,
reportBackupQueryError(operationId, reportBackupQueryError(operationId,
result, result,
errorMessage = errorMessage =
format("the specified restorable version %ld is not valid", restoreVersion)); format("the specified restorable version %lld is not valid", restoreVersion));
return Void(); return Void();
} }
Optional<RestorableFileSet> fileSet = wait(bc->getRestoreSet(restoreVersion, keyRangesFilter)); Optional<RestorableFileSet> fileSet = wait(bc->getRestoreSet(restoreVersion, keyRangesFilter));

View File

@ -40,7 +40,7 @@ ACTOR Future<bool> advanceVersionCommandActor(Reference<IDatabase> db, std::vect
} else { } else {
state Version v; state Version v;
int n = 0; int n = 0;
if (sscanf(tokens[1].toString().c_str(), "%ld%n", &v, &n) != 1 || n != tokens[1].size()) { if (sscanf(tokens[1].toString().c_str(), "%lld%n", &v, &n) != 1 || n != tokens[1].size()) {
printUsage(tokens[0]); printUsage(tokens[0]);
return false; return false;
} else { } else {
@ -53,7 +53,7 @@ ACTOR Future<bool> advanceVersionCommandActor(Reference<IDatabase> db, std::vect
tr->set(advanceVersionSpecialKey, boost::lexical_cast<std::string>(v)); tr->set(advanceVersionSpecialKey, boost::lexical_cast<std::string>(v));
wait(safeThreadFutureToFuture(tr->commit())); wait(safeThreadFutureToFuture(tr->commit()));
} else { } else {
printf("Current read version is %ld\n", rv); printf("Current read version is %lld\n", rv);
return true; return true;
} }
} catch (Error& e) { } catch (Error& e) {

View File

@ -115,7 +115,7 @@ ACTOR Future<bool> changeFeedCommandActor(Database localDb, std::vector<StringRe
Version end = std::numeric_limits<Version>::max(); Version end = std::numeric_limits<Version>::max();
if (tokens.size() > 3) { if (tokens.size() > 3) {
int n = 0; int n = 0;
if (sscanf(tokens[3].toString().c_str(), "%ld%n", &begin, &n) != 1 || n != tokens[3].size()) { if (sscanf(tokens[3].toString().c_str(), "%lld%n", &begin, &n) != 1 || n != tokens[3].size()) {
printUsage(tokens[0]); printUsage(tokens[0]);
return false; return false;
} }
@ -168,7 +168,7 @@ ACTOR Future<bool> changeFeedCommandActor(Database localDb, std::vector<StringRe
} }
Version v; Version v;
int n = 0; int n = 0;
if (sscanf(tokens[3].toString().c_str(), "%ld%n", &v, &n) != 1 || n != tokens[3].size()) { if (sscanf(tokens[3].toString().c_str(), "%lld%n", &v, &n) != 1 || n != tokens[3].size()) {
printUsage(tokens[0]); printUsage(tokens[0]);
return false; return false;
} else { } else {

View File

@ -705,12 +705,12 @@ void printStatus(StatusObjectReader statusObj,
} }
} }
outputString += format( outputString += format(
" %s log epoch: %ld begin: %ld end: %s, missing " " %s log epoch: %lld begin: %lld end: %s, missing "
"log interfaces(id,address): %s\n", "log interfaces(id,address): %s\n",
current ? "Current" : "Old", current ? "Current" : "Old",
epoch, epoch,
beginVersion, beginVersion,
endVersion == invalidVersion ? "(unknown)" : format("%ld", endVersion).c_str(), endVersion == invalidVersion ? "(unknown)" : format("%lld", endVersion).c_str(),
missing_log_interfaces.c_str()); missing_log_interfaces.c_str());
} }
} }

View File

@ -1615,7 +1615,7 @@ ACTOR Future<int> cli(CLIOptions opt, LineNoise* plinenoise) {
} else { } else {
Version v = wait(makeInterruptable( Version v = wait(makeInterruptable(
safeThreadFutureToFuture(getTransaction(db, tr, options, intrans)->getReadVersion()))); safeThreadFutureToFuture(getTransaction(db, tr, options, intrans)->getReadVersion())));
printf("%ld\n", v); printf("%lld\n", v);
} }
continue; continue;
} }

View File

@ -96,7 +96,7 @@ public:
struct ToStringFunc { struct ToStringFunc {
std::string operator()(int v) const { return format("int:%d", v); } std::string operator()(int v) const { return format("int:%d", v); }
std::string operator()(int64_t v) const { return format("int64_t:%ld", v); } std::string operator()(int64_t v) const { return format("int64_t:%lld", v); }
std::string operator()(bool v) const { return format("bool:%d", v); } std::string operator()(bool v) const { return format("bool:%d", v); }
std::string operator()(ValueRef v) const { return "string:" + v.toString(); } std::string operator()(ValueRef v) const { return "string:" + v.toString(); }
std::string operator()(double v) const { return format("double:%lf", v); } std::string operator()(double v) const { return format("double:%lf", v); }

View File

@ -87,7 +87,7 @@ std::string secondsToTimeFormat(int64_t seconds) {
else if (seconds >= 60) else if (seconds >= 60)
return format("%.2f minute(s)", seconds / 60.0); return format("%.2f minute(s)", seconds / 60.0);
else else
return format("%ld second(s)", seconds); return format("%lld second(s)", seconds);
} }
const Key FileBackupAgent::keyLastRestorable = LiteralStringRef("last_restorable"); const Key FileBackupAgent::keyLastRestorable = LiteralStringRef("last_restorable");
@ -5183,7 +5183,7 @@ public:
else else
statusText += "The initial snapshot is still running.\n"; statusText += "The initial snapshot is still running.\n";
statusText += format("\nDetails:\n LogBytes written - %ld\n RangeBytes written - %ld\n " statusText += format("\nDetails:\n LogBytes written - %lld\n RangeBytes written - %lld\n "
"Last complete log version and timestamp - %s, %s\n " "Last complete log version and timestamp - %s, %s\n "
"Last complete snapshot version and timestamp - %s, %s\n " "Last complete snapshot version and timestamp - %s, %s\n "
"Current Snapshot start version and timestamp - %s, %s\n " "Current Snapshot start version and timestamp - %s, %s\n "

View File

@ -2201,7 +2201,7 @@ ACTOR Future<Void> advanceVersion(Database cx, Version v) {
tr.set(minRequiredCommitVersionKey, BinaryWriter::toValue(v + 1, Unversioned())); tr.set(minRequiredCommitVersionKey, BinaryWriter::toValue(v + 1, Unversioned()));
wait(tr.commit()); wait(tr.commit());
} else { } else {
printf("Current read version is %ld\n", rv); printf("Current read version is %lld\n", rv);
return Void(); return Void();
} }
} catch (Error& e) { } catch (Error& e) {

View File

@ -61,7 +61,7 @@ class WriteToTransactionEnvironment {
Version lastWrittenVersion{ 0 }; Version lastWrittenVersion{ 0 };
static Value longToValue(int64_t v) { static Value longToValue(int64_t v) {
auto s = format("%ld", v); auto s = format("%lld", v);
return StringRef(reinterpret_cast<uint8_t const*>(s.c_str()), s.size()); return StringRef(reinterpret_cast<uint8_t const*>(s.c_str()), s.size());
} }

View File

@ -5209,13 +5209,13 @@ public:
return Void(); return Void();
} }
ACTOR static Future<Void> AddAllTeams_isExhaustive() { static void AddAllTeams_isExhaustive() {
Reference<IReplicationPolicy> policy = Reference<IReplicationPolicy>( Reference<IReplicationPolicy> policy = Reference<IReplicationPolicy>(
new PolicyAcross(3, "zoneid", Reference<IReplicationPolicy>(new PolicyOne()))); new PolicyAcross(3, "zoneid", Reference<IReplicationPolicy>(new PolicyOne())));
state int processSize = 10; int processSize = 10;
state int desiredTeams = SERVER_KNOBS->DESIRED_TEAMS_PER_SERVER * processSize; int desiredTeams = SERVER_KNOBS->DESIRED_TEAMS_PER_SERVER * processSize;
state int maxTeams = SERVER_KNOBS->MAX_TEAMS_PER_SERVER * processSize; int maxTeams = SERVER_KNOBS->MAX_TEAMS_PER_SERVER * processSize;
state std::unique_ptr<DDTeamCollection> collection = testTeamCollection(3, policy, processSize); std::unique_ptr<DDTeamCollection> collection = testTeamCollection(3, policy, processSize);
int result = collection->addTeamsBestOf(200, desiredTeams, maxTeams); int result = collection->addTeamsBestOf(200, desiredTeams, maxTeams);
@ -5223,24 +5223,20 @@ public:
// The maximum number of available server teams with machine locality constraint is 120 - 40, because // The maximum number of available server teams with machine locality constraint is 120 - 40, because
// the 40 (5*4*2) server teams whose servers come from the same machine are invalid. // the 40 (5*4*2) server teams whose servers come from the same machine are invalid.
ASSERT(result == 80); ASSERT(result == 80);
return Void();
} }
ACTOR static Future<Void> AddAllTeams_withLimit() { static void AddAllTeams_withLimit() {
Reference<IReplicationPolicy> policy = Reference<IReplicationPolicy>( Reference<IReplicationPolicy> policy = Reference<IReplicationPolicy>(
new PolicyAcross(3, "zoneid", Reference<IReplicationPolicy>(new PolicyOne()))); new PolicyAcross(3, "zoneid", Reference<IReplicationPolicy>(new PolicyOne())));
state int processSize = 10; int processSize = 10;
state int desiredTeams = SERVER_KNOBS->DESIRED_TEAMS_PER_SERVER * processSize; int desiredTeams = SERVER_KNOBS->DESIRED_TEAMS_PER_SERVER * processSize;
state int maxTeams = SERVER_KNOBS->MAX_TEAMS_PER_SERVER * processSize; int maxTeams = SERVER_KNOBS->MAX_TEAMS_PER_SERVER * processSize;
state std::unique_ptr<DDTeamCollection> collection = testTeamCollection(3, policy, processSize); std::unique_ptr<DDTeamCollection> collection = testTeamCollection(3, policy, processSize);
int result = collection->addTeamsBestOf(10, desiredTeams, maxTeams); int result = collection->addTeamsBestOf(10, desiredTeams, maxTeams);
ASSERT(result >= 10); ASSERT(result >= 10);
return Void();
} }
ACTOR static Future<Void> AddTeamsBestOf_SkippingBusyServers() { ACTOR static Future<Void> AddTeamsBestOf_SkippingBusyServers() {
@ -5665,12 +5661,12 @@ TEST_CASE("DataDistribution/AddTeamsBestOf/NotUseMachineID") {
} }
TEST_CASE("DataDistribution/AddAllTeams/isExhaustive") { TEST_CASE("DataDistribution/AddAllTeams/isExhaustive") {
wait(DDTeamCollectionUnitTest::AddAllTeams_isExhaustive()); DDTeamCollectionUnitTest::AddAllTeams_isExhaustive();
return Void(); return Void();
} }
TEST_CASE("/DataDistribution/AddAllTeams/withLimit") { TEST_CASE("/DataDistribution/AddAllTeams/withLimit") {
wait(DDTeamCollectionUnitTest::AddAllTeams_withLimit()); DDTeamCollectionUnitTest::AddAllTeams_withLimit();
return Void(); return Void();
} }

View File

@ -2359,7 +2359,7 @@ ACTOR Future<Void> KVFileDump(std::string filename) {
k = keyAfter(kv[kv.size() - 1].key); k = keyAfter(kv[kv.size() - 1].key);
} }
fflush(stdout); fflush(stdout);
fprintf(stderr, "Counted: %ld\n", count); fprintf(stderr, "Counted: %lld\n", count);
if (store->getError().isError()) if (store->getError().isError())
wait(store->getError()); wait(store->getError());

View File

@ -1038,7 +1038,7 @@ ACTOR static Future<JsonBuilderObject> processStatusFetcher(
if (ssLag[address] >= 60) { if (ssLag[address] >= 60) {
messages.push_back(JsonString::makeMessage( messages.push_back(JsonString::makeMessage(
"storage_server_lagging", "storage_server_lagging",
format("Storage server lagging by %ld seconds.", (int64_t)ssLag[address]).c_str())); format("Storage server lagging by %lld seconds.", (int64_t)ssLag[address]).c_str()));
} }
// Store the message array into the status object that represents the worker process // Store the message array into the status object that represents the worker process

View File

@ -1432,8 +1432,8 @@ private:
// parameter // parameter
knobs.emplace_back( knobs.emplace_back(
"page_cache_4k", "page_cache_4k",
format("%ld", ti.get() / 4096 * 4096)); // The cache holds 4K pages, so we can truncate this to the format("%lld", ti.get() / 4096 * 4096)); // The cache holds 4K pages, so we can truncate this to the
// next smaller multiple of 4K. // next smaller multiple of 4K.
break; break;
case OPT_BUGGIFY: case OPT_BUGGIFY:
if (!strcmp(args.OptionArg(), "on")) if (!strcmp(args.OptionArg(), "on"))

View File

@ -183,7 +183,7 @@ struct MakoWorkload : TestWorkload {
auto ratesItr = ratesAtKeyCounts.begin(); auto ratesItr = ratesAtKeyCounts.begin();
for (; ratesItr != ratesAtKeyCounts.end(); ratesItr++) { for (; ratesItr != ratesAtKeyCounts.end(); ratesItr++) {
m.emplace_back( m.emplace_back(
format("%ld keys imported bytes/sec", ratesItr->first), ratesItr->second, Averaged::False); format("%lld keys imported bytes/sec", ratesItr->first), ratesItr->second, Averaged::False);
} }
} }
// benchmark // benchmark

View File

@ -317,7 +317,7 @@ struct ReadWriteWorkload : KVWorkload {
std::vector<std::pair<uint64_t, double>>::iterator ratesItr = ratesAtKeyCounts.begin(); std::vector<std::pair<uint64_t, double>>::iterator ratesItr = ratesAtKeyCounts.begin();
for (; ratesItr != ratesAtKeyCounts.end(); ratesItr++) for (; ratesItr != ratesAtKeyCounts.end(); ratesItr++)
m.emplace_back(format("%ld keys imported bytes/sec", ratesItr->first), ratesItr->second, Averaged::False); m.emplace_back(format("%lld keys imported bytes/sec", ratesItr->first), ratesItr->second, Averaged::False);
} }
Value randomValue() { Value randomValue() {

View File

@ -3826,7 +3826,7 @@ TEST_CASE("/flow/Platform/getMemoryInfo") {
ASSERT(request[LiteralStringRef("SwapTotal:")] == 25165820); ASSERT(request[LiteralStringRef("SwapTotal:")] == 25165820);
ASSERT(request[LiteralStringRef("SwapFree:")] == 23680228); ASSERT(request[LiteralStringRef("SwapFree:")] == 23680228);
for (auto& item : request) { for (auto& item : request) {
printf("%s:%ld\n", item.first.toString().c_str(), item.second); printf("%s:%lld\n", item.first.toString().c_str(), item.second);
} }
printf("UnitTest flow/Platform/getMemoryInfo 2\n"); printf("UnitTest flow/Platform/getMemoryInfo 2\n");
@ -3877,7 +3877,7 @@ TEST_CASE("/flow/Platform/getMemoryInfo") {
ASSERT(request[LiteralStringRef("SwapTotal:")] == 0); ASSERT(request[LiteralStringRef("SwapTotal:")] == 0);
ASSERT(request[LiteralStringRef("SwapFree:")] == 0); ASSERT(request[LiteralStringRef("SwapFree:")] == 0);
for (auto& item : request) { for (auto& item : request) {
printf("%s:%ld\n", item.first.toString().c_str(), item.second); printf("%s:%lld\n", item.first.toString().c_str(), item.second);
} }
return Void(); return Void();