message
stringlengths
6
474
diff
stringlengths
8
5.22k
tests: cleaned up asprintf.c.
#include "criterion/criterion.h" #include "criterion/theories.h" #include "criterion/internal/asprintf-compat.h" +#include "criterion/new/assert.h" #include <stdio.h> union anyval { - int c; - int hd; + char c; + short hd; int d; long ld; long long lld; - unsigned int hu; + unsigned short hu; unsigned int u; unsigned long lu; unsigned long long llu; @@ -44,14 +45,14 @@ TheoryDataPoints(asprintf, valid) = { }; Theory((struct format_test *fmt), asprintf, valid) { + char *actual; char expected[32]; - snprintf(expected, sizeof (expected), fmt->format, *fmt->val); - - char *actual; - cr_asprintf(&actual, fmt->format, *fmt->val); + int rc_expected = snprintf(expected, sizeof (expected), fmt->format, *fmt->val); + int rc_actual = cr_asprintf(&actual, fmt->format, *fmt->val); - cr_expect_str_eq(actual, expected); + cr_expect(eq(int, rc_actual, rc_expected)); + cr_expect(eq(str, actual, expected)); free(actual); }
Extend test coverage of XML_ResumeParser
@@ -1745,6 +1745,23 @@ START_TEST(test_reset_in_entity) } END_TEST +/* Test that resume correctly passes through parse errors */ +START_TEST(test_resume_invalid_parse) +{ + const char *text = "<doc>Hello</doc"; /* Missing closing wedge */ + + resumable = XML_TRUE; + XML_SetCharacterDataHandler(parser, + clearing_aborting_character_handler); + if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR) + xml_failure(parser); + if (XML_ResumeParser(parser) == XML_STATUS_OK) + fail("Resumed invalid parse not faulted"); + if (XML_GetErrorCode(parser) != XML_ERROR_UNCLOSED_TOKEN) + fail("Invalid parse not correctly faulted"); +} +END_TEST + /* Test resetting a subordinate parser does exactly nothing */ static int XMLCALL external_entity_resetter(XML_Parser parser, @@ -3234,6 +3251,7 @@ make_suite(void) tcase_add_test(tc_basic, test_set_base); tcase_add_test(tc_basic, test_attributes); tcase_add_test(tc_basic, test_reset_in_entity); + tcase_add_test(tc_basic, test_resume_invalid_parse); tcase_add_test(tc_basic, test_subordinate_reset); tcase_add_test(tc_basic, test_subordinate_suspend); tcase_add_test(tc_basic, test_explicit_encoding);
build: add python files to ctags Type: improvement
@@ -516,7 +516,7 @@ endef endif %.files: .FORCE - @find . \( -name '*\.[chyS]' -o -name '*\.java' -o -name '*\.lex' \) -and \ + @find . \( -name '*\.[chyS]' -o -name '*\.java' -o -name '*\.lex' -o -name '*\.py' \) -and \ \( -not -path './build-root*' -o -path \ './build-root/build-vpp_debug-native/dpdk*' \) > $@
Adapt commands for tests with GNU make.
@@ -121,11 +121,15 @@ jobs: run: | case "${{ matrix.build }}" in "make") - echo "::group::Tests for BLAS" - make blas-test + MAKE_FLAGS='DYNAMIC_ARCH=1 USE_OPENMP=0' + echo "::group::Tests in 'test' directory" + make -C test $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}" echo "::endgroup::" - echo "::group::Tests for LAPACK" - make lapack-test + echo "::group::Tests in 'ctest' directory" + make -C ctest $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}" + echo "::endgroup::" + echo "::group::Tests in 'utest' directory" + make -C utest $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}" echo "::endgroup::" ;; "cmake")
version T13.790: memory leak fixed, the program will not fail
-/* dnet: threads; T11.231-T13.789; $DVS:time$ */ +/* dnet: threads; T11.231-T13.790; $DVS:time$ */ #include <stdlib.h> #include <stdio.h> @@ -231,6 +231,9 @@ static void *dnet_thread_accepted(void *arg) { g_n_inbound--; t->conn.socket = -1; //pthread_mutex_lock(&t->conn.mutex); +#ifdef CHEATCOIN + if (dnet_connection_close_notify) (*dnet_connection_close_notify)(&t->conn); +#endif t->to_remove = 1; //pthread_mutex_unlock(&t->conn.mutex); return 0;
limit max size of memory allocated for HTTP responses to 1 Mb
@@ -451,11 +451,14 @@ char *oidc_get_current_url(request_rec *r) { /* buffer to hold HTTP call responses */ typedef struct oidc_curl_buffer { - apr_pool_t *pool; + request_rec *r; char *memory; size_t size; } oidc_curl_buffer; +/* maximum acceptable size of HTTP responses: 1 Mb */ +#define OIDC_CURL_MAX_RESPONSE_SIZE 1024 * 1024 + /* * callback for CURL to write bytes that come back from an HTTP call */ @@ -463,10 +466,24 @@ size_t oidc_curl_write(void *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; oidc_curl_buffer *mem = (oidc_curl_buffer *) userp; - char *newptr = apr_palloc(mem->pool, mem->size + realsize + 1); - if (newptr == NULL) + /* check if we don't run over the maximum buffer/memory size for HTTP responses */ + if (mem->size + realsize > OIDC_CURL_MAX_RESPONSE_SIZE) { + oidc_error(mem->r, + "HTTP response larger than maximum allowed size: current size=%ld, additional size=%ld, max=%d", + mem->size, realsize, OIDC_CURL_MAX_RESPONSE_SIZE); + return 0; + } + + /* allocate the new buffer for the current + new response bytes */ + char *newptr = apr_palloc(mem->r->pool, mem->size + realsize + 1); + if (newptr == NULL) { + oidc_error(mem->r, + "memory allocation for new buffer of %ld bytes failed", + mem->size + realsize + 1); return 0; + } + /* copy over the data from current memory plus the cURL buffer */ memcpy(newptr, mem->memory, mem->size); memcpy(&(newptr[mem->size]), contents, realsize); mem->size += realsize; @@ -537,7 +554,7 @@ static apr_byte_t oidc_util_http_call(request_rec *r, const char *url, curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); /* setup the buffer where the response will be written to */ - curlBuffer.pool = r->pool; + curlBuffer.r = r; curlBuffer.memory = NULL; curlBuffer.size = 0; curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, oidc_curl_write);
console: ensure "Console is enabled" string is intact BRANCH=none TEST=boot 10 times on kevin, and see the complete string "Console is enabled..." Commit-Ready: Philip Chen Tested-by: Philip Chen
@@ -269,11 +269,13 @@ command_has_error: static void console_init(void) { *input_buf = '\0'; + cflush(); #ifdef CONFIG_EXPERIMENTAL_CONSOLE ccprintf("Enhanced Console is enabled (v1.0.0); type HELP for help.\n"); #else ccprintf("Console is enabled; type HELP for help.\n"); #endif /* defined(CONFIG_EXPERIMENTAL_CONSOLE) */ + cflush(); ccputs(PROMPT); }
display: use esc [!p to reset terminal
#define ESC_RESET "\033[0m" #define ESC_SCROLL(x, y) "\033[" #x ";" #y "r" #define ESC_SCROLL_DISABLE "\033[?7h" +#define ESC_RESET_SETTINGS "\033[!p" #if defined(_HF_ARCH_LINUX) #define _HF_MONETARY_MOD "'" @@ -279,7 +280,9 @@ extern void display_display(honggfuzz_t* hfuzz) { display_displayLocked(hfuzz); } -extern void display_fini(void) { display_put(ESC_SCROLL(1, 999) ESC_NAV(999, 1)); } +extern void display_fini(void) { + display_put(ESC_RESET_SETTINGS ESC_SCROLL(1, 999) ESC_NAV(999, 1)); +} extern void display_init(void) { atexit(display_fini);
bitbake: bump to v1.9.2
@@ -16,7 +16,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" SECTION = "net" PR = "r0" -PV = "1.9.0" +PV = "1.9.2" SRCREV = "v${PV}" SRC_URI = "git://github.com/fluent/fluent-bit.git;nobranch=1"
add tw_timer_template.c to vpp devel packages
@@ -207,6 +207,7 @@ nobase_include_HEADERS = \ vppinfra/tw_timer_2t_1w_2048sl.h \ vppinfra/tw_timer_16t_2w_512sl.h \ vppinfra/tw_timer_template.h \ + vppinfra/tw_timer_template.c \ vppinfra/types.h \ vppinfra/unix.h \ vppinfra/vec.h \
Fixes memleak in pubsub topology manager
@@ -932,15 +932,13 @@ static void pstm_setupTopicSenders(pubsub_topology_manager_t *manager) { psa->matchPublisher(psa->handle, entry->bndId, entry->publisherFilter, &topicProps, &score, &serSvcId, &protSvcId); if (score > highestScore) { - if (topicPropertiesForHighestMatch != NULL) { celix_properties_destroy(topicPropertiesForHighestMatch); - } highestScore = score; serializerSvcId = serSvcId; protocolSvcId = protSvcId; selectedPsaSvcId = svcId; topicPropertiesForHighestMatch = topicProps; - } else if (topicProps != NULL) { + } else { celix_properties_destroy(topicProps); } } @@ -968,6 +966,7 @@ static void pstm_setupTopicSenders(pubsub_topology_manager_t *manager) { entry->scope, entry->topic, celix_filter_getFilterString(entry->publisherFilter)); + celix_properties_destroy(topicPropertiesForHighestMatch); } } } @@ -997,6 +996,8 @@ static void pstm_setupTopicSenders(pubsub_topology_manager_t *manager) { celixThreadMutex_unlock(&manager->topicSenders.mutex); } else { celix_logHelper_warning(manager->loghelper, "Cannot setup TopicSender for %s/%s\n", setupEntry->scope == NULL ? "(null)" : setupEntry->scope, setupEntry->topic); + celix_properties_destroy(setupEntry->topicProperties); + celix_properties_destroy(setupEntry->endpointResult); } free(setupEntry->scope); free(setupEntry->topic);
VERSION bump to version 1.3.44
@@ -31,7 +31,7 @@ endif() # micro version is changed with a set of small changes or bugfixes anywhere in the project. set(SYSREPO_MAJOR_VERSION 1) set(SYSREPO_MINOR_VERSION 3) -set(SYSREPO_MICRO_VERSION 43) +set(SYSREPO_MICRO_VERSION 44) set(SYSREPO_VERSION ${SYSREPO_MAJOR_VERSION}.${SYSREPO_MINOR_VERSION}.${SYSREPO_MICRO_VERSION}) # Version of the library
khan: just %done
@@ -79,8 +79,7 @@ _khan_close_socket(u3_khan* kan_u, u3_chan* can_u) u3dc("scot", c3__uv, kan_u->sev_l), u3dc("scot", c3__ud, can_u->coq_l), u3_nul); - // TODO change to just %socket-done or even %done - cad = u3nc(u3i_string("socket-done"), u3_nul); + cad = u3nc(c3__done, u3_nul); u3_auto_peer( u3_auto_plan(&kan_u->car_u, u3_ovum_init(0, c3__k, wir, cad)), 0,
dprint: simplify and fix core/chapter/arm search the main issue fixed was with looking inside of chapters for arms didn't work
lhs :: [%core *] - :: cores don't have any doc structure inside of them. i probably need to - :: check that they're wrapped with a %hint type. so this just looks for - :: docs on the arms. - :: + :: checks for a core name match, then tries to find a chapter, arm, or + :: arm in a chapter depending on how many topics remain. will still work + :: if core is unnamed =+ core-name=p.p.q.sut ?: !=(`i.topics core-name) - :: the current topic isn't the top level core name - :: else, look for an arm matching the name - =+ arm=(find-arm-in-coil i.topics q.sut) + =+ arm=(make-arm i.topics sut ~) ?~ arm - :: the current topic is not an arm in the core, recurse into sut ?:(rec $(sut p.sut) ~) - :: else, return the arm as docs - =+ [adoc pdoc cdoc]=(all-arm-docs u.arm sut (trip i.topics)) - `[%arm (trip i.topics) adoc pdoc cdoc u.arm p.sut] - :: the core name matches. check to see if there are any topics left + arm ?~ t.topics - :: we matched the core name and have no further topics. return the core =* compiled-against (signify p.sut) `[%core (trip i.topics) *what sut q.sut compiled-against] - :: we matched the core name, but there are still topics left - :: check to see if one the chapters matches the next topic - =+ chapters=~(key by q.r.q.sut) - ?. (~(has in chapters) i.t.topics) - :: the core name matched, but nothing inside of it did. return null - ~ - :: if there is a chapter with a name matching the topic, return chapter - :: as a (unit item) - =/ docs=what p:(~(got by q.r.q.sut) i.t.topics) - `[%chapter (trip i.t.topics) docs sut q.sut i.t.topics] + =/ tom=(unit tome) (~(get by q.r.q.sut) i.t.topics) + ?~ tom + (make-arm i.t.topics sut ~) + ?~ t.t.topics + `[%chapter (trip i.t.topics) p.u.tom sut q.sut i.t.topics] + (make-arm i.t.t.topics sut tom) :: [%face *] ?. ?=(term p.sut) [%hold *] $(sut (~(play ut p.sut) q.sut)) :: == + ++ make-arm + |= [name=term sut=type tom=(unit tome)] + ^- (unit item) + ?> ?=([%core *] sut) + =+ arm=(find-arm-in-coil name q.sut) + ?~ arm + ~ + =+ [adoc pdoc cdoc]=(all-arm-docs u.arm sut (trip name)) + ?~ tom + `[%arm (trip name) adoc pdoc cdoc u.arm p.sut] + ?. (~(has by q.u.tom) name) + ~ + `[%arm (trip name) adoc pdoc cdoc u.arm p.sut] + -- :: :> changes a type into a item :>
chore: Correct a typo in CHANGELOG.md
### New Features #### AFQP 1.0 Support -This release of AFR has support for vendors who wish to have their ports qualified for Amazon FreeRTOS through the Amazon FreeRTOS Qualification Program (AFQP). This is the first public release of AFQP tests and documentation. A new top level "test" directory has been added to support this functionality. AFQP documents are available in "tests" directory. [Learn more.](https://docs.aws.amazon.com/freertos/latest/userguide/freertos-qualification-program.html) +This release of AFR has support for vendors who wish to have their ports qualified for Amazon FreeRTOS through the Amazon FreeRTOS Qualification Program (AFQP). This is the first public release of AFQP tests and documentation. A new top level "tests" directory has been added to support this functionality. AFQP documents are available in "tests" directory. [Learn more.](https://docs.aws.amazon.com/freertos/latest/userguide/freertos-qualification-program.html) #### Device Defender 1.0 Support AWS IoT Device Defender is an AWS IoT security service that allows users to audit the configuration of their devices, monitor connected devices to detect abnormal behavior, and to mitigate security risks. It gives you the ability to enforce consistent security policies across your AWS IoT device fleet and respond quickly when devices are compromised. Device side support of this feature is part of this release. Devices supported are WinSim and Microchip PIC32MZEF. [Learn more.](https://docs.aws.amazon.com/freertos/latest/userguide/afr-device-defender-library.html)
Bugfix for kas2 roles in building registration
@@ -3370,7 +3370,7 @@ static ACVP_RESULT acvp_build_kas_ifc_register_cap(ACVP_CTX *ctx, current_param = kas_ifc_cap->kas2_roles; if (current_param) { role_val = json_value_init_object(); - role_obj = json_value_get_object(sch_val); + role_obj = json_value_get_object(role_val); json_object_set_value(role_obj, "kasRole", json_value_init_array()); temp_arr = json_object_get_array(role_obj, "kasRole"); while (current_param) {
Add deparse step to blocking version of encryption test to make it comparable
@@ -210,6 +210,9 @@ struct rte_crypto_op* dequeued_ops[RTE_MAX_LCORE][CRYPTO_BURST_SIZE]; void do_blocking_sync_op(packet_descriptor_t* pd, enum async_op_type op){ unsigned int lcore_id = rte_lcore_id(); + control_DeparserImpl(pd, 0, 0); + emit_packet(pd, 0, 0); + create_crypto_op(async_ops[lcore_id],pd,op,NULL); if (rte_crypto_op_bulk_alloc(lcore_conf[lcore_id].crypto_pool, RTE_CRYPTO_OP_TYPE_SYMMETRIC, enqueued_ops[lcore_id], 1) == 0) @@ -227,6 +230,8 @@ void do_blocking_sync_op(packet_descriptor_t* pd, enum async_op_type op){ rte_mempool_put_bulk(lcore_conf[lcore_id].crypto_pool, (void **)dequeued_ops[lcore_id], 1); + reset_pd(pd); + parse_packet(pd, 0, 0); } void main_loop_async(struct lcore_data* lcdata, packet_descriptor_t *pd)
Set default channel size to 0.
@@ -521,7 +521,7 @@ static Janet cfun_channel_count(int32_t argc, Janet *argv) { static Janet cfun_channel_new(int32_t argc, Janet *argv) { janet_arity(argc, 0, 1); - int32_t limit = janet_optnat(argv, argc, 0, 10); + int32_t limit = janet_optnat(argv, argc, 0, 0); JanetChannel *channel = janet_abstract(&ChannelAT, sizeof(JanetChannel)); janet_chan_init(channel, limit); return janet_wrap_abstract(channel); @@ -756,7 +756,7 @@ static const JanetReg ev_cfuns[] = { "ev/chan", cfun_channel_new, JDOC("(ev/chan &opt capacity)\n\n" "Create a new channel. capacity is the number of values to queue before " - "blocking writers, defaults to 10 if not provided. Returns a new channel.") + "blocking writers, defaults to 0 if not provided. Returns a new channel.") }, { "ev/give", cfun_channel_push,
Small changes [ci skip]
<!-- choose one --> **Type of change**: -- [ ] bug fix -- [ ] new feature -- [ ] other enhancement +- [ ] Bug fix +- [ ] New feature +- [ ] Other enhancement <!-- choose one --> **Impact**: -- [ ] rtl change -- [ ] software change -- [ ] unknown -- [ ] other +- [ ] RTL change +- [ ] Software change (RISC-V software) +- [ ] Build system change +- [ ] Other -<!-- choose one --> -**Contributer Checklist**: +<!-- must be filled out completely to be considered for merging --> +**Contributor Checklist**: +- [ ] Yes, I specified the "Type of Change" +- [ ] Yes, I specified the "Impact" - [ ] Did you set `dev` as the base branch? -- [ ] Did you add documentation for the feature? -- [ ] Did you add a test demonstrating the PR? - [ ] Did you delete any extraneous prints/debugging code? +- [ ] (If applicable) Did you add documentation for the feature? +- [ ] (If applicable) Did you add a test demonstrating the PR? <!-- Do this if this PR is a bug fix that should be applied to master --> - [ ] (If applicable) Did you mark the PR as "Please Backport"?
use synthese option rebuilt instead of none
@@ -87,7 +87,7 @@ set_property STEPS.SYNTH_DESIGN.ARGS.RESOURCE_SHARING off [get_runs set_property STEPS.SYNTH_DESIGN.ARGS.SHREG_MIN_SIZE 5 [get_runs synth_1] set_property STEPS.SYNTH_DESIGN.ARGS.KEEP_EQUIVALENT_REGISTERS true [get_runs synth_1] set_property STEPS.SYNTH_DESIGN.ARGS.NO_LC true [get_runs synth_1] -set_property STEPS.SYNTH_DESIGN.ARGS.FLATTEN_HIERARCHY none [get_runs synth_1] +set_property STEPS.SYNTH_DESIGN.ARGS.FLATTEN_HIERARCHY rebuilt [get_runs synth_1] # Implementaion set_property STEPS.OPT_DESIGN.ARGS.DIRECTIVE Explore [get_runs impl_1] set_property STEPS.PLACE_DESIGN.ARGS.DIRECTIVE Explore [get_runs impl_1]
Make test_alloc_realloc_attributes() robust vs allocation changes
@@ -9912,7 +9912,9 @@ START_TEST(test_alloc_realloc_attributes) if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) break; - XML_ParserReset(parser, NULL); + /* See comment in test_alloc_parse_xdecl() */ + alloc_teardown(); + alloc_setup(); } if (i == 0)
vtd: dmar_uint->root_table_addr should be hpa add necessary HPA2HVA/HVA2HPA transition for root_table_addr Acked-by: Tian, Kevin Acked-by: Xu, Anthony
@@ -965,14 +965,10 @@ static int add_iommu_device(struct iommu_domain *domain, uint16_t segment, } if (dmar_uint->root_table_addr == 0) { - /* 1:1 mapping for hypervisor HEAP, - * physical address equals virtual address - */ - dmar_uint->root_table_addr = - (uint64_t)alloc_paging_struct(); + dmar_uint->root_table_addr = HVA2HPA(alloc_paging_struct()); } - root_table = (uint64_t *)dmar_uint->root_table_addr; + root_table = (uint64_t *)HPA2HVA(dmar_uint->root_table_addr); root_entry = (struct dmar_root_entry *)&root_table[bus * 2]; @@ -1071,7 +1067,7 @@ remove_iommu_device(struct iommu_domain *domain, uint16_t segment, return 1; } - root_table = (uint64_t *)dmar_uint->root_table_addr; + root_table = (uint64_t *)HPA2HVA(dmar_uint->root_table_addr); root_entry = (struct dmar_root_entry *)&root_table[bus * 2]; context_table_addr = DMAR_GET_BITSLICE(root_entry->lower,
flash_mmap: fix mmap unordered test on c2
@@ -251,13 +251,22 @@ TEST_CASE("Can mmap unordered pages into contiguous memory", "[spi_flash][mmap]" printf("mmap_res: handle=%"PRIx32" ptr=%p\n", (uint32_t)handle1, ptr1); spi_flash_mmap_dump(); +#if (CONFIG_MMU_PAGE_SIZE == 0x10000) + uint32_t words_per_sector = 1024; +#elif (CONFIG_MMU_PAGE_SIZE == 0x8000) + uint32_t words_per_sector = 512; +#elif (CONFIG_MMU_PAGE_SIZE == 0x4000) + uint32_t words_per_sector = 256; +#else + uint32_t words_per_sector = 128; +#endif srand(0); const uint32_t *data = (const uint32_t *) ptr1; - for (int block = 0; block < nopages; ++block) { + for (int block = 0; block < 1; ++block) { for (int sector = 0; sector < 16; ++sector) { - for (uint32_t word = 0; word < 1024; ++word) { - TEST_ASSERT_EQUAL_UINT32(rand(), data[(((nopages-1)-block) * 16 + sector) * 1024 + word]); + for (uint32_t word = 0; word < words_per_sector; ++word) { + TEST_ASSERT_EQUAL_UINT32(rand(), data[(((nopages-1)-block) * 16 + sector) * words_per_sector + word]); } } }
Use nearbyint to get bankers rounding
@@ -1041,10 +1041,10 @@ ASTCENC_SIMD_INLINE vfloat4 abs(vfloat4 a) */ ASTCENC_SIMD_INLINE vfloat4 round(vfloat4 a) { - return vfloat4(std::round(a.m[0]), - std::round(a.m[1]), - std::round(a.m[2]), - std::round(a.m[3])); + return vfloat4(std::nearbyint(a.m[0]), + std::nearbyint(a.m[1]), + std::nearbyint(a.m[2]), + std::nearbyint(a.m[3])); } /**
Clang static analyser: Dead increment
@@ -221,7 +221,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) lop *= 1e-6; if (lap != 0.0) return GRIB_NOT_IMPLEMENTED; - lap *= DEG2RAD; + /*lap *= DEG2RAD;*/ lop *= DEG2RAD; orient_angle = orientationInDegrees;
minor +send-blob refactor
=/ =peer-state +.u.ship-state =/ =channel [[our ship] now +>.ames-state -.peer-state] :: - ?~ route=route.peer-state + =* try-next-sponsor ?: =(ship her-sponsor.channel) event-core $(ship her-sponsor.channel) :: + ?~ route=route.peer-state + try-next-sponsor + :: =. event-core (emit unix-duct.ames-state %give %send lane.u.route blob) :: ?: direct.u.route event-core - ?: =(ship her-sponsor.channel) - event-core - $(ship her-sponsor.channel) + try-next-sponsor :: +got-peer-state: lookup .her state or crash :: ++ got-peer-state
sysrepo MAINTENANCE use libyang helper functions
@@ -2667,7 +2667,7 @@ sr_replace_config(sr_session_ctx_t *session, const char *module_name, struct lyd SR_CHECK_ARG_APIRET(!session || !SR_IS_CONVENTIONAL_DS(session->ds), session, err_info); - if (src_config && (session->conn->ly_ctx != src_config->schema->module->ctx)) { + if (src_config && (session->conn->ly_ctx != LYD_CTX(src_config))) { sr_errinfo_new(&err_info, SR_ERR_INVAL_ARG, "Data trees must be created using the session connection libyang context."); return sr_api_ret(session, err_info); } @@ -2677,7 +2677,7 @@ sr_replace_config(sr_session_ctx_t *session, const char *module_name, struct lyd } /* find first sibling */ - for ( ; src_config && src_config->prev->next; src_config = src_config->prev) {} + src_config = lyd_first_sibling(src_config); if (module_name) { /* try to find this module */
Allow the MQTT client example for platform Cooja
@@ -10,6 +10,6 @@ MODULES += $(CONTIKI_NG_APP_LAYER_DIR)/mqtt MODULES_REL += arch/platform/$(TARGET) -PLATFORMS_ONLY = cc26x0-cc13x0 cc2538dk openmote zoul native simplelink +PLATFORMS_ONLY = cc26x0-cc13x0 cc2538dk openmote zoul native simplelink cooja include $(CONTIKI)/Makefile.include
Make sure we use a fetched cipher when encrypting stateless tickets We use AES-256-CBC to encrypt stateless session tickets. We should ensure that the implementation is fetched from the appropriate provider.
@@ -3906,7 +3906,14 @@ static int construct_stateless_ticket(SSL *s, WPACKET *pkt, uint32_t age_add, } iv_len = EVP_CIPHER_CTX_iv_length(ctx); } else { - const EVP_CIPHER *cipher = EVP_aes_256_cbc(); + EVP_CIPHER *cipher = EVP_CIPHER_fetch(s->ctx->libctx, "AES-256-CBC", + s->ctx->propq); + + if (cipher == NULL) { + SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_CONSTRUCT_STATELESS_TICKET, + SSL_R_ALGORITHM_FETCH_FAILED); + goto err; + } iv_len = EVP_CIPHER_iv_length(cipher); if (RAND_bytes_ex(s->ctx->libctx, iv, iv_len) <= 0 @@ -3915,10 +3922,12 @@ static int construct_stateless_ticket(SSL *s, WPACKET *pkt, uint32_t age_add, || !ssl_hmac_init(hctx, tctx->ext.secure->tick_hmac_key, sizeof(tctx->ext.secure->tick_hmac_key), "SHA256")) { + EVP_CIPHER_free(cipher); SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_CONSTRUCT_STATELESS_TICKET, ERR_R_INTERNAL_ERROR); goto err; } + EVP_CIPHER_free(cipher); memcpy(key_name, tctx->ext.tick_key_name, sizeof(tctx->ext.tick_key_name)); }
VERSION bump to version 1.3.12
@@ -27,7 +27,7 @@ endif() # micro version is changed with a set of small changes or bugfixes anywhere in the project. set(SYSREPO_MAJOR_VERSION 1) set(SYSREPO_MINOR_VERSION 3) -set(SYSREPO_MICRO_VERSION 11) +set(SYSREPO_MICRO_VERSION 12) set(SYSREPO_VERSION ${SYSREPO_MAJOR_VERSION}.${SYSREPO_MINOR_VERSION}.${SYSREPO_MICRO_VERSION}) # Version of the library
Fix problem with allNAMES in ThirdPartyInstallLibrary that prevented some libraries from being installed correctly.
@@ -159,7 +159,7 @@ FUNCTION(THIRD_PARTY_INSTALL_LIBRARY LIBFILE) SET(curNAME "${curPATH}/${inptNAME}") # Come up with all of the possible library and symlink names SET(allNAMES "${curNAME}${LIBEXT}") - SET(allNAMES "${curNAME}${LIBEXT}.1") # seems to be a standard linux-ism that isn't always covered by the foreach-loop on ${extList} + SET(allNAMES ${allNAMES} "${curNAME}${LIBEXT}.1") # seems to be a standard linux-ism that isn't always covered by the foreach-loop on ${extList} SET(allNAMES ${allNAMES} "${curNAME}.a") FOREACH(X ${extList}) SET(curNAME "${curNAME}.${X}")
increased delay for USB init
@@ -11,7 +11,7 @@ import inky_helper as ih # WIFI_PASSWORD = "Your WiFi password" # A short delay to give USB chance to initialise -time.sleep(0.1) +time.sleep(0.5) # Setup for the display. graphics = PicoGraphics(DISPLAY)
fixed JS API on WM/CE
@@ -5332,6 +5332,9 @@ get_attr_vsn(const WCHAR *path, DWORD *atts, DWORD *vsn) static int wrename(const WCHAR *oldpath, const WCHAR *newpath) { + +//RHO +#ifndef _WIN32_WCE int res = 0; DWORD oldatts, newatts = (DWORD)-1; DWORD oldvsn = 0, newvsn = 0, e; @@ -5354,8 +5357,6 @@ wrename(const WCHAR *oldpath, const WCHAR *newpath) } get_attr_vsn(newpath, &newatts, &newvsn); -//RHO -#ifndef _WIN32_WCE RUBY_CRITICAL({ if (newatts != (DWORD)-1 && newatts & FILE_ATTRIBUTE_READONLY) @@ -5376,6 +5377,18 @@ wrename(const WCHAR *oldpath, const WCHAR *newpath) SetFileAttributesW(newpath, oldatts); }); #else + int res = 0; + int oldatts; + int newatts; + + oldatts = GetFileAttributesW(oldpath); + newatts = GetFileAttributesW(newpath); + + if (oldatts == -1) { + errno = map_errno(GetLastError()); + return -1; + } + RUBY_CRITICAL({ if (newatts != -1 && newatts & FILE_ATTRIBUTE_READONLY) SetFileAttributesW(newpath, newatts & ~ FILE_ATTRIBUTE_READONLY);
refactor: move curl header to user-agent.h
#ifndef USER_AGENT_H #define USER_AGENT_H -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus +#include <curl/curl.h> #include "ntl.h" #include "orka-config.h" +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + /* UTILITY MACROS */ #define STREQ(str1, str2) (0 == strcmp(str1, str2)) #define STRNEQ(str1, str2, n) (0 == strncmp(str1, str2, n))
Add quick comment about ambiguous field name
@@ -271,7 +271,7 @@ typedef struct packed { memory_op_t memory_access_type; logic load; logic compare; - subcycle_t last_subcycle; + subcycle_t last_subcycle; // count of last subcycle, not a boolean flag control_register_t creg_index; logic cache_control; cache_op_t cache_control_op;
Remove Pragma once from HttpClientFactory.hpp to align with project-wide style.
// Copyright (c) Microsoft. All rights reserved. +#ifndef HTTPCLIENTFACTORY_HPP +#define HTTPCLIENTFACTORY_HPP -#pragma once #include "IHttpClient.hpp" #include "pal/PAL.hpp" @@ -18,3 +19,5 @@ private: } ARIASDK_NS_END + +#endif // HTTPCLIENTFACTORY_HPP \ No newline at end of file
Skip updating directory when already set to the correct path
@@ -608,10 +608,19 @@ BOOLEAN PhInitializeDirectoryPolicy( { PPH_STRING applicationDirectory; UNICODE_STRING applicationDirectoryUs; + PH_STRINGREF currentDirectory; if (!(applicationDirectory = PhGetApplicationDirectoryWin32())) return FALSE; + PhUnicodeStringToStringRef(&NtCurrentPeb()->ProcessParameters->CurrentDirectory.DosPath, &currentDirectory); + + if (PhEqualStringRef(&applicationDirectory->sr, &currentDirectory, TRUE)) + { + PhDereferenceObject(applicationDirectory); + return TRUE; + } + if (!PhStringRefToUnicodeString(&applicationDirectory->sr, &applicationDirectoryUs)) { PhDereferenceObject(applicationDirectory);
add matekf411.dshot300.serial as default build.
"BRUSHLESS_TARGET": "", "RX_UNIFIED_SERIAL": "" } + }, + { + "name": "dshot300.serial", + "defines": { + "BRUSHLESS_TARGET": "", + "RX_UNIFIED_SERIAL": "", + "DSHOT": "300" + } } ] },
Fix array sizes to prevent ASAN errors (large block interpolation).
// AVX2 implementation of horizontal filter reads and // writes two rows for luma and four for chroma at a time. // Extra vertical padding is added to prevent segfaults. -// Horizontal padding is not needed even if one extra byte -// is read because kvz_image_alloc adds enough padding. -#define KVZ_IPOL_MAX_INPUT_SIZE_LUMA_SIMD ((KVZ_EXT_BLOCK_W_LUMA + 1) * KVZ_EXT_BLOCK_W_LUMA) -#define KVZ_IPOL_MAX_INPUT_SIZE_CHROMA_SIMD ((KVZ_EXT_BLOCK_W_CHROMA + 3) * KVZ_EXT_BLOCK_W_CHROMA) + // Needs one extra byte for input buffer to prevent ASAN + // error because AVX2 reads one extra byte in the end. +#define KVZ_IPOL_MAX_INPUT_SIZE_LUMA_SIMD ((KVZ_EXT_BLOCK_W_LUMA + 1) * KVZ_EXT_BLOCK_W_LUMA + 1) +#define KVZ_IPOL_MAX_INPUT_SIZE_CHROMA_SIMD ((KVZ_EXT_BLOCK_W_CHROMA + 3) * KVZ_EXT_BLOCK_W_CHROMA + 1) #define KVZ_IPOL_MAX_IM_SIZE_LUMA_SIMD ((KVZ_EXT_BLOCK_W_LUMA + 1) * LCU_WIDTH) #define KVZ_IPOL_MAX_IM_SIZE_CHROMA_SIMD ((KVZ_EXT_BLOCK_W_CHROMA + 3) * LCU_WIDTH_C)
fix bug in documentation there was fault for `uint32_t NVIC_GetEnableIRQ(IRQn_Type IRQn)` function documentation that fixed.
@@ -482,7 +482,7 @@ void NVIC_EnableIRQ(IRQn_Type IRQn); \returns - 0 Interrupt is not enabled - - 1 Interrupt is pending + - 1 Interrupt is enabled \remarks - IRQn must not be negative.
fix plus config mixer
@@ -255,10 +255,10 @@ void motor_mixer_calc(float mix[4]) { mix[MOTOR_BL] = state.throttle + state.pidoutput.axis[ROLL] + state.pidoutput.axis[PITCH] + state.pidoutput.axis[YAW]; // BL #else // plus mode, we set mix according to pidoutput - mix[MOTOR_FR] = state.throttle - state.pidoutput.axis[PITCH] - state.pidoutput.axis[YAW]; // FRONT - mix[MOTOR_FL] = state.throttle - state.pidoutput.axis[ROLL] + state.pidoutput.axis[YAW]; // RIGHT - mix[MOTOR_BR] = state.throttle + state.pidoutput.axis[PITCH] - state.pidoutput.axis[YAW]; // BACK - mix[MOTOR_BL] = state.throttle + state.pidoutput.axis[ROLL] + state.pidoutput.axis[YAW]; // LEFT + mix[MOTOR_FR] = state.throttle - state.pidoutput.axis[PITCH] + state.pidoutput.axis[YAW]; // FRONT + mix[MOTOR_FL] = state.throttle + state.pidoutput.axis[ROLL] - state.pidoutput.axis[YAW]; // LEFT + mix[MOTOR_BR] = state.throttle - state.pidoutput.axis[ROLL] - state.pidoutput.axis[YAW]; // RIGHT + mix[MOTOR_BL] = state.throttle + state.pidoutput.axis[PITCH] + state.pidoutput.axis[YAW]; // BACK #endif for (int i = 0; i <= 3; i++) {
host_command: Add host_is_event_set host_is_event_set checks whether a given event is set or not. BRANCH=none TEST=make buildall
@@ -161,6 +161,17 @@ void host_clear_events(uint32_t mask); * Return the raw event state. */ uint32_t host_get_events(void); + +/** + * Check a single host event. + * + * @param event Event to check + * @return true if <event> is set or false otherwise + */ +static inline int host_is_event_set(enum host_event_code event) +{ + return host_get_events() & EC_HOST_EVENT_MASK(event); +} #endif /**
Examples: Use more common technical term
@@ -33,7 +33,7 @@ int main (void) // printf ("Write key set to disk\n"); // kdbSet (handle, config, root); - printf ("Delete mappings inside memory\n"); + printf ("Delete key-value pairs inside memory\n"); ksDel (config); printf ("Close key database\n"); kdbClose (handle, 0);
.github/workflows/travis-ci.yml: Disable esp32 builds. Rely on separate .yml for that.
@@ -461,6 +461,7 @@ jobs: make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32- esp32-ESP-IDFv3-port-build: + if: false runs-on: ubuntu-16.04 steps: - name: Clone @@ -489,6 +490,7 @@ jobs: make ${MAKEOPTS} -C ports/esp32 esp32-ESP-IDFv4-port-build: + if: false runs-on: ubuntu-16.04 steps: - name: Clone
Don't turn off the phone power on C2s when changing USB mode
@@ -72,11 +72,9 @@ void uno_set_usb_power_mode(uint8_t mode) { bool valid = false; switch (mode) { case USB_POWER_CLIENT: - uno_set_phone_power(false); valid = true; break; case USB_POWER_CDP: - uno_set_phone_power(true); uno_bootkick(); valid = true; break;
kiln: update %base in +bump
|= except=(set desk) ^+ kiln =/ kel=weft [%zuse zuse] - =. except (~(put in except) %base) - =/ ded (~(dif in (get-blockers kel)) except) + =/ ded (~(dif in (get-blockers kel)) (~(put in except) %base)) ?. =(~ ded) =/ mes "kiln: desks blocked upgrade to {<[- +]:kel>}: {<ded>}" (^emit (pyre:pass leaf/mes ~))
build: luajit: macos: Handle macOS Monterey
@@ -14,7 +14,7 @@ set(LUAJIT_DEST ${CMAKE_CURRENT_BINARY_DIR}) if (CMAKE_SYSTEM_NAME MATCHES "Darwin") set(CFLAGS "${CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT} -fno-stack-check") if (CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20 - AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 21) + AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 22) set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=11.0") else() set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=10.15") @@ -30,7 +30,7 @@ ExternalProject_Add(luajit EXCLUDE_FROM_ALL TRUE SOURCE_DIR ${LUAJIT_SRC} CONFIGURE_COMMAND ./configure - BUILD_COMMAND $(MAKE) CC=${CMAKE_C_COMPILER} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC" + BUILD_COMMAND $(MAKE) CC=${CMAKE_C_COMPILER} ${DEPLOYMENT_TARGET} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC" INSTALL_COMMAND cp src/libluajit.a "${LUAJIT_DEST}/lib/libluajit.a") # luajit (Windows)
arch/imxrt: fix typo in Kconfig, ARCH_FAMILY_MIMXRT105xCVL5A ARCH_FAMILY_IMIMXRT105xCVL5A -> ARCH_FAMILY_MIMXRT105xCVL5A
@@ -34,7 +34,7 @@ config ARCH_CHIP_MIMXRT1051DVL6A config ARCH_CHIP_MIMXRT1051CVL5A bool "MIMXRT1051CVL5A" - select ARCH_FAMILY_IMIMXRT105xCVL5A + select ARCH_FAMILY_MIMXRT105xCVL5A config ARCH_CHIP_MIMXRT1052DVL6A bool "MIMXRT1052DVL6A"
osx: travis another path fix
@@ -34,7 +34,7 @@ echo "Building rhosim" cd $TRAVIS_BUILD_DIR rm $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip rake build:osx:rhosimulator -zip $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip $TRAVIS_BUILD_DIR/rhodes/platform/osx/bin/RhoSimulator/RhoSimulator.app +zip $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/RhoSimulator.app # > build.log OUT=$?
added create group toggle to new notebook page
@@ -58,20 +58,29 @@ export class NewScreen extends Component { onClickCreate() { const { props, state } = this; let bookId = stringToSymbol(state.idName); - let groupInfo = (state.invites.groups.length > 0) - ? { + let groupInfo = null; + if (state.invites.groups.length > 0) { + groupInfo = { "group-path": state.invites.groups[0], "invitees": [], "use-preexisting": true, "make-managed": false, - } - : { - // TODO remove /~ and set make-managed on toggle + }; + } else if (this.state.createGroup) { + groupInfo = { + "group-path": `/~${window.ship}/${bookId}`, + "invitees": state.invites.ships, + "use-preexisting": false, + "make-managed": true, + }; + } else { + groupInfo = { "group-path": `/~/publish/~${window.ship}/${bookId}`, "invitees": state.invites.ships, "use-preexisting": false, "make-managed": false, }; + } let action = { "new-book": { @@ -87,32 +96,30 @@ export class NewScreen extends Component { } render() { - // let createGroupClasses = this.state.createGroup - // ? "relative checked bg-green2 br3 h1 toggle v-mid z-0" - // : "relative bg-gray4 bg-gray1-d br3 h1 toggle v-mid z-0"; + let createGroupClasses = this.state.createGroup + ? "relative checked bg-green2 br3 h1 toggle v-mid z-0" + : "relative bg-gray4 bg-gray1-d br3 h1 toggle v-mid z-0"; let createClasses = "pointer db f9 green2 bg-gray0-d ba pv3 ph4 mv7 b--green2"; if (!this.state.idName) { createClasses = "pointer db f9 gray2 ba bg-gray0-d pa2 pv3 ph4 mv7 b--gray3"; } - // let createGroupToggle = <div/> - // if ((this.state.invites.ships.length > 0) && (this.state.invites.groups.length === 0)) { - // createGroupToggle = ( - // <div className="mv7"> - // <input - // type="checkbox" - // style={{ WebkitAppearance: "none", width: 28 }} - // className={createGroupClasses} - // onChange={this.createGroupChange} - // /> - // <span className="dib f9 white-d inter ml3">Create Group</span> - // <p className="f9 gray2 pt1" style={{ paddingLeft: 40 }}> - // Participants will share this group across applications - // </p> - // </div> - // ); - // } + let createGroupToggle = + !((this.state.invites.ships.length > 0) && (this.state.invites.groups.length === 0)) + ? null + : <div className="mv7"> + <input + type="checkbox" + style={{ WebkitAppearance: "none", width: 28 }} + className={createGroupClasses} + onChange={this.createGroupChange} + /> + <span className="dib f9 white-d inter ml3">Create Group</span> + <p className="f9 gray2 pt1" style={{ paddingLeft: 40 }}> + Participants will share this group across applications + </p> + </div>; let idErrElem = <span />; @@ -176,7 +183,7 @@ export class NewScreen extends Component { invites={this.state.invites} setInvite={this.setInvite} /> - {/* {createGroupToggle} */} + {createGroupToggle} <button onClick={this.onClickCreate.bind(this)} className={createClasses}>
CUDA: const correctness in get/free device name string This silences a couple of const correctness warnings due to implicit casts to/from char*/const char*.
@@ -286,12 +286,15 @@ pocl_cuda_init (unsigned j, cl_device_id dev, const char *parameters) ret = CL_INVALID_DEVICE; /* Get specific device name */ - dev->long_name = dev->short_name = calloc (256, sizeof (char)); + { + char *name = calloc (256, sizeof (char)); if (ret != CL_INVALID_DEVICE) - cuDeviceGetName (dev->long_name, 256, data->device); + cuDeviceGetName (name, 256, data->device); else - snprintf (dev->long_name, 255, "Unavailable CUDA device #%d", j); + snprintf (name, 255, "Unavailable CUDA device #%d", j); + dev->long_name = dev->short_name = name; + } SETUP_DEVICE_CL_VERSION (CUDA_DEVICE_CL_VERSION_MAJOR, CUDA_DEVICE_CL_VERSION_MINOR); @@ -533,7 +536,10 @@ pocl_cuda_uninit (unsigned j, cl_device_id device) POCL_MEM_FREE (data); device->data = NULL; - POCL_MEM_FREE (device->long_name); + char *name = (char*)device->long_name; + POCL_MEM_FREE (name); + device->long_name = device->short_name = NULL; + return CL_SUCCESS; }
tools/mpybytes: create temporary files
#!/usr/bin/env python3 -from sys import argv +import os import mpy_cross import argparse +import tempfile -TMPFILE = 'script.py' - -def get_bytes(path): +def get_bytes_from_file(path, fake_name=None): """Compile a Python file with mpy-cross and return as list of bytes.""" - # TODO: Check versions and compatibility - proc = mpy_cross.run(path, '-mno-unicode') + + # Cross-compile Python file to .mpy + mpy_path = os.path.splitext(path)[0] + '.mpy' + proc = mpy_cross.run(path, '-mno-unicode', '-o', mpy_path) proc.wait() - with open(path[0:-3]+'.mpy', 'rb') as mpy: + # Read the .mpy file + with open(mpy_path, 'rb') as mpy: contents = mpy.read() + + # Override the module name if requested (else it is /path/to/script.py) + if fake_name: + bin_path = bytes(path.encode('utf-8')) + fake_path = bytes(fake_name.encode('utf-8')) + contents = contents.replace(bin_path, fake_path) + + # Remove the temporary .mpy file and return the contents + os.remove(mpy_path) return [int(c) for c in contents] -def script_from_str(string): - with open(TMPFILE, 'w') as f: +def get_bytes_from_str(string): + """Compile a Python command with mpy-cross and return as list of bytes.""" + + # Write Python command to a temporary file and convert as a regular script. + with tempfile.NamedTemporaryFile(mode='w', suffix='.py') as f: f.write(string + '\n') + return get_bytes_from_file(f.name, fake_name='script.py') if __name__ == "__main__": @@ -30,7 +45,7 @@ if __name__ == "__main__": args = parser.parse_args() if args.file: - print(get_bytes(args.file)) + print(get_bytes_from_file(args.file)) if args.string: - print(get_bytes(TMPFILE)) + print(get_bytes_from_str(args.string))
ble_mesh: stack: Fix Node ID adv with wrong timeout
@@ -231,6 +231,11 @@ static inline int adv_send(struct net_buf *buf) return 0; } +static inline TickType_t K_WAIT(int32_t val) +{ + return (val == K_FOREVER) ? portMAX_DELAY : (val / portTICK_PERIOD_MS); +} + static void adv_thread(void *p) { #if defined(CONFIG_BLE_MESH_RELAY_ADV_BUF) @@ -254,7 +259,7 @@ static void adv_thread(void *p) BT_DBG("Mesh Proxy Advertising start"); timeout = bt_mesh_proxy_server_adv_start(); BT_DBG("Mesh Proxy Advertising up to %d ms", timeout); - xQueueReceive(adv_queue.handle, &msg, timeout); + xQueueReceive(adv_queue.handle, &msg, K_WAIT(timeout)); BT_DBG("Mesh Proxy Advertising stop"); bt_mesh_proxy_server_adv_stop(); } @@ -277,7 +282,7 @@ static void adv_thread(void *p) BT_DBG("Mesh Proxy Advertising start"); timeout = bt_mesh_proxy_server_adv_start(); BT_DBG("Mesh Proxy Advertising up to %d ms", timeout); - handle = xQueueSelectFromSet(mesh_queue_set, timeout); + handle = xQueueSelectFromSet(mesh_queue_set, K_WAIT(timeout)); BT_DBG("Mesh Proxy Advertising stop"); bt_mesh_proxy_server_adv_stop(); if (handle) {
updating R to v3.3.2
@@ -65,7 +65,7 @@ BuildRequires: intel_licenses Name: %{pname}%{PROJ_DELIM} Release: 1%{?dist} -Version: 3.3.1 +Version: 3.3.2 Source: https://cran.r-project.org/src/base/R-3/R-%{version}.tar.gz Source1: OHPC_macros Source2: OHPC_setup_compiler
tools/check-hash.sh: Add shasum to use checking hash In macOS, sha*sum tools not found, but shasum can be use instead of them.
@@ -71,7 +71,14 @@ esac # Calculate hash value of passed file -calc_hash=$( ${hash_algo}sum "${file_to_check}" | cut -d' ' -f1 ) +if [ `which ${hash_algo}sum 2> /dev/null` ]; then + hash_algo_cmd="${hash_algo}sum" +elif [ `which shasum 2> /dev/null` ]; then + hash_algo_len=$( echo ${hash_algo} | cut -c 4- ) + hash_algo_cmd="shasum -a ${hash_algo_len}" +fi + +calc_hash=$( ${hash_algo_cmd} "${file_to_check}" | cut -d' ' -f1 ) # Does it match expected hash?
Test multi-byte characters in ATTLIST default attribute value
@@ -1927,6 +1927,16 @@ START_TEST(test_dtd_attr_handling) "bar", XML_FALSE }, + { + "<!ATTLIST doc a CDATA '\xdb\xb2'>\n" + "]>" + "<doc/>", + "doc", + "a", + "CDATA", + "\xdb\xb2", + XML_FALSE + }, { NULL, NULL, NULL, NULL, NULL, XML_FALSE } }; AttTest *test;
Fix buffer overflow in ble-l2cap
@@ -422,9 +422,16 @@ input_l2cap_frame_flow_channel(l2cap_channel_t *channel, uint8_t *data, uint16_t if(channel->rx_buffer.sdu_length == 0) { /* handle first fragment */ memcpy(&frame_len, &data[0], 2); - memcpy(&channel->rx_buffer.sdu_length, &data[4], 2); payload_len = frame_len - 2; + if(payload_len > BLE_L2CAP_NODE_MTU) { + LOG_WARN("l2cap_frame: illegal L2CAP frame payload_len: %d\n", payload_len); + /* the payload length may not be larger than the destination buffer */ + return; + } + + memcpy(&channel->rx_buffer.sdu_length, &data[4], 2); + memcpy(channel->rx_buffer.sdu, &data[6], payload_len); channel->rx_buffer.current_index = payload_len; } else { @@ -432,6 +439,13 @@ input_l2cap_frame_flow_channel(l2cap_channel_t *channel, uint8_t *data, uint16_t memcpy(&frame_len, &data[0], 2); payload_len = frame_len; + if(channel->rx_buffer.current_index + payload_len > BLE_L2CAP_NODE_MTU) { + LOG_WARN("l2cap_frame: illegal L2CAP frame payload_len: %d\n", payload_len); + /* the current index plus the payload length may not be larger than + * the destination buffer */ + return; + } + memcpy(&channel->rx_buffer.sdu[channel->rx_buffer.current_index], &data[4], payload_len); channel->rx_buffer.current_index += payload_len; }
BugId:19028262: Recreate .config for %.menuconfig Cleanup useless check from Makefile.
@@ -56,7 +56,7 @@ else ifneq ($(filter %.export-iar, $(BUILD_STRING)),) export IDE := iar endif -ifneq ($(filter %.config, $(MAKECMDGOALS)),) +ifneq ($(filter %.config %.menuconfig, $(MAKECMDGOALS)),) $(shell rm -rf .config .defconfig out/config) endif @@ -160,22 +160,6 @@ export BOARD_DEFCONFIG := $(defconfig) AOS_DEFCONFIG := $(BOARD_DEFCONFIG) endif -ifneq ($(wildcard $(AOS_CONFIG)),) -include $(AOS_CONFIG) - -ifneq ($(AOS_BUILD_APP),) -ifneq ($(AOS_BUILD_APP),"$(appname)") -$(error App name missmatched: $(AOS_BUILD_APP),"$(appname)") -endif -endif # $(AOS_BUILD_APP) - -ifneq ($(AOS_BUILD_BOARD),) -ifneq ($(AOS_BUILD_BOARD),"$(boardname)") -$(error Board name missmatched: $(AOS_BUILD_BOARD),"$(boardname)") -endif -endif # $(AOS_BUILD_BOARD) -endif # $(wildcard $(AOS_CONFIG)) - export AOS_BOARD_CONFIG = AOS_BOARD_$(shell $(PYTHON) $(TR) $(subst -,_,$(subst board_,,$(real_boardname)))) export AOS_APP_CONFIG = AOS_APP_$(shell $(PYTHON) $(TR) $(subst -,_,$(subst app_,,$(real_appname))))
Fix typos in bio.pod CLA: trivial
@@ -17,7 +17,7 @@ details from an application. If an application uses a BIO for its I/O it can transparently handle SSL connections, unencrypted network connections and file I/O. -There are two type of BIO, a source/sink BIO and a filter BIO. +There are two types of BIO, a source/sink BIO and a filter BIO. As its name implies a source/sink BIO is a source and/or sink of data, examples include a socket BIO and a file BIO. @@ -31,7 +31,7 @@ BIO will encrypt data if it is being written to and decrypt data if it is being read from. BIOs can be joined together to form a chain (a single BIO is a chain -with one component). A chain normally consist of one source/sink +with one component). A chain normally consists of one source/sink BIO and one or more filter BIOs. Data read from or written to the first BIO then traverses the chain to the end (normally a source/sink BIO).
SOVERSION bump to version 1.3.6
@@ -48,7 +48,7 @@ set(LIBNETCONF2_VERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION # with backward compatible change and micro version is connected with any internal change of the library. set(LIBNETCONF2_MAJOR_SOVERSION 1) set(LIBNETCONF2_MINOR_SOVERSION 3) -set(LIBNETCONF2_MICRO_SOVERSION 5) +set(LIBNETCONF2_MICRO_SOVERSION 6) set(LIBNETCONF2_SOVERSION_FULL ${LIBNETCONF2_MAJOR_SOVERSION}.${LIBNETCONF2_MINOR_SOVERSION}.${LIBNETCONF2_MICRO_SOVERSION}) set(LIBNETCONF2_SOVERSION ${LIBNETCONF2_MAJOR_SOVERSION})
vkGetInstanceProcAddr(instance, "vkGetInstanceProcAddr") should return our vkGetInstanceProcAddr not the next in the chain.
@@ -1932,10 +1932,14 @@ static void overlay_DestroyInstance( extern "C" VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL overlay_GetDeviceProcAddr(VkDevice dev, const char *funcName); +extern "C" VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL overlay_GetInstanceProcAddr(VkInstance instance, + const char *funcName); + static const struct { const char *name; void *ptr; } name_to_funcptr_map[] = { + { "vkGetInstanceProcAddr", (void *) overlay_GetInstanceProcAddr }, { "vkGetDeviceProcAddr", (void *) overlay_GetDeviceProcAddr }, #define ADD_HOOK(fn) { "vk" # fn, (void *) overlay_ ## fn } #define ADD_ALIAS_HOOK(alias, fn) { "vk" # alias, (void *) overlay_ ## fn }
Add casts to performance/storage test for 32-bit architectures.
@@ -237,7 +237,7 @@ testRun(void) ASSERT(bufUsed(block) == 1024 * 1024); // Build the input buffer - Buffer *input = bufNew(blockTotal * bufSize(block)); + Buffer *input = bufNew((size_t)blockTotal * bufSize(block)); for (unsigned int blockIdx = 0; blockIdx < blockTotal; blockIdx++) memcpy(bufPtr(input) + (blockIdx * bufSize(block)), bufPtr(block), bufSize(block)); @@ -246,7 +246,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE_FMT( - "%u iteration(s) of %" PRIu64 "MiB with %" PRIu64 "MB/s input, %" PRIu64 "MB/s output", iteration, + "%u iteration(s) of %zuMiB with %" PRIu64 "MB/s input, %" PRIu64 "MB/s output", iteration, bufUsed(input) / bufUsed(block), rateIn, rateOut); #define BENCHMARK_BEGIN() \
[libc/time] Revert the time.h
@@ -57,10 +57,6 @@ time_t timegm(struct tm * const t); int gettimeofday(struct timeval *tv, struct timezone *tz); int settimeofday(const struct timeval *tv, const struct timezone *tz); -#if defined(__ARMCC_VERSION) || defined (__ICCARM__) -struct tm *gmtime_r(const time_t *timep, struct tm *r); -#endif - #ifdef RT_USING_POSIX #include <sys/types.h> /* posix clock and timer */
Reset initial ioclass stats value when retrieving.
@@ -289,7 +289,7 @@ int ocf_stats_collect_part_cache(ocf_cache_t cache, ocf_part_id_t part_id, struct ocf_stats_blocks *blocks) { struct io_class_stats_context ctx; - struct ocf_stats_io_class s; + struct ocf_stats_io_class s = {}; int result = 0; OCF_CHECK_NULL(cache);
VERSION bump to version 2.0.173
@@ -61,7 +61,7 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) # set version of the project set(LIBYANG_MAJOR_VERSION 2) set(LIBYANG_MINOR_VERSION 0) -set(LIBYANG_MICRO_VERSION 172) +set(LIBYANG_MICRO_VERSION 173) set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_MICRO_VERSION}) # set version of the library set(LIBYANG_MAJOR_SOVERSION 2)
[mod_extforward] consolidate ipstr_to_sockaddr()
@@ -326,8 +326,8 @@ static const char *last_not_in_array(array *a, plugin_data *p) return NULL; } -#ifdef HAVE_IPV6 static void ipstr_to_sockaddr(server *srv, const char *host, sock_addr *sock) { +#ifdef HAVE_IPV6 struct addrinfo hints, *addrlist = NULL; int result; @@ -370,8 +370,12 @@ static void ipstr_to_sockaddr(server *srv, const char *host, sock_addr *sock) { } freeaddrinfo(addrlist); -} +#else + UNUSED(srv); + sock->ipv4.sin_addr.s_addr = inet_addr(host); + sock->plain.sa_family = (sock->ipv4.sin_addr.s_addr == 0xFFFFFFFF) ? AF_UNSPEC : AF_INET; #endif +} static void clean_cond_cache(server *srv, connection *con) { config_cond_cache_reset_item(srv, con, COMP_HTTP_REMOTE_IP); @@ -432,12 +436,7 @@ URIHANDLER_FUNC(mod_extforward_uri_handler) { if (con->conf.log_request_handling) { log_error_write(srv, __FILE__, __LINE__, "ss", "using address:", real_remote_addr); } -#ifdef HAVE_IPV6 ipstr_to_sockaddr(srv, real_remote_addr, &sock); -#else - sock.ipv4.sin_addr.s_addr = inet_addr(real_remote_addr); - sock.plain.sa_family = (sock.ipv4.sin_addr.s_addr == 0xFFFFFFFF) ? AF_UNSPEC : AF_INET; -#endif if (sock.plain.sa_family != AF_UNSPEC) { /* we found the remote address, modify current connection and save the old address */ if (con->plugin_ctx[p->id]) {
OcAppleKernelLib: Fix Jettison heuristics
@@ -1547,7 +1547,7 @@ PatchSegmentJettison ( } Status = PatcherGetSymbolAddress (Patcher, "_ml_static_mfree", (UINT8 **) &StaticMfree); - if (EFI_ERROR (Status) || RemoveBs > Last) { + if (EFI_ERROR (Status) || StaticMfree > Last) { DEBUG ((DEBUG_INFO, "OCAK: Missing ml_static_mfree - %r\n", Status)); return EFI_NOT_FOUND; }
Remove name in `ns.h`
#include "scopetypes.h" -bool nsIsPidInChildNs(pid_t pid, pid_t *nsPid); -int nsForkAndExec(pid_t parentPid, pid_t nsPid); +bool nsIsPidInChildNs(pid_t, pid_t *); +int nsForkAndExec(pid_t, pid_t); #endif // __NS_H__
lib: test: add signal handlers
#include <stdio.h> #include <stdlib.h> +#include <signal.h> #include <unistd.h> #define API_ADDR "127.0.0.1" #define API_PORT "2020" +/* Main context set as global so the signal handler can use it */ +mk_ctx_t *ctx; + void cb_worker(void *data) { mk_info("[api test] test worker callback; data=%p", data); @@ -46,12 +50,39 @@ void cb_test_big_chunk(mk_request_t *request, void *data) mk_http_done(request); } + +static void signal_handler(int signal) +{ + write(STDERR_FILENO, "[engine] caught signal\n", 23); + + switch (signal) { + case SIGTERM: + case SIGINT: + mk_stop(ctx); + mk_destroy(ctx); + _exit(EXIT_SUCCESS); + default: + break; + } +} + +static void signal_init() +{ + signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); +} + int main() { int vid; - mk_ctx_t *ctx; + + signal_init(); ctx = mk_create(); + if (!ctx) { + return -1; + } + mk_config_set(ctx, "Listen", API_PORT, NULL); @@ -70,10 +101,9 @@ int main() mk_info("Service: http://%s:%s/test", API_ADDR, API_PORT); mk_start(ctx); - sleep(10); - - mk_stop(ctx); - mk_destroy(ctx); + while (1) { + sleep(1000); + } return 0; }
buffersize via macro
@@ -33,6 +33,7 @@ static char *config_property = "{\ static uint8_t config_log_level = 1; static uint8_t config_keep_alive = 0; #define BUFFERSIZE 33768 +#define BUFFERSIZE_SMALL 1024 struct neat_ctx *ctx = NULL; @@ -73,7 +74,7 @@ prepare_http_response(struct http_flow *http_flow, unsigned char **buffer, uint3 unsigned char *payload_buffer = NULL; unsigned char *header_buffer = NULL; int i = 0; - char misc_buffer[512]; + char misc_buffer[BUFFERSIZE_SMALL]; if (config_log_level >= 2) { @@ -83,7 +84,7 @@ prepare_http_response(struct http_flow *http_flow, unsigned char **buffer, uint3 // iterate header fields for (i = 0; i < (int)http_flow->num_headers; i++) { // build string from name/value pair - snprintf(misc_buffer, 512, "%.*s: %.*s", + snprintf(misc_buffer, BUFFERSIZE_SMALL, "%.*s: %.*s", (int)http_flow->headers[i].name_len, http_flow->headers[i].name, (int)http_flow->headers[i].value_len, @@ -128,14 +129,14 @@ prepare_http_response(struct http_flow *http_flow, unsigned char **buffer, uint3 exit(EXIT_FAILURE); } - header_buffer = malloc(512); + header_buffer = malloc(BUFFERSIZE_SMALL); if (header_buffer == NULL) { fprintf(stderr, "%s - malloc failed\n", __func__); exit(EXIT_FAILURE); } // prepare response header - header_length = snprintf((char *) header_buffer, 1024, + header_length = snprintf((char *) header_buffer, BUFFERSIZE_SMALL, "HTTP/1.1 200 OK\r\n" "Server: NEAT super fancy webserver\r\n" "Content-Length: %u\r\n"
debian: bump version to 0.11-development
+td-agent-bit (0.11.0-dev) stable; urgency=low + + * Based on Fluent Bit v0.11.0-dev + + -- Eduardo Silva <[email protected]> Mon, 13 Mar 2017 09:00:00 -0600 + +td-agent-bit (0.10.1-1) stable; urgency=low + + * Based on Fluent Bit v0.10.1 + + -- Eduardo Silva <[email protected]> Fri, 06 Jan 2017 09:00:00 -0600 + td-agent-bit (0.10.0-1) stable; urgency=low * Based on Fluent Bit v0.10.0
display: lock mutex before calling display_displayLocked
@@ -148,9 +148,6 @@ static void display_displayLocked(honggfuzz_t* hfuzz) { size_t exec_per_sec = curr_exec_cnt - prev_exec_cnt; prev_exec_cnt = curr_exec_cnt; - /* The lock should be acquired before any output is printed on the screen */ - MX_SCOPED_LOCK(logMutexGet()); - display_put(ESC_NAV(13, 1) ESC_CLEAR_ABOVE ESC_NAV(1, 1)); display_put("------------------------[" ESC_BOLD "%31s " ESC_RESET "]----------------------\n", timeStr); @@ -294,6 +291,7 @@ void display_display(honggfuzz_t* hfuzz) { if (logIsTTY() == false) { return; } + MX_SCOPED_LOCK(logMutexGet()); display_displayLocked(hfuzz); }
options/ansi: Add ENOSPC to strerror
@@ -334,6 +334,7 @@ char *strerror(int e) { case ESPIPE: s = "Seek not possible (ESPIPE)"; break; case ENXIO: s = "No such device or address (ENXIO)"; break; case ENOEXEC: s = "Exec format error (ENOEXEC)"; break; + case ENOSPC: s = "No space left on device (ENOSPC)"; break; default: s = "Unknown error code (?)"; }
Get default values for stack and heap for sam3u2c
; * ; *****************************************************************************/ +#include "daplink_defaults.h" ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> -Stack_Size EQU 0x00000200 +Stack_Size EQU DAPLINK_STACK_SIZE AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size @@ -35,7 +36,7 @@ __initial_sp ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> -Heap_Size EQU 0x00000000 +Heap_Size EQU DAPLINK_HEAP_SIZE AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base
allow forward search on wlandump forced handshakes
@@ -1097,6 +1097,44 @@ while(c >= 0) return; } /*===========================================================================*/ +static void lookfor21(long int cakt, eapdb_t *zeigerakt, unsigned long long int replaycakt) +{ +eapdb_t *zeiger; +unsigned long long int r; +long int c; +int rctime = 120; +uint8_t m = 0; + +if (replaycakt != MYREPLAYCOUNT) + { + return; + } + +zeiger = zeigerakt; +c = cakt; +while(c >= 0) + { + if(((zeigerakt->tv_sec - zeiger->tv_sec) < 0) || ((zeigerakt->tv_sec - zeiger->tv_sec) > rctime)) + break; + + if((memcmp(zeiger->mac_ap.addr, zeigerakt->mac_ap.addr, 6) == 0) && (memcmp(zeiger->mac_sta.addr, zeigerakt->mac_sta.addr, 6) == 0)) + { + m = geteapkey(zeiger->eapol); + r = getreplaycount(zeiger->eapol); + if((m == 2) && (r == replaycakt)) + { + lookforessid(zeiger, zeigerakt, MESSAGE_PAIR_M12E2); + if(netexact == true) + lookforessidexact(zeiger, zeigerakt, MESSAGE_PAIR_M12E2); + return; + } + } + zeiger--; + c--; + } +return; +} +/*===========================================================================*/ static void lookfor12(long int cakt, eapdb_t *zeigerakt, unsigned long long int replaycakt) { eapdb_t *zeiger; @@ -1187,6 +1225,11 @@ memcpy(neweapdbdata->eapol, eap, neweapdbdata->eapol_len); m = geteapkey(neweapdbdata->eapol); replaycount = getreplaycount(neweapdbdata->eapol); +if(m == 1) + { + lookfor21(eapdbrecords, neweapdbdata, replaycount); + } + if(m == 2) { lookfor12(eapdbrecords, neweapdbdata, replaycount); @@ -1509,7 +1552,6 @@ while((pcapstatus = pcap_next_ex(pcapin, &pkh, &packet)) != -2) if(pkh->caplen != pkh->len) continue; - packetcount++; if((pkh->ts.tv_sec == 0) && (pkh->ts.tv_usec == 0)) wcflag = true; @@ -1596,7 +1638,7 @@ while((pcapstatus = pcap_next_ex(pcapin, &pkh, &packet)) != -2) } /* check Ethernet-header */ - if(datalink == DLT_EN10MB) + else if(datalink == DLT_EN10MB) { if(ETHER_SIZE > pkh->len) continue;
options/posix: Fix incorrect deadlock detection in pthread_mutex_trylock
@@ -822,11 +822,7 @@ int pthread_mutex_trylock(pthread_mutex_t *mutex) { // If this (recursive) mutex is already owned by us, increment the recursion level. if((expected & mutex_owner_mask) == this_tid()) { if(!(mutex->__mlibc_flags & mutexRecursive)) { - if (mutex->__mlibc_flags & mutexErrorCheck) - return EDEADLK; - else - mlibc::panicLogger() << "mlibc: pthread_mutex deadlock detected!" - << frg::endlog; + return EBUSY; } ++mutex->__mlibc_recursion; return 0;
Allow lovr.audio.setDevice(type, nil);
@@ -77,9 +77,8 @@ static int l_lovrAudioGetDevices(lua_State *L) { static int l_lovrAudioSetDevice(lua_State *L) { AudioType type = luax_checkenum(L, 1, AudioType, "playback"); - luaL_checkany(L, 2); void* id = lua_touserdata(L, 2); - size_t size = luax_len(L, 2); + size_t size = id ? luax_len(L, 2) : 0; Sound* sink = lua_isnoneornil(L, 3) ? NULL : luax_checktype(L, 3, Sound); AudioShareMode shareMode = luax_checkenum(L, 4, AudioShareMode, "shared"); bool success = lovrAudioSetDevice(type, id, size, sink, shareMode);
Add party id to GroupManager
@@ -12,8 +12,8 @@ namespace FFXIVClientStructs.FFXIV.Client.Game.Group [FieldOffset(0x1180)] public fixed byte AllianceMembers[0x230 * 20]; // PartyMember type [FieldOffset(0x3D40)] public uint Unk_3D40; [FieldOffset(0x3D44)] public ushort Unk_3D44; - [FieldOffset(0x3D48)] public long Unk_3D48; - [FieldOffset(0x3D50)] public long Unk_3D50; + [FieldOffset(0x3D48)] public long PartyId; // both seem to be unique per party and replicated to every member + [FieldOffset(0x3D50)] public long PartyId_2; [FieldOffset(0x3D58)] public uint PartyLeaderIndex; // index of party leader in array [FieldOffset(0x3D5C)] public byte MemberCount; [FieldOffset(0x3D5D)] public byte Unk_3D5D;
fix select_threshold
@@ -464,10 +464,11 @@ def select_threshold(model=None, data=None, curve=None, FPR=None, FNR=None, thre for pool in data: if not isinstance(pool, Pool): raise CatBoostError('one of data pools is not catboost.Pool') + return _select_threshold(model._object, data, None, FPR, FNR, thread_count) elif curve is not None: if not (isinstance(curve, list) or isinstance(curve, tuple)) or len(curve) != 3: raise CatBoostError('curve must be list or tuple of three arrays (fpr, tpr, thresholds).') + return _select_threshold(None, None, curve, FPR, FNR, thread_count) else: raise CatBoostError('One of the parameters data and curve should be set.') - return _select_threshold(model._object, data, curve, FPR, FNR, thread_count)
Update dofile function signature.
:source, :evaluator, :read, and :parser are passed through to the underlying `run-context` call. If `exit` is true, any top level errors will trigger a call to `(os/exit 1)` after printing the error.`` - [path &keys - {:exit exit - :env env - :source src - :expander expander - :evaluator evaluator - :read read - :parser parser}] + [path &named exit env source expander evaluator read parser] (def f (case (type path) :core/file path :core/stream path (def path-is-file (= f path)) (default env (make-env)) (def spath (string path)) - (put env :source (or src (if-not path-is-file spath path))) + (put env :source (or source (if-not path-is-file spath path))) (var exit-error nil) (var exit-fiber nil) (defn chunks [buf _] (:read f 4096 buf)) :expander expander :read read :parser parser - :source (or src (if path-is-file :<anonymous> spath))})) + :source (or source (if path-is-file :<anonymous> spath))})) (if-not path-is-file (:close f)) (when exit-error (if exit-fiber
VERSION bump to version 2.0.267
@@ -61,7 +61,7 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) # set version of the project set(LIBYANG_MAJOR_VERSION 2) set(LIBYANG_MINOR_VERSION 0) -set(LIBYANG_MICRO_VERSION 266) +set(LIBYANG_MICRO_VERSION 267) set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_MICRO_VERSION}) # set version of the library set(LIBYANG_MAJOR_SOVERSION 2)
Doc: in v12 release notes, explain how to replace uses of consrc and adsrc. While you can find that info if you drill down far enough, it seems more helpful to put something right in the compatibility notes. Per a question from Ivan Sergio Borgonovo. Discussion:
@@ -1590,6 +1590,16 @@ Author: Peter Eisentraut <[email protected]> linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link>.<structfield>consrc</structfield> column (Peter Eisentraut) </para> + + <para> + This column has been deprecated for a long time, because it did not + update in response to other catalog changes (such as column renamings). + The recommended way to get a text version of a check constraint's + expression from <structname>pg_constraint</structname> + is <literal>pg_get_expr(conbin, conrelid)</literal>. + <function>pg_get_constraintdef()</function> is also a useful + alternative. + </para> </listitem> <listitem> @@ -1603,6 +1613,14 @@ Author: Peter Eisentraut <[email protected]> linkend="catalog-pg-attrdef"><structname>pg_attrdef</structname></link>.<structfield>adsrc</structfield> column (Peter Eisentraut) </para> + + <para> + This column has been deprecated for a long time, because it did not + update in response to other catalog changes (such as column renamings). + The recommended way to get a text version of a default-value expression + from <structname>pg_attrdef</structname> is <literal>pg_get_expr(adbin, + adrelid)</literal>. + </para> </listitem> <listitem>
guard isxdigit against negative values
@@ -1602,8 +1602,8 @@ memset(buff, 0, bufflen); p = 0; while((lineptr[p] != '*') && (lineptr[p] != 0) && (p /2 <= bufflen)) { - if(!isxdigit(lineptr[p +0])) return 0; - if(!isxdigit(lineptr[p +1])) return 0; + if(!isxdigit((unsigned char)lineptr[p +0])) return 0; + if(!isxdigit((unsigned char)lineptr[p +1])) return 0; if((lineptr[p +1] == '*') && (lineptr[p +1] == 0)) return 0; idx0 = ((uint8_t)lineptr[p +0] &0x1F) ^0x10; idx1 = ((uint8_t)lineptr[p +1] &0x1F) ^0x10; @@ -1677,7 +1677,7 @@ while(1) p2 = 0; for(p1 = 0; p1 < 17; p1++) { - if(isxdigit(linein[p1])) + if(isxdigit((unsigned char)linein[p1])) { linein[p2] = linein[p1]; p2++; @@ -1782,7 +1782,7 @@ while(1) p2 = 0; for(p1 = 0; p1 < 17; p1++) { - if(isxdigit(linein[p1])) + if(isxdigit((unsigned char)linein[p1])) { linein[p2] = linein[p1]; p2++; @@ -2636,7 +2636,7 @@ while((auswahl = getopt_long (argc, argv, short_options, long_options, &index)) p2 = 0; for(p1 = 0; p1 < l; p1++) { - if(isxdigit(optarg[p1])) + if(isxdigit((unsigned char)optarg[p1])) { optarg[p2] = optarg[p1]; p2++; @@ -2657,7 +2657,7 @@ while((auswahl = getopt_long (argc, argv, short_options, long_options, &index)) p2 = 0; for(p1 = 0; p1 < l; p1++) { - if(isxdigit(optarg[p1])) + if(isxdigit((unsigned char)optarg[p1])) { optarg[p2] = optarg[p1]; p2++; @@ -2678,7 +2678,7 @@ while((auswahl = getopt_long (argc, argv, short_options, long_options, &index)) p2 = 0; for(p1 = 0; p1 < l; p1++) { - if(isxdigit(optarg[p1])) + if(isxdigit((unsigned char)optarg[p1])) { optarg[p2] = optarg[p1]; p2++; @@ -2707,7 +2707,7 @@ while((auswahl = getopt_long (argc, argv, short_options, long_options, &index)) p2 = 0; for(p1 = 0; p1 < l; p1++) { - if(isxdigit(optarg[p1])) + if(isxdigit((unsigned char)optarg[p1])) { optarg[p2] = optarg[p1]; p2++;
Add recording logs Log when recording is started and stopped.
@@ -114,6 +114,8 @@ SDL_bool recorder_open(struct recorder *recorder, AVCodec *input_codec) { return SDL_FALSE; } + LOGI("Recording started to %s file: %s", format_name, recorder->filename); + return SDL_TRUE; } @@ -124,6 +126,9 @@ void recorder_close(struct recorder *recorder) { } avio_close(recorder->ctx->pb); avformat_free_context(recorder->ctx); + + const char *format_name = recorder_get_format_name(recorder->format); + LOGI("Recording complete to %s file: %s", format_name, recorder->filename); } static SDL_bool
sandbox/pll-3rd-order: extending example to exaggerate concept
@@ -14,8 +14,8 @@ int main() float phase_in = 3.0f; // carrier phase offset float frequency_in = -0.20; // carrier frequency offset float alpha = 0.08f; // phase adjustment factor - unsigned int n = 400; // number of samples - float df_in = 0.10 /(float)n; + unsigned int n = 1200; // number of samples + float df_in = 0.30 /(float)n; // initialize states float beta = 0.5*alpha*alpha; // frequency adjustment factor
system/lzf: correct the open mode
@@ -311,7 +311,6 @@ short_read: static int open_out(FAR const char *name) { - int fd; int m = O_EXCL; if (g_force) @@ -319,8 +318,7 @@ static int open_out(FAR const char *name) m = 0; } - fd = open(name, O_CREAT | O_WRONLY | O_TRUNC | m, 600); - return fd; + return open(name, O_CREAT | O_WRONLY | O_TRUNC | m, 0600); } static int compose_name(FAR const char *fname, FAR char *oname, int namelen)
Update: Variable.c: Also put the variable_id as global array to reduce stack memory cost.
@@ -206,18 +206,19 @@ static void countHigherOrderStatementAtoms(Term *term, int *appearing, bool exte int appearing_left[ATOMS_MAX] = {0}; int appearing_right[ATOMS_MAX] = {0}; +char variable_id[ATOMS_MAX] = {0}; Term Variable_IntroduceImplicationVariables(Term implication, bool *success, bool extensionally) { assert(Narsese_copulaEquals(implication.atoms[0], TEMPORAL_IMPLICATION) || Narsese_copulaEquals(implication.atoms[0], IMPLICATION) || Narsese_copulaEquals(implication.atoms[0], EQUIVALENCE), "An implication is expected here!"); Term left_side = Term_ExtractSubterm(&implication, 1); Term right_side = Term_ExtractSubterm(&implication, 2); - memset(appearing_left, 0, ATOMS_MAX*sizeof(Atom)); - memset(appearing_right, 0, ATOMS_MAX*sizeof(Atom)); + memset(appearing_left, 0, ATOMS_MAX*sizeof(int)); + memset(appearing_right, 0, ATOMS_MAX*sizeof(int)); countHigherOrderStatementAtoms(&left_side, appearing_left, extensionally); countHigherOrderStatementAtoms(&right_side, appearing_right, extensionally); char depvar_i = 1; char indepvar_i = 1; - char variable_id[ATOMS_MAX] = {0}; + memset(variable_id, 0, ATOMS_MAX*sizeof(char)); Term implication_copy = implication; for(int i=0; i<COMPOUND_TERM_SIZE_MAX; i++) { @@ -259,20 +260,19 @@ Term Variable_IntroduceImplicationVariables(Term implication, bool *success, boo return implication; } -int appearing_conjunction[ATOMS_MAX] = {0}; Term Variable_IntroduceConjunctionVariables(Term conjunction, bool *success, bool extensionally) { assert(Narsese_copulaEquals(conjunction.atoms[0], CONJUNCTION), "A conjunction is expected here!"); - memset(appearing_conjunction, 0, ATOMS_MAX*sizeof(Atom)); + memset(appearing_left, 0, ATOMS_MAX*sizeof(int)); Term left_side = conjunction; - countHigherOrderStatementAtoms(&left_side, appearing_conjunction, extensionally); + countHigherOrderStatementAtoms(&left_side, appearing_left, extensionally); char depvar_i = 1; - char variable_id[ATOMS_MAX] = {0}; + memset(variable_id, 0, ATOMS_MAX*sizeof(char)); Term conjunction_copy = conjunction; for(int i=0; i<COMPOUND_TERM_SIZE_MAX; i++) { Atom atom = conjunction_copy.atoms[i]; - if(appearing_conjunction[(int) atom] >= 2) + if(appearing_left[(int) atom] >= 2) { int var_id = variable_id[(int) atom] = variable_id[(int) atom] ? variable_id[(int) atom] : depvar_i++; if(var_id <= 9) //can only introduce up to 9 variables
common/body_detection.c: Format with clang-format BRANCH=none TEST=none
@@ -31,8 +31,7 @@ static bool history_initialized; static bool body_detect_enable; STATIC_IF(CONFIG_ACCEL_SPOOF_MODE) bool spoof_enable; -static struct body_detect_motion_data -{ +static struct body_detect_motion_data { int history[CONFIG_BODY_DETECTION_MAX_WINDOW_SIZE]; /* acceleration */ int sum; /* sum(history) */ uint64_t n2_variance; /* n^2 * var(history) */ @@ -59,8 +58,8 @@ static void update_motion_data(struct body_detect_motion_data *x, int x_n) const int sum_diff = x_n - x_0; const int new_sum = x->sum + sum_diff; - x->n2_variance += sum_diff * - ((int64_t)n * (x_n + x_0) - new_sum - x->sum); + x->n2_variance += + sum_diff * ((int64_t)n * (x_n + x_0) - new_sum - x->sum); x->sum = new_sum; x->history[history_idx] = x_n; } @@ -76,8 +75,8 @@ static void update_motion_variance(void) /* return Var(X) + Var(Y) */ static uint64_t get_motion_variance(void) { - return (data[X].n2_variance + data[Y].n2_variance) - / window_size / window_size; + return (data[X].n2_variance + data[Y].n2_variance) / window_size / + window_size; } static int calculate_motion_confidence(uint64_t var) @@ -160,15 +159,15 @@ static void determine_threshold_scale(int range, int resolution, int rms_noise) * CONFIG_BODY_DETECTION_VAR_NOISE_FACTOR / 100. */ const int var_noise = POW2((uint64_t)rms_noise) * - CONFIG_BODY_DETECTION_VAR_NOISE_FACTOR * POW2(98) - / 100 / POW2(10000); + CONFIG_BODY_DETECTION_VAR_NOISE_FACTOR * + POW2(98) / 100 / POW2(10000); - var_threshold_scaled = (uint64_t) - (CONFIG_BODY_DETECTION_VAR_THRESHOLD + var_noise) * - multiplier / divisor; - confidence_delta_scaled = (uint64_t) - CONFIG_BODY_DETECTION_CONFIDENCE_DELTA * + var_threshold_scaled = + (uint64_t)(CONFIG_BODY_DETECTION_VAR_THRESHOLD + var_noise) * multiplier / divisor; + confidence_delta_scaled = + (uint64_t)CONFIG_BODY_DETECTION_CONFIDENCE_DELTA * multiplier / + divisor; } void body_detect_reset(void) @@ -185,8 +184,8 @@ void body_detect_reset(void) if (odr == 0) return; determine_window_size(odr); - determine_threshold_scale(body_sensor->current_range, - resolution, rms_noise); + determine_threshold_scale(body_sensor->current_range, resolution, + rms_noise); /* initialize motion data and state */ memset(data, 0, sizeof(data)); history_idx = 0;
bootutil: trivial fixes
@@ -32,7 +32,7 @@ extern "C" { /** Swap to slot 1. Absent a confirm command, revert back on next boot. */ #define BOOT_SWAP_TYPE_TEST 2 -/** Swap to slot 1 permanently. */ +/** Swap to slot 1, and permanently switch to booting its contents. */ #define BOOT_SWAP_TYPE_PERM 3 /** Swap back to alternate slot. A confirm changes this state to NONE. */
baseboard/honeybuns/usbc_support.c: Format with clang-format BRANCH=none TEST=none
@@ -48,17 +48,13 @@ __maybe_unused static __const_data const char * const usbc_state_names[] = { static int read_reg(uint8_t port, int reg, int *regval) { return i2c_read8(ppc_chips[port].i2c_port, - ppc_chips[port].i2c_addr_flags, - reg, - regval); + ppc_chips[port].i2c_addr_flags, reg, regval); } static int write_reg(uint8_t port, int reg, int regval) { return i2c_write8(ppc_chips[port].i2c_port, - ppc_chips[port].i2c_addr_flags, - reg, - regval); + ppc_chips[port].i2c_addr_flags, reg, regval); } static int baseboard_ppc_enable_sink_path(int port) @@ -147,7 +143,6 @@ static void baseboard_ucpd_apply_rd(int port) STM32_PWR_CR3 |= STM32_PWR_CR3_UCPD1_DBDIS; } - static void baseboard_ucpd_get_cc(int port, enum tcpc_cc_voltage_status *cc1, enum tcpc_cc_voltage_status *cc2) { @@ -325,10 +320,8 @@ int c1_ps8805_is_sourcing_vbus(int port) return level; } - int c1_ps8805_vbus_source_enable(int port, int enable) { - return ps8805_gpio_set_level(port, PS8805_GPIO_1, enable); } @@ -359,10 +352,11 @@ static void baseboard_usb3_manage_vbus(void) #ifdef GPIO_USB_HUB_OCP_NOTIFY /* - * In the case of an OCP event on this port, the usb hub should be - * notified via a GPIO signal. Following, an OCP, the attached.src state - * for the usb3 only port is checked again. If it's attached, then make - * sure the OCP notify signal is reset. + * In the case of an OCP event on this port, the usb hub should + * be notified via a GPIO signal. Following, an OCP, the + * attached.src state for the usb3 only port is checked again. + * If it's attached, then make sure the OCP notify signal is + * reset. */ gpio_set_level(GPIO_USB_HUB_OCP_NOTIFY, 1); #endif @@ -436,7 +430,8 @@ static void baseboard_usbc_usb3_handle_interrupt(void) CPRINTS("usb3_ppc: VBUS OC!"); gpio_set_level(GPIO_USB_HUB_OCP_NOTIFY, 0); if (++ppc_ocp_count < 5) - hook_call_deferred(&baseboard_usb3_manage_vbus_data, + hook_call_deferred( + &baseboard_usb3_manage_vbus_data, USB_HUB_OCP_RESET_MSEC); else CPRINTS("usb3_ppc: VBUS OC limit reached!"); @@ -466,7 +461,6 @@ static void baseboard_usbc_usb3_handle_interrupt(void) /* Clear the interrupt sources. */ write_reg(port, SN5S330_INT_TRIP_RISE_REG2, rise); write_reg(port, SN5S330_INT_TRIP_FALL_REG2, fall); - } } DECLARE_DEFERRED(baseboard_usbc_usb3_handle_interrupt);
Make: fix installation instructions The installation instructions as shown after successfully compiling OpenBLAS are wrong because this arguments used during compilation have to be provided to Make again.
@@ -81,8 +81,9 @@ ifeq ($(OSNAME), Darwin) @echo "install_name_tool -id /new/absolute/path/to/$(LIBDYNNAME) $(LIBDYNNAME)" endif @echo - @echo "To install the library, you can run \"make PREFIX=/path/to/your/installation install\"." - @echo + @echo "To install the library, you can run" + @echo " make <ARGS> PREFIX=/path/to/your/installation install" + @echo "where '<ARGS>' is the set of argument used for compilation." shared : ifndef NO_SHARED
testcase/filesystem: Fix fs readdir() tc failure Currently readdir() fs tc assert, checks for not equal to NULL case. But when end of the directory stream is reached,readdir() returns NULL. So tc assert should check for equal to NULL case.
@@ -951,7 +951,7 @@ static void tc_fs_vfs_seekdir(void) seekdir(dir, offset); TC_ASSERT_NEQ_CLEANUP("seekdir", dir, NULL, closedir(dir)); dirent = readdir(dir); - TC_ASSERT_NEQ_CLEANUP("readdir", dirent, NULL, closedir(dir)); + TC_ASSERT_EQ_CLEANUP("readdir", dirent, NULL, closedir(dir)); ret = closedir(dir); TC_ASSERT_EQ("closedir", ret, OK);
py/builtinevex: Allow to pass module object as globals/locals to exec. In this case, its namespace dict is extracted and used. This alleviates need to expose mod.__dict__ or vars(mod) for particular usecase of running code in module context.
@@ -124,10 +124,15 @@ STATIC mp_obj_t eval_exec_helper(size_t n_args, const mp_obj_t *args, mp_parse_i mp_obj_dict_t *locals = mp_locals_get(); for (size_t i = 1; i < 3 && i < n_args; ++i) { if (args[i] != mp_const_none) { - if (!mp_obj_is_type(args[i], &mp_type_dict)) { + mp_obj_t ns = args[i]; + if (mp_obj_is_type(ns, &mp_type_module)) { + ns = MP_OBJ_FROM_PTR(mp_obj_module_get_globals(ns)); + } + + if (!mp_obj_is_type(ns, &mp_type_dict)) { mp_raise_TypeError(NULL); } - locals = MP_OBJ_TO_PTR(args[i]); + locals = MP_OBJ_TO_PTR(ns); if (i == 1) { globals = locals; }
Allow nested containers by parsing their delimiters immediately
?~ los ~&(%unterminated-line [~ +>(err `naz)]) ?. =(`@`10 i.los) ?: (gth col q.naz) - ?. (~(has in ^~((silt " -+>!"))) i.los) + ?. =(' ' i.los) ~&(expected-indent+[col naz los] [~ +>(err `naz)]) $(los t.los, q.naz +(q.naz)) :: ++ abet :: accept line :: :: nap: take first line - =^ nap +>.$ snap - ..$(lub `[naz nap ~]) + ..$(lub `[naz ~]) :: ++ apex ^+ . :: by column offset ?+ dif ~& offset+dif fail :: indent by 2 =. col (add 2 col) :: + :: "parse" marker + =. los (slag (sub col q.naz) los) + =. q.naz col + :: (push typ) :: ++ lent :: list entry
Fix wrong compiler.libcxx setting on MacOS.
@@ -24,7 +24,7 @@ jobs: conan profile update settings.build_type=Release default conan profile update settings.compiler=apple-clang default conan profile update settings.compiler.cppstd=17 default - conan profile update settings.compiler.libcxx=libc++11 default + conan profile update settings.compiler.libcxx=libc++ default conan profile update settings.compiler.version=12.0 default - name: Install Dependencies env:
[CUDA] Add note about selecting multiple GPUs to docs
@@ -44,7 +44,9 @@ Building pocl with CUDA support 4) Configuration ~~~~~~~~~~~~~~~~ - Use ``POCL_DEVICES=CUDA`` to select only CUDA devices. + Use ``POCL_DEVICES=CUDA`` to select only CUDA devices. If the system has more + than one GPU, specify the ``CUDA`` device multiple times (e.g. + ``POCL_DEVICES=CUDA,CUDA`` for two GPUs). The CUDA backend currently has a runtime dependency on the CUDA toolkit. If you receive errors regarding a failure to load ``libdevice``, you may need
Add support for Duty 2 note preview
@@ -19,6 +19,10 @@ import { NR43, NR44, AUD3_WAVE_RAM, + NR21, + NR22, + NR23, + NR24, } from "./music_constants"; let update_handle = null; @@ -137,6 +141,7 @@ const preview = (note, type, instrument, square2) => { switch (type) { case "duty": + if (!square2) { const regs = { NR10: "0" + @@ -181,6 +186,45 @@ const preview = (note, type, instrument, square2) => { emulator.writeMem(NR12, parseInt(regs.NR12, 2)); emulator.writeMem(NR13, parseInt(regs.NR13, 2)); emulator.writeMem(NR14, parseInt(regs.NR14, 2)); + } else { + const regs = { + NR21: + bitpack(instrument.duty_cycle, 2) + + bitpack( + instrument.length !== null && instrument.length !== 0 + ? 64 - instrument.length + : 0, + 6 + ), + NR22: + bitpack(instrument.initial_volume, 4) + + (instrument.volume_sweep_change > 0 ? 1 : 0) + + bitpack( + instrument.volume_sweep_change !== 0 + ? 8 - Math.abs(instrument.volume_sweep_change) + : 0, + 3 + ), + NR23: bitpack(noteFreq & 0b11111111, 8), + NR24: + "1" + // Initial + (instrument.length !== null ? 1 : 0) + + "000" + + bitpack((noteFreq & 0b0000011100000000) >> 8, 3), + }; + + console.log("-------------"); + console.log(`NR21`, regs.NR21, parseInt(regs.NR21, 2)); + console.log(`NR22`, regs.NR22, parseInt(regs.NR22, 2)); + console.log(`NR23`, regs.NR23, parseInt(regs.NR23, 2)); + console.log(`NR24`, regs.NR24, parseInt(regs.NR24, 2)); + console.log("============="); + + emulator.writeMem(NR21, parseInt(regs.NR21, 2)); + emulator.writeMem(NR22, parseInt(regs.NR22, 2)); + emulator.writeMem(NR23, parseInt(regs.NR23, 2)); + emulator.writeMem(NR24, parseInt(regs.NR24, 2)); + } break; case "wave": // Copy Wave Form
VERSION bump to version 2.0.63
@@ -58,7 +58,7 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) # set version of the project set(LIBYANG_MAJOR_VERSION 2) set(LIBYANG_MINOR_VERSION 0) -set(LIBYANG_MICRO_VERSION 62) +set(LIBYANG_MICRO_VERSION 63) set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_MICRO_VERSION}) # set version of the library set(LIBYANG_MAJOR_SOVERSION 2)
fix missed ;
@@ -289,7 +289,7 @@ namespace NCatboostCuda { trainDirPath.MkDir(); } } catch (...) { - ythrow TCatboostException() << "Can't create working dir: " << path + ythrow TCatboostException() << "Can't create working dir: " << path; } }
vlib: fix out of memory issue 'show node foo' causes infinite loop resulting in out of memory. This patch fixes the issue by breaking the loop on invalid input. Ticket: Type: fix Fixes:
@@ -562,6 +562,9 @@ show_node (vlib_main_t * vm, unformat_input_t * input, else error = clib_error_return (0, "unknown input '%U'", format_unformat_error, line_input); + + if (error) + break; } unformat_free (line_input);