Repository navigation
manager: fix build on 32-bit architectures - #185
Merged
Merged
Conversation
without this cast, build fails with this error on 32-bit platforms,
because `XScreenSaverInfo.idle` has the type `c_ulong`, which is `u32`
on 32-bit platforms and `u64` on 64-bit platforms:
```
Compiling wired v0.10.7 (/builddir/wired-notify-0.10.7)
error[E0308]: mismatched types
--> src/manager.rs:210:48
|
210 | if info_idle / 1000 >= threshold {
| ^^^^^^^^^ expected `u32`, found `u64`
error[E0277]: can't compare `u32` with `u64`
--> src/manager.rs:210:45
|
210 | if info_idle / 1000 >= threshold {
| ^^ no implementation for `u32 < u64` and `u32 > u64`
|
= help: the trait `PartialOrd<u64>` is not implemented for `u32`
help: `u32` implements trait `PartialOrd<Rhs>`
--> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/cmp.rs:1997:12
|
= note: `PartialOrd`
::: /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/cmp.rs:2080:4
|
= note: in this macro invocation
|
::: /host/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/glib-0.15.5/src/types.rs:429:1
|
429 | impl PartialOrd<ULong> for libc::c_ulong {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `PartialOrd<ULong>`
= note: this error originates in the macro `ord_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> src/manager.rs:217:47
|
217 | self.last_idle_time = info_idle;
| ------------------- ^^^^^^^^^ expected `u64`, found `u32`
| |
| expected due to the type of this binding
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `wired` (bin "wired") due to 3 previous errors
```
classabbyamp
force-pushed
the
32bit-fix
branch
from
October 12, 2026 17:25
4e7e939 to
a797e34
Compare
Owner
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
without this cast, build fails with this error on 32-bit platforms, because
XScreenSaverInfo.idlehas the typec_ulong, which isu32on 32-bit platforms andu64on 64-bit platforms: