Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-24 Thread Anselm R Garbe
On 24 April 2017 at 11:56, Snobb wrote: > Completely agree with all points. I generally prefer inline function and > const variables over defines if I can help it. General guidance is not the question here. The suggestion for syntax sugar would only justify a define in the actual case of simplif

Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-24 Thread Snobb
+1 Completely agree with all points. I generally prefer inline function and const variables over defines if I can help it. On 24/04/17 10:14am, Laslo Hunhold wrote: > On Mon, 24 Apr 2017 10:01:31 +0200 > Anselm R Garbe wrote: > > Hey Anselm, > > > I'd prefer a define instead of a one-line fun

Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-24 Thread Martin Kühne
Urm, I'd prefer a local pointer, but I figure a modern compiler should be perfectly capable of deciding that intermediate results and pointers should be stored/cached for reuse. Which should sufficiently illustrate that these particular lines of code are perfectly fine. cheers! mar77i

Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-24 Thread Laslo Hunhold
On Mon, 24 Apr 2017 10:01:31 +0200 Anselm R Garbe wrote: Hey Anselm, > I'd prefer a define instead of a one-line function. a macro does not bring any advantages to the table, but some disadvantages. It makes it harder to analyze the binaries when debug symbols are compiled in, because everythin

Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-24 Thread Anselm R Garbe
On 23 April 2017 at 20:14, Hiltjo Posthuma wrote: > On Sun, Apr 23, 2017 at 11:54:31PM +1000, Daniel Cousens wrote: >>I have found this pattern to take up significant parts of my time when >>rebasing my changes onto suckless/master, Â such that I feel the >>following patch will both i

Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-24 Thread Laslo Hunhold
On Mon, 24 Apr 2017 08:44:12 +0200 Hiltjo Posthuma wrote: Hey Hiltjo, > Don't make it const, but agree with the rest. it may be a minute detail, but is there a reason why we do not declare "canarrange" as static? Is it so that external patches can use it as well in separate c-files? With best

Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-23 Thread Hiltjo Posthuma
On Mon, Apr 24, 2017 at 10:14:36AM +1000, Daniel Cousens wrote: >Indeed, � apologies for the style issues. >The argument could probably be const too. > >On 24 Apr. 2017 04:32, "Laslo Hunhold" <[1]d...@frign.de> wrote: > > On Sun, 23 Apr 2017 20:14:01 +0200 > Hiltjo Posthuma

Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-23 Thread Daniel Cousens
Indeed, apologies for the style issues. The argument could probably be const too. On 24 Apr. 2017 04:32, "Laslo Hunhold" wrote: > On Sun, 23 Apr 2017 20:14:01 +0200 > Hiltjo Posthuma wrote: > > Hey Hiltjo, > > wouldn't it also be better to remove the space between function name > and list of a

Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-23 Thread Laslo Hunhold
On Sun, 23 Apr 2017 20:14:01 +0200 Hiltjo Posthuma wrote: Hey Hiltjo, wouldn't it also be better to remove the space between function name and list of arguments? The current patch is inconsistent with the dwm-style. > > +int canarrange (Monitor* m) { --> > > +int > > +canarrange(Monitor* m)

Re: [hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-23 Thread Hiltjo Posthuma
On Sun, Apr 23, 2017 at 11:54:31PM +1000, Daniel Cousens wrote: >I have found this pattern to take up significant parts of my time when >rebasing my changes onto suckless/master, � such that I feel the >following patch will both increase readability, � reduce diffs and >overall inc

[hackers] Repeated usage of m->lt[m->sellt]->arrange deduplication

2017-04-23 Thread Daniel Cousens
I have found this pattern to take up significant parts of my time when rebasing my changes onto suckless/master, such that I feel the following patch will both increase readability, reduce diffs and overall increase code quality :). Thoughts? From 160dbe6eaa8fccc1eb5c9cde036b9256c2e820c5 Mon Se