On 19.11.20 г. 0:13 ч., Steven Rostedt wrote:
On Wed, 18 Nov 2020 16:49:49 +0200 "Yordan Karadzhov (VMware)" <y.karadz@xxxxxxxxx> wrote:+static void *index_to_ptr(unsigned int index) +{ + unsigned long p; + + p = INVALID_STREAM_MASK | index; + + return (void *) p;I'm curious to why you add a space between the *) and the p? This is now your project, so I wont complain about formats like this. You can decide it. But typecasts in Linux are expected to be together with what they typecast.
Hi Steven, I have no strong preference about having or not having this extra space.For me, having the space makes the C-like casting look more similar to a new declaration on contrary to the C++-like casting that will be something like this
unsigned long i(340); char c = char(i); and looks more like a constructor call. Of course C++ will not let you cast number to pointer this way. Thanks! Yordan
Again, no change required, we just need to be consistent with it. (makes it easier to grep for) -- Steve+} +