From 4ac076a0f7d5f4a585035ef488e1f7a4b86ab0fc Mon Sep 17 00:00:00 2001 From: Emden Gansner Date: Fri, 9 Dec 2016 16:03:56 -0500 Subject: [PATCH] Cleanup warnings and add missing include directory. --- cmd/mingle/Makefile.am | 1 + cmd/mingle/minglemain.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmd/mingle/Makefile.am b/cmd/mingle/Makefile.am index bdc03bc24..d61f39995 100644 --- a/cmd/mingle/Makefile.am +++ b/cmd/mingle/Makefile.am @@ -9,6 +9,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/sfdpgen \ -I$(top_srcdir)/lib/mingle \ -I$(top_srcdir)/lib/ingraphs \ + -I$(top_srcdir)/lib/common \ -I$(top_srcdir)/lib/cgraph \ -I$(top_srcdir)/lib/cdt diff --git a/cmd/mingle/minglemain.c b/cmd/mingle/minglemain.c index d8cfb080f..c2cd67398 100644 --- a/cmd/mingle/minglemain.c +++ b/cmd/mingle/minglemain.c @@ -124,8 +124,8 @@ checkG (Agraph_t* g) static void init(int argc, char *argv[], opts_t* opts) { - unsigned int c; - char* CmdName = argv[0]; + int c; + char* cmd = argv[0]; real s; int i; @@ -179,7 +179,7 @@ static void init(int argc, char *argv[], opts_t* opts) fprintf (stderr, "-k arg %s must be an integer >= 2 - ignored\n", optarg); break; case 'o': - outfile = openFile(optarg, "w", CmdName); + outfile = openFile(optarg, "w", cmd); break; case 'p': if ((sscanf(optarg,"%lf",&s) > 0)) @@ -204,7 +204,7 @@ static void init(int argc, char *argv[], opts_t* opts) case 'v': Verbose = 1; if ((sscanf(optarg,"%d",&i) > 0) && (i >= 0)) - Verbose = i; + Verbose = (unsigned char)i; else optind--; break; @@ -212,7 +212,7 @@ static void init(int argc, char *argv[], opts_t* opts) if (optopt == 'v') Verbose = 1; else { - fprintf(stderr, "%s: option -%c missing argument\n", CmdName, optopt); + fprintf(stderr, "%s: option -%c missing argument\n", cmd, optopt); usage(1); } break; @@ -220,7 +220,9 @@ static void init(int argc, char *argv[], opts_t* opts) if (optopt == '?') usage(0); else - fprintf(stderr, "%s: option -%c unrecognized - ignored\n", CmdName, optopt); + fprintf(stderr, "%s: option -%c unrecognized - ignored\n", cmd, optopt); + break; + default: break; } } -- 2.40.0