I'm once again sure that the most useful program in vim package is xxd.
-
I'm once again sure that the most useful program in vim package is xxd.
It's so much better than hexdump.
-
I'm once again sure that the most useful program in vim package is xxd.
It's so much better than hexdump.
@a1ba I got used to od(1) because it's everywhere (POSIX!) but well I ended up making xcd to have colors based on the values.
screen.png -
A a1ba@suya.place shared this topic
-
@a1ba I got used to od(1) because it's everywhere (POSIX!) but well I ended up making xcd to have colors based on the values.
screen.png@lanodan wow pretty -
@lanodan wow pretty@a1ba And IIRC I adjusted the values in the algo a bit to make it match the main character classes pretty well, at least for my eyes…
screen.png -
@a1ba And IIRC I adjusted the values in the algo a bit to make it match the main character classes pretty well, at least for my eyes…
screen.png@lanodan > if(strncmp(argv[argi], "-", 2) == 0)
why strncmp(..., 2) though? isn't just strcmp would be the same thing here? -
@lanodan > if(strncmp(argv[argi], "-", 2) == 0)
why strncmp(..., 2) though? isn't just strcmp would be the same thing here?@a1ba@suya.place Yeah, or could just be
if(argv[argi][0] == '-' && argv[argi][1] == '\0')
like I tend to do these days for very short string comparisons. -
@a1ba@suya.place Yeah, or could just be
if(argv[argi][0] == '-' && argv[argi][1] == '\0')
like I tend to do these days for very short string comparisons.@lanodan compiler will optimize strcmp to this anyway -
@lanodan compiler will optimize strcmp to this anyway@lanodan my source is decompiled code, idk if it's just gcc thing that builtins half of libc
-
@lanodan my source is decompiled code, idk if it's just gcc thing that builtins half of libc@a1ba Sadly not tcc apparently, and that's one of the compilers I target… https://godbolt.org/z/GM8hjzGEf
(And cproc on godbolt just fails)
But yeah in general I'd expect compilers to optimise at least the bits that are part of ISO C since it's relevant to them, POSIX functions though could be a bit too much.
screen.png -
@a1ba Sadly not tcc apparently, and that's one of the compilers I target… https://godbolt.org/z/GM8hjzGEf
(And cproc on godbolt just fails)
But yeah in general I'd expect compilers to optimise at least the bits that are part of ISO C since it's relevant to them, POSIX functions though could be a bit too much.
screen.png@lanodan posix at least has useful stuff like strnlen, strlcpy, strlcat, so handling them on compiler side would be nice too. Wish strchrnul was more adopted too.