-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📐 Reformated code #52
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, the reformatting really helps.
However, I have one major issue with the formatting - { placement and member indentation of class
.
source/server/ScriptEngine.h
Outdated
}; | ||
typedef std::vector<callback_t> callbackList; | ||
typedef std::vector<callback_t> callbackList; | ||
|
||
class ScriptEngine { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ placement of class
should be consistent with struct
, and I like it placed on the next line.
source/server/ScriptEngine.h
Outdated
* @return true if the callback exists | ||
*/ | ||
bool callbackExists(const std::string &type, asIScriptFunction *func, asIScriptObject *obj); | ||
ScriptEngine(Sequencer *seq); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class members absolutely must be indented (I don't even remember seeing it unindented anywhere). It should also be consistent with struct
which is indented here.
source/gui/servergui.cpp
Outdated
}; | ||
|
||
BEGIN_EVENT_TABLE(MyDialog, wxDialog | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please hand-edit this and put the closing brackets on the same line as the macro 😄
source/gui/statpict.cpp
Outdated
@@ -20,15 +20,15 @@ | |||
#include "wx/dcclient.h" | |||
|
|||
IMPLEMENT_DYNAMIC_CLASS(wxStaticPicture, wxControl | |||
) | |||
const wxChar *wxStaticPictureNameStr = wxT("staticPicture"); | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto; please hand-edit and put the () on single line.
source/gui/statpict.cpp
Outdated
|
||
/* | ||
* wxStaticPicture | ||
*/ | ||
|
||
BEGIN_EVENT_TABLE(wxStaticPicture, wxControl | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto; please hand-edit and put the () on single line.
source/server/ScriptEngine.cpp
Outdated
// necessary to register your own string type if you don't want to. | ||
RegisterStdString(engine); | ||
RegisterScriptArray(engine, | ||
true); // true = allow arrays to be registered as type[] (e.g. int[]). Needed for backwards compatibillity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call was probably line-broken because of the long comment.
If you wouldn't mind the comment spanning far to the right (I wouldn't), just remove the linebreak please.
Otherwise, rewrite like this:
const bool allow_cstyle_array_syntax = true; // e.g. int[]; Needed for backwards compatibility
RegisterScriptArray(engine, allow_cstyle_array_syntax);
source/server/broadcaster.cpp
Outdated
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Foobar. If not, see <http://www.gnu.org/licenses/>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please substitute Foobar with Rigs of Rods Server everywhere 🤣
#define VAL_BOOL(_STR_)(RudeStrToBool(value)) | ||
|
||
void ProcessConfigEntry(const char *key, const char *value) { | ||
if (strcmp(key, "baseconfig") == 0) { LoadConfigFile(VAL_STR (value)); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, I'd prefer this if-elseif...
cascade to be excluded from the auto-formatting and left as-is, perhaps just aligned to columns.
2f492d4
to
d911490
Compare
@only-a-ptr everything should be fixed now. |
Something I missed the last time: indentation depth of 3 = 🤢. Keep 4 please. |
@AnotherFoxGuy Sorry for letting this rot... please reset it to current upstream and re-run the formatting. |
I will replace this with clang-format |
Used the ben2.cfg from uncrustify
Fixes #50