1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-08-29 08:52:19 +00:00

initialized some variables to silence warnings

This commit is contained in:
Zeno Rogue 2025-08-23 16:57:38 +02:00
parent 8139e65c8e
commit eccb323501
12 changed files with 13 additions and 13 deletions

View File

@ -912,7 +912,7 @@ EX void add_connection(arbi_tiling& c, int ai, int as, int bi, int bs, int m) {
auto& ash = c.shapes[ai]; auto& ash = c.shapes[ai];
auto& bsh = c.shapes[bi]; auto& bsh = c.shapes[bi];
add_connection_sub(c, ai, as, bi, bs, m); add_connection_sub(c, ai, as, bi, bs, m);
int as1, bs1; int as1 = 0, bs1 = 0; /* set to 0 to silence warning */
if(ash.symmetric_value) { if(ash.symmetric_value) {
as1 = ash.reflect(as); as1 = ash.reflect(as);
add_connection_sub(c, ai, as1, bi, bs, !m); add_connection_sub(c, ai, as1, bi, bs, !m);

View File

@ -542,7 +542,7 @@ EX void generateTreasureIsland(cell *c) {
if(c->wall == waCTree) return; if(c->wall == waCTree) return;
} }
vector<cell*> ctab; vector<cell*> ctab;
int qlo, qhi; int qlo = 0, qhi = 0; /* set to 0 to silence warning */
for(int i=0; i<c->type; i++) { for(int i=0; i<c->type; i++) {
cell *c2 = createMov(c, i); cell *c2 = createMov(c, i);
if(!eubinary) currentmap->extend_altmap(c2->master); if(!eubinary) currentmap->extend_altmap(c2->master);

View File

@ -945,7 +945,7 @@ EX namespace clearing {
int steps = 0; int steps = 0;
int ds; int ds = 0; /* set to 0 to silence warning */
int stepcount = 0; int stepcount = 0;
while(true) { while(true) {

View File

@ -30,7 +30,7 @@ void compute_life(cell *c, transmatrix S1, const worldline_visitor& wv) {
auto last_w = cur_w; auto last_w = cur_w;
auto next_w = cur_w; auto next_w = cur_w;
transmatrix next_S1; transmatrix next_S1;
ld next_t; ld next_t = 0; /* set to 0 to silence warning */
ld last_time = t; ld last_time = t;
cell *next_c = nullptr; cell *next_c = nullptr;
binsearch(t, t+90._deg, [&] (ld t1) { binsearch(t, t+90._deg, [&] (ld t1) {

View File

@ -46,7 +46,7 @@ void do_analyze_grid(int maxv) {
println(hlog, "log(gamma) = ", log(cgi.expansion->get_growth())); println(hlog, "log(gamma) = ", log(cgi.expansion->get_growth()));
ld lE, dif, lwE; ld lE = 0, dif = 0, lwE;
for(int d=0; d<32; d++) if(stats[d][0]) { for(int d=0; d<32; d++) if(stats[d][0]) {
int q = stats[d][0]; int q = stats[d][0];
if(q != cgi.expansion->get_descendants(d).approx_int()) continue; if(q != cgi.expansion->get_descendants(d).approx_int()) continue;

View File

@ -124,7 +124,7 @@ void generate_root() {
mroot->leftsibling = mroot->rightsibling = mroot; mroot->leftsibling = mroot->rightsibling = mroot;
mroot->leftparent = mroot->rightparent = NULL; mroot->leftparent = mroot->rightparent = NULL;
mycell *child; mycell *child = nullptr; /* silence warning */
bool first = true; bool first = true;
for(int c: cgi.expansion->children[origtype]) { for(int c: cgi.expansion->children[origtype]) {
if(first) { if(first) {

View File

@ -116,7 +116,7 @@ void launch(int seed, int elimit, int hlimit) {
pair<cell*, cell*> worst; pair<cell*, cell*> worst;
if(1) { if(1) {
int wdist = -1, wdcount; int wdist = -1, wdcount = 0; /* set to silence warning */
for(cell* x0: cl0) for(cell *x1: cl1) { for(cell* x0: cl0) for(cell *x1: cl1) {
int x = 9999; int x = 9999;
for(int d=0; d<4; d++) for(int d=0; d<4; d++)
@ -133,7 +133,7 @@ void launch(int seed, int elimit, int hlimit) {
while(true) { while(true) {
int wdist = -1, wdcount = 0; int wdist = -1, wdcount = 0;
cell *worst_block; cell *worst_block = nullptr; /* set to silence warning */
for(cell *c: clboth) if(c->wall == waNone && c != c0 && c != c1) { for(cell *c: clboth) if(c->wall == waNone && c != c0 && c != c1) {
c->wall = waSea; c->wall = waSea;
solve(start); solve(start);

View File

@ -508,7 +508,7 @@ bool drawVertex(const shiftmatrix &V, cell *c, shmup::monster *m) {
} }
} }
ld angle; ld angle = 0;
if(swarm) angle = hrand(1000); if(swarm) angle = hrand(1000);
printf("setting up...\n"); printf("setting up...\n");

View File

@ -175,7 +175,7 @@ void dofullsa_iterations(long long saiter) {
// println(hlog, "before dofullsa_iterations, cost = ", double(sag::cost), " iterations = ", fts(saiter)); // println(hlog, "before dofullsa_iterations, cost = ", double(sag::cost), " iterations = ", fts(saiter));
ld last_ratio; ld last_ratio = 0;
int lpct = 0; int lpct = 0;

View File

@ -125,7 +125,7 @@ vector<pair<int, int> > compute_voronoi_edges(manifold& m) {
/* project all the net[ni].net on the manifold */ /* project all the net[ni].net on the manifold */
for(int ni=0; ni<N; ni++) { for(int ni=0; ni<N; ni++) {
kohvec best; kohvec best;
int best_tri; int best_tri = 0; /* set to silence warning */
ld best_dist = HUGE_VAL; ld best_dist = HUGE_VAL;
reaction_t better = [] {}; reaction_t better = [] {};
set<int> triangles_to_visit; set<int> triangles_to_visit;

View File

@ -70,7 +70,7 @@ bool overlay = false;
bool sunflower_cell(cell *c, shiftmatrix V) { bool sunflower_cell(cell *c, shiftmatrix V) {
density = zdensity / 100; density = zdensity / 100;
ld qd; ld qd = 1;
if(sphere) { if(sphere) {
if(infer == 'r') if(infer == 'r')

View File

@ -261,7 +261,7 @@ void compute_skyvertices(const vector<sky_item>& sky) {
int k = isize(vertices); int k = isize(vertices);
color_t ccolor; color_t ccolor = 0;
for(int i=0; i<k; i++) ccolor = gradient(ccolor, vcolors[i], 0, 1, i+1); for(int i=0; i<k; i++) ccolor = gradient(ccolor, vcolors[i], 0, 1, i+1);
hyperpoint ctr = Hypc; hyperpoint ctr = Hypc;