10
-red
38d

Shitcode

Comments
  • 3
    Looks like a struct?
  • 3
    @jespersh Yeaaaaah ! :( Should’ve mentioned that.
  • 2
    at least put it in array.
  • 4
    Go a little more context? I am sure it makes sense if it like a registry of something
  • 4
    @jespersh You use a struct for items where the position changes their meaning, like in x/y/z coordinates. But then you also need to give them different names.

    Just enumerating them like in this case rather suggests that they should be an array, unless it's an improbable case of an eight-dimensional space where these are the coordinates.
  • 6
    @jespersh @Fast-Nop I currently use this to access them:

    @highlight
    *(&s.xvm0 + (i * (&s.xvm1 - &s.xvm0)))
  • 2
  • 2
  • 3
    @jespersh Yeah sorry about the lack of context. I was annoyed and wanted to quickly rant.

    I did not get a satisfactory answer so far for why it was written this way. And this code is so old and the original Dev is no longer at the company.
  • 6
    @-red I think you could improve clarity with the "offsetof" macro.
  • 3
    @Fast-Nop Well that’s handy. Didn’t know about it. Thanks for this.
  • 0
    @-red Don't know the rest of the code but i can imagine removing the & and replacing the . with -> would work there after some modifying. Would sure as heck look more readable cause that's readable but damn doesn't look appetizing.

    But i could be wrong. 2:36am so not really thinking hard here :P and fully exhausted from writing C for the entire day.
Add Comment