1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-14 01:20:27 +00:00

Code style fixes.

Pretty obvious I thought control statements were glued to their opening
parenthesis at first and then I realized not and voila, a bundle of
mixed style. Hopefully this fixes all of it.
This commit is contained in:
llmII 2021-09-04 09:34:47 -05:00
parent 8b67108dc8
commit b847a7d90b
No known key found for this signature in database
GPG Key ID: E3AD2E259F58A9A0

View File

@ -1597,7 +1597,7 @@ void add_kqueue_events(const struct kevent *events, int length) {
* note that kqueue actually does this. We do not do this at this time. */ * note that kqueue actually does this. We do not do this at this time. */
int status; int status;
status = kevent(janet_vm.kq, events, length, NULL, 0, NULL); status = kevent(janet_vm.kq, events, length, NULL, 0, NULL);
if(status == -1 && errno != EINTR) if (status == -1 && errno != EINTR)
janet_panicv(janet_ev_lasterr()); janet_panicv(janet_ev_lasterr());
} }
@ -1626,9 +1626,9 @@ JanetListenerState *janet_listen(JanetStream *stream, JanetListener behavior, in
static void janet_unlisten(JanetListenerState *state, int is_gc) { static void janet_unlisten(JanetListenerState *state, int is_gc) {
JanetStream *stream = state->stream; JanetStream *stream = state->stream;
if(!(stream->flags & JANET_STREAM_CLOSED)) { if (!(stream->flags & JANET_STREAM_CLOSED)) {
/* Use flag to indicate state is not registered in kqueue */ /* Use flag to indicate state is not registered in kqueue */
if(!(state->_mask & (1 << JANET_ASYNC_EVENT_COMPLETE))) { if (!(state->_mask & (1 << JANET_ASYNC_EVENT_COMPLETE))) {
int is_last = (state->_next == NULL && stream->state == state); int is_last = (state->_next == NULL && stream->state == state);
int op = is_last ? EV_DELETE : EV_DISABLE | EV_ADD; int op = is_last ? EV_DELETE : EV_DISABLE | EV_ADD;
struct kevent kev[2]; struct kevent kev[2];
@ -1673,13 +1673,13 @@ void janet_loop1_impl(int has_timeout, JanetTimestamp timeout) {
do { do {
status = kevent(janet_vm.kq, NULL, 0, events, JANET_KQUEUE_MAX_EVENTS, NULL); status = kevent(janet_vm.kq, NULL, 0, events, JANET_KQUEUE_MAX_EVENTS, NULL);
} while (status == -1 && errno == EINTR); } while (status == -1 && errno == EINTR);
if(status == -1) if (status == -1)
JANET_EXIT("failed to poll events"); JANET_EXIT("failed to poll events");
/* Step state machines */ /* Step state machines */
for(int i = 0; i < status; i++) { for (int i = 0; i < status; i++) {
void *p = events[i].udata; void *p = events[i].udata;
if(&janet_vm.timer == p) { if (&janet_vm.timer == p) {
/* Timer expired, ignore */; /* Timer expired, ignore */;
} else if (janet_vm.selfpipe == p) { } else if (janet_vm.selfpipe == p) {
/* Self-pipe handling */ /* Self-pipe handling */
@ -1703,7 +1703,7 @@ void janet_loop1_impl(int has_timeout, JanetTimestamp timeout) {
} else { } else {
statuses[2] = state->machine(state, JANET_ASYNC_EVENT_ERR); statuses[2] = state->machine(state, JANET_ASYNC_EVENT_ERR);
} }
if(statuses[0] == JANET_ASYNC_STATUS_DONE || if (statuses[0] == JANET_ASYNC_STATUS_DONE ||
statuses[1] == JANET_ASYNC_STATUS_DONE || statuses[1] == JANET_ASYNC_STATUS_DONE ||
statuses[2] == JANET_ASYNC_STATUS_DONE || statuses[2] == JANET_ASYNC_STATUS_DONE ||
statuses[3] == JANET_ASYNC_STATUS_DONE) statuses[3] == JANET_ASYNC_STATUS_DONE)