mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 19:55:33 -04:00
universal7885: libfileio: Fix the unoverloadable function error
device/samsung/universal7885-common/apps/aidl-support/libfileio/FileIO.cpp:27:5: error: functions that differ only in their return type cannot be overloaded
int readline(const char *path) {
~~~ ^
device/samsung/universal7885-common/apps/aidl-support/libfileio/FileIO.cpp:12:13: note: previous definition is here
std::string readline(const char *path) {
~~~~~~~~~~~ ^
1 error generated.
- Rename int version to 'readint' to fix
This commit is contained in:
parent
eea872d99a
commit
8d728a6111
6 changed files with 7 additions and 7 deletions
|
|
@ -38,7 +38,7 @@ constexpr const char *FM_FREQ_SEEK = FM_SYSFS_BASE "/radio_freq_seek";
|
|||
}
|
||||
switch (type) {
|
||||
case GetType::GET_TYPE_FM_FREQ:
|
||||
*_aidl_return = FileIO::readline(FM_FREQ_CTL);
|
||||
*_aidl_return = FileIO::readint(FM_FREQ_CTL);
|
||||
break;
|
||||
case GetType::GET_TYPE_FM_UPPER_LIMIT:
|
||||
case GetType::GET_TYPE_FM_LOWER_LIMIT:
|
||||
|
|
@ -109,7 +109,7 @@ constexpr const char *FM_FREQ_SEEK = FM_SYSFS_BASE "/radio_freq_seek";
|
|||
for (int i = 0; i < TRACK_SIZE; i++) {
|
||||
FileIO::writeline(FM_FREQ_SEEK,
|
||||
"1 " + std::to_string(SYSFS_SPACING * 10));
|
||||
int freq = FileIO::readline(FM_FREQ_CTL);
|
||||
int freq = FileIO::readint(FM_FREQ_CTL);
|
||||
if (std::find(freqs_list.begin(), freqs_list.end(), freq) !=
|
||||
freqs_list.end())
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ std::string readline(const char *path) {
|
|||
return value;
|
||||
}
|
||||
|
||||
int readline(const char *path) {
|
||||
int readint(const char *path) {
|
||||
const std::string value = readline(path);
|
||||
try {
|
||||
return stoi(value);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace FileIO {
|
||||
std::string readline(const char *path);
|
||||
int readline(const char *path);
|
||||
int readint(const char *path);
|
||||
|
||||
void writeline(const char *path, const std::string& data);
|
||||
void writeline(const char *path, const int data);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ static inline const char *BatterySysToPath(BatterySys type) {
|
|||
// Methods from ::android::hardware::battery::V1_0::IBattery follow.
|
||||
::ndk::ScopedAStatus BatteryStats::getBatteryStats(BatterySys stats,
|
||||
int32_t *_aidl_return) {
|
||||
*_aidl_return = FileIO::readline(BatterySysToPath(stats));
|
||||
*_aidl_return = FileIO::readint(BatterySysToPath(stats));
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ constexpr const char *TORCH_LVL =
|
|||
::ndk::ScopedAStatus
|
||||
FlashBrightness::readFlashlightstats(bool s2mu106, int32_t *_aidl_return) {
|
||||
*_aidl_return =
|
||||
s2mu106 ? FileIO::readline(TORCH_LVL) / 21 : FileIO::readline(TORCH_LVL);
|
||||
s2mu106 ? FileIO::readint(TORCH_LVL) / 21 : FileIO::readint(TORCH_LVL);
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace aidl::vendor::eureka::hardware::parts {
|
|||
|
||||
void SmartCharge::battery_monitor(void) {
|
||||
while (kShouldRun) {
|
||||
auto batt = FileIO::readline(BATTERY_CAPACITY_CURRENT);
|
||||
auto batt = FileIO::readint(BATTERY_CAPACITY_CURRENT);
|
||||
if (batt >= limit) {
|
||||
if (kTookAction)
|
||||
goto sleep;
|
||||
|
|
|
|||
Loading…
Reference in a new issue