message
stringlengths 6
474
| diff
stringlengths 8
5.22k
|
---|---|
fix(coredump): pr_status pid padding should be uint16 | @@ -115,7 +115,7 @@ typedef union {
/* We can determine the padding thank to the previous macros */
#define PRSTATUS_SIG_PADDING (PRSTATUS_OFFSET_PR_CURSIG)
-#define PRSTATUS_PID_PADDING (PRSTATUS_OFFSET_PR_PID - PRSTATUS_OFFSET_PR_CURSIG - sizeof(uint32_t))
+#define PRSTATUS_PID_PADDING (PRSTATUS_OFFSET_PR_PID - PRSTATUS_OFFSET_PR_CURSIG - sizeof(uint16_t))
#define PRSTATUS_REG_PADDING (PRSTATUS_OFFSET_PR_REG - PRSTATUS_OFFSET_PR_PID - sizeof(uint32_t))
#define PRSTATUS_END_PADDING (PRSTATUS_SIZE - PRSTATUS_OFFSET_PR_REG - ELF_GREGSET_T_SIZE)
|
fix fee inclusion in balance calculations | @@ -191,6 +191,8 @@ cryptoTransferGetAmountDirected (BRCryptoTransfer transfer) {
extern BRCryptoAmount
cryptoTransferGetAmountDirectedNet (BRCryptoTransfer transfer) {
BRCryptoAmount amount = cryptoTransferGetAmountDirected (transfer);
+
+ if (CRYPTO_TRANSFER_SENT == cryptoTransferGetDirection (transfer)) {
BRCryptoAmount fee = cryptoTransferGetFee (transfer);
if (NULL == fee) return amount;
@@ -201,6 +203,9 @@ cryptoTransferGetAmountDirectedNet (BRCryptoTransfer transfer) {
cryptoAmountGive (amount);
return amountNet;
+ } else {
+ return amount;
+ }
}
extern BRCryptoUnit
|
log: fix minor memory leak when cleaning list of log levels | @@ -174,8 +174,10 @@ void esp_log_level_set(const char* tag, esp_log_level_t level)
void clear_log_level_list()
{
- while( !SLIST_EMPTY(&s_log_tags)) {
+ uncached_tag_entry_t *it;
+ while((it = SLIST_FIRST(&s_log_tags)) != NULL) {
SLIST_REMOVE_HEAD(&s_log_tags, entries );
+ free(it);
}
s_log_cache_entry_count = 0;
s_log_cache_max_generation = 0;
|
boot/boot_serial; syscfg restrictions should allow nvreg only
way of entering serial upload mode. | @@ -23,7 +23,8 @@ syscfg.defs:
value: '-1'
restrictions:
- '(BOOT_SERIAL_DETECT_PIN != -1) ||
- (BOOT_SERIAL_DETECT_TIMEOUT != 0)'
+ (BOOT_SERIAL_DETECT_TIMEOUT != 0) ||
+ (BOOT_SERIAL_NVREG_INDEX != -1)'
BOOT_SERIAL_DETECT_PIN_CFG:
description: >
@@ -48,7 +49,8 @@ syscfg.defs:
value: 0
restrictions:
- '(BOOT_SERIAL_DETECT_PIN != -1) ||
- (BOOT_SERIAL_DETECT_TIMEOUT != 0)'
+ (BOOT_SERIAL_DETECT_TIMEOUT != 0) ||
+ (BOOT_SERIAL_NVREG_INDEX != -1)'
BOOT_SERIAL_DETECT_STRING:
description: >
@@ -84,3 +86,7 @@ syscfg.defs:
Index of retained register to use (using hal_nvreg_read) for reading
magic value.
value: -1
+ restrictions:
+ - '(BOOT_SERIAL_DETECT_PIN != -1) ||
+ (BOOT_SERIAL_DETECT_TIMEOUT != 0) ||
+ (BOOT_SERIAL_NVREG_INDEX != -1)'
|
Fixed typo in X509_STORE_CTX_new description
'X509_XTORE_CTX_cleanup' -> 'X509_STORE_CTX_cleanup' | @@ -61,7 +61,7 @@ If B<ctx> is NULL nothing is done.
X509_STORE_CTX_init() sets up B<ctx> for a subsequent verification operation.
It must be called before each call to X509_verify_cert(), i.e. a B<ctx> is only
good for one call to X509_verify_cert(); if you want to verify a second
-certificate with the same B<ctx> then you must call X509_XTORE_CTX_cleanup()
+certificate with the same B<ctx> then you must call X509_STORE_CTX_cleanup()
and then X509_STORE_CTX_init() again before the second call to
X509_verify_cert(). The trusted certificate store is set to B<store>, the end
entity certificate to be verified is set to B<x509> and a set of additional
|
Travis CI: Use build matrix
Using the build matrix can help speeding up the CI since they run
simultaneously.
Closes | language: cpp
dist: trusty
+env:
+ global:
+ - CFLAGS='-g -pipe'
+ matrix:
+ - MODE=address
+ - MODE=lib-coverage
+
addons:
apt:
packages:
- docbook2x
install:
- - wget -O xmlts.zip https://www.w3.org/XML/Test/xmlts20080827.zip
+ - wget -O expat/tests/xmlts.zip https://www.w3.org/XML/Test/xmlts20080827.zip
script:
- cd expat
- - |
- set -e
- ret=0
- for mode in \
- address \
- lib-coverage \
- ; do
- git clean -X -d -f
- cp -v ../xmlts.zip tests/xmlts.zip
- ./buildconf.sh
- CFLAGS='-g -pipe' ./qa.sh ${mode} || ret=1
- done
- exit ${ret}
+ - ./buildconf.sh
+ - ./qa.sh ${MODE}
|
Feat:fix the log info in dam_byte_pool_init | @@ -96,7 +96,7 @@ qapi_Status_t dam_byte_pool_init(void)
ret = txm_module_object_allocate(&byte_pool_test, sizeof(TX_BYTE_POOL));
if(ret != TX_SUCCESS)
{
- LOG_ERROR("DAM_APP:Allocate byte_pool_dam fail \n");
+ BoatLog(BOAT_LOG_CRITICAL,"DAM_APP:Allocate byte_pool_dam fail,ret=%d",ret);
break;
}
@@ -104,7 +104,7 @@ qapi_Status_t dam_byte_pool_init(void)
ret = tx_byte_pool_create(byte_pool_test, "Test application pool", free_memory_test, TEST_BYTE_POOL_SIZE);
if(ret != TX_SUCCESS)
{
- LOG_ERROR("DAM_APP:Create byte_pool_dam fail \n");
+ BoatLog(BOAT_LOG_CRITICAL,"DAM_APP:Create byte_pool_dam fail,ret=%d",ret);
break;
}
|
STORE: Fix the repeated prompting of passphrase
OSSL_STORE's loading function could prompt repeatedly for the same
passphrase. It turns out that OSSL_STORE_load() wasn't caching the
passphrase properly. Fixed in this change. | @@ -135,7 +135,8 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
}
if (ui_method != NULL
- && !ossl_pw_set_ui_method(&ctx->pwdata, ui_method, ui_data)) {
+ && (!ossl_pw_set_ui_method(&ctx->pwdata, ui_method, ui_data)
+ || !ossl_pw_enable_passphrase_caching(&ctx->pwdata))) {
ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_CRYPTO_LIB);
goto err;
}
@@ -413,6 +414,9 @@ OSSL_STORE_INFO *OSSL_STORE_load(OSSL_STORE_CTX *ctx)
goto again;
}
+ /* Clear any internally cached passphrase */
+ (void)ossl_pw_clear_passphrase_cache(&ctx->pwdata);
+
if (v != NULL && ctx->expected_type != 0) {
int returned_type = OSSL_STORE_INFO_get_type(v);
|
main: fix error goto | @@ -801,7 +801,7 @@ static int dev_added(struct tcmu_device *dev)
ret = pthread_cond_init(&rdev->lock_cond, NULL);
if (ret < 0)
- goto cleanup_lock_cond;
+ goto close_dev;
/*
* Set the optimal unmap granularity to max xfer len. Optimal unmap
@@ -814,14 +814,14 @@ static int dev_added(struct tcmu_device *dev)
ret = pthread_create(&rdev->cmdproc_thread, NULL, tcmur_cmdproc_thread,
dev);
if (ret < 0)
- goto close_dev;
+ goto cleanup_lock_cond;
return 0;
-close_dev:
- rhandler->close(dev);
cleanup_lock_cond:
pthread_cond_destroy(&rdev->lock_cond);
+close_dev:
+ rhandler->close(dev);
cleanup_aio_tracking:
cleanup_aio_tracking(rdev);
cleanup_io_work_queue:
|
[examples] box stacks, disable wrecking ball by default | @@ -50,10 +50,10 @@ with Hdf5() as io:
io.addObject('ground', [Contactor('Ground')], [0,0,-0.05])
# Enable to smash the wall
- io.addPrimitiveShape('Ball', 'Sphere', [1,])
- io.addObject('WreckingBall', [Contactor('Ball')],
- translation=[30,0,3], velocity=[-30,0,2,0,0,0],
- mass=10)
+ # io.addPrimitiveShape('Ball', 'Sphere', [1,])
+ # io.addObject('WreckingBall', [Contactor('Ball')],
+ # translation=[30,0,3], velocity=[-30,0,2,0,0,0],
+ # mass=10)
# Definition of a non smooth law. As no group ids are specified it
# is between contactors of group id 0.
|
hw/mcu/dialog: Add MSPLIM support
This adds support for hardware stack limiter available in ARMv8-M.
It enables stack checking for MSP since PSP is already handled in
generic os_arch. | CRG_TOP_SYS_STAT_REG_COM_IS_DOWN_Msk | \
CRG_TOP_SYS_STAT_REG_RAD_IS_DOWN_Msk)
+extern uint8_t __StackLimit;
+
void SystemInit(void)
{
#if MYNEWT_VAL(OS_SCHEDULING) && MYNEWT_VAL(MCU_DEEP_SLEEP)
int idx;
#endif
+ __asm__ volatile (".syntax unified \n"
+ " msr msplim, %[msplim] \n"
+ :
+ : [msplim] "r" (&__StackLimit)
+ :
+ );
+
/* TODO: Check chip version.
assert(CHIP_VERSION->CHIP_ID1_REG == '2');
assert(CHIP_VERSION->CHIP_ID2_REG == '5');
|
Fix issue 315 | @@ -111,9 +111,9 @@ int main(int argc,char **argv)
CCL_ClTracer *ct_wl=ccl_cl_tracer_lensing_simple_new(cosmo,NZ,z_arr_sh,nz_arr_sh, &status);
printf("ell C_ell(c,c) C_ell(c,g) C_ell(c,s) C_ell(g,g) C_ell(g,s) C_ell(s,s) | r(g,s)\n");
for(int l=2;l<=NL;l*=2) {
- double cl_cc=ccl_angular_cl(cosmo,l,ct_wl,ct_wl, &status); //CMBLensing-CMBLensing
- double cl_cg=ccl_angular_cl(cosmo,l,ct_wl,ct_wl, &status); //CMBLensing-CMBLensing
- double cl_cs=ccl_angular_cl(cosmo,l,ct_wl,ct_wl, &status); //CMBLensing-CMBLensing
+ double cl_cc=ccl_angular_cl(cosmo,l,ct_cl,ct_cl, &status); //CMBLensing-CMBLensing
+ double cl_cg=ccl_angular_cl(cosmo,l,ct_cl,ct_gc, &status); //CMBLensing-Clustering
+ double cl_cs=ccl_angular_cl(cosmo,l,ct_wl,ct_cl, &status); //CMBLensing-Galaxy lensing
double cl_gg=ccl_angular_cl(cosmo,l,ct_gc,ct_gc, &status); //Galaxy-galaxy
double cl_gs=ccl_angular_cl(cosmo,l,ct_gc,ct_wl, &status); //Galaxy-lensing
double cl_ss=ccl_angular_cl(cosmo,l,ct_wl,ct_wl, &status); //Lensing-lensing
|
quic: fix rx_callback refactoring
* check_quic_client_connected might allocate ctx
and invalidate our pointer
Type: fix | @@ -2053,10 +2053,10 @@ quic_app_rx_callback (session_t * udp_session)
if (packets_ctx[i].thread_index != thread_index)
continue;
+ check_quic_client_connected (&packets_ctx[i]);
ctx =
quic_ctx_get (packets_ctx[i].ctx_index,
packets_ctx[i].thread_index);
- check_quic_client_connected (&packets_ctx[i]);
quic_send_packets (ctx);
}
svm_fifo_dequeue_drop (f, fifo_offset);
|
file_close(): add call to release_fdesc()
Without this call, the notify set associated to a file descriptor
being closed is leaked, and in addition any notify entries
registered on the file descriptor fail to be notified of the file
closure. | @@ -716,8 +716,10 @@ closure_function(2, 0, sysreturn, file_close,
ret = spec_close(f);
}
- if (ret == 0)
+ if (ret == 0) {
+ release_fdesc(&f->f);
unix_cache_free(get_unix_heaps(), file, f);
+ }
return 0;
}
|
ci: remove redundant OTA examples jobs | @@ -411,15 +411,8 @@ test_weekend_mqtt:
- .example_test_template
- .rules:test:example_test-esp32s3
-example_test_001A:
- extends: .example_test_esp32_template
- tags:
- - ESP32
- - Example_WIFI
-
example_test_001B:
extends: .example_test_esp32_template
- parallel: 2
tags:
- ESP32
- Example_EthKitV1
@@ -437,32 +430,12 @@ example_test_001C:
- ESP32
- Example_GENERIC
-example_test_001D:
- extends: .example_test_esp32_template
- tags:
- - ESP32
- - Example_8Mflash_Ethernet
-
-example_test_OTA:
- extends: .example_test_esp32_template
- tags:
- - ESP32
- - EXAMPLE_ETH_OTA
-
example_test_protocols:
extends: .example_test_esp32_template
- parallel: 2
tags:
- ESP32
- Example_WIFI_Protocols
-# This job is only triggered by env var `NIGHTLY_RUN`, please do NOT remove
-example_test_esp32_WIFI_OTA:
- extends: .example_test_esp32_template
- tags:
- - ESP32
- - Example_WIFI_OTA
-
example_test_002:
extends: .example_test_esp32_template
tags:
@@ -513,12 +486,6 @@ example_test_007:
- ESP32
- Example_I2C_CCS811_SENSOR
-example_test_008B:
- extends: .example_test_esp32_template
- tags:
- - ESP32
- - Example_Flash_Encryption_OTA
-
example_test_009:
extends: .example_test_esp32_template
tags:
@@ -548,18 +515,6 @@ example_test_013:
- ESP32
- UT_T1_SDMODE
-example_test_014:
- extends: .example_test_esp32_template
- tags:
- - ESP32
- - 8Mpsram
-
-example_test_015:
- extends: .example_test_esp32_template
- tags:
- - ESP32
- - Example_PPP
-
example_test_016:
extends: .example_test_esp32_template
tags:
@@ -572,13 +527,6 @@ example_test_017:
- ESP32S2
- Example_GENERIC
-example_test_C2_GENERIC:
- extends: .example_test_esp32c2_template
- parallel: 2
- tags:
- - ESP32C2
- - Example_GENERIC
-
example_test_C3_GENERIC:
extends: .example_test_esp32c3_template
parallel: 2
@@ -586,12 +534,6 @@ example_test_C3_GENERIC:
- ESP32C3
- Example_GENERIC
-example_test_C3_FLASH_ENC_OTA:
- extends: .example_test_esp32c3_template
- tags:
- - ESP32C3
- - Example_Flash_Encryption_OTA_WiFi
-
example_test_ESP32_SDSPI:
extends: .example_test_esp32_template
tags:
|
For %crow tasks: Skim instead of murn. No longer include desks with no rules. | ?~ des [[hen %give %croz rus]~ ..^^$]
=+ per=(filter-rules per.q.i.des)
=+ pew=(filter-rules pew.q.i.des)
- $(des t.des, rus (~(put by rus) p.i.des per pew))
+ =? rus |(?=(^ per) ?=(^ pew))
+ (~(put by rus) p.i.des per pew)
+ $(des t.des)
::
++ filter-rules
|= pes/regs
^+ pes
=- (~(gas in *regs) -)
- %+ murn ~(tap by pes)
+ %+ skim ~(tap by pes)
|= {p/path r/rule}
- ^- (unit (pair path rule))
- ?. (~(has in who.r) |+nom.req) ~
- `[p r]
+ (~(has in who.r) |+nom.req)
--
::
$drop
|
no test plugins in 2.26.1 | @@ -29,8 +29,7 @@ Source0: https://www.cs.uoregon.edu/research/tau/tau_releases/tau-%{version}.t
Source1: OHPC_macros
Patch1: tau-add-explicit-linking-option.patch
Patch2: tau-shared_libpdb.patch
-Patch3: tau-testplugins_makefile.patch
-Patch4: tau-disable_examples.patch
+Patch3: tau-disable_examples.patch
Provides: lib%PNAME.so()(64bit)
Provides: perl(ebs2otf)
@@ -75,7 +74,6 @@ automatic instrumentation tool.
%patch1 -p1
%patch2 -p1
%patch3 -p1
-%patch4 -p1
%ifarch x86_64
sed -i -e 's/^BITS.*/BITS = 64/' src/Profile/Makefile.skel
|
Pass stack allocated buffer to realpath | @@ -423,12 +423,12 @@ Request request_path(const std::string &uri, bool is_connect) {
namespace {
std::string resolve_path(const std::string &req_path) {
auto raw_path = config.htdocs + req_path;
- auto malloced_path = realpath(raw_path.c_str(), nullptr);
- if (malloced_path == nullptr) {
+ std::array<char, PATH_MAX> buf;
+ auto p = realpath(raw_path.c_str(), buf.data());
+ if (p == nullptr) {
return "";
}
- auto path = std::string(malloced_path);
- free(malloced_path);
+ auto path = std::string(p);
if (path.size() < config.htdocs.size() ||
!std::equal(std::begin(config.htdocs), std::end(config.htdocs),
|
Updated README.md to reflect the latest version. | @@ -47,6 +47,9 @@ terminal. Features include:
Have multiple Virtual Hosts (Server Blocks)? It features a panel that
displays which virtual host is consuming most of the web server resources.
+* **ASN (Autonomous System Number mapping)**<br>
+ Great for detecting malicious traffic patterns and block them accordingly.
+
* **Color Scheme Customizable**<br>
Tailor GoAccess to suit your own color taste/schemes. Either through the
terminal, or by simply applying the stylesheet on the HTML output.
@@ -97,9 +100,9 @@ GoAccess can be compiled and used on *nix systems.
Download, extract and compile GoAccess with:
- $ wget https://tar.goaccess.io/goaccess-1.6.5.tar.gz
- $ tar -xzvf goaccess-1.6.5.tar.gz
- $ cd goaccess-1.6.5/
+ $ wget https://tar.goaccess.io/goaccess-1.7.tar.gz
+ $ tar -xzvf goaccess-1.7.tar.gz
+ $ cd goaccess-1.7/
$ ./configure --enable-utf8 --enable-geoip=mmdb
$ make
# make install
|
pbio/source: double default drivebase acceleration
As acceleration, we take double the single motor amount, because
drivebases are usually expected to respond quickly to speed
setpoint changes, particularly when following lines. | @@ -16,13 +16,16 @@ static pbio_error_t drivebase_adopt_settings(pbio_control_settings_t *s_distance
// All rate/count acceleration limits add up, because distance state is two motors counts added
s_distance->max_rate = s_left->max_rate + s_right->max_rate;
- s_distance->abs_acceleration = s_left->abs_acceleration + s_right->abs_acceleration;
s_distance->rate_tolerance = s_left->rate_tolerance + s_right->rate_tolerance;
s_distance->count_tolerance = s_left->count_tolerance + s_right->count_tolerance;
s_distance->stall_rate_limit = s_left->stall_rate_limit + s_right->stall_rate_limit;
s_distance->integral_range = s_left->integral_range + s_right->integral_range;
s_distance->integral_rate = s_left->integral_rate + s_right->integral_rate;
+ // As acceleration, we take double the single motor amount, because drivebases are
+ // usually expected to respond quickly to speed setpoint changes
+ s_distance->abs_acceleration = (s_left->abs_acceleration + s_right->abs_acceleration)*2;
+
// Although counts/errors add up twice as fast, both motors actuate, so apply half of the average PID
s_distance->pid_kp = (s_left->pid_kp + s_right->pid_kp)/4;
s_distance->pid_ki = (s_left->pid_ki + s_right->pid_ki)/4;
|
CODEOWNERS: add acrn-hypervisor Makefile owner | # Default/global reviewers (if not overridden later)
* @anthonyzxu @dongyaozu
+Makefile @binbinwu1
/hypervisor/ @anthonyzxu @dongyaozu
/devicemodel/ @anthonyzxu @ywan170
/doc/ @dbkinder @deb-intel @NanlinXie
|
config_tools: update configurator readme
update configurator readme | @@ -9,13 +9,14 @@ This version is based on Tauri, WIP.
- [x] Linux (.deb, AppImage)
- [x] Windows 7,8,10 (.exe, .msi)
-
## Setting Up
### 1. Install System Dependencies
-Please follow [this guide](https://tauri.studio/docs/getting-started/prerequisites)
-to install system dependencies **(including yarn)**.
+1. Please follow [this guide](https://tauri.studio/v1/guides/getting-started/prerequisites)
+to install system dependencies.
+2. Download and install [Nodejs](https://nodejs.org/en/download/).
+3. Please follow [this guide](https://yarnpkg.com/lang/en/docs/install/) to install yarn.
#### Linux
@@ -78,11 +79,11 @@ Run following command in the 'acrn-hypervisor' directory.
```shell
cd misc\config_tools
python scenario_config/schema_slicer.py
-python scenario_config/jsonschema/convert.py
+python scenario_config/jsonschema/converter.py
xmllint --xinclude schema/datachecks.xsd > schema/allchecks.xsd
python -m build
-del configurator/packages/configurator/thirdLib/acrn_config_tools-3.0-py3-none-any.whl
+del configurator\packages\configurator\thirdLib\acrn_config_tools-3.0-py3-none-any.whl
cd configurator
python packages/configurator/thirdLib/manager.py install
|
batchMetricCalcer test | @@ -803,6 +803,29 @@ def test_eval_metrics(loss_function):
assert np.all(first_metrics == second_metrics)
[email protected]('loss_function', ['Logloss', 'RMSE', 'QueryRMSE'])
+def test_eval_metrics_batch_calcer(loss_function):
+ metric = loss_function
+ if loss_function == 'QueryRMSE':
+ train, test, cd = QUERYWISE_TRAIN_FILE, QUERYWISE_TEST_FILE, QUERYWISE_CD_FILE
+ metric = 'PFound'
+ else:
+ train, test, cd = TRAIN_FILE, TEST_FILE, CD_FILE
+
+ train_pool = Pool(train, column_description=cd)
+ test_pool = Pool(test, column_description=cd)
+ model = CatBoost(params={'loss_function': loss_function, 'random_seed': 0, 'iterations': 100, 'thread_count': 8, 'eval_metric': metric})
+
+ model.fit(train_pool, eval_set=test_pool, use_best_model=False)
+ first_metrics = np.round(np.loadtxt('catboost_info/test_error.tsv', skiprows=1)[:, 1], 10)
+
+ calcer = model.create_metric_calcer([metric])
+ calcer.add(test_pool)
+
+ second_metrics = np.round(calcer.eval_metrics().get_result(metric), 10)
+ assert np.all(first_metrics == second_metrics)
+
+
@pytest.mark.parametrize('verbose', [5, False, True])
def test_verbose_int(verbose):
expected_line_count = {5: 3, False: 0, True: 10}
|
Changed iptest light resource to match bleprph_oic | @@ -321,19 +321,19 @@ net_cli(int argc, char **argv)
static void
app_get_light(oc_request_t *request, oc_interface_mask_t interface)
{
- bool state;
+ bool value;
if (hal_gpio_read(LED_BLINK_PIN)) {
- state = true;
+ value = true;
} else {
- state = false;
+ value = false;
}
oc_rep_start_root_object();
switch (interface) {
case OC_IF_BASELINE:
oc_process_baseline_interface(request->resource);
- case OC_IF_RW:
- oc_rep_set_boolean(root, state, state);
+ case OC_IF_A:
+ oc_rep_set_boolean(root, value, value);
break;
default:
break;
@@ -345,15 +345,15 @@ app_get_light(oc_request_t *request, oc_interface_mask_t interface)
static void
app_set_light(oc_request_t *request, oc_interface_mask_t interface)
{
- bool state;
+ bool value;
int len;
uint16_t data_off;
struct os_mbuf *m;
struct cbor_attr_t attrs[] = {
[0] = {
- .attribute = "state",
+ .attribute = "value",
.type = CborAttrBooleanType,
- .addr.boolean = &state,
+ .addr.boolean = &value,
.dflt.boolean = false
},
[1] = {
@@ -364,7 +364,7 @@ app_set_light(oc_request_t *request, oc_interface_mask_t interface)
if (cbor_read_mbuf_attrs(m, data_off, len, attrs)) {
oc_send_response(request, OC_STATUS_BAD_REQUEST);
} else {
- hal_gpio_write(LED_BLINK_PIN, state == true);
+ hal_gpio_write(LED_BLINK_PIN, value == true);
oc_send_response(request, OC_STATUS_CHANGED);
}
}
@@ -379,14 +379,15 @@ omgr_app_init(void)
NULL);
res = oc_new_resource("/light/1", 1, 0);
- oc_resource_bind_resource_type(res, "oic.r.light");
- oc_resource_bind_resource_interface(res, OC_IF_RW);
- oc_resource_set_default_interface(res, OC_IF_RW);
+ oc_resource_bind_resource_type(res, "oic.r.switch.binary");
+ oc_resource_bind_resource_interface(res, OC_IF_A);
+ oc_resource_set_default_interface(res, OC_IF_A);
oc_resource_set_discoverable(res);
oc_resource_set_periodic_observable(res, 1);
oc_resource_set_request_handler(res, OC_GET, app_get_light);
oc_resource_set_request_handler(res, OC_PUT, app_set_light);
+ oc_resource_set_request_handler(res, OC_POST, app_set_light);
oc_add_resource(res);
hal_gpio_init_out(LED_BLINK_PIN, 1);
|
chat: sort DMs by most recent, sort grouped by alphabetical | @@ -17,7 +17,30 @@ export class GroupItem extends Component {
let first = (props.index === 0) ? "pt1" : "pt4"
- let channelItems = channels.map((each, i) => {
+ let channelItems = channels.sort((a, b) => {
+ if (props.index === "/~/") {
+ let aPreview = props.messagePreviews[a];
+ let bPreview = props.messagePreviews[b];
+ let aWhen = !!aPreview ? aPreview.when : 0;
+ let bWhen = !!bPreview ? bPreview.when : 0;
+
+ return bWhen - aWhen;
+ } else {
+ let aAssociation = a in props.chatMetadata ? props.chatMetadata[a] : {};
+ let bAssociation = b in props.chatMetadata ? props.chatMetadata[b] : {};
+ let aTitle = a;
+ let bTitle = b;
+ if (aAssociation.metadata && aAssociation.metadata.title) {
+ aTitle = (aAssociation.metadata.title !== "")
+ ? aAssociation.metadata.title : a;
+ }
+ if (bAssociation.metadata && bAssociation.metadata.title) {
+ bTitle =
+ bAssociation.metadata.title !== "" ? bAssociation.metadata.title : b;
+ }
+ return aTitle.toLowerCase().localeCompare(bTitle.toLowerCase());
+ }
+ }).map((each, i) => {
let unread = props.unreads[each];
let title = each.substr(1);
if (
|
Clean up readinto. | @@ -365,7 +365,7 @@ const readln = {f
/* get at least delimiter count of characters */
match ensureread(f, 1)
| `std.Err `Eof:
- ret = readinto(f, ret, f.rend - f.rstart)
+ readinto(f, &ret, f.rend - f.rstart)
if ret.len > 0
-> `std.Ok ret
else
@@ -378,7 +378,7 @@ const readln = {f
for var i = f.rstart; i < f.rend; i++
c = (f.rbuf[i] : char)
if c == '\r' || c == '\n'
- ret = readinto(f, ret, i - f.rstart)
+ readinto(f, &ret, i - f.rstart)
f.rstart++
/* if we have '\r', we can get '\r\n'. */
if c == '\r' && unwrapc(peekc(f), -1) == '\n'
@@ -388,7 +388,7 @@ const readln = {f
;;
:nextitergetln
;;
- ret = readinto(f, ret, f.rend - f.rstart)
+ readinto(f, &ret, f.rend - f.rstart)
;;
std.die("unreachable")
}
@@ -409,7 +409,7 @@ const readdelim = {f, delim, drop
match ensureread(f, 1)
| `std.Err `Eof:
if !drop
- ret = readinto(f, ret, f.rend - f.rstart)
+ readinto(f, &ret, f.rend - f.rstart)
else
f.rstart += f.rend - f.rstart
;;
@@ -429,7 +429,7 @@ const readdelim = {f, delim, drop
;;
;;
if !drop
- ret = readinto(f, ret, i - f.rstart)
+ readinto(f, &ret, i - f.rstart)
else
f.rstart += i - f.rstart
;;
@@ -439,7 +439,7 @@ const readdelim = {f, delim, drop
:nextiterread
;;
if !drop
- ret = readinto(f, ret, f.rend - f.rstart)
+ readinto(f, &ret, f.rend - f.rstart)
else
f.rstart += f.rend - f.rstart
;;
@@ -476,13 +476,10 @@ const putv = {f, fmt, ap
reads n bytes from the read buffer onto the heap-allocated slice
provided.
*/
-const readinto = {f, buf, n
- var ret
-
+const readinto = {f, bufp, n
std.assert(f.rstart + n <= f.rend, "Reading too much from buffer")
- ret = std.sljoin(&buf, f.rbuf[f.rstart:f.rstart + n])
+ std.sljoin(bufp, f.rbuf[f.rstart:f.rstart + n])
f.rstart += n
- -> ret
}
/* makes sure we can bufferedly write at least n bytes */
|
test: additional resilience in the MSD tests + remove 2 tests from quick suite | @@ -151,7 +151,18 @@ class MassStorageTester(object):
def _check_data_correct(self, expected_data, _):
"""Return True if the actual data written matches the expected"""
data_len = len(expected_data)
+ for retry_count in range(self.RETRY_COUNT):
+ if retry_count > 0:
+ test_info.info('Previous attempts %s' % retry_count)
+ try:
data_loaded = self.board.read_target_memory(self._start, data_len)
+ except:
+ time.sleep(self.DELAY_BEFORE_RETRY_S)
+ continue
+ break
+ else:
+ raise Exception("read_target_memory() failed after %i retries" % self.RETRY_COUNT)
+
return _same(expected_data, data_loaded)
def run(self):
@@ -296,6 +307,8 @@ class MassStorageTester(object):
assert not failure_expected
assert not failure_occured
+ time.sleep(1)
+
# If there is expected data then compare
if self._expected_data:
if self._check_data_correct(self._expected_data, test_info):
@@ -378,6 +391,7 @@ def test_mass_storage(workspace, parent_test, quick=False):
# Test loading a blank binary - this image should cause a timeout
# since it doesn't have a valid vector table
+ if not quick:
test = MassStorageTester(board, test_info, "Load blank binary")
test.set_programming_data(blank_bin_contents, 'image.bin')
test.set_expected_failure_msg("The transfer timed out.", "transient, user")
@@ -397,6 +411,7 @@ def test_mass_storage(workspace, parent_test, quick=False):
test.run()
# Test a normal load with dummy files created beforehand
+ if not quick:
test = MassStorageTester(board, test_info, "Extra Files")
test.set_programming_data(hex_file_contents, 'image.hex')
test.add_mock_dirs(MOCK_DIR_LIST)
|
prgenv/amd: Test eccodes_t_grib_bpv_limit fails | @@ -40,16 +40,17 @@ long grib_get_binary_scale_fact(double max, double min, long bpval, int* ret)
long scale = 0;
const long last = 127; /* Depends on edition, should be parameter */
unsigned long maxint = 0;
+ const size_t ulong_size = sizeof(maxint) * 8;
/* See ECC-246
unsigned long maxint = grib_power(bpval,2) - 1;
double dmaxint=(double)maxint;
*/
- const double dmaxint = grib_power(bpval, 2) - 1;
- if (dmaxint >= ULONG_MAX) {
+ if (bpval >= ulong_size) {
*ret = GRIB_OUT_OF_RANGE; /*overflow*/
return 0;
}
+ const double dmaxint = grib_power(bpval, 2) - 1;
maxint = (unsigned long)dmaxint; /* Now it's safe to cast */
*ret = 0;
|
add AKM defined PMKIDs to PMKIDs total | @@ -793,7 +793,6 @@ if(pmkiduselesscount > 0) fprintf(stdout, "PMKID (useless).....................
if(pmkidcount > 0) fprintf(stdout, "PMKID (total)............................: %ld\n", pmkidcount);
if(zeroedpmkidpskcount > 0) fprintf(stdout, "PMKID (from zeroed PSK)..................: %ld\n", zeroedpmkidpskcount);
if(zeroedpmkidpmkcount > 0) fprintf(stdout, "PMKID (from zeroed PMK)..................: %ld\n", zeroedpmkidpmkcount);
-if(pmkidakmcount > 0) fprintf(stdout, "PMKID (KDV:0 AKM defined)................: %ld (PMK not recoverable)\n", pmkidakmcount);
if(donotcleanflag == false)
{
if(pmkidbestcount > 0) fprintf(stdout, "PMKID (best).............................: %ld\n", pmkidbestcount);
@@ -803,6 +802,7 @@ else
if(pmkidbestcount > 0) fprintf(stdout, "PMKID (useful)...........................: %ld\n", pmkidbestcount);
}
if(pmkidroguecount > 0) fprintf(stdout, "PMKID ROGUE..............................: %ld\n", pmkidroguecount);
+if(pmkidakmcount > 0) fprintf(stdout, "PMKID (KDV:0 AKM defined)................: %ld (PMK not recoverable)\n", pmkidakmcount);
if(pmkidwrittenhcount > 0) fprintf(stdout, "PMKID written to 22000 hash file.........: %ld\n", pmkidwrittenhcount);
if(pmkidwrittenjcountdeprecated > 0) fprintf(stdout, "PMKID written to old format JtR..........: %ld\n", pmkidwrittenjcountdeprecated);
if(pmkidwrittencountdeprecated > 0) fprintf(stdout, "PMKID written to old format (1680x)......: %ld\n", pmkidwrittencountdeprecated);
@@ -3731,7 +3731,11 @@ if((keyver == 0) || (keyver > 3))
{
pmkiduselesscount++;
}
- else pmkidakmcount++;
+ else
+ {
+ pmkidakmcount++;
+ pmkidcount++;
+ }
}
}
return;
|
out_azure_blob: updated crypto wrapper calls | @@ -32,7 +32,7 @@ static int hmac_sha256_sign(unsigned char out[32],
unsigned char *key, size_t key_len,
unsigned char *msg, size_t msg_len)
{
- return flb_hmac_simple(FLB_CRYPTO_SHA256,
+ return flb_hmac_simple(FLB_DIGEST_SHA256,
key, key_len,
msg, msg_len,
out, 32);
|
memcheck: suppress gpg-agent leak | obj:/usr/bin/gpg-agent
fun:(below main)
}
+{
+ gpg-agent
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:calloc
+ obj:/usr/bin/gpg-agent
+ obj:/usr/bin/gpg-agent
+ fun:(below main)
+}
{
PluginProcess child dies keyDup
Memcheck:Leak
|
docs: Add lutime | @@ -2590,6 +2590,22 @@ Equivalent to `futime(2)`.
**Returns (async version):** `uv_fs_t userdata`
+### `uv.fs_lutime(path, atime, mtime, [callback])`
+
+**Parameters:**
+- `path`: `string`
+- `atime`: `number`
+- `mtime`: `number`
+- `callback`: `callable` (async version) or `nil` (sync version)
+ - `err`: `nil` or `string`
+ - `success`: `boolean` or `nil`
+
+Equivalent to `lutime(2)`.
+
+**Returns (sync version):** `boolean` or `fail`
+
+**Returns (async version):** `uv_fs_t userdata`
+
### `uv.fs_link(path, new_path, [callback])`
**Parameters:**
|
Tests: added delay before SIGQUIT in access_log partial tests.
This change is necessary to avoid race between
client connection close and Unit close.
Also "read_timeout" value decreased to speed up tests. | @@ -180,7 +180,9 @@ Connection: close
self.assertEqual(self.post()['status'], 200, 'init')
- resp = self.http(b"""GE""", raw=True, read_timeout=5)
+ resp = self.http(b"""GE""", raw=True, read_timeout=1)
+
+ time.sleep(1)
self.stop()
@@ -206,7 +208,9 @@ Connection: close
self.assertEqual(self.post()['status'], 200, 'init')
- resp = self.http(b"""GET / HTTP/1.1""", raw=True, read_timeout=5)
+ resp = self.http(b"""GET / HTTP/1.1""", raw=True, read_timeout=1)
+
+ time.sleep(1)
self.stop()
@@ -219,7 +223,9 @@ Connection: close
self.assertEqual(self.post()['status'], 200, 'init')
- resp = self.http(b"""GET / HTTP/1.1\n""", raw=True, read_timeout=5)
+ resp = self.http(b"""GET / HTTP/1.1\n""", raw=True, read_timeout=1)
+
+ time.sleep(1)
self.stop()
|
Removed instance variable from child class
As inheritance takes care of making the parent class methods accessible in child class, removed the instance variable from child class | /**
* inheritance.du
-*
*/
// Parent class - Animal
class Animal {
-
eating() {
print("Eating");
}
@@ -13,11 +11,6 @@ class Animal {
// Child class - Dog
class Dog < Animal {
-
- init() {
- this.eating = super.eating;
- }
-
bark() {
print("Barking");
}
@@ -25,11 +18,6 @@ class Dog < Animal {
// Child class - Cat
class Cat < Animal {
-
- init() {
- this.eating = super.eating;
- }
-
meow() {
print("Meowing");
}
|
viofs-svc: fix repoprted file allocation.
The blocks field is in 512 bytes blocks and not in blksize. | @@ -321,7 +321,7 @@ static VOID SetFileInfo(struct fuse_attr *attr, FSP_FSCTL_FILE_INFO *FileInfo)
{
FileInfo->FileAttributes = PosixUnixModeToAttributes(attr->mode);
FileInfo->ReparseTag = 0;
- FileInfo->AllocationSize = attr->blocks * attr->blksize;
+ FileInfo->AllocationSize = attr->blocks * 512;
FileInfo->FileSize = attr->size;
UnixTimeToFileTime(attr->ctime, attr->ctimensec, &FileInfo->CreationTime);
UnixTimeToFileTime(attr->atime, attr->atimensec,
|
tests CHANGE additional tests of refining actions/notifications from groupings | @@ -2275,6 +2275,7 @@ test_uses(void **state)
struct ly_ctx *ctx;
struct lys_module *mod;
const struct lysc_node *parent, *child;
+ const struct lysc_node_container *cont;
assert_int_equal(LY_SUCCESS, ly_ctx_new(NULL, LY_CTX_DISABLE_SEARCHDIRS, &ctx));
@@ -2338,6 +2339,26 @@ test_uses(void **state)
assert_non_null(child = lysc_node_children(child, 0));
assert_string_equal("x", child->name);
+ assert_non_null(mod = lys_parse_mem(ctx, "module e {yang-version 1.1;namespace urn:e;prefix e; grouping grp {action g { description \"super g\";}}"
+ "container top {action e; uses grp {refine g {description \"ultra g\";}}}}", LYS_IN_YANG));
+ assert_non_null(mod->compiled->data);
+ cont = (const struct lysc_node_container*)mod->compiled->data;
+ assert_non_null(cont->actions);
+ assert_int_equal(2, LY_ARRAY_SIZE(cont->actions));
+ assert_string_equal("e", cont->actions[1].name);
+ assert_string_equal("g", cont->actions[0].name);
+ assert_string_equal("ultra g", cont->actions[0].dsc);
+
+ assert_non_null(mod = lys_parse_mem(ctx, "module f {yang-version 1.1;namespace urn:f;prefix f; grouping grp {notification g { description \"super g\";}}"
+ "container top {notification f; uses grp {refine g {description \"ultra g\";}}}}", LYS_IN_YANG));
+ assert_non_null(mod->compiled->data);
+ cont = (const struct lysc_node_container*)mod->compiled->data;
+ assert_non_null(cont->notifs);
+ assert_int_equal(2, LY_ARRAY_SIZE(cont->notifs));
+ assert_string_equal("f", cont->notifs[1].name);
+ assert_string_equal("g", cont->notifs[0].name);
+ assert_string_equal("ultra g", cont->notifs[0].dsc);
+
/* invalid */
assert_null(lys_parse_mem(ctx, "module aa {namespace urn:aa;prefix aa;uses missinggrp;}", LYS_IN_YANG));
logbuf_assert("Grouping \"missinggrp\" referenced by a uses statement not found.");
@@ -2372,6 +2393,15 @@ test_uses(void **state)
"container top {uses grp {augment /g {leaf x {type int8;}}}}}", LYS_IN_YANG));
logbuf_assert("Invalid descendant-schema-nodeid value \"/g\" - absolute-schema-nodeid used.");
+ assert_non_null(mod = lys_parse_mem(ctx, "module hh {yang-version 1.1;namespace urn:hh;prefix hh;"
+ "grouping grp {notification g { description \"super g\";}}"
+ "container top {notification h; uses grp {refine h {description \"ultra h\";}}}}", LYS_IN_YANG));
+ logbuf_assert("Invalid descendant-schema-nodeid value \"h\" - target node not found.");
+
+ assert_non_null(mod = lys_parse_mem(ctx, "module ii {yang-version 1.1;namespace urn:ii;prefix ii;"
+ "grouping grp {action g { description \"super g\";}}"
+ "container top {action i; uses grp {refine i {description \"ultra i\";}}}}", LYS_IN_YANG));
+ logbuf_assert("Invalid descendant-schema-nodeid value \"i\" - target node not found.");
*state = NULL;
ly_ctx_destroy(ctx, NULL);
|
trusty: fix typo of comments
Remove TODO comments since it has been done below the comments.
Typo fix: startup_info --> startup_param.
Acked-by: Eddie Dong | @@ -304,8 +304,6 @@ static bool setup_trusty_info(struct vcpu *vcpu,
mem = (struct trusty_mem *)(HPA2HVA(mem_base_hpa));
- /* TODO: prepare vkey_info */
-
/* copy key_info to the first page of trusty memory */
memcpy_s(&mem->first_page.key_info, sizeof(g_key_info),
&g_key_info, sizeof(g_key_info));
@@ -327,7 +325,7 @@ static bool setup_trusty_info(struct vcpu *vcpu,
}
}
- /* Prepare trusty startup info */
+ /* Prepare trusty startup param */
mem->first_page.startup_param.size_of_this_struct =
sizeof(struct trusty_startup_param);
mem->first_page.startup_param.mem_size = mem_size;
|
test[platon]:modify g_platon_network_config | extern char g_platon_private_key_buf[1024];
extern BoatKeypairPriKeyCtx_config g_keypair_config;
-extern BoatVenachainNetworkConfig g_platon_network_config;
+extern BoatPlatONNetworkConfig g_platon_network_config;
extern BUINT8 g_binFormatKey[32];
\ No newline at end of file
|
Add missing getDirection binding; | @@ -442,6 +442,7 @@ static const luaL_Reg lovrHeadset[] = {
{ "getPose", l_lovrHeadsetGetPose },
{ "getPosition", l_lovrHeadsetGetPosition },
{ "getOrientation", l_lovrHeadsetGetOrientation },
+ { "getDirection", l_lovrHeadsetGetDirection },
{ "getVelocity", l_lovrHeadsetGetVelocity },
{ "getAngularVelocity", l_lovrHeadsetGetAngularVelocity },
{ "isDown", l_lovrHeadsetIsDown },
|
ecx_set_priv_key: Try to obtain libctx from the pkey's keymgmt
We can try to do that although for legacy keys the keymgmt
will not be set. This function will disappear with legacy support
removed. | #include "internal/deprecated.h"
#include <stdio.h>
-#include "internal/cryptlib.h"
#include <openssl/x509.h>
#include <openssl/ec.h>
#include <openssl/rand.h>
#include <openssl/core_names.h>
-#include "openssl/param_build.h"
+#include <openssl/param_build.h>
+#include "internal/cryptlib.h"
+#include "internal/provider.h"
#include "crypto/asn1.h"
#include "crypto/evp.h"
#include "crypto/ecx.h"
@@ -334,14 +335,24 @@ static int ecd_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
static int ecx_set_priv_key(EVP_PKEY *pkey, const unsigned char *priv,
size_t len)
{
+ OSSL_LIB_CTX *libctx = NULL;
+
+ if (pkey->keymgmt != NULL)
+ libctx = ossl_provider_libctx(EVP_KEYMGMT_provider(pkey->keymgmt));
+
return ecx_key_op(pkey, pkey->ameth->pkey_id, NULL, priv, len,
- KEY_OP_PRIVATE, NULL, NULL);
+ KEY_OP_PRIVATE, libctx, NULL);
}
static int ecx_set_pub_key(EVP_PKEY *pkey, const unsigned char *pub, size_t len)
{
+ OSSL_LIB_CTX *libctx = NULL;
+
+ if (pkey->keymgmt != NULL)
+ libctx = ossl_provider_libctx(EVP_KEYMGMT_provider(pkey->keymgmt));
+
return ecx_key_op(pkey, pkey->ameth->pkey_id, NULL, pub, len,
- KEY_OP_PUBLIC, NULL, NULL);
+ KEY_OP_PUBLIC, libctx, NULL);
}
static int ecx_get_priv_key(const EVP_PKEY *pkey, unsigned char *priv,
|
Add pci_get_class() and pci_get_subclass(). | #pragma once
+/* PCI config register */
#define PCIR_VENDOR 0x00
#define PCIR_DEVICE 0x02
+#define PCIR_SUBCLASS 0x0a
+#define PCIR_CLASS 0x0b
#define PCIR_MEMBASE0_2 0x1c
#define PCIR_MEMLIMIT0_2 0x20
#define PCIR_MEMBASE1_2 0x24
#define PCIR_IOBASEH_1 0x30
#define PCIR_IOLIMITH_1 0x32
+/* PCI device class */
+#define PCIC_STORAGE 0x01
+
+/* PCI device subclass */
+#define PCIS_STORAGE_IDE 0x01
+
typedef struct pci_dev *pci_dev;
struct pci_dev {
@@ -32,6 +41,16 @@ static inline u16 pci_get_device(pci_dev dev)
return pci_cfgread(dev, PCIR_DEVICE, 2);
}
+static inline u16 pci_get_class(pci_dev dev)
+{
+ return pci_cfgread(dev, PCIR_CLASS, 1);
+}
+
+static inline u16 pci_get_subclass(pci_dev dev)
+{
+ return pci_cfgread(dev, PCIR_SUBCLASS, 1);
+}
+
u32 pci_readbar(pci_dev dev, int bid, u32 *length);
void pci_discover();
|
Use up-to-date value of mv dir for bit cost calculations | @@ -1371,7 +1371,7 @@ static void search_pu_inter_ref(inter_search_info_t *info,
// Only check when candidates are different
uint8_t mv_ref_coded = LX_idx;
int cu_mv_cand = select_mv_cand(info->state, info->mv_cand, best_mv.x, best_mv.y, NULL);
- best_bits += cur_cu->inter.mv_dir - 1 + mv_ref_coded;
+ best_bits += ref_list + mv_ref_coded;
// Update best unipreds for biprediction
bool valid_mv = fracmv_within_tile(info, best_mv.x, best_mv.y);
|
OcAppleKernelLib: Implement support for macOS 10.4 for ProvideCurrentCpuInfo quirk | @@ -1361,7 +1361,13 @@ PatchProvideCurrentCpuInfo (
Status |= PatcherGetSymbolAddressValue (Patcher, "_tsc_init", (UINT8 **)&TscInitFunc, &TscInitFuncSymAddr);
Status |= PatcherGetSymbolAddress (Patcher, "_tmrCvt", (UINT8 **)&TmrCvtFunc);
+ //
+ // _busFreq only exists on 10.5 and higher.
+ //
+ if (OcMatchDarwinVersion (KernelVersion, KERNEL_VERSION_LEOPARD_MIN, 0)) {
Status |= PatcherGetSymbolValue (Patcher, "_busFreq", &BusFreqSymAddr);
+ }
+
Status |= PatcherGetSymbolValue (Patcher, "_busFCvtt2n", &BusFCvtt2nSymAddr);
Status |= PatcherGetSymbolValue (Patcher, "_busFCvtn2t", &BusFCvtn2tSymAddr);
Status |= PatcherGetSymbolValue (Patcher, "_tscFreq", &TscFreqSymAddr);
@@ -1396,14 +1402,16 @@ PatchProvideCurrentCpuInfo (
//
TscLocation = TscInitFunc;
+ if (OcMatchDarwinVersion (KernelVersion, KERNEL_VERSION_LEOPARD_MIN, 0)) {
TscLocation = PatchMovVar (TscLocation, Patcher->Is32Bit, &TscInitFuncSymAddr, BusFreqSymAddr, busFreqValue);
+ }
+
TscLocation = PatchMovVar (TscLocation, Patcher->Is32Bit, &TscInitFuncSymAddr, BusFCvtt2nSymAddr, busFCvtt2nValue);
TscLocation = PatchMovVar (TscLocation, Patcher->Is32Bit, &TscInitFuncSymAddr, BusFCvtn2tSymAddr, busFCvtn2tValue);
TscLocation = PatchMovVar (TscLocation, Patcher->Is32Bit, &TscInitFuncSymAddr, TscFreqSymAddr, tscFreqValue);
TscLocation = PatchMovVar (TscLocation, Patcher->Is32Bit, &TscInitFuncSymAddr, TscFCvtt2nSymAddr, tscFCvtt2nValue);
TscLocation = PatchMovVar (TscLocation, Patcher->Is32Bit, &TscInitFuncSymAddr, TscFCvtn2tSymAddr, tscFCvtn2tValue);
TscLocation = PatchMovVar (TscLocation, Patcher->Is32Bit, &TscInitFuncSymAddr, TscGranularitySymAddr, tscGranularityValue);
- TscLocation = PatchMovVar (TscLocation, Patcher->Is32Bit, &TscInitFuncSymAddr, BusFreqSymAddr, busFreqValue);
if (Patcher->Is32Bit) {
//
|
VERSION bump to version 0.11.1 | @@ -29,7 +29,7 @@ set(CMAKE_C_FLAGS_DEBUG "-g -O0")
# set version
set(LIBNETCONF2_MAJOR_VERSION 0)
set(LIBNETCONF2_MINOR_VERSION 11)
-set(LIBNETCONF2_MICRO_VERSION 0)
+set(LIBNETCONF2_MICRO_VERSION 1)
set(LIBNETCONF2_VERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION}.${LIBNETCONF2_MICRO_VERSION})
set(LIBNETCONF2_SOVERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION})
|
tigertail: bugfix mux select
Don't clobber uart autodetect settings on detect.
BRANCH=None
TEST=ran on tigertail
Commit-Ready: Nick Sanders
Tested-by: Nick Sanders | @@ -260,7 +260,8 @@ void uart_sbu_tick(void)
if (debounce > 4) {
debounce = 0;
CPRINTS("UART autoenable\n");
- set_uart_state(state);
+ uart_state = state;
+ set_uart_gpios(state);
}
return;
}
@@ -272,7 +273,8 @@ void uart_sbu_tick(void)
if (debounce > 4) {
debounce = 0;
CPRINTS("UART autodisable\n");
- set_uart_state(UART_OFF);
+ uart_state = UART_OFF;
+ set_uart_gpios(UART_OFF);
}
return;
}
|
crypto: fix typo in testmod_crypt.c | @@ -281,7 +281,7 @@ static void test_gpg (void)
int main (int argc, char ** argv)
{
- printf ("CYPTO TESTS\n");
+ printf ("CRYPTO TESTS\n");
printf ("==================\n\n");
init (argc, argv);
|
Add an alignment test for the heapmem module. | * Nicolas Tsiftes <[email protected]>
*/
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -77,6 +78,13 @@ UNIT_TEST(do_many_allocations)
char *ptrs[TEST_CONCURRENT] = { NULL };
unsigned failed_allocations = 0;
unsigned failed_deallocations = 0;
+ unsigned misalignments = 0;
+ unsigned min_alignment = heapmem_alignment();
+
+ UNIT_TEST_ASSERT(min_alignment != 0);
+ UNIT_TEST_ASSERT(!(min_alignment & (min_alignment - 1)));
+
+ printf("Using heapmem alignment of %u\n", min_alignment);
/*
* Do a number of allocations (TEST_LIMIT) of a random size in the range
@@ -103,6 +111,9 @@ UNIT_TEST(do_many_allocations)
if(ptrs[alloc_index] == NULL) {
failed_allocations++;
} else {
+ if((uintptr_t)ptrs[alloc_index] & (min_alignment - 1)) {
+ misalignments++;
+ }
memset(ptrs[alloc_index], '!', alloc_size);
}
}
@@ -118,8 +129,10 @@ UNIT_TEST(do_many_allocations)
printf("Failed allocations: %u\n", failed_allocations);
printf("Failed deallocations: %u\n", failed_deallocations);
+ printf("Misaligned addresses: %u\n", misalignments);
UNIT_TEST_ASSERT(failed_allocations == 0);
UNIT_TEST_ASSERT(failed_deallocations == 0);
+ UNIT_TEST_ASSERT(misalignments == 0);
UNIT_TEST_END();
}
|
peview: Add symbol for entrypoint | @@ -1121,23 +1121,72 @@ VOID PvpSetPeImageEntropy(
PhQueueItemWorkQueue(PhGetGlobalWorkQueue(), PvpEntropyImageThreadStart, WindowHandle);
}
-VOID PvpSetPeImageEntryPoint(
- _In_ HWND ListViewHandle
+static NTSTATUS PvpEntryPointImageThreadStart(
+ _In_ PVOID Parameter
)
{
ULONG addressOfEntryPoint;
PPH_STRING string;
+ PPH_STRING symbol;
+ PPH_STRING symbolName = NULL;
+ PH_SYMBOL_RESOLVE_LEVEL symbolResolveLevel = PhsrlInvalid;
if (PvMappedImage.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
addressOfEntryPoint = PvMappedImage.NtHeaders32->OptionalHeader.AddressOfEntryPoint;
else
addressOfEntryPoint = PvMappedImage.NtHeaders->OptionalHeader.AddressOfEntryPoint;
+ if (PvMappedImage.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
+ {
+ symbol = PhGetSymbolFromAddress(
+ PvSymbolProvider,
+ (ULONG64)PTR_ADD_OFFSET(PvMappedImage.NtHeaders32->OptionalHeader.ImageBase, addressOfEntryPoint),
+ &symbolResolveLevel,
+ NULL,
+ &symbolName,
+ NULL
+ );
+ }
+ else
+ {
+ symbol = PhGetSymbolFromAddress(
+ PvSymbolProvider,
+ (ULONG64)PTR_ADD_OFFSET(PvMappedImage.NtHeaders->OptionalHeader.ImageBase, addressOfEntryPoint),
+ &symbolResolveLevel,
+ NULL,
+ &symbolName,
+ NULL
+ );
+ }
+
+ if (symbolName && symbolResolveLevel == PhsrlFunction || symbolResolveLevel == PhsrlModule || symbolResolveLevel == PhsrlAddress)
+ {
+ string = PhFormatString(L"0x%I32x (%s)", addressOfEntryPoint, PhGetStringOrEmpty(symbolName));
+ PhSetListViewSubItem(Parameter, PVP_IMAGE_GENERAL_INDEX_ENTRYPOINT, 1, string->Buffer);
+ PhDereferenceObject(string);
+ }
+ else
+ {
string = PhFormatString(L"0x%I32x", addressOfEntryPoint);
- PhSetListViewSubItem(ListViewHandle, PVP_IMAGE_GENERAL_INDEX_ENTRYPOINT, 1, string->Buffer);
+ PhSetListViewSubItem(Parameter, PVP_IMAGE_GENERAL_INDEX_ENTRYPOINT, 1, string->Buffer);
PhDereferenceObject(string);
}
+ if (symbolName)
+ PhDereferenceObject(symbolName);
+ PhDereferenceObject(symbol);
+ return STATUS_SUCCESS;
+}
+
+VOID PvpSetPeImageEntryPoint(
+ _In_ HWND ListViewHandle
+ )
+{
+ PhSetListViewSubItem(ListViewHandle, PVP_IMAGE_GENERAL_INDEX_ENTRYPOINT, 1, L"Resolving...");
+
+ PhQueueItemWorkQueue(PhGetGlobalWorkQueue(), PvpEntryPointImageThreadStart, ListViewHandle);
+}
+
VOID PvpSetPeImageCheckSum(
_In_ HWND WindowHandle,
_In_ HWND ListViewHandle
|
Modify implementation to take advantage of browser | @@ -933,6 +933,7 @@ typedef struct {
#define DISPLAY_DIMM_ID_MAX_SIZE 2 //!< Number of possible Dimm Identifiers
#define DISPLAY_DIMM_ID_DEFAULT DISPLAY_DIMM_ID_HANDLE
+#define APP_DIRECT_SETTINGS_INDEX_DEFAULT 0
#define BMI_DEFAULT MODE_DISABLED //!< default setting for boot minimal init
|
Optimize the performance of msetnx command by call lookupkey only once
This is a small addition to
It improves performance by avoiding double lookup of the the key. | @@ -553,6 +553,7 @@ void mgetCommand(client *c) {
void msetGenericCommand(client *c, int nx) {
int j;
+ int setkey_flags = 0;
if ((c->argc % 2) == 0) {
addReplyErrorArity(c);
@@ -568,11 +569,12 @@ void msetGenericCommand(client *c, int nx) {
return;
}
}
+ setkey_flags |= SETKEY_DOESNT_EXIST;
}
for (j = 1; j < c->argc; j += 2) {
c->argv[j+1] = tryObjectEncoding(c->argv[j+1]);
- setKey(c,c->db,c->argv[j],c->argv[j+1],0);
+ setKey(c, c->db, c->argv[j], c->argv[j + 1], setkey_flags);
notifyKeyspaceEvent(NOTIFY_STRING,"set",c->argv[j],c->db->id);
}
server.dirty += (c->argc-1)/2;
|
Fix ticket logging bug | @@ -930,8 +930,9 @@ int quic_client(const char* ip_address_text, int server_port, const char * sni,
uint16_t ticket_length;
if (sni != NULL && 0 == picoquic_get_ticket(qclient->p_first_ticket, current_time, sni, (uint16_t)strlen(sni), alpn, (uint16_t)strlen(alpn), &ticket, &ticket_length, 0)) {
- fprintf(F_log, "Received ticket from %s:\n", sni);
- picoquic_log_picotls_ticket(F_log, picoquic_null_connection_id, ticket, ticket_length);
+ FILE * F = (F_log != NULL) ? F_log : stdout;
+ fprintf(F, "Received ticket from %s:\n", sni);
+ picoquic_log_picotls_ticket(F, picoquic_null_connection_id, ticket, ticket_length);
}
if (picoquic_save_tickets(qclient->p_first_ticket, current_time, ticket_store_filename) != 0) {
|
[core] fix HTTP/2 upload > 64k w/ max-request-size (fixes
fix HTTP/2 upload > 64k with server.max-request-size > 0
(regression present only in lighttpd 1.4.60)
(thx SM)
x-ref:
"File upload is broken after upgrade from 1.4.59 to 1.4.60" | @@ -1742,6 +1742,7 @@ h2_init_con (request_st * const restrict h2r, connection * const restrict con, c
con->read_idle_ts = log_monotonic_secs;
con->keep_alive_idle = h2r->conf.max_keep_alive_idle;
+ /*(h2r->h2_rwin must match value assigned in h2_init_stream())*/
h2r->h2_rwin = 65535; /* h2 connection recv window */
h2r->h2_swin = 65535; /* h2 connection send window */
/* settings sent from peer */ /* initial values */
@@ -2552,7 +2553,7 @@ h2_init_stream (request_st * const h2r, connection * const con)
/* XXX: TODO: assign default priority, etc.
* Perhaps store stream id and priority in separate table */
h2c->r[h2c->rused++] = r;
- r->h2_rwin = h2c->s_initial_window_size;
+ r->h2_rwin = 65535; /* must keep in sync with h2_init_con() */
r->h2_swin = h2c->s_initial_window_size;
r->http_version = HTTP_VERSION_2;
|
sasuke : tune usb_eq on port 1
add function to tune usb_eq_rx
BRANCH=None
TEST=make -j BOARD=sasuke
update ec and check usb eq register | @@ -454,11 +454,13 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
},
};
+static int tune_mux(const struct usb_mux *me);
const struct usb_mux usbc1_retimer = {
.usb_port = 1,
.i2c_port = I2C_PORT_SUB_USB_C1,
.i2c_addr_flags = NB7V904M_I2C_ADDR0,
.driver = &nb7v904m_usb_redriver_drv,
+ .board_init = &tune_mux,
};
const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
@@ -476,6 +478,13 @@ const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
}
};
+static int tune_mux(const struct usb_mux *me)
+{
+ return nb7v904m_tune_usb_eq_rx(me,
+ NB7V904M_CH_A_EQ_10_DB,
+ NB7V904M_CH_D_EQ_10_DB);
+}
+
uint16_t tcpc_get_alert_status(void)
{
uint16_t status = 0;
|
Ensure non deleted resources are returned in getLight.. and getSensor.. methods
This also fixes rule resource re-indexing after delete and rejoin a device,
which required a deCONZ restart to work. | @@ -2375,7 +2375,7 @@ LightNode *DeRestPluginPrivate::getLightNodeForId(const QString &id)
{
for (i = nodes.begin(); i != end; ++i)
{
- if (i->id() == id)
+ if (i->id() == id && i->state() == LightNode::StateNormal)
{
return &*i;
}
@@ -2385,7 +2385,7 @@ LightNode *DeRestPluginPrivate::getLightNodeForId(const QString &id)
{
for (i = nodes.begin(); i != end; ++i)
{
- if (i->uniqueId() == id)
+ if (i->uniqueId() == id && i->state() == LightNode::StateNormal)
{
return &*i;
}
@@ -6227,36 +6227,30 @@ Sensor *DeRestPluginPrivate::getSensorNodeForFingerPrint(quint64 extAddr, const
*/
Sensor *DeRestPluginPrivate::getSensorNodeForUniqueId(const QString &uniqueId)
{
- std::vector<Sensor>::iterator i;
- std::vector<Sensor>::iterator end = sensors.end();
-
- for (i = sensors.begin(); i != end; ++i)
+ for (Sensor &s : sensors)
{
- if (i->uniqueId() == uniqueId)
+ if (s.deletedState() == Sensor::StateNormal && s.uniqueId() == uniqueId)
{
- return &(*i);
+ return &s;
}
}
- return 0;
+ return nullptr;
}
/*! Returns a Sensor for its given \p id or 0 if not found.
*/
Sensor *DeRestPluginPrivate::getSensorNodeForId(const QString &id)
{
- std::vector<Sensor>::iterator i;
- std::vector<Sensor>::iterator end = sensors.end();
-
- for (i = sensors.begin(); i != end; ++i)
+ for (Sensor &s : sensors)
{
- if (i->id() == id)
+ if (s.deletedState() == Sensor::StateNormal && s.id() == id)
{
- return &(*i);
+ return &s;
}
}
- return 0;
+ return nullptr;
}
/*! Returns a Group for a given group id or 0 if not found.
|
addad chapter ioctl vs NETLINK | @@ -124,6 +124,12 @@ Requirements
If you decide to compile latest git head, make sure that your distribution is updated to latest version.
+ioctl() system calls versus NETLINK
+--------------
+* ioctl() system calls are purely synchronous and should be the first choice due to its immediacy and reliable delivery.
+* Netlink comms is very much asynchronous and should be used for bulk data.
+
+
Adapters
--------------
@@ -140,19 +146,12 @@ Manufacturers do change chipsets without changing model numbers. Sometimes they
This list is for information purposes only and should not be regarded as a binding presentation of the products:
* ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter
-
* ID 148f:761a Ralink Technology, Corp. MT7610U ("Archer T2U" 2.4G+5G WLAN Adapter
-
* ID 0e8d:7612 MediaTek Inc. MT7612U 802.11a/b/g/n/ac Wireless Adapter
-
* ID 0b05:17d1 ASUSTek Computer, Inc. AC51 802.11a/b/g/n/ac Wireless Adapter [Mediatek MT7610U]
-
* ID 7392:7710 Edimax Technology Co., Ltd Edimax Wi-Fi
-
* ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter
-
* ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
-
* ID 148f:5572 Ralink Technology, Corp. RT5572 Wireless Adapter
Always verify the actual chipset with 'lsusb' and/or 'lspci'!
@@ -169,9 +168,7 @@ No support for a driver which doesn't support monitor and packet injection, nati
Not recommended WiFi chipsets (Broadcom, Intel, Realtek and Atheros), especially:
* Broadcom (neither monitor mode nor frame injection)
-
* Intel PRO/Wireless (due to several driver issues and NETLINK dependency)
-
* Realtek RTL8811AU, RTL8812AU, RTL8814AU (due to NETLINK dependency)
more information about possible issues on https://bugzilla.kernel.org
@@ -326,3 +323,4 @@ You must use hcxdumptool only on networks you have permission to do this and if
* Stop all services which take access to the physical interface (NetworkManager, wpa_supplicant,...)
* Do not use tools like macchanger, as they are useless, because hcxdumptool uses its own random mac address space
+
|
Restore groupSize if (re)allocation of groupConnector fails | @@ -4832,8 +4832,10 @@ doProlog(XML_Parser parser,
if (prologState.level >= groupSize) {
if (groupSize) {
char *temp = (char *)REALLOC(groupConnector, groupSize *= 2);
- if (temp == NULL)
+ if (temp == NULL) {
+ groupSize /= 2;
return XML_ERROR_NO_MEMORY;
+ }
groupConnector = temp;
if (dtd->scaffIndex) {
int *temp = (int *)REALLOC(dtd->scaffIndex,
@@ -4845,10 +4847,12 @@ doProlog(XML_Parser parser,
}
else {
groupConnector = (char *)MALLOC(groupSize = 32);
- if (!groupConnector)
+ if (!groupConnector) {
+ groupSize = 0;
return XML_ERROR_NO_MEMORY;
}
}
+ }
groupConnector[prologState.level] = 0;
if (dtd->in_eldecl) {
int myindex = nextScaffoldPart(parser);
|
kdb-set: fix documentation | @@ -18,7 +18,7 @@ To set a key to an empty value, `""` should be passed for the `value` argument.
## NEGATIVE VALUES
-To set a key to a negative value, `--` has to be used to stop option processing. (example below)
+To set a key to a negative value, `--` has to be used to stop option processing. (see example below)
## OPTIONS
@@ -57,20 +57,27 @@ To set a key to a negative value, `--` has to be used to stop option processing.
## EXAMPLES
To set a Key to the value `Hello World!`:
+
`kdb set user/example/key "Hello World!"`
To create a new key with a null value:
+
`kdb set user/example/key`
To set a key to an empty value:
+
`kdb set user/example/key ""`
To set a key to a negative value:
+
`kdb set -- /tests/neg -3`
To create bookmarks:
+
`kdb set user/sw/elektra/kdb/#0/current/bookmarks`
+
followed by:
+
`kdb set user/sw/elektra/kdb/#0/current/bookmarks/kdb user/sw/elektra/kdb/#0/current`
|
out_pgsql: Fix typo specefied | @@ -209,7 +209,7 @@ static int cb_pgsql_init(struct flb_output_instance *ins,
return -1;
}
- /* Maybe use the timestamp with the TZ specefied */
+ /* Maybe use the timestamp with the TZ specified */
/* in the postgresql connection? */
snprintf(query, str_len,
"CREATE TABLE IF NOT EXISTS %s "
|
cirrus: add -Db_lundef=false to sanitizer buld | @@ -17,7 +17,7 @@ task:
- apt-get install -y ninja-build ninja-build python3-pip python3-setuptools python3-wheel gcovr clang
- pip3 install meson
configure_script:
- - /usr/local/bin/meson setup build -Db_coverage=true -Db_sanitize=address,undefined
+ - /usr/local/bin/meson setup build -Db_coverage=true -Db_sanitize=address,undefined -Db_lundef=false
build_script:
- ninja -C build -v -j 3
test_script:
|
arvo: revive |start | |= $: [now=@da eny=@uvJ bec=beak]
[arg=[@ $@(~ [@ ~])] ~]
==
-:- %drum-start
+=/ [des=@tas dap=@tas]
?> ((sane %tas) -.arg)
?@ +.arg [q.bec -.arg]
?> ((sane %tas) +<.arg)
[-.arg +<.arg]
+[%kiln-rein des & [dap ~ ~] ~]
|
Fix LibreSSL build issue
LibreSSL forked from 1.0.1f, this 1.0.2 method is unavailable | @@ -651,7 +651,7 @@ mongoc_stream_tls_openssl_new (mongoc_stream_t *base_stream,
RETURN (NULL);
}
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
if (!opt->allow_invalid_hostname) {
struct in_addr addr;
X509_VERIFY_PARAM *param = X509_VERIFY_PARAM_new ();
|
fix and optimise Variable Set to Value causing Nan / Null if no value
If value greater than 1 use value, if 1 cmd set true, if 0 or no value, cmd set false.
would be nan if no value (now that data is checked). | @@ -16,6 +16,14 @@ export const fields = [
];
export const compile = (input, helpers) => {
+ if (input.value > 1) {
const { variableSetToValue } = helpers;
variableSetToValue(input.variable, input.value);
+ }else if (input.value == 1) {
+ const { variableSetToTrue } = helpers;
+ variableSetToTrue(input.variable);
+ }else {
+ const { variableSetToFalse } = helpers;
+ variableSetToFalse(input.variable);
+ }
};
|
fcm: fixing maven deps | @@ -6,12 +6,8 @@ android:
- ext/android/ApplicationManifestAdds.erb
library_deps: [extras/google/google_play_services/libproject/google-play-services_lib]
source_list: ext/android/ext_java.files
- maven_deps: ['com.android.support:appcompat-v7:25.2.0']
- maven_deps: ['com.google.android.gms:play-services:11.0.2']
- maven_deps: ['com.google.android.gms:play-services-identity:11.0.2']
- maven_deps: ['com.google.firebase:firebase-core:11.0.2']
- maven_deps: ['com.google.firebase:firebase-config:11.0.2']
- maven_deps: ['com.google.firebase:firebase-messaging:11.0.2']
+ maven_deps:
+ - 'com.google.firebase:firebase-messaging:11.0.2'
adds: ext/android/res
libraries: ['fcm-push']
xml_api_paths: ext/fcm.xml
|
Travis: Allow job LINUX64_MUSL USE_OPENMP=1 to fail
See: | @@ -87,7 +87,10 @@ jobs:
- TARGET_BOX=LINUX64_MUSL
- BTYPE="BINARY=64"
- - <<: *test-alpine
+ # XXX: This job segfaults in TESTS OF THE COMPLEX LEVEL 3 BLAS,
+ # so it's "allowed to fail" for now (see allow_failures).
+ - &test-alpine-openmp
+ <<: *test-alpine
env:
- TARGET_BOX=LINUX64_MUSL
- BTYPE="BINARY=64 USE_OPENMP=1"
|
input: do not show password title while confirming empty passw. | @@ -142,8 +142,9 @@ static void _render(component_t* component)
data_t* data = (data_t*)component->data;
bool confirm_gesture_active =
data->can_confirm && data->longtouch && confirm_gesture_is_active(data->confirm_component);
- bool show_title =
- data->string_index == 0 && !trinary_input_char_in_progress(data->trinary_char_component);
+ bool show_title = data->string_index == 0 &&
+ !trinary_input_char_in_progress(data->trinary_char_component) &&
+ !confirm_gesture_active;
UG_S16 string_x = data->start_x;
|
Fix World:update; | @@ -85,6 +85,10 @@ void lovrWorldDestroyData(World* world) {
}
void lovrWorldUpdate(World* world, float dt, CollisionResolver resolver, void* userdata) {
+ if (dt == 0.) {
+ return;
+ }
+
if (resolver) {
resolver(world, userdata);
} else {
|
Move newline generation in help
If we removed the shortcuts intro, we would not need the additional '\n'
of the section title, so it should be printed along with the shortcuts
intro. | @@ -776,7 +776,7 @@ print_shortcuts_intro(unsigned cols) {
return;
}
- printf("%s\n", intro);
+ printf("\n%s\n", intro);
free(intro);
}
@@ -831,7 +831,7 @@ scrcpy_print_usage(const char *arg0) {
}
// Print shortcuts section
- printf("\nShortcuts:\n\n");
+ printf("\nShortcuts:\n");
print_shortcuts_intro(cols);
for (size_t i = 0; i < ARRAY_LEN(shortcuts); ++i) {
print_shortcut(&shortcuts[i], cols);
|
Updater: Fix missing changelog | @@ -62,7 +62,7 @@ VOID ShowProgressDialog(
memset(&config, 0, sizeof(TASKDIALOGCONFIG));
config.cbSize = sizeof(TASKDIALOGCONFIG);
- config.dwFlags = TDF_USE_HICON_MAIN | TDF_ALLOW_DIALOG_CANCELLATION | TDF_CAN_BE_MINIMIZED | TDF_ENABLE_HYPERLINKS | TDF_SHOW_PROGRESS_BAR;
+ config.dwFlags = TDF_USE_HICON_MAIN | TDF_ALLOW_DIALOG_CANCELLATION | TDF_CAN_BE_MINIMIZED | TDF_ENABLE_HYPERLINKS | TDF_SHOW_PROGRESS_BAR | TDF_EXPAND_FOOTER_AREA;
config.dwCommonButtons = TDCBF_CANCEL_BUTTON;
config.hMainIcon = Context->IconLargeHandle;
config.cxWidth = 200;
@@ -76,7 +76,7 @@ VOID ShowProgressDialog(
Context->RevisionVersion
)->Buffer;
config.pszContent = L"Downloaded: ~ of ~ (0%)\r\nSpeed: ~ KB/s";
- config.pszExpandedInformation = L"<A HREF=\"changelog.txt\">View Changelog</A>";
+ config.pszExpandedInformation = PhGetString(Context->BuildMessage);
SendMessage(Context->DialogHandle, TDM_NAVIGATE_PAGE, 0, (LPARAM)&config);
}
\ No newline at end of file
|
OCC: Increase max pstate check on P9 to 255
This has changed from P8, we can now have > 127 pstates.
This was observed on Boston during WoF bringup.
Reported-by: Minda Wei
Reported-by: Francesco A Campisano | @@ -612,13 +612,15 @@ static bool add_cpu_pstate_properties(int *pstate_nom)
nr_pstates = labs(pmax - pmin) + 1;
prlog(PR_DEBUG, "OCC: Version %x Min %d Nom %d Max %d Nr States %d\n",
occ_data->version, pmin, pnom, pmax, nr_pstates);
- if (nr_pstates <= 1 || nr_pstates > 128) {
+ if ((occ_data->version == 0x90 && (nr_pstates <= 1)) ||
+ (occ_data->version <= 0x02 &&
+ (nr_pstates <= 1 || nr_pstates > 128))) {
/**
* @fwts-label OCCInvalidPStateRange
* @fwts-advice The number of pstates is outside the valid
- * range (currently <=1 or > 128), so OPAL has not added
- * pstates to the device tree. This means that OCC (On Chip
- * Controller) will be non-functional. This means
+ * range (currently <=1 or > 128 on p8, >255 on P9), so OPAL
+ * has not added pstates to the device tree. This means that
+ * OCC (On Chip Controller) will be non-functional. This means
* that CPU idle states and CPU frequency scaling
* will not be functional.
*/
|
Ensure we have a valid fname_as_vhost before making a copy of it. | @@ -1798,7 +1798,7 @@ pre_process_log (GLog * glog, char *line, int dry_run) {
else
ret = parse_format (logitem, line, fmt);
- if (!glog->piping && conf.fname_as_vhost)
+ if (!glog->piping && conf.fname_as_vhost && glog->fname_as_vhost)
logitem->vhost = xstrdup(glog->fname_as_vhost);
if (ret || (ret = verify_missing_fields (logitem))) {
|
Add test-java to CI. | @@ -289,6 +289,40 @@ jobs:
path: ${{runner.workspace}}/${{github.event.repository.name}}/tools/ci/tinyspline/
if-no-files-found: error
+ test-java:
+ needs: [package]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest]
+ java: ["11", "17"]
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-java@v2
+ with:
+ distribution: "adopt"
+ java-version: ${{ matrix.java }}
+
+ - name: Download Packages
+ uses: actions/download-artifact@v2
+ with:
+ path: packages
+
+ - name: Install Package
+ shell: bash
+ run: |
+ mkdir -p $GITHUB_WORKSPACE/build/lib
+ cd $GITHUB_WORKSPACE/build/lib
+ unzip -d . $GITHUB_WORKSPACE/packages/tinyspline/tinyspline-java.zip
+ find . -name "*[0-9].jar" -exec mv {} tinyspline.jar \;
+
+ - name: Run Tests
+ shell: bash
+ run: |
+ cd $GITHUB_WORKSPACE/test/java
+ mvn test
+
test-lua:
needs: [package]
runs-on: ${{ matrix.os }}
|
os/arch: remove dependancy between DDR and ARCH_BOARD_CY4390X
Any board can use DDR, this is not specific to Cypress board. | @@ -738,14 +738,15 @@ config RAM_SIZE
config DDR
bool "Use DDR memory"
default n
- depends on ARCH_CHIP_BCM4390X
+ ---help---
+ If the board uses external DDR RAM memory, enable this.
config RAM_DDR_START
hex "DDR RAM start address"
default 0x0
depends on DDR
---help---
- If the board using external DDR RAM memory, you need to define
+ If the board uses external DDR RAM memory, you need to define
the start address of DDR RAM
config RAM_DDR_SIZE
@@ -753,7 +754,7 @@ config RAM_DDR_SIZE
default 0
depends on DDR
---help---
- If the board using external DDR RAM memory, you need to define
+ If the board uses external DDR RAM memory, you need to define
the size of DDR RAM
|
commander_btc: enforce next BTCRequest/* call
So that during a signing session, no other unrelated api calls can be
made. | @@ -184,6 +184,9 @@ commander_error_t commander_btc_pub(const BTCPubRequest* request, PubResponse* r
}
}
+// like commander_states, but for requests nested in BTCRequest.
+static commander_states_endpoint_id _force_next = 0;
+
static void _handle_sign_next(const BTCSignNextResponse* next)
{
switch (next->type) {
@@ -194,11 +197,16 @@ static void _handle_sign_next(const BTCSignNextResponse* next)
commander_states_force_next(Request_btc_sign_output_tag);
break;
case BTCSignNextResponse_Type_PREVTX_INIT:
+ commander_states_force_next(Request_btc_tag);
+ _force_next = BTCRequest_prevtx_init_tag;
+ break;
case BTCSignNextResponse_Type_PREVTX_INPUT:
+ commander_states_force_next(Request_btc_tag);
+ _force_next = BTCRequest_prevtx_input_tag;
+ break;
case BTCSignNextResponse_Type_PREVTX_OUTPUT:
- // Force BTCRequest*.
commander_states_force_next(Request_btc_tag);
- // TODO: force nested message in BTCRequest/*.
+ _force_next = BTCRequest_prevtx_output_tag;
break;
default:
break;
@@ -263,6 +271,12 @@ static commander_error_t _api_register_script_config(const BTCRegisterScriptConf
commander_error_t commander_btc(const BTCRequest* request, BTCResponse* response)
{
+ bool can_call = _force_next == 0 || _force_next == request->which_request;
+ if (!can_call) {
+ return COMMANDER_ERR_INVALID_STATE;
+ }
+ _force_next = 0;
+
switch (request->which_request) {
case BTCRequest_is_script_config_registered_tag:
response->which_response = BTCResponse_is_script_config_registered_tag;
|
[kernel/schedule] fix the time slice issue | @@ -683,8 +683,19 @@ void rt_schedule_insert_thread(struct rt_thread *thread)
#endif /* RT_THREAD_PRIORITY_MAX > 32 */
rt_thread_ready_priority_group |= thread->number_mask;
+ /* there is no time slices left(YIELD), inserting thread before ready list*/
+ if((thread->stat & RT_THREAD_STAT_YIELD_MASK) != 0)
+ {
rt_list_insert_before(&(rt_thread_priority_table[thread->current_priority]),
&(thread->tlist));
+ }
+ /* there are some time slices left, inserting thread after ready list to schedule it firstly at next time*/
+ else
+ {
+ rt_list_insert_after(&(rt_thread_priority_table[thread->current_priority]),
+ &(thread->tlist));
+ }
+
cpu_mask = RT_CPU_MASK ^ (1 << cpu_id);
rt_hw_ipi_send(RT_SCHEDULE_IPI, cpu_mask);
}
@@ -697,8 +708,18 @@ void rt_schedule_insert_thread(struct rt_thread *thread)
#endif /* RT_THREAD_PRIORITY_MAX > 32 */
pcpu->priority_group |= thread->number_mask;
+ /* there is no time slices left(YIELD), inserting thread before ready list*/
+ if((thread->stat & RT_THREAD_STAT_YIELD_MASK) != 0)
+ {
rt_list_insert_before(&(rt_cpu_index(bind_cpu)->priority_table[thread->current_priority]),
&(thread->tlist));
+ }
+ /* there are some time slices left, inserting thread after ready list to schedule it firstly at next time*/
+ else
+ {
+ rt_list_insert_after(&(rt_cpu_index(bind_cpu)->priority_table[thread->current_priority]),
+ &(thread->tlist));
+ }
if (cpu_id != bind_cpu)
{
@@ -733,9 +754,18 @@ void rt_schedule_insert_thread(struct rt_thread *thread)
/* READY thread, insert to ready queue */
thread->stat = RT_THREAD_READY | (thread->stat & ~RT_THREAD_STAT_MASK);
- /* insert thread to ready list */
+ /* there is no time slices left(YIELD), inserting thread before ready list*/
+ if((thread->stat & RT_THREAD_STAT_YIELD_MASK) != 0)
+ {
rt_list_insert_before(&(rt_thread_priority_table[thread->current_priority]),
&(thread->tlist));
+ }
+ /* there are some time slices left, inserting thread after ready list to schedule it firstly at next time*/
+ else
+ {
+ rt_list_insert_after(&(rt_thread_priority_table[thread->current_priority]),
+ &(thread->tlist));
+ }
RT_DEBUG_LOG(RT_DEBUG_SCHEDULER, ("insert thread[%.*s], the priority: %d\n",
RT_NAME_MAX, thread->name, thread->current_priority));
|
Disable HS USB for nrf52840
The nrf52840 does not support high speed USB so this patch disables it. | // <o0.0> High-speed
// <i> Enable high-speed functionality (if device supports it)
-#define USBD_HS_ENABLE 1
+#define USBD_HS_ENABLE 0
#if (defined(WEBUSB_INTERFACE) || defined(WINUSB_INTERFACE) || defined(BULK_ENDPOINT))
#define USBD_BOS_ENABLE 1
#else
#define USBD_HID_EP_INTIN_STACK 0
#define USBD_HID_WMAXPACKETSIZE 64
#define USBD_HID_BINTERVAL 1
-#define USBD_HID_HS_ENABLE 1
+#define USBD_HID_HS_ENABLE 0
#define USBD_HID_HS_WMAXPACKETSIZE 64
#define USBD_HID_HS_BINTERVAL 1
#define USBD_HID_STRDESC L"CMSIS-DAP v1"
#define USBD_MSC_EP_BULKOUT 2
#define USBD_MSC_EP_BULKIN_STACK 0
#define USBD_MSC_WMAXPACKETSIZE 64
-#define USBD_MSC_HS_ENABLE 1
+#define USBD_MSC_HS_ENABLE 0
#define USBD_MSC_HS_WMAXPACKETSIZE 512
#define USBD_MSC_HS_BINTERVAL 0
#define USBD_MSC_STRDESC L"USB_MSC"
#define USBD_CDC_ACM_EP_INTIN_STACK 0
#define USBD_CDC_ACM_WMAXPACKETSIZE 16
#define USBD_CDC_ACM_BINTERVAL 32
-#define USBD_CDC_ACM_HS_ENABLE 1
+#define USBD_CDC_ACM_HS_ENABLE 0
#define USBD_CDC_ACM_HS_WMAXPACKETSIZE 64
#define USBD_CDC_ACM_HS_BINTERVAL 2
#define USBD_CDC_ACM_EP_BULKIN 4
#define USBD_BULK_EP_BULKOUT 5
// #define USBD_BULK_EP_BULKIN_SWO 6
#define USBD_BULK_WMAXPACKETSIZE 64
-#define USBD_BULK_HS_ENABLE 1
+#define USBD_BULK_HS_ENABLE 0
#define USBD_BULK_HS_WMAXPACKETSIZE 512
#define USBD_BULK_STRDESC L"CMSIS-DAP v2"
|
Improve CLR exit | @@ -637,7 +637,8 @@ void ClrStartup(CLR_SETTINGS params)
}
else
{
- CPU_Reset();
+ // equivalent to CPU_Reset();
+ break;
}
}
|
board/beadrix/board.h: Format with clang-format
BRANCH=none
TEST=none
Tricium: disable | #define CONFIG_CHARGE_RAMP_HW
#undef CONFIG_CHARGER_SINGLE_CHIP
#define CONFIG_OCPC
-#define CONFIG_OCPC_DEF_RBATT_MOHMS 22 /* R_DS(on) 11.6mOhm + 10mOhm sns rstr \
+#define CONFIG_OCPC_DEF_RBATT_MOHMS \
+ 22 /* R_DS(on) 11.6mOhm + 10mOhm sns rstr \
*/
/*
|
contact-push-hook: add blank personal psuedo-resource for personal contact subscriptions | :: if the ship is in any group that I am pushing updates for, push
:: it out to that resource.
::
+ =/ rids
%+ skim ~(tap in scry-sharing)
|= r=resource:res
(is-member:grp s r)
+ ?. =(s our.bowl)
+ rids
+ (snoc rids [our.bowl %''])
::
++ scry-sharing
.^ (set resource:res)
++ rolo
^- rolodex:store
=/ ugroup (scry-group:grp resource)
- ?~ ugroup *rolodex:store
%- ~(gas by *rolodex:store)
+ ?~ ugroup
+ =/ c=(unit contact:store) (get-contact:con our.bowl)
+ ?~ c
+ [our.bowl *contact:store]~
+ [our.bowl u.c]~
%+ murn ~(tap in (members:grp resource))
|= s=ship
^- (unit [ship contact:store])
|
zephyr: flash: change flash_lock to use K_MUTEX_DEFINE
Switch this Zephyr-only code to use K_MUTEX_DEFINE, removing the
requirement to initialize this mutex at runtime.
BRANCH=none
TEST=zmake testall | @@ -30,15 +30,7 @@ static uint8_t saved_sr2;
#define CMD_READ_STATUS_REG 0x05
#define CMD_READ_STATUS_REG2 0x35
-static mutex_t flash_lock;
-static int init_flash_mutex(const struct device *dev)
-{
- ARG_UNUSED(dev);
-
- k_mutex_init(&flash_lock);
- return 0;
-}
-SYS_INIT(init_flash_mutex, POST_KERNEL, 50);
+K_MUTEX_DEFINE(flash_lock);
static int flash_get_status1(void)
{
|
fix display converter | @@ -53,6 +53,20 @@ pbc.initIgnoreS = function(){
}
pbc.initModuleAttrD = function(){
+ for (var i = 0; i < profile.default.builtinimg.length; i++) {
+ pbc.moduleAttrD.get('Image')[profile.default.builtinimg[i][0]] = function (node, module, attr) {
+ return block("pins_builtinimg", node.lineno, {
+ "PIN": module + "." + attr
+ });
+ }
+ }
+ for (var i = 0; i < profile.default.imglist.length; i++) {
+ pbc.moduleAttrD.get('Image')[profile.default.imglist[i][0]] = function (node, module, attr) {
+ return block("pins_imglist", node.lineno, {
+ "PIN": module + "." + attr
+ });
+ }
+ }
}
pbc.initKnownModuleS = function(){
|
apps/wifi_manager_sample/wm_test : Change strcat to strncat
1) WID:10637402 Use of vulnerable function 'strcat' at wm_test.c:366. This function is unsafe, use strncat instead.
2) Revert partial of about unreachable code | @@ -357,14 +357,14 @@ static void print_wifi_ap_profile(wifi_manager_ap_config_s *config, char *title)
if (config->ap_auth_type == WIFI_MANAGER_AUTH_UNKNOWN || config->ap_crypto_type == WIFI_MANAGER_CRYPTO_UNKNOWN) {
printf("[WT] SECURITY: unknown\n");
} else {
- char security_type[20] = {0,};
+ char security_type[21] = {0,};
strncat(security_type, wifi_test_auth_method[config->ap_auth_type], 20);
wifi_manager_ap_auth_type_e tmp_type = config->ap_auth_type;
if (tmp_type == WIFI_MANAGER_AUTH_OPEN || tmp_type == WIFI_MANAGER_AUTH_IBSS_OPEN || tmp_type == WIFI_MANAGER_AUTH_WEP_SHARED) {
printf("[WT] SECURITY: %s\n", security_type);
} else {
- strcat(security_type, "_");
- strcat(security_type, wifi_test_crypto_method[config->ap_crypto_type]);
+ strncat(security_type, "_", strlen("_"));
+ strncat(security_type, wifi_test_crypto_method[config->ap_crypto_type], strlen(wifi_test_crypto_method[config->ap_crypto_type]));
printf("[WT] SECURITY: %s\n", security_type);
}
}
@@ -984,6 +984,8 @@ void wm_auto_test(void *arg)
printf("[WT] Cycle finished [Round %d]\n", cnt);
}
+ printf("[WT] Exit WiFi Manager Stress Test..\n");
+
}
static wm_test_e _wm_get_opt(int argc, char *argv[])
|
fix randomseed bug
put randomseed into setup default | @@ -169,8 +169,8 @@ Blockly.Arduino.math_max_min = function() {
Blockly.Arduino.math_random_seed = function () {
// Random integer between [X] and [Y].
var a = Blockly.Arduino.valueToCode(this, 'NUM',Blockly.Arduino.ORDER_NONE) || '0';
- var code = 'randomSeed(' + a + ');'+'\n';
- return code;
+ Blockly.Arduino.setups_['setup_randomSeed'] ='randomSeed(' + a + ');'+'\n';
+ return "";
};
Blockly.Arduino.math_random_int = function() {
|
OpenXR: More robust graphics plugin; | @@ -171,13 +171,13 @@ static bool openxr_init(float offset, uint32_t msaa) {
{ // Session
XrSessionCreateInfo info = {
.type = XR_TYPE_SESSION_CREATE_INFO,
-#if defined(_WIN32)
+#if defined(_WIN32) && defined(LOVR_GL)
.next = &(XrGraphicsBindingOpenGLWin32KHR) {
.type = XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR,
.hDC = lovrPlatformGetWindow(),
.hGLRC = lovrPlatformGetContext()
},
-#elif defined(__ANDROID__)
+#elif defined(__ANDROID__) && defined(LOVR_GLES)
.next = &(XrGraphicsBindingOpenGLESAndroidKHR) {
.type = XR_TYPE_GRAPHICS_BINDING_OPENGL_ES_ANDROID_KHR,
.display = lovrPlatformGetEGLDisplay(),
@@ -185,7 +185,7 @@ static bool openxr_init(float offset, uint32_t msaa) {
.context = lovrPlatformGetEGLContext()
},
#else
-#error "OpenXR is not supported on this platform"
+#error "Unsupported OpenXR platform/graphics combination"
#endif
.systemId = state.system
};
|
Prevent using uninitialized memory | @@ -1759,7 +1759,10 @@ static void search_pu_inter(encoder_state_t * const state,
kvz_sort_keys_by_cost(&amvp[0]);
kvz_sort_keys_by_cost(&amvp[1]);
- int best_keys[2] = { amvp[0].keys[0], amvp[1].keys[0] };
+ int best_keys[2] = {
+ amvp[0].size > 0 ? amvp[0].keys[0] : 0,
+ amvp[1].size > 0 ? amvp[1].keys[0] : 0
+ };
cu_info_t *best_unipred[2] = {
&amvp[0].unit[best_keys[0]],
|
RTX5: moved "weak" attribute to function definition (issue | @@ -434,9 +434,8 @@ extern const uint8_t *irqRtxLibRef;
const uint8_t *irqRtxLibRef = &irqRtxLib;
// Default User SVC Table
-__WEAK
extern void * const osRtxUserSVC[];
- void * const osRtxUserSVC[1] = { (void *)0 };
+__WEAK void * const osRtxUserSVC[1] = { (void *)0 };
// OS Sections
@@ -511,18 +510,16 @@ const uint32_t os_cb_sections[] = {
(defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
#ifndef __MICROLIB
-__WEAK
-void _platform_post_stackheap_init (void);
-void _platform_post_stackheap_init (void) {
+extern void _platform_post_stackheap_init (void);
+__WEAK void _platform_post_stackheap_init (void) {
osKernelInitialize();
}
#endif
#elif defined(__GNUC__)
-__WEAK
-void software_init_hook (void);
-void software_init_hook (void) {
+extern void software_init_hook (void);
+__WEAK void software_init_hook (void) {
osKernelInitialize();
}
|
Fix typo in crlf.c | @@ -190,7 +190,7 @@ static ssize_t crlf_mrecvl(struct msock_vfs *mvfs,
c1 = c2;
/* c2 <- socket */
int rc = obj->uvfs->brecvl(obj->uvfs, &iol, &iol, deadline);
- if(dill_slow(rc < 0)) {obj->inerr = -1; return -1;}
+ if(dill_slow(rc < 0)) {obj->inerr = 1; return -1;}
++recvd;
if(c1 == '\r' && c2 == '\n') break;
}
|
Don't add pointers with uncertain lifetimes into long lived stat cache hash table | @@ -25,9 +25,7 @@ void StatCacheDestroy(StatCache* self)
static void StatCacheInsert(StatCache* self, uint32_t hash, const char* path, const FileInfo& info)
{
ReadWriteLockWrite(&self->m_HashLock);
-
- HashTableInsert(&self->m_Files, hash, path, info);
-
+ HashTableInsert(&self->m_Files, hash, StrDup(self->m_Allocator, path), info);
ReadWriteUnlockWrite(&self->m_HashLock);
}
|
king: fix bug Show Ipv4 | @@ -172,9 +172,9 @@ newtype Ipv4 = Ipv4 { unIpv4 :: Word32 }
instance Show Ipv4 where
show (Ipv4 i) =
- show ((shiftL i 24) .&. 0xff) ++ "." ++
- show ((shiftL i 16) .&. 0xff) ++ "." ++
- show ((shiftL i 8) .&. 0xff) ++ "." ++
+ show ((shiftR i 24) .&. 0xff) ++ "." ++
+ show ((shiftR i 16) .&. 0xff) ++ "." ++
+ show ((shiftR i 8) .&. 0xff) ++ "." ++
show (i .&. 0xff)
-- @is
|
cloud: reset lists of published resources on stop
Do not destroy the list of published resources, but move the
resources into the to-be-published list when oc_cloud_manager_stop
is invoked. | @@ -365,7 +365,7 @@ oc_cloud_manager_stop(oc_cloud_context_t *ctx)
#endif /* OC_SESSION_EVENTS */
oc_remove_delayed_callback(ctx, restart_manager);
oc_remove_delayed_callback(ctx, start_manager);
- cloud_rd_deinit(ctx);
+ cloud_rd_reset_context(ctx);
cloud_manager_stop(ctx);
cloud_store_initialize(&ctx->store);
cloud_close_endpoint(ctx->cloud_ep);
|
unified: harden crsf protocol detection | @@ -346,7 +346,9 @@ void rx_serial_find_protocol(void) {
}
break;
case RX_SERIAL_PROTOCOL_CRSF:
- if (rx_buffer[0] == 0xC8) {
+ if (rx_buffer[0] == 0xC8 &&
+ rx_buffer[1] <= 64 &&
+ (rx_buffer[2] == 0x16 || rx_buffer[2] == 0x14)) {
rx_serial_protocol = protocol_to_check;
}
break;
@@ -362,6 +364,10 @@ void rx_serial_find_protocol(void) {
}
}
+ if (rx_serial_protocol == protocol_to_check) {
+ quic_debugf("UNIFIED: protocol %d found", protocol_to_check);
+ }
+
if (protocol_detect_timer > 4000) { //4000 loops, half a second
protocol_detect_timer = 0; // Reset timer, triggering a shift to detecting the next protocol
}
|
out OPTIMIZE realloc for LY_OUT_MEMORY | #include "tree_data.h"
#include "tree_schema.h"
+/**
+ * @brief Align the desired size to 1 KB.
+ */
+#define REALLOC_CHUNK(NEW_SIZE) \
+ NEW_SIZE + (1024 - (NEW_SIZE % 1024))
+
ly_bool
ly_should_print(const struct lyd_node *node, uint32_t options)
{
@@ -534,7 +540,7 @@ LY_ERR
ly_write_(struct ly_out *out, const char *buf, size_t len)
{
LY_ERR ret = LY_SUCCESS;
- size_t written = 0;
+ size_t written = 0, new_mem_size;
if (out->hole_count) {
/* we are buffering data after a hole */
@@ -562,15 +568,17 @@ ly_write_(struct ly_out *out, const char *buf, size_t len)
repeat:
switch (out->type) {
case LY_OUT_MEMORY:
- if (out->method.mem.len + len + 1 > out->method.mem.size) {
- *out->method.mem.buf = ly_realloc(*out->method.mem.buf, out->method.mem.len + len + 1);
+ new_mem_size = out->method.mem.len + len + 1;
+ if (new_mem_size > out->method.mem.size) {
+ new_mem_size = REALLOC_CHUNK(new_mem_size);
+ *out->method.mem.buf = ly_realloc(*out->method.mem.buf, new_mem_size);
if (!*out->method.mem.buf) {
out->method.mem.len = 0;
out->method.mem.size = 0;
LOGMEM(NULL);
return LY_EMEM;
}
- out->method.mem.size = out->method.mem.len + len + 1;
+ out->method.mem.size = new_mem_size;
}
if (len) {
memcpy(&(*out->method.mem.buf)[out->method.mem.len], buf, len);
|
ixfr-out, limit IXFR packets to the compression bounds of 16k. | @@ -144,7 +144,7 @@ static void pktcompression_insert(struct pktcompression* pcomp, uint8_t* dname,
struct rrcompress_entry* entry;
if(len > 65535)
return;
- if(offset > 16384)
+ if(offset > MAX_COMPRESSION_OFFSET)
return; /* too far for a compression pointer */
entry = pktcompression_alloc(pcomp, sizeof(*entry));
if(!entry)
@@ -163,6 +163,8 @@ static void pktcompression_insert_with_labels(struct pktcompression* pcomp,
{
if(!dname)
return;
+ if(offset > MAX_COMPRESSION_OFFSET)
+ return;
/* while we have not seen the end root label */
while(len > 0 && dname[0] != 0) {
@@ -266,7 +268,8 @@ static int ixfr_write_rr_pkt(struct query* query, struct buffer* packet,
size_t i;
rrtype_descriptor_type* descriptor;
- if(query_overflow(query)) {
+ if(buffer_position(packet) > MAX_COMPRESSION_OFFSET
+ || query_overflow(query)) {
/* we are past the maximum length */
return 0;
}
|
gall: no-op on %slay,%idle for missing agent | ++ mo-fade
|= [dap=term style=?(%slay %idle %jolt)]
^+ mo-core
- =/ =routes [disclosing=~ attributing=our]
- =/ app (ap-abed:ap dap routes)
+ ?. |(=(%jolt style) (~(has by yokes.state) dap))
+ mo-core
+ =/ app
+ ~_ leaf/"gall: fade {<style>} missing agent {<dap>}"
+ (ap-abed:ap dap `routes`[disclosing=~ attributing=our])
=. mo-core ap-abet:(ap-fade:app style)
=. mo-core
?- style
|
include/gpio_list.h: Format with clang-format
BRANCH=none
TEST=none | @@ -64,7 +64,8 @@ const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers);
* The compiler will complain if we use the same name twice. The linker ignores
* anything that gets by.
*/
-#define PIN(a, b...) static const int _pin_ ## a ## _ ## b \
+#define PIN(a, b...) \
+ static const int _pin_##a##_##b \
__attribute__((unused, section(".unused"))) = __LINE__;
#include "gpio.wrap"
@@ -117,8 +118,8 @@ const int ioex_ih_count = ARRAY_SIZE(ioex_irq_handlers);
* file.
*/
#define IOEX_INT(name, expin, flags, handler) \
- BUILD_ASSERT(IOEX_##name - IOEX_SIGNAL_START \
- < ARRAY_SIZE(ioex_irq_handlers));
+ BUILD_ASSERT(IOEX_##name - IOEX_SIGNAL_START < \
+ ARRAY_SIZE(ioex_irq_handlers));
#include "gpio.wrap"
#define IOEX(name, expin, flags) expin
|
Sockeye TN: Update info about node types | @@ -271,12 +271,14 @@ The overlay will span addresses from \texttt{0x0} to \(\texttt{0x2}^\texttt{bits
\end{syntax}
\subsection{Node Type}
-Currently there are two types: \Sockeye{device} and \Sockeye{memory}. A third internal type \Sockeye{other} is given to nodes for which no type is specified.
-The \Sockeye{device} type specifies that the accepted addresses are device registers while the \Sockeye{memory} type is for memory nodes like RAM or ROM.
+Currently there are three types: \Sockeye{core}, \Sockeye{device} and \Sockeye{memory}. A fourth internal type \Sockeye{other} is given to nodes for which no type is specified.
+The \Sockeye{core} type designates the node as a CPU core. The \Sockeye{device} type specifies that the accepted addresses are device registers while the \Sockeye{memory} type is for memory nodes like RAM or ROM.
\paragraph{Syntax}
\begin{align*}
\textit{type} & \mathop{=}
+ \textbf{core}\
+ |\
\textbf{device}\
|\
\textbf{memory} \\
|
Actually add the message to the TLS section | @@ -1291,7 +1291,12 @@ UNLOCK_COMMAND(&alloc_lock);
return (void *)(((char *)alloc_info) + sizeof(struct alloc_t));
error:
- printf("OpenBLAS : Program will terminate because you tried to allocate too many memory regions.\n");
+ printf("OpenBLAS : Program will terminate because you tried to allocate too many TLS memory regions.\n");
+ printf("This library was built to support a maximum of %d threads - either rebuild OpenBLAS\n", NUM_BUFFERS);
+ printf("with a larger NUM_THREADS value or set the environment variable OPENBLAS_NUM_THREADS to\n");
+ printf("a sufficiently small number. This error typically occurs when the software that relies on\n");
+ printf("OpenBLAS calls BLAS functions from many threads in parallel, or when your computer has more\n");
+ printf("cpu cores than what OpenBLAS was configured to handle.\n");
return NULL;
}
|
vere: skip disk cleanup if commit thread cannot be canceled | @@ -689,18 +689,14 @@ u3_disk_exit(u3_disk* log_u)
}
}
- // cancel write thread
+ // try to cancel write thread
+ // shortcircuit cleanup if we cannot
//
- // XX can deadlock when called from signal handler
- // XX revise SIGTSTP handling
- //
- if ( c3y == log_u->ted_o ) {
- c3_i sas_i;
-
- do {
- sas_i = uv_cancel(&log_u->req_u);
- }
- while ( UV_EBUSY == sas_i );
+ if ( (c3y == log_u->ted_o)
+ && uv_cancel(&log_u->req_u) )
+ {
+ // u3l_log("disk: unable to cleanup\r\n");
+ return;
}
// close database
|
ipc/tree: populate `focus` fields
Ids of children, by order of focus | @@ -454,21 +454,50 @@ json_object *ipc_json_describe_container_recursive(swayc_t *c) {
int i;
json_object *floating = json_object_new_array();
- if (c->type != C_VIEW && c->floating && c->floating->length > 0) {
+ if (c->type != C_VIEW && c->floating) {
for (i = 0; i < c->floating->length; ++i) {
- json_object_array_add(floating, ipc_json_describe_container_recursive(c->floating->items[i]));
+ swayc_t *item = c->floating->items[i];
+ json_object_array_add(floating, ipc_json_describe_container_recursive(item));
}
}
json_object_object_add(object, "floating_nodes", floating);
json_object *children = json_object_new_array();
- if (c->type != C_VIEW && c->children && c->children->length > 0) {
+ if (c->type != C_VIEW && c->children) {
for (i = 0; i < c->children->length; ++i) {
json_object_array_add(children, ipc_json_describe_container_recursive(c->children->items[i]));
}
}
json_object_object_add(object, "nodes", children);
+ json_object *focus = json_object_new_array();
+ if (c->type != C_VIEW) {
+ if (c->focused) {
+ json_object_array_add(focus, json_object_new_double(c->focused->id));
+ }
+ if (c->floating) {
+ for (i = 0; i < c->floating->length; ++i) {
+ swayc_t *item = c->floating->items[i];
+ if (item == c->focused) {
+ continue;
+ }
+
+ json_object_array_add(focus, json_object_new_double(item->id));
+ }
+ }
+ if (c->children) {
+ for (i = 0; i < c->children->length; ++i) {
+ swayc_t *item = c->children->items[i];
+ if (item == c->focused) {
+ continue;
+ }
+
+ json_object_array_add(focus, json_object_new_double(item->id));
+ }
+ }
+ }
+ json_object_object_add(object, "focus", focus);
+
if (c->type == C_ROOT) {
json_object *scratchpad_json = json_object_new_array();
if (scratchpad->length > 0) {
|
Cleanup port macro flag names | @@ -140,9 +140,9 @@ static inline void oper_move_relative_or_explode(Gbuffer gbuf, Mbuffer mbuf,
if (!oper_has_neighboring_bang(gbuffer, height, width, y, x)) \
return
-#define PORT_LOCKED Mark_flag_lock
-#define PORT_UNLOCKED Mark_flag_none
-#define PORT_HASTE Mark_flag_haste_input
+#define LOCKING Mark_flag_lock
+#define NONLOCKING Mark_flag_none
+#define HASTE Mark_flag_haste_input
#define REALIZE_DUAL \
bool const Dual_is_active = \
@@ -218,9 +218,9 @@ MOVING_OPERATOR(west, 0, -1)
BEGIN_DUAL_PHASE_0(add)
REALIZE_DUAL;
BEGIN_DUAL_PORTS
- I_PORT(0, 1, PORT_LOCKED);
- I_PORT(0, 2, PORT_LOCKED);
- O_PORT(1, 0, PORT_LOCKED);
+ I_PORT(0, 1, LOCKING);
+ I_PORT(0, 2, LOCKING);
+ O_PORT(1, 0, LOCKING);
END_PORTS
END_PHASE
BEGIN_DUAL_PHASE_1(add)
@@ -235,9 +235,9 @@ END_PHASE
BEGIN_DUAL_PHASE_0(modulo)
REALIZE_DUAL;
BEGIN_DUAL_PORTS
- I_PORT(0, 1, PORT_LOCKED);
- I_PORT(0, 2, PORT_LOCKED);
- O_PORT(1, 0, PORT_LOCKED);
+ I_PORT(0, 1, LOCKING);
+ I_PORT(0, 2, LOCKING);
+ O_PORT(1, 0, LOCKING);
END_PORTS
END_PHASE
BEGIN_DUAL_PHASE_1(modulo)
@@ -252,9 +252,9 @@ END_PHASE
BEGIN_DUAL_PHASE_0(increment)
REALIZE_DUAL;
BEGIN_DUAL_PORTS
- I_PORT(0, 1, PORT_LOCKED);
- I_PORT(0, 2, PORT_LOCKED);
- O_PORT(1, 0, PORT_LOCKED);
+ I_PORT(0, 1, LOCKING);
+ I_PORT(0, 2, LOCKING);
+ O_PORT(1, 0, LOCKING);
END_PORTS
END_PHASE
BEGIN_DUAL_PHASE_1(increment)
|
Cleanup draw naming | @@ -161,7 +161,7 @@ void tui_cursor_move_relative(Tui_cursor* tc, Usz field_h, Usz field_w,
tc->x = (Usz)x0;
}
-void draw_tui_cursor(WINDOW* win, Glyph const* gbuffer, Usz field_h,
+void tdraw_tui_cursor(WINDOW* win, Glyph const* gbuffer, Usz field_h,
Usz field_w, Usz ruler_spacing_y, Usz ruler_spacing_x,
Usz cursor_y, Usz cursor_x) {
(void)ruler_spacing_y;
@@ -257,7 +257,7 @@ void undo_history_pop(Undo_history* hist, Field* out_field, Usz* out_tick_num) {
Usz undo_history_count(Undo_history* hist) { return hist->count; }
-void draw_ui_bar(WINDOW* win, int win_y, int win_x, const char* filename,
+void tdraw_hud(WINDOW* win, int win_y, int win_x, const char* filename,
Usz tick_num) {
wmove(win, win_y, win_x);
wattrset(win, A_dim | Cdef_normal);
@@ -269,7 +269,7 @@ void draw_ui_bar(WINDOW* win, int win_y, int win_x, const char* filename,
wclrtoeol(win);
}
-void draw_field(WINDOW* win, int term_h, int term_w, int pos_y, int pos_x,
+void tdraw_field(WINDOW* win, int term_h, int term_w, int pos_y, int pos_x,
Glyph const* gbuffer, Mark const* mbuffer, Usz field_h,
Usz field_w, Usz ruler_spacing_y, Usz ruler_spacing_x) {
enum { Bufcount = 4096 };
@@ -485,17 +485,17 @@ int main(int argc, char** argv) {
field_copy(&scratch_field, &field);
needs_remarking = false;
}
- draw_field(stdscr, term_height, term_width, 0, 0, field.buffer,
+ tdraw_field(stdscr, term_height, term_width, 0, 0, field.buffer,
markmap_r.buffer, field.height, field.width, ruler_spacing_y,
ruler_spacing_x);
for (int y = field.height; y < term_height - 1; ++y) {
wmove(stdscr, y, 0);
wclrtoeol(stdscr);
}
- draw_tui_cursor(stdscr, field.buffer, field.height, field.width,
+ tdraw_tui_cursor(stdscr, field.buffer, field.height, field.width,
ruler_spacing_y, ruler_spacing_x, tui_cursor.y,
tui_cursor.x);
- draw_ui_bar(stdscr, term_height - 1, 0, input_file, tick_num);
+ tdraw_hud(stdscr, term_height - 1, 0, input_file, tick_num);
int key;
// ncurses gives us ERR if there was no user input. We'll sleep for 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.