Fix incorrect power of two operator - #56
Conversation
415757a to
0cafe94
Compare
|
Why is |
Because 2^16 isn't a power of two operation, it's 2 xor 16, which equals 18. Gcc 15.1 gives a warning about this. |
|
maybe we just want max connections 18? :D
no it is definitely not the same ^ is xor not pow |
uuups, you've cought me. I'm covering my head in a paper back and silently moving to some dark corner where nobody can see me ;-) I yet need your sign-off, btw. |
Added. Or do we need to use real names? |
|
‘18 connections ought to be enough for anybody’ ― Enrico Gates |
uuuh, do I become a billionare now ? ;-) |
|
uh, it needs a rebase, because I had to fix up the history (see mail) |
|
@metux done |
2^16 is 2 xor 16 which equals 18, not 2 to the power of 16 which is 65536 Signed-off-by: dec05eba <dec05eba@protonmail.com>
|
If we ever have conference, I want a t-shirt with that quote I have never said ;-) |
|
if put that in calculator — answer is 2^16 = 65536. |
That's a very reasonable question, BTW, fundamental to the project mgmt. @metux: does the XLibree fork allow to contribute anonymously? |
Some unique name and a valid mail address (where you can be reached) is enough. |
|
Bitwise xor is fairly uncommon, and if we assume it was the default behavior of xorg, this is gonna introduce incompatibilities between software run in xorg's xserver versus X11Libre's xserver. The last thing we need is another Wayland situation. Regardless, if you are planning to move forward with this commit, it would be wise to add a replacement for the old behavior. C# also uses ^ for bitwise xor, but it has math.pow() that does essentially the same thing ^ did before this issue. |
You could simply check date of the last change / when did it was introduced. The line comes from 2025-06-12: |
2^16 is 2 xor 16 which equals 18, not 2 to the power of 16 which is 65536