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,46 +44,53 @@
#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;
const char* sq = "\xE2\x96\x88"; // square block
const char* tr = "\xE2\x95\x97"; // top right corner
const char* tl = "\xE2\x95\x94"; // top left corner
const char* br = "\xE2\x95\x9D"; // bottom right corner
const char* bl = "\xE2\x95\x9A"; // bottom left corner
const char* hl = "\xE2\x95\x90"; // horiz line
const char* vl = "\xE2\x95\x91"; // vert line
const char* __ = " ";
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"), static void showBanner_logo(LogoMode mode) {
sq, sq, sq, sq, sq, sq, tr, __, sq, sq, sq, tr, __, __, __, sq, sq, sq, tr, sq, sq, sq, sq, sq, tr, __); switch (mode) {
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"), case UTF8: {
sq, sq, tl, hl, hl, sq, sq, tr, sq, sq, sq, sq, tr, __, sq, sq, sq, sq, vl, bl, hl, hl, hl, sq, sq, tr); const char* sq = "\xE2\x96\x88"; // square block
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"), const char* tr = "\xE2\x95\x97"; // top right corner
sq, sq, sq, sq, sq, sq, tl, br, sq, sq, tl, sq, sq, sq, sq, tl, sq, sq, vl, __, sq, sq, sq, sq, tl, br); const char* tl = "\xE2\x95\x94"; // top left corner
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")" " BANNERMSG1, const char* br = "\xE2\x95\x9D"; // bottom right corner
sq, sq, tl, hl, hl, hl, br, __, sq, sq, vl, bl, sq, sq, tl, br, sq, sq, vl, __, bl, hl, hl, sq, sq, tr); const char* bl = "\xE2\x95\x9A"; // bottom left corner
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")" " BANNERMSG2, const char* hl = "\xE2\x95\x90"; // horiz line
sq, sq, vl, __, __, __, __, __, sq, sq, vl, __, bl, hl, br, __, sq, sq, vl, sq, sq, sq, sq, sq, tl, br); const char* vl = "\xE2\x95\x91"; // vert line
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, const char* __ = " ";
bl, hl, br, __, __, __, __, __, bl, hl, br, __, __, __, __, __, bl, hl, br, bl, hl, hl, hl, hl, br, __);
}
static inline void ansi_showBanner(void) { 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"),
PrintAndLogEx(NORMAL, " " _BLUE_("██████╗ ███╗ ███╗█████╗ ")); sq, sq, sq, sq, sq, sq, tr, __, sq, sq, sq, tr, __, __, __, sq, sq, sq, tr, sq, sq, sq, sq, sq, tr, __);
PrintAndLogEx(NORMAL, " " _BLUE_("██╔══██╗████╗ ████║╚═══██╗")); 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"),
PrintAndLogEx(NORMAL, " " _BLUE_("██████╔╝██╔████╔██║ ████╔╝")); sq, sq, tl, hl, hl, sq, sq, tr, sq, sq, sq, sq, tr, __, sq, sq, sq, sq, vl, bl, hl, hl, hl, sq, sq, tr);
PrintAndLogEx(NORMAL, " " _BLUE_("██╔═══╝ ██║╚██╔╝██║ ╚══██╗") " " BANNERMSG1); 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"),
PrintAndLogEx(NORMAL, " " _BLUE_("██║ ██║ ╚═╝ ██║█████╔╝") " " BANNERMSG2); sq, sq, sq, sq, sq, sq, tl, br, sq, sq, tl, sq, sq, sq, sq, tl, sq, sq, vl, __, sq, sq, sq, sq, tl, br);
PrintAndLogEx(NORMAL, " " _BLUE_("╚═╝ ╚═╝ ╚═╝╚════╝ ") " " 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")" " BANNERMSG1,
} sq, sq, tl, hl, hl, hl, br, __, sq, sq, vl, bl, sq, sq, tl, br, sq, sq, vl, __, bl, hl, hl, sq, sq, tr);
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")" " BANNERMSG2,
static inline void ascii_showBanner(void) { sq, sq, vl, __, __, __, __, __, sq, sq, vl, __, bl, hl, br, __, sq, sq, vl, sq, sq, sq, sq, sq, tl, br);
PrintAndLogEx(NORMAL, " ######. ###. ###.#####. "); 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, " ##...##.####. ####. ...##."); bl, hl, br, __, __, __, __, __, bl, hl, br, __, __, __, __, __, bl, hl, br, bl, hl, hl, hl, hl, br, __);
PrintAndLogEx(NORMAL, " ######..##.####.##. ####.."); break;
PrintAndLogEx(NORMAL, " ##..... ##..##..##. ..##." " " BANNERMSG1); }
PrintAndLogEx(NORMAL, " ##. ##. .. ##.#####.." " " BANNERMSG2); case ANSI: {
PrintAndLogEx(NORMAL, " .. .. .. ..... " " " BANNERMSG3); PrintAndLogEx(NORMAL, " " _BLUE_("██████╗ ███╗ ███╗█████╗ "));
PrintAndLogEx(NORMAL, " " _BLUE_("██╔══██╗████╗ ████║╚═══██╗"));
PrintAndLogEx(NORMAL, " " _BLUE_("██████╔╝██╔████╔██║ ████╔╝"));
PrintAndLogEx(NORMAL, " " _BLUE_("██╔═══╝ ██║╚██╔╝██║ ╚══██╗") " " BANNERMSG1);
PrintAndLogEx(NORMAL, " " _BLUE_("██║ ██║ ╚═╝ ██║█████╔╝") " " BANNERMSG2);
PrintAndLogEx(NORMAL, " " _BLUE_("╚═╝ ╚═╝ ╚═╝╚════╝ ") " " BANNERMSG3);
break;
}
case ASCII: {
PrintAndLogEx(NORMAL, " ######. ###. ###.#####. ");
PrintAndLogEx(NORMAL, " ##...##.####. ####. ...##.");
PrintAndLogEx(NORMAL, " ######..##.####.##. ####..");
PrintAndLogEx(NORMAL, " ##..... ##..##..##. ..##." " " BANNERMSG1);
PrintAndLogEx(NORMAL, " ##. ##. .. ##.#####.." " " BANNERMSG2);
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");