Commit Graph

29 Commits

Author SHA1 Message Date
jD91mZM2 e84ea94dd0 Execute fmt.sh 2019-06-12 14:45:33 +02:00
Jason Hansel a5409ecd36 Fix out-of-bounds error in strsignal 2019-06-10 10:25:59 -04:00
Mateusz Mikuła d62db7b1b9 Add memrchr() 2019-05-11 13:49:46 +02:00
Alex Lyon 5bbce37789 string: add strnlen_s() 2019-04-26 20:36:37 -07:00
Mateusz Mikuła 1ebd8a3d72 Handle zero length for strerror_r 2019-04-24 17:42:28 +02:00
Jeremy Soller 7bde036031 Remove va_list submodule, format 2019-04-21 15:45:55 -06:00
jD91mZM2 6d4ac9dba8 Finally, get rid of all rust warnings
Just a small step along the way to reduce the massive wall of spam
every time you compile.

This was done partly automagically with `cargo fix`. The rest was me
deleting or commenting out a bunch of variables. Hope nothing was
important...
2019-04-21 21:12:16 +02:00
jD91mZM2 3a3fd3da39 Use the memchr crate
https://github.com/BurntSushi/rust-memchr is supposed to be a whole
lot faster :)
2019-04-21 19:09:37 +02:00
jD91mZM2 601cb43f6c Merge branch 'strerror_r' into 'master'
Add POSIX strerror_r

See merge request redox-os/relibc!207
2019-04-21 15:06:17 +00:00
Mateusz Mikuła c68a0d5678 Add POSIX strerror_r 2019-04-19 17:59:56 +02:00
Michal Z 89ca696f8e Changed while loops to for
Changed while loops to for - https://gitlab.redox-os.org/redox-os/relibc/issues/128
2019-04-15 18:24:46 +02:00
Jeremy Soller 52669688bf Fix issue of strcasecmp not showing up 2019-01-13 14:17:05 -07:00
Jeremy Soller fe57754c34 Do not cast usize to isize in strncpy 2018-12-02 08:16:38 -07:00
Jeremy Soller 52fd4d7e83 Clippy fixes 2018-12-02 08:04:53 -07:00
Jeremy Soller 9325183b21 Fix strcat 2018-12-01 08:55:02 -07:00
Jeremy Soller d66afa4586 Do not return mutable pointer from strsignal 2018-11-27 20:54:37 -07:00
Ian Douglas Scott fdd966629d Some type signature fixes found using script in #111 2018-11-25 20:58:02 -08:00
Jeremy Soller 0ac16556bc Format 2018-11-25 10:34:42 -07:00
Jeremy Soller ebffc977b2 Reduce warnings 2018-11-10 07:52:45 -07:00
jD91mZM2 0469c0c2c6 Add tests for memcmp and fix a teeny tiny bug 2018-10-09 16:47:57 +02:00
Benedikt Rascher-Friesenhausen 8e2b7c11b4 Replace i32 with c_int in memcmp
As per the comments from jD91mZM2 on the merge request.
2018-10-07 17:40:30 +02:00
Benedikt Rascher-Friesenhausen e10a346356 Optimise memcmp for speed
I saw that in other parts of the `string` module iterations over `usize` were
used to increase iteration speed.  In this patch I apply the same logic to
`memcmp`.  With this change I measured a 7x speedup for `memcmp` on a ~1MB
buffer (comparing two buffers with the same content) on my machine (i7-7500U),
but I did not do any real world benchmarking for the change.  The increase in
speed comes with the tradeoff of both increased complexity and larger generated
assembly code for the function.

I tested the correctness of the implementation by generating two randomly filled
buffers and comparing the `memcmp` result of the old implementation against this
new one.

I ran the tests and currently currently three of them fail:
  - netdb (fails to run)
  - stdio/rename (fails to verify)
  - unistd/pipe (fails to verify)

They do so though regardless of this change, so I don't think they are related.
2018-10-07 10:25:19 +02:00
jD91mZM2 26d629674a Implement strcasestr 2018-10-06 17:37:50 +02:00
jD91mZM2 baddbb98d5 Don't reinvent the wheel in strings.h 2018-10-05 19:33:41 +02:00
Jeremy Soller 7f14fcdee0 Remove c_str functions, replace with CStr 2018-09-24 21:08:29 -06:00
jD91mZM2 1e9dbfdf62 Use cbitset crate 2018-09-22 17:26:58 +02:00
Jeremy Soller bab4e2896a Format 2018-08-27 06:35:30 -06:00
Jeremy Soller 7ab700315d Fix warnings and add c_str 2018-08-26 15:15:29 -06:00
Jeremy Soller c20ce5ffed Large reorganization of headers (WIP) 2018-08-26 08:11:35 -06:00