From 87967d2389d25aa9f7c0f25a51d6c7ab2ad4cc42 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 25 Dec 2021 12:39:30 -0800 Subject: [PATCH] mingle: use safer C++ casts --- cmd/mingle/minglemain.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/mingle/minglemain.cpp b/cmd/mingle/minglemain.cpp index 9386dc3aa..2032dc543 100644 --- a/cmd/mingle/minglemain.cpp +++ b/cmd/mingle/minglemain.cpp @@ -193,7 +193,7 @@ static void init(int argc, char *argv[], opts_t* opts) case 'v': Verbose = 1; if ((sscanf(optarg,"%d",&i) > 0) && (i >= 0)) - Verbose = (unsigned char)i; + Verbose = static_cast(i); else optind--; break; @@ -328,8 +328,8 @@ static void genBundleColors(pedge edge, std::ostream &os, double maxwgt) { static void export_dot (FILE* fp, int ne, pedge *edges, Agraph_t* g) { - Agsym_t* epos = agattr(g, AGEDGE, (char*)"pos", ""); - Agsym_t* esects = agattr(g, AGEDGE, (char*)"bundle", ""); + Agsym_t* epos = agattr(g, AGEDGE, const_cast("pos"), ""); + Agsym_t* esects = agattr(g, AGEDGE, const_cast("bundle"), ""); Agsym_t* eclrs = nullptr; Agnode_t* n; Agedge_t* e; @@ -361,7 +361,7 @@ export_dot (FILE* fp, int ne, pedge *edges, Agraph_t* g) buf.str(""); if (edge->wgts) { - if (!eclrs) eclrs = agattr(g, AGEDGE, (char*)"color", ""); + if (!eclrs) eclrs = agattr(g, AGEDGE, const_cast("color"), ""); genBundleColors(edge, buf, maxwgt); agxset(e, eclrs, buf.str().c_str()); buf.str(""); -- 2.40.0