warnings when using g++ compiler

This commit is contained in:
Jacob Barthelmeh
2017-05-02 15:20:20 -06:00
parent aa990ed1ce
commit 8146f73eff
3 changed files with 10 additions and 11 deletions

View File

@ -9637,7 +9637,7 @@ int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx,
/* build DER formatted ECC key, include optional public key if requested,
* return length on success, negative on error */
static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen,
int public)
int pubIn)
{
byte curve[MAX_ALGO_SZ+2];
byte ver[MAX_VERSION_SZ];
@ -9678,8 +9678,8 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen,
}
prvidx += privSz;
/* public */
if (public) {
/* pubIn */
if (pubIn) {
ret = wc_ecc_export_x963(key, NULL, &pubSz);
if (ret != LENGTH_ONLY_E) {
XFREE(prv, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
@ -9717,7 +9717,7 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen,
totalSz = prvidx + pubidx + curveidx + verSz + seqSz;
if (totalSz > (int)inLen) {
XFREE(prv, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
if (public) {
if (pubIn) {
XFREE(pub, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
}
return BAD_FUNC_ARG;
@ -9741,8 +9741,8 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen,
XMEMCPY(output + idx, curve, curveidx);
idx += curveidx;
/* public */
if (public) {
/* pubIn */
if (pubIn) {
XMEMCPY(output + idx, pub, pubidx);
/* idx += pubidx; not used after write, if more data remove comment */
XFREE(pub, key->heap, DYNAMIC_TYPE_TMP_BUFFER);

View File

@ -834,8 +834,7 @@ static int wc_PKCS7_SignedDataBuildSignature(PKCS7* pkcs7,
* type - [OUT] pointer to wc_HashType for output
*
* returns hash digest size on success, negative on error */
static enum wc_HashType wc_PKCS7_SetHashType(PKCS7* pkcs7,
enum wc_HashType* type)
static int wc_PKCS7_SetHashType(PKCS7* pkcs7, enum wc_HashType* type)
{
if (pkcs7 == NULL || type == NULL)
return BAD_FUNC_ARG;

View File

@ -761,15 +761,15 @@ int wc_scrypt(byte* output, const byte* passwd, int passLen,
bSz = 128 * blockSize;
blocksSz = bSz * parallel;
blocks = XMALLOC(blocksSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
blocks = (byte*)XMALLOC(blocksSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (blocks == NULL)
goto end;
/* Temporary for scryptROMix. */
v = XMALLOC((1 << cost) * bSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
v = (byte*)XMALLOC((1 << cost) * bSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (v == NULL)
goto end;
/* Temporary for scryptBlockMix. */
y = XMALLOC(blockSize * 128, NULL, DYNAMIC_TYPE_TMP_BUFFER);
y = (byte*)XMALLOC(blockSize * 128, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (y == NULL)
goto end;