[PR #1203] [FIX] EIA-608 screen clearing fix #1998

Open
opened 2026-01-29 17:19:40 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1203

State: closed
Merged: Yes


In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

My familiarity with the project is as follows (check one):

  • I have used CCExtractor just a couple of times.

This adds a constant with the maximum number of screen rows and replaces hard-coded occurrences of it with the new constant, as hard-coding array lengths everywhere is unclear and prone to breakage. The array lengths in the screen struct were also replaced with constants where applicable.

The cleanup directly ties in with the fix in question, which is to initialize the colora nd font arrays properly using a loop rather than memset. The commit message goes into more detail regarding this issue.

GCC 9.2.0 issues a warning here:

src/lib_ccx/ccx_decoders_608.c: In function ‘clear_eia608_cc_buffer’:
src/lib_ccx/ccx_decoders_608.c:111:3: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  111 |   memset(data->colors[i], context->settings->default_color, CCX_DECODER_608_SCREEN_WIDTH + 1);
      |   ^~~~~~
src/lib_ccx/ccx_decoders_608.c:112:3: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  112 |   memset(data->fonts[i], FONT_REGULAR, CCX_DECODER_608_SCREEN_WIDTH + 1);
      |   ^~~~~~
**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1203 **State:** closed **Merged:** Yes --- **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. **My familiarity with the project is as follows (check one):** - [x] I have used CCExtractor just a couple of times. --- This adds a constant with the maximum number of screen rows and replaces hard-coded occurrences of it with the new constant, as hard-coding array lengths everywhere is unclear and prone to breakage. The array lengths in the screen struct were also replaced with constants where applicable. The cleanup directly ties in with the fix in question, which is to initialize the colora nd font arrays properly using a loop rather than `memset`. The commit message goes into more detail regarding this issue. GCC 9.2.0 issues a warning here: ``` src/lib_ccx/ccx_decoders_608.c: In function ‘clear_eia608_cc_buffer’: src/lib_ccx/ccx_decoders_608.c:111:3: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] 111 | memset(data->colors[i], context->settings->default_color, CCX_DECODER_608_SCREEN_WIDTH + 1); | ^~~~~~ src/lib_ccx/ccx_decoders_608.c:112:3: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] 112 | memset(data->fonts[i], FONT_REGULAR, CCX_DECODER_608_SCREEN_WIDTH + 1); | ^~~~~~ ```
claunia added the pull-request label 2026-01-29 17:19:40 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#1998