mirror of
https://github.com/janet-lang/janet
synced 2025-01-09 07:00:27 +00:00
Run through astyle with manual corrections
This commit is contained in:
parent
866d83579e
commit
9a2897e741
@ -78,7 +78,6 @@ double double_lots(
|
|||||||
return i + j;
|
return i + j;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EXPORTER
|
EXPORTER
|
||||||
double double_lots_2(
|
double double_lots_2(
|
||||||
double a,
|
double a,
|
||||||
@ -204,5 +203,3 @@ EXPORTER
|
|||||||
int sixints_fn_3(SixInts s, int x) {
|
int sixints_fn_3(SixInts s, int x) {
|
||||||
return x + s.u + s.v + s.w + s.x + s.y + s.z;
|
return x + s.u + s.v + s.w + s.x + s.y + s.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,6 +70,5 @@ int system_test() {
|
|||||||
|
|
||||||
assert(janet_equals(tuple1, tuple2));
|
assert(janet_equals(tuple1, tuple2));
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -949,7 +949,6 @@ static Janet janet_disasm_symbolslots(JanetFuncDef *def) {
|
|||||||
return janet_wrap_array(symbolslots);
|
return janet_wrap_array(symbolslots);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Janet janet_disasm_bytecode(JanetFuncDef *def) {
|
static Janet janet_disasm_bytecode(JanetFuncDef *def) {
|
||||||
JanetArray *bcode = janet_array(def->bytecode_length);
|
JanetArray *bcode = janet_array(def->bytecode_length);
|
||||||
for (int32_t i = 0; i < def->bytecode_length; i++) {
|
for (int32_t i = 0; i < def->bytecode_length; i++) {
|
||||||
|
@ -354,7 +354,6 @@ JANET_CORE_FN(cfun_buffer_push,
|
|||||||
return argv[0];
|
return argv[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
JANET_CORE_FN(cfun_buffer_clear,
|
JANET_CORE_FN(cfun_buffer_clear,
|
||||||
"(buffer/clear buffer)",
|
"(buffer/clear buffer)",
|
||||||
"Sets the size of a buffer to 0 and empties it. The buffer retains "
|
"Sets the size of a buffer to 0 and empties it. The buffer retains "
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef JANET_AMALG
|
#ifndef JANET_AMALG
|
||||||
#include "features.h"
|
#include "features.h"
|
||||||
#include <janet.h>
|
#include <janet.h>
|
||||||
@ -365,7 +364,6 @@ void janet_stream_close(JanetStream *stream) {
|
|||||||
janet_stream_close_impl(stream, 0);
|
janet_stream_close_impl(stream, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Called to clean up a stream */
|
/* Called to clean up a stream */
|
||||||
static int janet_stream_gc(void *p, size_t s) {
|
static int janet_stream_gc(void *p, size_t s) {
|
||||||
(void) s;
|
(void) s;
|
||||||
@ -1453,7 +1451,6 @@ JanetListenerState *janet_listen(JanetStream *stream, JanetListener behavior, in
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void janet_unlisten(JanetListenerState *state, int is_gc) {
|
static void janet_unlisten(JanetListenerState *state, int is_gc) {
|
||||||
janet_unlisten_impl(state, is_gc);
|
janet_unlisten_impl(state, is_gc);
|
||||||
}
|
}
|
||||||
@ -2173,7 +2170,6 @@ void janet_ev_default_threaded_callback(JanetEVGenericMessage return_value) {
|
|||||||
janet_gcunroot(janet_wrap_fiber(return_value.fiber));
|
janet_gcunroot(janet_wrap_fiber(return_value.fiber));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Convenience method for common case */
|
/* Convenience method for common case */
|
||||||
JANET_NO_RETURN
|
JANET_NO_RETURN
|
||||||
void janet_ev_threaded_await(JanetThreadedSubroutine fp, int tag, int argi, void *argp) {
|
void janet_ev_threaded_await(JanetThreadedSubroutine fp, int tag, int argi, void *argp) {
|
||||||
@ -2523,7 +2519,6 @@ static JanetAsyncStatus handle_connect(JanetListenerState *s) {
|
|||||||
return JANET_ASYNC_STATUS_DONE;
|
return JANET_ASYNC_STATUS_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
JanetAsyncStatus ev_machine_write(JanetListenerState *s, JanetAsyncEvent event) {
|
JanetAsyncStatus ev_machine_write(JanetListenerState *s, JanetAsyncEvent event) {
|
||||||
StateWrite *state = (StateWrite *) s;
|
StateWrite *state = (StateWrite *) s;
|
||||||
switch (event) {
|
switch (event) {
|
||||||
@ -2703,7 +2698,6 @@ static void janet_ev_write_generic(JanetStream *stream, void *buf, void *dest_ab
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void janet_ev_write_buffer(JanetStream *stream, JanetBuffer *buf) {
|
void janet_ev_write_buffer(JanetStream *stream, JanetBuffer *buf) {
|
||||||
janet_ev_write_generic(stream, buf, NULL, JANET_ASYNC_WRITEMODE_WRITE, 1, 0);
|
janet_ev_write_generic(stream, buf, NULL, JANET_ASYNC_WRITEMODE_WRITE, 1, 0);
|
||||||
}
|
}
|
||||||
|
@ -1531,12 +1531,12 @@ JANET_CORE_FN(cfun_ffi_pointer_buffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
JANET_CORE_FN(cfun_ffi_supported_calling_conventions,
|
JANET_CORE_FN(cfun_ffi_supported_calling_conventions,
|
||||||
"(ffi/calling-conventions)",
|
"(ffi/calling-conventions)",
|
||||||
"Get an array of all supported calling conventions on the current arhcitecture. Some architectures may have some FFI "
|
"Get an array of all supported calling conventions on the current arhcitecture. Some architectures may have some FFI "
|
||||||
"functionality (ffi/malloc, ffi/free, ffi/read, ffi/write, etc.) but not support "
|
"functionality (ffi/malloc, ffi/free, ffi/read, ffi/write, etc.) but not support "
|
||||||
"any calling conventions. This function can be used to get all supported calling conventions "
|
"any calling conventions. This function can be used to get all supported calling conventions "
|
||||||
"that can be used on this architecture. All architectures support the :none calling "
|
"that can be used on this architecture. All architectures support the :none calling "
|
||||||
"convention which is a placeholder that cannot be used at runtime.") {
|
"convention which is a placeholder that cannot be used at runtime.") {
|
||||||
janet_fixarity(argc, 0);
|
janet_fixarity(argc, 0);
|
||||||
(void) argv;
|
(void) argv;
|
||||||
JanetArray *array = janet_array(4);
|
JanetArray *array = janet_array(4);
|
||||||
|
@ -504,7 +504,6 @@ static Janet cfun_io_print_impl_x(int32_t argc, Janet *argv, int newline,
|
|||||||
return janet_wrap_nil();
|
return janet_wrap_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Janet cfun_io_print_impl(int32_t argc, Janet *argv,
|
static Janet cfun_io_print_impl(int32_t argc, Janet *argv,
|
||||||
int newline, const char *name, FILE *dflt_file) {
|
int newline, const char *name, FILE *dflt_file) {
|
||||||
Janet x = janet_dyn(name);
|
Janet x = janet_dyn(name);
|
||||||
|
@ -256,7 +256,6 @@ JANET_NO_RETURN static void janet_sched_accept(JanetStream *stream, JanetFunctio
|
|||||||
janet_await();
|
janet_await();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Adress info */
|
/* Adress info */
|
||||||
@ -417,7 +416,6 @@ JANET_CORE_FN(cfun_net_connect,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Create socket */
|
/* Create socket */
|
||||||
JSock sock = JSOCKDEFAULT;
|
JSock sock = JSOCKDEFAULT;
|
||||||
void *addr = NULL;
|
void *addr = NULL;
|
||||||
|
@ -289,7 +289,6 @@ JANET_CORE_FN(os_cpu_count,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef JANET_NO_PROCESSES
|
#ifndef JANET_NO_PROCESSES
|
||||||
|
|
||||||
/* Get env for os_execute */
|
/* Get env for os_execute */
|
||||||
@ -1076,7 +1075,6 @@ static Janet os_execute_impl(int32_t argc, Janet *argv, int is_spawn) {
|
|||||||
startupInfo.hStdInput = (HANDLE) _get_osfhandle(0);
|
startupInfo.hStdInput = (HANDLE) _get_osfhandle(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (pipe_out != JANET_HANDLE_NONE) {
|
if (pipe_out != JANET_HANDLE_NONE) {
|
||||||
startupInfo.hStdOutput = pipe_out;
|
startupInfo.hStdOutput = pipe_out;
|
||||||
} else if (new_out != JANET_HANDLE_NONE) {
|
} else if (new_out != JANET_HANDLE_NONE) {
|
||||||
|
@ -182,7 +182,6 @@ static int destructure(JanetCompiler *c,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!janet_checktype(values[i + 1], JANET_SYMBOL)) {
|
if (!janet_checktype(values[i + 1], JANET_SYMBOL)) {
|
||||||
janetc_error(c, janet_formatc("expected symbol following '& in destructuring pattern, found %q", values[i + 1]));
|
janetc_error(c, janet_formatc("expected symbol following '& in destructuring pattern, found %q", values[i + 1]));
|
||||||
return 1;
|
return 1;
|
||||||
@ -651,7 +650,6 @@ static JanetSlot janetc_do(JanetFopts opts, int32_t argn, const Janet *argv) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Compile an upscope form. Upscope forms execute their body sequentially and
|
/* Compile an upscope form. Upscope forms execute their body sequentially and
|
||||||
* evaluate to the last expression in the body, but without lexical scope. */
|
* evaluate to the last expression in the body, but without lexical scope. */
|
||||||
static JanetSlot janetc_upscope(JanetFopts opts, int32_t argn, const Janet *argv) {
|
static JanetSlot janetc_upscope(JanetFopts opts, int32_t argn, const Janet *argv) {
|
||||||
@ -1124,4 +1122,3 @@ const JanetSpecial *janetc_special(const uint8_t *name) {
|
|||||||
sizeof(JanetSpecial),
|
sizeof(JanetSpecial),
|
||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +354,6 @@ typedef struct JanetOSRWLock JanetOSRWLock;
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
/* What to do when out of memory */
|
/* What to do when out of memory */
|
||||||
#ifndef JANET_OUT_OF_MEMORY
|
#ifndef JANET_OUT_OF_MEMORY
|
||||||
#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
|
#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
|
||||||
@ -1905,7 +1904,6 @@ JANET_API Janet janet_resolve_core(const char *name);
|
|||||||
#define JANET_DEF_SD(ENV, JNAME, VAL, DOC) \
|
#define JANET_DEF_SD(ENV, JNAME, VAL, DOC) \
|
||||||
janet_def_sm(ENV, JNAME, VAL, DOC, __FILE__, __LINE__)
|
janet_def_sm(ENV, JNAME, VAL, DOC, __FILE__, __LINE__)
|
||||||
|
|
||||||
|
|
||||||
/* Choose defaults for source mapping and docstring based on config defs */
|
/* Choose defaults for source mapping and docstring based on config defs */
|
||||||
#if defined(JANET_NO_SOURCEMAPS) && defined(JANET_NO_DOCSTRINGS)
|
#if defined(JANET_NO_SOURCEMAPS) && defined(JANET_NO_DOCSTRINGS)
|
||||||
#define JANET_REG JANET_REG_
|
#define JANET_REG JANET_REG_
|
||||||
|
@ -548,7 +548,6 @@ static void kdeletew(void) {
|
|||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* See tools/symchargen.c */
|
/* See tools/symchargen.c */
|
||||||
static int is_symbol_char_gen(uint8_t c) {
|
static int is_symbol_char_gen(uint8_t c) {
|
||||||
if (c & 0x80) return 1;
|
if (c & 0x80) return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user