The C standard requires sizeof(char) == 1.
Showing the changes to libavfilter (2 of 3 files). Show all
Unified · Split
| @@ -95,7 +95,7 @@ static TF_Tensor *allocate_input_tensor(const DNNData *input) · 94 unmodified lines | ||
| 95 | 95 | break; |
| 96 | 96 | case DNN_UINT8: |
| 97 | 97 | dt = TF_UINT8; |
| 98 | − size = sizeof(char); | |
| 98 | + size = 1; | |
| 99 | 99 | break; |
| 100 | 100 | default: |
| 101 | 101 | av_assert0(!"should not reach here"); |
| @@ -354,7 +354,7 @@ static av_cold int init(AVFilterContext *ctx) · 353 unmodified lines | ||
| 354 | 354 | if (deshake->filename) |
| 355 | 355 | deshake->fp = fopen(deshake->filename, "w"); |
| 356 | 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 | 359 | // Quadword align left edge of box for MMX code, adjust width if necessary |
| 360 | 360 | // to keep right margin |
| @@ -485,7 +485,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 124 unmodified lines | ||
| 485 | 485 | // Write statistics to file |
| 486 | 486 | if (deshake->fp) { |
| 487 | 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 | 491 | // Turn relative current frame motion into absolute by adding it to the |