jni: Remove unused variables
* libfm_jni/FmPerformanceParams.cpp:
443:16: error: unused variable 'sinr'
* libfm_jni/ConfigFmThs.cpp:
425:17: error: unused variable 'ret'
433:9: error: unused variable 'value'
566:9: error: unused variable 'index'
* libfm_jni/ConfFileParser.cpp:
328:16: error: unused variable 'num_of_keys'
536:9: error: unused variable 'grp_name'
537:16: error: unused variable 'len'
732:13: error: unused function 'key_exist'
* libfm_jni/FmRadioController.cpp:
651:9: error: unused variable 'stationList
* libfm_jni/FmPerformanceParams.cpp:
442:16: error: unused variable 'sinr'
Change-Id: I9c4839d1bc8b64c536b8a7db7c2094001f2562ba
diff --git a/jni/ConfFileParser.cpp b/jni/ConfFileParser.cpp
index d270690..0a0883a 100644
--- a/jni/ConfFileParser.cpp
+++ b/jni/ConfFileParser.cpp
@@ -322,7 +322,6 @@
{
unsigned int grp_hash_code;
unsigned int grp_index;
- unsigned int num_of_keys;
unsigned int i;
unsigned int j = 0;
unsigned int key_len;
@@ -530,8 +529,6 @@
)
{
const char *line_begin;
- char *grp_name;
- unsigned int len;
if((line == NULL) || (key_file == NULL)) {
ALOGE("key file or line is null\n");
@@ -729,53 +726,6 @@
}
}
-static char key_exist
-(
- const group_table *key_file,
- const char *cur_grp,
- const char *key
-)
-{
- unsigned int grp_hash_code;
- unsigned int key_hash_code;
- unsigned int grp_index;
- unsigned int key_index;
- group *grp = NULL;
- key_value_pair_list *list = NULL;
-
- if((key_file != NULL) && (cur_grp != NULL)
- && (key != NULL) && ((key_file->grps_hash != NULL))
- && (strcmp(key, ""))) {
- grp_hash_code = get_hash_code(cur_grp);
- grp_index = (grp_hash_code % key_file->grps_hash_size);
- grp = key_file->grps_hash[grp_index];
- key_hash_code = get_hash_code(key);
- while((grp != NULL)) {
- if(!strcmp(cur_grp, grp->grp_name)) {
- key_index = (key_hash_code % grp->keys_hash_size);
- if(grp->list)
- list = grp->list[key_index];
- while((list != NULL) && strcmp(key, list->key)) {
- list = list->next;
- }
- if(list != NULL){
- return TRUE;
- }else{
- return FALSE;
- }
- }
- grp = grp->grp_next;
- }
- if(!grp) {
- return TRUE;
- }else {
- return FALSE;
- }
- }else {
- return FALSE;
- }
-}
-
//checks validity of key
//a valid key must start in
//a seperate line and key must
diff --git a/jni/ConfigFmThs.cpp b/jni/ConfigFmThs.cpp
index 3845dfd..10bb921 100644
--- a/jni/ConfigFmThs.cpp
+++ b/jni/ConfigFmThs.cpp
@@ -344,7 +344,6 @@
UINT fd
)
{
- signed char ret = FM_SUCCESS;
char **keys = NULL;
char **keys_cpy = NULL;
char *key_value = NULL;
@@ -352,7 +351,6 @@
unsigned int *freqs_array = NULL;
signed char *sinrs_array = NULL;
char *sinrs = NULL;
- int value;
unsigned int freq_cnt = 0;
unsigned int sinr_cnt = 0;
FmPerformanceParams perf_params;
@@ -485,7 +483,6 @@
const char *file, UINT fd
)
{
- int index;
struct NAME_MAP *found;
char **grps = NULL;
char **grps_cpy = NULL;
diff --git a/jni/FmPerformanceParams.cpp b/jni/FmPerformanceParams.cpp
index bdd0a43..9d1542f 100644
--- a/jni/FmPerformanceParams.cpp
+++ b/jni/FmPerformanceParams.cpp
@@ -377,7 +377,6 @@
struct v4l2_ext_control ext_ctl;
struct v4l2_ext_controls v4l2_ctls;
unsigned int freq;
- signed char sinr;
unsigned int size = 0;
char *data = NULL;
signed char ret = FM_FAILURE;
diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp
index 27dd2a0..d6cb073 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -78,7 +78,6 @@
SCAN_DN
};
-static JNIEnv *g_jEnv = NULL;
static JavaVM *g_jVM = NULL;
namespace android {
@@ -126,7 +125,6 @@
static JNIEnv *mCallbackEnv = NULL;
static jobject mCallbacksObj = NULL;
static bool mCallbacksObjCreated = false;
-static jfieldID sCallbacksField;
static jclass javaClassRef;
static jmethodID method_psInfoCallback;
@@ -273,7 +271,7 @@
{
ALOGD("RT_EVT: " );
jbyteArray rt_buff = NULL;
- int i,len;
+ int len;
if (!checkCallbackThread())
return;
@@ -290,7 +288,6 @@
}
mCallbackEnv->SetByteArrayRegion(rt_buff, 0, len,(jbyte *)rt);
- jbyte* bytes= mCallbackEnv->GetByteArrayElements(rt_buff,0);
mCallbackEnv->CallVoidMethod(mCallbacksObj, method_rtCallback,rt_buff);
mCallbackEnv->DeleteLocalRef(rt_buff);
@@ -299,7 +296,7 @@
void fm_ps_update_cb(char *ps)
{
jbyteArray ps_data = NULL;
- int i,len;
+ int len;
int numPs;
if (!checkCallbackThread())
return;
@@ -315,7 +312,6 @@
}
mCallbackEnv->SetByteArrayRegion(ps_data, 0, len,(jbyte *)ps);
- jbyte* bytes= mCallbackEnv->GetByteArrayElements(ps_data,0);
mCallbackEnv->CallVoidMethod(mCallbacksObj, method_psInfoCallback,ps_data);
mCallbackEnv->DeleteLocalRef(ps_data);
}
@@ -350,7 +346,7 @@
{
ALOGD("ERT_EVT");
jbyteArray ert_buff = NULL;
- int i,len;
+ int len;
if (!checkCallbackThread())
return;
@@ -375,7 +371,7 @@
{
ALOGI("Extended Contry code ");
jbyteArray ecc_buff = NULL;
- int i,len;
+ int len;
if (!checkCallbackThread())
return;
@@ -656,7 +652,7 @@
(JNIEnv* env, jobject thiz, jstring path)
{
int fd;
- int i = 0, retval=0, err;
+ int i = 0, err;
char value[PROPERTY_VALUE_MAX] = {'\0'};
char versionStr[40] = {'\0'};
int init_success = 0;
@@ -730,9 +726,6 @@
static jint android_hardware_fmradio_FmReceiverJNI_closeFdNative
(JNIEnv * env, jobject thiz, jint fd)
{
- int i = 0;
- int cleanup_success = 0;
- char retval =0;
char value[PROPERTY_VALUE_MAX] = {'\0'};
property_get("vendor.bluetooth.soc", value, NULL);
@@ -1277,7 +1270,6 @@
{
int i=0;
char value[PROPERTY_VALUE_MAX] = {'\0'};
- char firmwareVersion[80];
property_get("vendor.bluetooth.soc", value, NULL);