neovim/neovim — pull request #411 by lslah (2014-03-27 14:08:10+00:00)
Title: [WIP/RFC] Adapt os module to the style guide

This PR tries to fix the style of the os module.
What is done so far:
* `mch_*` functions are renamed to `os_*`
* `/*...*/` are replaced with `//...` comments
* some other clint warnings are fixed (like too long lines, wrong parentheses, etc.)

Remaining `clint.py` errors:
```
$ python clint.py src/os/*
src/os/env.c:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
Done processing src/os/env.c
src/os/event.c:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
Done processing src/os/event.c
src/os/event.h:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
src/os/event.h:1: #ifndef header guard has wrong style, please use: SRC_OS_EVENT_H_ [build/header_guard] [5]
src/os/event.h:15: #endif line should be "#endif // SRC_OS_EVENT_H_" [build/header_guard] [5]
Done processing src/os/event.h
src/os/fs.c:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
src/os/fs.c:124: Do not use variable-length arrays. Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size. [runtime/arrays] [1]
Done processing src/os/fs.c
src/os/input.c:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
Done processing src/os/input.c
src/os/input.h:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
src/os/input.h:1: #ifndef header guard has wrong style, please use: SRC_OS_INPUT_H_ [build/header_guard] [5]
src/os/input.h:19: #endif line should be "#endif // SRC_OS_INPUT_H_" [build/header_guard] [5]
Done processing src/os/input.h
src/os/mem.c:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
Done processing src/os/mem.c
src/os/os.h:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
src/os/os.h:1: #ifndef header guard has wrong style, please use: SRC_OS_OS_H_ [build/header_guard] [5]
src/os/os.h:24: #endif line should be "#endif // SRC_OS_OS_H_" [build/header_guard] [5]
Done processing src/os/os.h
src/os/time.c:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
Done processing src/os/time.c
src/os/time.h:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
src/os/time.h:1: #ifndef header guard has wrong style, please use: SRC_OS_TIME_H_ [build/header_guard] [5]
src/os/time.h:10: #endif line should be "#endif // SRC_OS_TIME_H_" [build/header_guard] [5]
Done processing src/os/time.h
src/os/users.c:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5]
src/os/users.c:60: Consider using getpwuid_r(...) instead of getpwuid(...) for improved thread safety. [runtime/threadsafe_fn] [2]
src/os/users.c:80: Consider using getpwnam_r(...) instead of getpwnam(...) for improved thread safety. [runtime/threadsafe_fn] [2]
Done processing src/os/users.c
Total errors found: 22
```

Most of the errors are wrong (header guards and copyright warnings). These are fixed by #409.
Any thoughts on the last two errors (use `getpw[uid|nam]_r` instead of `getpw[uid|nam]`) are appreciated.
Also feel free to be pedantic with this PR. Surely there are lots of style issues which can be solved in this module.