Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes warnings on Windows #288

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading