mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-24 02:24:18 +03:00
Merge branch 'master' into eyre-new
Conflicts: urb/urbit.pill urb/zod/docs/pub/doc/arvo/util.md
This commit is contained in:
commit
2669bcf0f5
9
Makefile
9
Makefile
@ -33,7 +33,7 @@ ENDIAN=little
|
||||
#
|
||||
BIN=bin
|
||||
|
||||
LIB=$(PWD)/urb
|
||||
LIB=$(shell pwd)/urb
|
||||
|
||||
RM=rm -f
|
||||
CC=gcc
|
||||
@ -86,8 +86,11 @@ CWFLAGS=-Wall \
|
||||
-Wno-sign-compare \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
-Wno-error=unused-result \
|
||||
-Wno-strict-aliasing \
|
||||
-Werror
|
||||
ifneq ($(OS),bsd)
|
||||
CWFLAGS+=-Wno-error=unused-result
|
||||
endif
|
||||
|
||||
ifdef NO_SILENT_RULES
|
||||
%.o: %.c $(CORE)
|
||||
@ -377,7 +380,7 @@ $(LIBCOMMONMARK):
|
||||
$(MAKE) -C outside/commonmark
|
||||
|
||||
$(CRE2_OFILES): outside/cre2/src/src/cre2.cpp outside/cre2/src/src/cre2.h $(LIBRE2)
|
||||
$(CXX) $(CXXFLAGS) -c $< $(LIBRE2) -o $@
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
$(V_OFILES): i/v/vere.h
|
||||
|
||||
|
@ -178,3 +178,12 @@
|
||||
# else
|
||||
# error "port: timeconvert"
|
||||
# endif
|
||||
|
||||
/* Entropy
|
||||
*/
|
||||
# if defined(U3_OS_bsd) && defined(__OpenBSD__)
|
||||
# define c3_rand(rd) (getentropy((void*)rd, 32) == 0 ? \
|
||||
(void)0 : c3_assert(!"ent"))
|
||||
# else
|
||||
# define c3_rand u3_sist_rand
|
||||
# endif
|
||||
|
2
i/n/m.h
2
i/n/m.h
@ -24,7 +24,7 @@
|
||||
** %oops :: assertion failure
|
||||
*/
|
||||
c3_i
|
||||
u3m_bail(c3_m how_m);
|
||||
u3m_bail(c3_m how_m) __attribute__((noreturn));
|
||||
|
||||
/* u3m_file(): load file, as atom, or bail.
|
||||
*/
|
||||
|
20
i/v/vere.h
20
i/v/vere.h
@ -201,12 +201,15 @@
|
||||
/* u3_ames: ames networking.
|
||||
*/
|
||||
typedef struct _u3_ames { // packet network state
|
||||
uv_udp_t wax_u; // socket state
|
||||
uv_timer_t tim_u; // network timer
|
||||
c3_o alm; // alarm on
|
||||
c3_w law_w; // last wakeup, unix time
|
||||
c3_s por_s; // public IPv4 port
|
||||
c3_w imp_w[256]; // imperial IPs
|
||||
union {
|
||||
uv_udp_t wax_u;
|
||||
uv_handle_t had_u;
|
||||
};
|
||||
uv_timer_t tim_u; // network timer
|
||||
c3_o alm; // alarm on
|
||||
c3_w law_w; // last wakeup, unix time
|
||||
c3_s por_s; // public IPv4 port
|
||||
c3_w imp_w[256]; // imperial IPs
|
||||
} u3_ames;
|
||||
|
||||
/* u3_save: checkpoint control.
|
||||
@ -1091,6 +1094,11 @@
|
||||
void
|
||||
u3_sist_get(const c3_c* key_c, c3_y* val_y);
|
||||
|
||||
/* u3_sist_rand(): fill 8 words (32 bytes) with high-quality entropy.
|
||||
*/
|
||||
void
|
||||
u3_sist_rand(c3_w* rad_w);
|
||||
|
||||
/** New timer system.
|
||||
**/
|
||||
/* u3_temp_io_init(): initialize time timer.
|
||||
|
5
n/m.c
5
n/m.c
@ -571,7 +571,7 @@ c3_w Exit;
|
||||
** [%2 trace]
|
||||
** [%3 code trace]
|
||||
** ==
|
||||
*/
|
||||
*/
|
||||
c3_i
|
||||
u3m_bail(u3_noun how)
|
||||
{
|
||||
@ -636,11 +636,10 @@ u3m_bail(u3_noun how)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Longjmp, with an underscore.
|
||||
*/
|
||||
_longjmp(u3R->esc.buf, how);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int c3_cooked() { return u3m_bail(c3__oops); }
|
||||
|
@ -22,7 +22,7 @@ JSMODULES=$(wildcard js/lib/*.js)
|
||||
.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site check npm debug mingw archive tarball ziparchive testarchive testtarball testziparchive testlib bench apidoc
|
||||
|
||||
all: $(BUILDDIR)
|
||||
@make -C $(BUILDDIR)
|
||||
@$(MAKE) -C $(BUILDDIR)
|
||||
@echo "Binaries can be found in $(BUILDDIR)/src"
|
||||
|
||||
check:
|
||||
@ -34,19 +34,19 @@ $(BUILDDIR): check $(SRCDIR)/html/html_unescape.h $(SRCDIR)/case_fold_switch.inc
|
||||
cmake .. -G "$(GENERATOR)" -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
|
||||
install: $(BUILDDIR)
|
||||
make -C $(BUILDDIR) install
|
||||
$(MAKE) -C $(BUILDDIR) install
|
||||
|
||||
debug:
|
||||
mkdir -p $(BUILDDIR); \
|
||||
cd $(BUILDDIR); \
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug; \
|
||||
make
|
||||
$(MAKE)
|
||||
|
||||
mingw:
|
||||
mkdir -p $(MINGW_BUILDDIR); \
|
||||
cd $(MINGW_BUILDDIR); \
|
||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$(MINGW_INSTALLDIR) ;\
|
||||
make && make install
|
||||
$(MAKE) && $(MAKE) install
|
||||
|
||||
archive: spec.html $(BUILDDIR)
|
||||
@rm -rf $(PKGDIR); \
|
||||
@ -87,7 +87,7 @@ $(SRCDIR)/case_fold_switch.inc: $(DATADIR)/CaseFolding-3.2.0.txt
|
||||
perl mkcasefold.pl < $< > $@
|
||||
|
||||
test: $(SPEC) $(BUILDDIR)
|
||||
make -C $(BUILDDIR) test ARGS="-V"
|
||||
$(MAKE) -C $(BUILDDIR) test ARGS="-V"
|
||||
|
||||
$(TARBALL): archive
|
||||
|
||||
@ -100,13 +100,13 @@ testtarball: $(TARBALL)
|
||||
rm -rf $(PKGDIR); \
|
||||
tar xvzf $(TARBALL); \
|
||||
cd $(PKGDIR); \
|
||||
mkdir build && cd build && cmake .. && make && ctest -V
|
||||
mkdir build && cd build && cmake .. && $(MAKE) && ctest -V
|
||||
|
||||
testziparchive: $(ZIPARCHIVE)
|
||||
rm -rf $(PKGDIR); \
|
||||
unzip $(ZIPARCHIVE); \
|
||||
cd $(PKGDIR); \
|
||||
mkdir build && cd build && cmake .. && make && ctest -V
|
||||
mkdir build && cd build && cmake .. && $(MAKE) && ctest -V
|
||||
|
||||
$(ALLTESTS): spec.txt
|
||||
python test/spec_tests.py --spec $< --dump-tests | python -c 'import json; import sys; tests = json.loads(sys.stdin.read()); print "\n".join([test["markdown"] for test in tests]).encode("utf-8")' > $@
|
||||
@ -188,7 +188,7 @@ spec.pdf: spec.md template.tex specfilter.hs
|
||||
### Website ###
|
||||
|
||||
update-site: spec.html js/commonmark.js
|
||||
make -C $(SITE) update
|
||||
$(MAKE) -C $(SITE) update
|
||||
|
||||
upload-site: spec.html
|
||||
make -C $(SITE) upload
|
||||
$(MAKE) -C $(SITE) upload
|
||||
|
@ -1,70 +1,11 @@
|
||||
/*
|
||||
Portable header to provide the 32 and 64 bits type.
|
||||
|
||||
Not a compatible replacement for <stdint.h>, do not blindly use it as such.
|
||||
*/
|
||||
|
||||
#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__WATCOMC__) && (defined(_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || defined(__UINT_FAST64_TYPE__)) )) && !defined(FIXEDINT_H_INCLUDED)
|
||||
#include <stdint.h>
|
||||
#define FIXEDINT_H_INCLUDED
|
||||
|
||||
#if defined(__WATCOMC__) && __WATCOMC__ >= 1250 && !defined(UINT64_C)
|
||||
#include <limits.h>
|
||||
#define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef FIXEDINT_H_INCLUDED
|
||||
#define FIXEDINT_H_INCLUDED
|
||||
#define FIXEDINT_H_INCLUDED
|
||||
|
||||
/* (u)int32_t */
|
||||
#ifndef uint32_t
|
||||
#if (ULONG_MAX == 0xffffffffUL)
|
||||
typedef unsigned long uint32_t;
|
||||
#elif (UINT_MAX == 0xffffffffUL)
|
||||
typedef unsigned int uint32_t;
|
||||
#elif (USHRT_MAX == 0xffffffffUL)
|
||||
typedef unsigned short uint32_t;
|
||||
#endif
|
||||
#endif
|
||||
#include <stdint.h>
|
||||
#include <limits.h>
|
||||
|
||||
|
||||
#ifndef int32_t
|
||||
#if (LONG_MAX == 0x7fffffffL)
|
||||
typedef signed long int32_t;
|
||||
#elif (INT_MAX == 0x7fffffffL)
|
||||
typedef signed int int32_t;
|
||||
#elif (SHRT_MAX == 0x7fffffffL)
|
||||
typedef signed short int32_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* (u)int64_t */
|
||||
#if (defined(__STDC__) && defined(__STDC_VERSION__) && __STDC__ && __STDC_VERSION__ >= 199901L)
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
#define UINT64_C(v) v ##ULL
|
||||
#define INT64_C(v) v ##LL
|
||||
#elif defined(__GNUC__)
|
||||
__extension__ typedef long long int64_t;
|
||||
__extension__ typedef unsigned long long uint64_t;
|
||||
|
||||
#define UINT64_C(v) v ##ULL
|
||||
#define INT64_C(v) v ##LL
|
||||
#elif defined(__MWERKS__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__APPLE_CC__) || defined(_LONG_LONG) || defined(_CRAYC)
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
#define UINT64_C(v) v ##ULL
|
||||
#define INT64_C(v) v ##LL
|
||||
#elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined(__BORLANDC__) && __BORLANDC__ > 0x460) || defined(__alpha) || defined(__DECC)
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
#define UINT64_C(v) v ##UI64
|
||||
#define INT64_C(v) v ##I64
|
||||
#endif
|
||||
#endif
|
||||
|
2
v/ames.c
2
v/ames.c
@ -367,7 +367,7 @@ u3_ames_io_exit()
|
||||
{
|
||||
u3_ames* sam_u = &u3_Host.sam_u;
|
||||
|
||||
uv_close((uv_handle_t*)&sam_u->wax_u, 0);
|
||||
uv_close(&sam_u->had_u, 0);
|
||||
}
|
||||
|
||||
/* u3_ames_io_poll(): update ames IO state.
|
||||
|
12
v/sist.c
12
v/sist.c
@ -444,10 +444,10 @@ _sist_bask(c3_c* pop_c, u3_noun may)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* _sist_rand(): fill a 256-bit (8-word) buffer.
|
||||
/* u3_sist_rand(): fill a 256-bit (8-word) buffer.
|
||||
*/
|
||||
static void
|
||||
_sist_rand(c3_w* rad_w)
|
||||
void
|
||||
u3_sist_rand(c3_w* rad_w)
|
||||
{
|
||||
c3_i fid_i = open(DEVRANDOM, O_RDONLY);
|
||||
|
||||
@ -589,7 +589,7 @@ _sist_zest()
|
||||
{
|
||||
c3_w rad_w[8];
|
||||
|
||||
_sist_rand(rad_w);
|
||||
c3_rand(rad_w);
|
||||
sal_l = (0x7fffffff & rad_w[0]);
|
||||
}
|
||||
|
||||
@ -599,7 +599,7 @@ _sist_zest()
|
||||
c3_w rad_w[8];
|
||||
u3_noun pas;
|
||||
|
||||
_sist_rand(rad_w);
|
||||
c3_rand(rad_w);
|
||||
pas = u3i_words(2, rad_w);
|
||||
|
||||
u3A->key = _sist_fatt(sal_l, u3k(pas));
|
||||
@ -1201,7 +1201,7 @@ _sist_zen()
|
||||
{
|
||||
c3_w rad_w[8];
|
||||
|
||||
_sist_rand(rad_w);
|
||||
c3_rand(rad_w);
|
||||
return u3i_words(8, rad_w);
|
||||
}
|
||||
|
||||
|
18
v/term.c
18
v/term.c
@ -22,15 +22,15 @@
|
||||
#include "all.h"
|
||||
#include "v/vere.h"
|
||||
|
||||
static void _term_read_tn_cb(uv_stream_t* tcp_u,
|
||||
ssize_t siz_i,
|
||||
const uv_buf_t * buf_u);
|
||||
static void _term_read_cb(uv_stream_t* tcp_u,
|
||||
ssize_t siz_i,
|
||||
const uv_buf_t * buf_u);
|
||||
static void _term_suck(u3_utty*, const c3_y*, ssize_t);
|
||||
static void _tel_event(telnet_nvt*, telnet_event*);
|
||||
static void _tel_opt(telnet_nvt*, telnet_byte, telnet_telopt_event*);
|
||||
static void _term_read_tn_cb(uv_stream_t* tcp_u,
|
||||
ssize_t siz_i,
|
||||
const uv_buf_t * buf_u);
|
||||
static void _term_read_cb(uv_stream_t* tcp_u,
|
||||
ssize_t siz_i,
|
||||
const uv_buf_t * buf_u);
|
||||
static inline void _term_suck(u3_utty*, const c3_y*, ssize_t);
|
||||
static void _tel_event(telnet_nvt*, telnet_event*);
|
||||
static void _tel_opt(telnet_nvt*, telnet_byte, telnet_telopt_event*);
|
||||
|
||||
#define _T_ECHO 1 // local echo
|
||||
#define _T_CTIM 3 // suppress GA/char-at-a-time
|
||||
|
Loading…
Reference in New Issue
Block a user