Re: [hackers] [dmenu|libsl][PATCH] optimize drw_text() for large strings

2022-03-20 Thread Stein Gunnar Bakkeby
Hi NRK, I think you've gotten it backwards, this patch should *faster* if the > string is too long, since we're incrementing up to w instead of > decerementing down it it. Yes you are right of course, I was mixing up the two approaches. I have attached the changes I was experimenting with. I st

Re: [hackers] [st][PATCH v2] code-golfing: cleanup osc color related code

2022-03-20 Thread NRK
On Sun, Mar 20, 2022 at 12:49:22PM +0100, Hiltjo Posthuma wrote: > > - n = snprintf(buf, sizeof buf, > > "\033]4;%d;rgb:%02x%02x/%02x%02x/%02x%02x\007", > > -num, r, r, g, g, b, b); > > - > > - ttywrite(buf, n, 1); > > -} > > A nitpick, because I think the string always fits i

Re: [hackers] [st][PATCH v2] code-golfing: cleanup osc color related code

2022-03-20 Thread Hiltjo Posthuma
On Sun, Mar 20, 2022 at 05:36:04PM +0600, NRK wrote: > * adds missing function prototype > * move xgetcolor() prototype to win.h (that's where all the other x.c > func prototype seems to be declared at). > * reduces code duplication for osc 10/11/12 > * unify osc_color_response() and osc4_color_r