message
stringlengths 6
474
| diff
stringlengths 8
5.22k
|
---|---|
Explicitly added .bc files to EXTRA_LDFLAGS to allow liba_bundled to pass | @@ -9,7 +9,7 @@ CLANG = clang
OMP_BIN = $(AOMP)/bin/$(CLANG)
CC = $(OMP_BIN) $(VERBOSE)
EXTRA_CFLAGS =
-EXTRA_LDFLAGS =
+EXTRA_LDFLAGS = MyDeviceLib/build/func_1v-$(GPUTYPE)-$(AOMP_GPU).bundled.bc MyDeviceLib/build/func_2v-$(GPUTYPE)-$(AOMP_GPU).bundled.bc MyDeviceLib/build/func_3v-$(GPUTYPE)-$(AOMP_GPU).bundled.bc
EXTRA_OMP_FLAGS =
ifeq (sm_,$(findstring sm_,$(AOMP_GPU)))
|
show map stats crash when not configured. | @@ -1048,7 +1048,7 @@ show_map_stats_command_fn (vlib_main_t * vm, unformat_input_t * input,
map_main_t *mm = &map_main;
map_domain_t *d;
int domains = 0, rules = 0, domaincount = 0, rulecount = 0;
- if (pool_elts (mm->domains) == 0)
+ if (pool_elts (mm->domains) <= 1)
{
vlib_cli_output (vm, "No MAP domains are configured...");
return 0;
|
rescaler_neon: harmonize function suffixes | #error "MULT_FIX/WEBP_RESCALER_RFIX need some more work"
#endif
-static uint32x4_t Interpolate(const rescaler_t* const frow,
+static uint32x4_t Interpolate_NEON(const rescaler_t* const frow,
const rescaler_t* const irow,
uint32_t A, uint32_t B) {
LOAD_32x4(frow, A0);
@@ -91,9 +91,9 @@ static void RescalerExportRowExpand_NEON(WebPRescaler* const wrk) {
const uint32_t A = (uint32_t)(WEBP_RESCALER_ONE - B);
for (x_out = 0; x_out < max_span; x_out += 8) {
const uint32x4_t C0 =
- Interpolate(frow + x_out + 0, irow + x_out + 0, A, B);
+ Interpolate_NEON(frow + x_out + 0, irow + x_out + 0, A, B);
const uint32x4_t C1 =
- Interpolate(frow + x_out + 4, irow + x_out + 4, A, B);
+ Interpolate_NEON(frow + x_out + 4, irow + x_out + 4, A, B);
const uint32x4_t D0 = MULT_FIX(C0, fy_scale_half);
const uint32x4_t D1 = MULT_FIX(C1, fy_scale_half);
const uint16x4_t E0 = vmovn_u32(D0);
|
For des.c, eliminate repetition of iv code | @@ -765,24 +765,6 @@ ACVP_RESULT acvp_des_kat_handler (ACVP_CTX *ctx, JSON_Object *obj) {
// Convert to bits
ptlen = ptlen * 4;
- if (alg_id != ACVP_TDES_ECB) {
- iv = json_object_get_string(testobj, "iv");
- if (!iv) {
- ACVP_LOG_ERR("Server JSON missing 'iv'");
- free(key);
- return ACVP_MISSING_ARG;
- }
-
- ivlen = strnlen(iv, ACVP_SYM_IV_MAX + 1);
- if (ivlen != 16) {
- ACVP_LOG_ERR("Invalid 'iv' length (%u). Expected (%u)", ivlen, 16);
- free(key);
- return ACVP_INVALID_ARG;
- }
- // Convert to bits
- ivlen = ivlen * 4;
- }
-
if (alg_id == ACVP_TDES_CFB1) {
unsigned int tmp_pt_len = 0;
@@ -810,6 +792,17 @@ ACVP_RESULT acvp_des_kat_handler (ACVP_CTX *ctx, JSON_Object *obj) {
// Convert to bits
ctlen = ctlen * 4;
+ if (alg_id == ACVP_TDES_CFB1) {
+ unsigned int tmp_ct_len = 0;
+
+ tmp_ct_len = (unsigned int) json_object_get_number(testobj, "ctLen");
+ if (tmp_ct_len) {
+ // Replace with the provided ctLen
+ ctlen = tmp_ct_len;
+ }
+ }
+ }
+
if (alg_id != ACVP_TDES_ECB) {
iv = json_object_get_string(testobj, "iv");
if (!iv) {
@@ -828,17 +821,6 @@ ACVP_RESULT acvp_des_kat_handler (ACVP_CTX *ctx, JSON_Object *obj) {
ivlen = ivlen * 4;
}
- if (alg_id == ACVP_TDES_CFB1) {
- unsigned int tmp_ct_len = 0;
-
- tmp_ct_len = (unsigned int) json_object_get_number(testobj, "ctLen");
- if (tmp_ct_len) {
- // Replace with the provided ctLen
- ctlen = tmp_ct_len;
- }
- }
- }
-
ACVP_LOG_INFO(" Test case: %d", j);
ACVP_LOG_INFO(" tcId: %d", tc_id);
ACVP_LOG_INFO(" key: %s", key);
|
fixes issue with utf-8 filenames
windows needs to widen the string to properly open files, this
implements a solution for compiling with MSVC anyway using the extension
for fstream to take a wchar | #include <ImfStdIO.h>
#include "Iex.h"
#include <errno.h>
+#ifdef _MSC_VER
+# define VC_EXTRALEAN
+# include <Windows.h>
+# include <string.h>
+#endif
using namespace std;
#include "ImfNamespace.h"
@@ -51,6 +56,21 @@ OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
namespace {
+#ifdef _MSC_VER
+std::wstring WidenFilename (const char *filename)
+{
+ std::wstring ret;
+ int fnlen = static_cast<int>( strlen(filename) );
+ int len = MultiByteToWideChar(CP_UTF8, 0, filename, fnlen, NULL, 0 );
+ if (len > 0)
+ {
+ ret.resize(len);
+ MultiByteToWideChar(CP_UTF8, 0, filename, fnlen, &ret[0], len);
+ }
+ return ret;
+}
+#endif
+
void
clearError ()
{
@@ -95,7 +115,13 @@ checkError (ostream &os)
StdIFStream::StdIFStream (const char fileName[]):
OPENEXR_IMF_INTERNAL_NAMESPACE::IStream (fileName),
- _is (new ifstream (fileName, ios_base::binary)),
+ _is (new ifstream (
+#ifdef _MSC_VER
+ WidenFilename(fileName).c_str(),
+#else
+ fileName,
+#endif
+ ios_base::binary)),
_deleteStream (true)
{
if (!*_is)
@@ -158,7 +184,13 @@ StdIFStream::clear ()
StdOFStream::StdOFStream (const char fileName[]):
OPENEXR_IMF_INTERNAL_NAMESPACE::OStream (fileName),
- _os (new ofstream (fileName, ios_base::binary)),
+ _os (new ofstream (
+#ifdef _MSC_VER
+ WidenFilename(fileName).c_str(),
+#else
+ fileName,
+#endif
+ ios_base::binary)),
_deleteStream (true)
{
if (!*_os)
|
Enforce MVEX constraints | @@ -2583,6 +2583,7 @@ ZyanBool ZydisAreMvexFeaturesCompatible(const ZydisEncoderInstructionMatch *matc
ZyanBool ZydisCheckConstraints(const ZydisEncoderInstructionMatch *match)
{
const ZydisEncoderOperand *operands = match->request->operands;
+ ZyanBool is_gather = ZYAN_FALSE;
switch (match->definition->encoding)
{
case ZYDIS_INSTRUCTION_ENCODING_VEX:
@@ -2612,21 +2613,7 @@ ZyanBool ZydisCheckConstraints(const ZydisEncoderInstructionMatch *match)
{
const ZydisInstructionDefinitionEVEX *evex_def =
(const ZydisInstructionDefinitionEVEX *)match->base_definition;
- if ((evex_def->is_gather) && (operands[0].type == ZYDIS_OPERAND_TYPE_REGISTER))
- {
- ZYAN_ASSERT(match->request->operand_count == 3);
- ZYAN_ASSERT(operands[0].type == ZYDIS_OPERAND_TYPE_REGISTER);
- ZYAN_ASSERT(operands[2].type == ZYDIS_OPERAND_TYPE_MEMORY);
- const ZyanI8 dest = ZydisRegisterGetId(operands[0].reg.value);
- const ZyanI8 index = ZydisRegisterGetId(operands[2].mem.index);
- // The instruction will #UD fault if the destination vector zmm1 is the same as
- // index vector VINDEX.
- if (dest == index)
- {
- return ZYAN_FALSE;
- }
- }
-
+ is_gather = evex_def->is_gather;
if (evex_def->no_source_dest_match)
{
ZYAN_ASSERT(operands[0].type == ZYDIS_OPERAND_TYPE_REGISTER);
@@ -2644,12 +2631,37 @@ ZyanBool ZydisCheckConstraints(const ZydisEncoderInstructionMatch *match)
return ZYAN_FALSE;
}
}
-
- return ZYAN_TRUE;
+ break;
+ }
+ case ZYDIS_INSTRUCTION_ENCODING_MVEX:
+ {
+ const ZydisInstructionDefinitionMVEX *mvex_def =
+ (const ZydisInstructionDefinitionMVEX *)match->base_definition;
+ is_gather = mvex_def->is_gather;
+ break;
}
default:
return ZYAN_TRUE;
}
+
+ if ((is_gather) && (operands[0].type == ZYDIS_OPERAND_TYPE_REGISTER))
+ {
+ ZYAN_ASSERT(match->request->operand_count == 3);
+ ZYAN_ASSERT(operands[0].type == ZYDIS_OPERAND_TYPE_REGISTER);
+ ZYAN_ASSERT(operands[2].type == ZYDIS_OPERAND_TYPE_MEMORY);
+ const ZyanI8 dest = ZydisRegisterGetId(operands[0].reg.value);
+ const ZyanI8 index = ZydisRegisterGetId(operands[2].mem.index);
+ // EVEX: The instruction will #UD fault if the destination vector zmm1 is the same as
+ // index vector VINDEX.
+ // MVEX: The KNC GATHER instructions forbid using the same vector register for destination
+ // and for the index. (https://github.com/intelxed/xed/issues/281#issuecomment-970074554)
+ if (dest == index)
+ {
+ return ZYAN_FALSE;
+ }
+ }
+
+ return ZYAN_TRUE;
}
/**
|
fix the spaces and tabs | @@ -411,16 +411,16 @@ sysreturn open_internal(tuple n, int flags, int mode)
bytes length;
heap h = heap_general(get_kernel_heaps());
unix_heaps uh = get_unix_heaps();
-
- // buffer b = allocate(h, sizeof(struct buffer));
// might be functional, or be a directory
file f = unix_cache_alloc(uh, file);
- if (f == INVALID_ADDRESS) {
+ if (f == INVALID_ADDRESS)
+ {
msg_err("failed to allocate struct file\n");
return set_syscall_error(current, ENOMEM);
}
int fd = allocate_fd(current->p, f);
- if (fd == INVALID_PHYSICAL) {
+ if (fd == INVALID_PHYSICAL)
+ {
unix_cache_free(uh, file, f);
return set_syscall_error(current, EMFILE);
}
@@ -437,7 +437,8 @@ sysreturn open(char *name, int flags, int mode)
// fix - lookup should be robust
if (name == 0)
return set_syscall_error (current, EINVAL);
- if (!(n = resolve_cstring(current->p->cwd, name))) {
+ if (!(n = resolve_cstring(current->p->cwd, name)))
+ {
rprintf("open %s - not found\n", name);
return set_syscall_error(current, ENOENT);
}
@@ -463,11 +464,13 @@ sysreturn openat(int dirfd, char *name, int flags, int mode)
if (name == 0)
return set_syscall_error (current, EINVAL);
// dirfs == AT_FDCWS or path is absolute
- if (dirfd == AT_FDCWD || *name == '/') {
+ if (dirfd == AT_FDCWD || *name == '/')
+ {
return open(name, flags, mode);
}
file f = resolve_fd(current->p, dirfd);
- if (!f) {
+ if (!f)
+ {
return EINVAL;
}
return open_internal(f->n, flags, mode);
|
Don't check whether we are using KTLS before calling the cipher function
The KTLS cipher function is a no-op so it doesn't matter if we call it.
We shouldn't special case KTLS in tls_common.c | @@ -1750,7 +1750,6 @@ int tls_write_records_default(OSSL_RECORD_LAYER *rl,
}
}
- if (!using_ktls) {
if (prefix) {
if (rl->funcs->cipher(rl, wr, 1, 1, NULL, mac_size) < 1) {
if (rl->alert == SSL_AD_NO_ALERT) {
@@ -1760,14 +1759,12 @@ int tls_write_records_default(OSSL_RECORD_LAYER *rl,
}
}
- if (rl->funcs->cipher(rl, wr + prefix, numtempl, 1, NULL,
- mac_size) < 1) {
+ if (rl->funcs->cipher(rl, wr + prefix, numtempl, 1, NULL, mac_size) < 1) {
if (rl->alert == SSL_AD_NO_ALERT) {
RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
}
goto err;
}
- }
for (j = 0; j < numtempl + prefix; j++) {
size_t origlen;
|
Enable -Wunused-but-set-variable | @@ -1403,7 +1403,6 @@ class GnuCompiler(Compiler):
# Disable some warnings which will fail compilation at the time
self.c_warnings += [
'-Wno-parentheses',
- '-Wno-unused-but-set-variable',
]
self.c_defines = ['-DFAKEID=$CPP_FAKEID']
|
Fix flipped terminal height/width. | @@ -522,7 +522,7 @@ term (tsize, Client{..}) shutdownSTM king enqueueEv =
where
TSize.Window wi hi = tsize
- initialEvents = [(initialBlew hi wi), initialHail]
+ initialEvents = [(initialBlew wi hi), initialHail]
runTerm :: RAcquire e (EffCb e TermEf)
runTerm = do
|
Prevent polling clusters wich don't exist in the simple descriptor
Issue | @@ -406,6 +406,33 @@ void PollManager::pollTimerFired()
}
}
+ // check that cluster exists on endpoint
+ {
+ bool found = false;
+ deCONZ::SimpleDescriptor sd;
+ if (restNode->node()->copySimpleDescriptor(pitem.endpoint, &sd) == 0)
+ {
+ for (const auto &cl : sd.inClusters())
+ {
+ if (cl.id() == clusterId)
+ {
+ found = true;
+ break;
+ }
+ }
+ }
+
+ if (!found)
+ {
+ if (clusterId != 0xffff)
+ {
+ DBG_Printf(DBG_INFO, "Poll APS request to 0x%016llX cluster: 0x%04X dropped, cluster doesn't exist\n", pitem.address.ext(), clusterId);
+ clusterId = 0xffff;
+ }
+ suffix = nullptr;
+ }
+ }
+
if (clusterId != 0xffff && fresh > 0 && fresh == attributes.size())
{
DBG_Printf(DBG_INFO, "Poll APS request to 0x%016llX cluster: 0x%04X dropped, values are fresh enough\n", pitem.address.ext(), clusterId);
@@ -439,5 +466,4 @@ void PollManager::pollTimerFired()
items.front() = items.back();
items.pop_back();
}
-
}
|
docker: fix user input prompt for abi dockerfile | @@ -29,7 +29,7 @@ RUN yum localinstall -y ${ELEKTRA_ROOT}/*
RUN wget https://rpms.libelektra.org/fedora-34/libelektra.repo -O libelektra.repo \
&& mv libelektra.repo /etc/yum.repos.d/ \
- && yum update
+ && yum update -y
RUN yum -y install --downloadonly --downloaddir=./ elektra-tests \
&& rpm -i --nodeps ./elektra-tests* ./elektra-tests* \
|
elrs: add aux0 sampling | @@ -280,7 +280,7 @@ static void elrs_unpack_1bit_switches(uint8_t *packet) {
state.aux[AUX_CHANNEL_11] = 0;
}
-static inline uint8_t elrs_unpack_3b_switch(uint16_t val) {
+static uint8_t elrs_unpack_3b_switch(uint16_t val) {
switch (val) {
case 6:
case 7:
@@ -294,7 +294,10 @@ static inline uint8_t elrs_unpack_3b_switch(uint16_t val) {
}
static void elrs_unpack_hybrid_switches(uint8_t *packet) {
- state.aux[AUX_CHANNEL_0] = (packet[6] & 0b01000000);
+ static uint8_t last_aux0_value = 0;
+ const uint8_t aux0_value = (packet[6] & 0b01000000) >> 6;
+ state.aux[AUX_CHANNEL_0] = (!last_aux0_value && !aux0_value) ? 0 : 1;
+ last_aux0_value = aux0_value;
const uint8_t index = (packet[6] & 0b111000) >> 3;
const uint16_t value = elrs_unpack_3b_switch(packet[6] & 0b111);
|
Update Github CI test commands. | @@ -26,7 +26,7 @@ jobs:
- name: make
run: make
- name: test
- run: make test || cat test/error_log*
+ run: make test || cat test/test*.log
build-macos:
@@ -43,7 +43,7 @@ jobs:
- name: make
run: make
- name: test
- run: make test || cat test/error_log*
+ run: make test || cat test/test*.log
build-windows:
|
Use more bits | @@ -7,10 +7,10 @@ extern "C" {
#endif
#define CLAP_VERSION_MAKE(Major, Minor, Revision) \
- ((((Major)&0xff) << 16) | (((Minor)&0xff) << 8) | ((Revision)&0xff))
+ ((((Major)&0xfff) << 20) | (((Minor)&0xfff) << 8) | ((Revision)&0xff))
-#define CLAP_VERSION_MAJ(Version) (((Version) >> 16) & 0xff)
-#define CLAP_VERSION_MIN(Version) (((Version) >> 8) & 0xff)
+#define CLAP_VERSION_MAJ(Version) (((Version) >> 20) & 0xfff)
+#define CLAP_VERSION_MIN(Version) (((Version) >> 8) & 0xfff)
#define CLAP_VERSION_REV(Version) ((Version)&0xff)
// Define CLAP_EXPORT
|
try to fix sponsor pinging | version https://git-lfs.github.com/spec/v1
-oid sha256:495cc6e23d6805366048ef1451deeb3f4836411999ffd4e3329f1434085b72a3
-size 10287843
+oid sha256:52447461c64b4abf79b6daafa9e693077e3342101f1d451f280d5bd145ac544e
+size 10290998
|
sdmmc_host/driver: Add module reset before enabling | @@ -222,6 +222,7 @@ esp_err_t sdmmc_host_init(void)
return ESP_ERR_INVALID_STATE;
}
+ periph_module_reset(PERIPH_SDMMC_MODULE);
periph_module_enable(PERIPH_SDMMC_MODULE);
// Enable clock to peripheral. Use smallest divider first.
|
Remove unused variable in fs.c | @@ -190,7 +190,6 @@ static int luv_check_amode(lua_State* L, int index) {
#if LUV_UV_VERSION_GEQ(1, 31, 0)
static void luv_push_statfs_table(lua_State* L, const uv_statfs_t* s) {
- int i;
lua_createtable(L, 0, 8);
lua_pushinteger(L, s->f_type);
lua_setfield(L, -2, "type");
|
Solve serial test for apple. | @@ -301,7 +301,7 @@ TEST_F(serial_test, DefaultConstructor)
#else
"0x000A7EF2",
#endif
- #elif defined(__linux) || defined(__linux__)
+ #elif defined(__linux) || defined(__linux__) || defined(__APPLE__)
"0xa7ef2",
#else
"<unknown>",
|
psp2kern: Fix indentations of USB headers | @@ -68,10 +68,10 @@ typedef enum SceUsbdErrorCode {
SCE_USBD_ERROR_NO_MEMORY = 0x80240005,
SCE_USBD_ERROR_DEVICE_NOT_FOUND = 0x80240006,
- SCE_USBD_ERROR_80240007 = 0x80240007, //
+ SCE_USBD_ERROR_80240007 = 0x80240007,
- SCE_USBD_ERROR_80240009 = 0x80240009, //
- SCE_USBD_ERROR_8024000A = 0x8024000A, //
+ SCE_USBD_ERROR_80240009 = 0x80240009,
+ SCE_USBD_ERROR_8024000A = 0x8024000A,
SCE_USBD_ERROR_FATAL = 0x802400FF
@@ -329,13 +329,11 @@ typedef void (*ksceUsbdIsochDoneCallback)(int32_t result, ksceUsbdIsochTransfer
* @param user_data userdata to pass to callback
*
*/
-int ksceUsbdControlTransfer(
- SceUID pipe_id,
+int ksceUsbdControlTransfer(SceUID pipe_id,
const SceUsbdDeviceRequest *req,
unsigned char *buffer,
ksceUsbdDoneCallback cb,
- void *user_data
-);
+ void *user_data);
/**
* Transfer data to/from interrupt endpoint
@@ -349,13 +347,11 @@ int ksceUsbdControlTransfer(
* @param user_data userdata to pass to callback
*
*/
-int ksceUsbdInterruptTransfer(
- SceUID pipe_id,
+int ksceUsbdInterruptTransfer(SceUID pipe_id,
unsigned char *buffer,
SceSize length,
ksceUsbdDoneCallback cb,
- void *user_data
-);
+ void *user_data);
/**
* Transfer isochronous data to/from endpoint
@@ -368,12 +364,10 @@ int ksceUsbdInterruptTransfer(
* @param user_data userdata to pass to callback
*
*/
-int ksceUsbdIsochronousTransfer(
- SceUID pipe_id,
+int ksceUsbdIsochronousTransfer(SceUID pipe_id,
ksceUsbdIsochTransfer* transfer,
ksceUsbdIsochDoneCallback cb,
- void *user_data
-);
+ void *user_data);
/**
* Transfer data to/from endpoint
@@ -388,13 +382,11 @@ int ksceUsbdIsochronousTransfer(
*
* @note buffer pointer must be 64b aligned
*/
-int ksceUsbdBulkTransfer(
- SceUID pipe_id,
+int ksceUsbdBulkTransfer(SceUID pipe_id,
unsigned char *buffer,
unsigned int length,
ksceUsbdDoneCallback cb,
- void *user_data
-);
+ void *user_data);
/**
* Transfer data to/from endpoint
@@ -409,13 +401,11 @@ int ksceUsbdBulkTransfer(
*
* @note buffer pointer must be 64b aligned
*/
-int ksceUsbdBulkTransfer2(
- int pipe_id,
+int ksceUsbdBulkTransfer2(int pipe_id,
unsigned char *buffer,
unsigned int length,
ksceUsbdDoneCallback cb,
- void *user_data
-);
+ void *user_data);
/**
|
[util] Drop unused template arg in string/url, fix msvc warning. | @@ -44,7 +44,7 @@ namespace {
return 0;
}
- template <typename TChar, typename TTraits, typename TBounds>
+ template <typename TChar, typename TBounds>
inline size_t GetHttpPrefixSizeImpl(const TChar* url, const TBounds& urlSize, bool ignorehttps) {
const TChar httpPrefix[] = {'h', 't', 't', 'p', ':', '/', '/', 0};
const TChar httpsPrefix[] = {'h', 't', 't', 'p', 's', ':', '/', '/', 0};
@@ -57,9 +57,7 @@ namespace {
template <typename T>
inline T CutHttpPrefixImpl(const T& url, bool ignorehttps) {
- using TChar = typename T::char_type;
- using TTraits = typename T::traits_type;
- size_t prefixSize = GetHttpPrefixSizeImpl<TChar, TTraits>(url.data(), TKnownSize(url.size()), ignorehttps);
+ size_t prefixSize = GetHttpPrefixSizeImpl<typename T::char_type>(url.data(), TKnownSize(url.size()), ignorehttps);
if (prefixSize)
return url.substr(prefixSize);
return url;
@@ -67,19 +65,19 @@ namespace {
}
size_t GetHttpPrefixSize(const char* url, bool ignorehttps) noexcept {
- return GetHttpPrefixSizeImpl<char, TCharTraits<char>>(url, TUncheckedSize(), ignorehttps);
+ return GetHttpPrefixSizeImpl<char>(url, TUncheckedSize(), ignorehttps);
}
size_t GetHttpPrefixSize(const wchar16* url, bool ignorehttps) noexcept {
- return GetHttpPrefixSizeImpl<wchar16, TCharTraits<wchar16>>(url, TUncheckedSize(), ignorehttps);
+ return GetHttpPrefixSizeImpl<wchar16>(url, TUncheckedSize(), ignorehttps);
}
size_t GetHttpPrefixSize(const TStringBuf url, bool ignorehttps) noexcept {
- return GetHttpPrefixSizeImpl<char, TCharTraits<char>>(url.data(), TKnownSize(url.size()), ignorehttps);
+ return GetHttpPrefixSizeImpl<char>(url.data(), TKnownSize(url.size()), ignorehttps);
}
size_t GetHttpPrefixSize(const TWtringBuf url, bool ignorehttps) noexcept {
- return GetHttpPrefixSizeImpl<wchar16, TCharTraits<wchar16>>(url.data(), TKnownSize(url.size()), ignorehttps);
+ return GetHttpPrefixSizeImpl<wchar16>(url.data(), TKnownSize(url.size()), ignorehttps);
}
TStringBuf CutHttpPrefix(const TStringBuf url, bool ignorehttps) noexcept {
|
Move cert/private key to stack to satisfy Valgrind
Valgrind started detecting the mallocs in this test as a
memory leak when I touched an unrelated part of the test.
I fixed the leak to satisfy Valgrind, but we need a deeper
investigation. See issue: | @@ -48,6 +48,7 @@ int mock_client(struct s2n_test_piped_io *piped_io)
result = s2n_negotiate(client_conn, &blocked);
+ s2n_piped_io_close_one_end(piped_io, S2N_CLIENT);
s2n_connection_free(client_conn);
s2n_config_free(client_config);
@@ -64,18 +65,12 @@ int main(int argc, char **argv)
s2n_blocked_status blocked;
int status;
pid_t pid;
- char *cert_chain_pem;
- char *private_key_pem;
+ char cert_chain_pem[S2N_MAX_TEST_PEM_SIZE];
+ char private_key_pem[S2N_MAX_TEST_PEM_SIZE];
struct s2n_cert_chain_and_key *chain_and_key;
BEGIN_TEST();
- /* Ignore SIGPIPE */
- signal(SIGPIPE, SIG_IGN);
-
- EXPECT_NOT_NULL(cert_chain_pem = malloc(S2N_MAX_TEST_PEM_SIZE));
- EXPECT_NOT_NULL(private_key_pem = malloc(S2N_MAX_TEST_PEM_SIZE));
-
EXPECT_SUCCESS(s2n_read_test_pem(S2N_DEFAULT_TEST_CERT_CHAIN, cert_chain_pem, S2N_MAX_TEST_PEM_SIZE));
EXPECT_SUCCESS(s2n_read_test_pem(S2N_DEFAULT_TEST_PRIVATE_KEY, private_key_pem, S2N_MAX_TEST_PEM_SIZE));
EXPECT_NOT_NULL(chain_and_key = s2n_cert_chain_and_key_new());
@@ -128,8 +123,6 @@ int main(int argc, char **argv)
EXPECT_SUCCESS(s2n_config_free(config));
EXPECT_SUCCESS(s2n_cert_chain_and_key_free(chain_and_key));
- free(cert_chain_pem);
- free(private_key_pem);
END_TEST();
return 0;
|
website: revert to npm install | @@ -35,7 +35,7 @@ else ()
# attempt to install npm dependencies
install (
- CODE "execute_process (COMMAND npm ci --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
+ CODE "execute_process (COMMAND npm install --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
)
generate_manpage (kdb-run-${tool} FILENAME "${CMAKE_CURRENT_BINARY_DIR}/README.md" GENERATED_FROM
|
added some more weak candidates (yearyearyear) | @@ -419,7 +419,7 @@ return;
/*===========================================================================*/
static void keywriteyearyear(void)
{
-int y, y2;
+int y, y2, y3;
for(y = 1900; y <= thisyear; y++)
{
@@ -429,6 +429,18 @@ for(y = 1900; y <= thisyear; y++)
writepsk(pskstring);
}
}
+
+for(y = 1900; y <= thisyear; y++)
+ {
+ for(y2 = 1900; y2 <= thisyear; y2++)
+ {
+ for(y3 = 1900; y3 <= thisyear; y3++)
+ {
+ snprintf(pskstring, 64, "%04d%04d%04d", y, y2, y3);
+ writepsk(pskstring);
+ }
+ }
+ }
return;
}
/*===========================================================================*/
|
use RtlGenRandom on windows to enable compilation as C++ even with dynamic override | @@ -162,20 +162,29 @@ If we cannot get good randomness, we fall back to weak randomness based on a tim
-----------------------------------------------------------------------------*/
#if defined(_WIN32)
+/*
+// We prefer BCryptGenRandom over RtlGenRandom but it leads to a crash a when using dynamic override combined with the C++ runtime :-(
#pragma comment (lib,"bcrypt.lib")
#include <bcrypt.h>
static bool os_random_buf(void* buf, size_t buf_len) {
return (BCryptGenRandom(NULL, (PUCHAR)buf, (ULONG)buf_len, BCRYPT_USE_SYSTEM_PREFERRED_RNG) >= 0);
}
-/*
-#define SystemFunction036 NTAPI SystemFunction036
-#include <NTSecAPI.h>
-#undef SystemFunction036
+*/
+#define RtlGenRandom SystemFunction036
+#ifdef __cplusplus
+extern "C" {
+#endif
+BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength);
+#ifdef __cplusplus
+}
+#endif
static bool os_random_buf(void* buf, size_t buf_len) {
+ mi_assert_internal(buf_len >= sizeof(uintptr_t));
+ memset(buf, 0, buf_len);
RtlGenRandom(buf, (ULONG)buf_len);
- return true;
+ return (((uintptr_t*)buf)[0] != 0); // sanity check (but RtlGenRandom should never fail)
}
-*/
+
#elif defined(ANDROID) || defined(XP_DARWIN) || defined(__APPLE__) || defined(__DragonFly__) || \
defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
defined(__sun) || defined(__wasi__)
|
LAPACK: Fix lapack-test errors in ARM64 threaded version | @@ -284,6 +284,7 @@ static int inner_advanced_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *
}
}
+ MB;
for (i = 0; i < args -> nthreads; i++)
job[mypos].working[i][CACHE_LINE_SIZE * bufferside] = (BLASLONG)buffer[bufferside];
@@ -324,6 +325,7 @@ static int inner_advanced_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *
sa, (FLOAT *)job[current].working[mypos][CACHE_LINE_SIZE * bufferside],
c, lda, is, xxx);
+ MB;
if (is + min_i >= m) {
job[current].working[mypos][CACHE_LINE_SIZE * bufferside] = 0;
}
|
hoon: make +slab respect variance using given mode and return false | [p.gun (slum q.gat q.sam)]
::
++ slab :: test if contains
- |= {cog/@tas typ/type}
+ |= {cog/@tas way/?(%read %rite %both) typ/type}
?= [%| *]
- (~(find ut typ) %read ~[cog])
+ (~(find ut typ) way ~[cog])
::
++ slap
|= {vax/vase gen/hoon} ^- vase :: untyped vase .*
|
Lock cachelines under hash bucket locks
.. or when holding exclusive global metadata lock. | @@ -414,14 +414,16 @@ static int ocf_engine_evict(struct ocf_request *req)
ocf_engine_unmapped_count(req));
}
-static int lock_clines(struct ocf_request *req, enum ocf_engine_lock_type lock,
- ocf_req_async_lock_cb cb)
+static int lock_clines(struct ocf_request *req,
+ const struct ocf_engine_callbacks *engine_cbs)
{
- switch (lock) {
+ enum ocf_engine_lock_type lock_type = engine_cbs->get_lock_type(req);
+
+ switch (lock_type) {
case ocf_engine_lock_write:
- return ocf_req_async_lock_wr(req, cb);
+ return ocf_req_async_lock_wr(req, engine_cbs->resume);
case ocf_engine_lock_read:
- return ocf_req_async_lock_rd(req, cb);
+ return ocf_req_async_lock_rd(req, engine_cbs->resume);
default:
return OCF_LOCK_ACQUIRED;
}
@@ -433,7 +435,6 @@ int ocf_engine_prepare_clines(struct ocf_request *req,
bool mapped;
bool promote = true;
int lock = -ENOENT;
- enum ocf_engine_lock_type lock_type;
struct ocf_metadata_lock *metadata_lock = &req->cache->metadata.lock;
/* Calculate hashes for hash-bucket locking */
@@ -451,8 +452,7 @@ int ocf_engine_prepare_clines(struct ocf_request *req,
if (mapped) {
/* Request cachelines are already mapped, acquire cacheline
* lock */
- lock_type = engine_cbs->get_lock_type(req);
- lock = lock_clines(req, lock_type, engine_cbs->resume);
+ lock = lock_clines(req, engine_cbs);
} else {
/* check if request should promote cachelines */
promote = ocf_promotion_req_should_promote(
@@ -469,6 +469,8 @@ int ocf_engine_prepare_clines(struct ocf_request *req,
* performed holding (at least) hash-bucket write lock */
ocf_req_hash_lock_upgrade(req);
ocf_engine_map(req);
+ if (!req->info.mapping_error)
+ lock = lock_clines(req, engine_cbs);
ocf_req_hash_unlock_wr(req);
if (req->info.mapping_error) {
@@ -482,14 +484,10 @@ int ocf_engine_prepare_clines(struct ocf_request *req,
if (ocf_engine_evict(req) == LOOKUP_MAPPED)
ocf_engine_map(req);
- ocf_metadata_end_exclusive_access(metadata_lock);
- }
+ if (!req->info.mapping_error)
+ lock = lock_clines(req, engine_cbs);
- if (!req->info.mapping_error) {
- /* Request mapped successfully - acquire cacheline
- * lock */
- lock_type = engine_cbs->get_lock_type(req);
- lock = lock_clines(req, lock_type, engine_cbs->resume);
+ ocf_metadata_end_exclusive_access(metadata_lock);
}
}
|
fs/nffs: Remove padding from struct nffs_block
This structure is kept only in RAM so there is no need for adding
padding. | @@ -167,7 +167,6 @@ struct nffs_block {
struct nffs_inode_entry *nb_inode_entry; /* Owning inode. */
struct nffs_hash_entry *nb_prev; /* Previous block in file. */
uint16_t nb_data_len; /* # of data bytes in block. */
- uint16_t reserved16;
};
struct nffs_file {
|
feat: better explanation for bot-reddit-search.c | @@ -445,9 +445,17 @@ int main(int argc, char *argv[])
printf("\n\nThis bot demonstrates how easy it is to have two distinct"
" APIs interacting with eachother (Reddit + Discord).\n"
"1. Type reddit.search<?query> <keywords> \n"
- "Ex1: reddit.search Hello everyone!\n"
- "Ex2: reddit.search?srs=CryptoCurrency+dogecoin dogecoin made me poor\n"
- "Ex3: reddit.search?srs=c_programming&before=t_a1234 Segfault\n"
+ "\tEx1: reddit.search Hello everyone!\n"
+ "\tEx2: reddit.search?srs=CryptoCurrency+dogecoin dogecoin made me poor\n"
+ "\tEx3: reddit.search?srs=c_programming&before=t_a1234 Segfault\n"
+ "2. Edit bot-reddit-search.json to enable auto-search mode \n"
+ "\t2.1. enable: enable auto-search mode\n"
+ "\t2.2. refresh_seconds: interval when bot should perform search\n"
+ "\t2.3. sort: sort results by [new, hot, comments, relevance] \n"
+ "\t2.4. discord_bind_channel_ids: array of channel ids the search results will be output to \n"
+ "\t2.5. keywords: array of keywords that will be searched for\n"
+ "\t2.6. subreddits: array of subreddits for lookup (leave null to include all)\n"
+ "\t2.7. before: show results before a certain message ID\n"
"\nTYPE ANY KEY TO START BOT\n");
fgetc(stdin); // wait for input
|
Should check amplification limit | @@ -10167,7 +10167,8 @@ ngtcp2_ssize ngtcp2_conn_write_vmsg(ngtcp2_conn *conn, ngtcp2_path *path,
origlen = ngtcp2_min(origlen, server_tx_left);
destlen = ngtcp2_min(destlen, server_tx_left);
- if (destlen == 0 && conn->cstat.loss_detection_timer != UINT64_MAX) {
+ if (server_tx_left == 0 &&
+ conn->cstat.loss_detection_timer != UINT64_MAX) {
ngtcp2_log_info(
&conn->log, NGTCP2_LOG_EVENT_RCV,
"loss detection timer canceled due to amplification limit");
|
[io] fix bug in last commit
siconos_run_options are only created in write mode. | @@ -576,7 +576,8 @@ class MechanicsHdf5(object):
use_compression=self._use_compression)
self._solv_data = data(self._data, 'solv', 4,
use_compression=self._use_compression)
- if 'siconos_mechanics_run_options' in self._data:
+
+ if self._mode == 'w':
self._run_options_data = data(self._data, 'siconos_mechanics_run_options', 1,
use_compression=self._use_compression)
|
OcAppleKernelLib: OSBundleLibraries are optional. | @@ -649,7 +649,7 @@ InternalScanPrelinkedKext (
//
DependencyKext = InternalCachedPrelinkedKext (Context, DependencyId);
if (DependencyKext == NULL) {
- return EFI_NOT_FOUND;
+ continue;
}
Status = InternalInsertPrelinkedKextDependency (Kext, Context, DependencyIndex, DependencyKext);
|
use mergedPE align score for comparison w/ chimeric mergedPE score | @@ -72,7 +72,7 @@ void ReadAlign::chimericDetectionPEmerged(ReadAlign &seRA) {
// new chimeric detection routine
- chimRecord=seRA.chimDet->chimericDetectionMult(seRA.nW, seRA.readLength, trBest->maxScore, true);
+ chimRecord=seRA.chimDet->chimericDetectionMult(seRA.nW, seRA.readLength, seRA.trBest->maxScore, true);
};
if ( chimRecord ) {
|
ok, let's bite the bullet, an example OpenNARS can do due to the flexible higher order reasoning, goal spikes to rescue! | @@ -191,7 +191,6 @@ void Memory_Test()
puts("<<Memory test successful");
}
-
void ANSNA_Alphabet_Test()
{
ANSNA_INIT();
@@ -329,7 +328,6 @@ void ANSNA_Pong_Right()
{
ANSNA_Pong_Right_executed = true;
}
-
void ANSNA_Pong(bool useNumericEncoding)
{
OUTPUT = 0;
@@ -504,6 +502,42 @@ void ANSNA_Multistep_Test()
assert(!ANSNA_Lightswitch_GotoSwitch_executed && ANSNA_Lightswitch_ActivateSwitch_executed, "ANSNA needs to activate the switch");
puts("<<ANSNA Multistep test successful");
}
+void ANSNA_Multistep2_Test()
+{
+ puts(">>ANSNA Multistep2 test start");
+ OUTPUT = 0;
+ ANSNA_INIT();
+ ANSNA_AddOperation(Encode_Term("op_goto_switch"), ANSNA_Lightswitch_GotoSwitch);
+ ANSNA_AddOperation(Encode_Term("op_activate_switch"), ANSNA_Lightswitch_ActivateSwitch);
+ for(int i=0; i<5; i++)
+ {
+ ANSNA_AddInputBelief(Encode_Term("start_at"));
+ ANSNA_AddInputBelief(Encode_Term("op_goto_switch"));
+ ANSNA_Cycles(10);
+ ANSNA_AddInputBelief(Encode_Term("switch_at"));
+ ANSNA_Cycles(100);
+ }
+ ANSNA_Cycles(1000);
+ for(int i=0; i<5; i++)
+ {
+ ANSNA_AddInputBelief(Encode_Term("switch_at"));
+ ANSNA_AddInputBelief(Encode_Term("op_activate_switch"));
+ ANSNA_AddInputBelief(Encode_Term("switch_active"));
+ ANSNA_Cycles(5);
+ ANSNA_AddInputBelief(Encode_Term("light_active"));
+ ANSNA_Cycles(100);
+ }
+ ANSNA_AddInputBelief(Encode_Term("start_at"));
+ ANSNA_AddInputGoal(Encode_Term("light_active"));
+ ANSNA_Cycles(100);
+ assert(ANSNA_Lightswitch_GotoSwitch_executed && !ANSNA_Lightswitch_ActivateSwitch_executed, "ANSNA needs to go to the switch first");
+ ANSNA_Lightswitch_GotoSwitch_executed = false;
+ puts("ANSNA arrived at the switch");
+ ANSNA_AddInputBelief(Encode_Term("switch_at"));
+ ANSNA_AddInputGoal(Encode_Term("light_active"));
+ assert(!ANSNA_Lightswitch_GotoSwitch_executed && ANSNA_Lightswitch_ActivateSwitch_executed, "ANSNA needs to activate the switch");
+ puts("<<ANSNA Multistep2 test successful");
+}
int main(int argc, char *argv[])
{
@@ -532,6 +566,7 @@ int main(int argc, char *argv[])
Memory_Test();
ANSNA_Follow_Test();
ANSNA_Multistep_Test();
+ ANSNA_Multistep2_Test();
puts("\nAll tests ran successfully, if you wish to run examples now, just pass the corresponding parameter:");
puts("ANSNA pong (starts Pong example)");
puts("ANSNA numeric-pong (starts Pong example with numeric input)");
|
link libpocl-devices-pthread.so with -pthread | @@ -28,5 +28,5 @@ if(MSVC)
endif(MSVC)
add_pocl_device_library(pocl-devices-pthread pocl-pthread.h pthread.c pthread_scheduler.c pthread_utils.c)
if(ENABLE_LOADABLE_DRIVERS)
-target_link_libraries(pocl-devices-pthread PRIVATE pocl-devices-basic)
+target_link_libraries(pocl-devices-pthread PRIVATE pocl-devices-basic ${PTHREAD_LIBRARY})
endif()
|
Fixes for lovr.filesystem on Linux; | @@ -81,6 +81,13 @@ int lovrFilesystemGetAppdataDirectory(char* dest, unsigned int size) {
#elif EMSCRIPTEN
strncpy(dest, "/home/web_user", size);
return 0;
+#elif __linux__
+ const char* home;
+ if ((home = getenv("HOME")) == NULL) {
+ home = getpwuid(getuid())->pw_dir;
+ }
+
+ snprintf(dest, size, "%s/.config", home);
#else
#error "This platform is missing an implementation for lovrFilesystemGetAppdataDirectory"
#endif
@@ -101,6 +108,11 @@ int lovrFilesystemGetExecutablePath(char* dest, unsigned int size) {
return !GetModuleFileName(NULL, dest, size);
#elif EMSCRIPTEN
return 1;
+#elif __linux__
+ memset(dest, 0, size);
+ if (readlink("/proc/self/exe", dest, size) == -1) {
+ perror("readlink");
+ }
#else
#error "This platform is missing an implementation for lovrFilesystemGetExecutablePath"
#endif
@@ -213,10 +225,12 @@ int lovrFilesystemSetIdentity(const char* identity) {
lovrFilesystemGetAppdataDirectory(state.savePathFull, LOVR_PATH_MAX);
PHYSFS_setWriteDir(state.savePathFull);
snprintf(state.savePathRelative, LOVR_PATH_MAX, "LOVR/%s", identity ? identity : "default");
- snprintf(state.savePathFull, LOVR_PATH_MAX, "%s/%s", state.savePathFull, state.savePathRelative);
+ char fullPathBuffer[LOVR_PATH_MAX];
+ snprintf(fullPathBuffer, LOVR_PATH_MAX, "%s/%s", state.savePathFull, state.savePathRelative);
+ strncpy(state.savePathFull, fullPathBuffer, LOVR_PATH_MAX);
PHYSFS_mkdir(state.savePathRelative);
if (!PHYSFS_setWriteDir(state.savePathFull)) {
- error("Could not set write directory");
+ error("Could not set write directory: %s (%s)", PHYSFS_getLastError(), state.savePathRelative);
}
PHYSFS_mount(state.savePathFull, NULL, 0);
|
Fix setColorWrite(bool) variant; | @@ -270,7 +270,7 @@ static int l_lovrPassSetColor(lua_State* L) {
static int l_lovrPassSetColorWrite(lua_State* L) {
Pass* pass = luax_checktype(L, 1, Pass);
bool r, g, b, a;
- if (lua_gettop(L) <= 1) {
+ if (lua_gettop(L) <= 2) {
r = g = b = a = lua_toboolean(L, 2);
} else {
r = lua_toboolean(L, 2);
|
add thread id to trace, warning, and error messages | @@ -322,11 +322,22 @@ void _mi_fprintf( mi_output_fun* out, void* arg, const char* fmt, ... ) {
va_end(args);
}
+static void mi_vfprintf_thread(mi_output_fun* out, void* arg, const char* prefix, const char* fmt, va_list args) {
+ if (prefix != NULL && strlen(prefix) <= 32 && !_mi_is_main_thread()) {
+ char tprefix[64];
+ snprintf(tprefix, sizeof(tprefix), "%sthread 0x%zx: ", prefix, _mi_thread_id());
+ mi_vfprintf(out, arg, tprefix, fmt, args);
+ }
+ else {
+ mi_vfprintf(out, arg, prefix, fmt, args);
+ }
+}
+
void _mi_trace_message(const char* fmt, ...) {
if (mi_option_get(mi_option_verbose) <= 1) return; // only with verbose level 2 or higher
va_list args;
va_start(args, fmt);
- mi_vfprintf(NULL, NULL, "mimalloc: ", fmt, args);
+ mi_vfprintf_thread(NULL, NULL, "mimalloc: ", fmt, args);
va_end(args);
}
@@ -341,7 +352,7 @@ void _mi_verbose_message(const char* fmt, ...) {
static void mi_show_error_message(const char* fmt, va_list args) {
if (!mi_option_is_enabled(mi_option_show_errors) && !mi_option_is_enabled(mi_option_verbose)) return;
if (mi_atomic_increment_acq_rel(&error_count) > mi_max_error_count) return;
- mi_vfprintf(NULL, NULL, "mimalloc: error: ", fmt, args);
+ mi_vfprintf_thread(NULL, NULL, "mimalloc: error: ", fmt, args);
}
void _mi_warning_message(const char* fmt, ...) {
@@ -349,7 +360,7 @@ void _mi_warning_message(const char* fmt, ...) {
if (mi_atomic_increment_acq_rel(&warning_count) > mi_max_warning_count) return;
va_list args;
va_start(args,fmt);
- mi_vfprintf(NULL, NULL, "mimalloc: warning: ", fmt, args);
+ mi_vfprintf_thread(NULL, NULL, "mimalloc: warning: ", fmt, args);
va_end(args);
}
|
Fix error when compiling union events with variables | @@ -675,6 +675,7 @@ class ScriptBuilder {
}
if(unionValue.type === "variable") {
this.variableCopy(variable, unionValue.value);
+ return variable;
}
throw new Error(`Union type "${unionValue.type}" unknown.`);
}
|
ci: add caching for imgtool pip packages
Cache python dependencies for faster install and test times. | @@ -13,6 +13,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
+ - name: Cache pip
+ uses: actions/cache@v1
+ with:
+ path: ~/.cache/pip
+ key: ${{ runner.os }}-pip
- name: Install packages
run: |
export PATH="$HOME/.local/bin:$PATH"
|
drivers/lp5523: remove static delays from config | @@ -1053,28 +1053,20 @@ lp5523_config(struct led_itf *itf, struct lp5523_cfg *cfg)
goto err;
}
- lp5523_wait(1);
-
rc = lp5523_set_output_log_dim(itf, i, cfg->per_led_cfg[i - 1].log_dim_en);
if (rc) {
goto err;
}
- lp5523_wait(1);
-
rc = lp5523_set_output_temp_comp(itf, i, cfg->per_led_cfg[i - 1].temp_comp);
if (rc) {
goto err;
}
- lp5523_wait(1);
-
rc = lp5523_set_output_on(itf, i, cfg->per_led_cfg[i - 1].output_on);
if (rc) {
goto err;
}
-
- lp5523_wait(1);
}
err:
|
Remove useless loop variable | @@ -236,7 +236,6 @@ void ngtcp2_cc_cubic_cc_free(ngtcp2_cc *cc, const ngtcp2_mem *mem) {
static uint64_t ngtcp2_cbrt(uint64_t n) {
int d;
uint64_t a;
- int i;
if (n == 0) {
return 0;
@@ -257,7 +256,7 @@ static uint64_t ngtcp2_cbrt(uint64_t n) {
#endif
a = 1ULL << ((64 - d) / 3 + 1);
- for (i = 0; a * a * a > n; ++i) {
+ for (; a * a * a > n;) {
a = (2 * a + n / a / a) / 3;
}
return a;
|
BugID:23823329: change default loglevel | #include <aos/kernel.h>
#include <aos/yloop.h>
#include <netmgr.h>
+#include "ulog/ulog.h"
static int lwm2m_client_started = 0;
@@ -35,6 +36,9 @@ int application_start(int argc, char *argv[])
sal_init();
#endif
+ /* Set ulog ouput level to INFO */
+ aos_set_log_level(AOS_LL_INFO);
+
netmgr_init();
aos_register_event_filter(EV_WIFI, wifi_service_event, NULL);
|
Fix inline marking introduced in commit
Forgot to add inline marking in changes_filename() declaration. In the passing, add
inline marking for a similar function subxact_filename().
Reported-By: Nathan Bossart
Discussion: | @@ -198,8 +198,8 @@ typedef struct ApplySubXactData
static ApplySubXactData subxact_data = {0, 0, InvalidTransactionId, NULL};
-static void subxact_filename(char *path, Oid subid, TransactionId xid);
-static void changes_filename(char *path, Oid subid, TransactionId xid);
+static inline void subxact_filename(char *path, Oid subid, TransactionId xid);
+static inline void changes_filename(char *path, Oid subid, TransactionId xid);
/*
* Information about subtransactions of a given toplevel transaction.
@@ -2722,7 +2722,7 @@ subxact_info_add(TransactionId xid)
}
/* format filename for file containing the info about subxacts */
-static void
+static inline void
subxact_filename(char *path, Oid subid, TransactionId xid)
{
snprintf(path, MAXPGPATH, "%u-%u.subxacts", subid, xid);
|
Fix unnecessary rendering of EditorSidebar being caused by useSelector returning full editor state | @@ -8,10 +8,11 @@ import CustomEventEditor from "./CustomEventEditor";
import { VariableEditor } from "./VariableEditor";
import { RootState } from "store/configureStore";
-const EditorSidebar: React.FC = () => {
- const { type, entityId, scene: sceneId } = useSelector((state: RootState) =>
- state.editor
- );
+const EditorSidebar = () => {
+ const type = useSelector((state: RootState) => state.editor.type);
+ const entityId = useSelector((state: RootState) => state.editor.entityId);
+ const sceneId = useSelector((state: RootState) => state.editor.scene);
+
if (type === "trigger") {
return <TriggerEditor key={entityId} id={entityId} sceneId={sceneId} />;
}
|
.github/workflows: add clean network environment step in centos nightly build | @@ -58,14 +58,8 @@ jobs:
rpm -ivh epm-$RUNE_VERSION*.rpm
popd
- - name: Install containerd
+ - name: Configure containerd
run: |
- pushd ${WORK_DIR}
- curl -LO http://aliacs-edge-k8s-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/jiazhuo/containerd-1.3.4.linux-amd64.tar.gz
- tar -xvf containerd-1.3.4.linux-amd64.tar.gz
- /bin/cp -f bin/* /usr/local/bin
- popd
-
cat <<- EOF >/etc/systemd/system/containerd.service
[Unit]
Description=containerd container runtime
@@ -262,6 +256,7 @@ jobs:
- name: Clear the environment
if: always()
run: |
+ sudo kubectl delete pod --all
sudo kubeadm reset -f || true
for service in kubectl kubelet containerd epm
do
@@ -287,4 +282,10 @@ jobs:
sudo rm -fr /var/lib/etcd
sudo rm -f /etc/yum.repos.d/occlum.repo
sudo rm -f /etc/yum.repos.d/kubernetes.repo
- sudo rm -f /usr/local/bin/containerd* /usr/local/bin/ctr
+ sudo ip link set cni0 down
+ sudo ip link delete cni0
+ sudo ip link set flannel.1 down
+ sudo ip link delete flannel.1
+ sudo ip -all netns del
+ sudo ps -ef | grep containerd-shim-rune-v2 | awk '{print $2}' | xargs kill -9 || true
+ sudo systemctl restart docker
|
tools: fix return values | @@ -445,10 +445,10 @@ fpga_result find_dev_feature(fpga_token token,
glob_t pglob;
char feature_path[SYSFS_PATH_MAX] = { 0 };
- res = get_fpga_sbdf(token, &segment, &bus, &device, &function);
- if (res != FPGA_OK) {
+ retval = get_fpga_sbdf(token, &segment, &bus, &device, &function);
+ if (retval != FPGA_OK) {
OPAE_ERR("Failed to get sbdf ");
- return res;
+ return retval;
}
if (snprintf(feature_path, sizeof(feature_path),
|
schema BUGFIX return value check | @@ -92,7 +92,8 @@ lys_resolve_schema_nodeid(struct lysc_ctx *ctx, const char *nodeid, size_t nodei
}
if (implement && !mod->implemented) {
/* make the module implemented */
- lys_set_implemented_internal((struct lys_module*)mod, 2);
+ ret = lys_set_implemented_internal((struct lys_module*)mod, 2);
+ LY_CHECK_RET(ret);
}
if (context_node && context_node->nodetype == LYS_ACTION) {
/* move through input/output manually */
|
[GB] Implement SRA Reg8 instructions | @@ -891,6 +891,21 @@ impl CpuState {
// TODO(PT): Should be four cycles when (HL)
2
}
+ "00101iii" => {
+ // SRA Reg8
+ let (reg, addressing_mode) = self.get_reg_from_lookup_tab1(i);
+ if debug {
+ println!("SRA {reg}");
+ }
+ let contents = reg.read_u8_with_mode(&self, addressing_mode);
+ let lsb = contents & 0b1;
+ let msb = contents >> 7;
+ self.update_flag(FlagUpdate::Carry(lsb == 1));
+ let new_contents = (contents >> 1) | (msb << 7);
+ reg.write_u8_with_mode(&self, addressing_mode, new_contents);
+ // TODO(PT): Should be four cycles when (HL)
+ 2
+ }
_ => {
println!("<cb {:02x} is unimplemented>", instruction_byte);
self.print_regs();
@@ -3542,4 +3557,21 @@ mod tests {
// And interrupts are re-enabled
assert!(int_controller.are_interrupts_globally_enabled());
}
+
+ /* SRA Reg8 */
+
+ #[test]
+ fn test_sra_reg8() {
+ let gb = get_system();
+ let mut cpu = gb.cpu.borrow_mut();
+
+ cpu.reg(RegisterName::A).write_u8(&cpu, 0x8a);
+ gb.run_cb_opcode_with_expected_attrs(&mut cpu, 0x2f, 2);
+ assert_eq!(cpu.reg(RegisterName::A).read_u8(&cpu), 0xc5);
+
+ cpu.reg(RegisterName::A).write_u8(&cpu, 0x01);
+ gb.run_cb_opcode_with_expected_attrs(&mut cpu, 0x2f, 2);
+ assert_eq!(cpu.reg(RegisterName::A).read_u8(&cpu), 0x00);
+ assert!(cpu.is_flag_set(Flag::Carry));
+ }
}
|
Fix the data race in DispatchEvent
* Fix the data race in DispatchEvent
Fix the data race in DispatchEvent
* Update according to comments | @@ -35,13 +35,14 @@ namespace MAT_NS_BEGIN {
/// <summary>Microsoft Telemetry SDK invokes this method to dispatch event to client callback</summary>
bool DebugEventSource::DispatchEvent(DebugEvent evt)
{
- seq++;
- evt.seq = seq;
evt.ts = PAL::getUtcSystemTime();
bool dispatched = false;
{
DE_LOCKGUARD(stateLock());
+ seq++;
+ evt.seq = seq;
+
if (listeners.size()) {
// Events filter handlers list
auto &v = listeners[evt.type];
|
rune/libenclave/skeleton/README.md: add declaration that not support DCAP driver until
now for the rune attest command | # Introduction
-This guide will guide you how to use remote attestation based on SGX in skeleton with rune.
+This guide will guide you how to use remote attestation based on SGX in skeleton with rune. **Currently `rune attest` can only run on the machines with [OOT SGX dirver](https://github.com/intel/linux-sgx-driver), we will support [DCAP driver](https://github.com/intel/SGXDataCenterAttestationPrimitives) as soon as possible**.
# Before you start
- Build a skeleton bundle according to [this guide](https://github.com/alibaba/inclavare-containers/blob/master/rune/libenclave/internal/runtime/pal/skeleton/README.md) from scratch.
|
net/netmgr: remove unused functions
remove unused functions when DEBUG_PORT is disabled | @@ -164,7 +164,7 @@ static char *_convert_udp_type(struct lwip_sock *sock)
}
return "UDP";
}
-
+#ifdef CONFIG_NET_DEBUG_PORT
static void _get_port(int fd, int *port)
{
*port = -1;
@@ -183,6 +183,7 @@ static void _get_port(int fd, int *port)
*port = upcb->local_port;
}
}
+#endif
static inline void _get_tcp_info(int fd, struct lwip_sock *lsock, netmgr_logger_p logger)
{
@@ -343,6 +344,7 @@ static void _get_raw_info(int fd, struct lwip_sock *lsock, netmgr_logger_p logge
}
}
+#ifdef CONFIG_NET_DEBUG_PORT
static void _get_proto(int fd, char **type)
{
*type = UNKNOWN_STR;
@@ -359,6 +361,7 @@ static void _get_proto(int fd, char **type)
*type = UDP_STR;
}
}
+#endif
static inline int _netsock_clone(FAR struct lwip_sock *sock1, FAR struct lwip_sock *sock2)
{
|
fix(setup): Fix sed delimiters for Cradio | @@ -189,7 +189,7 @@ popd
sed -i'.orig' \
-e "s/BOARD_NAME/$board/" \
-e "s/SHIELD_NAME/$shield/" \
- -e "s/KEYBOARD_TITLE/$shield_title/" \
+ -e "s|KEYBOARD_TITLE|$shield_title|" \
.github/workflows/build.yml
if [ "$board" == "proton_c" ]; then
|
address use after free bug | @@ -1601,7 +1601,8 @@ io_readable(neat_ctx *ctx, neat_flow *flow, struct neat_pollable_socket *socket,
#endif // SCTP_MULTISTREAM
// We don't update readBufferSize, so buffer is implicitly "freed"
- if (sctp_event_ret == READ_WITH_ZERO) {
+ if (sctp_event_ret == READ_WITH_ZERO && flow->state == NEAT_FLOW_OPEN) {
+ assert(flow);
flow->readBufferMsgComplete = 1;
}
|
BugID:17865306: Update linkkit Config.in | @@ -5,7 +5,9 @@ menuconfig AOS_LINKKIT
if AOS_LINKKIT
config SRCPATH
string
+## --- Generated Automatically ---
default "middleware/linkkit/sdk-c"
+## --- End ---
source "$SRCPATH/Config.linkkit"
endif
|
add generate one project way | @@ -27,6 +27,13 @@ $ pip install -r requirements.txt
$ progen generate -t uvision
$ venv/Scripts/deactivate
```
+```generate one project
+only generate one specific project,e.g:
+progen generate -f projects.yaml -p stm32f103xb_stm32f746zg_if-t uvision
+use option: -f indication the project file
+ -p indication the project name
+ -t indication the IDE name
+```
Mbedcli project lists compile
```
|
* fixed generation of .gdbinit file (esp32c3 dbg issue) | @@ -98,10 +98,10 @@ def action_extensions(base_actions, project_path):
def create_local_gdbinit(gdbinit, elf_file):
with open(gdbinit, 'w') as f:
- f.write('target remote :3333\n')
if os.name == 'nt':
elf_file = elf_file.replace('\\','\\\\')
- f.write('symbol-file {}\n'.format(elf_file))
+ f.write('file {}\n'.format(elf_file))
+ f.write('target remote :3333\n')
f.write('mon reset halt\n')
f.write('flushregs\n')
f.write('thb app_main\n')
|
ORB: Use popcount for distance. | @@ -473,6 +473,16 @@ array_t *orb_find_keypoints(image_t *img, bool normalized, int threshold,
return kpts;
}
+// This is a modifed popcount that counts every 2 different bits as 1.
+// This is what should actually be used with wta_k == 3 or 4.
+static inline uint32_t popcount(uint32_t i)
+{
+ i = i - ((i >> 1) & 0x55555555);
+ i = ((i & 0xAAAAAAAA)>>1) | (i & 0x55555555);
+ i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
+ return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
+}
+
static kp_t *find_best_match(kp_t *kp1, array_t *kpts, int *dist_out1, int *dist_out2)
{
kp_t *min_kp=NULL;
@@ -486,13 +496,7 @@ static kp_t *find_best_match(kp_t *kp1, array_t *kpts, int *dist_out1, int *dist
if (kp2->matched == 0) {
for (int m=0; m<(KDESC_SIZE/4); m++) {
- uint32_t v = ((uint32_t*)(kp1->desc))[m] ^ ((uint32_t*)(kp2->desc))[m];
- while (v) {
- if (v & 0x3) {
- dist++;
- }
- v >>= 2;
- }
+ dist += popcount(((uint32_t*)(kp1->desc))[m] ^ ((uint32_t*)(kp2->desc))[m]);
}
if (dist < min_dist1) {
|
toml: adapting grammar for whitespaces | @@ -76,22 +76,22 @@ Toml : AnyNewlines Nodes AnyNewlines { driverExitToml(driver); }
| %empty
;
-Nodes : Node
- | Nodes Newlines Node
+Nodes : AnyWS Node
+ | Nodes Newlines AnyWS Node
;
-Node : AnyWS COMMENT { driverExitComment (driver, $2); }
- | AnyWS Table OptComment { driverExitOptCommentTable (driver); }
- | AnyWS KeyPair OptComment { driverExitOptCommentKeyPair (driver); }
+Node : COMMENT { driverExitComment (driver, $1); }
+ | Table OptComment { driverExitOptCommentTable (driver); }
+ | KeyPair OptComment { driverExitOptCommentKeyPair (driver); }
;
-OptComment : AnyWS COMMENT { driverExitComment (driver, $2); } AnySWS
- | AnySWS
+OptComment : AnyWS COMMENT { driverExitComment (driver, $2); }
+ | %empty
;
-Newlines : NEWLINE AnySWS
- | Newlines NEWLINE AnySWS { driverExitNewline (driver); }
+Newlines : NEWLINE
+ | Newlines NEWLINE { driverExitNewline (driver); }
;
AnyNewlines : Newlines
@@ -130,7 +130,7 @@ Value : Scalar { driverExitValue (driver, $1); }
| Array
;
-InlineTable : CURLY_OPEN { driverEnterInlineTable(driver); } AnySWS InlineTableList AnySWS CURLY_CLOSE { driverExitInlineTable (driver); }
+InlineTable : CURLY_OPEN { driverEnterInlineTable(driver); } AnySWS InlineTableList CURLY_CLOSE { driverExitInlineTable (driver); }
| CURLY_OPEN AnySWS CURLY_CLOSE { driverEmptyInlineTable(driver); }
;
@@ -157,8 +157,8 @@ ArrayEpilogue : AnyCommentNL
;
AnyCommentNL : AnyCommentNL NEWLINE { driverExitNewline (driver); }
- | AnyCommentNL AnyWS COMMENT NEWLINE { driverExitComment (driver, $3); }
- | AnySWS
+ | AnyCommentNL COMMENT NEWLINE { driverExitComment (driver, $2); }
+ | %empty
;
Scalar : IntegerScalar { $$ = $1; }
|
Chatty read errors too. | @@ -210,19 +210,19 @@ class HTTPDriver(BaseDriver):
self.write_session.put(self.url, data=gen, headers=headers)
self.write_response = True
except requests.exceptions.ConnectionError as err:
- msg = "Client connection error to %s with headers %s: msg=%s" \
+ msg = "Client connection error to %s with [PUT] headers %s: msg=%s" \
% (self.url, headers, err.message)
warnings.warn(msg)
except requests.exceptions.ConnectTimeout as err:
- msg = "Client connection timeout to %s with headers %s: msg=%s" \
+ msg = "Client connection timeout to %s with [PUT] headers %s: msg=%s" \
% (self.url, headers, err.message)
warnings.warn(msg)
except requests.exceptions.RetryError:
- msg = "Client retry error to %s with headers %s: msg=%s" \
+ msg = "Client retry error to %s with [PUT] headers %s: msg=%s" \
% (self.url, headers, err.message)
warnings.warn(msg)
except requests.exceptions.ReadTimeout:
- msg = "Client read timeout to %s with headers %s: msg=%s" \
+ msg = "Client read timeout to %s with [PUT] headers %s: msg=%s" \
% (self.url, headers, err.message)
warnings.warn(msg)
return self.write_ok
@@ -275,15 +275,21 @@ class HTTPDriver(BaseDriver):
stream=True,
headers=headers,
timeout=self.timeout)
- except requests.exceptions.ConnectionError:
- msg = "Invalid request to %s with headers %s." % (self.url, headers)
+ except requests.exceptions.ConnectionError as err:
+ msg = "Client connection error to %s with [GET] headers %s: msg=%s" \
+ % (self.url, headers, err.message)
+ warnings.warn(msg)
+ except requests.exceptions.ConnectTimeout as err:
+ msg = "Client connection timeout to %s with [GET] headers %s: msg=%s" \
+ % (self.url, headers, err.message)
warnings.warn(msg)
- except requests.exceptions.ConnectTimeout:
- pass
except requests.exceptions.RetryError:
- pass
+ msg = "Client retry error to %s with [GET] headers %s: msg=%s" \
+ % (self.url, headers, err.message)
+ warnings.warn(msg)
except requests.exceptions.ReadTimeout:
- msg = "Invalid request to %s with headers %s." % (self.url, headers)
+ msg = "Client read timeout to %s with [GET] headers %s: msg=%s" \
+ % (self.url, headers, err.message)
warnings.warn(msg)
return self.read_ok
|
BugID:19675668: Disable check of gitee url | @@ -41,11 +41,11 @@ def main():
url = sys.argv[1]
dest_dir = sys.argv[2]
- if check_url(url):
- print ("\nCan't reach url: %s" % url)
- print ("Please check your network and download it manually:\n")
- print (" $ git clone %s %s\n" % (url, dest_dir))
- return 1
+ #if check_url(url):
+ # print ("\nCan't reach url: %s" % url)
+ # print ("Please check your network and download it manually:\n")
+ # print (" $ git clone %s %s\n" % (url, dest_dir))
+ # return 1
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
|
clock: differentiate date and time colors | @@ -14,18 +14,20 @@ const innerSize = 124; // clock size
// }
// }
-let text = '#000000', background = '#ffffff';
+let timeTextColor = '#000000', dateTextColor = '#333333', background = '#ffffff';
const dark = window.matchMedia('(prefers-color-scheme: dark)');
if (dark.matches) {
- text = '#7f7f7f';
+ timeTextColor = '#ffffff';
+ dateTextColor = '#7f7f7f';
background = '#333';
}
function darkColors(dark) {
if (dark.matches) {
- text = '#7f7f7f';
+ timeTextColor = '#ffffff';
+ dateTextColor = '#7f7f7f';
background = '#ffffff';
}
}
@@ -344,10 +346,10 @@ class Clock extends React.Component {
: moment().format('h:mm A');
const dateText = moment().format('MMM Do');
ctx.textAlign = 'center';
- ctx.fillStyle = text;
+ ctx.fillStyle = timeTextColor;
ctx.font = '12px Inter';
ctx.fillText(timeText, ctr, ctr + 6 - 7);
- ctx.fillStyle = text;
+ ctx.fillStyle = dateTextColor;
ctx.font = '12px Inter';
ctx.fillText(dateText, ctr, ctr + 6 + 7);
|
OpenSSL >= v3.0 is mandatory, now | @@ -126,7 +126,7 @@ Requirements
* detailed knowledge of Linux
* Linux (recommended Arch Linux, but other distros should work, too (no support for other distributions).
* gcc >= 11 recommended (deprecated versions are not supported: https://gcc.gnu.org/)
-* libopenssl and openssl-dev installed
+* libopenssl (>= v3.0) and openssl-dev installed
* librt and librt-dev installed (should be installed by default)
* zlib and zlib-dev installed (for gzip compressed cap/pcap/pcapng files)
* libcurl and curl-dev installed (used by whoismac and wlancap2wpasec)
|
Minor adjustment in the "function read_version"
Removed the ":" from the "commit hash:" string in the export command because it doesn't allow the compressed *.7z file to be created at the end of the compilation process | @@ -53,7 +53,7 @@ VERSION_DATE=`date '+%Y%m%d%H%M%S'`
if [ -z "${VERSION_COMMIT}" ]; then
export VERSION="v$VERSION_MAJOR.$VERSION_MINOR Build $VERSION_BUILD"
else
- export VERSION="v$VERSION_MAJOR.$VERSION_MINOR Build $VERSION_BUILD (commit hash: ${VERSION_COMMIT})"
+ export VERSION="v$VERSION_MAJOR.$VERSION_MINOR Build $VERSION_BUILD (commit hash ${VERSION_COMMIT})"
fi
}
|
Rename test log file to match reference file name | @@ -538,7 +538,7 @@ void picoquic_binlog_frames(FILE* F, uint8_t* bytes, size_t length);
static char const* log_test_file = "log_test.txt";
static char const* log_fuzz_test_file = "log_fuzz_test.txt";
static char const* log_packet_test_file = "log_fuzz_test.txt";
-static char const* binlog_test_file = "binlog_test.txt";
+static char const* binlog_test_file = "binlog_test.log";
#define LOG_TEST_REF "picoquictest" PICOQUIC_FILE_SEPARATOR "log_test_ref.txt"
#define BINLOG_TEST_REF "picoquictest" PICOQUIC_FILE_SEPARATOR "binlog_ref.log"
|
drv doc: add note about binutils >= 2.25
as a requirement for 512-bit PR. | @@ -71,6 +71,13 @@ the AF.
In all other cases PR fails and may cause system instability.
+.. note::
+
+```
+ Platforms that support 512-bit Partial Reconfiguration require
+ binutils >= version 2.25.
+```
+
Close any software program accessing the FPGA, including software programs running in a virtualized host before
initiating PR. Here is the recommended sequence:
|
add missing changes in de_web_plugin_private.h | @@ -415,7 +415,6 @@ extern const quint64 silabs2MacPrefix;
extern const quint64 xiaomiMacPrefix;
extern const quint64 computimeMacPrefix;
extern const quint64 konkeMacPrefix;
-extern const quint64 sunricherMacPrefix;
inline bool checkMacVendor(quint64 addr, quint16 vendor)
{
@@ -430,8 +429,7 @@ inline bool checkMacVendor(quint64 addr, quint16 vendor)
return prefix == emberMacPrefix ||
prefix == jennicMacPrefix;
case VENDOR_SUNRICHER:
- return prefix == emberMacPrefix ||
- prefix == sunricherMacPrefix;
+ return prefix == emberMacPrefix;
case VENDOR_BITRON:
return prefix == tiMacPrefix;
case VENDOR_BOSCH:
|
Refactor Ethereum ABI decoding logic to do less busywork
++decode-arguments now takes already-parsed words, rather than a of
words, so that we operate on straight atom values instead of hex
strings.
For the ++decode-topics case, we no longer re-string and un-string the
input data prior to processing. | ::
:: decoding
::
- ++ decode-topics
- :: tox: list of hex words
- |* [tox=(lest @ux) tys=(list etyp)]
- =- (decode-arguments (crip -) tys)
- %+ roll `(list @ux)`tox
- |= [top=@ tos=tape]
- (weld tos (render-hex-bytes 32 top))
+ ++ decode-topics decode-arguments
::
++ decode-results
:: rex: string of hex bytes with leading 0x.
|* [rex=@t tys=(list etyp)]
- (decode-arguments (rsh 3 2 rex) tys)
+ =- (decode-arguments - tys)
+ %+ turn (rip 9 (rsh 3 2 rex))
+ (curr rash hex)
::
++ decode-arguments
- |* [res=@t tys=(list etyp)]
+ |* [wos=(list @) tys=(list etyp)]
+ =/ wos=(list @) wos :: get rid of tmi
=| win=@ud
- =/ wos=(list @t) (rip 9 res)
=< (decode-from 0 tys)
|%
++ decode-from
?(%address %bool %uint) :: %int %real %ureal
:- +(win)
?- typ
- %address `@ux`(rash wor hex)
- %uint `@ud`(rash wor hex)
- %bool =(1 (rash wor hex))
+ %address `@ux`wor
+ %uint `@ud`wor
+ %bool =(1 wor)
==
::
%string
=+ $(tys ~[%bytes])
- ~! -
[nin (trip (swp 3 q.dat))]
::
%bytes
:- +(win)
:: find the word index of the actual data.
- =/ lic=@ud (div (rash wor hex) 32)
+ =/ lic=@ud (div wor 32)
:: learn the bytelength of the data.
- =/ len=@ud (rash (snag lic wos) hex)
+ =/ len=@ud (snag lic wos)
(decode-bytes-n +(lic) len)
::
[%bytes-n *]
[%array *]
:- +(win)
:: find the word index of the actual data.
- =. win (div (rash wor hex) 32)
+ =. win (div wor 32)
:: read the elements from their location.
%- tail
%^ decode-array-n ~[t.typ] +(win)
- (rash (snag win wos) hex)
+ (snag win wos)
::
[%array-n *]
(decode-array-n ~[t.typ] win n.typ)
|= [fro=@ud bys=@ud]
^- octs
:: parse {bys} bytes from {fro}.
- =- [bys (rash - hex)]
- %^ end 3 (mul 2 bys)
- %+ can 9
- %+ turn
- (swag [fro +((div (dec bys) 32))] wos)
- |=(a=@t [1 a])
+ :- bys
+ %^ rsh 3 (sub 32 (mod bys 33))
+ %+ rep 8
+ (flop (swag [fro +((div (dec bys) 32))] wos))
::
++ decode-array-n
::NOTE we take (list etyp) even though we only operate on
:: a single etyp as a workaround for urbit/arvo#673
+ ::NOTE careful! produces lists without type info
=| res=(list)
- ~& %watch-out--arrays-without-typeinfo
|* [tys=(list etyp) fro=@ud len=@ud]
^- [@ud (list)]
?~ tys !!
|
Remove ltests from Lua 5.4 files | @@ -224,7 +224,7 @@ if %LUA_SVER%==53 (
)
)
if %LUA_SVER%==54 (
- set FILES_CORE=lapi lcode lctype ldebug ldo ldump lfunc lgc llex lmem lobject lopcodes lparser lstate lstring ltable ltm lundump lvm lzio ltests lauxlib
+ set FILES_CORE=lapi lcode lctype ldebug ldo ldump lfunc lgc llex lmem lobject lopcodes lparser lstate lstring ltable ltm lundump lvm lzio lauxlib
set FILES_LIB=lbaselib ldblib liolib lmathlib loslib ltablib lstrlib lutf8lib loadlib lcorolib linit
set FILES_DLL=lua
set FILES_OTH=luac
|
doc: remove notes section in OSSL_ENCODER.pod
Fixes
The note wasn't adding anything useful. | @@ -108,12 +108,6 @@ otherwise 0.
OSSL_ENCODER_number() returns an integer.
-=head1 NOTES
-
-OSSL_ENCODER_fetch() may be called implicitly by other fetching
-functions, using the same library context and properties.
-Any other API that uses keys will typically do this.
-
=head1 SEE ALSO
L<provider(7)>, L<OSSL_ENCODER_CTX(3)>, L<OSSL_ENCODER_to_bio(3)>,
|
yasm: actually add include path to command line | @@ -6,7 +6,7 @@ function apply(env, options)
env:set_many {
["YASM"] = "yasm",
- ["ASMCOM"] = "$(YASM) -o $(@) $(ASMDEFS:p-D ) $(ASMOPTS) $(<)",
+ ["ASMCOM"] = "$(YASM) -o $(@) $(ASMDEFS:p-D ) $(ASMINCPATH:p-I ) $(ASMOPTS) $(<)",
["ASMINC_KEYWORDS"] = { "%include" },
}
end
|
CCode: Update documentation of `encodeName` | @@ -182,8 +182,6 @@ class Coder
/**
* @brief This function replaces unescaped characters in a key name with escaped characters.
*
- * @pre The variable `buffer` needs to be twice as large as the size of the name of `key`.
- *
* @param key This `Key` stores a name possibly containing unescaped special characters.
*
* @return A copy of `key` containing an escaped version of the name of `key`
|
testcase/semaphore: Modify sem flag value checking when semaphore is initialized
After initializing semaphore, sem flag will be set like below.
sem_flag = FLAGS_INITIALIZED;
sem_flag &= ~(PRIOINHERIT_FLAGS_DISABLE); | @@ -51,6 +51,7 @@ static void tc_libc_semaphore_sem_init(void)
sem_t sem;
unsigned int value = SEM_VALUE;
int ret_chk;
+ uint8_t sem_flag;
ret_chk = sem_init(NULL, PSHARED, 0);
TC_ASSERT_EQ("sem_init", ret_chk, ERROR);
@@ -64,7 +65,9 @@ static void tc_libc_semaphore_sem_init(void)
TC_ASSERT_EQ("sem_init", ret_chk, OK);
TC_ASSERT_EQ("sem_init", sem.semcount, value);
#ifdef CONFIG_PRIORITY_INHERITANCE
- TC_ASSERT_EQ("sem_init", sem.flags, 0);
+ sem_flag = FLAGS_INITIALIZED;
+ sem_flag &= ~(PRIOINHERIT_FLAGS_DISABLE);
+ TC_ASSERT_EQ("sem_init", sem.flags, sem_flag);
#if CONFIG_SEM_PREALLOCHOLDERS > 0
TC_ASSERT_EQ("sem_init", sem.hhead, NULL);
#else
|
Fix missing quotes around thunderx targets | @@ -198,7 +198,7 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
set(CGEMM_UNROLL_N 4)
set(ZGEMM_UNROLL_M 8)
set(ZGEMM_UNROLL_N 4)
- elseif ("${CORE}" STREQUAL "THUNDERX)
+ elseif ("${CORE}" STREQUAL "THUNDERX")
file(APPEND ${TARGET_CONF_TEMP}
"#define L1_CODE_SIZE\t32768\n"
"#define L1_CODE_LINESIZE\t64\n"
@@ -224,7 +224,7 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
set(CGEMM_UNROLL_N 2)
set(ZGEMM_UNROLL_M 2)
set(ZGEMM_UNROLL_N 2)
- elseif ("${CORE}" STREQUAL "THUNDERX2T99)
+ elseif ("${CORE}" STREQUAL "THUNDERX2T99")
file(APPEND ${TARGET_CONF_TEMP}
"#define L1_CODE_SIZE\t32768\n"
"#define L1_CODE_LINESIZE\t64\n"
|
sets correct gruvbox defaultfg and cursor colors, restores poss. to use 257+ colors | @@ -102,9 +102,10 @@ static const char *colorname[] = {
"#d3869b",
"#8ec07c",
"#ebdbb2",
+ [255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"black", /* 256 -> bg */
- "brwhite", /* 257 -> fg */
+ "white", /* 257 -> fg */
};
@@ -112,10 +113,10 @@ static const char *colorname[] = {
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
-unsigned int defaultfg = 12;
+unsigned int defaultfg = 15;
unsigned int defaultbg = 0;
-static unsigned int defaultcs = 14;
-static unsigned int defaultrcs = 15;
+static unsigned int defaultcs = 15;
+static unsigned int defaultrcs = 0;
/*
* Default shape of cursor
|
gk110: Add acout37 flag for imul LIMM form | @@ -1536,7 +1536,7 @@ static struct insn tabm[] = {
{ 0x2600000000000002ull, 0x3fc0000000000003ull, N("cvt"), T(sat35), T(cvti2idst), T(neg30), T(abs34), T(cvti2isrc) },
{ 0x25c0000000000002ull, 0x3fc0000000000003ull, N("cvt"), T(frm2a), T(cvti2fdst), T(neg30), T(abs34), T(cvti2fsrc) },
{ 0x27c0000000000002ull, 0x3fc0000000000003ull, N("rshf"), T(high33), N("b32"), DST, SESTART, T(us64_28), SRC1, SRC3, SEEND, T(shfclamp), T(is2) }, // XXX: check is2 and bits 0x29,0x33(swap srcs ?)
- { 0x2800000000000002ull, 0xf880000000000003ull, N("mul"), T(high38), DST, T(us32_39), SRC1, T(us32_3a), LIMM },
+ { 0x2800000000000002ull, 0xf800000000000003ull, N("mul"), T(high38), DST, T(acout37), T(us32_39), SRC1, T(us32_3a), LIMM },
{ 0x3000000000000002ull, 0xf800000000000003ull, N("suldgb"), T(sudst1), T(sulcop2), T(sclamp2l), T(suldty), GLOBALDSU, CONST, T(sup) },
{ 0x3800000000000002ull, 0xf8000000000000f3ull, N("sustgb"), T(suscop2), T(sclamp2s2), T(sustty2), GLOBALDSU, CONST, SRC3, T(sup2) },
{ 0x3800000000000002ull, 0xf800000000000003ull, N("sustgp"), T(suscop2), T(sclamp2s2), T(sustty2), GLOBALDSU, CONST, SUSTPSRC1, T(sup2) },
|
Use macro for checking return values | @@ -423,19 +423,9 @@ cleanupHAPI()
// If HAPI is not initialized, then don't try to do cleanup. This could be
// because HAPI failed to initialize, or HARS disconnected.
- if( HAPI_FAIL( HAPI_IsInitialized( Util::theHAPISession.get() ) ) )
- {
- return true;
- }
+ CHECK_HAPI_AND_RETURN( HAPI_IsInitialized( Util::theHAPISession.get() ), true );
- HAPI_Result hstat = HAPI_RESULT_SUCCESS;
-
- hstat = HAPI_Cleanup( Util::theHAPISession.get() );
- if(hstat != HAPI_RESULT_SUCCESS)
- {
- CHECK_HAPI(hstat);
- return false;
- }
+ CHECK_HAPI_AND_RETURN( HAPI_Cleanup( Util::theHAPISession.get() ), false );
return true;
}
|
usrsock_rpmsg: fix can't wake ppoll when no ACTION
N/A
no matter open/close CONFIG_SIGUSR1_ACTION, usrsock always do,
unmask SIGUSR1, set action to NULL. | @@ -839,6 +839,7 @@ int main(int argc, char *argv[])
pthread_mutex_init(&priv->mutex, NULL);
pthread_cond_init(&priv->cond, NULL);
+ signal(SIGUSR1, SIG_IGN);
sigprocmask(SIG_SETMASK, NULL, &sigmask);
sigaddset(&sigmask, SIGUSR1);
sigprocmask(SIG_SETMASK, &sigmask, NULL);
|
mynewt.h: Include generated `logcfg/logcfg.h` file
Modify `mynewt.h` to take advantage of the new logcfg newt feature.
Now, `mynewt.h` includes the generated logcfg header. | #include "defs/error.h"
#include "sys/debug_panic.h"
+/* Only include the logcfg header if this version of newt can generate it. */
+#if MYNEWT_VAL(NEWT_FEATURE_LOGCFG)
+#include "logcfg/logcfg.h"
+#endif
+
#endif
|
Allow dns tests that require an internet connection to fail when offline
Closes | @@ -19,6 +19,11 @@ return require('lib/tap')(function (test)
socktype = "stream",
family = "inet",
}, expect(function (err, res)
+ -- allow failure when offline
+ if err == "EAI_AGAIN" then
+ print(err, "skipping")
+ return
+ end
assert(not err, err)
p(res, #res)
assert(#res > 0)
@@ -32,6 +37,11 @@ return require('lib/tap')(function (test)
socktype = "stream",
family = "inet6",
}, expect(function (err, res)
+ -- allow failure when offline
+ if err == "EAI_AGAIN" then
+ print(err, "skipping")
+ return
+ end
assert(not err, err)
p(res, #res)
assert(#res == 1)
@@ -43,6 +53,11 @@ return require('lib/tap')(function (test)
assert(uv.getaddrinfo("luvit.io", nil, {
socktype = "stream",
}, expect(function (err, res)
+ -- allow failure when offline
+ if err == "EAI_AGAIN" then
+ print(err, "skipping")
+ return
+ end
assert(not err, err)
p(res, #res)
assert(#res > 0)
@@ -51,6 +66,11 @@ return require('lib/tap')(function (test)
test("Get all adresses for luvit.io", function (print, p, expect, uv)
assert(uv.getaddrinfo("luvit.io", nil, nil, expect(function (err, res)
+ -- allow failure when offline
+ if err == "EAI_AGAIN" then
+ print(err, "skipping")
+ return
+ end
assert(not err, err)
p(res, #res)
assert(#res > 0)
@@ -61,6 +81,11 @@ return require('lib/tap')(function (test)
assert(uv.getnameinfo({
family = "inet",
}, expect(function (err, hostname, service)
+ -- allow failure when offline
+ if err == "EAI_AGAIN" then
+ print(err, "skipping")
+ return
+ end
p{err=err,hostname=hostname,service=service}
assert(not err, err)
assert(hostname)
@@ -69,9 +94,14 @@ return require('lib/tap')(function (test)
end)
test("Lookup local ipv4 address sync", function (print, p, expect, uv)
- local hostname, service = assert(uv.getnameinfo({
+ local hostname, service, err = uv.getnameinfo({
family = "inet",
- }))
+ })
+ -- allow failure when offline
+ if err == "EAI_AGAIN" then
+ print(err, "skipping")
+ return
+ end
p{hostname=hostname,service=service}
assert(hostname)
assert(service)
|
Update documentation to explain redisConnectWithOptions.
Additionally document the new `REDIS_OPT_PREFER_IPV4`,
`REDIS_OPT_PREFER_IPV6` as well as the rest of our existing options.
See | @@ -82,6 +82,7 @@ an error state. The field `errstr` will contain a string with a description of
the error. More information on errors can be found in the **Errors** section.
After trying to connect to Redis using `redisConnect` you should
check the `err` field to see if establishing the connection was successful:
+
```c
redisContext *c = redisConnect("127.0.0.1", 6379);
if (c == NULL || c->err) {
@@ -94,6 +95,40 @@ if (c == NULL || c->err) {
}
```
+One can also use `redisConnectWithOptions` which takes a `redisOptions` argument
+that can be configured with endpoint information as well as many different flags
+to change how the `redisContext` will be configured.
+
+```c
+redisOptions opt = {0};
+
+/* One can set the endpoint with one of our helper macros */
+if (tcp) {
+ REDIS_OPTIONS_SET_TCP(&opt, "localhost", 6379);
+} else {
+ REDIS_OPTIONS_SET_UNIX(&opt, "/tmp/redis.sock");
+}
+
+/* And privdata can be specified with another helper */
+REDIS_OPTIONS_SET_PRIVDATA(&opt, myPrivData, myPrivDataDtor);
+
+/* Finally various options may be set via the `options` member, as described below */
+opt->options |= REDIS_OPT_PREFER_IPV4;
+```
+
+### Configurable redisOptions flags
+
+There are several flags you may set in the `redisOptions` struct to change default behavior. You can specify the flags via the `redisOptions->options` member.
+
+| Flag | Description |
+| --- | --- |
+| REDIS\_OPT\_NONBLOCK | Tells hiredis to make a non-blocking connection. |
+| REDIS\_OPT\_REUSEADDR | Tells hiredis to set the [SO_REUSEADDR](https://man7.org/linux/man-pages/man7/socket.7.html) socket option |
+| REDIS\_OPT\_PREFER\_IPV4<br>REDIS\_OPT\_PREFER_IPV6 | Informs hiredis to either prefer `IPV4` or `IPV6` when invoking [getaddrinfo](https://man7.org/linux/man-pages/man3/gai_strerror.3.html). Note that both of the options may be set at once, which will cause hiredis to spcify `AF_UNSPEC` in the getaddrinfo call, which means both `IPV4` and `IPV6` addresses will be searched simultaneously. |
+| REDIS\_OPT\_NO\_PUSH\_AUTOFREE | Tells hiredis to not install the default RESP3 PUSH handler (which just intercepts and frees the replies). This is useful in situations where you want to process these messages in-band. |
+| REDIS\_OPT\_NOAUOTFREEREPLIES | **ASYNC**: tells hiredis not to automatically invoke `freeReplyObject` after executing the reply callback. |
+| REDIS\_OPT\_NOAUTOFREE | **ASYNC**: Tells hiredis not to automatically free the `redisAsyncContext` on connection/communication failure, but only if the user makes an explicit call to `redisAsyncDisconnect` or `redisAsyncFree` |
+
*Note: A `redisContext` is not thread-safe.*
### Sending commands
|
Prevent warn on sign conversion, overlapping compile flags | @@ -32,6 +32,8 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
WalletKitCoreTests/test/include
include
src)
+ set_target_properties(test_bitcoin
+ PROPERTIES COMPILE_FLAGS "-Wno-sign-conversion")
target_link_libraries (test_bitcoin
WalletKitCore)
@@ -80,7 +82,7 @@ target_include_directories (WalletKitCore
# specify compiler warnings
target_compile_options (WalletKitCore
- PUBLIC
+ PRIVATE
"-Wall"
"-Wconversion"
"-Wsign-conversion"
|
board/voxel/board.c: Format with clang-format
BRANCH=none
TEST=none | @@ -80,8 +80,8 @@ static const struct ec_response_keybd_config zbu_old_kb = {
.capabilities = KEYBD_CAP_SCRNLOCK_KEY,
};
-__override
-const struct ec_response_keybd_config *board_vivaldi_keybd_config(void)
+__override const struct ec_response_keybd_config *
+board_vivaldi_keybd_config(void)
{
if (get_board_id() > 2)
return &zbu_new_kb;
@@ -111,12 +111,11 @@ __override struct keyboard_scan_config keyscan_config = {
* that we don't have pin 0.
*/
const int keyboard_factory_scan_pins[][2] = {
- {-1, -1}, {0, 5}, {1, 1}, {1, 0}, {0, 6},
- {0, 7}, {-1, -1}, {-1, -1}, {1, 4}, {1, 3},
- {-1, -1}, {1, 6}, {1, 7}, {3, 1}, {2, 0},
- {1, 5}, {2, 6}, {2, 7}, {2, 1}, {2, 4},
- {2, 5}, {1, 2}, {2, 3}, {2, 2}, {3, 0},
- {-1, -1}, {0, 4}, {-1, -1}, {8, 2}, {-1, -1},
+ { -1, -1 }, { 0, 5 }, { 1, 1 }, { 1, 0 }, { 0, 6 }, { 0, 7 },
+ { -1, -1 }, { -1, -1 }, { 1, 4 }, { 1, 3 }, { -1, -1 }, { 1, 6 },
+ { 1, 7 }, { 3, 1 }, { 2, 0 }, { 1, 5 }, { 2, 6 }, { 2, 7 },
+ { 2, 1 }, { 2, 4 }, { 2, 5 }, { 1, 2 }, { 2, 3 }, { 2, 2 },
+ { 3, 0 }, { -1, -1 }, { 0, 4 }, { -1, -1 }, { 8, 2 }, { -1, -1 },
{ -1, -1 },
};
const int keyboard_factory_scan_pins_used =
@@ -314,12 +313,12 @@ static void setup_board_tcpc(void)
if (board_id == 0) {
/* config typec C0 prot TUSB422 TCPC */
- tcpc_config[USBC_PORT_C0].i2c_info.addr_flags
- = TUSB422_I2C_ADDR_FLAGS;
+ tcpc_config[USBC_PORT_C0].i2c_info.addr_flags =
+ TUSB422_I2C_ADDR_FLAGS;
tcpc_config[USBC_PORT_C0].drv = &tusb422_tcpm_drv;
/* config typec C1 prot TUSB422 TCPC */
- tcpc_config[USBC_PORT_C1].i2c_info.addr_flags
- = TUSB422_I2C_ADDR_FLAGS;
+ tcpc_config[USBC_PORT_C1].i2c_info.addr_flags =
+ TUSB422_I2C_ADDR_FLAGS;
tcpc_config[USBC_PORT_C1].drv = &tusb422_tcpm_drv;
}
}
|
anim_encode: fix integer overflow
calculate the file duration using unsigned math. this could still result
in an incorrect average duration calculation if there were multiple
rollovers. caching the duration is an option if it was desirable to
support such an extreme case. | @@ -1536,7 +1536,8 @@ int WebPAnimEncoderAssemble(WebPAnimEncoder* enc, WebPData* webp_data) {
if (!enc->got_null_frame_ && enc->in_frame_count_ > 1 && enc->count_ > 0) {
// set duration of the last frame to be avg of durations of previous frames.
- const double delta_time = enc->prev_timestamp_ - enc->first_timestamp_;
+ const double delta_time =
+ (uint32_t)enc->prev_timestamp_ - enc->first_timestamp_;
const int average_duration = (int)(delta_time / (enc->in_frame_count_ - 1));
if (!IncreasePreviousDuration(enc, average_duration)) {
return 0;
|
Add a test for subtracting a vector from itself. | @@ -279,6 +279,32 @@ vector_vec_norm_0(CuTest *tc)
___TEARDOWN___
}
+void
+vector_vec_sub_same(CuTest *tc)
+{
+ ___SETUP___
+ tsReal vec[5], dist;
+
+ ___GIVEN___
+ vec[0] = (tsReal) 1.0;
+ vec[1] = (tsReal) 2.0;
+ vec[2] = (tsReal) 3.0;
+ vec[3] = (tsReal) 4.0;
+ vec[4] = (tsReal) 5.0;
+
+ ___WHEN___
+ ts_vec_sub(vec, vec, 3, vec);
+ dist = ts_distance_varargs(tc, 3, vec, 0.0, 0.0, 0.0);
+
+ ___THEN___
+ CuAssertDblEquals(tc, 0.0, dist, POINT_EPSILON);
+ /* Check for out-of-bounds */
+ CuAssertDblEquals(tc, 4.0, vec[3], POINT_EPSILON);
+ CuAssertDblEquals(tc, 5.0, vec[4], POINT_EPSILON);
+
+ ___TEARDOWN___
+}
+
CuSuite *
get_vector_suite()
{
@@ -294,5 +320,6 @@ get_vector_suite()
SUITE_ADD_TEST(suite, vector_vec_mag_2_3_4);
SUITE_ADD_TEST(suite, vector_vec_mag_dim_0);
SUITE_ADD_TEST(suite, vector_vec_norm_0);
+ SUITE_ADD_TEST(suite, vector_vec_sub_same);
return suite;
}
|
linux-raspberrypi-dev: Update to v4.15.y | @@ -7,8 +7,8 @@ python __anonymous() {
FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:"
-LINUX_VERSION ?= "4.14"
-LINUX_RPI_DEV_BRANCH ?= "rpi-4.14.y"
+LINUX_VERSION ?= "4.15"
+LINUX_RPI_DEV_BRANCH ?= "rpi-4.15.y"
SRCREV = "${AUTOREV}"
SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=${LINUX_RPI_DEV_BRANCH} \
|
bugID:18350314:[bt] Config BT tx/rx default buffer count to 3,sync with zephyr. | #define CONFIG_BT_RX_BUF_COUNT 5
#else
#ifndef CONFIG_BT_RX_BUF_COUNT
-#define CONFIG_BT_RX_BUF_COUNT 10
+#define CONFIG_BT_RX_BUF_COUNT 3
#endif
#endif
#undef CONFIG_BT_L2CAP_TX_BUF_COUNT
#define CONFIG_BT_L2CAP_TX_BUF_COUNT 3
#else
-#define CONFIG_BT_L2CAP_TX_BUF_COUNT 10
+#define CONFIG_BT_L2CAP_TX_BUF_COUNT 3
#endif
#endif
|
Bypass cert path validations in D2C handshakes | @@ -1199,7 +1199,13 @@ oc_tls_add_peer(oc_endpoint_t *endpoint, int role)
transport_type);
#ifdef OC_PKI
+#if defined(OC_CLOUD) && defined(OC_CLIENT)
+ if (ciphers != cloud_priority) {
+#endif /* OC_CLOUD && OC_CLIENT */
mbedtls_ssl_conf_verify(&peer->ssl_conf, verify_certificate, peer);
+#if defined(OC_CLOUD) && defined(OC_CLIENT)
+ }
+#endif /* OC_CLOUD && OC_CLIENT */
#endif /* OC_PKI */
oc_tls_set_ciphersuites(&peer->ssl_conf, endpoint);
@@ -1682,6 +1688,19 @@ read_application_data(oc_tls_peer_t *peer)
peer->ssl_ctx.session->ciphersuite);
oc_handle_session(&peer->endpoint, OC_SESSION_CONNECTED);
#ifdef OC_CLIENT
+#if defined(OC_CLOUD) && defined(OC_PKI)
+ if (!peer->ssl_conf.f_vrfy) {
+ const mbedtls_x509_crt *cert =
+ mbedtls_ssl_get_peer_cert(&peer->ssl_ctx);
+ oc_string_t uuid;
+ if (oc_certs_parse_CN_for_UUID(cert, &uuid) < 0) {
+ peer->uuid.id[0] = '*';
+ } else {
+ oc_str_to_uuid(oc_string(uuid), &peer->uuid);
+ oc_free_string(&uuid);
+ }
+ }
+#endif /* OC_CLOUD && OC_PKI */
#ifdef OC_PKI
if (auto_assert_all_roles && !oc_tls_uses_psk_cred(peer) &&
oc_get_all_roles()) {
|
{AH} ensure that template/header/reference_names are defined when writing | @@ -802,6 +802,11 @@ cdef class AlignmentFile(HTSFile):
if mode[0] == 'w':
# open file for writing
+ if not (template or header or reference_names):
+ raise ValueError(
+ "either supply options `template`, `header` or both `reference_names` "
+ "and `reference_lengths` for writing")
+
if template:
# header is copied, though at the moment not strictly
# necessary as AlignmentHeader is immutable.
|
also prepend digits | @@ -598,6 +598,8 @@ for(d = 0; d < 1000; d++)
{
snprintf(pskstring, 64, "%s%03d", basestring, d);
writepsk(pskstring);
+ snprintf(pskstring, 64, "%03d%s", d, basestring);
+ writepsk(pskstring);
}
return;
}
@@ -610,6 +612,8 @@ for(d = 0; d < 100; d++)
{
snprintf(pskstring, 64, "%s%02d", basestring, d);
writepsk(pskstring);
+ snprintf(pskstring, 64, "%02d%s", d, basestring);
+ writepsk(pskstring);
}
return;
}
@@ -622,6 +626,8 @@ for(d = 0; d < 10; d++)
{
snprintf(pskstring, 64, "%s%d", basestring, d);
writepsk(pskstring);
+ snprintf(pskstring, 64, "%d%s", d, basestring);
+ writepsk(pskstring);
}
return;
}
@@ -634,6 +640,8 @@ for(y = 1900; y <= thisyear; y++)
{
snprintf(pskstring, 64, "%s%04d", basestring, y);
writepsk(pskstring);
+ snprintf(pskstring, 64, "%04d%s", y, basestring);
+ writepsk(pskstring);
}
return;
}
|
kconfig: extend the max msix table number to 64
There are some devices (like Samsung NVMe SSD SM981/PM981 which has 33 MSIX tables)
which have more than 16 MSIX tables. Extend the default value to 64 to handle them. | @@ -309,7 +309,7 @@ config MAX_PCI_DEV_NUM
config MAX_MSIX_TABLE_NUM
int "Maximum number of MSI-X tables per device"
range 1 2048
- default 16
+ default 64
config ENFORCE_VALIDATED_ACPI_INFO
bool "Enforce the use of validated ACPI info table"
|
Hotfix: disable send queue | @@ -971,11 +971,11 @@ int xdag_create_block(struct xdag_field *fields, int inputsCount, int outputsCou
block[0].field[XDAG_BLOCK_FIELDS - 1].data, sizeof(xdag_hash_t));
}
- if(g_xdag_pool) { /* append pool created block to list */
- xdag_append_new_block(block);
- } else { /* send miner created block directly */
+// if(g_xdag_pool) { /* append pool created block to list */
+// xdag_append_new_block(block);
+// } else { /* send miner created block directly */
xdag_send_new_block(block);
- }
+// }
if(newBlockHashResult != NULL) {
memcpy(newBlockHashResult, newBlockHash, sizeof(xdag_hash_t));
|
Add printError documentation | @@ -35,6 +35,16 @@ print("test"); // "test"
print(10, "test", nil, true); // 10, "test", nil, true
```
+### printError(...values...)
+
+Prints a given list of values to stderr.
+
+```cs
+printError(10); // 10
+printError("test"); // "test"
+printError(10, "test", nil, true); // 10, "test", nil, true
+```
+
### input(string: prompt -> optional)
Gathers user input from stdin and returns the value as a string. `input()` has an optional prompt which will be shown to
|
fixes function cache_memory accounting stats bug
This bug resulted in wrong memory usage statistics after a redis function library is removed. | @@ -293,7 +293,7 @@ static void libraryUnlink(functionsLibCtx *lib_ctx, functionLibInfo* li) {
entry = dictUnlink(lib_ctx->libraries, li->name);
dictSetVal(lib_ctx->libraries, entry, NULL);
dictFreeUnlinkedEntry(lib_ctx->libraries, entry);
- lib_ctx->cache_memory += libraryMallocSize(li);
+ lib_ctx->cache_memory -= libraryMallocSize(li);
/* update stats */
functionsLibEngineStats *stats = dictFetchValue(lib_ctx->engines_stats, li->ei->name);
|
Match db.yml names pss_crypto_* and update structure
* Match db.yml names (pss_crypto_open)
the _p was from a plugin that hooks these functions ..
* Add pss_crypto_close
* Update unk0 | @@ -14,14 +14,15 @@ extern "C" {
#endif
typedef struct ScePssCryptoHandle {
- uint32_t unk0;
+ SceUID fd;
uint32_t unk1;
SceSize size;
uint32_t unk3;
} ScePssCryptoHandle;
-int pss_crypto_open_p(ScePssCryptoHandle *handle, char *path);
-char *pss_crypto_read_p(ScePssCryptoHandle *handle, int *mode);
+int pss_crypto_open(ScePssCryptoHandle *handle, char *path);
+char *pss_crypto_read(ScePssCryptoHandle *handle, int *mode);
+int pss_crypto_close(ScePssCryptoHandle *handle);
void *pss_code_mem_alloc(SceSize *);
void pss_code_mem_flush_icache(const void *, SceSize);
void pss_code_mem_lock(void);
|
load config b4 complete | @@ -23,6 +23,11 @@ function targets()
{
function ()
import("core.project.project")
+ import("core.project.config")
+
+ -- load config
+ config.load()
+
return table.keys(project.targets())
end
}
@@ -33,6 +38,11 @@ function runable_targets()
{
function ()
import("core.project.project")
+ import("core.project.config")
+
+ -- load config
+ config.load()
+
local targets = project.targets()
local runable = {}
for k, v in pairs(targets) do
|
[catboost] Fix a test | @@ -1903,7 +1903,7 @@ class TestInvalidCustomLossAndMetric(object):
pass
def test_loss_good_metric_none(self):
- with pytest.raises(CatboostError, match='metric is not defined'):
+ with pytest.raises(CatboostError, match='metric is not defined|No metrics specified'):
model = CatBoost({"loss_function": self.GoodCustomLoss(), "iterations": 2, "random_seed": 0})
pool = Pool(*random_xy(10, 5))
model.fit(pool)
|
xive: Don't try to find a target EQ for prio 0xff
Otherwise we get warnings when masking interrupts | @@ -2229,9 +2229,10 @@ static int64_t xive_set_irq_targetting(uint32_t isn, uint32_t target,
bitmap_set_bit(*x->int_enabled_map, GIRQ_TO_IDX(isn));
}
- /* Re-target the IVE. First find the EQ
+ /* If prio isn't 0xff, re-target the IVE. First find the EQ
* correponding to the target
*/
+ if (prio != 0xff) {
if (!xive_eq_for_target(target, prio, &eq_blk, &eq_idx)) {
xive_err(x, "Can't find EQ for target/prio 0x%x/%d\n",
target, prio);
@@ -2244,6 +2245,7 @@ static int64_t xive_set_irq_targetting(uint32_t isn, uint32_t target,
*/
new_ive = SETFIELD(IVE_EQ_BLOCK, new_ive, eq_blk);
new_ive = SETFIELD(IVE_EQ_INDEX, new_ive, eq_idx);
+ }
new_ive = SETFIELD(IVE_EQ_DATA, new_ive, lirq);
xive_vdbg(x,"ISN %x routed to eq %x/%x lirq=%08x IVE=%016llx !\n",
|
[Exploit] Output status messages more often | @@ -266,7 +266,7 @@ void _timer_fired(gui_text_view_t* ctx) {
printf("timer fired!\n");
char buf[512];
// Scan 4GB, 512MB at a time
- uint64_t memory_chunk_size = 256LL * 1024LL * 1024LL;
+ uint64_t memory_chunk_size = 4LL * 1024LL * 1024LL;
uint64_t total_memory_to_scan = 4LL * 1024LL * 1024LL * 1024LL;
uint64_t total_string_count = 0;
for (uint64_t chunk_base = 0; chunk_base < total_memory_to_scan; chunk_base += memory_chunk_size) {
@@ -302,9 +302,8 @@ int main(int argc, char** argv) {
};
amc_message_send(AXLE_CORE_SERVICE_NAME, &request, sizeof(memwalker_request_pml1_t));
amc_message_t* response_msg;
- amc_message_await(AXLE_CORE_SERVICE_NAME, &response_msg);
+ amc_message_await__u32_event(AXLE_CORE_SERVICE_NAME, MEMWALKER_REQUEST_PML1_ENTRY, &response_msg);
memwalker_request_pml1_response_t* response = (memwalker_request_pml1_response_t*)response_msg->body;
- assert(response->event == MEMWALKER_REQUEST_PML1_ENTRY);
uint64_t pt_virt = response->pt_virt_base;
uint64_t pt_phys = response->pt_phys_base;
uint64_t mapped_memory_virt_base = response->mapped_memory_virt_base;
|
Subsets and Splits