From 27c970cd5c68329d7c7b303c0e092d53cfedafd6 Mon Sep 17 00:00:00 2001
From: Jason Hiser <jdhiser@gmail.com>
Date: Mon, 16 Dec 2019 13:48:05 -0500
Subject: [PATCH] minor code cleanups

---
 irdb-libs/libEXEIO/src/exeio_pe.h     |  2 +-
 irdb-libs/libIRDB-core/src/cmdstr.hpp | 10 +++++-----
 irdb-libs/libIRDB-core/src/fileir.cpp |  1 +
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/irdb-libs/libEXEIO/src/exeio_pe.h b/irdb-libs/libEXEIO/src/exeio_pe.h
index d2ec01a4a..b2a14d903 100644
--- a/irdb-libs/libEXEIO/src/exeio_pe.h
+++ b/irdb-libs/libEXEIO/src/exeio_pe.h
@@ -163,7 +163,7 @@ namespace EXEIO
 
 			virtual bool isDLL() { return true; } 
 
-                        virtual void* get_pebliss() { assert(e); return (void*)e; }
+                        virtual void* get_pebliss() { assert(e); return static_cast<void*>(e); }
 	
 		private:  
 			pe_bliss::pe_base* e;
diff --git a/irdb-libs/libIRDB-core/src/cmdstr.hpp b/irdb-libs/libIRDB-core/src/cmdstr.hpp
index 1cc08ae61..b99a87d3b 100644
--- a/irdb-libs/libIRDB-core/src/cmdstr.hpp
+++ b/irdb-libs/libIRDB-core/src/cmdstr.hpp
@@ -19,7 +19,7 @@ using namespace std;
 static inline pair<string,int> command_to_string( const string& command)
 {
 	auto ret=string();
-	int exit_code;
+	int exit_code=0;
 	int cout_pipe[2];
 	int cerr_pipe[2];
 	posix_spawn_file_actions_t action;
@@ -54,14 +54,14 @@ static inline pair<string,int> command_to_string( const string& command)
 	{
 		if ( plist[0].revents&POLLIN) {
 			const auto bytes_read = read(cout_pipe[0], &buffer[0], buffer.length());
-			cout << "read " << bytes_read << " bytes from stdout.\n";
-			cout << buffer.substr(0, static_cast<size_t>(bytes_read)) << "\n";
+			// cout << "read " << bytes_read << " bytes from stdout.\n";
+			// cout << buffer.substr(0, static_cast<size_t>(bytes_read)) << "\n";
 			ret += buffer.substr(0, static_cast<size_t>(bytes_read));
 		}
 		else if ( plist[1].revents&POLLIN ) {
 			const auto bytes_read = read(cerr_pipe[0], &buffer[0], buffer.length());
-			cout << "read " << bytes_read << " bytes from stderr.\n";
-			cout << buffer.substr(0, static_cast<size_t>(bytes_read)) << "\n";
+			// cout << "read " << bytes_read << " bytes from stderr.\n";
+			// cout << buffer.substr(0, static_cast<size_t>(bytes_read)) << "\n";
 			ret +=  buffer.substr(0, static_cast<size_t>(bytes_read));
 		}
 		else 
diff --git a/irdb-libs/libIRDB-core/src/fileir.cpp b/irdb-libs/libIRDB-core/src/fileir.cpp
index 4d9a65fde..901c2463f 100644
--- a/irdb-libs/libIRDB-core/src/fileir.cpp
+++ b/irdb-libs/libIRDB-core/src/fileir.cpp
@@ -46,6 +46,7 @@ using namespace std;
 
 int command_to_stream(const string& command, ostream& stream)
 {
+	cout << "Issuing command: " << command << endl;
 	const auto res = command_to_string(command);
 
 	stream << res.first << endl;
-- 
GitLab