Skip to content

Commit 88e379b

Browse files
author
WolfTech Innovations
authored
Merge branch 'fastfetch-cli:dev' into dev
2 parents cd7d7e9 + 5f3ff07 commit 88e379b

File tree

16 files changed

+87
-20
lines changed

16 files changed

+87
-20
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,29 +1124,29 @@ elseif(Haiku)
11241124
src/common/networking_linux.c
11251125
src/common/processing_linux.c
11261126
src/detection/battery/battery_haiku.c
1127-
src/detection/bios/bios_nosupport.c
1128-
src/detection/board/board_nosupport.c
1127+
src/detection/bios/bios_windows.c
1128+
src/detection/board/board_windows.c
11291129
src/detection/bootmgr/bootmgr_nosupport.c
11301130
src/detection/brightness/brightness_nosupport.c
11311131
src/detection/btrfs/btrfs_nosupport.c
1132-
src/detection/chassis/chassis_nosupport.c
1132+
src/detection/chassis/chassis_windows.c
11331133
src/detection/cpu/cpu_haiku.c
1134-
src/detection/cpucache/cpucache_nosupport.c
1134+
src/detection/cpucache/cpucache_shared.c
11351135
src/detection/cpuusage/cpuusage_nosupport.c
11361136
src/detection/cursor/cursor_nosupport.c
11371137
src/detection/bluetooth/bluetooth_nosupport.c
11381138
src/detection/bluetoothradio/bluetoothradio_nosupport.c
11391139
src/detection/disk/disk_haiku.cpp
11401140
src/detection/dns/dns_linux.c
11411141
src/detection/physicaldisk/physicaldisk_nosupport.c
1142-
src/detection/physicalmemory/physicalmemory_nosupport.c
1142+
src/detection/physicalmemory/physicalmemory_linux.c
11431143
src/detection/diskio/diskio_nosupport.c
11441144
src/detection/displayserver/displayserver_haiku.cpp
11451145
src/detection/font/font_haiku.cpp
11461146
src/detection/gpu/gpu_haiku.c
11471147
src/detection/gpu/gpu_pci.c
11481148
src/detection/gtk_qt/gtk.c
1149-
src/detection/host/host_nosupport.c
1149+
src/detection/host/host_windows.c
11501150
src/detection/icons/icons_nosupport.c
11511151
src/detection/initsystem/initsystem_linux.c
11521152
src/detection/keyboard/keyboard_nosupport.c

doc/json_schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,8 @@
817817
"unit": {
818818
"type": "string",
819819
"description": "Set the unit of the temperature",
820-
"enum": ["CELSIUS", "C", "FAHRENHEIT", "F", "KELVIN", "K"],
821-
"default": "C"
820+
"enum": ["D", "Default", "Celsius", "C", "Fahrenheit", "F", "Kelvin", "K"],
821+
"default": "D"
822822
},
823823
"ndigits": {
824824
"type": "integer",

src/common/netif/netif_haiku.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ bool ffNetifGetDefaultRouteImpl(char iface[IF_NAMESIZE + 1], uint32_t* ifIndex)
2424
return false;
2525

2626
int size = config.ifc_value;
27-
if (size == 0)
27+
if (size <= 0)
2828
return false;
2929

30-
FF_AUTO_FREE void *buffer = malloc(size);
30+
FF_AUTO_FREE void *buffer = malloc((size_t) size);
3131
if (buffer == NULL) {
3232
return false;
3333
}

src/common/temps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig confi
3939

4040
switch (options->tempUnit)
4141
{
42+
case FF_TEMPERATURE_UNIT_DEFAULT:
4243
case FF_TEMPERATURE_UNIT_CELSIUS:
4344
ffStrbufAppendF(buffer, "%.*f°C", options->tempNdigits, celsius);
4445
break;

src/data/help.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,11 +722,12 @@
722722
"arg": {
723723
"type": "enum",
724724
"enum": {
725+
"D": "Default",
725726
"C": "Celsius",
726727
"F": "Fahrenheit",
727728
"K": "Kelvin"
728729
},
729-
"default": "C"
730+
"default": "D"
730731
}
731732
},
732733
{

src/detection/battery/battery_haiku.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const char* parseBattery(int dfd, const char* battId, FFlist* results)
2828
battery->temperature = FF_BATTERY_TEMP_UNSET;
2929
battery->cycleCount = extended.cycles;
3030
battery->timeRemaining = -1;
31-
battery->capacity = (double) basic.capacity / (double) extended.last_full_charge;
31+
battery->capacity = (double) basic.capacity * 100. / (double) extended.last_full_charge;
3232

3333
if (basic.state & BATTERY_DISCHARGING)
3434
ffStrbufAppendS(&battery->status, "Discharging, ");
@@ -44,7 +44,7 @@ const char* parseBattery(int dfd, const char* battId, FFlist* results)
4444
return NULL;
4545
}
4646

47-
const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results)
47+
const char* ffDetectBattery(FF_MAYBE_UNUSED FFBatteryOptions* options, FFlist* results)
4848
{
4949
FF_AUTO_CLOSE_DIR DIR* dir = opendir("/dev/power/acpi_battery/");
5050
if (!dir) return "opendir(/dev/power/acpi_battery) failed";

src/detection/sound/sound_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static void paSinkInfoCallback(pa_context *c, const pa_sink_info *i, int eol, vo
1818
ffStrbufInitS(&device->name, i->description);
1919
ffStrbufTrimRightSpace(&device->name);
2020
ffStrbufTrimLeft(&device->name, ' ');
21-
device->volume = i->mute ? 0 : (uint8_t) (i->volume.values[0] * 100 / PA_VOLUME_NORM);
21+
device->volume = i->mute ? 0 : (uint8_t) ((i->volume.values[0] * 100 + PA_VOLUME_NORM / 2 /*round*/) / PA_VOLUME_NORM);
2222
device->active = i->active_port && i->active_port->available != PA_PORT_AVAILABLE_NO;
2323
device->main = false;
2424
}

src/detection/sound/sound_nbsd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const char* ffDetectSound(FFlist* devices)
4141
ffStrbufInitS(&device->name, ad.name);
4242
ffStrbufTrimRightSpace(&device->name);
4343
ffStrbufInitF(&device->platformApi, "%s", "SunAudio");
44-
device->volume = (uint8_t) (ai.play.gain * 100 / AUDIO_MAX_GAIN);
44+
device->volume = (uint8_t) ((ai.play.gain * 100 + AUDIO_MAX_GAIN / 2) / AUDIO_MAX_GAIN);
4545
device->active = true;
4646
device->main = defaultDev == idev;
4747
}

src/detection/sound/sound_obsd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const char* ffDetectSound(FFlist* devices)
8080
if (!bundle.mute[i])
8181
totalLevel += bundle.level[i];
8282
}
83-
device->volume = (uint8_t) (totalLevel * 100 / bundle.iLevel);
83+
device->volume = (uint8_t) ((totalLevel * 100 + bundle.iLevel / 2) / bundle.iLevel);
8484

8585
return NULL;
8686
}

src/detection/terminalshell/terminalshell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
747747

748748
#endif
749749

750-
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__sun) || defined(__NetBSD__)
750+
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__sun) || defined(__NetBSD__) || defined(__HAIKU__)
751751

752752
if(ffStrbufStartsWithIgnCaseS(processName, "gnome-terminal"))
753753
return getTerminalVersionGnome(exe, version);

0 commit comments

Comments
 (0)