message
stringlengths 6
474
| diff
stringlengths 8
5.22k
|
---|---|
Refactor macro-spanning ifs in ecp.c | @@ -2287,12 +2287,14 @@ cleanup:
mbedtls_free( T );
}
- /* don't free R while in progress in case R == P */
+ int should_free_R = 0;
+ /* prevent caller from using invalid value */
+ should_free_R = ( ret != 0 );
#if defined(MBEDTLS_ECP_RESTARTABLE)
- if( ret != MBEDTLS_ERR_ECP_IN_PROGRESS )
+ /* don't free R while in progress in case R == P */
+ should_free_R = should_free_R && ( ret != MBEDTLS_ERR_ECP_IN_PROGRESS );
#endif
- /* prevent caller from using invalid value */
- if( ret != 0 )
+ if( should_free_R )
mbedtls_ecp_point_free( R );
ECP_RS_LEAVE( rsm );
@@ -2537,10 +2539,12 @@ static int ecp_mul_restartable_internal( mbedtls_ecp_group *grp, mbedtls_ecp_poi
MBEDTLS_MPI_CHK( mbedtls_internal_ecp_init( grp ) );
#endif /* MBEDTLS_ECP_INTERNAL_ALT */
+ int restarting = 0;
#if defined(MBEDTLS_ECP_RESTARTABLE)
- /* skip argument check when restarting */
- if( rs_ctx == NULL || rs_ctx->rsm == NULL )
+ restarting = ( rs_ctx != NULL && rs_ctx->rsm != NULL );
#endif
+ /* skip argument check when restarting */
+ if( !restarting )
{
/* check_privkey is free */
MBEDTLS_ECP_BUDGET( MBEDTLS_ECP_OPS_CHK );
|
Yan LR: Truncate method signature | #include <kdbplugin.h>
+using ckdb::Key;
+using ckdb::KeySet;
+using ckdb::Plugin;
+
extern "C" {
-int elektraYanlrGet (ckdb::Plugin * handle, ckdb::KeySet * ks, ckdb::Key * parentKey);
-int elektraYanlrSet (ckdb::Plugin * handle, ckdb::KeySet * ks, ckdb::Key * parentKey);
+int elektraYanlrGet (Plugin *, KeySet *, Key *);
+int elektraYanlrSet (Plugin *, KeySet *, Key *);
-ckdb::Plugin * ELEKTRA_PLUGIN_EXPORT (yanlr);
+Plugin * ELEKTRA_PLUGIN_EXPORT (yanlr);
} // end extern "C"
|
Ruby: Add inspect and to_s method. | %ignore tinyspline::DeBoorNet::operator=;
%ignore tinyspline::Domain::operator=;
+%rename (inspect) tinyspline::BSpline::toString;
+%extend tinyspline::BSpline {std::string to_s() { return $self->toString(); }}
+%rename (inspect) tinyspline::DeBoorNet::toString;
+%extend tinyspline::DeBoorNet {std::string to_s() { return $self->toString(); }}
+%rename (inspect) tinyspline::Domain::toString;
+%extend tinyspline::Domain {std::string to_s() { return $self->toString(); }}
+
%rename("%(undercase)s", %$isfunction) "";
%rename("%(undercase)s", %$ismember, %$not %$isconstructor) "";
|
Comment why external subset name lookup cannot fail
Also add comment tag so that lcov can ignore unreachable code | @@ -4452,8 +4452,14 @@ doProlog(XML_Parser parser,
&dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
- if (!entity)
- return XML_ERROR_NO_MEMORY;
+ if (!entity) {
+ /* The external subset name "#" will have already been
+ * inserted into the hash table at the start of the
+ * external entity parsing, so no allocation will happen
+ * and lookup() cannot fail.
+ */
+ return XML_ERROR_NO_MEMORY; /* LCOV_EXCL_LINE */
+ }
if (useForeignDTD)
entity->base = curBase;
dtd->paramEntityRead = XML_FALSE;
|
nimble/ll: Use bigger LL task stack with ext adv
This was removed in but as it turns out, we need more stack for
extended and (especially) periodic advertising when running on CM0.
120 words give us few words to spare when running all features on CM0. | @@ -229,7 +229,11 @@ static void ble_ll_event_dbuf_overflow(struct ble_npl_event *ev);
#if MYNEWT
/* The BLE LL task data structure */
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
+#define BLE_LL_STACK_SIZE (120)
+#else
#define BLE_LL_STACK_SIZE (90)
+#endif
struct os_task g_ble_ll_task;
|
simd128: add SSE2 q15mulr_sat implementation | @@ -4412,12 +4412,29 @@ simde_wasm_i16x8_q15mulr_sat (simde_v128_t a, simde_v128_t b) {
b_ = simde_v128_to_private(b),
r_;
+ /* https://github.com/WebAssembly/simd/pull/365 */
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
r_.neon_i16 = vqrdmulhq_s16(a_.neon_i16, b_.neon_i16);
#elif defined(SIMDE_X86_SSSE3_NATIVE)
__m128i y = _mm_mulhrs_epi16(a_.sse_m128i, b_.sse_m128i);
- __m128i tmp = _mm_cmpeq_epi16(y, _mm_set1_epi16(HEDLEY_STATIC_CAST(int16_t, UINT16_C(0x8000))));
+ __m128i tmp = _mm_cmpeq_epi16(y, _mm_set1_epi16(INT16_MAX));
r_.sse_m128i = _mm_xor_si128(y, tmp);
+ #elif defined(SIMDE_X86_SSE2_NATIVE)
+ const __m128i prod_lo = _mm_mullo_epi16(a_.sse_m128i, b_.sse_m128i);
+ const __m128i prod_hi = _mm_mulhi_epi16(a_.sse_m128i, b_.sse_m128i);
+ const __m128i tmp =
+ _mm_add_epi16(
+ _mm_avg_epu16(
+ _mm_srli_epi16(prod_lo, 14),
+ _mm_setzero_si128()
+ ),
+ _mm_add_epi16(prod_hi, prod_hi)
+ );
+ r_.sse_m128i =
+ _mm_xor_si128(
+ tmp,
+ _mm_cmpeq_epi16(_mm_set1_epi16(INT16_MAX), tmp)
+ );
#else
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.i16) / sizeof(r_.i16[0])) ; i++) {
|
BugID:16763931:remove some externs which should not exist | @@ -494,7 +494,7 @@ void set_iotx_info()
HAL_SetDeviceName(DEVICE_NAME);
HAL_SetDeviceSecret(DEVICE_SECRET);
}
-extern int iotx_dm_cota_get_config(_IN_ const char *config_scope, const char *get_type, const char *attribute_keys);
+
int linkkit_main(void *paras)
{
#ifndef WIFI_PROVISION_ENABLED
|
Use unversioned `fmt::format_error` | @@ -352,7 +352,7 @@ void render_mpris_metadata(struct overlay_params& params, mutexed_metadata& meta
fmt::arg("title", meta.meta.title),
fmt::arg("album", meta.meta.album));
}
- catch (const fmt::v7::format_error& err)
+ catch (const fmt::format_error& err)
{
SPDLOG_ERROR("formatting error in '{}': {}", f, err.what());
}
|
vere: update patch version (0.9.1 -> 0.9.2) [ci skip] | set -e
-URBIT_VERSION="0.9.1"
+URBIT_VERSION="0.9.2"
deps=" \
curl gmp sigsegv argon2 ed25519 ent h2o scrypt sni uv murmur3 secp256k1 \
|
Warning of disabled safety modes
Several safety modes are available only with ALLOW_DEBUG flag. This is not noted in docs... | @@ -89,7 +89,7 @@ To print out the serial console from the ESP8266, run PORT=1 tests/debug_console
Safety Model
------
-When a panda powers up, by default it's in `SAFETY_SILENT` mode. While in `SAFETY_SILENT` mode, the buses are also forced to be silent. In order to send messages, you have to select a safety mode. Currently, setting safety modes is only supported over USB.
+When a panda powers up, by default it's in `SAFETY_SILENT` mode. While in `SAFETY_SILENT` mode, the buses are also forced to be silent. In order to send messages, you have to select a safety mode. Currently, setting safety modes is only supported over USB. Some of safety modes (for example `SAFETY_ALLOUTPUT`) are disabled in release firmwares. In order to use them, compile and flash your own build.
Safety modes optionally supports `controls_allowed`, which allows or blocks a subset of messages based on a customizable state in the board.
|
Add binding script prototypes. | @@ -2763,6 +2763,8 @@ void init_scripts();
void load_scripts();
void execute_animation_script (entity *ent);
void execute_takedamage_script (entity *ent, entity *other, s_collision_attack *attack);
+void execute_on_bind_update_other_to_self (entity *ent, s_bind *binding);
+void execute_on_bind_update_self_to_other (entity *ent, s_bind *binding);
void execute_ondeath_script (entity *ent, entity *other, s_collision_attack *attack);
void execute_onkill_script (entity *ent);
void execute_onpain_script (entity *ent, int iType, int iReset);
|
Enchance 'Require claim' directive
Add possibility to match values, of embedded objects in response (eg. claims in id_token). | @@ -229,6 +229,21 @@ apr_byte_t oidc_authz_match_claim(request_rec *r,
if (oidc_authz_match_expression(r, spec_c, val) == TRUE)
return TRUE;
+
+ /* dot means child nodes must be evaluated */
+ } else if (!(*attr_c) && (*spec_c) == '.') {
+
+ /* skip the dot */
+ spec_c++;
+
+ if (!json_is_object(val)) {
+ oidc_warn(r, "\"%s\" matched, and child nodes should be evaluated, but value is not an object.", key);
+ return FALSE;
+ }
+
+ oidc_debug(r, "Attribute chunk matched. Evaluating children of key: \"%s\".", key);
+
+ return oidc_authz_match_claim(r, spec_c, json_object_get(claims, key));
}
iter = json_object_iter_next((json_t *) claims, iter);
|
Added Synwit | <xs:enumeration value="Spansion:100"/>
<xs:enumeration value="STMicroelectronics:13"/>
<xs:enumeration value="Sunrise Micro Devices:121"/>
+ <xs:enumeration value="Synwit:144"/>
<xs:enumeration value="TI:16"/>
<xs:enumeration value="Texas Instruments:16"/>
<xs:enumeration value="Toshiba:92"/>
|
Cirrus: Remove unnecessary CMake config values | @@ -87,9 +87,6 @@ mac_task:
- SYSTEM_DIR="$PWD/kdbsystem"
- mkdir build && cd build
- cmake -GNinja -DPLUGINS=ALL -DBINDINGS=ALL -DKDB_DB_SYSTEM="$SYSTEM_DIR" ..
- -DRUBY_EXECUTABLE=/usr/local/opt/[email protected]/bin/ruby
- -DRUBY_INCLUDE_DIR=/usr/local/opt/[email protected]/include/ruby-2.5.0
- -DRUBY_LIBRARY=/usr/local/opt/[email protected]/lib/libruby.dylib
- ninja
- output="$(ninja install 2>&1)" || printf '%s' "$output"
|
board/kappa/led.c: Format with clang-format
BRANCH=none
TEST=none | @@ -87,11 +87,10 @@ static void led_set_battery(void)
battery_ticks++;
/* override battery led for system suspend */
- if (chipset_in_state(CHIPSET_STATE_SUSPEND |
- CHIPSET_STATE_STANDBY) &&
+ if (chipset_in_state(CHIPSET_STATE_SUSPEND | CHIPSET_STATE_STANDBY) &&
charge_get_state() != PWR_STATE_CHARGE) {
- led_set_color_battery(power_ticks++ & 0x2 ?
- LED_WHITE : LED_OFF);
+ led_set_color_battery(power_ticks++ & 0x2 ? LED_WHITE :
+ LED_OFF);
return;
}
@@ -119,8 +118,8 @@ static void led_set_battery(void)
led_set_color_battery(LED_OFF);
break;
case PWR_STATE_ERROR:
- led_set_color_battery(
- (battery_ticks % 0x2) ? LED_WHITE : LED_OFF);
+ led_set_color_battery((battery_ticks % 0x2) ? LED_WHITE :
+ LED_OFF);
break;
case PWR_STATE_CHARGE_NEAR_FULL:
led_set_color_battery(LED_WHITE);
|
SOVERSION bump to version 2.8.9 | @@ -63,7 +63,7 @@ set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_
# set version of the library
set(LIBYANG_MAJOR_SOVERSION 2)
set(LIBYANG_MINOR_SOVERSION 8)
-set(LIBYANG_MICRO_SOVERSION 8)
+set(LIBYANG_MICRO_SOVERSION 9)
set(LIBYANG_SOVERSION_FULL ${LIBYANG_MAJOR_SOVERSION}.${LIBYANG_MINOR_SOVERSION}.${LIBYANG_MICRO_SOVERSION})
set(LIBYANG_SOVERSION ${LIBYANG_MAJOR_SOVERSION})
|
ev3sensor: fix port mode typo | @@ -35,7 +35,8 @@ static const char* const port_modes[] = {
"other-i2c",
"ev3-analog",
"ev3-uart",
- "other-uart raw"
+ "other-uart",
+ "raw"
};
struct _pbdrv_ev3_sensor_t {
|
fix freeze on hangup | @@ -39,6 +39,7 @@ static void auplay_destructor(void *arg)
if (st->run) {
debug("alsa: stopping playback thread (%s)\n", st->device);
st->run = false;
+ snd_pcm_drop(st->write);
(void)pthread_join(st->thread, NULL);
}
|
docs: Fix a syntax error
issue | @@ -128,7 +128,7 @@ BoAT IoT Framework SDK depends on the following software:
| Python | Python 3.8.3 (Python 2.7 is also compatible) | Required | |
| curl | libcurl and its development files (7.55.1 is tested) | Required on Linux default | Required on Linux default |
-Before compiling the SDK and using it, you need to make sure that these software have been installed. On Ubuntu, can use the apt install command to install the corresponding package. Under Cygwin, use the Setup program that comes with Cygwin to install.
+Before compiling the SDK and using it, you need to make sure that these software have been installed. On Ubuntu OS, you can use the `apt install` command to install the corresponding package. Under Cygwin, use the Setup program that comes with Cygwin to install.
E.g.:
- Ubuntu
````
|
dds/example: removing 'experimental' header include, cleaning code a bit | #include <stdio.h>
#include <complex.h>
#include <math.h>
-
-#include "liquid.experimental.h"
+#include "liquid.h"
#define OUTPUT_FILENAME "dds_cccf_example.m"
int main() {
// options
- float fc=-0.0f; // input (output) decim (interp) frequency
+ float fc = -0.2f; // input (output) decim (interp) frequency
unsigned int num_stages = 3; // number of halfband interp/decim stages
unsigned int num_samples = 64; // number of input samples
float As = 60.0f; // DDS stop-band attenuation [dB]
@@ -55,7 +54,7 @@ int main() {
float h[h_len];
liquid_firdes_kaiser(h_len,bw,60.0f,0.0f,h);
for (i=0; i<num_samples; i++)
- x[i] = i < h_len ? h[i]*bw : 0.0f;
+ x[i] = i < h_len ? 2*h[i]*bw : 0.0f;
// run interpolation (up-conversion) stage
for (i=0; i<num_samples; i++) {
|
adding libc atanh, atanhf, atanhl | @@ -25,11 +25,11 @@ GO(__atan2f_finite, fFff)
GO(__atan2_finite, dFdd)
// atan2l // Weak
GOW(atanf, fFf)
-// atanh // Weak
-// atanhf // Weak
+GOW(atanh, dFd)
+GOW(atanhf, fFf)
// __atanhf_finite
// __atanh_finite
-// atanhl // Weak
+GO2(atanhl, LFL, atanh)
// atanl // Weak
// cabs // Weak
// cabsf // Weak
|
Fix aes gcm iv condition | @@ -774,10 +774,11 @@ ACVP_RESULT acvp_aes_kat_handler (ACVP_CTX *ctx, JSON_Object *obj) {
}
/*
- * If GCM and the generation is internal, then iv is not provided.
+ * If GCM, direction is encrypt, and the generation is internal
+ * then iv is not provided.
*/
- if (ivlen && !(alg_id == ACVP_AES_GCM
- && iv_gen == ACVP_IVGEN_SRC_INT)) {
+ if (ivlen && !(alg_id == ACVP_AES_GCM && dir == ACVP_DIR_ENCRYPT &&
+ iv_gen == ACVP_IVGEN_SRC_INT)) {
if (alg_id == ACVP_AES_XTS) {
/* XTS may call it tweak value "i", but we treat it as an IV */
iv = json_object_get_string(testobj, "i");
|
400KHz i2c with slight rise/fall slew | @@ -31,7 +31,7 @@ void MX_I2C4_Init(void)
{
hi2c4.Instance = I2C4;
- hi2c4.Init.Timing = 0x307075B1;
+ hi2c4.Init.Timing = 0x20401943;
hi2c4.Init.OwnAddress1 = 0;
hi2c4.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c4.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
|
docs(discord.h): better distinguish between discord_get_self() and discord_get_current_user() | @@ -147,7 +147,7 @@ void discord_global_init();
void discord_global_cleanup();
/**
- * @brief Get the user structure corresponding to the client
+ * @brief Get the client's cached user
*
* @param client the client created with discord_init()
* @warning the returned structure should NOT be modified
|
fix medium page size to 512k | @@ -141,7 +141,7 @@ typedef int32_t mi_ssize_t;
#endif
#define MI_SMALL_PAGE_SHIFT (MI_SEGMENT_SLICE_SHIFT) // 64KiB
-#define MI_MEDIUM_PAGE_SHIFT ( 4 + MI_SMALL_PAGE_SHIFT) // 512KiB
+#define MI_MEDIUM_PAGE_SHIFT ( 3 + MI_SMALL_PAGE_SHIFT) // 512KiB
// Derived constants
|
It is not allowed that the bitstream name includes a dot. | @@ -29,5 +29,5 @@ if [ "$NAME" == "donut.vhd" ]; then
sed -i '/ BUILD_DATE_DAT[^I]*:[ ^I]std_logic_vector/ c\
BUILD_DATE_DAT : std_logic_vector(63 DOWNTO 0) := x\"0000_'$SNAP_BUILD_DATE'\";' $1/$2
- echo "fw_$SNAP_RELEASE.$SNAP_BUILD_DATE" >.bitstream_name.txt
+ echo "fw_$SNAP_RELEASE_$SNAP_BUILD_DATE" >.bitstream_name.txt
fi
|
Teach ASN1_item_verify_ctx() how to handle provided keys
We need to special case RSA-PSS because that uses X509_ALGOR style
parameters and we have no support for this on the provider side at this
stage. | #include <openssl/evp.h>
#include "crypto/asn1.h"
#include "crypto/evp.h"
+#include "crypto/rsa.h"
#ifndef OPENSSL_NO_DEPRECATED_3_0
@@ -136,7 +137,7 @@ int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
goto err;
}
- if (mdnid == NID_undef) {
+ if (mdnid == NID_undef && evp_pkey_is_legacy(pkey)) {
if (pkey->ameth == NULL || pkey->ameth->item_verify == NULL) {
ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM);
goto err;
@@ -153,25 +154,51 @@ int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
if (ret <= 1)
goto err;
} else {
- const EVP_MD *type = EVP_get_digestbynid(mdnid);
+ const EVP_MD *type = NULL;
- if (type == NULL) {
- ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
+ /*
+ * We don't yet have the ability for providers to be able to handle
+ * X509_ALGOR style parameters. Fortunately the only one that needs this
+ * so far is RSA-PSS, so we just special case this for now. In some
+ * future version of OpenSSL we should push this to the provider.
+ */
+ if (mdnid == NID_undef && pknid == EVP_PKEY_RSA_PSS) {
+ if (!EVP_PKEY_is_a(pkey, "RSA") && !EVP_PKEY_is_a(pkey, "RSA-PSS")) {
+ ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE);
goto err;
}
-
+ /* This function also calls EVP_DigestVerifyInit */
+ if (ossl_rsa_pss_to_ctx(ctx, NULL, alg, pkey) <= 0) {
+ ERR_raise(ERR_LIB_ASN1, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
+ } else {
/* Check public key OID matches public key type */
if (!EVP_PKEY_is_a(pkey, OBJ_nid2sn(pknid))) {
ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE);
goto err;
}
+ if (mdnid != NID_undef) {
+ type = EVP_get_digestbynid(mdnid);
+ if (type == NULL) {
+ ERR_raise(ERR_LIB_ASN1,
+ ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
+ goto err;
+ }
+ }
+
+ /*
+ * Note that some algorithms (notably Ed25519 and Ed448) may allow
+ * a NULL digest value.
+ */
if (!EVP_DigestVerifyInit(ctx, NULL, type, NULL, pkey)) {
ERR_raise(ERR_LIB_ASN1, ERR_R_EVP_LIB);
ret = 0;
goto err;
}
}
+ }
inl = ASN1_item_i2d(data, &buf_in, it);
if (inl <= 0) {
|
decisions: rationale for Decided/Implemented step | @@ -123,6 +123,7 @@ Steps are described in [STEPS.md](../STEPS.md):
- PRs allow to better support the constraint that everything must be within Elektra's repository (also rejected decisions).
- "Decision", "Rationale" and "Implications" are filled out later to keep the discussion unbiased
- PRs allow to suggest changes and review individual sentences of the decision.
+- As "Decided"/"Implemented" decisions need a special decision PR, we cannot merge an "Decided"/"Implemented" decision PR by accident.
- Several "Related Decisions" are very important even if everyone agrees on one solution.
They allow reviewers and future readers of the decision to understand which options were considered and why they were rejected.
- The decision process is focused around the decision text (and not forum-like discussions), so that:
|
removes debug binding in +poke-noun, unnecessary printfs | %dns-authority
[/org/urbit/dyndns %gcloud %tonal-griffin-853 %dyndns]
==
- ::
- %bin
- :_ this :_ ~
- :* ost.bow
- %poke
- /bar
- [our.bow dap.bow]
- %dns-bind
- :: [for=~binzod him=~ridbyl-dovwyd tar=[%indirect p=~binzod]]
- [for=~binzod him=~ridbyl-dovwyd tar=[%direct %if .8.8.8.8]]
- ==
==
:: +sigh-httr: accept http response
::
~& [%authority-confirm-fail rep]
[~ this(nem ~)]
:: XX anything to do here? parse body?
- ~& %authority-confirmed
[~ this]
::
[%authority %create @ %for @ ~]
[%check @ ~]
=/ him=ship (slav %p i.t.wir)
?: =(200 p.rep)
- ~& %direct-confirm
abet:~(bind tell [him (~(get by per) him)])
:: XX specific messages per status code
~& %direct-confirm-fail
::
++ emit
|= car=card
- ~& [%emit-bind car]
^+ this
this(moz [[ost.bow car] moz])
:: +init: establish zone authority (request confirmation)
::
++ emit
|= car=card
- ~& [%emit-tell car]
^+ this
this(moz [[ost.bow car] moz])
:: +listen: subscribe to %ames +lane changes for child ships
|
test:runtime: out_stackdriver: add test with log tag | @@ -3606,6 +3606,50 @@ void flb_test_resource_k8s_node_custom_k8s_regex_with_dot()
flb_destroy(ctx);
}
+void flb_test_resource_k8s_node_custom_k8s_regex_with_long_tag()
+{
+ int ret;
+ int size = sizeof(K8S_NODE_LOCAL_RESOURCE_ID_WITH_DOT) - 1;
+ flb_ctx_t *ctx;
+ int in_ffd;
+ int out_ffd;
+
+ /* Create context, flush every second (some checks omitted here) */
+ ctx = flb_create();
+ flb_service_set(ctx, "flush", "1", "grace", "1", NULL);
+
+ /* Lib input mode */
+ in_ffd = flb_input(ctx, (char *) "lib", NULL);
+ flb_input_set(ctx, in_ffd, "tag", "tagWithLongLen", NULL);
+
+ /* Stackdriver output */
+ out_ffd = flb_output(ctx, (char *) "stackdriver", NULL);
+ flb_output_set(ctx, out_ffd,
+ "match", "tagWithLongLen",
+ "resource", "k8s_node",
+ "google_service_credentials", SERVICE_CREDENTIALS,
+ "k8s_cluster_name", "test_cluster_name",
+ "k8s_cluster_location", "test_cluster_location",
+ "custom_k8s_regex", "^(?<node_name>.*)$",
+ NULL);
+
+ /* Enable test mode */
+ ret = flb_output_set_test(ctx, out_ffd, "formatter",
+ cb_check_k8s_node_custom_k8s_regex,
+ NULL, NULL);
+
+ /* Start */
+ ret = flb_start(ctx);
+ TEST_CHECK(ret == 0);
+
+ /* Ingest data sample */
+ flb_lib_push(ctx, in_ffd, (char *) K8S_NODE_LOCAL_RESOURCE_ID_WITH_DOT, size);
+
+ sleep(2);
+ flb_stop(ctx);
+ flb_destroy(ctx);
+}
+
void flb_test_resource_k8s_pod_no_local_resource_id()
{
int ret;
@@ -4714,6 +4758,7 @@ TEST_LIST = {
{"resource_k8s_node_common", flb_test_resource_k8s_node_common },
{"resource_k8s_node_no_local_resource_id", flb_test_resource_k8s_node_no_local_resource_id },
{"resource_k8s_node_custom_k8s_regex_with_dot", flb_test_resource_k8s_node_custom_k8s_regex_with_dot },
+ {"resource_k8s_node_custom_k8s_regex_with_long_tag", flb_test_resource_k8s_node_custom_k8s_regex_with_long_tag },
{"resource_k8s_pod_common", flb_test_resource_k8s_pod_common },
{"resource_k8s_pod_no_local_resource_id", flb_test_resource_k8s_pod_no_local_resource_id },
{"default_labels", flb_test_default_labels },
|
Update error code for cert parsing failure | @@ -1898,7 +1898,7 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl,
mbedtls_ssl_send_alert_message( ssl,
MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR );
- return( MBEDTLS_ERR_SSL_BAD_CERTIFICATE );
+ return( MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR );
}
/* In theory, the CRT can be up to 2**24 Bytes, but we don't support
* anything beyond 2**16 ~ 64K. */
|
Make it constexpr | #include <stdint.h>
+#include "macros.h"
+
typedef uint32_t clap_id;
-static const clap_id CLAP_INVALID_ID = UINT32_MAX;
\ No newline at end of file
+static const CLAP_CONSTEXPR clap_id CLAP_INVALID_ID = UINT32_MAX;
\ No newline at end of file
|
Import prompt_toolkit 2.0.9 | @@ -151,6 +151,11 @@ def check_imports(no_check=None, extra=[], skip_func=None):
"prompt_toolkit.win32_types",
"prompt_toolkit.terminal.win32_input",
"prompt_toolkit.terminal.win32_output",
+ "prompt_toolkit.input.win32",
+ "prompt_toolkit.input.win32_pipe",
+ "prompt_toolkit.output.conemu",
+ "prompt_toolkit.output.win32",
+ "prompt_toolkit.output.windows10",
"backports.__init__",
"pygments.sphinxext",
|
Replace Slack URL
with URL for the join form instead of general URL which could be misleading or even confusing for a new user trying to join us there | [](https://travis-ci.org/nanoframework/nf-interpreter)
-[](https://nanoframework.slack.com/)
+[](https://nanoframework.wordpress.com/slack-invite-form/)
Welcome to the nanoFramework Interpreter repository!
|
BugID:17641214:improve linkkit_gateway_example | HAL_Printf("\033[0m\r\n"); \
} while (0)
-#define EXAMPLE_SUBDEV_MAX_NUM 20
+#define EXAMPLE_SUBDEV_MAX_NUM 6
const iotx_linkkit_dev_meta_info_t subdevArr[EXAMPLE_SUBDEV_MAX_NUM] = {
{
"a1YRfb9bepk",
@@ -423,6 +423,8 @@ int linkkit_main(void *paras)
}
while (1) {
+ HAL_SleepMs(200);
+
time_now_sec = user_update_sec();
if (time_prev_sec == time_now_sec) {
continue;
|
Fix text macros after foolishly breaking them | @@ -573,7 +573,7 @@ pub fn print_alloc(text: impl AsRef<str>, x: i32, y: i32, opts: PrintOptions) ->
#[macro_export]
macro_rules! print {
($text: literal, $($args: expr), *) => {
- $crate::tic80::print_raw($text, $($args), *);
+ $crate::tic80::print_raw(concat!($text, "\0"), $($args), *);
};
($text: expr, $($args: expr), *) => {
$crate::tic80::print_alloc($text, $($args), *);
@@ -642,7 +642,7 @@ pub fn font_alloc(text: impl AsRef<str>, x: i32, y: i32, opts: FontOptions) -> i
#[macro_export]
macro_rules! font {
($text: literal, $($args: expr), *) => {
- $crate::tic80::font_raw($text, $($args), *);
+ $crate::tic80::font_raw(concat!($text, "\0"), $($args), *);
};
($text: expr, $($args: expr), *) => {
$crate::tic80::font_alloc($text, $($args), *);
|
Readonly span | @@ -55,7 +55,7 @@ namespace Miningcore.Crypto.Hashing.Equihash
/// <param name="header">header including nonce (140 bytes)</param>
/// <param name="solution">equihash solution without size-preamble</param>
/// <returns></returns>
- public abstract bool Verify(Span<byte> header, Span<byte> solution);
+ public abstract bool Verify(ReadOnlySpan<byte> header, ReadOnlySpan<byte> solution);
}
public unsafe class EquihashSolver_200_9 : EquihashSolver
@@ -65,7 +65,7 @@ namespace Miningcore.Crypto.Hashing.Equihash
this.personalization = personalization;
}
- public override bool Verify(Span<byte> header, Span<byte> solution)
+ public override bool Verify(ReadOnlySpan<byte> header, ReadOnlySpan<byte> solution)
{
try
{
@@ -94,7 +94,7 @@ namespace Miningcore.Crypto.Hashing.Equihash
this.personalization = personalization;
}
- public override bool Verify(Span<byte> header, Span<byte> solution)
+ public override bool Verify(ReadOnlySpan<byte> header, ReadOnlySpan<byte> solution)
{
try
{
@@ -123,7 +123,7 @@ namespace Miningcore.Crypto.Hashing.Equihash
this.personalization = personalization;
}
- public override bool Verify(Span<byte> header, Span<byte> solution)
+ public override bool Verify(ReadOnlySpan<byte> header, ReadOnlySpan<byte> solution)
{
try
{
|
fix the ACK strategy, inspired from picoquic master branch | @@ -2558,9 +2558,20 @@ protoop_arg_t is_ack_needed(picoquic_cnx_t *cnx)
int ret = 0;
picoquic_packet_context_t * pkt_ctx = &path_x->pkt_ctx[pc];
+ if (pkt_ctx->ack_needed) {
if (pkt_ctx->highest_ack_sent + 2 <= pkt_ctx->first_sack_item.end_of_sack_range ||
pkt_ctx->highest_ack_time + pkt_ctx->ack_delay_local <= current_time) {
- ret = pkt_ctx->ack_needed;
+ ret = 1;
+ }
+ } else if (pkt_ctx->highest_ack_sent + 8 <= pkt_ctx->first_sack_item.end_of_sack_range &&
+ pkt_ctx->highest_ack_time + pkt_ctx->ack_delay_local <= current_time) {
+ /* Force sending an ack-of-ack from time to time, as a low priority action */
+ if (pkt_ctx->first_sack_item.end_of_sack_range == (uint64_t)((int64_t)-1)) {
+ ret = 0;
+ }
+ else {
+ ret = 1;
+ }
}
return (protoop_arg_t) ret;
|
Don't try to compare the ctype functions on values > 127
Our internal replacement functions return 0 for those values.
However, depending on locale, the C RTL functions may return 1. | @@ -70,7 +70,7 @@ static int test_ctype_tolower(int n)
int setup_tests(void)
{
- ADD_ALL_TESTS(test_ctype_chars, 256);
+ ADD_ALL_TESTS(test_ctype_chars, 128);
ADD_ALL_TESTS(test_ctype_toupper, OSSL_NELEM(case_change));
ADD_ALL_TESTS(test_ctype_tolower, OSSL_NELEM(case_change));
return 1;
|
workflow/show_mnemonic: shorter title
Fits better between the buttons on the top. | #define NUM_RANDOM_WORDS 5
static const char* _back_label = "Back to seed phrase";
-static const char* _cancel_confirm_title = "Export Mnemonic";
+static const char* _cancel_confirm_title = "Mnemonic";
static void _split_and_save_wordlist(
char* mnemonic,
|
Remove hidapi from android build | @@ -471,6 +471,7 @@ if(BUILD_SDL AND NOT EMSCRIPTEN AND NOT RPI)
if(ANDROID)
include_directories(${ANDROID_NDK}/sources/android/cpufeatures)
+ set(SDL_STATIC_PIC ON CACHE BOOL "" FORCE)
endif()
set(SDL_SHARED OFF CACHE BOOL "" FORCE)
@@ -981,7 +982,7 @@ if(BUILD_SDL)
add_library(tic80 SHARED ${TIC80_SRC})
- target_link_libraries(tic80 hidapi)
+ target_link_libraries(tic80)
else()
add_executable(tic80 ${TIC80_SRC})
|
WIP extracts event-log header read and single-home | @@ -601,6 +601,39 @@ _pier_disk_init(u3_disk* log_u)
return c3y;
}
+/* _pier_disk_read_header():
+** XX async
+*/
+static c3_o
+_pier_disk_read_header(u3_pier* pir_u, u3_noun ovo)
+{
+ u3_noun who, fak, len;
+
+ c3_assert( c3__boot == u3h(ovo) );
+ u3x_qual(ovo, 0, &who, &fak, &len);
+
+ c3_assert( c3y == u3ud(who) );
+ c3_assert( 1 >= u3r_met(7, who) );
+ c3_assert( c3y == u3ud(fak) );
+ c3_assert( 1 >= u3r_met(0, fak) );
+ c3_assert( c3y == u3ud(len) );
+ c3_assert( 1 >= u3r_met(3, len) );
+
+ pir_u->fak_o = (c3_o)fak;
+ pir_u->lif_d = u3r_word(0, len);
+ u3r_chubs(0, 2, pir_u->who_d, who);
+
+ // Disable networking for fake ships
+ //
+ if ( c3y == pir_u->fak_o ) {
+ u3_Host.ops_u.net = c3n;
+ }
+
+ u3z(ovo);
+
+ return c3y;
+}
+
/* _pier_disk_load_commit(): load all commits >= evt_d; set ent_u, ext_u.
** XX async
*/
@@ -643,30 +676,12 @@ _pier_disk_load_commit(u3_pier* pir_u,
if ( (0ULL == pos_d) &&
(1ULL == lav_d) )
{
- u3_noun who, fak, len;
-
- c3_assert( c3__boot == u3h(ovo) );
- u3x_qual(ovo, 0, &who, &fak, &len);
-
- c3_assert( c3y == u3ud(who) );
- c3_assert( 1 >= u3r_met(7, who) );
- c3_assert( c3y == u3ud(fak) );
- c3_assert( 1 >= u3r_met(0, fak) );
- c3_assert( c3y == u3ud(len) );
- c3_assert( 1 >= u3r_met(3, len) );
-
- pir_u->fak_o = (c3_o)fak;
- pir_u->lif_d = u3r_word(0, len);
- u3r_chubs(0, 2, pir_u->who_d, who);
+ u3z(mat);
- // Disable networking for fake ships
- //
- if ( c3y == pir_u->fak_o ) {
- u3_Host.ops_u.net = c3n;
+ if ( c3n == _pier_disk_read_header(pir_u, ovo) ) {
+ return c3n;
}
- u3z(mat);
- u3z(ovo);
break;
}
|
dm-hook: fix migration | ++ graph
%+ roll dms
|= [rid=resource =graph:store]
+ ^- graph:store
=/ =ship (counterparty rid)
=| =post:store
=: author.post our.bowl
index.post [ship ~]
time-sent.post now.bowl
==
- =. graph
- (update-indices ~[ship] graph)
- (put:orm:store graph `@`ship [%& post] %graph graph)
+ =/ dm=graph:store
+ (update-indices ~[ship] (get-graph-mop:gra rid))
+ (put:orm:store graph `@`ship [%& post] %graph dm)
--
::
++ on-save !>(state)
|
Restore MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED as default ret. | @@ -331,7 +331,7 @@ int mbedtls_ccm_update( mbedtls_ccm_context *ctx,
unsigned char *output, size_t output_size,
size_t *output_len )
{
- int ret;
+ int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
unsigned char i;
size_t use_len, offset, olen;
@@ -431,7 +431,7 @@ exit:
int mbedtls_ccm_finish( mbedtls_ccm_context *ctx,
unsigned char *tag, size_t tag_len )
{
- int ret;
+ int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
unsigned char i;
if( ctx->state & CCM_STATE__ERROR )
|
Use the existing constants for device server path | @@ -124,7 +124,7 @@ execute_server(struct server *server, const struct server_params *params) {
sprintf(max_fps_string, "%"PRIu16, params->max_fps);
const char *const cmd[] = {
"shell",
- "CLASSPATH=/data/local/tmp/" SERVER_FILENAME,
+ "CLASSPATH=" DEVICE_SERVER_PATH,
"app_process",
#ifdef SERVER_DEBUGGER
# define SERVER_DEBUGGER_PORT "5005"
|
build: bump to v2.0.8 | @@ -8,7 +8,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
# Fluent Bit Version
set(FLB_VERSION_MAJOR 2)
set(FLB_VERSION_MINOR 0)
-set(FLB_VERSION_PATCH 7)
+set(FLB_VERSION_PATCH 8)
set(FLB_VERSION_STR "${FLB_VERSION_MAJOR}.${FLB_VERSION_MINOR}.${FLB_VERSION_PATCH}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
Remove unused token.IDDollar | @@ -225,7 +225,6 @@ const (
IDExclam = ID(0x0C)
IDQuestion = ID(0x0D)
IDColon = ID(0x0E)
- IDDollar = ID(0x0F)
)
const (
@@ -621,7 +620,6 @@ var builtInsByID = [nBuiltInIDs]string{
IDQuestion: "?",
IDColon: ":",
IDSemicolon: ";",
- IDDollar: "$",
IDPlusEq: "+=",
IDMinusEq: "-=",
@@ -958,7 +956,6 @@ var squiggles = [256]ID{
'?': IDQuestion,
':': IDColon,
';': IDSemicolon,
- '$': IDDollar,
}
type suffixLexer struct {
@@ -1191,5 +1188,4 @@ var isTightRight = [...]bool{
IDExclam: true,
IDQuestion: true,
IDColon: true,
- IDDollar: true,
}
|
esp32/mphalport: Improve delay and ticks functions. | */
#include <stdio.h>
+#include <sys/time.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
@@ -78,22 +79,34 @@ void mp_hal_stdout_tx_strn_cooked(const char *str, uint32_t len) {
}
uint32_t mp_hal_ticks_ms(void) {
- return xTaskGetTickCount() * (1000 / configTICK_RATE_HZ);
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
uint32_t mp_hal_ticks_us(void) {
- return mp_hal_ticks_ms() * 1000;
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_sec * 1000000 + tv.tv_usec;
}
void mp_hal_delay_ms(uint32_t ms) {
+ struct timeval tv_start;
+ gettimeofday(&tv_start, NULL);
vTaskDelay(ms / portTICK_PERIOD_MS);
+ struct timeval tv_end;
+ gettimeofday(&tv_end, NULL);
+ uint64_t dt = (tv_end.tv_sec - tv_start.tv_sec) * 1000 + (tv_end.tv_usec - tv_start.tv_usec) / 1000;
+ if (dt < ms) {
+ ets_delay_us((ms - dt) * 1000);
+ }
}
void mp_hal_delay_us(uint32_t us) {
- vTaskDelay(us / 1000 / portTICK_PERIOD_MS);
+ ets_delay_us(us);
}
-// this function could do with improvements
+// this function could do with improvements (eg use ets_delay_us)
void mp_hal_delay_us_fast(uint32_t us) {
uint32_t delay = ets_get_cpu_frequency() / 19;
while (--us) {
|
zero pad messages before sending | @@ -134,6 +134,7 @@ def _isotp_thread(panda, bus, tx_addr, tx_queue, rx_queue):
req = tx_queue.get(block=False)
# reset rx rx_frame
rx_frame = {"size": 0, "data": "", "sent": True}
+ req = req.ljust(8, "\x00")
if (DEBUG): print "S:", hex(tx_addr), req.encode("hex")
panda.can_send(tx_addr, req, bus)
else:
@@ -643,7 +644,7 @@ if __name__ == "__main__":
from python import Panda
panda = Panda()
bus = 0
- tx_addr = 0x18daf130 # EPS
+ tx_addr = 0x18da30f1 # EPS
tx_queue = Queue()
rx_queue = Queue()
can_reader_t = threading.Thread(target=_isotp_thread, args=(panda, bus, tx_addr, tx_queue, rx_queue))
|
Update CLI, rework desctool interface | @@ -2704,7 +2704,7 @@ macro _SRC("supp", SRC, SRCFLAGS...) {
}
macro _SRC("ydl", SRC, SRCFLAGS...) {
- .CMD=${tool:"statbox/ydl/compiler/tooling/ydlc/bin"} --tty-colors -I ${ARCADIA_ROOT} --cpp-output-header ${output;suf=.h:SRC} --cpp-output-source ${output;suf=.cpp:SRC} ${input:SRC} ${output_include;hide:"statbox/ydl/runtime/cpp/gen_support/standard_includes.h"} ${kv;hide:"p YDL"} ${kv;hide:"pc yellow"}
+ .CMD=${tool:"statbox/ydl/compiler/tooling/ydlc/bin"} --force-color -I ${ARCADIA_ROOT} --cpp-output-header ${output;suf=.h:SRC} --cpp-output-source ${output;suf=.cpp:SRC} ${input:SRC} ${output_include;hide:"statbox/ydl/runtime/cpp/gen_support/standard_includes.h"} ${kv;hide:"p YDL"} ${kv;hide:"pc yellow"}
.PEERDIR+=statbox/ydl/runtime/cpp
}
|
fix(docs): Correct mo_tog implementation in tabbed menu | @@ -139,7 +139,7 @@ defaultValue="homerow_mods"
values={[
{label: 'Homerow Mods', value: 'homerow_mods'},
{label: 'Autoshift', value: 'autoshift'},
-{label: 'Toggle-on-Tap, Momentary-on-Hold Layers', value: 'tog_mo'},
+{label: 'Toggle-on-Tap, Momentary-on-Hold Layers', value: 'mo_tog'},
]}>
<TabItem value="homerow_mods">
|
RPL-CLASSIC: Add guard for urgent probing
Compiling with RPL_CONF_WITH_PROBING := 0 was not possible due to `urgent_probing_target`
not present. | @@ -268,9 +268,11 @@ rpl_link_callback(const linkaddr_t *addr, int status, int numtx)
if(parent != NULL) {
/* If this is the neighbor we were probing urgently, mark urgent
probing as done */
+#if RPL_WITH_PROBING
if(instance->urgent_probing_target == parent) {
instance->urgent_probing_target = NULL;
}
+#endif /* RPL_WITH_PROBING */
/* Trigger DAG rank recalculation. */
PRINTF("RPL: rpl_link_callback triggering update\n");
parent->flags |= RPL_PARENT_FLAG_UPDATED;
|
Add argp error handling block | @@ -128,15 +128,22 @@ static int parse_opt(int key, char *arg, struct argp_state *state)
bool cnc_client_parse_cl_args(CNCCommandPacket * command_packet, int argc, char ** argv)
{
- int res, argsc;
+ int result;
int flags = 0;
if (command_packet == NULL || argv == NULL)
{
return false;
}
- argp_parse (&argp, argc, argv, flags, 0, command_packet);
-
+ result = argp_parse (&argp, argc, argv, flags, 0, command_packet);
+ if (result == 0)
+ {
return true;
}
+ else
+ {
+ //Do some error handling
+ return false;
+ }
+}
|
fix: explicite decorator useless | @@ -22,7 +22,6 @@ def pytest_addoption(parser):
path: str = SCRIPT_DIR.parent.parent / "bin" / "app.elf"
parser.addoption("--path", action="store", default=path)
[email protected]()
def client(pytestconfig):
file_path = pytestconfig.getoption("path")
model = pytestconfig.getoption("model")
|
out_http: set upstream flags using instance flags | @@ -214,6 +214,9 @@ struct flb_out_http *flb_http_conf_create(struct flb_output_instance *ins,
ctx->host = ins->host.name;
ctx->port = ins->host.port;
+ /* Set instance flags into upstream */
+ flb_output_upstream_set(ctx->u, ins);
+
return ctx;
}
|
print failed %pokes in +coup | ?~ nem [~ this]
abet:(~(create bind u.nem) for him tar)
[(weld zom zam) this]
-::
-:: ++ coup-dns-bind
-:: |= [wir=wire saw=(unit tang)]
-:: ~& [%coup-bind +<]
-:: ?~ saw
-:: [~ this]
-:: ?> ?=(^ wir)
-:: ?- i.wir
-:: %forward !! :: re-forward?
-:: %bind !! :: rebind?
-:: * ~&(coup-dns-bind+wir [~ this])
-:: ==
-::
:: +poke-dns-bond: process established dns binding
::
++ poke-dns-bond
(~(bake tell [him (~(get by per) him)]) dom)
~& [%strange-bond +<]
[~ this]
+:: +coup: general poke acknowledgement or error
+::
+++ coup
+ |= [wir=wire saw=(unit tang)]
+ ?~ saw [~ this]
+ ~& [%coup-fallthru wir]
+ [((slog u.saw) ~) this]
:: +rove: hear %ames +lane change for child ships
::
++ rove
|
Add verbosity to debug occasional missing q1-10.example.net, from timer. | @@ -45,7 +45,7 @@ fi
# make config file
sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' -e 's/@CONTROL_PORT\@/'$CONTROL_PORT'/' < dnstap.conf > ub.conf
# start unbound in the background
-$PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
+$PRE/unbound -d -c ub.conf -vvvv >unbound.log 2>&1 &
UNBOUND_PID=$!
echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
|
silence unit test debug output | @@ -4,22 +4,23 @@ all:objcache_test network_test id_heap_test
ROOT=$(PWD)/..
CC=cc
-CFLAGS=-g -c -DENABLE_MSG_DEBUG -std=gnu99
+CFLAGS=-g -std=gnu99
+#CFLAGS+=-DENABLE_MSG_DEBUG
include $(ROOT)/unix_process/Makefile
INCLUDES += -I.
%.o: %.c $(ROOT)/runtime/closure_templates.h
- $(CC) $(CFLAGS) $(INCLUDES) $<
+ $(CC) -c $(CFLAGS) $(INCLUDES) $<
objcache_test: objcache_test.o $(UNIXRUNTIME) $(TFS)
- $(CC) $^ -g -o objcache_test
+ $(CC) $(CFLAGS) $^ -g -o objcache_test
network_test: network_test.o http.o socket_user.o $(UNIXRUNTIME)
- $(CC) -I. $^ -g -o network_test
+ $(CC) $(CFLAGS) -I. $^ -g -o network_test
id_heap_test: id_heap_test.o $(UNIXRUNTIME)
- $(CC) $^ -g -o id_heap_test
+ $(CC) $(CFLAGS) $^ -g -o id_heap_test
unit-test: objcache_test id_heap_test
./objcache_test
|
Do not warn on terminating the server
If the server is already dead, terminating it fails. This is expected. | @@ -382,9 +382,7 @@ server_start(struct server *server, const char *serial,
server->wait_server_thread =
SDL_CreateThread(run_wait_server, "wait-server", server);
if (!server->wait_server_thread) {
- if (!cmd_terminate(server->process)) {
- LOGW("Could not terminate server");
- }
+ cmd_terminate(server->process);
cmd_simple_wait(server->process, NULL); // ignore exit code
goto error2;
}
@@ -464,9 +462,7 @@ server_stop(struct server *server) {
assert(server->process != PROCESS_NONE);
- if (!cmd_terminate(server->process)) {
- LOGW("Could not terminate server");
- }
+ cmd_terminate(server->process);
if (server->tunnel_enabled) {
// ignore failure
|
h2olog/quic: support the streams_blocked_send probe | @@ -112,6 +112,8 @@ struct quic_event_t {
u32 new_version;
u64 len;
u64 token_generation;
+ u64 limit;
+ u32 is_unidirectional;
};
BPF_PERF_OUTPUT(events);
@@ -382,6 +384,25 @@ int trace_new_token_receive(struct pt_regs *ctx) {
return 0;
}
+
+int trace_streams_blocked_send(struct pt_regs *ctx) {
+ void *pos = NULL;
+ struct quic_event_t event = {};
+ struct st_quicly_conn_t conn = {};
+ sprintf(event.type, "handshake_done_send");
+
+ bpf_usdt_readarg(1, ctx, &pos);
+ bpf_probe_read(&conn, sizeof(conn), pos);
+ event.master_conn_id = conn.master_id;
+ bpf_usdt_readarg(2, ctx, &event.at);
+ bpf_usdt_readarg(3, ctx, &event.limit);
+ bpf_usdt_readarg(4, ctx, &event.is_unidirectional);
+
+ if (events.perf_submit(ctx, &event, sizeof(event)) < 0)
+ bpf_trace_printk("failed to perf_submit\\n");
+
+ return 0;
+}
"""
def handle_req_line(cpu, data, size):
@@ -506,6 +527,7 @@ if sys.argv[1] == "quic":
u.enable_probe(probe="new_token_send", fn_name="trace_new_token_send")
u.enable_probe(probe="new_token_acked", fn_name="trace_new_token_acked")
u.enable_probe(probe="new_token_receive", fn_name="trace_new_token_receive")
+ u.enable_probe(probe="streams_blocked_send", fn_name="trace_streams_blocked_send")
b = BPF(text=quic_bpf, usdt_contexts=[u])
else:
u.enable_probe(probe="receive_request", fn_name="trace_receive_req")
|
test-suite: register gnu9 variant for GSL linkage (to get math library) | @@ -56,6 +56,7 @@ fi
AM_CONDITIONAL(USE_GNU_COMPILER, test "$LMOD_FAMILY_COMPILER" = "gnu")
AM_CONDITIONAL(USE_GNU_COMPILER, test "$LMOD_FAMILY_COMPILER" = "gnu7")
AM_CONDITIONAL(USE_GNU_COMPILER, test "$LMOD_FAMILY_COMPILER" = "gnu8")
+AM_CONDITIONAL(USE_GNU_COMPILER, test "$LMOD_FAMILY_COMPILER" = "gnu9")
AM_COND_IF(USE_GNU_COMPILER, LDFLAGS="${LDFLAGS} -lm")
# Set subdirectories
|
adding some notes on the AST checks | @@ -789,13 +789,29 @@ Namespaces will appear as sections in the documentation.
\label{chap:astops}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+The following checks are executed after the parser has consumed the entire
+Skate file and created the AST.
+
\section{Filename Check}
+As already stated, the name of the Skate (without extension) must match the
+identifier of the declared schema in the Skate file. This is required for
+resolving imports of other Schemas.
+
+\section{Uniqueness of declarations / fields}
+Skate ensures that all declarations within a namespace are unique no matter
+which type they are i.e. there cannot be a fact and a constant definition with
+the same identifier. Moreover, the same check is applied to the fact attributes
+as well as flags, enumerations and constant values.
+
+Checks are based on the qualified identifier.
\section{Type Checks}
-\section{Sorting of Declarations}
+\section{Sorting of Declarations}
+\todo{This requires generated a dependency graph for the facts etc. }
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{C mapping for Schema Definitions}
\label{chap:cmapping}
|
tinyusb: Fix CDC rx/tx buffer size for high speed
Previous values (64) were OK for full speed devices.
The way FIFO is handled in cdc_device requires buffer
of 512 bytes in high speed mode. | @@ -86,8 +86,8 @@ extern "C" {
#define CFG_TUD_BTH_ISO_ALT_COUNT 2
/* CDC FIFO size of TX and RX */
-#define CFG_TUD_CDC_RX_BUFSIZE 64
-#define CFG_TUD_CDC_TX_BUFSIZE 64
+#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
+#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
/* HID buffer size Should be sufficient to hold ID (if any) + Data */
#define CFG_TUD_HID_BUFSIZE 16
|
ToolStatus: Disable rebar autosize | @@ -128,7 +128,7 @@ VOID RebarLoadSettings(
WS_EX_TOOLWINDOW,
REBARCLASSNAME,
NULL,
- WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CCS_NODIVIDER | CCS_TOP | RBS_VARHEIGHT | RBS_AUTOSIZE, // CCS_NOPARENTALIGN
+ WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CCS_NODIVIDER | CCS_TOP | RBS_VARHEIGHT, // | RBS_AUTOSIZE CCS_NOPARENTALIGN
0, 0, 0, 0,
PhMainWndHandle,
NULL,
|
clear next-order on domain validation failure | :~ 'unable to reach ' (scot %p our.bow)
' via http at ' (join '.' turf.i.item) ':80'
==
- (emit (notify msg [(sell !>(rep)) ~]))
+ (emit(next-order ~) (notify msg [(sell !>(rep)) ~]))
?: ?=(~ (skip ~(val by u.next-order) |=([@ud valid=?] valid)))
new-order:effect
(validate-domain:effect +(idx))
|
apps/examples/stat: Fix a backward conditional test. Improve output. | @@ -61,7 +61,7 @@ static struct mallinfo g_mmafter;
static void showusage(FAR struct mallinfo *mmbefore,
FAR struct mallinfo *mmafter, FAR const char *msg)
{
- if (mmbefore->uordblks > mmafter->uordblks)
+ if (mmbefore->uordblks != mmafter->uordblks)
{
printf("\n%s:\n", msg);
printf("VARIABLE BEFORE AFTER\n");
@@ -172,7 +172,7 @@ static void dump_stat(FAR struct stat *buf)
details[8]='w';
}
- printf("\nstat:\n");
+ printf("stat buffer:\n");
printf(" st_mode: %04x %s\n", buf->st_mode, details);
printf(" st_size: %llu\n", (unsigned long long)buf->st_size);
printf(" st_blksize: %lu\n", (unsigned long)buf->st_blksize);
@@ -184,7 +184,7 @@ static void dump_stat(FAR struct stat *buf)
static void dump_statfs(FAR struct statfs *buf)
{
- printf("\nstatfs:\n");
+ printf("statfs buffer:\n");
printf(" f_type: %lu\n", (unsigned long)buf->f_type);
printf(" f_namelen: %lu\n", (unsigned long)buf->f_namelen);
printf(" f_bsize: %lu\n", (unsigned long)buf->f_bsize);
@@ -240,6 +240,7 @@ int stat_main(int argc, char *argv[])
/* Try stat first */
+ printf("\nTest stat(%s)\n", path);
ret = stat(path, &statbuf);
if (ret < 0)
{
@@ -256,6 +257,7 @@ int stat_main(int argc, char *argv[])
/* Try statfs */
+ printf("\nTest statfs(%s)\n", path);
ret = statfs(path, &statfsbuf);
if (ret < 0)
{
@@ -272,7 +274,10 @@ int stat_main(int argc, char *argv[])
if (isreg)
{
- int fd = open(path, O_RDONLY);
+ int fd;
+
+ printf("\nOpen(%s) and test fstat()\n", path);
+ fd = open(path, O_RDONLY);
if (fd < 0)
{
int errcode = errno;
@@ -282,8 +287,6 @@ int stat_main(int argc, char *argv[])
return EXIT_FAILURE;
}
- stepusage();
-
ret = fstat(fd, &statbuf);
if (ret < 0)
{
@@ -297,8 +300,8 @@ int stat_main(int argc, char *argv[])
dump_stat(&statbuf);
}
- stepusage();
close(fd);
+ stepusage();
}
endusage();
|
Remove prefix opcodes from compiler | @@ -1658,8 +1658,6 @@ static int getArgCount(uint8_t code, const ValueArray constants, int ip) {
case OP_GREATER:
case OP_LESS:
case OP_ADD:
- case OP_INCREMENT:
- case OP_DECREMENT:
case OP_MULTIPLY:
case OP_DIVIDE:
case OP_POW:
|
board/kukui_scp/isp_p2_srv.c: Format with clang-format
BRANCH=none
TEST=none | static struct consumer const event_dip_consumer;
static void event_dip_written(struct consumer const *consumer, size_t count);
-static struct queue const event_dip_queue = QUEUE_DIRECT(4,
- struct dip_msg_service, null_producer, event_dip_consumer);
+static struct queue const event_dip_queue = QUEUE_DIRECT(
+ 4, struct dip_msg_service, null_producer, event_dip_consumer);
static struct consumer const event_dip_consumer = {
.queue = &event_dip_queue,
@@ -31,7 +31,9 @@ static struct consumer const event_dip_consumer = {
/* Stub functions only provided by private overlays. */
#ifndef HAVE_PRIVATE_MT8183
-void dip_msg_handler(void *data) {}
+void dip_msg_handler(void *data)
+{
+}
#endif
static void event_dip_written(struct consumer const *consumer, size_t count)
|
py/runtime: Use mp_obj_new_int_from_ll when return int is not small.
There's no need to call mp_obj_new_int() which will just fail the check for
small int and call mp_obj_new_int_from_ll() anyway.
Thanks to for prompting this change. | @@ -496,11 +496,11 @@ mp_obj_t mp_binary_op(mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs) {
default:
goto unsupported_op;
}
- // TODO: We just should make mp_obj_new_int() inline and use that
+ // This is an inlined version of mp_obj_new_int, for speed
if (MP_SMALL_INT_FITS(lhs_val)) {
return MP_OBJ_NEW_SMALL_INT(lhs_val);
} else {
- return mp_obj_new_int(lhs_val);
+ return mp_obj_new_int_from_ll(lhs_val);
}
#if MICROPY_PY_BUILTINS_FLOAT
} else if (mp_obj_is_float(rhs)) {
|
esp32/main: Bump heap size from 64k to 96k. | #define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1)
#define MP_TASK_STACK_SIZE (16 * 1024)
#define MP_TASK_STACK_LEN (MP_TASK_STACK_SIZE / sizeof(StackType_t))
-#define MP_TASK_HEAP_SIZE (64 * 1024)
+#define MP_TASK_HEAP_SIZE (96 * 1024)
//STATIC StaticTask_t mp_task_tcb;
//STATIC StackType_t mp_task_stack[MP_TASK_STACK_LEN] __attribute__((aligned (8)));
|
[verilator] Hack together a Verilator compilation | @@ -106,7 +106,7 @@ $(buildpath)/$(library):
.PHONY: compile
compile: dpi lib $(buildpath) $(buildpath)/compile.tcl update_opcodes
$(buildpath)/compile.tcl: $(bender) $(config_mk) Makefile $(MEMPOOL_DIR)/Bender.yml $(shell find {src,tb,deps} -type f)
- $(bender) script vsim --vlog-arg="$(vlog_args)" $(vlog_defs) -t rtl -t mempool_test > $(buildpath)/compile.tcl
+ $(bender) script vsim --vlog-arg="$(vlog_args)" $(vlog_defs) -t rtl -t mempool_vsim > $(buildpath)/compile.tcl
echo "exit" >> $(buildpath)/compile.tcl
cd $(buildpath) && $(questa_cmd) vsim -work $(library) -c -do compile.tcl
@@ -150,13 +150,22 @@ VERILATOR_FLAGS += -Wno-WIDTH
VERILATOR_FLAGS += -Wno-WIDTHCONCAT
VERILATOR_FLAGS += -Wno-UNSIGNED
VERILATOR_FLAGS += -Wno-UNUSED
+# VERILATOR_FLAGS += -Wno-BLKLOOPINIT
VERILATOR_FLAGS += -Wno-fatal
+VERILATOR_FLAGS += -Wno-lint
+VERILATOR_FLAGS += -Wno-style
VERILATOR_FLAGS += --output-split 20000
+# VERILATOR_FLAGS += --trace --trace-fst --trace-structs --trace-params --trace-max-array 1024
+VERILATOR_FLAGS += -CFLAGS "-std=c++11 -Wall -DVM_TRACE_FMT_FST -DTOPLEVEL_NAME=mempool_tb_verilator -g" -LDFLAGS "-pthread -lutil -lelf" -Wall --unroll-count 72
+VERILATOR_FLAGS += --debug
+
verilate:
mkdir -p obj_dir
- $(bender) script verilator $(vlog_defs) -t rtl -t mempool_test > obj_dir/files
- $(verilator) -f obj_dir/files $(VERILATOR_FLAGS) --cc --top-module mempool_system
+ # $(bender) script verilator $(vlog_defs) -t rtl -t mempool_verilator > obj_dir/files
+ cp files.target obj_dir/files
+ $(verilator) -f obj_dir/files $(VERILATOR_FLAGS) --cc --top-module mempool_tb_verilator
+ make -j4 -C obj_dir -f Vmempool_tb_verilator.mk
# Benchmarking
benchmark: log simc
|
Added comment regarding carriage returns in options.c
Added Figs directory to tex/ | @@ -55,6 +55,8 @@ void GetLine(char cFile[],char cOption[],char cLine[],int *iLine,int iVerbose) {
char cWord[OPTLEN],cTmp[LINE];
FILE *fp;
+ /* XXX Need to add a check for a carriage return on each line */
+
iLen=strlen(cOption);
fp=fopen(cFile,"r");
|
kernel/debug: Fix build error in sysdbg module
This patch fixes build error, which occurs
when any one or two of below three configs are disabled
1. CONFIG_TASK_SCHED_HISTORY
2. CONFIG_IRQ_SCHED_HISTORY
3. CONFIG_SEMAPHORE_HISTORY | @@ -889,21 +889,29 @@ static void sysdbg_monitor_enable(void)
irqrestore(saved_state);
return;
}
+
+#ifdef CONFIG_SEMAPHORE_HISTORY
fail3:
+#endif
#ifdef CONFIG_IRQ_SCHED_HISTORY
kmm_free(sysdbg_struct->irq);
sysdbg_struct->irq = NULL;
#endif
+#ifdef CONFIG_IRQ_SCHED_HISTORY
fail2:
+#endif
#ifdef CONFIG_TASK_SCHED_HISTORY
kmm_free(sysdbg_struct->sched);
sysdbg_struct->sched = NULL;
#endif
+#ifdef CONFIG_TASK_SCHED_HISTORY
fail1:
+#endif
kmm_free(sysdbg_struct);
sysdbg_struct = NULL;
+
fail:
lldbg("Disabling sysdbg monitoring feature, kindly use less count\n");
sysdbg_monitor = false;
|
curve448/field.h: relax alignment, as it doesn't work universally.
Some platforms, cough-DJGPP, fail to compile claiming that requested
alignment is greater than maximum possible. Supposedly original
alignment was result of an attempt to utilize AVX2... | # if defined(__GNUC__) || defined(__clang__)
# define INLINE_UNUSED __inline__ __attribute__((__unused__,__always_inline__))
# define RESTRICT __restrict__
-# define ALIGNED __attribute__((__aligned__(32)))
+# define ALIGNED __attribute__((__aligned__(16)))
# else
# define INLINE_UNUSED ossl_inline
# define RESTRICT
|
vcp: timeout insted of blocking forever | @@ -181,16 +181,18 @@ static uint16_t VCP_DataTx(uint8_t *Buf, uint32_t Len) {
and wait for any existing transmission to complete.
*/
- while (CDC_Send_FreeBytes() == 0 || USB_Tx_State != 0)
+ for (uint32_t timeout = 1000; timeout && CDC_Send_FreeBytes() == 0 || USB_Tx_State != 0; --timeout) {
__WFI();
+ }
for (uint32_t i = 0; i < Len; i++) {
APP_Rx_Buffer[APP_Rx_ptr_in] = Buf[i];
APP_Rx_ptr_in = (APP_Rx_ptr_in + 1) % APP_RX_DATA_SIZE;
- while (CDC_Send_FreeBytes() == 0 || USB_Tx_State != 0)
+ for (uint32_t timeout = 1000; timeout && CDC_Send_FreeBytes() == 0 || USB_Tx_State != 0; --timeout) {
__WFI();
}
+ }
return USBD_OK;
}
|
Add tests for new single line trimming option | @@ -76,3 +76,11 @@ test("should treat variable characters as length=1 in character limits", () => {
trimlines("Hell#L0#\nWorld", 5)
).toBe("Hell#L0#\nWorld");
});
+
+test("should allow trimming text to a single line using third arg", () => {
+ expect(trimlines("Obsid$", 6, 1)).toBe("Obsid$");
+ expect(trimlines("Obsid $", 6, 1)).toBe("Obsid ");
+ expect(trimlines("Obsidian", 6, 1)).toBe("Obsidi");
+ expect(trimlines("Obsi\n$", 6, 1)).toBe("Obsi");
+ expect(trimlines("\n\n\n\n\n\n", 6, 1)).toBe("");
+});
|
Tuprules: fix ode path; | @@ -237,12 +237,12 @@ ifneq (@(CMAKE_DEPS),)
LDFLAGS_@(PHYSICS)_$(win32) += -L$(BUILD)/ode/$(CONFIG) -lode
LDFLAGS_@(PHYSICS)_$(macos) += -L$(BUILD)/ode -lode
LDFLAGS_@(PHYSICS)_$(linux) += -L$(BUILD)/ode -lode
- LDFLAGS_@(PHYSICS)_$(android) += -L$(BUILD)/lib/arm64-v8a -lode
+ LDFLAGS_@(PHYSICS)_$(android) += -L$(BUILD)/raw/lib/arm64-v8a -lode
LDFLAGS_@(PHYSICS)_$(web) += $(BUILD)/ode/libode.a
LIBS_@(PHYSICS)_$(win32) += $(BUILD)/ode/$(CONFIG)/ode.dll
LIBS_@(PHYSICS)_$(macos) += $(BUILD)/ode/libode.dylib
LIBS_@(PHYSICS)_$(linux) += $(BUILD)/ode/libode.so
- LIBS_@(PHYSICS)_$(android) += $(BUILD)/lib/arm64-v8a/libode.so
+ LIBS_@(PHYSICS)_$(android) += $(BUILD)/raw/lib/arm64-v8a/libode.so
# Oculus Audio
CFLAGS_@(OCULUS_AUDIO) += -I@(OCULUS_AUDIO_PATH)/Include
|
Docs/esp_netif: Make WiFi AP docs available only if enabled
Prepare support for ESP8684 | @@ -227,25 +227,37 @@ ESP-NETIF programmer's manual
Please refer to the example section for basic initialization of default interfaces:
+
- WiFi Station: :example_file:`wifi/getting_started/station/main/station_example_main.c`
-- WiFi Access Point: :example_file:`wifi/getting_started/softAP/main/softap_example_main.c`
+
- Ethernet: :example_file:`ethernet/basic/main/ethernet_example_main.c`
+.. only:: CONFIG_ESP_WIFI_SOFTAP_SUPPORT
+
+ - WiFi Access Point: :example_file:`wifi/getting_started/softAP/main/softap_example_main.c`
+
For more specific cases please consult this guide: :doc:`/api-reference/network/esp_netif_driver`.
WiFi default initialization
^^^^^^^^^^^^^^^^^^^^^^^^^^^
-The initialization code as well as registering event handlers for default interfaces, such as softAP and station, are provided in two separate APIs to facilitate simple startup code for most applications:
+The initialization code as well as registering event handlers for default interfaces, such as softAP and station, are provided in separate APIs to facilitate simple startup code for most applications:
-* :cpp:func:`esp_netif_create_default_wifi_ap()`
* :cpp:func:`esp_netif_create_default_wifi_sta()`
+.. only:: CONFIG_ESP_WIFI_SOFTAP_SUPPORT
+
+ * :cpp:func:`esp_netif_create_default_wifi_ap()`
+
Please note that these functions return the ``esp_netif`` handle, i.e. a pointer to a network interface object allocated and configured with default settings, which as a consequence, means that:
* The created object has to be destroyed if a network de-initialization is provided by an application using :cpp:func:`esp_netif_destroy_default_wifi()`.
+
* These *default* interfaces must not be created multiple times, unless the created handle is deleted using :cpp:func:`esp_netif_destroy()`.
+
+.. only:: CONFIG_ESP_WIFI_SOFTAP_SUPPORT
+
* When using Wifi in ``AP+STA`` mode, both these interfaces has to be created.
|
Update macro names | @@ -149,7 +149,7 @@ psa_status_t psa_driver_wrapper_sign_message(
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
- case PSA_CRYPTO_TEST_DRIVER_LIFETIME:
+ case PSA_CRYPTO_TEST_DRIVER_LOCATION:
return( mbedtls_test_opaque_signature_sign_message(
attributes,
key_buffer,
@@ -250,7 +250,7 @@ psa_status_t psa_driver_wrapper_verify_message(
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
- case PSA_CRYPTO_TEST_DRIVER_LIFETIME:
+ case PSA_CRYPTO_TEST_DRIVER_LOCATION:
return( mbedtls_test_opaque_signature_verify_message(
attributes,
key_buffer,
|
wireless/bluetooth/btsak/btsak_security.c: Fix newline character
Inspired by Abdelatif's find, here are other cases where /n was used when \n ws intended | @@ -132,7 +132,7 @@ void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
if (argc < 2)
{
- fprintf(stderr, "ERROR: Missing required arguments/n");
+ fprintf(stderr, "ERROR: Missing required arguments\n");
btsak_security_showusage(btsak->progname, argv[0], EXIT_FAILURE);
}
@@ -145,7 +145,7 @@ void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
if (argc < 4)
{
- fprintf(stderr, "ERROR: Missing required arguments/n");
+ fprintf(stderr, "ERROR: Missing required arguments\n");
btsak_security_showusage(btsak->progname, argv[0], EXIT_FAILURE);
}
@@ -157,7 +157,7 @@ void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
ret = btsak_str2addr(argv[1], btreq.btr_secaddr.val);
if (ret < 0)
{
- fprintf(stderr, "ERROR: Invalid address string: %s/n", argv[1]);
+ fprintf(stderr, "ERROR: Invalid address string: %s\n", argv[1]);
btsak_security_showusage(btsak->progname, argv[0], EXIT_FAILURE);
}
@@ -166,7 +166,7 @@ void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
ret = btsak_str2addrtype(argv[2], &btreq.btr_secaddr.type);
if (ret < 0)
{
- fprintf(stderr, "ERROR: Invalid address type: %s/n", argv[2]);
+ fprintf(stderr, "ERROR: Invalid address type: %s\n", argv[2]);
btsak_security_showusage(btsak->progname, argv[0], EXIT_FAILURE);
}
|
chat-fe: copy patp to clipboard on author name click | @@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { Sigil } from '/components/lib/icons/sigil';
import classnames from 'classnames';
import { Route, Link } from 'react-router-dom'
-import { uxToHex, cite } from '/lib/util';
+import { uxToHex, cite, writeText } from '/lib/util';
import urbitOb from 'urbit-ob';
import moment from 'moment';
import _ from 'lodash';
@@ -181,7 +181,15 @@ export class Message extends Component {
<div className="hide-child" style={paddingTop}>
<p className="v-mid f9 gray2 dib mr3 c-default">
<span
- className={contact.nickname ? null : "mono"}
+ className={"pointer " + (contact.nickname ? null : "mono")}
+ ref="author"
+ onClick={() => {
+ writeText(props.msg.author);
+ this.refs.author.innerText = "Copied";
+ setTimeout(() => {
+ this.refs.author.innerText = name;
+ }, 800);
+ }}
title={`~${props.msg.author}`}>
{name}
</span>
|
'Text Search Dictionaries': Correct output | @@ -370,17 +370,17 @@ ALTER TEXT SEARCH CONFIGURATION russian
<codeblock>SELECT plainto_tsquery('supernova star');
plainto_tsquery
-----------------
- 'sn'
+ 'supernova' & 'star'
SELECT to_tsvector('supernova star');
to_tsvector
-------------
- 'sn':1</codeblock>
+ 'star':2 'supernova':1</codeblock>
<p>In principle, one can use <codeph>to_tsquery</codeph> if you quote the argument:</p>
<codeblock>SELECT to_tsquery('''supernova star''');
to_tsquery
------------
- 'sn'</codeblock>
+ 'supernova' & 'star'</codeblock>
<p>Notice that <codeph>supernova star</codeph> matches <codeph>supernovae stars</codeph> in
<codeph>thesaurus_astro</codeph> because we specified the <codeph>english_stem</codeph>
stemmer in the <codeph>thesaurus</codeph> definition. The stemmer removed the
@@ -392,7 +392,7 @@ SELECT to_tsvector('supernova star');
SELECT plainto_tsquery('supernova star');
plainto_tsquery
-----------------------------
- 'sn' & 'supernova' & 'star'</codeblock>
+ 'supernova' & 'star'</codeblock>
</sectiondiv>
</section>
<section id="ispell">
|
Fix controller cleanup
After commit the controller
was not stopped and destroyed on quit. | @@ -364,10 +364,12 @@ scrcpy(const struct scrcpy_options *options) {
if (!controller_init(&controller, server.control_socket)) {
goto end;
}
+ controller_initialized = true;
if (!controller_start(&controller)) {
goto end;
}
+ controller_started = true;
}
if (!screen_init_rendering(&screen, device_name, frame_size,
|
Remove discussion of non-public guidelines until they're public | @@ -75,8 +75,3 @@ appropriate include:
For example, Windows requires [`closesocket()`](https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-closesocket)
to close a socket rather than the POSIX `close()` API.
Hence this reference should be consulted for discussion of "standard" APIs.
-
-* (Microsoft-internal only) [Win32 API Design Guidelines](https://osgwiki.com/wiki/Win32_API_Design_Guidelines):
- Although this reference is only accessible to Microsoft employees, it does
- contain some useful design guidance for C APIs, such as the
- [recommendation against call-twice APIs](https://osgwiki.com/wiki/Win32_API_Design_Guidelines#Designing_variable-sized_out_parameters).
|
dialog/da1469x: Fix array pointer re-referencing bug
Register trim values from OTP were not being applied. Upon inspection it
was found that da1469x_pd_apply_trimv() was improperly assigning 'reg' to the
address of 'trimv_words[idx *2]'.
With this fix the OTP register values appear to be properly applied. | @@ -96,7 +96,7 @@ da1469x_pd_apply_trimv(uint8_t pd)
}
for (idx = 0; idx < pdd->trimv_count; idx++) {
- reg = &pdd->trimv_words[idx * 2];
+ reg = (uint32_t *) pdd->trimv_words[idx * 2];
val = pdd->trimv_words[idx * 2 + 1];
*reg = val;
}
|
Improve usage text for test_gpdb.sh - including options. | @@ -198,7 +198,7 @@ upgrade_segment()
usage()
{
appname=`basename $0`
- echo "usage: $appname -o <dir> -b <dir>"
+ echo "usage: $appname -o <dir> -b <dir> [options]"
echo " -o <dir> Directory containing old datadir"
echo " -b <dir> Directory containing binaries"
echo " -s Run smoketest only"
|
st_perf: fix duplicate execution
If val is function then val will be called twice because val is
executed for log in printf. If function uses shared variables inside
then return value from it might be differed. So stored function value
to tmp_val and reuse it's value when print log. | @@ -180,29 +180,32 @@ void perf_set_keeprunning(int enable);
* Expect?
*/
-#define ST_EXPECT_EQ(val, exp) \
+#define ST_EXPECT_EQ(exp, val) \
do { \
- if (exp != val) { \
- printf("\t[ERROR] val (%d) exp (%d)\n", val, exp); \
+ uint32_t tmp_val = val; \
+ if (exp != tmp_val) { \
+ printf("\t[ERROR] val (%d) exp (%d)\n", tmp_val, exp); \
printf("\t %s\t%s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
st_res = STRESS_TC_FAIL; \
goto STFUNC_OUT; \
} \
} while (0)
-#define ST_ASSERT_EQ(val, exp) \
+#define ST_ASSERT_EQ(exp, val) \
do { \
- if (exp != val) { \
- printf("\t[ERROR] val (%d) exp (%d)\n", val, exp); \
+ uint32_t tmp_val = val; \
+ if (exp != tmp_val) { \
+ printf("\t[ERROR] val (%d) exp (%d)\n", tmp_val, exp); \
printf("\t %s\t%s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
assert(0); \
} \
} while (0)
-#define ST_ASSERT_NEQ(val, exp) \
+#define ST_ASSERT_NEQ(exp, val) \
do { \
- if (exp == val) { \
- printf("\t[ERROR] val (%d) exp (%d)\n", val, exp); \
+ uint32_t tmp_val = val; \
+ if (exp == tmp_val) { \
+ printf("\t[ERROR] val (%d) exp (%d)\n", tmp_val, exp); \
printf("\t %s\t%s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
assert(0); \
} \
|
add BOX_T_SCALE but disable for now | #define BOX_CONE_MAX_ITERS (25)
#define POW_CONE_MAX_ITERS (20)
+/* In the box cone projection we penalize the `t` term additionally by this
+ * factor. This encourages the `t` term to stay close to the incoming `t` term,
+ * which should provide better convergence since typically the `t` term does
+ * not appear in the linear system other than `t = 1`. Setting to 1 is
+ * the vanilla projection.
+ */
+#define BOX_T_SCALE (1.)
+
/* Box cone limits (+ or -) taken to be INF */
#define MAX_BOX_VAL (1e15)
@@ -34,8 +42,8 @@ void SCS(set_rho_y_vec)(const ScsCone *k, scs_float scale, scs_float *rho_y_vec,
scs_int i, count = 0;
/* f cone */
for (i = 0; i < k->z; ++i) {
- /* set rho_y small for z, similar to rho_x term, since z is primal zero
- * cone, this effectively decreases penalty on those entries
+ /* set rho_y small for z, similar to rho_x term, since z corresponds to
+ * dual free cone, this effectively decreases penalty on those entries
* and lets them be determined almost entirely by the linear system solve
*/
rho_y_vec[i] = 1.0 / (1000. * scale);
@@ -45,10 +53,16 @@ void SCS(set_rho_y_vec)(const ScsCone *k, scs_float scale, scs_float *rho_y_vec,
for (i = count; i < m; ++i) {
rho_y_vec[i] = 1.0 / scale;
}
+
/* Note, if updating this to use different scales for other cones (e.g. box)
* then you must be careful to also include the effect of the rho_y_vec
- * in the actual projection operator.
+ * in the cone projection operator.
*/
+
+ /* Increase rho_y_vec for the t term in the box cone */
+ if (k->bsize) {
+ rho_y_vec[k->z + k->l] *= BOX_T_SCALE;
+ }
}
static inline scs_int get_sd_cone_size(scs_int s) {
@@ -672,8 +686,9 @@ static scs_float proj_box_cone(scs_float *tx, const scs_float *bl,
/* should only require about 5 or so iterations, 1 or 2 if warm-started */
for (iter = 0; iter < BOX_CONE_MAX_ITERS; iter++) {
t_prev = t;
- gt = t - tx[0]; /* gradient */
- ht = 1.; /* hessian */
+ /* incorporate the additional BOX_T_SCALE factor into the projection */
+ gt = BOX_T_SCALE * (t - tx[0]); /* gradient */
+ ht = BOX_T_SCALE; /* hessian */
for (j = 0; j < bsize - 1; j++) {
if (x[j] > t * bu[j]) {
gt += (t * bu[j] - x[j]) * bu[j]; /* gradient */
|
OpenXR: rm visibility mask;
Haven't found a runtime that supports it yet. | @@ -86,7 +86,6 @@ EGLConfig lovrPlatformGetEGLConfig(void);
X(xrGetActionStateFloat)\
X(xrSyncActions)\
X(xrApplyHapticFeedback)\
- X(xrGetVisibilityMaskKHR)\
X(xrCreateHandTrackerEXT)\
X(xrDestroyHandTrackerEXT)\
X(xrLocateHandJointsEXT)
@@ -124,7 +123,6 @@ static struct {
XrHandTrackerEXT handTrackers[2];
struct {
bool handTracking;
- bool visibilityMask;
} features;
} state;
@@ -192,11 +190,6 @@ static bool openxr_init(float offset, uint32_t msaa) {
state.features.handTracking = true;
}
- if (hasExtension(extensions, extensionCount, XR_KHR_VISIBILITY_MASK_EXTENSION_NAME)) {
- enabledExtensionNames[enabledExtensionCount++] = XR_KHR_VISIBILITY_MASK_EXTENSION_NAME;
- state.features.visibilityMask = true;
- }
-
free(extensions);
XrInstanceCreateInfo info = {
|
ixfr-out, fix ixfr create rename files for more than two files. | @@ -886,6 +886,7 @@ static int ixfr_create_rename_files(const char* zname, const char* zfile)
while(ixfr_file_exists(zfile, num)) {
if(!ixfr_rename_it(zname, zfile, num, 0, num+1, 0))
return 0;
+ num++;
}
return 1;
}
|
oops... fix protocol and `fd` data locking issue (caused by my latest commit) | @@ -64,8 +64,10 @@ inline static protocol_s *protocol_try_lock(intptr_t fd,
errno = EBADF;
return NULL;
}
- if (spn_trylock(&prt_meta(pr).locks[type]))
+ if (spn_trylock(&prt_meta(pr).locks[type])) {
+ spn_unlock(&fd_data(fd).lock);
goto would_block;
+ }
spn_unlock(&fd_data(fd).lock);
return pr;
would_block:
|
libhfuzz: add a flag to disable addr checks in HF_cmphash | __attribute__((visibility("hidden"))) __attribute__((used))
const char* const LIBHFUZZ_module_memorycmp = "LIBHFUZZ_module_memorycmp";
+/*
+ * util_getProgAddr() check is quite costly, and it lowers the fuzzing speed typically by a factor
+ * of 2, but keep it true for now
+ */
+#define HF_TEST_ADDR_CMPHASH true
+
static inline uintptr_t HF_cmphash(uintptr_t addr, const void* s1, const void* s2) {
- if (util_getProgAddr(s1) == LHFC_ADDR_RO) {
+ if (HF_TEST_ADDR_CMPHASH && util_getProgAddr(s1) == LHFC_ADDR_RO) {
addr ^= ((uintptr_t)s1 << 2);
}
- if (util_getProgAddr(s2) == LHFC_ADDR_RO) {
+ if (HF_TEST_ADDR_CMPHASH && util_getProgAddr(s2) == LHFC_ADDR_RO) {
addr ^= ((uintptr_t)s2 << 4);
}
return addr;
|
For the sake of security, we now enable this flag by default. | * Some Megadrive models (as 2016 Tectoy Megadrive) need it to prevent some possible 68000 memory or Z80 corruption bugs
* (may happen when Z80 access the main BUS during a DMA operation).
*/
-#define HALT_Z80_ON_DMA 0
+#define HALT_Z80_ON_DMA 1
/**
* \brief
|
Specify bounds checking. | @@ -1384,8 +1384,8 @@ TABLE OF CONTENTS:
`idx`th value in the sequence is referred to. This expression
produces an lvalue.
- If `idx` is larger than `expr.len`, then the program must
- terminate.
+ If `idx` is larger than `expr.len` or smaller than 0, then the
+ program must terminate.
Type:
@@ -1404,6 +1404,9 @@ TABLE OF CONTENTS:
If the lower bound is omitted, then it is implicitly zero. If the
upper bound is ommitted, then it is implicitly `expr.len`.
+ If the bounds are not fully contained within the slice being
+ indexed, the program must terminate.
+
Type:
(expr : @a[N])[(lo : @lo) : (hi : @hi)] : @a[:]
|
cpeng: change default CLI arg values
* cpeng: change default CLI args
* Change destination offset to the correct offset in memory where the
HPS boot will look for the image at
* Change to timeout to a smaller value
* Change default image name to kernel.itb | @@ -38,19 +38,21 @@ const char *cpeng_guid = "44bfc10d-b42a-44e5-bd42-57dc93ea7f91";
using opae::fpga::types::shared_buffer;
using opae_exception = opae::fpga::types::exception;
using usec = std::chrono::microseconds;
+using msec = std::chrono::milliseconds;
const size_t pg_size = sysconf(_SC_PAGESIZE);
constexpr size_t MB(uint32_t count) {
return count * 1024 * 1024;
}
+const usec default_timeout_usec(msec(10));
class cpeng : public opae::afu_test::command
{
public:
cpeng()
- : filename_("hps.img")
- , destination_offset_(0)
- , timeout_usec_(60000000)
+ : filename_("kernel.itb")
+ , destination_offset_(0x2000000)
+ , timeout_usec_(default_timeout_usec.count())
, chunk_(pg_size)
, soft_reset_(false)
{
|
hcxdumptool new option | +15.09.2020
+==========
+hcxdumptool: added new option
+--stop_client_m2_attacks=<digit> : stop attacks against CLIENTS after 10 M2 frames received
+ affected: ap-less (EAPOL 2/4 - M2) attack
+ require hcxpcangtool --all option
+
+
24.08.2020
==========
hcxdumptool: added new option
|
SOVERSION bump to version 2.13.4 | @@ -67,7 +67,7 @@ set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_
# set version of the library
set(LIBYANG_MAJOR_SOVERSION 2)
set(LIBYANG_MINOR_SOVERSION 13)
-set(LIBYANG_MICRO_SOVERSION 3)
+set(LIBYANG_MICRO_SOVERSION 4)
set(LIBYANG_SOVERSION_FULL ${LIBYANG_MAJOR_SOVERSION}.${LIBYANG_MINOR_SOVERSION}.${LIBYANG_MICRO_SOVERSION})
set(LIBYANG_SOVERSION ${LIBYANG_MAJOR_SOVERSION})
|
Makefile: make internal comment in doc Makefile silent
There is a comment in the doc/Makefile that is beinhg spit out
when calling 'make clean'. This is harmless but can be confusing
to users so let's make it silent. | @@ -68,7 +68,7 @@ singlehtml: doxy content kconfig
clean:
rm -fr $(BUILDDIR)
- # Keeping these temporarily, but no longer strictly needed.
+ @# Keeping these temporarily, but no longer strictly needed.
rm -fr doxygen
rm -fr misc
rm -fr reference/kconfig/*.rst
|
cborattr; remove unused field from cbor_attr_t. | @@ -33,7 +33,7 @@ extern "C" {
#endif
/* This library wraps the tinycbor decoder with a attribute based decoder
- * suitable for decoding a binary version of json. Specificallly, the
+ * suitable for decoding a binary version of json. Specifically, the
* contents of the cbor contains pairs of attributes. where the attribute
* is a key/value pair. keys are always text strings, but values can be
* many different things (enumerated below) */
@@ -117,7 +117,6 @@ struct cbor_attr_t {
float fval;
} dflt;
size_t len;
- const struct json_enum_t *map;
bool nodefault;
};
|
Enable address sanitizer when building YARA in Travis-CI. | @@ -5,7 +5,7 @@ matrix:
- os: linux
dist: trusty
sudo: required
- env: CONFIGFLAGS="CFLAGS=-m64 --enable-cuckoo --enable-magic"
+ env: CONFIGFLAGS="CFLAGS=-m64 --enable-cuckoo --enable-magic --enable-address-sanitizer"
# The certificate for scan.coverity.com is too new and is not recognized by
# wget. This command adds the certificate to /etc/ssl/certs/ca-certificates.crt
# See: https://github.com/travis-ci/travis-ci/issues/6142
|
Subsets and Splits