commit c403f22497e7af16a964775a2d80cde31374cc06 from: Brett Fisher date: Mon Jun 15 23:12:27 2026 UTC bxbar.c: Standardize code structure and improve logging safety. - Apply static qualifiers to run() and draw() for consistency. - Forward-declare text_fit() to match the call hierarchy. - Reorder functions to mirror the execution flow. - Remove redundant initial draw logic. commit - dd102aa1db20b7623d92da065e0554aad1ef700f commit + c403f22497e7af16a964775a2d80cde31374cc06 blob - feb7a63cad7608d95fe51ce286447a5339dc4cb6 blob + db158c046a4d3566fd05cb62d56035ea11ef3377 --- bxbar.c +++ bxbar.c @@ -33,7 +33,7 @@ static char stext[MAXINPUT]; static int slen = 0; static int dirty = 0; static XftFont *font; -static XftColor color[2]; /* [0] foreground, [1] background */ +static XftColor color[2]; /* [0] foreground, [1] background */ static XftDraw *xft_draw; /* Atoms for dock integration */ @@ -49,6 +49,7 @@ static void setup(void); static void set_dock_atoms(void); static void run(void); static int readstdin(void); +static int text_fit(const char *s, int len, int max_w, XGlyphInfo *ext); static void draw(void); static void cleanup(int status); @@ -60,7 +61,6 @@ int main(void) { signal(SIGHUP, SIG_IGN); setup(); - dirty = 0; /* force initial draw */ run(); cleanup(0); return 0; @@ -160,7 +160,7 @@ static void set_dock_atoms(void) { PropModeReplace, (unsigned char *)strut, 12); } -void +static void run(void) { logmsg("run() entered"); @@ -254,7 +254,7 @@ text_fit(const char *s, int len, int max_w, XGlyphInfo return 0; } -void +static void draw(void) { /* Paint background */