Fix warnings, update Xcode project.

This commit is contained in:
Michael R Sweet 2021-10-08 14:08:07 -04:00
parent f425952f36
commit 8aef2bfedd
No known key found for this signature in database
GPG Key ID: 999559A027815955
3 changed files with 19 additions and 7 deletions

View File

@ -80,7 +80,7 @@ static const uint8_t Rcon[11] = // Round constants
// Local functions...
//
static void AddRoundKey(uint8_t round, state_t *state, const uint8_t *RoundKey);
static void AddRoundKey(size_t round, state_t *state, const uint8_t *RoundKey);
static void SubBytes(state_t *state);
static void ShiftRows(state_t *state);
static uint8_t xtime(uint8_t x);
@ -252,7 +252,7 @@ _pdfioCryptoAESEncrypt(
// This function adds the round key to state.
// The round key is added to the state by an XOR function.
static void
AddRoundKey(uint8_t round, state_t *state, const uint8_t *RoundKey)
AddRoundKey(size_t round, state_t *state, const uint8_t *RoundKey)
{
unsigned i; // Looping var
uint8_t *sptr = (*state)[0]; // Pointer into state
@ -314,7 +314,7 @@ ShiftRows(state_t *state)
static uint8_t
xtime(uint8_t x)
{
return ((x << 1) ^ ((x >> 7) * 0x1b));
return ((uint8_t)((x << 1) ^ ((x >> 7) * 0x1b)));
}
@ -466,7 +466,7 @@ Cipher(state_t *state, const _pdfio_aes_t *ctx)
static void
InvCipher(state_t *state, const _pdfio_aes_t *ctx)
{
uint8_t round = 0;
size_t round;
// Add the First round key to the state before starting the rounds.
AddRoundKey(ctx->round_size, state, ctx->round_key);

View File

@ -281,7 +281,7 @@ _pdfioCryptoMD5Append(_pdfio_md5_t *pms, const uint8_t *data, size_t nbytes)
{
const uint8_t *p = data;
size_t left = nbytes;
int offset = (pms->count[0] >> 3) & 63;
size_t offset = (pms->count[0] >> 3) & 63;
uint32_t nbits = (uint32_t)(nbytes << 3);
if (nbytes == 0)
@ -295,7 +295,7 @@ _pdfioCryptoMD5Append(_pdfio_md5_t *pms, const uint8_t *data, size_t nbytes)
/* Process an initial partial block. */
if (offset) {
int copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
memcpy(pms->buf + offset, p, copy);
if (offset + copy < 64)

View File

@ -26,6 +26,9 @@
279E1036267D043B00D3A349 /* ttf.c in Sources */ = {isa = PBXBuildFile; fileRef = 279E1034267D043B00D3A349 /* ttf.c */; };
279E103B267D04E600D3A349 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 279E103A267D04E600D3A349 /* libz.tbd */; };
27ECBD8926419DAB0025312A /* libpdfio.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 273440B0263D6FE200FBFD63 /* libpdfio.a */; };
27F2F0602710BE92008ECD36 /* pdfio-md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 27F2F05D2710BE92008ECD36 /* pdfio-md5.c */; };
27F2F0612710BE92008ECD36 /* pdfio-rc4.c in Sources */ = {isa = PBXBuildFile; fileRef = 27F2F05E2710BE92008ECD36 /* pdfio-rc4.c */; };
27F2F0622710BE92008ECD36 /* pdfio-crypto.c in Sources */ = {isa = PBXBuildFile; fileRef = 27F2F05F2710BE92008ECD36 /* pdfio-crypto.c */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -79,6 +82,9 @@
279E1033267D043B00D3A349 /* ttf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttf.h; sourceTree = "<group>"; };
279E1034267D043B00D3A349 /* ttf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttf.c; sourceTree = "<group>"; };
279E103A267D04E600D3A349 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
27F2F05D2710BE92008ECD36 /* pdfio-md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "pdfio-md5.c"; sourceTree = "<group>"; };
27F2F05E2710BE92008ECD36 /* pdfio-rc4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "pdfio-rc4.c"; sourceTree = "<group>"; };
27F2F05F2710BE92008ECD36 /* pdfio-crypto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "pdfio-crypto.c"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -153,16 +159,19 @@
273440BA263D727800FBFD63 /* pdfio-array.c */,
273440BB263D727800FBFD63 /* pdfio-common.c */,
271EA703265B2B1000ACDD39 /* pdfio-content.c */,
27F2F05F2710BE92008ECD36 /* pdfio-crypto.c */,
273440BE263D727800FBFD63 /* pdfio-dict.c */,
273440BD263D727800FBFD63 /* pdfio-file.c */,
27F2F05D2710BE92008ECD36 /* pdfio-md5.c */,
273440BC263D727800FBFD63 /* pdfio-object.c */,
273440C2263D727800FBFD63 /* pdfio-page.c */,
27F2F05E2710BE92008ECD36 /* pdfio-rc4.c */,
273440BF263D727800FBFD63 /* pdfio-stream.c */,
273440B9263D727800FBFD63 /* pdfio-string.c */,
273440E3263DD7EA00FBFD63 /* pdfio-token.c */,
273440C0263D727800FBFD63 /* pdfio-value.c */,
279E1033267D043B00D3A349 /* ttf.h */,
279E1034267D043B00D3A349 /* ttf.c */,
279E1033267D043B00D3A349 /* ttf.h */,
);
name = Library;
sourceTree = "<group>";
@ -281,11 +290,14 @@
273440CB263D727800FBFD63 /* pdfio-value.c in Sources */,
273440CA263D727800FBFD63 /* pdfio-stream.c in Sources */,
273440CD263D727800FBFD63 /* pdfio-page.c in Sources */,
27F2F0622710BE92008ECD36 /* pdfio-crypto.c in Sources */,
273440C5263D727800FBFD63 /* pdfio-array.c in Sources */,
273440E4263DD7EA00FBFD63 /* pdfio-token.c in Sources */,
273440C7263D727800FBFD63 /* pdfio-object.c in Sources */,
27F2F0602710BE92008ECD36 /* pdfio-md5.c in Sources */,
273440C4263D727800FBFD63 /* pdfio-string.c in Sources */,
271EA705265B2B1000ACDD39 /* pdfio-content.c in Sources */,
27F2F0612710BE92008ECD36 /* pdfio-rc4.c in Sources */,
273440C6263D727800FBFD63 /* pdfio-common.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;