message
stringlengths
6
474
diff
stringlengths
8
5.22k
gif loader: check LZW code size (Issue
@@ -58,6 +58,10 @@ typedef struct unsigned char suffix; } gif_lzw; +enum { + gif_lzw_max_code_size = 12 +}; + typedef struct { int w, h; @@ -65,7 +69,7 @@ typedef struct int flags, bgindex, ratio, transparent, eflags; unsigned char pal[256][3]; unsigned char lpal[256][3]; - gif_lzw codes[4096]; + gif_lzw codes[1 << gif_lzw_max_code_size]; unsigned char *color_table; int parse, step; int lflags; @@ -299,7 +303,15 @@ gif_process_raster( signed int codesize, codemask, avail, oldcode, bits, valid_bits, clear; gif_lzw *p; + /* LZW Minimum Code Size */ lzw_cs = gif_get8(s); + if (lzw_cs > gif_lzw_max_code_size) { + sixel_helper_set_additional_message( + "Unsupported GIF (LZW code size)"); + status = SIXEL_RUNTIME_ERROR; + goto end; + } + clear = 1 << lzw_cs; first = 1; codesize = lzw_cs + 1; @@ -353,7 +365,7 @@ gif_process_raster( goto end; } if (oldcode >= 0) { - if (avail < 4096) { + if (avail < (1 << gif_lzw_max_code_size)) { p = &g->codes[avail++]; p->prefix = (signed short) oldcode; p->first = g->codes[oldcode].first;
Allow landscape controlls on mobile phones jsEmu Works great on ultrawide phones, pretty well on normal wide. Less confusion when itch.io says please rotate, but you can't due to missconfig
@@ -277,7 +277,7 @@ body { } } -@media only screen and (max-device-width: 812px) and (orientation: landscape) { +@media only screen and (max-device-width: 300px) and (orientation: landscape) { html, body { height: 100%;
Fix key log file open.
@@ -1353,8 +1353,6 @@ void picoquic_set_key_log_file(picoquic_quic_t *quic, char const * keylog_filena log_event->super.cb = picoquic_log_event_call_back; ctx->log_event = (ptls_log_event_t *)log_event; } - - picoquic_file_close(F_keylog); } }
emitter: Tidy up the check for assign being optimizable.
@@ -1888,53 +1888,34 @@ static lily_type *determine_left_type(lily_emit_state *emit, lily_ast *ast) return result_type; } -/* Does an assignment -really- have to be written, or can the last tree's result - be rewritten to target the left side? Given a tree (the whole assign), this - figures that out. - Note: Only valid for basic assignments. Upvalue/subscript/etc. do not belong - here. */ -static int assign_optimize_check(lily_ast *ast) +static int can_optimize_out_assignment(lily_ast *ast) { - int can_optimize = 1; - - do { - /* assigning to a global is done differently than with a local, so it - can't be optimized. */ - if (ast->left->tree_type == tree_global_var) { - can_optimize = 0; - break; - } - lily_ast *right_tree = ast->right; + int can_optimize = 0; - /* Parenths don't write anything, so dive to the bottom of them. */ while (right_tree->tree_type == tree_parenth) right_tree = right_tree->arg_start; - /* Gotta do basic assignments. */ - if (right_tree->tree_type == tree_local_var) { - can_optimize = 0; - break; - } + /* Keep these conditions away from each other since each has a different + reason why optimization can't be done. */ - /* && and || work by having one set of cases write down to one storage, - and the other set write down to another storage. Because of that, it - can't be folded, or the first set of cases will target a storage - while the second target the var. */ - if (right_tree->tree_type == tree_binary && + if (ast->left->tree_type == tree_global_var) + /* The receiver is a global var and thus in a different scope. */ + ; + else if (right_tree->tree_type == tree_local_var) + /* Can't skip basic assignments. */ + ; + else if (right_tree->tree_type == tree_binary && (right_tree->op == expr_logical_and || - right_tree->op == expr_logical_or)) { - can_optimize = 0; - break; - } - - /* Also check if the right side is an assignment or compound op. */ - if (right_tree->tree_type == tree_binary && - right_tree->op >= expr_assign) { - can_optimize = 0; - break; - } - } while (0); + right_tree->op == expr_logical_or)) + /* These operations do two different writes. */ + ; + else if (right_tree->tree_type == tree_binary && + right_tree->op >= expr_assign) + /* Compound ops (+= and the like) can't be skipped. */ + ; + else + can_optimize = 1; return can_optimize; } @@ -2722,7 +2703,7 @@ after_type_check:; if (left_tt == tree_local_var || left_tt == tree_global_var) { - if (assign_optimize_check(ast)) { + if (can_optimize_out_assignment(ast)) { /* Trees always finish by writing a result and then the line number. Optimize out by patching the result to target the left side. */ int pos = lily_u16_pos(emit->code) - 2;
Add more log message in OTA over HTTP
@@ -400,6 +400,7 @@ static void _httpReadReadyCallback( void * pPrivateData, /* Check if the server returns a response with connection field set to "close". */ if( strncmp( "close", connectionValueStr, sizeof( "close" ) ) == 0 ) { + IotLogInfo( "Connection has been closed by the HTTP server, reconnecting to the server..." ); _httpReconnect(); } @@ -482,8 +483,7 @@ static void _httpConnectionClosedCallback( void * pPrivateData, /* HTTP callback data is not used. */ ( void ) pPrivateData; - IotLogInfo( "Connection has been closed by the HTTP client due to an error, reconnecting to server..." ); - + IotLogInfo( "Connection has been closed by the HTTP client due to an error, reconnecting to the server..." ); _httpReconnect(); } @@ -824,18 +824,28 @@ OTA_Err_t _AwsIotOTA_RequestDataBlock_HTTP( OTA_AgentContext_t * pAgentCtx ) /* Reconnect to the HTTP server if we did not receive any response within OTA agent request data * timeout or we detect an error during processing the response and a reconnect is needed. */ - if( _httpDownloader.state == OTA_HTTP_WAITING_RESPONSE || _httpDownloader.err == OTA_HTTP_ERR_NEED_RECONNECT ) - { - if( _httpReconnect() != IOT_HTTPS_OK ) + if( _httpDownloader.err == OTA_HTTP_ERR_NEED_RECONNECT ) { - OTA_GOTO_CLEANUP(); + IotLogInfo( "" ); + httpsStatus = _httpReconnect(); } + else if( _httpDownloader.state == OTA_HTTP_WAITING_RESPONSE ) + { + IotLogInfo( "Still waiting for a response from the server after request timeout. Assuming " + "the connection is closed by the server, reconnecting..." ); + httpsStatus = _httpReconnect(); } /* Otherwise exit if not in idle state, this means we're still sending the request or processing * a response. */ else if( _httpDownloader.state != OTA_HTTP_IDLE ) { IotLogInfo( "Current download is not finished, skipping the request." ); + httpsStatus = IOT_HTTPS_BUSY; + } + + /* Exit if we're still busy downloading or reconnect is required but failed. */ + if( httpsStatus != IOT_HTTPS_OK ) + { OTA_GOTO_CLEANUP(); }
Update comment to match reality.
-/* Table of instructions. Each instruction +/* + Table of instructions. Each instruction is defined by the following macro: - Insn(enumval, fmt, attr) + + Insn(enumval, gasfmt, p9fmt, uses, defs) The format string 'fmt' has the following expansions: + %r - int reg %f - xmm reg %m - mem %[1-9]*t - Mode of an operand. The optional number preceeding it is the operand desired for the mode. - Currently, there aren't any attrs, because none were needed yet. - Eventually, they'll probably include flag setting and so on. The - upper case versions of these indicate Plan9 location formatting. - For technical reasons, the indexing on use and def statments is 1-based, - instead of 0-based. (0 is the sentinel value). + The uppercase version of these formats denote the plan 9 variants + of the above. + + Because 0 indictates the sentiel value, the indexing on use and def statments + is 1-based. */ #define None .l={0},.r={0} Insn(Inone,
Fix util/perl/OpenSSL/Test.pm input variable overwrite
@@ -905,9 +905,9 @@ sub __test_file { my $e = pop || ""; my $f = pop; - $f = catfile($directories{BLDTEST},@_,$f . $e); - $f = catfile($directories{SRCTEST},@_,$f) unless -f $f; - return $f; + my $out = catfile($directories{BLDTEST},@_,$f . $e); + $out = catfile($directories{SRCTEST},@_,$f) unless -f $out; + return $out; } sub __apps_file { @@ -915,9 +915,9 @@ sub __apps_file { my $e = pop || ""; my $f = pop; - $f = catfile($directories{BLDAPPS},@_,$f . $e); - $f = catfile($directories{SRCAPPS},@_,$f) unless -f $f; - return $f; + my $out = catfile($directories{BLDAPPS},@_,$f . $e); + $out = catfile($directories{SRCAPPS},@_,$f) unless -f $out; + return $out; } sub __fuzz_file { @@ -925,9 +925,9 @@ sub __fuzz_file { my $e = pop || ""; my $f = pop; - $f = catfile($directories{BLDFUZZ},@_,$f . $e); - $f = catfile($directories{SRCFUZZ},@_,$f) unless -f $f; - return $f; + my $out = catfile($directories{BLDFUZZ},@_,$f . $e); + $out = catfile($directories{SRCFUZZ},@_,$f) unless -f $out; + return $out; } sub __data_file {
[core] cygwin helper func for getcwd
#include <limits.h> #include <glob.h> +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif #if defined(HAVE_MYSQL) || (defined(HAVE_LDAP_H) && defined(HAVE_LBER_H) && defined(HAVE_LIBLDAP) && defined(HAVE_LIBLBER)) static void config_warn_authn_module (server *srv, const char *module, size_t len) { @@ -1372,39 +1375,28 @@ int config_parse_file(server *srv, config_t *context, const char *fn) { return ret; } -static char* getCWD(void) { - char *s, *s1; - size_t len; -#ifdef PATH_MAX - len = PATH_MAX; -#else - len = 4096; -#endif +#ifdef __CYGWIN__ - s = malloc(len); - if (!s) return NULL; - while (NULL == getcwd(s, len)) { - if (errno != ERANGE || SSIZE_MAX - len < len) { - free(s); +static char* getCWD(char *buf, size_t sz) { + if (NULL == getcwd(buf, sz)) { return NULL; } - len *= 2; - s1 = realloc(s, len); - if (!s1) { - free(s); - return NULL; - } - s = s1; + for (size_t i = 0; buf[i]; ++i) { + if (buf[i] == '\\') buf[i] = '/'; } - return s; + return buf; } +#define getcwd(buf, sz) getCWD((buf),(sz)) + +#endif /* __CYGWIN__ */ + int config_parse_cmd(server *srv, config_t *context, const char *cmd) { int ret = 0; - char *oldpwd; int fds[2]; + char oldpwd[PATH_MAX]; - if (NULL == (oldpwd = getCWD())) { + if (NULL == getcwd(oldpwd, sizeof(oldpwd))) { log_error_write(srv, __FILE__, __LINE__, "s", "cannot get cwd", strerror(errno)); return -1; @@ -1414,7 +1406,6 @@ int config_parse_cmd(server *srv, config_t *context, const char *cmd) { if (0 != chdir(context->basedir->ptr)) { log_error_write(srv, __FILE__, __LINE__, "sbs", "cannot change directory to", context->basedir, strerror(errno)); - free(oldpwd); return -1; } } @@ -1488,7 +1479,6 @@ int config_parse_cmd(server *srv, config_t *context, const char *cmd) { "cannot change directory to", oldpwd, strerror(errno)); ret = -1; } - free(oldpwd); return ret; } @@ -1536,8 +1526,8 @@ int config_read(server *srv, const char *fn) { *array_get_int_ptr(dc->value, CONST_STR_LEN("var.PID")) = getpid(); dcwd = srv->tmp_buf; - buffer_string_prepare_copy(dcwd, 4095); - if (NULL != getcwd(dcwd->ptr, 4095)) { + buffer_string_prepare_copy(dcwd, PATH_MAX-1); + if (NULL != getcwd(dcwd->ptr, buffer_string_space(dcwd)+1)) { buffer_commit(dcwd, strlen(dcwd->ptr)); array_set_key_value(dc->value, CONST_STR_LEN("var.CWD"), CONST_BUF_LEN(dcwd)); }
CMSIS-DSP: Correction for float16 support with MVE.
@@ -363,12 +363,12 @@ inline float16x8_t vtanhq_f16(float16x8_t val) return tanh; } -inline float16x8_t vtaylor_polyq_f16(float16x8_t x, const std::array<float16x8_t, 8> &coeffs) +inline float16x8_t vtaylor_polyq_f16(float16x8_t x, const float16_t *coeffs) { - const float16x8_t A = vaddq_f16(coeffs[0], vmulq_f16(coeffs[4], x)); - const float16x8_t B = vaddq_f16(coeffs[2], vmulq_f16(coeffs[6], x)); - const float16x8_t C = vaddq_f16(coeffs[1], vmulq_f16(coeffs[5], x)); - const float16x8_t D = vaddq_f16(coeffs[3], vmulq_f16(coeffs[7], x)); + const float16x8_t A = vaddq_f16(&coeffs[8*0], vmulq_f16(&coeffs[8*4], x)); + const float16x8_t B = vaddq_f16(&coeffs[8*2], vmulq_f16(&coeffs[8*6], x)); + const float16x8_t C = vaddq_f16(&coeffs[8*1], vmulq_f16(&coeffs[8*5], x)); + const float16x8_t D = vaddq_f16(&coeffs[8*3], vmulq_f16(&coeffs[8*7], x)); const float16x8_t x2 = vmulq_f16(x, x); const float16x8_t x4 = vmulq_f16(x2, x2); const float16x8_t res = vaddq_f16(vaddq_f16(A, vmulq_f16(B, x2)), vmulq_f16(vaddq_f16(C, vmulq_f16(D, x2)), x4));
jenkins: issues -> problems
@@ -457,7 +457,7 @@ def generateFullBuildStages() { */ // Generate tests for different release types - // Detects issues with debug modules enabled or disabled + // Detects problems with debug modules enabled or disabled for(plugins in ['ALL', 'NODEP']) { for(buildType in ['Debug', 'Release', 'RelWithDebInfo']) { if (plugins == 'ALL' && buildType == 'RelWithDebInfo') {
Added clone syscall check for uid/gid mapping. Now it's possible to pass -DNXT_HAVE_CLONE=0 for debugging.
@@ -207,7 +207,7 @@ nxt_process_create(nxt_task_t *task, nxt_process_t *process) goto fail; } -#if (NXT_HAVE_CLONE_NEWUSER) +#if (NXT_HAVE_CLONE && NXT_HAVE_CLONE_NEWUSER) if ((init->isolation.clone.flags & CLONE_NEWUSER) == CLONE_NEWUSER) { ret = nxt_clone_proc_map(task, pid, &init->isolation.clone); if (nxt_slow_path(ret != NXT_OK)) {
Enhance search of libstdc++-6.dll
@@ -807,6 +807,15 @@ if(TINYSPLINE_RUNTIME_LIBRARIES STREQUAL "") include(InstallRequiredSystemLibraries) elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") get_filename_component(basedir ${CMAKE_CXX_COMPILER} DIRECTORY) + if(NOT EXISTS "${basedir}/libstdc++-6.dll") + set(basedir "${CMAKE_INSTALL_PREFIX}/bin") + if(NOT EXISTS "${basedir}/libstdc++-6.dll") + set(basedir "${CMAKE_INSTALL_PREFIX}/lib") + if(NOT EXISTS "${basedir}/libstdc++-6.dll") + message(FATAL_ERROR "Cannot find libstdc++-6.dll") + endif() + endif() + endif() list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS "${basedir}/libstdc++-6.dll" )
HW: Do not automatically detach action on <STOP> when interrupt is enabled
@@ -95,6 +95,7 @@ ARCHITECTURE job_manager OF job_manager IS SIGNAL detach_action_q : std_ulogic_vector(NUM_OF_ACTION_TYPES-1 DOWNTO 0); SIGNAL check_for_idle_q : std_ulogic_vector(ACTION_BITS-1 DOWNTO 0); SIGNAL enable_check_for_idle_q : ACTION_ID_ARRAY(NUM_OF_ACTION_TYPES-1 DOWNTO 0); + SIGNAL job_queue_mode_q : std_ulogic_vector(NUM_OF_ACTION_TYPES-1 DOWNTO 0); SIGNAL action_active_q : std_ulogic_vector(NUM_OF_ACTIONS-1 DOWNTO 0); SIGNAL ctx_fifo_we : std_ulogic_vector(NUM_OF_ACTION_TYPES-1 DOWNTO 0); @@ -302,6 +303,7 @@ BEGIN assign_action_fsm_q <= ST_RESET; current_contexts_q <= (OTHERS => (OTHERS => '0')); enable_check_for_idle_q(sat_id) <= (OTHERS => '0'); + job_queue_mode_q(sat_id) <= '0'; int_fifo_assign_we_q(sat_id) <= '0'; ELSE @@ -317,6 +319,7 @@ BEGIN assign_action_fsm_q <= assign_action_fsm_q; current_contexts_q <= current_contexts_q; enable_check_for_idle_q(sat_id) <= (OTHERS => '0'); + job_queue_mode_q(sat_id) <= job_queue_mode_q(sat_id); int_fifo_assign_we_q(sat_id) <= '0'; -- @@ -365,6 +368,7 @@ BEGIN WHEN ST_RETURN_MMIO_LOCK => enable_check_for_idle_q(sat_id)(to_integer(unsigned(assign_action_id_q(sat_id)))) <= mmj_d_i.job_queue_mode OR mmj_d_i.cpl_int_enable; + job_queue_mode_q(sat_id) <= mmj_d_i.job_queue_mode; IF mmj_c_i.action_ack = '1' THEN assign_require_mmio_q <= '0'; assign_action_fsm_q <= ST_WAIT_FREE_ACTION; @@ -419,7 +423,7 @@ BEGIN action_completed_fifo_re(sat_id) <= '0'; action_completed_fifo_we(sat_id) <= '0'; action_completed_v := '0'; - IF (unsigned(mmj_d_i.sat(to_integer(unsigned(xj_c_i.action)))) = to_unsigned(sat_id, ACTION_BITS)) THEN + IF (job_queue_mode_q(sat_id) = '1') AND (unsigned(mmj_d_i.sat(to_integer(unsigned(xj_c_i.action)))) = to_unsigned(sat_id, ACTION_BITS)) THEN action_completed_fifo_we(sat_id) <= xj_c_i.valid; action_completed_fifo_din(sat_id) <= xj_c_i.action; action_completed_v := xj_c_i.valid;
plugin-template: add state
@@ -25,9 +25,10 @@ static const clap_plugin_descriptor_t s_my_plug_desc = { typedef struct { clap_plugin_t plugin; const clap_host_t *host; - const clap_host_latency_t *hostLatency; - const clap_host_log_t *hostLog; - const clap_host_thread_check_t *hostThreadCheck; + const clap_host_latency_t *host_latency; + const clap_host_log_t *host_log; + const clap_host_thread_check_t *host_thread_check; + const clap_host_state_t *host_state; uint32_t latency; } my_plug_t; @@ -96,6 +97,29 @@ static const clap_plugin_latency_t s_my_plug_latency = { .get = my_plug_latency_get, }; +//////////////// +// clap_state // +//////////////// + +bool my_plug_state_save(const clap_plugin_t *plugin, const clap_ostream_t *stream) +{ + my_plug_t *plug = plugin->plugin_data; + // TODO: write the state into stream + return true; +} + +bool my_plug_state_load(const clap_plugin_t *plugin, const clap_istream_t *stream) +{ + my_plug_t *plug = plugin->plugin_data; + // TODO: read the state from stream + return true; +} + +static const clap_plugin_state_t s_my_plug_state = { + .save = my_plug_state_save, + .load = my_plug_state_load, +}; + ///////////////// // clap_plugin // ///////////////// @@ -104,9 +128,10 @@ static bool my_plug_init(const struct clap_plugin *plugin) { my_plug_t *plug = plugin->plugin_data; // Fetch host's extensions here - plug->hostLog = plug->host->get_extension(plug->host, CLAP_EXT_LOG); - plug->hostThreadCheck = plug->host->get_extension(plug->host, CLAP_EXT_THREAD_CHECK); - plug->hostLatency = plug->host->get_extension(plug->host, CLAP_EXT_LATENCY); + plug->host_log = plug->host->get_extension(plug->host, CLAP_EXT_LOG); + plug->host_thread_check = plug->host->get_extension(plug->host, CLAP_EXT_THREAD_CHECK); + plug->host_latency = plug->host->get_extension(plug->host, CLAP_EXT_LATENCY); + plug->host_state = plug->host->get_extension(plug->host, CLAP_EXT_STATE); return true; } @@ -249,8 +274,9 @@ static const void *my_plug_get_extension(const struct clap_plugin *plugin, const return &s_my_plug_audio_ports; if (!strcmp(id, CLAP_EXT_NOTE_PORTS)) return &s_my_plug_note_ports; + if (!strcmp(id, CLAP_EXT_STATE)) + return &s_my_plug_state; // TODO: add support to CLAP_EXT_PARAMS - // TODO: add support to CLAP_EXT_STATE return NULL; } @@ -340,6 +366,7 @@ static const void *entry_get_factory(const char *factory_id) { return NULL; } +// This symbol will be resolved by the host CLAP_EXPORT const clap_plugin_entry_t clap_entry = { .clap_version = CLAP_VERSION_INIT, .init = entry_init,
nat: pnat only use save_rewrite_length on output path Don't expect save_rewrite_length to be set correctly on RX path. Type: fix
@@ -132,7 +132,8 @@ static_always_inline uword pnat_node_inline(vlib_main_t *vm, u32 sw_if_index0 = vnet_buffer(b[0])->sw_if_index[dir]; u16 sport0 = vnet_buffer(b[0])->ip.reass.l4_src_port; u16 dport0 = vnet_buffer(b[0])->ip.reass.l4_dst_port; - u32 iph_offset = vnet_buffer(b[0])->ip.reass.save_rewrite_length; + u32 iph_offset = + dir == VLIB_TX ? vnet_buffer(b[0])->ip.save_rewrite_length : 0; ip0 = (ip4_header_t *)(vlib_buffer_get_current(b[0]) + iph_offset); interface = pnat_interface_by_sw_if_index(sw_if_index0); ASSERT(interface); @@ -146,8 +147,6 @@ static_always_inline uword pnat_node_inline(vlib_main_t *vm, if (clib_bihash_search_16_8(&pm->flowhash, &kv, &value) == 0) { /* Cache hit */ *pi = value.value; - u32 iph_offset = vnet_buffer(b[0])->ip.reass.save_rewrite_length; - ip0 = (ip4_header_t *)(vlib_buffer_get_current(b[0]) + iph_offset); u32 errno0 = pnat_rewrite_ip4(value.value, ip0); if (PREDICT_FALSE(errno0)) { next[0] = PNAT_NEXT_DROP;
[core] handle fds pending close after poll timeout (fixes handle fds pending close whether or not new events are triggered (thx davidm) x-ref: "POST to mod_cgi sometimes hangs"
@@ -2085,13 +2085,14 @@ static int server_main (server * const srv, int argc, char **argv) { (*handler)(srv, context, revents); } } while (--n > 0); - fdevent_sched_run(srv, srv->ev); } else if (n < 0 && errno != EINTR) { log_error_write(srv, __FILE__, __LINE__, "ss", "fdevent_poll failed:", strerror(errno)); } + if (n >= 0) fdevent_sched_run(srv, srv->ev); + for (ndx = 0; ndx < srv->joblist->used; ndx++) { connection *con = srv->joblist->ptr[ndx]; connection_state_machine(srv, con);
release-tests: fix kdb set call
@@ -16,7 +16,7 @@ log_strace() { strace -o $BASE_DIR/$VERSION/$CONTEXT/mount.strace kdb mount file.ecf user:/release_test strace -o $BASE_DIR/$VERSION/$CONTEXT/file.strace kdb file user:/release_test/b - strace -o $BASE_DIR/$VERSION/$CONTEXT/set.strace kdb set user:/release_test/b + strace -o $BASE_DIR/$VERSION/$CONTEXT/set.strace kdb set user:/release_test/b "" strace -o $BASE_DIR/$VERSION/$CONTEXT/get.strace kdb get user:/release_test/b strace -o $BASE_DIR/$VERSION/$CONTEXT/rm.strace kdb rm user:/release_test/b strace -o $BASE_DIR/$VERSION/$CONTEXT/umount.strace kdb umount user:/release_test
Bring the U2F timeout back to the original value
@@ -133,7 +133,7 @@ class U2FHid(TransportLayer): raise ValueError("Endpoint/U2F command is out of range '0 < endpoint <= 0xFF'") if cid < 0 or cid > 0xFFFFFFFF: raise ValueError("Channel id is out of range '0 < cid <= 0xFFFFFFFF'") - timeout_ms = 5000 + timeout_ms = 5000000 buf = self._device.read(USB_REPORT_SIZE, timeout_ms) if len(buf) >= 3: reply_cid = ((buf[0] * 256 + buf[1]) * 256 + buf[2]) * 256 + buf[3] @@ -147,7 +147,7 @@ class U2FHid(TransportLayer): # CONT response buf = self._device.read(USB_REPORT_SIZE, timeout_ms) if len(buf) < 3: - raise Exception("Did not receive a continuation frame after 5 seconds.") + raise Exception("Did not receive a continuation frame after 5000 seconds.") data += buf[5:] idx += len(buf) - 5 if reply_cid != cid: @@ -155,7 +155,7 @@ class U2FHid(TransportLayer): if reply_cmd != endpoint: raise Exception(f"- USB command mismatch {reply_cmd:x} != {endpoint:x}") return bytes(data[:data_len]) - raise Exception("Did not read anything after 5 seconds.") + raise Exception("Did not read anything after 5000 seconds.") def close(self) -> None: self._device.close()
rune: Fix static compilation error `make static` should depend on *.pb.go files.
@@ -47,7 +47,7 @@ skeleton: libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.so libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.so: make -C libenclave/internal/runtime/pal/skeleton -static: +static: $(PROTOS) $(GO_BUILD_STATIC) -o rune . $(GO_BUILD_STATIC) -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
Base 666: Remove useless whitespace
@@ -23,9 +23,7 @@ static inline KeySet * base666Contract (void) keyNew ("system/elektra/modules/base666/exports/get", KEY_FUNC, elektraBase666Get, KEY_END), keyNew ("system/elektra/modules/base666/exports/set", KEY_FUNC, elektraBase666Set, KEY_END), #include ELEKTRA_README (base666) - keyNew ("system/elektra/modules/base666/infos/version", KEY_VALUE, PLUGINVERSION, KEY_END), - - KS_END); + keyNew ("system/elektra/modules/base666/infos/version", KEY_VALUE, PLUGINVERSION, KEY_END), KS_END); } /**
Fix iotivity bug in usage of mutex
@@ -1164,9 +1164,6 @@ const CASecureEndpoint_t *GetCASecureEndpointData(const CAEndpoint_t* peer) { OIC_LOG_V(DEBUG, NET_SSL_TAG, "In %s", __func__); - // TODO: Added as workaround, need to debug - oc_mutex_unlock(g_sslContextMutex); - oc_mutex_lock(g_sslContextMutex); if (NULL == g_caSslContext) { @@ -2657,9 +2654,6 @@ CAResult_t CAsslGenerateOwnerPsk(const CAEndpoint_t *endpoint, VERIFY_NON_NULL_RET(provServerDeviceId, NET_SSL_TAG, "provId is NULL", CA_STATUS_INVALID_PARAM); VERIFY_NON_NULL_RET(ownerPsk, NET_SSL_TAG, "ownerPSK is NULL", CA_STATUS_INVALID_PARAM); - // TODO: Added as workaround, need to debug - oc_mutex_unlock(g_sslContextMutex); - oc_mutex_lock(g_sslContextMutex); if (NULL == g_caSslContext) {
detection of freeRADIUS authentication (Ethernet II header)
@@ -2739,6 +2739,7 @@ if(caplen < (uint32_t)IPV4_SIZE_MIN) return; } ipv4 = (ipv4_t*)packet; + if((ipv4->ver_hlen & 0xf0) != 0x40) { return; @@ -2749,6 +2750,7 @@ if(caplen < (uint32_t)ipv4len) return; } packet_ptr = packet +ipv4len; + if(ipv4->nextprotocol == NEXTHDR_ICMP4) { processicmp4packet(); @@ -2971,6 +2973,8 @@ uint8_t *packet_ptr; eth2 = (eth2_t*)packet; packet_ptr = packet; +packet_ptr += ETH2_SIZE; +caplen -= ETH2_SIZE; if(ntohs(eth2->ether_type) == LLC_TYPE_IPV4) { processipv4packet(tv_sec, tv_usec, caplen, packet_ptr); @@ -2994,10 +2998,10 @@ uint8_t *packet_ptr; loba = (loba_t*)packet; packet_ptr = packet; -if(ntohl(loba->family == AF_INET)) - { packet_ptr += LOBA_SIZE; caplen -= LOBA_SIZE; +if(ntohl(loba->family == AF_INET)) + { processipv4packet(tv_sec, tv_usec, caplen, packet_ptr); processipv6packet(tv_sec, tv_usec, caplen, packet_ptr); } @@ -3044,8 +3048,6 @@ else if(linktype == DLT_EN10MB) printf("failed to read ethernet header\n"); return; } - packet_ptr += ETH2_SIZE; - caplen -= ETH2_SIZE; processethernetpacket(tv_sec, tv_usec, caplen, packet); return; }
sim: Make BootGoResult into an enum Now that this result is abstracted, take the special case for a sim stop and make it its own field. This hides the magic number we use to indicate this to be entirely within mcuboot-sys.
@@ -13,30 +13,41 @@ use crate::api; /// The result of an invocation of `boot_go`. This is intentionally opaque so that we can provide /// accessors for everything we need from this. #[derive(Debug)] -pub struct BootGoResult { +pub enum BootGoResult { + /// This run was stopped by the flash simulation mechanism. + Stopped, + /// The bootloader ran to completion with the following data. + Normal { result: i32, asserts: u8, + }, } impl BootGoResult { /// Was this run interrupted. pub fn interrupted(&self) -> bool { - self.result == -0x13579 + matches!(self, BootGoResult::Stopped) } /// Was this boot run successful (returned 0) pub fn success(&self) -> bool { - self.result == 0 + matches!(self, BootGoResult::Normal { result: 0, .. }) } /// Success, but also no asserts. pub fn success_no_asserts(&self) -> bool { - self.result == 0 && self.asserts == 0 + matches!(self, BootGoResult::Normal { + result: 0, + asserts: 0, + }) } - /// Get the asserts count. + /// Get the asserts count. An interrupted run will be considered to have no asserts. pub fn asserts(&self) -> u8 { - self.asserts + match self { + BootGoResult::Normal { asserts, .. } => *asserts, + _ => 0, + } } } @@ -72,7 +83,11 @@ pub fn boot_go(multiflash: &mut SimMultiFlash, areadesc: &AreaDesc, for &dev_id in multiflash.keys() { api::clear_flash(dev_id); } - BootGoResult { result, asserts } + if result == -0x13579 { + BootGoResult::Stopped + } else { + BootGoResult::Normal { result, asserts } + } } pub fn boot_trailer_sz(align: u32) -> u32 {
Fixed bug in xstar[0] input
@@ -1108,11 +1108,12 @@ static void ccl_cosmology_compute_power_emu(ccl_cosmology * cosmo, int * status) return; } + //For each redshift: for (int j = 0; j < na; j++){ //Turn cosmology into xstar: - xstar[0] = cosmo->params.Omega_c*cosmo->params.h*cosmo->params.h; + xstar[0] = (cosmo->params.Omega_c+cosmo->params.Omega_b)*cosmo->params.h*cosmo->params.h; xstar[1] = cosmo->params.Omega_b*cosmo->params.h*cosmo->params.h; xstar[2] = cosmo->params.sigma_8; xstar[3] = cosmo->params.h;
hv: vtd: check bus number when assign/unassign device Input parameter "bus" of assign_iommu_device/unassign_iommu_device may be from hypercall. And the conext tables are static allocated according to CONFIG_IOMMU_BUS_NUM. Need to check the bus value to avoid access invalid memory address with invalid value. Acked-by: Anthony Xu
@@ -1155,6 +1155,9 @@ static int32_t remove_iommu_device(const struct iommu_domain *domain, uint16_t s if (dmar_unit == NULL) { pr_err("no dmar unit found for device: %x:%x.%x", bus, pci_slot(devfun), pci_func(devfun)); ret = -EINVAL; + } else if (dmar_unit->drhd->ignore) { + dev_dbg(ACRN_DBG_IOMMU, "device is ignored :0x%x:%x.%x", bus, pci_slot(devfun), pci_func(devfun)); + ret = -EINVAL; } else { root_table = (struct dmar_entry *)hpa2hva(dmar_unit->root_table_addr); root_entry = root_table + bus; @@ -1257,9 +1260,11 @@ void destroy_iommu_domain(struct iommu_domain *domain) int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun) { int32_t status = 0; + uint16_t bus_local = bus; /* TODO: check if the device assigned */ + if (bus_local < CONFIG_IOMMU_BUS_NUM) { if (fallback_iommu_domain != NULL) { status = remove_iommu_device(fallback_iommu_domain, 0U, bus, devfun); } @@ -1267,6 +1272,9 @@ int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t de if (status == 0) { status = add_iommu_device(domain, 0U, bus, devfun); } + } else { + status = -EINVAL; + } return status; } @@ -1274,13 +1282,19 @@ int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t de int32_t unassign_iommu_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun) { int32_t status = 0; + uint16_t bus_local = bus; /* TODO: check if the device assigned */ + + if (bus_local < CONFIG_IOMMU_BUS_NUM) { status = remove_iommu_device(domain, 0U, bus, devfun); if ((status == 0) && (fallback_iommu_domain != NULL)) { status = add_iommu_device(fallback_iommu_domain, 0U, bus, devfun); } + } else { + status = -EINVAL; + } return status; }
Docs - adding note/example about not specifying GPDB ports that conflict with OS.
connections are created during operations such as query execution. Transient connections for query execution processes, data movement, and statistics collection use available ports in the range 1025 to 65535 with both TCP and UDP protocols. </p> + <note>To avoid port conflicts between Greenplum Database and other applications when + initializing Greenplum Database, do not specify Greenplum Database ports in the range + specified by the operating system parameter <codeph>net.ipv4.ip_local_port_range</codeph>. For + example, if <codeph>net.ipv4.ip_local_port_range = 10000 65535</codeph>, you could set the + Greenplum Database base port numbers to values outside of that + range:<codeblock>PORT_BASE = 6000 +MIRROR_PORT_BASE = 7000 +REPLICATION_PORT_BASE = 8000 +MIRROR_REPLICATION_PORT_BASE = 9000</codeblock></note> <p>Some add-on products and services that work with Greenplum Database have additional networking requirements. The following table lists ports and protocols used within the Greenplum cluster, and includes services and applications that integrate with Greenplum
lpeg: fix acceptable version range for lua Allow lua-2.1.* and lua-2.2.*.
`lpeg` uses [PVP Versioning][]. +## lpeg-1.0.3 + +Released 2022-01-29. + +- Allow lua-2.2.*. + ## lpeg-1.0.2 -Released 29-01-2022. +Released 2022-01-29. -- Allow lua-2.1.0. +- Allow lua-2.1.*. ## lpeg-1.0.1
yolint with updated printf check
@@ -3,14 +3,14 @@ RESOURCES_LIBRARY() IF (HOST_OS_LINUX) - DECLARE_EXTERNAL_RESOURCE(YOLINT sbr:1223392710) - DECLARE_EXTERNAL_RESOURCE(YOLINT_NEXT sbr:1223392710) + DECLARE_EXTERNAL_RESOURCE(YOLINT sbr:1255096669) + DECLARE_EXTERNAL_RESOURCE(YOLINT_NEXT sbr:1255096669) ELSEIF (HOST_OS_DARWIN) - DECLARE_EXTERNAL_RESOURCE(YOLINT sbr:1223393616) - DECLARE_EXTERNAL_RESOURCE(YOLINT_NEXT sbr:1223393616) + DECLARE_EXTERNAL_RESOURCE(YOLINT sbr:1255096323) + DECLARE_EXTERNAL_RESOURCE(YOLINT_NEXT sbr:1255096323) ELSEIF (HOST_OS_WINDOWS) - DECLARE_EXTERNAL_RESOURCE(YOLINT sbr:1223395359) - DECLARE_EXTERNAL_RESOURCE(YOLINT_NEXT sbr:1223395359) + DECLARE_EXTERNAL_RESOURCE(YOLINT sbr:1255096581) + DECLARE_EXTERNAL_RESOURCE(YOLINT_NEXT sbr:1255096581) ELSE() MESSAGE(FATAL_ERROR Unsupported host platform) ENDIF()
overridable $ver & $branch
@@ -44,7 +44,7 @@ try{ writeErrorTip 'Please set environment var "TMP" to another path' myExit 1 } -$ver='v2.1.3' +if($ver -eq $null){ $ver='v2.1.3' } Write-Host 'Start downloading... Hope amazon S3 is not broken again' try{ Invoke-Webrequest "https://github.com/tboox/xmake/releases/download/$ver/xmake-$ver.exe" -OutFile "$outfile" @@ -75,7 +75,7 @@ try{ writeErrorTip 'But xmake could not run... Why?' myExit 1 } -$branch='master' +if($branch -eq $null){ $branch='master' } Write-Host "Pulling xmake from branch $branch" $outfile=$temppath+"\$pid-xmake-repo.zip" try{
Proper checks
@@ -293,12 +293,12 @@ def _fix_user_data(orig_cmd, shell, user_input, user_output, strategy): continue cmd.append(arg) - for srcs, dst in [ - (user_input, input_data), - (user_output, output_data), + for srcs, dst, local_path_iter in [ + (user_input, input_data, lambda x: x.values()), + (user_output, output_data, lambda x: x.keys()), ]: if srcs: - for path in srcs.values(): + for path in local_path_iter(srcs): if path and path.startswith('/'): raise InvalidInputError("Don't use abs path for specifying destination path '{}'".format(path)) dst.update(srcs)
feat(calendar) improve MicroPython example Small improvements: Remove cast from get_pressed_date Check return value of get_pressed_date Call set_today_date on clicked date Compact highlighted_days Added a switch to show different header type
@@ -4,8 +4,8 @@ def event_handler(evt): if code == lv.EVENT.VALUE_CHANGED: source = evt.get_target() date = lv.calendar_date_t() - lv.calendar.get_pressed_date(source,date) - if date: + if source.get_pressed_date(date) == lv.RES.OK: + calendar.set_today_date(date.year, date.month, date.day) print("Clicked date: %02d.%02d.%02d"%(date.day, date.month, date.year)) @@ -18,25 +18,32 @@ calendar.set_today_date(2021, 02, 23) calendar.set_showed_date(2021, 02) # Highlight a few days -highlighted_days=[] -for i in range(3): - highlighted_days.append(lv.calendar_date_t()) - -highlighted_days[0].year=2021 -highlighted_days[0].month=02 -highlighted_days[0].day=6 - -highlighted_days[1].year=2021 -highlighted_days[1].month=02 -highlighted_days[1].day=11 - -highlighted_days[2].year=2022 -highlighted_days[2].month=02 -highlighted_days[2].day=22 - -calendar.set_highlighted_dates(highlighted_days, 3) - -header = lv.calendar_header_dropdown(lv.scr_act(),calendar) -# header = lv.calendar_header_arrow(lv.scr_act(),calendar,25) - - +highlighted_days=[ + lv.calendar_date_t({'year':2021, 'month':2, 'day':6}), + lv.calendar_date_t({'year':2021, 'month':2, 'day':11}), + lv.calendar_date_t({'year':2021, 'month':2, 'day':22}) +] + +calendar.set_highlighted_dates(highlighted_days, len(highlighted_days)) + +# 2 options for header +header1 = lv.calendar_header_dropdown(lv.scr_act(),calendar) +header2 = lv.calendar_header_arrow(lv.scr_act(),calendar,25) + +# Switch to switch headeres +header2.add_flag(lv.obj.FLAG.HIDDEN) +header1.clear_flag(lv.obj.FLAG.HIDDEN) + +sw = lv.switch(lv.scr_act()) +sw.set_pos(20,20) + +def sw_cb(e): + obj = e.get_target() + if obj.has_state(lv.STATE.CHECKED): + header1.add_flag(lv.obj.FLAG.HIDDEN) + header2.clear_flag(lv.obj.FLAG.HIDDEN) + else: + header2.add_flag(lv.obj.FLAG.HIDDEN) + header1.clear_flag(lv.obj.FLAG.HIDDEN) + +sw.add_event_cb(sw_cb, lv.EVENT.VALUE_CHANGED, None)
Broke 2 long lines
@@ -705,7 +705,8 @@ int mbedtls_ecp_point_write_binary( const mbedtls_ecp_group *grp, { int ret = MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE; size_t plen; - if( format != MBEDTLS_ECP_PF_UNCOMPRESSED && format != MBEDTLS_ECP_PF_COMPRESSED ) + if( format != MBEDTLS_ECP_PF_UNCOMPRESSED && + format != MBEDTLS_ECP_PF_COMPRESSED ) return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); plen = mbedtls_mpi_size( &grp->P ); @@ -866,7 +867,8 @@ int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp, const mbedtls_ecp unsigned char *buf, size_t blen ) { int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; - if( format != MBEDTLS_ECP_PF_UNCOMPRESSED && format != MBEDTLS_ECP_PF_COMPRESSED ) + if( format != MBEDTLS_ECP_PF_UNCOMPRESSED && + format != MBEDTLS_ECP_PF_COMPRESSED ) return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); /*
SOVERSION bump to version 7.11.0
@@ -71,8 +71,8 @@ set(SYSREPO_VERSION ${SYSREPO_MAJOR_VERSION}.${SYSREPO_MINOR_VERSION}.${SYSREPO_ # Major version is changed with every backward non-compatible API/ABI change, minor version changes # with backward compatible change and micro version is connected with any internal change of the library. set(SYSREPO_MAJOR_SOVERSION 7) -set(SYSREPO_MINOR_SOVERSION 10) -set(SYSREPO_MICRO_SOVERSION 2) +set(SYSREPO_MINOR_SOVERSION 11) +set(SYSREPO_MICRO_SOVERSION 0) set(SYSREPO_SOVERSION_FULL ${SYSREPO_MAJOR_SOVERSION}.${SYSREPO_MINOR_SOVERSION}.${SYSREPO_MICRO_SOVERSION}) set(SYSREPO_SOVERSION ${SYSREPO_MAJOR_SOVERSION})
remove distro lapack/blas
@@ -69,13 +69,13 @@ License: BSD-3-Clause Group: %{PROJ_NAME}/dev-tools Url: http://www.scipy.org Source0: https://github.com/scipy/scipy/archive/v%{version}.tar.gz#$/%{pname}-%{version}.tar.gz -BuildRequires: blas-devel +#BuildRequires: blas-devel Source1: OHPC_macros %if 0%{?sles_version} || 0%{?suse_version} BuildRequires: fdupes %endif BuildRequires: fftw-%{compiler_family}-%{mpi_family}%{PROJ_DELIM} -BuildRequires: lapack-devel +#BuildRequires: lapack-devel BuildRequires: python-devel BuildRequires: python-setuptools BuildRequires: python-Cython
[kernel] fix unused variable warning
@@ -218,7 +218,7 @@ void Topology::__removeInteractionFromIndexSet(SP::Interaction inter) void Topology::insertDynamicalSystem(SP::DynamicalSystem ds) { - DynamicalSystemsGraph::VDescriptor dsgv = _DSG[0]->add_vertex(ds); + _DSG[0]->add_vertex(ds); } void Topology::setName(SP::DynamicalSystem ds, const std::string& name)
proc/stack cannary: No need to check if process != NULL We need to set t->ustack anyway JIRA:
@@ -819,13 +819,10 @@ int proc_threadCreate(process_t *process, void (*start)(void *), unsigned int *i /* Prepare initial stack */ hal_cpuCreateContext(&t->context, start, t->kstack, t->kstacksz, stack + stacksz, arg); - if (process != NULL) { + if (process != NULL) hal_cpuSetCtxGot(t->context, process->got); + threads_canaryInit(t, stack); - } - else { - t->ustack = NULL; - } t->startTime = TIMER_CYC2US(hal_getTimer()); t->cpuTime = 0;
added GensKmod debug log info when using wrong animation or frame index with the sprite engine (useful for debugging)
@@ -943,7 +943,24 @@ void SPR_setAnimAndFrame(Sprite* sprite, s16 anim, s16 frame) if ((sprite->animInd != anim) || (sprite->seqInd != frame)) { +#if (LIB_DEBUG != 0) + if (anim >= sprite->definition->numAnimation) + { + KLog_U2("SPR_setAnimAndFrame: error - trying to use non existing animation #", anim, " - num animation = ", sprite->definition->numAnimation); + return; + } +#endif // LIB_DEBUG + Animation* animation = sprite->definition->animations[anim]; + +#if (LIB_DEBUG != 0) + if (frame >= animation->length) + { + KLog_U3("SPR_setAnimAndFrame: error - trying to use non existing frame #", frame, " for animation #", anim, " - num frame = ", animation->length); + return; + } +#endif // LIB_DEBUG + const u16 frameInd = animation->sequence[frame]; sprite->animInd = anim; @@ -974,6 +991,14 @@ void SPR_setAnim(Sprite* sprite, s16 anim) if (sprite->animInd != anim) { +#if (LIB_DEBUG != 0) + if (anim >= sprite->definition->numAnimation) + { + KLog_U2("SPR_setAnim: error - trying to use non existing animation #", anim, " - num animation = ", sprite->definition->numAnimation); + return; + } +#endif // LIB_DEBUG + Animation *animation = sprite->definition->animations[anim]; // first frame by default const u16 frameInd = animation->sequence[0]; @@ -1006,6 +1031,14 @@ void SPR_setFrame(Sprite* sprite, s16 frame) if (sprite->seqInd != frame) { +#if (LIB_DEBUG != 0) + if (frame >= sprite->animation->length) + { + KLog_U3("SPR_setFrame: error - trying to use non existing frame #", frame, " for animation #", sprite->animInd, " - num frame = ", sprite->animation->length); + return; + } +#endif // LIB_DEBUG + const u16 frameInd = sprite->animation->sequence[frame]; sprite->seqInd = frame;
Add url link to releases page to readme
@@ -24,11 +24,8 @@ found in this repository. 1.1 Windows ~~~~~~~~~~~ -Windows builds are available in the releases page on GitHub: - -:: - - https://github.com/rednex/rgbds/releases +Windows builds are available in the releases page on GitHub +`here <https://github.com/rednex/rgbds/releases>`__. Extract the zip and then add the executable directory to the path. For example:
wrap directory variables in quotes see
@@ -616,7 +616,7 @@ install-all: all $(PYTHONMOD_INSTALL) $(PYUNBOUND_INSTALL) $(UNBOUND_EVENT_INSTA $(INSTALL) -c -m 644 doc/unbound.conf.5 $(DESTDIR)$(mandir)/man5 $(INSTALL) -c -m 644 doc/unbound-host.1 $(DESTDIR)$(mandir)/man1 $(INSTALL) -c -m 755 unbound-control-setup $(DESTDIR)$(sbindir)/unbound-control-setup - if test ! -e $(DESTDIR)$(configfile); then $(INSTALL) -d `dirname $(DESTDIR)$(configfile)`; $(INSTALL) -c -m 644 doc/example.conf $(DESTDIR)$(configfile); fi + if test ! -e "$(DESTDIR)$(configfile)"; then $(INSTALL) -d `dirname "$(DESTDIR)$(configfile)"`; $(INSTALL) -c -m 644 doc/example.conf "$(DESTDIR)$(configfile)"; fi pythonmod-uninstall: rm -f -- $(DESTDIR)$(PYTHON_SITE_PKG)/unboundmodule.py
Fix bug when calling xsavec instruction There is an existing patch for the xsave instruction, but I came across an executable that fails with an xsavec instruction. This fixes that.
@@ -193,9 +193,9 @@ static inline void mmap_close(MMAPFILE fd) { close(fd); } static void *mmap_map(MMAPFILE fd, size_t size, size_t offset = 0) { - USIZE thesize=0; - OS_FileSizeFD(fd,&thesize); - if(static_cast<size_t>(thesize) < offset+size) + struct stat st; + fstat(fd, &st); + if(static_cast<size_t>(st.st_size) < offset+size) ftruncate(fd, offset+size); void *ret = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset); @@ -442,7 +442,7 @@ public: #ifndef TARGET_WINDOWS void fork_before(THREADID tid) { PIN_GetLock(&lock, 0); - // sync(); // commented out to be compatible with later PIN versions. Seems to work... + sync(); // TODO: Close all files, reopen later // I think this is only required for the current tid's data structure. } @@ -651,6 +651,12 @@ VOID Instruction(INS ins, VOID *v) { return; } + if(INS_Mnemonic(ins) == "XSAVEC") { + // Avoids "Cannot use IARG_MEMORYWRITE_SIZE on non-standard memory access of instruction at 0xfoo: xsavec ptr [rsp]" + // TODO: Bitch at the PIN folks. + return; + } + for(UINT32 i = 0; i < memOps; i++) { if(!filtered && INS_MemoryOperandIsRead(ins, i)) { INS_InsertPredicatedCall(
[DeviceDrivers] export pwm_enable/set to shell.
@@ -148,16 +148,67 @@ rt_err_t rt_pwm_enable(int channel) rt_err_t rt_pwm_set(int channel, rt_uint32_t period, rt_uint32_t pulse) { rt_err_t result = RT_EOK; - struct rt_device *pwm = rt_device_find("pwm"); + struct rt_device *device = rt_device_find("pwm"); + struct rt_pwm_configuration configuration = {0}; - if(!pwm) + if (!device) { return -RT_EIO; } + configuration.channel = channel; + configuration.period = period; + configuration.pulse = pulse; + result = rt_device_control(device, PWM_CMD_SET, &configuration); + return result; } -#ifdef finsh -#endif /**/ +#ifdef RT_USING_FINSH +#include <finsh.h> + +FINSH_FUNCTION_EXPORT_ALIAS(rt_pwm_enable, pwm_enable, enable pwm by channel.); +FINSH_FUNCTION_EXPORT_ALIAS(rt_pwm_set, pwm_set, set pwm.); + +#ifdef FINSH_USING_MSH +static int pwm_enable(int argc, char **argv) +{ + int result = 0; + + if (argc != 2) + { + rt_kprintf("Usage: pwm_enable 1\n"); + result = -RT_ERROR; + goto _exit; + } + + result = rt_pwm_enable(atoi(argv[1])); + +_exit: + return result; +} +MSH_CMD_EXPORT(pwm_enable, pwm_enable 1); + +static int pwm_set(int argc, char **argv) +{ + int result = 0; + + if (argc != 4) + { + rt_kprintf("Usage: pwm_set 1 100 50\n"); + result = -RT_ERROR; + goto _exit; + } + + result = rt_pwm_set(atoi(argv[1]), atoi(argv[2]), atoi(argv[3])); + +_exit: + return result; +} +MSH_CMD_EXPORT(pwm_set, pwm_set 1 100 50); + +#endif /* FINSH_USING_MSH */ + + +#endif /* RT_USING_FINSH */
filter: remove metrics context if initialization fails
@@ -247,7 +247,6 @@ void flb_filter_exit(struct flb_config *config) flb_metrics_destroy(ins->metrics); } #endif - if (ins->alias) { flb_free(ins->alias); } @@ -358,10 +357,17 @@ void flb_filter_initialize_all(struct flb_config *config) /* Create the metrics context */ in->metrics = flb_metrics_create(name); - if (in->metrics) { + if (!in->metrics) { + flb_warn("[filter] cannot initialize metrics for %s filter, " + "unloading.", name); + mk_list_del(&in->_head); + flb_free(in); + continue; + } + + /* Register filter metrics */ flb_metrics_add(FLB_METRIC_N_DROPPED, "drop_records", in->metrics); flb_metrics_add(FLB_METRIC_N_ADDED, "add_records", in->metrics); - } #endif /* Initialize the input */ @@ -389,6 +395,9 @@ void flb_filter_initialize_all(struct flb_config *config) } #endif +#ifdef FLB_HAVE_METRICS + flb_metrics_destroy(in->metrics); +#endif mk_list_del(&in->_head); flb_free(in); }
trivial: mmap runtime test was missing from runtime-tests rule
@@ -78,7 +78,7 @@ test test-noaccel: mkfs boot stage3 $(Q) $(MAKE) -C test test $(Q) $(MAKE) runtime-tests$(subst test,,$@) -RUNTIME_TESTS= creat fst getdents getrandom hw hws mkdir pipe signal vsyscall write +RUNTIME_TESTS= creat fst getdents getrandom hw hws mkdir mmap pipe signal vsyscall write .PHONY: runtime-tests runtime-tests-noaccel
sched/assert: modify assert message
@@ -444,20 +444,20 @@ void _assert(FAR const char *filename, int linenum) #ifdef CONFIG_SMP # if CONFIG_TASK_NAME_SIZE > 0 - _alert("Assertion failed CPU%d at file:%s line: %d task: %s %p\n", + _alert("Assertion failed CPU%d at file: %s:%d task: %s %p\n", up_cpu_index(), filename, linenum, running_task()->name, running_task()->entry.main); # else - _alert("Assertion failed CPU%d at file:%s line: %d\n", + _alert("Assertion failed CPU%d at file: %s:%d\n", up_cpu_index(), filename, linenum); # endif #else # if CONFIG_TASK_NAME_SIZE > 0 - _alert("Assertion failed at file:%s line: %d task: %s %p\n", + _alert("Assertion failed at file: %s:%d task: %s %p\n", filename, linenum, running_task()->name, running_task()->entry.main); # else - _alert("Assertion failed at file:%s line: %d\n", + _alert("Assertion failed at file: %s:%d\n", filename, linenum); # endif #endif
test: fix VppNeighbor.query_vpp_config
@@ -38,13 +38,14 @@ class VppNeighbor(VppObject): self.af = af self.is_static = is_static self.is_no_fib_entry = is_no_fib_entry - self.nbr_addr = inet_pton(af, nbr_addr) + self.nbr_addr = nbr_addr + self.nbr_addr_n = inet_pton(af, nbr_addr) def add_vpp_config(self): self._test.vapi.ip_neighbor_add_del( self.sw_if_index, self.mac_addr, - self.nbr_addr, + self.nbr_addr_n, is_add=1, is_ipv6=1 if AF_INET6 == self.af else 0, is_static=self.is_static, @@ -55,25 +56,20 @@ class VppNeighbor(VppObject): self._test.vapi.ip_neighbor_add_del( self.sw_if_index, self.mac_addr, - self.nbr_addr, + self.nbr_addr_n, is_ipv6=1 if AF_INET6 == self.af else 0, is_add=0, is_static=self.is_static) def query_vpp_config(self): - dump = self._test.vapi.ip_neighbor_dump( + return find_nbr(self._test, self.sw_if_index, - is_ipv6=1 if AF_INET6 == self.af else 0) - for n in dump: - if self.nbr_addr == n.ip_address \ - and self.is_static == n.is_static: - return True - return False + self.nbr_addr, + self.is_static, + self.af) def __str__(self): return self.object_id() def object_id(self): - return ("%d:%s" - % (self.sw_if_index, - inet_ntop(self.af, self.nbr_addr))) + return ("%d:%s" % (self.sw_if_index, self.nbr_addr))
libcupsfilters: Fixed typo
@@ -78,7 +78,7 @@ typedef int (*filter_function_t)(int inputfd, int outputfd, int inputseekable, typedef enum filter_out_format_e { /* Possible output formats for rastertopdf() filter function */ OUTPUT_FORMAT_PDF, /* PDF */ - OUTPUT_FORMAT_PCLM /* PCLM */ + OUTPUT_FORMAT_PCLM, /* PCLM */ OUTPUT_FORMAT_RASTER, /* CUPS/PWG Raster */ OUTPUT_FORMAT_PXL /* PCL-XL */ } filter_out_format_t;
Finish client after CONNECTION_CLOSE is sent
@@ -239,6 +239,10 @@ void Client::disconnect() { ev_io_stop(loop_, &rev_); ev_io_stop(loop_, &wev_); + // Call ev_break to stop event loop. This is strange, but it is OK + // because we have 1 client only. + ev_break(loop_, EVBREAK_ALL); + if (conn_) { ngtcp2_conn_del(conn_); conn_ = nullptr;
Update at_client.c correct a spelling mistake
@@ -870,7 +870,7 @@ int at_client_init(const char *dev_name, rt_size_t recv_bufsz) if (idx >= AT_CLIENT_NUM_MAX) { - LOG_E("AT client initialize filed! Check the maximum number(%d) of AT client.", AT_CLIENT_NUM_MAX); + LOG_E("AT client initialize failed! Check the maximum number(%d) of AT client.", AT_CLIENT_NUM_MAX); result = -RT_EFULL; goto __exit; }
add new line && id_length pointer check
@@ -1038,7 +1038,7 @@ bool secure_session_is_established(const secure_session_t *session_ctx) } themis_status_t secure_session_get_remote_id(const secure_session_t* session_ctx, uint8_t* id, size_t* id_length){ - if(!session_ctx){ + if(!session_ctx || !id_length){ return THEMIS_INVALID_PARAMETER; } if(!id || (*id_length)<(session_ctx->peer.id_length)){
[config] blank server.tag if whitespace-only
@@ -877,6 +877,9 @@ static int config_insert(server *srv) { t[1] = ' '; buffer_commit(b, 1); } + char *t = b->ptr; /*(make empty if tag is whitespace-only)*/ + while (*t==' ' || *t=='\t' || *t=='\r' || *t=='\n') ++t; + if (*t == '\0') buffer_string_set_length(b, 0); } break; case 3: /* server.max-request-size */
add bc to dependency list replace $(echo "..." | bc) by `echo ... | bc` as they do not seem to behave the same way.
@@ -61,7 +61,7 @@ DEB_DEPENDS = curl build-essential autoconf automake bison libssl-dev ccache DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-systemd DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config DEB_DEPENDS += lcov chrpath autoconf nasm indent libnuma-dev -DEB_DEPENDS += python-all python-dev python-virtualenv python-pip libffi6 +DEB_DEPENDS += python-all python-dev python-virtualenv python-pip libffi6 bc ifeq ($(OS_VERSION_ID),14.04) DEB_DEPENDS += openjdk-8-jdk-headless else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8) @@ -74,11 +74,12 @@ endif RPM_DEPENDS = redhat-lsb glibc-static java-1.8.0-openjdk-devel yum-utils RPM_DEPENDS += openssl-devel RPM_DEPENDS += numactl-devel +RPM_DEPENDS += bc ifeq ($(OS_ID)-$(OS_VERSION_ID),fedora-25) RPM_DEPENDS += python-devel RPM_DEPENDS += python2-virtualenv RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries' -else ifeq ($(shell if [ $(echo "$(OS_VERSION_ID) > 25" | bc) -eq 1 ] ; then echo "y" ; fi),"y") +else ifeq ($(shell if [ `echo "$(OS_VERSION_ID) > 25" | bc` -eq 1 ] ; then echo "y" ; fi),"y") RPM_DEPENDS += python2-devel RPM_DEPENDS += python2-virtualenv RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries' @@ -99,7 +100,7 @@ endif RPM_SUSE_DEPENDS = autoconf automake bison ccache chrpath distribution-release gcc6 glibc-devel-static RPM_SUSE_DEPENDS += java-1_8_0-openjdk-devel libopenssl-devel libtool lsb-release make openssl-devel -RPM_SUSE_DEPENDS += python-devel python-pip python-rpm-macros shadow nasm libnuma-devel +RPM_SUSE_DEPENDS += python-devel python-pip python-rpm-macros shadow nasm libnuma-devel bc ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),) STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
wuffs gen -version=0.3.0-alpha.13
@@ -65,15 +65,15 @@ extern "C" { // each major.minor branch, the commit count should increase monotonically. // // WUFFS_VERSION was overridden by "wuffs gen -version" based on revision -// a06a89c080e46db183fb65268e5cbef247c2b85a committed on 2020-08-30. +// 57d47c633ce692dff24a804382935f46f7074ebf committed on 2020-09-08. #define WUFFS_VERSION 0x000030000 #define WUFFS_VERSION_MAJOR 0 #define WUFFS_VERSION_MINOR 3 #define WUFFS_VERSION_PATCH 0 -#define WUFFS_VERSION_PRE_RELEASE_LABEL "alpha.12" -#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 2695 -#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 20200830 -#define WUFFS_VERSION_STRING "0.3.0-alpha.12+2695.20200830" +#define WUFFS_VERSION_PRE_RELEASE_LABEL "alpha.13" +#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 2702 +#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 20200908 +#define WUFFS_VERSION_STRING "0.3.0-alpha.13+2702.20200908" // Define WUFFS_CONFIG__STATIC_FUNCTIONS to make all of Wuffs' functions have // static storage. The motivation is discussed in the "ALLOW STATIC @@ -11940,7 +11940,7 @@ wuffs_base__private_implementation__high_prec_dec__to_f64( if (h->digits[0] >= 5) { break; } - shift = (h->digits[0] <= 2) ? 2 : 1; + shift = (h->digits[0] < 2) ? 2 : 1; } else { uint32_t n = (uint32_t)(-h->decimal_point); shift = (n < num_powers)
Fix Truncate function
double d = stack.Arg0().NumericByRefConst().r8; double res = 0.0; - double retVal = System::Math::Truncate(d, res); + modf(d, &res); - stack.SetResult_R8( retVal ); + stack.SetResult_R8( res ); NANOCLR_NOCLEANUP_NOLABEL();
reset version to 1
@@ -6,7 +6,7 @@ import rtconfig import shutil # version -MODULE_VER_NUM = 6 +MODULE_VER_NUM = 1 cproject_temp = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
Added SIMD macros to arm_math.h again. CMSIS NN uses this macros.
@@ -400,6 +400,34 @@ extern "C" typedef double float64_t; +/** + @brief definition to read/write two 16 bit values (Depricated). + */ +#if defined ( __CC_ARM ) + #define __SIMD32_TYPE int32_t __packed +#elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) + #define __SIMD32_TYPE int32_t +#elif defined ( __GNUC__ ) + #define __SIMD32_TYPE int32_t +#elif defined ( __ICCARM__ ) + #define __SIMD32_TYPE int32_t __packed +#elif defined ( __TI_ARM__ ) + #define __SIMD32_TYPE int32_t +#elif defined ( __CSMC__ ) + #define __SIMD32_TYPE int32_t +#elif defined ( __TASKING__ ) + #define __SIMD32_TYPE __unaligned int32_t +#else + #error Unknown compiler +#endif + +#define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) +#define __SIMD32_CONST(addr) ( (__SIMD32_TYPE * ) (addr)) +#define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE * ) (addr)) +#define __SIMD64(addr) (*( int64_t **) & (addr)) + + + /* SIMD replacement */
improves curl cleanup
@@ -95,14 +95,15 @@ char* httpsGET(const char* url) { CURLErrorHandling(res, curl); curl_easy_cleanup(curl); + curl_global_cleanup(); syslog(LOG_AUTHPRIV|LOG_DEBUG, "Response: %s\n",s.ptr); + return s.ptr; } else { + curl_global_cleanup(); syslog(LOG_AUTHPRIV|LOG_EMERG, "Couldn't init curl for Https GET. %s\n", curl_easy_strerror(res)); exit(EXIT_FAILURE); } - curl_global_cleanup(); - return s.ptr; } @@ -151,13 +152,14 @@ char* httpsPOST(const char* url, const char* data) { CURLErrorHandling(res, curl); curl_easy_cleanup(curl); + curl_global_cleanup(); syslog(LOG_AUTHPRIV|LOG_DEBUG, "Response: %s\n",s.ptr); + return s.ptr; } else { + curl_global_cleanup(); syslog(LOG_AUTHPRIV|LOG_EMERG, "Couldn't init curl for Https GET. %s\n", curl_easy_strerror(res)); exit(EXIT_FAILURE); } - curl_global_cleanup(); - return s.ptr; }
RTX5: Dynamic memory functions made weak
@@ -48,7 +48,7 @@ typedef struct mem_block_s { /// \param[in] mem pointer to memory pool. /// \param[in] size size of a memory pool in bytes. /// \return 1 - success, 0 - failure. -uint32_t osRtxMemoryInit (void *mem, uint32_t size) { +__WEAK uint32_t osRtxMemoryInit (void *mem, uint32_t size) { mem_head_t *head; mem_block_t *ptr; @@ -77,7 +77,7 @@ uint32_t osRtxMemoryInit (void *mem, uint32_t size) { /// \param[in] size size of a memory block in bytes. /// \param[in] type memory block type: 0 - generic, 1 - control block /// \return allocated memory block or NULL in case of no memory is available. -void *osRtxMemoryAlloc (void *mem, uint32_t size, uint32_t type) { +__WEAK void *osRtxMemoryAlloc (void *mem, uint32_t size, uint32_t type) { mem_block_t *p, *p_new, *ptr; uint32_t hole_size; @@ -132,7 +132,7 @@ void *osRtxMemoryAlloc (void *mem, uint32_t size, uint32_t type) { /// \param[in] mem pointer to memory pool. /// \param[in] block memory block to be returned to the memory pool. /// \return 1 - success, 0 - failure. -uint32_t osRtxMemoryFree (void *mem, void *block) { +__WEAK uint32_t osRtxMemoryFree (void *mem, void *block) { mem_block_t *p, *p_prev, *ptr; if ((mem == NULL) || (block == NULL)) {
Add a debug build to testing
@@ -11,7 +11,12 @@ jobs: fail-fast: false matrix: compiler: [gcc, clang] - flags: ["", "-m32"] + #flags: ["", "-m32"] # TODO + + include: + - compiler: gcc + flags: "" + build_type: -DCMAKE_BUILD_TYPE="Debug" steps: - uses: actions/checkout@v1 @@ -25,7 +30,7 @@ jobs: run: | mkdir build cd build - cmake .. + cmake ${{ matrix.build_type }} .. - name: Build run: | cmake --build build @@ -83,7 +88,7 @@ jobs: cmake --build build --config Release cp ./build/Release/wasm3.exe ./build/ - name: Run spec tests - continue-on-error: true + continue-on-error: true # TODO run: | cd test python run-spec-test.py @@ -110,7 +115,7 @@ jobs: run: | cmake --build build-wasi - name: Run spec tests - continue-on-error: true + continue-on-error: true # TODO run: | source $HOME/.wasmer/wasmer.sh cd test
remove GUC_NEW_DISP for statement_timeout and gp_vmem_idle_resource_timeout
@@ -5269,7 +5269,7 @@ static struct config_int ConfigureNamesInt[] = {"statement_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT, gettext_noop("Sets the maximum allowed duration (in milliseconds) of any statement."), gettext_noop("A value of 0 turns off the timeout."), - GUC_UNIT_MS | GUC_GPDB_ADDOPT | GUC_NEW_DISP + GUC_UNIT_MS | GUC_GPDB_ADDOPT }, &StatementTimeout, 0, 0, INT_MAX, NULL, NULL @@ -5279,7 +5279,7 @@ static struct config_int ConfigureNamesInt[] = {"gp_vmem_idle_resource_timeout", PGC_USERSET, CLIENT_CONN_OTHER, gettext_noop("Sets the time a session can be idle (in milliseconds) before we release gangs on the segment DBs to free resources."), gettext_noop("A value of 0 means closing idle gangs at once"), - GUC_UNIT_MS | GUC_GPDB_ADDOPT | GUC_NEW_DISP + GUC_UNIT_MS | GUC_GPDB_ADDOPT }, &IdleSessionGangTimeout, #ifdef USE_ASSERT_CHECKING
king: Factored all terminal rendering logic into its own module.
@@ -28,7 +28,6 @@ import Urbit.Vere.Http.Server (serv) import Urbit.Vere.Log (EventLog) import Urbit.Vere.Serf (Serf, SerfState(..), doJob, sStderr) -import qualified System.Console.Terminal.Size as TSize import qualified System.Entropy as Ent import qualified Urbit.King.API as King import qualified Urbit.Time as Time @@ -37,6 +36,7 @@ import qualified Urbit.Vere.Serf as Serf import qualified Urbit.Vere.Term as Term import qualified Urbit.Vere.Term.API as Term import qualified Urbit.Vere.Term.Demux as Term +import qualified Urbit.Vere.Term.Render as Term -------------------------------------------------------------------------------- @@ -225,7 +225,7 @@ pier (serf, log, ss) mStart = do drivers inst ship (isFake logId) (writeTQueue computeQ) shutdownEvent - (TSize.Window 80 24, muxed) + (Term.TSize{tsWide=80, tsTall=24}, muxed) showErr io $ atomically $ for_ bootEvents (writeTQueue computeQ) @@ -286,7 +286,7 @@ data Drivers e = Drivers drivers :: (HasLogFunc e, HasNetworkConfig e, HasPierConfig e) => KingId -> Ship -> Bool -> (Ev -> STM ()) -> STM() - -> (TSize.Window Word, Term.Client) + -> (Term.TSize, Term.Client) -> (Text -> RIO e ()) -> ([Ev], RAcquire e (Drivers e)) drivers inst who isFake plan shutdownSTM termSys stderr =
io: Readd flag assignment
@@ -418,6 +418,7 @@ int elektraIoFdSetFlags (ElektraIoFdOperation * fdOp, int flags) return -1; } // since custom flags are allowed by `fcntl.h`, no further checks are required + fdOp->flags = flags; return 1; }
Add reference link for Random definition
@@ -1071,7 +1071,8 @@ static int ssl_tls13_parse_server_hello( mbedtls_ssl_context *ssl, } p += 2; - /* ... + /* From RFC8446, page 27. + * ... * Random random; * ... * with Random defined as:
Dockerfile: remove pc_ble_driver workaround This is not required with Python 3.8.
@@ -100,16 +100,17 @@ RUN wget -nv https://www.nordicsemi.com/-/media/Software-and-other-downloads/Des # Sphinx is required for building the readthedocs API documentation. # Matplotlib is required for result visualization. -# After that, install nrfutil, work around broken pc_ble_driver_py dependency, -# and remove the pip cache. +# Nrfutil 6.1.3 does not work with protobuf 4, so install latest 3.x +# Keep the image size down by removing the pip cache when done. RUN python3 -m pip -q install --upgrade pip && \ python3 -m pip -q install \ setuptools \ sphinx_rtd_theme \ sphinx \ - matplotlib && \ - python3 -m pip -q install nrfutil && \ - python3 -m pip -q install --no-deps -t /usr/local/lib/python3.6/dist-packages --python-version 3.6 --ignore-requires-python --upgrade nrfutil && \ + matplotlib \ + 'protobuf<=4' && \ + python3 -m pip -q install \ + nrfutil && \ rm -rf /root/.cache # Create user, add to groups dialout and sudo, and configure sudoers.
Use PSA_ALG_TRUNCATED_MAC() to limit to COOKIE_HMAC_LEN in mbedtls_ssl_cookie_setup()
@@ -121,10 +121,11 @@ int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx, if( alg == 0 ) return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA ); - ctx->psa_hmac_alg = PSA_ALG_HMAC( alg ); + ctx->psa_hmac_alg = PSA_ALG_TRUNCATED_MAC( PSA_ALG_HMAC( alg ), + COOKIE_HMAC_LEN ); psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_SIGN_MESSAGE ); - psa_set_key_algorithm( &attributes, PSA_ALG_HMAC( alg ) ); + psa_set_key_algorithm( &attributes, ctx->psa_hmac_alg ); psa_set_key_type( &attributes, PSA_KEY_TYPE_HMAC ); psa_set_key_bits( &attributes, PSA_BYTES_TO_BITS( COOKIE_MD_OUTLEN ) );
[Rust] Mouse moved/exited properly translates coordinate system
@@ -114,11 +114,18 @@ impl UIElement for View { printf!("Mouse exited view!\n"); *self.currently_contains_mouse_int.borrow_mut() = false; + let inner_content_origin = (*self.current_inner_content_frame.borrow()).origin; + let mut elems_containing_mouse = &mut *self.sub_elements_containing_mouse.borrow_mut(); for elem in elems_containing_mouse.drain(..) { - let mut slice = onto.get_slice(elem.frame()); + + let mut slice = onto.get_slice(Rect::from_parts( + elem.frame().origin + inner_content_origin, + elem.frame().size, + )); elem.handle_mouse_exited(&mut slice); } + Bordered::draw_border(self, onto); } fn handle_mouse_moved(&self, mouse_point: Point, onto: &mut LayerSlice) { @@ -127,14 +134,16 @@ impl UIElement for View { let mut elems_containing_mouse = &mut *self.sub_elements_containing_mouse.borrow_mut(); let inner_content_origin = (*self.current_inner_content_frame.borrow()).origin; + let mouse_to_inner_coordinate_system = mouse_point - inner_content_origin; for elem in elems { let mut slice = onto.get_slice(Rect::from_parts( elem.frame().origin + inner_content_origin, elem.frame().size, )); - //let mut slice = onto.get_slice(elem.frame()); - let elem_contains_mouse = elem.frame().contains(mouse_point); + let elem_contains_mouse = + Rect::from_parts(elem.frame().origin - self.frame().origin, elem.frame().size) + .contains(mouse_to_inner_coordinate_system); // Did this element previously bound the mouse? if let Some(index) = elems_containing_mouse @@ -158,7 +167,8 @@ impl UIElement for View { } for elem in elems_containing_mouse { - elem.handle_mouse_moved(mouse_point, onto); + let elem_local_point = mouse_point - elem.frame().origin; + elem.handle_mouse_moved(elem_local_point, onto); } }
test: account for pypy in traceback tests
@@ -54,7 +54,7 @@ class TestExcepthookDefault(ExcepthookTestCase): self.setup_idle(RuntimeError("Bad")) self.loop.run() self.assertOutput("(?s)^Unhandled exception in callback\n" - "Traceback.*\nRuntimeError: Bad\n$") + "(Traceback.*\n)?RuntimeError: Bad\n$") self.assertNotIn('AttributeError', sys.stderr.getvalue()) @@ -98,9 +98,9 @@ class TestExcepthookBadAttr(ExcepthookTestCase): self.setup_idle(RuntimeError("Bad")) self.loop.run() self.assertOutput("(?s)^Exception while getting excepthook\n" - "Traceback.*\nTypeError: oops\n\n" + "(Traceback.*\n)?TypeError: oops\n\n" "Unhandled exception in callback\n" - "Traceback.*\nRuntimeError: Bad\n$") + "(Traceback.*\n)?RuntimeError: Bad\n$") class TestExcepthookAttribute(ExcepthookTestCase): @@ -130,9 +130,9 @@ class TestExcepthookAttribute(ExcepthookTestCase): self.loop.exception = NameError("abc") self.loop.run() self.assertOutput("(?s)^Unhandled exception in excepthook\n" - "Traceback.*\nNameError: abc\n\n" + "(Traceback.*\n)?NameError: abc\n\n" "Unhandled exception in callback\n" - "Traceback.*\nRuntimeError: Bad\n$") + "(Traceback.*\n)?RuntimeError: Bad\n$") class LoopOverride(pyuv.Loop):
Paramaterize ccp tag filter in pipeline
@@ -221,7 +221,7 @@ resources: branch: {{ccp-git-branch}} private_key: {{ccp-git-key}} uri: {{ccp-git-remote}} - tag_filter: 1.4.4 + tag_filter: {{ccp-tag-filter}} - name: terraform type: terraform
test: ignore some clang warnings from -Weverything
#include "../simde/simde-common.h" SIMDE_DIAGNOSTIC_DISABLE_VLA_ +HEDLEY_DIAGNOSTIC_PUSH +#if HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) +# pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if HEDLEY_HAS_WARNING("-Wpadded") +# pragma clang diagnostic ignored "-Wpadded" +#endif #include "munit/munit.h" +HEDLEY_DIAGNOSTIC_POP #include <stdio.h> #include <math.h> @@ -16,6 +24,9 @@ SIMDE_DIAGNOSTIC_DISABLE_DOUBLE_PROMOTION_ #if HEDLEY_HAS_WARNING("-Wold-style-cast") #pragma clang diagnostic ignored "-Wold-style-cast" #endif +#if HEDLEY_HAS_WARNING("-Wzero-as-null-pointer-constant") + #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" +#endif #if defined(HEDLEY_MSVC_VERSION) /* Unused function(s) */
Replace field access with getter (h).
@@ -778,7 +778,7 @@ void ts_internal_bspline_eval(const tsBSpline *spline, tsReal u, ridx = dim; tidx = N*dim; /* N >= 1 implies tidx > 0 */ r = 1; - for (;r <= _deBoorNet_->pImpl->h; r++) { + for (;r <= ts_deboornet_num_insertions(_deBoorNet_); r++) { i = fst + r; for (; i <= lst; i++) { ui = spline->pImpl->knots[i]; @@ -1052,7 +1052,7 @@ void ts_internal_bspline_insert_knot(const tsBSpline *spline, /* n > 0 implies s <= deg implies a regular evaluation implies h+1 is * valid. */ - N = deBoorNet->pImpl->h+1; + N = ts_deboornet_num_insertions(deBoorNet) + 1; /* 1. Copy all necessary control points and knots from * the original B-Spline. @@ -1161,9 +1161,11 @@ void ts_internal_bspline_split(const tsBSpline *spline, tsReal u, ts_internal_bspline_copy(spline, _split_, b); *k = ts_deboornet_index(&net); } else { - ts_internal_bspline_insert_knot( - spline, &net, net.pImpl->h+1, _split_, b); - *k = ts_deboornet_index(&net) + net.pImpl->h + 1; + ts_internal_bspline_insert_knot(spline, &net, + ts_deboornet_num_insertions(&net) + 1, + _split_, b); + *k = ts_deboornet_index(&net) + + ts_deboornet_num_insertions(&net) + 1; } CATCH *k = 0;
Docs: Sync changelog about Fusion Drive REF:
@@ -4,6 +4,7 @@ OpenCore Changelog #### v0.6.0 - Fixed sound corruption with AudioDxe - Fixed icon choice for Apple FW update in OpenCanopy +- Fixed APFS driver loading on Fusion Drive #### v0.5.9 - Added full HiDPI support in OpenCanopy
nimble/ll: Fix assert on connection event end This was missing in i.e. since we now close connection event in that case, we should also allow to move to next conn event gracefully.
@@ -2817,20 +2817,6 @@ ble_ll_conn_event_end(struct ble_npl_event *ev) /* Better be a connection state machine! */ connsm = (struct ble_ll_conn_sm *)ble_npl_event_get_arg(ev); BLE_LL_ASSERT(connsm); - if (connsm->conn_state == BLE_LL_CONN_STATE_IDLE) { - /* That should not happen. If it does it means connection - * is already closed. - * Make sure LL state machine is in idle - */ - STATS_INC(ble_ll_conn_stats, sched_end_in_idle); - BLE_LL_ASSERT(0); - - /* Just in case */ - ble_ll_state_set(BLE_LL_STATE_STANDBY); - - ble_ll_scan_chk_resume(); - return; - } /* Log event end */ ble_ll_trace_u32x2(BLE_LL_TRACE_ID_CONN_EV_END, connsm->conn_handle,
decision: fix styling
@@ -53,6 +53,7 @@ The library `libelektra-core` must be kept minimal. - It is possible to do change tracking with reasonable memory and computation overhead - It is possible to design a single change tracking API that is useful for all existing and future plugins - False positivies are okay + - this may happend when some keys may have been changed by the user, but have subsequentially been "unchanged" by a transformation plugin Scenario: hypothetical plugin that converts all values to UPPERCASE. - user gets key `system:/background` with value `RED` @@ -63,7 +64,6 @@ The library `libelektra-core` must be kept minimal. - False negatives are not okay - ## Considered Alternatives ### Alternative 1 - Tracking withn `libelektra-kdb`
Fix bug that Short packet is sent from client before handshake completes
@@ -903,13 +903,6 @@ int Client::on_write(bool retransmit) { assert(sendbuf_.left() >= max_pktlen_); - if (!retransmit && ngtcp2_conn_get_handshake_completed(conn_)) { - auto rv = write_streams(); - if (rv != 0) { - return rv; - } - } - for (;;) { ssize_t n; if (ngtcp2_conn_bytes_in_flight(conn_) < MAX_BYTES_IN_FLIGHT) { @@ -939,9 +932,7 @@ int Client::on_write(bool retransmit) { } } - // Packet write for 0-RTT packet must be done after initial - // ngtcp2_conn_write_pkt call. - if (!retransmit && !ngtcp2_conn_get_handshake_completed(conn_)) { + if (!retransmit) { auto rv = write_streams(); if (rv != 0) { return rv;
CI: Fix port for test app of IDF Monitor IDE integration
@@ -73,6 +73,7 @@ def test_monitor_ide_integration(env, extra_data): with WebSocketServer(), ttfw_idf.CustomProcess(' '.join([monitor_path, elf_path, + '--port', str(dut.port), '--ws', 'ws://{}:{}'.format(WebSocketServer.HOST, WebSocketServer.PORT)]), logfile='monitor_{}.log'.format(name)) as p:
py/objgenerator: Add missing #if guard for PY_GENERATOR_PEND_THROW. Without it, gen_instance_pend_throw_obj is defined but not used when MICROPY_PY_GENERATOR_PEND_THROW is set to 0.
@@ -297,6 +297,7 @@ STATIC mp_obj_t gen_instance_close(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(gen_instance_close_obj, gen_instance_close); +#if MICROPY_PY_GENERATOR_PEND_THROW STATIC mp_obj_t gen_instance_pend_throw(mp_obj_t self_in, mp_obj_t exc_in) { mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in); if (self->code_state.sp == self->code_state.state - 1) { @@ -307,6 +308,7 @@ STATIC mp_obj_t gen_instance_pend_throw(mp_obj_t self_in, mp_obj_t exc_in) { return prev; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(gen_instance_pend_throw_obj, gen_instance_pend_throw); +#endif STATIC const mp_rom_map_elem_t gen_instance_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&gen_instance_close_obj) },
parser: json: use new flb_pack_json() prototype
@@ -34,6 +34,7 @@ int flb_parser_json_do(struct flb_parser *parser, int skip; int ret; int slen; + int root_type; double tmfrac = 0; char *mp_buf = NULL; char *time_key; @@ -55,7 +56,7 @@ int flb_parser_json_do(struct flb_parser *parser, struct flb_time *t; /* Convert incoming in_buf JSON message to message pack format */ - ret = flb_pack_json(in_buf, in_size, &mp_buf, &mp_size); + ret = flb_pack_json(in_buf, in_size, &mp_buf, &mp_size, &root_type); if (ret != 0) { return -1; }
Fix error message Fix error message ([arc::pullid] b6d8e0bb-9e25d7f0-12431b42-9e5e0c32) Note: mandatory check (NEED_CHECK) was skipped
@@ -140,7 +140,7 @@ int main(int argc, char** argv) { } if (entry_point == NULL) { - fprintf(stderr, "No entry point, did you forget PY3_MAIN?\n"); + fprintf(stderr, "No entry point, did you forget PY_MAIN?\n"); goto error; }
section with relevant links
@@ -35,7 +35,7 @@ Introduction IoTivity-Lite is an open-source, reference implementation of the `Open Connectivity Foundation <https://openconnectivity.org/>`_ (OCF) standards for the Internet of Things (IoT). Specifically, the stack realizes all the functionalities of the `OCF Core Framework <https://iotivity.org/documentation/ocf-core-framework>`_. The challenge for the IoT ecosystem is to ensure that devices can connect securely and reliably to the Internet and to each other. -The Open Connectivity Foundation (OCF), a group of industry leaders have created a standard specification and certification program to address these challenges. +The Open Connectivity Foundation (OCF), a group of industry leaders have created a `(ISO/IEC) <https://www.iso.org/standard/53238.html>`_ standard specification and certification program to address these challenges. .. image:: Architecture.png :scale: 100% @@ -43,9 +43,10 @@ The Open Connectivity Foundation (OCF), a group of industry leaders have created :align: center The OCF Core Framework provides a versatile communications layer with best-in-class security for Device-to-Device (D2D) and Device-to-Cloud (D2C) connectivity over IP. -IoT interoperability is achieved through the use of consensus-derived, industry standard `data models <https://openconnectivity.org/developer/oneiota-data-model-tool>`_ spanning an array of usage verticals. The OCF Core Framework may be harnessed alongside other IoT technologies in a synergistic fashion to lend a comprehensive and robust IoT solution. +IoT interoperability is achieved through the use of consensus-derived, industry standard `data models <https://openconnectivity.org/developer/oneiota-data-model-tool>`_ spanning an array of usage verticals. +The OCF Core Framework may be harnessed alongside other IoT technologies in a synergistic fashion to lend a comprehensive and robust IoT solution. -Please review the following resources for more details: +Please review the following `specifications <https://openconnectivity.org/developer/specifications/>`_ for more details: - `OCF Security <https://openconnectivity.org/specs/OCF_Security_Specification.pdf>`_ - `Device Commissioning (On-boarding and Provisioning) <https://openconnectivity.org/specs/OCF_Onboarding_Tool_Specification.pdf>`_ @@ -137,6 +138,18 @@ swig/* contains instructions and code to build Java language bindings using the SWIG tool. +Other information sources +------------------------- + + +- `IoTivity.org <https://iotivity.org/>`_ +- `OCF GitHub <https://github.com/openconnectivityfoundation>`_ +- `OCF Specifications <https://openconnectivity.org/developer/specifications/>`_ +- `oneIOTa data models <https://openconnectivity.org/developer/oneiota-data-model-tool>`_ +- `plgd (OCF compliant Cloud implementation) <https://plgd.dev/>`_ +- `Wiki <https://github.com/iotivity/iotivity-lite/wiki>`_ + + Build instructions ------------------
dpdk: fix QSFP+ module info
@@ -512,7 +512,8 @@ format_dpdk_device_module_info (u8 * s, va_list * args) if (rte_eth_dev_get_module_eeprom (xd->port_id, &ei) == 0) { - s = format (s, "%U", format_sfp_eeprom, ei.data); + s = format (s, "%U", format_sfp_eeprom, ei.data + + (mi.type == RTE_ETH_MODULE_SFF_8436 ? 0x80 : 0)); } else s = format (s, "eeprom read error");
Remove unneeded script_action_complete updates
@@ -1522,8 +1522,6 @@ void Script_ScenePopAllState_b() { return; } - - script_action_complete = TRUE; } /* @@ -1544,8 +1542,6 @@ void Script_SetInputScript_b() { input_script_ptrs[index].bank = script_cmd_args[1]; input_script_ptrs[index].offset = (script_cmd_args[2] * 256) + script_cmd_args[3]; - - script_action_complete = TRUE; } /* @@ -1565,8 +1561,6 @@ void Script_RemoveInputScript_b() { } input = input >> 1; } - - script_action_complete = TRUE; } /*
fix cmake warnings when building openmp by removing unused cmake vars
@@ -63,7 +63,6 @@ export LLVM_DIR=$AOMP_INSTALL_DIR GFXSEMICOLONS=`echo $GFXLIST | tr ' ' ';' ` ALTAOMP=${ALTAOMP:-$AOMP} COMMON_CMAKE_OPTS="-DOPENMP_ENABLE_LIBOMPTARGET=1 --DOPENMP_ENABLE_LIBOMPTARGET_HSA=1 -DCMAKE_INSTALL_PREFIX=$INSTALL_OPENMP -DOPENMP_TEST_C_COMPILER=$AOMP/bin/clang -DOPENMP_TEST_CXX_COMPILER=$AOMP/bin/clang++ @@ -73,7 +72,6 @@ COMMON_CMAKE_OPTS="-DOPENMP_ENABLE_LIBOMPTARGET=1 -DDEVICELIBS_ROOT=$DEVICELIBS_ROOT -DLIBOMP_COPY_EXPORTS=OFF -DLIBOMPTARGET_ENABLE_DEBUG=ON --DAOMP_STANDALONE_BUILD=$AOMP_STANDALONE_BUILD -DLLVM_DIR=$LLVM_DIR" @@ -114,7 +112,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then echo "Use ""$0 nocmake"" or ""$0 install"" to avoid FRESH START." echo rm -rf $BUILD_DIR/build/openmp rm -rf $BUILD_DIR/build/openmp - MYCMAKEOPTS="$COMMON_CMAKE_OPTS -DCMAKE_BUILD_TYPE=Release $AOMP_ORIGIN_RPATH -DROCM_DIR=$ROCM_DIR" + MYCMAKEOPTS="$COMMON_CMAKE_OPTS -DCMAKE_BUILD_TYPE=Release $AOMP_ORIGIN_RPATH" mkdir -p $BUILD_DIR/build/openmp cd $BUILD_DIR/build/openmp echo " -----Running openmp cmake ---- "
Disable entry export entry loop, Fixup macro usage
@@ -6034,9 +6034,9 @@ NTSTATUS PhAccessResource( PVOID baseAddress; if (LDR_IS_DATAFILE(DllBase)) - baseAddress = (PVOID)((ULONG_PTR)DllBase & ~1); + baseAddress = LDR_DATAFILE_TO_MAPPEDVIEW(DllBase); else if (LDR_IS_IMAGEMAPPING(DllBase)) - baseAddress = (PVOID)((ULONG_PTR)DllBase & ~2); + baseAddress = LDR_IMAGEMAPPING_TO_MAPPEDVIEW(DllBase); else baseAddress = DllBase; @@ -6564,6 +6564,33 @@ NTSTATUS PhGetLoaderEntryImageDirectory( directory = &ImageNtHeader->OptionalHeader.DataDirectory[ImageDirectoryIndex]; + //if (ImageNtHeader->FileHeader.Machine == IMAGE_FILE_MACHINE_I386) + //{ + // PIMAGE_OPTIONAL_HEADER32 optionalHeader; + // + // optionalHeader = &((PIMAGE_NT_HEADERS32)ImageNtHeader)->OptionalHeader; + // + // if (ImageDirectoryIndex >= optionalHeader->NumberOfRvaAndSizes) + // return STATUS_INVALID_FILE_FOR_SECTION; + // + // directory = &optionalHeader->DataDirectory[ImageDirectoryIndex]; + //} + //else if (ImageNtHeader->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64) + //{ + // PIMAGE_OPTIONAL_HEADER64 optionalHeader; + // + // optionalHeader = &((PIMAGE_NT_HEADERS64)ImageNtHeader)->OptionalHeader; + // + // if (ImageDirectoryIndex >= optionalHeader->NumberOfRvaAndSizes) + // return STATUS_INVALID_FILE_FOR_SECTION; + // + // directory = &optionalHeader->DataDirectory[ImageDirectoryIndex]; + //} + //else + //{ + // return STATUS_INVALID_FILE_FOR_SECTION; + //} + if (directory->VirtualAddress == 0 || directory->Size == 0) return STATUS_INVALID_FILE_FOR_SECTION; @@ -6763,20 +6790,18 @@ PVOID PhGetLoaderEntryImageExportFunction( ); if (exportIndex == ULONG_MAX) - { - for (exportIndex = 0; exportIndex < ExportDirectory->NumberOfNames; exportIndex++) - { - if (PhEqualBytesZ(ExportName, PTR_ADD_OFFSET(BaseAddress, exportNameTable[exportIndex]), FALSE)) - { - exportAddress = PTR_ADD_OFFSET(BaseAddress, exportAddressTable[exportOrdinalTable[exportIndex]]); - break; - } - } - } - else - { + return NULL; + exportAddress = PTR_ADD_OFFSET(BaseAddress, exportAddressTable[exportOrdinalTable[exportIndex]]); - } + + //for (exportIndex = 0; exportIndex < ExportDirectory->NumberOfNames; exportIndex++) + //{ + // if (PhEqualBytesZ(ExportName, PTR_ADD_OFFSET(BaseAddress, exportNameTable[exportIndex]), FALSE)) + // { + // exportAddress = PTR_ADD_OFFSET(BaseAddress, exportAddressTable[exportOrdinalTable[exportIndex]]); + // break; + // } + //} } if (!exportAddress) @@ -7673,6 +7698,7 @@ NTSTATUS PhLoadPluginImage( imageNtHeaders, "ProcessHacker.exe" ); + if (!NT_SUCCESS(status)) goto CleanupExit;
Fix typo in code style script
@@ -68,7 +68,7 @@ def get_uncrustify_version() -> str: def check_style_is_correct(src_file_list: List[str]) -> bool: """ - Check the code style and output a diff foir each file whose style is + Check the code style and output a diff for each file whose style is incorrect. """ style_correct = True
Fix heap overflow in ELF module.
@@ -97,6 +97,7 @@ static const char* str_table_entry(const char* str_table_base, } len = strnlen(str_entry, str_table_limit - str_entry); + if (str_entry + len == str_table_limit) { /* Entry is clamped by extent of string table, not null-terminated. */ @@ -318,20 +319,30 @@ void parse_elf_header_##bits##_##bo( \ \ for (j = 0; j < sym_table_size / sizeof(elf##bits##_sym_t); j++, sym++) \ { \ - set_integer(sym->info >> 4, elf_obj, "symtab[%i].bind", j); \ - set_integer(sym->info & 0xf, elf_obj, "symtab[%i].type", j); \ + uint32_t sym_name_offset = yr_##bo##32toh(sym->name); \ + \ + if (sym_name_offset < sym_str_table_size) \ + { \ + const char* sym_name = sym_str_table + sym_name_offset; \ + \ + set_sized_string( \ + sym_name, \ + strnlen(sym_name, sym_table_size - sym_name_offset), \ + elf_obj, \ + "symtab[%i].name", \ + j); \ + } \ + \ + set_integer(sym->info >> 4, elf_obj, \ + "symtab[%i].bind", j); \ + set_integer(sym->info & 0xf, elf_obj, \ + "symtab[%i].type", j); \ set_integer(yr_##bo##16toh(sym->shndx), elf_obj, \ "symtab[%i].shndx", j); \ set_integer(yr_##bo##bits##toh(sym->value), elf_obj, \ "symtab[%i].value", j); \ set_integer(yr_##bo##bits##toh(sym->size), elf_obj, \ "symtab[%i].size", j); \ - \ - if (yr_##bo##32toh(sym->name) < sym_str_table_size) \ - { \ - set_string(sym_str_table + yr_##bo##32toh(sym->name), elf_obj, \ - "symtab[%i].name", j); \ - } \ } \ \ set_integer(j, elf_obj, "symtab_entries"); \
Update mbedTLS sha256 usage to avoid deprecation mbedTLS made sha256 functions that do not return errors deprecated. This updates to use the new functions avoiding the extra functions calls, and breakage when the deprecated calls are effectively removed.
@@ -61,20 +61,20 @@ typedef mbedtls_sha256_context bootutil_sha256_context; static inline void bootutil_sha256_init(bootutil_sha256_context *ctx) { mbedtls_sha256_init(ctx); - mbedtls_sha256_starts(ctx, 0); + (void)mbedtls_sha256_starts_ret(ctx, 0); } static inline void bootutil_sha256_update(bootutil_sha256_context *ctx, const void *data, uint32_t data_len) { - mbedtls_sha256_update(ctx, data, data_len); + (void)mbedtls_sha256_update_ret(ctx, data, data_len); } static inline void bootutil_sha256_finish(bootutil_sha256_context *ctx, uint8_t *output) { - mbedtls_sha256_finish(ctx, output); + (void)mbedtls_sha256_finish_ret(ctx, output); } #endif /* MCUBOOT_USE_MBED_TLS */
Update for Develco sensor battery reporting
@@ -5788,8 +5788,13 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event) if (i->modelId().startsWith(QLatin1String("tagv4")) || // SmartThings Arrival sensor i->modelId() == QLatin1String("Remote switch") || // Legrand switch i->modelId() == QLatin1String("Zen-01") || // Zen thermostat - i->modelId() == QLatin1String("Motion Sensor-A") || - i->modelId().contains(QLatin1String("86opcn01"))) //Aqara Opple + i->modelId() == QLatin1String("Motion Sensor-A") || // Osram motion sensor + i->modelId().contains(QLatin1String("86opcn01")) || // Aqara Opple + i->modelId().contains(QLatin1String("SMSZB-120")) || // Develco smoke sensor + i->modelId().contains(QLatin1String("HESZB-120")) || // Develco heat sensor + i->modelId().contains(QLatin1String("MOSZB-130")) || // Develco motion sensor + i->modelId().contains(QLatin1String("FLSZB-110")) || // Develco water leak sensor + i->modelId().contains(QLatin1String("ZHMS101"))) // Wattle (Develco) magnetic sensor { } else {
crmf: updates for the new additional MAC_init arguments
@@ -140,7 +140,7 @@ int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq, int ok = 0; EVP_MAC *mac = NULL; EVP_MAC_CTX *mctx = NULL; - OSSL_PARAM macparams[3] = {OSSL_PARAM_END, OSSL_PARAM_END, OSSL_PARAM_END}; + OSSL_PARAM macparams[2] = { OSSL_PARAM_END, OSSL_PARAM_END }; if (out == NULL || pbmp == NULL || pbmp->mac == NULL || pbmp->mac->algorithm == NULL || msg == NULL || sec == NULL) { @@ -207,12 +207,10 @@ int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq, macparams[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST, (char *)mdname, 0); - macparams[1] = OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY, - basekey, bklen); if ((mac = EVP_MAC_fetch(libctx, "HMAC", propq)) == NULL || (mctx = EVP_MAC_CTX_new(mac)) == NULL || !EVP_MAC_CTX_set_params(mctx, macparams) - || !EVP_MAC_init(mctx) + || !EVP_MAC_init(mctx, basekey, bklen, macparams) || !EVP_MAC_update(mctx, msg, msglen) || !EVP_MAC_final(mctx, mac_res, outlen, EVP_MAX_MD_SIZE)) goto err;
check kernel >= 4.20, no channel test on passive mode, cosmetics
#include <signal.h> #include <unistd.h> #include <inttypes.h> +#include <linux/version.h> #include <linux/ethtool.h> #include <linux/sockios.h> #include <linux/if_packet.h> @@ -7239,7 +7240,7 @@ while(1) return; } /*===========================================================================*/ -static inline bool opensocket() +static inline bool opensocket(bool passiveflag) { static struct ethtool_perm_addr *epmaddr; static struct ifreq ifr; @@ -7431,15 +7432,19 @@ if(setsockopt(fd_socket, SOL_PACKET, PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)) < 0 perror("failed to set setsockopt(PACKET_MR_PROMISC)"); return false; } +#if(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) #ifdef PACKET_IGNORE_OUTGOING if(setsockopt(fd_socket, SOL_PACKET, PACKET_IGNORE_OUTGOING, &enable, sizeof(int)) < 0) perror("failed to ignore outgoing packets, ioctl(PACKET_IGNORE_OUTGOING) not supported by driver"); #endif - +#endif +if(passiveflag == false) + { if(set_channel_test(2412) == false) { fprintf(stderr, "channel test failed\n"); return false; } + } epmaddr = (struct ethtool_perm_addr*)calloc(1, sizeof(struct ethtool_perm_addr) +6); if(!epmaddr) { @@ -9461,7 +9466,7 @@ if(monitormodeflag == true) fprintf(stderr, "no interface specified\n"); exit(EXIT_FAILURE); } - if(opensocket() == false) + if(opensocket(passiveflag) == false) { fprintf(stderr, "failed to init socket\n"); exit(EXIT_FAILURE); @@ -9546,7 +9551,7 @@ if(eapreqflag == true) } } -if(opensocket() == false) +if(opensocket(passiveflag) == false) { fprintf(stderr, "warning: failed to init socket\n"); errorcount++;
revert scale change
@@ -218,8 +218,8 @@ typedef float scs_float; #define AA_MAX_WEIGHT_NORM (1e10) /* (Dual) Scale updating parameters */ -#define MAX_SCALE_VALUE (1e3) -#define MIN_SCALE_VALUE (1e-3) +#define MAX_SCALE_VALUE (1e6) +#define MIN_SCALE_VALUE (1e-6) #define SCALE_NORM NORM /* what norm to use when computing the scale factor */ /* CG == Conjugate gradient */
Add MacPorts documentation PR <https://github.com/Genymobile/scrcpy/pull/2299>
@@ -130,6 +130,15 @@ You need `adb`, accessible from your `PATH`. If you don't have it yet: brew install android-platform-tools ``` +It's also available in [MacPorts], which sets up adb for you: + +```bash +sudo port install scrcpy +``` + +[MacPorts]: https://www.macports.org/ + + You can also [build the app manually][BUILD].
Update mmcsd_card.h
@@ -135,6 +135,8 @@ struct rt_sdio_function { rt_uint32_t enable_timeout_val; /* max enable timeout in msec */ struct rt_sdio_function_tuple *tuples; + + void *priv; }; #define SDIO_MAX_FUNCTIONS 7
Fix output of tinysplinecxx_tests in target tests.
@@ -95,7 +95,8 @@ add_subdirectory(cxx) ############################################################################### add_custom_target(tests DEPENDS tinyspline_tests tinysplinecxx_tests - COMMAND tinyspline_tests tinysplinecxx_tests + COMMAND tinyspline_tests + COMMAND tinysplinecxx_tests ) add_custom_target(coverage DEPENDS tinyspline_coverage
board/quackingstick/usbc_config.c: Format with clang-format BRANCH=none TEST=none
@@ -64,7 +64,8 @@ int charger_profile_override(struct charge_state_data *curr) if (current_level >= NUM_TEMP_CHG_LEVELS) current_level = NUM_TEMP_CHG_LEVELS - 1; - curr->requested_current = MIN(curr->requested_current, + curr->requested_current = + MIN(curr->requested_current, temp_chg_table[current_level].current); }
mmapstorage: fix sprintf format error
@@ -699,7 +699,7 @@ static void test_mmap_unlink_dirty_plugindata (const char * tmpFile) { keySetMeta (found, "some erroneous key", "which should not exist here"); char tooLarge[1024]; - sprintf (tooLarge, "%ju", UINTMAX_MAX); + sprintf (tooLarge, "%llu", ULLONG_MAX); tooLarge[1023] = '\0'; keySetMeta (found, tooLarge, "0xZZZZ"); }
userland: Check for ~ in TOCK_USERLAND_BASE_DIR Errors if someone tries to use ~ instead of $(HOME). Fixes
# userland master makefile. Included by application makefiles +# Check for a ~/ at the beginning of a path variable (TOCK_USERLAND_BASE_DIR). +# Make will not properly expand this. +ifdef TOCK_USERLAND_BASE_DIR + ifneq (,$(findstring BEGINNINGOFVARIABLE~/,BEGINNINGOFVARIABLE$(TOCK_USERLAND_BASE_DIR))) + $(error Hi! Using "~" in Makefile variables is not supported. Use "$$(HOME)" instead) + endif +endif + TOCK_USERLAND_BASE_DIR ?= .. TOCK_BASE_DIR ?= $(TOCK_USERLAND_BASE_DIR)/.. BUILDDIR ?= build/$(TOCK_ARCH)
Disable broken aligned_alloc on new versions of macOS and revert to old behaviour.
@@ -4182,18 +4182,21 @@ static void* vma_aligned_alloc(size_t alignment, size_t size) static void* vma_aligned_alloc(size_t alignment, size_t size) { -#if defined(__APPLE__) && (defined(MAC_OS_X_VERSION_10_16) || defined(__IPHONE_14_0)) -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0 - // For C++14, usr/include/malloc/_malloc.h declares aligned_alloc()) only - // with the MacOSX11.0 SDK in Xcode 12 (which is what adds - // MAC_OS_X_VERSION_10_16), even though the function is marked - // availabe for 10.15. That's why the preprocessor checks for 10.16 but - // the __builtin_available checks for 10.15. - // People who use C++17 could call aligned_alloc with the 10.15 SDK already. - if (__builtin_available(macOS 10.15, iOS 13, *)) - return aligned_alloc(alignment, size); -#endif -#endif + // Unfortunately, aligned_alloc causes VMA to crash due to it returning null pointers. (At least under 11.4) + // Therefore, for now disable this specific exception until a proper solution is found. + //#if defined(__APPLE__) && (defined(MAC_OS_X_VERSION_10_16) || defined(__IPHONE_14_0)) + //#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0 + // // For C++14, usr/include/malloc/_malloc.h declares aligned_alloc()) only + // // with the MacOSX11.0 SDK in Xcode 12 (which is what adds + // // MAC_OS_X_VERSION_10_16), even though the function is marked + // // availabe for 10.15. That's why the preprocessor checks for 10.16 but + // // the __builtin_available checks for 10.15. + // // People who use C++17 could call aligned_alloc with the 10.15 SDK already. + // if (__builtin_available(macOS 10.15, iOS 13, *)) + // return aligned_alloc(alignment, size); + //#endif + //#endif + // alignment must be >= sizeof(void*) if(alignment < sizeof(void*)) {
msvcbuild.bat: Update default to 2019, add support for 2022
@echo off Setlocal EnableDelayedExpansion -if not defined VS set VS=15 +if not defined VS set VS=16 +if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2022" (set VS=17) if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" (set VS=16) if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (set VS=15) if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" (set VS=14)
bytecode interpreter passes memory checker
*/ #include "all.h" -#define TREE_NOCK - static u3_noun _n_nock_on(u3_noun bus, u3_noun fol); static u3_noun _n_burn_on(u3_noun bus, u3_noun fol); @@ -1868,7 +1866,7 @@ _n_burn_on(u3_noun bus, u3_noun fol) c3_y* pog = _n_find(fol); c3_ys mov, off; - //u3z(fol); + u3z(fol); if ( c3y == u3a_is_north(u3R) ) { mov = -1; off = 0; @@ -1877,8 +1875,7 @@ _n_burn_on(u3_noun bus, u3_noun fol) mov = 1; off = -1; } - //u3_noun pro = _n_burn(pog, bus, mov, off); - u3_noun pro = _n_nock_on(bus, fol); + u3_noun pro = _n_burn(pog, bus, mov, off); return pro; } @@ -2016,6 +2013,7 @@ _n_mark_byc(c3_y* pog) } } + tot_w += u3a_mark_mptr(pog); return tot_w; } @@ -2027,7 +2025,7 @@ static void _n_bam(u3_noun kev) { c3_y* pog = u3a_into(u3t(kev)); - bam_w += u3a_mark_noun(kev) + _n_mark_byc(pog); + bam_w += _n_mark_byc(pog); } /* u3n_bark(): mark the bytecode cache for gc. @@ -2035,12 +2033,10 @@ _n_bam(u3_noun kev) c3_w u3n_bark() { - return 0; - /* + u3p(u3h_root) har_p = u3R->byc.har_p; bam_w = 0; - u3h_walk(u3R->byc.har_p, _n_bam); - return bam_w; - */ + u3h_walk(har_p, _n_bam); + return bam_w + u3h_mark(har_p); } #if 0
sysrepoctl BUGFIX typo Fixes
@@ -59,7 +59,7 @@ static void version_print(void) { printf( - "sysrepocfg - sysrepo YANG schema manipulation tool, compiled with libsysrepo v%s (SO v%s)\n" + "sysrepoctl - sysrepo YANG schema manipulation tool, compiled with libsysrepo v%s (SO v%s)\n" "\n", SR_VERSION, SR_SOVERSION );
Fixing call to determine latest git tag
@@ -50,19 +50,21 @@ else TEST_HOME=$5; fi +echo INFO: Staging files for regression testing + + SCRIPT_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" BUILD_HOME="$(dirname "$SCRIPT_HOME")" SUT_PATH=(`find $BUILD_HOME -name "bin" -type d`) - # TODO: determine platform # determine latest tag from GitHub API LATEST_URL="https://api.github.com/repos/openwateranalytics/epanet-example-networks/releases/latest" LATEST_TAG=(`curl --silent ${LATEST_URL} | jq -r .tag_name`) -if [ -z $LATEST_TAG ]; then +if [ ${LATEST_TAG} == 'null' ]; then echo "ERROR: curl | jq - ${LATEST_URL}" exit 1 fi @@ -71,8 +73,6 @@ TEST_URL="https://github.com/OpenWaterAnalytics/epanet-example-networks/archive/ BENCH_URL="https://github.com/OpenWaterAnalytics/epanet-example-networks/releases/download/${LATEST_TAG}/benchmark-${PLATFORM}-${REF_BUILD_ID}.tar.gz" -echo INFO: Staging files for regression testing - # create a clean directory for staging regression tests if [ -d ${TEST_HOME} ]; then rm -rf ${TEST_HOME}