message
stringlengths 6
474
| diff
stringlengths 8
5.22k
|
---|---|
openwsman: wsman-win-client-transport: plug leak in error path
Free allocated memory in error path. | @@ -111,6 +111,7 @@ int wsmc_transport_init(WsManClient *cl, void *arg)
while (InterlockedExchange(&cl->lock_session_handle, 1L));
if (cl->session_handle != NULL) {
cl->lock_session_handle = 0L;
+ u_free(agent);
return 0;
}
if(!cl->proxy_data.proxy){
|
Documentation: Remove link to non-existent directory | @@ -6,7 +6,7 @@ There should be no scripts top-level but only in sub directories.
These files are installed on the target system.
-- [kdb](kdb): for scripts to be used with `kdb <script>`.
+- kdb: for scripts to be used with `kdb <script>`.
- [ffconfig](ffconfig): to configure firefox.
- [completion](completion): for shell completion files.
|
removes unused fprintf arg | @@ -978,7 +978,7 @@ _sist_rest()
"and do not delete your pier!\n"));
u3_lo_bail();
}
- uL(fprintf(uH, "rest: checkpoint is up-to-date\n", ful_c));
+ uL(fprintf(uH, "rest: checkpoint is up-to-date\n"));
}
else {
// Execute the fscking things. This is pretty much certain to crash.
|
vcs: Statically link against libfesvr
libfesvr.so is no longer built after fesvr merged with riscv-isa-sim. | @@ -48,8 +48,7 @@ VCS_CC_OPTS = \
-CC "-I$(VCS_HOME)/include" \
-CC "-I$(RISCV)/include" \
-CC "-std=c++11" \
- -CC "-Wl,-rpath,$(RISCV)/lib" \
- $(RISCV)/lib/libfesvr.so
+ $(RISCV)/lib/libfesvr.a
VCS_NONCC_OPTS = \
+lint=all,noVCDE,noONGS,noUI \
|
fix types and default values in vna.c | @@ -15,8 +15,8 @@ volatile uint16_t *rx_cntr;
volatile float *rx_data;
int sock_thread = -1;
-uint32_t rate_thread = 1;
-uint32_t size_thread = 600;
+uint32_t rate_thread = 5;
+uint32_t size_thread = 6000;
void *read_handler(void *arg);
@@ -31,10 +31,9 @@ int main(int argc, char *argv[])
volatile int16_t *tx_level[2];
volatile uint8_t *rst, *gpio;
struct sockaddr_in addr;
- uint32_t command, rate;
+ uint32_t command, freq, rate, start, stop, size, i;
int32_t value, corr;
- int64_t start, stop, size, freq;
- int i, yes = 1;
+ int yes = 1;
if((fd = open("/dev/mem", O_RDWR)) < 0)
{
|
Remove unused reference from property select | import React, { useEffect, useState } from "react";
import { useSelector } from "react-redux";
-import { Actor, ActorDirection } from "store/features/entities/entitiesTypes";
+import { Actor } from "store/features/entities/entitiesTypes";
import { RootState } from "store/configureStore";
import {
OptGroup,
|
VERSION bump to version 2.0.198 | @@ -61,7 +61,7 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# set version of the project
set(LIBYANG_MAJOR_VERSION 2)
set(LIBYANG_MINOR_VERSION 0)
-set(LIBYANG_MICRO_VERSION 197)
+set(LIBYANG_MICRO_VERSION 198)
set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_MICRO_VERSION})
# set version of the library
set(LIBYANG_MAJOR_SOVERSION 2)
|
gpio: Fixed typo in generic_gpio example
Closes
Updated commit message] | @@ -84,7 +84,7 @@ void app_main(void)
io_conf.pull_up_en = 1;
gpio_config(&io_conf);
- //change gpio intrrupt type for one pin
+ //change gpio interrupt type for one pin
gpio_set_intr_type(GPIO_INPUT_IO_0, GPIO_INTR_ANYEDGE);
//create a queue to handle gpio event from isr
|
Use lookup function in getValueAsString | @@ -225,14 +225,7 @@ kdb_long_double_t elektraGetLongDoubleArrayElement (Elektra * elektra, const cha
static const char * getValueAsString (Elektra * elektra, const char * name, KDBType type)
{
Key * const key = generateLookupKey (elektra, name);
-
- Key * const resultKey = ksLookup (elektra->config, key, 0);
- if (resultKey == NULL)
- {
- printf ("Key not found: %s\n", keyName(key));
- exit (EXIT_FAILURE);
- }
-
+ Key * const resultKey = lookup (elektra, key);
checkType (resultKey, type);
return keyString (resultKey);
|
namemap: handle a NULL return when looking for a non-legacy cipher/MD
Fixes | @@ -409,6 +409,7 @@ static void get_legacy_cipher_names(const OBJ_NAME *on, void *arg)
{
const EVP_CIPHER *cipher = (void *)OBJ_NAME_get(on->name, on->type);
+ if (cipher != NULL)
get_legacy_evp_names(NID_undef, EVP_CIPHER_get_type(cipher), NULL, arg);
}
@@ -416,6 +417,7 @@ static void get_legacy_md_names(const OBJ_NAME *on, void *arg)
{
const EVP_MD *md = (void *)OBJ_NAME_get(on->name, on->type);
+ if (md != NULL)
get_legacy_evp_names(0, EVP_MD_get_type(md), NULL, arg);
}
|
BugID:19041481: modify the help message in Config.in | @@ -4,8 +4,7 @@ menuconfig AOS_COMP_MBEDTLS
help
The mbedtls provides cryptographic algorithms
(AES, RSA, MD5/SHA1/SHA256/SHA512 etc.), X.509 certificate and
- TLS/DTLS protocol support.
- It's ported from open source mbedtls, for details, please refer to
+ TLS/DTLS protocol support. For details, please refer to
https://tls.mbed.org/.
if AOS_COMP_MBEDTLS
@@ -26,6 +25,7 @@ config MBEDTLS_CONFIG_USER_FILE
help
User custom configuration file to add or override our default
configurations.
+ You may place the file into utility/mbedtls/aos/include/.
menuconfig MBEDTLS_CONFIG_CRYPTO
bool "Cryptographic algorithms support"
|
Rust: Use the key error structs instead of enum | use std::error::Error;
use std::fmt;
-use crate::{KeyError, ReadOnly, ReadableKey, StringKey, WriteableKey};
+use crate::{ReadOnly, ReadableKey, StringKey, WriteableKey, KeyNameInvalidError, KeyNameReadOnlyError};
use bitflags::bitflags;
use std::convert::TryInto;
@@ -236,7 +236,7 @@ impl KeySet {
}
/// Lookup a key by name.
- /// Returns a KeyError::InvalidName if the provided string is an invalid name.
+ /// Returns a `KeyNameInvalidError` if the provided string is an invalid name.
/// Otherwise identical to [`lookup`].
///
/// [`lookup`]: #method.lookup
@@ -244,7 +244,7 @@ impl KeySet {
&mut self,
name: &str,
options: LookupOption,
- ) -> Result<Option<StringKey>, KeyError> {
+ ) -> Result<Option<StringKey>, KeyNameInvalidError> {
let key = StringKey::new(name)?;
Ok(self.lookup(key, options))
}
@@ -347,7 +347,7 @@ mod tests {
use crate::KeyBuilder;
#[test]
- fn can_build_simple_keyset() -> Result<(), KeyError> {
+ fn can_build_simple_keyset() -> Result<(), KeyNameInvalidError> {
let mut ks = KeySet::new();
ks.append_key(
KeyBuilder::<StringKey>::new("user/sw/org/app/bool")?
@@ -369,7 +369,7 @@ mod tests {
}
#[test]
- fn can_iterate_simple_keyset() -> Result<(), KeyError> {
+ fn can_iterate_simple_keyset() -> Result<(), KeyNameInvalidError> {
let names = ["user/test/key1", "user/test/key2", "user/test/key3"];
let values = ["value1", "value2", "value3"];
@@ -452,7 +452,7 @@ mod tests {
}
#[test]
- fn can_lookup_by_name_and_duplicate_key() -> Result<(), KeyError> {
+ fn can_lookup_by_name_and_duplicate_key() -> Result<(), KeyNameInvalidError> {
// Make sure that a duplicate of a key that is from a keyset
// can be used after the KeySet has been freed
let key;
|
[patches] - Adjust raja.patch
Re-enable Vtable unit tests. | @@ -11,16 +11,3 @@ index 934bfc68e..027895111 100644
#define RAJA_AUTO_ATOMIC \
RAJA::cuda_atomic {}
#elif defined(__HIP_DEVICE_COMPILE__)
-diff --git a/test/unit/workgroup/CMakeLists.txt b/test/unit/workgroup/CMakeLists.txt
-index d3228a9a5..5d4d84eb0 100644
---- a/test/unit/workgroup/CMakeLists.txt
-+++ b/test/unit/workgroup/CMakeLists.txt
-@@ -72,7 +72,7 @@ if(RAJA_TEST_EXHAUSTIVE OR NOT RAJA_COMPILER MATCHES "RAJA_COMPILER_Intel")
- endif()
-
- set(Vtable_SUBTESTS Single)
--buildunitworkgrouptest(Vtable "${Vtable_SUBTESTS}" "${Vtable_BACKENDS}")
-+#buildunitworkgrouptest(Vtable "${Vtable_SUBTESTS}" "${Vtable_BACKENDS}")
-
- set(WorkStorage_SUBTESTS Constructor Iterator InsertCall Multiple)
- buildunitworkgrouptest(WorkStorage "${WorkStorage_SUBTESTS}" "${WorkStorage_BACKENDS}")
|
push a task to call 6p. | @@ -82,10 +82,10 @@ void msf_updateCellsPassed(open_addr_t* neighbor){
msf_vars.numCellsPassed++;
if (msf_vars.numCellsPassed == MAX_NUMCELLS){
if (msf_vars.numCellsUsed > LIM_NUMCELLSUSED_HIGH){
- msf_trigger6pAdd();
+ scheduler_push_task(msf_trigger6pAdd,TASKPRIO_MSF);
}
if (msf_vars.numCellsUsed < LIM_NUMCELLSUSED_LOW){
- msf_trigger6pDelete();
+ scheduler_push_task(msf_trigger6pDelete,TASKPRIO_MSF);
}
msf_vars.numCellsPassed = 0;
msf_vars.numCellsUsed = 0;
|
libmemif: icmp-responder example buffer management fix
Type: fix | @@ -290,7 +290,6 @@ on_interrupt (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
memif_connection_t *c = &memif_connection;
int err;
uint16_t rx;
- uint16_t fb = 0;
/* receive data from shared memory buffers */
err = memif_rx_burst (c->conn, qid, c->rx_bufs, MAX_MEMIF_BUFS, &rx);
c->rx_buf_num += rx;
@@ -314,10 +313,14 @@ on_interrupt (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
/* mark memif buffers and shared memory buffers as free */
err = memif_refill_queue (c->conn, qid, rx, 0);
- c->rx_buf_num -= fb;
+ /*
+ * In this example we can assert that c->conn points to valid connection
+ * and 'rx <= c->rx_buf_num'.
+ */
+ c->rx_buf_num -= rx;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
+ rx, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
icmpr_tx_burst (c->tx_qid);
@@ -327,9 +330,9 @@ error:
err = memif_refill_queue (c->conn, qid, rx, 0);
if (err != MEMIF_ERR_SUCCESS)
INFO ("memif_buffer_free: %s", memif_strerror (err));
- c->rx_buf_num -= fb;
+ c->rx_buf_num -= rx;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
+ rx, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
return 0;
}
|
Avoid macro redefinition | @@ -180,8 +180,10 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
"Atomic operations are not supported on your platform"
#if defined(__has_feature) && __has_feature(thread_sanitizer)
+#if !defined(THREAD_SANITIZER)
#define THREAD_SANITIZER
#endif
+#endif
// ThreadSanitizer, http://clang.llvm.org/docs/ThreadSanitizer.html.
#if defined(THREAD_SANITIZER)
|
disable demo app custom fee controls | @@ -65,9 +65,9 @@ UITextViewDelegate, UIPickerViewDelegate, UIPickerViewDataSource {
}
target = Address.create (string: self.recvField.text!, network: self.wallet.manager.network)
- gasPriceSegmentedController.isEnabled = isEthCurrency && canUseFeeBasis
- gasLimitSegmentedController.isEnabled = isEthCurrency && canUseFeeBasis
- satPerKBSegmentedController.isEnabled = isBitCurrency && canUseFeeBasis
+ gasPriceSegmentedController.isEnabled = false//isEthCurrency && canUseFeeBasis
+ gasLimitSegmentedController.isEnabled = false//isEthCurrency && canUseFeeBasis
+ satPerKBSegmentedController.isEnabled = false//isBitCurrency && canUseFeeBasis
priorityPicker.dataSource = self
priorityPicker.delegate = self
|
fix timing problem in sdr_transceiver_emb/sp.tcl | @@ -398,6 +398,7 @@ cell xilinx.com:ip:floating_point:7.1 fp_0 {
cell xilinx.com:ip:floating_point:7.1 fp_1 {
OPERATION_TYPE Logarithm
RESULT_PRECISION_TYPE Single
+ C_MULT_USAGE No_Usage
HAS_ARESETN true
} {
S_AXIS_A fp_0/M_AXIS_RESULT
|
nimble/ll: Fix build | @@ -524,7 +524,7 @@ ble_ll_sched_master_new(struct ble_ll_conn_sm *connsm,
}
}
earliest_start += MYNEWT_VAL(BLE_LL_CONN_INIT_MIN_WIN_OFFSET) *
- BLE_LL_SCHED_TICKS_PER_SLOT;
+ BLE_LL_SCHED_USECS_PER_SLOT;
itvl_t = connsm->conn_itvl_ticks;
/* We have to find a place for this schedule */
|
cmake: give instructions what to do in internal inconsistency | @@ -196,6 +196,8 @@ function (restore_variable PLUGIN_NAME VARIABLE)
message (
FATAL_ERROR
"Internally inconsistency, plugin ${PLUGIN_NAME} got different values for variable ${VARIABLE}: '${${VARIABLE}}' != '${VAR}'"
+ "Concatinate variables that contain the value of ${VARIABLE} in a single variable during the DEPENDENCY_PHASE."
+ "Make sure that only a single variable is passed to every argument of add_plugin."
)
endif ()
else ()
|
fixes for the pro build | @@ -613,13 +613,7 @@ set(TIC80LIB_SRC
${TIC80LIB_DIR}/net.c
)
-set(TIC80_OUTPUTS tic80)
-
-if(BUILD_PRO)
- list(APPEND TIC80_OUTPUTS tic80pro)
-endif()
-
-foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
+set(TIC80_OUTPUT tic80)
add_library(${TIC80_OUTPUT}lib STATIC ${TIC80LIB_SRC} ${DEMO_CARTS_OUT})
@@ -633,10 +627,8 @@ foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
target_link_libraries(${TIC80_OUTPUT}lib tic80core zlib libcurl)
-endforeach()
-
if(BUILD_PRO)
- target_compile_definitions(tic80prolib PRIVATE TIC80_PRO)
+ target_compile_definitions(tic80lib PRIVATE TIC80_PRO)
endif()
################################
@@ -644,7 +636,6 @@ endif()
################################
if(BUILD_SDL)
-foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
set(TIC80_SRC ${CMAKE_SOURCE_DIR}/src/ext/file_dialog.c)
@@ -716,7 +707,6 @@ foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
target_link_libraries(${TIC80_OUTPUT} ${GTK_LIBRARIES})
endif()
-endforeach()
endif()
################################
@@ -724,7 +714,6 @@ endif()
################################
if(BUILD_SOKOL)
-foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
set(TIC80_SRC ${CMAKE_SOURCE_DIR}/src/ext/file_dialog.c)
@@ -775,5 +764,4 @@ foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
target_link_libraries(${TIC80_OUTPUT}-sokol ${GTK_LIBRARIES})
endif()
-endforeach()
endif()
|
stm32f103xb : Process USB TX before USB RX
If TX and RX USB events are pending at the same time, process the TX
event first. This prevents MSD problems from packets being processed
in the wrong order. | @@ -648,35 +648,35 @@ void USBD_Handler(void)
num = istr & ISTR_EP_ID;
val = EPxREG(num);
- if (val & EP_CTR_RX) {
- EPxREG(num) = EP_VAL_UNCHANGED(val) & ~EP_CTR_RX;
+ if (val & EP_CTR_TX) {
+ EPxREG(num) = EP_VAL_UNCHANGED(val) & ~EP_CTR_TX;
#ifdef __RTX
if (USBD_RTX_EPTask[num]) {
- isr_evt_set((val & EP_SETUP) ? USBD_EVT_SETUP : USBD_EVT_OUT, USBD_RTX_EPTask[num]);
+ isr_evt_set(USBD_EVT_IN, USBD_RTX_EPTask[num]);
}
#else
if (USBD_P_EP[num]) {
- USBD_P_EP[num]((val & EP_SETUP) ? USBD_EVT_SETUP : USBD_EVT_OUT);
+ USBD_P_EP[num](USBD_EVT_IN);
}
#endif
}
- if (val & EP_CTR_TX) {
- EPxREG(num) = EP_VAL_UNCHANGED(val) & ~EP_CTR_TX;
+ if (val & EP_CTR_RX) {
+ EPxREG(num) = EP_VAL_UNCHANGED(val) & ~EP_CTR_RX;
#ifdef __RTX
if (USBD_RTX_EPTask[num]) {
- isr_evt_set(USBD_EVT_IN, USBD_RTX_EPTask[num]);
+ isr_evt_set((val & EP_SETUP) ? USBD_EVT_SETUP : USBD_EVT_OUT, USBD_RTX_EPTask[num]);
}
#else
if (USBD_P_EP[num]) {
- USBD_P_EP[num](USBD_EVT_IN);
+ USBD_P_EP[num]((val & EP_SETUP) ? USBD_EVT_SETUP : USBD_EVT_OUT);
}
#endif
|
Try to specify shell: it appears that GitHub actions switched default shell from cmd.exe to PowerShell without any prior notice :-/ | @@ -28,5 +28,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_PULL_TOKEN: ${{ secrets.GIT_PULL_TOKEN }}
- run: |
- $GITHUB_WORKSPACE\\build-tests.cmd ${{ matrix.arch }} ${{ matrix.config }}
+ shell: cmd
+ run: build-tests.cmd ${{ matrix.arch }} ${{ matrix.config }}
|
Refactor compile-time assertion checks in c.h
This commit refactors and simplifies the definitions of StaticAssertStmt,
StaticAssertExpr and StaticAssertDecl. By unifying the C and C++
fallback implementations, this reduces the number of different
implementations from four to three.
Author: Michael Paquier
Discussion: | @@ -836,43 +836,37 @@ extern void ExceptionalCondition(const char *conditionName,
* The macro StaticAssertDecl() is suitable for use at file scope (outside of
* any function).
*
+ * On recent C++ compilers, we can use standard static_assert().
+ *
* Otherwise we fall back on a kluge that assumes the compiler will complain
* about a negative width for a struct bit-field. This will not include a
* helpful error message, but it beats not getting an error at all.
*/
-#ifndef __cplusplus
-#ifdef HAVE__STATIC_ASSERT
+#if !defined(__cplusplus) && defined(HAVE__STATIC_ASSERT)
+/* Default C implementation */
#define StaticAssertStmt(condition, errmessage) \
do { _Static_assert(condition, errmessage); } while(0)
#define StaticAssertExpr(condition, errmessage) \
((void) ({ StaticAssertStmt(condition, errmessage); true; }))
#define StaticAssertDecl(condition, errmessage) \
_Static_assert(condition, errmessage)
-#else /* !HAVE__STATIC_ASSERT */
-#define StaticAssertStmt(condition, errmessage) \
- ((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; }))
-#define StaticAssertExpr(condition, errmessage) \
- StaticAssertStmt(condition, errmessage)
-#define StaticAssertDecl(condition, errmessage) \
- extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1])
-#endif /* HAVE__STATIC_ASSERT */
-#else /* C++ */
-#if defined(__cpp_static_assert) && __cpp_static_assert >= 200410
+#elif defined(__cplusplus) && __cpp_static_assert >= 200410
+/* Default C++ implementation */
#define StaticAssertStmt(condition, errmessage) \
static_assert(condition, errmessage)
#define StaticAssertExpr(condition, errmessage) \
({ static_assert(condition, errmessage); })
#define StaticAssertDecl(condition, errmessage) \
static_assert(condition, errmessage)
-#else /* !__cpp_static_assert */
+#else
+/* Fallback implementation for C and C++ */
#define StaticAssertStmt(condition, errmessage) \
- do { struct static_assert_struct { int static_assert_failure : (condition) ? 1 : -1; }; } while(0)
+ ((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; }))
#define StaticAssertExpr(condition, errmessage) \
- ((void) ({ StaticAssertStmt(condition, errmessage); }))
+ StaticAssertStmt(condition, errmessage)
#define StaticAssertDecl(condition, errmessage) \
extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1])
-#endif /* __cpp_static_assert */
-#endif /* C++ */
+#endif
/*
|
host/mesh: Fail provisioning when RFU values are used
When Public Key field is set to RFU value then we should send
Provisioning Fail with Invalid Format error.
This is port of | @@ -119,9 +119,9 @@ static void prov_start(const uint8_t *data)
return;
}
- if (data[1] == PUB_KEY_OOB &&
- !(MYNEWT_VAL(BLE_MESH_PROV_OOB_PUBLIC_KEY) &&
- bt_mesh_prov->public_key_be)) {
+ if (data[1] > PUB_KEY_OOB ||
+ (data[1] == PUB_KEY_OOB &&
+ (!MYNEWT_VAL(BLE_MESH_PROV_OOB_PUBLIC_KEY) || !bt_mesh_prov->public_key_be))) {
BT_ERR("Invalid public key type: 0x%02x", data[1]);
prov_fail(PROV_ERR_NVAL_FMT);
return;
|
Clean up Makefile options | @@ -43,7 +43,8 @@ HEADERS = \
OBJECTS = $(SOURCES:.cpp=.o)
-CPPFLAGS = -std=c++11 -O3 -Wall -W -Wall -Wextra -Wpedantic -Werror -Werror=shadow -msse2 -mfpmath=sse
+CPPFLAGS = -std=c++11 -O3 -msse2 -mfpmath=sse \
+ -Wall -Wextra -Wpedantic -Werror -Werror=shadow
astcenc: $(OBJECTS)
@g++ -o $@ $^ $(CPPFLAGS) -lpthread
|
add compiler-rt to components to build | @@ -58,7 +58,7 @@ if [ "$AOMP_CHECK_GIT_BRANCH" == 1 ] ; then
else
DO_TESTS="-DLLVM_BUILD_TESTS=OFF -DLLVM_INCLUDE_TESTS=OFF -DCLANG_INCLUDE_TESTS=OFF"
fi
-MYCMAKEOPTS="-DLLVM_ENABLE_PROJECTS=clang;lld -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$INSTALL_PROJECT -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_TARGETS_TO_BUILD=$TARGETS_TO_BUILD $COMPILERS -DLLVM_VERSION_SUFFIX=_AOMP_Version_$AOMP_VERSION_STRING -DBUG_REPORT_URL='https://github.com/ROCm-Developer-Tools/aomp' -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF $DO_TESTS -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_INSTALL_RPATH=$AOMP_INSTALL_DIR/lib"
+MYCMAKEOPTS="-DLLVM_ENABLE_PROJECTS=clang;lld;compiler-rt -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$INSTALL_PROJECT -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_TARGETS_TO_BUILD=$TARGETS_TO_BUILD $COMPILERS -DLLVM_VERSION_SUFFIX=_AOMP_Version_$AOMP_VERSION_STRING -DBUG_REPORT_URL='https://github.com/ROCm-Developer-Tools/aomp' -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF $DO_TESTS -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_INSTALL_RPATH=$AOMP_INSTALL_DIR/lib"
if [ "$1" == "-h" ] || [ "$1" == "help" ] || [ "$1" == "-help" ] ; then
help_build_aomp
|
Fix spelling error in name of glms_rotate_x. | CGLM_INLINE mat4s glms_scale_make(vec3s v);
CGLM_INLINE mat4s glms_scale(mat4s m, vec3s v);
CGLM_INLINE mat4s glms_scale_uni(mat4s m, float s);
- CGLM_INLINE mat4s glmx_rotate_x(mat4s m, float angle);
+ CGLM_INLINE mat4s glms_rotate_x(mat4s m, float angle);
CGLM_INLINE mat4s glms_rotate_y(mat4s m, float angle);
CGLM_INLINE mat4s glms_rotate_z(mat4s m, float angle);
CGLM_INLINE mat4s glms_rotate_make(float angle, vec3s axis);
@@ -169,7 +169,7 @@ glms_scale_uni(mat4s m, float s) {
*/
CGLM_INLINE
mat4s
-glmx_rotate_x(mat4s m, float angle) {
+glms_rotate_x(mat4s m, float angle) {
mat4s r;
glm_rotate_x(m.raw, angle, r.raw);
return r;
|
Fix numeric issue with newer compiler version when spatial extents for x- or y-axis are zero. | @@ -1107,7 +1107,7 @@ Digits(double min, double max )
int ipow10 = (int)floor(pow10);
int digitsPastDecimal = -ipow10;
- if (digitsPastDecimal < 0)
+ if (!isfinite(pow10) || digitsPastDecimal < 0)
{
//
// The range is more than 10, but not so big we need scientific
|
bug fix for the view scale update | @@ -5503,6 +5503,9 @@ ViewerWindow::SetInitialView3d()
// Kathleen Bonnell, Tue Mar 3 15:04:57 PST 2009
// CanDoLogViewScaling changed to PermitsLogViewScaling.
//
+// Alister Maguire, Tue Jun 12 16:38:16 PDT 2018
+// Added update of the view scale.
+//
// ****************************************************************************
void
@@ -5591,6 +5594,23 @@ ViewerWindow::UpdateViewCurve(const double *limits)
ResetViewCurve();
}
+ //
+ // Update the plot lists' view scale.
+ //
+ const avtViewCurve &newViewCurve = GetViewCurve();
+ double scale;
+ int size[2];
+ visWindow->GetSize(size[0], size[1]);
+ bool validViewScale = newViewCurve.GetScaleFactor(size, scale);
+ if (!validViewScale)
+ {
+ debug1 << "WARNING: an unsuccessful attempt to retrieve the "
+ << "view scale was made. This may result in the view being "
+ << "skewed..." << endl;
+ }
+
+ plotList->SetViewScale(scale);
+
viewSetInCurve = true;
}
|
display: no need to put ' around target name | @@ -185,7 +185,7 @@ static void display_displayLocked(honggfuzz_t* hfuzz) {
display_put(" Target : [" ESC_BOLD "%d" ESC_RESET "] '" ESC_BOLD "%s" ESC_RESET "'\n",
hfuzz->linux.pid, hfuzz->linux.pidCmd);
} else {
- display_put(" Target : '" ESC_BOLD "%s" ESC_RESET "'\n", hfuzz->cmdline_txt);
+ display_put(" Target : " ESC_BOLD "%s" ESC_RESET "\n", hfuzz->cmdline_txt);
}
static long num_cpu = 0;
|
extmod/moduhashlib: Add md5 implementation using mbedtls. | #endif
#if MICROPY_SSL_MBEDTLS
+#include "mbedtls/md5.h"
#include "mbedtls/sha1.h"
#endif
@@ -268,6 +269,44 @@ STATIC mp_obj_t uhashlib_md5_digest(mp_obj_t self_in) {
}
#endif // MICROPY_SSL_AXTLS
+#if MICROPY_SSL_MBEDTLS
+
+#if MBEDTLS_VERSION_NUMBER < 0x02070000
+#define mbedtls_md5_starts_ret mbedtls_md5_starts
+#define mbedtls_md5_update_ret mbedtls_md5_update
+#define mbedtls_md5_finish_ret mbedtls_md5_finish
+#endif
+
+STATIC mp_obj_t uhashlib_md5_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
+ mp_arg_check_num(n_args, n_kw, 0, 1, false);
+ mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(mbedtls_md5_context));
+ o->base.type = type;
+ mbedtls_md5_init((mbedtls_md5_context*)o->state);
+ mbedtls_md5_starts_ret((mbedtls_md5_context*)o->state);
+ if (n_args == 1) {
+ uhashlib_md5_update(MP_OBJ_FROM_PTR(o), args[0]);
+ }
+ return MP_OBJ_FROM_PTR(o);
+}
+
+STATIC mp_obj_t uhashlib_md5_update(mp_obj_t self_in, mp_obj_t arg) {
+ mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
+ mp_buffer_info_t bufinfo;
+ mp_get_buffer_raise(arg, &bufinfo, MP_BUFFER_READ);
+ mbedtls_md5_update_ret((mbedtls_md5_context*)self->state, bufinfo.buf, bufinfo.len);
+ return mp_const_none;
+}
+
+STATIC mp_obj_t uhashlib_md5_digest(mp_obj_t self_in) {
+ mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
+ vstr_t vstr;
+ vstr_init_len(&vstr, 16);
+ mbedtls_md5_finish_ret((mbedtls_md5_context*)self->state, (byte*)vstr.buf);
+ mbedtls_md5_free((mbedtls_md5_context*)self->state);
+ return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
+}
+#endif // MICROPY_SSL_MBEDTLS
+
STATIC MP_DEFINE_CONST_FUN_OBJ_2(uhashlib_md5_update_obj, uhashlib_md5_update);
STATIC MP_DEFINE_CONST_FUN_OBJ_1(uhashlib_md5_digest_obj, uhashlib_md5_digest);
|
mem: do not permit zero-sized allocations (FLU-01-002)
note: security audit report by Cure53/CNCF | @@ -55,6 +55,10 @@ static inline ALLOCSZ_ATTR(1)
void *flb_malloc(const size_t size) {
void *aux;
+ if (size == 0) {
+ return NULL;
+ }
+
aux = malloc(size);
if (flb_unlikely(!aux && size)) {
return NULL;
@@ -67,6 +71,10 @@ static inline ALLOCSZ_ATTR(1)
void *flb_calloc(size_t n, const size_t size) {
void *buf;
+ if (size == 0) {
+ return NULL;
+ }
+
buf = calloc(n, size);
if (flb_unlikely(!buf)) {
return NULL;
@@ -80,6 +88,13 @@ void *flb_realloc(void *ptr, const size_t size)
{
void *aux;
+ if (size == 0) {
+ if (ptr) {
+ free(ptr);
+ }
+ return NULL;
+ }
+
aux = realloc(ptr, size);
if (flb_unlikely(!aux && size)) {
return NULL;
|
Update README instructions for using Emscripten
Point to a newer URL
Use emcmake and emmake (which will set the CMake project file) | @@ -10,26 +10,18 @@ This file describes the compilation of libwebp into a JavaScript decoder
using Emscripten and CMake.
- install the Emscripten SDK following the procedure described at:
- https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html
+ https://emscripten.org/docs/getting_started/downloads.html#installation-instructions-using-the-emsdk-recommended
After installation, you should have some global variable positioned to the
- location of the SDK. In particular, $EMSCRIPTEN should point to the
+ location of the SDK. In particular, $EMSDK should point to the
top-level directory containing Emscripten tools.
- - make sure the file $EMSCRIPTEN/cmake/Modules/Platform/Emscripten.cmake is
- accessible. This is the toolchain file used by CMake to invoke Emscripten.
- If $EMSCRIPTEN is unset search for Emscripten.cmake under $EMSDK and set
- $EMSCRIPTEN accordingly, for example:
- unix-like environments: export EMSCRIPTEN=$EMSDK/upstream/emscripten
- windows: set EMSCRIPTEN=%EMSDK%\upstream\emscripten
-
- configure the project 'WEBP_JS' with CMake using:
cd webp_js && \
- cmake -DWEBP_BUILD_WEBP_JS=ON \
- -DCMAKE_TOOLCHAIN_FILE=$EMSCRIPTEN/cmake/Modules/Platform/Emscripten.cmake \
+ emcmake cmake -DWEBP_BUILD_WEBP_JS=ON \
../
- - compile webp.js using 'make'.
+ - compile webp.js using 'emmake make'.
- that's it! Upon completion, you should have the webp.js and
webp.wasm files generated.
|
py/objstringio: Guard bytesio_stream_p struct w/ MICROPY_PY_IO_BYTESIO.
It's static and can lead to a compilation warning/error when
MICROPY_PY_IO_BYTESIO is disabled. | @@ -244,12 +244,6 @@ STATIC const mp_stream_p_t stringio_stream_p = {
.is_text = true,
};
-STATIC const mp_stream_p_t bytesio_stream_p = {
- .read = stringio_read,
- .write = stringio_write,
- .ioctl = stringio_ioctl,
-};
-
const mp_obj_type_t mp_type_stringio = {
{ &mp_type_type },
.name = MP_QSTR_StringIO,
@@ -262,6 +256,12 @@ const mp_obj_type_t mp_type_stringio = {
};
#if MICROPY_PY_IO_BYTESIO
+STATIC const mp_stream_p_t bytesio_stream_p = {
+ .read = stringio_read,
+ .write = stringio_write,
+ .ioctl = stringio_ioctl,
+};
+
const mp_obj_type_t mp_type_bytesio = {
{ &mp_type_type },
.name = MP_QSTR_BytesIO,
|
install: create SRPD_PLUGINS_PATH directory
Sysrepo should install the directories it needs, especially when they
are by default in /usr which can be read-only.
Also the directory should be owned by sysrepo packages. | @@ -390,6 +390,7 @@ install(TARGETS sysrepoctl sysrepocfg sysrepo-plugind DESTINATION ${CMAKE_INSTAL
install(FILES ${PROJECT_SOURCE_DIR}/src/executables/sysrepoctl.1 ${PROJECT_SOURCE_DIR}/src/executables/sysrepocfg.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
install(FILES ${PROJECT_SOURCE_DIR}/src/executables/sysrepo-plugind.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
+install(DIRECTORY DESTINATION ${SRPD_PLUGINS_PATH})
if(SR_HAVE_SYSTEMD)
install(FILES ${PROJECT_BINARY_DIR}/sysrepo-plugind.service DESTINATION ${SYSTEMD_UNIT_DIR})
endif()
|
at_client: Increase stack size
Got stack overflow in test automation for Espressif so we need a little
more stack. | @@ -339,7 +339,7 @@ extern "C" {
* which seems to require around twice the stack of NRF52
* or STM32F4.
*/
-# define U_AT_CLIENT_CALLBACK_TASK_STACK_SIZE_BYTES 1536
+# define U_AT_CLIENT_CALLBACK_TASK_STACK_SIZE_BYTES 2048
#endif
#ifndef U_AT_CLIENT_CALLBACK_TASK_PRIORITY
|
Remove references from bootstrap-t4p4s.sh | @@ -17,10 +17,6 @@ sudo apt-get update && sudo apt-get -y install g++ git automake libtool libgc-de
WAITPROC_APTGET="$!"
[ $PARALLEL_INSTALL -ne 0 ] || wait "$WAITPROC_APTGET"
-git clone --recursive https://github.com/p4lang/p4-hlir &
-WAITPROC_P4HLIR="$!"
-[ $PARALLEL_INSTALL -ne 0 ] || wait "$WAITPROC_P4HLIR"
-
wget http://fast.dpdk.org/rel/dpdk-$DPDK_FILEVSN.tar.xz && tar xJf dpdk-$DPDK_FILEVSN.tar.xz && rm dpdk-$DPDK_FILEVSN.tar.xz &
WAITPROC_DPDK="$!"
[ $PARALLEL_INSTALL -ne 0 ] || wait "$WAITPROC_DPDK"
@@ -42,12 +38,6 @@ WAITPROC_T4P4S="$!"
[ $PARALLEL_INSTALL -ne 1 ] || wait "$WAITPROC_APTGET"
-# Setup p4-hlir
-[ $PARALLEL_INSTALL -ne 1 ] || wait "$WAITPROC_P4HLIR"
-
-cd p4-hlir
-sudo python setup.py install
-cd ..
# Setup DPDK
|
Pend one alert in case wrong EXT_EARLY_DATA length | @@ -2542,9 +2542,18 @@ static int ssl_tls13_parse_new_session_ticket_exts( mbedtls_ssl_context *ssl,
{
case MBEDTLS_TLS_EXT_EARLY_DATA:
MBEDTLS_SSL_DEBUG_MSG( 4, ( "early_data extension received" ) );
- if( extension_data_len == 4 && ssl->session != NULL )
+ if( extension_data_len != 4 )
+ {
+ MBEDTLS_SSL_PEND_FATAL_ALERT(
+ MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR,
+ MBEDTLS_ERR_SSL_DECODE_ERROR );
+ return( MBEDTLS_ERR_SSL_DECODE_ERROR );
+ }
+ if( ssl->session != NULL )
+ {
ssl->session->ticket_flags |=
MBEDTLS_SSL_TICKET_ALLOW_EARLY_DATA;
+ }
break;
default:
|
zephyr: add GPIO enum GPIO_USB_CX_DISHCARGE
It's missing so add the enum.
TEST=zmake testall
BRANCH=none
Tested-by: Eric Yilun Lin | @@ -86,6 +86,7 @@ properties:
- GPIO_USB_C0_BC12_INT_ODL
- GPIO_USB_C0_C2_TCPC_INT_ODL
- GPIO_USB_C0_C2_TCPC_RST_ODL
+ - GPIO_USB_C0_DISCHARGE
- GPIO_USB_C0_DP_HPD
- GPIO_USB_C0_OC_ODL
- GPIO_USB_C0_PD_INT_ODL
@@ -94,6 +95,7 @@ properties:
- GPIO_USB_C0_TCPC_INT_ODL
- GPIO_USB_C0_TCPC_RST_L
- GPIO_USB_C1_BC12_INT_ODL
+ - GPIO_USB_C1_DISCHARGE
- GPIO_USB_C1_DP_HPD
- GPIO_USB_C0_FRS_EN
- GPIO_USB_C1_FRS_EN
@@ -108,6 +110,7 @@ properties:
- GPIO_USB_C1_TCPC_INT_ODL
- GPIO_USB_C1_TCPC_RST_L
- GPIO_USB_C2_BC12_INT_ODL
+ - GPIO_USB_C2_DISCHARGE
- GPIO_USB_C2_PPC_INT_ODL
- GPIO_USB1_CTL1
- GPIO_USB1_CTL2
|
refactor: replace every snprintf used for creating JSON with json_inject | @@ -92,11 +92,18 @@ ws_send_payload(dati *ws, char payload[])
static void
ws_send_resume(dati *ws)
{
- char fmt_payload[] = \
- "{\"op\":6,\"d\":{\"token\":\"%s\",\"session_id\":\"%s\",\"seq\":%d}}";
char payload[MAX_PAYLOAD_LEN];
- int ret = snprintf(payload, MAX_PAYLOAD_LEN, fmt_payload,
- ws->p_client->settings.token, ws->session_id, ws->payload.seq_number);
+ int ret = json_inject(payload, sizeof(payload),
+ "(op):6" // RESUME OPCODE
+ "(d):{"
+ "(token):s"
+ "(session_id):s"
+ "(seq):d"
+ "}",
+ ws->p_client->settings.token,
+ ws->session_id,
+ &ws->payload.seq_number);
+
ASSERT_S(ret < (int)sizeof(payload), "Out of bounds write attempt");
D_NOTOP_PRINT("RESUME PAYLOAD:\n\t%s", payload);
@@ -116,7 +123,7 @@ ws_send_identify(dati *ws)
ws->session.concurrent = 0;
}
- // contain token (sensitive data), enable _ORKA_DEBUG_STRICT
+ // contain token (sensitive data), enable _ORKA_DEBUG_STRICT to print it
DS_PRINT("IDENTIFY PAYLOAD:\n\t%s", ws->identify);
ws_send_payload(ws, ws->identify);
@@ -539,7 +546,8 @@ static void
ws_send_heartbeat(dati *ws)
{
char payload[64];
- int ret = snprintf(payload, sizeof(payload), "{\"op\":1,\"d\":%d}", ws->payload.seq_number);
+ int ret = json_inject(payload, sizeof(payload),
+ "(op):1, (d):d", &ws->payload.seq_number);
ASSERT_S(ret < (int)sizeof(payload), "Out of bounds write attempt");
D_PRINT("HEARTBEAT_PAYLOAD:\n\t\t%s", payload);
|
Ignore invalid socket ID when updating properties
This update sets the socket ID only when the call to sysfs succeeds. | @@ -332,12 +332,12 @@ fpgaUpdateProperties(fpga_token token, fpga_properties prop)
_iprop.function = (uint8_t) f;
SET_FIELD_VALID(&_iprop, FPGA_PROPERTY_FUNCTION);
+ // only set socket id if we have it on sysfs
result = sysfs_get_socket_id(device_id, &_iprop.socket_id);
- if (result)
- return result;
-
+ if (0 == result)
SET_FIELD_VALID(&_iprop, FPGA_PROPERTY_SOCKETID);
+ // FIXME
// _iprop.device_id = ?? ;
// SET_FIELD_VALID(&_iprop, FPGA_PROPERTY_DEVICEID);
|
Disallow change EVP_CIPHER properties once set | @@ -54,18 +54,27 @@ void EVP_CIPHER_meth_free(EVP_CIPHER *cipher)
int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len)
{
+ if (cipher->iv_len != 0)
+ return 0;
+
cipher->iv_len = iv_len;
return 1;
}
int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags)
{
+ if (cipher->flags != 0)
+ return 0;
+
cipher->flags = flags;
return 1;
}
int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size)
{
+ if (cipher->ctx_size != 0)
+ return 0;
+
cipher->ctx_size = ctx_size;
return 1;
}
@@ -76,6 +85,9 @@ int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher,
const unsigned char *iv,
int enc))
{
+ if (cipher->init != NULL)
+ return 0;
+
cipher->init = init;
return 1;
}
@@ -86,6 +98,9 @@ int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher,
const unsigned char *in,
size_t inl))
{
+ if (cipher->do_cipher != NULL)
+ return 0;
+
cipher->do_cipher = do_cipher;
return 1;
}
@@ -93,6 +108,9 @@ int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher,
int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher,
int (*cleanup) (EVP_CIPHER_CTX *))
{
+ if (cipher->cleanup != NULL)
+ return 0;
+
cipher->cleanup = cleanup;
return 1;
}
@@ -101,6 +119,9 @@ int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher,
int (*set_asn1_parameters) (EVP_CIPHER_CTX *,
ASN1_TYPE *))
{
+ if (cipher->set_asn1_parameters != NULL)
+ return 0;
+
cipher->set_asn1_parameters = set_asn1_parameters;
return 1;
}
@@ -109,6 +130,9 @@ int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher,
int (*get_asn1_parameters) (EVP_CIPHER_CTX *,
ASN1_TYPE *))
{
+ if (cipher->get_asn1_parameters != NULL)
+ return 0;
+
cipher->get_asn1_parameters = get_asn1_parameters;
return 1;
}
@@ -117,6 +141,9 @@ int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher,
int (*ctrl) (EVP_CIPHER_CTX *, int type,
int arg, void *ptr))
{
+ if (cipher->ctrl != NULL)
+ return 0;
+
cipher->ctrl = ctrl;
return 1;
}
|
centos: revert java path | @@ -107,7 +107,7 @@ RUN useradd \
RUN cd /tmp && wget https://services.gradle.org/distributions/gradle-7.4-bin.zip && unzip gradle-7.4-bin.zip && rm gradle-7.4-bin.zip && mv gradle-7.4 /opt/gradle
RUN alternatives --auto java && alternatives --auto javac
ENV PATH="${PATH}:/opt/gradle/bin" \
- JAVA_HOME="/usr/lib/jvm/java"
+ JAVA_HOME="/etc/alternatives/jre"
USER ${JENKINS_USERID}
|
invalidation_watch_file isn't needed as this job is now performed by the plugin invalidation factory | @@ -273,24 +273,6 @@ typedef struct clap_preset_discovery_indexer {
bool(CLAP_ABI *declare_soundpack)(const struct clap_preset_discovery_indexer *indexer,
const clap_preset_discovery_soundpack_t *soundpack);
- // Sets the path to a watch file.
- // Whenever the given file is "touched" (its modification time is updated),
- // then the indexer shall invalidate all the data.
- //
- // This file shouldn't be touched when a new preset is added, the host shall detect the new
- // preset using the OS features (file system monitoring).
- //
- // The invalidation file is useful if:
- // - the set of filetypes changes
- // - the set of locations changes
- // - the set of sound packs changes
- // - the metadata extraction code changes is located outside of the DSO containing this
- // preset provider
- //
- // Returns false, if the path isn't valid or if the watch file isn't supported by the indexer.
- bool(CLAP_ABI *set_invalidation_watch_file)(const struct clap_preset_discovery_indexer *indexer,
- const char *path);
-
// Query an extension.
// The returned pointer is owned by the indexer.
// It is forbidden to call it before provider->init().
|
6LoWPAN: Put parentheses around macro parameters | #define LOG_MODULE "6LoWPAN"
#define LOG_LEVEL LOG_LEVEL_6LOWPAN
-#define GET16(ptr,index) (((uint16_t)((ptr)[index] << 8)) | ((ptr)[(index) + 1]))
+#define GET16(ptr,index) (((uint16_t)((ptr)[(index)] << 8)) | ((ptr)[(index) + 1]))
#define SET16(ptr,index,value) do { \
- (ptr)[index] = ((value) >> 8) & 0xff; \
- (ptr)[index + 1] = (value) & 0xff; \
+ (ptr)[(index)] = ((value) >> 8) & 0xff; \
+ (ptr)[(index) + 1] = (value) & 0xff; \
} while(0)
/** \name Pointers in the packetbuf buffer
|
[core] simplify parsing hdr key whitespace then : | @@ -580,7 +580,7 @@ static int parse_single_header(server *srv, connection *con, parse_header_state
int http_request_parse(server *srv, connection *con) {
char *uri = NULL, *proto = NULL, *method = NULL;
- int is_key = 1, key_len = 0, is_ws_after_key = 0;
+ int is_key = 1, key_len = 0;
char *value = NULL;
int line = 0;
@@ -890,25 +890,32 @@ int http_request_parse(server *srv, connection *con) {
char *cur = con->parse_request->ptr + i;
if (is_key) {
- size_t j;
- int got_colon = 0;
-
/**
* 1*<any CHAR except CTLs or separators>
* CTLs == 0-31 + 127, CHAR = 7-bit ascii (0..127)
*
*/
switch(*cur) {
+ case ' ':
+ case '\t':
+ /* skip every thing up to the : */
+ do { ++cur; } while (*cur == ' ' || *cur == '\t');
+ if (*cur != ':') {
+ if (srv->srvconf.log_request_header_on_error) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "WS character in key -> 400");
+ log_error_write(srv, __FILE__, __LINE__, "Sb",
+ "request-header:\n",
+ con->request.request);
+ }
+
+ goto failure;
+ }
+ /* fall through */
case ':':
is_key = 0;
-
- value = cur + 1;
-
- if (is_ws_after_key == 0) {
key_len = i - first;
- }
- is_ws_after_key = 0;
-
+ value = cur + 1;
+ i = cur - con->parse_request->ptr;
break;
case '(':
case ')':
@@ -935,40 +942,6 @@ int http_request_parse(server *srv, connection *con) {
con->request.request);
}
goto failure;
- case ' ':
- case '\t':
- key_len = i - first;
-
- /* skip every thing up to the : */
- for (j = 1; !got_colon; j++) {
- switch(con->parse_request->ptr[j + i]) {
- case ' ':
- case '\t':
- /* skip WS */
- continue;
- case ':':
- /* ok, done; handle the colon the usual way */
-
- i += j - 1;
- got_colon = 1;
- is_ws_after_key = 1; /* we already know the key length */
-
- break;
- default:
- /* error */
-
- if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "WS character in key -> 400");
- log_error_write(srv, __FILE__, __LINE__, "Sb",
- "request-header:\n",
- con->request.request);
- }
-
- goto failure;
- }
- }
-
- break;
case '\r':
if (con->parse_request->ptr[i+1] == '\n' && i == first) {
/* End of Header */
|
Destroy ecdh_psa_privkey on failure | @@ -3181,6 +3181,8 @@ curve_matching_done:
{
ret = psa_ssl_status_to_mbedtls( status );
MBEDTLS_SSL_DEBUG_RET( 1, "psa_export_public_key", ret );
+ (void) psa_destroy_key( handshake->ecdh_psa_privkey );
+ handshake->ecdh_psa_privkey = MBEDTLS_SVC_KEY_ID_INIT;
return( ret );
}
@@ -3919,6 +3921,8 @@ static int ssl_parse_client_key_exchange( mbedtls_ssl_context *ssl )
{
ret = psa_ssl_status_to_mbedtls( status );
MBEDTLS_SSL_DEBUG_RET( 1, "psa_raw_key_agreement", ret );
+ (void) psa_destroy_key( handshake->ecdh_psa_privkey );
+ handshake->ecdh_psa_privkey = MBEDTLS_SVC_KEY_ID_INIT;
return( ret );
}
|
inertial_updates: update raw IMU descriptions for clarity | @@ -21,7 +21,8 @@ definitions:
short_desc: Raw IMU data
desc: |
Raw data from the Inertial Measurement Unit, containing accelerometer and
- gyroscope readings.
+ gyroscope readings. The sense of the measurements are to be aligned with
+ the indications on the device itself.
fields:
- tow:
type: u32
@@ -36,22 +37,22 @@ definitions:
Milliseconds since start of GPS week, fractional part
- acc_x:
type: s16
- desc: Acceleration in the body frame X axis
+ desc: Acceleration in the IMU frame X axis
- acc_y:
type: s16
- desc: Acceleration in the body frame Y axis
+ desc: Acceleration in the IMU frame Y axis
- acc_z:
type: s16
- desc: Acceleration in the body frame Z axis
+ desc: Acceleration in the IMU frame Z axis
- gyr_x:
type: s16
- desc: Angular rate around the body frame X axis
+ desc: Angular rate around IMU frame X axis
- gyr_y:
type: s16
- desc: Angular rate around the body frame Y axis
+ desc: Angular rate around IMU frame Y axis
- gyr_z:
type: s16
- desc: Angular rate around the body frame Z axis
+ desc: Angular rate around IMU frame Z axis
- MSG_IMU_AUX:
id: 0x0901
|
libcupsfilters: Fixed typo in PPD-generator's output-bin option support. | @@ -1211,7 +1211,7 @@ ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
else
strlcpy(ppdname, "Unknown", sizeof(ppdname));
- if ((attr = ippFindAttribute(response, "outout-bin-supported", IPP_TAG_ZERO)) != NULL && (count = ippGetCount(attr)) > 1)
+ if ((attr = ippFindAttribute(response, "output-bin-supported", IPP_TAG_ZERO)) != NULL && (count = ippGetCount(attr)) > 1)
{
static const char * const output_bins[][2] =
{ /* "output-bin" strings */
|
NAT: interface fib fix | @@ -2178,6 +2178,7 @@ snat_update_outside_fib (u32 sw_if_index, u32 new_fib_index,
nat_outside_fib_t *outside_fib;
snat_interface_t *i;
u8 is_add = 1;
+ u8 match = 0;
if (new_fib_index == old_fib_index)
return;
@@ -2185,14 +2186,21 @@ snat_update_outside_fib (u32 sw_if_index, u32 new_fib_index,
if (!vec_len (sm->outside_fibs))
return;
- pool_foreach (i, sm->interfaces, (
- {
+ /* *INDENT-OFF* */
+ pool_foreach (i, sm->interfaces,
+ ({
if (i->sw_if_index == sw_if_index)
{
if (!(nat_interface_is_outside (i)))
- return;}
+ return;
+ match = 1;
}
- ));
+ }));
+ /* *INDENT-ON* */
+
+ if (!match)
+ return;
+
vec_foreach (outside_fib, sm->outside_fibs)
{
if (outside_fib->fib_index == old_fib_index)
|
Tools: Set key 'file' for grib_get | @@ -204,6 +204,11 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
}
}
+ if (options->current_infile && options->current_infile->name) {
+ size = strlen(options->current_infile->name);
+ grib_set_string(h, "file", options->current_infile->name, &size);
+ }
+
return 0;
}
|
chip/npcx/rom_chip.h: Format with clang-format
BRANCH=none
TEST=none | @@ -45,8 +45,8 @@ enum API_RETURN_STATUS_T {
#define ADDR_DOWNLOAD_FROM_FLASH (*(volatile uint32_t *)0x40)
#define download_from_flash(src_offset, dest_addr, size, sign, exe_addr, \
status) \
- (((download_from_flash_ptr) ADDR_DOWNLOAD_FROM_FLASH) \
- (src_offset, dest_addr, size, sign, exe_addr, status))
+ (((download_from_flash_ptr)ADDR_DOWNLOAD_FROM_FLASH)( \
+ src_offset, dest_addr, size, sign, exe_addr, status))
/******************************************************************************/
/*
@@ -61,6 +61,4 @@ typedef void (*download_from_flash_ptr) (
enum API_RETURN_STATUS_T *status /* Status fo download */
);
-
-
#endif /* __CROS_EC_ROM_CHIP_H_ */
|
dockerfile: remove cmd used for debugging | @@ -103,6 +103,3 @@ USER ${JENKINS_USERID}
# Set git config
RUN git config --global user.email 'Jenkins <[email protected]>' \
&& git config --global user.name 'Jenkins'
-
-# TODO: remove next line
-CMD tail -f /dev/null
|
display: use ATOMIC_GET when accessing hfuzz->feedback.feedbackMap | @@ -251,7 +251,7 @@ static void display_displayLocked(honggfuzz_t* hfuzz) {
uint64_t softCntCmp = ATOMIC_GET(hfuzz->linux.hwCnts.softCntCmp);
display_put(" edge: " ESC_BOLD "%" _HF_NONMON_SEP PRIu64 ESC_RESET "/" ESC_BOLD
"%" _HF_NONMON_SEP PRIu64 ESC_RESET,
- softCntEdge, hfuzz->feedback.feedbackMap->guardNb);
+ softCntEdge, ATOMIC_GET(hfuzz->feedback.feedbackMap->guardNb));
display_put(" pc: " ESC_BOLD "%" _HF_NONMON_SEP PRIu64 ESC_RESET, softCntPc);
display_put(" cmp: " ESC_BOLD "%" _HF_NONMON_SEP PRIu64 ESC_RESET, softCntCmp);
}
|
f16c: use __ARM_FEATURE_FP16_VECTOR_ARITHMETIC to detect Arm support | @@ -59,7 +59,7 @@ simde_mm_cvtps_ph(simde__m128 a, const int sae) {
HEDLEY_STATIC_CAST(void, sae);
- #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && (__ARM_FP & 2)
+ #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
r_.neon_f16 = vcombine_f16(vcvt_f16_f32(a_.neon_f32), vdup_n_f16(SIMDE_FLOAT16_C(0.0)));
#else
SIMDE_VECTORIZE
@@ -84,7 +84,7 @@ simde_mm_cvtph_ps(simde__m128i a) {
simde__m128i_private a_ = simde__m128i_to_private(a);
simde__m128_private r_;
- #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && (__ARM_FP & 2)
+ #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
r_.neon_f32 = vcvt_f32_f16(vget_low_f16(a_.neon_f16));
#else
SIMDE_VECTORIZE
|
add missing external function | @@ -81,6 +81,8 @@ register_functions(struct ubpf_vm *vm) {
ubpf_register(vm, 0x2a, "my_htons", my_htons);
ubpf_register(vm, 0x2b, "my_ntohs", my_ntohs);
+ ubpf_register(vm, 0x2c, "strncmp", strncmp);
+
// logging func
ubpf_register(vm, 0x2d, "picoquic_has_booked_plugin_frames", picoquic_has_booked_plugin_frames);
|
[io] update cf info | @@ -564,11 +564,12 @@ class MechanicsHdf5(object):
self._cf_data = data(self._data, 'cf', 26,
use_compression=self._use_compression)
if self._mode == 'w':
- self._cf_data.attrs['info'] = 'time, mu, contact point A ,'
- self._cf_data.attrs['info'] += 'contact point B, contact normal, '
- self._cf_data.attrs['info'] += 'relative gap relative velocity,'
- self._cf_data.attrs['info'] += 'reaction impulse, interaction id,'
- self._cf_data.attrs['info'] += 'ds 1 number, ds 2 number '
+ self._cf_data.attrs['info'] = 'time [0], mu [1], contact point A [2:4] ,'
+ self._cf_data.attrs['info'] += 'contact point B [5:7], contact normal [8:10], '
+ self._cf_data.attrs['info'] += 'reaction impulse (global frame) [11:13],'
+ self._cf_data.attrs['info'] += 'relative gap [14:16], reaction velocity [17:19],'
+ self._cf_data.attrs['info'] += 'reaction impulse (local frame) [20:22], interaction id [23],'
+ self._cf_data.attrs['info'] += 'ds 1 number [24], ds 2 number [25]'
if self._should_output_domains or 'domain' in self._data:
self._domain_data = data(self._data, 'domain', 3,
|
Getting some system info | #import "api_generator/iphone/CMethodResult.h"
#import "Rhodes.h"
#import "sys/utsname.h"
-#import "mach/mach.h"
#include "common/RhoConf.h"
#include "logging/RhoLog.h"
@@ -388,21 +387,23 @@ namespace rho {
// retVal.put(key,value);
+ NSString *value = [[UIDevice currentDevice] localizedModel];
+ retVal.put("Device Localized Model", std::string([value UTF8String]));
+
struct utsname systemInfo;
uname(&systemInfo);
- retVal["Device Model"] = systemInfo.machine;
-
- struct mach_task_basic_info info;
- mach_msg_type_number_t size = MACH_TASK_BASIC_INFO_COUNT;
- kern_return_t kerr = task_info(mach_task_self(),
- MACH_TASK_BASIC_INFO,
- (task_info_t)&info,
- &size);
- if( kerr == KERN_SUCCESS ) {
- retVal["Memory in use (in bytes):"] = info.resident_size;
- } else {
- retVal["Memory in use (in bytes):"] = mach_error_string(kerr);
- }
+ retVal.put("Device", systemInfo.machine);
+
+ value = [[UIDevice currentDevice] model];
+ retVal.put("Device Model", std::string([value UTF8String]));
+
+ value = [[UIDevice currentDevice] name];
+ retVal.put("Device Name", std::string([value UTF8String]));
+
+ NSString *osName = [[UIDevice currentDevice] systemName];
+ NSString *osVersion = [[UIDevice currentDevice] systemVersion];
+ value = [@[osName, @", v.", osVersion] componentsJoinedByString:@""];
+ retVal.put("Device OS", std::string([value UTF8String]));
oResult.set(retVal);
}
|
footnote degub arg | #define TEST_DISTANCE 0.300 // meter
#define TEST_RADIAN 3.14 // 180 degree
-#define DEBUG
+// #define DEBUG
#define DEBUG_SERIAL SerialBT2
// Callback function prototypes
|
Fix LMS not checking RNG function return value | @@ -545,9 +545,13 @@ int mbedtls_lms_generate_private_key( mbedtls_lms_private_t *ctx,
ctx->params.type = type;
ctx->params.otstype = otstype;
- f_rng( p_rng,
+ ret = f_rng( p_rng,
ctx->params.I_key_identifier,
MBEDTLS_LMOTS_I_KEY_ID_LEN );
+ if( ret != 0 )
+ {
+ goto exit;
+ }
ctx->ots_private_keys = mbedtls_calloc( ( size_t )MERKLE_TREE_LEAF_NODE_AM(ctx->params.type),
sizeof( *ctx->ots_private_keys ) );
|
bitwise tests are completed | @@ -277,6 +277,7 @@ else:
#--- Complete ---
"i32", "i64", "stack", "fac",
"f32_cmp", "f64_cmp",
+ "f32_bitwise", "f64_bitwise",
"f32", "f64",
"float_misc",
#--- In progress ---
|
Mention missing breaking change in ThemisPP
We mention this PR as a minor refactoring in Themis Core, but in fact it
includes a breaking change in ThemisPP as well. This change affects all
users of Secure Session and breaks compilation. Let's mention it in the
changelog to simplify migration. | @@ -185,6 +185,22 @@ _Code:_
[#576](https://github.com/cossacklabs/themis/pull/576)).
- Updated test suite to test C++14 and C++17 (in addition to C++11 and C++03) ([#572](https://github.com/cossacklabs/themis/pull/572)).
+ - **Breaking changes**
+
+ - `get_pub_key_by_id()` method of `secure_session_callback_interface_t`
+ now has to return non-const vector
+ ([#540](https://github.com/cossacklabs/themis/pull/540)).
+
+ Change your implementation like this:
+
+ ```diff
+ -const std::vector<uint8_t> get_pub_key_by_id(const std::vector<uint8_t>& id) override
+ +std::vector<uint8_t> get_pub_key_by_id(const std::vector<uint8_t>& id) override
+ {
+ // ...
+ }
+ ```
+
- **Go**
- New function `keys.NewSymmetricKey()` can be used to generate symmetric keys for Secure Cell ([#561](https://github.com/cossacklabs/themis/pull/561)).
|
Add 'ya tool tvmknife'
Add 'ya tool tvmknife'
([arc::pullid] 3cfad4cd-aea83eb9-297940c3-71f16ecf) | "godoc": { "description": "Run godoc tool" },
"gofmt": { "description": "Run gofmt tool" },
"yo": { "description": "Tool for managing vendor/ directory" },
+ "tvmknife": { "description": "Tool for debugging and testing with TVM tickets" },
"golangci-lint": { "description": "Linters Runner for Go" }
},
"toolchain": {
{"host": {"os": "DARWIN"}, "default": true}
]
},
+ "tvmknife": {
+ "tools": {
+ "tvmknife": { "bottle": "tvmknife", "executable": "tvmknife" }
+ },
+ "platforms": [
+ {"host": {"os": "LINUX"}, "default": true},
+ {"host": {"os": "WIN"}, "default": true},
+ {"host": {"os": "DARWIN"}, "default": true}
+ ]
+ },
"golangci-lint": {
"tools": {
"golangci-lint": { "bottle": "golangci-lint", "executable": "golangci-lint" }
"yo": ["yo"]
}
},
+ "tvmknife": {
+ "formula": {
+ "sandbox_id": [375826288],
+ "match": "tvmknife"
+ },
+ "executable": {
+ "tvmknife": ["tvmknife"]
+ }
+ },
"golangci-lint": {
"formula": {
"sandbox_id": [352933824, 352932977],
|
Build: Speed up HomeBrew Deployment | @@ -11,7 +11,7 @@ matrix:
name: "Check Shell Scripts"
script:
- - HOMEBREW_NO_AUTO_UPDATE=1 brew install shellcheck
+ - HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install shellcheck
- find . \( -name "*.tool" -o -name "*.command" -o -name "*.sh" \) -exec shellcheck --severity=info {} \;
- os: osx
@@ -20,7 +20,7 @@ matrix:
compiler: clang
script:
- - HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl
+ - HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl
- "./macbuild.tool"
deploy:
@@ -87,7 +87,7 @@ matrix:
compiler: clang
before_install:
- - HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl
+ - HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl
- curl -Ls https://entrust.com/root-certificates/entrust_l1k.cer -o ~/entrust_l1k.crt || exit 1
- curl -LS https://curl.haxx.se/ca/cacert.pem -o ~/cacert.pem || exit 1
- cat ~/entrust_l1k.crt >> ~/cacert.pem || exit 1
|
decisions: allow backlinks | @@ -7,6 +7,13 @@ Substantial decisions, however, must be made in a transparent and participative
The main purpose of the decision process is to get a common understanding of the problems and the impacts of possible solutions.
+## Terminology
+
+- `Decision`:
+ A text file which contains the content as [explained here](EXPLANATIONS.md).
+- `Decision PR`:
+ A pull request that contains changes for decisions.
+
## Constraints
- All relevant information about decisions must be within Elektra's repository.
@@ -27,7 +34,8 @@ The main purpose of the decision process is to get a common understanding of the
- For reviewers:
- Prefer to directly give suggestions how to change sentences.
- General questions should be asked in the root of "Conversation" and not at vaguely related sentences in the review.
-- Decision PRs only contain a single decision and changes directly related to the decision. (e.g. adding it as a "Related Decision" elsewhere)
+- Decision PRs only modify a *single* decision.
+ Small exceptions like backlinks from other decisions are okay, though.
- Changes not changing the decision step or the direction of the decision are not decision PRs.
- The person merging the decision PR must be someone other than the person that created the decision.
- The purpose of decisions is to have clear descriptions of technical problems and solutions.
|
bn/asm/rsaz-avx2.pl: refine Win64 SE handler. | @@ -827,6 +827,7 @@ $code.=<<___;
mov %rbp, %rax
___
$code.=<<___ if ($win64);
+.Lsqr_1024_in_tail:
movaps -0xd8(%rax),%xmm6
movaps -0xc8(%rax),%xmm7
movaps -0xb8(%rax),%xmm8
@@ -1460,6 +1461,7 @@ $code.=<<___;
mov %rbp, %rax
___
$code.=<<___ if ($win64);
+.Lmul_1024_in_tail:
movaps -0xd8(%rax),%xmm6
movaps -0xc8(%rax),%xmm7
movaps -0xb8(%rax),%xmm8
@@ -1815,14 +1817,17 @@ rsaz_se_handler:
cmp %r10,%rbx # context->Rip<prologue label
jb .Lcommon_seh_tail
- mov 152($context),%rax # pull context->Rsp
-
mov 4(%r11),%r10d # HandlerData[1]
lea (%rsi,%r10),%r10 # epilogue label
cmp %r10,%rbx # context->Rip>=epilogue label
jae .Lcommon_seh_tail
- mov 160($context),%rax # pull context->Rbp
+ mov 160($context),%rbp # pull context->Rbp
+
+ mov 8(%r11),%r10d # HandlerData[2]
+ lea (%rsi,%r10),%r10 # "in tail" label
+ cmp %r10,%rbx # context->Rip>="in tail" label
+ cmovc %rbp,%rax
mov -48(%rax),%r15
mov -40(%rax),%r14
@@ -1900,11 +1905,13 @@ rsaz_se_handler:
.LSEH_info_rsaz_1024_sqr_avx2:
.byte 9,0,0,0
.rva rsaz_se_handler
- .rva .Lsqr_1024_body,.Lsqr_1024_epilogue
+ .rva .Lsqr_1024_body,.Lsqr_1024_epilogue,.Lsqr_1024_in_tail
+ .long 0
.LSEH_info_rsaz_1024_mul_avx2:
.byte 9,0,0,0
.rva rsaz_se_handler
- .rva .Lmul_1024_body,.Lmul_1024_epilogue
+ .rva .Lmul_1024_body,.Lmul_1024_epilogue,.Lmul_1024_in_tail
+ .long 0
.LSEH_info_rsaz_1024_gather5:
.byte 0x01,0x36,0x17,0x0b
.byte 0x36,0xf8,0x09,0x00 # vmovaps 0x90(rsp),xmm15
|
roller: simplify handling of /predict timer | :: next-batch: when then next l2 batch will be sent
:: pre: predicted l2 state
:: own: ownership of azimuth points
- :: derive-p: flag (derive predicted state)
- :: derive-o: flag (derive ownership state)
+ :: derive: flag (derive predicted/ownership state)
::
pending=(list pend-tx)
sending=(map l1-tx-pointer sending-txs)
next-batch=time
pre=^state:naive
own=owners
- derive-p=?
- derive-o=?
+ derive=?
::
:: pk: private key to send the roll
:: frequency: time to wait between sending batches (TODO fancier)
[%predict ~]
?+ +<.sign-arvo (on-arvo:def wire sign-arvo)
%wake
+ =. own.state canonical-owners:do
=^ effects state
(predicted-state canonical-state):do
- [(emit effects) this(derive-p &)]
- ==
- ::
- [%owners ~]
- ?+ +<.sign-arvo (on-arvo:def wire sign-arvo)
- %wake
- =. own.state canonical-owners:do
- `this(derive-o &)
+ [(emit effects) this(derive &)]
==
::
[%resend @ @ ~]
:: ?. not-sent ~& "skip" [~ state]
:: toggle flush flag
::
- :_ state(derive-p ?:(derive-p | derive-p))
+ :_ state(derive ?:(derive | derive))
%+ weld (emit update-cards)
- ?. derive-p ~
- :: derive predicted state in 5m.
+ ?. derive ~
+ :: derive predicted state in 1m.
::
- [(wait:b:sys /predict (add ~m5 now.bowl))]~
+ [(wait:b:sys /predict (add ~m1 now.bowl))]~
:: +set-timer: %wait until next whole :frequency
::
++ set-timer
:: tx succeds but we get a "Runtime Error: revert"?
::
=: pending ~
- derive-p &
+ derive &
next-nonce `+(u.next-nonce)
::
sending
++ on-naive-diff
|= =diff:naive
^- (quip card _state)
- ?: ?=(%point -.diff)
- :_ state(derive-o ?:(derive-o | derive-o))
- ?. derive-o ~
- :: calculate ownership in 5m.
- ::
- [(wait:b:sys /owners (add ~m5 now.bowl))]~
- ?. ?=(%tx -.diff)
+ ?. |(?=(%point -.diff) ?=(%tx -.diff))
[~ state]
+ =; [cards=(list card) =_state]
+ :_ state(derive ?:(derive | derive))
+ %+ weld cards
+ ?. derive ~
+ :: derive predicted/ownership state in 1m.
+ ::
+ [(wait:b:sys /predict (add ~m1 now.bowl))]~
+ ::
+ ?: ?=(%point -.diff) [~ state]
+ ?> ?=(%tx -.diff)
=/ =keccak (hash-raw-tx:lib raw-tx.diff)
?~ wer=(~(get by finding) keccak)
- ~? lverb [dap.bowl %missing-keccak]
[~ state]
:: if we had already seen the tx, no-op
::
?~(err.diff %confirmed %failed)
:- [%tx address roller-tx]~
(~(put ju history) [address roller-tx])
- ::
- :_ state(derive-p ?:(derive-p | derive-p))
- %+ weld (emit updates)
- ?. derive-p ~
- :: derive predicted state in 5m.
- ::
- [(wait:b:sys /predict (add ~m5 now.bowl))]~
+ [(emit updates) state]
::
--
|
Update src/utils/registryConnector.c | @@ -23,7 +23,7 @@ void getRegistryEntry(const char* key, const char* value) {
char* getRegistryValue(const char* env_name) {
char value_buffer[8192];
getRegistryEntry(env_name, value_buffer);
- if (strcmp(value_buffer, "") == 0) {
+ if (!strValid(value_buffer)) {
return NULL;
}
char* value = oidc_strcopy(value_buffer);
|
groups: fix issue with wrapping urls in notes | @@ -2,9 +2,7 @@ import { Text } from '@tlon/indigo-react';
import styled from 'styled-components';
export const TruncatedText = styled(Text)`
- white-space: pre;
- text-overflow: ellipsis;
- overflow: hidden;
min-width: 0;
+ overflow-wrap: anywhere;
`;
|
Updater: Add sourceforge nightly | @@ -256,7 +256,8 @@ ULONG64 ParseVersionString(
}
BOOLEAN QueryUpdateData(
- _Inout_ PPH_UPDATER_CONTEXT Context
+ _Inout_ PPH_UPDATER_CONTEXT Context,
+ _In_ BOOLEAN UseSourceForge
)
{
BOOLEAN success = FALSE;
@@ -270,6 +271,31 @@ BOOLEAN QueryUpdateData(
goto CleanupExit;
}
+ if (UseSourceForge)
+ {
+ if (!PhHttpSocketConnect(
+ httpContext,
+ L"processhacker.sourceforge.io",
+ PH_HTTP_DEFAULT_HTTPS_PORT
+ ))
+ {
+ Context->ErrorCode = GetLastError();
+ goto CleanupExit;
+ }
+
+ if (!PhHttpSocketBeginRequest(
+ httpContext,
+ NULL,
+ L"/nightly.php?phupdater",
+ PH_HTTP_FLAG_REFRESH | PH_HTTP_FLAG_SECURE
+ ))
+ {
+ Context->ErrorCode = GetLastError();
+ goto CleanupExit;
+ }
+ }
+ else
+ {
if (!PhHttpSocketConnect(
httpContext,
L"wj32.org",
@@ -290,6 +316,7 @@ BOOLEAN QueryUpdateData(
Context->ErrorCode = GetLastError();
goto CleanupExit;
}
+ }
{
PPH_STRING versionHeader;
@@ -407,8 +434,11 @@ NTSTATUS UpdateCheckSilentThread(
PhDelayExecution(5 * 1000);
// Query latest update information from the server.
- if (!QueryUpdateData(context))
+ if (!QueryUpdateData(context, FALSE))
+ {
+ if (!QueryUpdateData(context, TRUE))
goto CleanupExit;
+ }
// Compare the current version against the latest available version
if (context->CurrentVersion < context->LatestVersion)
@@ -449,7 +479,10 @@ NTSTATUS UpdateCheckThread(
// Check if we have cached update data
if (!context->HaveData)
{
- context->HaveData = QueryUpdateData(context);
+ context->HaveData = QueryUpdateData(context, FALSE);
+
+ if (!context->HaveData)
+ context->HaveData = QueryUpdateData(context, TRUE);
}
if (!context->HaveData)
|
find-doc-nits: Minor improvements of help and diagnostic output | @@ -45,7 +45,7 @@ our($opt_c);
sub help {
print <<EOF;
Find small errors (nits) in documentation. Options:
- -c List undocumented commands and options
+ -c List undocumented commands, undocumented options and unimplemented options.
-d Detailed list of undocumented (implies -u)
-e Detailed list of new undocumented (implies -v)
-h Print this help message
@@ -1085,8 +1085,7 @@ sub checkflags {
# See what's in the command not the manpage.
my @undocced = sort grep { !defined $docopts{$_} } @cmdopts;
foreach ( @undocced ) {
- next if $cmd eq "openssl" && $_ eq "help";
- err("$doc: undocumented option -$_");
+ err("$doc: undocumented $cmd option -$_");
}
# See what's in the command not the manpage.
|
Fix Coverity CID:1453685 'unreachable code' in aes_xts code. | @@ -176,7 +176,6 @@ static int aes_xts_cipher(void *vctx, unsigned char *out, size_t *outl,
else if (CRYPTO_xts128_encrypt(&ctx->xts, ctx->base.iv, in, out, inl,
ctx->base.enc))
return 0;
- return 1;
*outl = inl;
return 1;
@@ -198,7 +197,6 @@ static int aes_xts_stream_update(void *vctx, unsigned char *out, size_t *outl,
return 0;
}
- *outl = inl;
return 1;
}
|
sched: mark threads as idle only once preemption completes
these threads are effectively unavailable until they are descheduled,
this reduces the chance of a wakeup failing in ksched | @@ -38,6 +38,7 @@ int sched_siblings_nr;
static int nr_guaranteed;
struct core_state {
+ struct thread *last_th; /* recently run thread, waiting for preemption to complete */
struct thread *pending_th; /* a thread waiting run */
struct thread *cur_th; /* the currently running thread */
unsigned int idle:1; /* is the core idle? */
@@ -162,10 +163,8 @@ __sched_run(struct core_state *s, struct thread *th, unsigned int core)
/* finally request that the new kthread run on this core */
ksched_run(core, th ? th->tid : 0);
- if (s->cur_th) {
- sched_disable_kthread(s->cur_th);
- proc_put(s->cur_th->p);
- }
+
+ s->last_th = s->cur_th;
s->cur_th = th;
s->wait = true;
s->idle = false;
@@ -512,6 +511,9 @@ static int sched_try_fast_rewake(struct thread *th)
int i;
struct hwq *h;
+ if (unlikely(th->p->kill))
+ return -EINVAL;
+
/*
* If the kthread has yielded voluntarily but still has pending I/O
* requests in flight, we can just wake it back up directly without
@@ -580,6 +582,11 @@ void sched_poll(void)
/* check if a pending context switch finished */
if (s->wait && ksched_poll_run_done(core)) {
+ if (s->last_th) {
+ sched_disable_kthread(s->last_th);
+ proc_put(s->last_th->p);
+ s->last_th = NULL;
+ }
if (s->pending) {
struct thread *th = s->pending_th;
@@ -587,10 +594,7 @@ void sched_poll(void)
s->pending = false;
ksched_enqueue_intr(core, KSCHED_INTR_CEDE);
ksched_run(core, th ? th->tid : 0);
- if (s->cur_th) {
- sched_disable_kthread(s->cur_th);
- proc_put(s->cur_th->p);
- }
+ s->last_th = s->cur_th;
s->cur_th = th;
} else {
s->wait = false;
@@ -600,8 +604,7 @@ void sched_poll(void)
/* check if a core went idle */
if (!s->wait && !s->idle && ksched_poll_idle(core)) {
if (s->cur_th) {
- if (!s->cur_th->p->kill &&
- sched_try_fast_rewake(s->cur_th) == 0)
+ if (sched_try_fast_rewake(s->cur_th) == 0)
continue;
sched_disable_kthread(s->cur_th);
proc_put(s->cur_th->p);
|
gkhash: fix use after free
Do not free immediately in case tpl_unpack() gets called multiple times | @@ -1168,8 +1168,8 @@ restore_global_si32 (khash_t (si32) * hash, const char *fn) {
tpl_load (tn, TPL_FILE, fn);
while (tpl_unpack (tn, 1) > 0) {
ins_si32 (hash, key, val);
- free (key);
}
+ free (key);
tpl_free (tn);
}
@@ -1284,9 +1284,9 @@ restore_si32 (GSMetric metric, const char *path, int module) {
while (tpl_unpack (tn, 2) > 0) {
ins_si32 (hash, key, val);
- free (key);
}
}
+ free (key);
tpl_free (tn);
return 0;
@@ -1343,9 +1343,9 @@ restore_is32 (GSMetric metric, const char *path, int module) {
dupval = xstrdup (val);
if (ins_is32 (hash, key, dupval) != 0)
free (dupval);
- free (val);
}
}
+ free (val);
tpl_free (tn);
return 0;
@@ -1566,9 +1566,9 @@ restore_su64 (GSMetric metric, const char *path, int module) {
while (tpl_unpack (tn, 2) > 0) {
ins_su64 (hash, key, val);
- free (key);
}
}
+ free (key);
tpl_free (tn);
return 0;
|
margin styling, spacing in general | |= [t=knot con=topicful:collections]
;* ?: comm.config
;* ?: xeno.config
- ;li.forum
+ ;li.forum.mb-8
;div.text-mono
- {(trip t)}
+ ; {(trip t)}
==
;div.h3.mt-0
;a(href "/~~/collections/{(trip -.s.bem.gas)}/{(trip t)}"): {(trip tit.info.con)}
==
- ;div.who
+ ;div.who.text-mono.text-600
; {(trip (scot %p who.info.con))}
==
- ;div.com-count
+ ;div.meta-cont
+ ;div.da.text-mono(data-urb-elapsed "{(esoo mod.info.con)}");
+ ;div.com-count.ml-12
; {(trip (scot %ud (lent ~(tap by coms.con))))} comments
==
==
- ;li.blog
+ ==
+ ;li.blog.mb-8
;div.text-mono
- {(trip t)}
+ ; {(trip t)}
==
;div.h2.mt-0
;a(href "/~~/collections/{(trip -.s.bem.gas)}/{(trip t)}"): {(trip tit.info.con)}
|
Code not working | #include "de_web_plugin.h"
#include "de_web_plugin_private.h"
+//Used somewhere else in the code
+const QDateTime epoch = QDateTime(QDate(2000, 1, 1), QTime(0, 0), Qt::UTC);
+
+// Used only localy
const QDateTime J2000_epoch = QDateTime(QDate(2000, 1, 1), QTime(0, 0), Qt::UTC);
const QDateTime Unix_epoch = QDateTime(QDate(1970, 1, 1), QTime(0, 0), Qt::UTC);
@@ -31,21 +35,21 @@ void DeRestPluginPrivate::getTime(quint32 *time, qint32 *tz, quint32 *dstStart,
QDateTime yearStart(QDate(QDate::currentDate().year(), 1, 1), QTime(0, 0), Qt::UTC);
QTimeZone timeZone(QTimeZone::systemTimeZoneId());
- QDateTime epoch = J2000_epoch;
+ QDateTime epoch2 = J2000_epoch;
if ( mode == UNIX_EPOCH)
{
- epoch = Unix_epoch;
+ epoch2 = Unix_epoch;
}
- *time = *standardTime = *localTime = epoch.secsTo(now);
+ *time = *standardTime = *localTime = epoch2.secsTo(now);
*tz = timeZone.offsetFromUtc(yearStart);
if (timeZone.hasTransitions())
{
QTimeZone::OffsetData dstStartOffsetData = timeZone.nextTransition(yearStart);
QTimeZone::OffsetData dstEndOffsetData = timeZone.nextTransition(dstStartOffsetData.atUtc);
- *dstStart = epoch.secsTo(dstStartOffsetData.atUtc);
- *dstEnd = epoch.secsTo(dstEndOffsetData.atUtc);
+ *dstStart = epoch2.secsTo(dstStartOffsetData.atUtc);
+ *dstEnd = epoch2.secsTo(dstEndOffsetData.atUtc);
*dstShift = dstStartOffsetData.daylightTimeOffset;
*standardTime += *tz;
*localTime += *tz + ((*time >= *dstStart && *time <= *dstEnd) ? *dstShift : 0);
|
Support for more than 15 keyword arguments | @@ -87,10 +87,12 @@ static void send_by_name( struct VM *vm, mrbc_sym sym_id, int a, int c )
// Convert keyword argument to hash.
if( karg ) {
+ narg++;
+ if( karg != CALL_MAXARGS ) {
mrbc_value h = mrbc_hash_new( vm, karg );
if( !h.hash ) return; // ENOMEM
- mrbc_value *r1 = recv + narg + 1;
+ mrbc_value *r1 = recv + narg;
memcpy( h.hash->data, r1, sizeof(mrbc_value) * karg * 2 );
h.hash->n_stored = karg * 2;
@@ -98,7 +100,7 @@ static void send_by_name( struct VM *vm, mrbc_sym sym_id, int a, int c )
memset( r1 + 2, 0, sizeof(mrbc_value) * (karg * 2 - 1) );
*r1++ = h;
*r1 = block;
- narg++;
+ }
}
// is not have block
|
trace: add filter events on last chunk trace when using limits. | @@ -146,7 +146,7 @@ void flb_filter_do(struct flb_input_chunk *ic,
/* reset data content length */
#ifdef FLB_TRACE
- if (ic->in->trace_ctxt) flb_trace_chunk_filter(ic->trace, (void *)f_ins, "", 0);
+ if (ic->trace) flb_trace_chunk_filter(ic->trace, (void *)f_ins, "", 0);
#endif // FLB_TRACE
@@ -204,7 +204,7 @@ void flb_filter_do(struct flb_input_chunk *ic,
}
#ifdef FLB_TRACE
- if (ic->in->trace_ctxt) flb_trace_chunk_filter(ic->trace, (void *)f_ins, out_buf, out_size);
+ if (ic->trace) flb_trace_chunk_filter(ic->trace, (void *)f_ins, out_buf, out_size);
#endif // FLB_TRACE
/* Point back the 'data' pointer to the new address */
|
SOVERSION bump to version 2.26.6 | @@ -66,7 +66,7 @@ set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_
# set version of the library
set(LIBYANG_MAJOR_SOVERSION 2)
set(LIBYANG_MINOR_SOVERSION 26)
-set(LIBYANG_MICRO_SOVERSION 5)
+set(LIBYANG_MICRO_SOVERSION 6)
set(LIBYANG_SOVERSION_FULL ${LIBYANG_MAJOR_SOVERSION}.${LIBYANG_MINOR_SOVERSION}.${LIBYANG_MICRO_SOVERSION})
set(LIBYANG_SOVERSION ${LIBYANG_MAJOR_SOVERSION})
|
Compute passes release their shaders properly;
Active shader was only getting released for render passes. | @@ -5509,7 +5509,7 @@ static void releasePassResources(void) {
lovrRelease(access->texture, lovrTextureDestroy);
}
- if (pass->info.type == PASS_RENDER) {
+ if (pass->info.type == PASS_RENDER || pass->info.type == PASS_COMPUTE) {
for (size_t j = 0; j <= pass->pipelineIndex; j++) {
Pipeline* pipeline = pass->pipeline - j;
lovrRelease(pipeline->font, lovrFontDestroy);
|
Check for ipcRenderer to prevent unit tests failing | @@ -80,6 +80,7 @@ const plugins = {
}, {})
};
+if (ipcRenderer) {
ipcRenderer.send("set-menu-plugins", plugins.menu);
chokidar
@@ -155,6 +156,7 @@ chokidar
pluginEmitter.emit("remove-menu", { id: pluginId });
ipcRenderer.send("set-menu-plugins", plugins.menu);
});
+}
export default plugins;
export { pluginEmitter };
|
BuildTools: Fix cleanup path typo | @@ -244,8 +244,8 @@ public static void CleanupBuildEnvironment()
{
string sourceFile = BuildOutputFolder + file;
- if (File.Exists(file))
- File.Delete(file);
+ if (File.Exists(sourceFile))
+ File.Delete(sourceFile);
}
if (Directory.Exists("sdk"))
|
Add further array bounds checks to bark_noise_hybridmp.
Make it clear to local analysis that no out-of-bounds array
accesses are possible here.
Follow-up to CVE-2018-10393 and CVE-2017-14160. | @@ -599,11 +599,11 @@ static void bark_noise_hybridmp(int n,const long *b,
XY[i] = tXY;
}
- for (i = 0, x = 0.f;; i++, x += 1.f) {
+ for (i = 0, x = 0.f; i < n; i++, x += 1.f) {
lo = b[i] >> 16;
hi = b[i] & 0xffff;
- if( lo>=0 ) break;
+ if( lo>=0 || -lo>=n ) break;
if( hi>=n ) break;
tN = N[hi] + N[-lo];
@@ -616,16 +616,16 @@ static void bark_noise_hybridmp(int n,const long *b,
B = tN * tXY - tX * tY;
D = tN * tXX - tX * tX;
R = (A + x * B) / D;
- if (R < 0.f)
- R = 0.f;
+ if (R < 0.f) R = 0.f;
noise[i] = R - offset;
}
- for ( ;; i++, x += 1.f) {
+ for ( ; i < n; i++, x += 1.f) {
lo = b[i] >> 16;
hi = b[i] & 0xffff;
+ if( lo<0 || lo>=n ) break;
if( hi>=n ) break;
tN = N[hi] - N[lo];
@@ -642,6 +642,7 @@ static void bark_noise_hybridmp(int n,const long *b,
noise[i] = R - offset;
}
+
for ( ; i < n; i++, x += 1.f) {
R = (A + x * B) / D;
@@ -652,9 +653,10 @@ static void bark_noise_hybridmp(int n,const long *b,
if (fixed <= 0) return;
- for (i = 0, x = 0.f;; i++, x += 1.f) {
+ for (i = 0, x = 0.f; i < n; i++, x += 1.f) {
hi = i + fixed / 2;
lo = hi - fixed;
+ if ( hi>=n ) break;
if ( lo>=0 ) break;
tN = N[hi] + N[-lo];
@@ -671,11 +673,12 @@ static void bark_noise_hybridmp(int n,const long *b,
if (R - offset < noise[i]) noise[i] = R - offset;
}
- for ( ;; i++, x += 1.f) {
+ for ( ; i < n; i++, x += 1.f) {
hi = i + fixed / 2;
lo = hi - fixed;
if ( hi>=n ) break;
+ if ( lo<0 ) break;
tN = N[hi] - N[lo];
tX = X[hi] - X[lo];
|
linkvoiceapp:disable scan sd card | @@ -135,14 +135,14 @@ void xplayer_run(void)
}
aos_register_event_filter(EV_KEY, xplayer_key_process, music_player->bufque);
- LOG("show music list...");
- if (xPlayerShowMusicList() == -1) {
- krhino_buf_queue_dyn_del(&music_player->bufque);
- xPlayerDestroy();
- krhino_task_dyn_del(NULL);
- LOG("xplaer thread exit...");
- return;
- }
+ // LOG("show music list...");
+ // if (xPlayerShowMusicList() == -1) {
+ // krhino_buf_queue_dyn_del(&music_player->bufque);
+ // xPlayerDestroy();
+ // krhino_task_dyn_del(NULL);
+ // LOG("xplaer thread exit...");
+ // return;
+ // }
// draw_text(0,3,0,"HEADPHONE");
if(audio_out_select){
aud_mgr_handler(AUDIO_DEVICE_MANAGER_PATH, CODE_EVENT_EXT_SPEAKER);
|
Fixed bugs revealed by LGTM.com (on port to CUPS)
This especially revealed that on selecting the final setting for the
color mode/quality presets only 2 of the intended 3 passes were done. | @@ -2568,8 +2568,6 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
// No or small change -> Normal quality
if (m == 1)
properties->sets_normal += res_factor * 4;
- else if (m > 1 && m < 2)
- properties->sets_normal += res_factor * 2;
// At least double the pixels -> High quality
else if (m == 2)
properties->sets_high += res_factor * 3;
@@ -2587,8 +2585,6 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
// No or small change -> Normal quality
if (m == 1)
properties->sets_normal += res_factor * 1;
- else if (m > 1 && m < 2)
- properties->sets_normal += res_factor * 1;
// At most half the pixels -> Draft quality
else if (m == 2)
properties->sets_draft += res_factor * 3;
@@ -2615,7 +2611,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
* grid
*/
- for (pass = 0; pass < 2; pass ++)
+ for (pass = 0; pass < 3; pass ++)
{
for (k = 0; k < option->num_choices; k ++)
{
|
lib: Update tcmulib_command_complete comments | @@ -111,7 +111,8 @@ struct tcmulib_cmd *tcmulib_get_next_command(struct tcmu_device *dev);
* Mark the command as complete.
* Must be called before get_next_command() is called again.
*
- * result is scsi status, or TCMU_STS_NOT_HANDLED or TCMU_ASYNC_HANDLED.
+ * result is TCMU_STS value from libtcmu_common.h. If TCMU_STS_PASSTHROUGH_ERR
+ * is returned then the caller must setup the tcmulib_cmd->sense_buf.
*/
void tcmulib_command_complete(struct tcmu_device *dev, struct tcmulib_cmd *cmd, int result);
|
api: fix dead client scan heap issue
Type: fix
On multiworker setup when an app client dies, the
vec_reset_length call fails the assert in
clib_mem_is_heap_object. Same thing might happen for
the clib_warnings | @@ -666,14 +666,18 @@ vl_mem_api_dead_client_scan (api_main_t * am, vl_shmem_hdr_t * shm, f64 now)
vec_delete (am->vlib_private_rps, 1, i);
goto found;
}
+ svm_pop_heap (oldheap);
clib_warning ("private rp %llx AWOL", dead_rp);
+ oldheap = svm_push_data_heap (svm);
found:
/* Kill it, accounting for the memfd header page */
+ svm_pop_heap (oldheap);
if (munmap ((void *) virtual_base, virtual_size) < 0)
clib_unix_warning ("munmap");
/* Reset the queue-length-address cache */
vec_reset_length (vl_api_queue_cursizes);
+ oldheap = svm_push_data_heap (svm);
}
else
{
|
Added "far" field to BIN resource and replaced FileWriter by StringBuffer (faster and safer) | @@ -2,7 +2,6 @@ package sgdk.rescomp.resource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.PrintWriter;
import java.util.Arrays;
import sgdk.rescomp.Resource;
@@ -18,10 +17,11 @@ public class Bin extends Resource
public final Compression wantedCompression;
public PackedData packedData;
public Compression doneCompression;
+ public boolean far;
final int hc;
- public Bin(String id, byte[] data, int align, int sizeAlign, int fill, Compression compression)
+ public Bin(String id, byte[] data, int align, int sizeAlign, int fill, Compression compression, boolean far)
{
super(id);
@@ -33,11 +33,17 @@ public class Bin extends Resource
wantedCompression = compression;
packedData = null;
doneCompression = Compression.NONE;
+ this.far = far;
// compute hash code
hc = Arrays.hashCode(data) ^ (align << 16) ^ wantedCompression.hashCode();
}
+ public Bin(String id, byte[] data, int align, int sizeAlign, int fill, Compression compression)
+ {
+ this(id, data, align, sizeAlign, fill, compression, true);
+ }
+
public Bin(String id, byte[] data, int align, int sizeAlign, int fill)
{
this(id, data, align, sizeAlign, fill, Compression.NONE);
@@ -53,9 +59,9 @@ public class Bin extends Resource
this(id, data, 2, 0, 0, compression);
}
- public Bin(String id, short[] data, Compression compression)
+ public Bin(String id, short[] data, Compression compression, boolean far)
{
- this(id, ArrayUtil.shortToByte(data), 2, 0, 0, compression);
+ this(id, ArrayUtil.shortToByte(data), 2, 0, 0, compression, far);
}
public Bin(String id, int[] data, Compression compression)
@@ -89,7 +95,7 @@ public class Bin extends Resource
}
@Override
- public void out(ByteArrayOutputStream outB, PrintWriter outS, PrintWriter outH) throws IOException
+ public void out(ByteArrayOutputStream outB, StringBuilder outS, StringBuilder outH) throws IOException
{
// pack data first if needed
packedData = Util.pack(data, wantedCompression, outB);
@@ -125,6 +131,6 @@ public class Bin extends Resource
Util.declArray(outS, outH, "u8", id, data.length, align, global);
// output data (compression information is stored in 'parent' resource)
Util.outS(outS, packedData.data, 1);
- outS.println();
+ outS.append("\n");
}
}
\ No newline at end of file
|
board/bobba/board.h: Format with clang-format
BRANCH=none
TEST=none | #define CONFIG_ACCELGYRO_ICM426XX_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
-
-#define CONFIG_SYNC_INT_EVENT \
- TASK_EVENT_MOTION_SENSOR_INTERRUPT(VSYNC)
+#define CONFIG_SYNC_INT_EVENT TASK_EVENT_MOTION_SENSOR_INTERRUPT(VSYNC)
#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_UPDATE
@@ -111,19 +109,10 @@ enum temp_sensor_id {
TEMP_SENSOR_COUNT
};
-enum pwm_channel {
- PWM_CH_KBLIGHT,
- PWM_CH_COUNT
-};
+enum pwm_channel { PWM_CH_KBLIGHT, PWM_CH_COUNT };
/* Motion sensors */
-enum sensor_id {
- LID_ACCEL,
- BASE_ACCEL,
- BASE_GYRO,
- VSYNC,
- SENSOR_COUNT
-};
+enum sensor_id { LID_ACCEL, BASE_ACCEL, BASE_GYRO, VSYNC, SENSOR_COUNT };
/* List of possible batteries */
enum battery_type {
|
fix(docs): Consistent naming in Mo-Tog example.
Updated all references in example to conform to Hold action-Tap action wording order. | @@ -276,19 +276,19 @@ A popular method of implementing Autoshift in ZMK involves a C-preprocessor macr
</TabItem>
-<TabItem value="tog_mo">
+<TabItem value="mo_tog">
-This hold-tap example implements a [toggle-layer](layers.md/#toggle-layer) when the keybind is tapped and a [momentary-layer](layers.md/#momentary-layer) when it is held. Similarly to the Autoshift and Sticky Hold use-cases, a `TOG_MO(layer)` macro is defined such that the `&tog` and `&mo` behaviors can target a single layer.
+This hold-tap example implements a [momentary-layer](layers.md/#momentary-layer) when it is held and a [toggle-layer](layers.md/#toggle-layer) when the keybind is tapped. Similarly to the Autoshift and Sticky Hold use-cases, a `MO_TOG(layer)` macro is defined such that the `&mo` and `&tog` behaviors can target a single layer.
-```dtsi title="Hold-Tap Example: Toggle layer on Tap, Momentary layer on Hold"
+```dtsi title="Hold-Tap Example: Momentary layer on Hold, Toggle layer on Tap"
#include <dt-bindings/zmk/keys.h>
#include <behaviors.dtsi>
-#define TOG_MO(layer) &tog_mo layer layer // Macro to apply toggle-layer-on-tap/momentary-layer-on-hold to a specific layer
+#define MO_TOG(layer) &mo_tog layer layer // Macro to apply momentary-layer-on-hold/toggle-layer-on-tap to a specific layer
/ {
behaviors {
- tog_mo: behavior_mo_tog {
+ mo_tog: behavior_mo_tog {
compatible = "zmk,behavior-hold-tap";
label = "mo_tog";
#binding-cells = <2>;
@@ -302,8 +302,8 @@ This hold-tap example implements a [toggle-layer](layers.md/#toggle-layer) when
compatible = "zmk,keymap";
default_layer {
bindings = <
- &tog_mo 2 1 // &mo 2 on hold, &tog 1 on tap
- TOG_MO(3) // &mo 3 on hold, &tog 3 on tap
+ &mo_tog 2 1 // &mo 2 on hold, &tog 1 on tap
+ MO_TOG(3) // &mo 3 on hold, &tog 3 on tap
>;
};
};
|
refactor: add libdiscord target so we can just build the library | @@ -62,7 +62,7 @@ all : mkdir common orka discord github bot
common: mkdir $(COMMON_OBJS)
orka: mkdir $(ORKA_OBJS)
-discord: mkdir $(DISCORD_OBJS) $(LIBDISCORD)
+discord: mkdir $(DISCORD_OBJS) libdiscord
github: mkdir $(GITHUB_OBJS)
bot: $(BOT_EXES) #@todo should we split by categories (bot_discord, bot_github, etc)?
@@ -83,13 +83,14 @@ $(OBJDIR)/%.cpp.o: %.cpp
$(CXX) $(CXXFLAGS) $(LIBS_CFLAGS) -c -o $@ $<
#generic compilation
-%.exe : %.c $(LIBDISCORD)
+%.exe : %.c libdiscord
$(CC) $(CFLAGS) $(LIBS_CFLAGS) -o $@ $< $(LIBS_LDFLAGS)
-%.exe: %.cpp $(LIBDISCORD)
+%.exe: %.cpp libdiscord
$(CXX) $(CXXFLAGS) $(LIBS_CFLAGS) -o $@ $< $(LIBS_LDFLAGS)
-$(LIBDISCORD) : $(OBJS)
- $(AR) -cvq $@ $(OBJS)
+libdiscord: mkdir $(OBJS)
+ $(AR) -cvq $(LIBDISCORD) $(OBJS)
+
install : all
install -d $(PREFIX)/lib/
|
sway-output.5: improve display of parameter
Since "width" and "height" are separate parameters, show them as such. | @@ -24,7 +24,7 @@ must be separated by one space. For example:
# COMMANDS
-*output* <name> mode|resolution|res [--custom] <WIDTHxHEIGHT>[@<RATE>Hz]
+*output* <name> mode|resolution|res [--custom] <width>x<height>[@<rate>Hz]
Configures the specified output to use the given mode. Modes are a
combination of width and height (in pixels) and a refresh rate that your
display can be configured to use. For a list of available modes for each
|
Silence some more msvc errors. | @@ -243,11 +243,11 @@ static int escape1(DstParser *p, DstParseState *state, uint8_t c) {
static int stringend(DstParser *p, DstParseState *state) {
Dst ret;
if (state->flags & PFLAG_BUFFER) {
- DstBuffer *b = dst_buffer(p->bufcount);
- dst_buffer_push_bytes(b, p->buf, p->bufcount);
+ DstBuffer *b = dst_buffer((int32_t)p->bufcount);
+ dst_buffer_push_bytes(b, p->buf, (int32_t)p->bufcount);
ret = dst_wrap_buffer(b);
} else {
- ret = dst_wrap_string(dst_string(p->buf, p->bufcount));
+ ret = dst_wrap_string(dst_string(p->buf, (int32_t)p->bufcount));
}
p->bufcount = 0;
popstate(p, ret);
@@ -291,7 +291,7 @@ static int tokenchar(DstParser *p, DstParseState *state, uint8_t c) {
return 1;
}
/* Token finished */
- blen = p->bufcount;
+ blen = (int32_t) p->bufcount;
numcheck = dst_scan_number(p->buf, blen);
if (!dst_checktype(numcheck, DST_NIL)) {
ret = numcheck;
@@ -767,7 +767,7 @@ static int cfun_state(DstArgs args) {
}
}
}
- str = dst_string(p->buf + oldcount, p->bufcount - oldcount);
+ str = dst_string(p->buf + oldcount, (int32_t)(p->bufcount - oldcount));
p->bufcount = oldcount;
DST_RETURN_STRING(args, str);
}
|
automation: Minor fix for unknown platform | @@ -189,7 +189,7 @@ def instance_command(ctx, instance_str, cmd):
check_return_code(return_code)
else:
- raise Exit(f"Unsupported platform: '{desc}'")
+ raise Exit(f"Unsupported platform: '{platform}'")
@task()
|
openvr: rm state.rift;
Yay actions? | @@ -85,7 +85,6 @@ static struct {
RenderModel_TextureMap_t* deviceTextures[16];
Canvas* canvas;
vec_float_t boundsGeometry;
- bool rift;
float clipNear;
float clipFar;
float offset;
@@ -208,8 +207,6 @@ static bool openvr_init(float offset, int msaa) {
state.input->GetActionHandle("/actions/lovr/out/leftHandBZZ", &state.hapticActions[0]);
state.input->GetActionHandle("/actions/lovr/out/rightHandBZZ", &state.hapticActions[1]);
- openvr_getName(buffer, sizeof(buffer));
- state.rift = !strncmp(buffer, "Oculus", sizeof(buffer));
state.clipNear = 0.1f;
state.clipFar = 30.f;
state.offset = state.compositor->GetTrackingSpace() == ETrackingUniverseOrigin_TrackingUniverseStanding ? 0. : offset;
|
Useless conf != NULL test
check is already made 10 line above.
clean commented code | @@ -442,19 +442,13 @@ end_of_options:
&& (section = lookup_conf(conf, BASE_SECTION, ENV_DEFAULT_CA)) == NULL)
goto end;
- if (conf != NULL) {
p = NCONF_get_string(conf, NULL, "oid_file");
if (p == NULL)
ERR_clear_error();
if (p != NULL) {
- BIO *oid_bio;
+ BIO *oid_bio = BIO_new_file(p, "r");
- oid_bio = BIO_new_file(p, "r");
if (oid_bio == NULL) {
- /*-
- BIO_printf(bio_err,"problems opening %s for extra oid's\n",p);
- ERR_print_errors(bio_err);
- */
ERR_clear_error();
} else {
OBJ_create_objects(oid_bio);
@@ -465,7 +459,6 @@ end_of_options:
ERR_print_errors(bio_err);
goto end;
}
- }
app_RAND_load_conf(conf, BASE_SECTION);
|
Bad copy paste... | @@ -9,7 +9,7 @@ static CLAP_CONSTEXPR const char CLAP_EXT_STATE[] = "clap.state";
extern "C" {
#endif
-typedef struct clap_plugin_state {
+typedef struct clap_plugin_state_context {
// Saves the plugin state into stream.
// Returns true if the state was correctly saved.
// [main-thread]
|
Set policy only if CMake version >= 3.21.0. | @@ -993,7 +993,9 @@ cmake_policy(SET CMP0078 NEW)
# Although this script already fixes the library prefix of the C# binding (see
# ``tinyspline_add_swig_library``), we enable the new behavior as the old one
# will be removed in future releases of CMake.
+if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.21.0")
cmake_policy(SET CMP0122 NEW)
+endif()
# TINYSPLINE_BINDINGS_FOLDER_NAME
set(TINYSPLINE_BINDINGS_FOLDER_NAME "bindings")
|
Using #define defaults instead of hard-coded numbers | @@ -1321,15 +1321,15 @@ static void lv_cpicker_reset_hsv_if_double_clicked(lv_obj_t * cpicker,
switch(ext->color_mode)
{
case LV_CPICKER_COLOR_MODE_HUE:
- ext->hue = 0;
+ ext->hue = LV_CPICKER_DEF_HUE;
ext->prev_hue = ext->hue;
break;
case LV_CPICKER_COLOR_MODE_SATURATION:
- ext->saturation = 100;
+ ext->saturation = LV_CPICKER_DEF_SATURATION;
ext->prev_saturation = ext->saturation;
break;
case LV_CPICKER_COLOR_MODE_VALUE:
- ext->value = 100;
+ ext->value = LV_CPICKER_DEF_VALUE;
ext->prev_value = ext->value;
break;
}
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.