Created
August 22, 2012 10:21
-
-
Save bilderbuchi/3424179 to your computer and use it in GitHub Desktop.
tweaked OF code style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Correct | |
#ifdef WIN32 | |
#define IS_WIN32 | |
#endif | |
#ifndef TARGET_LINUX | |
doSomething(); | |
#define TARGET_LINUX | |
#endif | |
#define MY_CONSTANT | |
ofSomeClass::doSomething(){ | |
//this should not be indented | |
#if !defined(TARGET_LINUX) && !defined(MAC_OS_X_VERSION_10_7) | |
doThis(); //indent to class level | |
int myInt = 5; | |
#define MY_CONSTANT2 | |
#if defined MY_CONSTANT | |
doMyConstantStuff(); | |
#endif | |
#else //this should not be indented | |
doThat(); //indent to class level | |
int myInt = 10; | |
#endif //this should not be indented | |
//define is still indented at correct level | |
#define MAC_OS_X_VERSION_10_7 | |
finishUp(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Correct | |
#ifdef WIN32 | |
#define IS_WIN32 | |
#endif | |
#ifndef TARGET_LINUX | |
doSomething(); | |
#define TARGET_LINUX | |
#endif | |
#define MY_CONSTANT | |
ofSomeClass::doSomething(){ | |
//this should not be indented | |
#if !defined(TARGET_LINUX) && !defined(MAC_OS_X_VERSION_10_7) | |
doThis(); //indent to class level | |
int myInt = 5; | |
#define MY_CONSTANT2 | |
#if defined MY_CONSTANT | |
doMyConstantStuff(); | |
#endif | |
#else //this should not be indented | |
doThat(); //indent to class level | |
int myInt = 10; | |
#endif //this should not be indented | |
//define is still indented at correct level | |
#define MAC_OS_X_VERSION_10_7 | |
finishUp(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Correct | |
#ifdef WIN32 | |
#define IS_WIN32 | |
#endif | |
#ifndef TARGET_LINUX | |
doSomething(); | |
#define TARGET_LINUX | |
#endif | |
#define MY_CONSTANT | |
ofSomeClass::doSomething(){ | |
//this should not be indented | |
#if !defined(TARGET_LINUX) && !defined(MAC_OS_X_VERSION_10_7) | |
doThis(); //indent to class level | |
int myInt = 5; | |
#define MY_CONSTANT2 | |
#if defined MY_CONSTANT | |
doMyConstantStuff(); | |
#endif | |
#else //this should not be indented | |
doThat(); //indent to class level | |
int myInt = 10; | |
#endif //this should not be indented | |
//define is still indented at correct level | |
#define MAC_OS_X_VERSION_10_7 | |
finishUp(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment