Works on both 0.11.0 and 9999 (git) versions (0.12.0-dev.867+1f6d82ec0).
Signed-off-by: Eric Joldasov bratishkaerik@getgoogleoff.me
refs/pull/229/head into zig
Works on both 0.11.0 and 9999 (git) versions (0.12.0-dev.867+1f6d82ec0).
Signed-off-by: Eric Joldasov bratishkaerik@getgoogleoff.me
Sorry, I forgot to remove ncurses_refs.c from Makefile, will do now.
done
BTW it is a nice help for future work based on https://github.com/gentoo/gentoo/pull/33868.
Sorry for the delay, getting rid of the C file isn't too high of a priority and there's the potential to break some systems, so I'd err on the side of caution.
Overall this approach looks sensible; hardcoding the map indices seems like a bad idea at first, but ncurses can't really change them anyway without breaking ABI compat and I doubt they'd do that at this point. There's also a minor concern with some systems (notably pkgsrc) using alternative curses implementations, but I don't think that works with ncdu2 yet so that won't count as a regression. And they can always fall back to proper ncurses as well.
The whole init() approach seems pretty roundabout, is there a reason you didn't go for a simpler approach like this?
// Replaces the 'ACS.init()' call:constacs_map=@extern(*[128]c.chtype,.{.name="acs_map"});constulcorner=acs_map['l'];// ...
Sorry for the delay, getting rid of the C file isn't too high of a priority and there's the potential to break some systems, so I'd err on the side of caution.
Sure!
Overall this approach looks sensible; hardcoding the map indices seems like a bad idea at first, but ncurses can't really change them anyway without breaking ABI compat and I doubt they'd do that at this point. There's also a minor concern with some systems (notably pkgsrc) using alternative curses implementations, but I don't think that works with ncdu2 yet so that won't count as a regression. And they can always fall back to proper ncurses as well.
Yep, I thought about this (and it should be properly fixed in translate-c instead), but it also helps to build sys-fs/ncdu with other non-LLVM backends so IMO it should be a net-win for portability.
The whole
init()approach seems pretty roundabout, is there a reason you didn't go for a simpler approach like this?// Replaces the 'ACS.init()' call:constacs_map=@extern(*[128]c.chtype,.{.name="acs_map"});constulcorner=acs_map['l'];// ...
Initially, I added it as an interface that can be used in other files, not just Box.create (https://code.blicky.net/yorhel/ncdu/pulls/229#issuecomment-1435) and left this idea as-is in the current version. Struct-level constants or variable initializers are required to be comptime-known so I moved them to this runtime function. But to think of it, it's unnecessary (Box.create is the only user) so you are right.
Pulled, thanks!
Thank you!
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?