message
stringlengths
6
474
diff
stringlengths
8
5.22k
homepage: add camel;xerces;yamlcpp to build
@@ -21,7 +21,7 @@ LD_FLAGS='-Wl,-z,now -Wl,-z,relro' cmake -DENABLE_ASAN=ON -DBUILD_FULL=OFF -DBUILD_SHARED=ON -DBUILD_STATIC=OFF -DBUILD_DOCUMENTATION=OFF \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PATH}" -DINSTALL_SYSTEM_FILES=OFF \ - -DPLUGINS='ALL;-EXPERIMENTAL;-fstab;-semlock;file;-ruby;-lua;-python;-python2' \ + -DPLUGINS='ALL;-EXPERIMENTAL;-fstab;-semlock;-ruby;-lua;-python;-python2;file;camel;xerces;yamlcpp' \ -DTOOLS='kdb;rest-backend;rest-frontend' \ -DCMAKE_C_FLAGS="$C_FLAGS" \ -DCMAKE_CXX_FLAGS="$C_FLAGS" \
Move net_init() and net_cleanup() upwards These two functions are global, define them at the top of the implementation file. This is consistent with the header file.
typedef struct in_addr IN_ADDR; #endif +bool +net_init(void) { +#ifdef __WINDOWS__ + WSADATA wsa; + int res = WSAStartup(MAKEWORD(2, 2), &wsa) < 0; + if (res < 0) { + LOGC("WSAStartup failed with error %d", res); + return false; + } +#endif + return true; +} + +void +net_cleanup(void) { +#ifdef __WINDOWS__ + WSACleanup(); +#endif +} + static void net_perror(const char *s) { #ifdef _WIN32 @@ -133,26 +153,6 @@ net_shutdown(socket_t socket, int how) { return !shutdown(socket, how); } -bool -net_init(void) { -#ifdef __WINDOWS__ - WSADATA wsa; - int res = WSAStartup(MAKEWORD(2, 2), &wsa) < 0; - if (res < 0) { - LOGC("WSAStartup failed with error %d", res); - return false; - } -#endif - return true; -} - -void -net_cleanup(void) { -#ifdef __WINDOWS__ - WSACleanup(); -#endif -} - bool net_close(socket_t socket) { #ifdef __WINDOWS__
Update README.md Internal command removed
@@ -16,11 +16,6 @@ devtools::install() ### Quick start -```sh -# download data -sky get -wu --network=Backbone rbtorrent:45de565860210ca922cc684d33f6a6b989320456 -``` - ```r # load data to R pool_path = 'train_full3'
Use the new clipping only in situations where it actually helps
@@ -702,13 +702,22 @@ void kvz_set_ctu_qp_lambda(encoder_state_t * const state, vector2d_t pos) { } } else { - encoder_state_t *previous = state->previous_encoder_state; - const int layer = encoder->cfg.gop[state->frame->gop_offset].layer; + encoder_state_t *previous = state; + if((encoder->cfg.gop_lp_definition.d != 0 && + (encoder->cfg.owf == 1 || encoder->cfg.owf == 3)) || + (encoder->cfg.gop_len != 0 && !encoder->cfg.gop_lowdelay && encoder->cfg.owf > 5)) { + + // THis doesn't have problem with previous frame not existing because + // the first frame is intra and can never get here + previous = state->previous_encoder_state; int owf = MIN(encoder->cfg.owf, state->frame->num); + const int layer = encoder->cfg.gop[state->frame->gop_offset].layer; + while (layer != encoder->cfg.gop[previous->frame->gop_offset].layer && --owf) { previous = previous->previous_encoder_state; } + } if (state->frame->lcu_stats[index].lambda > 0) { clip_neighbor_lambda = previous->frame->lcu_stats[index].lambda;
bricks/ev3dev/docker: add libsndfile1-dev This is used for reading sound files.
@@ -5,11 +5,12 @@ RUN sudo apt-get update && \ ev3dev-mocks \ libasound2-plugin-ev3dev:armel \ libasound2:armel \ + libasound2-dev:armel \ + libsndfile1-dev:armel \ libffi-dev:armel \ libi2c-dev \ libmagickwand-6.q16-3:armel \ libsndfile1:armel \ - libasound2-dev:armel \ libudev-dev:armel \ libumockdev0:armel \ pkg-config \
refactor Catboostregressor docs
@@ -4914,7 +4914,6 @@ class CatBoostRegressor(CatBoost): Parameters ---------- Like in CatBoostClassifier, except loss_function, classes_count, class_names and class_weights - #TODO add aft loss_function : string, [default='RMSE'] 'RMSE' 'MAE' @@ -4923,6 +4922,7 @@ class CatBoostRegressor(CatBoost): 'Poisson' 'MAPE' 'Lq:q=value' + 'SurvivalAft:dist=value;scale=value' """ _estimator_type = 'regressor'
2704: h2o: config: bug-fix: max-connections configuration value should not exceed RLIMIT_NOFILE
@@ -3440,10 +3440,13 @@ int main(int argc, char **argv) conf.error_log = NULL; } - { /* raise RLIMIT_NOFILE */ - struct rlimit limit; + { + struct rlimit limit = { 0 }; + if (getrlimit(RLIMIT_NOFILE, &limit) == 0) { + /* raise RLIMIT_NOFILE */ limit.rlim_cur = limit.rlim_max; + if (setrlimit(RLIMIT_NOFILE, &limit) == 0 #ifdef __APPLE__ || (limit.rlim_cur = OPEN_MAX, setrlimit(RLIMIT_NOFILE, &limit)) == 0 @@ -3452,6 +3455,16 @@ int main(int argc, char **argv) fprintf(stderr, "[INFO] raised RLIMIT_NOFILE to %d\n", (int)limit.rlim_cur); } } + + if (conf.max_connections > (int)limit.rlim_cur) { + fprintf(stderr, + "[FATAL] The 'max-connections'=[%d] configuration value " + "should not exceed the file descriptor limit of " + "the process 'RLIMIT_NOFILE'=[%lu]\n", + conf.max_connections, + limit.rlim_cur); + return EX_CONFIG; + } } setup_signal_handlers();
tests/basics/sys_intern: Comment out check no longer true with CPython3.8. It seems that CPython3.8 over-interns strings.
@@ -10,7 +10,8 @@ except AttributeError: s1 = "long long long long long long" s2 = "long long long" + " long long long" -print(id(s1) == id(s2)) +# The result varies across CPython versions, e.g. 3.6 vs 3.8. +#print(id(s1) == id(s2)) i1 = sys.intern(s1) i2 = sys.intern(s2)
Remove RtlQueryInformationAcl since it doesn't always return the correct ACL length
@@ -823,32 +823,20 @@ _Callback_ NTSTATUS PhStdGetObjectSecurity( if (NT_SUCCESS(status) && !defaultDacl->DefaultDacl) status = STATUS_INVALID_SECURITY_DESCR; - if (NT_SUCCESS(status)) - { - ACL_SIZE_INFORMATION aclSizeInfo; - - status = RtlQueryInformationAcl( - defaultDacl->DefaultDacl, - &aclSizeInfo, - sizeof(ACL_SIZE_INFORMATION), - AclSizeInformation - ); - if (NT_SUCCESS(status)) { ULONG allocationLength; PSECURITY_DESCRIPTOR securityDescriptor; - allocationLength = SECURITY_DESCRIPTOR_MIN_LENGTH + aclSizeInfo.AclBytesInUse; + allocationLength = SECURITY_DESCRIPTOR_MIN_LENGTH + defaultDacl->DefaultDacl->AclSize; - securityDescriptor = PhAllocateZero(allocationLength); + securityDescriptor = PhAllocateZero(PAGE_SIZE); RtlCreateSecurityDescriptor(securityDescriptor, SECURITY_DESCRIPTOR_REVISION); RtlSetDaclSecurityDescriptor(securityDescriptor, TRUE, defaultDacl->DefaultDacl, FALSE); assert(allocationLength == RtlLengthSecurityDescriptor(securityDescriptor)); *SecurityDescriptor = securityDescriptor; - } PhFree(defaultDacl); }
fix regex arch query
@@ -29,7 +29,7 @@ $mpi_exceptions{"mkl-blacs"} = 1; # extra file to create) - per arch basis my %page_breaks = (); -if ( $ENV{'PWD'} =~ /\s+\/x86_64\// ) { +if ( $ENV{'PWD'} =~ /\S+\/x86_64\// ) { $page_breaks{"scorep-gnu7-impi-ohpc"} = 2; $page_breaks{"petsc-gnu-impi-ohpc"} = 2; $page_breaks{"phdf5-gnu-impi-ohpc"} = 2;
chore: fix e2e example path for profilerecording specific container logs
@@ -155,7 +155,7 @@ func (e *e2e) testCaseProfileRecordingMultiContainerLogs() { func (e *e2e) testCaseProfileRecordingSpecificContainerLogs() { e.logEnricherOnlyTestCase() - e.profileRecordingSpecificContainer(exampleRecordingBpfSpecificContainerPath, + e.profileRecordingSpecificContainer(exampleRecordingSeccompSpecificContainerLogsPath, regexp.MustCompile(`(?m)"container"="nginx".*"syscallName"="setuid"`), ) }
Fix installation path for desktop-file and icons. This change fixes installation path for desktop-file and icons. They should be installed directly to ``` /usr/share/applications/ /usr/share/icons/hicolor/scalable/apps/ ```
@@ -13,11 +13,11 @@ if (NOT WIN32) # Install desktop application entry install(FILES stlink-gui.desktop - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/applications) + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) # Install icons install(FILES icons/stlink-gui.svg - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/icons/hicolor/scalable/apps) + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps) set(GUI_SOURCES gui.c gui.h)
haskell-cmake-improvements: remove unrequired hint
@@ -64,13 +64,7 @@ Before configuring the project via cmake, make sure you have set the environment to the sandbox' location unless you are using the standard folder as described above. In case you simply want to install the bindings, but no other haskell based plugins, -install the following dependencies into the sandbox. Please note that ideally you use -the same cabal library version as your local cabal executable has been compiled with -to avoid compilation warnings. To find out that version use the command `cabal --version` -and check the string `compiled using version ... of the Cabal library`, using the minor -version. -As an example, in case of Debian Stretch `cabal` uses the version `1.24.1.0`, so adjust -the version string below to `Cabal == 1.24.*` before installing. +install the following dependencies into the sandbox. ``` cabal install 'Cabal >=1.24.1 && <2.4' 'base >=4.9 && <4.12' 'containers >=0.5 && <0.6' \
aes/sha: fixed driver reseting the wrong GDMA channel Driver was using the channel ID from tx when reseting rx. But since rx and tx is not necessarily from the same pair this could lead to the driver reseting the wrong DMA channel.
@@ -128,7 +128,7 @@ esp_err_t esp_crypto_shared_gdma_start(const lldesc_t *input, const lldesc_t *ou } /* tx channel is reset by gdma_connect(), also reset rx to ensure a known state */ - gdma_get_channel_id(tx_channel, &rx_ch_id); + gdma_get_channel_id(rx_channel, &rx_ch_id); gdma_ll_rx_reset_channel(&GDMA, rx_ch_id); gdma_start(tx_channel, (intptr_t)input);
Remove `virtual` operator for the helper.
@@ -32,7 +32,7 @@ namespace ARIASDK_NS_BEGIN { mutable std::mutex m_dataViewerMapLock; protected: - virtual bool IsViewerEnabledHelper(const char* viewerName) const; + bool IsViewerEnabledHelper(const char* viewerName) const; std::vector<std::shared_ptr<IDataViewer>> m_dataViewerCollection; };
fix typo in sway-output.5.scd
@@ -142,7 +142,7 @@ must be separated by one space. For example: Enables or disables adaptive synchronization (often referred to as Variable Refresh Rate, or by the vendor-specific names FreeSync/G-Sync). - Adaptive sync allows clients to submit frames a little to late without + Adaptive sync allows clients to submit frames a little too late without having to wait a whole refresh period to display it on screen. Enabling adaptive sync can improve latency, but can cause flickering on some hardware.
third attempt at foreign platform compilation
#endif #ifdef _MSC_VER - #define noreturn __declspec(noreturn) + #define noreturn #else #define noreturn __attribute__((noreturn)) /* this is ok in gcc/g++/clang and tcc; pure attribute is rarely applicable here, and does not seem to be helpful (maybe safe_strlen) */ #define MS_WINDOWS 0 #endif -#ifndef _WIN32 +#if defined(__GNUC__) #define Jmp_Buf sigjmp_buf #define SetJmp(A, B) sigsetjmp(A, B) #define LongJmp(A, B) siglongjmp(A, B)
Update default scenario with filter function
@@ -97,10 +97,14 @@ void Reset_Context(void) ******************************************************************************/ static void Detection(service_t *service) { + search_result_t result; + Luos_Detect(service); Luos_Loop(); - printf("[INFO] %d services are active\n", RoutingTB_GetServiceNB()); - TEST_ASSERT_EQUAL(DUMMY_SERVICE_NUMBER, RoutingTB_GetServiceNB()); + + RTFilter_Reset(&result); + printf("[INFO] %d services are active\n", result.result_nbr); + TEST_ASSERT_EQUAL(DUMMY_SERVICE_NUMBER, result.result_nbr); } /******************************************************************************
Fix up webclient.
(setdyn :pretty-format "%.20P") (repl (fn get-line [buf p] (def offset (parser/where p)) - (def prompt (string "janet:" offset ":" (parser/state p) "> ")) + (def prompt (string "janet:" offset ":" (parser/state p :delimiters) "> ")) (repl-yield prompt buf) (yield) buf))))
COIL: Rename comments in PI3USB2x532 driver Rename i2c comments in PI3USB2x532 driver to match current naming. BRANCH=None TEST=make -j buildall
@@ -17,7 +17,7 @@ static int pi3usb3x532_read(const struct usb_mux *me, int read, res; /* - * First byte read will be slave address (ignored). + * First byte read will be i2c address (ignored). * Second byte read will be vendor ID. * Third byte read will be selection control. */
[state] fix bug: load contract storage from db
@@ -39,17 +39,9 @@ type ContractState struct { dbstore *db.DB } -func (st *ContractState) loadStorage() error { - storage := trie.NewTrie(32, types.TrieHasher, *st.dbstore) - root := st.State.StorageRoot - if root != nil { - err := storage.LoadCache(root) - if err != nil { - return err - } - } - st.storage = storage - return nil +func (st *ContractState) loadStorage() { + st.storage = trie.NewTrie(32, types.TrieHasher, *st.dbstore) + st.storage.Root = st.State.StorageRoot } func (st *ContractState) SetNonce(nonce uint64) { @@ -94,10 +86,7 @@ func (st *ContractState) GetCode() ([]byte, error) { func (st *ContractState) SetData(key, value []byte) error { if st.storage == nil { - err := st.loadStorage() - if err != nil { - return err - } + st.loadStorage() } hkey := types.TrieHasher(key) _, err := st.storage.Update(trie.DataArray{hkey[:]}, trie.DataArray{value}) @@ -109,10 +98,7 @@ func (st *ContractState) SetData(key, value []byte) error { } func (st *ContractState) GetData(key []byte) ([]byte, error) { if st.storage == nil { - err := st.loadStorage() - if err != nil { - return nil, err - } + st.loadStorage() } hkey := types.TrieHasher(key) value, err := st.storage.Get(hkey[:])
BugID:16760137:modify IOT_MQTT_Construct to avoid reinit mqtt
@@ -3373,6 +3373,9 @@ void *IOT_MQTT_Construct(iotx_mqtt_param_t *pInitParams) iotx_mqtt_param_t *mqtt_params = NULL; if (pInitParams == NULL) { + if (g_mqtt_client != NULL) { + return NULL; + } mqtt_params = (iotx_mqtt_param_t *)mqtt_malloc(sizeof(iotx_mqtt_param_t)); if (mqtt_params == NULL) {
Transformed convert from 256 to cast 256 -> 128 and then convert from 128
@@ -813,8 +813,8 @@ static void inter_recon_bipred_no_mov_avx2( case 8: - lcu->rec.u[(y_in_lcu)* LCU_WIDTH_C + x_in_lcu] = _mm256_cvtsi256_si32(temp_u_epi8); - lcu->rec.v[(y_in_lcu)* LCU_WIDTH_C + x_in_lcu] = _mm256_cvtsi256_si32(temp_v_epi8); + lcu->rec.u[(y_in_lcu)* LCU_WIDTH_C + x_in_lcu] = _mm_cvtsi128_si32(_mm256_castsi256_si128(temp_u_epi8)); + lcu->rec.v[(y_in_lcu)* LCU_WIDTH_C + x_in_lcu] = _mm_cvtsi128_si32(_mm256_castsi256_si128(temp_v_epi8)); break; @@ -921,7 +921,7 @@ static void inter_recon_bipred_avx2(const int hi_prec_luma_rec0, case 4: temp_epi8 = _mm256_packus_epi16(temp_y_epi16, temp_y_epi16); - lcu->rec.y[(y_in_lcu)* LCU_WIDTH + x_in_lcu] = _mm256_cvtsi256_si32(temp_epi8); + lcu->rec.y[(y_in_lcu)* LCU_WIDTH + x_in_lcu] = _mm_cvtsi128_si32(_mm256_castsi256_si128(temp_epi8)); break; case 8: @@ -1009,10 +1009,10 @@ static void inter_recon_bipred_avx2(const int hi_prec_luma_rec0, temp_epi8 = _mm256_packus_epi16(temp_u_epi16, temp_u_epi16); - lcu->rec.u[(y_in_lcu)* LCU_WIDTH_C + x_in_lcu] = _mm256_cvtsi256_si32(temp_epi8); + lcu->rec.u[(y_in_lcu)* LCU_WIDTH_C + x_in_lcu] = _mm_cvtsi128_si32(_mm256_castsi256_si128(temp_epi8)); temp_epi8 = _mm256_packus_epi16(temp_v_epi16, temp_v_epi16); - lcu->rec.v[(y_in_lcu)* LCU_WIDTH_C + x_in_lcu] = _mm256_cvtsi256_si32(temp_epi8); + lcu->rec.v[(y_in_lcu)* LCU_WIDTH_C + x_in_lcu] = _mm_cvtsi128_si32(_mm256_castsi256_si128(temp_epi8)); break;
Fix to allow OpenQueueEntry_t reset by calling tossHeader function.
@@ -276,9 +276,10 @@ void packetfunctions_reserveHeaderSize(OpenQueueEntry_t* pkt, uint8_t header_len } void packetfunctions_tossHeader(OpenQueueEntry_t* pkt, uint8_t header_length) { + pkt->payload += header_length; pkt->length -= header_length; - if ( (uint8_t*)(pkt->payload) > (uint8_t*)(pkt->packet+126) ) { + if ( (uint8_t*)(pkt->payload) > (uint8_t*)(pkt->packet+127) ) { openserial_printError(COMPONENT_PACKETFUNCTIONS,ERR_HEADER_TOO_LONG, (errorparameter_t)1, (errorparameter_t)pkt->length);
BugID:17711683: Use log module interface to replace aos_cli_printf
static void app_delayed_action(void *arg) { - aos_cli_printf("helloworld %s:%d %s\r\n", __func__, __LINE__, aos_task_name()); + LOG("helloworld %s:%d %s\r\n", __func__, __LINE__, aos_task_name()); aos_post_delayed_action(5000, app_delayed_action, NULL); }
fix: delete Malloc funcation to avoid memory leaks
@@ -572,7 +572,6 @@ END_TEST START_TEST(test_002InitWallet_0002SetEIP155CompFailureNullParam) { BSINT32 rtnVal; - BoatPlatONWallet *wallet_ptr = BoatMalloc(sizeof(BoatPlatONWallet)); BoatPlatONWalletConfig wallet = get_platon_wallet_settings(); /* 1. execute unit test */ @@ -582,7 +581,6 @@ START_TEST(test_002InitWallet_0002SetEIP155CompFailureNullParam) ck_assert_int_eq(rtnVal, BOAT_ERROR_COMMON_INVALID_ARGUMENT); /* 2-2. verify the global variables that be affected */ - ck_assert(wallet_ptr->network_info.eip155_compatibility == BOAT_FALSE); } END_TEST
Proper conversion of old hotkeys.json config format to new bindings.json
@@ -95,7 +95,7 @@ std::vector<VKBindInfo> VKBindings::InitializeMods(std::vector<VKBindInfo> aVKBi void VKBindings::Load(const Overlay& aOverlay) { - auto parseConfig {[this, &aOverlay](const std::filesystem::path& path) -> bool { + auto parseConfig {[this, &aOverlay](const std::filesystem::path& path, bool old = false) -> bool { std::ifstream ifs { path }; if (ifs) { @@ -105,7 +105,21 @@ void VKBindings::Load(const Overlay& aOverlay) // properly auto-bind Overlay if it is present here (could be this is first start so it may not be // in here yet) auto vkBind { (it.key() == aOverlay.GetBind().ID) ? aOverlay.GetBind() : VKBind{ it.key() } }; - const auto ret { Bind(it.value(), vkBind) }; + + uint64_t key { it.value() }; + if (old) + { + // encoded key bind was 32-bit number in old config, convert it to new 64-bit format + key = + { + ((key & 0x000000FF) << 8*0) + | ((key & 0x0000FF00) << 8*1) + | ((key & 0x00FF0000) << 8*2) + | ((key & 0xFF000000) << 8*3) + }; + } + + const auto ret { Bind(key, vkBind) }; assert(ret); // we want this to never fail! } return true; @@ -118,7 +132,7 @@ void VKBindings::Load(const Overlay& aOverlay) { // if failed, try to look for old config auto oldPath = m_paths.CETRoot() / "hotkeys.json"; - if (parseConfig(oldPath)) + if (parseConfig(oldPath, true)) { // old config found and parsed, remove it and save it to current location remove(oldPath);
[RAFT] change default timeout to 30sec for enterprise tx command of aergocli
@@ -33,7 +33,7 @@ var ( func init() { rootCmd.AddCommand(enterpriseCmd) - enterpriseTxCmd.Flags().Uint64VarP(&timeout, "timeout", "t", 3600, "timeout(second) of geting status of enterprise transaction") + enterpriseTxCmd.Flags().Uint64VarP(&timeout, "timeout", "t", 30, "timeout(second) of geting status of enterprise transaction") enterpriseCmd.AddCommand(enterpriseKeyCmd) enterpriseCmd.AddCommand(enterpriseTxCmd)
Silence some code completion errors
@@ -5,23 +5,56 @@ except: import jedi import sys import traceback +from rubicon.objc import at +from Foundation import NSAutoreleasePool + +_completions_queue = 0 def suggestForCode(code, index, path): + global _completions_queue + + pool = NSAutoreleasePool.alloc().init() + - for console in ConsoleViewController.objcVisibles: - def visibleEditor(): - return console.editorSplitViewController.editor + try: + visibles = ConsoleViewController.objcVisibles + except AttributeError: + visibles = [] + + for console in visibles: - if visibleEditor().document.fileURL.path != path: + try: + try: + if console.editorSplitViewController is None: + continue + except AttributeError: + return + + try: + visibleEditor = console.editorSplitViewController.editor + except AttributeError: + visibleEditor = console.editorSplitViewController().editor + + if visibleEditor is None: + continue + + try: + if visibleEditor.document.fileURL.path != path: + continue + except AttributeError: + if visibleEditor.document().fileURL.path != path: continue if code.endswith(");\n"): - if visibleEditor() is None: + if visibleEditor is None: return - visibleEditor().completions = [] - visibleEditor().suggestions = [] - visibleEditor().docStrings = None + visibleEditor.completions = [] + visibleEditor.suggestions = [] + visibleEditor.docStrings = None + return + except Exception as e: + sys.__stdout__.write("Code completion:\n "+traceback.format_exc()+"\n") return try: @@ -38,7 +71,7 @@ def suggestForCode(code, index, path): definitions.append([decl, line]) - visibleEditor().definitions = definitions + visibleEditor.definitions = definitions suggestions = [] completions = [] @@ -96,21 +129,24 @@ def suggestForCode(code, index, path): suggestions = [] break - visibleEditor().signature = signature - visibleEditor().completions = completions - visibleEditor().suggestions = suggestions - visibleEditor().docStrings = docs + visibleEditor.signature = signature + visibleEditor.completions = completions + visibleEditor.suggestions = suggestions + visibleEditor.docStrings = docs + except Exception as e: sys.__stdout__.write("Code completion:\n "+traceback.format_exc()+"\n") - if visibleEditor() is None: + if visibleEditor is None: return - visibleEditor().completions = [] - visibleEditor().suggestions = [] - visibleEditor().signature = "" - visibleEditor().docStrings = None + visibleEditor.completions = [] + visibleEditor.suggestions = [] + visibleEditor.signature = "" + visibleEditor.docStrings = None + + pool.release() def suggestionsForCode(code, path=None):
Remove index 0 = 1 check to simplify fade to black I think this makes fade to white faster, could be added back to white path if this needs to be slower again?
@@ -16,8 +16,8 @@ static const UBYTE bgp_fade_black_vals[] = {0xFF, 0xFF, 0xFE, 0xE9, 0xE5, 0xE4, #ifdef CGB UWORD UpdateColorBlack(UINT8 i, UWORD col) { - return RGB2(DespRight(PAL_RED(col), 6 - i), DespRight(PAL_GREEN(col), 6 - i), - DespRight(PAL_BLUE(col), 6 - i)); + return RGB2(DespRight(PAL_RED(col), 5 - i), DespRight(PAL_GREEN(col), 5 - i), + DespRight(PAL_BLUE(col), 5 - i)); } void ApplyPaletteChangeColor(UBYTE index) { @@ -26,10 +26,7 @@ void ApplyPaletteChangeColor(UBYTE index) { UWORD paletteWhite; UWORD* col = BkgPalette; - if (index == 0) { - index = 1; - } - if (index == 6) { + if (index == 5) { set_bkg_palette(0, 8, BkgPalette); set_sprite_palette(0, 8, SprPalette); return; @@ -46,8 +43,8 @@ void ApplyPaletteChangeColor(UBYTE index) { } set_sprite_palette(0, 8, palette); } else { - paletteWhite = RGB2(DespRight(0x1F, index - 1), DespRight(0x1F, index - 1), - DespRight(0x1F, index - 1)); + paletteWhite = RGB2(DespRight(0x1F, index), DespRight(0x1F, index), + DespRight(0x1F, index)); for (c = 0; c != 32; ++c, ++col) { palette[c] = (UWORD)*col | paletteWhite; } @@ -103,7 +100,7 @@ void FadeUpdate_b() { if ((fade_frame & fade_frames_per_step) == 0) { if (fade_direction == FADE_IN) { fade_timer++; - if (fade_timer == 6) { + if (fade_timer == 5) { fade_running = FALSE; } } else {
Check range of test values using isascii before diving into the full range of ctype functions. Revert "Don't try to compare the ctype functions on values > 127" This reverts commit
@@ -27,9 +27,14 @@ static int isblank(int c) static int test_ctype_chars(int n) { - return TEST_int_eq(isalnum(n) != 0, ossl_isalnum(n) != 0) - && TEST_int_eq(isalpha(n) != 0, ossl_isalpha(n) != 0) - && TEST_int_eq(isascii(n) != 0, ossl_isascii(n) != 0) + if (!TEST_int_eq(isascii((unsigned char)n) != 0, ossl_isascii(n) != 0)) + return 0; + + if (!ossl_isascii(n)) + return 1; + + return TEST_int_eq(isalpha(n) != 0, ossl_isalpha(n) != 0) + && TEST_int_eq(isalnum(n) != 0, ossl_isalnum(n) != 0) && TEST_int_eq(isblank(n) != 0, ossl_isblank(n) != 0) && TEST_int_eq(iscntrl(n) != 0, ossl_iscntrl(n) != 0) && TEST_int_eq(isdigit(n) != 0, ossl_isdigit(n) != 0) @@ -75,7 +80,7 @@ static int test_ctype_eof(void) int setup_tests(void) { - ADD_ALL_TESTS(test_ctype_chars, 128); + ADD_ALL_TESTS(test_ctype_chars, 256); ADD_ALL_TESTS(test_ctype_toupper, OSSL_NELEM(case_change)); ADD_ALL_TESTS(test_ctype_tolower, OSSL_NELEM(case_change)); ADD_TEST(test_ctype_eof);
framework/st_things : remove unused code "user_def_dev_list". Delete the logic and functions that contain "user_def_dev_list".
#define MAX_FILE_PATH_LENGTH (250) -#define MAX_SUBDEVICE_EA (100) - #define MAX_SOFTAP_SSID (64) #define PATH_MNT "/mnt/" #define PATH_ROM "/rom/" static bool is_support_user_def_dev_list = true; // It's allow to apply user-defined device-ID only when start Stack. -static char *user_def_dev_list[MAX_SUBDEVICE_EA + 1] = { 0, }; static volatile int resource_type_cnt = 0; @@ -1821,16 +1818,6 @@ st_device_s *dm_get_info_of_dev(unsigned long number) return (st_device_s *)hashmap_get(g_device_hmap, number); } -static void dm_delete_user_define_device_id(void) -{ - int i = 0; - - for (i = 0; i < MAX_SUBDEVICE_EA; i++) { - things_free(user_def_dev_list[i]); - user_def_dev_list[i] = NULL; - } -} - bool dm_register_device_id(void) { int i = 0; @@ -1856,44 +1843,8 @@ bool dm_register_device_id(void) } memcpy(dev_list[0]->device_id, id, strlen(id) + 1); - // Set Sub-Device ID - for (i = 1; i < device_cnt; i++) { - dev_list[i] = (st_device_s *)hashmap_get(g_device_hmap, (unsigned long)i); - if (dev_list[i] == NULL) { - THINGS_LOG_V_ERROR(THINGS_ERROR, TAG, "Error : device[%d] =0x%X", i, dev_list[i]); - goto GOTO_ERROR; - } - - if (user_def_dev_list[i] != NULL || strlen(dev_list[i]->device_id) == 0) { - // a. If logical device is in a hosting(physical) device. - if (dev_list[i]->is_physical == 1) { - OCRandomUuidResult idGenRet = RAND_UUID_CONVERT_ERROR; - - if (user_def_dev_list[i]) { - THINGS_LOG_D(THINGS_DEBUG, TAG, "Set Sub-device ID with user-defined device ID."); - memcpy(dev_list[i]->device_id, user_def_dev_list[i], strlen(user_def_dev_list[i]) + 1); - idGenRet = RAND_UUID_OK; - } else { - THINGS_LOG_D(THINGS_DEBUG, TAG, "Set Sub-device ID with Auto-Generated device ID."); - idGenRet = OCGenerateUuidString(dev_list[i]->device_id); - } - - if (idGenRet != RAND_UUID_OK) { - THINGS_LOG_D_ERROR(THINGS_ERROR, TAG, "[DEVICE] Device ID Creation Failed : %d", idGenRet); - } else { - THINGS_LOG_D(THINGS_DEBUG, TAG, "[DEVICE] ID Created : %s", (dev_list[i]->device_id)); - } - } - // b. If logical device is in the other physical device - else { - THINGS_LOG_D(THINGS_INFO, TAG, "[DEVICE] Not Physically Separated Device "); - } - } - } - is_support_user_def_dev_list = false; // It's allow permission to apply user defined device-ID only when start THINGS_STACK. - dm_delete_user_define_device_id(); things_free(dev_list); dev_list = NULL; return true;
stm32/sdcard: Properly reset SD periph when SDMMC2 is used on H7 MCUs.
@@ -169,9 +169,14 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { #if defined(STM32H7) // Reset SDMMC + #if defined(MICROPY_HW_SDMMC2_CK) + __HAL_RCC_SDMMC2_FORCE_RESET(); + __HAL_RCC_SDMMC2_RELEASE_RESET(); + #else __HAL_RCC_SDMMC1_FORCE_RESET(); __HAL_RCC_SDMMC1_RELEASE_RESET(); #endif + #endif // NVIC configuration for SDIO interrupts NVIC_SetPriority(SDMMC_IRQn, IRQ_PRI_SDIO);
zephyr: Improve help text for ACPI support Expand on the help text for the CONFIG_PLATFORM_EC_ACPI option. BRANCH=none TEST=zmake testall
@@ -50,11 +50,23 @@ rsource "Kconfig.usbc" # Please keep these in alphabetical order config PLATFORM_EC_ACPI - bool "Enable the ACPI module" + bool "Advanced Confiugration and Power Interface (ACPI)" default y if AP_X86 && PLATFORM_EC_ESPI help - Enable shimming the ACPI handler, which will handle the Host data from - the ACPI I/O port for X86 AP. + Enable the Advanced Configuration and Power Interface (ACPI) in the + EC. ACPI is a standard interface to the Application Processor (AP) + that abstracts the hardware specific details for controlling and + managing the board. + + This includes interfaces for monitoring or controlling features, + including: + keyboard backlight + fan speed + temperature sensors + charging properties + device orientation (tablet or laptop mode) + + https://uefi.org/sites/default/files/resources/ACPI_Spec_6_4_Jan22.pdf config PLATFORM_EC_BACKLIGHT_LID bool "Control the display backlight based on the lid switch"
Adjust Haswell ZGEMM blocking parameters
@@ -1572,7 +1572,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define SGEMM_DEFAULT_P 768 #define DGEMM_DEFAULT_P 512 #define CGEMM_DEFAULT_P 384 -#define ZGEMM_DEFAULT_P 256 +#define ZGEMM_DEFAULT_P 192 #ifdef WINDOWS_ABI #define SGEMM_DEFAULT_Q 320 @@ -1582,7 +1582,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define DGEMM_DEFAULT_Q 256 #endif #define CGEMM_DEFAULT_Q 192 -#define ZGEMM_DEFAULT_Q 128 +#define ZGEMM_DEFAULT_Q 192 #define SGEMM_DEFAULT_R sgemm_r #define DGEMM_DEFAULT_R 13824
log UPDATE set ly log store for callback as well
@@ -443,7 +443,7 @@ sr_strerror(int err_code) API void sr_log_stderr(sr_log_level_t log_level) { - /* initializes libyang logging for our purpose */ + /* initializes libyang logging for our purposes */ ly_log_options(LY_LOSTORE); sr_stderr_ll = log_level; @@ -458,7 +458,7 @@ sr_log_get_stderr(void) API void sr_log_syslog(const char *app_name, sr_log_level_t log_level) { - /* initializes libyang logging for our purpose */ + /* initializes libyang logging for our purposes */ ly_log_options(LY_LOSTORE); sr_syslog_ll = log_level; @@ -483,5 +483,8 @@ sr_log_get_syslog(void) API void sr_log_set_cb(sr_log_cb log_callback) { + /* initializes libyang logging for our purposes */ + ly_log_options(LY_LOSTORE); + sr_lcb = log_callback; }
motorcontrol: simplify gear ratio computation fw size -48
@@ -119,33 +119,19 @@ EncodedMotor Arguments: port {const} -- Port to which the device is connected: PORT_A, PORT_B, etc. direction {const} -- DIR_NORMAL or DIR_INVERTED (default: {DIR_NORMAL}) - gear_teeth {list} -- Description + first_gear {int} -- Number of teeth of gear attached to motor (default: {None}) + last_gear {int} -- Number of teeth of last gear in the gear train (default: {None}) """ */ mp_obj_t motor_EncodedMotor_make_new(const mp_obj_type_id_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args){ - mp_arg_check_num(n_args, n_kw, 1, 3, false); + mp_arg_check_num(n_args, n_kw, 1, 4, false); motor_EncodedMotor_obj_t *self = m_new_obj(motor_EncodedMotor_obj_t); self->base.type = (mp_obj_type_t*) type; self->port = mp_obj_get_int(args[0]); int8_t direction = (n_args > 1) ? mp_obj_get_int(args[1]) : PBIO_MOTOR_DIR_NORMAL; - // Determine gear ratio from number of teeth on each gear - float_t gear_ratio = 1; - if (n_args >= 3) { - - mp_obj_t *teeth; - size_t number_of_gears; - mp_obj_get_array(args[2], &number_of_gears, &teeth); - if (number_of_gears < 2) { - pb_raise_pbio_error(PBIO_ERROR_INVALID_ARG); - } - float_t teeth_now = mp_obj_get_int(teeth[0]); - for (int16_t gear = 1; gear <= number_of_gears-1; gear++) { - float_t teeth_next = mp_obj_get_int(teeth[gear]); - gear_ratio = gear_ratio * (teeth_next/teeth_now); - teeth_now = teeth_next; - } - } - pbio_error_t err = pbio_encmotor_setup(self->port, type->device_id, direction, gear_ratio); + int16_t teeth_first = (n_args == 4) ? mp_obj_get_int(args[2]) : 1; + int16_t teeth_last = (n_args == 4) ? mp_obj_get_int(args[3]) : 1; + pbio_error_t err = pbio_encmotor_setup(self->port, type->device_id, direction, ((float_t) teeth_last)/teeth_first); // TODO: Don't compute gear ratio here. Pass on teeth numbers to motorcontrol to save some more computations there pb_raise_pbio_error(err); return MP_OBJ_FROM_PTR(self); }
Ensure we have sd before accessing it
@@ -1694,6 +1694,10 @@ mongoc_cluster_fetch_stream_single (mongoc_cluster_t *cluster, sd = _mongoc_stream_run_ismaster ( cluster, stream, scanner_node->host.host_and_port, server_id); + + if (!sd) { + return NULL; + } } if (sd->type == MONGOC_SERVER_UNKNOWN) {
change uint to unsigned int (fixes
@@ -725,7 +725,7 @@ const struct operator_s* operator_bind2(const struct operator_s* op, unsigned in bool n_flags[D + 1]; - for (uint i = 0; i < D + 1; i++) + for (unsigned int i = 0; i < D + 1; i++) n_flags[i] = false; for (unsigned int i = 0, j = 0; i < D; i++) {
Removed r_delta and nu from python
@@ -64,36 +64,5 @@ def halo_bias(cosmo, halo_mass, a, odelta=200): return _vectorize_fn4(lib.halo_bias, lib.halo_bias_vec, cosmo, halo_mass, a, odelta) -def r_delta(cosmo, halo_mass, a, odelta): - """The comoving halo radius for a given overdensity criterion - - Args: - cosmo (:obj:`ccl.cosmology`): Cosmological parameters. - halo_mass (float or array_like): Halo masses; Msun. - a (float): Scale factor. - odelta (float): Overdensity parameter - - Returns: - r_delta (float or array_like): Comoving halo radius - - """ - return _vectorize_fn4(lib.r_delta, - lib.r_delta_vec, cosmo, halo_mass, a, odelta) - -def nu(cosmo, halo_mass, a): - """Dimensionless peak height of a halo of mass M, nu = delta_c(z)/sigma(M) - - Args: - cosmo (:obj:`ccl.cosmology`): Cosmological parameters. - halo_mass (float or array_like): Halo masses; Msun. - a (float): Scale factor. - - Returns: - nu (float or array_like): Peak height - - """ - return _vectorize_fn2(lib.r_delta, - lib.r_delta_vec, cosmo, halo_mass, a) -
arch/imxrt/adc: remove ADC1_IN2, ADC1_IN1 on imxrt1050-evk Because they are dedeicated to UART TXD and RXD on i.MXRT1050-evk board, let's remove them from adc pin init.
@@ -799,11 +799,15 @@ void imxrt_adc_pins_init(int bus, int cchannels) imxrt_iomuxc_setpinmux(IMXRT_ADC1_IN3, inputvalue); imxrt_iomuxc_setpinconfig(IMXRT_ADC1_IN3, pinconfig); case 3: +#ifndef CONFIG_ARCH_BOARD_IMXRT1050_EVK // FIXME This pin is dedicated to UART1_RXD on i.MXRT1050-evk board. imxrt_iomuxc_setpinmux(IMXRT_ADC1_IN2, inputvalue); imxrt_iomuxc_setpinconfig(IMXRT_ADC1_IN2, pinconfig); +#endif case 2: +#ifndef CONFIG_ARCH_BOARD_IMXRT1050_EVK // FIXME This pin is dedicated to UART1_TXD on i.MXRT1050-evk board. imxrt_iomuxc_setpinmux(IMXRT_ADC1_IN1, inputvalue); imxrt_iomuxc_setpinconfig(IMXRT_ADC1_IN1, pinconfig); +#endif case 1: imxrt_iomuxc_setpinmux(IMXRT_ADC1_IN0, inputvalue); imxrt_iomuxc_setpinconfig(IMXRT_ADC1_IN0, pinconfig);
py/stream: Introduce MP_STREAM_GET_FILENO ioctl request. Can be used by POSIX-like systems that associate file numbers with a file.
#define MP_STREAM_SET_OPTS (7) // Set stream options #define MP_STREAM_GET_DATA_OPTS (8) // Get data/message options #define MP_STREAM_SET_DATA_OPTS (9) // Set data/message options +#define MP_STREAM_GET_FILENO (10) // Get fileno of underlying file // These poll ioctl values are compatible with Linux #define MP_STREAM_POLL_RD (0x0001)
oic; ble transport was now fragmenting incorrectly.
@@ -283,9 +283,9 @@ oc_ble_frag(struct os_mbuf *m, uint16_t mtu) STAILQ_NEXT(pkt, omp_next) = NULL; return 0; } - off = pkt->omp_len % mtu; - while (off > mtu) { + off = pkt->omp_len - (pkt->omp_len % mtu); + while (off >= mtu) { n = os_msys_get_pkthdr(mtu, 0); if (!n) { goto err; @@ -300,7 +300,6 @@ oc_ble_frag(struct os_mbuf *m, uint16_t mtu) off -= blk; os_mbuf_adj(m, -blk); } - os_mbuf_adj(m, mtu - OS_MBUF_PKTLEN(m)); return 0; err: pkt = OS_MBUF_PKTHDR(m);
posix: fix definitions to match those in libphoenix
#ifndef _PHOENIX_POSIX_H_ #define _PHOENIX_POSIX_H_ -#define F_DUPFD 0 -#define F_GETFD 1 -#define F_SETFD 2 -#define F_GETFL 3 -#define F_SETFL 4 -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 -#define F_GETOWN 9 -#define F_DUPFD_CLOEXEC 10 +enum { F_DUPFD = 0, F_DUPFD_CLOEXEC, F_GETFD, F_SETFD, F_GETFL, F_SETFL, + F_GETOWN, F_SETOWN, F_GETLK, F_SETLK, F_SETLKW }; #define FD_CLOEXEC 1
bootloader: fix bootloader_sha256_flash_contents mmap issue
@@ -20,7 +20,7 @@ extern "C" { #define FLASH_SECTOR_SIZE 0x1000 #define FLASH_BLOCK_SIZE 0x10000 -#define MMAP_ALIGNED_MASK 0x0000FFFF +#define MMAP_ALIGNED_MASK (SPI_FLASH_MMU_PAGE_SIZE - 1) #define MMU_FLASH_MASK (~(SPI_FLASH_MMU_PAGE_SIZE - 1)) /**
mac siphash: add missing NULL check on context creation Bug reported by Kihong Heo.
@@ -51,6 +51,7 @@ static void *siphash_new(void *provctx) { struct siphash_data_st *ctx = OPENSSL_zalloc(sizeof(*ctx)); + if (ctx != NULL) ctx->provctx = provctx; return ctx; }
boldar: configure fan speed BRANCH=none TEST=make BOARD=boldar
@@ -133,17 +133,11 @@ const struct fan_conf fan_conf_0 = { .enable_gpio = GPIO_EN_PP5000_FAN, }; -/* - * Fan specs from datasheet: - * Max speed 5900 rpm (+/- 7%), minimum duty cycle 30%. - * Minimum speed not specified by RPM. Set minimum RPM to max speed (with - * margin) x 30%. - * 5900 x 1.07 x 0.30 = 1894, round up to 1900 - */ +/* Default */ const struct fan_rpm fan_rpm_0 = { - .rpm_min = 1900, - .rpm_start = 1900, - .rpm_max = 5900, + .rpm_min = 3000, + .rpm_start = 3000, + .rpm_max = 10000, }; const struct fan_t fans[FAN_CH_COUNT] = { @@ -156,11 +150,6 @@ const struct fan_t fans[FAN_CH_COUNT] = { /******************************************************************************/ /* EC thermal management configuration */ -/* - * Tiger Lake specifies 100 C as maximum TDP temperature. THRMTRIP# occurs at - * 130 C. However, sensor is located next to DDR, so we need to use the lower - * DDR temperature limit (85 C) - */ const static struct ec_thermal_config thermal_cpu = { .temp_host = { [EC_TEMP_THRESH_HIGH] = C_TO_K(70), @@ -169,7 +158,7 @@ const static struct ec_thermal_config thermal_cpu = { .temp_host_release = { [EC_TEMP_THRESH_HIGH] = C_TO_K(65), }, - .temp_fan_off = C_TO_K(35), + .temp_fan_off = C_TO_K(15), .temp_fan_max = C_TO_K(50), }; @@ -177,12 +166,6 @@ const static struct ec_thermal_config thermal_cpu = { * Inductor limits - used for both charger and PP3300 regulator * * Need to use the lower of the charger IC, PP3300 regulator, and the inductors - * - * Charger max recommended temperature 100C, max absolute temperature 125C - * PP3300 regulator: operating range -40 C to 145 C - * - * Inductors: limit of 125c - * PCB: limit is 80c */ const static struct ec_thermal_config thermal_inductor = { .temp_host = { @@ -192,7 +175,7 @@ const static struct ec_thermal_config thermal_inductor = { .temp_host_release = { [EC_TEMP_THRESH_HIGH] = C_TO_K(65), }, - .temp_fan_off = C_TO_K(40), + .temp_fan_off = C_TO_K(15), .temp_fan_max = C_TO_K(55), };
esp-tls: remove redundant snippet from CMakeList
@@ -20,11 +20,6 @@ if(CONFIG_ESP_TLS_USING_WOLFSSL) target_link_libraries(${COMPONENT_LIB} PUBLIC ${wolfssl}) endif() -if(CONFIG_ESP_TLS_USE_SE) - idf_component_get_property(cryptoauthlib esp-cryptoauthlib COMPONENT_LIB) - target_link_libraries(${COMPONENT_LIB} PUBLIC ${cryptoauthlib}) -endif() - # Increase link multiplicity to get some lwip symbols correctly resolved by the linker # due to cyclic dependencies present in IDF for lwip/esp_netif/mbedtls idf_component_get_property(lwip lwip COMPONENT_LIB)
bugfix: Run `deploy_docs_production` in `post_deploy` stage after `push_to_github` successfully
@@ -59,9 +59,6 @@ push_to_github: tags: - deploy - shiny - needs: - - build_docs_html - - build_docs_pdf variables: DOCS_BUILD_DIR: "${IDF_PATH}/docs/_build/" PYTHONUNBUFFERED: 1 @@ -77,6 +74,9 @@ deploy_docs_preview: - .rules:labels:build_docs-slim # Override default stage to happen before the post_check stage: test_deploy + needs: + - build_docs_html + - build_docs_pdf variables: TYPE: "preview" # older branches use DOCS_DEPLOY_KEY, DOCS_SERVER, DOCS_SERVER_USER, DOCS_PATH for preview server so we keep these names for 'preview' @@ -92,6 +92,11 @@ deploy_docs_production: extends: - .deploy_docs_template - .rules:protected-no_label + stage: post_deploy + needs: # ensure runs after push_to_github succeeded + - build_docs_html + - build_docs_pdf + - push_to_github variables: TYPE: "preview" DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PROD_DEPLOY_KEY"
esp32/machine_pin: Rework pull mode config to fix GPIO hold feature. For gpio_hold_en() to work properly (not draw additional current) pull up/down must be disabled when hold is enabled. This patch makes sure this is the case by reworking the pull constants to be a bit mask.
#include "machine_rtc.h" #include "modesp32.h" -// Used to implement gpio_hold_en() functionality; value should be distinct from all IDF pull modes -#define GPIO_PULLHOLD (8) +// Used to implement a range of pull capabilities +#define GPIO_PULL_DOWN (1) +#define GPIO_PULL_UP (2) +#define GPIO_PULL_HOLD (4) typedef struct _machine_pin_obj_t { mp_obj_base_t base; @@ -168,18 +170,24 @@ STATIC mp_obj_t machine_pin_obj_init_helper(const machine_pin_obj_t *self, size_ // configure pull if (args[ARG_pull].u_obj != MP_OBJ_NEW_SMALL_INT(-1)) { - if (args[ARG_pull].u_obj == mp_const_none) { - gpio_set_pull_mode(self->id, GPIO_FLOATING); - } else { - int mode = mp_obj_get_int(args[ARG_pull].u_obj); - if (mode == GPIO_PULLHOLD) { - gpio_hold_en(self->id); + int mode = 0; + if (args[ARG_pull].u_obj != mp_const_none) { + mode = mp_obj_get_int(args[ARG_pull].u_obj); + } + if (mode & GPIO_PULL_DOWN) { + gpio_pulldown_en(self->id); } else { - if (GPIO_IS_VALID_OUTPUT_GPIO(self->id)) { - gpio_hold_dis(self->id); + gpio_pulldown_dis(self->id); } - gpio_set_pull_mode(self->id, mode); + if (mode & GPIO_PULL_UP) { + gpio_pullup_en(self->id); + } else { + gpio_pullup_dis(self->id); } + if (mode & GPIO_PULL_HOLD) { + gpio_hold_en(self->id); + } else if (GPIO_IS_VALID_OUTPUT_GPIO(self->id)) { + gpio_hold_dis(self->id); } } @@ -329,9 +337,9 @@ STATIC const mp_rom_map_elem_t machine_pin_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IN), MP_ROM_INT(GPIO_MODE_INPUT) }, { MP_ROM_QSTR(MP_QSTR_OUT), MP_ROM_INT(GPIO_MODE_INPUT_OUTPUT) }, { MP_ROM_QSTR(MP_QSTR_OPEN_DRAIN), MP_ROM_INT(GPIO_MODE_INPUT_OUTPUT_OD) }, - { MP_ROM_QSTR(MP_QSTR_PULL_UP), MP_ROM_INT(GPIO_PULLUP_ONLY) }, - { MP_ROM_QSTR(MP_QSTR_PULL_DOWN), MP_ROM_INT(GPIO_PULLDOWN_ONLY) }, - { MP_ROM_QSTR(MP_QSTR_PULL_HOLD), MP_ROM_INT(GPIO_PULLHOLD) }, + { MP_ROM_QSTR(MP_QSTR_PULL_UP), MP_ROM_INT(GPIO_PULL_UP) }, + { MP_ROM_QSTR(MP_QSTR_PULL_DOWN), MP_ROM_INT(GPIO_PULL_DOWN) }, + { MP_ROM_QSTR(MP_QSTR_PULL_HOLD), MP_ROM_INT(GPIO_PULL_HOLD) }, { MP_ROM_QSTR(MP_QSTR_IRQ_RISING), MP_ROM_INT(GPIO_PIN_INTR_POSEDGE) }, { MP_ROM_QSTR(MP_QSTR_IRQ_FALLING), MP_ROM_INT(GPIO_PIN_INTR_NEGEDGE) }, { MP_ROM_QSTR(MP_QSTR_WAKE_LOW), MP_ROM_INT(GPIO_PIN_INTR_LOLEVEL) },
Support compile with mingw toolchain
@@ -51,7 +51,9 @@ const char *getFileName(const char *pszPath) #ifdef WIN32 +#ifndef __MINGW32__ typedef long ssize_t; +#endif HANDLE hComm = INVALID_HANDLE_VALUE; OVERLAPPED osRX = { 0 }; OVERLAPPED osTX = { 0 };
Fix uninitialized Key values from TEXTINPUT. These keys were being padded with random data. Now they use a copy of `TCOD_ctx.key_state`.
@@ -1090,11 +1090,10 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, break; case SDL_TEXTINPUT: { SDL_TextInputEvent *iev=&ev->text; - TCOD_key_t ret; - ret.vk = TCODK_TEXT; - ret.pressed = 1; - strncpy(ret.text, iev->text, TCOD_KEY_TEXT_SIZE); - *key = ret; + *key = TCOD_ctx.key_state; + key->vk = TCODK_TEXT; + key->pressed = 1; + strncpy(key->text, iev->text, TCOD_KEY_TEXT_SIZE); return retMask | TCOD_EVENT_KEY_PRESS; } break;
[libc] Add more typedef in minilibc.
@@ -15,6 +15,16 @@ typedef int mode_t; typedef unsigned long clockid_t; typedef int pid_t; +typedef int gid_t; +typedef int uid_t; +typedef int dev_t; +typedef int ino_t; +typedef int mode_t; +typedef int caddr_t; + +typedef unsigned int wint_t; +typedef unsigned long useconds_t; + typedef unsigned long clock_t; /* clock() */ #ifndef NULL
Fix no-cmac and no-camellia Guard two tests that depend on CMAC and Camellia so that we don't fail if those algorithms are not available.
@@ -297,6 +297,7 @@ static int test_kdf_x963(void) return ret; } +#if !defined(OPENSSL_NO_CMAC) && !defined(OPENSSL_NO_CAMELLIA) /* * KBKDF test vectors from RFC 6803 (Camellia Encryption for Kerberos 5) * section 10. @@ -421,6 +422,7 @@ static int test_kdf_kbkdf_6803_256(void) return ret; } +#endif /* Two test vectors from RFC 8009 (AES Encryption with HMAC-SHA2 for Kerberos * 5) appendix A. */ @@ -771,8 +773,10 @@ static int test_kdf_krb5kdf(void) int setup_tests(void) { +#if !defined(OPENSSL_NO_CMAC) && !defined(OPENSSL_NO_CAMELLIA) ADD_TEST(test_kdf_kbkdf_6803_128); ADD_TEST(test_kdf_kbkdf_6803_256); +#endif ADD_TEST(test_kdf_kbkdf_8009_prf1); ADD_TEST(test_kdf_kbkdf_8009_prf2); ADD_TEST(test_kdf_get_kdf);
tools/check_output_size.py : Modify to use board_metadata.txt For finding kernel binary name, using board_metadata.txt. Because each board has a different kernel binary name.
@@ -26,19 +26,20 @@ import sys import string cfg_file = os.path.dirname(__file__) + '/../.config' +build_folder = os.path.dirname(__file__) + '/../../build' -def get_config_value(file_name, config): +def get_value_from_file(file_name, target): with open(file_name, 'r+') as f: lines = f.readlines() value = 'None' for line in lines: - if config in line: + if target in line: value = (line.split("=")[1]) break return value; -PARTITION_SIZE_LIST = get_config_value(cfg_file, "CONFIG_FLASH_PART_SIZE=") -PARTITION_NAME_LIST = get_config_value(cfg_file, "CONFIG_FLASH_PART_NAME=") +PARTITION_SIZE_LIST = get_value_from_file(cfg_file, "CONFIG_FLASH_PART_SIZE=") +PARTITION_NAME_LIST = get_value_from_file(cfg_file, "CONFIG_FLASH_PART_NAME=") if PARTITION_SIZE_LIST == 'None' : sys.exit(0) @@ -57,16 +58,18 @@ for name in NAME_LIST : KERNEL_PARTITION_SIZE = int(SIZE_LIST[KERNEL_IDX]) * 1024 # Check the board type. Because kernel binary name is different based on board type. -BOARD_TYPE = get_config_value(cfg_file, "CONFIG_ARCH_BOARD=") +BOARD_TYPE = get_value_from_file(cfg_file, "CONFIG_ARCH_BOARD=") BOARD_TYPE = BOARD_TYPE.replace('"', '') BOARD_TYPE = BOARD_TYPE.rstrip("\n") -if BOARD_TYPE == "rtl8721csm" : - # If the board is rtl8721csm, the kernel binary name is km0_km4_image2.bin - output_path = os.path.dirname(__file__) + '/../../build/output/bin/km0_km4_image2.bin' +# Read the kernel binary name from board_metadata.txt. +metadata_file = build_folder + '/configs/' + BOARD_TYPE + '/board_metadata.txt' +if os.path.isfile(metadata_file) : + kernel_bin_name = get_value_from_file(metadata_file, "KERNEL=").replace('"','').rstrip('\n') + output_path = build_folder + '/output/bin/' + kernel_bin_name + '.bin' else : - # Other cases, the kernel binary name is tinyara.bin - output_path = os.path.dirname(__file__) + '/../../build/output/bin/tinyara.bin' + print("!!! There is no board_metadata.txt. Check the output size with tinyara.bin by default !!!") + output_path = build_folder + '/output/bin/tinyara.bin' # Partition sizes in the list are in KB, so calculate all sizes in KB. KERNEL_BINARY_SIZE=os.path.getsize(output_path)
Performance: remove unnecessary IF statement
@@ -358,7 +358,8 @@ void grib_trie_with_rank_delete_container(grib_trie_with_rank *t) { GRIB_MUTEX_INIT_ONCE(&once,&init); GRIB_MUTEX_LOCK(&mutex); - if(t) { + DebugAssert(t); + { int i; for(i = t->first; i <= t->last; i++) if (t->next[i]) {
WIP Stakable
@@ -1561,7 +1561,7 @@ static void ApproximateBestSubset(vector<pair<int64_t, pair<const CWalletTx*,uns } } -// denarius: total coins available for staking +// denarius: total coins available for staking - WIP needs updating int64_t CWallet::GetStakeAmount() const { int64_t nTotal = 0; @@ -1570,7 +1570,7 @@ int64_t CWallet::GetStakeAmount() const for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; - if (pcoin->IsTrusted()) //Just pulls GetBalance() currently + if (pcoin->IsTrusted() && pcoin->GetDepthInMainChain() > 0) //Just pulls GetBalance() currently nTotal += pcoin->GetAvailableCredit(); } }
Adjust portPOINTER_SIZE_TYPE to correct size * Adjust portPOINTER_SIZE_TYPE to correct size portPOINTER_SIZE_TYPE wasn't yet set correctly to be 16 bit * Fixed FreeRTOS file header to comply with automatic checks
* https://www.FreeRTOS.org * https://github.com/FreeRTOS * - * 1 tab == 4 spaces! */ /* @@ -58,6 +57,8 @@ extern "C" { #define portSTACK_TYPE uint8_t #define portBASE_TYPE char +#define portPOINTER_SIZE_TYPE uint16_t + typedef portSTACK_TYPE StackType_t; typedef signed char BaseType_t; typedef unsigned char UBaseType_t;
Issue EDNS OPT can have no rdata
@@ -449,7 +449,10 @@ ldns_pkt2buffer_wire_compress(ldns_buffer *buffer, const ldns_pkt *packet, ldns_ , ldns_buffer_export(edns_buf)); ldns_buffer_free(edns_buf); } - ldns_rr_push_rdf(edns_rr, edns_rdf ? edns_rdf : packet->_edns_data); + if (edns_rdf) + ldns_rr_push_rdf(edns_rr, edns_rdf); + else if (packet->_edns_data) + ldns_rr_push_rdf(edns_rr, packet->_edns_data); (void)ldns_rr2buffer_wire_compress(buffer, edns_rr, LDNS_SECTION_ADDITIONAL, compression_data); /* take the edns rdata back out of the rr before we free rr */ if (!edns_rdf)
AltGR fix
@@ -397,16 +397,17 @@ static void processMouse() static void processKeyboard() { + tic_mem* tic = platform.studio->tic; + { SDL_Keymod mod = SDL_GetModState(); platform.keyboard.state[tic_key_shift] = mod & KMOD_SHIFT; platform.keyboard.state[tic_key_ctrl] = mod & (KMOD_CTRL | KMOD_GUI); - platform.keyboard.state[tic_key_alt] = mod & KMOD_ALT; platform.keyboard.state[tic_key_capslock] = mod & KMOD_CAPS; } - tic80_input* input = &platform.studio->tic->ram.input; + tic80_input* input = &tic->ram.input; input->keyboard.data = 0; enum{BufSize = COUNT_OF(input->keyboard.keys)};
Detect cache devices that would overflow ocf_cacheline_t
@@ -912,6 +912,7 @@ static int ocf_metadata_hash_init_variable_size(struct ocf_cache *cache, struct ocf_cache_line_settings *settings = (struct ocf_cache_line_settings *)&cache->metadata.settings; ocf_flush_page_synch_t lock_page, unlock_page; + uint64_t device_lines; OCF_DEBUG_TRACE(cache); @@ -919,7 +920,16 @@ static int ocf_metadata_hash_init_variable_size(struct ocf_cache *cache, ctrl = cache->metadata.iface_priv; - ctrl->device_lines = device_size / cache_line_size; + device_lines = device_size / cache_line_size; + if (device_lines >= (ocf_cache_line_t)(-1)){ + /* TODO: This is just a rough check. Most optimal one would be + * located in calculate_metadata_size. */ + ocf_cache_log(cache, log_err, "Device exceeds maximum suported size " + "with this cache line size. Try bigger cache line size."); + return -OCF_ERR_INVAL_CACHE_DEV; + } + + ctrl->device_lines = device_lines; if (settings->size != cache_line_size) /* Re-initialize settings with different cache line size */
travis: similar fix to PR
@@ -197,11 +197,14 @@ before_script: script: - ninja - | - if [[ "$FAST" == "ON" || "$ASAN" = "ON" ]]; then - if [[ "$ASAN" = "ON" ]]; then - export LD_PRELOAD=$(find /usr/ -name '*libclang_rt.ubsan_standalone_cxx-x86_64.so') - fi + if [[ "$FAST" == "ON" ]]; then ninja run_all + elif [[ "$ASAN" = "ON" && "$TRAVIS_OS_NAME" == "linux" ]]; then + # preload required libraries (LD_PRELOAD is a space separated list) + UBSAN_LIBRARY=$(find /usr/ -name '*libclang_rt.ubsan_standalone_cxx-x86_64.so') + LD_PRELOAD="$UBSAN_LIBRARY" ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) ninja run_all + elif [[ "$ASAN" = "ON" ]]; then + ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) ninja run_all else ninja install ninja run_all && kdb run_all
Changing back the registry directory in config.json
{ "cnc": { "daemon_log_path": "\"/home/var/log.daemon.log\"", - "registry_dir": "\"/home/vagrant\"", + "registry_dir": "\"/usr/local/kubos\"", "daemon_rx_pipe": "\"/usr/local/kubos/client-to-server\"", "daemon_tx_pipe": "\"/usr/local/kubos/server-to-client\"" },
filter_stdout: add and parse empty config_map.
#include <stdio.h> #include <fluent-bit/flb_filter.h> +#include <fluent-bit/flb_filter_plugin.h> #include <fluent-bit/flb_utils.h> #include <fluent-bit/flb_time.h> @@ -33,6 +34,10 @@ static int cb_stdout_init(struct flb_filter_instance *f_ins, (void) config; (void) data; + if (flb_filter_config_map_set(f_ins, (void *)config) == -1) { + flb_plg_error(f_ins, "unable to load configuration"); + return -1; + } return 0; } @@ -66,11 +71,17 @@ static int cb_stdout_filter(const void *data, size_t bytes, return FLB_FILTER_NOTOUCH; } +static struct flb_config_map config_map[] = { + /* EOF */ + {0} +}; + struct flb_filter_plugin filter_stdout_plugin = { .name = "stdout", .description = "Filter events to STDOUT", .cb_init = cb_stdout_init, .cb_filter = cb_stdout_filter, .cb_exit = NULL, + .config_map = config_map, .flags = 0 };
OcAppleKernelLib: Fix the upper boundary from last commit.
@@ -671,7 +671,7 @@ InternalRelocateRelocationIntel64 ( MachSize = MachoGetFileSize (&Kext->Context.MachContext); if (((UINTN)InstructionPtr < (UINTN)MachHeader) - || ((UINTN)(InstructionPtr + 1) > ((UINTN)MachHeader + MachSize))) { + || (((UINTN)InstructionPtr + ((Length != 3) ? 4 : 8)) > ((UINTN)MachHeader + MachSize))) { return MAX_UINTN; }
verify WPSIE_TAG len
@@ -2356,8 +2356,7 @@ static bool gettagwps(int wpslen, uint8_t *ieptr, tags_t *zeiger) { wpslen -= VENDORIE_SIZE; ieptr += VENDORIE_SIZE; - -if(wpslen == 0) return true; +if(wpslen < (int)WPSIE_SIZE) return true; zeiger->wpsinfo = 1; return true; }
raspberrypi-cm3.conf: Inherit raspberrypi3 not raspberrypi2 The CM3 module is based Raspberry Pi 3 not 2.
#@NAME: RaspberryPi Compute Module 3 (CM3) #@DESCRIPTION: Machine configuration for the RaspberryPi Compute Module 3 (CM3) -MACHINEOVERRIDES = "raspberrypi2:${MACHINE}" -include conf/machine/raspberrypi2.conf +MACHINEOVERRIDES = "raspberrypi3:${MACHINE}" +include conf/machine/raspberrypi3.conf
Feat:Remove redundant debug information in the demo
@@ -6,7 +6,6 @@ DESCRIPTION ===========================================================================*/ /* MA510 Includes ---------------------------------------------------------*/ -#include "test_utils.h" #include "qflog_utils.h" #include "qapi_uart.h" #include "qapi_timer.h" @@ -16,7 +15,6 @@ DESCRIPTION #include "boatconfig.h" #include "boatlog.h" #include "my_contract.cpp.abi.h" -//#include "web3intf.h" BoatPlatoneWallet *g_platone_wallet_ptr; @@ -282,7 +280,7 @@ int fibocom_task_entry(void) ret = dam_byte_pool_init(); if(ret != TX_SUCCESS) { - BoatLog(BOAT_LOG_CRITICAL,"DAM_APP:Create DAM byte pool fail \n"); + BoatLog(BOAT_LOG_CRITICAL,"Create DAM byte pool fail!\n"); return ret; }
NetworkTools: Update mmdb SDK
@@ -38,9 +38,9 @@ BOOLEAN NetToolsGeoLiteInitialized( { PPH_STRING dbpath; - if (dbpath = PhGetApplicationDataFileName(&GeoDbFileName, FALSE)) + if (dbpath = PhGetApplicationDataFileName(&GeoDbFileName, TRUE)) { - if (MMDB_open(dbpath->Buffer, MMDB_MODE_MMAP, &GeoDbCountry) == MMDB_SUCCESS) + if (MMDB_open(&dbpath->sr, MMDB_MODE_MMAP, &GeoDbCountry) == MMDB_SUCCESS) { LARGE_INTEGER systemTime; ULONG secondsSince1970;
Fix test_out_option Random path generation code in test/recipes/15-test_out_option.t does not work: The code sets rand_path to "/test.pem". I.e. the test will fail as expected for unprivileged user but will pass for root user.
@@ -36,7 +36,8 @@ test_illegal_path('../'); # Test for trying to create a file in a non-exist directory my @chars = ("A".."Z", "a".."z", "0".."9"); -my $rand_path = $chars[rand @chars] for 1..32; +my $rand_path = ""; +$rand_path .= $chars[rand @chars] for 1..32; $rand_path .= "/test.pem"; test_illegal_path($rand_path);
Fix drawing tests on OSX Need to be explicit about stealing the deltaImage when doing a move of our ImageDelta Fixes
@@ -50,6 +50,8 @@ struct ImageDelta { ImageDelta(ImageComparisonResult result, size_t differences, CGImageRef deltaImage) : result(result), differences(differences), deltaImage(CGImageRetain(deltaImage)) { } + + ImageDelta(ImageDelta&& other) : result(other.result), differences(other.differences), deltaImage(other.deltaImage.release()) {} }; class ImageComparator {
Add counter for leaks in docker compose tests.
@@ -80,7 +80,13 @@ sub_test() { docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm deps ln -sf tools/dev/.dockerignore .dockerignore - docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm dev + docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm dev | tee /tmp/metacall-test-output + + SUMMARY=$(grep "SUMMARY:" /tmp/metacall-test-output) + echo "${SUMMARY}" + printf "Number of leaks detected: " + echo "${SUMMARY}" | awk '{print $7}' | awk '{s+=$1} END {print s}' + rm /tmp/metacall-test-output } # Build MetaCall Docker Compose with caching (link manually dockerignore files)
fix icon anchors
@@ -12,7 +12,7 @@ import IconButton from 'material-ui/IconButton' const ActionButton = ({ icon, tooltip, onClick, size = 14 }) => ( <IconButton - style={{ width: 16, height: 16, paddingTop: 1 }} + style={{ width: 22, height: 22, padding: 4 }} iconStyle={{ width: 14, height: 14 }} onClick={onClick} tooltip={tooltip}
peview: ignore entries with invalid RVA
@@ -844,6 +844,12 @@ INT_PTR CALLBACK PvpPeExportsDlgProc( WCHAR number[PH_INT32_STR_LEN_1]; WCHAR pointer[PH_PTR_STR_LEN_1]; + // TODO: user32.dll and some other libraries have many (unnamed) exports with invalid RVA, + // they might be exported variables or caused by incorrect math, ignore these entries + // until more information is available. + if (!exportFunction.Function) + continue; + if (exportEntry.Name) { name = PhZeroExtendToUtf16(exportEntry.Name); @@ -852,10 +858,7 @@ INT_PTR CALLBACK PvpPeExportsDlgProc( } else { - if (exportFunction.Function) lvItemIndex = PhAddListViewItem(lvHandle, MAXINT, L"(unnamed)", NULL); - else - lvItemIndex = PhAddListViewItem(lvHandle, MAXINT, L"(unnamed variable)", NULL); } PhPrintUInt32(number, exportEntry.Ordinal);
Document new install command
@@ -80,14 +80,16 @@ To build, flash and run the `logo` example. #### With the 32blit tool -Alternatively, you can use the tool directly: +Alternatively, you can use the tool to flash a game directly: + ``` -32blit flash flash --file=[filename].blit +32blit install filename.blit ``` -Or, to save to the SD card: +Or save it to your SD card: + ``` -32blit flash save --file=[filename].blit +32blit install filename.blit / ``` (If `32blit` is not found you can use `python3 -m ttblit` instead)
Increase number of results for alert from 10 to 100
@@ -60,13 +60,12 @@ public class Alert { } /** - * Creates a solr query Creates a mail with the title of each result Send the - * mail + * Creates a solr query Creates a mail with the title of each result Send the mail */ public void run() { try { final IndexerQuery query = IndexerServerManager.createQuery(); - switch (this.frequency) { // The fq parameter depends of the frequency of + switch (this.frequency.toLowerCase()) { // The fq parameter depends of the frequency of // the alerts default: query.setParam("fq", "last_modified:[NOW-1DAY TO NOW] OR crawl_date:[NOW-1DAY TO NOW]"); @@ -81,7 +80,7 @@ public class Alert { query.setParam("fq", "last_modified:[NOW-7DAY TO NOW] OR crawl_date:[NOW-7DAY TO NOW]"); break; } - query.setParam("rows", "10"); // Sets the maximum number of results that + query.setParam("rows", "100"); // Sets the maximum number of results that // will be sent in the email query.setParam("q.op", "AND"); query.setParam("q", keyword); // Sets the q parameters according to the
nissa: Hibernate secondary charger first Ensure that the secondary charger (if any) is hbernated before the primary charger. TEST=zmake configure -b nivviks; flash and run BRANCH=none
@@ -58,9 +58,9 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { */ __override void board_hibernate_late(void) { - raa489000_hibernate(CHARGER_PRIMARY, true); if (board_get_usb_pd_port_count() == 2) raa489000_hibernate(CHARGER_SECONDARY, true); + raa489000_hibernate(CHARGER_PRIMARY, true); gpio_set_level(GPIO_EN_SLP_Z, 1); /*
getFreeSensorId() rename local variable id to sid For consistency with the database column name.
@@ -4405,10 +4405,10 @@ int getFreeSensorId() if (c.resource() == RSensors) { bool ok; - const int id = c.id().toInt(&ok); - if (ok && std::find(sensorIds.begin(), sensorIds.end(), id) == sensorIds.end()) + const int sid = c.id().toInt(&ok); + if (ok && std::find(sensorIds.begin(), sensorIds.end(), sid) == sensorIds.end()) { - sensorIds.push_back(id); + sensorIds.push_back(sid); } } } @@ -4434,23 +4434,23 @@ int getFreeSensorId() // 'append' only, start with largest known id // skip daylight sensor.id 1000 from earlier versions to keep id value low as possible - const auto startId = std::find_if(sensorIds.rbegin(), sensorIds.rend(), [](int id) { return id < 1000; }); + const auto startId = std::find_if(sensorIds.rbegin(), sensorIds.rend(), [](int sid) { return sid < 1000; }); - int id = (startId != sensorIds.rend()) ? *startId : 1; + int sid = (startId != sensorIds.rend()) ? *startId : 1; - while (id < 10000) + while (sid < 10000) { - const auto result = std::find(sensorIds.begin(), sensorIds.end(), id); + const auto result = std::find(sensorIds.begin(), sensorIds.end(), sid); if (result == sensorIds.end()) { - return id; + return sid; } - id++; + sid++; } - return id; + return sid; } /*! Saves the current auth with apikey to the database.
disabling removing scope env vars
@@ -30,17 +30,14 @@ func (rc *Config) Run(args []string) { if err := CreateScopec(); err != nil { util.ErrAndExit("error creating scopec: %v", err) } - var env []string // Normal operational, not passthrough, create directory for this run // Directory contains scope.yml which is configured to output to that // directory and has a command directory configured in that directory. + env := os.Environ() if !rc.Passthrough { - env = environNoScope() rc.SetupWorkDir(args) env = append(env, "SCOPE_CONF_PATH="+filepath.Join(rc.workDir, "scope.yml")) log.Info().Bool("passthrough", rc.Passthrough).Strs("args", args).Msg("calling syscall.Exec") - } else { - env = os.Environ() } syscall.Exec(scopecPath(), append([]string{"scopec"}, args...), env) }
host/ble_gap.c: Fix failure to run callback on finished scan When both roles - peripheral and central where turned off, removed lines where causing not calling callback function after completing the scan.
@@ -917,21 +917,17 @@ ble_gap_disc_report(void *desc) static void ble_gap_disc_complete(void) { -#if NIMBLE_BLE_CONNECT struct ble_gap_master_state state; -#endif struct ble_gap_event event; memset(&event, 0, sizeof event); event.type = BLE_GAP_EVENT_DISC_COMPLETE; event.disc_complete.reason = 0; -#if NIMBLE_BLE_CONNECT ble_gap_master_extract_state(&state, 1); if (ble_gap_has_client(&state)) { ble_gap_call_event_cb(&event, state.cb, state.cb_arg); } -#endif ble_gap_event_listener_call(&event); }
Remove an unnecessary #else and commented line With the else branch commented out, both lines are unnecessary. We could check for the invalid configuration in the future, once tests were made to exclude this combination.
@@ -352,8 +352,6 @@ extern "C" { #if defined(PSA_WANT_KEY_TYPE_CHACHA20) #define MBEDTLS_CHACHAPOLY_C #define MBEDTLS_PSA_BUILTIN_ALG_CHACHA20_POLY1305 1 -#else /* not PSA_WANT_KEY_TYPE_CHACHA20 */ -// #error "PSA_WANT_ALG_CHACHA20_POLY1305 requires PSA_WANT_KEY_TYPE_CHACHA20" #endif /* PSA_WANT_KEY_TYPE_CHACHA20 */ #endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */
optimize the ARGB->ARGB Import to use memcpy (instead of the generic VP8PackARGB call)
@@ -1105,9 +1105,14 @@ static int Import(WebPPicture* const picture, if (import_alpha) { uint32_t* dst = picture->argb; + const int do_copy = !swap_rb && !ALPHA_IS_LAST; assert(step == 4); for (y = 0; y < height; ++y) { + if (do_copy) { + memcpy(dst, r_ptr, width * sizeof(*dst)); + } else { VP8PackARGB(a_ptr, r_ptr, g_ptr, b_ptr, width, dst); + } a_ptr += rgb_stride; r_ptr += rgb_stride; g_ptr += rgb_stride;
HLS: Improve comments
@@ -126,10 +126,10 @@ static snap_membus_t hashkey_to_mbus(hashkey_t key) #define SNAP_4KiB_WORDS (4096 / sizeof(snap_membus_t)) typedef struct snap_4KiB_t { - snap_membus_t buf[SNAP_4KiB_WORDS]; - snap_membus_t *mem; - unsigned int m_idx; - unsigned int b_idx; + snap_membus_t buf[SNAP_4KiB_WORDS]; /* temporary storage buffer */ + snap_membus_t *mem; /* source where data comes from */ + unsigned int m_idx; /* read position for source */ + unsigned int b_idx; /* read position for buffer */ } snap_4KiB_t; static void snap_4KiB_init(snap_4KiB_t *buf, snap_membus_t *mem)
cache JSONEncoder as json module does for the default encoder
@@ -19,6 +19,9 @@ perf_ring_buffer_page_cnt = 256 # overridden by -P=N if os.geteuid() != 0: os.execvp("sudo", ["-E", sys.executable] + sys.argv) + +json_encoder = json.JSONEncoder(separators = (',', ':')) + default_bpf = """ #define MAX_STR_LEN 128 @@ -931,7 +934,7 @@ def handle_quic_event(cpu, data, size): res = OrderedDict() load_common_fields(res, ev) build_quic_trace_result(res, ev, quic_type_map.get(ev.type, [])) - print(json.dumps(res, separators = (',', ':'))) + print(json_encoder.encode(res)) def usage(): print("""
configure.ac: Fix typo s/optionnal/optional/
@@ -461,7 +461,7 @@ if test "x$enable_ssdp" = xyes ; then AC_DEFINE(UPNP_HAVE_SSDP, 1, [see upnpconfig.h]) fi -RT_BOOL_ARG_ENABLE([optssdp], [yes], [optionnal SSDP headers support)]) +RT_BOOL_ARG_ENABLE([optssdp], [yes], [optional SSDP headers support)]) if test "x$enable_optssdp" = xyes ; then AC_DEFINE(UPNP_HAVE_OPTSSDP, 1, [see upnpconfig.h]) enable_uuid=yes
fixes for coap ==> coaps
@@ -1831,7 +1831,7 @@ static void set_cloud_info(void) { char url[64] = "/CoapCloudConfResURI"; // url of the coap cloud config url - char cis[64] = "coap+tcp://127.0.0.1:5683"; + char cis[64] = "coaps+tcp://127.0.0.1:5683"; char at[64] = "test"; char sid[64] = "00000000-0000-0000-0000-000000000001"; char apn[64] = "plgd"; @@ -1880,7 +1880,7 @@ set_cloud_info(void) SCANF("%63s", at); PRINT("\nEnter apn ('plgd'): "); SCANF("%63s", apn); - PRINT("\nEnter cis ('coap+tcp://127.0.0.1:5684'):"); + PRINT("\nEnter cis ('coaps+tcp://127.0.0.1:5684'):"); SCANF("%63s", cis); PRINT("\nEnter sid ('00000000-0000-0000-0000-000000000001'):"); SCANF("%63s", sid);
Fix a http header parsing function in webserver Remove the code for checking the length of the http header. The whole unseparated http header can be longer than the max key length. Re-fix of commit
@@ -169,12 +169,11 @@ int http_separate_keyvalue(const char *src, char *key, char *value) int value_position = 0; int src_len = strlen(src); - if (src_len > HTTP_CONF_MAX_KEY_LENGTH) { - HTTP_LOGE("Error: src_len is over the key buffer size.\n"); + for (i = 0; i < src_len; i++) { + if (i >= HTTP_CONF_MAX_KEY_LENGTH) { + HTTP_LOGE("Error: The key length is over the value buffer size.\n"); return HTTP_ERROR; } - - for (i = 0; i < src_len; i++) { if (src[i] != ':') { key[i] = src[i]; } else { @@ -186,7 +185,7 @@ int http_separate_keyvalue(const char *src, char *key, char *value) for (i = value_position; i < src_len; i++) { if ((i - value_position) >= HTTP_CONF_MAX_VALUE_LENGTH) { - HTTP_LOGE("Error: The length is over the value buffer size.\n"); + HTTP_LOGE("Error: The value length is over the value buffer size.\n"); return HTTP_ERROR; } value[i - value_position] = src[i];
json BUGFIX type mismatch
@@ -461,7 +461,7 @@ lyjson_exp_number_copy_num_part(const char *num, uint32_t num_len, */ static LY_ERR lyjson_exp_number(const struct ly_ctx *ctx, const char *in, const char *exponent, - uint64_t total_len, char **res, uint64_t *res_len) + uint64_t total_len, char **res, size_t *res_len) { #define MAYBE_WRITE_MINUS(ARRAY, INDEX, FLAG) \
deny django version in contrib
@@ -32,6 +32,10 @@ DENY .* -> contrib/deprecated/uriparser ALLOW travel/rasp -> contrib/python/django/django-1.9 DENY .* -> contrib/python/django/django-1.9 +ALLOW contrib/python/.*/tests? -> contrib/python/django/django-1.11 +ALLOW contrib/python/.*/tests? -> contrib/python/django/django-2.2 +DENY contrib/python -> contrib/python/django/django-1.11 +DENY contrib/python -> contrib/python/django/django-2.2 ALLOW maps -> maps/contrib # maps/contrib/libpqxx is used by maps/libs/pgpool, a client-side connection pool for PostgrSQL
Improve the parameters rescanning interface
@@ -84,6 +84,34 @@ typedef struct clap_plugin_params { clap_param_value *plain_value); } clap_plugin_params; +enum { + // The parameter values did change. + // The host will scan the parameter value and value_to_text + CLAP_PARAM_RESCAN_VALUES = 1 << 0, + + // The parameter info did change + CLAP_PARAM_RESCAN_INFO = 1 << 1, + + // The parameter range did change, or enum definition did change. + // This change can't be performed immediately because there might be + // param updates pending in the host's queues. + // The change will apply once the host deactivates the plugin. + CLAP_PARAM_RESCAN_RANGES = 1 << 2, + + // The parameter list did change + // It means that some parameters maybe added or removed, + // the index <-> id mapping is invalidated + // + // The plugin can't perform the parameter list change immediately: + // 1. the plugin sends CLAP_PARAM_RESCAN_LIST + // 2. the host deactivates the plugin, be aware that it may happen a bit later + // because the host needs to flush its parameters update queues and suspend + // the plugin execution in the audio engine + // 3. the plugin can switch to its new parameter set + // 4. the host activates the plugin + CLAP_PARAM_RESCAN_LIST = 1 << 3, +}; + typedef struct clap_host_params { /* [main-thread] */ void (*touch_begin)(clap_host *host, clap_id param_id); @@ -97,9 +125,13 @@ typedef struct clap_host_params { // [main-thread] void (*changed)(clap_host *host, clap_id param_id, clap_param_value plain_value); + // Rescan the full list of parameters according to the flags. + // [main-thread] + void (*rescan)(clap_host *host, uint32_t flags); + + // Only rescan the given subset of parameters according to the flags. // [main-thread] - void (*rescan)(clap_host *host, bool did_parameter_list_change); - void (*rescan_params)(clap_host *host, const uint32_t *indexes, uint32_t count); + void (*rescan_params)(clap_host *host, uint32_t flags, const uint32_t *indexes, uint32_t count); } clap_host_params; #ifdef __cplusplus
perf: remove unnecessary conditional judgments
@@ -314,7 +314,7 @@ BOAT_RESULT BoatHlfabricWalletSetNetworkInfo( BoatHlfabricWallet *wallet_ptr, /* endorser node URL assignment */ for (i = 0; i < endorserNumber; i++) { - if( ( (endorserInfo_ptr + i) != NULL ) && ( (endorserInfo_ptr + i)->nodeUrl != NULL ) && + if( ( (endorserInfo_ptr + i) != NULL ) && ( (stringLen = strlen( (endorserInfo_ptr + i)->nodeUrl) ) > 0 ) ) { // stringLen check @@ -335,7 +335,7 @@ BOAT_RESULT BoatHlfabricWalletSetNetworkInfo( BoatHlfabricWallet *wallet_ptr, #if (BOAT_HLFABRIC_TLS_SUPPORT == 1) /* endorser node hostName assignment */ - if( ( (endorserInfo_ptr + i) != NULL ) && ( (endorserInfo_ptr + i)->hostName != NULL ) && + if( ( (endorserInfo_ptr + i) != NULL ) && ( (stringLen = strlen( (endorserInfo_ptr + i)->hostName) ) > 0 ) ) { // stringLen check @@ -366,7 +366,7 @@ BOAT_RESULT BoatHlfabricWalletSetNetworkInfo( BoatHlfabricWallet *wallet_ptr, /* orderer node URL assignment */ for( i = 0; i < ordererNumber; i++ ) { - if( ( (ordererInfo_ptr + i) != NULL ) && ( (ordererInfo_ptr + i)->nodeUrl != NULL ) && + if( ( (ordererInfo_ptr + i) != NULL ) && ( (stringLen = strlen( (ordererInfo_ptr + i)->nodeUrl ) ) > 0) ) { // stringLen check @@ -386,7 +386,7 @@ BOAT_RESULT BoatHlfabricWalletSetNetworkInfo( BoatHlfabricWallet *wallet_ptr, memcpy(wallet_ptr->network_info.orderer[i].nodeUrl, (ordererInfo_ptr + i)->nodeUrl, stringLen + 1); #if (BOAT_HLFABRIC_TLS_SUPPORT == 1) /* endorser node hostName assignment */ - if( ( (ordererInfo_ptr + i) != NULL ) && ( (ordererInfo_ptr + i)->hostName != NULL ) && + if( ( (ordererInfo_ptr + i) != NULL ) && ((stringLen = strlen( (ordererInfo_ptr + i)->hostName) ) > 0) ) { // stringLen check
bugID:17718537:whitescan fix#17718537.
@@ -76,7 +76,7 @@ static void event_handler(ali_event_t *p_event) } break; case BZ_CMD_CTX_INFO: - if(p_event != NULL){ + if(p_event->rx_data.p_data != NULL){ struct rx_cmd_post_t *r_cmd = (struct rx_cmd_post_t*) p_event->rx_data.p_data; uint8_t cmd = r_cmd ->cmd; if(cmd == BZ_CMD_QUERY){
out_s3: added extra argument to flb_sched_timer_cb_create call
@@ -1397,7 +1397,7 @@ static void cb_s3_flush(const void *data, size_t bytes, ret = flb_sched_timer_cb_create(sched, FLB_SCHED_TIMER_CB_PERM, ctx->timer_ms, cb_s3_upload, - ctx); + ctx, NULL); if (ret == -1) { flb_plg_error(ctx->ins, "Failed to create upload timer"); FLB_OUTPUT_RETURN(FLB_RETRY);
[ivshmem] added ivshmem and test app to buildAll.bat
@@ -7,6 +7,10 @@ call tools\build.bat vioscsi\vioscsi.vcxproj "Win8_SDV Win10_SDV" %* if errorlevel 1 goto :fail call tools\build.bat viostor\viostor.vcxproj "Win8_SDV Win10_SDV" %* if errorlevel 1 goto :fail +call tools\build.bat ivshmem\ivshmem.vcxproj "Win10_SDV" %* +if errorlevel 1 goto :fail +call tools\build.bat ivshmem\test\ivshmem-test.vcxproj "Win10_SDV" %* +if errorlevel 1 goto :fail for %%D in (pciserial fwcfg packaging Q35) do ( pushd %%D
link fe: make uxToHex more safe Matching implementation from contacts' lib/util.js.
@@ -128,9 +128,10 @@ export function deSig(ship) { return ship.replace('~', ''); } -//TODO look at uxToHex wonky functionality -//TODO what does "wonky functionality" refer to? export function uxToHex(ux) { - let value = ux.substr(2).replace('.', '').padStart(6, '0'); - return value; + if (ux.length > 2 && ux.substr(0,2) === '0x') { + return ux.substr(2).replace('.', '').padStart(6, '0'); + } else { + return ux.replace('.', '').padStart(6, '0'); + } }
OcFileLib: Add more logging on Disk I/O failure
@@ -432,7 +432,15 @@ InternalGetDiskPartitions ( ); if (EFI_ERROR (Status)) { FreePool (GptHeader); - DEBUG ((DEBUG_INFO, "OCPI: ReadDisk1 %r\n", Status)); + DEBUG (( + DEBUG_INFO, + "OCPI: ReadDisk1 (block: %u, io1: %d, io2: %d, size: %u) %r\n", + BlockSize, + DiskIo != NULL, + DiskIo2 != NULL, + (UINT32) sizeof (*GptHeader), + Status + )); return NULL; } @@ -488,7 +496,15 @@ InternalGetDiskPartitions ( ); if (EFI_ERROR (Status)) { FreePool (PartEntries); - DEBUG ((DEBUG_INFO, "OCPI: ReadDisk2 %r\n", Status)); + DEBUG (( + DEBUG_INFO, + "OCPI: ReadDisk2 (block: %u, io1: %d, io2: %d, size: %u) %r\n", + BlockSize, + DiskIo != NULL, + DiskIo2 != NULL, + (UINT32) PartEntriesSize, + Status + )); return NULL; }
add env var to disable compression in cli Makefile
@@ -101,7 +101,9 @@ $(SCOPE): run/bundle.go $(GOVVV) $(filter-out %_test.go,$(shell find . -type f - -o $(SCOPE) compressscope: $(SCOPE) require-upx + @if [ -z $(SCOPE_NOCOMPRESS) ] ; then \ upx -l $(SCOPE) >/dev/null 2>&1 || upx -9 $(SCOPE); \ + fi ## test: run unit tests test:
DBus: Fix minor spelling mistake in comment
@@ -148,7 +148,7 @@ static int test_prerequisites (void) printf ("detecting available bus types - please ignore single error messages prefixed with \"connect:\"\n"); // Set bus type for tests - // NOTE brew dbus on MacOs supports session by out of the box while session + // NOTE brew dbus on MacOs supports session out of the box while session // bus is not available without further configuration on Linux DBusConnection * systemBus = getDbusConnection (DBUS_BUS_SYSTEM);
network/dhcpd: fix calling dhcpd join callback even it points invalid memory. A callback that notifies providing an address to node should be protected by null check. And if dhcpd_start be called multiple times then the callback can be overwritten. So adds protection logic to detect the call while dhcpd is running.
#include <netinet/in.h> #include <arpa/inet.h> #include <semaphore.h> +#include <pthread.h> /**************************************************************************** * Global Data ****************************************************************************/ sem_t g_dhcpd_sem; + /**************************************************************************** * Private Data ****************************************************************************/ @@ -321,7 +323,8 @@ static char DHCPD_IFNAME[IFNAMSIZ] = { 0, }; static struct timeval g_select_timeout = { 1, 0 }; #endif -static dhcp_sta_joined g_dhcp_sta_joined; +static dhcp_sta_joined g_dhcp_sta_joined = NULL; +static pthread_mutex_t g_dhcpd_lock = PTHREAD_MUTEX_INITIALIZER; // protect a write operation in g_dhcpd_running /**************************************************************************** * Private Functions @@ -1095,7 +1098,9 @@ int dhcpd_sendack(in_addr_t ipaddr) /* TODO: new callback way up to application to inform a new STA has called * dhcp client */ + if (g_dhcp_sta_joined) { g_dhcp_sta_joined(); + } return OK; } @@ -1480,9 +1485,12 @@ int dhcpd_status(void) void dhcpd_stop(void) { int ret = -1; + pthread_mutex_lock(&g_dhcpd_lock); if (g_dhcpd_running == 0) { + pthread_mutex_unlock(&g_dhcpd_lock); return; } + pthread_mutex_unlock(&g_dhcpd_lock); g_dhcpd_quit = 1; while (ret != OK) { @@ -1536,9 +1544,7 @@ int dhcpd_run(void *arg) /* Now loop indefinitely, reading packets from the DHCP server socket */ g_dhcpd_sockfd = -1; - g_dhcpd_quit = 0; - g_dhcpd_running = 1; /* Create a socket to listen for requests from DHCP clients */ /* TODO : Need to add cancellation point */ @@ -1636,8 +1642,8 @@ int dhcpd_run(void *arg) sem_post(&g_dhcpd_sem); exit_with_error: - g_dhcpd_running = 0; - + /* We don't need to de-initialize g_dhcp_sta_joined + because it will be initialized at dhcpd_start*/ /* de-initialize netif address (ip address, netmask, default gateway) */ if (dhcpd_netif_deinit(DHCPD_IFNAME) < 0) { @@ -1660,10 +1666,21 @@ exit_with_error: int dhcpd_start(char *intf, dhcp_sta_joined dhcp_join_cb) { + pthread_mutex_lock(&g_dhcpd_lock); + if (g_dhcpd_running == 1) { + pthread_mutex_unlock(&g_dhcpd_lock); + return -1; + } + g_dhcpd_running = 1; + pthread_mutex_unlock(&g_dhcpd_lock); + pthread_attr_t attr; int status; int ret; struct sched_param sparam; + + g_dhcp_sta_joined = 0; + ret = sem_init(&g_dhcpd_sem, 0, 0); if (ret != OK) { ndbg("failed to initialize semaphore\n"); @@ -1716,5 +1733,9 @@ int dhcpd_start(char *intf, dhcp_sta_joined dhcp_join_cb) return 0; err_exit: + pthread_mutex_lock(&g_dhcpd_lock); + g_dhcpd_running = 0; + pthread_mutex_unlock(&g_dhcpd_lock); + return -1; }
Linux was missing poll events.
@@ -317,6 +317,9 @@ pkg sys = const Pollin : pollevt = 0x001 /* There is data to read. */ const Pollpri : pollevt = 0x002 /* There is urgent data to read. */ const Pollout : pollevt = 0x004 /* Writing now will not block. */ + const Pollerr : pollevt = 0x008 /* Error condition. */ + const Pollhup : pollevt = 0x010 /* Hung up. */ + const Pollnval : pollevt = 0x020 /* Invalid polling request. */ /* poll events: xopen */ const Pollrdnorm : pollevt = 0x040 /* Normal data may be read. */