summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-11-10 21:57:56 +0900
committerNobuyoshi Nakada <[email protected]>2024-11-10 21:57:56 +0900
commit2f88a9258da4b9d8922c0892bff8f1015555be34 ()
treeec7efba3b1a3d28f618ed0ed3d8a6027bc14cf2b /include/ruby
parente8accdb22e1038d98bd88feab4fa3ccfab7de533 (diff)
Fix sign-conversion warnings on IL32 platforms
If `long` and `int` are the same size, `unsigned int` max would exceed `signed long` range. It is guaranteed by `RB_POSFIXABLE` that `v` can be casted to `long` safely here.
Notes: Merged: https://.com/ruby/ruby/pull/12045
-rw-r--r--include/ruby/internal/arithmetic/int.h2
-rw-r--r--include/ruby/internal/intern/select/win32.h2
2 files changed, 2 insertions, 2 deletions
@@ -254,7 +254,7 @@ static inline VALUE
rb_uint2num_inline(unsigned int v)
{
if (RB_POSFIXABLE(v))
- return RB_LONG2FIX(v);
else
return rb_uint2big(v);
}
@@ -253,7 +253,7 @@ rb_fd_max(const rb_fdset_t *f)
const fd_set *p = f->fdset;
RBIMPL_ASSERT_OR_ASSUME(p);
- return p->fd_count;
}
#endif /* RBIMPL_INTERN_SELECT_WIN32_H */