diff --git a/doomsday/client/client.pro b/doomsday/client/client.pro index 910dcad34a..9f1401acbe 100644 --- a/doomsday/client/client.pro +++ b/doomsday/client/client.pro @@ -15,7 +15,10 @@ echo(Doomsday Client $${DENG_VERSION}.) # Some messy old code here: *-g++*|*-gcc*|*-clang* { - QMAKE_CXXFLAGS_WARN_ON += -Wno-missing-field-initializers + QMAKE_CXXFLAGS_WARN_ON += \ + -Wno-missing-field-initializers \ + -Wno-unused-parameter \ + -Wno-missing-braces } # External Dependencies ------------------------------------------------------ diff --git a/doomsday/plugins/common/src/p_saveg.c b/doomsday/plugins/common/src/p_saveg.c index 330dde48a4..0c16f1969e 100644 --- a/doomsday/plugins/common/src/p_saveg.c +++ b/doomsday/plugins/common/src/p_saveg.c @@ -194,7 +194,7 @@ static MaterialArchive* materialArchive; static thinkerinfo_t thinkerInfo[] = { { TC_MOBJ, - P_MobjThinker, + (thinkfunc_t) P_MobjThinker, TSF_SERVERONLY, SV_WriteMobj, SV_ReadMobj, @@ -912,7 +912,7 @@ static thinkerinfo_t* infoForThinker(thinker_t* th) static int removeThinker(thinker_t* th, void* context) { - if(th->function == P_MobjThinker) + if(th->function == (thinkfunc_t) P_MobjThinker) P_MobjRemove((mobj_t *) th, true); else Z_Free(th); @@ -958,7 +958,7 @@ static uint SV_InitThingArchive(boolean load, boolean savePlayers) else { // Count the number of mobjs we'll be writing. - Thinker_Iterate(P_MobjThinker, countMobjs, ¶ms); + Thinker_Iterate((thinkfunc_t) P_MobjThinker, countMobjs, ¶ms); } thingArchive = calloc(params.count, sizeof(mobj_t*)); @@ -1014,7 +1014,7 @@ unsigned short SV_ThingArchiveNum(mobj_t* mo) errorIfNotInited("SV_ThingArchiveNum"); // We only archive valid mobj thinkers. - if(mo == NULL || ((thinker_t *) mo)->function != P_MobjThinker) + if(mo == NULL || ((thinker_t *) mo)->function != (thinkfunc_t) P_MobjThinker) return 0; #if __JHEXEN__ @@ -4282,7 +4282,7 @@ static int archiveThinker(thinker_t* th, void* context) boolean savePlayers = *(boolean*) context; // Are we archiving players? - if(!(th->function == P_MobjThinker && ((mobj_t *) th)->player && + if(!(th->function == (thinkfunc_t) P_MobjThinker && ((mobj_t *) th)->player && !savePlayers)) { thinkerinfo_t* thInfo = infoForThinker(th); @@ -4454,7 +4454,7 @@ static void rebuildCorpseQueue(void) { P_InitCorpseQueue(); // Search the thinker list for corpses and place them in the queue. - Thinker_Iterate(P_MobjThinker, rebuildCorpseQueueWorker, NULL/*no params*/); + Thinker_Iterate((thinkfunc_t) P_MobjThinker, rebuildCorpseQueueWorker, NULL/*no params*/); } #endif @@ -4569,7 +4569,7 @@ static void P_UnArchiveThinkers(void) if(thInfo->thinkclass == TC_MOBJ) { th = (thinker_t*) - P_MobjCreateXYZ(P_MobjThinker, 0, 0, 0, 0, 64, 64, 0); + P_MobjCreateXYZ((thinkfunc_t) P_MobjThinker, 0, 0, 0, 0, 64, 64, 0); } else { @@ -4608,11 +4608,11 @@ static void P_UnArchiveThinkers(void) // Update references to things. #if __JHEXEN__ - Thinker_Iterate(P_MobjThinker, restoreMobjLinks, NULL); + Thinker_Iterate((thinkfunc_t) P_MobjThinker, restoreMobjLinks, NULL); #else if(IS_SERVER) { - Thinker_Iterate(P_MobjThinker, restoreMobjLinks, NULL); + Thinker_Iterate((thinkfunc_t) P_MobjThinker, restoreMobjLinks, NULL); for(i = 0; i < numlines; ++i) { diff --git a/doomsday/plugins/common/src/p_xgsec.c b/doomsday/plugins/common/src/p_xgsec.c index 21dab7b2fa..a87f0debe0 100644 --- a/doomsday/plugins/common/src/p_xgsec.c +++ b/doomsday/plugins/common/src/p_xgsec.c @@ -2173,7 +2173,7 @@ int C_DECL XSTrav_Teleport(Sector* sector, boolean ceiling, void* context, thinker_t *th = (thinker_t*) mo; // Not a mobj. - if(th->function != P_MobjThinker) + if(th->function != (thinkfunc_t) P_MobjThinker) continue; // Not a teleportman. @@ -2918,7 +2918,7 @@ void XS_Thinker(xsthinker_t* xs) params.sec = sector; params.data = XSCE_FLOOR; - Thinker_Iterate(P_MobjThinker, XSTrav_SectorChain, ¶ms); + Thinker_Iterate((thinkfunc_t) P_MobjThinker, XSTrav_SectorChain, ¶ms); } // Ceiling chain. Check any mobjs that are touching the ceiling. @@ -2928,7 +2928,7 @@ void XS_Thinker(xsthinker_t* xs) params.sec = sector; params.data = XSCE_CEILING; - Thinker_Iterate(P_MobjThinker, XSTrav_SectorChain, ¶ms); + Thinker_Iterate((thinkfunc_t) P_MobjThinker, XSTrav_SectorChain, ¶ms); } // Inside chain. Check any sectorlinked mobjs. @@ -2938,7 +2938,7 @@ void XS_Thinker(xsthinker_t* xs) params.sec = sector; params.data = XSCE_INSIDE; - Thinker_Iterate(P_MobjThinker, XSTrav_SectorChain, ¶ms); + Thinker_Iterate((thinkfunc_t) P_MobjThinker, XSTrav_SectorChain, ¶ms); } // Ticker chain. Send an activate event if TICKER_D flag is not set. @@ -2995,7 +2995,7 @@ void XS_Thinker(xsthinker_t* xs) xstrav_windparams_t params; params.sec = sector; - Thinker_Iterate(P_MobjThinker, XSTrav_Wind, ¶ms); + Thinker_Iterate((thinkfunc_t) P_MobjThinker, XSTrav_Wind, ¶ms); } } diff --git a/doomsday/plugins/config_plugin.pri b/doomsday/plugins/config_plugin.pri index 5dd3e556c4..3d1f1bbb5a 100644 --- a/doomsday/plugins/config_plugin.pri +++ b/doomsday/plugins/config_plugin.pri @@ -9,6 +9,13 @@ win32 { TARGET_EXT = .dll } +*-g++* | *-gcc* | *-clang* { + # In the game plugins there is a large number of thinkfunc_t related + # casting from various types of functions. This should be removed + # when the issue has been resolved: + QMAKE_CFLAGS_WARN_ON += -Wno-incompatible-pointer-types +} + INCLUDEPATH += $$DENG_API_DIR !dengplugin_libdeng2_full { diff --git a/doomsday/plugins/doom/src/p_oldsvg.c b/doomsday/plugins/doom/src/p_oldsvg.c index cc51a95bc0..5374326e9c 100644 --- a/doomsday/plugins/doom/src/p_oldsvg.c +++ b/doomsday/plugins/doom/src/p_oldsvg.c @@ -439,7 +439,7 @@ static void P_v19_UnArchiveWorld(void) static int removeThinker(thinker_t* th, void* context) { - if(th->function == P_MobjThinker) + if(th->function == (thinkfunc_t) P_MobjThinker) P_MobjRemove((mobj_t *) th, true); else Z_Free(th); diff --git a/doomsday/plugins/heretic/src/p_mobj.c b/doomsday/plugins/heretic/src/p_mobj.c index 854cfee1a3..c33d0f8638 100644 --- a/doomsday/plugins/heretic/src/p_mobj.c +++ b/doomsday/plugins/heretic/src/p_mobj.c @@ -877,7 +877,7 @@ void P_MobjThinker(mobj_t* mobj) coord_t oldZ = mobj->origin[VZ]; P_MobjMoveZ(mobj); - if(mobj->thinker.function != P_MobjThinker) + if(mobj->thinker.function != (thinkfunc_t) P_MobjThinker) return; // mobj was removed /** diff --git a/doomsday/plugins/heretic/src/p_oldsvg.c b/doomsday/plugins/heretic/src/p_oldsvg.c index f11a295e53..1406a4bcad 100644 --- a/doomsday/plugins/heretic/src/p_oldsvg.c +++ b/doomsday/plugins/heretic/src/p_oldsvg.c @@ -459,7 +459,7 @@ static void P_v13_UnArchiveWorld(void) static int removeThinker(thinker_t* th, void* context) { - if(th->function == P_MobjThinker) + if(th->function == (thinkfunc_t) P_MobjThinker) P_MobjRemove((mobj_t *) th, true); else Z_Free(th); diff --git a/doomsday/plugins/hexen/src/po_man.c b/doomsday/plugins/hexen/src/po_man.c index a489b808f5..976ba1e82b 100644 --- a/doomsday/plugins/hexen/src/po_man.c +++ b/doomsday/plugins/hexen/src/po_man.c @@ -581,7 +581,7 @@ static void thrustMobj(struct mobj_s* mo, void* linep, void* pop) pe = (polyevent_t*) po->specialData; if(pe) { - if(pe->thinker.function == T_RotatePoly) + if(pe->thinker.function == (thinkfunc_t) T_RotatePoly) { force = FIX2FLT(pe->intSpeed >> 8); } diff --git a/doomsday/server/server.pro b/doomsday/server/server.pro index 2573d85267..b2bb8eef04 100644 --- a/doomsday/server/server.pro +++ b/doomsday/server/server.pro @@ -15,8 +15,11 @@ echo(Doomsday Server $${DENG_VERSION}.) CONFIG -= app_bundle # Some messy old code here: -*-g++*|*-gcc*|*-clang* { - QMAKE_CXXFLAGS_WARN_ON += -Wno-missing-field-initializers +*-g++* | *-gcc* | *-clang* { + QMAKE_CXXFLAGS_WARN_ON += \ + -Wno-missing-field-initializers \ + -Wno-unused-parameter \ + -Wno-missing-braces } # External Dependencies ------------------------------------------------------