Drop redundant casts to the same type

This commit is contained in:
Christian Göttsche
2020-09-28 12:17:52 +02:00
committed by cgzones
parent 214c742ae1
commit 843949131a
9 changed files with 12 additions and 12 deletions

View File

@ -100,11 +100,11 @@ static ACPresence procAcpiCheck(void) {
}
for (;;) {
struct dirent* dirEntry = readdir((DIR *) dir);
struct dirent* dirEntry = readdir(dir);
if (!dirEntry)
break;
char* entryName = (char *) dirEntry->d_name;
const char* entryName = dirEntry->d_name;
if (entryName[0] != 'A')
continue;
@ -189,10 +189,10 @@ static void Battery_getSysData(double* level, ACPresence* isOnAC) {
unsigned long int totalRemain = 0;
for (;;) {
struct dirent* dirEntry = readdir((DIR *) dir);
struct dirent* dirEntry = readdir(dir);
if (!dirEntry)
break;
char* entryName = (char *) dirEntry->d_name;
const char* entryName = dirEntry->d_name;
char filePath[256];
xSnprintf(filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/type", entryName);

View File

@ -290,7 +290,7 @@ void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field)
xSnprintf(buffer, n, "%5lu ", lp->ctxt_diff);
break;
default:
Process_writeField((Process*)this, str, field);
Process_writeField(this, str, field);
return;
}
RichString_append(str, attr, buffer);

View File

@ -232,7 +232,7 @@ static inline unsigned long long LinuxProcess_adjustTime(unsigned long long t) {
jiffy = sc_jiffy;
}
double jiffytime = 1.0 / jiffy;
return (unsigned long long) t * jiffytime * 100;
return t * jiffytime * 100;
}
static bool LinuxProcessList_readStatFile(Process *process, const char* dirname, const char* name, char* command, int* commLen) {