Skip to content

Commit

Permalink
Fix gcc 8 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Nov 3, 2018
1 parent 5733073 commit 48bc6e0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/client/GameSave.cpp
Expand Up @@ -270,7 +270,7 @@ char * GameSave::Serialise(unsigned int & dataSize)
{
return serialiseOPS(dataSize);
}
catch (BuildException e)
catch (BuildException & e)
{
std::cout << e.what() << std::endl;
return NULL;
Expand Down
6 changes: 3 additions & 3 deletions src/graphics/Renderer.cpp
Expand Up @@ -2648,8 +2648,8 @@ Renderer::Renderer(Graphics * g, Simulation * sim):
renderModePresets[10].ColourMode = COLOUR_LIFE;

//Prepare the graphics cache
graphicscache = (gcache_item *)malloc(sizeof(gcache_item)*PT_NUM);
memset(graphicscache, 0, sizeof(gcache_item)*PT_NUM);
graphicscache = new gcache_item[PT_NUM];
std::fill(&graphicscache[0], &graphicscache[PT_NUM], gcache_item());

int fireColoursCount = 4;
pixel fireColours[] = {PIXPACK(0xAF9F0F), PIXPACK(0xDFBF6F), PIXPACK(0x60300F), PIXPACK(0x000000)};
Expand Down Expand Up @@ -2960,7 +2960,7 @@ Renderer::~Renderer()
delete[] persistentVid;
delete[] warpVid;
#endif
free(graphicscache);
delete[] graphicscache;
free(flm_data);
free(plasma_data);
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/search/SearchView.cpp
Expand Up @@ -31,7 +31,7 @@ SearchView::SearchView():
{
motdLabel = new ui::RichLabel(ui::Point(51, WINDOWH-18), ui::Point(WINDOWW-102, 16), Client::Ref().GetMessageOfTheDay());
}
catch (std::exception e) { }
catch (std::exception & e) { }

class PageNumAction : public ui::TextboxAction
{
Expand Down Expand Up @@ -254,7 +254,7 @@ void SearchView::NotifyMessageOfTheDay(Client * sender)
{
motdLabel->SetText(sender->GetMessageOfTheDay());
}
catch (std::exception e)
catch (std::exception & e)
{
motdLabel = nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lua/LegacyLuaAPI.cpp
Expand Up @@ -238,7 +238,7 @@ int luacon_elementwrite(lua_State* l)

luacon_model->BuildMenus();
luacon_sim->init_can_move();
memset(luacon_ren->graphicscache, 0, sizeof(gcache_item)*PT_NUM);
std::fill(&luacon_ren->graphicscache[0], &luacon_ren->graphicscache[PT_NUM], gcache_item());

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/Simulation.cpp
Expand Up @@ -43,7 +43,7 @@ int Simulation::Load(int fullX, int fullY, GameSave * save, bool includePressure
{
save->Expand();
}
catch (ParseException)
catch (ParseException &)
{
return 1;
}
Expand Down

0 comments on commit 48bc6e0

Please sign in to comment.