[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: when source code isn't enough
Also sprach Peter Jay Salzman:
}
} also, i'm wondering if !! is a double negation or something about C which
} i've never learned:
}
} #define input_report_key(a,b,c) input_event(a, EV_KEY, b, !!(c))
}
} if it's a double negation, what possible purpose could it serve?
}
It returns either 0 or 1 depending on whether c is 0 or not. It can be
used for a number of things...For instance, if input_event takes a
"short or char" but c is something longer (an int or long), then it's
possible for the value of c to lose information if it's packed down into
something smaller (i.e., int c == 256 which is 0 when you cast it to a char,
so you get a false negative).
--
|| Bill Wendling wendling@ganymede.isdn.uiuc.edu
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.surriel.com/kernelnewbies.shtml