message
stringlengths
6
474
diff
stringlengths
8
5.22k
options/ansi: Implemented towlower() and towupper()
@@ -283,13 +283,19 @@ int toupper(int nc) { // wchar_t conversion functions. // -------------------------------------------------------------------------------------- -wint_t towlower(wint_t) { - __ensure(!"Not implemented"); - __builtin_unreachable(); +wint_t towlower(wint_t wc) { + auto cc = mlibc::platform_wide_charcode(); + mlibc::codepoint cp; + if(auto e = cc->promote(wc, cp); e != mlibc::charcode_error::null) + return wc; + return mlibc::current_charset()->to_lower(cp); } -wint_t towupper(wint_t) { - __ensure(!"Not implemented"); - __builtin_unreachable(); +wint_t towupper(wint_t wc) { + auto cc = mlibc::platform_wide_charcode(); + mlibc::codepoint cp; + if(auto e = cc->promote(wc, cp); e != mlibc::charcode_error::null) + return wc; + return mlibc::current_charset()->to_upper(cp); }
request mn list faster and from more peers
@@ -968,13 +968,13 @@ void ThreadCheckDarkSendPool(void* parg) masternodePayments.CleanPaymentList(); } - int mnRefresh = 90; //(5*5) + int mnRefresh = 15; //(3*5) //try to sync the masternode list and payment list every 90 seconds from at least 3 nodes - if(c % mnRefresh == 0 && RequestedMasterNodeList < 3){ + if(vNodes.size() > 3 && c % mnRefresh == 0 && RequestedMasterNodeList < 6){ bool fIsInitialDownload = IsInitialBlockDownload(); if(!fIsInitialDownload) { - //LOCK(cs_vNodes); + LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { if (pnode->nVersion >= darkSendPool.PROTOCOL_VERSION) {
fix(group): be sure the default group pointer points to a proper place
@@ -92,6 +92,9 @@ void lv_group_del(lv_group_t * group) indev = lv_indev_get_next(indev); } + /*If the group is the default group, set the default group as NULL*/ + if(group == lv_group_get_default()) lv_group_set_default(NULL); + _lv_ll_clear(&(group->obj_ll)); _lv_ll_remove(&LV_GC_ROOT(_lv_group_ll), group); lv_free(group);
Do not refresh watchdog in rtimer busy-wait macros
#include "dev/watchdog.h" #include <stdbool.h> +#if CONTIKI_TARGET_COOJA +#include "lib/simEnvChange.h" +#include "sys/cooja_mt.h" +#endif + /** \brief The rtimer size (in bytes) */ #ifdef RTIMER_CONF_CLOCK_SIZE #define RTIMER_CLOCK_SIZE RTIMER_CONF_CLOCK_SIZE @@ -189,14 +194,24 @@ void rtimer_arch_schedule(rtimer_clock_t t); #endif /* RTIMER_CONF_GUARD_TIME */ /** \brief Busy-wait until a condition. Start time is t0, max wait time is max_time */ +#if CONTIKI_TARGET_COOJA #define RTIMER_BUSYWAIT_UNTIL_ABS(cond, t0, max_time) \ ({ \ bool c; \ while(!(c = cond) && RTIMER_CLOCK_LT(RTIMER_NOW(), (t0) + (max_time))) { \ - watchdog_periodic(); \ + simProcessRunValue = 1; \ + cooja_mt_yield(); \ } \ c; \ }) +#else /* CONTIKI_TARGET_COOJA */ +#define RTIMER_BUSYWAIT_UNTIL_ABS(cond, t0, max_time) \ + ({ \ + bool c; \ + while(!(c = cond) && RTIMER_CLOCK_LT(RTIMER_NOW(), (t0) + (max_time))); \ + c; \ + }) +#endif /* CONTIKI_TARGET_COOJA */ /** \brief Busy-wait until a condition for at most max_time */ #define RTIMER_BUSYWAIT_UNTIL(cond, max_time) \
OcMachoLib: Fix expansion of images with segment size mismatch before last
@@ -1224,6 +1224,7 @@ MachoExpandImage64 ( UINT32 OriginalDelta; UINT64 CurrentSize; MACH_SEGMENT_COMMAND_64 *Segment; + MACH_SEGMENT_COMMAND_64 *FirstSegment; MACH_SEGMENT_COMMAND_64 *DstSegment; MACH_SYMTAB_COMMAND *Symtab; MACH_DYSYMTAB_COMMAND *DySymtab; @@ -1244,6 +1245,7 @@ MachoExpandImage64 ( CopyMem (Destination, Header, HeaderSize); CurrentDelta = 0; + FirstSegment = NULL; for ( Segment = MachoGetNextSegment64 (Context, NULL); Segment != NULL; @@ -1257,6 +1259,11 @@ MachoExpandImage64 ( if (Segment->FileSize > Segment->Size) { return 0; } + + if (FirstSegment == NULL) { + FirstSegment = Segment; + } + // // Do not overwrite header. // @@ -1295,6 +1302,11 @@ MachoExpandImage64 ( DstSegment = (MACH_SEGMENT_COMMAND_64 *) ((UINT8 *) Segment - Source + Destination); DstSegment->FileOffset += CurrentDelta; DstSegment->FileSize = DstSegment->Size; + + if (DstSegment->VirtualAddress - DstSegment->FileOffset != FirstSegment->VirtualAddress) { + return 0; + } + // // We need to update fields in SYMTAB and DYSYMTAB. Tables have to be present before 0 FileSize // sections as they have data, so we update them before parsing sections. @@ -1355,23 +1367,19 @@ MachoExpandImage64 ( // and later on the section values are checked by MachoLib. // Note: There is an assumption that 'CopyFileOffset + CurrentDelta' is aligned. // + OriginalDelta = CurrentDelta; + CopyFileOffset = Segment->FileOffset; for (Index = 0; Index < DstSegment->NumSections; ++Index) { if (DstSegment->Sections[Index].Offset == 0) { DstSegment->Sections[Index].Offset = (UINT32) CopyFileOffset + CurrentDelta; CurrentDelta += (UINT32) DstSegment->Sections[Index].Size; } else { DstSegment->Sections[Index].Offset += CurrentDelta; - OriginalDelta = (UINT32)(CopyFileOffset + DstSegment->Sections[Index].Size); CopyFileOffset = DstSegment->Sections[Index].Offset + DstSegment->Sections[Index].Size; } } - // - // After sections we may have extra padding (OriginalDelta), which may save us up to 1 page. - // The following is true for all valid data, and invalid data will be caught by fits check. - // CopyFileOffset + CurrentDelta <= DstSegment->FileOffset + DstSegment->FileSize - // - OriginalDelta = (UINT32)(DstSegment->FileOffset + DstSegment->FileSize - CopyFileOffset - CurrentDelta); - CurrentDelta -= MIN (OriginalDelta, CurrentDelta); + + CurrentDelta = OriginalDelta + Segment->Size - Segment->FileSize; } if (Strip) {
Update Mynewt repository.yaml for 1.9 release Missed this update for the release. This should point Mynewt to the latest release.
@@ -34,9 +34,10 @@ repo.versions: "1.7.1": "v1.7.1" "1.7.2": "v1.7.2" "1.8.0": "v1.8.0" + "1.9.0": "v1.9.0" "0-dev": "0.0.0" # main - "0-latest": "1.8.0" # latest stable release - "1-latest": "1.8.0" # latest stable release + "0-latest": "1.9.0" # latest stable release + "1-latest": "1.9.0" # latest stable release - "1.0-latest": "1.8.0" + "1.0-latest": "1.9.0"
Simplify RESET_STREAM reception code
@@ -6810,14 +6810,20 @@ static int conn_recv_reset_stream(ngtcp2_conn *conn, return NGTCP2_ERR_FINAL_SIZE; } + if (strm->flags & NGTCP2_STRM_FLAG_RECV_RST) { + return 0; + } + + if (strm->rx.max_offset < fr->final_size) { + return NGTCP2_ERR_FLOW_CONTROL; + } + datalen = fr->final_size - strm->rx.last_offset; - if (strm->rx.max_offset < fr->final_size || - conn_max_data_violated(conn, datalen)) { + if (conn_max_data_violated(conn, datalen)) { return NGTCP2_ERR_FLOW_CONTROL; } - if (!(strm->flags & NGTCP2_STRM_FLAG_RECV_RST)) { rv = conn_call_stream_reset(conn, fr->stream_id, fr->final_size, fr->app_error_code, strm->stream_user_data); if (rv != 0) { @@ -6830,7 +6836,6 @@ static int conn_recv_reset_stream(ngtcp2_conn *conn, ngtcp2_conn_extend_max_offset(conn, strm->rx.last_offset - ngtcp2_strm_rx_offset(strm)); } - } conn->rx.offset += datalen; ngtcp2_conn_extend_max_offset(conn, datalen);
[numerics] NM_LU_solve: add preserve for generic mechanical test
@@ -319,7 +319,7 @@ void gmp_gauss_seidel(GenericMechanicalProblem* pGMP, double * reaction, double for(size_t i = 0; i < curSize; ++i) sol[i] = -curProblem->q[i]; // resLocalSolver = NM_gesv(&M, sol, true); - resLocalSolver = NM_LU_solve(&M, sol, 1); + resLocalSolver = NM_LU_solve(NM_preserve(&M), sol, 1); M.matrix0 = NULL; NM_clear(&M);
No updates if current version is newer than announced version.
@@ -359,13 +359,21 @@ void DeRestPluginPrivate::internetDiscoveryExtractVersionInfo(QNetworkReply *rep if (!version.isEmpty()) { - if (gwUpdateVersion != version) + QStringList gwUpdateVersionList = gwUpdateVersion.split('.'); + QStringList versionList = version.split('.'); + if (((gwUpdateVersionList[0].toInt() < versionList[0].toInt())) || + ((gwUpdateVersionList[0].toInt() == versionList[0].toInt()) && (gwUpdateVersionList[1].toInt() < versionList[1].toInt())) || + ((gwUpdateVersionList[0].toInt() == versionList[0].toInt()) && (gwUpdateVersionList[1].toInt() == versionList[1].toInt()) && (gwUpdateVersionList[2].toInt() < versionList[2].toInt()))) { DBG_Printf(DBG_INFO, "discovery found version %s for update channel %s\n", qPrintable(version), qPrintable(gwUpdateChannel)); gwUpdateVersion = version; gwSwUpdateState = swUpdateState.readyToInstall; - updateEtag(gwConfigEtag); } + else + { + gwSwUpdateState = swUpdateState.noUpdate; + } + updateEtag(gwConfigEtag); } else {
sdl/events: tidy up #ifdef checks
@@ -5,10 +5,18 @@ package sdl #include "events.h" #if !SDL_VERSION_ATLEAST(2,0,9) +#if defined(WARN_OUTDATED) +#pragma message("SDL_DISPLAYEVENT is not supported before SDL 2.0.9") +#endif + #define SDL_DISPLAYEVENT (0x150) #endif #if !SDL_VERSION_ATLEAST(2,0,2) +#if defined(WARN_OUTDATED) +#pragma message("SDL_RENDER_TARGETS_RESET is not supported before SDL 2.0.2") +#endif + #define SDL_RENDER_TARGETS_RESET (0x2000) #endif @@ -16,36 +24,17 @@ package sdl #if defined(WARN_OUTDATED) #pragma message("SDL_KEYMAPCHANGED is not supported before SDL 2.0.4") -#endif - -#define SDL_KEYMAPCHANGED (0x304) - - -#if defined(WARN_OUTDATED) #pragma message("SDL_AUDIODEVICEADDED is not supported before SDL 2.0.4") -#endif - -#define SDL_AUDIODEVICEADDED (0x1100) - - -#if defined(WARN_OUTDATED) #pragma message("SDL_AUDIODEVICEREMOVED is not supported before SDL 2.0.4") -#endif - -#define SDL_AUDIODEVICEREMOVED (0x1101) - - -#if defined(WARN_OUTDATED) #pragma message("SDL_RENDER_DEVICE_RESET is not supported before SDL 2.0.4") +#pragma message("SDL_AudioDeviceEvent is not supported before SDL 2.0.4") #endif +#define SDL_KEYMAPCHANGED (0x304) +#define SDL_AUDIODEVICEADDED (0x1100) +#define SDL_AUDIODEVICEREMOVED (0x1101) #define SDL_RENDER_DEVICE_RESET (0x2001) - -#if defined(WARN_OUTDATED) -#pragma message("SDL_AudioDeviceEvent is not supported before SDL 2.0.4") -#endif - typedef struct SDL_AudioDeviceEvent { Uint32 type; @@ -56,29 +45,21 @@ typedef struct SDL_AudioDeviceEvent Uint8 padding2; Uint8 padding3; } SDL_AudioDeviceEvent; + #endif #if !SDL_VERSION_ATLEAST(2,0,5) #if defined(WARN_OUTDATED) #pragma message("SDL_DROPTEXT is not supported before SDL 2.0.5") -#endif - -#define SDL_DROPTEXT (0x1001) - - -#if defined(WARN_OUTDATED) #pragma message("SDL_DROPBEGIN is not supported before SDL 2.0.5") -#endif - -#define SDL_DROPBEGIN (0x1002) - - -#if defined(WARN_OUTDATED) #pragma message("SDL_DROPCOMPLETE is not supported before SDL 2.0.5") #endif +#define SDL_DROPTEXT (0x1001) +#define SDL_DROPBEGIN (0x1002) #define SDL_DROPCOMPLETE (0x1003) + #endif #if !SDL_VERSION_ATLEAST(2,0,9)
Always remove the old source when we resub a dropped /circle subscription.
|= src/source ^+ +> =+ seq=(~(get by sequence) cir.src) + =/ ner/range + ?~ seq ran.src + =- `[[%ud u.seq] -] + ?~ ran.src ~ + tal.u.ran.src + :: if our subscription changes or ends, remove + :: the original source. + =? +>.$ !=(ner ran.src) + (so-delta-our %config so-cir %source | src) :: if we're past the range, don't resubscribe. ?: ?& ?=(^ ran.src) ?=(^ tal.u.ran.src) == == == - (so-delta-our %follow | [src ~ ~]) - =- (so-delta-our %follow & [[cir.src -] ~ ~]) - ^- range - ?~ seq ran.src - =- `[[%ud u.seq] -] - ?~ ran.src ~ - tal.u.ran.src + +>.$ + (so-delta-our %follow & [[cir.src -] ~ ~]) :: ++ so-first-grams :> beginning of stream
ExtendedTools: Remove legacy code
@@ -426,19 +426,6 @@ VOID NTAPI EtEtwProcessesUpdatedCallback( runCount++; } -static VOID NTAPI EtpInvalidateNetworkNode( - _In_ PVOID Parameter - ) -{ - PPH_NETWORK_ITEM networkItem = Parameter; - PPH_NETWORK_NODE networkNode; - - if (networkNode = PhFindNetworkNode(networkItem)) - TreeNew_InvalidateNode(NetworkTreeNewHandle, &networkNode->Node); - - PhDereferenceObject(networkItem); -} - VOID NTAPI EtEtwNetworkItemsUpdatedCallback( _In_opt_ PVOID Parameter, _In_opt_ PVOID Context @@ -471,8 +458,9 @@ VOID NTAPI EtEtwNetworkItemsUpdatedCallback( if (memcmp(oldDeltas, block->Deltas, sizeof(block->Deltas))) { // Values have changed. Invalidate the network node. - PhReferenceObject(block->NetworkItem); - ProcessHacker_Invoke(PhMainWndHandle, EtpInvalidateNetworkNode, block->NetworkItem); + PhAcquireQueuedLockExclusive(&block->TextCacheLock); + memset(block->TextCacheValid, 0, sizeof(block->TextCacheValid)); + PhReleaseQueuedLockExclusive(&block->TextCacheLock); } listEntry = listEntry->Flink;
Add tui controls to README
@@ -52,6 +52,8 @@ Run `./tool --help` to see usage info. ## Run +### CLI interpreter + The CLI (`orca` binary) reads from a file and runs the orca simulation for 1 timestep (default) or a specified number (`-t` option) and writes the resulting state of the grid to stdout. ```sh @@ -63,6 +65,26 @@ You can also make orca read from stdin: echo -e "...\na34\n..." | orca /dev/stdin ``` +### Interactive terminal UI + +```sh +tui [options] [file] +``` + +Run the interactive terminal UI, useful for debugging or observing behavior. + +#### Controls + +- `ctrl+q` or `ctrl+d` or `ctrl+g`: quit +- Arrow keys or `ctrl+h/j/k/l`: move cursor +- `A`-`Z`, `a`-`z` and `0`-`9`: write character to grid at cursor +- Spacebar: step the simulation one tick +- `ctrl+u`: undo +- `[` and `]`: Adjust cosmetic grid rulers horizontally +- `{` and `}`: Adjust cosmetic grid rulers vertically +- `(` and `)`: resize grid horizontally +- `_` and `+`: resize grid vertically + ## Extras - Support this project through [Patreon](https://patreon.com/100).
[remove] redundant script.
@@ -7,10 +7,6 @@ objs = [] cwd = GetCurrentDir() list = os.listdir(cwd) -# the default version of LWIP is 2.0.2 -if not GetDepend('RT_USING_LWIP141') and not GetDepend('RT_USING_LWIP202') and not GetDepend('RT_USING_LWIP203') and not GetDepend('RT_USING_LWIP212'): - AddDepend('RT_USING_LWIP202') - for d in list: path = os.path.join(cwd, d) if os.path.isfile(os.path.join(path, 'SConscript')):
Check for empty asset name when creating the asset So that undoing a deletion wouldn't trigger error if asset name is empty. Also delete the asset if the asset name is empty, so that it's the same behavior as an invalid asset name.
@@ -1844,16 +1844,7 @@ AssetNode::setInternalValueInContext( // Create the Asset object as early as possible. We may need it before // the first compute. For example, Maya may call internalArrayCount. - - // When the AssetNode is first created, setInternalValueInContext() - // will be called with default values. But we don't want to try to - // create the Asset at that time, since it'll result in errors that's - // not caused by the user. So make sure the asset name is at least set - // to avoid getting false errors. - if(myAssetName.length()) - { rebuildAsset(); - } return true; } @@ -1932,6 +1923,11 @@ AssetNode::createAsset() return; } + // Make sure the asset name is set before trying to create the asset. + if(!myAssetName.length()) + { + return; + } myAsset = new Asset(myOTLFilePath, myAssetName, thisMObject());
Remove unused VerifyFileResult struct.
@@ -22,12 +22,6 @@ typedef enum /*********************************************************************************************************************************** Functions ***********************************************************************************************************************************/ -typedef struct VerifyFileResult -{ - VerifyResult fileResult; - String *filePathName; -} VerifyFileResult; - // Verify a file in the pgBackRest repository VerifyResult verifyFile( const String *filePathName, const String *fileChecksum, uint64_t fileSize, const String *cipherPass);
gall: adds verbose arg to agent scry implementation
:: ++ mo-peek ~/ %mo-peek - |= [dap=term =routes care=term =path] + |= [veb=? dap=term =routes care=term =path] ^- (unit (unit cage)) :: =/ app (ap-abed:ap dap routes) - (ap-peek:app care path) + (ap-peek:app veb care path) :: ++ mo-apply |= [dap=term =routes =deal] :: ++ ap-peek ~/ %ap-peek - |= [care=term tyl=path] + |= [veb=? care=term tyl=path] ^- (unit (unit cage)) :: take trailing mark off path for %x scrys :: =/ peek-result=(each (unit (unit cage)) tang) (ap-mule-peek |.((on-peek:ap-agent-core [care tyl]))) ?: ?=(%| -.peek-result) + ?. veb [~ ~] ((slog leaf+"peek bad result" p.peek-result) [~ ~]) :: for non-%x scries, or failed %x scries, or %x results that already :: have the requested mark, produce the result as-is ?. ?=(^ path) ~ =/ =routes [~ ship] - (mo-peek:mo dap routes care path) + (mo-peek:mo & dap routes care path) :: +stay: save without cache; suspend non-%base agents :: :: TODO: superfluous? see +molt
config: get "stty technique" working again on MacOS X. Addresses GH#2167.
@@ -502,9 +502,7 @@ case "$GUESSOS" in echo " invoke 'KERNEL_BITS=64 $THERE/config $options'." if [ "$DRYRUN" = "false" -a -t 1 ]; then echo " You have about 5 seconds to press Ctrl-C to abort." - # The stty technique used elsewhere doesn't work on - # MacOS. At least, right now on this Mac. - sleep 5 + (trap "stty `stty -g`; exit 1" 2; stty -icanon min 0 time 50; read waste; exit 0) <&1 || exit fi fi if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
changed ranking of warnings
@@ -602,6 +602,24 @@ if(taglenerrorcount > 0) printf("IE TAG length error (malformed packets)..: %ld if(essiderrorcount > 0) printf("ESSID error (malformed packets)..........: %ld\n", essiderrorcount); eapolmsgerrorcount = eapolmsgerrorcount +eapolm1errorcount +eapolm2errorcount +eapolm3errorcount +eapolm4errorcount; if(eapolmsgerrorcount > 0) printf("EAPOL messages (malformed packets).......: %ld\n", eapolmsgerrorcount); + +if(sequenceerrorcount > 0) + { + printf("\nWarning: out of sequence timestamps!\n" + "This dump file contains frames with out of sequence timestamps.\n"); + } +if(zeroedtimestampcount > 0) + { + printf("\nWarning: missing timestamps!\n" + "This dump file contains frames with zeroed timestamps.\n" + "That prevent calculation of EAPOL TIMEOUT values.\n"); + } +if(eapolmsgtimestamperrorcount > 0) + { + printf("\nWarning: wrong timestamps!\n" + "This dump file contains frames with wrong timestamps.\n" + "That prevent calculation of EAPOL TIMEOUT values.\n"); + } if(malformedcount > 10) { printf( "\nWarning: malformed packets detected!\n" @@ -611,7 +629,6 @@ if(malformedcount > 10) "a bit error in the payload it can lead to unexpected results.\n" "Please analyze the dump file with Wireshark.\n"); } - if((authenticationcount +associationrequestcount +reassociationrequestcount) == 0) { printf("\nWarning: missing frames!\n" @@ -621,7 +638,6 @@ if((authenticationcount +associationrequestcount +reassociationrequestcount) == "it could happen if filter options are used during capturing.\n" "That makes it hard to recover the PSK.\n"); } - if(proberequestcount == 0) { printf("\nWarning: missing frames!\n" @@ -631,7 +647,6 @@ if(proberequestcount == 0) "it could happen if filter options are used during capturing.\n" "That makes it hard to recover the PSK.\n"); } - if(eapolm1ancount <= 1) { printf("\nWarning: missing frames!\n" @@ -640,23 +655,6 @@ if(eapolm1ancount <= 1) "it could happen if filter options are used during capturing.\n" "That makes it impossible to calculate nonce-error-correction values.\n"); } -if(sequenceerrorcount > 0) - { - printf("\nWarning: out of sequence timestamps!\n" - "This dump file contains frames with out of sequence timestamps.\n"); - } -if(zeroedtimestampcount > 0) - { - printf("\nWarning: missing timestamps!\n" - "This dump file contains frames with zeroed timestamps.\n" - "That prevent calculation of EAPOL TIMEOUT values.\n"); - } -if(eapolmsgtimestamperrorcount > 0) - { - printf("\nWarning: wrong timestamps!\n" - "This dump file contains frames with wrong timestamps.\n" - "That prevent calculation of EAPOL TIMEOUT values.\n"); - } printf("\n"); return; }
Risky: prefer consumption out of order
@@ -2472,27 +2472,7 @@ inline static uintptr_t fio_risky_hash(const void *data_, size_t len, tmp |= ((uint64_t)data[1]) << 48; case 1: /* overflow */ tmp |= ((uint64_t)data[0]) << 56; -#if FIO_RISKY_CONSUME_LEFTOVER_IN_ORDER - /* ((len & 24) >> 3) is a 0-3 value representing the next state vector */ - /* `switch` allows v[i] to be a register without a memory address */ - /* using v[(len & 24) >> 3] forces implementation to use memory (bad) */ - switch ((len & 24) >> 3) { - case 3: fio_risky_consume(v[3], tmp); - break; - case 2: - fio_risky_consume(v[2], tmp); - break; - case 1: - fio_risky_consume(v[1], tmp); - break; - case 0: - fio_risky_consume(v[0], tmp); - break; - } -#else - fio_risky_consume(v[3], tmp); -#endif } /* merge and mix */
Tweak docstring.
@@ -1403,7 +1403,7 @@ static const JanetReg os_cfuns[] = { { "os/realpath", os_realpath, JDOC("(os/realpath path)\n\n" - "Get the absolute path for a given path, resolving the relative path, following ../, ./, and symlinks. " + "Get the absolute path for a given path, following ../, ./, and symlinks. " "Returns an absolute path as a string. Will raise an error on Windows.") }, #endif
fixed sound on weak devices with Android
#define CLOCKRATE (255<<13) #define TIC_DEFAULT_COLOR 15 -#define TIC_SOUND_RINGBUF_LEN 6 // in worst case, this induces ~ 6 tick delay i.e. 100 ms +#define TIC_SOUND_RINGBUF_LEN 12 // in worst case, this induces ~ 12 tick delay i.e. 200 ms typedef struct {
Minor code formatting update on MIME/TLS changes.
@@ -2333,13 +2333,14 @@ extract_mimemajor (const char *token) { /* official IANA registries as per https://www.iana.org/assignments/media-types/ */ - if ( - (lookfor = "application", !strncmp (token, lookfor, 11)) || + if ((lookfor = "application", !strncmp (token, lookfor, 11)) || (lookfor = "audio", !strncmp (token, lookfor, 5)) || (lookfor = "font", !strncmp (token, lookfor, 4)) || - (lookfor = "example", !strncmp (token, lookfor, 7)) || /* unlikely */ + /* unlikely */ + (lookfor = "example", !strncmp (token, lookfor, 7)) || (lookfor = "image", !strncmp (token, lookfor, 5)) || - (lookfor = "message", !strncmp (token, lookfor, 7)) || /* unlikely */ + /* unlikely */ + (lookfor = "message", !strncmp (token, lookfor, 7)) || (lookfor = "model", !strncmp (token, lookfor, 5)) || (lookfor = "multipart", !strncmp (token, lookfor, 9)) || (lookfor = "text", !strncmp (token, lookfor, 4)) || @@ -2355,8 +2356,7 @@ extract_mimemajor (const char *token) { * On success, the generated key is assigned to our key data structure. */ static int -gen_mime_type_key (GKeyData * kdata, GLogItem * logitem) -{ +gen_mime_type_key (GKeyData * kdata, GLogItem * logitem) { const char *major = NULL; if (!logitem->mime_type) @@ -2389,8 +2389,8 @@ extract_tlsmajor (const char *token) { (lookfor = "TLSv1.1", !strncmp (token, lookfor, 7)) || (lookfor = "TLSv1.2", !strncmp (token, lookfor, 7)) || (lookfor = "TLSv1.3", !strncmp (token, lookfor, 7)) || - (lookfor = "TLSv1", !strncmp (token, lookfor, 5)) // Nope, it's not 1.0 - ) + // Nope, it's not 1.0 + (lookfor = "TLSv1", !strncmp (token, lookfor, 5))) return lookfor; return NULL; } @@ -2401,8 +2401,7 @@ extract_tlsmajor (const char *token) { * On success, the generated key is assigned to our key data structure. */ static int -gen_tls_type_key (GKeyData * kdata, GLogItem * logitem) -{ +gen_tls_type_key (GKeyData * kdata, GLogItem * logitem) { const char *tls; if (!logitem->tls_type)
[catboost] improve exception message
#pragma once #include "model.h" + #include <catboost/libs/helpers/exception.h> + #include <util/generic/ymath.h> +#include <util/stream/labeled.h> + #include <emmintrin.h> constexpr size_t FORMULA_EVALUATION_BLOCK_SIZE = 128; @@ -318,7 +322,10 @@ inline void CalcGeneric( return; } - CB_ENSURE(results.size() == docCount * model.ObliviousTrees.ApproxDimension); + CB_ENSURE( + results.size() == docCount * model.ObliviousTrees.ApproxDimension, + "`results` size is insufficient: " + LabeledOutput(results.size(), docCount * model.ObliviousTrees.ApproxDimension)); std::fill(results.begin(), results.end(), 0.0); TVector<TCalcerIndexType> indexesVec(blockSize); TVector<int> transposedHash(blockSize * model.ObliviousTrees.CatFeatures.size());
parser: Add a very basic manifest loop. Not reachable by executable.
@@ -5189,6 +5189,52 @@ static void parser_loop(lily_parse_state *parser) } } +static void manifest_loop(lily_parse_state *parser) +{ + lily_lex_state *lex = parser->lex; + int key_id = -1; + + parser->flags |= PARSER_IN_MANIFEST; + + /* This is a trick inspired by "use strict". Code files passed to manifest + parsing will fail here. Manifest files passed to code parsing will fail + to load this module. */ + lily_next_token(lex); + expect_word(parser, "import"); + lily_next_token(lex); + expect_word(parser, "manifest"); + lily_next_token(lex); + + while (1) { + if (lex->token == tk_word) { + key_id = keyword_by_name(lex->label); + + if (key_id == KEY_DEFINE) { + lily_next_token(lex); + keyword_define(parser); + parse_block_exit(parser); + } + } + else if (lex->token == tk_right_curly) + parse_block_exit(parser); + else if (lex->token == tk_eof) { + lily_block *b = parser->emit->block; + + if (b->block_type != block_file) + lily_raise_syn(parser->raiser, "Unexpected token '%s'.", + tokname(tk_eof)); + + if (b->prev != NULL) + finish_import(parser); + else + break; + } + else + lily_raise_syn(parser->raiser, "Unexpected token '%s'.", + tokname(lex->token)); + } +} + static void update_main_name(lily_parse_state *parser, const char *filename) { @@ -5390,6 +5436,8 @@ int lily_parse_manifest(lily_state *s) parser->flags = 0; if (setjmp(parser->raiser->all_jumps->jump) == 0) { + manifest_loop(parser); + lily_pop_lex_entry(parser->lex); lily_mb_flush(parser->msgbuf);
map editor fix
@@ -1749,6 +1749,7 @@ static void studioTick() { Map* map = impl.editor[impl.bank.index.map].map; overline = map->overline; + scanline = map->scanline; data = map; memcpy(&tic->ram.vram.palette, &tic->cart.palette, sizeof(tic_palette)); }
Remove obsolete reference to io_reader.set_limit
@@ -294,13 +294,7 @@ func (g *gen) writeStatementIOBind(b *buffer, n *a.IOBind, depth uint32) error { b.writes(");\n") } else { - // TODO: restrict (in the type checker or parser) that e is - // args.foo? - b.printf("wuffs_base__io_%s__set_limit(&%s%s, iop_%s%s,\n", cTyp, prefix, name, prefix, name) - if err := g.writeExpr(b, n.Arg1(), 0); err != nil { - return err - } - b.writes(");\n") + return fmt.Errorf("TODO: implement io_limit (or remove it from the parser)") } }
Adds path to gsl libs on osx
@@ -44,6 +44,7 @@ install: - if ! [[ $TRAVIS_OS_NAME == "linux" ]]; then hash -r ; fi - if ! [[ $TRAVIS_OS_NAME == "linux" ]]; then source activate test-environment ; fi - if ! [[ $TRAVIS_OS_NAME == "linux" ]]; then export PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH ; fi + - if ! [[ $TRAVIS_OS_NAME == "linux" ]]; then export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH ; fi - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig - cmake --version
Move -dl -pthread to OPENSSL_LIBS
@@ -15,8 +15,7 @@ RUN apt-get update && \ cd ngtcp2 && autoreconf -i && \ ./configure \ LIBTOOL_LDFLAGS="-static-libtool-libs" \ - LIBS="-ldl -pthread" \ - OPENSSL_LIBS="-l:libssl.a -l:libcrypto.a" \ + OPENSSL_LIBS="-l:libssl.a -l:libcrypto.a -ldl -pthread" \ LIBEV_LIBS="-l:libev.a" \ JEMALLOC_LIBS="-l:libjemalloc.a -lm" && \ make -j$(nproc) && \
Jenkinsfile: increase timeout on no log output
@@ -1268,7 +1268,7 @@ def withDockerEnv(image, opts=[], cl) { } docker.withRegistry("https://${REGISTRY}", 'docker-hub-elektra-jenkins') { - timeout(activity: true, time: 10, unit: 'MINUTES') { + timeout(activity: true, time: 15, unit: 'MINUTES') { def cpu_count = cpuCount() withEnv(["MAKEFLAGS='-j${cpu_count+2} -l${cpu_count*2}'", "CTEST_PARALLEL_LEVEL='${cpu_count+2}'",
Fixed missing changed file on previous commit
</ResourceCompile> <Link> <AdditionalLibraryDirectories>src\common\mysql\lib</AdditionalLibraryDirectories> - <AdditionalDependencies>ws2_32.lib;wsock32.lib;libmysql.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>ws2_32.lib;libmysql.lib;%(AdditionalDependencies)</AdditionalDependencies> <OptimizeReferences>true</OptimizeReferences> <SubSystem>Windows</SubSystem> </Link> @@ -85,7 +85,7 @@ if defined GitRev ( </ResourceCompile> <Link> <AdditionalLibraryDirectories>src\common\mysql\lib</AdditionalLibraryDirectories> - <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>ws2_32.lib;libmysql.lib;%(AdditionalDependencies)</AdditionalDependencies> <OptimizeReferences>true</OptimizeReferences> <SubSystem>Windows</SubSystem> </Link> @@ -113,7 +113,7 @@ if defined GitRev ( </ResourceCompile> <Link> <AdditionalLibraryDirectories>src\common\mysql\lib</AdditionalLibraryDirectories> - <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>ws2_32.lib;libmysql.lib;%(AdditionalDependencies)</AdditionalDependencies> <OptimizeReferences>true</OptimizeReferences> <SubSystem>Windows</SubSystem> </Link> @@ -141,7 +141,7 @@ if defined GitRev ( </ResourceCompile> <Link> <AdditionalLibraryDirectories>src\common\mysql\lib</AdditionalLibraryDirectories> - <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>ws2_32.lib;libmysql.lib;%(AdditionalDependencies)</AdditionalDependencies> <OptimizeReferences>true</OptimizeReferences> <SubSystem>Windows</SubSystem> </Link>
drum: restrict +se-blin to expected/sane blits We only expect the two primary screen-draw blits here.
leaf+tape :: ++ se-blin :: print and newline - |= lin=dill-blit:dill + |= $= lin + $~ [%put ~] + $>(?(%put %klr) dill-blit:dill) ^+ +> :: newline means we need to redraw the prompt, :: so update the prompt mirror accordingly.
[mod_openssl] use 16k static buffer instead of 64k better match size used by openssl (avoid unused, oversized reads)
@@ -82,7 +82,7 @@ static int ssl_is_init; /* need assigned p->id for deep access of module handler_ctx for connection * i.e. handler_ctx *hctx = con->plugin_ctx[plugin_data_singleton->id]; */ static plugin_data *plugin_data_singleton; -#define LOCAL_SEND_BUFSIZE (64 * 1024) +#define LOCAL_SEND_BUFSIZE (16 * 1024) static char *local_send_buffer; typedef struct { @@ -1435,7 +1435,7 @@ load_next_chunk (server *srv, chunkqueue *cq, off_t max_bytes, { chunk *c = cq->first; - /* local_send_buffer is a 64k sendbuffer (LOCAL_SEND_BUFSIZE) + /* local_send_buffer is a static buffer of size (LOCAL_SEND_BUFSIZE) * * it has to stay at the same location all the time to satisfy the needs * of SSL_write to pass the SAME parameter in case of a _WANT_WRITE
Add Lambda function steps to 'Using the Library' doc
@@ -53,3 +53,19 @@ This again executes the `ps` command using the AppScope library. But here, we al For a full list of library environment variables, execute: `./libscope.so all` For the default settings in the sample `scope.yml` configuration file, see [Config Files](/docs/config-files), or inspect the most-recent file on [GitHub](https://github.com/criblio/appscope/blob/master/conf/scope.yml). + +### <span id="lambda">Deploying the Library in a Lambda Function</span> + +You can pull the libscope.so library into an AWS Lambda function as a [Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), using these steps: + +1. Run `scope extract`, e.g.: + ``` + scope extract /opt/<your-layer>/ + ``` + +1. Set these three environment variables: + ``` + LD_PRELOAD=/opt/<your-layer>/libscope.so + SCOPE_EXEC_PATH=/opt/<your-layer>/ldscope + SCOPE_CONF_PATH=/opt/<your-layer>/scope.yml + ```
tools: add passphrase to GPG key in gen-gpg-testkey
@@ -17,7 +17,7 @@ gpgme_error_t passphrase_cb (void * hook ELEKTRA_GEN_GPG_TESTKEY_UNUSED, const c const char * passphrase_info ELEKTRA_GEN_GPG_TESTKEY_UNUSED, int prev_was_bad ELEKTRA_GEN_GPG_TESTKEY_UNUSED, int fd) { - gpgme_io_writen (fd, "\n", 2); + gpgme_io_writen (fd, "Super-Secret-Passphrase-123456\n", 33); return 0; }
add fonts packages
@@ -43,9 +43,10 @@ tlmgr install \ ulem \ ifmtarg \ unicode-math \ - mathpple \ latex-tools \ - psnfss + psnfss \ + rsfs \ + times # Keep no backups (not required, simply makes cache bigger) tlmgr option -- autobackup 0
Improve code for testing
@@ -17,16 +17,37 @@ websocket-bench broadcast ws://127.0.0.1:3000/ --concurrent 10 \ */ +#include "spnlock.inc" #include "websockets.h" #include <string.h> +#ifdef __APPLE__ +#include <dlfcn.h> +#endif + FIOBJ CHANNEL_TEXT; FIOBJ CHANNEL_BINARY; +static size_t sub_count; +static size_t unsub_count; + +static void on_websocket_unsubscribe(void *udata) { + (void)udata; + spn_add(&unsub_count, 1); +} + +static void print_subscription_balance(void *a) { + fprintf(stderr, "* subscribe / on_unsubscribe count (%s): %zu / %zu\n", + (char *)a, sub_count, unsub_count); +} + static void on_open_shootout_websocket(ws_s *ws) { - websocket_subscribe(ws, .channel = CHANNEL_TEXT, .force_text = 1); - websocket_subscribe(ws, .channel = CHANNEL_BINARY, .force_binary = 1); + spn_add(&sub_count, 2); + websocket_subscribe(ws, .channel = CHANNEL_TEXT, .force_text = 1, + .on_unsubscribe = on_websocket_unsubscribe); + websocket_subscribe(ws, .channel = CHANNEL_BINARY, .force_binary = 1, + .on_unsubscribe = on_websocket_unsubscribe); } static void on_open_shootout_websocket_sse(http_sse_s *sse) { http_sse_subscribe(sse, .channel = CHANNEL_TEXT); @@ -136,6 +157,19 @@ int main(int argc, char const *argv[]) { websocket_optimize4broadcasts(WEBSOCKET_OPTIMIZE_PUBSUB_BINARY, 1); } +#ifdef __APPLE__ + /* patch for dealing with the High Sierra `fork` limitations */ + void *obj_c_runtime = dlopen("Foundation.framework/Foundation", RTLD_LAZY); + (void)obj_c_runtime; +#endif + + facil_core_callback_add(FIO_CALL_ON_SHUTDOWN, print_subscription_balance, + "on shutdown"); + facil_core_callback_add(FIO_CALL_ON_FINISH, print_subscription_balance, + "on finish"); + facil_core_callback_add(FIO_CALL_AT_EXIT, print_subscription_balance, + "at exit"); + facil_run(.threads = threads, .processes = workers); // free global resources. fiobj_free(CHANNEL_TEXT);
core: add OSSL_INOUT_CALLBACK
@@ -212,7 +212,8 @@ extern OSSL_provider_init_fn OSSL_provider_init; * application callback it knows about. */ typedef int (OSSL_CALLBACK)(const OSSL_PARAM params[], void *arg); - +typedef int (OSSL_INOUT_CALLBACK)(const OSSL_PARAM in_params[], + OSSL_PARAM out_params[], void *arg); /* * Passphrase callback function signature *
[hardware] Add handling of multiple sections > Add handling of multiple sections. > Delete keys list. > Add argument parsing for the results folder. [hardware] corrent lint error
-import csv +#!/usr/bin/env python3 + +# Copyright 2022 ETH Zurich and University of Bologna. +# Solderpad Hardware License, Version 0.51, see LICENSE for details. +# SPDX-License-Identifier: SHL-0.51 + +# This script takes a set of .csv files in one of the results folders and +# generates the average performances over all the cores used. +# Author: Marco Bertuletti <[email protected]> + import os import pandas as pd import numpy as np -from collections import deque, defaultdict -import sys +import argparse -path = '/scratch2/mempool/hardware/build/traces' ext = ('.csv') padding = ' ' + '.' * 25 -keys = [ 'cycles', - 'snitch_loads', - 'snitch_stores', - 'snitch_avg_load_latency', - 'snitch_occupancy', - 'total_ipc', - 'snitch_issues', - 'stall_tot', - 'stall_ins', - 'stall_raw', - 'stall_raw_lsu', - 'stall_raw_acc', - 'stall_lsu', - 'stall_acc', - 'seq_loads_local', - 'seq_loads_global', - 'itl_loads_local', - 'itl_loads_global', - 'seq_latency_local', - 'seq_latency_global', - 'itl_latency_local', - 'itl_latency_global', - 'seq_stores_local', - 'seq_stores_global', - 'itl_stores_local', - 'itl_stores_global'] - +parser = argparse.ArgumentParser() +parser.add_argument( + '-folder', + help='Name of the results folder with traces to be averaged.' +) +args = parser.parse_args() + +os.chdir("../results") +os.chdir(args.folder) +path = os.getcwd() +print(path) for files in os.listdir(path): if files.endswith(ext): - print(files) csvread = pd.read_csv(files) - print('\n\n') - #print(csvread) - print("******************************") - print("** AVERAGE PERFORMANCES **") - print("******************************") + + print("\n") + print("*******************************") + print("** AVERAGE PERFORMANCE **") + print("*******************************") print("") + for section in set(csvread['section']): + print("Section %d:\n" % section) + sectionread = csvread.loc[csvread['section'] == section] + keys = csvread.columns + remove_keys = ['core', + 'section', + 'start', + 'end', + 'snitch_load_latency', + 'snitch_load_region', + 'snitch_load_tile', + 'snitch_store_region', + 'snitch_store_tile'] + keys = keys.drop(remove_keys, errors='raise') for key in keys: - column = csvread[key].replace(np.nan,0) + try: + column = sectionread[key].replace(np.nan, 0) column = column.to_numpy() avg = np.average(column) - #print('{:.40s} {}'.format(key + padding, avg)) + except Exception: + # Key could not be averaged + continue print("%-30s %4.4f" % (key, avg)) - print('\n\n') - - - - -
Backported version calculation fix.
@@ -60,16 +60,15 @@ if (NOT PUPNP_VERSION_STRING) file (APPEND ${CMAKE_CURRENT_BINARY_DIR}/autoconfig.h.cm "#cmakedefine ${CMAKE_MATCH_1} 1\n\n") list (APPEND WRITTEN_VARS ${CMAKE_MATCH_1}) elseif (line MATCHES "^AC_SUBST.*LT_VERSION_IXML, ([0-9]*):([0-9]*):([0-9]*).*") - set (IXML_VERSION_MAJOR ${CMAKE_MATCH_1} CACHE STRING "Majorversion of libixml" FORCE) - set (IXML_VERSION ${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3} CACHE STRING "Version of libixml" FORCE) - message (STATUS "Setting ixml-version to ${IXML_VERSION}") + math (EXPR IXML_MAJ "${CMAKE_MATCH_1} - ${CMAKE_MATCH_3}") + set (IXML_SOMAJOR ${IXML_MAJ} CACHE STRING "Major version of ixml" FORCE) + set (IXML_SOVERSION ${IXML_MAJ}.${CMAKE_MATCH_3}.${CMAKE_MATCH_2} CACHE STRING "Version of libixml" FORCE) + message (STATUS "Setting ixml-soversion to ${IXML_SOVERSION}") elseif (line MATCHES "^AC_SUBST.*LT_VERSION_UPNP, ([0-9]*):([0-9]*):([0-9]*).*") - set (UPNP_VERSION_MAJOR ${CMAKE_MATCH_1} CACHE STRING "Majorversion of libupnp" FORCE) - set (UPNP_VERSION_MINOR ${CMAKE_MATCH_2} CACHE STRING "Minorversion of libupnp" FORCE) - set (UPNP_VERSION_PATCH ${CMAKE_MATCH_3} CACHE STRING "Patchversion of libupnp" FORCE) - set (UPNP_VERSION ${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3} CACHE STRING "Version of libupnp" FORCE) - set (UPNP_VERSION_STRING ${UPNP_VERSION} CACHE STRING "see upnpconfig.h" FORCE) - message (STATUS "Setting upnp-version to ${UPNP_VERSION}") + math (EXPR UPNP_MAJ "${CMAKE_MATCH_1} - ${CMAKE_MATCH_3}") + set (UPNP_SOMAJOR ${UPNP_MAJ} CACHE STRING "Major version of upnp" FORCE) + set (UPNP_SOVERSION ${UPNP_MAJ}.${CMAKE_MATCH_3}.${CMAKE_MATCH_2} CACHE STRING "Version of libupnp" FORCE) + message (STATUS "Setting upnp-soversion to ${UPNP_SOVERSION}") endif() endforeach() endforeach()
out_stackdriver: use new jmsn wrapper header
#include <fluent-bit/flb_info.h> #include <fluent-bit/flb_unescape.h> #include <fluent-bit/flb_utils.h> - -#include <jsmn/jsmn.h> +#include <fluent-bit/flb_jsmn.h> #include <sys/types.h> #include <sys/stat.h>
Specify libssl1.1 dependency on deb package
@@ -161,6 +161,7 @@ if [ "$OS" == "linux" ]; then --name ${NAME} \ --provides ${NAME} \ --conflicts ${CONFLICTS} \ + --depends "libssl1.1" \ --version ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} \ --description "${DESCRIPTION}" \ --vendor "${VENDOR}" \
Update json_tokener.h
@@ -150,6 +150,13 @@ typedef struct json_tokener json_tokener; */ #define JSON_TOKENER_STRICT 0x01 +/** + * Cause json_tokener_parse_ex() to validate that input is UTF8. + * If this flag is specified and validation fails, then + * json_tokener_get_error(tok) will return + * json_tokener_error_parse_utf8_string + * + * This flag is not set by default. * * @see json_tokener_set_flags() */
Python: supporting UNIX sockets. This closes issue on GitHub.
@@ -30,6 +30,8 @@ static void nxt_py_asgi_close_handler(nxt_unit_request_info_t *req); static PyObject *nxt_py_asgi_create_http_scope(nxt_unit_request_info_t *req); static PyObject *nxt_py_asgi_create_address(nxt_unit_sptr_t *sptr, uint8_t len, uint16_t port); +static PyObject *nxt_py_asgi_create_ip_address(nxt_unit_sptr_t *sptr, + uint8_t len, uint16_t port); static PyObject *nxt_py_asgi_create_header(nxt_unit_field_t *f); static PyObject *nxt_py_asgi_create_subprotocols(nxt_unit_field_t *f); @@ -663,7 +665,7 @@ nxt_py_asgi_create_http_scope(nxt_unit_request_info_t *req) SET_ITEM(scope, query_string, v) Py_DECREF(v); - v = nxt_py_asgi_create_address(&r->remote, r->remote_length, 0); + v = nxt_py_asgi_create_ip_address(&r->remote, r->remote_length, 0); if (nxt_slow_path(v == NULL)) { nxt_unit_req_alert(req, "Python failed to create 'client' pair"); goto fail; @@ -735,6 +737,48 @@ nxt_py_asgi_create_http_scope(nxt_unit_request_info_t *req) static PyObject * nxt_py_asgi_create_address(nxt_unit_sptr_t *sptr, uint8_t len, uint16_t port) +{ + size_t prefix_len; + nxt_str_t addr; + PyObject *pair, *v; + + addr.length = len; + addr.start = nxt_unit_sptr_get(sptr); + + prefix_len = nxt_length("unix:"); + if (!nxt_str_start(&addr, "unix:", prefix_len)) { + return nxt_py_asgi_create_ip_address(sptr, len, port); + } + +#if NXT_HAVE_UNIX_DOMAIN + pair = PyTuple_New(2); + if (nxt_slow_path(pair == NULL)) { + return NULL; + } + + addr.start += prefix_len; + addr.length -= prefix_len; + + v = PyString_FromStringAndSize((const char *) addr.start, addr.length); + if (nxt_slow_path(v == NULL)) { + Py_DECREF(pair); + + return NULL; + } + + PyTuple_SET_ITEM(pair, 0, v); + PyTuple_SET_ITEM(pair, 1, Py_None); + + return pair; + +#else + return NULL; +#endif +} + + +static PyObject * +nxt_py_asgi_create_ip_address(nxt_unit_sptr_t *sptr, uint8_t len, uint16_t port) { char *p, *s; PyObject *pair, *v;
Documentation: typo in Ubuntu tutorial and additional note Fix one typo (in a command) in the tutorial entitled "Using Ubuntu as the Service OS". Add a note explaining that a script may have to be adjusted based on the HW set-up (network interface name).
@@ -267,7 +267,7 @@ For the User OS, we are using the same `Clear Linux`_ release version as the Ser .. code-block:: none - sudo apt-get instal iasl + sudo apt-get install iasl sudo cp /usr/bin/iasl /usr/sbin/iasl * Adjust ``launch_uos.sh`` @@ -329,6 +329,10 @@ script example shows how to set this up (verified in Ubuntu 14.04 and 16.04 as t brctl addif acrn-br0 acrn_tap0 ip link set dev acrn_tap0 up +.. note:: + The SOS network interface is called ``enp3s0`` in the script above. You will need + to adjust the script if your system uses a different name (e.g. ``eno1``). + Enabling USB keyboard and mouse *******************************
hw/mcu/dialog: Remove redundant PDC ack in CMAC driver There is no need to do this, it will be acked before going to deep sleep (where all M33 PDC entries are acked).
@@ -103,12 +103,6 @@ da1469x_cmac_pdc_signal(void) da1469x_pdc_set(g_da1469x_pdc_sys2cmac); } -static inline void -da1469x_cmac_pdc_ack(void) -{ - da1469x_pdc_ack(g_da1469x_pdc_cmac2sys); -} - static void cmac2sys_isr(void) { @@ -119,8 +113,6 @@ cmac2sys_isr(void) os_trace_isr_enter(); - da1469x_cmac_pdc_ack(); - /* Clear CMAC2SYS interrupt */ *(volatile uint32_t *)0x40002000 = 2;
TSCH scanning: limit the etimer frequency to 1/CLOCK_SECOND to reduce CPU usage during the scanning
@@ -786,7 +786,7 @@ PT_THREAD(tsch_scan(struct pt *pt)) TSCH_ASN_INIT(tsch_current_asn, 0, 0); - etimer_set(&scan_timer, CLOCK_SECOND / TSCH_ASSOCIATION_POLL_FREQUENCY); + etimer_set(&scan_timer, MAX(1, CLOCK_SECOND / TSCH_ASSOCIATION_POLL_FREQUENCY)); current_channel_since = clock_time(); while(!tsch_is_associated && !tsch_is_coordinator) { @@ -851,7 +851,7 @@ PT_THREAD(tsch_scan(struct pt *pt)) NETSTACK_RADIO.off(); } else if(!tsch_is_coordinator) { /* Go back to scanning */ - etimer_reset(&scan_timer); + etimer_restart(&scan_timer); PT_WAIT_UNTIL(pt, etimer_expired(&scan_timer)); } }
Update SNAP-Registers.md
@@ -181,6 +181,21 @@ Address: 0x0000028 --- +#### SNAP Capability Register (SCaR) +``` +Address: 0x0000030 + 63..32 RO: Reserved + 31..16 RO: Size of attached on-card SDRAM in MB + 15..9 RO: Reserved + 8 RO: NVMe enabled + 7..0 RO: Card type: + 0x01 : FGT + 0x00 : KU3 + +``` + +--- + #### Freerunning Timer (FRT) ``` Address: 0x0000080 @@ -479,6 +494,21 @@ Address: 0x0000028 + (s+n) * 0x0010000 --- +#### SNAP Capability Register (SCaR) +``` +Address: 0x0000030 + (s+n) * 0x0010000 + 63..32 RO: Reserved + 31..16 RO: Size of attached on-card SDRAM in MB + 15..9 RO: Reserved + 8 RO: NVMe enabled + 7..0 RO: Card type: + 0x01 : FGT + 0x00 : KU3 + +``` + +--- + #### Freerunning Timer (FRT) ``` Address: 0x0000080 + (s+n) * 0x0010000
Cleanup extconf.rb a bit.
@@ -25,18 +25,28 @@ else dir_config('xml2') end -unless find_header('libxml/xmlversion.h', +found_header = find_header('libxml/xmlversion.h', '/opt/include/libxml2', '/opt/local/include/libxml2', '/usr/local/include/libxml2', - '/usr/include/libxml2') && - find_library('xml2', 'xmlParseDoc', + '/usr/include/libxml2', + '/usr/local/include') + +found_lib = find_library('xml2', 'xmlParseDoc', '/opt/lib', '/opt/local/lib', '/usr/local/lib', '/usr/lib') - crash(<<EOL) -need libxml2. + +found_lib ||= find_library('libxml2', 'xmlParseDoc', + '/opt/lib', + '/opt/local/lib', + '/usr/local/lib', + '/usr/lib') + +if !found_header || !found_lib + crash(<<~EOL) + Cannot find libxml2. Install the library or try one of the following options to extconf.rb: @@ -47,11 +57,5 @@ need libxml2. EOL end -have_func('rb_io_bufwrite', 'ruby/io.h') - -# For FreeBSD add /usr/local/include -$INCFLAGS << " -I/usr/local/include" -$CFLAGS << ' ' << $INCFLAGS - create_header() create_makefile('libxml_ruby')
tests: reduce output of Cooja tests The build phase in Cooja tests is rarely interesting, so make the build system quiet by default for them. The tests will still output everything when running in the CI since the CI variable is set to true.
@@ -43,6 +43,20 @@ GRADLE ?= $(CONTIKI)/tools/cooja/gradlew Q ?= @ +# The build phase ~never fails for Cooja tests, so silence the build system. +QUIET ?= 1 + +# Prevent make from printing "Entering/Leaving directory <..>". +# This cannot be done in Makefile.include because MAKEFLAGS already contains +# -w at that point. ContikiMoteType clears its environment before compiling +# so the problem will only be seen for MSP430-based motes. +ifneq ($(CI),true) +ifeq ($(QUIET),1) + MAKEFLAGS += --no-print-directory + export QUIET +endif +endif + .PHONY: all clean tests tests: $(TESTLOGS)
RFC 8398: EAI comparison
@@ -878,8 +878,22 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, ASN1_STRING *cstr; gen = sk_GENERAL_NAME_value(gens, i); - if (gen->type != check_type) + if ((gen->type == GEN_OTHERNAME) && (check_type == GEN_EMAIL)) { + if (OBJ_obj2nid(gen->d.otherName->type_id) == + NID_id_on_SmtpUTF8Mailbox) { + san_present = 1; + cstr = gen->d.otherName->value->value.utf8string; + + /* Positive on success, negative on error! */ + if ((rv = do_check_string(cstr, 0, equal, flags, + chk, chklen, peername)) != 0) + break; + } else + continue; + } else { + if ((gen->type != check_type) && (gen->type != GEN_OTHERNAME)) continue; + } san_present = 1; if (check_type == GEN_EMAIL) cstr = gen->d.rfc822Name;
Remove redundant arity checks in XINFO The arity in the JSON files of the subcommands reneder this code unreachable
@@ -3838,11 +3838,6 @@ void xinfoCommand(client *c) { /* HELP is special. Handle it ASAP. */ if (!strcasecmp(c->argv[1]->ptr,"HELP")) { - if (c->argc != 2) { - addReplySubcommandSyntaxError(c); - return; - } - const char *help[] = { "CONSUMERS <key> <groupname>", " Show consumers of <groupname>.", @@ -3854,9 +3849,6 @@ NULL }; addReplyHelp(c, help); return; - } else if (c->argc < 3) { - addReplySubcommandSyntaxError(c); - return; } /* With the exception of HELP handled before any other sub commands, all
test added for memcfl_register
#include "utest.h" +#include "misc/misc.h" #include "misc/mmio.h" #include "misc/memcfl.h" @@ -38,6 +39,41 @@ static bool test_memcfl_load(void) UT_REGISTER_TEST(test_memcfl_load); +static bool test_memcfl_register(void) +{ + long dims[2] = { 10, 5 }; + complex float* x = xmalloc(io_calc_size(2, dims, sizeof(complex float))); + + for (int i = 0; i < 50; i++) + x[i] = i; + + memcfl_register("test.mem", 2, dims, x, false); + + unmap_cfl(2, dims, x); + + long dims2[2]; + complex float* y = load_cfl("test.mem", 2, dims2); + + if (!((dims[0] == dims2[0]) && dims[1] == dims2[1])) + return false; + + for (int i = 0; i < 50; i++) + if (x[i] != i) + return false; + + unmap_cfl(2, dims, y); + + memcfl_unlink("test.mem"); + + xfree(x); + + return true; +} + + +UT_REGISTER_TEST(test_memcfl_register); + + static bool test_memcfl_write(void) { long dims[2] = { 10, 5 };
Refix _sceCommonDialogSetMagicNumber hack original patch introduced for the Vita3K, only problem in 64bit C++ compiler. this patch is also hack, but will work on all compilers also fill the magic value
@@ -107,9 +107,7 @@ typedef struct SceCommonDialogParam { static inline void _sceCommonDialogSetMagicNumber(SceCommonDialogParam *param) { -#ifdef __vita__ - param->magic = SCE_COMMON_DIALOG_MAGIC_NUMBER + (SceUInt32)param; -#endif + param->magic = SCE_COMMON_DIALOG_MAGIC_NUMBER + *(SceUInt32*)&param; } static inline
Travis: Set library path Before this commit the installed version of `kdb` would not work on Linux if we use a custom install location. See also: Issue
@@ -56,6 +56,8 @@ before_install: # before_script: - cd $TRAVIS_BUILD_DIR/.. + - INSTALL_DIR="$PWD/install" + - SYSTEM_DIR="$PWD/kdbsystem" - mkdir build && cd build - CMAKE_OPT=() - echo $PATH @@ -78,11 +80,12 @@ before_script: -DBINDINGS=ALL -DTOOLS=ALL -DINSTALL_SYSTEM_FILES=OFF - -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/../install - -DKDB_DB_SYSTEM=$TRAVIS_BUILD_DIR/../kdbsystem + -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" + -DKDB_DB_SYSTEM="$SYSTEM_DIR" ${CMAKE_OPT[@]} $TRAVIS_BUILD_DIR - - PATH=$PATH:$(ruby -e "puts File.expand_path('$TRAVIS_BUILD_DIR/../install/bin')") + - export PATH=$PATH:"$INSTALL_DIR/bin" + - export LD_LIBRARY_PATH="$INSTALL_DIR/lib" script: - ninja
[ctr/lua] small fix for error message
@@ -827,7 +827,7 @@ func LuaDeployContract(L *LState, service *C.int, contract *C.char, args *C.char if len(code) == 0 { l := luacUtil.NewLState() if l == nil { - luaPushStr(L, "[Contract.LuaDeployContract]compile error:"+err.Error()) + luaPushStr(L, "[Contract.LuaDeployContract] get luaState error") return -1 } defer luacUtil.CloseLState(l) @@ -903,7 +903,7 @@ func LuaDeployContract(L *LState, service *C.int, contract *C.char, args *C.char db := LuaGetDbHandle(&stateSet.service) if db == nil { stateSet.dbSystemError = true - luaPushStr(L, "[System.LuaDeployContract] DB err:"+err.Error()) + luaPushStr(L, "[System.LuaDeployContract] DB err") return -1 } senderState.Nonce += 1
Remove obsolete comment Fixes
@@ -277,7 +277,6 @@ static void ossl_lib_ctx_generic_free(void *parent_ign, void *ptr, meth->free_func(ptr); } -/* Non-static so we can use it in context_internal_test */ static int ossl_lib_ctx_init_index(OSSL_LIB_CTX *ctx, int static_index, const OSSL_LIB_CTX_METHOD *meth) {
arm: fix fma for glm_vec4_muladds
@@ -590,8 +590,10 @@ glm_vec4_muladd(vec4 a, vec4 b, vec4 dest) { CGLM_INLINE void glm_vec4_muladds(vec4 a, float s, vec4 dest) { -#if defined(CGLM_SIMD) +#if defined( __SSE__ ) || defined( __SSE2__ ) glmm_store(dest, glmm_fmadd(glmm_load(a), _mm_set1_ps(s), glmm_load(dest))); +#elif defined(CGLM_NEON_FP) + glmm_store(dest, glmm_fmadd(glmm_load(a), vdupq_n_f32(s), glmm_load(dest))); #else dest[0] += a[0] * s; dest[1] += a[1] * s;
refactor: add todo
@@ -294,6 +294,7 @@ perform_request( CURLcode ecode; //perform the connection + //@todo shouldn't abort on error ecode = curl_easy_perform(ehandle); ASSERT_S(CURLE_OK == ecode, curl_easy_strerror(ecode));
Update: PriorityQueue_Test.h: this makes the test compatible with tcc float handling
@@ -44,7 +44,7 @@ void PriorityQueue_Test() if(feedback.evicted) { printf("evicted item %f %ld\n", feedback.evictedItem.priority, (long)feedback.evictedItem.address); - assert(evictions>0 || feedback.evictedItem.priority == ((double)(1.0/((double) (n_items*2)))), "the evicted item has to be the lowest priority one"); + assert(evictions>0 || (feedback.evictedItem.priority - ((double)(1.0/((double) (n_items*2))))) < 0.00001, "the evicted item has to be the lowest priority one"); assert(queue.itemsAmount < n_items+1, "eviction should only happen when full!"); evictions++; }
nimble/host: Allow to configure non-connectable scannable advertising
@@ -2373,7 +2373,7 @@ ble_gap_ext_adv_params_validate(const struct ble_gap_ext_adv_params *params) } if (params->directed) { - if (params->scannable) { + if (params->scannable && params->connectable) { return BLE_HS_EINVAL; } } @@ -2793,7 +2793,7 @@ ble_gap_ext_adv_rsp_set_validate(uint8_t instance, struct os_mbuf *data) } /* not allowed with directed advertising */ - if (ble_gap_slave[instance].directed) { + if (ble_gap_slave[instance].directed && ble_gap_slave[instance].connectable) { return BLE_HS_EINVAL; }
board/nocturne_fp/ro_workarounds.c: Format with clang-format BRANCH=none TEST=./util/compare_build.sh -b fp
@@ -75,8 +75,7 @@ void wp_event(enum gpio_signal signal) * This function is also called from system_reset to set the final save * reset flags, before an actual planned reset. */ -__override -void bkpdata_write_reset_flags(uint32_t save_flags) +__override void bkpdata_write_reset_flags(uint32_t save_flags) { /* Preserve flags in case a reset pulse occurs */ if (!gpio_get_level(GPIO_WP))
fix: secure sockets regression error
@@ -399,7 +399,7 @@ int32_t SOCKETS_Connect( Socket_t xSocket, struct sockaddr_in sa_addr = { 0 }; int ret; - + sa_addr.sin_family = pxAddress->ucSocketDomain; sa_addr.sin_addr.s_addr = pxAddress->ulAddress; sa_addr.sin_port = pxAddress->usPort;
Event connection writing fixes.
@@ -46,6 +46,9 @@ nxt_conn_io_write(nxt_task_t *task, void *obj, void *data) do { ret = nxt_conn_io_sendbuf(task, &sb); + c->socket.write_ready = sb.ready; + c->socket.error = sb.error; + if (ret < 0) { /* ret == NXT_AGAIN || ret == NXT_ERROR. */ break; @@ -61,6 +64,8 @@ nxt_conn_io_write(nxt_task_t *task, void *obj, void *data) break; } + sb.buf = b; + if (!c->socket.write_ready) { ret = NXT_AGAIN; break; @@ -95,6 +100,10 @@ nxt_conn_io_write(nxt_task_t *task, void *obj, void *data) * direction. */ nxt_event_conn_timer(engine, c, c->write_state, &c->write_timer); + + if (nxt_fd_event_is_disabled(c->socket.write)) { + nxt_fd_event_enable_write(engine, &c->socket); + } } }
web-ui: fix bug when entering additional metadata
@@ -20,6 +20,9 @@ import { HANDLED_METADATA } from './utils' const DebouncedTextField = debounce(TextField) +const IMMEDIATE = 'IMMEDIATE' +const DEBOUNCED = 'DEBOUNCED' + export default class AdditionalMetakeysSubDialog extends Component { constructor (props, ...args) { super(props, ...args) @@ -77,9 +80,9 @@ export default class AdditionalMetakeysSubDialog extends Component { floatingLabelText={item.key} floatingLabelFixed={true} tabIndex="0" - value={item.value || getMeta(item.key)} - onChange={this.updateValue(item.key)} - onDebounced={handleEdit(item.key)} + value={getMeta(item.key)} + onChange={handleEdit(item.key, IMMEDIATE)} + onDebounced={handleEdit(item.key, DEBOUNCED)} /> <SavedIcon saved={getSaved(item.key)} /> <IconButton
board/imxrt1050-evk: tidyup including headers in imxrt_boot.c 1. Include <stdio.h> and <stdint.h> stdio.h for snprintf stdint.h for uint8_t 2. Remove duplicated <tinyara/gpio.h> There are two includings. 3. Remove unnecessary headers for imxrt1020-evk The imxrt_boot.c under os/board/imxrt1050-evk/src folder is built only when imxrt1050-evk is selected. It is never built with imxrt1020-evk.
#include <tinyara/config.h> +#include <stdint.h> +#include <stdio.h> + #include <tinyara/board.h> #include <tinyara/pwm.h> #include <tinyara/gpio.h> #include <tinyara/spi/spi.h> - #include <arch/board/board.h> -#if defined(CONFIG_ARCH_CHIP_FAMILY_IMXRT102x) -#include "chip/imxrt102x_config.h" -#include "imxrt1020-evk.h" -#elif defined(CONFIG_ARCH_CHIP_FAMILY_IMXRT105x) -#include "chip/imxrt105x_config.h" -#include "imxrt1050-evk.h" -#else -#error Unrecognized i.MX RT architecture -#endif +#include "imxrt1050-evk.h" #include "imxrt_start.h" #include "imxrt_pwm.h" #include "imxrt_flash.h" #include "imxrt_gpio.h" -#include <tinyara/gpio.h> #include "imxrt_lpspi.h" - #ifdef CONFIG_IMXRT_SEMC_SDRAM #include "imxrt_semc_sdram.h" #endif
remove generic Write method for lua version
@@ -294,6 +294,7 @@ namespace SLua pos_++; } + public void Write (ushort v) { Write ((short)v);
Disable DNS tests temporarily.
@@ -86,11 +86,11 @@ run_test test/${OS}/httpaggtest run_test test/${OS}/selfinterposetest if [ "${OS}" = "linux" ]; then - SAVEVARS=$ENVARS - ENVVARS=$ENVVARS"LD_PRELOAD=./lib/linux/libscope.so ""SCOPE_METRIC_DEST=file:///tmp/dnstest.log ""SCOPE_METRIC_VERBOSITY=9 ""SCOPE_SUMMARY_PERIOD=1 " - run_test test/${OS}/dnstest - ENVARS=$SAVEVARS - rm "/tmp/dnstest.log" + #SAVEVARS=$ENVARS + #ENVVARS=$ENVVARS"LD_PRELOAD=./lib/linux/libscope.so ""SCOPE_METRIC_DEST=file:///tmp/dnstest.log ""SCOPE_METRIC_VERBOSITY=9 ""SCOPE_SUMMARY_PERIOD=1 " + #run_test test/${OS}/dnstest + #ENVARS=$SAVEVARS + #rm "/tmp/dnstest.log" test/access_rights.sh ERR+=$?
pci: actually returning with the right message so RPCs can proceed
@@ -757,7 +757,7 @@ static void request_iommu_endpoint_cap_handler(struct kaluga_binding* b, uint8_t } reply: - err = b->tx_vtbl.request_endpoint_cap_response(b, NOP_CONT, cap, out_err); + err = b->tx_vtbl.request_iommu_endpoint_cap_response(b, NOP_CONT, cap, out_err); assert(err_is_ok(err)); slot_free(cap); }
Remove unused parameter in Android constructor
@@ -137,12 +137,12 @@ class Request implements Runnable { } public class httpClient{ - private static final int Max_Threads = 2; // Collector wants no more than 2 at a time - public httpClient(int n_threads) + private static final int MAX_HTTP_THREADS = 2; // Collector wants no more than 2 at a time + public httpClient() { String path = System.getProperty("java.io.tmpdir"); setCacheFilePath(path); - m_executor = Executors.newFixedThreadPool(Max_Threads); + m_executor = Executors.newFixedThreadPool(MAX_HTTP_THREADS); createClientInstance(); }
don't extend hud width if gpu_stats is disabled
@@ -352,7 +352,7 @@ parse_overlay_config(struct overlay_params *params, if (params->enabled[OVERLAY_PARAM_ENABLED_io_read] && params->enabled[OVERLAY_PARAM_ENABLED_io_write] && params->width == 280) params->width = 15 * params->font_size; - if (params->enabled[OVERLAY_PARAM_ENABLED_gpu_core_clock] && params->enabled[OVERLAY_PARAM_ENABLED_gpu_temp]){ + if (params->enabled[OVERLAY_PARAM_ENABLED_gpu_core_clock] && params->enabled[OVERLAY_PARAM_ENABLED_gpu_temp] && params->enabled[OVERLAY_PARAM_ENABLED_gpu_stats]){ params->tableCols = 4; params->width = 20 * params->font_size; }
Undo commit Comment in the commit: /* Ignore NULLs, thanks to Bob Beck */
@@ -757,8 +757,6 @@ void ERR_add_error_vdata(int num, va_list args) n = 0; for (i = 0; i < num; i++) { a = va_arg(args, char *); - /* ignore NULLs, thanks to Bob Beck <[email protected]> */ - if (a != NULL) { n += strlen(a); if (n > s) { s = n + 20; @@ -771,7 +769,6 @@ void ERR_add_error_vdata(int num, va_list args) } OPENSSL_strlcat(str, a, (size_t)s + 1); } - } ERR_set_error_data(str, ERR_TXT_MALLOCED | ERR_TXT_STRING); }
fix panda connect on macOS
@@ -179,7 +179,7 @@ class Panda(object): self.bootstub = device.getProductID() == 0xddee self.legacy = (device.getbcdDevice() != 0x2300) self._handle = device.open() - if sys.platform not in ["win32", "cygwin", "msys"]: + if sys.platform not in ["win32", "cygwin", "msys", "darwin"]: self._handle.setAutoDetachKernelDriver(True) if claim: self._handle.claimInterface(0)
Stop requiring an explicit return from perl subroutines The consensus of the project appears to be that this provides little benefit and is simply an annoyance. Discussion:
@@ -22,7 +22,3 @@ verbose = %f: %m at line %l, column %c. %e. ([%p] Severity: %s)\n # insist on use of the warnings pragma [TestingAndDebugging::RequireUseWarnings] severity = 5 - -# for now raise severity of this to level 5 -[Subroutines::RequireFinalReturn] -severity = 5
travis: increase wait time and update Xcode version
language: cpp dist: bionic -osx_image: xcode11.6 +osx_image: xcode12 # # Define the build matrix @@ -279,7 +279,7 @@ before_script: - cmake ${CMAKE_OPT[@]} script: - - ninja + - travis_wait 20 ninja - output="$(ninja install 2>&1)" || printf '%s' "$output" - - ninja run_all - - kdb run_all + - travis_wait 20 ninja run_all + - travis_wait 20 kdb run_all
include/tinyara/reboot_reason.h : Add reboot reason code for recovery failure Add reboot reason code for binary recover failure as 35.
@@ -34,6 +34,7 @@ typedef enum { REBOOT_SYSTEM_WIFICORE_WATCHDOG = 11, /* Wi-Fi Core Watchdog Reset */ REBOOT_SYSTEM_WIFICORE_PANIC = 12, /* Wi-Fi Core Panic */ REBOOT_SYSTEM_BINARY_UPDATE = 34, /* Reboot for Binary Update */ + REBOOT_SYSTEM_BINARY_RECOVERYFAIL = 35, /* Binary Recovery Fail */ REBOOT_UNKNOWN = 99, } reboot_reason_code_t;
kdbset example: More precise error description
@@ -63,7 +63,7 @@ while (ret == -1) // as long as we have an error theirs = ksDup (ours); kdbGet (handle, theirs, parentKey); // refresh key database Key * informationKey = keyNew(0, KEY_END); - KeySet * res = elektraMerge( + KeySet * result = elektraMerge( ksCut(ours, parentKey), parentKey, ksCut(theirs, parentKey), parentKey, ksCut(base, parentKey), parentKey, @@ -71,8 +71,8 @@ while (ret == -1) // as long as we have an error int numberOfConflicts = getConflicts (informationKey); keyDel (informationKey); ksDel (theirs); - if (res != NULL) { - ret = kdbSet (handle, res, parentKey); + if (result != NULL) { + ret = kdbSet (handle, result, parentKey); } else { // an error happened while merging if (numberOfConflicts > 0 && strategy == MERGE_STRATEGY_ABORT) @@ -82,7 +82,7 @@ while (ret == -1) // as long as we have an error } else { - // Other error + // Internal errors, out of memory etc. ret = -1; } }
Increase timeouts for connections and reads.
@@ -88,8 +88,8 @@ class TCPDriver(BaseDriver): class HTTPException(Exception): pass -DEFAULT_CONNECT_TIMEOUT = 10 -DEFAULT_READ_TIMEOUT = 10 +DEFAULT_CONNECT_TIMEOUT = 30 +DEFAULT_READ_TIMEOUT = 120 DEFAULT_TIMEOUT = (DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT) MAX_CONNECT_RETRIES = 10 MAX_READ_RETRIES = 10
fix: Fixed wild pointer call issue issue This version has not been tested.
@@ -136,20 +136,23 @@ __BOATSTATIC BOAT_RESULT platone_createOnetimeWallet() { BSINT32 index; BoatPlatoneWalletConfig wallet_config; + BUINT8 binFormatKey[32] = {0}; /* wallet_config value assignment */ /* for one-time wallet, the 'prikeyId' field should be cleared */ //memset(wallet_config.prikeyId, 0, BOAT_KEYID_MAX_LEN); wallet_config.chain_id = 1; wallet_config.eip155_compatibility = BOAT_FALSE; -#if 1 + char *nativedemoKey = "0xfcf6d76706e66250dbacc9827bc427321edb9542d58a74a67624b253960465ca"; wallet_config.prikeyCtx_config.prikey_genMode = BOAT_WALLET_PRIKEY_GENMODE_EXTERNAL_INJECTION; wallet_config.prikeyCtx_config.prikey_format = BOAT_WALLET_PRIKEY_FORMAT_NATIVE; wallet_config.prikeyCtx_config.prikey_type = BOAT_WALLET_PRIKEY_TYPE_SECP256K1; - UtilityHexToBin(wallet_config.prikeyCtx_config.prikey_content.field_ptr, 32, nativedemoKey, TRIMBIN_TRIM_NO, BOAT_FALSE); + UtilityHexToBin(binFormatKey, 32, native_demoKey, TRIMBIN_TRIM_NO, BOAT_FALSE); + wallet_config.prikeyCtx_config.prikey_content.field_ptr = binFormatKey; + UtilityHexToBin(wallet_config.prikeyCtx_config.prikey_content.field_ptr, 32, native_demoKey, TRIMBIN_TRIM_NO, BOAT_FALSE); wallet_config.prikeyCtx_config.prikey_content.field_len = 32; -#endif + strncpy(wallet_config.node_url_str, "http://116.236.47.90:7545", BOAT_PLATONE_NODE_URL_MAX_LEN - 1); // "http://116.236.47.90:7545" //"http://106.14.94.165:8080"
api/trace: add parameter to explicitly enable or disable traces.
#include <fluent-bit/flb_lib.h> #include <fluent-bit/flb_trace_chunk.h> #include <fluent-bit/flb_kv.h> +#include <fluent-bit/flb_utils.h> #include <msgpack.h> @@ -59,10 +60,10 @@ static int enable_trace_input(struct flb_hs *hs, const char *name, const char *p flb_free(in->trace_ctxt); } in->trace_ctxt = flb_trace_chunk_context_new(hs->config, output_name, prefix, props); - return (in->trace_ctxt == NULL ? -1 : 0); + return (in->trace_ctxt == NULL ? -1 : 1); } -static int disable_trace_input(struct flb_hs *hs, const char *name, const char *prefix, const char *output_name, struct mk_list *props) +static int disable_trace_input(struct flb_hs *hs, const char *name) { struct flb_input_instance *in; @@ -76,6 +77,7 @@ static int disable_trace_input(struct flb_hs *hs, const char *name, const char * flb_free(in->trace_ctxt); } in->trace_ctxt = NULL; + return 0; } static int toggle_trace_input(struct flb_hs *hs, const char *name, const char *prefix, const char *output_name, struct mk_list *props) @@ -117,7 +119,9 @@ static void cb_enable_trace(mk_request_t *request, void *data) flb_sds_t input_name; flb_sds_t prefix; flb_sds_t output_name; + flb_sds_t enable_disable_str; int toggled_on = -1; + int enable_disable = -1; msgpack_object *key; msgpack_object *val; struct mk_list *props = NULL; @@ -187,8 +191,28 @@ static void cb_enable_trace(mk_request_t *request, void *data) (char *)val->via.map.ptr[x].val.via.str.ptr, val->via.map.ptr[x].val.via.str.size); } } + if (strncmp(key->via.str.ptr, "enable", key->via.str.size) == 0) { + if (val->type == MSGPACK_OBJECT_BOOLEAN) { + enable_disable = val->via.boolean; + } else if (val->type == MSGPACK_OBJECT_STR) { + enable_disable_str = flb_sds_create_len(val->via.str.ptr, val->via.str.size); + enable_disable = flb_utils_bool(enable_disable_str); + flb_sds_destroy(enable_disable_str); + } } + } + switch (enable_disable) { + case -1: toggled_on = toggle_trace_input(hs, input_name, prefix, output_name, props); + break; + case 1: + toggled_on = enable_trace_input(hs, input_name, prefix, output_name, props); + break; + case 0: + toggled_on = 0; + disable_trace_input(hs, input_name); + break; + } flb_sds_destroy(prefix); flb_sds_destroy(input_name); flb_sds_destroy(output_name);
zephyr: implement gpio_reset and gpio_set_flags These are required by power sequencing. Also, handle conversion of more bits while I'm here. BRANCH=none TEST=compile with power sequencing code for volteer
@@ -167,21 +167,41 @@ void gpio_set_level(enum gpio_signal signal, int value) } } +/* GPIO flags which are the same in Zephyr and this codebase */ +#define GPIO_CONVERSION_SAME_BITS \ + (GPIO_OPEN_DRAIN | GPIO_PULL_UP | GPIO_PULL_DOWN | GPIO_INPUT | \ + GPIO_OUTPUT) + static int convert_from_zephyr_flags(const gpio_flags_t zephyr) { - int ec_flags = 0; - - /* - * Convert from Zephyr flags to EC flags. Note that a few flags have - * the same value in both builds environments (e.g. GPIO_OUTPUT) - */ - if (zephyr | GPIO_OUTPUT) { - ec_flags |= GPIO_OUTPUT; + /* Start out with the bits that are the same. */ + int ec_flags = zephyr & GPIO_CONVERSION_SAME_BITS; + gpio_flags_t unhandled_flags = zephyr & ~GPIO_CONVERSION_SAME_BITS; + + /* TODO(b/173789980): handle conversion of more bits? */ + if (unhandled_flags) { + LOG_WRN("Unhandled GPIO bits in zephyr->ec conversion: 0x%08X", + unhandled_flags); } return ec_flags; } +static gpio_flags_t convert_to_zephyr_flags(int ec_flags) +{ + /* Start out with the bits that are the same. */ + gpio_flags_t zephyr_flags = ec_flags & GPIO_CONVERSION_SAME_BITS; + int unhandled_flags = ec_flags & ~GPIO_CONVERSION_SAME_BITS; + + /* TODO(b/173789980): handle conversion of more bits? */ + if (unhandled_flags) { + LOG_WRN("Unhandled GPIO bits in ec->zephyr conversion: 0x%08X", + unhandled_flags); + } + + return zephyr_flags; +} + int gpio_get_default_flags(enum gpio_signal signal) { if (signal >= ARRAY_SIZE(configs)) @@ -285,3 +305,21 @@ int gpio_disable_interrupt(enum gpio_signal signal) return rv; } + +void gpio_reset(enum gpio_signal signal) +{ + if (signal >= ARRAY_SIZE(configs)) + return; + + gpio_pin_configure(data[signal].dev, configs[signal].pin, + configs[signal].init_flags); +} + +void gpio_set_flags(enum gpio_signal signal, int flags) +{ + if (signal >= ARRAY_SIZE(configs)) + return; + + gpio_pin_configure(data[signal].dev, configs[signal].pin, + convert_to_zephyr_flags(flags)); +}
Fix instruction in README [ci skip]
@@ -105,7 +105,7 @@ the READMEs in those directories). For example, this will render a 3D model in the emulator: - cd build/software/apps/sceneview + cd software/apps/sceneview ./run_emulator To run on FPGA, see instructions in hardware/fpga/de2-115/README.md
Regenerate patch for Ibex
diff --git a/build.sbt b/build.sbt -index 3123c4b8..487fc428 100644 +index b1f7e004..f39c3712 100644 --- a/build.sbt +++ b/build.sbt @@ -184,7 +184,7 @@ lazy val testchipipLib = "edu.berkeley.cs" %% "testchipip" % "1.0-020719-SNAPSHO @@ -9,9 +9,9 @@ index 3123c4b8..487fc428 100644 - sha3, // On separate line to allow for cleaner tutorial-setup patches + //sha3, // On separate line to allow for cleaner tutorial-setup patches dsptools, `rocket-dsp-utils`, - gemmini, icenet, tracegen, cva6, nvdla, sodor) + gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex) .settings(libraryDependencies ++= rocketLibDeps.value) -@@ -223,11 +223,11 @@ lazy val sodor = (project in file("generators/riscv-sodor")) +@@ -228,11 +228,11 @@ lazy val sodor = (project in file("generators/riscv-sodor")) .settings(libraryDependencies ++= rocketLibDeps.value) .settings(commonSettings)
tests: add a weird fix for a thread local storage bug on macos.
@@ -46,10 +46,8 @@ void flb_custom_calyptia_pipeline_config_get_test() cfg = custom_calyptia_pipeline_config_get(ctx->config); TEST_CHECK(strcmp(cfg, cfg_str) == 0); - flb_start(ctx); - sleep(2); - flb_stop(ctx); - + // fix a thread local storage bug on macos + flb_output_prepare(); flb_sds_destroy(cfg); flb_destroy(ctx); }
rename to mimalloc-override.dll and use C compilation
<OutDir>$(SolutionDir)..\..\out\msvc-$(Platform)\$(Configuration)\</OutDir> <IntDir>$(SolutionDir)..\..\out\msvc-$(Platform)\$(ProjectName)\$(Configuration)\</IntDir> <TargetExt>.dll</TargetExt> - <TargetName>mimalloc</TargetName> + <TargetName>mimalloc-override</TargetName> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <OutDir>$(SolutionDir)..\..\out\msvc-$(Platform)\$(Configuration)\</OutDir> <IntDir>$(SolutionDir)..\..\out\msvc-$(Platform)\$(ProjectName)\$(Configuration)\</IntDir> <TargetExt>.dll</TargetExt> - <TargetName>mimalloc</TargetName> + <TargetName>mimalloc-override</TargetName> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <OutDir>$(SolutionDir)..\..\out\msvc-$(Platform)\$(Configuration)\</OutDir> <IntDir>$(SolutionDir)..\..\out\msvc-$(Platform)\$(ProjectName)\$(Configuration)\</IntDir> <TargetExt>.dll</TargetExt> - <TargetName>mimalloc</TargetName> + <TargetName>mimalloc-override</TargetName> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <OutDir>$(SolutionDir)..\..\out\msvc-$(Platform)\$(Configuration)\</OutDir> <IntDir>$(SolutionDir)..\..\out\msvc-$(Platform)\$(ProjectName)\$(Configuration)\</IntDir> <TargetExt>.dll</TargetExt> - <TargetName>mimalloc</TargetName> + <TargetName>mimalloc-override</TargetName> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <PreprocessorDefinitions>MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <SupportJustMyCode>false</SupportJustMyCode> - <CompileAs>CompileAsCpp</CompileAs> + <CompileAs>Default</CompileAs> </ClCompile> <Link> <AdditionalDependencies>../../bin/mimalloc-redirect32.lib;%(AdditionalDependencies)</AdditionalDependencies> <PreprocessorDefinitions>MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <SupportJustMyCode>false</SupportJustMyCode> - <CompileAs>CompileAsCpp</CompileAs> + <CompileAs>Default</CompileAs> </ClCompile> <Link> <AdditionalDependencies>../../bin/mimalloc-redirect.lib;%(AdditionalDependencies)</AdditionalDependencies> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WholeProgramOptimization>false</WholeProgramOptimization> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <CompileAs>CompileAsCpp</CompileAs> + <CompileAs>Default</CompileAs> </ClCompile> <Link> <EnableCOMDATFolding>true</EnableCOMDATFolding> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WholeProgramOptimization>false</WholeProgramOptimization> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <CompileAs>CompileAsCpp</CompileAs> + <CompileAs>Default</CompileAs> </ClCompile> <Link> <EnableCOMDATFolding>true</EnableCOMDATFolding>
Component/bt: read multiple return callback status: ESP_GATT_STACK_RSP
@@ -557,7 +557,7 @@ void gatt_process_read_multi_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, U key_size, trans_id); - if (err == GATT_SUCCESS) { + if (err == GATT_SUCCESS || err == GATT_STACK_RSP) { gatt_sr_process_app_rsp(p_tcb, gatt_cb.sr_reg[i_rcb].gatt_if , trans_id, op_code, GATT_SUCCESS, p_msg); } /* either not using or done using the buffer, release it now */ @@ -572,9 +572,8 @@ void gatt_process_read_multi_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, U err = GATT_NO_RESOURCES; } } - /* in theroy BUSY is not possible(should already been checked), protected check */ - if (err != GATT_SUCCESS && err != GATT_PENDING && err != GATT_BUSY) { + if (err != GATT_SUCCESS && err != GATT_STACK_RSP && err != GATT_PENDING && err != GATT_BUSY) { gatt_send_error_rsp(p_tcb, err, op_code, handle, FALSE); } }
Adapt indentation in hdl_helloworld/action_config.sh to general SNAP format
@@ -15,6 +15,7 @@ set src_dir $aip_dir/action_ip_prj/action_ip_prj.srcs/sources_1/ip puts "\[CREATE_ACTION_IPs..........\] start [clock format [clock seconds] -format {%T %a %b %d/ %Y}]" puts " FPGACHIP = $fpga_part" puts " ACTION_ROOT = $action_root" +puts " Creating IP in $src_dir" create_project action_ip_prj $aip_dir/action_ip_prj -force -part $fpga_part -ip >> $log_file # Project IP Settings
linux/arch: larger stack for clone's
@@ -111,14 +111,16 @@ static inline bool arch_shouldAttach(honggfuzz_t * hfuzz, fuzzer_t * fuzzer) return true; } -static uint8_t arch_clone_stack[PTHREAD_STACK_MIN * 2]; - +/* + * 128 KiB for the temporary stack + */ +static uint8_t arch_clone_stack[128 * 1024]; static __thread jmp_buf env; #if defined(__has_feature) -#if __has_feature(address_sanitizer) +#if __has_feature(address_sanitizer) || __has_feature(memory_sanitizer) __attribute__ ((no_sanitize("address"))) __attribute__ ((no_sanitize("memory"))) -#endif /* if __has_feature(address_sanitizer) */ +#endif /* if __has_feature(address_sanitizer) || __has_feature(memory_sanitizer) */ #endif /* if defined(__has_feature) */ static int arch_cloneFunc(void *arg UNUSED) {
Additional logging messages
@@ -111,6 +111,7 @@ static void _onNetworkStateChangeCallback( uint32_t network, credentials.pAlpnProtos = NULL; } + IotLogInfo("OnConnected: %d", network); pDemoContext->networkConnectedCallback(awsIotMqttMode, clientcredentialIOT_THING_NAME, &serverInfo, @@ -124,6 +125,7 @@ static void _onNetworkStateChangeCallback( uint32_t network, pDemoContext->connectedNetwork = AWSIOT_NETWORK_TYPE_NONE; if( pDemoContext->networkDisconnectedCallback != NULL ) { + IotLogInfo("OnDisconnected: %d", network); pNetworkInterface = AwsIotNetworkManager_GetNetworkInterface(network); pDemoContext->networkDisconnectedCallback(pNetworkInterface); } @@ -140,6 +142,7 @@ static void _onNetworkStateChangeCallback( uint32_t network, credentials.pAlpnProtos = NULL; } + IotLogInfo("OnConnected: %d", networkAvailable); pDemoContext->networkConnectedCallback( awsIotMqttMode, clientcredentialIOT_THING_NAME, &serverInfo, @@ -179,6 +182,7 @@ static int _initializeDemo( demoContext_t* pContext ) } else { + IotLogError( "IotCommon_Init Failed.\r\n" ); status = EXIT_FAILURE; } @@ -186,6 +190,7 @@ static int _initializeDemo( demoContext_t* pContext ) { if (AwsIotNetworkManager_Init() != pdTRUE) { + IotLogError( "AwsIotNetworkManager_Init Failed.\r\n" ); status = EXIT_FAILURE; } } @@ -209,9 +214,9 @@ static int _initializeDemo( demoContext_t* pContext ) } else { + IotLogError( "IotMqtt_Init Failed.\r\n" ); status = EXIT_FAILURE; } - } if( status == EXIT_SUCCESS ) @@ -225,7 +230,6 @@ static int _initializeDemo( demoContext_t* pContext ) { semaphoreCreated = true; } - } if( status == EXIT_SUCCESS ) @@ -279,7 +283,6 @@ void runDemoTask( void * pArgument ) { /* On Amazon FreeRTOS, credentials and server info are defined in a header * and set by the initializers. */ - demoContext_t * pContext = ( demoContext_t * ) pArgument; uint32_t network = AWSIOT_NETWORK_TYPE_NONE; @@ -302,6 +305,7 @@ void runDemoTask( void * pArgument ) if( network == AWSIOT_NETWORK_TYPE_NONE ) { + IotLogError( "No Netrowks Available!\r\n" ); /* No connected Networks. Block for a network to be connected. */ network = _blockForAvailableNetwork( pContext ); } @@ -313,7 +317,6 @@ void runDemoTask( void * pArgument ) pContext->connectedNetwork = network; pNetworkInterface = AwsIotNetworkManager_GetNetworkInterface( network ); - if( ( network == AWSIOT_NETWORK_TYPE_WIFI )||( network == AWSIOT_NETWORK_TYPE_ETH ) ) { /* ALPN only works over port 443. Disable it otherwise. */ @@ -333,6 +336,7 @@ void runDemoTask( void * pArgument ) else { /* Other network types are not supported */ + IotLogError( "No supported network interface.\r\n" ); status = EXIT_FAILURE; } }
Update version.h Remove date cap.
* ----------------------------------------------------------------------- * All rights reserved, see LICENSE in OpenBOR root for details. * - * Copyright (c) 2004 - 2014 OpenBOR Team + * Copyright (c) 2004 OpenBOR Team */ #ifndef VERSION_H
implemet client ssl factory for rhodes as lib
@@ -362,6 +362,59 @@ public class SSLImpl { } } + public static SSLSocketFactory getSecureClientFactory() throws NoSuchAlgorithmException, KeyManagementException, CertificateException, KeyStoreException, IOException, UnrecoverableKeyException + { + SSLContext context = SSLContext.getInstance("TLS"); + + Logger.I(TAG, "Creating TrustManager for system certificates"); + TrustManagerFactory systemTmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + systemTmf.init((KeyStore)null); + X509TrustManager systemTrustManager = (X509TrustManager)systemTmf.getTrustManagers()[0]; + + KeyStore keystore = KeyStore.getInstance( KeyStore.getDefaultType() ); + keystore.load(null); + + if(local_server_cert != null) + { + keystore.setCertificateEntry("cert-alias-local", local_server_cert); + } + + Logger.I(TAG, "Creating TrustManager for custom certificates"); + TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + tmf.init(keystore); + X509TrustManager customTrustManager = (X509TrustManager)tmf.getTrustManagers()[0]; + + KeyManagerFactory kmf = null; + KeyStore clientKeystore = null; + + if(client_private_key != null && client_cert_chain != null) + { + if (clientKeystore == null) + { + clientKeystore = KeyStore.getInstance("pkcs12"); + clientKeystore.load(null); + } + + KeyStore.PrivateKeyEntry pkEntry = new KeyStore.PrivateKeyEntry(client_private_key, client_cert_chain); + clientKeystore.setEntry("taup12", pkEntry, null); + } + + if (clientKeystore != null) { + kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + kmf.init(clientKeystore, null); + } + + context.init( + (kmf==null)?null:kmf.getKeyManagers(), + new TrustManager[] { new MySecureTrustManager( systemTrustManager, customTrustManager ) }, + new SecureRandom() + ); + + Logger.I(TAG, "Secure SSL factory initialization completed"); + + return (SSLSocketFactory)context.getSocketFactory(); + } + private static SSLSocketFactory getSecureFactory() throws NoSuchAlgorithmException, KeyManagementException, CertificateException, KeyStoreException, IOException, UnrecoverableKeyException { Logger.I(TAG, "Creating secure SSL factory");
JS apps: fix linking errors in RhoJSON
@@ -934,8 +934,10 @@ static void Init_RhoJSON() rb_RhoModule = rb_define_module("Rho"); rb_RhoJSON = rb_define_class_under(rb_RhoModule, "JSON", rb_cObject); +#if !defined(RHO_NO_RUBY) rb_define_singleton_method(rb_RhoJSON, "parse", rho_json_parse, 1); rb_define_singleton_method(rb_RhoJSON, "quote_value", rho_json_quote_value, 1); +#endif } static VALUE rb_RhoMessages;
bugfix(rmt): tx cmd without negative coding
@@ -338,7 +338,7 @@ static void rmt_example_nec_tx_task() int i, offset = 0; while(1) { //To build a series of waveforms. - i = nec_build_items(channel, item + offset, item_num - offset, ((~addr) << 8) | addr, cmd); + i = nec_build_items(channel, item + offset, item_num - offset, ((~addr) << 8) | addr, ((~cmd) << 8) | cmd); if(i < 0) { break; }
correct closest docs
@@ -114,7 +114,7 @@ Option Description ========================================================================== Default behavior ========================================================================== -The `closest` tool first searches for features in B that overlap a feature in A. If overlaps are found, the feature in B that overlaps the highest fraction of A is reported. If no overlaps are found, `closestBed` looks for +The `closest` tool first searches for features in B that overlap a feature in A. If overlaps are found, each feature in B that overlaps A is reported. If no overlaps are found, `closestBed` looks for the feature in B that is *closest* (that is, least genomic distance to the start or end of A) to A. For example, For example, consider the case where one of the intervals in B overlaps the interval in B, yet another does not:
avoid deadlock (rt_hw_interrupt_disable and rt_enter_critical when enable smp)
#include <rtthread.h> #include <rthw.h> -#ifdef RT_USING_SMP -rt_hw_spinlock_t _rt_critical_lock; -#endif /*RT_USING_SMP*/ - rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX]; rt_uint32_t rt_thread_ready_priority_group; #if RT_THREAD_PRIORITY_MAX > 32 @@ -859,12 +855,15 @@ void rt_enter_critical(void) * enough and does not check here */ - /* lock scheduler for all cpus */ - if (current_thread->critical_lock_nest == 0) { - rt_hw_spin_lock(&_rt_critical_lock); + register rt_uint16_t lock_nest = current_thread->cpus_lock_nest; + current_thread->cpus_lock_nest++; + if (lock_nest == 0) + { + current_thread->scheduler_lock_nest ++; + rt_hw_spin_lock(&_cpus_lock); + } } - /* critical for local cpu */ current_thread->critical_lock_nest ++; @@ -917,9 +916,11 @@ void rt_exit_critical(void) current_thread->critical_lock_nest --; - if (current_thread->critical_lock_nest == 0) + current_thread->cpus_lock_nest--; + if (current_thread->cpus_lock_nest == 0) { - rt_hw_spin_unlock(&_rt_critical_lock); + current_thread->scheduler_lock_nest --; + rt_hw_spin_unlock(&_cpus_lock); } if (current_thread->scheduler_lock_nest <= 0)
Resolve segfault and add new opcode to compiler argcount
@@ -1615,9 +1615,13 @@ static void method(Compiler *compiler, bool private, Token *identifier, bool *ha if (strcmp(AS_STRING(entry->key)->chars, "annotatedMethodName") == 0) { Value existingDict; dictGet(compiler->methodAnnotations, entry->key, &existingDict); - dictDelete(vm, compiler->methodAnnotations, entry->key); + push(vm, OBJ_VAL(existingDict)); ObjString *methodKey = copyString(vm, compiler->parser->previous.start, compiler->parser->previous.length); dictSet(vm, compiler->methodAnnotations, OBJ_VAL(methodKey), existingDict); + pop(vm); + dictDelete(vm, compiler->methodAnnotations, entry->key); + + break; } } *hasAnnotation = false; @@ -2095,6 +2099,7 @@ static int getArgCount(uint8_t *code, const ValueArray constants, int ip) { case OP_NEW_DICT: case OP_CLOSE_FILE: case OP_MULTI_CASE: + case OP_DEFINE_METHOD_ANNOTATIONS: return 1; case OP_DEFINE_OPTIONAL:
vlib: fix coverity warning / real bug The path must be next-to-impossible to hit, because the code has been wrong for at least 5 years. Type: fix
@@ -1217,7 +1217,7 @@ add_sub_command (vlib_cli_main_t * cm, uword parent_index, uword child_index) vec_len (p->sub_rules)); vec_add2 (p->sub_rules, sr, 1); sr->name = sub_name; - sr->rule_index = q[0]; + sr->rule_index = sr - p->sub_rules; sr->command_index = child_index; return; }
OcCompressionLib: Add change note to the changes from last commit as required by license.
#ifndef ZLIB_H #define ZLIB_H +// +// EDIT (Download-Fritz): Disable MSVC warnings preventing compilation. +// Include stddef.h for its wchar_t definition. +// #if defined(_MSC_VER) #include <stddef.h> #pragma warning ( disable : 4131 )
Correct Danfoss window states script
switch (Attr.val) { - case "0": + case 0: Item.val = "Quarantine"; break; - case "1": + case 1: Item.val = "Closed"; break; - case "2": + case 2: Item.val = "Hold"; break; - case "3": + case 3: Item.val = "Open"; break; - case "4": + case 4: Item.val = "Open (external), closed (internal)"; break; } \ No newline at end of file
Only move collisions/actors/triggers if tile has changed when moving mouse, prevents multiple identical redux actions which pollute undo history
@@ -39,6 +39,7 @@ class Scene extends Component { const tX = Math.floor(x / (8 * zoomRatio)); const tY = Math.floor(y / (8 * zoomRatio)); + if (tX !== this.lastTX || tY !== this.lastTY) { if (creating) { if (tool === "collisions") { if (this.remove) { @@ -73,7 +74,7 @@ class Scene extends Component { let actor = this.actorAt(tX, tY); - this.props.setStatus({ + this.setStatus({ sceneName: scene.name, x: tX, y: tY, @@ -85,8 +86,16 @@ class Scene extends Component { hoverX: tX, hoverY: tY }); + + this.lastTX = tX; + this.lastTY = tY; + } }; + setStatus = throttle((options) => { + this.props.setStatus(options); + }, 200) + onMouseDown = e => { const { id, tool, scene, width, showCollisions } = this.props; const { hoverX, hoverY } = this.state;