Skip to content

Commit

Permalink
Fixes warnings on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornvolcker committed Dec 20, 2024
1 parent 68178fa commit 42b9c1e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/src/legacy/legacy_h26x_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ legacy_verify_hashes_with_hash_list(legacy_sv_t *self,
assert(hash_size > 0);
// Expected hashes.
uint8_t *expected_hashes = self->gop_info->hash_list;
const int num_expected_hashes = self->gop_info->list_idx / hash_size;
const int num_expected_hashes = (const int)(self->gop_info->list_idx / hash_size);

legacy_h26x_nalu_list_t *nalu_list = self->nalu_list;
legacy_h26x_nalu_list_item_t *last_used_item = NULL;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/signed_video_h26x_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ verify_hashes_with_hash_list(signed_video_t *self,
assert(hash_size > 0);
// Expected hashes.
uint8_t *expected_hashes = self->gop_info->hash_list;
const int num_expected_hashes = self->gop_info->list_idx / hash_size;
const int num_expected_hashes = (const int)(self->gop_info->list_idx / hash_size);

h26x_nalu_list_t *nalu_list = self->nalu_list;
h26x_nalu_list_item_t *last_used_item = NULL;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/signed_video_h26x_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ check_and_copy_hash_to_hash_list(signed_video_t *self, const uint8_t *hash, size
// a valid |hash_list| exists, and the |hash| can be copied to it.
if (*list_idx >= 0) {
memcpy(&hash_list[*list_idx], hash, hash_size);
*list_idx += hash_size;
*list_idx += (int)hash_size;
}
openssl_update_hash(self->crypto_handle, hash, hash_size, true);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/signed_video_h26x_nalu_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ h26x_nalu_list_copy_last_item(h26x_nalu_list_t *list, bool hash_algo_known)
while (!(item->nalu)) {
item = item->prev;
}
int hashable_data_offset = item->nalu->hashable_data - item->nalu->nalu_data;
int hashable_data_offset = (int)(item->nalu->hashable_data - item->nalu->nalu_data);

svrc_t status = SV_UNKNOWN_FAILURE;
SV_TRY()
Expand Down
6 changes: 3 additions & 3 deletions lib/src/signed_video_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ openssl_private_key_malloc(sign_or_verify_data_t *sign_data,
svrc_t status = SV_UNKNOWN_FAILURE;
SV_TRY()
// Read private key
BIO *bp = BIO_new_mem_buf(private_key, private_key_size);
BIO *bp = BIO_new_mem_buf(private_key, (int)private_key_size);
signing_key = PEM_read_bio_PrivateKey(bp, NULL, NULL, NULL);
BIO_free(bp);
SV_THROW_IF(!signing_key, SV_EXTERNAL_ERROR);
Expand Down Expand Up @@ -406,7 +406,7 @@ oid_to_type(message_digest_t *self)
// Point to the first byte of the OID. The |oid_ptr| will increment while decoding.
encoded_oid_ptr = self->encoded_oid;
SV_THROW_IF(
!d2i_ASN1_OBJECT(&obj, &encoded_oid_ptr, self->encoded_oid_size), SV_EXTERNAL_ERROR);
!d2i_ASN1_OBJECT(&obj, &encoded_oid_ptr, (long)self->encoded_oid_size), SV_EXTERNAL_ERROR);
self->type = EVP_get_digestbyobj(obj);
self->size = EVP_MD_size(self->type);
SV_CATCH()
Expand Down Expand Up @@ -531,7 +531,7 @@ openssl_encoded_oid_to_str(const unsigned char *encoded_oid, size_t encoded_oid_
}

// Point to the first byte of the OID. The |oid_ptr| will increment while decoding.
if (!d2i_ASN1_OBJECT(&obj, &encoded_oid, encoded_oid_size)) {
if (!d2i_ASN1_OBJECT(&obj, &encoded_oid, (long)encoded_oid_size)) {
goto done;
}
OBJ_obj2txt(algo_name, 50, obj, 1);
Expand Down

0 comments on commit 42b9c1e

Please sign in to comment.