git: 48633f8f820d - main - sysutils/bottom: fix build on ARM / POWER

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Thu, 18 Sep 2025 04:13:29 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=48633f8f820d201253e15d76563981c88a32d2a6

commit 48633f8f820d201253e15d76563981c88a32d2a6
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2025-09-17 11:51:50 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2025-09-18 04:13:21 +0000

    sysutils/bottom: fix build on ARM / POWER
    
    error[E0308]: mismatched types
       --> src/collection/processes/unix/process_ext.rs:186:40
        |
    186 |             const SIDL: u8 = assert_u8(libc::SIDL);
        |                              --------- ^^^^^^^^^^ expected `i8`, found `u8`
        |                              |
        |                              arguments to this function are incorrect
        |
    note: function defined here
       --> src/collection/processes/unix/process_ext.rs:182:22
        |
    182 |             const fn assert_u8(val: i8) -> u8 {
        |                      ^^^^^^^^^ -------
    
    error[E0308]: mismatched types
       --> src/collection/processes/unix/process_ext.rs:187:40
        |
    187 |             const SRUN: u8 = assert_u8(libc::SRUN);
        |                              --------- ^^^^^^^^^^ expected `i8`, found `u8`
        |                              |
        |                              arguments to this function are incorrect
        |
    note: function defined here
       --> src/collection/processes/unix/process_ext.rs:182:22
        |
    182 |             const fn assert_u8(val: i8) -> u8 {
        |                      ^^^^^^^^^ -------
    
    error[E0308]: mismatched types
       --> src/collection/processes/unix/process_ext.rs:188:42
        |
    188 |             const SSLEEP: u8 = assert_u8(libc::SSLEEP);
        |                                --------- ^^^^^^^^^^^^ expected `i8`, found `u8`
        |                                |
        |                                arguments to this function are incorrect
        |
    note: function defined here
       --> src/collection/processes/unix/process_ext.rs:182:22
        |
    182 |             const fn assert_u8(val: i8) -> u8 {
        |                      ^^^^^^^^^ -------
    
    error[E0308]: mismatched types
       --> src/collection/processes/unix/process_ext.rs:189:41
        |
    189 |             const SSTOP: u8 = assert_u8(libc::SSTOP);
        |                               --------- ^^^^^^^^^^^ expected `i8`, found `u8`
        |                               |
        |                               arguments to this function are incorrect
        |
    note: function defined here
       --> src/collection/processes/unix/process_ext.rs:182:22
        |
    182 |             const fn assert_u8(val: i8) -> u8 {
        |                      ^^^^^^^^^ -------
    
    error[E0308]: mismatched types
       --> src/collection/processes/unix/process_ext.rs:190:41
        |
    190 |             const SZOMB: u8 = assert_u8(libc::SZOMB);
        |                               --------- ^^^^^^^^^^^ expected `i8`, found `u8`
        |                               |
        |                               arguments to this function are incorrect
        |
    note: function defined here
       --> src/collection/processes/unix/process_ext.rs:182:22
        |
    182 |             const fn assert_u8(val: i8) -> u8 {
        |                      ^^^^^^^^^ -------
    
    error[E0308]: mismatched types
       --> src/collection/processes/unix/process_ext.rs:191:41
        |
    191 |             const SWAIT: u8 = assert_u8(libc::SWAIT);
        |                               --------- ^^^^^^^^^^^ expected `i8`, found `u8`
        |                               |
        |                               arguments to this function are incorrect
        |
    note: function defined here
       --> src/collection/processes/unix/process_ext.rs:182:22
        |
    182 |             const fn assert_u8(val: i8) -> u8 {
        |                      ^^^^^^^^^ -------
    
    error[E0308]: mismatched types
       --> src/collection/processes/unix/process_ext.rs:192:41
        |
    192 |             const SLOCK: u8 = assert_u8(libc::SLOCK);
        |                               --------- ^^^^^^^^^^^ expected `i8`, found `u8`
        |                               |
        |                               arguments to this function are incorrect
        |
    note: function defined here
       --> src/collection/processes/unix/process_ext.rs:182:22
        |
    182 |             const fn assert_u8(val: i8) -> u8 {
        |                      ^^^^^^^^^ -------
---
 .../files/patch-src_collection_processes_unix_process__ext.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sysutils/bottom/files/patch-src_collection_processes_unix_process__ext.rs b/sysutils/bottom/files/patch-src_collection_processes_unix_process__ext.rs
new file mode 100644
index 000000000000..ab1b26f46c4a
--- /dev/null
+++ b/sysutils/bottom/files/patch-src_collection_processes_unix_process__ext.rs
@@ -0,0 +1,11 @@
+--- src/collection/processes/unix/process_ext.rs.orig	2025-09-17 11:38:11 UTC
++++ src/collection/processes/unix/process_ext.rs
+@@ -179,7 +179,7 @@ fn convert_process_status_to_char(status: ProcessStatu
+                 _ => '?'
+             }
+         } else if #[cfg(target_os = "freebsd")] {
+-            const fn assert_u8(val: i8) -> u8 {
++            const fn assert_u8(val: libc::c_char) -> u8 {
+                 if val < 0 { panic!("there was an invalid i8 constant that is supposed to be a char") } else { val as u8 }
+             }
+