ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
cenomla has joined #zig
dtzWill has quit [*.net *.split]
mal`` has quit [*.net *.split]
Vinski has quit [*.net *.split]
m6w6 has quit [*.net *.split]
Vinski has joined #zig
m6w6 has joined #zig
aiwakura has joined #zig
ltr_ has joined #zig
wishstudio has joined #zig
dtzWill has joined #zig
mal`` has joined #zig
cenomla has quit [Quit: cenomla]
scientes has quit [Ping timeout: 240 seconds]
mal`` has quit [Quit: Leaving]
mal`` has joined #zig
arBmind has joined #zig
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
scientes has joined #zig
scientes has quit [Changing host]
scientes has joined #zig
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jjido has joined #zig
scientes has quit [Ping timeout: 240 seconds]
cenomla has joined #zig
cenomla_ has joined #zig
cenomla has quit [Read error: Connection reset by peer]
cenomla_ is now known as cenomla
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jjido has joined #zig
jjido has quit [Ping timeout: 240 seconds]
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Read error: Connection reset by peer]
_whitelogger has joined #zig
jjido has joined #zig
cenomla has joined #zig
jjido has quit [Read error: Connection reset by peer]
jjido has joined #zig
cenomla has quit [Quit: cenomla]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arBmind has quit [Read error: Connection reset by peer]
scientes has joined #zig
scientes has quit [Changing host]
scientes has joined #zig
<scientes>
how do i cast an array from a pointer an a length?
<scientes>
var file: [file_size]u8 = _arg_file %% unreachable;
<scientes>
nvm
<andrewrk>
scientes, did you figure it out
<andrewrk>
?
<scientes>
yeah
<scientes>
just set the raw file.ptr and file.len
<andrewrk>
uh I think that's a bug that you can do that
<andrewrk>
you can slice a pointer
<andrewrk>
ptr[start..end]
<andrewrk>
ptr[0..len]
<scientes>
/home/shawn/git/command-not-found/bisect.zig:57:31: error: slice of non-array type '?&u8'
<andrewrk>
do you want to assert that it is non-null?
<scientes>
yes
<andrewrk>
(??ptr)[0..len]
<scientes>
ahh
<andrewrk>
I'm guessing that function came from a parsed .h file
<scientes>
c_translate
<andrewrk>
yeah. if you're copying the translated C code, and you know that the pointer is never null, you'd be better off changing the type to remove the ?
<andrewrk>
but sadly when translating C code we have to be ready for any pointer to be NULL
<scientes>
you could just let the segfaults happen ;)
<scientes>
not with optimization however
<andrewrk>
I mean that you might actually need to check a pointer for null
<andrewrk>
and in zig unless you have ? you can't do that
arBmind has joined #zig
jjido has joined #zig
Caius_ has joined #zig
cenomla has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]