message
stringlengths
6
474
diff
stringlengths
8
5.22k
show command for lookup DPOs
@@ -1482,6 +1482,46 @@ const static char* const * const lookup_dst_from_interface_nodes[DPO_PROTO_NUM] [DPO_PROTO_MPLS] = lookup_dst_from_interface_mpls_nodes, }; +static clib_error_t * +lookup_dpo_show (vlib_main_t * vm, + unformat_input_t * input, + vlib_cli_command_t * cmd) +{ + index_t lkdi = INDEX_INVALID; + + while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) + { + if (unformat (input, "%d", &lkdi)) + ; + else + break; + } + + if (INDEX_INVALID != lkdi) + { + vlib_cli_output (vm, "%U", format_lookup_dpo, lkdi); + } + else + { + lookup_dpo_t *lkd; + + pool_foreach(lkd, lookup_dpo_pool, + ({ + vlib_cli_output (vm, "[@%d] %U", + lookup_dpo_get_index(lkd), + format_lookup_dpo, + lookup_dpo_get_index(lkd)); + })); + } + + return 0; +} + +VLIB_CLI_COMMAND (replicate_show_command, static) = { + .path = "show lookup-dpo", + .short_help = "show lookup-dpo [<index>]", + .function = lookup_dpo_show, +}; void lookup_dpo_module_init (void)
Increment version to 4.6.8.
#define MOD_WSGI_MAJORVERSION_NUMBER 4 #define MOD_WSGI_MINORVERSION_NUMBER 6 -#define MOD_WSGI_MICROVERSION_NUMBER 7 -#define MOD_WSGI_VERSION_STRING "4.6.7" +#define MOD_WSGI_MICROVERSION_NUMBER 8 +#define MOD_WSGI_VERSION_STRING "4.6.8" /* ------------------------------------------------------------------------- */
Fix -v to work (amended 13146a8e3b2c3f6a907e83c7541e05c5676439da)
@@ -710,7 +710,10 @@ def handle_quic_event(cpu, data, size): if allowed_quic_event and ev.type != allowed_quic_event: return - if allowed_res_header_name and ev.type == "send_response_header" and ev.h2o_header_name != allowed_res_header_name: + if ev.type == "send_response_header": # HTTP-level events + if not verbose: + return + if allowed_res_header_name and ev.h2o_header_name != allowed_res_header_name: return res = OrderedDict() @@ -820,7 +823,6 @@ try: verbose = True elif opt == "-s": # reSponse allowed_res_header_name = arg.lower() - except getopt.error as msg: print(msg) sys.exit(2)
Add meta key 'command/key' to METADATA.ini
@@ -371,6 +371,15 @@ description= "introduces a sub-command must be specified on a key in the 'spec' namespace" +[command/key] +type= string +status= implemented +usedby/plugin= gopts +usedby/api= elektraGetOpts kdbopts.h +description= "specifies which (sub-)command a key in the + + 'spec' namespace belongs to" + [opt] type= char status= implemented
Readme: Add test coverage badge.
@@ -2,6 +2,8 @@ Linux: [![Linux Build](https://travis-ci.org/FascinatedBox/lily.svg?branch=maste Windows: [![Windows Build](https://ci.appveyor.com/api/projects/status/github/FascinatedBox/lily?svg=true)](https://ci.appveyor.com/project/FascinatedBox/lily) +Test Coverage: [![codecov](https://codecov.io/gh/FascinatedBox/lily/branch/master/graph/badge.svg)](https://codecov.io/gh/FascinatedBox/lily) + ## Lily Lily is a programming language focused on expressiveness and type safety.
Check for a null net pointer in extractPayload.
@@ -862,7 +862,7 @@ extractPayload(int sockfd, net_info *net, void *buf, size_t len, metric_t src, s } memmove(pinfo->data, buf, len); - memmove(&pinfo->net, net, sizeof(net_info)); + if (net) memmove(&pinfo->net, net, sizeof(net_info)); pinfo->evtype = EVT_PAYLOAD; pinfo->src = src;
Add handshake over test
@@ -248,6 +248,14 @@ Negative test moving servers ssl to state: NEW_SESSION_TICKET depends_on:MBEDTLS_SSL_PROTO_TLS1_2:!MBEDTLS_SSL_PROTO_TLS1_3 move_handshake_to_state:MBEDTLS_SSL_IS_SERVER:MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET:0 +TLSv1.3:Test moving clients handshake to state: HANDSHAKE_OVER +depends_on:MBEDTLS_SSL_PROTO_TLS1_3:!MBEDTLS_SSL_PROTO_TLS1_2 +move_handshake_to_state:MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_HANDSHAKE_OVER:1 + +TLSv1.3:Test moving servers handshake to state: HANDSHAKE_OVER +depends_on:MBEDTLS_SSL_PROTO_TLS1_3:!MBEDTLS_SSL_PROTO_TLS1_2 +move_handshake_to_state:MBEDTLS_SSL_IS_SERVER:MBEDTLS_SSL_HANDSHAKE_OVER:1 + TLSv1.3:Test moving clients handshake to state: HELLO_REQUEST depends_on:MBEDTLS_SSL_PROTO_TLS1_3:!MBEDTLS_SSL_PROTO_TLS1_2 move_handshake_to_state:MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_HELLO_REQUEST:1 @@ -286,7 +294,7 @@ move_handshake_to_state:MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_CERTIFICATE_REQUEST:1 TLSv1.3:Test moving servers handshake to state: CERTIFICATE_REQUEST depends_on:MBEDTLS_SSL_PROTO_TLS1_3:!MBEDTLS_SSL_PROTO_TLS1_2 -move_handshake_to_state:MBEDTLS_SSL_IS_SERVER:MBEDTLS_SSL_CERTIFICATE_REQUEST:0 +move_handshake_to_state:MBEDTLS_SSL_IS_SERVER:MBEDTLS_SSL_CERTIFICATE_REQUEST:1 TLSv1.3:Test moving clients handshake to state: SERVER_CERTIFICATE depends_on:MBEDTLS_SSL_PROTO_TLS1_3:!MBEDTLS_SSL_PROTO_TLS1_2
Change position of module instance check
@@ -26,6 +26,11 @@ static HANDLE s_modInstanceMutex = nullptr; static void Initialize(HMODULE mod) { + + s_modInstanceMutex = CreateMutex(NULL, TRUE, _T("Cyber Engine Tweaks Module Instance")); + if (s_modInstanceMutex == nullptr) + return; + MH_Initialize(); Options::Initialize(mod); @@ -41,10 +46,6 @@ static void Initialize(HMODULE mod) return; } - s_modInstanceMutex = CreateMutex(NULL, TRUE, _T("Cyber Engine Tweaks Module Instance")); - if (s_modInstanceMutex == nullptr) - return; - if (options.PatchEnableDebug) EnableDebugPatch(&options.GameImage);
This patch has been applied to the master branch of rocminfo already.
@@ -101,11 +101,6 @@ if [ "$1" == "install" ] ; then fi if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then - - patchfile=$thisdir/patches/rocminfo_cmake.patch - patchdir=$RINFO_REPO_DIR - patchrepo - if [ -d "$BUILD_DIR/build/rocminfo" ] ; then echo echo "FRESH START , CLEANING UP FROM PREVIOUS BUILD"
Update: Fix of the metrics script
@@ -88,6 +88,8 @@ def Test(Example, outputString): print("Failure for " + line + " in "+ Example) exit(0) else: + QuestionsAnswered += 1.0 + QuestionsAnsweredGlobal += 1.0 break if AnswerRatioTest: if QuestionsTotal > 0:
Temporarily enable rate limiting in verify server
@@ -2316,8 +2316,18 @@ server_reload(struct nsd *nsd, region_type* server_region, netio_type* netio, #endif if(nsd->options->verify_enable) { +#ifdef RATELIMIT + /* allocate resources for rate limiting. use a slot that is guaranteed + not mapped to a file so no persistent data is overwritten */ + rrl_init(nsd->child_count + 1); +#endif + /* spin-up server and execute verifiers for each zone */ server_verify(nsd, cmdsocket); +#ifdef RATELIMIT + /* deallocate rate limiting resources */ + rrl_deinit(nsd->child_count + 1); +#endif } for(node = radix_first(nsd->db->zonetree);
Added missing cancel_job handler.
*/ #include <cupsfilters/filter.h> +#include <signal.h> /* * Local globals... static int JobCanceled = 0;/* Set to 1 on SIGTERM */ + +/* + * Local functions... + */ + +static void cancel_job(int sig); + + /* * 'main()' - Main entry and processing of driver. */ @@ -41,6 +50,25 @@ main(int argc, /* I - Number of command-line arguments */ char *argv[]) /* I - Command-line arguments */ { int ret; +#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) + struct sigaction action; /* Actions for POSIX signals */ +#endif /* HAVE_SIGACTION && !HAVE_SIGSET */ + + /* + * Register a signal handler to cleanly cancel a job. + */ + +#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */ + sigset(SIGTERM, cancel_job); +#elif defined(HAVE_SIGACTION) + memset(&action, 0, sizeof(action)); + + sigemptyset(&action.sa_mask); + action.sa_handler = cancel_job; + sigaction(SIGTERM, &action, NULL); +#else + signal(SIGTERM, cancel_job); +#endif /* HAVE_SIGSET */ /* * Fire up the rastertops() filter function @@ -53,3 +81,17 @@ main(int argc, /* I - Number of command-line arguments */ return (ret); } + + +/* + * 'cancel_job()' - Flag the job as canceled. + */ + +static void +cancel_job(int sig) /* I - Signal number (unused) */ +{ + (void)sig; + + JobCanceled = 1; +} +
media : add missing function for getstate only a function definition, and no implementation added
@@ -80,6 +80,11 @@ void MediaRecorder::setObserver(std::shared_ptr<MediaRecorderObserverInterface> mPMrImpl->setObserver(observer); } +recorder_state_t MediaRecorder::getState() +{ + return mPMrImpl->getState(); +} + MediaRecorder::~MediaRecorder() { }
stm32/machine_uart: Retain attached-to-repl setting when init'ing UART.
@@ -283,11 +283,17 @@ STATIC mp_obj_t pyb_uart_init_helper(pyb_uart_obj_t *self, size_t n_args, const // flow control uint32_t flow = args.flow.u_int; + // Save attach_to_repl setting because uart_init will disable it. + bool attach_to_repl = self->attached_to_repl; + // init UART (if it fails, it's because the port doesn't exist) if (!uart_init(self, baudrate, bits, parity, stop, flow)) { mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("UART(%d) doesn't exist"), self->uart_id); } + // Restore attach_to_repl setting so UART still works if attached to dupterm. + uart_attach_to_repl(self, attach_to_repl); + // set timeout self->timeout = args.timeout.u_int;
Updater: Improve filename cache
@@ -486,13 +486,18 @@ static PPH_STRING UpdaterParseDownloadFileName( _In_ PPH_STRING DownloadUrlPath ) { + static PH_STRINGREF seperator = PH_STRINGREF_INIT(L"="); // download= PH_STRINGREF pathPart; PH_STRINGREF baseNamePart; PPH_STRING filePath; PPH_STRING downloadFileName; - if (!PhSplitStringRefAtLastChar(&DownloadUrlPath->sr, '/', &pathPart, &baseNamePart)) - return NULL; + if (PhSplitStringRefAtLastChar(&DownloadUrlPath->sr, L'/', &pathPart, &baseNamePart)) + { + if (PhFindStringInStringRef(&DownloadUrlPath->sr, &seperator, TRUE) != -1) + { + PhSplitStringRefAtString(&DownloadUrlPath->sr, &seperator, TRUE, &pathPart, &baseNamePart); + } downloadFileName = PhCreateString2(&baseNamePart); filePath = PhCreateCacheFile(downloadFileName); @@ -501,6 +506,9 @@ static PPH_STRING UpdaterParseDownloadFileName( return filePath; } + return NULL; +} + NTSTATUS UpdateDownloadThread( _In_ PVOID Parameter )
possible fix for memory instability on Win7
@@ -212,9 +212,11 @@ static void* mi_win_virtual_allocx(void* addr, size_t size, size_t try_alignment void* p = VirtualAlloc(hint, size, flags, PAGE_READWRITE); if (p != NULL) return p; DWORD err = GetLastError(); - if (err != ERROR_INVALID_ADDRESS) { // if linked with multiple instances, we may have tried to allocate at an already allocated area + if (err != ERROR_INVALID_ADDRESS && // If linked with multiple instances, we may have tried to allocate at an already allocated area (#210) + err != ERROR_INVALID_PARAMETER) { // Windows7 instability (#230) return NULL; } + // fall through } #endif #if defined(MEM_EXTENDED_PARAMETER_TYPE_BITS) @@ -228,6 +230,7 @@ static void* mi_win_virtual_allocx(void* addr, size_t size, size_t try_alignment return (*pVirtualAlloc2)(GetCurrentProcess(), addr, size, flags, PAGE_READWRITE, &param, 1); } #endif + // last resort return VirtualAlloc(addr, size, flags, PAGE_READWRITE); }
Requested changes, part 2
@@ -135,6 +135,11 @@ void DeRestPluginPrivate::handleTuyaClusterIndication(const deCONZ::ApsDataIndic QDataStream stream(zclFrame.payload()); stream.setByteOrder(QDataStream::LittleEndian); + // "dp" field describes the action/message of a command frame and was composed by a type and an identifier + // "transid" is just a "counter", a response will have the same transif than the command. + // "Status" and "fn" are always 0 + // More explanations at top of file + quint8 status; quint8 transid; quint16 dp; @@ -188,7 +193,7 @@ void DeRestPluginPrivate::handleTuyaClusterIndication(const deCONZ::ApsDataIndic // Sunday = W001 // All days = W127 - QString transitions = QString(""); + QString transitions; length = length / 3;
MSR: Only enable test if plugin is included
@@ -8,16 +8,24 @@ function (add_s_test NAME FILE) set_property(TEST testshell_markdown_${NAME} PROPERTY LABELS memleak kdbtests) endfunction () -add_s_test (enum "${CMAKE_SOURCE_DIR}/src/plugins/enum/README.md") -add_s_test (blockresolver "${CMAKE_SOURCE_DIR}/src/plugins/blockresolver/README.md") -add_s_test (conditionals "${CMAKE_SOURCE_DIR}/src/plugins/conditionals/README.md") -add_s_test (hosts "${CMAKE_SOURCE_DIR}/src/plugins/hosts/README.md") -add_s_test (line "${CMAKE_SOURCE_DIR}/src/plugins/line/README.md") -add_s_test (mathcheck "${CMAKE_SOURCE_DIR}/src/plugins/mathcheck/README.md") -add_s_test (mozpref "${CMAKE_SOURCE_DIR}/src/plugins/mozprefs/README.md") +function (add_plugin_shell_test PLUGIN) + list (FIND REMOVED_PLUGINS ${PLUGIN} INDEX) + if (${INDEX} EQUAL -1) + add_s_test (${PLUGIN} "${CMAKE_SOURCE_DIR}/src/plugins/${PLUGIN}/README.md") + endif () +endfunction () + add_s_test (tutorial_cascading "${CMAKE_SOURCE_DIR}/doc/tutorials/cascading.md") add_s_test (kdb-complete "${CMAKE_SOURCE_DIR}/doc/help/kdb-complete.md") -add_s_test (xerces "${CMAKE_SOURCE_DIR}/src/plugins/xerces/README.md") + +add_plugin_shell_test (blockresolver) +add_plugin_shell_test (conditionals) +add_plugin_shell_test (enum) +add_plugin_shell_test (hosts) +add_plugin_shell_test (line) +add_plugin_shell_test (mathcheck) +add_plugin_shell_test (mozprefs) +add_plugin_shell_test (xerces) # Only works with super user privileges, since it writes to `/etc/hosts`: # add_s_test (tutorial_mount "${CMAKE_SOURCE_DIR}/doc/tutorials/mount.md")
fix loss of data warnings with vc15 win64 and /W4
@@ -655,7 +655,7 @@ unicode_byte_type(char hi, char lo) { return XML_CONVERT_INPUT_INCOMPLETE; \ } \ plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \ - *(*toP)++ = ((plane >> 2) | UTF8_cval4); \ + *(*toP)++ = (char)((plane >> 2) | UTF8_cval4); \ *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \ from += 2; \ lo2 = GET_LO(from); \
luax_readmesh assert for index range;
@@ -430,7 +430,9 @@ int luax_readmesh(lua_State* L, int index, float** vertices, uint32_t* vertexCou for (uint32_t i = 0; i < *indexCount; i++) { lua_rawgeti(L, index + 1, i + 1); - (*indices)[i] = luaL_checkinteger(L, -1) - 1; + uint32_t index = luaL_checkinteger(L, -1) - 1; + lovrAssert(index < *vertexCount, "Invalid vertex index %d (expected [%d, %d])", 1, *vertexCount); + (*indices)[i] = index; lua_pop(L, 1); }
fixed punctuation in heading
-# SDK & CARTO Tools +# SDK and CARTO Tools For select account plans, you can connect to the CARTO Engine APIs via Mobile SDK, to retrieve map visualizations and table data from your CARTO account. _API access is not available for free users._ [Contact us](mailto:[email protected]) for questions about your account plan and enabling this feature.
static-code-checking: add instructions for cppcheck, scan-build and SonarLint to TESTING.md
@@ -194,6 +194,57 @@ See also build server jobs: For bounded model checking tests, see `scripts/cbmc`. +### Static Code Checkers + +There is a number of static code checkers available for all kind of programming languages. The +following section show how the most common ones can be used with libelektra. + +#### cppcheck + +[cppcheck](http://cppcheck.sourceforge.net/) can be used directly on a C or C++ source +file by calling it with `cppcheck --enable=all <sourcefile>`. This way it might miss some header +files though and thus doesn't detect all possible issues, but still gives useful hints in general. + +To analyze the whole project, use it in conjunction with cmake by calling cmake with the parameter +`-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`. This way cmake creates a file called `compile_commands.json` in +the build directory. Afterwards, call cppcheck with the cmake settings and store the output as xml: + + cppcheck --project=compile_commands.json --enable=all -j 8 --xml-version=2 2> cppcheck_result.xml + +Since the XML file is difficult to read directly, the best way is to convert it to an html report. +cppcheck already includes a tool for that, call it with the xml report: + + cppcheck-htmlreport --file=cppcheck_result.xml --report-dir=cppcheck_report --source-dir=. + +Now you can view the html report by opening `index.html` in the specified foder to get an overview +of the issues found in the whole project. + +#### scan-build + +[scan-build](http://clang-analyzer.llvm.org/scan-build.html) is a tool that is usually bundled along +with LLVM/clang and is also primarily intended for C and C++ code. On macOS you have to install the +package `llvm` with homebrew, then you'll find the tool in the folder `/usr/local/opt/llvm/bin/`. + +To use it, prefix the compilation make command with `scan-build` in the build folder and specify an +output folder for the results: + + scan-build -o ./scanbuild_result make + +Afterwards, the report can be viewed by using the tool `scan-view`, also found in the llvm folder. +The report is created in the folder specified above, along with the current date of the analyzation, +for instance: + + scan-view <path specified above>/2017-06-18-171027-27108-1 + +Alternatively, you can also open the `index.html` file in the aforementioned folder, but using the tool +the report is enriched with further information. + +#### SonarLint + +[SonarLint](http://www.sonarlint.org/) is a static code checker primarily intended for Java. It is +usually used by installing the corresponding plugin for the used IDE, then there is no further +configuration required. + ### Code Coverage Run:
doc: PORTING: drop flash_area_read_is_empty() Update PORTING guide dropping `flash_area_read_is_empty`.
@@ -119,11 +119,6 @@ int flash_area_erase(const struct flash_area *, uint32_t off, uint32_t len); uint8_t flash_area_align(const struct flash_area *); /*< What is value is read from erased flash bytes. */ uint8_t flash_area_erased_val(const struct flash_area *); -/*< Reads len bytes from off, and checks if the read data is erased. Returns - 1 if empty (that is containing erased value), 0 if not-empty, and -1 on - failure. */ -int flash_area_read_is_empty(const struct flash_area *fa, uint32_t off, - void *dst, uint32_t len); /*< Given flash area ID, return info about sectors within the area. */ int flash_area_get_sectors(int fa_id, uint32_t *count, struct flash_sector *sectors);
Update orca to new version v3.47.0
@@ -13,12 +13,12 @@ function make_sync_tools() { popd case "${TARGET_OS}" in centos|ubuntu) - wget -q -O - https://github.com/greenplum-db/gporca/archive/v3.45.0.tar.gz | tar zxf - -C ${GPDB_SRC_PATH}/gpAux/ext/${BLD_ARCH} + wget -q -O - https://github.com/greenplum-db/gporca/archive/v3.47.0.tar.gz | tar zxf - -C ${GPDB_SRC_PATH}/gpAux/ext/${BLD_ARCH} mkdir -p orca_src mv ${GPDB_SRC_PATH}/gpAux/ext/${BLD_ARCH}/gporca*/* orca_src/ ;; sles) - wget -q -O - https://github.com/greenplum-db/gporca/releases/download/v3.45.0/bin_orca_centos5_release.tar.gz | tar zxf - -C ${GPDB_SRC_PATH}/gpAux/ext/${BLD_ARCH} + wget -q -O - https://github.com/greenplum-db/gporca/releases/download/v3.47.0/bin_orca_centos5_release.tar.gz | tar zxf - -C ${GPDB_SRC_PATH}/gpAux/ext/${BLD_ARCH} ;; esac }
release: do not cleanup workspaces
@@ -617,7 +617,7 @@ def buildRelease(stageName, image, packageRevision='1', bundleRepo=false, placeholderDir=false) { return [(stageName): { stage(stageName) { - withDockerEnv(image, [DockerOpts.MOUNT_MIRROR, DockerOpts.NO_CHECKOUT]) { + withDockerEnv(image, [DockerOpts.MOUNT_MIRROR, DockerOpts.NO_CHECKOUT, DockerOpts.NO_CLEANUP]) { withCredentials([file(credentialsId: 'jenkins-key', variable: 'KEY'), file(credentialsId: 'jenkins-secret-key', variable: 'SKEY')]) { sh "gpg --import $KEY" @@ -686,7 +686,7 @@ def buildRelease(stageName, image, packageRevision='1', def testInstalledPackage(stageName, image) { return [(stageName): { stage(stageName) { - withDockerEnv(image, [DockerOpts.MOUNT_MIRROR]) { + withDockerEnv(image, [DockerOpts.MOUNT_MIRROR, DockerOpts.NO_CLEANUP]) { checkout scm sh "./scripts/release/release-tests.sh ./ ${RELEASE_VERSION} package OFF" @@ -714,7 +714,7 @@ def publish(correspondingReleaseStageName, context, repoName, repoPrefix, publishPackagesFun, packageRevision) { return [(correspondingReleaseStageName): { stage(correspondingReleaseStageName) { - withDockerEnv(DOCKER_IMAGES.buster) { + withDockerEnv(DOCKER_IMAGES.buster, [DockerOpts.NO_CLEANUP]) { copyReleaseArtifact(correspondingReleaseStageName) dir('copy') { deleteDir() @@ -743,7 +743,7 @@ def publishSource(artifactStageName) { def stageName = 'publishSourcePackage' return [(stageName): { stage(stageName) { - withDockerEnv(DOCKER_IMAGES.buster) { + withDockerEnv(DOCKER_IMAGES.buster, [DockerOpts.NO_CLEANUP]) { configureGitUser() copyReleaseArtifact(artifactStageName) dir('ftp') { @@ -797,7 +797,7 @@ def publishMainRepo(artifactStageName) { def stageName = 'publishMainRepo' return [(stageName): { stage(stageName) { - withDockerEnv(DOCKER_IMAGES.buster) { + withDockerEnv(DOCKER_IMAGES.buster, [DockerOpts.NO_CLEANUP]) { configureGitUser() copyArtifacts( filter: "artifacts/${artifactStageName}/libelektra.bundle", @@ -833,7 +833,7 @@ def buildDoc() { ] return [(stageName): { stage(stageName) { - withDockerEnv(DOCKER_IMAGES.sid_doc) { + withDockerEnv(DOCKER_IMAGES.sid_doc, [DockerOpts.NO_CLEANUP]) { configureGitUser() dir('build') { @@ -920,7 +920,7 @@ def buildAndPublishMaven() { def stageName = 'publishMavenArtifacts' return [(stageName): { stage(stageName) { - withDockerEnv(DOCKER_IMAGES.focal) { + withDockerEnv(DOCKER_IMAGES.focal, [DockerOpts.NO_CLEANUP]) { withCredentials([file(credentialsId: 'maven-signing-key', variable: 'KEY'), string(credentialsId: 'maven-signing-passphrase', variable: 'PASS'), usernamePassword(credentialsId: 'sonatype-credentials', passwordVariable: 'SONATYPE_PASSWORD', usernameVariable: 'SONATYPE_USERNAME')]) {
ur: fixes a buffer over-write in ur_bsr_bytes_any()
@@ -369,14 +369,18 @@ ur_bsr_bytes_any(ur_bsr_t *bsr, uint64_t len, uint8_t *out) // become the least-significant bits of an output byte, and vice-versa // else { - uint64_t need = len_byt + (len_bit >> 3) + !!ur_mask_3(len_bit); - ur_bool_t end = need >= left; - uint64_t max = end ? (left - 1) : len_byt; uint8_t rest = 8 - off; uint8_t mask = (1 << off) - 1; uint8_t byt = b[0]; uint8_t l, m = byt >> off; - uint64_t i; + ur_bool_t end; + uint64_t i, max; + + { + uint64_t need = len_byt + !!len_bit; + end = need >= left; + max = end ? (left - 1) : len_byt; + } for ( i = 0; i < max; i++ ) { byt = b[1ULL + i]; @@ -407,6 +411,7 @@ ur_bsr_bytes_any(ur_bsr_t *bsr, uint64_t len, uint8_t *out) left -= step; off = ur_mask_3(bits); + if ( len_bit ) { if ( len_bit <= rest ) { out[max] = m & ((1 << len_bit) - 1); } @@ -416,6 +421,7 @@ ur_bsr_bytes_any(ur_bsr_t *bsr, uint64_t len, uint8_t *out) } } } + } bsr->off = off; bsr->left = left;
Benchmarks: Fix minor spelling mistake
@@ -8,7 +8,7 @@ go to a specific commit of Elektra. Then you can run a benchmark. Afterwards you commit all information you have collected. -This has the advantage that it is reproduceable. +This has the advantage that it is reproducible. Everyone can go anytime back to the benchmark commits and run the same benchmarks again.
components/unity: reverted the inclusion of test protect based on setjmp
* uncomment this line. Remote tests on CI * still working as expected */ -//#define UNITY_EXCLUDE_SETJMP_H +#define UNITY_EXCLUDE_SETJMP_H void unity_flush(void); void unity_putc(int c);
Test top-bit-set character mimicking surrogate high is rejected
@@ -5297,7 +5297,8 @@ MiscEncodingHandler(void *data, if (!strcmp(encoding, "invalid-9") || !strcmp(encoding, "ascii-like") || !strcmp(encoding, "invalid-len") || - !strcmp(encoding, "invalid-a")) + !strcmp(encoding, "invalid-a") || + !strcmp(encoding, "invalid-surrogate")) high_map = -1; for (i = 0; i < 128; ++i) @@ -5314,6 +5315,11 @@ MiscEncodingHandler(void *data, /* If required, make a top-bit set character a valid ASCII character */ if (!strcmp(encoding, "invalid-a")) info->map[0x82] = 'a'; + /* If required, give a top-bit set character a forbidden value, + * what would otherwise be the first of a surrogate pair. + */ + if (!strcmp(encoding, "invalid-surrogate")) + info->map[0x83] = 0xd801; info->data = data; info->release = NULL; @@ -5507,6 +5513,18 @@ START_TEST(test_unknown_encoding_invalid_topbit) } END_TEST +START_TEST(test_unknown_encoding_invalid_surrogate) +{ + const char *text = + "<?xml version='1.0' encoding='invalid-surrogate'?>\n" + "<doc>Hello, \x82 world</doc>"; + + XML_SetUnknownEncodingHandler(parser, MiscEncodingHandler, NULL); + expect_failure(text, XML_ERROR_INVALID_TOKEN, + "Invalid unknown encoding not faulted"); +} +END_TEST + /* * Namespaces tests. @@ -10776,6 +10794,7 @@ make_suite(void) tcase_add_test(tc_basic, test_unknown_ascii_encoding_fail); tcase_add_test(tc_basic, test_unknown_encoding_invalid_length); tcase_add_test(tc_basic, test_unknown_encoding_invalid_topbit); + tcase_add_test(tc_basic, test_unknown_encoding_invalid_surrogate); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace,
Disable redux logger middleware on production build
@@ -8,17 +8,22 @@ import loggerMiddleware from "../middleware/logger"; const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; -export default function configureStore() { - return createStore( - rootReducer, - composeEnhancers( - applyMiddleware( +const DEBUG = false; + +let middleware = [ thunk, electronMiddleware, buildGameMiddleware, - musicMiddleware, - loggerMiddleware - ) - ) + musicMiddleware +]; + +if (process.env.NODE_ENV !== "production" && DEBUG) { + middleware = [...middleware, loggerMiddleware]; +} + +export default function configureStore() { + return createStore( + rootReducer, + composeEnhancers(applyMiddleware(...middleware)) ); }
dhcp: Fix DHCP option Client-identifier
/* Offsets into the transmitted DHCP options fields at which various parameters are located. */ -#define dhcpCLIENT_IDENTIFIER_OFFSET ( 5 ) -#define dhcpREQUESTED_IP_ADDRESS_OFFSET ( 13 ) -#define dhcpDHCP_SERVER_IP_ADDRESS_OFFSET ( 19 ) +#define dhcpCLIENT_IDENTIFIER_OFFSET ( 6 ) +#define dhcpREQUESTED_IP_ADDRESS_OFFSET ( 14 ) +#define dhcpDHCP_SERVER_IP_ADDRESS_OFFSET ( 20 ) /* Values used in the DHCP packets. */ #define dhcpREQUEST_OPCODE ( 1 ) @@ -905,7 +905,7 @@ static const uint8_t ucDHCPRequestOptions[] = dhcpCLIENT_IDENTIFIER_OFFSET, dhcpREQUESTED_IP_ADDRESS_OFFSET and dhcpDHCP_SERVER_IP_ADDRESS_OFFSET. */ dhcpMESSAGE_TYPE_OPTION_CODE, 1, dhcpMESSAGE_TYPE_REQUEST, /* Message type option. */ - dhcpCLIENT_IDENTIFIER_OPTION_CODE, 6, 0, 0, 0, 0, 0, 0, /* Client identifier. */ + dhcpCLIENT_IDENTIFIER_OPTION_CODE, 7, 1, 0, 0, 0, 0, 0, 0, /* Client identifier. */ dhcpREQUEST_IP_ADDRESS_OPTION_CODE, 4, 0, 0, 0, 0, /* The IP address being requested. */ dhcpSERVER_IP_ADDRESS_OPTION_CODE, 4, 0, 0, 0, 0, /* The IP address of the DHCP server. */ dhcpOPTION_END_BYTE @@ -943,7 +943,7 @@ static const uint8_t ucDHCPDiscoverOptions[] = { /* Do not change the ordering without also changing dhcpCLIENT_IDENTIFIER_OFFSET. */ dhcpMESSAGE_TYPE_OPTION_CODE, 1, dhcpMESSAGE_TYPE_DISCOVER, /* Message type option. */ - dhcpCLIENT_IDENTIFIER_OPTION_CODE, 6, 0, 0, 0, 0, 0, 0, /* Client identifier. */ + dhcpCLIENT_IDENTIFIER_OPTION_CODE, 7, 1, 0, 0, 0, 0, 0, 0, /* Client identifier. */ dhcpPARAMETER_REQUEST_OPTION_CODE, 3, dhcpSUBNET_MASK_OPTION_CODE, dhcpGATEWAY_OPTION_CODE, dhcpDNS_SERVER_OPTIONS_CODE, /* Parameter request option. */ dhcpOPTION_END_BYTE };
Update github workflow for Windows Virtual environment windows-latest now defaults to windows-2022. Update workflows to work with this new environment.
@@ -20,7 +20,7 @@ jobs: name: "Windows Latest MSVC", artifact: "Windows-MSVC.tar.xz", os: windows-latest, build_type: "Release", cc: "cl", cxx: "cl", - environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat" + environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" } #- { # name: "Windows Latest MinGW", artifact: "Windows-MinGW.tar.xz", @@ -91,10 +91,15 @@ jobs: set(ENV{CXX} ${{ matrix.config.cxx }}) if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") + message(STATUS "Set Windows environment") execute_process( COMMAND "${{ matrix.config.environment_script }}" && set OUTPUT_FILE environment_script_output.txt + RESULT_VARIABLE result ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "Bad exit status") + endif() file(STRINGS environment_script_output.txt output_lines) foreach(line IN LISTS output_lines) if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$") @@ -105,6 +110,7 @@ jobs: file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/ninja" ninja_program) + message(STATUS "Create Ninja build system") execute_process( COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/cmake -S .
swaymsg.1: fix description of --pretty
@@ -20,7 +20,7 @@ _swaymsg_ [options...] [message] swaymsg will stop monitoring and exit. *-p, --pretty* - Use raw output even when not using a tty. + Use pretty output even when not using a tty. *-q, --quiet* Sends the IPC message but does not print the response from sway.
OcCryptoLib: Sha2. Fix build errors Fix negative shift count in ROT macros. Fix field name mismatch in context sha512 struct. Fix input var name mismatch in Sha512 procedure: Digest->Hash
@@ -62,9 +62,9 @@ do { \ } while (0) -#define SHFR(x, n) (x >> n) -#define ROTLEFT(a, b) (((a) << (b)) | ((a) >> (32-(b)))) -#define ROTRIGHT(a, b) (((a) >> (b)) | ((a) << (32-(b)))) +#define SHFR(a, b) (a >> b) +#define ROTLEFT(a, b) ((a << b) | (a >> ((sizeof(a) << 3) - b))) +#define ROTRIGHT(a, b) ((a >> b) | (a << ((sizeof(a) << 3) - b))) #define CH(x, y, z) (((x) & (y)) ^ (~(x) & (z))) #define MAJ(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) @@ -73,8 +73,8 @@ do { \ // #define SHA256_EP0(x) (ROTRIGHT(x, 2) ^ ROTRIGHT(x, 13) ^ ROTRIGHT(x, 22)) #define SHA256_EP1(x) (ROTRIGHT(x, 6) ^ ROTRIGHT(x, 11) ^ ROTRIGHT(x, 25)) -#define SHA256_SIG0(x) (ROTRIGHT(x, 7) ^ ROTRIGHT(x, 18) ^ ((x) >> 3)) -#define SHA256_SIG1(x) (ROTRIGHT(x, 17) ^ ROTRIGHT(x, 19) ^ ((x) >> 10)) +#define SHA256_SIG0(x) (ROTRIGHT(x, 7) ^ ROTRIGHT(x, 18) ^ SHFR(x, 3)) +#define SHA256_SIG1(x) (ROTRIGHT(x, 17) ^ ROTRIGHT(x, 19) ^ SHFR(x, 10)) // // Sha 512 @@ -429,13 +429,13 @@ Sha512Update ( UINTN TmpLen; CONST UINT8 *ShiftedMsg; - TmpLen = SHA512_BLOCK_SIZE - Context->Len; + TmpLen = SHA512_BLOCK_SIZE - Context->Length; RemLen = Len < TmpLen ? Len : TmpLen; - CopyMem (&Context->Block[Context->Len], Data, RemLen); + CopyMem (&Context->Block[Context->Length], Data, RemLen); - if (Context->Len + Len < SHA512_BLOCK_SIZE) { - Context->Len += Len; + if (Context->Length + Len < SHA512_BLOCK_SIZE) { + Context->Length += Len; return; } @@ -451,7 +451,7 @@ Sha512Update ( CopyMem (Context->Block, &ShiftedMsg[BlockNb << 7], RemLen); - Context->Len = RemLen; + Context->Length = RemLen; Context->TotalLength += (BlockNb + 1) << 7; } @@ -493,7 +493,7 @@ Sha512 ( Sha512Init (&Context); Sha512Update (&Context, Data, Len); - Sha512Final (&Context, Digest); + Sha512Final (&Context, Hash); }
[libgui] View exposes lifecycle methods
@@ -59,6 +59,23 @@ impl View { self.sub_elements.borrow_mut().push(elem); } + + pub fn resize_subviews(&self) { + let frame = *self.frame.borrow(); + let inner_content_frame = frame.apply_insets(self.border_insets()); + + let elems = &*self.sub_elements.borrow(); + for elem in elems { + elem.handle_superview_resize(inner_content_frame.size); + } + } + + pub fn draw_subviews(&self) { + let sub_elements = &self.sub_elements.borrow(); + for elem in sub_elements.iter() { + elem.draw(); + } + } } impl NestedLayerSlice for View { @@ -76,11 +93,7 @@ impl NestedLayerSlice for View { impl Bordered for View { fn draw_inner_content(&self, _outer_frame: Rect, onto: &mut LayerSlice) { onto.fill(self.background_color); - - let sub_elements = &self.sub_elements.borrow(); - for elem in sub_elements.iter() { - elem.draw(); - } + self.draw_subviews(); } fn border_enabled(&self) -> bool { @@ -127,13 +140,7 @@ impl UIElement for View { let sizer = &*self.sizer.borrow(); let frame = sizer(self, superview_size); self.frame.replace(frame); - - let inner_content_frame = frame.apply_insets(self.border_insets()); - - let elems = &*self.sub_elements.borrow(); - for elem in elems { - elem.handle_superview_resize(inner_content_frame.size); - } + self.resize_subviews(); } fn handle_mouse_entered(&self) {
libhfuzz/memcmp: instrument also if the length of string runs out
@@ -17,10 +17,10 @@ static inline int HF_strcmp(const char* s1, const char* s2, uintptr_t addr) { size_t i; for (i = 0; s1[i] == s2[i]; i++) { if (s1[i] == '\0' || s2[i] == '\0') { - instrumentUpdateCmpMap(addr, i); break; } } + instrumentUpdateCmpMap(addr, i); return ((unsigned char)s1[i] - (unsigned char)s2[i]); } @@ -28,10 +28,10 @@ static inline int HF_strcasecmp(const char* s1, const char* s2, uintptr_t addr) size_t i; for (i = 0; tolower((unsigned char)s1[i]) == tolower((unsigned char)s2[i]); i++) { if (s1[i] == '\0' || s2[i] == '\0') { - instrumentUpdateCmpMap(addr, i); break; } } + instrumentUpdateCmpMap(addr, i); return (tolower((unsigned char)s1[i]) - tolower((unsigned char)s2[i])); } @@ -39,11 +39,11 @@ static inline int HF_strncmp(const char* s1, const char* s2, size_t n, uintptr_t size_t i; for (i = 0; i < n; i++) { if ((s1[i] != s2[i]) || s1[i] == '\0' || s2[i] == '\0') { - instrumentUpdateCmpMap(addr, i); break; } } + instrumentUpdateCmpMap(addr, i); if (i == n) { return 0; } @@ -55,11 +55,11 @@ static inline int HF_strncasecmp(const char* s1, const char* s2, size_t n, uintp for (i = 0; i < n; i++) { if ((tolower((unsigned char)s1[i]) != tolower((unsigned char)s2[i])) || s1[i] == '\0' || s2[i] == '\0') { - instrumentUpdateCmpMap(addr, i); break; } } + instrumentUpdateCmpMap(addr, i); if (i == n) { return 0; } @@ -98,14 +98,14 @@ static inline int HF_memcmp(const void* m1, const void* m2, size_t n, uintptr_t size_t i; for (i = 0; i < n; i++) { if (s1[i] != s2[i]) { - instrumentUpdateCmpMap(addr, i); break; } } + + instrumentUpdateCmpMap(addr, i); if (i == n) { return 0; } - return ((unsigned char)s1[i] - (unsigned char)s2[i]); } @@ -129,8 +129,8 @@ static inline void* HF_memmem(const void* haystack, size_t haystacklen, const vo static inline char* HF_strcpy(char* dest, const char* src, uintptr_t addr) { size_t len = strlen(src); - instrumentUpdateCmpMap(addr, len); + instrumentUpdateCmpMap(addr, len); return memcpy(dest, src, len + 1); }
Edit help string for wave.c
@@ -63,10 +63,8 @@ static const char help_str[] = "Expected dimensions:\n" " * maps - ( sx, sy, sz, nc, md)\n" " * wave - ( wx, sy, sz, 1, 1)\n" - " * phi - ( 1, 1, 1, 1, 1)\n" - " * output - ( sx, sy, sz, 1, md)\n" - " * reorder - ( n, 3, 1, 1, 1)\n" - " * table - ( wx, nc, n, 1, 1)"; + " * kspace - ( wx, sy, sz, nc, 1)\n" + " * output - ( sx, sy, sz, 1, md)"; /* Helper function to print out operator dimensions. */ static void print_opdims(const struct linop_s* op)
lossless_enc,TransformColorBlue: quiet uint32_t conv warning no change in object code from clang-7 integer sanitizer: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 159 (8-bit, unsigned)
@@ -546,7 +546,7 @@ static WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue, uint32_t argb) { const uint32_t green = argb >> 8; const uint32_t red = argb >> 16; - uint8_t new_blue = argb; + uint8_t new_blue = argb & 0xff; new_blue -= ColorTransformDelta(green_to_blue, green); new_blue -= ColorTransformDelta(red_to_blue, red); return (new_blue & 0xff);
fix test_lb_ip4_gre6() cleanup missing "del" keyword, and as a result, we were trying to add the as twice.
@@ -195,7 +195,7 @@ class TestLB(VppTestCase): self.checkCapture(gre4=False, isv4=True) finally: for asid in self.ass: - self.vapi.cli("lb as 90.0.0.0/8 2002::%u" % (asid)) + self.vapi.cli("lb as 90.0.0.0/8 2002::%u del" % (asid)) self.vapi.cli("lb vip 90.0.0.0/8 encap gre6 del") def test_lb_ip6_gre6(self):
always display user/ namespace
@@ -115,7 +115,7 @@ export default class Configuration extends Component { generateData = ({ ls, match, getKey }) => { const { id } = match && match.params - return parseData(getKey, id, ls) + return parseData(getKey, id, [ 'user', ...ls ]) } refresh = () => {
Delete leftover code
@@ -159,7 +159,6 @@ psa_status_t mbedtls_psa_hkdf_extract( psa_algorithm_t alg, return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA ); } - //hash_len = mbedtls_md_get_size( md ); hash_len = PSA_HASH_LENGTH( alg ); if( hash_len == 0 )
hv: refine memset Use enhanced rep fast-string operation to refine memset.
@@ -367,33 +367,22 @@ void *memcpy_s(void *d, size_t dmax, const void *s, size_t slen_arg) return d; } -void *memset(void *base, uint8_t v, size_t n) +static inline void memset_erms(void *base, uint8_t v, size_t n) { - uint8_t *dest_p; - size_t n_q; - size_t count; - void *ret; - - dest_p = (uint8_t *)base; - - if ((dest_p == NULL) || (n == 0U)) { - ret = NULL; - } else { - /* do the few bytes to get uint64_t alignment */ - count = n; - for (; (count != 0U) && (((uint64_t)dest_p & 7UL) != 0UL); count--) { - *dest_p = v; - dest_p++; + asm volatile("rep ; stosb" + : "+D"(base) + : "a" (v), "c"(n)); } - /* 64-bit mode */ - n_q = count >> 3U; - asm volatile("cld ; rep ; stosq ; movl %3,%%ecx ; rep ; stosb" - : "+c"(n_q), "+D"(dest_p) - : "a" (v * 0x0101010101010101U), - "r"((uint32_t)count & 7U)); - ret = (void *)dest_p; +void *memset(void *base, uint8_t v, size_t n) +{ + /* + * Some CPUs support enhanced REP MOVSB/STOSB feature. It is recommended + * to use it when possible. + */ + if ((base != NULL) && (n != 0U)) { + memset_erms(base, v, n); } - return ret; + return base; }
Add lightcount to scene info in group object Used in the app to quickly verify the scene has assigned lights.
@@ -1735,6 +1735,7 @@ bool DeRestPluginPrivate::groupToMap(const Group *group, QVariantMap &map) scene["id"] = sid; scene["name"] = si->name; scene["transitiontime"] = si->transitiontime(); + scene["lightcount"] = (double)si->lights().size(); scenes.append(scene); }
Fixed warnings in string test.
@@ -7,7 +7,7 @@ void str_enum_test_bijection(CuTest* tc) char *str; int i, j; for (i = 0; i > -9; i--) { - str = ts_enum_str((tsError) i); + str = (char *)ts_enum_str((tsError) i); j = strcmp("unknown error", str); if (j == 0) /* TS_SUCCESS */ CuAssertTrue(tc, !j); /* equal */ @@ -20,13 +20,13 @@ void str_enum_test_bijection(CuTest* tc) void str_enum_test_unknown(CuTest* tc) { - char *str = ts_enum_str((tsError) 0); + char *str = (char *)ts_enum_str((tsError) 0); CuAssertStrEquals(tc, "unknown error", str); - str = ts_enum_str((tsError) 1); + str = (char *)ts_enum_str((tsError) 1); CuAssertStrEquals(tc, "unknown error", str); - str = ts_enum_str((tsError) 2); + str = (char *)ts_enum_str((tsError) 2); CuAssertStrEquals(tc, "unknown error", str); - str = ts_enum_str((tsError) 100); + str = (char *)ts_enum_str((tsError) 100); CuAssertStrEquals(tc, "unknown error", str); }
LICENSE: add license for chat document the license in the LICENSE file
@@ -1688,3 +1688,38 @@ apps/include/wireless/wapi.h LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +apps/netutils/chat/chat.c +apps/netutils/chat/chat.h +========================= + + Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. + Author: Vladimir Komendantskiy <[email protected]> + Partly based on code by Max Nekludov <[email protected]> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. Neither the name NuttX nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE.
Export tcp_listener_type from libdill
#include "fd.h" #include "utils.h" +/* Secretly export the symbols. More thinking should be done about how + to do this cleanly without breaking encapsulation. */ +DILL_EXPORT extern const void *tcp_type; +DILL_EXPORT extern const void *tcp_listener_type; +DILL_EXPORT int tcp_fd(int s); + static int tcp_makeconn(int fd); /******************************************************************************/ /* TCP connection socket */ /******************************************************************************/ -/* Seceretely export the symbols. More thinking should be done about how - to do this cleanly without breaking encapsulation. */ -DILL_EXPORT extern const void *tcp_type; -DILL_EXPORT int tcp_fd(int s); - dill_unique_id(tcp_type); static void *tcp_hquery(struct hvfs *hvfs, const void *type);
assemble.py: Add explicit license declaration Although this file is likely implicitly licensed under the Apache 2.0 license because of the LICENSE file for this project, make this explicit in this file.
#! /usr/bin/env python3 +# +# Copyright 2017 Linaro Limited +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. """ Assemble multiple images into a single image that can be flashed on the device.
libwally/secp256k1: enable the ecdsa-s2c module (sign-to-contract) The antiklepto functions reside in this module, needed to implement the antiklepto protocol.
@@ -14,7 +14,7 @@ string(REPLACE "-mfpu=fpv4-sp-d16" "" MODIFIED_C_FLAGS ${MODIFIED_C_FLAGS_TMP}) # wally-core # configure flags for secp256k1 bundled in libwally core, to reduce memory consumption -set(LIBWALLY_SECP256k1_FLAGS --with-ecmult-window=2 --with-ecmult-gen-precision=2 --enable-ecmult-static-precomputation) +set(LIBWALLY_SECP256k1_FLAGS --with-ecmult-window=2 --with-ecmult-gen-precision=2 --enable-ecmult-static-precomputation --enable-module-ecdsa-s2c) set(LIBWALLY_CONFIGURE_FLAGS --enable-static --disable-shared --disable-tests ${LIBWALLY_SECP256k1_FLAGS}) if(SANITIZE_ADDRESS) set(LIBWALLY_CFLAGS "-fsanitize=address")
zephyr/emul/tcpc/emul_tcpci_partner_faulty_snk.c: Format with clang-format BRANCH=none TEST=none
@@ -42,8 +42,7 @@ static void tcpci_faulty_snk_emul_reduce_action_count( k_fifo_get(&data->action_list, K_FOREVER); } -void tcpci_faulty_snk_emul_append_action( - struct tcpci_faulty_snk_emul_data *data, +void tcpci_faulty_snk_emul_append_action(struct tcpci_faulty_snk_emul_data *data, struct tcpci_faulty_snk_action *action) { k_fifo_put(&data->action_list, action); @@ -67,8 +66,8 @@ void tcpci_faulty_snk_emul_clear_actions_list( * @return TCPCI_PARTNER_COMMON_MSG_HANDLED Message was handled * @return TCPCI_PARTNER_COMMON_MSG_NOT_HANDLED Message wasn't handled */ -static enum tcpci_partner_handler_res tcpci_faulty_snk_emul_handle_sop_msg( - struct tcpci_partner_extension *ext, +static enum tcpci_partner_handler_res +tcpci_faulty_snk_emul_handle_sop_msg(struct tcpci_partner_extension *ext, struct tcpci_partner_data *common_data, const struct tcpci_emul_msg *msg) { @@ -106,8 +105,7 @@ static enum tcpci_partner_handler_res tcpci_faulty_snk_emul_handle_sop_msg( tcpci_partner_received_msg_status( common_data, TCPCI_EMUL_TX_DISCARDED); tcpci_partner_send_control_msg( - common_data, - PD_CTRL_ACCEPT, 0); + common_data, PD_CTRL_ACCEPT, 0); tcpci_faulty_snk_emul_reduce_action_count(data); return TCPCI_PARTNER_COMMON_MSG_HANDLED; } @@ -140,8 +138,8 @@ struct tcpci_partner_extension_ops tcpci_faulty_snk_emul_ops = { .connect = NULL, }; -struct tcpci_partner_extension *tcpci_faulty_snk_emul_init( - struct tcpci_faulty_snk_emul_data *data, +struct tcpci_partner_extension * +tcpci_faulty_snk_emul_init(struct tcpci_faulty_snk_emul_data *data, struct tcpci_partner_data *common_data, struct tcpci_partner_extension *ext) {
Add PhQueryEnvironmentVariableZ and PhQuerySymbolicLinkObjectZ
@@ -293,6 +293,22 @@ PhQueryEnvironmentVariable( _Out_opt_ PPH_STRING* Value ); +FORCEINLINE +NTSTATUS +NTAPI +PhQueryEnvironmentVariableZ( + _In_opt_ PVOID Environment, + _In_ PWSTR Name, + _Out_opt_ PPH_STRING* Value + ) +{ + PH_STRINGREF name; + + PhInitializeStringRef(&name, Name); + + return PhQueryEnvironmentVariable(Environment, &name, Value); +} + PHLIBAPI NTSTATUS NTAPI @@ -319,11 +335,7 @@ PhSetEnvironmentVariableZ( PhInitializeStringRef(&name, Name); PhInitializeStringRef(&value, Value); - return PhSetEnvironmentVariable( - Environment, - &name, - &value - ); + return PhSetEnvironmentVariable(Environment, &name, &value); } else { @@ -331,11 +343,7 @@ PhSetEnvironmentVariableZ( PhInitializeStringRef(&name, Name); - return PhSetEnvironmentVariable( - Environment, - &name, - NULL - ); + return PhSetEnvironmentVariable(Environment, &name, NULL); } } @@ -1505,6 +1513,21 @@ PhQuerySymbolicLinkObject( _Out_ PPH_STRING* LinkTarget ); +FORCEINLINE +NTSTATUS +NTAPI +PhQuerySymbolicLinkObjectZ( + _In_ PWSTR Name, + _Out_ PPH_STRING* LinkTarget + ) +{ + PH_STRINGREF name; + + PhInitializeStringRef(&name, Name); + + return PhQuerySymbolicLinkObject(&name, LinkTarget); +} + PHLIBAPI VOID NTAPI
dood: Add CONFIG_USB_PD_RESET_MIN_BATT_SOC Add CONFIG_USB_PD_RESET_MIN_BATT_SOC to prevent pd reset when battery soc under 2% BRANCH=octopus TEST=make BOARD=dood
/* SYV682 isn't connected to CC, so TCPC must provide VCONN */ #define CONFIG_USBC_PPC_SYV682X_NO_CC +/* prevent pd reset when battery soc under 2% */ +#define CONFIG_USB_PD_RESET_MIN_BATT_SOC 2 + #ifndef __ASSEMBLER__
Removed duplicate solr.DefaultValueUpdateProcessorFactory for datafariweb updateRequestProcessorChain
<str name="value">Web</str> </processor> - <processor class="solr.DefaultValueUpdateProcessorFactory"> - <str name="fieldName">source</str> - <str name="value">Web</str> - </processor> - <processor class="solr.DefaultValueUpdateProcessorFactory"> <str name="fieldName">extension</str> <str name="value">html</str>
Bugfix: the value in test cases should be invariable JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang
@@ -17,7 +17,7 @@ var name = ""; try { Object.defineProperties(constructor.isExtensible, {a: Object.getOwnPropertyDescriptor(Uint8ClampedArray, "length")}) - new Int32Array(new ArrayBuffer(), undefined, Date.now()) + new Int32Array(new ArrayBuffer(), undefined, 40000000000) } catch (e) {
doc: release note v1.0, correct some words.
@@ -6,7 +6,7 @@ ACRN v1.0 (May 2019) We are pleased to announce the release of ACRN version 1.0, a key Project ACRN milestone focused on automotive Software-Defined Cockpit (SDC) use cases and introducing additional architecture enhancements for -Industrial and IoT usages. +more IOT usages, such as Industrial. This v1.0 release is a production-ready reference solution for SDC usages that require multiple VMs and rich I/O mediation for device
fixed bug in reuse PBKDF2
@@ -429,7 +429,7 @@ while(c < hcxrecords) memset(&ptk, 0, sizeof(ptk)); memset(&pkedata, 0, sizeof(mic)); memcpy(&pmk, &pmkin, 32); - + memset(&mic, 0, 16); if(c > 0) { zeigerhcx2 = hcxdata +c -1; @@ -440,6 +440,7 @@ while(c < hcxrecords) fprintf(stderr, "could not generate plainmasterkey\n"); return; } + memcpy(&pmk, &pmkin, 32); } } else if(c == 0) @@ -449,6 +450,7 @@ while(c < hcxrecords) fprintf(stderr, "could not generate plainmasterkey\n"); return; } + memcpy(&pmk, &pmkin, 32); } if(zeigerhcx->keyver == 1) { @@ -914,7 +916,7 @@ if(hcxorgrecords == 0) gettimeofday(&tv, NULL); tm_info = localtime(&tv.tv_sec); strftime(zeitstring, 26, "%H:%M:%S", tm_info); -printf("started %s to test %ld records\n", zeitstring, hcxorgrecords); +printf("started at %s to test %ld records\n", zeitstring, hcxorgrecords); if((essidname != NULL) && (passwordname != NULL)) hcxessidpassword(hcxorgrecords, essidname, essidlen, passwordname, passwordlen); @@ -934,6 +936,11 @@ if((wordlistinname != NULL) && (essidname != NULL)) if((wordlistinname != NULL) && (essidname == NULL)) hcxwordlist(hcxorgrecords, wordlistinname); +gettimeofday(&tv, NULL); +tm_info = localtime(&tv.tv_sec); +strftime(zeitstring, 26, "%H:%M:%S", tm_info); +printf("finished at %s\n", zeitstring); + if(hcxdata != NULL) free(hcxdata);
Fix build when no console device is selected This enables building console/minimal when CONSOLE_UART and CONSOLE_RTT are both disabled, and allows console to be effectively "disabled" when no uart/rtt was built but console/minimal was added as dependency. This mimics a change that was already applied on console/full.
@@ -59,6 +59,12 @@ static uint8_t cur, end; static struct os_eventq *avail_queue; static struct os_eventq *lines_queue; +int __attribute__((weak)) +console_out(int c) +{ + return c; +} + void console_write(const char *str, int cnt) {
Update s_time to be allow configuration of TLSv1.3 ciphersuites
@@ -59,9 +59,9 @@ static const size_t fmt_http_get_cmd_size = sizeof(fmt_http_get_cmd) - 2; typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, - OPT_CONNECT, OPT_CIPHER, OPT_CERT, OPT_NAMEOPT, OPT_KEY, OPT_CAPATH, - OPT_CAFILE, OPT_NOCAPATH, OPT_NOCAFILE, OPT_NEW, OPT_REUSE, OPT_BUGS, - OPT_VERIFY, OPT_TIME, OPT_SSL3, + OPT_CONNECT, OPT_CIPHER, OPT_CIPHERSUITES, OPT_CERT, OPT_NAMEOPT, OPT_KEY, + OPT_CAPATH, OPT_CAFILE, OPT_NOCAPATH, OPT_NOCAFILE, OPT_NEW, OPT_REUSE, + OPT_BUGS, OPT_VERIFY, OPT_TIME, OPT_SSL3, OPT_WWW } OPTION_CHOICE; @@ -69,7 +69,9 @@ const OPTIONS s_time_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, {"connect", OPT_CONNECT, 's', "Where to connect as post:port (default is " SSL_CONNECT_NAME ")"}, - {"cipher", OPT_CIPHER, 's', "Cipher to use, see 'openssl ciphers'"}, + {"cipher", OPT_CIPHER, 's', "TLSv1.2 and below cipher list to be used"}, + {"ciphersuites", OPT_CIPHERSUITES, 's', + "Specify TLSv1.3 ciphersuites to be used"}, {"cert", OPT_CERT, '<', "Cert file to use, PEM format assumed"}, {"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"}, {"key", OPT_KEY, '<', "File with key, PEM; default is -cert file"}, @@ -106,7 +108,8 @@ int s_time_main(int argc, char **argv) SSL *scon = NULL; SSL_CTX *ctx = NULL; const SSL_METHOD *meth = NULL; - char *CApath = NULL, *CAfile = NULL, *cipher = NULL, *www_path = NULL; + char *CApath = NULL, *CAfile = NULL, *cipher = NULL, *ciphersuites = NULL; + char *www_path = NULL; char *host = SSL_CONNECT_NAME, *certfile = NULL, *keyfile = NULL, *prog; double totalTime = 0.0; int noCApath = 0, noCAfile = 0; @@ -170,6 +173,9 @@ int s_time_main(int argc, char **argv) case OPT_CIPHER: cipher = opt_arg(); break; + case OPT_CIPHERSUITES: + ciphersuites = opt_arg(); + break; case OPT_BUGS: st_bugs = 1; break; @@ -196,10 +202,6 @@ int s_time_main(int argc, char **argv) if (cipher == NULL) cipher = getenv("SSL_CIPHER"); - if (cipher == NULL) { - BIO_printf(bio_err, "No CIPHER specified\n"); - goto end; - } if ((ctx = SSL_CTX_new(meth)) == NULL) goto end; @@ -210,7 +212,9 @@ int s_time_main(int argc, char **argv) if (st_bugs) SSL_CTX_set_options(ctx, SSL_OP_ALL); - if (!SSL_CTX_set_cipher_list(ctx, cipher)) + if (cipher != NULL && !SSL_CTX_set_cipher_list(ctx, cipher)) + goto end; + if (ciphersuites != NULL && !SSL_CTX_set_ciphersuites(ctx, ciphersuites)) goto end; if (!set_cert_stuff(ctx, certfile, keyfile)) goto end;
sysdeps/managarm: implement DRM PRIME ioctls
@@ -2950,6 +2950,67 @@ int sys_ioctl(int fd, unsigned long request, void *arg, int *result) { " is a noop\e[39m" << frg::endlog; return 0; } + case DRM_IOCTL_PRIME_HANDLE_TO_FD: { + auto param = reinterpret_cast<drm_prime_handle *>(arg); + + managarm::fs::CntRequest<MemoryAllocator> req(getSysdepsAllocator()); + req.set_req_type(managarm::fs::CntReqType::PT_IOCTL); + req.set_command(request); + req.set_drm_prime_handle(param->handle); + req.set_drm_flags(param->flags); + + auto [offer, send_req, send_creds, recv_resp] = exchangeMsgsSync( + handle, + helix_ng::offer( + helix_ng::sendBragiHeadOnly(req, getSysdepsAllocator()), + helix_ng::imbueCredentials(), + helix_ng::recvInline()) + ); + HEL_CHECK(offer.error()); + HEL_CHECK(send_req.error()); + HEL_CHECK(send_creds.error()); + HEL_CHECK(recv_resp.error()); + + managarm::fs::SvrResponse<MemoryAllocator> resp(getSysdepsAllocator()); + resp.ParseFromArray(recv_resp.data(), recv_resp.length()); + __ensure(resp.error() == managarm::fs::Errors::SUCCESS); + + param->fd = resp.drm_prime_fd(); + *result = resp.result(); + return 0; + } + case DRM_IOCTL_PRIME_FD_TO_HANDLE: { + auto param = reinterpret_cast<drm_prime_handle *>(arg); + + managarm::fs::CntRequest<MemoryAllocator> req(getSysdepsAllocator()); + req.set_req_type(managarm::fs::CntReqType::PT_IOCTL); + req.set_command(request); + req.set_drm_flags(param->flags); + + auto [offer, send_req, send_creds, recv_resp] = exchangeMsgsSync( + handle, + helix_ng::offer( + helix_ng::sendBragiHeadOnly(req, getSysdepsAllocator()), + helix_ng::imbueCredentials(getHandleForFd(param->fd)), + helix_ng::recvInline()) + ); + HEL_CHECK(offer.error()); + HEL_CHECK(send_req.error()); + HEL_CHECK(send_creds.error()); + HEL_CHECK(recv_resp.error()); + + managarm::fs::SvrResponse<MemoryAllocator> resp(getSysdepsAllocator()); + resp.ParseFromArray(recv_resp.data(), recv_resp.length()); + if(resp.error() == managarm::fs::Errors::FILE_NOT_FOUND) { + return EBADF; + } else { + __ensure(resp.error() == managarm::fs::Errors::SUCCESS); + } + + param->handle = resp.drm_prime_handle(); + *result = resp.result(); + return 0; + } case TCGETS: { auto param = reinterpret_cast<struct termios *>(arg); HelAction actions[4];
chk_local_db_running: speed up file checks In a classic example of "too many layers", chk_local_db_running() used FileDirExists, which spins up a new Python interpreter, to check for the existence of a file. Just use os.path.exists() directly.
TODO: docs! """ import os, pickle, base64, time +import os.path import re, socket @@ -1307,13 +1308,8 @@ def chk_local_db_running(datadir, port): finally: f.close() - cmd=FileDirExists('check for /tmp/.s.PGSQL file file', "/tmp/.s.PGSQL.%d" % port) - cmd.run(validateAfter=True) - tmpfile_exists = cmd.filedir_exists() - - cmd=FileDirExists('check for lock file', get_lockfile_name(port)) - cmd.run(validateAfter=True) - lockfile_exists = cmd.filedir_exists() + tmpfile_exists = os.path.exists("/tmp/.s.PGSQL.%d" % port) + lockfile_exists = os.path.exists(get_lockfile_name(port)) netstat_port_active = PgPortIsActive.local('check netstat for postmaster port',"/tmp/.s.PGSQL.%d" % port, port)
[cmake] if no docstrings files, skip docstring generation. Condition triggered when headers are removed from externals installation. When DOCSTRINGS_FILES is empty, it issues an argument-less cat command which hangs waiting for input.
@@ -38,25 +38,26 @@ macro(doxy2swig_docstrings COMP) endforeach() endforeach() - # If this variable is empty, cat will hang, so error out instead. - if (NOT DOCSTRINGS_FILES) - message(FATAL_ERROR "DOCSTRINGS_FILES=${DOCSTRINGS_FILES}") - endif() - + if (DOCSTRINGS_FILES) add_custom_command(OUTPUT ${SICONOS_SWIG_ROOT_DIR}/${COMP}-docstrings.i DEPENDS ${DOCSTRINGS_FILES} COMMAND cat ARGS ${DOCSTRINGS_FILES} > ${SICONOS_SWIG_ROOT_DIR}/${COMP}-docstrings.i COMMENT "${COMP} docstrings concatenation") - add_custom_target(${COMP}_docstrings DEPENDS ${SICONOS_SWIG_ROOT_DIR}/${COMP}-docstrings.i) else() add_custom_command(OUTPUT ${SICONOS_SWIG_ROOT_DIR}/${COMP}-docstrings.i DEPENDS ${DOCSTRINGS_FILES} - COMMAND printf \"\" > ${COMP}-docstrings.i + COMMAND touch + ARGS ${SICONOS_SWIG_ROOT_DIR}/${COMP}-docstrings.i) + endif() + else() + add_custom_command(OUTPUT ${SICONOS_SWIG_ROOT_DIR}/${COMP}-docstrings.i + DEPENDS ${DOCSTRINGS_FILES} + COMMAND touch + ARGS ${SICONOS_SWIG_ROOT_DIR}/${COMP}-docstrings.i ) - - add_custom_target(${COMP}_docstrings DEPENDS ${SICONOS_SWIG_ROOT_DIR}/${COMP}-docstrings.i) endif() + add_custom_target(${COMP}_docstrings DEPENDS ${SICONOS_SWIG_ROOT_DIR}/${COMP}-docstrings.i) endmacro() # ----------------------------------------------------------------------
board/dojo/battery.c: Format with clang-format BRANCH=none TEST=none
@@ -178,8 +178,7 @@ int charger_profile_override(struct charge_state_data *curr) chg_temp = K_TO_C(chg_temp); prev_chg_lvl = chg_lvl; - if (chg_temp <= temp_chg_table[chg_lvl].lo_thre && - chg_lvl > 0) + if (chg_temp <= temp_chg_table[chg_lvl].lo_thre && chg_lvl > 0) chg_lvl--; else if (chg_temp >= temp_chg_table[chg_lvl].hi_thre && chg_lvl < CHG_LEVEL_COUNT - 1)
remove vestigial lwIP TCP connection error handler; nuke error_message()
@@ -204,19 +204,6 @@ static void wakeup_sock(sock s, int flags) notify_sock(s); } -static inline void error_message(sock s, err_t err) { - switch (err) { - case ERR_ABRT: - msg_warn("connection closed on fd %d due to tcp_abort or timer\n", s->fd); - break; - case ERR_RST: - msg_warn("connection closed on fd %d due to remote reset\n", s->fd); - break; - default: - msg_err("fd %d: unknown error %d\n", s->fd, err); - } -} - static void remote_sockaddr_in(sock s, struct sockaddr_in *sin) { sin->family = AF_INET; @@ -938,42 +925,14 @@ sysreturn bind(int sockfd, struct sockaddr *addr, socklen_t addrlen) return lwip_to_errno(err); } -void error_handler_tcp(void* arg, err_t err) -{ - if (!arg) - return; - sock s = (sock)arg; - net_debug("sock %d, err %d\n", s->fd, err); - if (!s || err == ERR_OK) - return; - - /* Warning: Don't try to use the pcb. According to lwIP docs, it - may have been deallocated already. */ - s->info.tcp.lw = 0; - - error_message(s, err); // XXX nuke this - - if (err == ERR_ABRT || - err == ERR_RST || - err == ERR_CLSD) { - set_lwip_error(s, err); - wakeup_sock(s, WAKEUP_SOCK_EXCEPT); - } else { - /* We have no context for any other errors at this point, - so bark and ignore... */ - msg_err("unhandled lwIP error %d\n", err); - } -} - -static void lwip_tcp_conn_err(void * z, err_t b) { +static void lwip_tcp_conn_err(void * z, err_t err) { if (!z) { return; } sock s = z; - net_debug("sock %d, err %d\n", s->fd, b); - error_message(s, b); + net_debug("sock %d, err %d\n", s->fd, err); s->info.tcp.state = TCP_SOCK_UNDEFINED; - set_lwip_error(s, b); + set_lwip_error(s, err); /* Don't try to use the pcb, it may have been deallocated already. */ s->info.tcp.lw = 0; @@ -1057,7 +1016,7 @@ static inline err_t connect_tcp(sock s, const ip_addr_t* address, unsigned short struct tcp_pcb * lw = s->info.tcp.lw; tcp_arg(lw, s); tcp_recv(lw, tcp_input_lower); - tcp_err(lw, error_handler_tcp); + tcp_err(lw, lwip_tcp_conn_err); tcp_sent(lw, lwip_tcp_sent); s->info.tcp.state = TCP_SOCK_IN_CONNECTION; set_lwip_error(s, ERR_OK);
elrs: fix crc on wide channels
@@ -270,7 +270,7 @@ static bool elrs_vaild_packet() { // For smHybrid the CRC only has the packet type in byte 0 // For smHybridWide the FHSS slot is added to the CRC in byte 0 on RC_DATA_PACKETs if (type == RC_DATA_PACKET && bind_storage.elrs.switch_mode == SWITCH_WIDE_OR_8CH) { - uint8_t fhss_result = (ota_nonce % current_air_rate_config()->fhss_hop_interval); + const uint8_t fhss_result = (ota_nonce % current_air_rate_config()->fhss_hop_interval) + 1; packet[0] = type | (fhss_result << 2); } else { packet[0] = type;
Update the maximum supported FIS version This change enables management software to support up to FIS version 2.4 memory device.
/** Minimum supported version of FW API: 1.2 **/ #define MIN_FIS_SUPPORTED_BY_THIS_SW_MAJOR 1 #define MIN_FIS_SUPPORTED_BY_THIS_SW_MINOR 2 -/** Maximum supported version of FW API: 2.3 **/ +/** Maximum supported version of FW API: 2.4 **/ #define MAX_FIS_SUPPORTED_BY_THIS_SW_MAJOR 2 -#define MAX_FIS_SUPPORTED_BY_THIS_SW_MINOR 3 +#define MAX_FIS_SUPPORTED_BY_THIS_SW_MINOR 4 #endif /** _FWVERSION_H_ **/ \ No newline at end of file
Added class ce for Copernicus Emergency Management Service
32 yp YOPP 33 l5 ERA5L: ERA5 of land surface parameters 34 lw WMO Lead Centre Wave Forecast Verification +35 ce Copernicus Emergency Management Service 99 te Test 100 at Austria 101 be Belgium
fix(demo): minor fix for benchmark 1.add const to rnd_map 2.replace "i < sizeof(scenes) / sizeof(scene_dsc_t) - 1" with "scenes[i].create_cb" 3.replace "sizeof(scenes) / sizeof(scene_dsc_t)" with "dimof(scenes)"
@@ -602,7 +602,7 @@ static lv_obj_t * subtitle; static uint32_t rnd_act; -static uint32_t rnd_map[] = { +static const uint32_t rnd_map[] = { 0xbd13204f, 0x67d8167f, 0x20211c99, 0xb0a7cc05, 0x06d5c703, 0xeafb01a7, 0xd0473b5c, 0xc999aaa2, 0x86f9d5d9, 0x294bdb29, 0x12a3c207, 0x78914d14, @@ -631,7 +631,7 @@ static uint32_t rnd_map[] = { static void benchmark_init(void) { - lv_disp_t * disp = lv_disp_get_next(NULL); + lv_disp_t * disp = lv_disp_get_default(); disp->driver->monitor_cb = monitor_cb; lv_obj_t * scr = lv_scr_act(); @@ -763,7 +763,7 @@ static void generate_report(void) row++; char buf[256]; - for(i = 0; i < sizeof(scenes) / sizeof(scene_dsc_t) - 1; i++) { + for(i = 0; scenes[i].create_cb; i++) { if(scenes[i].fps_normal < 20 && scenes[i].weight >= 10) { lv_table_set_cell_value(table, row, 0, scenes[i].name); @@ -808,7 +808,7 @@ static void generate_report(void) // lv_table_set_cell_type(table, row, 0, 4); row++; - for(i = 0; i < sizeof(scenes) / sizeof(scene_dsc_t) - 1; i++) { + for(i = 0; scenes[i].create_cb; i++) { lv_table_set_cell_value(table, row, 0, scenes[i].name); lv_snprintf(buf, sizeof(buf), "%"LV_PRIu32, scenes[i].fps_normal); @@ -948,7 +948,7 @@ static void scene_next_task_cb(lv_timer_t * timer) if(scenes[scene_act].create_cb) { lv_label_set_text_fmt(title, "%"LV_PRId32"/%d: %s%s", scene_act * 2 + (opa_mode ? 1 : 0), - (sizeof(scenes) / sizeof(scene_dsc_t) * 2) - 2, scenes[scene_act].name, opa_mode ? " + opa" : ""); + (dimof(scenes) * 2) - 2, scenes[scene_act].name, opa_mode ? " + opa" : ""); if(opa_mode) { lv_label_set_text_fmt(subtitle, "Result of \"%s\": %"LV_PRId32" FPS", scenes[scene_act].name, scenes[scene_act].fps_normal);
Fixed error in propagating BN_FLG_CONSTTIME flag through BN_MONT_CTX_set, which could lead to information disclosure on RSA primes p and q.
@@ -258,6 +258,8 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) R = &(mont->RR); /* grab RR as a temp */ if (!BN_copy(&(mont->N), mod)) goto err; /* Set N */ + if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0) + BN_set_flags(&(mont->N), BN_FLG_CONSTTIME); mont->N.neg = 0; #ifdef MONT_WORD @@ -270,6 +272,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) tmod.dmax = 2; tmod.neg = 0; + if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0) + BN_set_flags(&tmod, BN_FLG_CONSTTIME); + mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2; # if defined(OPENSSL_BN_ASM_MONT) && (BN_BITS2<=32)
DDF support check groups when no meta group.endpoints are specified This information can also be extracted from group bindings.
@@ -4429,7 +4429,8 @@ void DeRestPluginPrivate::checkSensorNodeReachable(Sensor *sensor, const deCONZ: /*! On reception of an group command, check that the config.group entries are set properly. - - This requires the DDF has { "meta": { "group.endpoints": [<endpoints>] }} set. + - This requires the DDF has { "meta": { "group.endpoints": [<endpoints>] }} set, + or as alternative the DDF has group bindings specified. - This takes into account if there are also matching bindings set in the DDF. - "auto" entries are replaced based on the index in group.ednpoints. - Existing group entries are replaced if the device hasn't configured bindings in the DDF. @@ -4447,7 +4448,34 @@ void DEV_CheckConfigGroupIndication(Resource *rsub, uint8_t srcEndpoint, uint ds return; } - const QVariantList epList = ddfSubDevice.meta.value(QLatin1String("group.endpoints")).toList(); + const auto ddfItem = std::find_if(ddfSubDevice.items.cbegin(), ddfSubDevice.items.cend(), + [configGroup](const auto &x){ return x.descriptor.suffix == RConfigGroup; }); + + if (ddfItem == ddfSubDevice.items.cend()) + { + return; + } + + Device *device = static_cast<Device*>(rsub->parentResource()); + + QVariantList epList; + if (ddfSubDevice.meta.contains(QLatin1String("group.endpoints"))) + { + epList = ddfSubDevice.meta.value(QLatin1String("group.endpoints")).toList(); + } + else if (ddfItem->defaultValue.toString().contains(QLatin1String("auto"))) + { + // try to extract from bindings, todo cache + for (const auto &bnd : device->bindings()) + { + const QVariant ep(uint(bnd.srcEndpoint)); + if (bnd.isGroupBinding && !epList.contains(ep)) + { + epList.push_back(ep); + } + } + } + if (epList.isEmpty()) { return; @@ -4492,8 +4520,6 @@ void DEV_CheckConfigGroupIndication(Resource *rsub, uint8_t srcEndpoint, uint ds // at this point groupList[i] has a group which is different from the received one - Device *device = static_cast<Device*>(rsub->parentResource()); - for (const auto &bnd : device->bindings()) { if (bnd.isGroupBinding && bnd.srcEndpoint == srcEndpoint && bnd.configGroup == i) @@ -4621,7 +4647,7 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A // check if group configuration is handled by DDF const auto &ddfSubDevice = DeviceDescriptions::instance()->getSubDevice(sensor); - if (ddfSubDevice.isValid() && ddfSubDevice.meta.contains(QLatin1String("group.endpoints"))) + if (ddfSubDevice.isValid()) { doLegacyGroupStuff = false; if (ind.dstAddressMode() == deCONZ::ApsGroupAddress)
Support null colorspace for gradients
@@ -39,8 +39,8 @@ struct __CGGradient : CoreFoundation::CppBase<__CGGradient> { } __CGGradient(CGColorSpaceRef colorSpace, CFArrayRef components, const CGFloat* locations) - : _colorSpace(colorSpace), - _colorComponents(CopyColorComponents(colorSpace, components)), + : _colorSpace(woc::TakeOwnership, colorSpace ? CGColorSpaceRetain(colorSpace) : CGColorSpaceCreateDeviceRGB()), + _colorComponents(CopyColorComponents(_colorSpace, components)), _stopLocations(CopyLocations(locations, CFArrayGetCount(components))) { } @@ -121,8 +121,7 @@ CGGradientRef CGGradientRetain(CGGradientRef gradient) { } static inline bool __isValidGradientColorspaceModel(CGColorSpaceRef colorspace) { - RETURN_RESULT_IF_NULL(colorspace, false); - + // Note: null colorspace is valid // The colorspace cannot be kCGColorSpaceModelPattern || kCGColorSpaceModelIndexed CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorspace); if ((colorSpaceModel == kCGColorSpaceModelPattern) || (colorSpaceModel == kCGColorSpaceModelIndexed)) { @@ -149,10 +148,10 @@ CGGradientRef CGGradientCreateWithColorComponents(CGColorSpaceRef colorSpace, } /** - @Status Interoperable + @Status Caveat + @Notes Only RGB colorspace is supported, but individual colors can be of different colorspace */ CGGradientRef CGGradientCreateWithColors(CGColorSpaceRef colorSpace, CFArrayRef colors, const CGFloat* locations) { - RETURN_NULL_IF(!colorSpace); RETURN_NULL_IF(!colors); RETURN_NULL_IF(!__isValidGradientColorspaceModel(colorSpace)); // location can be null
A small fix for displaying help
@@ -30,7 +30,8 @@ elif [ "$#" -eq 1 ] then if [[ "$1" == "--help" ]] then - OS_NAME="$help_install_dependencies" + echo "$help_install_dependencies" + exit elif [[ "$1" == "linux" ]] then OS_NAME="linux"
nimble/ll: Fix network privacy when initiating If remote is using ID address and IRK for that peer is on resolving list and network privacy is enabled we should not be connecting to that peer. This was affecting LL/CON/INI/BV-24-C qualification test case.
@@ -3409,6 +3409,12 @@ ble_ll_init_rx_isr_end(uint8_t *rxbuf, uint8_t crcok, */ memcpy(init_addr, rl->rl_local_rpa, BLE_DEV_ADDR_LEN); } + } else if (!ble_ll_is_rpa(adv_addr, adv_addr_type)) { + /* undirected with ID address, assure privacy if on RL */ + rl = ble_ll_resolv_list_find(adv_addr, adv_addr_type); + if (rl && (rl->rl_priv_mode == BLE_HCI_PRIVACY_NETWORK)) { + goto init_rx_isr_exit; + } } #endif
search for sdl2 a little better on windows instead of only looking for it with local files, use the `find_package` cmake thing to look for it first (optionally). Helps when you wanna install SDL with pacman on MSYS2 or something.
@@ -4,9 +4,18 @@ project(nothing) set(NOTHING_CI OFF CACHE BOOL "Indicates whether the build is running on CI or not") if(WIN32) + # do the flags thing first. if(MINGW) add_compile_definitions(SDL_MAIN_HANDLED) # https://stackoverflow.com/a/25089610 add_compile_definitions(__USE_MINGW_ANSI_STDIO) # https://github.com/trink/symtseries/issues/49#issuecomment-160843756 + endif() + + # then try to find SDL2 using normal means (eg. the user may have installed SDL2 using pacman on msys2) + # note we don't use REQUIRED here, because it can fail -- in which case we fall back to looking for the + # library "directly" using local files. + find_package(SDL2) + if(NOT SDL2_FOUND) + if(MINGW) # Support both 32 and 64 bit builds if (${CMAKE_SIZEOF_VOID_P} MATCHES 8) set(SDL2_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/SDL2/x86_64-w64-mingw32/include/SDL2") @@ -15,7 +24,6 @@ if(WIN32) set(SDL2_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/SDL2/i686-w64-mingw32/include/SDL2") set(SDL2_LIBRARIES "${CMAKE_SOURCE_DIR}/SDL2/i686-w64-mingw32/lib/libSDL2.a;${CMAKE_SOURCE_DIR}/SDL2/i686-w64-mingw32/lib/libSDL2main.a") endif() - else() set(SDL2_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/SDL2/include") @@ -25,10 +33,9 @@ if(WIN32) else() set(SDL2_LIBRARIES "${CMAKE_SOURCE_DIR}/SDL2/lib/x86/SDL2.lib;${CMAKE_SOURCE_DIR}/SDL2/lib/x86/SDL2main.lib") endif() - endif() string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES) - + endif() else() find_package(SDL2 REQUIRED) endif()
doc: also update man
@@ -372,6 +372,9 @@ lua \fIlua/\fR Lua plugins .IP "\(bu" 4 shell \fIshell/\fR executes shell commandos . +.IP "\(bu" 4 +haskell \fIhaskell/\fR used for linking haskell plugins and is a small example for such plugins itself +. .IP "" 0 . .SS "Others" @@ -400,8 +403,5 @@ profile \fIprofile/\fR links profile keys .IP "\(bu" 4 simplespeclang \fIsimplespeclang/\fR simple configuration specification language . -.IP "\(bu" 4 -haskell \fIhaskell/\fR used for linking haskell plugins and is a small example for such plugins itself -. .IP "" 0
Fix decrement in while loop. Fixes
@@ -216,7 +216,7 @@ static void flattencond(Flattenctx *s, Node *n, Node *ltrue, Node *lfalse) } } -/* flattenlifies +/* flatten * a || b * to * if a || b @@ -239,6 +239,7 @@ static Node *flattenlazy(Flattenctx *s, Node *n) /* flatten the conditional */ flattencond(s, n, ltrue, lfalse); + /* if true */ append(s, ltrue); u = mkexpr(n->loc, Olit, mkbool(n->loc, 1), NULL); @@ -570,10 +571,13 @@ static void flattenloop(Flattenctx *s, Node *n) { Node *lbody; Node *lend; + Node *ldec; Node *lcond; Node *lstep; + size_t i; lbody = genlbl(n->loc); + ldec = genlbl(n->loc); lcond = genlbl(n->loc); lstep = genlbl(n->loc); lend = genlbl(n->loc); @@ -588,9 +592,17 @@ static void flattenloop(Flattenctx *s, Node *n) flatten(s, lstep); /* test lbl */ flatten(s, n->loopstmt.step); /* step */ flatten(s, lcond); /* test lbl */ - flattencond(s, n->loopstmt.cond, lbody, lend); /* repeat? */ + flattencond(s, n->loopstmt.cond, ldec, lend); /* repeat? */ + flatten(s, ldec); /* drain decrements */ + for (i = 0; i < s->nqueue; i++) + append(s, s->incqueue[i]); + jmp(s, lbody); /* goto test */ flatten(s, lend); /* exit */ + for (i = 0; i < s->nqueue; i++) + append(s, s->incqueue[i]); + lfree(&s->incqueue, &s->nqueue); + s->nloopstep--; s->nloopexit--; } @@ -601,6 +613,7 @@ static void flattenif(Flattenctx *s, Node *n, Node *exit) { Node *l1, *l2, *l3; Node *iftrue, *iffalse; + size_t i; l1 = genlbl(n->loc); l2 = genlbl(n->loc); @@ -614,9 +627,15 @@ static void flattenif(Flattenctx *s, Node *n, Node *exit) flattencond(s, n->ifstmt.cond, l1, l2); flatten(s, l1); + for (i = 0; i < s->nqueue; i++) + append(s, s->incqueue[i]); + /* goto test */ flatten(s, iftrue); jmp(s, l3); flatten(s, l2); + for (i = 0; i < s->nqueue; i++) + append(s, s->incqueue[i]); + lfree(&s->incqueue, &s->nqueue); /* because lots of bunched up end labels are ugly, * coalesce them by handling 'elif'-like constructs * separately */
board/elemi/board.c: Format with clang-format BRANCH=none TEST=none
@@ -248,8 +248,8 @@ DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, kb_backlight_disable, HOOK_PRIO_DEFAULT); __override void board_ps8xxx_tcpc_init(int port) { /* b/189587527: Set Displayport EQ loss up to 10dB */ - tcpc_addr_write(port, PS8XXX_I2C_ADDR1_P1_FLAGS, - PS8815_REG_DP_EQ_SETTING, + tcpc_addr_write( + port, PS8XXX_I2C_ADDR1_P1_FLAGS, PS8815_REG_DP_EQ_SETTING, PS8815_DPEQ_LOSS_UP_10DB << PS8815_REG_DP_EQ_COMP_SHIFT); } @@ -277,8 +277,7 @@ static void ps8815_reset(void) int val; gpio_set_level(GPIO_USB_C1_RT_RST_ODL, 0); - msleep(GENERIC_MAX(PS8XXX_RESET_DELAY_MS, - PS8815_PWR_H_RST_H_DELAY_MS)); + msleep(GENERIC_MAX(PS8XXX_RESET_DELAY_MS, PS8815_PWR_H_RST_H_DELAY_MS)); gpio_set_level(GPIO_USB_C1_RT_RST_ODL, 1); msleep(PS8815_FW_INIT_DELAY_MS); @@ -289,16 +288,16 @@ static void ps8815_reset(void) CPRINTS("%s: patching ps8815 registers", __func__); - if (i2c_read8(I2C_PORT_USB_C1, - PS8XXX_I2C_ADDR1_P2_FLAGS, 0x0f, &val) == EC_SUCCESS) + if (i2c_read8(I2C_PORT_USB_C1, PS8XXX_I2C_ADDR1_P2_FLAGS, 0x0f, &val) == + EC_SUCCESS) CPRINTS("ps8815: reg 0x0f was %02x", val); - if (i2c_write8(I2C_PORT_USB_C1, - PS8XXX_I2C_ADDR1_P2_FLAGS, 0x0f, 0x31) == EC_SUCCESS) + if (i2c_write8(I2C_PORT_USB_C1, PS8XXX_I2C_ADDR1_P2_FLAGS, 0x0f, + 0x31) == EC_SUCCESS) CPRINTS("ps8815: reg 0x0f set to 0x31"); - if (i2c_read8(I2C_PORT_USB_C1, - PS8XXX_I2C_ADDR1_P2_FLAGS, 0x0f, &val) == EC_SUCCESS) + if (i2c_read8(I2C_PORT_USB_C1, PS8XXX_I2C_ADDR1_P2_FLAGS, 0x0f, &val) == + EC_SUCCESS) CPRINTS("ps8815: reg 0x0f now %02x", val); }
Enable TLS/1.3 support with OpenSSL/LibreSSL, otherwise current ChromeOS doesn't work...
@@ -946,13 +946,13 @@ _httpTLSStart(http_t *http) // I - Connection to server TLS1_VERSION, // TLS/1.0 TLS1_1_VERSION, // TLS/1.1 TLS1_2_VERSION, // TLS/1.2 -//#ifdef TLS1_3_VERSION -// TLS1_3_VERSION, // TLS/1.3 -// TLS1_3_VERSION // TLS/1.3 (max) -//#else +#ifdef TLS1_3_VERSION + TLS1_3_VERSION, // TLS/1.3 + TLS1_3_VERSION // TLS/1.3 (max) +#else TLS1_2_VERSION, // TLS/1.2 TLS1_2_VERSION // TLS/1.2 (max) -//#endif // TLS1_3_VERSION +#endif // TLS1_3_VERSION };
arvo: adds dynamic analysis from neo
== ~>(%slog.[0 leaf+"arvo: scry-dark"] ~) [~ ~ +.q.u.u.bop] +:: :: ++me +++ me :: dynamic analysis + :: sac: compiler cache + :: + |_ sac/worm + :: :: ++refine-moves:me + ++ refine-moves :: move list from vase + |= vax/vase + ^- {(list move:live) worm} + ?: =(~ q.vax) [~ sac] + =^ hed sac (~(slot wa sac) 2 vax) + =^ tal sac (~(slot wa sac) 3 vax) + =^ mov sac (refine-move hed) + =^ moz sac $(vax tal) + [[mov moz] sac] + :: :: ++refine-move:me + ++ refine-move :: move from vase + |= vax/vase + ^- {move:live worm} + :: + :: den: ++duct vase + :: yat: card vase + :: + =^ hip sac (~(nell wa sac) p.vax) + ?> hip + =^ den sac (~(slot wa sac) 2 vax) + =^ yat sac (~(slot wa sac) 3 vax) + =. sac (~(neat wa sac) -:!>(*duct) %& den) + ?> hip + =^ del sac (refine-ball yat) + [[(duct q.den) del] sac] + :: :: ++refine-ball:me + ++ refine-ball :: ball from vase + |= vax/vase + ^- {ball:live worm} + :: + :: specialize span to actual card stem + :: + =^ hex sac (~(sped wa sac) vax) + ?+ -.q.hex ~|(%bad-move !!) + $give + =. sac (~(neat wa sac) -:!>([%give *card]) %& hex) + :: + :: yed: vase containing card + :: hil: card as mill + :: + =^ yed sac (~(slot wa sac) 3 hex) + =^ hil sac (refine-card yed) + [[%give hil] sac] + :: + $pass + =. sac (~(neat wa sac) -:!>([%pass *path *term *card]) %& hex) + :: + :: yed: vase containing card + :: hil: card as mill + :: + =^ yed sac (~(slot wa sac) 15 hex) + =^ hil sac (refine-card yed) + [[%pass (path +6:p.hex) (term +14:p.hex) hil] sac] + == + :: :: ++refine-card:me + ++ refine-card :: card from vase + |= vax/vase + ^- (pair mill worm) + :: + :: specialize span to actual card data + :: + =^ hex sac (~(sped wa sac) vax) + =^ hip sac (~(nell wa sac) p.hex) + ?> hip + ?. ?=($meta -.q.hex) + :: + :: for an non-meta card, the mill is the vase + :: + [[%& hex] sac] + :: + :: tiv: vase of vase of card + :: typ: vase of span + :: + =^ tiv sac (~(slot wa sac) 3 hex) + =^ hip sac (~(nell wa sac) p.tiv) + ?> hip + =^ typ sac (~(slot wa sac) 2 tiv) + =. sac (~(neat wa sac) -:!>(*type) %& hex) + :: + :: support for meta-meta-cards has been removed + :: + [[%| (^ q.tiv)] sac] + -- :: me :: ++ symp :: symbol or empty |= a=* ^- @tas
Remove the duplicate early_data_status check
@@ -2063,14 +2063,6 @@ static int ssl_tls13_parse_encrypted_extensions( mbedtls_ssl_context *ssl, #if defined(MBEDTLS_SSL_EARLY_DATA) case MBEDTLS_TLS_EXT_EARLY_DATA: - if( ssl->early_data_status != MBEDTLS_SSL_EARLY_DATA_STATUS_INDICATION_SENT ) - { - /* The server must not send the EarlyDataIndication if the - * client hasn't indicated the use of early data. */ - MBEDTLS_SSL_PEND_FATAL_ALERT( MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER, - MBEDTLS_ERR_SSL_ILLEGAL_PARAMETER ); - return( MBEDTLS_ERR_SSL_ILLEGAL_PARAMETER ); - } if( extension_data_len != 0 ) {
Comment why doCdataSection's default case is never executed. Also add comment tags so that lcov can ignore the unreachable code
@@ -3756,8 +3756,16 @@ doCdataSection(XML_Parser parser, } return XML_ERROR_UNCLOSED_CDATA_SECTION; default: + /* Every token returned by XmlCdataSectionTok() has its own + * explicit case, so this default case will never be executed. + * We retain it as a safety net and exclude it from the coverage + * statistics. + * + * LCOV_EXCL_START + */ *eventPP = next; return XML_ERROR_UNEXPECTED_STATE; + /* LCOV_EXCL_STOP */ } *eventPP = s = next;
Add pin setting as a button
@@ -54,6 +54,14 @@ void USB0_IRQHandler(void) #define LED_PIN_FUNCTION kPORT_MuxAsGpio #define LED_STATE_ON 0 +// Button +#define BUTTON_PORT GPIOC +#define BUTTON_PIN_CLOCK kCLOCK_PortC +#define BUTTON_PIN_PORT PORTC +#define BUTTON_PIN 9U +#define BUTTON_PIN_FUNCTION kPORT_MuxAsGpio +#define BUTTON_STATE_ACTIVE 0 + // UART #define UART_PORT UART0 #define UART_PIN_CLOCK kCLOCK_PortA @@ -86,6 +94,18 @@ void board_init(void) GPIO_PinInit(LED_PORT, LED_PIN, &led_config); board_led_write(false); +#if defined(BUTTON_PORT) && defined(BUTTON_PIN) + // Button + CLOCK_EnableClock(BUTTON_PIN_CLOCK); + port_pin_config_t button_port = { + .pullSelect = kPORT_PullUp, + .mux = BUTTON_PIN_FUNCTION, + }; + PORT_SetPinConfig(BUTTON_PIN_PORT, BUTTON_PIN, &button_port); + gpio_pin_config_t button_config = { kGPIO_DigitalInput, 0 }; + GPIO_PinInit(BUTTON_PORT, BUTTON_PIN, &button_config); +#endif + // UART CLOCK_EnableClock(UART_PIN_CLOCK); PORT_SetPinMux(UART_PIN_PORT, UART_PIN_RX, UART_PIN_FUNCTION); @@ -119,6 +139,9 @@ void board_led_write(bool state) uint32_t board_button_read(void) { +#if defined(BUTTON_PORT) && defined(BUTTON_PIN) + return BUTTON_STATE_ACTIVE == GPIO_ReadPinInput(BUTTON_PORT, BUTTON_PIN); +#endif return 0; }
Simplify code around next_proto.len by changing 'len' data type. clean an useless static qualifier and a dead comment.
@@ -106,8 +106,6 @@ static DH *load_dh_param(const char *dhfile); #endif static void print_connection_info(SSL *con); -/* static int load_CA(SSL_CTX *ctx, char *file);*/ - static const int bufsize = 16 * 1024; static int accept_socket = -1; @@ -140,14 +138,13 @@ static const char *session_id_prefix = NULL; #ifndef OPENSSL_NO_DTLS static int enable_timeouts = 0; static long socket_mtu; - -#endif static int dtlslisten = 0; +#endif static int early_data = 0; #ifndef OPENSSL_NO_PSK -static char *psk_identity = "Client_identity"; +static const char psk_identity[] = "Client_identity"; char *psk_key = NULL; /* by default PSK is not used */ static unsigned int psk_server_cb(SSL *ssl, const char *identity, @@ -452,7 +449,6 @@ static int ssl_servername_cb(SSL *s, int *ad, void *arg) } /* Structure passed to cert status callback */ - typedef struct tlsextstatusctx_st { int timeout; /* File to load OCSP Response from (or NULL if no file) */ @@ -632,7 +628,7 @@ static int cert_status_cb(SSL *s, void *arg) /* This is the context that we pass to next_proto_cb */ typedef struct tlsextnextprotoctx_st { unsigned char *data; - unsigned int len; + size_t len; } tlsextnextprotoctx; static int next_proto_cb(SSL *s, const unsigned char **data, @@ -978,7 +974,7 @@ int s_server_main(int argc, char *argv[]) tlsextalpnctx alpn_ctx = { NULL, 0 }; #ifndef OPENSSL_NO_PSK /* by default do not send a PSK identity hint */ - static char *psk_identity_hint = NULL; + char *psk_identity_hint = NULL; char *p; #endif #ifndef OPENSSL_NO_SRP @@ -1606,22 +1602,16 @@ int s_server_main(int argc, char *argv[]) } #if !defined(OPENSSL_NO_NEXTPROTONEG) if (next_proto_neg_in) { - size_t len; - next_proto.data = next_protos_parse(&len, next_proto_neg_in); + next_proto.data = next_protos_parse(&next_proto.len, next_proto_neg_in); if (next_proto.data == NULL) goto end; - next_proto.len = len; - } else { - next_proto.data = NULL; } #endif alpn_ctx.data = NULL; if (alpn_in) { - size_t len; - alpn_ctx.data = next_protos_parse(&len, alpn_in); + alpn_ctx.data = next_protos_parse(&alpn_ctx.len, alpn_in); if (alpn_ctx.data == NULL) goto end; - alpn_ctx.len = len; } if (crl_file) {
tools/ramdump: Add callstack log parsing feature This scripts catch addr from "[<addr>]" and run addr2line ex) Input : unwind_backtrace_with_fp: [<0x4001dc04>] Output : /root/tizenrt/os/fs/vfs/fs_poll.c:382
@@ -24,11 +24,13 @@ from Tkinter import * import tkFileDialog import os import tempfile +import subprocess modes = ( ("AssertLog",1), ("AssertLogFile",2), ("Ramdump",3), + ("CallStackLog",4), ) g_elfpath = "../../build/output/bin/tinyara" @@ -95,6 +97,8 @@ class DumpParser(Tk): self.logpath.pack(anchor=W) elif self.modevar.get() == 3: self.ramdumppath.pack(anchor=W) + elif self.modevar.get() == 4: + self.logtext.pack(anchor=W) def RunDumpParser(self): resWin = Toplevel(self) @@ -125,6 +129,17 @@ class DumpParser(Tk): " -r " + self.ramdumppath.path.get()) as fd: output = fd.read() resText.insert(INSERT, output) + elif self.modevar.get() == 4: + text = self.logtext.get("1.0",END) + lines = filter(None, text.split("\n")) + for line in lines: + addr_start = line.find("[<") + addr_end = line.find(">]") + addr = line[addr_start+2:addr_end] + cmd = ['addr2line', '-e', self.elfpath.path.get(), addr] + fd_popen = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout + data = fd_popen.read() + resText.insert(INSERT, data) if __name__ == "__main__": app = DumpParser()
bleprph_oic; sys/log -> sys/log/stub and sys/stats -> sys/stats/stub.
@@ -24,7 +24,6 @@ pkg.keywords: pkg.deps: - kernel/os - - sys/log - net/nimble/controller - net/nimble/host - net/nimble/host/services/gap @@ -32,7 +31,8 @@ pkg.deps: - net/nimble/host/store/ram - net/nimble/transport/ram - sys/console/full - - libc/baselibc + - sys/log/stub + - sys/stats/stub - mgmt/oicmgr - sys/sysinit - sys/shell
ia32/page.c fixed _page_showPages() adding empty lines
@@ -270,9 +270,11 @@ void _page_showPages(void) /* Print markers in case of memory gap */ if (p->addr > a) { if ((rep = (p->addr - a) / SIZE_PAGE) >= 4) { - k = page_digits(rep, 10); - if ((w += k + 3) > 80) { - lib_printf("\nvm: "); + k = page_digits(rep, 10) + 3; + if ((w += k) > 80) { + if (w - k < 80) + lib_printf("\n"); + lib_printf("vm: "); w = k + 7; } lib_printf("[%dx]", rep); @@ -280,7 +282,7 @@ void _page_showPages(void) else { for (k = 0; k < rep; k++) { if (++w > 80) { - lib_printf("\nvm: "); + lib_printf("vm: "); w = 5; } lib_printf("%c", 'x'); @@ -296,9 +298,11 @@ void _page_showPages(void) } if (rep >= 4) { - k = page_digits(rep + 1, 10); - if ((w += k + 3) > 80) { - lib_printf("\nvm: "); + k = page_digits(rep + 1, 10) + 3; + if ((w += k) > 80) { + if (w - k < 80) + lib_printf("\n"); + lib_printf("vm: "); w = k + 7; } lib_printf("[%d%c]", rep + 1, c); @@ -306,7 +310,7 @@ void _page_showPages(void) else { for (k = 0; k <= rep; k++) { if (++w > 80) { - lib_printf("\nvm: "); + lib_printf("vm: "); w = 5; } lib_printf("%c", pmap_marker(p));
pybricks/parameters/Color: implement scaling
@@ -96,6 +96,49 @@ STATIC void pb_type_Color_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { dest[1] = MP_OBJ_SENTINEL; } +STATIC mp_obj_t parameters_Color_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { + + parameters_Color_obj_t *self = MP_OBJ_TO_PTR(lhs_in); + + #if MICROPY_PY_BUILTINS_FLOAT + mp_float_t value; + #else + mp_int_t value; + #endif + + switch (op) { + case MP_BINARY_OP_MULTIPLY: + case MP_BINARY_OP_REVERSE_MULTIPLY: + #if MICROPY_PY_BUILTINS_FLOAT + value = mp_obj_get_float(rhs_in) * self->hsv.v; + #else + value = pb_obj_get_int(rhs_in) * self->hsv.v; + #endif + break; + case MP_BINARY_OP_FLOOR_DIVIDE: + value = self->hsv.v / pb_obj_get_int(rhs_in); + break; + #if MICROPY_PY_BUILTINS_FLOAT + case MP_BINARY_OP_TRUE_DIVIDE: + value = self->hsv.v / mp_obj_get_float(rhs_in); + break; + #endif + default: + // Other operations not supported + return MP_OBJ_NULL; + } + + // Scale value + if (value > 100) { + value = 100; + } + if (value < 0) { + value = 0; + } + + // Create and return a new Color + return parameters_Color_make_new_helper(self->hsv.h, self->hsv.s, (uint8_t)value, self->name); +} STATIC const mp_rom_map_elem_t pb_type_Color_table[] = { { MP_ROM_QSTR(MP_QSTR_RED), MP_ROM_PTR(&_pb_Color_RED_obj)}, @@ -109,6 +152,7 @@ const mp_obj_type_t pb_type_Color = { .print = pb_type_Color_print, .unary_op = mp_generic_unary_op, .make_new = parameters_Color_make_new, + .binary_op = parameters_Color_binary_op, .locals_dict = (mp_obj_dict_t *)&(pb_type_Color_locals_dict), };
fix plasma test link line
@@ -14,14 +14,8 @@ if test "x$PLASMA_DIR" = "x"; then echo AC_ERROR([PLASMA_DIR not defined - please load plasma environment.]) else - AC_MSG_RESULT([no]) + AC_MSG_RESULT([yes]) fi - -# unset default compilers and detect compiler toolchain from environment -CC=" " -F77=" " -FC=" " - # test compilers AC_PROG_CC AC_PROG_F77 @@ -34,12 +28,12 @@ if test "x$LMOD_FAMILY_COMPILER" = "xintel"; then CFLAGS="-I ${PLASMA_INC} -I ${MKLROOT}/include ${CFLAGS}" FFLAGS="-I ${PLASMA_INC} -I ${MKLROOT}/include ${FFLAGS}" FCFLAGS="-I ${PLASMA_INC} -I ${MKLROOT}/include ${FFLAGS}" - LDFLAGS="-L${PLASMA_LIB} -lplasma -lmkl_rt ${LDFLAGS}" + LDFLAGS="-L${PLASMA_LIB} -lplasma -lcoreblasqw -lcoreblas -lquark -lmkl_rt -lpthread -lm ${LDFLAGS}" else - CFLAGS="-I ${PLASMA_INC} -I ${SCALAPACK_INC} ${CFLAGS}" - FFLAGS="-I ${PLASMA_INC} -I ${SCALAPACK_INC} ${FFLAGS}" - FCFLAGS="-I ${PLASMA_INC} -I ${SCALAPACK_INC} ${FFLAGS}" - LDFLAGS="-L${PLASMA_LIB} -lplasma -L${SCALAPACK_LIB} -lscalapack ${LDFLAGS}" + CFLAGS="-I ${PLASMA_INC} ${CFLAGS}" + FFLAGS="-I ${PLASMA_INC} ${FFLAGS}" + FCFLAGS="-I ${PLASMA_INC} ${FFLAGS}" + LDFLAGS="-L${PLASMA_LIB} -lplasma -lcoreblasqw -lcoreblas -lquark -L${OPENBLAS_LIB} -lopenblas -lpthread -lm ${LDFLAGS}" fi
Improve Datapath ETW Profile
<Profiles> <SystemCollector Id="SC_HighVolume" Realtime="false"> <BufferSize Value="1024"/> - <Buffers Value="20"/> + <Buffers Value="60"/> </SystemCollector> <EventCollector Id="EC_LowVolume" Name="LowVolume"> - <BufferSize Value="16"/> + <BufferSize Value="128"/> <Buffers Value="32"/> </EventCollector> <EventCollector Id="EC_HighVolume" Name="High Volume"> - <BufferSize Value="128"/> + <BufferSize Value="1024"/> <Buffers Value="64"/> </EventCollector> <Keyword Value="CpuConfig"/> <Keyword Value="Loader"/> <Keyword Value="ProcessThread"/> - <Keyword Value="CSwitch"/> + <Keyword Value="SampledProfile"/> </Keywords> + <Stacks> + <Stack Value="SampledProfile"/> + </Stacks> </SystemProvider> <EventProvider Id="EP_MsQuicEtw" Name="ff15e657-4f26-570e-88ab-0796b258d11c" NonPagedMemory="true" /> </Profile> <Profile Id="Scheduling.Verbose.Memory" Base="Scheduling.Verbose.File" Name="Scheduling" Description="Used for debugging scheduling" LoggingMode="Memory" DetailLevel="Verbose"/> + <Profile Id="Datapath.Light.File" Name="Datapath" Description="Used for debugging datapath" LoggingMode="File" DetailLevel="Light"> + <Collectors> + <EventCollectorId Value="EC_HighVolume"> + <EventProviders> + <EventProviderId Value="EP_MsQuicEtw_LowVolume_DataPath" /> + </EventProviders> + </EventCollectorId> + </Collectors> + </Profile> + <Profile Id="Datapath.Light.Memory" Base="Datapath.Light.File" Name="Datapath" Description="Used for debugging datapath" LoggingMode="Memory" DetailLevel="Light"/> + <Profile Id="Datapath.Verbose.File" Name="Datapath" Description="Used for debugging datapath" LoggingMode="File" DetailLevel="Verbose"> <Collectors> + <SystemCollectorId Value="SC_HighVolume"> + <SystemProviderId Value="SP_SystemThreadExecution" /> + </SystemCollectorId> <EventCollectorId Value="EC_HighVolume"> <EventProviders> <EventProviderId Value="EP_MsQuicEtw_LowVolume_DataPath" />
fix compiling error with marvell pp2 plugin fix compile issue "src/plugins/marvell/pp2/pp2.c:247:62: error: 'vm' undeclared (first use in this function)"
@@ -179,6 +179,7 @@ mrvl_pp2_delete_if (mrvl_pp2_if_t * ppif) void mrvl_pp2_create_if (mrvl_pp2_create_if_args_t * args) { + vlib_main_t *vm = vlib_get_main (); vnet_main_t *vnm = vnet_get_main (); vlib_thread_main_t *tm = vlib_get_thread_main (); mrvl_pp2_main_t *ppm = &mrvl_pp2_main;
hw/scripts/common.sh; $OS might not be set when windows_detect() executes.
@@ -35,7 +35,7 @@ common_file_to_load () { # windows_detect() { WINDOWS=0 - if [ $OS = "Windows_NT" ]; then + if [ "$OS" = "Windows_NT" ]; then WINDOWS=1 fi if [ $WINDOWS -eq 1 -a -z "$COMSPEC" ]; then
Simplify image extension check.
@@ -344,30 +344,14 @@ IconNode *LoadNamedIconHelper(const char *name, const char *path, char *temp; const unsigned nameLength = strlen(name); const unsigned pathLength = strlen(path); + const char hasExtension = strchr(name, '.') != NULL; unsigned i; - char hasExtension; /* Full file name. */ temp = AllocateStack(nameLength + pathLength + MAX_EXTENSION_LENGTH + 1); memcpy(&temp[0], path, pathLength); memcpy(&temp[pathLength], name, nameLength + 1); - /* Determine if the extension is provided. - * We avoid extra file opens if so. - */ - hasExtension = 0; - for(i = 1; i < EXTENSION_COUNT; i++) { - const unsigned offset = nameLength + pathLength; - const unsigned extLength = strlen(ICON_EXTENSIONS[i]); - if(JUNLIKELY(offset < extLength)) { - continue; - } - if(!strcmp(ICON_EXTENSIONS[i], &temp[offset])) { - hasExtension = 1; - break; - } - } - /* Attempt to load the image. */ image = NULL; if(hasExtension) {
doc: Add a link to Win32 unofficial daily builds
@@ -100,6 +100,10 @@ or Run the relevant [`setup-*.exe`](https://cygwin.com/install.html), and select "the\_silver\_searcher" in the "Utils" category. +### Windows + +Unofficial daily builds are [available](https://github.com/k-takata/the_silver_searcher-win32). + ## Building from source ### Building master
compat: mingw: fix dependency patch path
@@ -79,16 +79,16 @@ buildnixdep () { fi # patch and build the dependency if necessary - pushd $dir - if [ ! -e .mingw~ ] + if [ ! -e $dir/.mingw~ ] then - local patch=../urbit/compat/mingw/$key.patch - [ -e $patch ] && patch -p 1 <$patch + local patch=compat/mingw/$key.patch + [ -e $patch ] && patch -d $dir -p 1 <$patch + pushd $dir eval "$cmdprep" eval make "$cmdmake" touch .mingw~ - fi popd + fi # if configured, upload freshly built dependency to binary cache if [ -n "$hash" -a -n "${CACHIX_AUTH_TOKEN-}" ]
Remove Yotta: Python port of
@@ -31,7 +31,7 @@ import subprocess import logging # Naming patterns to check against -MACRO_PATTERN = r"^MBEDTLS_[0-9A-Z_]*[0-9A-Z]$|^YOTTA_[0-9A-Z_]*[0-9A-Z]$" +MACRO_PATTERN = r"^MBEDTLS_[0-9A-Z_]*[0-9A-Z]$" IDENTIFIER_PATTERN = r"^(mbedtls|psa)_[0-9a-z_]*[0-9a-z]$" class Match(object):
Don't show traceback for `SystemExit` and `KeyboardInterrupt` on command runner
@@ -33,6 +33,10 @@ def main(): spec = importlib.util.spec_from_file_location("__main__", module_path) script = importlib.util.module_from_spec(spec) spec.loader.exec_module(script) + except KeyboardInterrupt: + pass + except SystemExit: + pass except: print(traceback.format_exc())
Minor enhancements in java binding.
} catch (final Exception e) { throw new Error(String.format( "Error while loading '%s'", - lib)); + lib), e); } } } while (progress); .createTempFile("tinyspline", null); tmp.deleteOnExit(); out = new java.io.FileOutputStream(tmp); - final byte[] buffer = new byte[4096]; + final byte[] buffer = new byte[16384]; int read = -1; while((read = in.read(buffer)) != -1) { out.write(buffer, 0, read); return tmp; } catch (final Exception e) { throw new Error(String.format( - "Error while copying resource '%s'", file)); + "Error while copying resource '%s'", + file), e); } finally { closeQuietly(in); closeQuietly(out); } catch (Exception e) { throw new Error(String.format( "Error while loading properties file '%s'", - file)); + file), e); } finally { closeQuietly(is); }
Fix shebang at start of GnuTLS install script
+#!/bin/bash # # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # express or implied. See the License for the specific language governing # permissions and limitations under the License. # -#!/bin/bash set -e
Store last folder used in create to local storage
@@ -4,7 +4,20 @@ import cx from "classnames"; import { DotsIcon } from "../components/library/Icons"; import stripInvalidFilenameCharacters from "../lib/stripInvalidFilenameCharacters"; import createProject, { ERR_PROJECT_EXISTS } from "../lib/createProject"; -import { ipcRenderer } from "electron"; +import { ipcRenderer, remote } from "electron"; + +const getLastUsedPath = () => { + const storedPath = localStorage.getItem("__lastUsedPath"); + if (storedPath) { + return storedPath; + } else { + return remote.app.getPath("documents"); + } +}; + +const setLastUsedPath = path => { + localStorage.setItem("__lastUsedPath", path); +}; class Splash extends Component { constructor() { @@ -14,7 +27,7 @@ class Splash extends Component { tab: "new", name: "Untitled", target: "gbhtml", - path: "/Users/cmaltby/Projects/", + path: getLastUsedPath(), nameError: null }; } @@ -54,8 +67,10 @@ class Splash extends Component { onSelectFolder = e => { if (e.target.files && e.target.files[0]) { + const newPath = e.target.files[0].path + "/"; + setLastUsedPath(newPath); this.setState({ - path: e.target.files[0].path + "/" + path: newPath }); } }; @@ -94,16 +109,6 @@ class Splash extends Component { > New </div> - <div - className={cx("Splash__Tab", { - "Splash__Tab--Active": tab === "recent" - })} - onClick={this.onSetTab("recent")} - > - Recent - </div> - <div className="Splash__FlexSpacer" /> - <div className="Splash__Tab" onClick={this.onOpen}> Open </div> @@ -121,7 +126,7 @@ class Splash extends Component { <div className="Splash__FormGroup"> <label>Target system</label> <select value={target} onChange={this.onChange("target")}> - <option value="gbhtml">HTML</option> + <option value="gbhtml">GB + HTML</option> </select> </div>
include/openssl/opensslconf.h.in: remove spurious HEADER_FILE_H definition This macro was never defined in existing releases, there's no reason for us to create a macro that we immediately deprecate.
@@ -66,8 +66,5 @@ extern "C" { # endif # include <openssl/macros.h> -# if !OPENSSL_API_3 -# define HEADER_FILE_H /* deprecated in version 3.0 */ -# endif #endif /* OPENSSL_OPENSSLCONF_H */
log: reomve KLOG_ENABLE define klog is added to all architectures
#define TCGETS 0x405c7401 -/* Temporary until all uart drivers support reading from kernel log */ -#if KLOG_ENABLE typedef struct _log_rmsg_t { void *odata; @@ -334,13 +332,10 @@ static void log_msgthr(void *arg) } } -#endif /* KLOG_ENABLE */ - int log_write(const char *data, size_t len) { int i = 0; -#if KLOG_ENABLE int overwrite = 0; char c; @@ -361,10 +356,6 @@ int log_write(const char *data, size_t len) if (i > 0) _log_readersUpdate(); proc_lockClear(&log_common.lock); -#else - for (i = 0; i < len; ++i) - hal_consolePutch(data[i]); -#endif /* KLOG_ENABLE */ return len; } @@ -372,20 +363,16 @@ int log_write(const char *data, size_t len) void _log_start(void) { -#if KLOG_ENABLE /* Create port 0 for /dev/kmsg */ if (proc_portCreate(&log_common.oid.port) != 0) return; proc_threadCreate(NULL, log_msgthr, NULL, 4, 2048, NULL, 0, NULL); -#endif /* KLOG_ENABLE */ } void _log_init(void) { -#if KLOG_ENABLE hal_memset(&log_common, 0, sizeof(log_common)); proc_lockInit(&log_common.lock); -#endif /* KLOG_ENABLE */ }
board/kinox/power_detection.c: Format with clang-format BRANCH=none TEST=none
/******************************************************************************/ static const char *const adp_id_names[] = { - "unknown", - "tiny", - "tio1", - "tio2", - "typec", + "unknown", "tiny", "tio1", "tio2", "typec", }; /* ADP_ID control */ @@ -300,9 +296,9 @@ void set_the_obp(int power_type_index, int adp_type) DEDICATED_CHARGE_PORT, &pi); break; case TINY: - charge_manager_update_charge( - CHARGE_SUPPLIER_DEDICATED, - DEDICATED_CHARGE_PORT, &pi); + charge_manager_update_charge(CHARGE_SUPPLIER_DEDICATED, + DEDICATED_CHARGE_PORT, + &pi); break; } } @@ -362,18 +358,18 @@ void adp_id_deferred(void) switch (adp_type) { case TIO1: - power_type_len = sizeof(tio1_power) / - sizeof(struct adpater_id_params); + power_type_len = + sizeof(tio1_power) / sizeof(struct adpater_id_params); memcpy(&power_type, &tio1_power, sizeof(tio1_power)); break; case TIO2: - power_type_len = sizeof(tio2_power) / - sizeof(struct adpater_id_params); + power_type_len = + sizeof(tio2_power) / sizeof(struct adpater_id_params); memcpy(&power_type, &tio2_power, sizeof(tio2_power)); break; case TINY: - power_type_len = sizeof(tiny_power) / - sizeof(struct adpater_id_params); + power_type_len = + sizeof(tiny_power) / sizeof(struct adpater_id_params); memcpy(&power_type, &tiny_power, sizeof(tiny_power)); break; } @@ -405,8 +401,8 @@ static void typec_adapter_setting(void) /* Check the barrel jack is not present */ if (gpio_get_level(GPIO_BJ_ADP_PRESENT_ODL)) { adapter_current_ma = charge_manager_get_charger_current(); - power_type_len = sizeof(typec_power) / - sizeof(struct adpater_id_params); + power_type_len = + sizeof(typec_power) / sizeof(struct adpater_id_params); memcpy(&power_type, &typec_power, sizeof(typec_power)); for (i = (power_type_len - 1); i >= 0; i--) {