History

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

The C standard requires sizeof(char) == 1.

Carl Eugen Hoyos committed 6 years ago

Commit 61dcaf51 parent e61767c3 files · +4 −4Browse files

Unified · Split

3 files
  1. libavfilter/dnn/dnn_backend_tf.c +1 −1
  2. libavfilter/vf_deshake.c +2 −2
  3. libavformat/webmdashenc.c +1 −1
libavfilter/dnn/dnn_backend_tf.c+1−1
@@ -95,7 +95,7 @@ static TF_Tensor *allocate_input_tensor(const DNNData *input) · 94 unmodified lines
95 break;95 break;
96 case DNN_UINT8:96 case DNN_UINT8:
97 dt = TF_UINT8;97 dt = TF_UINT8;
98 size = sizeof(char);98 size = 1;
99 break;99 break;
100 default:100 default:
101 av_assert0(!"should not reach here");101 av_assert0(!"should not reach here");
libavfilter/vf_deshake.c+2−2
@@ -354,7 +354,7 @@ static av_cold int init(AVFilterContext *ctx) · 353 unmodified lines
354 if (deshake->filename)354 if (deshake->filename)
355 deshake->fp = fopen(deshake->filename, "w");355 deshake->fp = fopen(deshake->filename, "w");
356 if (deshake->fp)356 if (deshake->fp)
357 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);357 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);
358 358
359 // Quadword align left edge of box for MMX code, adjust width if necessary359 // Quadword align left edge of box for MMX code, adjust width if necessary
360 // to keep right margin360 // to keep right margin
@@ -485,7 +485,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 124 unmodified lines
485 // Write statistics to file485 // Write statistics to file
486 if (deshake->fp) {486 if (deshake->fp) {
487 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);487 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);
488 fwrite(tmp, sizeof(char), strlen(tmp), deshake->fp);488 fwrite(tmp, 1, strlen(tmp), deshake->fp);
489 }489 }
490 490
491 // Turn relative current frame motion into absolute by adding it to the491 // Turn relative current frame motion into absolute by adding it to the
libavformat/webmdashenc.c+1−1
@@ -439,7 +439,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) · 438 unmodified lines
439static int to_integer(char *p, int len)439static int to_integer(char *p, int len)
440{440{
441 int ret;441 int ret;
442 char *q = av_malloc(sizeof(char) * len);442 char *q = av_malloc(len);
443 if (!q)443 if (!q)
444 return AVERROR(ENOMEM);444 return AVERROR(ENOMEM);
445 av_strlcpy(q, p, len);445 av_strlcpy(q, p, len);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t