Merge pull request #2479 from firefly2442/cppcheck-unusedvars

ran cppcheck, found unused variables
This commit is contained in:
Juan Linietsky 2015-10-17 10:25:36 -03:00
commit b217e1417a
8 changed files with 3 additions and 12 deletions

View file

@ -299,10 +299,8 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int *
ERR_FAIL_COND_V(len<12,ERR_INVALID_DATA); ERR_FAIL_COND_V(len<12,ERR_INVALID_DATA);
Vector<StringName> names; Vector<StringName> names;
Vector<StringName> subnames; Vector<StringName> subnames;
bool absolute;
StringName prop; StringName prop;
int i=0;
uint32_t namecount=strlen&=0x7FFFFFFF; uint32_t namecount=strlen&=0x7FFFFFFF;
uint32_t subnamecount = decode_uint32(buf+4); uint32_t subnamecount = decode_uint32(buf+4);
uint32_t flags = decode_uint32(buf+8); uint32_t flags = decode_uint32(buf+8);
@ -391,7 +389,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int *
ie.type=decode_uint32(&buf[0]); ie.type=decode_uint32(&buf[0]);
ie.device=decode_uint32(&buf[4]); ie.device=decode_uint32(&buf[4]);
uint32_t len = decode_uint32(&buf[8])-12;
if (r_len) if (r_len)
(*r_len)+=12; (*r_len)+=12;

View file

@ -231,14 +231,12 @@ Ref<ResourceImportMetadata> ResourceLoader::load_import_metadata(const String &p
local_path = Globals::get_singleton()->localize_path(p_path); local_path = Globals::get_singleton()->localize_path(p_path);
String extension=p_path.extension(); String extension=p_path.extension();
bool found=false;
Ref<ResourceImportMetadata> ret; Ref<ResourceImportMetadata> ret;
for (int i=0;i<loader_count;i++) { for (int i=0;i<loader_count;i++) {
if (!loader[i]->recognize(extension)) if (!loader[i]->recognize(extension))
continue; continue;
found=true;
Error err = loader[i]->load_import_metadata(local_path,ret); Error err = loader[i]->load_import_metadata(local_path,ret);
if (err==OK) if (err==OK)

View file

@ -236,13 +236,12 @@ void AudioDriverOpenSL::start(){
ERR_FAIL_COND( res !=SL_RESULT_SUCCESS ); ERR_FAIL_COND( res !=SL_RESULT_SUCCESS );
/* Initialize arrays required[] and iidArray[] */ /* Initialize arrays required[] and iidArray[] */
int i;
SLboolean required[MAX_NUMBER_INTERFACES]; SLboolean required[MAX_NUMBER_INTERFACES];
SLInterfaceID iidArray[MAX_NUMBER_INTERFACES]; SLInterfaceID iidArray[MAX_NUMBER_INTERFACES];
#if 0 #if 0
for (i=0; i<MAX_NUMBER_INTERFACES; i++) for (int i=0; i<MAX_NUMBER_INTERFACES; i++)
{ {
required[i] = SL_BOOLEAN_FALSE; required[i] = SL_BOOLEAN_FALSE;
iidArray[i] = SL_IID_NULL; iidArray[i] = SL_IID_NULL;

View file

@ -127,7 +127,7 @@ static __inline__ void x86_cpuid(int func, int values[4])
static int static int
get_file_size(const char* pathname) get_file_size(const char* pathname)
{ {
int fd, ret, result = 0; int fd, result = 0;
char buffer[256]; char buffer[256];
fd = open(pathname, O_RDONLY); fd = open(pathname, O_RDONLY);

View file

@ -53,7 +53,6 @@ Error AudioDriverBB10::init(const char* p_name) {
dev_name = (char *) p_name; dev_name = (char *) p_name;
} }
printf("******** reconnecting to device %s\n", dev_name); printf("******** reconnecting to device %s\n", dev_name);
int card, dev;
int ret = snd_pcm_open_name(&pcm_handle, dev_name, SND_PCM_OPEN_PLAYBACK); int ret = snd_pcm_open_name(&pcm_handle, dev_name, SND_PCM_OPEN_PLAYBACK);
ERR_FAIL_COND_V(ret < 0, FAILED); ERR_FAIL_COND_V(ret < 0, FAILED);
pcm_open = true; pcm_open = true;

View file

@ -194,7 +194,6 @@ bool BodyPairSW::_test_ccd(float p_step,BodySW *p_A, int p_shape_A,const Transfo
//cast a segment from support in motion normal, in the same direction of motion by motion length //cast a segment from support in motion normal, in the same direction of motion by motion length
//support is the worst case collision point, so real collision happened before //support is the worst case collision point, so real collision happened before
int a;
Vector3 s=p_A->get_shape(p_shape_A)->get_support(p_xform_A.basis.xform(mnormal).normalized()); Vector3 s=p_A->get_shape(p_shape_A)->get_support(p_xform_A.basis.xform(mnormal).normalized());
Vector3 from = p_xform_A.xform(s); Vector3 from = p_xform_A.xform(s);
Vector3 to = from + motion; Vector3 to = from + motion;

View file

@ -5219,7 +5219,6 @@ void VisualServerRaster::_light_instance_update_lispsm_shadow(Instance *p_light,
AABB proj_space_aabb; AABB proj_space_aabb;
float max_d,min_d;
{ {

View file

@ -710,7 +710,7 @@ void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,D
*(out++) =0; *(out++) =0;
for (i=0;i<datalen;i++) { for (i=0;i<datalen;i++) {
int step,diff,vpdiff,signed_nibble,p,mask; int step,diff,vpdiff,mask;
uint8_t nibble; uint8_t nibble;
int16_t xm_sample; int16_t xm_sample;