From: Jan Altensen Date: Sun, 10 May 2020 15:56:46 +0000 (+0200) Subject: libfmjni: resolve compilation errors X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=747e6e782471d3a4cf437b777c7cbcd298528452;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_fm.git libfmjni: resolve compilation errors Change-Id: I932e53b0d45ae0e2b2a6774dfc203f2b278f18b9 --- diff --git a/Android.mk b/Android.mk index 23ef5d9..f5377b9 100644 --- a/Android.mk +++ b/Android.mk @@ -21,7 +21,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := \ - FmRadioController_slsi.cpp + FmRadioController_slsi.cpp \ libfm_jni.cpp LOCAL_SHARED_LIBRARIES := \ diff --git a/FmRadioController_slsi.cpp b/FmRadioController_slsi.cpp index 2d0b737..1e402a5 100644 --- a/FmRadioController_slsi.cpp +++ b/FmRadioController_slsi.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include //#include #include "FmRadioController_slsi.h" @@ -17,6 +17,24 @@ long channel_limit_low; long channel_limit_high; +unsigned char test_read_data[TEST_DATA_SIZE][12]; +radio_data_t test_radio_data[TEST_DATA_SIZE]; +struct PIECC_data test_piecc[TEST_DATA_SIZE]; +struct RTPlus_data test_rtplus[TEST_DATA_SIZE]; +struct Final_RDS_data final_rds_data[10]; + +RadioText RT_Final; +RadioText RT_Buffered; +ServiceName PS_Final; +ServiceName PS_Buffered; + +unsigned char rt_flag; +unsigned char ps_flag; + +unsigned int test_data_index; +unsigned int test_data_index_rtplus; +unsigned int test_data_index_rds; + /******************************************************************************* * * Static functions to access device driver of kernel @@ -162,7 +180,7 @@ static int fm_radio_set_control(int fd, unsigned int id, long val) struct v4l2_control ctrl; int ret; - ALOGD("FmRadioController:fm_radio_set_control: id(%d) val(%d)\n", id, val); + ALOGD("FmRadioController:fm_radio_set_control: id(%d) val(%ld)\n", id, val); ctrl.id = id; if (val) @@ -327,7 +345,7 @@ void FmRadioController_slsi::TuneChannel(long channel) { int ret; - ALOGI("FmRadioController::TuneChannel: %d\n", channel); + ALOGI("FmRadioController::TuneChannel: %ld\n", channel); ret = fm_radio_check_state(&radio_state); if (ret < 0) @@ -575,15 +593,13 @@ fail: */ void FmRadioController_slsi::SetVolume(long volume) { - int ret; - - ALOGI("FmRadioController::SetVolume: %d\n", volume); + ALOGI("FmRadioController::SetVolume: %ld\n", volume); current_volume = volume; } long FmRadioController_slsi::GetVolume() { - ALOGI("FmRadioController::GetVolume: %d\n", current_volume); + ALOGI("FmRadioController::GetVolume: %ld\n", current_volume); return current_volume; } @@ -840,7 +856,7 @@ void FmRadioController_slsi::SetDeConstant(long DeConstant) long val_deconstant; int ret; - ALOGI("FmRadioController::SetDeConstant: %d\n", DeConstant); + ALOGI("FmRadioController::SetDeConstant: %ld\n", DeConstant); ret = fm_radio_check_state(&radio_state); if (ret < 0) @@ -854,7 +870,7 @@ void FmRadioController_slsi::SetDeConstant(long DeConstant) val_deconstant = FM_RADIO_DE_TIME_CONSTANT_0; break; default: - ALOGE("FmRadioController::SetDeConstant: [%d] is not supported\n", DeConstant); + ALOGE("FmRadioController::SetDeConstant: [%ld] is not supported\n", DeConstant); goto fail; } @@ -862,7 +878,7 @@ void FmRadioController_slsi::SetDeConstant(long DeConstant) if (ret < 0) goto fail; - ALOGI("FmRadioController::setDeConstant: set[%d] success\n", val_deconstant); + ALOGI("FmRadioController::setDeConstant: set[%ld] success\n", val_deconstant); fail: if (radio_state != FM_RADIO_STOP) @@ -895,7 +911,7 @@ long FmRadioController_slsi::GetCurrentRSSI() if (value > 127) value |= 0xFFFFFF00; - ALOGI("FmRadioController::GetCurrentRSSI: %d\n", value); + ALOGI("FmRadioController::GetCurrentRSSI: %ld\n", value); done: if (radio_state != FM_RADIO_STOP) @@ -927,7 +943,7 @@ long FmRadioController_slsi::GetCurrentSNR() goto done; } - ALOGI("FmRadioController::GetCurrentSNR: %d\n", value); + ALOGI("FmRadioController::GetCurrentSNR: %ld\n", value); done: if (radio_state != FM_RADIO_STOP) @@ -946,7 +962,7 @@ void FmRadioController_slsi::SetCurrentRSSI(long rssi) unsigned char crssi; int ret; - ALOGI("FmRadioController::SetCurrentRSSI: %d\n", rssi); + ALOGI("FmRadioController::SetCurrentRSSI: %ld\n", rssi); ret = fm_radio_check_state(&radio_state); if (ret < 0) @@ -959,7 +975,7 @@ void FmRadioController_slsi::SetCurrentRSSI(long rssi) if (ret < 0) goto fail; - ALOGI("FmRadioController::SetCurrentRSSI: set[%d] success\n", rssi); + ALOGI("FmRadioController::SetCurrentRSSI: set[%ld] success\n", rssi); fail: if (radio_state != FM_RADIO_STOP) @@ -993,7 +1009,7 @@ long FmRadioController_slsi::GetSeekMode() goto done; } - ALOGI("FmRadioController::GetSeekMode: %d\n", seek_mode); + ALOGI("FmRadioController::GetSeekMode: %ld\n", seek_mode); done: if (radio_state != FM_RADIO_STOP) @@ -1011,7 +1027,7 @@ void FmRadioController_slsi::SetSeekMode(long seek_mode) { int ret; - ALOGI("FmRadioController::SetSeekMode %d\n", seek_mode); + ALOGI("FmRadioController::SetSeekMode %ld\n", seek_mode); ret = fm_radio_check_state(&radio_state); if (ret < 0) @@ -1021,7 +1037,7 @@ void FmRadioController_slsi::SetSeekMode(long seek_mode) if (ret < 0) goto fail; - ALOGI("FmRadioController::SetSeekMode: set[%d] success\n", seek_mode); + ALOGI("FmRadioController::SetSeekMode: set[%ld] success\n", seek_mode); fail: if (radio_state != FM_RADIO_STOP) @@ -1353,7 +1369,9 @@ void FmRadioController_slsi::radio_data_proc(unsigned char *buf, int count) struct PIECC_data piecc_data; struct Final_RDS_data final_rds_data; struct RTPlus_data rtplus_data; +#if !defined(FM_RADIO_TEST_MODE) unsigned short checkFlag = 0; +#endif int i; memset(&r_data, 0, sizeof(radio_data_t)); @@ -1907,12 +1925,12 @@ int FmRadioController_slsi::GetAFValid_th() ******************************************************************************/ void FmRadioController_slsi::SetSeekRSSI(long freq) { - ALOGI("FmRadioController::SetSeekRSSI: freq:%d\n", freq); + ALOGI("FmRadioController::SetSeekRSSI: freq:%ld\n", freq); } void FmRadioController_slsi::SetSeekSNR(long freq) { - ALOGI("FmRadioController::SetSeekSNR: freq:%d\n", freq); + ALOGI("FmRadioController::SetSeekSNR: freq:%ld\n", freq); } void FmRadioController_slsi::setScanning(bool value) diff --git a/libfm_jni.cpp b/libfm_jni.cpp index a46d3cc..b0a649f 100644 --- a/libfm_jni.cpp +++ b/libfm_jni.cpp @@ -26,7 +26,7 @@ static FmRadioController_slsi * pFMRadio = NULL; -jboolean openDev(JNIEnv *env, jobject thiz) +jboolean openDev(JNIEnv *env __unused, jobject thiz __unused) { pFMRadio = new FmRadioController_slsi(); @@ -39,7 +39,7 @@ jboolean openDev(JNIEnv *env, jobject thiz) return JNI_FALSE; } -jboolean closeDev(JNIEnv *env, jobject thiz) +jboolean closeDev(JNIEnv *env __unused, jobject thiz __unused) { delete pFMRadio; pFMRadio = NULL; @@ -48,7 +48,7 @@ jboolean closeDev(JNIEnv *env, jobject thiz) return JNI_TRUE; } -jboolean powerUp(JNIEnv *env, jobject thiz, jfloat freq) +jboolean powerUp(JNIEnv *env __unused, jobject thiz __unused, jfloat freq) { pFMRadio->TuneChannel((int)(freq * 1000.00000000)); ALOGI("%s [freq=%d] \n", __func__, (int)freq); @@ -56,14 +56,14 @@ jboolean powerUp(JNIEnv *env, jobject thiz, jfloat freq) return JNI_TRUE; } -jboolean powerDown(JNIEnv *env, jobject thiz, jint type) +jboolean powerDown(JNIEnv *env __unused, jobject thiz __unused, jint type __unused) { ALOGI("%s \n", __func__); return JNI_TRUE; } -jboolean tune(JNIEnv *env, jobject thiz, jfloat freq) +jboolean tune(JNIEnv *env __unused, jobject thiz __unused, jfloat freq) { pFMRadio->TuneChannel((int)(freq * 1000.00000000)); ALOGI("%s [freq=%d] \n", __func__, (int)freq); @@ -71,10 +71,10 @@ jboolean tune(JNIEnv *env, jobject thiz, jfloat freq) return JNI_TRUE; } -jfloat seek(JNIEnv *env, jobject thiz, jfloat freq, jboolean isUp) //jboolean isUp; +jfloat seek(JNIEnv *env __unused, jobject thiz __unused, jfloat freq __unused, jboolean isUp) { int ret; - if (isup == JNI_TRUE) { + if (isUp == JNI_TRUE) { ret = pFMRadio->SeekUp(); } else { ret = pFMRadio->SeekDown(); @@ -85,21 +85,21 @@ jfloat seek(JNIEnv *env, jobject thiz, jfloat freq, jboolean isUp) //jboolean is return roundf((ret/1000.00F) * 100) / 100; } -jshortArray autoScan(JNIEnv *env, jobject thiz) +jshortArray autoScan(JNIEnv *env __unused, jobject thiz __unused) { ALOGD("%s not supported \n", __func__); return JNI_FALSE; } -jshort readRds(JNIEnv *env, jobject thiz) +jshort readRds(JNIEnv *env __unused, jobject thiz __unused) { ALOGD("%s not supported \n", __func__); return JNI_FALSE; } -jbyteArray getPs(JNIEnv *env, jobject thiz) +jbyteArray getPs(JNIEnv *env, jobject thiz __unused) { ALOGI("%s \n", __func__); // TODO @@ -111,7 +111,7 @@ jbyteArray getPs(JNIEnv *env, jobject thiz) return PSName; } -jbyteArray getLrText(JNIEnv *env, jobject thiz) +jbyteArray getLrText(JNIEnv *env, jobject thiz __unused) { ALOGI("%s \n", __func__); // TODO @@ -123,7 +123,7 @@ jbyteArray getLrText(JNIEnv *env, jobject thiz) return PSName; } -jshort activeAf(JNIEnv *env, jobject thiz) +jshort activeAf(JNIEnv *env __unused, jobject thiz __unused) { ALOGI("%s \n", __func__); @@ -132,14 +132,14 @@ jshort activeAf(JNIEnv *env, jobject thiz) return roundf((ret/1000.00F) * 100) / 100; } -jshortArray getAFList(JNIEnv *env, jobject thiz) +jshortArray getAFList(JNIEnv *env __unused, jobject thiz __unused) { ALOGD("%s not supported \n", __func__); return JNI_FALSE; } -jint setRds(JNIEnv *env, jobject thiz, jboolean rdson) +jint setRds(JNIEnv *env __unused, jobject thiz __unused, jboolean rdson) { if (rdson == JNI_TRUE) { pFMRadio->EnableRDS(); @@ -152,14 +152,14 @@ jint setRds(JNIEnv *env, jobject thiz, jboolean rdson) return JNI_TRUE; } -jboolean stopScan(JNIEnv *env, jobject thiz) +jboolean stopScan(JNIEnv *env __unused, jobject thiz __unused) { ALOGD("%s not supported \n", __func__); return JNI_TRUE; } -jint setMute(JNIEnv *env, jobject thiz, jboolean mute) +jint setMute(JNIEnv *env __unused, jobject thiz __unused, jboolean mute) { if (mute == JNI_TRUE) { pFMRadio->MuteOn(); @@ -172,14 +172,14 @@ jint setMute(JNIEnv *env, jobject thiz, jboolean mute) return JNI_TRUE; } -jint isRdsSupport(JNIEnv *env, jobject thiz) +jint isRdsSupport(JNIEnv *env __unused, jobject thiz __unused) { ALOGD("%s not supported \n", __func__); return JNI_FALSE; } -jint switchAntenna(JNIEnv *env, jobject thiz, jint antenna) +jint switchAntenna(JNIEnv *env __unused, jobject thiz __unused, jint antenna __unused) { ALOGD("%s not supported \n", __func__); @@ -262,7 +262,7 @@ typedef union { void* venv; } UnionJNIEnvToVoid; -jint JNI_OnLoad(JavaVM* vm, void* reserved) +jint JNI_OnLoad(JavaVM* vm, void* reserved __unused) { UnionJNIEnvToVoid uenv; uenv.venv = NULL;