-
Notifications
You must be signed in to change notification settings - Fork 581
Conversation
… and fix some style
exit(9); | ||
} | ||
if (host_statistics64(mach_host_self(), HOST_VM_INFO64, (host_info_t)p, &info_size) != 0) | ||
err(9, "Unable to retrieve VM statistics\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid removing braces, even when block contains a single statement
Thanks for taking a closer look at the Darwin codebase. Is this good to merge? |
@@ -55,13 +55,13 @@ inline int String_eq(const char* s1, const char* s2) { | |||
char** String_split(const char* s, char sep, int* n) { | |||
*n = 0; | |||
const int rate = 10; | |||
char** out = (char**) malloc(sizeof(char*) * rate); | |||
char** out = calloc(rate, sizeof(char**)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one looks wrong. We need sizeof(char_), not sizeof(char_*).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed wrong, I was moving too fast. We need sizeof(char*)
.
There are too many small mistakes in here to merge. It was a hasty correction of a few issues I came across while porting to OpenBSD. You can consider it a guideline and add them manually, or I can submit a more carefully written patch soon. |
I just added my OpenBSD port. I also fixed the |
Please make separate PRs, especially for a large feature such as OpenBSD support. And do get some sleep! Health is important :) |
…few existing ones and fix some style.
Cleanup and initial OpenBSD support
The person writing the Darwin code has a pretty strange style, honestly. Not putting spaces after condition keywords, putting 0 or NULL first in comparisons, etc.