From cced0a8811dbe7d9f0520cdfa92b25abce091882 Mon Sep 17 00:00:00 2001 From: tTh Date: Mon, 2 Oct 2023 18:26:11 +0200 Subject: [PATCH] use default if not provided by caller --- Lib/text16x24.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Lib/text16x24.c b/Lib/text16x24.c index e8856ef..2b2d814 100644 --- a/Lib/text16x24.c +++ b/Lib/text16x24.c @@ -165,6 +165,9 @@ int rp, gp, bp; int x2, y2; uint16_t mask; +RGBA blanc = { 255, 255, 255, 255, 0, 0 }, + noir = { 0, 0, 0, 64, 0, 0 }; + if (flags) { fprintf(stderr, "in %s, useless flags 0x%x is useless\n", __func__, flags); @@ -175,11 +178,15 @@ fprintf(stderr, "%s: ltr %3d '%c' %4d %4d\n", __func__, lettre, isprint(lettre) ? lettre : ' ', xpos, ypos); #endif +/* + * use default if not provided my caller + */ +if (NULL==pap) pap = &blanc; +if (NULL==ink) ink = &noir; + /* +-------------------------------+ | WTF ? no boundary check ? | +-------------------------------+ */ - - for (y=0; y<24; y++) { mask = 0x8000; y2 = y + ypos;