• Wincent
    Menu
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search

Proof WO_BOOL macro against overflows (WOCommon, d03a5b0)

Created 11/1/2007, updated 3/5/2024
  • snippets

Use the double-negation trick to ensure that a real boolean value is obtained in the WO_BOOL macro; without this trick the supplied expression is evaluated and cast to BOOL, which may not produce the expected result for large values.

Signed-off-by: Greg Hurrell <greg@hurrell.net>

← Add symlink to WOPublic tree (WOCommon, 9278332)
Ignore "index" directory (WOCommon, ae23fd8) →

All snippets

Site
  • About
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search
External
  • GitHub
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
Colophon

Made by Greg Hurrell with Rust (with help from Git and Neovim).