fixed bug #1005296 - NSIS build error on Linux with g++ 3.4.0
- upgraded to the latest LZMA SDK git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3637 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
98caca8be1
commit
ec6957f356
52 changed files with 1715 additions and 2540 deletions
|
@ -1,7 +1,5 @@
|
|||
// Common/CRC.h
|
||||
|
||||
// #pragma once
|
||||
|
||||
#ifndef __COMMON_CRC_H
|
||||
#define __COMMON_CRC_H
|
||||
|
||||
|
@ -9,20 +7,25 @@
|
|||
|
||||
class CCRC
|
||||
{
|
||||
UINT32 _value;
|
||||
UInt32 _value;
|
||||
public:
|
||||
static UINT32 Table[256];
|
||||
static UInt32 Table[256];
|
||||
static void InitTable();
|
||||
|
||||
CCRC(): _value(0xFFFFFFFF){};
|
||||
void Init() { _value = 0xFFFFFFFF; }
|
||||
void Update(const void *data, UINT32 size);
|
||||
UINT32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
|
||||
static UINT32 CalculateDigest(const void *data, UINT32 size)
|
||||
void Update(Byte v);
|
||||
void Update(UInt32 v);
|
||||
void Update(const UInt64 &v);
|
||||
void Update(const void *data, UInt32 size);
|
||||
UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
|
||||
static UInt32 CalculateDigest(const void *data, UInt32 size)
|
||||
{
|
||||
CCRC crc;
|
||||
crc.Update(data, size);
|
||||
return crc.GetDigest();
|
||||
}
|
||||
static bool VerifyDigest(UINT32 digest, const void *data, UINT32 size)
|
||||
static bool VerifyDigest(UInt32 digest, const void *data, UInt32 size)
|
||||
{
|
||||
return (CalculateDigest(data, size) == digest);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue