// TOCHECK: what is this function supposed to do?
#define bit2i(n) log2i((n) << 1)
+// boolean XOR (why doesn't C have the ^^ operator for this purpose?)
+#define boolxor(a,b) (!(a) != !(b))
+
// returns the smallest integer greater than or equal to "value", or 0 if "value" is too big
unsigned int CeilPowerOf2(unsigned int value);
listeners = snd_speakerlayout.listeners;
// Swap the left and right channels if snd_swapstereo is set
- if (!!snd_swapstereo.integer ^ !!v_flipped.integer)
+ if (boolxor(snd_swapstereo.integer, v_flipped.integer))
{
switch (snd_speakerlayout.channels)
{
(layout == SND_CHANNELLAYOUT_ALSA) ? "ALSA" : "standard");
}
- current_swapstereo = !!snd_swapstereo.integer ^ !!v_flipped.integer;
+ current_swapstereo = boolxor(snd_swapstereo.integer, v_flipped.integer);
current_channellayout = snd_channellayout.integer;
current_channellayout_used = layout;
}
return;
// If snd_swapstereo or snd_channellayout has changed, recompute the channel layout
- if (current_swapstereo != (!!snd_swapstereo.integer ^ !!v_flipped.integer) ||
+ if (current_swapstereo != boolxor(snd_swapstereo.integer, v_flipped.integer) ||
current_channellayout != snd_channellayout.integer)
S_SetChannelLayout();