Browse Source

lavf, lavfi: Remove uses of sizeof(char).

The C standard requires sizeof(char) == 1.
tags/n4.3
Carl Eugen Hoyos 5 years ago
parent
commit
61dcaf5fb7
3 changed files with 4 additions and 4 deletions
  1. +1
    -1
      libavfilter/dnn/dnn_backend_tf.c
  2. +2
    -2
      libavfilter/vf_deshake.c
  3. +1
    -1
      libavformat/webmdashenc.c

+ 1
- 1
libavfilter/dnn/dnn_backend_tf.c View File

@@ -95,7 +95,7 @@ static TF_Tensor *allocate_input_tensor(const DNNData *input)
break;
case DNN_UINT8:
dt = TF_UINT8;
size = sizeof(char);
size = 1;
break;
default:
av_assert0(!"should not reach here");


+ 2
- 2
libavfilter/vf_deshake.c View File

@@ -354,7 +354,7 @@ static av_cold int init(AVFilterContext *ctx)
if (deshake->filename)
deshake->fp = fopen(deshake->filename, "w");
if (deshake->fp)
fwrite("Ori x, Avg x, Fin x, Ori y, Avg y, Fin y, Ori angle, Avg angle, Fin angle, Ori zoom, Avg zoom, Fin zoom\n", sizeof(char), 104, deshake->fp);
fwrite("Ori x, Avg x, Fin x, Ori y, Avg y, Fin y, Ori angle, Avg angle, Fin angle, Ori zoom, Avg zoom, Fin zoom\n", 1, 104, deshake->fp);

// Quadword align left edge of box for MMX code, adjust width if necessary
// to keep right margin
@@ -485,7 +485,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
// Write statistics to file
if (deshake->fp) {
snprintf(tmp, 256, "%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", orig.vec.x, deshake->avg.vec.x, t.vec.x, orig.vec.y, deshake->avg.vec.y, t.vec.y, orig.angle, deshake->avg.angle, t.angle, orig.zoom, deshake->avg.zoom, t.zoom);
fwrite(tmp, sizeof(char), strlen(tmp), deshake->fp);
fwrite(tmp, 1, strlen(tmp), deshake->fp);
}

// Turn relative current frame motion into absolute by adding it to the


+ 1
- 1
libavformat/webmdashenc.c View File

@@ -439,7 +439,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index)
static int to_integer(char *p, int len)
{
int ret;
char *q = av_malloc(sizeof(char) * len);
char *q = av_malloc(len);
if (!q)
return AVERROR(ENOMEM);
av_strlcpy(q, p, len);


Loading…
Cancel
Save