Skip to content

Commit

Permalink
Style: Format code with clang-format 6.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga committed Jul 18, 2018
1 parent ce53876 commit 7c9f745
Show file tree
Hide file tree
Showing 33 changed files with 47 additions and 67 deletions.
9 changes: 8 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Commented out parameters are those with the same value as base LLVM style
# We can uncomment them if we want to change their value, or enforce the
# chosen value in case the base style changes (last sync: Clang 5.0.0).
# chosen value in case the base style changes (last sync: Clang 6.0.1).
---
### General config, applies to all languages ###
BasedOnStyle: LLVM
Expand Down Expand Up @@ -32,6 +32,7 @@ AllowShortIfStatementsOnASingleLine: true
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# AfterExternBlock: false
# BeforeCatch: false
# BeforeElse: false
# IndentBraces: false
Expand Down Expand Up @@ -60,6 +61,7 @@ Cpp11BracedListStyle: false
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# IncludeBlocks: Preserve
IncludeCategories:
- Regex: '".*"'
Priority: 1
Expand All @@ -69,6 +71,7 @@ IncludeCategories:
Priority: 3
# IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: true
# IndentPPDirectives: None
IndentWidth: 4
# IndentWrappedFunctionNames: false
# JavaScriptQuotes: Leave
Expand All @@ -86,6 +89,10 @@ IndentWidth: 4
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60
# PointerAlignment: Right
# RawStringFormats:
# - Delimiter: pb
# Language: TextProto
# BasedOnStyle: google
# ReflowComments: true
# SortIncludes: true
# SortUsingDeclarations: true
Expand Down
2 changes: 1 addition & 1 deletion core/dvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class PoolVector {
}

