Skip to content

Commit

Permalink
Quick : more fix for converting int to eReturnValue.
Browse files Browse the repository at this point in the history
  • Loading branch information
sharma-nidhi committed May 14, 2024
1 parent 1b577ad commit 6d72c62
Show file tree
Hide file tree
Showing 20 changed files with 316 additions and 316 deletions.
2 changes: 1 addition & 1 deletion subprojects/opensea-common
2 changes: 1 addition & 1 deletion subprojects/wingetopt
Submodule wingetopt updated 1 files
+2 −1 GNUmakefile
20 changes: 10 additions & 10 deletions utils/C/openSeaChest/openSeaChest_Basics.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int main(int argc, char *argv[])
SHOW_CONCURRENT_RANGES_VAR
LOWLEVEL_INFO_VAR

int args = 0;
int args = 0;
int argIndex = 0;
int optionIndex = 0;

Expand Down Expand Up @@ -699,11 +699,11 @@ int main(int argc, char *argv[])
print_Elevated_Privileges_Text();
}
unsigned int scanControl = DEFAULT_SCAN;
if(AGRESSIVE_SCAN_FLAG)
if (AGRESSIVE_SCAN_FLAG)
{
scanControl |= AGRESSIVE_SCAN;
}
#if defined (__linux__)
#if defined (__linux__)
if (SCAN_FLAGS.scanSD)
{
scanControl |= SD_HANDLES;
Expand All @@ -712,7 +712,7 @@ int main(int argc, char *argv[])
{
scanControl |= SG_TO_SD;
}
#endif
#endif
//set the drive types to show (if none are set, the lower level code assumes we need to show everything)
if (SCAN_FLAGS.scanATA)
{
Expand Down Expand Up @@ -821,8 +821,8 @@ int main(int argc, char *argv[])
}

if ((FORCE_SCSI_FLAG && FORCE_ATA_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG && FORCE_ATA_UDMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_UDMA_FLAG)
Expand Down Expand Up @@ -994,9 +994,9 @@ int main(int argc, char *argv[])
if ((deviceList[handleIter].os_info.fd < 0) ||
#else
if (((deviceList[handleIter].os_info.fd < 0) &&
(deviceList[handleIter].os_info.nvmeFd == NULL)) ||
(deviceList[handleIter].os_info.nvmeFd == NULL)) ||
#endif
(ret == FAILURE || ret == PERMISSION_DENIED))
(ret == FAILURE || ret == PERMISSION_DENIED))
#else
if ((deviceList[handleIter].os_info.fd == INVALID_HANDLE_VALUE) || (ret == FAILURE || ret == PERMISSION_DENIED))
#endif
Expand Down Expand Up @@ -2075,7 +2075,7 @@ int main(int argc, char *argv[])
{
double mCapacity = 0, capacity = 0;
char mCapUnits[UNIT_STRING_LENGTH] = { 0 }, capUnits[UNIT_STRING_LENGTH] = { 0 };
char* mCapUnit = &mCapUnits[0], * capUnit = &capUnits[0];
char* mCapUnit = &mCapUnits[0], *capUnit = &capUnits[0];
mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.deviceMaxLba * deviceList[deviceIter].drive_info.deviceBlockSize);
capacity = mCapacity;
metric_Unit_Convert(&mCapacity, &mCapUnit);
Expand Down Expand Up @@ -2113,7 +2113,7 @@ int main(int argc, char *argv[])
{
double mCapacity = 0, capacity = 0;
char mCapUnits[UNIT_STRING_LENGTH] = { 0 }, capUnits[UNIT_STRING_LENGTH] = { 0 };
char* mCapUnit = &mCapUnits[0], * capUnit = &capUnits[0];
char* mCapUnit = &mCapUnits[0], *capUnit = &capUnits[0];
mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.deviceMaxLba * deviceList[deviceIter].drive_info.deviceBlockSize);
capacity = mCapacity;
metric_Unit_Convert(&mCapacity, &mCapUnit);
Expand Down
26 changes: 13 additions & 13 deletions utils/C/openSeaChest/openSeaChest_Configure.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ int main(int argc, char *argv[])
ATA_DCO_SETMAXMODE_VARS
ATA_DCO_DISABLE_FEATURES_VARS

int args = 0;
int args = 0;
int argIndex = 0;
int optionIndex = 0;

Expand Down Expand Up @@ -779,7 +779,7 @@ int main(int argc, char *argv[])
if (strncmp(optarg, "file", 4) == 0)
{
//format is file=filename.txt
int sscanfRes = sscanf(optarg, SCSI_SET_MP_SSCANF_FILE_FORMAT_STR , SCSI_SET_MP_FILENAME);
int sscanfRes = sscanf(optarg, SCSI_SET_MP_SSCANF_FILE_FORMAT_STR, SCSI_SET_MP_FILENAME);
if (sscanfRes < 1 || sscanfRes == EOF)
{
print_Error_In_Cmd_Line_Args(SCSI_SET_MP_LONG_OPT_STRING, optarg);
Expand All @@ -799,7 +799,7 @@ int main(int argc, char *argv[])
else
{
//formatted as mp[-sp]:byte:highbit:fieldWidth=value
#define PARSE_MP_PAGE_AND_SUBPAGE_LENGTH 8
#define PARSE_MP_PAGE_AND_SUBPAGE_LENGTH 8
char pageAndSubpage[PARSE_MP_PAGE_AND_SUBPAGE_LENGTH] = { 0 };
char *token = strtok(optarg, ":=");
uint8_t tokenCounter = 0;
Expand Down Expand Up @@ -1170,7 +1170,7 @@ int main(int argc, char *argv[])
{
//error, unknown option
safe_Free(dcoDisableFeatList)
ATA_DCO_DISABLE_FEATURES = false;
ATA_DCO_DISABLE_FEATURES = false;
print_Error_In_Cmd_Line_Args(ATA_DCO_DISABLE_FEEATURES_LONG_OPT_STRING, optarg);
exit(UTIL_EXIT_ERROR_IN_COMMAND_LINE);
}
Expand Down Expand Up @@ -1372,7 +1372,7 @@ int main(int argc, char *argv[])
print_Elevated_Privileges_Text();
}
unsigned int scanControl = DEFAULT_SCAN;
if(AGRESSIVE_SCAN_FLAG)
if (AGRESSIVE_SCAN_FLAG)
{
scanControl |= AGRESSIVE_SCAN;
}
Expand Down Expand Up @@ -1494,8 +1494,8 @@ int main(int argc, char *argv[])
}

if ((FORCE_SCSI_FLAG && FORCE_ATA_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG && FORCE_ATA_UDMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_UDMA_FLAG)
Expand Down Expand Up @@ -1686,9 +1686,9 @@ int main(int argc, char *argv[])
if ((deviceList[handleIter].os_info.fd < 0) ||
#else
if (((deviceList[handleIter].os_info.fd < 0) &&
(deviceList[handleIter].os_info.nvmeFd == NULL)) ||
(deviceList[handleIter].os_info.nvmeFd == NULL)) ||
#endif
(ret == FAILURE || ret == PERMISSION_DENIED))
(ret == FAILURE || ret == PERMISSION_DENIED))
#else
if ((deviceList[handleIter].os_info.fd == INVALID_HANDLE_VALUE) || (ret == FAILURE || ret == PERMISSION_DENIED))
#endif
Expand Down Expand Up @@ -1880,7 +1880,7 @@ int main(int argc, char *argv[])
{
dcoData dco;
memset(&dco, 0, sizeof(dcoData));
switch(dco_Identify(&deviceList[deviceIter], &dco))
switch (dco_Identify(&deviceList[deviceIter], &dco))
{
case SUCCESS:
show_DCO_Identify_Data(&dco);
Expand Down Expand Up @@ -1995,7 +1995,7 @@ int main(int argc, char *argv[])
dco.mwdma.mwdma1 = false;
dco.mwdma.mwdma2 = false;
//now go turn modes on to highest supported value
switch(ATA_DCO_SETMAXMODE_VALUE)
switch (ATA_DCO_SETMAXMODE_VALUE)
{
case 10://udma6
dco.udma.udma6 = true;
Expand Down Expand Up @@ -3239,7 +3239,7 @@ int main(int argc, char *argv[])
{
double mCapacity = 0, capacity = 0;
char mCapUnits[UNIT_STRING_LENGTH] = { 0 }, capUnits[UNIT_STRING_LENGTH] = { 0 };
char* mCapUnit = &mCapUnits[0], * capUnit = &capUnits[0];
char* mCapUnit = &mCapUnits[0], *capUnit = &capUnits[0];
if (deviceList[deviceIter].drive_info.bridge_info.isValid)
{
mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.bridge_info.childDeviceMaxLba * deviceList[deviceIter].drive_info.bridge_info.childDeviceBlockSize);
Expand Down Expand Up @@ -3293,7 +3293,7 @@ int main(int argc, char *argv[])
{
double mCapacity = 0, capacity = 0;
char mCapUnits[UNIT_STRING_LENGTH] = { 0 }, capUnits[UNIT_STRING_LENGTH] = { 0 };
char* mCapUnit = &mCapUnits[0], * capUnit = &capUnits[0];
char* mCapUnit = &mCapUnits[0], *capUnit = &capUnits[0];
if (deviceList[deviceIter].drive_info.bridge_info.isValid)
{
mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.bridge_info.childDeviceMaxLba * deviceList[deviceIter].drive_info.bridge_info.childDeviceBlockSize);
Expand Down
40 changes: 20 additions & 20 deletions utils/C/openSeaChest/openSeaChest_Erase.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main(int argc, char *argv[])
/////////////////
//common utility variables
eReturnValues ret = SUCCESS;
int exitCode = UTIL_EXIT_NO_ERROR;
int exitCode = UTIL_EXIT_NO_ERROR;
DEVICE_UTIL_VARS
DEVICE_INFO_VAR
SAT_INFO_VAR
Expand Down Expand Up @@ -162,7 +162,7 @@ int main(int argc, char *argv[])
ERASE_RESTORE_MAX_VAR
REFRESH_FILE_SYSTEMS_VAR

int args = 0;
int args = 0;
int argIndex = 0;
int optionIndex = 0;

Expand Down Expand Up @@ -995,11 +995,11 @@ int main(int argc, char *argv[])
print_Elevated_Privileges_Text();
}
unsigned int scanControl = DEFAULT_SCAN;
if(AGRESSIVE_SCAN_FLAG)
if (AGRESSIVE_SCAN_FLAG)
{
scanControl |= AGRESSIVE_SCAN;
}
#if defined (__linux__)
#if defined (__linux__)
if (SCAN_FLAGS.scanSD)
{
scanControl |= SD_HANDLES;
Expand All @@ -1008,7 +1008,7 @@ int main(int argc, char *argv[])
{
scanControl |= SG_TO_SD;
}
#endif
#endif
//set the drive types to show (if none are set, the lower level code assumes we need to show everything)
if (SCAN_FLAGS.scanATA)
{
Expand Down Expand Up @@ -1212,8 +1212,8 @@ int main(int argc, char *argv[])
}

if ((FORCE_SCSI_FLAG && FORCE_ATA_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG && FORCE_ATA_UDMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_UDMA_FLAG)
Expand Down Expand Up @@ -1382,9 +1382,9 @@ int main(int argc, char *argv[])
if ((deviceList[handleIter].os_info.fd < 0) ||
#else
if (((deviceList[handleIter].os_info.fd < 0) &&
(deviceList[handleIter].os_info.nvmeFd == NULL)) ||
(deviceList[handleIter].os_info.nvmeFd == NULL)) ||
#endif
(ret == FAILURE || ret == PERMISSION_DENIED))
(ret == FAILURE || ret == PERMISSION_DENIED))
#else
if ((deviceList[handleIter].os_info.fd == INVALID_HANDLE_VALUE) || (ret == FAILURE || ret == PERMISSION_DENIED))
#endif
Expand All @@ -1394,7 +1394,7 @@ int main(int argc, char *argv[])
printf("Error: Could not open handle to %s\n", HANDLE_LIST[handleIter]);
}
free_Handle_List(&HANDLE_LIST, DEVICE_LIST_COUNT);
if(ret == PERMISSION_DENIED || !is_Running_Elevated())
if (ret == PERMISSION_DENIED || !is_Running_Elevated())
{
exit(UTIL_EXIT_NEED_ELEVATED_PRIVILEGES);
}
Expand Down Expand Up @@ -1755,7 +1755,7 @@ int main(int argc, char *argv[])
{
double mCapacity = 0, capacity = 0;
char mCapUnits[UNIT_STRING_LENGTH] = { 0 }, capUnits[UNIT_STRING_LENGTH] = { 0 };
char* mCapUnit = &mCapUnits[0], * capUnit = &capUnits[0];
char* mCapUnit = &mCapUnits[0], *capUnit = &capUnits[0];
if (deviceList[deviceIter].drive_info.bridge_info.isValid)
{
mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.bridge_info.childDeviceMaxLba * deviceList[deviceIter].drive_info.bridge_info.childDeviceBlockSize);
Expand Down Expand Up @@ -2133,7 +2133,7 @@ int main(int argc, char *argv[])
break;
}
}

if (SANITIZE_INFO_FLAG)
{
sanitizeFeaturesSupported sanitizeOptions;
Expand Down Expand Up @@ -2385,7 +2385,7 @@ int main(int argc, char *argv[])
if (VERBOSITY_QUIET < toolVerbosity)
{
printf("Sanitize command failed!\n");
#if defined (_WIN32)
#if defined (_WIN32)
if (!is_Windows_PE())
{
printf("\tNote: Windows 8 and higher block sanitize commands.\n");
Expand All @@ -2395,7 +2395,7 @@ int main(int argc, char *argv[])
printf("\t are permitted.\n");
printf("\t The Windows PE/RE environments allow all sanitize operations.\n");
}
#endif //_WIN32
#endif //_WIN32
}
exitCode = UTIL_EXIT_OPERATION_FAILURE;
break;
Expand Down Expand Up @@ -3318,16 +3318,16 @@ void utility_Usage(bool shortUsage)
print_Fast_Discovery_Help(shortUsage);
print_Time_Hours_Help(shortUsage);
print_Time_Minutes_Help(shortUsage);
#if !defined(DISABLE_TCG_SUPPORT)
#if !defined(DISABLE_TCG_SUPPORT)
print_TCG_PSID_Help(shortUsage);
#endif
#endif
print_Time_Seconds_Help(shortUsage);
print_Erase_Restore_Max_Prep_Help(shortUsage);
print_Refresh_Filesystems_Help(shortUsage);
print_Show_Supported_Erase_Modes_Help(shortUsage);
#if !defined(DISABLE_TCG_SUPPORT)
#if !defined(DISABLE_TCG_SUPPORT)
print_TCG_SID_Help(shortUsage);
#endif
#endif
print_Zero_Verify_Help(shortUsage);

//SATA Only Options
Expand Down Expand Up @@ -3371,10 +3371,10 @@ void utility_Usage(bool shortUsage)
print_Sanitize_Overwrite_Passes_Help(shortUsage);
print_Pattern_Help(shortUsage);
print_Perform_Quickest_Erase_Help(shortUsage);
#if !defined(DISABLE_TCG_SUPPORT)
#if !defined(DISABLE_TCG_SUPPORT)
print_Revert_Help(shortUsage);
print_RevertSP_Help(shortUsage);
#endif
#endif
print_Sanitize_Help(shortUsage, util_name);
print_Trim_Unmap_Help(shortUsage);
print_Trim_Unmap_Range_Help(shortUsage);
Expand Down
18 changes: 9 additions & 9 deletions utils/C/openSeaChest/openSeaChest_Firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int main(int argc, char *argv[])
#endif
LOWLEVEL_INFO_VAR

int args = 0;
int args = 0;
int argIndex = 0;
int optionIndex = 0;

Expand Down Expand Up @@ -445,11 +445,11 @@ int main(int argc, char *argv[])
print_Elevated_Privileges_Text();
}
unsigned int scanControl = DEFAULT_SCAN;
if(AGRESSIVE_SCAN_FLAG)
if (AGRESSIVE_SCAN_FLAG)
{
scanControl |= AGRESSIVE_SCAN;
}
#if defined (__linux__)
#if defined (__linux__)
if (SCAN_FLAGS.scanSD)
{
scanControl |= SD_HANDLES;
Expand All @@ -458,7 +458,7 @@ int main(int argc, char *argv[])
{
scanControl |= SG_TO_SD;
}
#endif
#endif
//set the drive types to show (if none are set, the lower level code assumes we need to show everything)
if (SCAN_FLAGS.scanATA)
{
Expand Down Expand Up @@ -567,8 +567,8 @@ int main(int argc, char *argv[])
}

if ((FORCE_SCSI_FLAG && FORCE_ATA_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG && FORCE_ATA_UDMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_UDMA_FLAG)
Expand Down Expand Up @@ -722,9 +722,9 @@ int main(int argc, char *argv[])
if ((deviceList[handleIter].os_info.fd < 0) ||
#else
if (((deviceList[handleIter].os_info.fd < 0) &&
(deviceList[handleIter].os_info.nvmeFd == NULL)) ||
(deviceList[handleIter].os_info.nvmeFd == NULL)) ||
#endif
(ret == FAILURE || ret == PERMISSION_DENIED))
(ret == FAILURE || ret == PERMISSION_DENIED))
#else
if ((deviceList[handleIter].os_info.fd == INVALID_HANDLE_VALUE) || (ret == FAILURE || ret == PERMISSION_DENIED))
#endif
Expand All @@ -734,7 +734,7 @@ int main(int argc, char *argv[])
printf("Error: Could not open handle to %s\n", HANDLE_LIST[handleIter]);
}
free_Handle_List(&HANDLE_LIST, DEVICE_LIST_COUNT);
if(ret == PERMISSION_DENIED || !is_Running_Elevated())
if (ret == PERMISSION_DENIED || !is_Running_Elevated())
{
exit(UTIL_EXIT_NEED_ELEVATED_PRIVILEGES);
}
Expand Down
Loading

0 comments on commit 6d72c62

Please sign in to comment.