1
mirror of https://github.com/hashcat/hashcat synced 2024-11-13 17:28:58 +01:00

Globally fix return parameter handling to not use brackets

This commit is contained in:
Jens Steube 2016-07-11 14:45:17 +02:00
parent 6ba0eb8b39
commit f1cd53e335
6 changed files with 100 additions and 100 deletions

View File

@ -81,7 +81,7 @@ static inline int CPU_ISSET (int num, cpu_set_t *cs) { return (cs->count & (1 <
exit (-1); \
} else { \
log_info ("WARNING: %s is missing from %s shared library.", #name, #libname); \
return (-1); \
return -1; \
} \
} \
}
@ -95,7 +95,7 @@ static inline int CPU_ISSET (int num, cpu_set_t *cs) { return (cs->count & (1 <
exit (-1); \
} else { \
log_info ("WARNING: %s is missing from %s shared library.", #name, #libname); \
return (-1); \
return -1; \
} \
} \
}
@ -108,7 +108,7 @@ static inline int CPU_ISSET (int num, cpu_set_t *cs) { return (cs->count & (1 <
exit (-1); \
} else { \
log_error ("WARNING: %s at address %08x is missing from %s shared library.", #name, addr, #libname); \
return (-1); \
return -1; \
} \
}

View File

@ -7,7 +7,7 @@
int adl_init (ADL_PTR *adl)
{
if (!adl) return (-1);
if (!adl) return -1;
memset (adl, 0, sizeof (ADL_PTR));
@ -27,7 +27,7 @@ int adl_init (ADL_PTR *adl)
//if (data.quiet == 0)
// log_info ("WARNING: load ADL library failed, proceed without ADL HWMon enabled.");
return (-1);
return -1;
}
HC_LOAD_FUNC(adl, ADL_Main_Control_Destroy, ADL_MAIN_CONTROL_DESTROY, ADL, 0)
@ -81,7 +81,7 @@ void adl_close (ADL_PTR *adl)
int hm_ADL_Main_Control_Destroy (ADL_PTR *adl)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Main_Control_Destroy ();
@ -95,7 +95,7 @@ int hm_ADL_Main_Control_Destroy (ADL_PTR *adl)
int hm_ADL_Main_Control_Create (ADL_PTR *adl, ADL_MAIN_MALLOC_CALLBACK callback, int iEnumConnectedAdapters)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Main_Control_Create (callback, iEnumConnectedAdapters);
@ -109,7 +109,7 @@ int hm_ADL_Main_Control_Create (ADL_PTR *adl, ADL_MAIN_MALLOC_CALLBACK callback,
int hm_ADL_Adapter_NumberOfAdapters_Get (ADL_PTR *adl, int *lpNumAdapters)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Adapter_NumberOfAdapters_Get (lpNumAdapters);
@ -123,7 +123,7 @@ int hm_ADL_Adapter_NumberOfAdapters_Get (ADL_PTR *adl, int *lpNumAdapters)
int hm_ADL_Adapter_AdapterInfo_Get (ADL_PTR *adl, LPAdapterInfo lpInfo, int iInputSize)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Adapter_AdapterInfo_Get (lpInfo, iInputSize);
@ -137,7 +137,7 @@ int hm_ADL_Adapter_AdapterInfo_Get (ADL_PTR *adl, LPAdapterInfo lpInfo, int iInp
int hm_ADL_Display_DisplayInfo_Get (ADL_PTR *adl, int iAdapterIndex, int *iNumDisplays, ADLDisplayInfo **lppInfo, int iForceDetect)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Display_DisplayInfo_Get (iAdapterIndex, iNumDisplays, lppInfo, iForceDetect);
@ -151,7 +151,7 @@ int hm_ADL_Display_DisplayInfo_Get (ADL_PTR *adl, int iAdapterIndex, int *iNumDi
int hm_ADL_Adapter_ID_Get (ADL_PTR *adl, int iAdapterIndex, int *lpAdapterID)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Adapter_ID_Get (iAdapterIndex, lpAdapterID);
@ -165,7 +165,7 @@ int hm_ADL_Adapter_ID_Get (ADL_PTR *adl, int iAdapterIndex, int *lpAdapterID)
int hm_ADL_Adapter_VideoBiosInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLBiosInfo *lpBiosInfo)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Adapter_VideoBiosInfo_Get (iAdapterIndex, lpBiosInfo);
@ -179,7 +179,7 @@ int hm_ADL_Adapter_VideoBiosInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLBiosIn
int hm_ADL_Overdrive_ThermalDevices_Enum (ADL_PTR *adl, int iAdapterIndex, int iThermalControllerIndex, ADLThermalControllerInfo *lpThermalControllerInfo)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_ThermalDevices_Enum (iAdapterIndex, iThermalControllerIndex, lpThermalControllerInfo);
@ -193,7 +193,7 @@ int hm_ADL_Overdrive_ThermalDevices_Enum (ADL_PTR *adl, int iAdapterIndex, int i
int hm_ADL_Overdrive5_Temperature_Get (ADL_PTR *adl, int iAdapterIndex, int iThermalControllerIndex, ADLTemperature *lpTemperature)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_Temperature_Get (iAdapterIndex, iThermalControllerIndex, lpTemperature);
@ -207,7 +207,7 @@ int hm_ADL_Overdrive5_Temperature_Get (ADL_PTR *adl, int iAdapterIndex, int iThe
int hm_ADL_Overdrive6_Temperature_Get (ADL_PTR *adl, int iAdapterIndex, int *iTemperature)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_Temperature_Get (iAdapterIndex, iTemperature);
@ -221,7 +221,7 @@ int hm_ADL_Overdrive6_Temperature_Get (ADL_PTR *adl, int iAdapterIndex, int *iTe
int hm_ADL_Overdrive_CurrentActivity_Get (ADL_PTR *adl, int iAdapterIndex, ADLPMActivity *lpActivity)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_CurrentActivity_Get (iAdapterIndex, lpActivity);
@ -235,7 +235,7 @@ int hm_ADL_Overdrive_CurrentActivity_Get (ADL_PTR *adl, int iAdapterIndex, ADLPM
int hm_ADL_Overdrive5_FanSpeedInfo_Get (ADL_PTR *adl, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedInfo *lpFanSpeedInfo)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_FanSpeedInfo_Get (iAdapterIndex, iThermalControllerIndex, lpFanSpeedInfo);
@ -249,7 +249,7 @@ int hm_ADL_Overdrive5_FanSpeedInfo_Get (ADL_PTR *adl, int iAdapterIndex, int iTh
int hm_ADL_Overdrive5_FanSpeed_Get (ADL_PTR *adl, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedValue *lpFanSpeedValue)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_FanSpeed_Get (iAdapterIndex, iThermalControllerIndex, lpFanSpeedValue);
@ -263,7 +263,7 @@ int hm_ADL_Overdrive5_FanSpeed_Get (ADL_PTR *adl, int iAdapterIndex, int iTherma
int hm_ADL_Overdrive6_FanSpeed_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6FanSpeedInfo *lpFanSpeedInfo)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Get (iAdapterIndex, lpFanSpeedInfo);
@ -277,7 +277,7 @@ int hm_ADL_Overdrive6_FanSpeed_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6FanSp
int hm_ADL_Overdrive5_FanSpeed_Set (ADL_PTR *adl, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedValue *lpFanSpeedValue)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_FanSpeed_Set (iAdapterIndex, iThermalControllerIndex, lpFanSpeedValue);
@ -291,7 +291,7 @@ int hm_ADL_Overdrive5_FanSpeed_Set (ADL_PTR *adl, int iAdapterIndex, int iTherma
int hm_ADL_Overdrive6_FanSpeed_Set (ADL_PTR *adl, int iAdapterIndex, ADLOD6FanSpeedValue *lpFanSpeedValue)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Set (iAdapterIndex, lpFanSpeedValue);
@ -305,7 +305,7 @@ int hm_ADL_Overdrive6_FanSpeed_Set (ADL_PTR *adl, int iAdapterIndex, ADLOD6FanSp
int hm_ADL_Overdrive5_FanSpeedToDefault_Set (ADL_PTR *adl, int iAdapterIndex, int iThermalControllerIndex)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_FanSpeedToDefault_Set (iAdapterIndex, iThermalControllerIndex);
@ -319,7 +319,7 @@ int hm_ADL_Overdrive5_FanSpeedToDefault_Set (ADL_PTR *adl, int iAdapterIndex, in
int hm_ADL_Overdrive_ODParameters_Get (ADL_PTR *adl, int iAdapterIndex, ADLODParameters *lpOdParameters)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_ODParameters_Get (iAdapterIndex, lpOdParameters);
@ -333,7 +333,7 @@ int hm_ADL_Overdrive_ODParameters_Get (ADL_PTR *adl, int iAdapterIndex, ADLODPar
int hm_ADL_Overdrive_ODPerformanceLevels_Get (ADL_PTR *adl, int iAdapterIndex, int iDefault, ADLODPerformanceLevels *lpOdPerformanceLevels)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_ODPerformanceLevels_Get (iAdapterIndex, iDefault, lpOdPerformanceLevels);
@ -347,7 +347,7 @@ int hm_ADL_Overdrive_ODPerformanceLevels_Get (ADL_PTR *adl, int iAdapterIndex, i
int hm_ADL_Overdrive_ODPerformanceLevels_Set (ADL_PTR *adl, int iAdapterIndex, ADLODPerformanceLevels *lpOdPerformanceLevels)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive5_ODPerformanceLevels_Set (iAdapterIndex, lpOdPerformanceLevels);
@ -361,7 +361,7 @@ int hm_ADL_Overdrive_ODPerformanceLevels_Set (ADL_PTR *adl, int iAdapterIndex, A
int hm_ADL_Overdrive_PowerControlInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6PowerControlInfo *powertune)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_PowerControlInfo_Get (iAdapterIndex, powertune);
@ -370,7 +370,7 @@ int hm_ADL_Overdrive_PowerControlInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLO
int hm_ADL_Overdrive_PowerControl_Get (ADL_PTR *adl, int iAdapterIndex, int *iCurrentValue)
{
if (!adl) return (-1);
if (!adl) return -1;
int default_value = 0;
@ -381,7 +381,7 @@ int hm_ADL_Overdrive_PowerControl_Get (ADL_PTR *adl, int iAdapterIndex, int *iCu
int hm_ADL_Overdrive_PowerControl_Set (ADL_PTR *adl, int iAdapterIndex, int level)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = ADL_ERR;
@ -418,7 +418,7 @@ int hm_ADL_Overdrive_PowerControl_Set (ADL_PTR *adl, int iAdapterIndex, int leve
int hm_ADL_Adapter_Active_Get (ADL_PTR *adl, int iAdapterIndex, int *lpStatus)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Adapter_Active_Get (iAdapterIndex, lpStatus);
@ -433,7 +433,7 @@ int hm_ADL_Adapter_Active_Get (ADL_PTR *adl, int iAdapterIndex, int *lpStatus)
/*
int hm_ADL_DisplayEnable_Set (ADL_PTR *adl, int iAdapterIndex, int *lpDisplayIndexList, int iDisplayListSize, int bPersistOnly)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_DisplayEnable_Set (iAdapterIndex, lpDisplayIndexList, iDisplayListSize, bPersistOnly);
@ -448,7 +448,7 @@ int hm_ADL_DisplayEnable_Set (ADL_PTR *adl, int iAdapterIndex, int *lpDisplayInd
int hm_ADL_Overdrive_Caps (ADL_PTR *adl, int iAdapterIndex, int *od_supported, int *od_enabled, int *od_version)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive_Caps (iAdapterIndex, od_supported, od_enabled, od_version);
@ -457,7 +457,7 @@ int hm_ADL_Overdrive_Caps (ADL_PTR *adl, int iAdapterIndex, int *od_supported, i
int hm_ADL_Overdrive6_PowerControl_Caps (ADL_PTR *adl, int iAdapterIndex, int *lpSupported)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_PowerControl_Caps (iAdapterIndex, lpSupported);
@ -466,7 +466,7 @@ int hm_ADL_Overdrive6_PowerControl_Caps (ADL_PTR *adl, int iAdapterIndex, int *l
int hm_ADL_Overdrive_Capabilities_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6Capabilities *caps)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_Capabilities_Get (iAdapterIndex, caps);
@ -475,7 +475,7 @@ int hm_ADL_Overdrive_Capabilities_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6Ca
int hm_ADL_Overdrive_StateInfo_Get (ADL_PTR *adl, int iAdapterIndex, int type, ADLOD6MemClockState *state)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_StateInfo_Get (iAdapterIndex, type, state);
@ -523,7 +523,7 @@ int hm_ADL_Overdrive_StateInfo_Get (ADL_PTR *adl, int iAdapterIndex, int type, A
int hm_ADL_Overdrive_CurrentStatus_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6CurrentStatus *status)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_CurrentStatus_Get (iAdapterIndex, status);
@ -532,7 +532,7 @@ int hm_ADL_Overdrive_CurrentStatus_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6C
int hm_ADL_Overdrive_State_Set (ADL_PTR *adl, int iAdapterIndex, int type, ADLOD6StateInfo *state)
{
if (!adl) return (-1);
if (!adl) return -1;
// sanity checks
@ -580,7 +580,7 @@ int hm_ADL_Overdrive_State_Set (ADL_PTR *adl, int iAdapterIndex, int type, ADLOD
int hm_ADL_Overdrive6_TargetTemperatureData_Get (ADL_PTR *adl, int iAdapterIndex, int *cur_temp, int *default_temp)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_TargetTemperatureData_Get (iAdapterIndex, cur_temp, default_temp);
@ -589,7 +589,7 @@ int hm_ADL_Overdrive6_TargetTemperatureData_Get (ADL_PTR *adl, int iAdapterIndex
int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6ParameterRange *lpTargetTemperatureInfo)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_TargetTemperatureRangeInfo_Get (iAdapterIndex, lpTargetTemperatureInfo);
@ -598,7 +598,7 @@ int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (ADL_PTR *adl, int iAdapter
int hm_ADL_Overdrive6_FanSpeed_Reset (ADL_PTR *adl, int iAdapterIndex)
{
if (!adl) return (-1);
if (!adl) return -1;
int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Reset (iAdapterIndex);

View File

@ -9,7 +9,7 @@
int nvapi_init (NVAPI_PTR *nvapi)
{
if (!nvapi) return (-1);
if (!nvapi) return -1;
memset (nvapi, 0, sizeof (NVAPI_PTR));
@ -28,7 +28,7 @@ int nvapi_init (NVAPI_PTR *nvapi)
//if (data.quiet == 0)
// log_info ("WARNING: load NVAPI library failed, proceed without NVAPI HWMon enabled.");
return (-1);
return -1;
}
HC_LOAD_FUNC(nvapi, nvapi_QueryInterface, NVAPI_QUERYINTERFACE, NVAPI, 0)
@ -57,7 +57,7 @@ void nvapi_close (NVAPI_PTR *nvapi)
int hm_NvAPI_Initialize (NVAPI_PTR *nvapi)
{
if (!nvapi) return (-1);
if (!nvapi) return -1;
NvAPI_Status NvAPI_rc = nvapi->NvAPI_Initialize ();
@ -77,7 +77,7 @@ int hm_NvAPI_Initialize (NVAPI_PTR *nvapi)
int hm_NvAPI_Unload (NVAPI_PTR *nvapi)
{
if (!nvapi) return (-1);
if (!nvapi) return -1;
NvAPI_Status NvAPI_rc = nvapi->NvAPI_Unload ();
@ -95,14 +95,14 @@ int hm_NvAPI_Unload (NVAPI_PTR *nvapi)
int hm_NvAPI_GetErrorMessage (NVAPI_PTR *nvapi, NvAPI_Status NvAPI_rc, NvAPI_ShortString string)
{
if (!nvapi) return (-1);
if (!nvapi) return -1;
return nvapi->NvAPI_GetErrorMessage (NvAPI_rc, string);
}
int hm_NvAPI_EnumPhysicalGPUs (NVAPI_PTR *nvapi, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount)
{
if (!nvapi) return (-1);
if (!nvapi) return -1;
NvAPI_Status NvAPI_rc = nvapi->NvAPI_EnumPhysicalGPUs (nvGPUHandle, pGpuCount);
@ -120,7 +120,7 @@ int hm_NvAPI_EnumPhysicalGPUs (NVAPI_PTR *nvapi, NvPhysicalGpuHandle nvGPUHandle
int hm_NvAPI_GPU_GetPerfPoliciesInfo (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 *perfPolicies_info)
{
if (!nvapi) return (-1);
if (!nvapi) return -1;
NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetPerfPoliciesInfo (hPhysicalGpu, perfPolicies_info);
@ -138,7 +138,7 @@ int hm_NvAPI_GPU_GetPerfPoliciesInfo (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhy
int hm_NvAPI_GPU_GetPerfPoliciesStatus (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *perfPolicies_status)
{
if (!nvapi) return (-1);
if (!nvapi) return -1;
NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetPerfPoliciesStatus (hPhysicalGpu, perfPolicies_status);
@ -156,7 +156,7 @@ int hm_NvAPI_GPU_GetPerfPoliciesStatus (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hP
int hm_NvAPI_GPU_SetCoolerLevels (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex, NV_GPU_COOLER_LEVELS *pCoolerLevels)
{
if (!nvapi) return (-1);
if (!nvapi) return -1;
NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_SetCoolerLevels (hPhysicalGpu, coolerIndex, pCoolerLevels);
@ -174,7 +174,7 @@ int hm_NvAPI_GPU_SetCoolerLevels (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysica
int hm_NvAPI_GPU_RestoreCoolerSettings (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex)
{
if (!nvapi) return (-1);
if (!nvapi) return -1;
NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_RestoreCoolerSettings (hPhysicalGpu, coolerIndex);

View File

@ -9,7 +9,7 @@
int nvml_init (NVML_PTR *nvml)
{
if (!nvml) return (-1);
if (!nvml) return -1;
memset (nvml, 0, sizeof (NVML_PTR));
@ -40,7 +40,7 @@ int nvml_init (NVML_PTR *nvml)
if (data.quiet == 0)
log_info ("WARNING: NVML library load failed, proceed without NVML HWMon enabled.");
return (-1);
return -1;
}
HC_LOAD_FUNC(nvml, nvmlErrorString, NVML_ERROR_STRING, NVML, 0)

View File

@ -7,14 +7,14 @@
int xnvctrl_init (XNVCTRL_PTR *xnvctrl)
{
if (!xnvctrl) return (-1);
if (!xnvctrl) return -1;
memset (xnvctrl, 0, sizeof (XNVCTRL_PTR));
#ifdef _WIN
// unsupport platform?
return (-1);
return -1;
#elif _POSIX

View File

@ -2756,13 +2756,13 @@ int hm_get_adapter_index_nvapi (HM_ADAPTER_NVAPI nvapiGPUHandle[DEVICES_MAX])
{
NvU32 pGpuCount;
if (hm_NvAPI_EnumPhysicalGPUs (data.hm_nvapi, nvapiGPUHandle, &pGpuCount) != NVAPI_OK) return (0);
if (hm_NvAPI_EnumPhysicalGPUs (data.hm_nvapi, nvapiGPUHandle, &pGpuCount) != NVAPI_OK) return 0;
if (pGpuCount == 0)
{
log_info ("WARN: No NvAPI adapters found");
return (0);
return 0;
}
return (pGpuCount);
@ -2787,7 +2787,7 @@ int hm_get_adapter_index_nvml (HM_ADAPTER_NVML nvmlGPUHandle[DEVICES_MAX])
{
log_info ("WARN: No NVML adapters found");
return (0);
return 0;
}
return (pGpuCount);
@ -4647,7 +4647,7 @@ int sort_by_salt (const void *v1, const void *v2)
while (n--)
{
if (s1->salt_buf[n] > s2->salt_buf[n]) return ( 1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return (-1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return -1;
}
n = 8;
@ -4655,10 +4655,10 @@ int sort_by_salt (const void *v1, const void *v2)
while (n--)
{
if (s1->salt_buf_pc[n] > s2->salt_buf_pc[n]) return ( 1);
if (s1->salt_buf_pc[n] < s2->salt_buf_pc[n]) return (-1);
if (s1->salt_buf_pc[n] < s2->salt_buf_pc[n]) return -1;
}
return (0);
return 0;
}
int sort_by_salt_buf (const void *v1, const void *v2)
@ -4677,7 +4677,7 @@ int sort_by_salt_buf (const void *v1, const void *v2)
while (n--)
{
if (s1->salt_buf[n] > s2->salt_buf[n]) return ( 1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return (-1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return -1;
}
return 0;
@ -4697,20 +4697,20 @@ int sort_by_hash_t_salt (const void *v1, const void *v2)
while (n--)
{
if (s1->salt_buf[n] > s2->salt_buf[n]) return ( 1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return (-1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return -1;
}
/* original code, seems buggy since salt_len can be very big (had a case with 131 len)
also it thinks salt_buf[x] is a char but its a uint so salt_len should be / 4
if (s1->salt_len > s2->salt_len) return ( 1);
if (s1->salt_len < s2->salt_len) return (-1);
if (s1->salt_len < s2->salt_len) return -1;
uint n = s1->salt_len;
while (n--)
{
if (s1->salt_buf[n] > s2->salt_buf[n]) return ( 1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return (-1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return -1;
}
*/
@ -4732,7 +4732,7 @@ int sort_by_hash_t_salt_hccap (const void *v1, const void *v2)
while (n--)
{
if (s1->salt_buf[n] > s2->salt_buf[n]) return ( 1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return (-1);
if (s1->salt_buf[n] < s2->salt_buf[n]) return -1;
}
return 0;
@ -4848,10 +4848,10 @@ int sort_by_digest_4_2 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_4_4 (const void *v1, const void *v2)
@ -4864,10 +4864,10 @@ int sort_by_digest_4_4 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_4_5 (const void *v1, const void *v2)
@ -4880,10 +4880,10 @@ int sort_by_digest_4_5 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_4_6 (const void *v1, const void *v2)
@ -4896,10 +4896,10 @@ int sort_by_digest_4_6 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_4_8 (const void *v1, const void *v2)
@ -4912,10 +4912,10 @@ int sort_by_digest_4_8 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_4_16 (const void *v1, const void *v2)
@ -4928,10 +4928,10 @@ int sort_by_digest_4_16 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_4_32 (const void *v1, const void *v2)
@ -4944,10 +4944,10 @@ int sort_by_digest_4_32 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_4_64 (const void *v1, const void *v2)
@ -4960,10 +4960,10 @@ int sort_by_digest_4_64 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_8_8 (const void *v1, const void *v2)
@ -4976,10 +4976,10 @@ int sort_by_digest_8_8 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_8_16 (const void *v1, const void *v2)
@ -4992,10 +4992,10 @@ int sort_by_digest_8_16 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_8_25 (const void *v1, const void *v2)
@ -5008,10 +5008,10 @@ int sort_by_digest_8_25 (const void *v1, const void *v2)
while (n--)
{
if (d1[n] > d2[n]) return ( 1);
if (d1[n] < d2[n]) return (-1);
if (d1[n] < d2[n]) return -1;
}
return (0);
return 0;
}
int sort_by_digest_p0p1 (const void *v1, const void *v2)
@ -5025,15 +5025,15 @@ int sort_by_digest_p0p1 (const void *v1, const void *v2)
const uint dgst_pos3 = data.dgst_pos3;
if (d1[dgst_pos3] > d2[dgst_pos3]) return ( 1);
if (d1[dgst_pos3] < d2[dgst_pos3]) return (-1);
if (d1[dgst_pos3] < d2[dgst_pos3]) return -1;
if (d1[dgst_pos2] > d2[dgst_pos2]) return ( 1);
if (d1[dgst_pos2] < d2[dgst_pos2]) return (-1);
if (d1[dgst_pos2] < d2[dgst_pos2]) return -1;
if (d1[dgst_pos1] > d2[dgst_pos1]) return ( 1);
if (d1[dgst_pos1] < d2[dgst_pos1]) return (-1);
if (d1[dgst_pos1] < d2[dgst_pos1]) return -1;
if (d1[dgst_pos0] > d2[dgst_pos0]) return ( 1);
if (d1[dgst_pos0] < d2[dgst_pos0]) return (-1);
if (d1[dgst_pos0] < d2[dgst_pos0]) return -1;
return (0);
return 0;
}
int sort_by_tuning_db_alias (const void *v1, const void *v2)
@ -21139,11 +21139,11 @@ int cpu_rule_to_kernel_rule (char *rule_buf, uint rule_len, kernel_rule_t *rule)
break;
case RULE_OP_MANGLE_PURGECHAR:
return (-1);
return -1;
break;
case RULE_OP_MANGLE_TOGGLECASE_REC:
return (-1);
return -1;
break;
case RULE_OP_MANGLE_DUPECHAR_FIRST:
@ -21219,14 +21219,14 @@ int cpu_rule_to_kernel_rule (char *rule_buf, uint rule_len, kernel_rule_t *rule)
break;
default:
return (-1);
return -1;
break;
}
}
if (rule_pos < rule_len) return (-1);
if (rule_pos < rule_len) return -1;
return (0);
return 0;
}
int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule)
@ -21358,11 +21358,11 @@ int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule)
break;
case RULE_OP_MANGLE_PURGECHAR:
return (-1);
return -1;
break;
case RULE_OP_MANGLE_TOGGLECASE_REC:
return (-1);
return -1;
break;
case RULE_OP_MANGLE_DUPECHAR_FIRST:
@ -21442,7 +21442,7 @@ int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule)
break;
default:
return (-1);
return -1;
break;
}
}
@ -21452,7 +21452,7 @@ int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule)
return rule_pos;
}
return (-1);
return -1;
}
/**