Cat Stevens [Tue, 21 Dec 2021 21:50:17 +0000 (16:50 -0500)]
help.lint.coverage: fix coverage on predicate? words
fix a regression for `predicate?` words revealed by uses of
`"help" word-prop` over `help:word-help`.
`"help" word-prop` is `f` for `predicate?` words like `array?` and
`zero-matrix?`. a poorly-written comparison in
`M\ word <word-help-coverage>` meant that result was effectively
compared to an empty array { }, instead of just being tested for
emptiness.
additionally, `(word-help)` is introduced to revive the old behaviour of
`help:word-help` before the move to split `$inputs` and `$outputs` in
Help rendering. `(word-help)` provides the actual help content for
words where `"help" word-prop` is `f`, by calling `word-help*`.
Doug Coleman [Tue, 21 Dec 2021 21:27:18 +0000 (15:27 -0600)]
syntax: Add REUSE: word to easily USE: but reload.
My use case is specifically for load-all with editors. The last
editor on macOS is Xcode and I use vscode, and once you have
``USE: editors.visual-studio-code`` then the next time it's a no-op.
``REUSE: editors.visual-studio-code`` is the same thing but with
two extra characters, as opposed to ``"editors.visual-studio-code" reload``
which requires a lot more typing.
We could have ``EDIT:``, ``EDIT-DOCS:``, ``EDIT-TESTS:`` etc if this REUSE:
word is successful.
Doug Coleman [Mon, 20 Dec 2021 08:11:54 +0000 (02:11 -0600)]
io.sockets.secure: Fix error handling for SSL calls.
Fixes:
- SSL_ERROR_SYSCALL -> ERR_get_error -> 0 means EOF from server
- don't throw on SSL_ERROR_ZERO_RETURN
-- in our case, our header value is 300k so it closes the connection
- don't call shutdown if server stops talking to us
- recognize EPIPE in a place
- simplify error handling
- pass around ssl-handle, not SSL, which can be grabbed from ssl-handle with handle>>
Doug Coleman [Wed, 15 Dec 2021 06:26:07 +0000 (00:26 -0600)]
vm: Fix C++ warning for comparing a signed to less-than 0.
Still a bit more duplication than I would like.
Found with:
c++ --version
c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Warning:
vm/bignum.cpp: In member function ‘factor::bignum* factor::factor_vm::cell_to_bignum(factor::cell)’:
vm/bignum.cpp:332:11: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
332 | if (n < (type) 0 && n == (type) - 1) \
| ~~^~~~~~~~~~
vm/bignum.cpp:361:1: note: in expansion of macro ‘FOO_TO_BIGNUM’
361 | FOO_TO_BIGNUM(cell, cell, fixnum, cell)
| ^~~~~~~~~~~~~
vm/bignum.cpp:336:29: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
336 | ((negative_p = (n < (type) 0)) ? ((type)(-(stype) n)) : n); \
| ~~^~~~~~~~~~
vm/bignum.cpp:361:1: note: in expansion of macro ‘FOO_TO_BIGNUM’
361 | FOO_TO_BIGNUM(cell, cell, fixnum, cell)
| ^~~~~~~~~~~~~
vm/bignum.cpp: In member function ‘factor::bignum* factor::factor_vm::ulong_long_to_bignum(uint64_t)’:
vm/bignum.cpp:332:11: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
332 | if (n < (type) 0 && n == (type) - 1) \
| ~~^~~~~~~~~~
vm/bignum.cpp:364:1: note: in expansion of macro ‘FOO_TO_BIGNUM’
364 | FOO_TO_BIGNUM(ulong_long, uint64_t, int64_t, uint64_t)
| ^~~~~~~~~~~~~
vm/bignum.cpp:336:29: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
336 | ((negative_p = (n < (type) 0)) ? ((type)(-(stype) n)) : n); \
| ~~^~~~~~~~~~
vm/bignum.cpp:364:1: note: in expansion of macro ‘FOO_TO_BIGNUM’
364 | FOO_TO_BIGNUM(ulong_long, uint64_t, int64_t, uint64_t)
| ^~~~~~~~~~~~~