Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Lines 175, 180, 185 have some extremely weird structs, that do not make sense in today's C language. Back in 6th Edition C, all struct fields were in the same namespace, so you could use '->lobyte' or '->hibyte' on any pointer you cared to. Good stuff, I'm sure it made for very interesting bugs.


Which also explains why very old APIs like struct timeval and struct stat have namespaced field names.


FWIW, some of us still do this in C programs today. Having a relatively unique prefix for struct members makes it extremely easy to find uses of those members with relatively simple tools like cscope.


Heh, tools. I just put an "XX" on the front of a field I want to refactor and see what breaks.


Can't cscope tell you everywhere a given struct type is used?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: