message
stringlengths
6
474
diff
stringlengths
8
5.22k
prov: update cmac to have additional init arguments
@@ -102,22 +102,28 @@ static size_t cmac_size(void *vmacctx) return EVP_CIPHER_CTX_block_size(CMAC_CTX_get0_cipher_ctx(macctx->ctx)); } -static int cmac_init(void *vmacctx) +static int cmac_setkey(struct cmac_data_st *macctx, + const unsigned char *key, size_t keylen) { - struct cmac_data_st *macctx = vmacctx; - int rv; - - if (!ossl_prov_is_running()) - return 0; - - rv = CMAC_Init(macctx->ctx, NULL, 0, + int rv = CMAC_Init(macctx->ctx, key, keylen, ossl_prov_cipher_cipher(&macctx->cipher), ossl_prov_cipher_engine(&macctx->cipher)); - ossl_prov_cipher_reset(&macctx->cipher); return rv; } +static int cmac_init(void *vmacctx, const unsigned char *key, + size_t keylen, const OSSL_PARAM params[]) +{ + struct cmac_data_st *macctx = vmacctx; + + if (!ossl_prov_is_running() || !cmac_set_ctx_params(macctx, params)) + return 0; + if (key != NULL) + return cmac_setkey(macctx, key, keylen); + return 1; +} + static int cmac_update(void *vmacctx, const unsigned char *data, size_t datalen) { @@ -184,13 +190,7 @@ static int cmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[]) if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL) { if (p->data_type != OSSL_PARAM_OCTET_STRING) return 0; - - if (!CMAC_Init(macctx->ctx, p->data, p->data_size, - ossl_prov_cipher_cipher(&macctx->cipher), - ossl_prov_cipher_engine(&macctx->cipher))) - return 0; - - ossl_prov_cipher_reset(&macctx->cipher); + return cmac_setkey(macctx, p->data, p->data_size); } return 1; }
host/mesh: logging public key in big endian Local public key has been logged in little endian but remote public key in big endian. That has been changed. Both are logged in big endian to be able to compare in logs. This is port of
@@ -248,14 +248,14 @@ static void send_pub_key(void) return; } - BT_DBG("Local Public Key: %s", bt_hex(key, BT_PUB_KEY_LEN)); - bt_mesh_prov_buf_init(buf, PROV_PUB_KEY); /* Swap X and Y halves independently to big-endian */ sys_memcpy_swap(net_buf_simple_add(buf, BT_PUB_KEY_COORD_LEN), key, BT_PUB_KEY_COORD_LEN); sys_memcpy_swap(net_buf_simple_add(buf, BT_PUB_KEY_COORD_LEN), &key[BT_PUB_KEY_COORD_LEN], 32); + BT_DBG("Local Public Key: %s", bt_hex(buf->om_data + 1, BT_PUB_KEY_LEN)); + /* PublicKeyDevice */ memcpy(bt_mesh_prov_link.conf_inputs.pub_key_device, &buf->om_data[1], PDU_LEN_PUB_KEY);
fixup fd leakage in libtcmu_config.c
@@ -371,13 +371,12 @@ int tcmu_load_config(struct tcmu_config *cfg, const char *path) } len = tcmu_read_config(fd, buf, TCMU_MAX_CFG_FILE_SIZE); + close(fd); if (len < 0) { tcmu_err("Failed to read file '%s'\n", path); return -1; } - close(fd); - buf[len] = '\0'; tcmu_parse_options(cfg, buf, len);
revise tls page per reviews
@@ -6,8 +6,8 @@ title: TLS AppScope supports TLS over TCP connections: +- AppScope can use TLS when connecting to LogStream or another application (including its events and metrics destinations). - LogStream can use TLS when connecting to AppScope over TCP. -- AppScope can use TLS when connecting to LogStream or another application. To see the TLS-related environment variables, run the command: `ldscope --help configuration | grep TLS` @@ -15,11 +15,11 @@ In the `scope.yml` config file, the `transport` definition includes an optional ## Using TLS in Cribl.Cloud -In Cribl.Cloud, AppScope can communicate with LogStream either using TLS (the default), or in cleartext. +In Cribl.Cloud, when communicating with LogStream, AppScope uses TLS by default. -Within Cribl.Cloud, a front-end load balancer (reverse proxy) handles the encrypted TLS traffic and relays it to the AppScope Source port in LogStream. The connection from the load balancer to LogStream does *not* use TLS, and you should not enable TLS on the AppScope Source in LogStream. +Within Cribl.Cloud, a front-end load balancer (reverse proxy) handles the encrypted TLS traffic and relays it to the AppScope Source port in LogStream. The connection from the load balancer to LogStream does *not* use TLS, and you should not enable TLS on the AppScope Source in LogStream. No changes in LogStream configuration are needed. -In Cribl.Cloud the Ingest Endpoint uses port 10090 for TLS and port 10091 for cleartext. +AppScope connects to port 10090 of the Cribl.Cloud Ingest Endpoint. Use the tenant hostname you were assigned when you joined Cribl.Cloud. ### CLI usage @@ -29,7 +29,7 @@ Use scope with the `-c` option: scope -c tls://host:10090 ``` -### `LD_PRELOAD` or `ldscope` +### Configuration for `LD_PRELOAD` or `ldscope` To connect AppScope to a LogStream Cloud instance using TLS: @@ -51,8 +51,10 @@ cribl: cacertpath: '' ``` -To connect AppScope to a LogStream Cloud instance *without* TLS: +## Scoping Without TLS -1. Disable the `tls` element in `scope.yml` -1. Connect to port 10091 on your Cribl.Cloud Ingest Endpoint +If you prefer to communicate in cleartext, connect to port 10091 instead of port 10090. +If it is enabled, disable the `tls` element in `scope.yml`. + +If connecting to LogStream in Cribl.Cloud, no changes in LogStream configuration are needed.
make =| print as =|, not ;;
[%mcnt *] (rune ';/' ~ ~ (hoons ~[p]:x)) [%mcsg *] (rune ';~' `'==' ~ (hoons [p q]:x)) [%mcmc *] (rune ';;' ~ ~ (hoons ~[p q]:x)) - [%tsbr *] (rune ';;' ~ ~ ~[(spec p.x) (hn q.x)]) + [%tsbr *] (rune '=|' ~ ~ ~[(spec p.x) (hn q.x)]) [%tscl *] (tiscol-to-plum p.x q.x) [%tsnt *] (rune '=/' ~ ~ (skin p.x) (hn q.x) (hn r.x) ~) [%tsmc *] (rune '=;' ~ ~ [(skin p.x) (hoons ~[q r]:x)])
UI documentation fixup
=head1 NAME UI_UTIL_read_pw_string, UI_UTIL_read_pw, -*UI_UTIL_wrap_read_pem_callback - user interface utilities +UI_UTIL_wrap_read_pem_callback - user interface utilities =head1 SYNOPSIS @@ -13,8 +13,7 @@ UI_UTIL_read_pw_string, UI_UTIL_read_pw, int verify); int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, int verify); - UI_METHOD *UI_UTIL_wrap_read_pem_callback(pem_password_cb *cb, int - rwflag); + UI_METHOD *UI_UTIL_wrap_read_pem_callback(pem_password_cb *cb, int rwflag); =head1 DESCRIPTION
Change identifier name
@@ -87,7 +87,7 @@ FORMS = [ ('v', 'i', '_mask') ] -BINOPS = [ +INSTRUCTIONS = [ ('or', False, lambda a, b: (a | b) & 0xffffffff), ('and', False, lambda a, b: (a & b) & 0xffffffff), ('xor', False, lambda a, b: (a ^ b) & 0xffffffff), @@ -112,7 +112,7 @@ print('# This file auto-generated by ' + sys.argv[0] + '''. Do not edit. .globl _start _start:''') -for mnemonic, is_unary, func in BINOPS: +for mnemonic, is_unary, func in INSTRUCTIONS: for op1type, op2type, suffix in FORMS: if op2type == 'i' and is_unary: continue
hardware: remove define error
#include "target.h" -#ifdef STM32F4 - #ifdef STM32F411 #define SYS_CLOCK_FREQ_HZ 108000000 #define PWM_CLOCK_FREQ_HZ 108000000 #endif -#if defined(STM32F411) && defined(STM32F405) -#error "multiple chip types (STM32F411, STM32F405) defined!" -#endif - -#endif - #ifdef STM32F7 - #define SYS_CLOCK_FREQ_HZ 216000000 #define PWM_CLOCK_FREQ_HZ 216000000 #define SPI_CLOCK_FREQ_HZ (SYS_CLOCK_FREQ_HZ / 4) #define WITHIN_DTCM_RAM(p) (((uint32_t)p & 0xffff0000) == 0x20000000) #define WITHIN_DMA_RAM(p) (false) - #endif #ifdef STM32H7 - #define SYS_CLOCK_FREQ_HZ 480000000 #define PWM_CLOCK_FREQ_HZ (SYS_CLOCK_FREQ_HZ / 2) #define SPI_CLOCK_FREQ_HZ (SYS_CLOCK_FREQ_HZ / 4) #define WITHIN_DTCM_RAM(p) (((uint32_t)p & 0xfffe0000) == 0x20000000) #define WITHIN_DMA_RAM(p) (((uint32_t)p & 0xfffe0000) == 0x30000000) - #endif #ifdef USE_FAST_RAM
py/bitbox02: bump min/max supported version to only allow v8.0.0
@@ -144,10 +144,10 @@ OP_NOISE_MSG = b"n" RESPONSE_SUCCESS = b"\x00" RESPONSE_FAILURE = b"\x01" -MIN_SUPPORTED_BITBOX02_MULTI_FIRMWARE_VERSION = semver.VersionInfo(6, 1, 0) -MIN_SUPPORTED_BITBOX02_BTCONLY_FIRMWARE_VERSION = semver.VersionInfo(6, 1, 0) -MIN_UNSUPPORTED_BITBOX02_MULTI_FIRMWARE_VERSION = semver.VersionInfo(8, 0, 0) -MIN_UNSUPPORTED_BITBOX02_BTCONLY_FIRMWARE_VERSION = semver.VersionInfo(8, 0, 0) +MIN_SUPPORTED_BITBOX02_MULTI_FIRMWARE_VERSION = semver.VersionInfo(8, 0, 0) +MIN_SUPPORTED_BITBOX02_BTCONLY_FIRMWARE_VERSION = semver.VersionInfo(8, 0, 0) +MIN_UNSUPPORTED_BITBOX02_MULTI_FIRMWARE_VERSION = semver.VersionInfo(9, 0, 0) +MIN_UNSUPPORTED_BITBOX02_BTCONLY_FIRMWARE_VERSION = semver.VersionInfo(9, 0, 0) class Platform(enum.Enum):
OCSP_sendreq_bio: Avoid doublefree of mem BIO
@@ -58,13 +58,11 @@ OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req) if (ctx == NULL) return NULL; mem = OSSL_HTTP_REQ_CTX_exchange(ctx); - resp = (OCSP_RESPONSE *) - ASN1_item_d2i_bio(ASN1_ITEM_rptr(OCSP_RESPONSE), mem, NULL); - BIO_free(mem); + /* ASN1_item_d2i_bio handles NULL bio gracefully */ + resp = (OCSP_RESPONSE *)ASN1_item_d2i_bio(ASN1_ITEM_rptr(OCSP_RESPONSE), + mem, NULL); - /* this indirectly calls ERR_clear_error(): */ OSSL_HTTP_REQ_CTX_free(ctx); - return resp; } #endif /* !defined(OPENSSL_NO_OCSP) */
experiment with commit strategy on macOS
@@ -715,7 +715,7 @@ static bool mi_os_commitx(void* addr, size_t size, bool commit, bool conservativ } #elif defined(__wasi__) // WebAssembly guests can't control memory protection - #elif defined(MAP_FIXED) + #elif defined(MAP_FIXED) && !defined(__APPLE__) if (!commit) { // use mmap with MAP_FIXED to discard the existing memory (and reduce commit charge) const int fd = mi_unix_mmap_fd();
usb_pd_alt_mode_dfp: Move pd_set_svids_discovery Place it next to the other SVIDs accessor functions. TEST=make buildall BRANCH=none
@@ -442,15 +442,6 @@ void pd_set_identity_discovery(int port, enum tcpm_transmit_type type, pd->identity_discovery = disc; } -void pd_set_svids_discovery(int port, enum tcpm_transmit_type type, - enum pd_discovery_state disc) -{ - struct pd_discovery *pd = pd_get_am_discovery(port, type); - - pd->svids_discovery = disc; -} - - enum pd_discovery_state pd_get_identity_discovery(int port, enum tcpm_transmit_type type) { @@ -492,6 +483,14 @@ uint8_t pd_get_product_type(int port) return resp->idh.product_type; } +void pd_set_svids_discovery(int port, enum tcpm_transmit_type type, + enum pd_discovery_state disc) +{ + struct pd_discovery *pd = pd_get_am_discovery(port, type); + + pd->svids_discovery = disc; +} + enum pd_discovery_state pd_get_svids_discovery(int port, enum tcpm_transmit_type type) {
buffers: fix vlib_buffer_free_no_next Type: fix Fixes:
@@ -838,7 +838,7 @@ vlib_buffer_free_inline (vlib_main_t * vm, u32 * buffers, u32 n_buffers, n_queue = 0; } - if (flags & VLIB_BUFFER_NEXT_PRESENT) + if (maybe_next && (flags & VLIB_BUFFER_NEXT_PRESENT)) { bi = next; goto next_in_chain;
Fix error when passing objects as thread arguments;
@@ -230,8 +230,7 @@ void _luax_pushtype(lua_State* L, const char* type, uint64_t hash, void* object) // Allocate userdata Proxy* p = (Proxy*) lua_newuserdata(L, sizeof(Proxy)); - luaL_getmetatable(L, type); - lovrAssert(lua_istable(L, -1), "Unknown type '%s' (maybe its module needs to be required)", type); + luaL_newmetatable(L, type); lua_setmetatable(L, -2); lovrRetain(object); p->object = object;
Update adc.c check fun is NULL, error
@@ -46,7 +46,7 @@ static rt_err_t _adc_control(rt_device_t dev, int cmd, void *args) rt_err_t result = RT_EOK; rt_adc_device_t adc = (struct rt_adc_device *)dev; - if (adc->ops->enabled != RT_NULL) + if (adc->ops->enabled == RT_NULL) { return -RT_ENOSYS; }
if color representation is not valid use RGBA
@@ -1975,6 +1975,8 @@ OutputGeometryPart::computeMesh( MFnMesh::MColorRepresentation colorRep = MFnMesh::MColorRepresentation::kRGBA; if(useColorRep) { if(layerIndex < (int) colorReps.length()) + if(colorReps[layerIndex] == MFnMesh::MColorRepresentation::kRGB + || colorReps[layerIndex] == MFnMesh::MColorRepresentation::kAlpha) colorRep = (MFnMesh::MColorRepresentation) colorReps[layerIndex]; } #endif
acl-plugin: remove the clib_warning "ACL enabling..." It was useful for debugging once upon a time... but time to say goodbye to it... Also remove the warning printed when sending ACL details.
@@ -563,9 +563,6 @@ acl_hook_l2_input_classify (acl_main_t * am, u32 sw_if_index) rv = vnet_l2_input_classify_set_tables (sw_if_index, ip4_table_index, ip6_table_index, ~0); - clib_warning - ("ACL enabling on interface sw_if_index %d, setting tables to the following: ip4: %d ip6: %d\n", - sw_if_index, ip4_table_index, ip6_table_index); if (rv) { acl_classify_add_del_table_tiny (cm, ip6_5tuple_mask, @@ -1499,7 +1496,6 @@ send_acl_details (acl_main_t * am, unix_shared_memory_queue_t * q, copy_acl_rule_to_api_rule (&rules[i], &acl->rules[i]); } - clib_warning("Sending acl details for ACL index %d", ntohl(mp->acl_index)); clib_mem_set_heap (oldheap); vl_msg_api_send_shmem (q, (u8 *) & mp); }
update arm docker tag #no_auto_pr
@@ -257,7 +257,7 @@ make dist-python PYPI_USERNAME=swiftnav PYPI_PASSWORD=... The Linux ARM build of libsbp can be done through docker via the following set of commands: ``` -docker run -v libsbp-arm-root:/root -v $PWD:/work --rm -it swiftnav/libsbp-arm:2020.05.07 libsbp-arm /bin/bash +docker run -v libsbp-arm-root:/root -v $PWD:/work --rm -it swiftnav/libsbp-arm:2020.09.15 libsbp-arm /bin/bash cd /work make dist-python PYPI_USERNAME=swiftnav PYPI_PASSWORD=... ```
hoon: add +lure, for turning a singleton into a list
|* [a=(list) b=*] (weld a ^+(a [b]~)) :: +:: +lure: List pURE +++ lure + |* a=* + [i=a t=~] +:: ++ fand :: all indices ~/ %fand |= [nedl=(list) hstk=(list)]
lib: use new coro init api
#include <fluent-bit/flb_filter.h> #include <fluent-bit/flb_utils.h> #include <fluent-bit/flb_time.h> +#include <fluent-bit/flb_coro.h> #include <fluent-bit/flb_callback.h> #include <signal.h> @@ -105,7 +106,7 @@ static inline struct flb_filter_instance *filter_instance_get(flb_ctx_t *ctx, void flb_init_env() { - flb_coro_prepare(); + flb_coro_init(); flb_output_prepare(); }
* Added no-format-truncation CC flag
@@ -109,6 +109,7 @@ list(APPEND PUB_HDRS ${CMAKE_CURRENT_SOURCE_DIR}/ejdb2.h set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -fsigned-char -pedantic -Wfatal-errors -Wall -Wextra \ -Wno-sign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-function \ + -Wno-format-truncation \ -Wno-missing-field-initializers -Wno-missing-braces -Wno-implicit-fallthrough \ ") if (NOT WIN32)
fix: reverts
@@ -14,7 +14,7 @@ json_escape_string (size_t * output_len_p, char * input, size_t input_len) /* * 1st iteration, output is NULL and count extra_bytes needed for escaping - * 2st iteration, output is not NULL, and does escaping. + * 2st iteration, output is not NULL, and does escaing. */ second_iter: for (char * s = input_start; s < input_end; s++) { @@ -154,7 +154,7 @@ next(char ** p, char * e, bool html) // Read the rest unsigned char tmp; - switch(trail_size) { // @todo this could be replaced by a while loop + switch(trail_size) { case 3: if(*p==e) return utf_illegal; @@ -163,7 +163,6 @@ next(char ** p, char * e, bool html) if (!utf8_is_trail(tmp)) return utf_illegal; c = (c << 6) | ( tmp & 0x3F); - /* fall through */ case 2: if(*p==e) return utf_illegal; @@ -172,7 +171,6 @@ next(char ** p, char * e, bool html) if (!utf8_is_trail(tmp)) return utf_illegal; c = (c << 6) | ( tmp & 0x3F); - /* fall through */ case 1: if(*p==e) return utf_illegal; @@ -327,6 +325,7 @@ second_iter: } break; default: + if(0<= c && c <= 0x1F) /* report errors */ goto return_err; } }
uart: cleaner way of handling error in a critical section Some critical sections have also been added, making the code more symetric accross the similar functions. Closes
@@ -258,7 +258,9 @@ esp_err_t uart_set_stop_bits(uart_port_t uart_num, uart_stop_bits_t stop_bit) esp_err_t uart_get_stop_bits(uart_port_t uart_num, uart_stop_bits_t *stop_bit) { ESP_RETURN_ON_FALSE((uart_num < UART_NUM_MAX), ESP_FAIL, UART_TAG, "uart_num error"); + UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock)); uart_hal_get_stop_bits(&(uart_context[uart_num].hal), stop_bit); + UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock)); return ESP_OK; } @@ -274,7 +276,9 @@ esp_err_t uart_set_parity(uart_port_t uart_num, uart_parity_t parity_mode) esp_err_t uart_get_parity(uart_port_t uart_num, uart_parity_t *parity_mode) { ESP_RETURN_ON_FALSE((uart_num < UART_NUM_MAX), ESP_FAIL, UART_TAG, "uart_num error"); + UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock)); uart_hal_get_parity(&(uart_context[uart_num].hal), parity_mode); + UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock)); return ESP_OK; } @@ -1338,17 +1342,19 @@ esp_err_t uart_flush_input(uart_port_t uart_num) } data = (uint8_t*) xRingbufferReceive(p_uart->rx_ring_buf, &size, (portTickType) 0); if(data == NULL) { + bool error = false; UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock)); if( p_uart_obj[uart_num]->rx_buffered_len != 0 ) { p_uart_obj[uart_num]->rx_buffered_len = 0; - UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock)); - // this must be called outside the critical section - ESP_LOGE(UART_TAG, "rx_buffered_len error"); - UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock)); + error = true; } //We also need to clear the `rx_buffer_full_flg` here. p_uart_obj[uart_num]->rx_buffer_full_flg = false; UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock)); + if (error) { + // this must be called outside the critical section + ESP_LOGE(UART_TAG, "rx_buffered_len error"); + } break; } UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
Fix handling of input for kdb_close
@@ -162,7 +162,7 @@ static ERL_NIF_TERM kdb_close (ErlNifEnv * env, int argc, const ERL_NIF_TERM arg } if (is_null_atom (env, argv[1])) { - handle_resource = NULL; + errorKey_resource = NULL; } else if (!enif_get_resource (env, argv[1], KEY_RESOURCE_TYPE, (void *) &errorKey_resource)) {
Tests: test_settings_header_read_timeout_update adjusted.
@@ -25,10 +25,11 @@ Connection: close self.assertEqual(resp['status'], 408, 'status header read timeout') - @unittest.expectedFailure def test_settings_header_read_timeout_update(self): self.load('empty') + r = None + self.conf({'http': { 'header_read_timeout': 4 }}, 'settings') (resp, sock) = self.http(b"""GET / HTTP/1.1 @@ -42,8 +43,12 @@ Connection: close time.sleep(2) (resp, sock) = self.http(b"""X-Blah: blah -""", start=True, sock=sock, raw=True, no_recv=True) +""", start=True, sock=sock, raw=True) + + if len(resp) != 0: + sock.close() + else: time.sleep(2) resp = self.http(b"""Connection: close
runtime: TCP - increase max size of out of order queue
#define TCP_TIME_WAIT_TIMEOUT (1 * ONE_SECOND) /* FIXME: should be 8 minutes */ #define TCP_RETRANSMIT_TIMEOUT (300 * ONE_MS) /* FIXME: should be dynamic */ #define TCP_FAST_RETRANSMIT_THRESH 3 -#define TCP_OOO_MAX_SIZE 16 +#define TCP_OOO_MAX_SIZE 2048 #define TCP_RETRANSMIT_BATCH 16 /* connecion states (RFC 793 Section 3.2) */
h2olog: always call setuid() and setgid() on privdrop
@@ -129,7 +129,6 @@ static void show_process(pid_t pid) static void drop_root_privilege(void) { if (getuid() == 0) { - if (getgid() == 0) { const char *sudo_gid = getenv("SUDO_GID"); if (sudo_gid == NULL) { fprintf(stderr, "Error: failed to read the SUDO_GID env variable\n"); @@ -141,11 +140,10 @@ static void drop_root_privilege(void) fprintf(stderr, "Error: failed to parse SUDO_GID\n"); exit(EXIT_FAILURE); } - if (gid != 0 && setgid(gid) != 0) { + if (setgid(gid) != 0) { fprintf(stderr, "Error: failed to drop the root group\n"); exit(EXIT_FAILURE); } - } const char *sudo_uid = getenv("SUDO_UID"); if (sudo_uid == NULL) { fprintf(stderr, "Error: failed to read the SUDO_UID env variable\n"); @@ -157,7 +155,7 @@ static void drop_root_privilege(void) fprintf(stderr, "Error: failed to parse SUDO_UID\n"); exit(EXIT_FAILURE); } - if (uid != 0 && setuid(uid) != 0) { + if (setuid(uid) != 0) { fprintf(stderr, "Error: failed to drop the root user\n"); exit(EXIT_FAILURE); }
motorcontrol: fix incorrect cast fixes
@@ -417,7 +417,7 @@ pbio_error_t pbio_motor_run(pbio_port_t port, int32_t speed) { if (mtr->state == PBIO_CONTROL_TIME_BACKGROUND && mtr->control.action == RUN && - ((uint32_t) (speed * mtr->counts_per_output_unit)) == mtr->control.trajectory.w1) { + ((int32_t) (speed * mtr->counts_per_output_unit)) == mtr->control.trajectory.w1) { // If the exact same command is already running, there is nothing we need to do return PBIO_SUCCESS; }
parser json REFACTOR local variable is not needed
@@ -507,7 +507,7 @@ static LY_ERR lydjson_metadata_finish(struct lyd_json_ctx *lydctx, struct lyd_node **first_p) { LY_ERR ret = LY_SUCCESS; - struct lyd_node *node, *attr, *next, *start = *first_p, *meta_iter; + struct lyd_node *node, *attr, *next, *meta_iter; uint64_t instance = 0; const char *prev = NULL; uint32_t log_location_items = 0; @@ -538,8 +538,8 @@ lydjson_metadata_finish(struct lyd_json_ctx *lydctx, struct lyd_node **first_p) instance++; } - /* find the correspnding data node */ - LY_LIST_FOR(start, node) { + /* find the corresponding data node */ + LY_LIST_FOR(*first_p, node) { if (!node->schema) { /* opaq node - we are going to put into it just a generic attribute. */ if (strcmp(&meta_container->name.name[1], ((struct lyd_node_opaq *)node)->name.name)) { @@ -632,7 +632,7 @@ lydjson_metadata_finish(struct lyd_json_ctx *lydctx, struct lyd_node **first_p) } else { /* remove the opaq attr */ if (attr == (*first_p)) { - *first_p = start = attr->next; + *first_p = attr->next; } lyd_free_tree(attr); }
travis: fix pip not being found on OS X builds
@@ -108,9 +108,9 @@ before_install: - | if [ "${TESTS:-ON}" = "ON" ]; then if [ "$TRAVIS_OS_NAME" = "osx" ]; then - export PATH="$(python -m site --user-base)/bin:$PATH" + export PATH="$(python2 -m site --user-base)/bin:$PATH" fi - travis_retry pip install --user cram==0.7 + travis_retry pip2 install --user cram==0.7 fi - export CXX=${CC/gcc/g++}; export CXX=${CXX/clang/clang++} - $CC --version
Add (void *) for pointer cast.
@@ -1004,7 +1004,7 @@ static bool dcd_write_packet_memory_ff(tu_fifo_t * ff, uint16_t dst, uint16_t wN { // Since PMA can accessed only 16 bit-wise we copy the last byte again tu_fifo_backward_read_pointer(ff, 1); // Move one byte back and copy two bytes for the PMA - tu_fifo_read_n(ff, &pma[PMA_STRIDE*(dst>>1)], 2); // Since EP FIFOs must be of item size 1 this is safe to do + tu_fifo_read_n(ff, (void *) &pma[PMA_STRIDE*(dst>>1)], 2); // Since EP FIFOs must be of item size 1 this is safe to do dst++; len2--; }
Fix error reporting after ioctl() call with pg_upgrade --clone errno was not reported correctly after attempting to clone a file, leading to incorrect error reports. While scanning through the code, I have not noticed any similar mistakes. Error introduced in Author: Justin Pryzby Discussion: Backpatch-through: 12
@@ -62,9 +62,11 @@ cloneFile(const char *src, const char *dst, if (ioctl(dest_fd, FICLONE, src_fd) < 0) { + int save_errno = errno; + unlink(dst); pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n", - schemaName, relName, src, dst, strerror(errno)); + schemaName, relName, src, dst, strerror(save_errno)); } close(src_fd);
Fix home indicator issues
@@ -51,7 +51,7 @@ import SwiftUI sceneDelegate?.sceneStateStore.reset() let sidebar = makeSidebarNavigation(url: nil, run: false, isShortcut: false, restoreSelection: false) - let vc = UIHostingController(rootView: AnyView(sidebar)) + let vc = SidebarController(rootView: AnyView(sidebar)) vc.modalTransitionStyle = .crossDissolve vc.modalPresentationStyle = .fullScreen sidebar.viewControllerStore.vc = vc @@ -317,6 +317,7 @@ import SwiftUI let runAction = UIDocumentBrowserAction(identifier: "run", localizedTitle: Localizable.MenuItems.run, availability: [.menu, .navigationBar], handler: { (urls) in self.openDocument(urls[0], run: true) }) + runAction.supportedContentTypes = ["public.python-script"] if #available(iOS 13.0, *) { additionalTrailingNavigationBarButtonItems = [UIBarButtonItem(image: UIImage(systemName: "folder.fill") ?? UIImage(), style: .plain, target: self, action: #selector(openProject))]
Add minus (hyphen) as neutral letter
@@ -119,7 +119,7 @@ bool lv_bidi_letter_is_rtl(uint32_t letter) bool lv_bidi_letter_is_neutral(uint32_t letter) { uint16_t i; - static const char neutrals[] = " \t\n\r.,:;'\"`!?%/\\=()[]{}<>@#&$|"; + static const char neutrals[] = " \t\n\r.,:;'\"`!?%/\\-=()[]{}<>@#&$|"; for(i = 0; neutrals[i] != '\0'; i++) { if(letter == (uint32_t)neutrals[i]) return true; }
fix misra 5.3: check_ignition is intended as check_started and can't be used twice
// ********************* Serial debugging ********************* -bool check_ignition(void) { +bool check_started(void) { return current_board->check_ignition() || ignition_can; } @@ -84,10 +84,10 @@ void started_interrupt_handler(uint8_t interrupt_line) { #ifdef EON // set power savings mode here if on EON build - int power_save_state = check_ignition() ? POWER_SAVE_STATUS_DISABLED : POWER_SAVE_STATUS_ENABLED; + int power_save_state = check_started() ? POWER_SAVE_STATUS_DISABLED : POWER_SAVE_STATUS_ENABLED; set_power_save_state(power_save_state); // set CDP usb power mode everytime that the car starts to make sure EON is charging - if (check_ignition()) { + if (check_started()) { current_board->set_usb_power_mode(USB_POWER_CDP); } #endif @@ -609,7 +609,7 @@ void TIM3_IRQHandler(void) { // check heartbeat counter if we are running EON code. If the heartbeat has been gone for a while, go to NOOUTPUT safety mode. #ifdef EON - if (heartbeat_counter >= (check_ignition() ? EON_HEARTBEAT_IGNITION_CNT_ON : EON_HEARTBEAT_IGNITION_CNT_OFF)) { + if (heartbeat_counter >= (check_started() ? EON_HEARTBEAT_IGNITION_CNT_ON : EON_HEARTBEAT_IGNITION_CNT_OFF)) { puts("EON hasn't sent a heartbeat for 0x"); puth(heartbeat_counter); puts(" seconds. Safety is set to NOOUTPUT mode.\n"); if(current_safety_mode != SAFETY_NOOUTPUT){ set_safety_mode(SAFETY_NOOUTPUT, 0U); @@ -707,7 +707,7 @@ int main(void) { current_board->set_esp_gps_mode(ESP_GPS_DISABLED); } // only enter power save after the first cycle - /*if (check_ignition()) { + /*if (check_started()) { set_power_save_state(POWER_SAVE_STATUS_ENABLED); }*/ #endif
Fix httpbin useragent response format.
if result then p.out(result) test.capture( - '{\n "user-agent": "Premake/' .. _PREMAKE_VERSION .. '"\n}' + '{"user-agent": "Premake/' .. _PREMAKE_VERSION .. '"}' ) else test.fail(err); if result then p.out(result) test.capture( - '{\n "user-agent": "Premake/' .. _PREMAKE_VERSION .. '"\n}' + '{"user-agent": "Premake/' .. _PREMAKE_VERSION .. '"}' ) else test.fail(err); if result then p.out(result) test.capture( - '{\n "user-agent": "Premake/' .. _PREMAKE_VERSION .. '"\n}' + '{"user-agent": "Premake/' .. _PREMAKE_VERSION .. '"}' ) else test.fail(err);
Fix u-boot compilation for gcc10.
@@ -80,3 +80,13 @@ diff -rupN old/u-boot-xlnx-xilinx-v2020.1/include/phy.h u-boot-xlnx-xilinx-v2020 int phy_et1011c_init(void); int phy_lxt_init(void); int phy_marvell_init(void); ++++ old/u-boot-xlnx-xilinx-v2020.1/scripts/dtc/dtc-lexer.l ++++ u-boot-xlnx-xilinx-v2020.1/scripts/dtc/dtc-lexer.l +@@ -38,7 +38,6 @@ + #include "srcpos.h" + #include "dtc-parser.tab.h" + +-YYLTYPE yylloc; + extern bool treesource_error; + + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
usdt: Have Context::addsem_probe() nop if pid not specified This makes bcc_usdt_addsem*() more consistent with the bcc_usdt_enable*() interface where if a USDT::Context was not constructed with a pid the semaphore enablement nops.
@@ -359,9 +359,13 @@ bool Context::addsem_probe(const std::string &provider_name, int16_t val) { Probe *found_probe = get_checked(provider_name, probe_name); - if (found_probe != nullptr) + if (found_probe != nullptr) { + if (found_probe->need_enable()) return found_probe->add_to_semaphore(val); + return true; + } + return false; }
Add unittest to check realm object and realm this types Make sure that realm object and realm this types are tested. JerryScript-DCO-1.0-Signed-off-by: Peter Gal
@@ -124,6 +124,33 @@ main (void) jerry_release_value (object_bigint); } + if (jerry_is_feature_enabled (JERRY_FEATURE_REALM)) + { + jerry_value_t new_realm = jerry_create_realm (); + jerry_value_t old_realm = jerry_set_realm (new_realm); + + jerry_type_t new_realm_type = jerry_value_get_type (new_realm); + TEST_ASSERT (new_realm_type == JERRY_TYPE_OBJECT); + + jerry_value_t new_realm_this = jerry_realm_get_this (new_realm); + jerry_type_t new_realm_this_type = jerry_value_get_type (new_realm_this); + TEST_ASSERT (new_realm_this_type == JERRY_TYPE_OBJECT); + jerry_release_value (new_realm_this); + + jerry_type_t old_realm_type = jerry_value_get_type (old_realm); + TEST_ASSERT (old_realm_type == JERRY_TYPE_OBJECT); + + jerry_release_value (new_realm); + + jerry_value_t old_realm_this = jerry_realm_get_this (old_realm); + jerry_type_t old_realm_this_type = jerry_value_get_type (old_realm_this); + TEST_ASSERT (old_realm_this_type == JERRY_TYPE_OBJECT); + jerry_release_value (old_realm_this); + + /* Restore the old realm as per docs */ + jerry_set_realm (old_realm); + } + jerry_cleanup (); return 0;
flash: smarter offsets
@@ -133,12 +133,12 @@ void flash_save(void) { cbor_encode_profile_t(&enc, &profile); uint32_t *proxy = (uint32_t *)buffer; - for (int i = 0; i < PROFILE_FLASH_SIZE / 8; i++) { + for (int i = 0; i < (PROFILE_FLASH_SIZE / 8); i++) { writeword(i + 256, proxy[i]); } } - writeword(512, FMC_HEADER); + writeword(256 + (PROFILE_FLASH_SIZE / 8), FMC_HEADER); fmc_lock(); } @@ -146,7 +146,7 @@ void flash_load(void) { unsigned long addresscount = 0; // check if saved data is present - if (FMC_HEADER == fmc_read(addresscount++) && FMC_HEADER == fmc_read(512)) { + if (FMC_HEADER == fmc_read(addresscount++) && FMC_HEADER == fmc_read(256 + (PROFILE_FLASH_SIZE / 8))) { float saved_pid_identifier = fmc_read_float(addresscount++); @@ -232,13 +232,13 @@ void flash_load(void) { memset(buffer, 0, PROFILE_FLASH_SIZE); uint32_t *proxy = (uint32_t *)buffer; - for (int i = 0; i < PROFILE_FLASH_SIZE / 8; i++) { + for (int i = 0; i < (PROFILE_FLASH_SIZE / 8); i++) { proxy[i] = fmc_read(i + 256); } - cbor_value_t enc; - cbor_decoder_init(&enc, buffer, PROFILE_FLASH_SIZE); - cbor_decode_profile_t(&enc, &profile); + cbor_value_t dec; + cbor_decoder_init(&dec, buffer, PROFILE_FLASH_SIZE); + cbor_decode_profile_t(&dec, &profile); // values in profile.c (was pid.c) changed, overwrite with defaults form profile.c if (saved_pid_identifier != initial_pid_identifier) {
adjust regularization
@@ -336,10 +336,10 @@ namespace NKernel { if (col <= row) { float val = __ldg(lower + row * (row + 1) / 2 + col); if (col == row && val <= 1e-7f) { - val += 10.0f; + val += trace / pseudoRank + 0.1f; } if (col == row) { - val += 0.01 * trace / pseudoRank; + val += 0.05f * trace / pseudoRank + 1e-20f; } val += col < row ? -lambda0 * cellPrior : (lambda0 * (1 - cellPrior) + lambda1); WriteThrough(lower + row * (row + 1) / 2 + col, val);
Put the CMAKE_MODULE_PATH line before find_package(ecbuild)
# -DCMAKE_MODULE_PATH=/path/to/ecbuild/cmake cmake_minimum_required( VERSION 3.12 FATAL_ERROR ) + +set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild/cmake" ) find_package( ecbuild 3.4 REQUIRED ) # Initialise project project( eccodes VERSION 2.19.0 LANGUAGES C ) -set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild/cmake" ) ############################################################################### # system checks needed for eccodes_config.h and some options like MEMFS
change post-increment to pre-increment
@@ -48,10 +48,10 @@ namespace MAT_NS_BEGIN void addData(json& object, std::vector<::CsProtocol::Data>& data) { std::vector<::CsProtocol::Data>::const_iterator it; - for (it = data.begin(); it != data.end(); it++) + for (it = data.begin(); it != data.end(); ++it) { std::map<std::string, CsProtocol::Value>::const_iterator mapIt; - for (mapIt = it->properties.begin(); mapIt != it->properties.end(); mapIt++) + for (mapIt = it->properties.begin(); mapIt != it->properties.end(); ++mapIt) { switch (mapIt->second.type) {
[python] compile numerics in C
@@ -95,10 +95,10 @@ macro(add_siconos_swig_sub_module fullname) set(${COMPONENT}_SWIG_DEFS "-I${_dir};${${COMPONENT}_SWIG_DEFS}") endforeach() - IF(WITH_CXX OR NOT ${COMPONENT} MATCHES "numerics") + IF(WITH_CXX AND NOT ${COMPONENT} MATCHES "numerics") set_source_files_properties(${swig_file} PROPERTIES SWIG_FLAGS "${${COMPONENT}_SWIG_DEFS}" CPLUSPLUS ON) - ENDIF(WITH_CXX OR NOT ${COMPONENT} MATCHES "numerics") + ENDIF(WITH_CXX AND NOT ${COMPONENT} MATCHES "numerics") # --- build swig module --- swig_add_module(${_name} python ${swig_file})
cmdline: indicate that the default value for --linux_net_ns is 'no' and correctly return tristate_t from cmdlineParseTriState()
@@ -172,18 +172,18 @@ tristate_t cmdlineParseTriState(const char* optname, const char* optarg) { } if ((strcasecmp(optarg, "0") == 0) || (strcasecmp(optarg, "false") == 0) || (strcasecmp(optarg, "n") == 0) || (strcasecmp(optarg, "no") == 0)) { - return false; + return HF_NO; } if ((strcasecmp(optarg, "1") == 0) || (strcasecmp(optarg, "true") == 0) || (strcasecmp(optarg, "y") == 0) || (strcasecmp(optarg, "yes") == 0)) { - return true; + return HF_YES; } if ((strcasecmp(optarg, "-1") == 0) || (strcasecmp(optarg, "maybe") == 0) || (strcasecmp(optarg, "m") == 0) || (strcasecmp(optarg, "if_supported") == 0)) { - return true; + return HF_MAYBE; } LOG_F("Unknown value for option --%s=%s. Use true, false or maybe", optname, optarg); - return false; + return HF_NO; } bool cmdlineParseTrueFalse(const char* optname, const char* optarg) { @@ -531,7 +531,7 @@ bool cmdlineParse(int argc, char* argv[], honggfuzz_t* hfuzz) { { { "linux_perf_bts_edge", no_argument, NULL, 0x513 }, "Use Intel BTS to count unique edges" }, { { "linux_perf_ipt_block", no_argument, NULL, 0x514 }, "Use Intel Processor Trace to count unique blocks (requires libipt.so)" }, { { "linux_perf_kernel_only", no_argument, NULL, 0x515 }, "Gather kernel-only coverage with Intel PT and with Intel BTS" }, - { { "linux_ns_net", required_argument, NULL, 0x0530 }, "Use Linux NET namespace isolation (yes/no/maybe [default:maybe/if_supported])" }, + { { "linux_ns_net", required_argument, NULL, 0x0530 }, "Use Linux NET namespace isolation (yes/no/maybe [default:no])" }, { { "linux_ns_pid", no_argument, NULL, 0x0531 }, "Use Linux PID namespace isolation" }, { { "linux_ns_ipc", no_argument, NULL, 0x0532 }, "Use Linux IPC namespace isolation" }, #endif // defined(_HF_ARCH_LINUX)
Fix circle uvs; After changing circle scale from diameter to radius, the uvs broke, since they are calculated from the position.
@@ -1062,7 +1062,7 @@ void lovrGraphicsArc(DrawStyle style, ArcMode mode, Material* material, mat4 tra for (int i = 0; i <= segments; i++) { float x = cosf(theta); float y = sinf(theta); - memcpy(vertices, ((float[]) { x, y, 0.f, 0.f, 0.f, 1.f, x + .5f, 1.f - (y + .5f) }), 8 * sizeof(float)); + memcpy(vertices, ((float[]) { x, y, 0.f, 0.f, 0.f, 1.f, (1.f + x) * .5f, (1.f - y) * .5f }), 8 * sizeof(float)); vertices += 8; theta += angleShift; }
README: fix example code The example has regressed during the recent formatter API changes.
@@ -66,10 +66,10 @@ int main() // Print current instruction pointer. printf("%016" PRIX64 " ", runtime_address); - // Format & print the binary instruction structure to human readable format + // Format & print the binary instruction structure to human-readable format char buffer[256]; ZydisFormatterFormatInstruction(&formatter, &instruction, operands, - instruction.operand_count_visible, buffer, sizeof(buffer), runtime_address); + instruction.operand_count_visible, buffer, sizeof(buffer), runtime_address, ZYAN_NULL); puts(buffer); offset += instruction.length;
unix_process/socket_user.c: fix memory leaks This commit removes heap allocations of structures that were never freed, adds buffer deallocation to the output buffer handler, and replaces a heap allocation in the input handler with a stack allocation.
@@ -430,19 +430,11 @@ static void fill_v4_sockaddr(struct sockaddr_in *in, u32 address, u16 port) static void register_descriptor_write(heap h, notifier n, descriptor f, thunk each) { - registration r = allocate(h, sizeof(struct registration)); - assert(r != INVALID_ADDRESS); - r->fd = f; - r->a = each; notifier_register(n, f, EPOLLOUT, each); } static void register_descriptor(heap h, notifier n, descriptor f, thunk each) { - registration r = allocate(h, sizeof(struct registration)); - assert(r != INVALID_ADDRESS); - r->fd = f; - r->a = each; notifier_register(n, f, EPOLLIN|EPOLLHUP, each); } @@ -451,7 +443,7 @@ closure_function(4, 0, void, connection_input, { // can reuse? descriptor f = bound(f); - buffer b = allocate_buffer(bound(h), 512); + buffer b = little_stack_buffer(512); int res = read(f, b->contents, b->length); if (res > 0) { b->end = res; @@ -473,6 +465,7 @@ closure_function(2, 1, status, connection_output, descriptor c = bound(c); if (b) { igr(write(c, b->contents, buffer_length(b))); + deallocate_buffer(b); } else { notifier_reset_fd(bound(n), c); close(c);
Delete underlying OpenAL source when a channel is stopped.
@@ -142,11 +142,16 @@ public: { clRemoveChannel(this); - if (!openal_is_shutdown && sourceId && playing()) + if (!openal_is_shutdown && sourceId) + { + if (playing()) { alSourceStop(sourceId); check("stop"); } + alSourcei(sourceId, AL_BUFFER, 0); + alDeleteSources(1, &sourceId); + } sourceId = 0; if (soundObject)
KDF SSH Updated per code review.
@@ -314,17 +314,26 @@ static ACVP_RESULT acvp_kdf135_ssh_init_tc(ACVP_CTX *ctx, unsigned int tc_id, ACVP_CIPHER alg_id, unsigned int sha_type, - unsigned int sh_sec_len, - unsigned int iv_len, - unsigned int key_len, + unsigned int sh_sec_len, //bites (spec) + unsigned int iv_len, //bites (spec) + unsigned int key_len, //bites (spec) const unsigned char *shared_sec_k, const unsigned char *hash_h, - unsigned int hash_len, + unsigned int hash_len, //bytes const unsigned char *session_id, - unsigned int session_len) + unsigned int session_len) //bytes { memset(stc, 0x0, sizeof(ACVP_KDF135_SSH_TC)); + if ((sh_sec_len/8 > ACVP_KDF135_SSH_MSG_MAX) || + (iv_len/8 > ACVP_KDF135_SSH_MSG_MAX) || + (key_len/8 > ACVP_KDF135_SSH_MSG_MAX) || + (hash_len > ACVP_KDF135_SSH_MSG_MAX) || + (session_len > ACVP_KDF135_SSH_MSG_MAX) ) { + ACVP_LOG_ERR("Input length too long KDF SSH."); + return (ACVP_DATA_TOO_LARGE); + } + stc->shared_sec_k = calloc(1, ACVP_KDF135_SSH_MSG_MAX); if (!stc->shared_sec_k) return ACVP_MALLOC_FAIL; stc->hash_h = calloc(1, ACVP_KDF135_SSH_MSG_MAX); @@ -347,8 +356,9 @@ static ACVP_RESULT acvp_kdf135_ssh_init_tc(ACVP_CTX *ctx, stc->sc_i_key = calloc(1, ACVP_KDF135_SSH_MSG_MAX); if (!stc->sc_i_key) return ACVP_MALLOC_FAIL; - memcpy(stc->shared_sec_k, shared_sec_k, key_len); + memcpy(stc->shared_sec_k, shared_sec_k, key_len/8); memcpy(stc->hash_h, hash_h, hash_len); + memcpy(stc->session_id, session_id, session_len); memset(stc->cs_init_iv, 0, ACVP_KDF135_SSH_MSG_MAX); memset(stc->sc_init_iv, 0, ACVP_KDF135_SSH_MSG_MAX); @@ -360,11 +370,11 @@ static ACVP_RESULT acvp_kdf135_ssh_init_tc(ACVP_CTX *ctx, stc->tc_id = tc_id; stc->cipher = alg_id; stc->sha_type = sha_type; - stc->sh_sec_len = sh_sec_len; - stc->iv_len = iv_len; - stc->key_len = key_len; - stc->session_len = session_len; - stc->hash_len = hash_len; + stc->sh_sec_len = sh_sec_len; //bites + stc->iv_len = iv_len; //bites + stc->key_len = key_len; //bits + stc->session_len = session_len; //bytes + stc->hash_len = hash_len; //bytes return ACVP_SUCCESS; }
SOVERSION bump to version 2.24.7
@@ -66,7 +66,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 24) -set(LIBYANG_MICRO_SOVERSION 6) +set(LIBYANG_MICRO_SOVERSION 7) set(LIBYANG_SOVERSION_FULL ${LIBYANG_MAJOR_SOVERSION}.${LIBYANG_MINOR_SOVERSION}.${LIBYANG_MICRO_SOVERSION}) set(LIBYANG_SOVERSION ${LIBYANG_MAJOR_SOVERSION})
[bsp][stm32][wdt] Optimize code style.
struct stm32_wdt_obj { + rt_watchdog_t watchdog; IWDG_HandleTypeDef hiwdg; rt_uint16_t is_start; }; static struct stm32_wdt_obj stm32_wdt; static struct rt_watchdog_ops ops; -static rt_watchdog_t watchdog; static rt_err_t wdt_init(rt_watchdog_t *wdt) { @@ -116,9 +116,9 @@ int rt_wdt_init(void) ops.init = &wdt_init; ops.control = &wdt_control; - watchdog.ops = &ops; + stm32_wdt.watchdog.ops = &ops; /* register watchdog device */ - if (rt_hw_watchdog_register(&watchdog, "wdt", RT_DEVICE_FLAG_DEACTIVATE, RT_NULL) != RT_EOK) + if (rt_hw_watchdog_register(&stm32_wdt.watchdog, "wdt", RT_DEVICE_FLAG_DEACTIVATE, RT_NULL) != RT_EOK) { LOG_E("wdt device register failed."); return -RT_ERROR;
When creating a CLIP sensor set config/on to true if not specified
@@ -428,6 +428,9 @@ int DeRestPluginPrivate::createSensor(const ApiRequest &req, ApiResponse &rsp) } } + ResourceItem *item = sensor.item(RConfigOn); + item->setValue(true); // default + //setConfig optional if (map.contains("config")) { @@ -449,7 +452,7 @@ int DeRestPluginPrivate::createSensor(const ApiRequest &req, ApiResponse &rsp) if (config.contains("on")) { - ResourceItem *item = sensor.addItem(DataTypeBool, RConfigOn); + item = sensor.item(RConfigOn); item->setValue(config["on"]); } if (config.contains("reachable"))
Fix "terminate process" on Windows CloseHandle() does not terminate the process. TerminateProcess() does.
@@ -28,7 +28,7 @@ HANDLE cmd_execute(const char *path, const char *const argv[]) { } SDL_bool cmd_terminate(HANDLE handle) { - return CloseHandle(handle); + return TerminateProcess(handle, 1) && CloseHandle(handle); } SDL_bool cmd_simple_wait(HANDLE handle, DWORD *exit_code) {
sdio_slave: fix the ret_queue crash issue when being reset by the master
@@ -965,7 +965,7 @@ static esp_err_t send_flush_data() if (context.in_flight) { buf_desc_t *desc = context.in_flight; while(desc != NULL) { - xQueueSend(context.ret_queue, desc->arg, portMAX_DELAY); + xQueueSend(context.ret_queue, &desc->arg, portMAX_DELAY); last = desc; desc = STAILQ_NEXT(desc, qe); } @@ -980,7 +980,7 @@ static esp_err_t send_flush_data() if (ret == ESP_OK) { buf_desc_t *desc = head; while(desc != NULL) { - xQueueSend(context.ret_queue, desc->arg, portMAX_DELAY); + xQueueSend(context.ret_queue, &desc->arg, portMAX_DELAY); last = desc; desc = STAILQ_NEXT(desc, qe); }
lwip/dhcps: fix improper use of inet_addr()
@@ -799,17 +799,17 @@ err_t dhcps_start(struct netif *netif) pcb_dhcps = dhcps; if (netif->ip_addr.addr == 0) { - netif->ip_addr.addr = inet_addr("LWIP_DHCPS_SERVER_IP"); + netif->ip_addr.addr = inet_addr(LWIP_DHCPS_SERVER_IP); } if (netif->gw.addr == 0) { - netif->gw.addr = inet_addr("LWIP_DHCPS_SERVER_IP"); + netif->gw.addr = inet_addr(LWIP_DHCPS_SERVER_IP); } server_address = netif->ip_addr; if (netif->netmask.addr == 0) { - netif->netmask.addr = inet_addr("LWIP_DHCPS_SERVER_NETMASK"); + netif->netmask.addr = inet_addr(LWIP_DHCPS_SERVER_NETMASK); } ipaddr_tmp = htonl(netif->ip_addr.addr);
Travis: Quote added path.
@@ -31,7 +31,7 @@ script: - if [ "$TRAVIS_OS_NAME" != "windows" ]; then cmake -DCMAKE_INSTALL_PREFIX=~/tinyspline .; fi; - cmake --build . - cmake --build . --target install - - if [ "$TRAVIS_OS_NAME" == "windows" ]; then export PATH=C:/tinyspline/bin:$PATH; fi; + - if [ "$TRAVIS_OS_NAME" == "windows" ]; then export PATH="C:/tinyspline/bin;":$PATH; fi; - cmake --build . --target tests jobs:
dev-tools/cmake: bump version to v3.11.1
%define pname cmake -%define major_version 3.10 -%define minor_version 2 +%define major_version 3.11 +%define minor_version 1 Summary: CMake is an open-source, cross-platform family of tools designed to build, test and package software. Name: %{pname}%{PROJ_DELIM}
Initialize ruby stack.
@@ -424,6 +424,10 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi log_copy(host->log); + /* Initialize Ruby */ + { + RUBY_INIT_STACK; + ruby_init(); ruby_init_loadpath(); @@ -443,6 +447,7 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi } log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader initialized correctly"); + } return (loader_impl_data)&rb_loader_impl_unused; }
configure: use sdl-config if available + do a full link to ensure SDL_main is resolved if needed fixes detection on OS X
@@ -443,31 +443,54 @@ AC_ARG_ENABLE([sdl], @<:@default=auto@:>@])) AS_IF([test "x$enable_sdl" != "xno"], [ CLEAR_LIBVARS([SDL]) + AC_PATH_PROGS([LIBSDL_CONFIG], [sdl-config]) + if test -n "$LIBSDL_CONFIG"; then + SDL_INCLUDES=`$LIBSDL_CONFIG --cflags` + SDL_LIBS="`$LIBSDL_CONFIG --libs`" + fi + WITHLIB_OPTION([sdl], [SDL]) sdl_header="no" LIBCHECK_PROLOGUE([SDL]) - AC_CHECK_HEADER([SDL/SDL.h], [sdl_header="SDL_SDL.h"], + AC_CHECK_HEADER([SDL/SDL.h], [sdl_header="SDL/SDL.h"], [AC_CHECK_HEADER([SDL.h], [sdl_header="SDL.h"], [AC_MSG_WARN(SDL library not available - no sdl.h)])]) if test x"$sdl_header" != "xno"; then - AC_CHECK_LIB(SDL, SDL_Init, - [SDL_LIBS="-lSDL" - SDL_INCLUDES="-DWEBP_HAVE_SDL" + AC_LANG_PUSH(C) + SDL_SAVED_LIBS="$LIBS" + for lib in "" "-lSDL" "-lSDLmain -lSDL"; do + LIBS="$SDL_SAVED_LIBS $lib" + # Perform a full link to ensure SDL_main is resolved if needed. + AC_LINK_IFELSE( + [AC_LANG_SOURCE([ + #include <$sdl_header> + int main(int argc, char** argv) { + SDL_Init(0); + return 0; + }])], + [SDL_LIBS="$LDFLAGS $LIBS" + SDL_INCLUDES="$SDL_INCLUDES -DWEBP_HAVE_SDL" AC_DEFINE(WEBP_HAVE_SDL, [1], [Set to 1 if SDL library is installed]) - sdl_support=yes - ], - AC_MSG_WARN(Optional SDL library not found), - [$MATH_LIBS]) + sdl_support=yes] + ) + if test x"$sdl_support" = "xyes"; then + break + fi + done + # LIBS is restored by LIBCHECK_EPILOGUE + AC_LANG_POP if test x"$sdl_header" = "xSDL.h"; then SDL_INCLUDES="$SDL_INCLUDES -DWEBP_HAVE_JUST_SDL_H" fi fi LIBCHECK_EPILOGUE([SDL]) - if test "$sdl_support" = "yes"; then + if test x"$sdl_support" = "xyes"; then build_vwebp_sdl=yes + else + AC_MSG_WARN(Optional SDL library not found) fi ])
[sbt] Use tools/chisel3 not rocketchip/chisel3
@@ -79,7 +79,7 @@ def isolateAllTests(tests: Seq[TestDefinition]) = tests map { test => // before launching sbt if any of the firrtl source files has been updated // The jar is dropped in chipyard's lib/ directory, which is used as the unmanagedBase // for all subprojects -lazy val chisel = (project in rocketChipDir / "chisel3") +lazy val chisel = (project in file("tools/chisel3")) lazy val firrtl_interpreter = (project in file("tools/firrtl-interpreter")) .settings(commonSettings)
misc: configurator: Apply pattern check to IVSHMEM name This patch applies pattern check to IVSHMEM name. Report error if regex does not match.
</label> </b-col> <b-col md="4"> - <b-form-input v-model="IVSHMEM_VMO.NAME" placeholder="Any string with no white spaces."/> + <b-form-input :state="validateIvshrgName(IVSHMEM_VMO.NAME)" v-model="IVSHMEM_VMO.NAME" placeholder="Must be 1-27 characters and only letters, digits and '_'."/> + <b-form-invalid-feedback> + Name must be between 1-27 characters and contain only letters, digits and "_". + </b-form-invalid-feedback> </b-col> </b-row> @@ -189,6 +192,10 @@ export default { } }, methods: { + validateIvshrgName(value) { + var regexp = new RegExp(this.IVSHMEMRegionType.properties.NAME.pattern); + return regexp.test(value); + }, validation(value) { return (value != null) && (value.length != 0); },
Fix the order of freeing memory
@@ -181,13 +181,13 @@ void mpi_mod_mul( char * input_A, } exit: - mbedtls_mpi_mod_modulus_free( &m ); - mbedtls_free( rA.p ); mbedtls_free( rB.p ); mbedtls_free( rR.p ); mbedtls_free( X ); mbedtls_free( (mbedtls_mpi_uint *) m.p ); + + mbedtls_mpi_mod_modulus_free( &m ); } /* END_CASE */ @@ -233,14 +233,14 @@ void mpi_mod_mul_neg( char * input_A, MBEDTLS_ERR_MPI_BAD_INPUT_DATA ); exit: - mbedtls_mpi_mod_modulus_free( &m ); - mbedtls_mpi_mod_modulus_free( &fake_m ); - mbedtls_free( rA.p ); mbedtls_free( rB.p ); mbedtls_free( rR.p ); mbedtls_free( X ); mbedtls_free( (mbedtls_mpi_uint *) m.p ); + + mbedtls_mpi_mod_modulus_free( &m ); + mbedtls_mpi_mod_modulus_free( &fake_m ); } /* END_CASE */
Fix typing error in max calculation
@@ -1314,7 +1314,7 @@ TMetricHolder TMultiClassMetric::EvalSingleThread( GetMultiDimensionalApprox(k, approx, approxDelta, evaluatedApprox); double maxApprox = std::numeric_limits<double>::min(); - for (int dim = 1; dim < approxDimension; ++dim) { + for (int dim = 0; dim < approxDimension; ++dim) { if (evaluatedApprox[dim] > maxApprox) { maxApprox = evaluatedApprox[dim]; }
Remove unnecessary priority and stacksize setting from env for built-in task
#include <tinyara/config.h> #include <string.h> #include <stdio.h> -#ifndef CONFIG_DISABLE_ENVIRON -#include <stdlib.h> -#endif #include <sys/types.h> #include <sys/boardctl.h> #include <apps/shell/tash.h> @@ -160,10 +157,7 @@ static int tash_help(int argc, char **args) } } printf("\n"); -#ifndef CONFIG_DISABLE_ENVIRON - printf("\nIf you want to run an ASYNC command with specific priority and stacksize\n"); - printf("use \"setenv %s\" or \"%s\"\n", TASH_ASYNC_CMD_PRI_STR, TASH_ASYNC_CMD_STACK_STR); -#endif + return 0; } @@ -203,28 +197,9 @@ static int tash_launch_cmdtask(TASH_CMD_CALLBACK cb, int argc, char **args) int ret = 0; int pri = TASH_CMDTASK_PRIORITY; long stack_size = TASH_CMDTASK_STACKSIZE; -#ifndef CONFIG_DISABLE_ENVIRON - char *env_pri; - char *env_stack; - int is_setenv = false; - - env_pri = getenv(TASH_ASYNC_CMD_PRI_STR); - if (env_pri != NULL) { - pri = atoi(env_pri); - is_setenv = true; - } - - env_stack = getenv(TASH_ASYNC_CMD_STACK_STR); - if (env_stack != NULL) { - stack_size = atoi(env_stack); - is_setenv = true; - } - if (is_setenv) { - printf("Priority and Stack size for TASH ASYNC cmd are changed\n"); printf("Command will be launched with pri (%d), stack size(%d)\n", pri, stack_size); - } -#endif + ret = task_create(args[0], pri, stack_size, cb, &args[1]); return ret;
Add missing LSM cleanup hook
@@ -1472,6 +1472,8 @@ class BPF(object): self.detach_kfunc(k) for k, v in list(self.kfunc_exit_fds.items()): self.detach_kretfunc(k) + for k, v in list(self.lsm_fds.items()): + self.detach_lsm(k) # Clean up opened perf ring buffer and perf events table_keys = list(self.tables.keys())
Remove the severity: fips change label if fips checksum unchanged
@@ -41,7 +41,7 @@ jobs: run: make update-fips-checksums working-directory: ./build-pristine - name: make diff-fips-checksums - run: make diff-fips-checksums || echo "fips_changed=1" >> $GITHUB_ENV + run: make diff-fips-checksums && echo "fips_unchanged=1" >> $GITHUB_ENV || echo "fips_changed=1" >> $GITHUB_ENV working-directory: ./build - name: set label if: ${{ env.fips_changed }} @@ -55,3 +55,15 @@ jobs: repo: context.repo.repo, labels: ['severity: fips change'] }) + - name: remove label + if: ${{ env.fips_unchanged }} + uses: actions/github-script@v4 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: 'severity: fips change' + })
graph-update: sort indices correctly
@@ -109,7 +109,7 @@ const addNodes = (json, state) => { let parNode = graph.get(index[0]); if (!parNode) { console.error('parent node does not exist, cannot add child'); - return; + return graph; } parNode.children = _addNode(parNode.children, index.slice(1), node); graph.set(index[0], parNode); @@ -134,7 +134,7 @@ const addNodes = (json, state) => { if (state.graphTimesentMap[resource][timestamp]) { let index = state.graphTimesentMap[resource][timestamp]; - if (index.split('/').length === 0) { return; } + if (index.split('/').length === 0) { return graph; } let indexArr = index.split('/').slice(1).map((ind) => { return bigInt(ind); }); @@ -178,7 +178,7 @@ const addNodes = (json, state) => { indices.sort((a, b) => { let aArr = a.split('/'); let bArr = b.split('/'); - return bArr.length < aArr.length; + return aArr.length - bArr.length; }); let graph = state.graphs[resource];
Add -debug to version on DEBUG builds
@@ -833,7 +833,13 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt) /* Call library constructors */ do_ctors(); - prlog(PR_NOTICE, "OPAL %s starting...\n", version); + prlog(PR_NOTICE, "OPAL %s%s starting...\n", version, +#ifdef DEBUG + "-debug" +#else + "" +#endif + ); prlog(PR_DEBUG, "initial console log level: memory %d, driver %d\n", (debug_descriptor.console_log_levels >> 4), (debug_descriptor.console_log_levels & 0x0f));
Fixed health struct size. We should really get an automated test for this
@@ -346,7 +346,7 @@ class Panda(object): # ******************* health ******************* def health(self): - dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 28) + dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 33) a = struct.unpack("IIIIIIBBBBBBBBB", dat) return { "uptime": a[0],
Fix pure TCP/IP example
@@ -501,35 +501,31 @@ Iodine allows custom TCP/IP server authoring, for those cases where we need raw Here's a short and sweet echo server - No HTTP, just use `telnet`: ```ruby - require 'iodine' # an echo protocol with asynchronous notifications. class EchoProtocol # `on_message` is an optional alternative to the `on_data` callback. # `on_message` has a 1Kb buffer that recycles itself for memory optimization. - def on_message buffer + def on_message client, buffer # writing will never block and will use a buffer written in C when needed. - write buffer + client.write buffer # close will be performed only once all the data in the write buffer # was sent. use `force_close` to close early. - close if buffer =~ /^bye[\r\n]/i - # use buffer.dup to save the data from being recycled once we return. - data = buffer.dup - # run asynchronous tasks with ease - run do + client.close if buffer =~ /^bye[\r\n]/i + # run asynchronous tasks using the thread pool + Iodine.run do sleep 1 - puts "Echoed data: #{data}" + puts "Echoed data: #{buffer}" end end end # listen on port 3000 for the echo protocol. -Iodine.listen 3000, EchoProtocol -Iodine.threads = 1 -Iodine.processes = 1 +Iodine.listen(port: "3000") { EchoProtocol.new } +Iodine.threads = 4 +Iodine.workers = 1 Iodine.start - ``` ### Why not EventMachine?
docs: Mark protocols and provisioning related chapters as updated for C6
@@ -71,11 +71,6 @@ api-guides/general-notes api-reference api-reference/api-conventions api-reference/template -api-reference/provisioning -api-reference/provisioning/protocomm -api-reference/provisioning/provisioning -api-reference/provisioning/index -api-reference/provisioning/wifi_provisioning api-reference/storage api-reference/storage/vfs api-reference/storage/spiffs @@ -184,16 +179,8 @@ api-reference/error-codes api-reference/index api-reference/protocols api-reference/protocols/esp_serial_slave_link -api-reference/protocols/mbedtls -api-reference/protocols/esp_http_server api-reference/protocols/esp_sdio_slave_protocol -api-reference/protocols/esp_local_ctrl -api-reference/protocols/esp_crt_bundle -api-reference/protocols/esp_http_client -api-reference/protocols/esp_https_server api-reference/protocols/esp_spi_slave_protocol -api-reference/protocols/modbus -api-reference/protocols/esp_tls api-reference/protocols/index security security/flash-encryption
YAMBi: Rephrase sentence about Bison dependency
@@ -17,7 +17,7 @@ This plugin uses Bison to generate a parser for the [YAML](http://yaml.org) seri ## Dependencies -Currently this plugin requires that you install [Bison](https://www.gnu.org/software/bison/) (3.0 or later). +The plugin requires [Bison](https://www.gnu.org/software/bison/) (3.0 or later). ## Examples
schema tree FEATURE macros to go through used structures
* Data structures and functions to manipulate and access schema tree. */ +/** + * @brief Helper macro to go through 0-terminated arrays + * + * Use with opening curly bracket '{'. + * + * @param[in] ARRAY Array to go through + * @param[out] ITER Numeric iterator storing available indexes of the ARRAY + */ +#define LY_ARRAY_FOR(ARRAY, ITER) for (ITER = 0; (ARRAY) && *((uint8_t *)((ARRAY) + ITER)); ++ITER) + +/** + * @brief Macro to iterate via all sibling elements without affecting the list itself + * + * Works for all types of nodes despite it is data or schema tree, but all the + * parameters must be pointers to the same type. + * + * Use with opening curly bracket '{'. All parameters must be of the same type. + * + * @param START Pointer to the starting element. + * @param ELEM Iterator. + */ +#define LY_LIST_FOR(START, ELEM) \ + for ((ELEM) = (START); \ + (ELEM); \ + (ELEM) = (ELEM)->next) + +/** + * @ingroup datatree + * @brief Macro to iterate via all sibling elements allowing to modify the list itself (e.g. removing elements) + * + * Use with opening curly bracket '{'. All parameters must be of the same type. + * + * @param START Pointer to the starting element. + * @param NEXT Temporary storage to allow removing of the current iterator content. + * @param ELEM Iterator. + */ +#define LY_LIST_FOR_SAFE(START, NEXT, ELEM) \ + for ((ELEM) = (START); \ + (ELEM) ? (NEXT = (ELEM)->next, 1) : 0; \ + (ELEM) = (NEXT)) + /** * @brief Schema input formats accepted by libyang [parser functions](@ref howtoschemasparsers). */
docs/library: Update pyb.SPI init method to add descr about "ti" arg.
@@ -64,6 +64,7 @@ Methods respectively. - ``bits`` can be 8 or 16, and is the number of bits in each transferred word. - ``firstbit`` can be ``SPI.MSB`` or ``SPI.LSB``. + - ``ti`` True indicates Texas Instruments, as opposed to Motorola, signal conventions. - ``crc`` can be None for no CRC, or a polynomial specifier. Note that the SPI clock frequency will not always be the requested baudrate.
Output bank data ptrs array
@@ -109,6 +109,11 @@ const compile = async ( // Add scene data const scenePtrs = precompiled.sceneData.map((scene, sceneIndex) => { + console.log("SCENE: " + sceneIndex, { + imageIndex: scene.imageIndex, + hi: hi(scene.imageIndex), + lo: lo(scene.imageIndex) + }); return banked.push( [].concat( hi(scene.imageIndex), @@ -155,6 +160,18 @@ const compile = async ( // ) // ); + const bankNums = [ + ...Array(bankOffset + stringBanks.length + banked.data.length).keys() + ]; + + const bankDataPtrs = bankNums.map(bankNum => { + return bankNum >= bankOffset + stringBanks.length + ? `&bank_${bankNum}_data` + : 0; + }); + + console.log({ bankNums, bankDataPtrs }); + const dataPtrs = { tileset_bank_ptrs: tileSetPtrs, image_bank_ptrs: imagePtrs, @@ -180,7 +197,9 @@ const compile = async ( return `extern const BANK_PTR ${name}[];`; }) .join(`\n`) + - `\nextern unsigned char script_flags[${precompiled.flags.length + 1}];\n` + + `\n` + + `extern const unsigned char *bank_data_ptrs[];\n` + + `extern unsigned char script_flags[${precompiled.flags.length + 1}];\n` + stringBanks .map((bankStrings, index) => { return `extern const unsigned char strings_${bankOffset + @@ -191,7 +210,11 @@ const compile = async ( output[`data_ptrs.c`] = `#pragma bank=16\n` + - `#include "data_ptrs.h"\n\n` + + `#include "data_ptrs.h"\n` + + `#include "banks.h"\n\n` + + `const unsigned char *bank_data_ptrs[] = {\n` + + bankDataPtrs.join(",") + + "\n};\n\n" + Object.keys(dataPtrs) .map(name => { return (
Scripts: Change order of columns
# parameterNumber # # The following are optional keys # typeOfFirstFixedSurface -# typeOfSecondFixedSurface -# scaledValueOfFirstFixedSurface # scaleFactorOfFirstFixedSurface -# scaledValueOfSecondFixedSurface +# scaledValueOfFirstFixedSurface +# typeOfSecondFixedSurface # scaleFactorOfSecondFixedSurface +# scaledValueOfSecondFixedSurface # typeOfStatisticalProcessing # # It outputs the def files: @@ -125,13 +125,12 @@ sub check_first_row_column_names { die "Error: 1st row column titles wrong: Column 7 should be 'parameterNumber'\n" if ($keys[6] ne "parameterNumber"); die "Error: 1st row column titles wrong: Column 8 should be 'typeOfFirstFixedSurface'\n" if ($keys[7] ne "typeOfFirstFixedSurface"); - die "Error: 1st row column titles wrong: Column 9 should be 'typeOfSecondFixedSurface'\n" if ($keys[8] ne "typeOfSecondFixedSurface"); - + die "Error: 1st row column titles wrong: Column 9 should be 'scaleFactorOfFirstFixedSurface'\n" if ($keys[8] ne "scaleFactorOfFirstFixedSurface"); die "Error: 1st row column titles wrong: Column 10 should be 'scaledValueOfFirstFixedSurface'\n" if ($keys[9] ne "scaledValueOfFirstFixedSurface"); - die "Error: 1st row column titles wrong: Column 11 should be 'scaleFactorOfFirstFixedSurface'\n" if ($keys[10] ne "scaleFactorOfFirstFixedSurface"); - die "Error: 1st row column titles wrong: Column 12 should be 'scaledValueOfSecondFixedSurface'\n" if ($keys[11] ne "scaledValueOfSecondFixedSurface"); - die "Error: 1st row column titles wrong: Column 13 should be 'scaleFactorOfSecondFixedSurface'\n" if ($keys[12] ne "scaleFactorOfSecondFixedSurface"); + die "Error: 1st row column titles wrong: Column 11 should be 'typeOfSecondFixedSurface'\n" if ($keys[10] ne "typeOfSecondFixedSurface"); + die "Error: 1st row column titles wrong: Column 12 should be 'scaleFactorOfSecondFixedSurface'\n" if ($keys[11] ne "scaleFactorOfSecondFixedSurface"); + die "Error: 1st row column titles wrong: Column 13 should be 'scaledValueOfSecondFixedSurface'\n" if ($keys[12] ne "scaledValueOfSecondFixedSurface"); die "Error: 1st row column titles wrong: Column 14 should be 'typeOfStatisticalProcessing'\n" if ($keys[13] ne "typeOfStatisticalProcessing"); }
README.md: Use version 2.05.01
@@ -28,11 +28,11 @@ Raspbian Wheezy and Qt4 is no longer maintained. ### Install deCONZ 1. Download deCONZ package - wget http://www.dresden-elektronik.de/rpi/deconz/beta/deconz-2.04.99-qt5.deb + wget http://www.dresden-elektronik.de/rpi/deconz/beta/deconz-2.05.01-qt5.deb 2. Install deCONZ package - sudo dpkg -i deconz-2.04.99-qt5.deb + sudo dpkg -i deconz-2.05.01-qt5.deb **Important** this step might print some errors *that's ok* and will be fixed in the next step. @@ -47,11 +47,11 @@ The deCONZ package already contains the REST API plugin, the development package 1. Download deCONZ development package - wget http://www.dresden-elektronik.de/rpi/deconz-dev/deconz-dev-2.04.99.deb + wget http://www.dresden-elektronik.de/rpi/deconz-dev/deconz-dev-2.05.01.deb 2. Install deCONZ development package - sudo dpkg -i deconz-dev-2.04.99.deb + sudo dpkg -i deconz-dev-2.05.01.deb 3. Install missing dependencies @@ -66,7 +66,7 @@ The deCONZ package already contains the REST API plugin, the development package 2. Checkout related version tag cd deconz-rest-plugin - git checkout -b mybranch V2_04_99 + git checkout -b mybranch V2_05_01 3. Compile the plugin
publish: add back nav for mobile on new-post
@@ -99,8 +99,13 @@ export class NewPost extends Component { let hiddenOnPopout = (props.popout) ? "" : "dib-m dib-l dib-xl"; + let newIndex = props.location.pathname.indexOf("/new"); + let backHref = props.location.pathname.slice(0, newIndex); return ( <div className="f9 h-100 relative"> + <div className="w-100 dn-m dn-l dn-xl inter pt4 pb4 f9 pl4"> + <Link to={backHref}>{"<- Back"}</Link> + </div> <div className="w-100 tl pv4 flex justify-center"> <SidebarSwitcher sidebarShown={props.sidebarShown}
Check empty string before strtol() There is no need to call strtol() if the input string is empty.
@@ -65,8 +65,12 @@ static int parse_args(struct args *args, int argc, char *argv[]) { } case 'p': { char *endptr; + if (*optarg == '\0') { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid port parameter is empty"); + return -1; + } long value = strtol(optarg, &endptr, 0); - if (*optarg == '\0' || *endptr != '\0') { + if (*endptr != '\0') { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid port: %s", optarg); return -1; } @@ -79,8 +83,12 @@ static int parse_args(struct args *args, int argc, char *argv[]) { } case 'm': { char *endptr; + if (*optarg == '\0') { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Max size parameter is empty"); + return -1; + } long value = strtol(optarg, &endptr, 0); - if (*optarg == '\0' || *endptr != '\0') { + if (*endptr != '\0') { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid max size: %s", optarg); return -1; }
Simplify travis.yml a bit Because our build matrix has only one case we can remove the build matrix and the environment variables.
language: python +os: linux -matrix: - include: - - os: linux - env: - - LUA="lua=5.3" cache: directories: - hrenv before_install: - pip install hererocks - - hererocks hrenv -rlatest --$LUA + - hererocks hrenv --luarocks=latest --lua=5.3 - source hrenv/bin/activate install:
Improve software memory handling
# Copyright 2018 Eotvos Lorand University, Budapest, Hungary from utils.codegen import format_expr, format_statement, format_declaration +from compiler_common import unique_everseen #[ #include "stateful_memory.h" #[ global_state_t global_smem; +for stype in unique_everseen(smem.smem_type for table, smem in hlir.all_meters + hlir.all_counters): + #{ void init_${stype}_smem(${stype}_t smem[], int* global_smem_amount_ref, int amount, const char*const name, const char*const purpose) { + #{ for (int idx = 0; idx < amount; ++idx) { + #[ sprintf(smem[idx].name, "%s/%s", name, purpose); + #} } + + #[ *global_smem_amount_ref = amount; + #} } + #[ + #{ void gen_init_smems() { #[ #ifdef T4P4S_DEBUG for table, smem in hlir.all_meters + hlir.all_counters: @@ -18,11 +29,7 @@ for table, smem in hlir.all_meters + hlir.all_counters: for c in smem.components: cname = c['name'] if not smem.is_direct: - #{ for (int idx = 0; idx < ${smem.amount}; ++idx) { - #[ strcpy(global_smem.${cname}[idx].name, "${smem.name}/${c['for']}"); - #} } - - #[ global_smem.${cname}_amount = ${smem.amount}; + #[ init_${smem.smem_type}_smem(global_smem.${cname}, &global_smem.${cname}_amount, ${smem.amount}, "${smem.name}", "${c['for']}"); else: #[ strcpy(global_smem.${cname}_${table.name}.name, "${smem.name}/${c['for']}");
Reformat CMake: Ignore deleted Google test folder
@@ -33,7 +33,6 @@ fi for file in $(find . \( -name 'CMakeLists.txt' -or -name '*.cmake' \) -and \ \( \ -not -regex '.*build/.*' \ - -not -regex '.*gtest.*' \ -not -regex '.*cmake/Modules/FindHaskell.cmake$' \ \)); do
Cut out the ':' in interop runner
@@ -65,7 +65,7 @@ if [ "$ROLE" == "client" ]; then # point to the same server. REQS=($REQUESTS) REQ=${REQS[0]} - SERVER=$(echo $REQ | cut -d'/' -f3) + SERVER=$(echo $REQ | cut -d'/' -f3 | cut -d':' -f1) echo "Connecting to $SERVER" if [ "$TESTCASE" == "multiconnect" ]; then
Remove Desired Version From Sample No longer necessary.
@@ -747,15 +747,6 @@ ClientLoadConfiguration( Settings.IdleTimeoutMs = IdleTimeoutMs; Settings.IsSet.IdleTimeoutMs = TRUE; - // - // Default to using the draft-29 version for now, since it's more - // universally supported by the TLS abstractions currently. - // - const uint32_t Version = 0xff00001dU; // IETF draft 29 - Settings.DesiredVersionsList = &Version; - Settings.DesiredVersionsListLength = 1; - Settings.IsSet.DesiredVersionsList = TRUE; - // // Configures a default client configuration, optionally disabling // server certificate validation.
wpa_supplicant/dpp: Avoid deadlock while deleting DPP task Closes
@@ -349,9 +349,7 @@ static void esp_dpp_task(void *pvParameters ) for (;;) { if (xQueueReceive(s_dpp_evt_queue, &evt, portMAX_DELAY) == pdTRUE) { - if (evt->id < SIG_DPP_MAX) { - DPP_API_LOCK(); - } else { + if (evt->id >= SIG_DPP_MAX) { os_free(evt); continue; } @@ -394,7 +392,6 @@ static void esp_dpp_task(void *pvParameters ) } os_free(evt); - DPP_API_UNLOCK(); if (task_del) { break;
Analysis workflow, set MAKESHELL.
@@ -304,6 +304,7 @@ jobs: sed -e 's?^SHELL =.*$??' < tests/Makefile.orig > tests/Makefile mv xmlwf/Makefile xmlwf/Makefile.orig sed -e 's?^SHELL =.*$??' < xmlwf/Makefile.orig > xmlwf/Makefile + export MAKESHELL="/bin/sh" echo "make" make echo "make install"
move location where the EDNS is added
@@ -506,12 +506,24 @@ read_entry(FILE* in, const char* name, int *lineno, uint32_t* default_ttl, reading_hex_ednsdata = true; } else if(str_keyword(&parse, "HEX_EDNSDATA_END")) { + ldns_buffer* edns = NULL; if (!reading_hex_ednsdata) { error("%s line %d: HEX_EDNSDATA_END read but no" "HEX_EDNSDATA_BEGIN keyword seen", name, *lineno); } reading_hex_ednsdata = false; + + edns = data_buffer2wire(hex_ednsdata_buffer); + + /* add read-in EDNS directly to the reply */ + ldns_pkt_set_edns_data(cur_reply->reply, + ldns_rdf_new_frm_data(LDNS_RDF_TYPE_UNKNOWN, + ldns_buffer_limit(edns), + ldns_buffer_begin(edns))); + + /* store raw EDNS for matching */ cur_reply->raw_ednsdata = data_buffer2wire(hex_ednsdata_buffer); + ldns_buffer_free(hex_ednsdata_buffer); hex_ednsdata_buffer = NULL; } else if(reading_hex_ednsdata) { @@ -895,21 +907,6 @@ handle_query(uint8_t* inbuf, ssize_t inlen, struct entry* entries, int* count, } else { answer_pkt = ldns_pkt_clone(p->reply); adjust_packet(entry, answer_pkt, query_pkt); - - /* add EDNS from canned reply */ - - if (p->raw_ednsdata) { - ldns_pkt_set_edns_udp_size(answer_pkt, ldns_pkt_edns_udp_size(query_pkt)); - ldns_pkt_set_edns_extended_rcode(answer_pkt, ldns_pkt_edns_extended_rcode(query_pkt)); - ldns_pkt_set_edns_version(answer_pkt, ldns_pkt_edns_version(query_pkt)); - answer_pkt->_edns_present = true; - ldns_pkt_set_edns_z(answer_pkt, ldns_pkt_edns_z(query_pkt)); - ldns_pkt_set_edns_data(answer_pkt, - ldns_rdf_new_frm_data(LDNS_RDF_TYPE_UNKNOWN, - ldns_buffer_limit(p->raw_ednsdata), - ldns_buffer_export(p->raw_ednsdata))); - } - if(verbose_out) ldns_pkt_print(verbose_out, answer_pkt); status = ldns_pkt2wire(&outbuf, answer_pkt, &answer_size); verbose(1, "Answer packet size: %u bytes.\n", (unsigned int)answer_size);
CCode: Use C++ style loop for write direction
#include "ccode.hpp" + +#include <kdb.hpp> #include <kdblogger.h> +using namespace ckdb; +using CppKey = kdb::Key; +using CppKeySet = kdb::KeySet; + namespace { @@ -132,7 +138,6 @@ void readConfig (CCodeData * const mapping, KeySet * const config, Key const * c } // end namespace -using namespace ckdb; extern "C" { /** @@ -302,20 +307,20 @@ int elektraCcodeSet (Plugin * handle, KeySet * returned, Key * parentKey ELEKTRA { CCodeData * const mapping = retrieveMapping (handle); - Key * key; - ksRewind (returned); - while ((key = ksNext (returned)) != 0) + CppKeySet keys{ returned }; + for (auto key : keys) { - size_t const size = keyGetValueSize (key) * 2; + size_t const size = key.getBinarySize () * 2; if (size > mapping->bufferSize) { mapping->bufferSize = size; mapping->buffer = new unsigned char[mapping->bufferSize]; } - elektraCcodeEncode (key, mapping); + elektraCcodeEncode (*key, mapping); } + keys.release (); return ELEKTRA_PLUGIN_STATUS_SUCCESS; }
tests/run-multitests.py: Flush stdout for each line of trace output.
@@ -243,6 +243,7 @@ def trace_instance_output(instance_idx, line): if cmd_args.trace_output: t_ms = round((time.time() - trace_t0) * 1000) print("{:6} i{} :".format(t_ms, instance_idx), line) + sys.stdout.flush() def run_test_on_instances(test_file, num_instances, instances):
herb: expect * rather than @
:: ++ export-app |= [app=@tas our=@p now=@da] - .^(@ %gx /(scot %p our)/[app]/(scot %da now)/export/noun) + .^(* %gx /(scot %p our)/[app]/(scot %da now)/export/noun) ++ export-all |= [our=@p now=@da] - ^- (list [@tas @]) + ^- (list [@tas *]) %+ turn ^- (list @tas) :~ %group-store %invite-store %chat-store %chat-hook - %publish %graph-store == |= app=@tas (json-response:gen jon) :: %import-all + ~& %import-all =/ enc (de:base64 base64-jam.source.com) ?~ enc !! - =/ by-app ;;((list [@tas @]) (cue q.u.enc)) + =/ by-app ;;((list [@tas *]) (cue q.u.enc)) :_ this %+ weld (give-simple-payload:app eyre-id not-found:gen) %+ turn by-app - |= [app=@tas data=@] + |= [app=@tas data=*] ^- card:agent:gall [%pass /import-all %agent [our.bowl app] %poke %import !>(data)] ==
Cache only rebinds vertex/index buffers when needed;
@@ -3609,8 +3609,16 @@ static void flushBuffers(Pass* pass, Draw* draw) { if (draw->hash) { cache = &pass->shapeCache[draw->hash & (COUNTOF(pass->shapeCache) - 1)]; if (cache->hash == draw->hash) { + if (pass->vertexBuffer != cache->vertices) { gpu_bind_vertex_buffers(pass->stream, &cache->vertices, NULL, 0, 1); + pass->vertexBuffer = cache->vertices; + } + + if (pass->indexBuffer != cache->indices) { gpu_bind_index_buffer(pass->stream, cache->indices, 0, GPU_INDEX_U16); + pass->indexBuffer = cache->indices; + } + *draw->vertex.pointer = NULL; *draw->index.pointer = NULL; return;
Fixed issue where malformed lightcap packet could read out of mem
@@ -1731,7 +1731,7 @@ int parse_watchman_lightcap(struct SurviveContext *ctx, const char *codename, ui // https://en.wikipedia.org/wiki/Variable-length_quantity uint8_t codebyte = 0; int codelength = 0; - while ((codebyte & 0x80) == 0) { + while ((codebyte & 0x80) == 0 && mptr >= readdata) { codebyte = *(mptr--); time_delta = (time_delta << 7) | (codebyte & 0x7f); codelength++;
Add workaround for querying immersive process heaps
#include <phsettings.h> #include <phsvccl.h> #include <actions.h> +#include <appresolver.h> #include <emenu.h> #include <mainwnd.h> #include <procprv.h> @@ -345,7 +346,7 @@ PPH_STRING PhGetProcessHeapFlagsText( if (Flags & HEAP_CREATE_ALIGN_16) PhAppendStringBuilder2(&stringBuilder, L"Align 16, "); if (Flags & HEAP_CREATE_ENABLE_TRACING) - PhAppendStringBuilder2(&stringBuilder, L"Tracing enabled, "); + PhAppendStringBuilder2(&stringBuilder, L"Traceable, "); if (Flags & HEAP_CREATE_ENABLE_EXECUTE) PhAppendStringBuilder2(&stringBuilder, L"Executable, "); if (Flags & HEAP_CREATE_SEGMENT_HEAP) @@ -411,9 +412,22 @@ VOID PhpEnumerateProcessHeaps( if (Context->ProcessItem->IsImmersive) { - // TODO: Even if the immersive process is active we can still deadlock when the + PPH_STRING appUserModelId; + + if (PhAppResolverGetAppIdForProcess(Context->ProcessItem->ProcessId, &appUserModelId)) + { + PhAppResolverActivateAppId(appUserModelId, NULL, NULL); + PhDereferenceObject(appUserModelId); + } + + if (PhIsProcessSuspended(Context->ProcessItem->ProcessId)) + { + // NOTE: Even if the immersive process is active we can still deadlock when the // RtlQueryProcessDebugInformation thread hasn't completed and // the UWP process is automatically suspended by the shell. (dmex) + // + // TODO: Duplicate the job object and use the JobObjectFreezeInformation class + // to suspend and resume the UWP process or KPH with PsFreeze. PhShowError2( Context->WindowHandle, L"Unable to query heap information.", @@ -421,6 +435,7 @@ VOID PhpEnumerateProcessHeaps( ); return; } + } ExtendedListView_SetRedraw(Context->ListViewHandle, FALSE); ListView_DeleteAllItems(Context->ListViewHandle); @@ -507,6 +522,7 @@ VOID PhpEnumerateProcessHeaps( L"Unable to query 32bit heap information.", L"The 32-bit version of Process Hacker could not be located." ); + goto CleanupExit; } } else
YAMBi: Check if path to Homebrew Bison exists
@@ -22,11 +22,12 @@ function (check_dependencies) return () endif (NOT HAVE_CODECVT) - if (APPLE) - # Add path to Homebrew version of Bison + # Add path to Homebrew version of Bison, if it exists. + set (USE_HOMEBREW_BISON ${APPLE} AND EXISTS /usr/local/opt/bison) + if (USE_HOMEBREW_BISON) list (APPEND CMAKE_PREFIX_PATH "/usr/local/opt/bison") - endif (APPLE) + endif (USE_HOMEBREW_BISON) find_package (BISON 3 QUIET) if (NOT BISON_FOUND)
docs: add a timebase precision section Type: docs
@@ -239,6 +239,26 @@ reference time, at the current clock tick rate: * c->clocks_per_second; ``` +### Timebase precision + +Cognoscenti may notice that vlib/clib\_time\_now(...) return a 64-bit +floating-point value; the number of seconds since vpp started. + +Please see [this Wikipedia +article](https://en.wikipedia.org/wiki/Double-precision_floating-point_format) +for more information. C double-precision floating point numbers +(called f64 in the vpp code base) have a 53-bit effective mantissa, +and can accurately represent 15 decimal digits' worth of precision. + +There are 315,360,000.000001 seconds in ten years plus one +microsecond. That string has exactly 15 decimal digits. The vpp time +base retains 1us precision for roughly 30 years. + +vlib/clib\_time\_now do *not* provide precision in excess of 1e-6 +seconds. If necessary, please use clib_cpu_time_now(...) for direct +access to the CPU clock-cycle counter. Note that the number of CPU +clock cycles per second varies significantly across CPU architectures. + Format ------
Fix sphere winding;
@@ -1156,7 +1156,7 @@ void lovrGraphicsSphere(Material* material, mat4 transform, int segments) { for (int j = 0; j < segments; j++) { uint16_t i0 = offset0 + j; uint16_t i1 = offset1 + j; - memcpy(indices, ((uint16_t[]) { i0, i1, i0 + 1, i1, i1 + 1, i0 + 1 }), 6 * sizeof(uint16_t)); + memcpy(indices, ((uint16_t[]) { i0, i0 + 1, i1, i1, i0 + 1, i1 + 1 }), 6 * sizeof(uint16_t)); indices += 6; } }
hw: mcu: kinetis: remove custom systick Remove custom systick implementation and allow Kinetis MCUs to use the existing `SysTick_Handler` implementation already available for Cortex-M4 MCUs.
#include "mcu/cmsis_nvic.h" #include "fsl_clock.h" -static void -sys_tick_handler(void) -{ - uint32_t sr; - - OS_ENTER_CRITICAL(sr); - os_time_advance(1); - - OS_EXIT_CRITICAL(sr); -} - void os_tick_idle(os_time_t ticks) { @@ -65,7 +54,6 @@ os_tick_init(uint32_t os_ticks_per_sec, int prio) /* Set isr in vector table and enable interrupt */ NVIC_SetPriority(SysTick_IRQn, prio); - NVIC_SetVector(SysTick_IRQn, (uint32_t) sys_tick_handler); /* Enable at the NVIC */ EnableIRQ(SysTick_IRQn);
feat: add more fields for slack at bot.config
"dump_json": { "filename": "dump.json", "enable": true, - }, - "dump_curl": { - "filename": "dump.curl", - "enable": false, } }, "discord": { "token":"YOUR-BOT-TOKEN" }, "slack": { - "token":YOUR-BOT-TOKEN" + "app-token":"YOUR-APP-TOKEN", + "bot-token":"YOUR-BOT-TOKEN", + "client-id":"YOUR-CLIENT-ID", + "client-secret":"YOUR-CLIENT-SECRET", + "signing-secret":"YOUR-SIGNING-SECRET" }, "github": { "username": "YOUR-GITHUB-USERNAME",
cleaner test for mingw as host system
@@ -33,6 +33,7 @@ m4_undefine([expat_version]) AC_CONFIG_SRCDIR([Makefile.in]) AC_CONFIG_AUX_DIR([conftools]) AC_CONFIG_MACRO_DIR([m4]) +AC_CANONICAL_HOST AM_INIT_AUTOMAKE @@ -130,7 +131,14 @@ AC_ARG_WITH([tests], [ AS_HELP_STRING([--without-tests], [do not build tests @<:@default=included@:>@])], [], [with_tests=yes]) AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes]) -AM_CONDITIONAL([MINGW], [echo -- "${host}" | ${FGREP} mingw >/dev/null]) + +AS_VAR_SET([EXPATCFG_ON_MINGW],[no]) +AS_CASE("$host_os", + [mingw*], + [AS_VAR_SET([EXPATCFG_ON_MINGW],[yes]) + AC_MSG_NOTICE([detected OS: MINGW])]) +AM_CONDITIONAL([MINGW], [test x$EXPATCFG_ON_MINGW = xyes]) + AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null])