Removed unused variables (first pass)
Fixes various gcc 5.4.0 warnings for -Wunused-variable and -Wunused-but-set-variable
This commit is contained in:
parent
1b9433594e
commit
b6ac91c0e6
13 changed files with 20 additions and 100 deletions
|
|
@ -460,7 +460,6 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
|
|||
|
||||
const GDParser::Node *instance = on->arguments[0];
|
||||
|
||||
bool in_static=false;
|
||||
if (instance->type==GDParser::Node::TYPE_SELF) {
|
||||
//room for optimization
|
||||
|
||||
|
|
@ -771,8 +770,6 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
|
|||
|
||||
Vector<int> setchain;
|
||||
|
||||
int prev_key_idx=-1;
|
||||
|
||||
for(List<GDParser::OperatorNode*>::Element *E=chain.back();E;E=E->prev()) {
|
||||
|
||||
|
||||
|
|
@ -822,7 +819,6 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
|
|||
setchain.push_back(named ? GDFunction::OPCODE_SET_NAMED : GDFunction::OPCODE_SET);
|
||||
|
||||
prev_pos=dst_pos;
|
||||
prev_key_idx=key_idx;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1211,7 +1207,6 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *
|
|||
|
||||
if (p_func) {
|
||||
for(int i=0;i<p_func->arguments.size();i++) {
|
||||
int idx = i;
|
||||
codegen.add_stack_identifier(p_func->arguments[i],i);
|
||||
#ifdef TOOLS_ENABLED
|
||||
argnames.push_back(p_func->arguments[i]);
|
||||
|
|
@ -1449,7 +1444,6 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa
|
|||
p_script->name=p_class->name;
|
||||
|
||||
|
||||
int index_from=0;
|
||||
Ref<GDNativeClass> native;
|
||||
|
||||
if (p_class->extends_used) {
|
||||
|
|
|
|||
|
|
@ -449,57 +449,21 @@ static Ref<Reference> _get_parent_class(GDCompletionContext& context) {
|
|||
}
|
||||
|
||||
String base=context._class->extends_class[0];
|
||||
const GDParser::ClassNode *p = context._class->owner;
|
||||
Ref<GDScript> base_class;
|
||||
#if 0
|
||||
while(p) {
|
||||
|
||||
if (p->subclasses.has(base)) {
|
||||
if (context._class->extends_class.size()>1) {
|
||||
|
||||
return REF();
|
||||
|
||||
base_class=p->subclasses[base];
|
||||
break;
|
||||
}
|
||||
p=p->_owner;
|
||||
}
|
||||
#endif
|
||||
if (base_class.is_valid()) {
|
||||
#if 0
|
||||
for(int i=1;i<context._class->extends_class.size();i++) {
|
||||
//if not found, try engine classes
|
||||
if (!GDScriptLanguage::get_singleton()->get_global_map().has(base)) {
|
||||
|
||||
String subclass=context._class->extends_class[i];
|
||||
|
||||
if (base_class->subclasses.has(subclass)) {
|
||||
|
||||
base_class=base_class->subclasses[subclass];
|
||||
} else {
|
||||
|
||||
//print_line("Could not find subclass: "+subclass);
|
||||
return _get_type_from_class(context); //fail please
|
||||
}
|
||||
}
|
||||
|
||||
script=base_class;
|
||||
#endif
|
||||
|
||||
} else {
|
||||
|
||||
if (context._class->extends_class.size()>1) {
|
||||
|
||||
return REF();
|
||||
|
||||
|
||||
}
|
||||
//if not found, try engine classes
|
||||
if (!GDScriptLanguage::get_singleton()->get_global_map().has(base)) {
|
||||
|
||||
return REF();
|
||||
}
|
||||
|
||||
int base_idx = GDScriptLanguage::get_singleton()->get_global_map()[base];
|
||||
native = GDScriptLanguage::get_singleton()->get_global_array()[base_idx];
|
||||
return native;
|
||||
return REF();
|
||||
}
|
||||
|
||||
int base_idx = GDScriptLanguage::get_singleton()->get_global_map()[base];
|
||||
native = GDScriptLanguage::get_singleton()->get_global_array()[base_idx];
|
||||
return native;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -2100,10 +2064,8 @@ static void _find_call_arguments(GDCompletionContext& context,const GDParser::No
|
|||
}
|
||||
|
||||
Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base_path, Object*p_owner, List<String>* r_options, String &r_call_hint) {
|
||||
//print_line( p_code.replace(String::chr(0xFFFF),"<cursor>"));
|
||||
|
||||
GDParser p;
|
||||
//Error parse(const String& p_code, const String& p_base_path="", bool p_just_validate=false,const String& p_self_path="",bool p_for_completion=false);
|
||||
|
||||
Error err = p.parse(p_code,p_base_path,false,"",true);
|
||||
bool isfunction=false;
|
||||
|
|
@ -2204,7 +2166,6 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base
|
|||
if (code!="") {
|
||||
//if there is code, parse it. This way is slower but updates in real-time
|
||||
GDParser p;
|
||||
//Error parse(const String& p_code, const String& p_base_path="", bool p_just_validate=false,const String& p_self_path="",bool p_for_completion=false);
|
||||
|
||||
Error err = p.parse(scr->get_source_code(),scr->get_path().get_base_dir(),true,"",false);
|
||||
|
||||
|
|
|
|||
|
|
@ -502,7 +502,6 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
|
|||
|
||||
Ref<FuncRef> fr = memnew( FuncRef);
|
||||
|
||||
Object *obj = *p_args[0];
|
||||
fr->set_instance(*p_args[0]);
|
||||
fr->set_function(*p_args[1]);
|
||||
|
||||
|
|
|
|||
|
|
@ -514,8 +514,6 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
|
|||
} else if (/*tokenizer->get_token()==GDTokenizer::TK_OP_ADD ||*/ tokenizer->get_token()==GDTokenizer::TK_OP_SUB || tokenizer->get_token()==GDTokenizer::TK_OP_NOT || tokenizer->get_token()==GDTokenizer::TK_OP_BIT_INVERT) {
|
||||
|
||||
//single prefix operators like !expr -expr ++expr --expr
|
||||
OperatorNode *op = alloc_node<OperatorNode>();
|
||||
|
||||
Expression e;
|
||||
e.is_op=true;
|
||||
|
||||
|
|
|
|||
|
|
@ -1156,7 +1156,6 @@ Vector<uint8_t> GDTokenizerBuffer::parse_code_string(const String& p_code) {
|
|||
GDTokenizerText tt;
|
||||
tt.set_code(p_code);
|
||||
int line=-1;
|
||||
int col=0;
|
||||
|
||||
while(true) {
|
||||
|
||||
|
|
|
|||
|
|
@ -912,7 +912,6 @@ void GridMap::_octant_bake(const OctantKey &p_key, const Ref<TriangleMesh>& p_tm
|
|||
int lc = p_lights.size();
|
||||
const BakeLight* bl = p_lights.ptr();
|
||||
float ofs = cell_size*0.02;
|
||||
float att = 0.2;
|
||||
|
||||
|
||||
for(;V;V=V->next()) {
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ void InverseKinematics::_notification(int p_what)
|
|||
}
|
||||
} break;
|
||||
case NOTIFICATION_PROCESS: {
|
||||
float delta = get_process_delta_time();
|
||||
|
||||
Spatial *sksp = skel->cast_to<Spatial>();
|
||||
if (!bound)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue