Commit 097fef9f authored by James Zern's avatar James Zern

examples: quiet -Wshorten-64-to-32 warnings

all around usage of strtol/strtoul

ported from libvpx:
08b8b6bb8 examples: quiet -Wshorten-64-to-32 warnings

Change-Id: If907c89f107a068987aa71ddd93cee9a7389e4cd
parent 31b980aa
......@@ -342,8 +342,8 @@ int main(int argc, char **argv) {
}
info.codec_fourcc = encoder->fourcc;
info.frame_width = strtol(width_arg, NULL, 0);
info.frame_height = strtol(height_arg, NULL, 0);
info.frame_width = (int)strtol(width_arg, NULL, 0);
info.frame_height = (int)strtol(height_arg, NULL, 0);
info.time_base.numerator = 1;
info.time_base.denominator = fps;
......
......@@ -93,8 +93,8 @@ int main(int argc, char **argv) {
if (!(outfile = fopen(argv[2], "wb")))
die("Failed to open %s for writing.", argv[2]);
n = strtol(argv[3], &nptr, 0);
m = strtol(nptr + 1, NULL, 0);
n = (int)strtol(argv[3], &nptr, 0);
m = (int)strtol(nptr + 1, NULL, 0);
is_range = (*nptr == '-');
if (!n || !m || (*nptr != '-' && *nptr != '/'))
die("Couldn't parse pattern %s.\n", argv[3]);
......
......@@ -80,8 +80,8 @@ int main(int argc, char **argv) {
if (!encoder) die("Unsupported codec.");
info.codec_fourcc = encoder->fourcc;
info.frame_width = strtol(argv[1], NULL, 0);
info.frame_height = strtol(argv[2], NULL, 0);
info.frame_width = (int)strtol(argv[1], NULL, 0);
info.frame_height = (int)strtol(argv[2], NULL, 0);
info.time_base.numerator = 1;
info.time_base.denominator = fps;
......
......@@ -143,8 +143,8 @@ int main(int argc, char **argv) {
}
assert(encoder != NULL);
info.codec_fourcc = encoder->fourcc;
info.frame_width = strtol(argv[2], NULL, 0);
info.frame_height = strtol(argv[3], NULL, 0);
info.frame_width = (int)strtol(argv[2], NULL, 0);
info.frame_height = (int)strtol(argv[3], NULL, 0);
info.time_base.numerator = 1;
info.time_base.denominator = fps;
......
......@@ -180,14 +180,14 @@ int main(int argc, char **argv) {
infile_arg = argv[4];
outfile_arg = argv[5];
keyframe_interval_arg = argv[6];
max_frames = strtol(argv[8], NULL, 0);
max_frames = (int)strtol(argv[8], NULL, 0);
encoder = get_aom_encoder_by_name(codec_arg);
if (!encoder) die("Unsupported codec.");
info.codec_fourcc = encoder->fourcc;
info.frame_width = strtol(width_arg, NULL, 0);
info.frame_height = strtol(height_arg, NULL, 0);
info.frame_width = (int)strtol(width_arg, NULL, 0);
info.frame_height = (int)strtol(height_arg, NULL, 0);
info.time_base.numerator = 1;
info.time_base.denominator = fps;
......@@ -201,7 +201,7 @@ int main(int argc, char **argv) {
die("Failed to allocate image.");
}
keyframe_interval = strtol(keyframe_interval_arg, NULL, 0);
keyframe_interval = (int)strtol(keyframe_interval_arg, NULL, 0);
if (keyframe_interval < 0) die("Invalid keyframe interval value.");
printf("Using %s\n", aom_codec_iface_name(encoder->codec_interface()));
......@@ -214,7 +214,7 @@ int main(int argc, char **argv) {
cfg.g_timebase.num = info.time_base.numerator;
cfg.g_timebase.den = info.time_base.denominator;
cfg.rc_target_bitrate = bitrate;
cfg.g_error_resilient = strtol(argv[7], NULL, 0);
cfg.g_error_resilient = (aom_codec_er_flags_t)strtoul(argv[7], NULL, 0);
writer = aom_video_writer_open(outfile_arg, kContainerIVF, &info);
if (!writer) die("Failed to open %s for writing.", outfile_arg);
......
......@@ -206,15 +206,15 @@ int main(int argc, char **argv) {
if (argc < 6) die("Invalid number of arguments");
if (argc > 6) limit = strtol(argv[6], NULL, 0);
if (argc > 6) limit = (int)strtol(argv[6], NULL, 0);
if (limit == 0) limit = 100;
encoder = get_aom_encoder_by_name(codec_arg);
if (!encoder) die("Unsupported codec.");
w = strtol(width_arg, NULL, 0);
h = strtol(height_arg, NULL, 0);
w = (int)strtol(width_arg, NULL, 0);
h = (int)strtol(height_arg, NULL, 0);
if (w <= 0 || h <= 0 || (w % 2) != 0 || (h % 2) != 0)
die("Invalid frame size: %dx%d", w, h);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment