Addressed warnings

develop
PatrikLundell 2020-03-04 10:09:51 +01:00
parent cd4c7ee422
commit 8dd89eee8a
4 changed files with 22 additions and 18 deletions

@ -327,11 +327,11 @@ namespace embark_assist {
int16_t controllable_civs = 0;
int16_t max_civs;
for (int16_t i = 0; i < world->raws.entities.size(); i++) {
for (int16_t i = 0; i < (int16_t)world->raws.entities.size(); i++) {
if (world->raws.entities[i]->flags.is_set(df::entity_raw_flags::CIV_CONTROLLABLE)) controllable_civs++;
}
for (int16_t i = 0; i < world->raws.entities.size(); i++) {
for (int16_t i = 0; i < (int16_t)world->raws.entities.size(); i++) {
if (!world->raws.entities[i]->flags.is_set(df::entity_raw_flags::LAYER_LINKED) && // Animal people
!world->raws.entities[i]->flags.is_set(df::entity_raw_flags::GENERATED) && // Vault guardians
(controllable_civs > 1 || // Suppress the playable civ when only 1
@ -428,6 +428,10 @@ namespace embark_assist {
element->list.push_back({ "None + Light", static_cast<int8_t>(k) });
break;
case embark_assist::defs::aquifer_ranges::None_Plus_At_Least_Light:
element->list.push_back({ "None + >= Light", static_cast<int8_t>(k) });
break;
case embark_assist::defs::aquifer_ranges::Light:
element->list.push_back({ "Light", static_cast<int8_t>(k) });
break;
@ -1294,8 +1298,8 @@ namespace embark_assist {
break;
case fields::neighbors:
for (int16_t k = 0; k < state->civs.size(); k++) {
state->finder_list.push_back({ state->civs[k].description, static_cast<int8_t>(i) + k });
for (uint8_t k = 0; k < state->civs.size(); k++) {
state->finder_list.push_back({ state->civs[k].description, static_cast<int8_t>(i) + (int8_t)k });
}
break;
}

@ -1369,10 +1369,10 @@ namespace embark_assist {
// Civ Neighbors
if (finder->min_civ_neighbors > (int16_t)world_tile->neighbors.size()) world_tile_match = false;
if (finder->max_civ_neighbors != -1 && finder->max_civ_neighbors < world_tile->neighbors.size()) world_tile_match = false;
if (finder->max_civ_neighbors != -1 && finder->max_civ_neighbors < (int8_t)world_tile->neighbors.size()) world_tile_match = false;
// Specific Neighbors
for (int16_t i = 0; i < finder->neighbors.size(); i++) {
for (uint16_t i = 0; i < finder->neighbors.size(); i++) {
switch (finder->neighbors[i].present) {
case embark_assist::defs::present_absent_ranges::NA:
break;
@ -1381,7 +1381,7 @@ namespace embark_assist {
{
bool found = false;
for (int16_t k = 0; k < world_tile->neighbors.size(); k++) {
for (uint16_t k = 0; k < world_tile->neighbors.size(); k++) {
if (finder->neighbors[i].entity_raw == world_tile->neighbors[k]) {
found = true;
break;
@ -1394,7 +1394,7 @@ namespace embark_assist {
}
case embark_assist::defs::present_absent_ranges::Absent:
for (int16_t k = 0; k < world_tile->neighbors.size(); k++) {
for (uint16_t k = 0; k < world_tile->neighbors.size(); k++) {
if (finder->neighbors[i].entity_raw == world_tile->neighbors[k]) {
world_tile_match = false;
break;
@ -2218,17 +2218,17 @@ namespace embark_assist {
// Civ Neighbors
if (finder->min_civ_neighbors > (int16_t)tile->neighbors.size()) {
if (trace) out.print("matcher::world_tile_match: Civ_Neighbors 1 (%i, %i), %i, %i\n", x, y, finder->min_civ_neighbors, tile->neighbors.size());
if (trace) out.print("matcher::world_tile_match: Civ_Neighbors 1 (%i, %i), %i, %i\n", x, y, finder->min_civ_neighbors, (int)tile->neighbors.size());
return false;
}
if (finder->max_civ_neighbors < tile->neighbors.size() &&
if (finder->max_civ_neighbors < (int8_t)tile->neighbors.size() &&
finder->max_civ_neighbors != -1) {
if (trace) out.print("matcher::world_tile_match: Civ_Neighbors 2 (%i, %i)\n", x, y);
return false;
}
// Specific Neighbors
for (int16_t i = 0; i < finder->neighbors.size(); i++) {
for (uint16_t i = 0; i < finder->neighbors.size(); i++) {
switch (finder->neighbors[i].present) {
case embark_assist::defs::present_absent_ranges::NA:
break;
@ -2237,7 +2237,7 @@ namespace embark_assist {
{
bool found = false;
for (int16_t k = 0; k < tile->neighbors.size(); k++) {
for (uint16_t k = 0; k < tile->neighbors.size(); k++) {
if (finder->neighbors[i].entity_raw == tile->neighbors[k]) {
found = true;
break;
@ -2253,7 +2253,7 @@ namespace embark_assist {
}
case embark_assist::defs::present_absent_ranges::Absent:
for (int16_t k = 0; k < tile->neighbors.size(); k++) {
for (uint16_t k = 0; k < tile->neighbors.size(); k++) {
if (finder->neighbors[i].entity_raw == tile->neighbors[k]) {
if (trace) out.print("matcher::world_tile_match: Specific Neighbors Absent (%i, %i)\n", x, y);
return false;
@ -3042,7 +3042,7 @@ uint16_t embark_assist::matcher::find(embark_assist::defs::match_iterators *iter
return 0;
}
if (iterator->finder.min_civ_neighbors != -1 && iterator->finder.neighbors.size() - absent_count < iterator->finder.min_civ_neighbors) {
if (iterator->finder.min_civ_neighbors != -1 && (int8_t)iterator->finder.neighbors.size() - absent_count < iterator->finder.min_civ_neighbors) {
out.printerr("matcher::find: Will never find any matches with total possible neighbors - excluded neighbors < min civ neighbors\n");
return 0;
}

@ -481,7 +481,7 @@ void embark_assist::overlay::set_embark(embark_assist::defs::site_infos *site_in
state->embark_info.push_back({ Screen::Pen(' ', COLOR_WHITE), world->raws.inorganics[i]->id });
}
for (int16_t i = 0; i < site_info->neighbors.size(); i++) {
for (uint16_t i = 0; i < site_info->neighbors.size(); i++) {
if (world->raws.entities[site_info->neighbors[i]]->translation == "") {
state->embark_info.push_back({ Screen::Pen(' ', COLOR_YELLOW), world->raws.entities[site_info->neighbors[i]]->code }); // Kobolds have an empty translation field
}

@ -1481,7 +1481,7 @@ void embark_assist::survey::survey_mid_level_tile(embark_assist::defs::geo_data
// Focus has to be at the world tile to get neighbor info
//
if (!tile->surveyed) {
for (int16_t i = 0; i < world->entities.all.size(); i++) {
for (uint16_t i = 0; i < world->entities.all.size(); i++) {
if (world->entities.all[i]->flags.bits.neighbor) {
if (world->entities.all[i]->type == df::historical_entity_type::SiteGovernment) {
tile->necro_neighbors++;
@ -2147,7 +2147,7 @@ void embark_assist::survey::survey_embark(embark_assist::defs::mid_level_tiles *
bool incursion_processing_failed = false;
df::world_data *world_data = world->world_data;
if (!use_cache) { // For some reason DF scrambles these values on world tile movements (at least in Lua...).
if (!use_cache) { // DF scrambles these values on world tile movements, while embark-tools stabilizes the movement, but its changes to the value are done after we've read them.
state->local_min_x = screen->location.embark_pos_min.x;
state->local_min_y = screen->location.embark_pos_min.y;
state->local_max_x = screen->location.embark_pos_max.x;
@ -2516,7 +2516,7 @@ void embark_assist::survey::survey_embark(embark_assist::defs::mid_level_tiles *
if (incursion_processing_failed) site_info->incursions_processed = false;
for (int16_t i = 0; i < survey_results->at(x).at(y).neighbors.size(); i++) {
for (uint16_t i = 0; i < survey_results->at(x).at(y).neighbors.size(); i++) {
site_info->neighbors.push_back(survey_results->at(x).at(y).neighbors[i]);
}