if (old_alloc->refcount.unref() == true) {
//this should never happen but..
//this should never happen but..

#ifdef DEBUG_ENABLED
MemoryPool::alloc_mutex->lock();
Expand Down
6 changes: 3 additions & 3 deletions core/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ T *_nullptr() {

#define OFFSET_OF(st, m) \
((size_t)((char *)&(_nullptr<st>()->m) - (char *)0))
/**
/**
* Some platforms (devices) not define NULL
*/

#ifndef NULL
#define NULL 0
#endif

/**
/**
* Windows defines a lot of badly stuff we'll never ever use. undefine it.
*/

Expand All @@ -104,7 +104,7 @@ T *_nullptr() {
#include "error_list.h"
#include "error_macros.h"

/** Generic ABS function, for math uses please use Math::abs */
/** Generic ABS function, for math uses please use Math::abs */

#ifndef ABS
#define ABS(m_v) ((m_v < 0) ? (-(m_v)) : (m_v))
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles2/rasterizer_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void RasterizerGLES2::initialize() {

#endif // GLAD_ENABLED

// For debugging
// For debugging
#ifdef GLES_OVER_GL
if (GLAD_GL_ARB_debug_output) {
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_ERROR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, NULL, GL_TRUE);
Expand Down
5 changes: 1 addition & 4 deletions drivers/gles2/rasterizer_storage_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,6 @@ void RasterizerStorageGLES2::texture_set_force_redraw_if_visible(RID p_texture,
ERR_FAIL_COND(!texture);

texture->redraw_if_visible = p_enable;

}

void RasterizerStorageGLES2::texture_set_detect_3d_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) {
Expand Down Expand Up @@ -1191,7 +1190,7 @@ RID RasterizerStorageGLES2::multimesh_create() {
return RID();
}

void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, VS::MultimeshColorFormat p_color_format,VS::MultimeshCustomDataFormat p_data) {
void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, VS::MultimeshColorFormat p_color_format, VS::MultimeshCustomDataFormat p_data) {
}

int RasterizerStorageGLES2::multimesh_get_instance_count(RID p_multimesh) const {
Expand Down Expand Up @@ -1234,8 +1233,6 @@ Color RasterizerStorageGLES2::multimesh_instance_get_custom_data(RID p_multimesh
}

void RasterizerStorageGLES2::multimesh_set_as_bulk_array(RID p_multimesh, const PoolVector<float> &p_array) {


}

void RasterizerStorageGLES2::multimesh_set_visible_instances(RID p_multimesh, int p_visible) {
Expand Down
3 changes: 1 addition & 2 deletions drivers/gles2/rasterizer_storage_gles2.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ class RasterizerStorageGLES2 : public RasterizerStorage {
bool active;
GLenum tex_id;


uint16_t stored_cube_sides;

RenderTarget *render_target;
Expand Down Expand Up @@ -515,7 +514,7 @@ class RasterizerStorageGLES2 : public RasterizerStorage {

virtual RID multimesh_create();

virtual void multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, VS::MultimeshColorFormat p_color_format,VS::MultimeshCustomDataFormat p_data=VS::MULTIMESH_CUSTOM_DATA_NONE);
virtual void multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, VS::MultimeshColorFormat p_color_format, VS::MultimeshCustomDataFormat p_data = VS::MULTIMESH_CUSTOM_DATA_NONE);
virtual int multimesh_get_instance_count(RID p_multimesh) const;

virtual void multimesh_set_mesh(RID p_multimesh, RID p_mesh);
Expand Down
6 changes: 3 additions & 3 deletions drivers/windows/file_access_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ void FileAccessWindows::close() {
bool rename_error = true;
int attempts = 4;
while (rename_error && attempts) {
// This workaround of trying multiple times is added to deal with paranoid Windows
// antiviruses that love reading just written files even if they are not executable, thus
// locking the file and preventing renaming from happening.
// This workaround of trying multiple times is added to deal with paranoid Windows
// antiviruses that love reading just written files even if they are not executable, thus
// locking the file and preventing renaming from happening.

#ifdef UWP_ENABLED
// UWP has no PathFileExists, so we check attributes instead
Expand Down
2 changes: 0 additions & 2 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,8 +1049,6 @@ void EditorInspectorSection::setup(const String &p_section, const String &p_labe
vbox->hide();
}
}
// void editor_set_section_unfold(const String &p_section, bool p_unfolded);

#endif
}

Expand Down
8 changes: 4 additions & 4 deletions editor/spatial_editor_gizmos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3272,10 +3272,10 @@ NavigationMeshSpatialGizmo::NavigationMeshSpatialGizmo(NavigationMeshInstance *p
navmesh = p_navmesh;
}

//////
///
///
///
//////
///
///
///

#define BODY_A_RADIUS 0.25
#define BODY_B_RADIUS 0.27
Expand Down
2 changes: 1 addition & 1 deletion modules/gdscript/gdscript_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser::

if (on->arguments[0]->type == GDScriptParser::Node::TYPE_OPERATOR && (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX || static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED)) {

// SET (chained) MODE!
// SET (chained) MODE!
#ifdef DEBUG_ENABLED
if (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED) {
const GDScriptParser::OperatorNode *inon = static_cast<GDScriptParser::OperatorNode *>(on->arguments[0]);
Expand Down
2 changes: 1 addition & 1 deletion modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@ static void _find_type_arguments(GDScriptCompletionContext &context, const GDScr

} else {

//regular method
//regular method
#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
if (p_argidx < m->get_argument_count()) {
PropertyInfo pi = m->get_argument_info(p_argidx);
Expand Down
2 changes: 1 addition & 1 deletion modules/gdscript/gdscript_tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ void GDScriptTokenizerText::advance(int p_amount) {
_advance();
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////

#define BYTECODE_VERSION 13

Expand Down
6 changes: 3 additions & 3 deletions modules/mono/mono_gd/gd_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,9 @@ void GDMono::_domain_assemblies_cleanup(uint32_t p_domain_id) {

void GDMono::unhandled_exception_hook(MonoObject *p_exc, void *) {

// This method will be called by the runtime when a thrown exception is not handled.
// It won't be called when we manually treat a thrown exception as unhandled.
// We assume the exception was already printed before calling this hook.
// This method will be called by the runtime when a thrown exception is not handled.
// It won't be called when we manually treat a thrown exception as unhandled.
// We assume the exception was already printed before calling this hook.

#ifdef DEBUG_ENABLED
GDMonoUtils::debug_send_unhandled_exception_error((MonoException *)p_exc);
Expand Down
2 changes: 1 addition & 1 deletion modules/mono/mono_gd/gd_mono_marshal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,4 +884,4 @@ Dictionary mono_object_to_Dictionary(MonoObject *p_dict) {

return ret;
}
}
} // namespace GDMonoMarshal
6 changes: 3 additions & 3 deletions modules/pvr/texture_loader_pvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ ResourceFormatPVR::ResourceFormatPVR() {
Image::_image_compress_pvrtc2_func = _compress_pvrtc4;
}

/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////

//PVRTC decompressor, Based on PVRTC decompressor by IMGTEC.
//PVRTC decompressor, Based on PVRTC decompressor by IMGTEC.

/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////

#define PT_INDEX 2
#define BLK_Y_SIZE 4
Expand Down
2 changes: 1 addition & 1 deletion modules/vorbis/audio_stream_ogg_vorbis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ size_t AudioStreamPlaybackOGGVorbis::_ov_read_func(void *p_dst, size_t p_data, s

int AudioStreamPlaybackOGGVorbis::_ov_seek_func(void *_f, ogg_int64_t offs, int whence) {

//printf("seek to %p, offs %i, whence %i\n",_f,(int)offs,whence);
//printf("seek to %p, offs %i, whence %i\n",_f,(int)offs,whence);

#ifdef SEEK_SET
//printf("seek set defined\n");
Expand Down
2 changes: 1 addition & 1 deletion modules/websocket/lws_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,6 @@ public: \
\
protected:

/* clang-format on */
/* clang-format on */

#endif // LWS_HELPER_H
3 changes: 2 additions & 1 deletion platform/android/audio_driver_opensl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void AudioDriverOpenSL::_buffer_callback(
/* SLuint32 eventFlags,
const void * pBuffer,
SLuint32 bufferSize,
SLuint32 dataUsed*/) {
SLuint32 dataUsed*/
) {

bool mix = true;

Expand Down
3 changes: 2 additions & 1 deletion platform/android/audio_driver_opensl.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class AudioDriverOpenSL : public AudioDriver {
/* SLuint32 eventFlags,
const void * pBuffer,
SLuint32 bufferSize,
SLuint32 dataUsed*/);
SLuint32 dataUsed*/
);

static void _buffer_callbacks(
SLAndroidSimpleBufferQueueItf queueItf,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public void consume(final String sku) {
}
final String token = _token;
new AsyncTask<String, String, String>() {

@Override
protected String doInBackground(String... params) {
try {
Expand All @@ -89,7 +88,6 @@ protected void onPostExecute(String param) {
error(param);
}
}

}
.execute();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void onServiceConnected(ComponentName name, IBinder service) {

public void requestPurchase(final String sku, String transactionId) {
new PurchaseTask(mService, Godot.getInstance()) {

@Override
protected void error(String message) {
godotPaymentV3.callbackFail(message);
Expand All @@ -128,7 +127,6 @@ protected void canceled() {
protected void alreadyOwned() {
godotPaymentV3.callbackAlreadyOwned(sku);
}

}
.purchase(sku, transactionId);
}
Expand All @@ -139,7 +137,6 @@ public boolean isConnected() {

public void consumeUnconsumedPurchases() {
new ReleaseAllConsumablesTask(mService, activity) {

@Override
protected void success(String sku, String receipt, String signature, String token) {
godotPaymentV3.callbackSuccessProductMassConsumed(receipt, signature, sku);
Expand Down Expand Up @@ -208,14 +205,12 @@ public void requestPurchased() {

public void processPurchaseResponse(int resultCode, Intent data) {
new HandlePurchaseTask(activity) {

@Override
protected void success(final String sku, final String signature, final String ticket) {
godotPaymentV3.callbackSuccess(ticket, signature, sku);

if (auto_consume) {
new ConsumeTask(mService, activity) {

@Override
protected void success(String ticket) {
}
Expand Down Expand Up @@ -245,12 +240,10 @@ protected void canceled() {
public void validatePurchase(String purchaseToken, final String sku) {

new ValidateTask(activity, godotPaymentV3) {

@Override
protected void success() {

new ConsumeTask(mService, activity) {

@Override
protected void success(String ticket) {
godotPaymentV3.callbackSuccess(ticket, null, sku);
Expand Down Expand Up @@ -283,7 +276,6 @@ public void setAutoConsume(boolean autoConsume) {

public void consume(final String sku) {
new ConsumeTask(mService, activity) {

@Override
protected void success(String ticket) {
godotPaymentV3.callbackSuccessProductMassConsumed(ticket, "", sku);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public void consumeItAll() {
String signature = mySignatures.get(i);
//Log.d("godot", "A punto de consumir un item con token:" + token + "\n" + receipt);
new GenericConsumeTask(context, mService, sku, receipt, signature, token) {

@Override
public void onSuccess(String sku, String receipt, String signature, String token) {
ReleaseAllConsumablesTask.this.success(sku, receipt, signature, token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public ValidateTask(Activity context, GodotPaymentV3 godotPaymentsV3) {

public void validatePurchase(final String sku) {
new AsyncTask<String, String, String>() {

private ProgressDialog dialog;

@Override
Expand Down Expand Up @@ -113,7 +112,6 @@ protected void onPostExecute(String response) {
error(e.getMessage());
}
}

}
.execute();
}
Expand Down
Loading

0 comments on commit 7c9f745

Please sign in to comment.