1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-08-30 17:27:57 +00:00

Use printf %lld, not %Ld

comply with ISO C++
This commit is contained in:
Locria Cyber
2023-02-01 12:53:09 +00:00
parent 253f0deaa6
commit 99e3b25560
4 changed files with 6 additions and 6 deletions

View File

@@ -342,7 +342,7 @@ void compute_betweenness(bool verify) {
auto b = betweenness3(c1); auto b = betweenness3(c1);
// add_to_set(c1, 1, 0); // add_to_set(c1, 1, 0);
auto b4 = betweenness4(c1); auto b4 = betweenness4(c1);
print(hlog, format("B;%10Ld;%10Ld;%20.10Lf;%3d;%-40s", b.first, b.second, b4, vertices[i]->lev, rogueviz::vdata[i].name.c_str())); print(hlog, format("B;%10lld;%10lld;%20.10Lf;%3d;%-40s", b.first, b.second, b4, vertices[i]->lev, rogueviz::vdata[i].name.c_str()));
if(verify) { if(verify) {
/* /*
betweenness_type a = b.first; betweenness_type a = b.first;

View File

@@ -191,7 +191,7 @@ void preparegraph() {
current_logistic.setRT(factor * graph_R, factor * graph_T); current_logistic.setRT(factor * graph_R, factor * graph_T);
saved_logistic = current_logistic; saved_logistic = current_logistic;
// for(int u=0; u<MAXDIST; u++) iprintf("%d/%Ld\n", edgetally[u], tally[u]); // for(int u=0; u<MAXDIST; u++) iprintf("%d/%lld\n", edgetally[u], tally[u]);
fix_logistic_parameters(current_logistic, loglik_logistic, "logistic", 1e-6); fix_logistic_parameters(current_logistic, loglik_logistic, "logistic", 1e-6);
writestats(); writestats();

View File

@@ -53,7 +53,7 @@ void test_paths(int radius) {
add_to_tally(mc2, 1, 0); add_to_tally(mc2, 1, 0);
// int v = 0; // int v = 0;
if(tally[quickdist(mc1, mc2)] != 1) { if(tally[quickdist(mc1, mc2)] != 1) {
printf("[%p] [%p]\n", mc1, mc2); printf("[%p] [%p]\n", (void*)mc1, (void*)mc2);
printf("quickdist = %d\n", quickdist(mc1, mc2)); printf("quickdist = %d\n", quickdist(mc1, mc2));
for(int i=0; i<MAXDIST; i++) if(tally[i]) printf("in tally = %d\n", i); for(int i=0; i<MAXDIST; i++) if(tally[i]) printf("in tally = %d\n", i);
mc1->ascell()->item = itDiamond; mc1->ascell()->item = itDiamond;

View File

@@ -431,7 +431,7 @@ namespace sag {
if(t2 - tl > 980) { if(t2 - tl > 980) {
tl = t2; tl = t2;
println(hlog, format("it %12Ld temp %6.4f [1/e at %13.6f] cost = %f ", println(hlog, format("it %12lld temp %6.4f [1/e at %13.6f] cost = %f ",
numiter, double(sag::temperature), (double) exp(sag::temperature), numiter, double(sag::temperature), (double) exp(sag::temperature),
double(sag::cost))); double(sag::cost)));
} }
@@ -458,7 +458,7 @@ namespace sag {
auto t2 = SDL_GetTicks(); auto t2 = SDL_GetTicks();
if(t2 - t1 > 1000) { if(t2 - t1 > 1000) {
t1 = t2; t1 = t2;
println(hlog, format("it %12Ld temp %6.4f [1/e at %13.6f] cost = %f ", println(hlog, format("it %12lld temp %6.4f [1/e at %13.6f] cost = %f ",
numiter, double(sag::temperature), (double) exp(sag::temperature), numiter, double(sag::temperature), (double) exp(sag::temperature),
double(sag::cost))); double(sag::cost)));
} }
@@ -491,7 +491,7 @@ namespace sag {
if(t < (sag_ittime+1) / 2) ipturn *= 2; if(t < (sag_ittime+1) / 2) ipturn *= 2;
else if(t > sag_ittime * 2) ipturn /= 2; else if(t > sag_ittime * 2) ipturn /= 2;
else ipturn = ipturn * sag_ittime / t; else ipturn = ipturn * sag_ittime / t;
print(hlog, format("it %12Ld temp %6.4f [2:%8.6f,10:%8.6f,50:%8.6f] cost = %f\n", print(hlog, format("it %12lld temp %6.4f [2:%8.6f,10:%8.6f,50:%8.6f] cost = %f\n",
numiter, double(sag::temperature), numiter, double(sag::temperature),
(double) exp(-2 * exp(-sag::temperature)), (double) exp(-2 * exp(-sag::temperature)),
(double) exp(-10 * exp(-sag::temperature)), (double) exp(-10 * exp(-sag::temperature)),