aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRémi Verschelde2017-01-15 16:38:54 +0100
committerRémi Verschelde2017-01-15 16:42:17 +0100
commite0faf8a51b38205ed5f9ebbcf95559f0e3110bf2 (patch)
treee48c0738600aa28116204b98e52ed0ec35424ffd /modules
parent52e2a1e98df9f1a7d69c2b35c7be9edc1a8e9753 (diff)
downloadgodot-e0faf8a51b38205ed5f9ebbcf95559f0e3110bf2.tar.gz
godot-e0faf8a51b38205ed5f9ebbcf95559f0e3110bf2.tar.zst
godot-e0faf8a51b38205ed5f9ebbcf95559f0e3110bf2.zip
Style: Cosmetic fixes to play nice with clang-format
Diffstat (limited to 'modules')
-rw-r--r--modules/chibi/cp_loader_xm.cpp70
-rw-r--r--modules/gdscript/gd_function.cpp111
-rw-r--r--modules/gdscript/gd_parser.cpp4
3 files changed, 107 insertions, 78 deletions
diff --git a/modules/chibi/cp_loader_xm.cpp b/modules/chibi/cp_loader_xm.cpp
index cbd883642..ccf1eef0e 100644
--- a/modules/chibi/cp_loader_xm.cpp
+++ b/modules/chibi/cp_loader_xm.cpp
@@ -380,22 +380,23 @@ CPLoader::Error CPLoader_XM::load_song(const char *p_file,CPSong *p_song,bool p_
uint32_t cpos=file->get_pos();
//printf("pos is %i\n",cpos);
-
-
-/* +4 */ uint32_t hsize=file->get_dword(); //header length
+ /* +4 */
+ uint32_t hsize=file->get_dword(); //header length
char instrname[23];
instrname[22]=0;
- file->get_byte_array((uint8_t*)instrname,22);
-//XM_LOAD_DEBUG printf("name is %s\n",instrname);
+ file->get_byte_array((uint8_t*)instrname,22);
+ //XM_LOAD_DEBUG printf("name is %s\n",instrname);
-/* +27 */ aux=file->get_byte(); //byte that must be ignored
-//XM_LOAD_DEBUG printf("header size is %i\n",hsize);
+ /* +27 */
+ aux=file->get_byte(); //byte that must be ignored
+ //XM_LOAD_DEBUG printf("header size is %i\n",hsize);
-/* +29 */ sampnum=file->get_word();
+ /* +29 */
+ sampnum=file->get_word();
-//XM_LOAD_DEBUG printf("samples %i\n",sampnum);
+ //XM_LOAD_DEBUG printf("samples %i\n",sampnum);
instrument.set_name( instrname );
@@ -410,7 +411,8 @@ CPLoader::Error CPLoader_XM::load_song(const char *p_file,CPSong *p_song,bool p_
continue;
}
-/* +33 */ file->get_dword();
+ /* +33 */
+ file->get_dword();
if (Error result=load_instrument_internal(&instrument,false,cpos,hsize,sampnum)) {
@@ -418,9 +420,8 @@ CPLoader::Error CPLoader_XM::load_song(const char *p_file,CPSong *p_song,bool p_
file->close();
return result;
}
-
}
-//
+
file->close();
return FILE_OK;
}
@@ -440,7 +441,8 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool
instrname[22]=0;
-/* +129 */ file->get_byte_array((uint8_t*)notenumb,96);
+ /* +129 */
+ file->get_byte_array((uint8_t*)notenumb,96);
for (int j=0;j<24;j++) {
volenv[j]=file->get_word();
}
@@ -448,35 +450,47 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool
panenv[j]=file->get_word();
}
-/* +177 */
-/* +225 */
-/* +226 */ volpoints=file->get_byte();
-/* +227 */ panpoints=file->get_byte();
-/* +230 */ vol_sustain_loop=file->get_byte();
-/* +228 */ vol_loop_begin=file->get_byte();
-/* +229 */ vol_loop_end=file->get_byte();
+ /* +177 */
+ /* +225 */
+ /* +226 */
+ volpoints=file->get_byte();
+ /* +227 */
+ panpoints=file->get_byte();
+ /* +230 */
+ vol_sustain_loop=file->get_byte();
+ /* +228 */
+ vol_loop_begin=file->get_byte();
+ /* +229 */
+ vol_loop_end=file->get_byte();
-//XM_LOAD_DEBUG printf("1- volpoints: %i, panpoints: %i, susloop: %i, loop begin: %i, loop end %i\n",volpoints,panpoints,vol_sustain_loop,vol_loop_begin,vol_loop_end);
+ //XM_LOAD_DEBUG printf("1- volpoints: %i, panpoints: %i, susloop: %i, loop begin: %i, loop end %i\n",volpoints,panpoints,vol_sustain_loop,vol_loop_begin,vol_loop_end);
pan_sustain_loop=file->get_byte();
-/* +231 */ pan_loop_begin=file->get_byte();
-/* +232 */ pan_loop_end=file->get_byte();
+ /* +231 */
+ pan_loop_begin=file->get_byte();
+ /* +232 */
+ pan_loop_end=file->get_byte();
-/* +234 */ aux=file->get_byte();
+ /* +234 */
+ aux=file->get_byte();
p_instr->get_volume_envelope()->reset();
p_instr->get_volume_envelope()->set_enabled(aux&1);
p_instr->get_volume_envelope()->set_sustain_loop_enabled((aux&2)?true:false);
p_instr->get_volume_envelope()->set_loop_enabled((aux&4)?true:false);
-/* +235 */ aux=file->get_byte();
+ /* +235 */
+ aux=file->get_byte();
p_instr->get_pan_envelope()->reset();
p_instr->get_pan_envelope()->set_enabled(aux&1);
p_instr->get_pan_envelope()->set_sustain_loop_enabled((aux&2)?true:false);
p_instr->get_pan_envelope()->set_loop_enabled((aux&4)?true:false);
-/* +239 */ aux=file->get_dword(); // sadly, cant use those
-/* +241 */ p_instr->set_volume_fadeout( file->get_word() >> 4 );
-/* +243 */ aux=file->get_word(); // reserved!
+ /* +239 */
+ aux=file->get_dword(); // sadly, cant use those
+ /* +241 */
+ p_instr->set_volume_fadeout( file->get_word() >> 4 );
+ /* +243 */
+ aux=file->get_word(); // reserved!
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index 665998860..51e2c1e2b 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -331,8 +331,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
#endif
ip+=5;
-
- } continue;
+ continue;
+ }
case OPCODE_EXTENDS_TEST: {
CHECK_SPACE(4);
@@ -404,8 +404,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
*dst=extends_ok;
ip+=4;
-
- } continue;
+ continue;
+ }
case OPCODE_SET: {
CHECK_SPACE(3);
@@ -429,7 +429,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
}
ip+=4;
- } continue;
+ continue;
+ }
case OPCODE_GET: {
CHECK_SPACE(3);
@@ -460,7 +461,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
*dst=ret;
#endif
ip+=4;
- } continue;
+ continue;
+ }
case OPCODE_SET_NAMED: {
CHECK_SPACE(3);
@@ -483,7 +485,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
}
ip+=4;
- } continue;
+ continue;
+ }
case OPCODE_GET_NAMED: {
@@ -518,7 +521,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
*dst=ret;
#endif
ip+=4;
- } continue;
+ continue;
+ }
case OPCODE_SET_MEMBER: {
CHECK_SPACE(3);
@@ -540,7 +544,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
}
#endif
ip+=3;
- } continue;
+ continue;
+ }
case OPCODE_GET_MEMBER: {
CHECK_SPACE(3);
@@ -557,8 +562,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
}
#endif
ip+=3;
-
- } continue;
+ continue;
+ }
case OPCODE_ASSIGN: {
CHECK_SPACE(3);
@@ -568,8 +573,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
*dst = *src;
ip+=3;
-
- } continue;
+ continue;
+ }
case OPCODE_ASSIGN_TRUE: {
CHECK_SPACE(2);
@@ -578,7 +583,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
*dst = true;
ip+=2;
- } continue;
+ continue;
+ }
case OPCODE_ASSIGN_FALSE: {
CHECK_SPACE(2);
@@ -587,7 +593,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
*dst = false;
ip+=2;
- } continue;
+ continue;
+ }
case OPCODE_CONSTRUCT: {
CHECK_SPACE(2);
@@ -612,7 +619,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
ip+=4+argc;
//construct a basic type
- } continue;
+ continue;
+ }
case OPCODE_CONSTRUCT_ARRAY: {
CHECK_SPACE(1);
@@ -632,8 +640,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
*dst=array;
ip+=3+argc;
-
- } continue;
+ continue;
+ }
case OPCODE_CONSTRUCT_DICTIONARY: {
CHECK_SPACE(1);
@@ -655,8 +663,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
*dst=dict;
ip+=3+argc*2;
-
- } continue;
+ continue;
+ }
case OPCODE_CALL_RETURN:
case OPCODE_CALL: {
@@ -737,8 +745,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
//_call_func(NULL,base,*methodname,ip,argc,p_instance,stack);
ip+=argc+1;
-
- } continue;
+ continue;
+ }
case OPCODE_CALL_BUILT_IN: {
CHECK_SPACE(4);
@@ -775,12 +783,12 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
break;
}
ip+=argc+1;
-
- } continue;
+ continue;
+ }
case OPCODE_CALL_SELF: {
-
- } break;
+ break;
+ }
case OPCODE_CALL_SELF_BASE: {
CHECK_SPACE(2);
@@ -857,8 +865,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
}
ip+=4+argc;
-
- } continue;
+ continue;
+ }
case OPCODE_YIELD:
case OPCODE_YIELD_SIGNAL: {
@@ -938,8 +946,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
}
exit_ok=true;
-
- } break;
+ break;
+ }
case OPCODE_YIELD_RESUME: {
CHECK_SPACE(2);
@@ -950,8 +958,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
GET_VARIANT_PTR(result,1);
*result=p_state->result;
ip+=2;
-
- } continue;
+ continue;
+ }
case OPCODE_JUMP: {
CHECK_SPACE(2);
@@ -959,8 +967,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
ERR_BREAK(to<0 || to>_code_size);
ip=to;
-
- } continue;
+ continue;
+ }
case OPCODE_JUMP_IF: {
CHECK_SPACE(3);
@@ -983,7 +991,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
continue;
}
ip+=3;
- } continue;
+ continue;
+ }
case OPCODE_JUMP_IF_NOT: {
CHECK_SPACE(3);
@@ -1006,21 +1015,22 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
continue;
}
ip+=3;
- } continue;
+ continue;
+ }
case OPCODE_JUMP_TO_DEF_ARGUMENT: {
CHECK_SPACE(2);
ip=_default_arg_ptr[defarg];
-
- } continue;
+ continue;
+ }
case OPCODE_RETURN: {
CHECK_SPACE(2);
GET_VARIANT_PTR(r,1);
retvalue=*r;
exit_ok=true;
-
- } break;
+ break;
+ }
case OPCODE_ITERATE_BEGIN: {
CHECK_SPACE(8); //space for this an regular iterate
@@ -1050,8 +1060,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
ip+=5; //skip regular iterate which is always next
-
- } continue;
+ continue;
+ }
case OPCODE_ITERATE: {
CHECK_SPACE(4);
@@ -1079,7 +1089,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
}
ip+=5; //loop again
- } continue;
+ continue;
+ }
case OPCODE_ASSERT: {
CHECK_SPACE(2);
GET_VARIANT_PTR(test,1);
@@ -1105,7 +1116,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
#endif
ip+=2;
- } continue;
+ continue;
+ }
case OPCODE_BREAKPOINT: {
#ifdef DEBUG_ENABLED
if (ScriptDebugger::get_singleton()) {
@@ -1113,7 +1125,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
}
#endif
ip+=1;
- } continue;
+ continue;
+ }
case OPCODE_LINE: {
CHECK_SPACE(2);
@@ -1142,17 +1155,19 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
ScriptDebugger::get_singleton()->line_poll();
}
- } continue;
+ continue;
+ }
case OPCODE_END: {
exit_ok=true;
break;
- } break;
+ }
default: {
err_text="Illegal opcode "+itos(_code_ptr[ip])+" at address "+itos(ip);
- } break;
+ break;
+ }
}
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 4a36fbb4f..da0863fd3 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -1043,8 +1043,8 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
case GDTokenizer::TK_OP_ASSIGN_MUL: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_MUL ; break;
case GDTokenizer::TK_OP_ASSIGN_DIV: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_DIV ; break;
case GDTokenizer::TK_OP_ASSIGN_MOD: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_MOD ; break;
- case GDTokenizer::TK_OP_ASSIGN_SHIFT_LEFT: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_SHIFT_LEFT; ; break;
- case GDTokenizer::TK_OP_ASSIGN_SHIFT_RIGHT: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_SHIFT_RIGHT; ; break;
+ case GDTokenizer::TK_OP_ASSIGN_SHIFT_LEFT: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_SHIFT_LEFT; break;
+ case GDTokenizer::TK_OP_ASSIGN_SHIFT_RIGHT: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_SHIFT_RIGHT; break;
case GDTokenizer::TK_OP_ASSIGN_BIT_AND: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_BIT_AND ; break;
case GDTokenizer::TK_OP_ASSIGN_BIT_OR: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_BIT_OR ; break;
case GDTokenizer::TK_OP_ASSIGN_BIT_XOR: _VALIDATE_ASSIGN op=OperatorNode::OP_ASSIGN_BIT_XOR ; break;