Skip to content

Instantly share code, notes, and snippets.

@ex
Created November 4, 2012 04:43
Show Gist options
  • Save ex/4010317 to your computer and use it in GitHub Desktop.
Save ex/4010317 to your computer and use it in GitHub Desktop.
Bug bitwise operators precedence
#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) {
...
info->is_directory =
file_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY != 0;
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment