codereport / jsource

J Language Source Code. Livestream links ⬇️
https://www.youtube.com/playlist?list=PLVFrD1dmDdvfVhYLU_iKkV67X9XqCJLWe
Other
38 stars 20 forks source link

Small cleanup to make_array #204

Closed herwinw closed 3 years ago

herwinw commented 3 years ago

The code was copied from a C macro, where ctype was an argument. There is no need to wrap that in parentheses anymore. Also add some whitespace to make it a bit more readable.

juntuu commented 3 years ago

clang-format will remove the space right of the &

This feels like it's treating & as the address of operator, not as bitwise and 🤷

herwinw commented 3 years ago

I agree with @juntuu Removing the rhs space makes the code confusing. I guess it would be better to just leave both spaces out, at least that makes it consistent.

Sebanisu commented 3 years ago

clang-format will remove the space right of the &

This feels like it's treating & as the address of operator, not as bitwise and 🤷

I'm sorry, I posted that looking at what I thought was a reference. It is probably fine.

herwinw commented 3 years ago

I just tried to clang-format the file, and the spaces on both sides of & are accepted. Actually, they are added by clang-format if the parentheses around ctype are removed.