From 2b3b6f0e1bfcda99ddc9d7cc41b434c97413cf22 Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Sat, 8 Oct 2005 23:47:37 +0000 Subject: [PATCH] Trimmed whitespace. --- zsnes/src/linux/sdllink.c | 22 +++++++++++----------- zsnes/src/uic.c | 8 ++++---- zsnes/src/win/winlink.cpp | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/zsnes/src/linux/sdllink.c b/zsnes/src/linux/sdllink.c index 8b38218c..6639d0ef 100644 --- a/zsnes/src/linux/sdllink.c +++ b/zsnes/src/linux/sdllink.c @@ -1341,11 +1341,11 @@ Special thanks David Lee Lambert for most of the code here #ifdef linux int CheckBattery() -{ +{ int battery = -1; //No battery / Can't get info const char *ac = "/proc/acpi/ac_adapter/"; - - //Check ac adapter + + //Check ac adapter DIR *ac_dir = opendir(ac); if (ac_dir) { @@ -1353,12 +1353,12 @@ int CheckBattery() FILE *fp; const char *pattern = " %39[^:]: %39[ -~]"; // for sscanf char line[80], key[40], arg[40]; - + struct dirent *ent; while ((ent = readdir(ac_dir))) { if (ent->d_name[0] == '.') { continue; } - + snprintf(fnbuf, 40, "%s%s/state", ac, ent->d_name); fp = fopen(fnbuf, "r"); if (fp) @@ -1392,8 +1392,8 @@ static int BatteryLifePercent; static void update_battery_info() { const char *batt = "/proc/acpi/battery/"; - - //Check batteries + + //Check batteries DIR *batt_dir = opendir(batt); if (batt_dir) { @@ -1401,9 +1401,9 @@ static void update_battery_info() FILE *fp; const char *pattern = " %39[^:]: %39[ -~]"; // for sscanf char line[80], key[40], arg[40]; - + float x, design_capacity = 0.0f, remaining_capacity = 0.0f, present_rate = 0.0f, full_capacity = 0.0f; - + struct dirent *ent; while ((ent = readdir(batt_dir))) { @@ -1421,7 +1421,7 @@ static void update_battery_info() else if (strcmp(key, "last full capacity") == 0 && sscanf(arg, "%g", &x) == 1) { full_capacity += x; - } + } } fclose(fp); } @@ -1462,7 +1462,7 @@ static void update_battery_info() BatteryLifePercent = (int)floorf(remaining_capacity / ((full_capacity > 0.0f) ? full_capacity : design_capacity) * 100.0); if (present_rate < 0.0f) { - // Linux specifies rates in mWh or mAh + // Linux specifies rates in mWh or mAh BatteryLifeTime = (int)floorf(remaining_capacity / (-present_rate) * 3600.0); } } diff --git a/zsnes/src/uic.c b/zsnes/src/uic.c index bb8068a6..6c052ea7 100644 --- a/zsnes/src/uic.c +++ b/zsnes/src/uic.c @@ -357,8 +357,8 @@ void DisplayBatteryStatus() #ifndef __MSDOS__ int CheckBattery(); int CheckBatteryTime(); - int CheckBatteryPercent(); - + int CheckBatteryPercent(); + *CSStatus2 = 0; *CSStatus3 = 0; @@ -367,7 +367,7 @@ void DisplayBatteryStatus() case -1: //No battery strcpy(CSStatus, "No battery present"); break; - + case 0: //Plugged in { int percent = CheckBatteryPercent(); @@ -379,7 +379,7 @@ void DisplayBatteryStatus() } } break; - + case 1: //Not plugged in { int percent = CheckBatteryPercent(); diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 86e73f92..1338110d 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -3098,7 +3098,7 @@ int CheckBattery() { return(1); //Running off of battery } - + if ((SysPowerStat.BatteryFlag == 255) || //Unknown (SysPowerStat.BatteryFlag & 128)) //No battery { @@ -3110,7 +3110,7 @@ int CheckBattery() { return(0); //Plugged in } - + return(1); //Running off of battery }