message
stringlengths
6
474
diff
stringlengths
8
5.22k
xive: Improve/fix EOI of LSIs Don't try to play games with PQ bits with LSIs, use the normal EOI loads instead as otherwise things won't work on P9 DD1 with PHB4 due to erratas on all non-EOI ESB operations.
@@ -2383,22 +2383,29 @@ static void xive_source_eoi(struct irq_source *is, uint32_t isn) * a clear of both P and Q and returns the old Q. * * This allows us to then do a re-trigger if Q was set - rather than synthetizing an interrupt in software + * rather than synthetizing an interrupt in software */ if (s->flags & XIVE_SRC_EOI_PAGE1) mmio_base += 1ull << (s->esb_shift - 1); + + /* LSIs don't need anything special, just EOI */ + if (s->flags & XIVE_SRC_LSI) + in_be64(mmio_base); + else { offset = 0xc00; if (s->flags & XIVE_SRC_SHIFT_BUG) offset <<= 4; eoi_val = in_be64(mmio_base + offset); - xive_vdbg(s->xive, "ISN: %08x EOI=%llx\n", isn, eoi_val); - if ((s->flags & XIVE_SRC_LSI) || !(eoi_val & 1)) + xive_vdbg(s->xive, "ISN: %08x EOI=%llx\n", + isn, eoi_val); + if (!(eoi_val & 1)) return; /* Re-trigger always on page0 or page1 ? */ out_be64(mmio_base, 0); } } +} static void xive_source_interrupt(struct irq_source *is, uint32_t isn) {
fix cache_memlimit bug for > 4G values The argument to *_adjust was size_t, but the input value being multiplied from was a uint, so this does the appropriate cast.
@@ -3809,7 +3809,7 @@ static void process_memlimit_command(conn *c, token_t *tokens, const size_t ntok if (memlimit < 8) { out_string(c, "MEMLIMIT_TOO_SMALL cannot set maxbytes to less than 8m"); } else { - if (slabs_adjust_mem_limit(memlimit * 1024 * 1024)) { + if (slabs_adjust_mem_limit((size_t) memlimit * 1024 * 1024)) { if (settings.verbose > 0) { fprintf(stderr, "maxbytes adjusted to %llum\n", (unsigned long long)memlimit); }
Force removal of existing RConfigBattery
@@ -3924,6 +3924,11 @@ static int sqliteLoadAllSensorsCallback(void *user, int ncols, char **colval , c item = sensor.addItem(DataTypeUInt16, RConfigPending); item->setValue(item->toNumber() | R_PENDING_MODE); } + + if (sensor.modelId() == QLatin1String("lumi.switch.n0agl1")) + { + sensor.removeItem(RConfigBattery); + } } else if (sensor.modelId().startsWith(QLatin1String("tagv4"))) // SmartThings Arrival sensor {
fix(shield): BFO9000 uses USB on right
if SHIELD_BFO9000_LEFT -config ZMK_SPLIT_BLE_ROLE_CENTRAL - default y - config ZMK_KEYBOARD_NAME default "BFO9000 Left" +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + endif if SHIELD_BFO9000_RIGHT @@ -16,6 +16,9 @@ if SHIELD_BFO9000_RIGHT config ZMK_KEYBOARD_NAME default "BFO9000 Right" +config USB + default y + endif if SHIELD_BFO9000_LEFT || SHIELD_BFO9000_RIGHT
honggfuzz.h: description for defer{}
@@ -330,7 +330,23 @@ typedef struct { } linux; } run_t; -/* Go-style defer implementation */ +/* + * Go-style defer scoped implementation + * Example of use: + * + * { + * int fd = open(fname, O_RDONLY); + * if (fd == -1) { + * error(....); + * return; + * } + * defer { close(fd; }; + * ssize_t sz = read(fd, buf, sizeof(buf)); + * ... + * ... + * } + * + * */ #define __STRMERGE(a, b) a##b #define _STRMERGE(a, b) __STRMERGE(a, b) #ifdef __clang__ @@ -355,6 +371,7 @@ static void __attribute__((unused)) __clang_cleanup_func(void (^*dfunc)(void)) { #define defer _DEFER(a, __COUNTER__) #endif /* __clang */ +/* Block scoped mutexes */ #define MX_SCOPED_LOCK(m) \ MX_LOCK(m); \ defer { \
Indent comments to 12*4 spaces
@@ -301,11 +301,10 @@ mem_free(void* ptr) { if ((block->size & mem_alloc_bit) && block->next == NULL) { /* * Clear allocated bit before entering back to free list - * List will automatically take care for fragmentation and mix segments back + * List will automatically take care for fragmentation */ block->size &= ~mem_alloc_bit; /* Clear allocated bit */ mem_available_bytes += block->size; /* Increase available bytes back */ - /* ESP_MEMSET(ptr, 0x00, block->size - MEMBLOCK_METASIZE); */ mem_insertfreeblock(block); /* Insert block to list of free blocks */ } } @@ -464,7 +463,7 @@ esp_mem_free(void* ptr) { "[MEM] Free size: %d, address: %p\r\n", (int)MEM_BLOCK_USER_SIZE(ptr), ptr); esp_core_lock(); - mem_free(ptr); /* Free already allocated memory */ + mem_free(ptr); esp_core_unlock(); }
fix segfault on raspberry pi
@@ -114,7 +114,8 @@ get_interface_index(int sock) for (interface = ifs; interface != NULL; interface = interface->ifa_next) { if (!(interface->ifa_flags & IFF_UP) || interface->ifa_flags & IFF_LOOPBACK) continue; - if (addr.ss_family == interface->ifa_addr->sa_family) { + if (interface->ifa_addr && + addr.ss_family == interface->ifa_addr->sa_family) { if (addr.ss_family == AF_INET6) { struct sockaddr_in6 *a = (struct sockaddr_in6 *)interface->ifa_addr; struct sockaddr_in6 *b = (struct sockaddr_in6 *)&addr;
tests/thread/stress_schedule.py: Assign globals before running test. When threading is enabled without the GIL then there can be races between the threads accessing the globals dict. Avoid this issue by making sure all globals variables are allocated before starting the threads.
@@ -14,7 +14,11 @@ except AttributeError: gc.disable() +_NUM_TASKS = 10000 +_TIMEOUT_MS = 10000 + n = 0 # How many times the task successfully ran. +t = None # Start time of test, assigned here to preallocate entry in globals dict. def task(x): @@ -34,9 +38,6 @@ def thread(): for i in range(8): _thread.start_new_thread(thread, ()) -_NUM_TASKS = const(10000) -_TIMEOUT_MS = const(10000) - # Wait up to 10 seconds for 10000 tasks to be scheduled. t = utime.ticks_ms() while n < _NUM_TASKS and utime.ticks_diff(utime.ticks_ms(), t) < _TIMEOUT_MS:
sysdeps/managarm: convert sys_epoll_pwait to helix_ng
@@ -1178,8 +1178,6 @@ int sys_epoll_pwait(int epfd, struct epoll_event *ev, int n, __ensure(timeout >= 0 || timeout == -1); // TODO: Report errors correctly. SignalGuard sguard; - HelAction actions[4]; - globalQueue.trim(); managarm::posix::CntRequest<MemoryAllocator> req(getSysdepsAllocator()); req.set_request_type(managarm::posix::CntReqType::EPOLL_WAIT); @@ -1193,42 +1191,26 @@ int sys_epoll_pwait(int epfd, struct epoll_event *ev, int n, req.set_sigmask_needed(false); } - frg::string<MemoryAllocator> ser(getSysdepsAllocator()); - req.SerializeToString(&ser); - actions[0].type = kHelActionOffer; - actions[0].flags = kHelItemAncillary; - actions[1].type = kHelActionSendFromBuffer; - actions[1].flags = kHelItemChain; - actions[1].buffer = ser.data(); - actions[1].length = ser.size(); - actions[2].type = kHelActionRecvInline; - actions[2].flags = kHelItemChain; - actions[3].type = kHelActionRecvToBuffer; - actions[3].flags = 0; - actions[3].buffer = ev; - actions[3].length = n * sizeof(struct epoll_event); - HEL_CHECK(helSubmitAsync(getPosixLane(), actions, 4, - globalQueue.getQueue(), 0, 0)); - - auto element = globalQueue.dequeueSingle(); - auto offer = parseHandle(element); - auto send_req = parseSimple(element); - auto recv_resp = parseInline(element); - auto recv_data = parseLength(element); - - HEL_CHECK(offer->error); - HEL_CHECK(send_req->error); - HEL_CHECK(recv_resp->error); - HEL_CHECK(recv_data->error); + auto [offer, send_req, recv_resp, recv_data] = exchangeMsgsSync( + getPosixLane(), + helix_ng::offer( + helix_ng::sendBragiHeadOnly(req, getSysdepsAllocator()), + helix_ng::recvInline(), + helix_ng::recvBuffer(ev, n * sizeof(struct epoll_event))) + ); + HEL_CHECK(offer.error()); + HEL_CHECK(send_req.error()); + HEL_CHECK(recv_resp.error()); + HEL_CHECK(recv_data.error()); managarm::posix::SvrResponse<MemoryAllocator> resp(getSysdepsAllocator()); - resp.ParseFromArray(recv_resp->data, recv_resp->length); + resp.ParseFromArray(recv_resp.data(), recv_resp.length()); if(resp.error() == managarm::posix::Errors::BAD_FD) { return EBADF; } __ensure(resp.error() == managarm::posix::Errors::SUCCESS); - __ensure(!(recv_data->length % sizeof(struct epoll_event))); - *raised = recv_data->length / sizeof(struct epoll_event); + __ensure(!(recv_data.actualLength() % sizeof(struct epoll_event))); + *raised = recv_data.actualLength() / sizeof(struct epoll_event); return 0; }
groups: only prompt to delete on ownership Fixes
@@ -34,10 +34,12 @@ function DeleteGroup(props: { const history = useHistory(); const onDelete = async () => { const name = props.association['group-path'].split('/').pop(); - if (prompt(`To confirm deleting this group, type ${name}`) === name) { + if (props.owner) { + const shouldDelete = (prompt(`To confirm deleting this group, type ${name}`) === name); + if (!shouldDelete) return; + } await props.api.contacts.delete(props.association["group-path"]); history.push("/"); - } }; const action = props.owner ? "Delete" : "Leave";
refactors _http_req_respond to use the h2o memory pool and defer cleanup possibly fixing a use after free
@@ -272,6 +272,24 @@ _http_req_dispatch(u3_hreq* req_u, u3_noun req) req)); } +typedef struct _u3_hgen { + h2o_generator_t neg_u; + h2o_iovec_t bod_u; + u3_hreq* req_u; + u3_hhed* hed_u; +} u3_hgen; + +/* _http_hgen_dispose(): dispose response generator and buffers +*/ +static void +_http_hgen_dispose(void* ptr_v) +{ + u3_hgen* gen_u = (u3_hgen*)ptr_v; + _http_req_free(gen_u->req_u); + _http_heds_free(gen_u->hed_u); + free(gen_u->bod_u.base); +} + /* _http_req_respond(): write httr to h2o_req_t->res and send */ static void @@ -287,7 +305,12 @@ _http_req_respond(u3_hreq* req_u, u3_noun sas, u3_noun hed, u3_noun bod) "hosed"; u3_hhed* hed_u = _http_heds_from_noun(u3k(hed)); - u3_hhed* deh_u = hed_u; + + u3_hgen* gen_u = h2o_mem_alloc_shared(&rec_u->pool, sizeof(*gen_u), + _http_hgen_dispose); + gen_u->neg_u = (h2o_generator_t){0, 0}; + gen_u->req_u = req_u; + gen_u->hed_u = hed_u; while ( 0 != hed_u ) { h2o_add_header_by_str(&rec_u->pool, &rec_u->res.headers, @@ -296,19 +319,12 @@ _http_req_respond(u3_hreq* req_u, u3_noun sas, u3_noun hed, u3_noun bod) hed_u = hed_u->nex_u; } - h2o_iovec_t bod_u = _http_vec_from_octs(u3k(bod)); - rec_u->res.content_length = bod_u.len; - - static h2o_generator_t gen_u = {0, 0}; - h2o_start_response(rec_u, &gen_u); - - h2o_send(rec_u, &bod_u, 1, H2O_SEND_STATE_FINAL); + gen_u->bod_u = _http_vec_from_octs(u3k(bod)); + rec_u->res.content_length = gen_u->bod_u.len; - _http_req_free(req_u); + h2o_start_response(rec_u, &gen_u->neg_u); + h2o_send(rec_u, &gen_u->bod_u, 1, H2O_SEND_STATE_FINAL); - // XX allocate on &req_u->rec_u->pool and skip these? - _http_heds_free(deh_u); - free(bod_u.base); u3z(sas); u3z(hed); u3z(bod); }
GRIB: Add new MARS class 'gw' - Global Wildfire
36 cr Copernicus Atmosphere Monitoring Service (CAMS) Research 37 rr Copernicus Regional ReAnalysis (CARRA/CERRA) 38 ul Project ULYSSES +39 gw Global Wildfire Information System 99 te Test 100 at Austria 101 be Belgium
Rollback: r4238276 Result revision: None [][] [diff-resolver:danlark] Sandbox task: Task author: danlark@ Description: rollback Note: mandatory check (NEED_CHECK) was skipped
#include <catboost/libs/helpers/exception.h> #include <util/string/split.h> -#include <util/string/iterator.h> ui32 TPoolColumnsMetaInfo::CountColumns(const EColumn columnType) const { return CountIf( @@ -93,7 +92,7 @@ TVector<TString> TPoolColumnsMetaInfo::GenerateFeatureIds(const TMaybe<TString>& } } else if (header.Defined()) { TVector<TStringBuf> words; - StringSplitter(*header).Split(fieldDelimiter).AddTo(&words); + SplitRangeTo<const char, TVector<TStringBuf>>(~(*header), ~(*header) + header->size(), fieldDelimiter, &words); for (int i = 0; i < words.ysize(); ++i) { if (Columns[i].Type == EColumn::Categ || Columns[i].Type == EColumn::Num) { featureIds.push_back(ToString(words[i]));
SAFETY: disallowing controls on brake switch as this is the main cancellation bit considered by cruise in pcm
@@ -27,8 +27,8 @@ static void honda_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) { // exit controls on brake press if ((to_push->RIR>>21) == 0x17C) { - // bit 50 - if (to_push->RDHR & 0x200000) { + // bit 32 or 53 + if (to_push->RDHR & 0x200001) { controls_allowed = 0; } }
Tweak README and mention Android
@@ -3,7 +3,9 @@ TrustKit [![Build Status](https://circleci.com/gh/datatheorem/TrustKit.svg?style=svg)](https://circleci.com/gh/datatheorem/TrustKit) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Version Status](https://img.shields.io/cocoapods/v/TrustKit.svg?style=flat)](https://cocoapods.org/pods/TrustKit) [![Platform](https://img.shields.io/cocoapods/p/TrustKit.svg?style=flat)](https://cocoapods.org/pods/TrustKit) [![License MIT](https://img.shields.io/cocoapods/l/TrustKit.svg?style=flat)](https://en.wikipedia.org/wiki/MIT_License) -**TrustKit** is an open source framework that makes it easy to deploy SSL public key pinning in any iOS 7+, macOS 10.9+, tvOS 10+ or watchOS 3+ App; it supports both Swift and Objective-C Apps. +**TrustKit** is an open source framework that makes it easy to deploy SSL public key pinning and reporting in any iOS 7+, macOS 10.9+, tvOS 10+ or watchOS 3+ App; it supports both Swift and Objective-C Apps. + +If you need SSL pinning/reporting in your Android App. we have also released **TrustKit for Android** at [https://github.com/datatheorem/TrustKit-Android](https://github.com/datatheorem/TrustKit-Android). Overview @@ -12,9 +14,9 @@ Overview **TrustKit** provides the following features: * Simple API to configure an SSL pinning policy and enforce it within an App. The policy settings are heavily based on the [HTTP Public Key Pinning specification](https://tools.ietf.org/html/rfc7469). -* Auto-pinning functionality by swizzling the App's _NSURLConnection_ and _NSURLSession_ delegates in order to automatically add pinning validation to the App's HTTPS connections; this allows deploying **TrustKit** without even modifying the App's source code. * Sane implementation by pinning the certificate's Subject Public Key Info, [as opposed to the certificate itself or the public key bits](https://www.imperialviolet.org/2011/05/04/pinning.html). * Reporting mechanism to notify a server about pinning validation failures happening within the App, when an unexpected certificate chain is detected. This is similar to the _report-uri_ directive described in the HPKP specification. The reporting mechanism can also be customized within the App by leveraging pin validation notifications sent by TrustKit. +* Auto-pinning functionality by swizzling the App's _NSURLConnection_ and _NSURLSession_ delegates in order to automatically add pinning validation to the App's HTTPS connections; this allows deploying **TrustKit** without even modifying the App's source code. **TrustKit** was open-sourced at [Black Hat 2015 USA][bh2015-conf].
[hardware] Reduce L2 size to 64KiB
@@ -34,7 +34,7 @@ module mempool_system #( localparam NumTilesPerGroup = NumTiles / NumGroups; localparam NumBanks = NumCores * BankingFactor; localparam TCDMSize = NumBanks * TCDMSizePerBank; - localparam L2AddrWidth = 18; + localparam L2AddrWidth = 12; /********* * AXI * @@ -101,7 +101,7 @@ module mempool_system #( localparam addr_t CtrlRegistersBaseAddr = 32'h4000_0000; localparam addr_t CtrlRegistersEndAddr = 32'h4000_FFFF; localparam addr_t L2MemoryBaseAddr = 32'h8000_0000; - localparam addr_t L2MemoryEndAddr = 32'h9FFF_FFFF; + localparam addr_t L2MemoryEndAddr = 32'h801F_FFFF; localparam addr_t BootromBaseAddr = 32'hA000_0000; localparam addr_t BootromEndAddr = 32'hA000_FFFF;
Types are also equal with flipflopping. If we have types a -> b -> ptr -> a, and b -> a -> ptr -> b, there are cases where the two types can end up on different branches, so we end up flipflopping between avisited and bvisited containing the type we want.
@@ -763,6 +763,7 @@ int tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search) { Type *x, *y; + int atid, btid; size_t i; int ret; @@ -786,9 +787,13 @@ tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search) if (bshas(avisited, a->tid) && bshas(bvisited, b->tid)) return 1; + if (bshas(bvisited, a->tid) && bshas(avisited, b->tid)) + return 1; bsput(avisited, a->tid); bsput(bvisited, b->tid); + atid = a->tid; + btid = b->tid; ret = 1; switch (a->type) {
Fixes RP2040 buffer reallocation overrun problem Fix running out of memory on a device that repeatedly closes and opens an endpoint. This is a workaround at the moment. A better solution would be to implement reclaiming usb buffer memory when closing an endpoint (i.e. implement dcd_edpt_close).
@@ -164,9 +164,13 @@ static void _hw_endpoint_init(struct hw_endpoint *ep, uint8_t ep_addr, uint wMax ep->endpoint_control = &usb_dpram->ep_ctrl[num-1].out; } - // Now alloc a buffer and fill in endpoint control register + // Now if it hasn't already been done + //alloc a buffer and fill in endpoint control register + if(!(ep->configured)) + { _hw_endpoint_alloc(ep); } + } ep->configured = true; }
fix type convert missing "Oid" system attribute
@@ -89,6 +89,8 @@ static Datum convert_range_recv(PG_FUNCTION_ARGS); static RangeConvert *get_convert_range_io_data(RangeConvert *ac, Oid rngtypid, MemoryContext context, bool is_send); static void free_range_convert(RangeConvert *ac); +static TupleTableSlot* convert_copy_tuple_oid(TupleTableSlot *dest, TupleTableSlot *src, bool use_min); + #ifdef USE_ASSERT_CHECKING static bool convert_equal_tuple_desc(TupleDesc desc1, TupleDesc desc2); #endif /* USE_ASSERT_CHECKING */ @@ -210,7 +212,8 @@ TupleTableSlot* do_type_convert_slot_in(TupleTypeConvert *convert, TupleTableSlo }PG_END_TRY(); pop_client_encoding(); - return ExecStoreVirtualTuple(dest); + ExecStoreVirtualTuple(dest); + return convert_copy_tuple_oid(dest, src, false); } TupleTableSlot* do_type_convert_slot_out(TupleTypeConvert *convert, TupleTableSlot *src, TupleTableSlot *dest, bool need_copy) @@ -264,7 +267,8 @@ TupleTableSlot* do_type_convert_slot_out(TupleTypeConvert *convert, TupleTableSl lc = lnext(lc); } - return ExecStoreVirtualTuple(dest); + ExecStoreVirtualTuple(dest); + return convert_copy_tuple_oid(dest, src, true); } Datum do_datum_convert_in(StringInfo buf, Oid typid) @@ -365,7 +369,7 @@ static TupleDesc create_convert_desc_if_need(TupleDesc indesc) if(need_convert == false) return NULL; /* don't need convert */ - outdesc = CreateTemplateTupleDesc(natts, false); + outdesc = CreateTemplateTupleDesc(natts, indesc->tdhasoid); for(i=natts=0;i<indesc->natts;++i) { attr = indesc->attrs[i]; @@ -1235,3 +1239,24 @@ static bool convert_equal_tuple_desc(TupleDesc desc1, TupleDesc desc2) return true; } #endif /* USE_ASSERT_CHECKING */ + +static TupleTableSlot* convert_copy_tuple_oid(TupleTableSlot *dest, TupleTableSlot *src, bool use_min) +{ + if(src->tts_tupleDescriptor->tdhasoid) + { + HeapTupleHeader header; + Oid oid; + Assert(dest->tts_tupleDescriptor->tdhasoid); + oid = ExecFetchSlotTupleOid(src); + if (OidIsValid(oid)) + { + if (use_min) + header = (HeapTupleHeader) ((char*)ExecFetchSlotMinimalTuple(dest) - MINIMAL_TUPLE_OFFSET); + else + header = ExecMaterializeSlot(dest)->t_data; + HeapTupleHeaderSetOid(header, oid); + } + } + + return dest; +}
BugID:23251508: fixed bug setsockopt() set TCP_NODELAY TCP_KEEPALIVE ... with a listen state TCP will crash commit Author: goldsimon Date: Mon Nov 28 15:50:59 2016 +0100
@@ -2578,6 +2578,10 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt case IPPROTO_TCP: /* Special case: all IPPROTO_TCP option take an int */ LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, *optlen, int, NETCONN_TCP); + if (sock->conn->pcb.tcp->state == LISTEN) { + done_socket(sock); + return EINVAL; + } switch (optname) { case TCP_NODELAY: *(int*)optval = tcp_nagle_disabled(sock->conn->pcb.tcp); @@ -3030,6 +3034,10 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_ case IPPROTO_TCP: /* Special case: all IPPROTO_TCP option take an int */ LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, int, NETCONN_TCP); + if (sock->conn->pcb.tcp->state == LISTEN) { + done_socket(sock); + return EINVAL; + } switch (optname) { case TCP_NODELAY: if (*(const int*)optval) {
Ensure tests expected to fail actually fail
@@ -524,16 +524,18 @@ static int aead_multipart_internal_func( int key_type_arg, data_t *key_data, ( input_data->x + data_true_size ), tag_length ); - if( status != PSA_SUCCESS ) + if( expect_valid_signature ) + PSA_ASSERT( status ); + else { - if( !expect_valid_signature ) + TEST_ASSERT( status != PSA_SUCCESS ); + + if( status != PSA_SUCCESS ) { /* Expected failure. */ test_ok = 1; goto exit; } - else - PSA_ASSERT( status ); } }
Remove comment and use correct tables
@@ -283,11 +283,6 @@ static bool invokeFromClass(VM *vm, ObjClass *klass, ObjString *name, static bool invoke(VM *vm, ObjString *name, int argCount) { Value receiver = peek(vm, argCount); -// if (!IS_OBJ(receiver)) { -// runtimeError(vm, "Can only invoke on objects."); -// return false; -// } - if (!IS_OBJ(receiver)) { if (IS_NUMBER(receiver)) { Value value; @@ -299,7 +294,7 @@ static bool invoke(VM *vm, ObjString *name, int argCount) { return false; } else if (IS_BOOL(receiver)) { Value value; - if (tableGet(&vm->numberMethods, name, &value)) { + if (tableGet(&vm->boolMethods, name, &value)) { return callNativeMethod(vm, value, argCount); } @@ -307,7 +302,7 @@ static bool invoke(VM *vm, ObjString *name, int argCount) { return false; } else if (IS_NIL(receiver)) { Value value; - if (tableGet(&vm->numberMethods, name, &value)) { + if (tableGet(&vm->nilMethods, name, &value)) { return callNativeMethod(vm, value, argCount); }
py/emitnative: Optimise for iteration asm code for non-debug build. In non-debug mode MP_OBJ_STOP_ITERATION is zero and comparing something to zero can be done more efficiently in assembler than comparing to a non-zero value.
@@ -1737,8 +1737,13 @@ STATIC void emit_native_for_iter(emit_t *emit, mp_uint_t label) { emit_get_stack_pointer_to_reg_for_pop(emit, REG_ARG_1, MP_OBJ_ITER_BUF_NSLOTS); adjust_stack(emit, MP_OBJ_ITER_BUF_NSLOTS); emit_call(emit, MP_F_NATIVE_ITERNEXT); + #ifdef NDEBUG + MP_STATIC_ASSERT(MP_OBJ_STOP_ITERATION == 0); + ASM_JUMP_IF_REG_ZERO(emit->as, REG_RET, label); + #else ASM_MOV_REG_IMM(emit->as, REG_TEMP1, (mp_uint_t)MP_OBJ_STOP_ITERATION); ASM_JUMP_IF_REG_EQ(emit->as, REG_RET, REG_TEMP1, label); + #endif emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET); }
zephyr: zmake: drop zephyr-chrome from DTS_ROOT Needed to clear file conflicts. BRANCH=none TEST=zmake testall
@@ -91,12 +91,7 @@ class Zmake: base_config = zmake.build_config.BuildConfig( environ_defs={'ZEPHYR_BASE': str(zephyr_base), 'PATH': '/usr/bin'}, - cmake_defs={'DTS_ROOT': '{};{}'.format( - # TODO(b/177003034): remove zephyr-chrome from here - # once all dts files have migrated to platform/ec. - module_paths['zephyr-chrome'], - module_paths['ec-shim'] / 'zephyr', - )}) + cmake_defs={'DTS_ROOT': str(module_paths['ec-shim'] / 'zephyr')}) module_config = zmake.modules.setup_module_symlinks( build_dir / 'modules', module_paths)
Hall newdm action: ship names are sorted by alphabetical order.
=/ nom/name %^ rsh 3 1 %+ roll - %+ sort (weld ~(tap in sis) [our.bol ~]) - |= [a=ship b=ship] - ^- ? - (lth a b) - |= {p/ship nam/name} + %+ sort %+ turn (weld ~(tap in sis) [our.bol ~]) + |= p/ship + ^- cord + (scot %p p) + aor + |= {p/cord nam/name} ^- @tas - (crip "{(trip `@t`nam)}.{(slag 1 (trip (scot %p p)))}") + (crip "{(trip `@t`nam)}.{(slag 1 (trip p))}") =/ dels/(list delta) :~ :*
fix: make features on plugin_descriptor_t const
@@ -27,7 +27,7 @@ typedef struct clap_plugin_descriptor { // They can be matched by the host indexer and used to classify the plugin. // The array of pointers must be null terminated. // For some standard features see plugin-features.h - const char **features; + const char *const *features; } clap_plugin_descriptor_t; typedef struct clap_plugin {
Fix dex test case.
@@ -99,7 +99,7 @@ int main(int argc, char** argv) assert_true_rule_blob( "import \"dex\" rule test { condition: \ - dex.map_list.map_item[1].type == dex.TYPE_HEADER_ITEM \ + dex.map_list.map_item[0].type == dex.TYPE_HEADER_ITEM \ }", DEX_FILE);
board/twinkie/simpletrace.c: Format with clang-format BRANCH=none TEST=none
@@ -55,14 +55,10 @@ static const char * const data_msg_name[] = { }; static const char *const svdm_cmd_name[] = { - [CMD_DISCOVER_IDENT] = "DISCID", - [CMD_DISCOVER_SVID] = "DISCSVID", - [CMD_DISCOVER_MODES] = "DISCMODE", - [CMD_ENTER_MODE] = "ENTER", - [CMD_EXIT_MODE] = "EXIT", - [CMD_ATTENTION] = "ATTN", - [CMD_DP_STATUS] = "DPSTAT", - [CMD_DP_CONFIG] = "DPCFG", + [CMD_DISCOVER_IDENT] = "DISCID", [CMD_DISCOVER_SVID] = "DISCSVID", + [CMD_DISCOVER_MODES] = "DISCMODE", [CMD_ENTER_MODE] = "ENTER", + [CMD_EXIT_MODE] = "EXIT", [CMD_ATTENTION] = "ATTN", + [CMD_DP_STATUS] = "DPSTAT", [CMD_DP_CONFIG] = "DPCFG", }; static const char *const svdm_cmdt_name[] = { @@ -119,8 +115,8 @@ static void print_packet(int head, uint32_t *payload) } name = cnt ? data_msg_name[typ] : ctrl_msg_name[typ]; prole = head & (PD_ROLE_SOURCE << 8) ? "SRC" : "SNK"; - ccprintf("%pT %s/%d [%04x]%s", - PRINTF_TIMESTAMP_NOW, prole, id, head, name); + ccprintf("%pT %s/%d [%04x]%s", PRINTF_TIMESTAMP_NOW, prole, id, head, + name); if (!cnt) { /* Control message : we are done */ ccputs("\n"); return; @@ -177,18 +173,19 @@ static void rx_event(void) rx_edge_ts[i][rx_edge_ts_idx[i]].val = get_time().val; next_idx = (rx_edge_ts_idx[i] == PD_RX_TRANSITION_COUNT - 1) ? - 0 : rx_edge_ts_idx[i] + 1; + 0 : + rx_edge_ts_idx[i] + 1; /* * If we have seen enough edges in a certain amount of * time, then trigger RX start. */ if ((rx_edge_ts[i][rx_edge_ts_idx[i]].val - - rx_edge_ts[i][next_idx].val) - < PD_RX_TRANSITION_WINDOW) { + rx_edge_ts[i][next_idx].val) < + PD_RX_TRANSITION_WINDOW) { /* acquire the message only on the active CC */ - STM32_COMP_CSR &= ~(i ? STM32_COMP_CMP1EN - : STM32_COMP_CMP2EN); + STM32_COMP_CSR &= ~(i ? STM32_COMP_CMP1EN : + STM32_COMP_CMP2EN); /* start sampling */ pd_rx_start(0); /*
Remove unavailable modules
@@ -25,7 +25,7 @@ These add-on modules are available from other developers; follow the links for m ## Build System Modules -* [CMake](https://github.com/Geequlim/premake-modules/tree/master/cmake) : CMakeLists exporter for premake +* [CMake](https://github.com/Jarod42/premake-cmake) : CMakeLists exporter for premake * [Ninja](https://github.com/jimon/premake-ninja) : [Ninja](https://github.com/martine/ninja) support ## Tool Modules @@ -36,7 +36,6 @@ These add-on modules are available from other developers; follow the links for m * [Generate compile_commands.json](https://github.com/tarruda/premake-export-compile-commands) : Export clang compilation database * [GitHub Packages](https://github.com/mversluys/premake-ghp) : Consume libraries directly from GitHub releases * [Pkgconfig](https://github.com/tarruda/premake-pkgconfig) : Pure lua implementation of pkgconfig for premake -* [Pkgconfig](https://github.com/Geequlim/premake-modules/tree/master/pkgconfig) : pkg-config loader for premake * [Platform test](https://github.com/tarruda/premake-platform-test) : Perform platform checks in your premake configuration ## Library Modules
Prettier pointer variable declarations in C We now do not leave a space after the `*` when declaring a pointer variable. Before: `TString * x1;` After: `TString *x1;`
@@ -47,7 +47,12 @@ end -- @returns A syntactically valid function argument or variable declaration -- without the comma or semicolon local function c_declaration(typ, name) - return string.format("%s %s", ctype(typ), name) + local typstr = ctype(typ) + if typstr:sub(-1) == "*" then + return typstr..name -- Pointers look nicer without a space + else + return typstr.." "..name + end end --
[core] fix crash at shutdown w/ certain config If server.systemd-socket-activation = "enable" and one or more of the sockets is not listed in lighttpd.conf, then when the server is shutting down, a buffer from the config file is free()d twice.
@@ -686,6 +686,8 @@ int network_init(server *srv, int stdin_fd) { force_assert(NULL != srv_socket); memcpy(srv_socket, srv->srv_sockets_inherited.ptr[i], sizeof(server_socket)); + srv_socket->srv_token = + buffer_init_buffer(srv_socket->srv_token); network_srv_sockets_append(srv, srv_socket); } }
pybricks/nxtdevices/ColorSensor: drop all() This was a hidden, undocumented debug function that we can remove.
@@ -60,21 +60,6 @@ static mp_obj_t color_obj(pbio_color_t color) { } } -// pybricks.nxtdevices.ColorSensor.all -STATIC mp_obj_t nxtdevices_ColorSensor_all(mp_obj_t self_in) { - nxtdevices_ColorSensor_obj_t *self = MP_OBJ_TO_PTR(self_in); - int32_t all[5]; - pb_device_get_values(self->pbdev, PBIO_IODEV_MODE_NXT_COLOR_SENSOR__MEASURE, all); - mp_obj_t ret[5]; - for (uint8_t i = 0; i < 4; i++) { - ret[i] = mp_obj_new_int(all[i]); - } - ret[4] = color_obj(all[4]); - - return mp_obj_new_tuple(5, ret); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(nxtdevices_ColorSensor_all_obj, nxtdevices_ColorSensor_all); - // pybricks.nxtdevices.ColorSensor.rgb STATIC mp_obj_t nxtdevices_ColorSensor_rgb(mp_obj_t self_in) { nxtdevices_ColorSensor_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -120,7 +105,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(nxtdevices_ColorSensor_color_obj, nxtdevices_Co // dir(pybricks.nxtdevices.ColorSensor) STATIC const mp_rom_map_elem_t nxtdevices_ColorSensor_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_all), MP_ROM_PTR(&nxtdevices_ColorSensor_all_obj) }, { MP_ROM_QSTR(MP_QSTR_rgb), MP_ROM_PTR(&nxtdevices_ColorSensor_rgb_obj) }, { MP_ROM_QSTR(MP_QSTR_ambient), MP_ROM_PTR(&nxtdevices_ColorSensor_ambient_obj) }, { MP_ROM_QSTR(MP_QSTR_reflection), MP_ROM_PTR(&nxtdevices_ColorSensor_reflection_obj) },
Fix versioninfo regression on server 2016
@@ -7888,7 +7888,7 @@ NTSTATUS PhLoadLibraryAsImageResource( NULL, &imageBaseSize, ViewShare, - WindowsVersion < WINDOWS_10 ? 0 : MEM_MAPPED, + WindowsVersion < WINDOWS_10_RS2 ? 0 : MEM_MAPPED, PAGE_READONLY );
Update IoTjs documentation.
IoT.js is an open source software platform for Internet of Things with JavaScript. -More mode detailed information, please check: +For more mode detailed information, please check: http://www.iotjs.net Or shipped [README](..//external/iotjs/README.md) in sources. @@ -37,7 +37,7 @@ Using menuconfig an example can be used to selected needed feature. ## How to load scripts File can be loaded for different locations, -but it is convenient to use add a ROM partition as explained in +For convinence, it is recommended to use the approach of adding a ROM partition as explained in [HowToUseROMFS.md](HowToUseROMFS.md) Then place your script(s) in tools/fs/contents, for instance: @@ -51,8 +51,24 @@ Then place your script(s) in tools/fs/contents, for instance: WiFi can be also enabled on boot if you want to join a network before running the script. -You need to run menuconfig again and edit credentials, -(typically for WPA2: Auth=5 and Enc=4) +You need to run "make menuconfig" again and edit credentials. + + make menuconfig + # Application Configuration ---> + # Examples ---> + # [*] IoT.js StartUp example + # (/rom/example/index.js) Main javascript file + # [*] Connect WiFi + # ("APSSID") SSID of AP + # ("APPassword") Passphrase of AP + # (4) Authentication type + # (4) Encryption type + # Application entry point (...) ---> + # (X) IoT.js StartUp example + +Edit "SSID of AP" and "Passphrase of AP" with your WiFi SSID and password. +For values of "Authentication type" and "Encryption type", use <Help> menu to find values that match +your WiFi configurations. For example, 4 for Authentication type of "WPA and WPA2 PSK", and 4 for "Encryption type of "TKIP". ## Resources:
chat-view: send invites when creating chat and group already exists
:~ (create-chat app-path.act security.act allow-history.act) %- create-group :* group-path.act + app-path.act security.act members.act title.act == :: ++ create-group - |= [=path security=rw-security ships=(set ship) title=@t desc=@t] + |= [=path app-path=path sec=rw-security ships=(set ship) title=@t desc=@t] ^- (list card) - ?^ (group-scry path) ~ + =/ group (group-scry path) + ?^ group + %- zing + %+ turn ~(tap in u.group) + |= =ship + ?: =(ship our.bol) ~ + [(send-invite app-path ship)]~ :: do not create a managed group if this is a sig path or a blacklist :: - ?: =(security %channel) + ?: =(sec %channel) :~ (group-poke [%bundle path]) - (create-security path security) + (create-security path sec) (permission-hook-poke [%add-owned path path]) == ?: (is-managed path) ~[(contact-view-poke [%create path ships title desc])] :~ (group-poke [%bundle path]) (group-poke [%add ships path]) - (create-security path security) + (create-security path sec) (permission-hook-poke [%add-owned path path]) == :: !>(act) == :: - ++ send-invite-poke + ++ send-invite |= [=path =ship] ^- card =/ =invite
vere: directly implements utf-32 to utf-8 conversion
@@ -485,11 +485,39 @@ _term_it_set_line(u3_utty* uty_u, c3_w sap_w) { u3_utat* tat_u = &uty_u->tat_u; - u3_noun txt = u3do("tuft", u3i_words(wor_w, lin_w)); - c3_w byt_w = u3r_met(3, txt); c3_y* hun_y = (c3_y*)lin_w; + c3_w byt_w = 0; - u3r_bytes(0, byt_w, hun_y, txt); + // convert lin_w in-place from utf-32 to utf-8 + // + // (this is just a hand-translation of +tuft) + // + { + c3_w car_w, i_w; + + for ( i_w = 0; i_w < wor_w; i_w++ ) { + car_w = lin_w[i_w]; + + if ( 0x7f >= car_w ) { + hun_y[byt_w++] = car_w; + } + else if ( 0x7ff >= car_w ) { + hun_y[byt_w++] = 0xc0 ^ ((car_w >> 6) & 0x1f); + hun_y[byt_w++] = 0x80 ^ (car_w & 0x3f); + } + else if ( 0xffff >= car_w ) { + hun_y[byt_w++] = 0xe0 ^ ((car_w >> 12) & 0xf); + hun_y[byt_w++] = 0x80 ^ ((car_w >> 6) & 0x3f); + hun_y[byt_w++] = 0x80 ^ (car_w & 0x3f); + } + else { + hun_y[byt_w++] = 0xf0 ^ ((car_w >> 18) & 0x7); + hun_y[byt_w++] = 0x80 ^ ((car_w >> 12) & 0x3f); + hun_y[byt_w++] = 0x80 ^ ((car_w >> 6) & 0x3f); + hun_y[byt_w++] = 0x80 ^ (car_w & 0x3f); + } + } + } c3_free(tat_u->mir.lin_y); tat_u->mir.lin_y = hun_y; @@ -498,8 +526,6 @@ _term_it_set_line(u3_utty* uty_u, tat_u->mir.sap_w = sap_w; _term_it_show_line(uty_u, wor_w, sap_w); - - u3z(txt); } /* _term_it_show_more(): new current line.
[ivshmem] Added support for different struct passed from 32 bit
#pragma alloc_text (PAGE, IVSHMEMEvtDeviceFileCleanup) #endif +#ifdef _WIN64 +// 32bit struct for when a 32bit application sends IOCTL codes +typedef struct IVSHMEM_MMAP32 +{ + IVSHMEM_PEERID peerID; // our peer id + IVSHMEM_SIZE size; // the size of the memory region + UINT32 ptr; // pointer to the memory region + UINT16 vectors; // the number of vectors available +} +IVSHMEM_MMAP32, *PIVSHMEM_MMAP32; +#endif + NTSTATUS IVSHMEMQueueInitialize(_In_ WDFDEVICE Device) { WDFQUEUE queue; @@ -103,15 +115,23 @@ IVSHMEMEvtIoDeviceControl( break; } - if (OutputBufferLength != sizeof(IVSHMEM_MMAP)) +#ifdef _WIN64 + PIRP irp = WdfRequestWdmGetIrp(Request); + const BOOLEAN is32Bit = IoIs32bitProcess(irp); + const size_t bufferLen = is32Bit ? sizeof(IVSHMEM_MMAP32) : sizeof(IVSHMEM_MMAP); +#else + const size_t bufferLen = sizeof(IVSHMEM_MMAP); +#endif + PVOID buffer; + + if (OutputBufferLength != bufferLen) { - DEBUG_ERROR("IOCTL_IVSHMEM_REQUEST_MMAP: Invalid size, expected %u but got %u", sizeof(IVSHMEM_MMAP), OutputBufferLength); + DEBUG_ERROR("IOCTL_IVSHMEM_REQUEST_MMAP: Invalid size, expected %u but got %u", bufferLen, OutputBufferLength); status = STATUS_INVALID_BUFFER_SIZE; break; } - PIVSHMEM_MMAP out = NULL; - if (!NT_SUCCESS(WdfRequestRetrieveOutputBuffer(Request, OutputBufferLength, (PVOID)&out, NULL))) + if (!NT_SUCCESS(WdfRequestRetrieveOutputBuffer(Request, bufferLen, (PVOID)&buffer, NULL))) { DEBUG_ERROR("%s", "IOCTL_IVSHMEM_REQUEST_MMAP: Failed to retrieve the output buffer"); status = STATUS_INVALID_USER_BUFFER; @@ -144,12 +164,26 @@ IVSHMEMEvtIoDeviceControl( } deviceContext->owner = WdfRequestGetFileObject(Request); +#ifdef _WIN64 + if (is32Bit) + { + PIVSHMEM_MMAP32 out = (PIVSHMEM_MMAP32)buffer; + out->peerID = (UINT16)deviceContext->devRegisters->ivProvision; + out->size = (UINT64)deviceContext->shmemAddr.NumberOfBytes; + out->ptr = PtrToUint(deviceContext->shmemMap); + out->vectors = deviceContext->interruptsUsed; + } + else +#endif + { + PIVSHMEM_MMAP out = (PIVSHMEM_MMAP)buffer; out->peerID = (UINT16)deviceContext->devRegisters->ivProvision; out->size = (UINT64)deviceContext->shmemAddr.NumberOfBytes; out->ptr = deviceContext->shmemMap; out->vectors = deviceContext->interruptsUsed; + } status = STATUS_SUCCESS; - bytesReturned = sizeof(IVSHMEM_MMAP); + bytesReturned = bufferLen; break; }
workaround fault with ssq=inf,scale=0
@@ -404,6 +404,7 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) #else nrm2_compute(n, x, inc_x, &ssq, &scale); #endif + if (fabs(scale) <1.e-300) return 0.; ssq = sqrt(ssq) * scale; return ssq;
build: rename tmp file for capturing derivation path
@@ -112,12 +112,11 @@ jobs: run: | nix-build -A urbit \ --arg enableStatic true \ - --argstr verePace ${{ env.VERE_PACE }} > ./result - cat ./result + --argstr verePace ${{ env.VERE_PACE }} > ./urbit-derivation + cat ./urbit-derivation echo -n "urbit_static=" >> $GITHUB_ENV - cat ./result >> $GITHUB_ENV - cat ./result - + cat ./urbit-derivation >> $GITHUB_ENV + cat ./urbit-derivation - name: confirm binary is mostly static if: matrix.os == 'macos-latest'
file copying now uses a 2KB buffer
@@ -711,9 +711,19 @@ long int findLogFileSize() } void copyToFile(FILE **fp1, FILE **fp2){ - char ch; - while((ch = getc(*fp1)) != EOF) - putc(ch, *fp2); + int buffer_size = 2048; + char *buf = (char*) malloc(sizeof(char)*buffer_size); + if(!buf){ + fprintf(stderr,"Error creating buffer for debug logging\n"); + return; + } + fseek(*fp1, 0, SEEK_SET); + size_t r = fread(buf, sizeof(char), sizeof(buffer_size)-1, *fp1); + while(r == sizeof(buffer_size)-1){ + fwrite(buf, sizeof(char), sizeof(buffer_size)-1, *fp2); + r = fread(buf, sizeof(char), sizeof(buffer_size)-1, *fp1); + } + fwrite(buf, sizeof(char), r, *fp2); } void
Set maskHash when creating parameters.
@@ -567,6 +567,8 @@ RSA_PSS_PARAMS *rsa_pss_params_create(const EVP_MD *sigmd, mgf1md = sigmd; if (!rsa_md_to_mgf1(&pss->maskGenAlgorithm, mgf1md)) goto err; + if (!rsa_md_to_algor(&pss->maskHash, mgf1md)) + goto err; return pss; err: RSA_PSS_PARAMS_free(pss);
Use event helper functions for connection handle
@@ -451,16 +451,18 @@ esp_conn_set_ssl_buffersize(size_t size, uint32_t blocking) { */ esp_conn_p esp_conn_get_from_evt(esp_cb_t* evt) { - if (evt->type == ESP_CB_CONN_ACTIVE || evt->type == ESP_CB_CONN_CLOSED) { - return evt->cb.conn_active_closed.conn; + if (evt->type == ESP_CB_CONN_ACTIVE) { + return esp_evt_conn_active_get_conn(evt); + } else if (evt->type == ESP_CB_CONN_CLOSED) { + return esp_evt_conn_closed_get_conn(evt); } else if (evt->type == ESP_CB_CONN_DATA_RECV) { - return evt->cb.conn_data_recv.conn; + return esp_evt_conn_data_recv_get_conn(evt); } else if (evt->type == ESP_CB_CONN_DATA_SEND_ERR) { - return evt->cb.conn_data_send_err.conn; + return esp_evt_conn_data_send_err_get_conn(evt); } else if (evt->type == ESP_CB_CONN_DATA_SENT) { - return evt->cb.conn_data_sent.conn; + return esp_evt_conn_data_sent_get_conn(evt); } else if (evt->type == ESP_CB_CONN_POLL) { - return evt->cb.conn_poll.conn; + return esp_evt_conn_poll_get_conn(evt); } return NULL; }
Warn on ignored touch event In theory, this was expected to only happen when a touch event is sent just before the device is rotated, but some devices do not respect the encoding size, causing an unexpected mismatch. Refs <https://github.com/Genymobile/scrcpy/issues/1518>
@@ -166,7 +166,7 @@ public class Controller { Point point = device.getPhysicalPoint(position); if (point == null) { - // ignore event + Ln.w("Ignore touch event, it was generated for a different device size"); return false; }
Fix QString::arg indexing to remove warnings. Resolves
@@ -490,6 +490,9 @@ QvisEngineWindow::UpdateInformation(int index) // Cyrus Harrison, Tue Jun 24 11:15:28 PDT 2008 // Initial Qt4 Port. // +// Kathleen Biagas, Tue Mar 2 15:49:07 PST 2021 +// Fix QString arg indexing. +// // **************************************************************************** void @@ -528,7 +531,7 @@ QvisEngineWindow::UpdateStatusArea() } else if (s->GetMessageType() == 2) { - QString msg = QString("%1/%1").arg(s->GetCurrentStage()).arg(s->GetMaxStage()); + QString msg = QString("%1/%2").arg(s->GetCurrentStage()).arg(s->GetMaxStage()); msg = tr("Total Status: Stage ") + msg; totalStatusLabel->setText(msg); msg = tr("Stage Status: ") + QString(s->GetCurrentStageName().c_str());
Fix `lightlastseeninterval` not displayed via REST API Using the parameter works, but display via GET on `config` resource doesn't display it.
@@ -1057,6 +1057,7 @@ void DeRestPluginPrivate::configToMap(const ApiRequest &req, QVariantMap &map) map["networkopenduration"] = gwNetworkOpenDuration; map["timeformat"] = gwTimeFormat; map["whitelist"] = whitelist; + map["lightlastseeninterval"] = gwLightLastSeenInterval; map["linkbutton"] = gwLinkButton; map["portalservices"] = false; map["websocketport"] = static_cast<double>(gwConfig["websocketport"].toUInt());
fix sliderfollow circle fadeout animation
@@ -90,17 +90,21 @@ class Check: followappear = False hitvalue = combostatus = 0 - if self.sliders_memory[osu_d["time"]]["done"]: - return False, None, None, None, None, None, hitvalue, combostatus - + prev_state = self.sliders_memory[osu_d["time"]]["follow state"] if osu_d["end time"] > osr[3] > osu_d["time"]: followappear, hitvalue, combostatus = self.checkcursor_incurve(osu_d, osr) + + if self.sliders_memory[osu_d["time"]]["done"]: + state = prev_state + self.sliders_memory[osu_d["time"]]["follow state"] = False + return state, None, osu_d["time"], None, None, False, 0, 0 + if osr[3] > osu_d["end time"]: score = self.sliders_memory[osu_d["time"]]["score"] del self.sliders_memory[osu_d["time"]] - return True, score, osu_d["time"], osu_d["end x"], osu_d["end y"], followappear, hitvalue, combostatus + return prev_state, score, osu_d["time"], osu_d["end x"], osu_d["end y"], False, hitvalue, combostatus - if followappear != self.sliders_memory[osu_d["time"]]["follow state"]: + if followappear != prev_state: self.sliders_memory[osu_d["time"]]["follow state"] = followappear return True, None, osu_d["time"], 0, 0, followappear, hitvalue, combostatus
fix: should actually return true if string is NULL
@@ -245,7 +245,7 @@ orka_str_to_ntl( int orka_str_below_threshold(const char *str, const size_t threshold) { - if (NULL == str) return 0; + if (NULL == str) return 1; size_t i=0; for ( ; i < threshold; ++i) {
nxwm: Fix warning about on_exit() dependency
* exit. */ -#ifndef CONFIG_SCHED_ONEXIT -# warning "on_exit() support may be needed (CONFIG_SCHED_ONEXIT)" +#if CONFIG_LIBC_MAX_EXITFUNS == 0 +# warning "on_exit() support may be needed (CONFIG_LIBC_MAX_EXITFUNS)" #endif /**
include/uart.h: Format with clang-format BRANCH=none TEST=none
@@ -72,8 +72,8 @@ int uart_put_raw(const char *out, int len); * * @return EC_SUCCESS, or non-zero if output was truncated. */ -__attribute__((__format__(__printf__, 1, 2))) -int uart_printf(const char *format, ...); +__attribute__((__format__(__printf__, 1, 2))) int +uart_printf(const char *format, ...); /** * Print formatted output to the UART, like vprintf(). @@ -258,7 +258,9 @@ void uart_exit_dsleep(void); */ void uart_deepsleep_interrupt(enum gpio_signal signal); #else -static inline void uart_deepsleep_interrupt(enum gpio_signal signal) { } +static inline void uart_deepsleep_interrupt(enum gpio_signal signal) +{ +} #endif /* !CONFIG_LOW_POWER_IDLE */ #if defined(HAS_TASK_CONSOLE) && defined(CONFIG_FORCE_CONSOLE_RESUME) @@ -269,7 +271,9 @@ static inline void uart_deepsleep_interrupt(enum gpio_signal signal) { } */ void uart_enable_wakeup(int enable); #elif !defined(CHIP_FAMILY_NPCX5) -static inline void uart_enable_wakeup(int enable) {} +static inline void uart_enable_wakeup(int enable) +{ +} #endif #ifdef CONFIG_UART_INPUT_FILTER @@ -372,9 +376,7 @@ enum ec_status uart_console_read_buffer_init(void); * * @return result status (EC_RES_*) */ -int uart_console_read_buffer(uint8_t type, - char *dest, - uint16_t dest_size, +int uart_console_read_buffer(uint8_t type, char *dest, uint16_t dest_size, uint16_t *write_count); /**
Demo: remove commented code, and unused macros
@@ -79,15 +79,6 @@ to exclude the API function. */ #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_TIMERS 1 #define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) -/* -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 0 -#define INCLUDE_vTaskSuspend 0 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -*/ #define INCLUDE_vTaskPrioritySet 1 #define INCLUDE_uxTaskPriorityGet 1 @@ -121,40 +112,9 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ | 9 connected. */ extern void vLoggingPrintf( const char *pcFormatString, ... ); - -/* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to -1 then FreeRTOS_debug_printf should be defined to the function used to print - out the debugging messages. */ -#define ipconfigHAS_DEBUG_PRINTF 1 - #ifdef HEAP3 #define xPortGetMinimumEverFreeHeapSize (x) #define xPortGetFreeHeapSize (x) #endif -#if( ipconfigHAS_DEBUG_PRINTF == 1 ) -#include <stdio.h> -#define FreeRTOS_debug_printf(X) \ - printf("%p->%s %d: ", \ - xTaskGetCurrentTaskHandle(), \ - __FUNCTION__, \ - __LINE__); \ - vLoggingPrintf X -#endif - -/* Set to 1 to print out non debugging messages, for example the output of the - FreeRTOS_netstat() command, and ping replies. If ipconfigHAS_PRINTF is set to 1 - then FreeRTOS_printf should be set to the function used to print out the - messages. */ -#define ipconfigHAS_PRINTF 1 -#if( ipconfigHAS_PRINTF == 1 ) -#include <stdio.h> -#define FreeRTOS_printf(X) \ - printf("%p->%s %d: ", \ - xTaskGetCurrentTaskHandle(), \ - __FUNCTION__, \ - __LINE__); \ - vLoggingPrintf X -#endif - #endif /* FREERTOS_CONFIG_H */
android: fixing rhoapi.js with wrong regexp
@@ -1122,7 +1122,7 @@ if (typeof(qt) == "undefined"){ // the order is important var bridgeMapping = [ [/RhoSimulator/ , bridges[rhoPlatform.id.RHOSIMULATOR]], - [/^(Windows\s+Phone).*Android/ , bridges[rhoPlatform.id.ANDROID] ], + [/(?<!Windows\s+Phone.*)Android(?!.*Windows\s+Phone)/, bridges[rhoPlatform.id.ANDROID]], [/iPhone|iPod|iPad/ , bridges[rhoPlatform.id.IPHONE] ], [/Windows\s+Phone\s+8/ , bridges[rhoPlatform.id.WP8] ], [/Windows\s+Phone\s+10/ , bridges[rhoPlatform.id.UWP] ],
Allow sizes to be divided
@@ -14,6 +14,7 @@ namespace blit { constexpr Size(int32_t w, int32_t h) : w(w), h(h) {} inline Size& operator*= (const float a) { w = static_cast<int32_t>(w * a); h = static_cast<int32_t>(h * a); return *this; } + inline Size operator / (const int a) { return Size(w / a, h / a);} bool empty() { return w <= 0 || h <= 0; }
board/driblee/board.h: Format with clang-format BRANCH=none TEST=none
@@ -117,11 +117,7 @@ enum adc_channel { ADC_CH_COUNT }; -enum temp_sensor_id { - TEMP_SENSOR_1, - TEMP_SENSOR_2, - TEMP_SENSOR_COUNT -}; +enum temp_sensor_id { TEMP_SENSOR_1, TEMP_SENSOR_2, TEMP_SENSOR_COUNT }; /* List of possible batteries */ enum battery_type {
feat[#1112]:Delete useless debug information
@@ -288,7 +288,6 @@ static BOAT_RESULT Boat_private_ecdsa_sign(mbedtls_ecdsa_context *ctx, //t: temporary random number to counter side-channel attacks int boat_ecdsPrefix; - BoatLog(BOAT_LOG_CRITICAL, "===> enter Boat_private_ecdsa_sign"); /* Fail cleanly on curves such as Curve25519 that can't be used for ECDSA */ // if (ctx == NULL || !mbedtls_ecdsa_can_do(ctx->grp.id) || ctx->grp.N.p == NULL) if (ctx == NULL || ctx->grp.N.p == NULL) @@ -309,7 +308,6 @@ static BOAT_RESULT Boat_private_ecdsa_sign(mbedtls_ecdsa_context *ctx, mbedtls_mpi_init(&r); mbedtls_mpi_init(&s); - BoatLog(BOAT_LOG_CRITICAL, "===> complate mbedtls mpi init"); sign_tries = 0; do { @@ -880,7 +878,6 @@ int boat_get_mbedtls_ecp_key(mbedtls_ecp_keypair *out_mbkey, BUINT8 *in_prikey) } } - BoatLog(BOAT_LOG_NORMAL, "== gen_privkey_fix ret=%d", ret); return(ret); } @@ -896,16 +893,10 @@ void boat_get_public_key_byprikey(BUINT8 *priv_key, BUINT8 *pub_key) result = mbedtls_pk_setup(&prikeyCtx, mbedtls_pk_info_from_type(MBEDTLS_PK_ECKEY)); - BoatLog(BOAT_LOG_NORMAL, "== boat_get_public_key_byprikey result=%d", result); - ecPrikey = ((mbedtls_ecp_keypair *) (prikeyCtx).pk_ctx); boat_get_mbedtls_ecp_key(ecPrikey, priv_key); - BoatLog(BOAT_LOG_NORMAL, "==pubkey d.n=%d", ecPrikey->d.n); - BoatLog(BOAT_LOG_NORMAL, "==pubkey d.s=%d", ecPrikey->d.s); - - BoatLog(BOAT_LOG_NORMAL, "==pubkey grp.id=%d", ecPrikey->grp.id); mbedtls_ecp_mul(&ecPrikey->grp, &ecPrikey->Q,
Enable Linux for qword
@@ -70,7 +70,6 @@ elif host_machine.system() == 'managarm' internal_conf.set('MLIBC_MAP_FILE_WINDOWS', true) subdir('sysdeps/managarm') elif host_machine.system() == 'qword' - disable_linux_option = true rtdl_include_dirs += include_directories('sysdeps/qword/include') libc_include_dirs += include_directories('sysdeps/qword/include') subdir('sysdeps/qword')
Add -latomic only for architectures where needed
@@ -677,7 +677,7 @@ my %targets = ( #### # *-generic* is endian-neutral target, but ./config is free to # throw in -D[BL]_ENDIAN, whichever appropriate... - "linux-generic" => { + "linux-generic32" => { inherit_from => [ "BASE_unix" ], CC => "gcc", CXX => "g++", @@ -699,18 +699,17 @@ my %targets = ( shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" }, enable => [ "afalgeng" ], }, - "linux-generic32" => { - inherit_from => [ "linux-generic" ], + "linux-latomic" => { + inherit_from => [ "linux-generic32" ], ex_libs => add(threads("-latomic")), - bn_ops => "BN_LLONG RC4_CHAR", }, "linux-generic64" => { - inherit_from => [ "linux-generic" ], + inherit_from => [ "linux-generic32" ], bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", }, "linux-ppc" => { - inherit_from => [ "linux-generic32" ], + inherit_from => [ "linux-latomic" ], asm_arch => 'ppc32', perlasm_scheme => "linux32", lib_cppflags => add("-DB_ENDIAN"), @@ -765,7 +764,7 @@ my %targets = ( # # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8 # - inherit_from => [ "linux-generic32" ], + inherit_from => [ "linux-latomic" ], asm_arch => 'armv4', perlasm_scheme => "linux32", }, @@ -786,7 +785,7 @@ my %targets = ( "linux-mips32" => { # Configure script adds minimally required -march for assembly # support, if no -march was specified at command line. - inherit_from => [ "linux-generic32" ], + inherit_from => [ "linux-latomic" ], cflags => add("-mabi=32"), cxxflags => add("-mabi=32"), asm_arch => 'mips32', @@ -795,7 +794,7 @@ my %targets = ( # mips32 and mips64 below refer to contemporary MIPS Architecture # specifications, MIPS32 and MIPS64, rather than to kernel bitness. "linux-mips64" => { - inherit_from => [ "linux-generic32" ], + inherit_from => [ "linux-latomic" ], cflags => add("-mabi=n32"), cxxflags => add("-mabi=n32"), bn_ops => "RC4_CHAR", @@ -929,7 +928,7 @@ my %targets = ( #### SPARC Linux setups "linux-sparcv8" => { - inherit_from => [ "linux-generic32" ], + inherit_from => [ "linux-latomic" ], cflags => add("-mcpu=v8"), cxxflags => add("-mcpu=v8"), lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"), @@ -939,7 +938,7 @@ my %targets = ( "linux-sparcv9" => { # it's a real mess with -mcpu=ultrasparc option under Linux, # but -Wa,-Av8plus should do the trick no matter what. - inherit_from => [ "linux-generic32" ], + inherit_from => [ "linux-latomic" ], cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"), cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"), lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
update requirements to cover go 1.19
@@ -36,12 +36,11 @@ The distros that AppScope supports all require the use of `/tmp`, `/dev/shm`, an **Only** these runtimes are supported: -- Open JVM 7 and later, Oracle JVM 7 and later, go1.8 through go1.18. +- Open JVM 7 and later, Oracle JVM 7 and later, go1.9 through go1.19. AppScope cannot: - Unload the libscope library, once loaded. -- Unattach/detach from a running process, once attached. - Instrument static executables that are not written in Go. - Instrument Go executables on ARM. - Attach to any static application.
initialize thread_delayed_free field atomically
@@ -122,7 +122,7 @@ mi_heap_t _mi_heap_main = { &tld_main, MI_SMALL_PAGES_EMPTY, MI_PAGE_QUEUES_EMPTY, - NULL, + ATOMIC_VAR_INIT(NULL), 0, // thread id MI_INIT_COOKIE, // initial cookie { MI_INIT_COOKIE, MI_INIT_COOKIE }, // the key of the main heap can be fixed (unlike page keys that need to be secure!)
Disable receive from dnstest.c:dnsReply().
@@ -192,7 +192,7 @@ dnsReply(void** state) assert_int_not_equal(-1, fd); assert_int_equal(0, CreateQuery(&pkt)); assert_int_not_equal(-1, sendToNS(fd, (char *)&pkt, - sizeof(pkt) + sizeof(question), &sa, 1)); + sizeof(pkt) + sizeof(question), &sa, 0)); truncFile(); close(fd); }
sim: Add a readable header to test images Rather than just make the test images entirely pseudorandom data, add a small textual header to the front that describes some key information about each image. This can be helpful when debugging, to determine what exactly is in each image slot.
@@ -4,6 +4,7 @@ use rand::{ Rng, SeedableRng, XorShiftRng, }; use std::{ + io::{Cursor, Write}, mem, slice, }; @@ -1097,6 +1098,15 @@ fn install_image(flash: &mut SimMultiFlash, slot: &SlotInfo, len: usize, let mut b_img = vec![0; len]; splat(&mut b_img, offset); + // Add some information at the start of the payload to make it easier + // to see what it is. This will fail if the image itself is too small. + { + let mut wr = Cursor::new(&mut b_img); + writeln!(&mut wr, "offset: {:#x}, dev_id: {:#x}, slot_info: {:?}", + offset, dev_id, slot).unwrap(); + writeln!(&mut wr, "version: {:?}", deps.my_version(offset, slot.index)).unwrap(); + } + // TLV signatures work over plain image tlv.add_bytes(&b_img);
Fix compilation error in spinbody.c, declare int outside for loop.
@@ -262,6 +262,7 @@ void ReadOptionsSpiNBody(BODY *body,CONTROL *control,FILES *files,OPTIONS *optio //============================ End Read Inputs ================================= void InitializeBodySpiNBody(BODY *body,CONTROL *control,UPDATE *update,int iBody,int iModule) { + int iTmpBody = 0; if (body[iBody].bSpiNBody){ body[iBody].iGravPerts = control->Evolve.iNumBodies-1; //All bodies except the body itself are perturbers body[iBody].iaGravPerts = malloc(body[iBody].iGravPerts*sizeof(int)); @@ -271,7 +272,7 @@ void InitializeBodySpiNBody(BODY *body,CONTROL *control,UPDATE *update,int iBody //If orbital parameters are defined, then we want to set position and velocity based on those if (body[iBody].bUseOrbParams){ if (iBody == 0){ //Only want to do this once - for (int iTmpBody = 0; iTmpBody<control->Evolve.iNumBodies; iTmpBody++){ + for (iTmpBody = 0; iTmpBody<control->Evolve.iNumBodies; iTmpBody++){ body[iTmpBody].dCartPos = malloc(3*sizeof(double)); body[iTmpBody].dCartVel = malloc(3*sizeof(double)); //Convert all bodies w/ orbital elements to Heliocentric
minor: remove obsolete comment [ci skip]
// // -// Simulates SPI mode SD card. Currently read-only. When the simulator is -// initialized, it opens the file specified by the argument +block=<filename> +// Simulates SPI mode SD card. When the simulator is initialized, it opens the +// file specified by the argument +block=<filename> // http://elm-chan.org/docs/mmc/mmc_e.html //
Workaround for silly warning
@@ -172,7 +172,7 @@ for table in hlir.tables: #{ void show_params_by_action_id(char* out, int table_id, int action_id, const void* entry) { for table in hlir.tables: if 'key' not in table or table.key_length_bits == 0: - #[ if (table_id == TABLE_${table.name}) { sprintf(out, ""); return; } + #[ if (table_id == TABLE_${table.name}) { sprintf(out, "%s", ""); return; } continue #{ if (table_id == TABLE_${table.name}) {
Cascading: Fix tutorial examples
@@ -21,6 +21,8 @@ Configuration in the **system** namespace is readable for all users and the same In the default Elektra installation only an administrator can update configuration here: ```sh +# Backup-and-Restore:/sw/tutorial + kdb get /sw/tutorial/cascading/#0/current/test # RET: 1 # STDERR:Did not find key @@ -58,7 +60,7 @@ As **dir** precedes the **user** namespace, configuration in **dir** can overwri ```sh # create and change to a new directory ... -mkdir kdbtutorial && cd $_ +mkdir -p kdbtutorial && cd $_ # ... and create a key in this directories dir-namespace kdb set dir/sw/tutorial/cascading/#0/current/test "hello universe" @@ -148,8 +150,8 @@ First you need to create the system default value to link the override to if the user hasn't defined it: ```sh -$ sudo kdb set system/overrides/test "hello default" -#> Create a new key system/overrides/test with string hello default +sudo kdb set system/overrides/test "hello default" +#> Set string to hello default ``` Then we can create the link:
fix direction of sliderb
@@ -130,7 +130,7 @@ class SliderManager: sum_y = (1 - t) * slider.bezier_info[1][0].y + t * slider.arrow_pos.y cur_pos = Position(sum_x, sum_y) - vector_x1, vector_y1 = slider.prev_pos.x - cur_pos.x, slider.prev_pos.y - cur_pos.y + vector_x1, vector_y1 = -(slider.prev_pos.x - cur_pos.x), -(slider.prev_pos.y - cur_pos.y) if slider.cur_repeated % 2 == 0 and self.flip: ball = self.sliderb_frames[color][slider.sliderb_i].transpose(Image.FLIP_LEFT_RIGHT)
fix rt_memcpy buf in RT_USING_TINY_SIZE enable
@@ -220,9 +220,18 @@ void *rt_memcpy(void *dst, const void *src, rt_ubase_t count) { #ifdef RT_USING_TINY_SIZE char *tmp = (char *)dst, *s = (char *)src; + rt_ubase_t len; + if(tmp <= s || tmp > (s + count)) + { while (count--) *tmp ++ = *s ++; + } + else + { + for(len = count; len > 0; len --) + tmp[len -1] = s[len - 1]; + } return dst; #else
Fix export of provided EC keys The exporter freed a buffer too soon, and there were attempts to use its data later, which was overwritten by something else at that point.
@@ -352,13 +352,10 @@ int ec_export(void *keydata, int selection, OSSL_CALLBACK *param_cb, if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0) ok = ok && otherparams_to_params(ec, tmpl, NULL); - if (!ok - || (params = OSSL_PARAM_BLD_to_param(tmpl)) == NULL) - goto err; - + if (ok && (params = OSSL_PARAM_BLD_to_param(tmpl)) != NULL) ok = param_cb(params, cbarg); + OSSL_PARAM_BLD_free_params(params); -err: OSSL_PARAM_BLD_free(tmpl); OPENSSL_free(pub_key); return ok;
Update sedem image r6151855 sedem release: add info option with table rendering, move old info to list r6152706 SEDEM - Add Duty ABC group to owners Note: mandatory check (NEED_CHECK) was skipped
}, "sedem": { "formula": { - "sandbox_id": 571985643, + "sandbox_id": 576334852, "match": "SEDEM archive" }, "executable": {
DOCS: update location of gpfdist transform example.
<title>XML Transformation Examples</title> <body> <p>The following examples demonstrate the complete process for different types of XML data and - STX transformations. Files and detailed instructions associated with these examples are in - <codeph>demo/gpfdist_transform.tar.gz.</codeph> Read the README file in the <i>Before You - Begin</i> section before you run the examples. The README file explains how to download the - example data file used in the examples.</p> + STX transformations. Files and detailed instructions associated with these examples are in the + GitHub greenplum-db/gpdb repo in <codeph><xref + href="https://github.com/greenplum-db/gpdb/blob/master/gpMgmt/demo/gpfdist_transform" + format="html" scope="external">gpMgmt/demo/gpfdist_transform</xref></codeph>. Read the + README file in the <i>Before You Begin</i> section before you run the examples. The README + file explains how to download the example data file used in the examples.</p> </body> </topic>
hdlc_input: simplify code using existing functions
@@ -139,8 +139,8 @@ hdlc_input (vlib_main_t * vm, b0 = vlib_get_buffer (vm, bi0); b1 = vlib_get_buffer (vm, bi1); - h0 = (void *) (b0->data + b0->current_data); - h1 = (void *) (b1->data + b1->current_data); + h0 = vlib_buffer_get_current (b0); + h1 = vlib_buffer_get_current (b1); protocol0 = h0->protocol; protocol1 = h1->protocol; @@ -152,11 +152,8 @@ hdlc_input (vlib_main_t * vm, len0 += protocol0 == clib_host_to_net_u16 (HDLC_PROTOCOL_osi); len1 += protocol1 == clib_host_to_net_u16 (HDLC_PROTOCOL_osi); - b0->current_data += len0; - b1->current_data += len1; - - b0->current_length -= len0; - b1->current_length -= len1; + vlib_buffer_advance (b0, len0); + vlib_buffer_advance (b1, len1); /* Index sparse array with network byte order. */ sparse_vec_index2 (rt->next_by_protocol, protocol0, protocol1, &i0, @@ -235,7 +232,7 @@ hdlc_input (vlib_main_t * vm, b0 = vlib_get_buffer (vm, bi0); - h0 = (void *) (b0->data + b0->current_data); + h0 = vlib_buffer_get_current (b0); protocol0 = h0->protocol; @@ -243,8 +240,7 @@ hdlc_input (vlib_main_t * vm, len0 = sizeof (h0[0]); len0 += protocol0 == clib_host_to_net_u16 (HDLC_PROTOCOL_osi); - b0->current_data += len0; - b0->current_length -= len0; + vlib_buffer_advance (b0, len0); i0 = sparse_vec_index (rt->next_by_protocol, protocol0);
unfied: check for fades in byte 0, check for protocol id in byte 1
@@ -315,7 +315,7 @@ void rx_serial_find_protocol() { if (frame_status == FRAME_RX) { // We got something! What is it? switch (protocol_to_check) { case RX_SERIAL_PROTOCOL_DSM: - if (rx_buffer[0] == 0x00 && rx_buffer[1] <= 0x04 && rx_buffer[2] != 0x00) { + if (rx_buffer[0] < 4 && (rx_buffer[1] == 0x12 || rx_buffer[1] == 0x01 || rx_buffer[1] == 0xB2 || rx_buffer[1] == 0xA2)) { // allow up to 4 fades or detection will fail. Some dsm rx will log a fade or two during binding rx_serial_process_dsmx(); if (bind_safety > 0)
Moving generating CGO header file to the make stage.
@@ -56,21 +56,14 @@ $echo "configuring Go package ..." >> $NXT_AUTOCONF_ERR $echo -n "checking for Go ..." $echo "checking for Go ..." >> $NXT_AUTOCONF_ERR -nxt_go_test="GOPATH=`pwd` CGO_CPPFLAGS='-DNXT_CONFIGURE -I`pwd`/src'\ - \"${NXT_GO}\" build -o build/nxt_go_gen.a --buildmode=c-archive nginext" - -if /bin/sh -c "$nxt_go_test" >> $NXT_AUTOCONF_ERR 2>&1; then +if /bin/sh -c "${NXT_GO} version" >> $NXT_AUTOCONF_ERR 2>&1; then $echo " found" NXT_GO_VERSION="`${NXT_GO} version`" $echo " + ${NXT_GO_VERSION}" else - $echo "----------" >> $NXT_AUTOCONF_ERR - $echo $nxt_go_test >> $NXT_AUTOCONF_ERR - $echo "----------" >> $NXT_AUTOCONF_ERR - $echo $echo $echo $0: error: no Go found. $echo @@ -78,7 +71,6 @@ else fi - NXT_GO_PATH=${NXT_GO_PATH=`${NXT_GO} env GOPATH`} NXT_GO_PATH=${NXT_GO_PATH:-`pwd`/${NXT_GO}} @@ -103,12 +95,21 @@ GOPATH = $NXT_GO_PATH GOOS = `${NXT_GO} env GOOS` GOARCH = `${NXT_GO} env GOARCH` -${NXT_GO}: +${NXT_GO}: $NXT_BUILD_DIR/nxt_go_gen.h + +$NXT_BUILD_DIR/nxt_go_gen.h: + GOPATH=`pwd` \\ + CGO_CPPFLAGS='-DNXT_CONFIGURE \\ + -I`pwd`/src' \\ + ${NXT_GO} build -o $NXT_BUILD_DIR/nxt_go_gen.a \\ + --buildmode=c-archive nginext + +${NXT_GO}-install: ${NXT_GO} install -d \$(GOPATH)/src/nginext install -p ./src/nginext/*.c ./src/nginext/*.h \\ ./src/nginext/*.go \$(GOPATH)/src/nginext/ - CGO_CFLAGS="-I\$(NXT_ROOT)/build -I\$(NXT_ROOT)/src" \\ - CGO_LDFLAGS="-L\$(NXT_ROOT)/build ${NXT_LIBRT}" \\ + CGO_CFLAGS="-I\$(NXT_ROOT)/$NXT_BUILD_DIR -I\$(NXT_ROOT)/src" \\ + CGO_LDFLAGS="-L\$(NXT_ROOT)/$NXT_BUILD_DIR ${NXT_LIBRT}" \\ GOPATH=$NXT_GO_PATH \\ ${NXT_GO} install -v nginext
Fix range limit exceeding actual data size in last step
@@ -288,6 +288,7 @@ int CNAME(BLASLONG n, BLASLONG k, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc range_m[MAX_CPU_NUMBER - num_cpu - 1] = range_m[MAX_CPU_NUMBER - num_cpu] - width; range_n[num_cpu] = num_cpu * (((n + 15) & ~15) + 16); + if (range_n[num_cpu] > n) range_n[num_cpu] = n; queue[num_cpu].mode = mode; queue[num_cpu].routine = trmv_kernel; @@ -327,6 +328,7 @@ int CNAME(BLASLONG n, BLASLONG k, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc range_m[num_cpu + 1] = range_m[num_cpu] + width; range_n[num_cpu] = num_cpu * (((n + 15) & ~15) + 16); + if (range_n[num_cpu] > n) range_n[num_cpu] = n; queue[num_cpu].mode = mode; queue[num_cpu].routine = trmv_kernel; @@ -356,6 +358,7 @@ int CNAME(BLASLONG n, BLASLONG k, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc range_m[num_cpu + 1] = range_m[num_cpu] + width; range_n[num_cpu] = num_cpu * (((n + 15) & ~15) + 16); + if (range_n[num_cpu] > n) range_n[num_cpu] = n; queue[num_cpu].mode = mode; queue[num_cpu].routine = trmv_kernel;
more correct ui64 -> int seed conversion
@@ -263,7 +263,7 @@ namespace NKernel FillBuffer(weightDst, 0.0f, size, stream); FillBuffer(qidCursor, 0, 1, stream); - int cudaSeed = seed; + int cudaSeed = seed + (seed >> 32); YetiRankGradientImpl<blockSize><<<maxBlocksPerSm * smCount, blockSize, 0, stream>>>(cudaSeed, bootstrapIter, queryOffsets,
trace: update trace call for filters when dropping records.
@@ -140,7 +140,7 @@ void flb_filter_do(struct flb_input_chunk *ic, /* all records removed, no data to continue processing */ if (out_size == 0) { /* reset data content length */ - flb_input_chunk_write_at(ic, write_at, "", 0); + flb_trace_filter(ic->tracer, (void *)f_ins); #ifdef FLB_TRACE // flb_trace_filter_write(f_ins, ic, ic->trace_version++, (size_t)0);
Typo in Cmakepresets.json
"NF_FEATURE_RTC": "ON", "NF_FEATURE_HAS_SDCARD": "ON", "ESP32_ETHERNET_SUPPORT": "ON", - "DETH_PHY_RST_GPIO": "12", + "ETH_PHY_RST_GPIO": "12", "ETH_RMII_CLK_OUT_GPIO": "17", "API_System.IO.FileSystem": "ON", "API_nanoFramework.Device.OneWire": "ON"
refactor: replace strcasestr with strstr
-#define _GNU_SOURCE /* strcasestr */ #include <stdio.h> #include <stdlib.h> #include <assert.h> @@ -20,9 +19,9 @@ void on_message(struct slack *client, char payload[], size_t len) json_extract(payload, len, "(text):?s,(channel):?s,(bot_id):T", &text, &channel, &check_bot); if (check_bot.start) return; // means message belongs to a bot - if (strcasestr(text, "ping")) + if (strstr(text, "ping")) slack_chat_post_message(client, channel, "pong"); - else if (strcasestr(text, "pong")) + else if (strstr(text, "pong")) slack_chat_post_message(client, channel, "ping"); if (text) free(text);
Don't run a CT specifc test if CT is disabled
@@ -160,7 +160,7 @@ sub inject_unsolicited_extension } SKIP: { - skip "TLS <= 1.2 disabled", 2 if alldisabled(("tls1", "tls1_1", "tls1_2")); + skip "TLS <= 1.2 disabled", 1 if alldisabled(("tls1", "tls1_1", "tls1_2")); #Test 4: Inject an unsolicited extension (<= TLSv1.2) $proxy->clear(); $proxy->filter(\&inject_unsolicited_extension); @@ -168,7 +168,11 @@ SKIP: { $proxy->clientflags("-no_tls1_3 -noservername"); $proxy->start(); ok(TLSProxy::Message->fail(), "Unsolicited server name extension"); +} +SKIP: { + skip "TLS <= 1.2 or CT disabled", 1 + if alldisabled(("tls1", "tls1_1", "tls1_2")) || disabled("ct"); #Test 5: Same as above for the SCT extension which has special handling $proxy->clear(); $testtype = UNSOLICITED_SCT;
BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL)
@@ -65,6 +65,7 @@ BUF_MEM *bptr; b64 = BIO_new(BIO_f_base64()); bmem = BIO_new(BIO_s_mem()); b64 = BIO_push(b64, bmem); +BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); BIO_write(b64, input, len); BIO_flush(b64); BIO_get_mem_ptr(b64, &bptr);
Use deblock and SAO in tiles tests Reveals a bug in SAO when using tiles.
set -eu . "${0%/*}/util.sh" -common_args='-p4 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=0 --pu-depth-inter=1-3 --pu-depth-intra=2-3' +common_args='-p4 --rd=0 --no-rdoq --no-signhide --subme=0 --deblock --sao --pu-depth-inter=1-3 --pu-depth-intra=2-3' valgrind_test 264x130 10 $common_args -r1 --owf=1 --threads=0 --no-wpp valgrind_test 264x130 10 $common_args -r1 --owf=0 --threads=0 --no-wpp valgrind_test 264x130 10 $common_args -r2 --owf=1 --threads=2 --wpp valgrind_test 264x130 10 $common_args -r2 --owf=0 --threads=2 --no-wpp valgrind_test 264x130 10 $common_args -r2 --owf=1 --threads=2 --tiles-height-split=u2 --no-wpp valgrind_test 264x130 10 $common_args -r2 --owf=0 --threads=2 --tiles-height-split=u2 --no-wpp +valgrind_test 512x512 3 $common_args -r2 --owf=1 --threads=2 --tiles=2x2 --no-wpp +valgrind_test 512x512 3 $common_args -r2 --owf=0 --threads=2 --tiles=2x2 --no-wpp
hark: simplify hook Fixes urbit/landscape#265
@@ -363,10 +363,18 @@ export function useShowNickname(contact: Contact | null, hide?: boolean): boolea return !!(contact && contact.nickname && !hideNicknames); } -export const useHovering = (props: {withParent?: boolean} = {}): Record<string, unknown> => { +interface useHoveringInterface { + hovering: boolean; + bind: { + onMouseOver: () => void, + onMouseLeave: () => void + } +} + +export const useHovering = (): useHoveringInterface => { const [hovering, setHovering] = useState(false); const bind = { - ...(props.withParent === true ? { onMouseOver: () => setHovering(true) } : { onMouseEnter: () => setHovering(true) }), + onMouseOver: () => setHovering(true), onMouseLeave: () => setHovering(false) }; return { hovering, bind };
Exclude end address from osGetPageProt With following memory mappings: ---p 00:00 0 rw-p 00:00 0 specific memory address range is described by: <start address, end_address) - including start address but excluding end address on example above address "0x7f4bc9a3a000" got rw permissions
@@ -643,7 +643,7 @@ osGetPageProt(uint64_t addr) scopeLog(CFG_LOG_TRACE, "addr 0x%lux addr1 0x%lux addr2 0x%lux\n", addr, addr1, addr2); - if ((addr >= addr1) && (addr <= addr2)) { + if ((addr >= addr1) && (addr < addr2)) { char *perms = end + 1; scopeLog(CFG_LOG_DEBUG, "matched 0x%lx to 0x%lx-0x%lx\n\t%c%c%c", addr, addr1, addr2, perms[0], perms[1], perms[2]); prot = 0;
fix a bug about OP_LOADI32 when enable MRBC_INT64 compiler flags.
@@ -527,7 +527,7 @@ static inline void op_loadi32( mrbc_vm *vm, mrbc_value *regs EXT ) FETCH_BSS(); mrbc_decref(&regs[a]); - mrbc_set_integer(&regs[a], (((int32_t)b<<16)+c)); + mrbc_set_integer(&regs[a], (((int32_t)b<<16)+(int32_t)c)); }
esp_wifi: STA set extra IEs for open AP
@@ -88,6 +88,8 @@ int wpa_config_profile(uint8_t *bssid) wpa_set_profile(WPA_PROTO_RSN, esp_wifi_sta_get_prof_authmode_internal()); } else if (esp_wifi_sta_prof_is_wapi_internal()) { wpa_set_profile(WPA_PROTO_WAPI, esp_wifi_sta_get_prof_authmode_internal()); + } else if (esp_wifi_sta_get_prof_authmode_internal() == NONE_AUTH) { + esp_set_assoc_ie((uint8_t *)bssid, NULL, 0, false); } else { ret = -1; }
py/objarray: make_new: Support separate __new__ vs __init__ phases.
@@ -159,6 +159,8 @@ STATIC mp_obj_t array_construct(char typecode, mp_obj_t initializer) { #if MICROPY_PY_ARRAY STATIC mp_obj_t array_make_new(const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { + MP_MAKE_NEW_GET_ONLY_FLAGS(); + (void)only_new; (void)type_in; mp_arg_check_num(n_args, n_kw, 1, 2, false); @@ -177,6 +179,8 @@ STATIC mp_obj_t array_make_new(const mp_obj_type_t *type_in, size_t n_args, size #if MICROPY_PY_BUILTINS_BYTEARRAY STATIC mp_obj_t bytearray_make_new(const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { + MP_MAKE_NEW_GET_ONLY_FLAGS(); + (void)only_new; (void)type_in; // Can take 2nd/3rd arg if constructs from str mp_arg_check_num(n_args, n_kw, 0, 3, false);
Stricter tests on incoming VN
@@ -881,16 +881,19 @@ int picoquic_incoming_version_negotiation( cnx->client_mode, length, nb_vn); ret = PICOQUIC_ERROR_DETECTED; break; - } else if (vn == cnx->proposed_version) { + } else if (vn == cnx->proposed_version || vn == 0) { DBG_PRINTF("VN packet (%d), proposed_version[%d] = 0x%08x.\n", cnx->client_mode, nb_vn, vn); ret = PICOQUIC_ERROR_DETECTED; break; } + else if (picoquic_get_version_index(vn) >= 0){ + /* The VN packet proposes a valid version that is locally supported */ nb_vn++; } + } if (ret == 0) { if (nb_vn == 0) { - DBG_PRINTF("VN packet (%d), does not propose any version.\n", cnx->client_mode); + DBG_PRINTF("VN packet (%d), does not propose any interesting version.\n", cnx->client_mode); ret = PICOQUIC_ERROR_DETECTED; } else {
marked format hccap and hccapx as old
@@ -592,8 +592,8 @@ if(eapolaplesscount > 0) printf("EAPOL ROGUE pairs........................: %ld if(eapolwrittencount > 0) printf("EAPOL pairs written to combi hash file...: %ld (RC checked)\n", eapolwrittencount); if(eapolncwrittencount > 0) printf("EAPOL pairs written to combi hash file...: %ld (RC not checked)\n", eapolncwrittencount); if(eapolwrittenhcpxcountdeprecated > 0) printf("EAPOL pairs written to hccapx............: %ld (RC checked)\n", eapolwrittenhcpxcountdeprecated); -if(eapolncwrittenhcpxcountdeprecated > 0) printf("EAPOL pairs written to hccapx............: %ld (RC not checked)\n", eapolncwrittenhcpxcountdeprecated); -if(eapolwrittenhcpcountdeprecated > 0) printf("EAPOL pairs written to hccap.............: %ld (RC checked)\n", eapolwrittenhcpcountdeprecated); +if(eapolncwrittenhcpxcountdeprecated > 0) printf("EAPOL pairs written to old format hccapx.: %ld (RC not checked)\n", eapolncwrittenhcpxcountdeprecated); +if(eapolwrittenhcpcountdeprecated > 0) printf("EAPOL pairs written to old format hccap..: %ld (RC checked)\n", eapolwrittenhcpcountdeprecated); if(eapolwrittenjcountdeprecated > 0) printf("EAPOL pairs written to old JtR format....: %ld (RC checked)\n", eapolwrittenjcountdeprecated); if(eapolm12e2count > 0) printf("EAPOL M12E2 (challenge)..................: %ld\n", eapolm12e2count); if(eapolm14e4count > 0) printf("EAPOL M14E4 (authorized).................: %ld\n", eapolm14e4count);
Minor bug solved from previous commit.
import os import sys +import json if sys.platform == 'win32': from metacall.module_win32 import metacall_module_load @@ -34,13 +35,6 @@ else: # Load metacall extension depending on the platform module = metacall_module_load() -print('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') -print('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') -print(module) -print('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') -sys.stdout.flush(); -exit(0); - # Check if library was found and print error message otherwhise if module == None: print('\x1b[31m\x1b[1m', 'You do not have MetaCall installed or we cannot find it.', '\x1b[0m');
vere: refactors %ames packet failure callback
@@ -392,13 +392,12 @@ _ames_cap_queue(u3_ames* sam_u) static void _ames_punt_goof(u3_noun lud) { - u3_noun dul = lud; - - if ( 2 == u3qb_lent(dul) ) { - u3_pier_punt_goof("hear", u3k(u3h(dul))); - u3_pier_punt_goof("crud", u3k(u3h(u3t(dul)))); + if ( 2 == u3qb_lent(lud) ) { + u3_pier_punt_goof("hear", u3k(u3h(lud))); + u3_pier_punt_goof("crud", u3k(u3h(u3t(lud)))); } else { + u3_noun dul = lud; c3_w len_w = 1; while ( u3_nul != dul ) {
re-enable CLEANUP
@@ -80,7 +80,7 @@ if (! -d $tmp_path) { File::Path::make_path($tmp_path) || die("Unable to create $tmp_path\n"); } -my $tmp_dir = File::Temp::tempdir(CLEANUP => 0, DIR=> $tmp_path) || MYERROR("Unable to create temporary directory"); +my $tmp_dir = File::Temp::tempdir(CLEANUP => 1, DIR=> $tmp_path) || MYERROR("Unable to create temporary directory"); print "\nStaging dist creation in $tmp_dir...\n"; @@ -167,7 +167,6 @@ foreach my $distro (@distros) { $file_update->spew_utf8( $contents ); # Assemble final tarball -# $tar_args .= " $tmp_dir/$distro"; $tar_args .= "$distro"; print "\nCreating dist tarball for $distro:$arch -- \n"; print "\ntar command -> tar $tar_args\n\n";
fix mousestate "couldn't unbind" closes
@@ -227,9 +227,11 @@ static void mousestate_poll(t_mousestate *x) static void mousestate_nopoll(t_mousestate *x) { + if(x->x_ispolling){ hammergui_stoppolling((t_pd *)x); x->x_ispolling = 0; } +} static void mousestate_zero(t_mousestate *x) {
component/bt: Fix mem leak of esp_ble_gap_set_security_param
@@ -939,6 +939,13 @@ void btc_gap_ble_arg_deep_free(btc_msg_t *msg) } break; } + case BTC_GAP_BLE_SET_SECURITY_PARAM_EVT: { + uint8_t *value = ((btc_ble_gap_args_t *)msg->arg)->set_security_param.value; + if (value) { + osi_free(value); + } + break; + } default: BTC_TRACE_DEBUG("Unhandled deep free %d\n", msg->act); break; @@ -1040,36 +1047,37 @@ void btc_gap_ble_call_handler(btc_msg_t *msg) break; } case BTC_GAP_BLE_SET_SECURITY_PARAM_EVT: { + uint8_t *value = arg->set_security_param.value; switch(arg->set_security_param.param_type) { case ESP_BLE_SM_PASSKEY: break; case ESP_BLE_SM_AUTHEN_REQ_MODE: { uint8_t authen_req = 0; - STREAM_TO_UINT8(authen_req, arg->set_security_param.value); + STREAM_TO_UINT8(authen_req, value); bta_dm_co_ble_set_auth_req(authen_req); break; } case ESP_BLE_SM_IOCAP_MODE: { uint8_t iocap = 0; - STREAM_TO_UINT8(iocap, arg->set_security_param.value); + STREAM_TO_UINT8(iocap, value); bta_dm_co_ble_set_io_cap(iocap); break; } case ESP_BLE_SM_SET_INIT_KEY: { uint8_t init_key = 0; - STREAM_TO_UINT8(init_key, arg->set_security_param.value); + STREAM_TO_UINT8(init_key, value); bta_dm_co_ble_set_init_key_req(init_key); break; } case ESP_BLE_SM_SET_RSP_KEY: { uint8_t rsp_key = 0; - STREAM_TO_UINT8(rsp_key, arg->set_security_param.value); + STREAM_TO_UINT8(rsp_key, value); bta_dm_co_ble_set_rsp_key_req(rsp_key); break; } case ESP_BLE_SM_MAX_KEY_SIZE: { uint8_t key_size = 0; - STREAM_TO_UINT8(key_size, arg->set_security_param.value); + STREAM_TO_UINT8(key_size, value); bta_dm_co_ble_set_max_key_size(key_size); break; }
odyssey: update documentation/configuration.md
@@ -355,6 +355,7 @@ Set route athentication method. Supported: "block" - block this user "clear_text" - PostgreSQL clear text authentication "md5" - PostgreSQL MD5 authentication +"cert" - Compare client certificate CommonName with username ``` `authentication "none"`
cmake: switch back to dump by default
@@ -125,7 +125,7 @@ set (KDB_DB_INIT "elektra.ecf" CACHE STRING "This configuration file will be used for bootstrapping." ) -set (KDB_DEFAULT_STORAGE "dini" CACHE STRING +set (KDB_DEFAULT_STORAGE "dump" CACHE STRING "This storage plugin will be used initially (as default and for bootstrapping).") if (KDB_DEFAULT_STORAGE STREQUAL "storage")
kscan: matrix: Remove verbose logging in read.
@@ -128,7 +128,6 @@ static int kscan_gpio_config_interrupts(struct device **devices, bool submit_follow_up_read = false; \ struct kscan_gpio_data_##n *data = dev->driver_data; \ static bool read_state[INST_MATRIX_ROWS(n)][INST_MATRIX_COLS(n)]; \ - LOG_DBG("Scanning the matrix for updated state"); \ /* Disable our interrupts temporarily while we scan, to avoid */ \ /* re-entry while we iterate columns and set them active one by one */ \ /* to get pressed state for each matrix cell. */ \ @@ -268,7 +267,7 @@ static int kscan_gpio_config_interrupts(struct device **devices, }; \ DEVICE_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \ &kscan_gpio_data_##n, &kscan_gpio_config_##n, \ - POST_KERNEL, CONFIG_ZMK_KSCAN_INIT_PRIORITY, \ + APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \ &gpio_driver_api_##n); DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
Test parsing a PI with a failing allocator
@@ -3752,6 +3752,44 @@ alloc_teardown(void) basic_teardown(); } + +/* Test the effects of allocation failures on a straightforward parse */ +START_TEST(test_alloc_parse) +{ + const char *text = + "<?xml version='1.0' encoding='utf-8'?>\n" + "<?pi unknown?>\n" + "<doc>Hello, world</doc>"; + int i; + int repeat = 0; +#define MAX_ALLOC_COUNT 10 + + for (i = 0; i < MAX_ALLOC_COUNT; i++) { + allocation_count = i; + /* Repeat some counts because of cached memory */ + if (i == 2 && repeat == 2) { + i -= 2; + repeat++; + } else if ((i == 1 && repeat < 2) || + (i == 1 && repeat > 2 && repeat < 5)) { + i--; + repeat++; + } + XML_SetProcessingInstructionHandler(parser, dummy_pi_handler); + if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), + XML_TRUE) != XML_STATUS_ERROR) + break; + XML_ParserReset(parser, NULL); + } + if (i == 0) + fail("Parse succeeded despite failing allocator"); + if (i == MAX_ALLOC_COUNT) + fail("Parse failed with max allocations"); +#undef MAX_ALLOC_COUNT +} +END_TEST + + static int XMLCALL external_entity_duff_loader(XML_Parser parser, const XML_Char *context, @@ -4357,6 +4395,7 @@ make_suite(void) suite_add_tcase(s, tc_alloc); tcase_add_checked_fixture(tc_alloc, alloc_setup, alloc_teardown); + tcase_add_test(tc_alloc, test_alloc_parse); tcase_add_test(tc_alloc, test_alloc_create_external_parser); tcase_add_test(tc_alloc, test_alloc_run_external_parser); tcase_add_test(tc_alloc, test_alloc_dtd_copy_default_atts);
timing_load_creds: Fix typos in the timersub macro
do { \ (res)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ if ((a)->tv_usec < (b)->tv_usec) { \ - (res)->tv_usec = (a)->tv_usec + 1000000 - (b)->tv_usec); \ + (res)->tv_usec = (a)->tv_usec + 1000000 - (b)->tv_usec; \ --(res)->tv_sec; \ } else { \ - (res)->tv_usec = (a)->tv_usec - (b)->tv_usec); \ + (res)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ } \ } while(0) # endif
client session BUGFIX double free Fixes
@@ -1299,7 +1299,11 @@ parse_reply(struct ly_ctx *ctx, struct lyxml_elem *xml, struct nc_rpc *rpc, int rpc_gen = (struct nc_rpc_act_generic *)rpc; if (rpc_gen->has_data) { - rpc_act = rpc_gen->content.data; + rpc_act = lyd_dup(rpc_gen->content.data, 1); + if (!rpc_act) { + ERR("Failed to duplicate a generic RPC/action."); + return NULL; + } } else { rpc_act = lyd_parse_mem(ctx, rpc_gen->content.xml_str, LYD_XML, LYD_OPT_RPC | parseroptions, NULL); if (!rpc_act) {
Disable duplicate icon cache flush
@@ -3154,32 +3154,32 @@ VOID PhImageListFlushCache( VOID ) { - PH_HASHTABLE_ENUM_CONTEXT enumContext; - PPH_IMAGELIST_ITEM* entry; - - if (!PhImageListCacheHashtable) - return; - - PhAcquireQueuedLockExclusive(&PhImageListCacheHashtableLock); - - PhBeginEnumHashtable(PhImageListCacheHashtable, &enumContext); - - while (entry = PhNextEnumHashtable(&enumContext)) - { - PPH_IMAGELIST_ITEM item = *entry; - - PhDereferenceObject(item); - } - - PhClearReference(&PhImageListCacheHashtable); - PhImageListCacheHashtable = PhCreateHashtable( - sizeof(PPH_IMAGELIST_ITEM), - PhImageListCacheHashtableEqualFunction, - PhImageListCacheHashtableHashFunction, - 32 - ); - - PhReleaseQueuedLockExclusive(&PhImageListCacheHashtableLock); + //PH_HASHTABLE_ENUM_CONTEXT enumContext; + //PPH_IMAGELIST_ITEM* entry; + // + //if (!PhImageListCacheHashtable) + // return; + // + //PhAcquireQueuedLockExclusive(&PhImageListCacheHashtableLock); + // + //PhBeginEnumHashtable(PhImageListCacheHashtable, &enumContext); + // + //while (entry = PhNextEnumHashtable(&enumContext)) + //{ + // PPH_IMAGELIST_ITEM item = *entry; + // + // PhDereferenceObject(item); + //} + // + //PhClearReference(&PhImageListCacheHashtable); + //PhImageListCacheHashtable = PhCreateHashtable( + // sizeof(PPH_IMAGELIST_ITEM), + // PhImageListCacheHashtableEqualFunction, + // PhImageListCacheHashtableHashFunction, + // 32 + // ); + // + //PhReleaseQueuedLockExclusive(&PhImageListCacheHashtableLock); } VOID PhDrawProcessIcon(
fix test with snapshot interval
@@ -6,6 +6,7 @@ import filecmp import csv import numpy as np import time +import timeit import json import catboost @@ -4163,7 +4164,7 @@ def test_snapshot_without_random_seed(): def test_snapshot_with_interval(): def run_with_timeout(cmd, timeout): try: - yatest.common.execute(cmd + additional_params, timeout=timeout) + yatest.common.execute(cmd, timeout=timeout) except ExecutionTimeoutError: return True return False @@ -4172,30 +4173,38 @@ def test_snapshot_with_interval(): CATBOOST_PATH, 'fit', '--loss-function', 'Logloss', - '--learning-rate', '0.5', '-f', data_file('adult', 'train_small'), '-t', data_file('adult', 'test_small'), '--column-description', data_file('adult', 'train.cd'), - '-i', '500', - '-T', '4' + '-T', '4', + '-r', '0' ] + measure_time_iters = 100 + exec_time = timeit.timeit(lambda: yatest.common.execute(cmd + ['-i', str(measure_time_iters)]), number=1) + + SNAPSHOT_INTERVAL = 1 + TIMEOUT = 5 + TOTAL_TIME = 25 + iters = int(TOTAL_TIME / (exec_time / measure_time_iters)) + + canon_eval_path = yatest.common.test_output_path('canon_test.eval') + canon_params = cmd + ['--eval-file', canon_eval_path, '-i', str(iters)] + yatest.common.execute(canon_params) + eval_path = yatest.common.test_output_path('test.eval') progress_path = yatest.common.test_output_path('test.cbp') model_path = yatest.common.test_output_path('model.bin') - additional_params = ['--snapshot-file', progress_path, - '--snapshot-interval', '1', + params = cmd + ['--snapshot-file', progress_path, + '--snapshot-interval', str(SNAPSHOT_INTERVAL), '-m', model_path, - '--eval-file', eval_path] + '--eval-file', eval_path, + '-i', str(iters)] was_timeout = False - while run_with_timeout(cmd + additional_params, 5): + while run_with_timeout(params, TIMEOUT): was_timeout = True assert was_timeout - - canon_eval_path = yatest.common.test_output_path('canon_test.eval') - random_seed = catboost.CatBoost(model_file=model_path).random_seed_ - yatest.common.execute(cmd + ['-r', str(random_seed), '--eval-file', canon_eval_path]) assert filecmp.cmp(canon_eval_path, eval_path)