Merge other top-level C code
Change-Id: I0ff77f51595599cc3de5183c6c655fd261e3d925
This commit is contained in:
Родитель
6ad3b74a58
Коммит
82b1a3433d
2
args.c
2
args.c
|
@ -52,7 +52,7 @@ int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) {
|
|||
arg.val = def->has_val ? arg.argv[1] : NULL;
|
||||
arg.argv_step = def->has_val ? 2 : 1;
|
||||
} else if (def->long_name) {
|
||||
int name_len = strlen(def->long_name);
|
||||
const size_t name_len = strlen(def->long_name);
|
||||
|
||||
if (strlen(arg.argv[0]) >= name_len + 2
|
||||
&& arg.argv[0][1] == '-'
|
||||
|
|
|
@ -9,14 +9,20 @@
|
|||
*/
|
||||
#include <stdio.h>
|
||||
#include "tools_common.h"
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) || defined(__OS2__)
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef __OS2__
|
||||
#define _setmode setmode
|
||||
#define _fileno fileno
|
||||
#define _O_BINARY O_BINARY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
FILE *set_binary_mode(FILE *stream) {
|
||||
(void)stream;
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) || defined(__OS2__)
|
||||
_setmode(_fileno(stream), _O_BINARY);
|
||||
#endif
|
||||
return stream;
|
||||
|
|
|
@ -669,7 +669,7 @@ int y4m_input_open(y4m_input *_y4m, FILE *_fin, char *_skip, int _nskip) {
|
|||
buffer[i] = *_skip++;
|
||||
_nskip--;
|
||||
} else {
|
||||
ret = fread(buffer + i, 1, 1, _fin);
|
||||
ret = (int)fread(buffer + i, 1, 1, _fin);
|
||||
if (ret < 1)return -1;
|
||||
}
|
||||
if (buffer[i] == '\n')break;
|
||||
|
@ -815,7 +815,7 @@ int y4m_input_fetch_frame(y4m_input *_y4m, FILE *_fin, vpx_image_t *_img) {
|
|||
int c_sz;
|
||||
int ret;
|
||||
/*Read and skip the frame header.*/
|
||||
ret = fread(frame, 1, 6, _fin);
|
||||
ret = (int)fread(frame, 1, 6, _fin);
|
||||
if (ret < 6)return 0;
|
||||
if (memcmp(frame, "FRAME", 5)) {
|
||||
fprintf(stderr, "Loss of framing in Y4M input data\n");
|
||||
|
|
Загрузка…
Ссылка в новой задаче