From 7f3b124fe32173cae776e5b8c2c1bd9f01a2eaea Mon Sep 17 00:00:00 2001
From: Clark Coleman <clc@zephyr-software.com>
Date: Mon, 1 Aug 2022 14:48:28 -0400
Subject: [PATCH] Code cleanup.

---
 src/interfaces/idapro/STARSIDAProgram.cpp | 26 +++++++++++------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/interfaces/idapro/STARSIDAProgram.cpp b/src/interfaces/idapro/STARSIDAProgram.cpp
index 32778bbd..6cf5330b 100644
--- a/src/interfaces/idapro/STARSIDAProgram.cpp
+++ b/src/interfaces/idapro/STARSIDAProgram.cpp
@@ -102,7 +102,7 @@ void STARS_IDA_Program_t::CloseFiles(void) {
 } // end of STARS_IDA_Program_t::CloseFiles()
 
 void STARS_IDA_Program_t::InitData(void) {
-	SMP_msg("INFO: Reach STARS_IDA_Program_t::InitData method.\n");
+	SMP_msg("INFO: Reached STARS_IDA_Program_t::InitData method.\n");
 
 	// Init everything else through the base class.
 	STARS_Program_t::InitData();
@@ -126,7 +126,7 @@ void STARS_IDA_Program_t::InitData(void) {
 void STARS_IDA_Program_t::DetermineRootFileName(void) {
 	SMP_msg("INFO: Reached DetermineRootFileName method.\n");
 	char TempRootName[STARS_MAXSTR];
-	for (size_t Index = 0; Index < (STARS_MAXSTR - 1); ++Index) {
+	for (std::size_t Index = 0; Index < (STARS_MAXSTR - 1); ++Index) {
 		TempRootName[Index] = 'S';
 	}
 	TempRootName[STARS_MAXSTR - 1] = '\0';
@@ -138,7 +138,7 @@ void STARS_IDA_Program_t::DetermineRootFileName(void) {
 #else
 	qstring EnvValue;
 	EnvValue.reserve(STARS_MAXSTR);
-	if (qgetenv("STARS_ROOT_FILENAME", &EnvValue)) {
+	if (::qgetenv("STARS_ROOT_FILENAME", &EnvValue)) {
 		SMP_strncpy(TempRootName, EnvValue.c_str(), sizeof(TempRootName)-1);
 		SMP_msg("INFO: qgetenv found value of STARS_ROOT_FILENAME: %s\n", TempRootName);
 	}
@@ -160,7 +160,7 @@ void STARS_IDA_Program_t::DetermineRootFileName(void) {
 
 	if (SMP_is_dll()) {
 		this->SetSharedObjectFlag(true);
-		SMP_msg("INFO: Determined shard object from is_dll() in IDA Pro.\n");
+		SMP_msg("INFO: Determined shared object from is_dll() in IDA Pro.\n");
 	}
 	else {
 		// Try to find ".so" or ".dll" or ".a" in file name, indicating shared object.
@@ -268,7 +268,7 @@ void STARS_IDA_Program_t::InitStaticDataTable(SMPProgram *CurrProg) {
 	STARS_ea_t ea;
 	flags_t ObjFlags;
 	bool ReadOnlyFlag;
-	size_t DummyNumber = 0; // suffix for SMP_dummy# global names
+	std::size_t DummyNumber = 0; // suffix for SMP_dummy# global names
 
 	// First, examine the data segments and collect info about static
 	//   data, such as name/address/size.
@@ -319,7 +319,7 @@ void STARS_IDA_Program_t::InitStaticDataTable(SMPProgram *CurrProg) {
 					if (NextEA == BADADDR) {
 						NextEA = seg->get_endEA();
 					}
-					size_t ObjSize = (size_t) (NextEA - ea);
+					std::size_t ObjSize = (std::size_t) (NextEA - ea);
 					if (TempLowestGlobalVarAddress > ea)
 						TempLowestGlobalVarAddress = ea;
 					if (TempHighestGlobalVarAddress < NextEA)
@@ -357,11 +357,11 @@ void STARS_IDA_Program_t::InitStaticDataTable(SMPProgram *CurrProg) {
 						pair<map<string, STARS_ea_t>::iterator, bool> InsertResult;
 						InsertResult = CurrProg->InsertGlobalNameAddrMapEntry(TempPair);
 						if (!InsertResult.second) {
-							SMP_msg("FATAL ERROR: Insertion into GlobalNameMap: %s at %llx\n", buf, (unsigned long long) ea);
+							SMP_msg("FATAL ERROR: Insertion into GlobalNameMap: %s at %llx\n", buf, (uint64_t) ea);
 						}
 #if 0
 						else {
-							SMP_msg("INFO: Insertion into GlobalNameMap: %s at %llx\n", buf, (unsigned long long) ea);
+							SMP_msg("INFO: Insertion into GlobalNameMap: %s at %llx\n", buf, (uint64_t) ea);
 						}
 #endif
 						assert(InsertResult.second);
@@ -389,7 +389,7 @@ void STARS_IDA_Program_t::InitStaticDataTable(SMPProgram *CurrProg) {
 									STARS_Segment_t *SegInfo = SMP_getseg(TargetAddr);
 									if ((NULL != SegInfo) && (SegInfo->IsCodeSegment())) {
 										if (!ReadOnlyFlag) {
-											SMP_msg("INFO: Code Xref from writeable data at %llx\n", (uint64_t)ea);
+											SMP_msg("INFO: Code Xref from writeable data at %llx to %llx\n", (uint64_t)ea, (uint64_t)TargetAddr);
 										}
 										bool NewTarget = CurrProg->InsertDataToCodeXref(TargetAddr);
 										if (NewTarget)
@@ -453,19 +453,19 @@ void STARS_IDA_Program_t::InitStaticDataTable(SMPProgram *CurrProg) {
 	// Update SMPProgram global limits
 	if (LowestCodeAddress > TempLowestCodeAddress) {
 		LowestCodeAddress = TempLowestCodeAddress;
-		SMP_msg("INFO: New lowest code address: %x\n", LowestCodeAddress);
+		SMP_msg("INFO: New lowest code address: %llx\n", (uint64_t)LowestCodeAddress);
 	}
 	if (HighestCodeAddress < TempHighestCodeAddress) {
 		HighestCodeAddress = TempHighestCodeAddress;
-		SMP_msg("INFO: New highest code address: %x\n", HighestCodeAddress);
+		SMP_msg("INFO: New highest code address: %llx\n", (uint64_t)HighestCodeAddress);
 	}
 	if (LowestGlobalVarAddress > TempLowestGlobalVarAddress) {
 		LowestGlobalVarAddress = TempLowestGlobalVarAddress;
-		SMP_msg("INFO: New lowest static data address: %x\n", LowestGlobalVarAddress);
+		SMP_msg("INFO: New lowest static data address: %llx\n", (uint64_t)LowestGlobalVarAddress);
 	}
 	if (HighestGlobalVarAddress < TempHighestGlobalVarAddress) {
 		HighestGlobalVarAddress = TempHighestGlobalVarAddress;
-		SMP_msg("INFO: New highest static data address: %x\n", HighestGlobalVarAddress);
+		SMP_msg("INFO: New highest static data address: %llx\n", (uint64_t)HighestGlobalVarAddress);
 	}
 
 	return;
-- 
GitLab