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

Fix build warnings and errors in Visual Studio 2022 #1047

Merged
merged 1 commit into from
Dec 19, 2023
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
10 changes: 5 additions & 5 deletions extra/getopt_long.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ __progname(char * nargv0)
* Parse argc/argv argument vector.
*/
int
getopt_internal(int nargc, char ** nargv, const char *ostr)
getopt_internal(int nargc, char * const* nargv, const char *ostr)
{
static char *place = EMSG; /* option letter processing */
const char *oli; /* option letter list index */
Expand Down Expand Up @@ -142,7 +142,7 @@ getopt2(int nargc, char * nargv, const char *ostr)

if ((retval = getopt_internal(nargc, nargv, ostr)) == -2) {
retval = -1;
++optind;
++optind;
}
return(retval);
}
Expand Down Expand Up @@ -175,11 +175,11 @@ getopt_long(int nargc, char ** nargv, char * options, struct option * long_optio
} else
current_argv_len = strlen(current_argv);

for (i = 0; long_options[i].name; i++) {
for (i = 0; long_options[i].name; i++) {
if (strncmp(current_argv, long_options[i].name, current_argv_len))
continue;

if (strlen(long_options[i].name) == (unsigned)current_argv_len) {
if (strlen(long_options[i].name) == (unsigned)current_argv_len) {
match = i;
break;
}
Expand Down Expand Up @@ -215,7 +215,7 @@ getopt_long(int nargc, char ** nargv, char * options, struct option * long_optio
if (long_options[match].flag) {
*long_options[match].flag = long_options[match].val;
retval = 0;
} else
} else
retval = long_options[match].val;
if (index)
*index = match;
Expand Down
8 changes: 4 additions & 4 deletions libheif/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,7 @@ static bool nclx_profile_matches_spec(heif_colorspace colorspace,
image_nclx = std::make_shared<color_profile_nclx>();
}

if (image_nclx->get_full_range_flag() != spec_nclx->full_range_flag) {
if (image_nclx->get_full_range_flag() != ( spec_nclx->full_range_flag == 0 ? false : true ) ) {
return false;
}

Expand Down Expand Up @@ -2938,9 +2938,9 @@ Error HeifContext::encode_image_as_jpeg2000(const std::shared_ptr<HeifPixelImage
for (;;) {
uint8_t* data;
int size;

encoder->plugin->get_compressed_data(encoder->encoder, &data, &size, nullptr);

if (data == NULL) {
break;
}
Expand All @@ -2954,7 +2954,7 @@ Error HeifContext::encode_image_as_jpeg2000(const std::shared_ptr<HeifPixelImage



//Add 'ispe' Property
//Add 'ispe' Property
m_heif_file->add_ispe_property(image_id, image->get_width(), image->get_height());

//Add 'colr' Property
Expand Down
2 changes: 1 addition & 1 deletion libheif/plugins/encoder_svt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ struct heif_error svt_encode_image(void* encoder_raw, const struct heif_image* i
svt_config.logical_processors = encoder->threads;

// disable 2-pass
svt_config.rc_stats_buffer = (SvtAv1FixedBuf) {nullptr, 0};
svt_config.rc_stats_buffer = {nullptr, 0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fishmonger42 This part already got applied (see #1059) and is probably the cause of the merge conflicts. Possibly you just need to drop it.


svt_config.rate_control_mode = 0; // constant rate factor
//svt_config.enable_adaptive_quantization = 0; // 2 is CRF (the default), 0 would be CQP
Expand Down
Loading