Clean up some compiler warnings

This commit is contained in:
Caelan Sayler
2021-12-20 12:51:03 +00:00
parent d713596bd8
commit 0b5c2ff2bc
7 changed files with 11 additions and 10 deletions

View File

@@ -52,7 +52,6 @@ bool hasEnding(std::wstring const& fullString, std::wstring const& ending)
void unzipSingleFile(BYTE* zipBuf, DWORD cZipBuf, wstring fileLocation, std::function<bool(ZIPENTRY&)>& predicate) void unzipSingleFile(BYTE* zipBuf, DWORD cZipBuf, wstring fileLocation, std::function<bool(ZIPENTRY&)>& predicate)
{ {
HZIP zipFile = OpenZip(zipBuf, cZipBuf, NULL); HZIP zipFile = OpenZip(zipBuf, cZipBuf, NULL);
//SetUnzipBaseDir(zipFile, targetDir);
bool unzipSuccess = false; bool unzipSuccess = false;
@@ -60,8 +59,6 @@ void unzipSingleFile(BYTE* zipBuf, DWORD cZipBuf, wstring fileLocation, std::fun
int index = 0; int index = 0;
do { do {
ZIPENTRY zentry; ZIPENTRY zentry;
wchar_t targetFile[MAX_PATH];
zr = GetZipItem(zipFile, index, &zentry); zr = GetZipItem(zipFile, index, &zentry);
if (zr != ZR_OK && zr != ZR_MORE) { if (zr != ZR_OK && zr != ZR_MORE) {
break; break;

View File

@@ -1650,16 +1650,16 @@ uInt* v) // working area: values in order of bit length
uInt f; // i repeats in table every f entries uInt f; // i repeats in table every f entries
int g; // maximum code length int g; // maximum code length
int h; // table level int h; // table level
register uInt i; // counter, current code /*register*/ uInt i; // counter, current code
register uInt j; // counter /*register*/ uInt j; // counter
register int k; // number of bits in current code /*register*/ int k; // number of bits in current code
int l; // bits per table (returned in m) int l; // bits per table (returned in m)
uInt mask; // (1 << w) - 1, to avoid cc -O bug on HP uInt mask; // (1 << w) - 1, to avoid cc -O bug on HP
register uInt* p; // pointer into c[], b[], or v[] /*register*/ uInt* p; // pointer into c[], b[], or v[]
inflate_huft* q; // points to current table inflate_huft* q; // points to current table
struct inflate_huft_s r; // table entry for structure assignment struct inflate_huft_s r; // table entry for structure assignment
inflate_huft* u[BMAX]; // table stack inflate_huft* u[BMAX]; // table stack
register int w; // bits before this table == (l * h) /*register*/ int w; // bits before this table == (l * h)
uInt x[BMAX + 1]; // bit offsets, then code stack uInt x[BMAX + 1]; // bit offsets, then code stack
uInt* xp; // pointer into x uInt* xp; // pointer into x
int y; // number of dummy codes added int y; // number of dummy codes added

View File

@@ -12,6 +12,7 @@
<PublishTrimmed>true</PublishTrimmed> <PublishTrimmed>true</PublishTrimmed>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile> <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -148,7 +148,7 @@ namespace SquirrelCli.Sources
private static string GetSHA1Checksum(byte[] bytes) private static string GetSHA1Checksum(byte[] bytes)
{ {
var sha = new System.Security.Cryptography.SHA1Managed(); var sha = System.Security.Cryptography.SHA1.Create();
byte[] checksum = sha.ComputeHash(bytes); byte[] checksum = sha.ComputeHash(bytes);
return BitConverter.ToString(checksum).Replace("-", String.Empty); return BitConverter.ToString(checksum).Replace("-", String.Empty);
} }

View File

@@ -61,6 +61,8 @@ std::wstring FindLatestAppDir()
continue; continue;
} }
#pragma warning( disable : 4244 ) // warning - conversion from 'wchar_t' to 'const _Elem', possible loss of data
std::string s(appVer.begin(), appVer.end()); std::string s(appVer.begin(), appVer.end());
version::Semver200_version thisVer(s); version::Semver200_version thisVer(s);

View File

@@ -11,6 +11,7 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile> <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -7,7 +7,7 @@
<Title>Squirrel.Tests</Title> <Title>Squirrel.Tests</Title>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<IsTest>true</IsTest> <IsTest>true</IsTest>
<NoWarn>CS1998</NoWarn> <NoWarn>CS1998,xUnit2015,xUnit2017,xUnit2005,xUnit2009,xUnit2013,xUnit2004</NoWarn>
<SignAssembly>True</SignAssembly> <SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\Squirrel.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>..\Squirrel.snk</AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>