This commit is contained in:
Igor Pavlov
2016-05-23 00:00:00 +00:00
committed by Kornel Lesiński
parent bec3b479dc
commit 1eddf527ca
25 changed files with 86 additions and 74 deletions

View File

@@ -1740,10 +1740,10 @@ struct CTotalBenchRes
}
};
static void PrintNumber(IBenchPrintCallback &f, UInt64 value, int size)
static void PrintNumber(IBenchPrintCallback &f, UInt64 value, unsigned size)
{
char s[128];
int startPos = (int)sizeof(s) - 32;
unsigned startPos = (unsigned)sizeof(s) - 32;
memset(s, ' ', startPos);
ConvertUInt64ToString(value, s + startPos);
// if (withSpace)
@@ -1751,7 +1751,7 @@ static void PrintNumber(IBenchPrintCallback &f, UInt64 value, int size)
startPos--;
size++;
}
int len = (int)strlen(s + startPos);
unsigned len = (unsigned)strlen(s + startPos);
if (size > len)
{
startPos -= (size - len);
@@ -1761,26 +1761,26 @@ static void PrintNumber(IBenchPrintCallback &f, UInt64 value, int size)
f.Print(s + startPos);
}
static const int kFieldSize_Name = 12;
static const int kFieldSize_SmallName = 4;
static const int kFieldSize_Speed = 9;
static const int kFieldSize_Usage = 5;
static const int kFieldSize_RU = 6;
static const int kFieldSize_Rating = 6;
static const int kFieldSize_EU = 5;
static const int kFieldSize_Effec = 5;
static const unsigned kFieldSize_Name = 12;
static const unsigned kFieldSize_SmallName = 4;
static const unsigned kFieldSize_Speed = 9;
static const unsigned kFieldSize_Usage = 5;
static const unsigned kFieldSize_RU = 6;
static const unsigned kFieldSize_Rating = 6;
static const unsigned kFieldSize_EU = 5;
static const unsigned kFieldSize_Effec = 5;
static const int kFieldSize_TotalSize = 4 + kFieldSize_Speed + kFieldSize_Usage + kFieldSize_RU + kFieldSize_Rating;
static const int kFieldSize_EUAndEffec = 2 + kFieldSize_EU + kFieldSize_Effec;
static const unsigned kFieldSize_TotalSize = 4 + kFieldSize_Speed + kFieldSize_Usage + kFieldSize_RU + kFieldSize_Rating;
static const unsigned kFieldSize_EUAndEffec = 2 + kFieldSize_EU + kFieldSize_Effec;
static void PrintRating(IBenchPrintCallback &f, UInt64 rating, int size)
static void PrintRating(IBenchPrintCallback &f, UInt64 rating, unsigned size)
{
PrintNumber(f, (rating + 500000) / 1000000, size);
}
static void PrintPercents(IBenchPrintCallback &f, UInt64 val, UInt64 divider, int size)
static void PrintPercents(IBenchPrintCallback &f, UInt64 val, UInt64 divider, unsigned size)
{
PrintNumber(f, (val * 100 + divider / 2) / divider, size);
}
@@ -1882,7 +1882,7 @@ struct CBenchCallbackToPrint: public IBenchCallback
UInt32 DictSize;
bool Use2Columns;
int NameFieldSize;
unsigned NameFieldSize;
bool ShowFreq;
UInt64 CpuFreq;
@@ -2712,7 +2712,7 @@ HRESULT Bench(
f.NewLine();
f.Print("Size");
const int kFieldSize_CrcSpeed = 6;
const unsigned kFieldSize_CrcSpeed = 6;
unsigned numThreadsTests = 0;
for (;;)
{
@@ -2875,7 +2875,7 @@ HRESULT Bench(
showFreq = true;
}
int fileldSize = kFieldSize_TotalSize;
unsigned fileldSize = kFieldSize_TotalSize;
if (showFreq)
fileldSize += kFieldSize_EUAndEffec;
@@ -2943,9 +2943,8 @@ HRESULT Bench(
printCallback->NewLine();
HRESULT res;
int freqTest;
const int kNumCpuTests = 3;
for (freqTest = 0; freqTest < kNumCpuTests; freqTest++)
const unsigned kNumCpuTests = 3;
for (unsigned freqTest = 0; freqTest < kNumCpuTests; freqTest++)
{
PrintLeft(f, "CPU", kFieldSize_Name);
UInt32 resVal;

View File

@@ -497,7 +497,7 @@ static HRESULT Archive_GetArcProp_UInt(IInArchive *arc, PROPID propid, UInt64 &r
switch (prop.vt)
{
case VT_UI4: result = prop.ulVal; defined = true; break;
case VT_I4: result = prop.lVal; defined = true; break;
case VT_I4: result = (Int64)prop.lVal; defined = true; break;
case VT_UI8: result = (UInt64)prop.uhVal.QuadPart; defined = true; break;
case VT_I8: result = (UInt64)prop.hVal.QuadPart; defined = true; break;
case VT_EMPTY: break;
@@ -864,7 +864,7 @@ HRESULT CArc::GetItem(UInt32 index, CReadArcItem &item) const
{
item.MainPath.DeleteFrom(colon);
item.AltStreamName = item.Path.Ptr(colon + 1);
item.MainIsDir = (colon == 0 || IsPathSepar(item.Path[colon - 1]));
item.MainIsDir = (colon == 0 || IsPathSepar(item.Path[(unsigned)colon - 1]));
item.IsAltStream = true;
}
}

View File

@@ -310,7 +310,7 @@ void CLinkDialog::OnButton_Link()
void CApp::Link()
{
int srcPanelIndex = GetFocusedPanelIndex();
unsigned srcPanelIndex = GetFocusedPanelIndex();
CPanel &srcPanel = Panels[srcPanelIndex];
if (!srcPanel.IsFSFolder())
{

View File

@@ -310,7 +310,7 @@ HRESULT CThreadCrc::ProcessVirt()
HRESULT CApp::CalculateCrc2(const UString &methodName)
{
int srcPanelIndex = GetFocusedPanelIndex();
unsigned srcPanelIndex = GetFocusedPanelIndex();
CPanel &srcPanel = Panels[srcPanelIndex];
CRecordVector<UInt32> indices;
@@ -379,7 +379,7 @@ void CApp::CalculateCrc(const UString &methodName)
HRESULT res = CalculateCrc2(methodName);
if (res != S_OK && res != E_ABORT)
{
int srcPanelIndex = GetFocusedPanelIndex();
unsigned srcPanelIndex = GetFocusedPanelIndex();
CPanel &srcPanel = Panels[srcPanelIndex];
srcPanel.MessageBoxError(res);
}

View File

@@ -343,7 +343,7 @@ static HRESULT ShowDialog(
int index = FindActionSet(actionSet);
if (index < 0)
return E_NOTIMPL;
di.UpdateMode = g_UpdateMode_Pairs[index].UpdateMode;
di.UpdateMode = g_UpdateMode_Pairs[(unsigned)index].UpdateMode;
}
if (dialog.Create(hwndParent) != IDOK)