Skip to content

Commit

Permalink
Conversely, we *want* the compiler to shout at us about *these* enums
Browse files Browse the repository at this point in the history
  • Loading branch information
NiLuJe committed May 11, 2024
1 parent 936885d commit 399df1a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions fbink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ static const unsigned char*
#endif // FBINK_WITH_BITMAP

static __attribute__((cold)) const char*
fontname_to_string(uint8_t fontname)
fontname_to_string(FONT_INDEX_E fontname)
{
switch (fontname) {
#ifdef FBINK_WITH_BITMAP
Expand Down Expand Up @@ -4088,7 +4088,7 @@ static __attribute__((cold)) const char*
}

static __attribute__((cold)) const char*
fb_pixfmt_to_string(FBINK_PXFMT_INDEX_T fmt)
fb_pixfmt_to_string(FBINK_PXFMT_INDEX_E fmt)
{
switch (fmt) {
case FBINK_PXFMT_UNKNOWN:
Expand Down Expand Up @@ -4539,7 +4539,7 @@ static __attribute__((cold)) void
}

static __attribute__((cold)) const char*
sunxi_force_rota_to_string(SUNXI_FORCE_ROTA_INDEX_T mode)
sunxi_force_rota_to_string(SUNXI_FORCE_ROTA_INDEX_E mode)
{
switch (mode) {
case FORCE_ROTA_CURRENT_ROTA:
Expand Down Expand Up @@ -5532,7 +5532,7 @@ int

#ifdef FBINK_WITH_OPENTYPE
static __attribute__((cold)) const char*
font_style_to_string(FONT_STYLE_T style)
font_style_to_string(FONT_STYLE_E style)
{
switch (style) {
case FNT_REGULAR:
Expand Down Expand Up @@ -7493,7 +7493,7 @@ static void

// Small helper for verbose log messages
static __attribute__((cold)) const char*
glyph_style_to_string(CHARACTER_FONT_T glyph_style)
glyph_style_to_string(CHARACTER_FONT_E glyph_style)
{
switch (glyph_style) {
case CH_IGNORE:
Expand Down Expand Up @@ -9310,7 +9310,7 @@ static uint32_t

// Convert a WFM_MODE_INDEX_T value to a human readable string
static __attribute__((cold)) const char*
wfm_to_string(WFM_MODE_INDEX_T wfm_mode_index)
wfm_to_string(WFM_MODE_INDEX_E wfm_mode_index)
{
switch (wfm_mode_index) {
case WFM_AUTO:
Expand Down Expand Up @@ -9605,7 +9605,7 @@ static __attribute__((cold)) const char*
# if defined(FBINK_FOR_KOBO) || defined(FBINK_FOR_KINDLE)
// Convert our public HW_DITHER_INDEX_T values to an appropriate mxcfb dithering mode constant
static int
get_hwd_mode(HW_DITHER_INDEX_T hw_dither_index)
get_hwd_mode(HW_DITHER_INDEX_E hw_dither_index)
{
// NOTE: This hardware dithering (handled by the PxP on i.MX) is only supported since EPDC v2!
// AFAICT, most of our eligible target devices only support PASSTHROUGH & ORDERED...
Expand Down Expand Up @@ -9649,7 +9649,7 @@ static int

// Convert a HW_DITHER_INDEX_T value to a human readable string
static __attribute__((cold)) const char*
hwd_to_string(HW_DITHER_INDEX_T hw_dither_index)
hwd_to_string(HW_DITHER_INDEX_E hw_dither_index)
{
switch (hw_dither_index) {
case HWD_PASSTHROUGH:
Expand Down
16 changes: 8 additions & 8 deletions fbink_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ static void clear_screen(int UNUSED_BY_NOTKINDLE, FBInkPixe
static const unsigned char* font8x8_get_bitmap(uint32_t);
#endif

static __attribute__((cold)) const char* fontname_to_string(uint8_t);
static __attribute__((cold)) const char* fontname_to_string(FONT_INDEX_E);

#ifdef FBINK_WITH_BITMAP
static int zu_print_length(size_t);
Expand Down Expand Up @@ -778,7 +778,7 @@ static int open_fb_fd(int* restric
static int open_fb_fd_nonblock(int* restrict, bool* restrict);

static __attribute__((cold)) const char* fb_rotate_to_string(uint32_t);
static __attribute__((cold)) const char* fb_pixfmt_to_string(FBINK_PXFMT_INDEX_T);
static __attribute__((cold)) const char* fb_pixfmt_to_string(FBINK_PXFMT_INDEX_E);
#ifdef FBINK_FOR_KINDLE
static __attribute__((cold)) const char* einkfb_orientation_to_string(orientation_t);
#endif
Expand All @@ -792,7 +792,7 @@ static __attribute__((cold)) void pocketbook_fix_fb_info(void);
#endif
#ifdef FBINK_FOR_KOBO
static __attribute__((cold)) void kobo_sunxi_fb_fixup(bool);
static __attribute__((cold)) const char* sunxi_force_rota_to_string(SUNXI_FORCE_ROTA_INDEX_T);
static __attribute__((cold)) const char* sunxi_force_rota_to_string(SUNXI_FORCE_ROTA_INDEX_E);
#endif
static __attribute__((cold)) int initialize_fbink(int, const FBInkConfig* restrict, bool);

Expand Down Expand Up @@ -849,17 +849,17 @@ static int draw_image(int,
#endif

#ifdef FBINK_WITH_OPENTYPE
static __attribute__((cold)) const char* font_style_to_string(FONT_STYLE_T);
static __attribute__((cold)) const char* font_style_to_string(FONT_STYLE_E);
static __attribute__((cold)) int add_ot_font(const char*, FONT_STYLE_T, FBInkOTFonts* restrict);
static __attribute__((cold)) int free_ot_font(stbtt_fontinfo** restrict);
static __attribute__((cold)) int free_ot_fonts(FBInkOTFonts* restrict);
static void parse_simple_md(const char* restrict, size_t, unsigned char* restrict);
static __attribute__((cold)) const char* glyph_style_to_string(CHARACTER_FONT_T);
static __attribute__((cold)) const char* glyph_style_to_string(CHARACTER_FONT_E);
#endif

#ifndef FBINK_FOR_LINUX
static uint32_t get_wfm_mode(WFM_MODE_INDEX_T);
static __attribute__((cold)) const char* wfm_to_string(WFM_MODE_INDEX_T);
static __attribute__((cold)) const char* wfm_to_string(WFM_MODE_INDEX_E);
# ifdef FBINK_FOR_KINDLE
static __attribute__((cold)) const char* kindle_wfm_to_string(uint32_t);
static __attribute__((cold)) const char* kindle_zelda_wfm_to_string(uint32_t);
Expand All @@ -874,8 +874,8 @@ static __attribute__((cold)) const char* remarkable_wfm_to_string(uint32_t);
static __attribute__((cold)) const char* pocketbook_wfm_to_string(uint32_t);
# endif
# if defined(FBINK_FOR_KOBO) || defined(FBINK_FOR_KINDLE)
static int get_hwd_mode(HW_DITHER_INDEX_T);
static __attribute__((cold)) const char* hwd_to_string(HW_DITHER_INDEX_T);
static int get_hwd_mode(HW_DITHER_INDEX_E);
static __attribute__((cold)) const char* hwd_to_string(HW_DITHER_INDEX_E);
# endif
#endif

Expand Down

0 comments on commit 399df1a

Please sign in to comment.