Commit Graph

93 Commits

Author SHA1 Message Date
Jeremy Soller ffa097ccb3 Support nightly 2026-05-24 2026-05-25 17:03:17 -06:00
auronandace 3d16b8a1b8 move wchar_t to stddef header 2026-05-12 11:09:23 +01:00
Speedy_Lex eff610eac6 Fix many clippy lints 2026-05-07 00:05:07 +02:00
Connor-GH 7c8259dfd6 fix some lints caught by Clippy
Most of these changes are very simple. Among the changes made involve
taking advantage of auto-deref (`(*val).foo()` -> `val.foo()`) and
removing instances where we create a ref and immediately dereference it
(`&*val` -> `val`). There was a pretty neat case in `posix_openpt` where
some pointer verbosity was able to be reduced by using the more modern C
strings rather than the byte strings with an explicit NUL at the end.

Additionally, `exit()` now calls `unreachable!()` at the end. We
previously did `loop {}`, but clippy didn't like this. It can be up for
debate whether we want to make this `unreachable_unchecked` or similar.

There is only one change that might cause any sort of concern, and that
is the change from `.skip_while(!p).next()` -> `.find(p)`. This, like
everything else, was caught in a Clippy lint but I believe it deserves
some explanation because it isn't immediately obvious. Info about the
lint is here: https://rust-lang.github.io/rust-clippy/rust-1.89.0/index.html#skip_while_next
2026-04-30 19:02:35 -05:00
sourceturner 885118ccac add missing #[deprecated] annotations
add #[deprecated] annotation to functions that are marked
as 'legacy' or 'obsolecent' (according to their comments)
2026-04-20 21:37:52 +00:00
Nicolás Antinori 89f53e7640 Using Reader (formerly LookAheadReader) in scanf/wscanf format string 2026-04-14 14:11:57 -06:00
auronandace b4009544a8 minor code cleanups 2026-04-03 14:39:56 +01:00
Jeremy Soller d34872cb35 Merge branch 'fgetws-fix' into 'master'
fgetws: don't always return NULL on EOF

See merge request redox-os/relibc!1126
2026-03-30 07:12:06 -06:00
Connor-GH e721d3d7c8 fgetws: don't always return NULL on EOF
This was a bug that prevented a lot of tests from passing. We only
need to return NULL if the file had an error. `fgetws` "stops when end
of stream is reached". Also, it only returns an error if "end of stream
was *already* reached or if an error occurred" (emphasis mine). Compare
this to the musl implementation:
https://git.musl-libc.org/cgit/musl/tree/src/stdio/fgetws.c
2026-03-29 21:10:59 -05:00
auronandace 3b69b617a2 move wchar bits to cbindgen 2026-03-29 15:49:01 +01:00
auronandace 84c9038a11 move wcstoimax and wcstoumax from wchar to inttypes 2026-03-17 16:53:48 +00:00
auronandace 70f9dad334 move macros from wchar to macros 2026-03-17 16:46:09 +00:00
auronandace c4d667c6bf make some cast lossless in macro in wchar 2026-03-11 11:02:53 +00:00
auronandace 4b9a15ce7d getopt and wchar cleanup 2026-02-28 15:50:10 +00:00
auronandace e1e9753c65 add upper_case_acronyms clippy lint and minor cleanups 2026-02-25 13:55:01 +00:00
auronandace c8a1bff78a wchar cleanup 2026-02-20 09:51:15 +00:00
auronandace 7d1582a555 add unused_imports lint 2026-02-10 15:55:32 +00:00
auronandace c3f3e051e1 add unused-unsafe lint 2026-02-08 15:39:48 +00:00
auronandace d2d45f0c75 cargo fmt 2026-02-03 11:14:01 +00:00
auronandace 506df9a175 signal and wchar header cleanup 2026-02-03 11:11:41 +00:00
Wildan M 1acf1d83cc Temporarily enable wcsftime and wcsxfrm 2026-01-27 15:27:45 +07:00
Wildan M f15322453b Convert all println to log or todo 2026-01-25 05:27:38 +07:00
sourceturner defd2ce7c3 Deny deny-unsafe_op_in_unsafe_fn on the crate level 2026-01-21 00:41:57 +01:00
sourceturner 718dc53b87 Use unsafe blocks in wchar.h implementation 2026-01-18 21:25:10 +01:00
Jeremy Soller 1bbdcc1202 Implement fwscanf and similar 2025-12-19 12:12:16 -07:00
auronandace e913e2447b fix fmt 2025-12-16 11:20:37 +00:00
auronandace 59295af7d8 mark 2 functions as unsafe 2025-12-16 11:14:02 +00:00
auronandace e041d5b552 only import needed types 2025-12-16 11:10:55 +00:00
auronandace 973b96a727 update and add spec links 2025-12-16 10:59:38 +00:00
4lDO2 1c5732ba36 Share almost all code between printf and wprintf. 2025-10-07 15:58:34 +02:00
4lDO2 96917f519e Reuse PrintfIter for both printf and wprintf. 2025-10-06 16:16:48 +02:00
4lDO2 62cc63c351 WIP: Reimpl WPrintfIter also in safe code. 2025-10-06 16:16:48 +02:00
4lDO2 6dc2606886 Expand CStr to make PrintfIter fully safe. 2025-10-06 16:16:48 +02:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
Nicolás Antinori 28b471300b added vwscanf 2025-02-09 02:29:20 -03:00
Nicolás Antinori 230a15046d cleanup 2025-02-08 14:24:44 -03:00
Nicolás Antinori 47ed7a5907 fixed return value 2025-02-08 14:11:25 -03:00
Nicolás Antinori da3e1e94fa added get_char_encoded_length function 2025-02-08 14:05:37 -03:00
Nicolás Antinori ca9cfde3d6 clean up code 2025-02-07 16:04:25 -03:00
Nicolás Antinori 9d49a2745f it is working, but with an unsafe 2025-02-07 15:56:21 -03:00
Nicolás Antinori 61c31f348c changed wscanf parameters 2025-02-06 19:58:54 -03:00
Nicolás Antinori 18659e821f compiling but not working :) 2025-02-06 19:45:54 -03:00
Jeremy Soller 90f30c5f51 Make NulTerminated::new return option 2025-01-09 13:33:56 -07:00
Josh Megnauth 5348273ccc Emit C attributes via cbindgen 2024-11-17 16:15:07 +00:00
Peter Limkilde Svendsen 41264dc8b1 Add NulTerminatedInclusive iterator, rewrite/fix strchr/wcschr 2024-10-22 22:12:24 +00:00
Peter Limkilde Svendsen 0a23acd401 Implement iterators on pointers 2024-09-22 23:42:28 +00:00
Nicolás Antinori 198c5502b7 swscanf and vswscanf implementation proposal 2024-08-01 18:41:14 +00:00
Peter Limkilde Svendsen a7137512fa Use standard casing and mangling for internal errno 2024-03-01 00:25:42 +00:00
Peter Limkilde Svendsen 9093f6bc47 Use Cell representation for errno 2024-02-29 14:07:40 +00:00
4lDO2 5630b6e0df Make relibc (except libm) pure Rust 2024-01-11 13:08:06 +00:00