Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* file_buffer: Fix unitialized variable usage warning Clang warns: In file included from src/lib_ccx/asf_functions.c:5: src/lib_ccx/file_buffer.h:76:7: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (buffer) ^~~~~~ src/lib_ccx/file_buffer.h:86:9: note: uninitialized use occurs here return result; ^~~~~~ src/lib_ccx/file_buffer.h:76:3: note: remove the 'if' if its condition is always true if (buffer) ^~~~~~~~~~~ src/lib_ccx/file_buffer.h:73:15: note: initialize the variable 'result' to silence this warning size_t result; ^ = 0 * common_timing: Fix uninitialized variable usage warning The vast majority of the code is already using fatal(), so I don't see why this should be an exception. Clang warns: src/lib_ccx/ccx_common_timing.c:274:3: warning: variable 'fts' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ src/lib_ccx/ccx_common_timing.c:280:9: note: uninitialized use occurs here return fts; ^~~ src/lib_ccx/ccx_common_timing.c:261:11: note: initialize the variable 'fts' to silence this warning LLONG fts; ^ = 0 * encoders: Fix handling of multibyte characters in UTF-8 converter This is actually incorrect because characters longer than 1 byte will be butchered. Clang warns: src/lib_ccx/ccx_encoders_common.c:178:12: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare] if (c < 256) ~ ^ ~~~ src/lib_ccx/ccx_encoders_common.c:193:12: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare] if (c < 256) ~ ^ ~~~ src/lib_ccx/ccx_encoders_common.c:209:12: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare] if (c < 256) ~ ^ ~~~ src/lib_ccx/ccx_encoders_common.c:229:12: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare] if (c < 256) ~ ^ ~~~ * gxf: Fix tautological comparison warnings Clang warns: src/lib_ccx/ccx_gxf.c:425:17: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare] if (tag_len > STR_LEN) ~~~~~~~ ^ ~~~~~~~ src/lib_ccx/ccx_gxf.c:542:17: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare] if (tag_len > STR_LEN) ~~~~~~~ ^ ~~~~~~~ src/lib_ccx/ccx_gxf.c:617:17: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare] if (tag_len > STR_LEN) ~~~~~~~ ^ ~~~~~~~ * gxf: Fix uninitialized variable usage warnings Clang warns: src/lib_ccx/ccx_gxf.c:1449:8: warning: variable 'first_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case TRACK_TYPE_MPEG1_525: ^~~~~~~~~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1475:35: note: uninitialized use occurs here debug("first field number %d\n", first_field_nb); ^~~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug' ^~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1450:8: warning: variable 'first_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case TRACK_TYPE_MPEG2_525: ^~~~~~~~~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1475:35: note: uninitialized use occurs here debug("first field number %d\n", first_field_nb); ^~~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug' ^~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1456:3: warning: variable 'first_field_nb' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ src/lib_ccx/ccx_gxf.c:1475:35: note: uninitialized use occurs here debug("first field number %d\n", first_field_nb); ^~~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug' ^~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1410:30: note: initialize the variable 'first_field_nb' to silence this warning unsigned char first_field_nb; ^ = '\0' src/lib_ccx/ccx_gxf.c:1449:8: warning: variable 'last_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case TRACK_TYPE_MPEG1_525: ^~~~~~~~~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1476:34: note: uninitialized use occurs here debug("last field number %d\n", last_field_nb); ^~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug' ^~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1450:8: warning: variable 'last_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case TRACK_TYPE_MPEG2_525: ^~~~~~~~~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1476:34: note: uninitialized use occurs here debug("last field number %d\n", last_field_nb); ^~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug' ^~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1456:3: warning: variable 'last_field_nb' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ src/lib_ccx/ccx_gxf.c:1476:34: note: uninitialized use occurs here debug("last field number %d\n", last_field_nb); ^~~~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug' ^~~~~~~~~~~ src/lib_ccx/ccx_gxf.c:1411:29: note: initialize the variable 'last_field_nb' to silence this warning unsigned char last_field_nb; ^ = '\0' * ts_functions: Fix incorrect enumeration type in get_buffer_type Clang warns: src/lib_ccx/ts_functions.c:127:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion] return CCX_PES; ~~~~~~ ^~~~~~~ src/lib_ccx/ts_functions.c:131:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion] return CCX_H264; ~~~~~~ ^~~~~~~~ src/lib_ccx/ts_functions.c:135:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion] return CCX_DVB_SUBTITLE; ~~~~~~ ^~~~~~~~~~~~~~~~ src/lib_ccx/ts_functions.c:139:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion] return CCX_ISDB_SUBTITLE; ~~~~~~ ^~~~~~~~~~~~~~~~~ src/lib_ccx/ts_functions.c:143:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion] return CCX_HAUPPAGE; ~~~~~~ ^~~~~~~~~~~~ src/lib_ccx/ts_functions.c:147:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion] return CCX_TELETEXT; ~~~~~~ ^~~~~~~~~~~~ src/lib_ccx/ts_functions.c:151:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion] return CCX_PRIVATE_MPEG2_CC; ~~~~~~ ^~~~~~~~~~~~~~~~~~~~ src/lib_ccx/ts_functions.c:155:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion] return CCX_PES; ~~~~~~ ^~~~~~~ src/lib_ccx/ts_functions.c:491:24: warning: implicit conversion from enumeration type 'enum ccx_stream_type' to different enumeration type 'enum ccx_bufferdata_type' [-Wenum-conversion] ptr->bufferdatatype = get_buffer_type(cinfo); ~ ^~~~~~~~~~~~~~~~~~~~~~ * utility: Fix tautological comparison warnings Clang warns: src/lib_ccx/utility.c:605:24: warning: result of comparison of constant 65536 with expression of type 'unsigned short' is always true [-Wtautological-constant-out-of-range-compare] } else if (utf16_char < 0x010000) { ~~~~~~~~~~ ^ ~~~~~~~~ src/lib_ccx/utility.c:610:24: warning: result of comparison of constant 1114112 with expression of type 'unsigned short' is always true [-Wtautological-constant-out-of-range-compare] } else if (utf16_char < 0x110000) { ~~~~~~~~~~ ^ ~~~~~~~~ * ocr: Fix floating point -> integer abs() warning Clang warns: src/lib_ccx/ocr.c:529:8: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value] if(abs(h-h0)>50) // Color has changed ^ src/lib_ccx/ocr.c:529:8: note: use function 'fabsf' instead if(abs(h-h0)>50) // Color has changed ^~~ fabsf src/lib_ccx/ocr.c:529:8: note: include the header <math.h> or explicitly provide a declaration for 'fabsf' * encoders: Fix incorrect string types when EIA-608 is in use Clang warns: src/lib_ccx/ccx_encoders_helpers.c: In function ‘clever_capitalize’: src/lib_ccx/ccx_encoders_helpers.c:186:4: warning: case label value exceeds maximum value for type 186 | case 0x89: // This is a transparent space | ^~~~ * ocr: Fix implicit struct declaration warning Clang warns: In file included from src/lib_ccx/dvd_subtitle_decoder.c:10: src/lib_ccx/ocr.h:18:54: warning: ‘struct encoder_ctx’ declared inside parameter list will not be visible outside of this definition or declaration 18 | char *paraof_ocrtext(struct cc_subtitle *sub, struct encoder_ctx *context); | ^~~~~~~~~~~
- Loading branch information