diff options
author | Mattias Andrée <maandree@kth.se> | 2021-09-16 16:05:05 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-09-16 16:05:05 +0200 |
commit | 744f1b4d36f1671c03f63820246746a5b52f24be (patch) | |
tree | fc5c86167c63d1771add281ac77a7ad8f588f206 /adjbacklight.c | |
parent | Update man page (diff) | |
download | adjbacklight-8.2.1.tar.gz adjbacklight-8.2.1.tar.bz2 adjbacklight-8.2.1.tar.xz |
Improve makefile and fix warnings8.2.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'adjbacklight.c')
-rw-r--r-- | adjbacklight.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/adjbacklight.c b/adjbacklight.c index d79d11b..57495d8 100644 --- a/adjbacklight.c +++ b/adjbacklight.c @@ -134,11 +134,11 @@ adjbrightness(const char *device, double pcur, long int cur, long int max, doubl switch (strlen(suf)) { case 2: pcur = adj * pcur / 100 + pcur * inc; - cur = (long int)(pcur * (double)max + 0.5); + cur = (long int)(pcur * (double)max + (double)0.5f); break; case 1: pcur = adj / 100 + pcur * inc; - cur = (long int)(pcur * (double)max + 0.5); + cur = (long int)(pcur * (double)max + (double)0.5f); break; case 0: cur = (long int)adj + cur * inc; @@ -155,7 +155,7 @@ adjbrightness(const char *device, double pcur, long int cur, long int max, doubl static void bars(long int max, long int init, long int cur) { - long int mid = (long int)((double)cur * (double)(cols - 2) / (double)max + 0.5); + long int mid = (long int)((double)cur * (double)(cols - 2) / (double)max + (double)0.5f); printf("\033[%iD\033[6A", cols); printf("\033[2K┌%s┐\n", line); |