~bakpakin/janet

b099bd97f23365fd410373c13e5b1b6611be00b2 — Calvin Rose 1 year, 3 months ago fcca9bb + 9c97d8f bytecode_opt
Merge branch 'master' into bytecode_opt
4 files changed, 11 insertions(+), 16 deletions(-)

M src/core/buffer.c
M src/core/net.c
M src/core/pp.c
M src/mainclient/shell.c
M src/core/buffer.c => src/core/buffer.c +2 -1
@@ 324,7 324,8 @@ static void buffer_push_impl(JanetBuffer *buffer, Janet *argv, int32_t argc_offs

JANET_CORE_FN(cfun_buffer_push_at,
              "(buffer/push-at buffer index & xs)",
              "Same as buffer/push, but inserts new data at index `index`.") {
              "Same as buffer/push, but copies the new data into the buffer "
              " at index `index`.") {
    janet_arity(argc, 2, -1);
    JanetBuffer *buffer = janet_getbuffer(argv, 0);
    int32_t index = janet_getinteger(argv, 1);

M src/core/net.c => src/core/net.c +1 -1
@@ 460,7 460,7 @@ JANET_CORE_FN(cfun_net_connect,
    if (binding) {
        struct addrinfo *rp = NULL;
        int did_bind = 0;
        for (rp = ai; rp != NULL; rp = rp->ai_next) {
        for (rp = binding; rp != NULL; rp = rp->ai_next) {
            if (bind(sock, rp->ai_addr, (int) rp->ai_addrlen) == 0) {
                did_bind = 1;
                break;

M src/core/pp.c => src/core/pp.c +2 -2
@@ 846,7 846,7 @@ void janet_formatbv(JanetBuffer *b, const char *format, va_list args) {
                }
                case 'd':
                case 'i': {
                    int64_t n = va_arg(args, long);
                    int64_t n = va_arg(args, int);
                    nb = snprintf(item, MAX_ITEM, form, n);
                    break;
                }


@@ 854,7 854,7 @@ void janet_formatbv(JanetBuffer *b, const char *format, va_list args) {
                case 'X':
                case 'o':
                case 'u': {
                    uint64_t n = va_arg(args, unsigned long);
                    uint64_t n = va_arg(args, unsigned int);
                    nb = snprintf(item, MAX_ITEM, form, n);
                    break;
                }

M src/mainclient/shell.c => src/mainclient/shell.c +6 -12
@@ 30,7 30,6 @@
#ifdef _WIN32
#include <windows.h>
#include <shlwapi.h>
#include <versionhelpers.h>
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif


@@ 147,9 146,8 @@ static void setup_console_output(void) {
    HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    DWORD dwMode = 0;
    GetConsoleMode(hOut, &dwMode);
    if (IsWindows10OrGreater()) {
        dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
    }
    dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
    dwMode |= ENABLE_PROCESSED_OUTPUT;
    SetConsoleMode(hOut, dwMode);
    if (IsValidCodePage(65001)) {
        SetConsoleOutputCP(65001);


@@ 165,10 163,8 @@ static int rawmode(void) {
    dwMode &= ~ENABLE_LINE_INPUT;
    dwMode &= ~ENABLE_INSERT_MODE;
    dwMode &= ~ENABLE_ECHO_INPUT;
    if (IsWindows10OrGreater()) {
        dwMode |= ENABLE_VIRTUAL_TERMINAL_INPUT;
        dwMode &= ~ENABLE_PROCESSED_INPUT;
    }
    dwMode |= ENABLE_VIRTUAL_TERMINAL_INPUT;
    dwMode &= ~ENABLE_PROCESSED_INPUT;
    if (!SetConsoleMode(hOut, dwMode)) return 1;
    gbl_israwmode = 1;
    return 0;


@@ 183,10 179,8 @@ static void norawmode(void) {
    dwMode |= ENABLE_LINE_INPUT;
    dwMode |= ENABLE_INSERT_MODE;
    dwMode |= ENABLE_ECHO_INPUT;
    if (IsWindows10OrGreater()) {
        dwMode &= ~ENABLE_VIRTUAL_TERMINAL_INPUT;
        dwMode |= ENABLE_PROCESSED_INPUT;
    }
    dwMode &= ~ENABLE_VIRTUAL_TERMINAL_INPUT;
    dwMode |= ENABLE_PROCESSED_INPUT;
    SetConsoleMode(hOut, dwMode);
    gbl_israwmode = 0;
}