banners: clang still warns on unused static inlines fcts, change strategy

This commit is contained in:
Philippe Teuwen 2020-05-08 00:48:20 +02:00
commit 59057b6a35

View file

@ -44,7 +44,11 @@
#define BANNERMSG2 " https://github.com/rfidresearchgroup/proxmark3/" #define BANNERMSG2 " https://github.com/rfidresearchgroup/proxmark3/"
#define BANNERMSG3 "pre-release v4.0" #define BANNERMSG3 "pre-release v4.0"
static inline void utf8_showBanner(void) { typedef enum LogoMode { UTF8, ANSI, ASCII } LogoMode;
static void showBanner_logo(LogoMode mode) {
switch (mode) {
case UTF8: {
const char* sq = "\xE2\x96\x88"; // square block const char* sq = "\xE2\x96\x88"; // square block
const char* tr = "\xE2\x95\x97"; // top right corner const char* tr = "\xE2\x95\x97"; // top right corner
const char* tl = "\xE2\x95\x94"; // top left corner const char* tl = "\xE2\x95\x94"; // top left corner
@ -66,24 +70,27 @@ static inline void utf8_showBanner(void) {
sq, sq, vl, __, __, __, __, __, sq, sq, vl, __, bl, hl, br, __, sq, sq, vl, sq, sq, sq, sq, sq, tl, br); sq, sq, vl, __, __, __, __, __, sq, sq, vl, __, bl, hl, br, __, sq, sq, vl, sq, sq, sq, sq, sq, tl, br);
PrintAndLogEx(NORMAL, " " _BLUE_("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s")" " BANNERMSG3, PrintAndLogEx(NORMAL, " " _BLUE_("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s")" " BANNERMSG3,
bl, hl, br, __, __, __, __, __, bl, hl, br, __, __, __, __, __, bl, hl, br, bl, hl, hl, hl, hl, br, __); bl, hl, br, __, __, __, __, __, bl, hl, br, __, __, __, __, __, bl, hl, br, bl, hl, hl, hl, hl, br, __);
} break;
}
static inline void ansi_showBanner(void) { case ANSI: {
PrintAndLogEx(NORMAL, " " _BLUE_("██████╗ ███╗ ███╗█████╗ ")); PrintAndLogEx(NORMAL, " " _BLUE_("██████╗ ███╗ ███╗█████╗ "));
PrintAndLogEx(NORMAL, " " _BLUE_("██╔══██╗████╗ ████║╚═══██╗")); PrintAndLogEx(NORMAL, " " _BLUE_("██╔══██╗████╗ ████║╚═══██╗"));
PrintAndLogEx(NORMAL, " " _BLUE_("██████╔╝██╔████╔██║ ████╔╝")); PrintAndLogEx(NORMAL, " " _BLUE_("██████╔╝██╔████╔██║ ████╔╝"));
PrintAndLogEx(NORMAL, " " _BLUE_("██╔═══╝ ██║╚██╔╝██║ ╚══██╗") " " BANNERMSG1); PrintAndLogEx(NORMAL, " " _BLUE_("██╔═══╝ ██║╚██╔╝██║ ╚══██╗") " " BANNERMSG1);
PrintAndLogEx(NORMAL, " " _BLUE_("██║ ██║ ╚═╝ ██║█████╔╝") " " BANNERMSG2); PrintAndLogEx(NORMAL, " " _BLUE_("██║ ██║ ╚═╝ ██║█████╔╝") " " BANNERMSG2);
PrintAndLogEx(NORMAL, " " _BLUE_("╚═╝ ╚═╝ ╚═╝╚════╝ ") " " BANNERMSG3); PrintAndLogEx(NORMAL, " " _BLUE_("╚═╝ ╚═╝ ╚═╝╚════╝ ") " " BANNERMSG3);
} break;
}
static inline void ascii_showBanner(void) { case ASCII: {
PrintAndLogEx(NORMAL, " ######. ###. ###.#####. "); PrintAndLogEx(NORMAL, " ######. ###. ###.#####. ");
PrintAndLogEx(NORMAL, " ##...##.####. ####. ...##."); PrintAndLogEx(NORMAL, " ##...##.####. ####. ...##.");
PrintAndLogEx(NORMAL, " ######..##.####.##. ####.."); PrintAndLogEx(NORMAL, " ######..##.####.##. ####..");
PrintAndLogEx(NORMAL, " ##..... ##..##..##. ..##." " " BANNERMSG1); PrintAndLogEx(NORMAL, " ##..... ##..##..##. ..##." " " BANNERMSG1);
PrintAndLogEx(NORMAL, " ##. ##. .. ##.#####.." " " BANNERMSG2); PrintAndLogEx(NORMAL, " ##. ##. .. ##.#####.." " " BANNERMSG2);
PrintAndLogEx(NORMAL, " .. .. .. ..... " " " BANNERMSG3); PrintAndLogEx(NORMAL, " .. .. .. ..... " " " BANNERMSG3);
break;
}
}
} }
static void showBanner(void) { static void showBanner(void) {
@ -94,14 +101,14 @@ static void showBanner(void) {
#if defined(_WIN32) #if defined(_WIN32)
if (GetConsoleCP() == 65001) { if (GetConsoleCP() == 65001) {
// If on Windows and using UTF-8 then we need utf-8 ascii art for banner. // If on Windows and using UTF-8 then we need utf-8 ascii art for banner.
utf8_showBanner(); showBanner_logo(UTF8);
} else { } else {
ansi_showBanner(); showBanner_logo(ANSI);
} }
#elif defined(__linux__) || defined(__APPLE__) #elif defined(__linux__) || defined(__APPLE__)
ansi_showBanner(); showBanner_logo(ANSI);
#else #else
ascii_showBanner(); showBanner_logo(ASCII);
#endif #endif
// PrintAndLogEx(NORMAL, "\nSupport iceman on patreon - https://www.patreon.com/iceman1001/"); // PrintAndLogEx(NORMAL, "\nSupport iceman on patreon - https://www.patreon.com/iceman1001/");
// PrintAndLogEx(NORMAL, " on paypal - https://www.paypal.me/iceman1001"); // PrintAndLogEx(NORMAL, " on paypal - https://www.paypal.me/iceman1001");