forked from len0rd/rockbox
Theme Editor: Make it compile with modern toolchains
Change-Id: Idc0ef3dd34ab186b4ea40f4d916a2addf87eb478
This commit is contained in:
parent
d7c541742f
commit
c34076b2a5
3 changed files with 8 additions and 8 deletions
|
@ -32,7 +32,7 @@
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Return the next byte in the pseudo-random sequence
|
* Return the next byte in the pseudo-random sequence
|
||||||
*/
|
*/
|
||||||
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
|
static int decrypt_byte(unsigned long* pkeys, const uint32_t* pcrc_32_tab)
|
||||||
{
|
{
|
||||||
(void) pcrc_32_tab; /* avoid "unused parameter" warning */
|
(void) pcrc_32_tab; /* avoid "unused parameter" warning */
|
||||||
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
|
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
|
||||||
|
@ -46,7 +46,7 @@ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Update the encryption keys with the next byte of plain text
|
* Update the encryption keys with the next byte of plain text
|
||||||
*/
|
*/
|
||||||
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
|
static int update_keys(unsigned long* pkeys,const uint32_t* pcrc_32_tab,int c)
|
||||||
{
|
{
|
||||||
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
|
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
|
||||||
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
|
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
|
||||||
|
@ -63,7 +63,7 @@ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int
|
||||||
* Initialize the encryption keys and the random header according to
|
* Initialize the encryption keys and the random header according to
|
||||||
* the given password.
|
* the given password.
|
||||||
*/
|
*/
|
||||||
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
|
static void init_keys(const char* passwd,unsigned long* pkeys,const uint32_t* pcrc_32_tab)
|
||||||
{
|
{
|
||||||
*(pkeys+0) = 305419896L;
|
*(pkeys+0) = 305419896L;
|
||||||
*(pkeys+1) = 591751049L;
|
*(pkeys+1) = 591751049L;
|
||||||
|
@ -93,7 +93,7 @@ static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
|
||||||
unsigned char *buf; /* where to write header */
|
unsigned char *buf; /* where to write header */
|
||||||
int bufSize;
|
int bufSize;
|
||||||
unsigned long* pkeys;
|
unsigned long* pkeys;
|
||||||
const unsigned long* pcrc_32_tab;
|
const uint32_t* pcrc_32_tab;
|
||||||
unsigned long crcForCrypting;
|
unsigned long crcForCrypting;
|
||||||
{
|
{
|
||||||
int n; /* index in random header */
|
int n; /* index in random header */
|
||||||
|
|
|
@ -147,7 +147,7 @@ typedef struct
|
||||||
int encrypted;
|
int encrypted;
|
||||||
# ifndef NOUNCRYPT
|
# ifndef NOUNCRYPT
|
||||||
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
|
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
|
||||||
const unsigned long* pcrc_32_tab;
|
const uint32_t* pcrc_32_tab;
|
||||||
# endif
|
# endif
|
||||||
} unz_s;
|
} unz_s;
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX)
|
||||||
uLong *pX;
|
uLong *pX;
|
||||||
{
|
{
|
||||||
uLong x ;
|
uLong x ;
|
||||||
int i;
|
int i = 0;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
|
err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
|
||||||
|
@ -232,7 +232,7 @@ local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX)
|
||||||
uLong *pX;
|
uLong *pX;
|
||||||
{
|
{
|
||||||
uLong x ;
|
uLong x ;
|
||||||
int i;
|
int i = 0;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
|
err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
|
||||||
|
|
|
@ -130,7 +130,7 @@ typedef struct
|
||||||
int encrypt;
|
int encrypt;
|
||||||
#ifndef NOCRYPT
|
#ifndef NOCRYPT
|
||||||
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
|
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
|
||||||
const unsigned long* pcrc_32_tab;
|
const uint32_t* pcrc_32_tab;
|
||||||
int crypt_header_size;
|
int crypt_header_size;
|
||||||
#endif
|
#endif
|
||||||
} curfile_info;
|
} curfile_info;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue