[brlcad-commits] SF.net SVN: brlcad:[70979] brlcad/trunk
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2018-05-19 12:27:03
|
Revision: 70979 http://sourceforge.net/p/brlcad/code/70979 Author: starseeker Date: 2018-05-19 12:26:55 +0000 (Sat, 19 May 2018) Log Message: ----------- Undo the (void (*)(void)) casting of commits 70970:70978 (leaving other changes, so not a full reverse merge.) Sean checked the standard and we are actually into undefined behavior with these conversions, so a better solution is needed. Modified Paths: -------------- brlcad/trunk/include/bu/redblack.h brlcad/trunk/include/rt/functab.h brlcad/trunk/src/adrt/master/master.c brlcad/trunk/src/adrt/master/tienet_master.c brlcad/trunk/src/burst/Sc.c brlcad/trunk/src/libbu/redblack.c brlcad/trunk/src/libfb/fbserv_obj.c brlcad/trunk/src/libnmg/isect.c brlcad/trunk/src/librt/db5_scan.c brlcad/trunk/src/librt/primitives/nmg/nmg.c brlcad/trunk/src/util/pixcount.c Modified: brlcad/trunk/include/bu/redblack.h =================================================================== --- brlcad/trunk/include/bu/redblack.h 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/include/bu/redblack.h 2018-05-19 12:26:55 UTC (rev 70979) @@ -247,7 +247,7 @@ */ BU_EXPORT extern struct bu_rb_tree *bu_rb_create(const char *description, int nm_orders, int (**compare_funcs)(const void *, const void *)); /* A macro for correct casting of a rb compare function for use a function argument: */ -#define BU_RB_COMPARE_FUNC_CAST_AS_FUNC_ARG(_func) ((int (*)(void))((void(*)(void))_func)) +#define BU_RB_COMPARE_FUNC_CAST_AS_FUNC_ARG(_func) ((int (*)(void))_func) /** * Create a single-order red-black tree Modified: brlcad/trunk/include/rt/functab.h =================================================================== --- brlcad/trunk/include/rt/functab.h 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/include/rt/functab.h 2018-05-19 12:26:55 UTC (rev 70979) @@ -76,21 +76,21 @@ int (*ft_prep)(struct soltab *stp, struct rt_db_internal *ip, struct rt_i *rtip); -#define RTFUNCTAB_FUNC_PREP_CAST(_func) ((int (*)(struct soltab *, struct rt_db_internal *, struct rt_i *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_PREP_CAST(_func) ((int (*)(struct soltab *, struct rt_db_internal *, struct rt_i *))_func) int (*ft_shot)(struct soltab *stp, struct xray *rp, struct application *ap, /* has resource */ struct seg *seghead); -#define RTFUNCTAB_FUNC_SHOT_CAST(_func) ((int (*)(struct soltab *, struct xray *, struct application *, struct seg *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_SHOT_CAST(_func) ((int (*)(struct soltab *, struct xray *, struct application *, struct seg *))_func) void (*ft_print)(const struct soltab *stp); -#define RTFUNCTAB_FUNC_PRINT_CAST(_func) ((void (*)(const struct soltab *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_PRINT_CAST(_func) ((void (*)(const struct soltab *))_func) void (*ft_norm)(struct hit *hitp, struct soltab *stp, struct xray *rp); -#define RTFUNCTAB_FUNC_NORM_CAST(_func) ((void (*)(struct hit *, struct soltab *, struct xray *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_NORM_CAST(_func) ((void (*)(struct hit *, struct soltab *, struct xray *))_func) int (*ft_piece_shot)(struct rt_piecestate *psp, struct rt_piecelist *plp, @@ -98,29 +98,29 @@ struct xray *ray, /* ray transformed to be near cut cell */ struct application *ap, /* has resource */ struct seg *seghead); /* used only for PLATE mode hits */ -#define RTFUNCTAB_FUNC_PIECE_SHOT_CAST(_func) ((int (*)(struct rt_piecestate *, struct rt_piecelist *, double dist, struct xray *, struct application *, struct seg *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_PIECE_SHOT_CAST(_func) ((int (*)(struct rt_piecestate *, struct rt_piecelist *, double dist, struct xray *, struct application *, struct seg *))_func) void (*ft_piece_hitsegs)(struct rt_piecestate *psp, struct seg *seghead, struct application *ap); /* has resource */ -#define RTFUNCTAB_FUNC_PIECE_HITSEGS_CAST(_func) ((void (*)(struct rt_piecestate *, struct seg *, struct application *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_PIECE_HITSEGS_CAST(_func) ((void (*)(struct rt_piecestate *, struct seg *, struct application *))_func) void (*ft_uv)(struct application *ap, /* has resource */ struct soltab *stp, struct hit *hitp, struct uvcoord *uvp); -#define RTFUNCTAB_FUNC_UV_CAST(_func) ((void (*)(struct application *, struct soltab *, struct hit *, struct uvcoord *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_UV_CAST(_func) ((void (*)(struct application *, struct soltab *, struct hit *, struct uvcoord *))_func) void (*ft_curve)(struct curvature *cvp, struct hit *hitp, struct soltab *stp); -#define RTFUNCTAB_FUNC_CURVE_CAST(_func) ((void (*)(struct curvature *, struct hit *, struct soltab *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_CURVE_CAST(_func) ((void (*)(struct curvature *, struct hit *, struct soltab *))_func) int (*ft_classify)(const struct soltab * /*stp*/, const vect_t /*min*/, const vect_t /*max*/, const struct bn_tol * /*tol*/); -#define RTFUNCTAB_FUNC_CLASS_CAST(_func) ((int (*)(const struct soltab *, const vect_t, const vect_t, const struct bn_tol *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_CLASS_CAST(_func) ((int (*)(const struct soltab *, const vect_t, const vect_t, const struct bn_tol *))_func) void (*ft_free)(struct soltab * /*stp*/); -#define RTFUNCTAB_FUNC_FREE_CAST(_func) ((void (*)(struct soltab *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_FREE_CAST(_func) ((void (*)(struct soltab *))_func) int (*ft_plot)(struct bu_list * /*vhead*/, struct rt_db_internal * /*ip*/, @@ -127,11 +127,11 @@ const struct rt_tess_tol * /*ttol*/, const struct bn_tol * /*tol*/, const struct rt_view_info * /*view info*/); -#define RTFUNCTAB_FUNC_PLOT_CAST(_func) ((int (*)(struct bu_list *, struct rt_db_internal *, const struct rt_tess_tol *, const struct bn_tol *, const struct rt_view_info *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_PLOT_CAST(_func) ((int (*)(struct bu_list *, struct rt_db_internal *, const struct rt_tess_tol *, const struct bn_tol *, const struct rt_view_info *))_func) int (*ft_adaptive_plot)(struct rt_db_internal * /*ip*/, const struct rt_view_info * /*view info*/); -#define RTFUNCTAB_FUNC_ADAPTIVE_PLOT_CAST(_func) ((int (*)(struct rt_db_internal *, const struct rt_view_info *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_ADAPTIVE_PLOT_CAST(_func) ((int (*)(struct rt_db_internal *, const struct rt_view_info *))_func) void (*ft_vshot)(struct soltab * /*stp*/[], struct xray *[] /*rp*/, @@ -138,7 +138,7 @@ struct seg * /*segp*/, int /*n*/, struct application * /*ap*/); -#define RTFUNCTAB_FUNC_VSHOT_CAST(_func) ((void (*)(struct soltab *[], struct xray *[], struct seg *, int, struct application *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_VSHOT_CAST(_func) ((void (*)(struct soltab *[], struct xray *[], struct seg *, int, struct application *))_func) int (*ft_tessellate)(struct nmgregion ** /*r*/, struct model * /*m*/, @@ -145,17 +145,17 @@ struct rt_db_internal * /*ip*/, const struct rt_tess_tol * /*ttol*/, const struct bn_tol * /*tol*/); -#define RTFUNCTAB_FUNC_TESS_CAST(_func) ((int (*)(struct nmgregion **, struct model *, struct rt_db_internal *, const struct rt_tess_tol *, const struct bn_tol *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_TESS_CAST(_func) ((int (*)(struct nmgregion **, struct model *, struct rt_db_internal *, const struct rt_tess_tol *, const struct bn_tol *))_func) int (*ft_tnurb)(struct nmgregion ** /*r*/, struct model * /*m*/, struct rt_db_internal * /*ip*/, const struct bn_tol * /*tol*/); -#define RTFUNCTAB_FUNC_TNURB_CAST(_func) ((int (*)(struct nmgregion **, struct model *, struct rt_db_internal *, const struct bn_tol *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_TNURB_CAST(_func) ((int (*)(struct nmgregion **, struct model *, struct rt_db_internal *, const struct bn_tol *))_func) void (*ft_brep)(ON_Brep ** /*b*/, struct rt_db_internal * /*ip*/, const struct bn_tol * /*tol*/); -#define RTFUNCTAB_FUNC_BREP_CAST(_func) ((void (*)(ON_Brep **, struct rt_db_internal *, const struct bn_tol *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_BREP_CAST(_func) ((void (*)(ON_Brep **, struct rt_db_internal *, const struct bn_tol *))_func) int (*ft_import5)(struct rt_db_internal * /*ip*/, const struct bu_external * /*ep*/, @@ -162,7 +162,7 @@ const mat_t /*mat*/, const struct db_i * /*dbip*/, struct resource * /*resp*/); -#define RTFUNCTAB_FUNC_IMPORT5_CAST(_func) ((int (*)(struct rt_db_internal *, const struct bu_external *, const mat_t, const struct db_i *, struct resource *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_IMPORT5_CAST(_func) ((int (*)(struct rt_db_internal *, const struct bu_external *, const mat_t, const struct db_i *, struct resource *))_func) int (*ft_export5)(struct bu_external * /*ep*/, const struct rt_db_internal * /*ip*/, @@ -169,7 +169,7 @@ double /*local2mm*/, const struct db_i * /*dbip*/, struct resource * /*resp*/); -#define RTFUNCTAB_FUNC_EXPORT5_CAST(_func) ((int (*)(struct bu_external *, const struct rt_db_internal *, double, const struct db_i *, struct resource *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_EXPORT5_CAST(_func) ((int (*)(struct bu_external *, const struct rt_db_internal *, double, const struct db_i *, struct resource *))_func) int (*ft_import4)(struct rt_db_internal * /*ip*/, const struct bu_external * /*ep*/, @@ -176,7 +176,7 @@ const mat_t /*mat*/, const struct db_i * /*dbip*/, struct resource * /*resp*/); -#define RTFUNCTAB_FUNC_IMPORT4_CAST(_func) ((int (*)(struct rt_db_internal *, const struct bu_external *, const mat_t, const struct db_i *, struct resource *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_IMPORT4_CAST(_func) ((int (*)(struct rt_db_internal *, const struct bu_external *, const mat_t, const struct db_i *, struct resource *))_func) int (*ft_export4)(struct bu_external * /*ep*/, const struct rt_db_internal * /*ip*/, @@ -183,10 +183,10 @@ double /*local2mm*/, const struct db_i * /*dbip*/, struct resource * /*resp*/); -#define RTFUNCTAB_FUNC_EXPORT4_CAST(_func) ((int (*)(struct bu_external *, const struct rt_db_internal *, double, const struct db_i *, struct resource *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_EXPORT4_CAST(_func) ((int (*)(struct bu_external *, const struct rt_db_internal *, double, const struct db_i *, struct resource *))_func) void (*ft_ifree)(struct rt_db_internal * /*ip*/); -#define RTFUNCTAB_FUNC_IFREE_CAST(_func) ((void (*)(struct rt_db_internal *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_IFREE_CAST(_func) ((void (*)(struct rt_db_internal *))_func) int (*ft_describe)(struct bu_vls * /*str*/, const struct rt_db_internal * /*ip*/, @@ -194,13 +194,13 @@ double /*mm2local*/, struct resource * /*resp*/, struct db_i *); -#define RTFUNCTAB_FUNC_DESCRIBE_CAST(_func) ((int (*)(struct bu_vls *, const struct rt_db_internal *, int, double, struct resource *, struct db_i *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_DESCRIBE_CAST(_func) ((int (*)(struct bu_vls *, const struct rt_db_internal *, int, double, struct resource *, struct db_i *))_func) int (*ft_xform)(struct rt_db_internal * /*op*/, const mat_t /*mat*/, struct rt_db_internal * /*ip*/, int /*free*/, struct db_i * /*dbip*/, struct resource * /*resp*/); -#define RTFUNCTAB_FUNC_XFORM_CAST(_func) ((int (*)(struct rt_db_internal *, const mat_t, struct rt_db_internal *, int, struct db_i *, struct resource *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_XFORM_CAST(_func) ((int (*)(struct rt_db_internal *, const mat_t, struct rt_db_internal *, int, struct db_i *, struct resource *))_func) const struct bu_structparse *ft_parsetab; /**< @brief rt_xxx_parse */ size_t ft_internal_size; /**< @brief sizeof(struct rt_xxx_internal) */ @@ -207,19 +207,19 @@ uint32_t ft_internal_magic; /**< @brief RT_XXX_INTERNAL_MAGIC */ int (*ft_get)(struct bu_vls *, const struct rt_db_internal *, const char *item); -#define RTFUNCTAB_FUNC_GET_CAST(_func) ((int (*)(struct bu_vls *, const struct rt_db_internal *, const char *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_GET_CAST(_func) ((int (*)(struct bu_vls *, const struct rt_db_internal *, const char *))_func) int (*ft_adjust)(struct bu_vls *, struct rt_db_internal *, int /*argc*/, const char ** /*argv*/); -#define RTFUNCTAB_FUNC_ADJUST_CAST(_func) ((int (*)(struct bu_vls *, struct rt_db_internal *, int, const char **))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_ADJUST_CAST(_func) ((int (*)(struct bu_vls *, struct rt_db_internal *, int, const char **))_func) int (*ft_form)(struct bu_vls *, const struct rt_functab *); -#define RTFUNCTAB_FUNC_FORM_CAST(_func) ((int (*)(struct bu_vls *, const struct rt_functab *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_FORM_CAST(_func) ((int (*)(struct bu_vls *, const struct rt_functab *))_func) void (*ft_make)(const struct rt_functab *, struct rt_db_internal * /*ip*/); -#define RTFUNCTAB_FUNC_MAKE_CAST(_func) ((void (*)(const struct rt_functab *, struct rt_db_internal *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_MAKE_CAST(_func) ((void (*)(const struct rt_functab *, struct rt_db_internal *))_func) int (*ft_params)(struct pc_pc_set *, const struct rt_db_internal * /*ip*/); -#define RTFUNCTAB_FUNC_PARAMS_CAST(_func) ((int (*)(struct pc_pc_set *, const struct rt_db_internal *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_PARAMS_CAST(_func) ((int (*)(struct pc_pc_set *, const struct rt_db_internal *))_func) /* Axis aligned bounding box */ int (*ft_bbox)(struct rt_db_internal * /*ip*/, @@ -226,26 +226,26 @@ point_t * /*min X, Y, Z of bounding RPP*/, point_t * /*max X, Y, Z of bounding RPP*/, const struct bn_tol *); -#define RTFUNCTAB_FUNC_BBOX_CAST(_func) ((int (*)(struct rt_db_internal *, point_t *, point_t *, const struct bn_tol *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_BBOX_CAST(_func) ((int (*)(struct rt_db_internal *, point_t *, point_t *, const struct bn_tol *))_func) void (*ft_volume)(fastf_t * /*vol*/, const struct rt_db_internal * /*ip*/); -#define RTFUNCTAB_FUNC_VOLUME_CAST(_func) ((void (*)(fastf_t *, const struct rt_db_internal *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_VOLUME_CAST(_func) ((void (*)(fastf_t *, const struct rt_db_internal *))_func) void (*ft_surf_area)(fastf_t * /*area*/, const struct rt_db_internal * /*ip*/); -#define RTFUNCTAB_FUNC_SURF_AREA_CAST(_func) ((void (*)(fastf_t *, const struct rt_db_internal *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_SURF_AREA_CAST(_func) ((void (*)(fastf_t *, const struct rt_db_internal *))_func) void (*ft_centroid)(point_t * /*cent*/, const struct rt_db_internal * /*ip*/); -#define RTFUNCTAB_FUNC_CENTROID_CAST(_func) ((void (*)(point_t *, const struct rt_db_internal *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_CENTROID_CAST(_func) ((void (*)(point_t *, const struct rt_db_internal *))_func) int (*ft_oriented_bbox)(struct rt_arb_internal * /* bounding arb8 */, struct rt_db_internal * /*ip*/, const fastf_t); -#define RTFUNCTAB_FUNC_ORIENTED_BBOX_CAST(_func) ((int (*)(struct rt_arb_internal *, struct rt_db_internal *, const fastf_t))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_ORIENTED_BBOX_CAST(_func) ((int (*)(struct rt_arb_internal *, struct rt_db_internal *, const fastf_t))_func) /** get a list of the selections matching a query */ struct rt_selection_set *(*ft_find_selections)(const struct rt_db_internal *, const struct rt_selection_query *); -#define RTFUNCTAB_FUNC_FIND_SELECTIONS_CAST(_func) ((struct rt_selection_set *(*)(const struct rt_db_internal *, const struct rt_selection_query *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_FIND_SELECTIONS_CAST(_func) ((struct rt_selection_set *(*)(const struct rt_db_internal *, const struct rt_selection_query *))_func) /** * evaluate a logical selection expression (e.g. a INTERSECT b, @@ -255,7 +255,7 @@ int op, const struct rt_selection *, const struct rt_selection *); -#define RTFUNCTAB_FUNC_EVALUATE_SELECTION_CAST(_func) ((struct rt_selection *(*)(const struct rt_db_internal *, int op, const struct rt_selection *, const struct rt_selection *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_EVALUATE_SELECTION_CAST(_func) ((struct rt_selection *(*)(const struct rt_db_internal *, int op, const struct rt_selection *, const struct rt_selection *))_func) /** apply an operation to a selected subset of a primitive */ int (*ft_process_selection)(struct rt_db_internal *, @@ -262,11 +262,11 @@ struct db_i *, const struct rt_selection *, const struct rt_selection_operation *); -#define RTFUNCTAB_FUNC_PROCESS_SELECTION_CAST(_func) ((int (*)(struct rt_db_internal *, struct db_i *, const struct rt_selection *, const struct rt_selection_operation *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_PROCESS_SELECTION_CAST(_func) ((int (*)(struct rt_db_internal *, struct db_i *, const struct rt_selection *, const struct rt_selection_operation *))_func) /** cache and uncache prep data for faster future lookup */ int (*ft_prep_serialize)(struct soltab *stp, const struct rt_db_internal *ip, struct bu_external *external, size_t *version); -#define RTFUNCTAB_FUNC_PREP_SERIALIZE_CAST(_func) ((int (*)(struct soltab *, const struct rt_db_internal *, struct bu_external *, size_t *))((void (*)(void))_func)) +#define RTFUNCTAB_FUNC_PREP_SERIALIZE_CAST(_func) ((int (*)(struct soltab *, const struct rt_db_internal *, struct bu_external *, size_t *))_func) }; Modified: brlcad/trunk/src/adrt/master/master.c =================================================================== --- brlcad/trunk/src/adrt/master/master.c 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/src/adrt/master/master.c 2018-05-19 12:26:55 UTC (rev 70979) @@ -132,7 +132,7 @@ tienet_master_init(port, master_result, list, exec, 5, ADRT_VER_KEY, bu_debug & BU_DEBUG_UNUSED_1); /* Launch a thread to handle networking */ - bu_thrd_create(&master.networking_thread, (bu_thrd_start_t)(void (*)(void))master_networking, &obs_port); + bu_thrd_create(&master.networking_thread, (bu_thrd_start_t)master_networking, &obs_port); /* Connect to the component Server */ compnet_connect(comp_host, ISST_COMPNET_PORT); Modified: brlcad/trunk/src/adrt/master/tienet_master.c =================================================================== --- brlcad/trunk/src/adrt/master/tienet_master.c 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/src/adrt/master/tienet_master.c 2018-05-19 12:26:55 UTC (rev 70979) @@ -183,7 +183,7 @@ bu_mtx_init(&tienet_master_broadcast_mut); /* Start the Listener as a Thread */ - bu_thrd_create(&thread, (bu_thrd_start_t)(void (*)(void))tienet_master_listener, NULL); + bu_thrd_create(&thread, (bu_thrd_start_t)tienet_master_listener, NULL); } Modified: brlcad/trunk/src/burst/Sc.c =================================================================== --- brlcad/trunk/src/burst/Sc.c 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/src/burst/Sc.c 2018-05-19 12:26:55 UTC (rev 70979) @@ -218,7 +218,7 @@ ScLoadTP(); ScLoadTCS(); - tputs(ScTI, 1, (int (*)(int))(void (*)(void))PutChr); /* Initialize terminal. */ + tputs(ScTI, 1, (int (*)(int))PutChr); /* Initialize terminal. */ #endif return 1; /* All is well. */ } @@ -232,7 +232,7 @@ if (ScCE == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(ScCE, 1, (int (*)(int))(void (*)(void))PutChr); + tputs(ScCE, 1, (int (*)(int))PutChr); #endif return 1; } @@ -246,7 +246,7 @@ if (ScCS == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(tgoto(ScCS, ScLI-1, 0), 1, (int (*)(int))(void (*)(void))PutChr); + tputs(tgoto(ScCS, ScLI-1, 0), 1, (int (*)(int))PutChr); #endif return 1; } @@ -260,7 +260,7 @@ if (ScSE == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(ScSE, 1, (int (*)(int))(void (*)(void))PutChr); + tputs(ScSE, 1, (int (*)(int))PutChr); #endif return 1; } @@ -274,7 +274,7 @@ if (ScCL == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(ScCL, ScLI, (int (*)(int))(void (*)(void))PutChr); + tputs(ScCL, ScLI, (int (*)(int))PutChr); #endif return 1; } @@ -288,7 +288,7 @@ if (ScAL == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(ScAL, 1, (int (*)(int))(void (*)(void))PutChr); + tputs(ScAL, 1, (int (*)(int))PutChr); #endif return 1; } @@ -302,7 +302,7 @@ if (ScDL == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(ScDL, 1, (int (*)(int))(void (*)(void))PutChr); + tputs(ScDL, 1, (int (*)(int))PutChr); #endif return 1; } @@ -316,7 +316,7 @@ if (ScSR == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(ScSR, 1, (int (*)(int))(void (*)(void))PutChr); + tputs(ScSR, 1, (int (*)(int))PutChr); #endif return 1; } @@ -330,7 +330,7 @@ if (ScHO == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(ScHO, 1, (int (*)(int))(void (*)(void))PutChr); + tputs(ScHO, 1, (int (*)(int))PutChr); #endif return 1; } @@ -351,7 +351,7 @@ #ifdef HAVE_TERMLIB --x; --y; /* Tgoto() adds 1 to each coordinate!? */ - tputs(tgoto(ScCM, x, y), 1, (int (*)(int))(void (*)(void))PutChr); + tputs(tgoto(ScCM, x, y), 1, (int (*)(int))PutChr); #endif return 1; } @@ -370,7 +370,7 @@ if (ScCS == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(tgoto(ScCS, btm-1, top-1), 1, (int (*)(int))(void (*)(void))PutChr); + tputs(tgoto(ScCS, btm-1, top-1), 1, (int (*)(int))PutChr); #endif return 1; } @@ -384,7 +384,7 @@ if (ScSO == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(ScSO, 1, (int (*)(int))(void (*)(void))PutChr); + tputs(ScSO, 1, (int (*)(int))PutChr); #endif return 1; } @@ -398,7 +398,7 @@ if (ScSF == NULL) return 0; #ifdef HAVE_TERMLIB - tputs(ScSF, 1, (int (*)(int))(void (*)(void))PutChr); + tputs(ScSF, 1, (int (*)(int))PutChr); #endif return 1; } Modified: brlcad/trunk/src/libbu/redblack.c =================================================================== --- brlcad/trunk/src/libbu/redblack.c 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/src/libbu/redblack.c 2018-05-19 12:26:55 UTC (rev 70979) @@ -185,9 +185,10 @@ bu_rb_create1(const char *description, int (*compare_func)(void)) { int (**cfp)(const void *, const void *); - cfp = (int (**)(const void *, const void *))bu_malloc(sizeof(int (*)(const void *, const void *)), "red-black function table"); - /* Stage through (void (*)(void)) for GCC -Wcast-function-type */ - *cfp = (int (*)(const void *, const void *)) (void (*)(void))compare_func; + + cfp = (int (**)(const void *, const void *)) + bu_malloc(sizeof(int (*)(const void *, const void *)), "red-black function table"); + *cfp = (int (*)(const void *, const void *)) compare_func; return bu_rb_create(description, 1, cfp); } @@ -617,7 +618,6 @@ struct bu_rb_tree *tree; struct bu_rb_package *package; void (*pp)(void *, const int); /* Pretty print function */ - void (*s)(void); BU_CKMAG(node, BU_RB_NODE_MAGIC, "red-black node"); tree = node->rbn_tree; @@ -624,9 +624,7 @@ RB_CKORDER(tree, d_order); package = (node->rbn_package)[d_order]; - /* Stage through (void (*)(void)) for GCC -Wcast-function-type */ - s = (void (*)(void))tree->rbt_print; - pp = (void (*)(void *, const int))s; + pp = (void (*)(void *, const int))tree->rbt_print; bu_log("%*snode <%p>...\n", depth * 2, "", (void*)node); bu_log("%*s tree: <%p>\n", depth * 2, "", (void*)node->rbn_tree); Modified: brlcad/trunk/src/libfb/fbserv_obj.c =================================================================== --- brlcad/trunk/src/libfb/fbserv_obj.c 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/src/libfb/fbserv_obj.c 2018-05-19 12:26:55 UTC (rev 70979) @@ -1054,7 +1054,7 @@ #if defined(_WIN32) && !defined(__CYGWIN__) Tcl_GetChannelHandle(fbsp->fbs_listener.fbsl_chan, TCL_READABLE, (ClientData *)&fbsp->fbs_listener.fbsl_fd); #else /* if defined(_WIN32) && !defined(__CYGWIN__) */ - Tcl_CreateFileHandler(fbsp->fbs_listener.fbsl_fd, TCL_READABLE, (Tcl_FileProc *)(void(*)(void))new_client_handler, (ClientData)&fbsp->fbs_listener); + Tcl_CreateFileHandler(fbsp->fbs_listener.fbsl_fd, TCL_READABLE, (Tcl_FileProc *)new_client_handler, (ClientData)&fbsp->fbs_listener); #endif /* if defined(_WIN32) && !defined(__CYGWIN__) */ return TCL_OK; Modified: brlcad/trunk/src/libnmg/isect.c =================================================================== --- brlcad/trunk/src/libnmg/isect.c 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/src/libnmg/isect.c 2018-05-19 12:26:55 UTC (rev 70979) @@ -2128,19 +2128,17 @@ pt_class = nmg_class_pt_fu_except(plane_pt, fu_p, (struct loopuse *)NULL, 0, 0, (char *)rd, NMG_FPI_PERGEOM, 1, vlfree, rd->tol); - else { - /* for GCC 8 -Wcast-function-type */ - void (*s)(void) = (void (*)(void))eu_touch_func; + else pt_class = nmg_class_pt_fu_except(plane_pt, fu_p, (struct loopuse *)NULL, - (void (*)(struct edgeuse *, point_t, const char *))s, + (void (*)(struct edgeuse *, point_t, const char *))eu_touch_func, (void (*)(struct vertexuse *, point_t, const char *))vu_touch_func, (char *)rd, NMG_FPI_PERGEOM, 0, vlfree, rd->tol); - } + NMG_GET_HITMISS(myhit); NMG_INDEX_ASSIGN(rd->hitmiss, fu_p->f_p, myhit); myhit->hit.hit_private = (void *)fu_p->f_p; Modified: brlcad/trunk/src/librt/db5_scan.c =================================================================== --- brlcad/trunk/src/librt/db5_scan.c 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/src/librt/db5_scan.c 2018-05-19 12:26:55 UTC (rev 70979) @@ -396,10 +396,7 @@ } else if (version == 4) { /* things used to be pretty simple with v4 */ - /* Stage pointer to avoid GCC 8 -Wcast-function-type */ - void (*s)(void) = (void (*)(void))db_diradd; - - if (db_scan(dbip, (int (*)(struct db_i *, const char *, off_t, size_t, int, void *))s, 1, NULL) < 0) { + if (db_scan(dbip, (int (*)(struct db_i *, const char *, off_t, size_t, int, void *))db_diradd, 1, NULL) < 0) { return -1; } Modified: brlcad/trunk/src/librt/primitives/nmg/nmg.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg.c 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/src/librt/primitives/nmg/nmg.c 2018-05-19 12:26:55 UTC (rev 70979) @@ -1147,13 +1147,13 @@ static int (*state_table[7])(void) = { - (int (*)(void))((void (*)(void))state0), - (int (*)(void))((void (*)(void))state1), - (int (*)(void))((void (*)(void))state2), - (int (*)(void))((void (*)(void))state3), - (int (*)(void))((void (*)(void))state4), - (int (*)(void))((void (*)(void))state5), - (int (*)(void))((void (*)(void))state6) + (int (*)(void))state0, + (int (*)(void))state1, + (int (*)(void))state2, + (int (*)(void))state3, + (int (*)(void))state4, + (int (*)(void))state5, + (int (*)(void))state6 }; @@ -1177,7 +1177,7 @@ NMG_CK_HITMISS(a_hit); /* cast function pointers for use */ - state_table_func = (int (*)(struct seg *, struct seg **, int *, struct hitmiss *, struct soltab *, struct application *, struct bn_tol *))((void (*)(void))state_table[ray_state]); + state_table_func = (int (*)(struct seg *, struct seg **, int *, struct hitmiss *, struct soltab *, struct application *, struct bn_tol *))state_table[ray_state]; new_state = state_table_func(seghead, &seg_p, &seg_count, a_hit, stp, ap, (struct bn_tol *)rd->tol); if (new_state < 0) { /* state transition error. Print out the hit list Modified: brlcad/trunk/src/util/pixcount.c =================================================================== --- brlcad/trunk/src/util/pixcount.c 2018-05-19 02:19:14 UTC (rev 70978) +++ brlcad/trunk/src/util/pixcount.c 2018-05-19 12:26:55 UTC (rev 70979) @@ -222,7 +222,7 @@ } } - palette = bu_rb_create1("Pixel palette", (int (*)(void))((void(*)(void))compare_pixels)); + palette = bu_rb_create1("Pixel palette", (int (*)(void))compare_pixels); bu_rb_uniq_on1(palette); /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |