Commit Graph

190 Commits

Author SHA1 Message Date
1d51935d43 Make Result able to return an error string 2022-11-30 17:10:43 +01:00
fc0779a2f9 Add a SystemError module for errno values :) 2022-11-30 17:10:30 +01:00
f8ed74fda5 Improve unit representation code 2022-11-30 14:41:35 +01:00
f1756e6f58 Add unit formatting 2022-11-30 12:42:11 +01:00
552186ad51 Add string_format and vstring_format 2022-11-30 12:36:21 +01:00
9934719f6b Use a more reliable signed 64-bit type than "long" 2022-11-23 18:05:01 +01:00
3b2dc5db55 PlacementNew.h: Use Types.h 2022-11-23 17:22:16 +01:00
2df0bc4238 Convert one tiny type to Types.h in Format.cpp 2022-11-20 18:31:55 +01:00
459e1ed653 luna/String.h: Convert to Types.h 2022-11-20 18:29:23 +01:00
3815f9aa9f Introduce an offset_ptr function to avoid quirky C pointer arithmetic 2022-11-20 15:12:18 +01:00
33876dcda4 Use _strto{i,u} in _atou and _atos 2022-11-20 09:28:17 +01:00
bde5de68ca Simplify is_valid_digit_for_base by reaching out to parse_digit_unchecked 2022-11-20 09:24:21 +01:00
44f44aedca Make _strtoi call _strtou, to deduplicate code 2022-11-19 22:52:08 +01:00
30a7d760ae Move a few repeated lambdas into their own functions 2022-11-19 22:48:20 +01:00
83bcac7a16 Kernel: Introduce a timer interface 2022-11-19 20:01:01 +01:00
db3e34b2ba Result: Add try_set_value()
This helper returns true if the Result contains a value, or false if it doesn't.
Additionally, if it has a value, it sets the passed reference to it.
2022-11-19 18:38:01 +01:00
83e6bd1322 Make the build system more platform-agnostic 2022-11-19 17:46:53 +01:00
8cae20a82c Move __check_failed out of line so anyone can implement it 2022-11-19 17:20:10 +01:00
2b9bdf560e Move include to .cpp file 2022-11-19 17:19:25 +01:00
b8c136eeb4 Make a common header for attribute shorthands 2022-11-19 17:18:51 +01:00
648bd3fb61 Switch format.h to use Result 2022-11-19 16:13:25 +01:00
31673c0ac9 Introduce format attribute 2022-11-19 15:53:58 +01:00
dadc3e570b Move a few functions out of line 2022-11-19 15:43:09 +01:00
56c2ca3381 Add _strtoi and _strtou 2022-11-19 15:27:55 +01:00
bad856afe0 Add %p and %% to cstyle_format 2022-11-19 15:26:29 +01:00
88af7a915b Start padding and alternate forms for integers 2022-11-19 13:59:06 +01:00
c48203997a Move output_integer into a function that accepts value arguments 2022-11-19 13:21:21 +01:00
4ebf244d3b Support printing some integers in output_integer 2022-11-19 13:15:13 +01:00
603ff46d8c Add a format implementation 2022-11-19 12:30:36 +01:00
be2e915d0d Use the standard names for ctype functions if inside moon or _LUNA_OVERRIDE_STDC is defined 2022-11-18 21:17:26 +01:00
1b3243a80c Add ctype.h functions to the Luna library 2022-11-18 21:12:54 +01:00
860f13cd7e Rename align_base to alignment 2022-11-18 18:02:38 +01:00
2e2656a02f Add static assertions to constexpr functions 2022-11-18 17:59:19 +01:00
30ac95bcf8 Use usize/isize instead of (s)size_t
Since we're using Rust-style integer types already, why not go all in?
2022-11-16 20:30:34 +01:00
7fc5a6b753 Make kernel rodata and data not executable 2022-11-16 20:02:04 +01:00
c9feb11366 Introduce a check() method (like assert() but always on) 2022-11-15 19:36:50 +01:00
705c2747de Add memory manager 2022-11-13 14:29:15 +01:00
6b95307b54 Add init 2022-11-13 12:20:53 +01:00
82c2381ac9 Serial printing!! 2022-11-13 10:30:10 +01:00
cf758fdfdc Initial commit :) 2022-11-13 10:09:09 +01:00