This repository has been archived by the owner on Nov 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 496
Code Style
nvllvs edited this page Jan 27, 2017
·
2 revisions
If you want your pull request to be accepted into AimTux make sure your code style is as follows:
====================
If your IDE/editor isn't defaulting to tabs please change it to do so.
Use:
- functions/methods
- struct names
- class names
- namespace names
MyAwesomeFunctionName();
struct MyStruct
{
};
class MyClass
{
};
namespace MyNamespace
{
}
Use:
- Variables
- Parameters
The first character must be lowercase
int myIntName;
int somethingOther;
void Something(int somethingOther);
Preprocessor names should be in all caps as standard in C/C++.
All preprocessors shouldn't be indented.
#define MY_PREPROCESSOR_NAME true
while (true)
{
#if MY_PREPROCESSOR_NAME
// Write something here...
int i = 0;
#endif
}
All curly braces ({ }
) should be on it's own line.
if (true)
{
while (true)
{
// Something...
}
}
When defining a pointer, put the asterisk on the left side, touching the type name.
void* myPointer;
uint32_t* someRandomIntPointer;
void SomeMethod(uint32_t& myReference);