From 306196da2a8383919881f0eb997dc1756f7325e3 Mon Sep 17 00:00:00 2001 From: Peter Limkilde Svendsen Date: Mon, 3 Feb 2025 22:47:45 +0100 Subject: [PATCH] Implement ffsl(), ffsll() --- src/header/strings/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/header/strings/mod.rs b/src/header/strings/mod.rs index cb2475bafe..2f4ab09513 100644 --- a/src/header/strings/mod.rs +++ b/src/header/strings/mod.rs @@ -79,13 +79,19 @@ pub extern "C" fn ffs(i: c_int) -> c_int { /// See . // #[no_mangle] pub extern "C" fn ffsl(i: c_long) -> c_int { - unimplemented!(); + if i == 0 { + return 0; + } + 1 + i.trailing_zeros() as c_int } /// See . // #[no_mangle] pub extern "C" fn ffsll(i: c_longlong) -> c_int { - unimplemented!(); + if i == 0 { + return 0; + } + 1 + i.trailing_zeros() as c_int } /// See .