message
stringlengths 6
474
| diff
stringlengths 8
5.22k
|
---|---|
Add PhDuplicateFontWithNewHeight | @@ -907,6 +907,24 @@ PhInitializeWindowTheme(
_In_ BOOLEAN EnableThemeSupport
);
+FORCEINLINE
+HFONT
+PhDuplicateFontWithNewHeight(
+ _In_ HFONT Font,
+ _In_ LONG NewHeight
+ )
+{
+ LOGFONT logFont;
+
+ if (GetObject(Font, sizeof(LOGFONT), &logFont))
+ {
+ logFont.lfHeight = NewHeight;
+ return CreateFontIndirect(&logFont);
+ }
+
+ return NULL;
+}
+
#ifdef __cplusplus
}
#endif
|
gfni: add cast to work around -Wimplicit-int-conversion warning
_mm_movemask_epi8 returns an int, and _mm_set1_epi16 takes a short.
If -Wimplicit-int-conversion is enabled, clang will warn about passing
the result of _mm_movemask_epi8 to _mm_set1_epi16. | @@ -124,7 +124,7 @@ simde_x_mm_gf2p8matrix_multiply_epi64_epi8 (simde__m128i x, simde__m128i A) {
SIMDE_VECTORIZE
#endif
for (int i = 0 ; i < 8 ; i++) {
- p = _mm_set1_epi16(_mm_movemask_epi8(a));
+ p = _mm_set1_epi16(HEDLEY_STATIC_CAST(short, _mm_movemask_epi8(a)));
p = _mm_and_si128(p, _mm_cmpgt_epi8(zero, X));
r = _mm_xor_si128(r, p);
a = _mm_add_epi8(a, a);
|
spend less on memory (more on CPU?) | @@ -371,8 +371,10 @@ size_t fiobj_str_capa_assert(FIOBJ str, size_t size) {
if (obj2str(str)->is_small) {
if (size <= STR_INTENAL_CAPA)
return STR_INTENAL_CAPA;
- if (size >> 12)
+ if ((size >> 12) >= 4) {
+ /* align to page boundary ? */
size = ((size >> 12) + 1) << 12;
+ }
char *mem = fio_malloc(size);
if (!mem) {
perror("FATAL ERROR: Couldn't allocate larger String memory");
@@ -393,11 +395,16 @@ size_t fiobj_str_capa_assert(FIOBJ str, size_t size) {
if (obj2str(str)->capa >= size)
return obj2str(str)->capa;
+ if ((size >> 12) >= 4) {
/* large strings should increase memory by page size (assumes 4096 pages) */
- if (size >> 12)
size = ((size >> 12) + 1) << 12;
- else if (size < (obj2str(str)->capa << 1))
- size = obj2str(str)->capa << 1; /* grow in steps */
+ } else if (size < (obj2str(str)->capa + 32)) {
+ /* Minimal growth is 32 byte */
+ size = obj2str(str)->capa + 32;
+ } else if (size >= 32) {
+ /* Minimal growth is 32 byte */
+ size = ((size >> 5) + 1) << 5;
+ }
if (obj2str(str)->capa == 0) {
/* a static string */
|
ver T13.789: one more attempt to fix memory leak | #define EXCHANGE_PERIOD 1800
#define EXCHANGE_MAX_TIME (3600 * 48)
#define LOG_PERIOD 300
-#define GC_PERIOD 300
+#define GC_PERIOD 60
#define UPDATE_PERIOD DNET_UPDATE_PERIOD
struct list *g_threads;
@@ -188,9 +188,6 @@ err:
if (strcmp(mess, "cannot connect") && strcmp(mess, "connection error"))
#endif
dnet_log_printf("dnet.%d: %s%s (%d), %s\n", t->nthread, mess, mess1, res, strerror(errno));
-#ifdef CHEATCOIN
- t->to_remove = 1;
-#endif
}
static void *dnet_thread_client_server(void *arg) {
@@ -209,12 +206,11 @@ static void *dnet_thread_client_server(void *arg) {
close(t->conn.socket); t->conn.socket = -1;
}
#ifndef CHEATCOIN
- if (t->to_remove) {
- if (dnet_connection_close_notify) (*dnet_connection_close_notify)(&t->conn);
- break;
- }
+ if (t->to_remove) break;
sleep(5);
#else
+ if (dnet_connection_close_notify) (*dnet_connection_close_notify)(&t->conn);
+ t->to_remove = 1;
break;
#endif
}
@@ -257,26 +253,22 @@ int dnet_traverse_threads(int (*callback)(struct dnet_thread *, void *), void *d
static int dnet_garbage_collect(void) {
struct list *l, *lnext;
+ int total = 0, collected = 0;
+ dnet_log_printf("dnet gc: start to collect\n");
pthread_rwlock_wrlock(&g_threads_rwlock);
for (l = g_threads->next; l != g_threads; l = lnext) {
struct dnet_thread *t = container_of(l, struct dnet_thread, threads);
lnext = l->next;
+ total++;
if (t->to_remove == 2) {
- int nthread = t->nthread;
list_remove(l);
- pthread_rwlock_unlock(&g_threads_rwlock);
- dnet_log_printf("dnet.%d: thread remove start\n", nthread);
dthread_mutex_destroy(&t->conn.mutex);
free(t);
- dnet_log_printf("dnet.%d: thread remove end\n", nthread);
- return 1;
- }
- }
- for (l = g_threads->next; l != g_threads; l = l->next) {
- struct dnet_thread *t = container_of(l, struct dnet_thread, threads);
- if (t->to_remove) t->to_remove = 2;
+ collected++;
+ } else if (t->to_remove) t->to_remove = 2;
}
pthread_rwlock_unlock(&g_threads_rwlock);
+ dnet_log_printf("dnet gc: %d threads total, %d collected\n", total, collected);
return 0;
}
@@ -286,7 +278,7 @@ static void *dnet_thread_collector(void __attribute__((unused)) *arg) {
t = time(0);
if (t - gc_t >= GC_PERIOD) {
gc_t = t;
- while (dnet_garbage_collect()) sleep(1);
+ dnet_garbage_collect();
}
sleep(GC_PERIOD / 10);
}
|
Commented scene logging | @@ -466,7 +466,7 @@ void SceneUpdateActors_b()
for (i = 0; i != len; ++i)
{
- LOG("MOVING actor %u\n", i);
+ // LOG("MOVING actor %u\n", i);
// If running script only update script actor - Unless needs redraw
// if (script_ptr && i != script_actor && !actors[i].redraw)
// {
@@ -537,7 +537,7 @@ void SceneUpdateActorMovement_b(UBYTE i)
return;
}
- LOG("UPDATE ACTOR MOVEMENT %u\n", i);
+ // LOG("UPDATE ACTOR MOVEMENT %u\n", i);
actors[i].moving = TRUE;
}
@@ -718,7 +718,7 @@ void SceneRenderActors_b()
for (i = 0; i != len; ++i)
{
- LOG("CHECK FOR REDRAW Actor %u\n", i);
+ // LOG("CHECK FOR REDRAW Actor %u\n", i);
redraw = actors[i].redraw;
@@ -755,7 +755,7 @@ void SceneRenderActors_b()
}
}
- LOG("REDRAW Actor %u\n", i);
+ // LOG("REDRAW Actor %u\n", i);
// Handle facing left
if (flip)
@@ -779,7 +779,7 @@ void SceneRenderActors_b()
for (i = 0; i != scene_num_actors; ++i)
{
sprite_index = MUL_2(i);
- LOG("a Reposition Actor %u\n", i);
+ // LOG("a Reposition Actor %u\n", i);
screen_x = actors[i].pos.x + scx;
screen_y = actors[i].pos.y + scy;
if (actors[i].enabled && (win_pos_y == MENU_CLOSED_Y || screen_y < win_pos_y + 16))
@@ -822,7 +822,7 @@ void SceneRenderActors_b()
for (i = 0; i != len; ++i)
{
sprite_index = MUL_2(i);
- LOG("b Reposition Actor %u\n", i);
+ // LOG("b Reposition Actor %u\n", i);
screen_x = actors[i].pos.x + scx;
screen_y = actors[i].pos.y + scy;
if (actors[i].enabled && (win_pos_y == MENU_CLOSED_Y || screen_y < win_pos_y + 16))
|
website: fix another instance of broken rss link | @@ -48,7 +48,7 @@ module.exports = function(grunt) {
title: "Elektra's Blog",
description: "News around Elektra",
feed_url:
- "<%= app.website.url %>rss/<%= grunt.config('create-website-news-rss.build.output.feed') %>",
+ "<%= app.website.url %>news/<%= grunt.config('create-website-news-rss.build.output.feed') %>",
post_url: "<%= app.website.url &>news/",
site_url: "<%= app.website.url %>",
language: "en",
|
contact-store: upon %edit of a nonexistent contact, make an empty contact and set that field | |= [=ship =edit-field:store timestamp=@da]
|^
^- (quip card _state)
- =/ old (~(got by rolodex) ship)
+ =/ old (fall (~(get by rolodex) ship) *contact:store)
?: (lte timestamp last-updated.old)
[~ state]
=/ contact (edit-contact old edit-field)
|
Improve Net-Virtua generator based on wpa-sec founds | @@ -1683,11 +1683,24 @@ if(essidlen < 15) return;
if(memcmp(essid, net2g, 10) != 0) return;
if((isdigit(essid[11])) && (isdigit(essid[12])) && (isdigit(essid[13])) && (isdigit(essid[14])))
{
- for(k = 0; k < 0x1000; k++)
+ for(k = 0; k < 1000; k++)
{
fprintf(fhout, "%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ fprintf(fhout, "15%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ fprintf(fhout, "16%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ fprintf(fhout, "24%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ fprintf(fhout, "31%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ fprintf(fhout, "33%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ fprintf(fhout, "37%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ fprintf(fhout, "38%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ fprintf(fhout, "40%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ fprintf(fhout, "61%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
fprintf(fhout, "71%03d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
}
+ for(k = 0; k < 10000; k++)
+ {
+ fprintf(fhout, "%04d%C%C%C%C0\n", k, essid[11], essid[12], essid[13], essid[14]);
+ }
}
return;
}
|
router_validate_address: ensure rethint is properly initialised | @@ -360,18 +360,18 @@ router_validate_address(
}
}
- /* try to see if this is a "numeric" IP address, in
- * which case we take the cannonical representation so
- * as to ensure (string) comparisons will match lateron */
memset(&hint, 0, sizeof(hint));
saddr = NULL;
+ /* try to see if this is a "numeric" IP address, which means
+ * re-resolving lateron will make no difference */
hint.ai_family = PF_UNSPEC;
hint.ai_socktype = proto == CON_UDP ? SOCK_DGRAM : SOCK_STREAM;
hint.ai_protocol = proto == CON_UDP ? IPPROTO_UDP : IPPROTO_TCP;
hint.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
snprintf(sport, sizeof(sport), "%u", port);
+ *rethint = NULL;
if (getaddrinfo(ip, sport, &hint, &saddr) != 0) {
int err;
/* now resolve this the normal way to check validity */
|
test more freq | @@ -747,15 +747,15 @@ static void i2s_test_common_sample_rate(i2s_chan_handle_t rx_chan, i2s_std_clk_c
esp_rom_gpio_connect_in_signal(MASTER_WS_IO, pcnt_periph_signals.groups[0].units[0].channels[0].pulse_sig, 0);
// Test common sample rate
- uint32_t test_freq[15] = {8000, 11025, 12000, 16000, 22050, 24000,
+ uint32_t test_freq[16] = {8000, 10000, 11025, 12000, 16000, 22050, 24000,
32000, 44100, 48000, 64000, 88200, 96000,
128000, 144000, 196000};
int real_pulse = 0;
- int case_cnt = 15;
+ int case_cnt = 16;
#if SOC_I2S_HW_VERSION_2
// Can't support a very high sample rate while using XTAL as clock source
if (clk_cfg->clk_src == I2S_CLK_SRC_XTAL) {
- case_cnt = 9;
+ case_cnt = 10;
}
#endif
for (int i = 0; i < case_cnt; i++) {
|
add missing dep in debian buster ci | @@ -12,6 +12,7 @@ RUN apt update && apt install -y -qq \
gfortran \
g++ \
libopenblas-dev \
+ liblapacke-dev \
lp-solve \
liblpsolve55-dev \
libpython3-dev \
|
[catboost] Ensure proper indexing in CUDA catboost with quantized pools
It was working because column indices in quantized pools are sorted (for reproducibility of generated quantized pools), but there are no guarantees actually. | @@ -370,33 +370,30 @@ static NCatboostCuda::TBinarizedFloatFeaturesMetaInfo GetQuantizedFeatureMetaInf
const NCB::TQuantizedPool& pool) {
const auto columnIndexToFlatIndex = GetColumnIndexToFlatIndexMap(pool);
+ const auto columnIndexToNumericFeatureIndex = GetColumnIndexToNumericFeatureIndexMap(pool);
+ const auto numericFeatureCount = columnIndexToNumericFeatureIndex.size();
+
NCatboostCuda::TBinarizedFloatFeaturesMetaInfo metainfo;
- size_t featureIndex = 0;
- for (size_t i = 0; i < pool.ColumnTypes.size(); ++i) {
- const auto localIndex = pool.ColumnIndexToLocalIndex.at(i);
- const auto columnType = pool.ColumnTypes[localIndex];
- if (!IsFactorColumn(columnType)) {
- continue;
- }
+ metainfo.BinarizedFeatureIds.resize(numericFeatureCount);
+ metainfo.Borders.resize(numericFeatureCount);
+ metainfo.NanModes.resize(numericFeatureCount, ENanMode::Min);
- Y_DEFER {
- ++featureIndex;
- };
- if (columnType != EColumn::Num) {
+ for (const auto [columnIndex, localIndex] : pool.ColumnIndexToLocalIndex) {
+ if (pool.ColumnTypes[localIndex] != EColumn::Num) {
continue;
}
- metainfo.BinarizedFeatureIds.push_back(featureIndex);
- metainfo.Borders.push_back({});
- metainfo.NanModes.push_back(ENanMode::Min);
+ const auto flatIndex = columnIndexToFlatIndex.at(columnIndex);
+ const auto numericFeatureIndex = columnIndexToNumericFeatureIndex.at(columnIndex);
+ metainfo.BinarizedFeatureIds[numericFeatureIndex] = flatIndex;
- const auto it = pool.QuantizationSchema.GetFeatureIndexToSchema().find(featureIndex);
+ const auto it = pool.QuantizationSchema.GetFeatureIndexToSchema().find(flatIndex);
if (it != pool.QuantizationSchema.GetFeatureIndexToSchema().end()) {
- metainfo.Borders.back().assign(
+ metainfo.Borders[numericFeatureIndex].assign(
it->second.GetBorders().begin(),
it->second.GetBorders().end());
- metainfo.NanModes.back() = NanModeFromProto(it->second.GetNanMode());
+ metainfo.NanModes[numericFeatureIndex] = NanModeFromProto(it->second.GetNanMode());
}
}
|
add SetPort method to both sockaddr implementations
Note: mandatory check (NEED_CHECK) was skipped | @@ -265,6 +265,10 @@ struct TSockAddrInet: public sockaddr_in, public ISockAddr {
TIpPort GetPort() const noexcept {
return InetToHost(sin_port);
}
+
+ void SetPort(TIpPort port) noexcept {
+ sin_port = HostToInet(port);
+ }
};
struct TSockAddrInet6: public sockaddr_in6, public ISockAddr {
@@ -329,6 +333,10 @@ struct TSockAddrInet6: public sockaddr_in6, public ISockAddr {
TIpPort GetPort() const noexcept {
return InetToHost(sin6_port);
}
+
+ void SetPort(TIpPort port) noexcept {
+ sin6_port = HostToInet(port);
+ }
};
using TSockAddrLocalStream = TSockAddrLocal;
|
BugID:29304869:Fix for http buffer overflow issue | @@ -378,7 +378,14 @@ static int _http_parse_response_header(httpclient_t *client, char *data, int len
/* try to read more header again until find response head ending "\r\n\r\n" */
while (NULL == (ptr_body_end = strstr(data, "\r\n\r\n"))) {
/* try to read more header */
- ret = _http_recv(client, data + len, HTTPCLIENT_RAED_HEAD_SIZE, &new_trf_len, iotx_time_left(&timer));
+ int max_remain_len = HTTPCLIENT_READ_BUF_SIZE - len -1;
+ if (max_remain_len <= 0) {
+ httpc_debug("buffer exceeded max\n");
+ return ERROR_HTTP_PARSE;
+ }
+ max_remain_len = max_remain_len > HTTPCLIENT_RAED_HEAD_SIZE ? HTTPCLIENT_RAED_HEAD_SIZE : max_remain_len;
+ ret = _http_recv(client, data + len, max_remain_len, &new_trf_len, iotx_time_left(&timer));
+
if (ret == ERROR_HTTP_CONN) {
return ret;
}
|
Set default fade speed in scene switches in sample project | "sceneId": "5e64882f-8ce6-423e-b582-70fdb2142ff6",
"x": 9,
"y": 15,
- "direction": "up"
+ "direction": "up",
+ "fadeSpeed": "2"
}
},
{
"x": 9,
"y": 14,
"direction": "up",
- "sceneId": "1b7f9ffd-2bbb-470b-9189-c2ac435d2a55"
+ "sceneId": "1b7f9ffd-2bbb-470b-9189-c2ac435d2a55",
+ "fadeSpeed": "2"
}
},
{
"x": 24,
"y": 9,
"direction": "down",
- "sceneId": "94c18861-b352-4f49-a64d-52f2e3415077"
+ "sceneId": "94c18861-b352-4f49-a64d-52f2e3415077",
+ "fadeSpeed": "2"
}
},
{
"sceneId": "94c18861-b352-4f49-a64d-52f2e3415077",
"x": 10,
"y": 9,
- "direction": "down"
+ "direction": "down",
+ "fadeSpeed": "2"
}
},
{
|
Don't run the tick with the mutex locked | @@ -179,8 +179,8 @@ static int system_loop(void *ptr) {
blit::buttons = shadow_buttons;
blit::tilt = shadow_tilt;
blit::joystick = shadow_joystick;
- blit::tick(::now());
SDL_UnlockMutex(shadow_mutex);
+ blit::tick(::now());
if(!running) break;
SDL_PushEvent(&event);
SDL_SemWait(system_loop_redraw);
|
Missing newlines in debug messages | @@ -518,7 +518,7 @@ static int genaInitNotifyCommon(UpnpDevice_Handle device_handle,
GENA,
__FILE__,
__LINE__,
- "GENA BEGIN INITIAL NOTIFY COMMON");
+ "GENA BEGIN INITIAL NOTIFY COMMON\n");
job = (ThreadPoolJob *)malloc(sizeof(ThreadPoolJob));
if (job == NULL) {
@@ -655,7 +655,7 @@ ExitFunction:
GENA,
__FILE__,
line,
- "GENA END INITIAL NOTIFY COMMON, ret = %d",
+ "GENA END INITIAL NOTIFY COMMON, ret = %d\n",
ret);
return ret;
@@ -677,7 +677,7 @@ int genaInitNotify(UpnpDevice_Handle device_handle,
GENA,
__FILE__,
__LINE__,
- "GENA BEGIN INITIAL NOTIFY");
+ "GENA BEGIN INITIAL NOTIFY\n");
if (var_count <= 0) {
line = __LINE__;
@@ -706,7 +706,7 @@ ExitFunction:
GENA,
__FILE__,
line,
- "GENA END INITIAL NOTIFY, ret = %d",
+ "GENA END INITIAL NOTIFY, ret = %d\n",
ret);
return ret;
@@ -727,7 +727,7 @@ int genaInitNotifyExt(UpnpDevice_Handle device_handle,
GENA,
__FILE__,
__LINE__,
- "GENA BEGIN INITIAL NOTIFY EXT");
+ "GENA BEGIN INITIAL NOTIFY EXT\n");
if (PropSet == 0) {
line = __LINE__;
@@ -757,7 +757,7 @@ ExitFunction:
GENA,
__FILE__,
line,
- "GENA END INITIAL NOTIFY EXT, ret = %d",
+ "GENA END INITIAL NOTIFY EXT, ret = %d\n",
ret);
return ret;
@@ -825,7 +825,7 @@ static int genaNotifyAllCommon(UpnpDevice_Handle device_handle,
GENA,
__FILE__,
__LINE__,
- "GENA BEGIN NOTIFY ALL COMMON");
+ "GENA BEGIN NOTIFY ALL COMMON\n");
/* Keep this allocation first */
reference_count = (int *)malloc(sizeof(int));
@@ -956,7 +956,7 @@ ExitFunction:
GENA,
__FILE__,
line,
- "GENA END NOTIFY ALL COMMON, ret = %d",
+ "GENA END NOTIFY ALL COMMON, ret = %d\n",
ret);
return ret;
@@ -976,7 +976,7 @@ int genaNotifyAllExt(UpnpDevice_Handle device_handle,
GENA,
__FILE__,
__LINE__,
- "GENA BEGIN NOTIFY ALL EXT");
+ "GENA BEGIN NOTIFY ALL EXT\n");
propertySet = ixmlPrintNode((IXML_Node *)PropSet);
if (propertySet == NULL) {
@@ -999,7 +999,7 @@ ExitFunction:
GENA,
__FILE__,
line,
- "GENA END NOTIFY ALL EXT, ret = %d",
+ "GENA END NOTIFY ALL EXT, ret = %d\n",
ret);
return ret;
@@ -1018,7 +1018,7 @@ int genaNotifyAll(UpnpDevice_Handle device_handle,
DOMString propertySet = NULL;
UpnpPrintf(
- UPNP_INFO, GENA, __FILE__, __LINE__, "GENA BEGIN NOTIFY ALL");
+ UPNP_INFO, GENA, __FILE__, __LINE__, "GENA BEGIN NOTIFY ALL\n");
ret = GeneratePropertySet(VarNames, VarValues, var_count, &propertySet);
if (ret != XML_SUCCESS) {
@@ -1040,7 +1040,7 @@ ExitFunction:
GENA,
__FILE__,
line,
- "GENA END NOTIFY ALL, ret = %d",
+ "GENA END NOTIFY ALL, ret = %d\n",
ret);
return ret;
|
crypto-openssl: use getrandom syscall
The sys/random.h header, which provides the getrandom syscall wrapper,
was only added in glibc2.25. To make it compatible with older version,
we can directly call the syscall.
Type: improvement | *------------------------------------------------------------------
*/
-#include <sys/random.h>
+#include <sys/syscall.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
@@ -478,7 +478,7 @@ crypto_openssl_init (vlib_main_t * vm)
openssl_per_thread_data_t *ptd;
u8 seed[32];
- if (getrandom (&seed, sizeof (seed), 0) != sizeof (seed))
+ if (syscall (SYS_getrandom, &seed, sizeof (seed), 0) != sizeof (seed))
return clib_error_return_unix (0, "getrandom() failed");
RAND_seed (seed, sizeof (seed));
|
Unify perf_event type and config check | @@ -604,10 +604,32 @@ error:
return NULL;
}
+int invalid_perf_config(uint32_t type, uint64_t config) {
+ switch (type) {
+ case PERF_TYPE_HARDWARE:
+ return config >= PERF_COUNT_HW_MAX;
+ case PERF_TYPE_SOFTWARE:
+ return config >= PERF_COUNT_SW_MAX;
+ case PERF_TYPE_RAW:
+ return 0;
+ default:
+ return 1;
+ }
+}
+
int bpf_open_perf_event(uint32_t type, uint64_t config, int pid, int cpu) {
int fd;
struct perf_event_attr attr = {};
+ if (type != PERF_TYPE_HARDWARE && type != PERF_TYPE_RAW) {
+ fprintf(stderr, "Unsupported perf event type\n");
+ return -1;
+ }
+ if (invalid_perf_config(type, config)) {
+ fprintf(stderr, "Invalid perf event config\n");
+ return -1;
+ }
+
attr.sample_period = LONG_MAX;
attr.type = type;
attr.config = config;
@@ -733,8 +755,7 @@ int bpf_attach_perf_event(int progfd, uint32_t ev_type, uint32_t ev_config,
fprintf(stderr, "Unsupported perf event type\n");
return -1;
}
- if ((ev_type == PERF_TYPE_HARDWARE && ev_config >= PERF_COUNT_HW_MAX) ||
- (ev_type == PERF_TYPE_SOFTWARE && ev_config >= PERF_COUNT_SW_MAX)) {
+ if (invalid_perf_config(ev_type, ev_config)) {
fprintf(stderr, "Invalid perf event config\n");
return -1;
}
|
news: update hashsums | @@ -505,9 +505,13 @@ or [GitHub](https://github.com/ElektraInitiative/ftp/blob/master/releases/elektr
The [hashsums are:](https://github.com/ElektraInitiative/ftp/blob/master/releases/elektra-0.9.1.tar.gz.hashsum?raw=true)
-<<`scripts/generate-hashsums elektra-0.9.1.tar.gz`>>
+- name: /home/mpranj/workspace/ftp/releases/elektra-0.9.1.tar.gz
+- size: 7534156
+- md5sum: 42ff587adb7c3f15807ac4dae6722261
+- sha1: bf250260a4efa20e5444f0a7f0027430bc7aa8a0
+- sha256: df1d2ec1b4db9c89c216772f0998581a1cbb665e295ff9a418549360bb42f758
-The release tarball is also available signed by Markus Raab using GnuPG from
+The release tarball is also available signed by Mihael Pranjic using GnuPG from
[here](https://www.libelektra.org/ftp/elektra/releases/elektra-0.9.1.tar.gz.gpg) or on
[GitHub](https://github.com/ElektraInitiative/ftp/blob/master/releases/elektra-0.9.1.tar.gz.gpg?raw=true)
|
capture: fixing counter | #define CAPTURE_DEFPREC 4 //default precision
#define CAPTURE_MAXPREC 99 //
#define CAPTURE_MINPREC 1 //minimum preision
-//not sure what's planned for precision Matt but i'll just put 64 here for 64 bits for now
-//and then delete these two lines of comments after you're done - DK
typedef struct _capture
{
@@ -21,9 +19,9 @@ typedef struct _capture
t_canvas *x_canvas;
char x_intmode; /* if nonzero ('x' or 'm') floats are ignored */
float *x_buffer;
- int x_bufsize;
- int x_count;
- int x_counter;
+ int x_bufsize; //number of stored values
+ int x_count; //number of values actually in buffer
+ unsigned int x_counter; //counting number of values received
int x_head;
int x_precision;
t_outlet * x_count_outlet;
@@ -41,7 +39,6 @@ static void capture_float(t_capture *x, t_float f)
x->x_head = 0;
if (x->x_count < x->x_bufsize)
x->x_count++;
- if (x->x_counter < x->x_bufsize)
x->x_counter++;
}
@@ -63,15 +60,17 @@ static void capture_list(t_capture *x, t_symbol *s, int ac, t_atom *av)
}
}
+//clear stored contents
static void capture_clear(t_capture *x)
{
x->x_count = 0;
x->x_head = 0;
}
+//counts number of items received since last count
static void capture_count(t_capture *x)
{
- outlet_float(x->x_count_outlet, x->x_counter);
+ outlet_float(x->x_count_outlet, (t_float)x->x_counter);
x->x_counter = 0;
}
@@ -97,6 +96,7 @@ static void capture_dump(t_capture *x)
}
}
+//used by formatnumber in tern used by appendfloat to write to editor window
static int capture_formatint(int i, char *buf, int col,
int maxcol, char *fmt)
{
@@ -112,6 +112,7 @@ static int capture_formatint(int i, char *buf, int col,
return (col);
}
+//used by capture_formatnumber used by append float to write to ed window
static int capture_formatfloat(t_capture *x, float f, char *buf, int col,
int maxcol, char *fmt)
{
|
Document that the ENGINE_[sg]_ex_data() calls are reprecated. | @@ -85,6 +85,11 @@ TYPE_get_ex_data() returns the application data or NULL if an error occurred.
L<CRYPTO_get_ex_new_index(3)>.
+=head1 HISTORY
+
+The ENGINE_get_ex_new_index(), ENGINE_set_ex_data() and ENGINE_get_ex_data()
+functions were deprecated in OpenSSL 3.0.
+
=head1 COPYRIGHT
Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
|
[swig] fix build | void set_polyhedron(SN_OBJ_TYPE* H_mat, SN_OBJ_TYPE* K_vec)
{
- $self->poly = (polyhedron*) malloc(sizeof(polyhedron));
+ $self->poly.split = (polyhedron*) malloc(sizeof(polyhedron));
int is_new_object2=0;
- %NM_convert_from_target(H_mat, (&$self->poly->H), TARGET_ERROR_VERBOSE);
+ %NM_convert_from_target(H_mat, (&$self->poly.split->H), TARGET_ERROR_VERBOSE);
- if ($self->poly->H->size1 != $self->size)
+ if ($self->poly.split->H->size1 != $self->size)
{
SWIG_Error(SWIG_TypeError, "The matrix does not have the right number of column");
TARGET_ERROR_VERBOSE;
SN_ARRAY_TYPE* vector = obj_to_sn_vector(K_vec, &is_new_object2);
sn_check_array_type(vector, TARGET_ERROR_VERBOSE);
- sn_check_size_mat_vec($self->poly->H->size0, vector, TARGET_ERROR_VERBOSE);
+ sn_check_size_mat_vec($self->poly.split->H->size0, vector, TARGET_ERROR_VERBOSE);
- set_vec_from_target($self->poly->K, vector, , TARGET_ERROR_VERBOSE);
+ set_vec_from_target($self->poly.split->K, vector, , TARGET_ERROR_VERBOSE);
- $self->poly->size_ineq = $self->poly->H->size0;
- $self->poly->size_eq = 0;
- $self->poly->Heq = NULL;
- $self->poly->Keq = NULL;
+ $self->poly.split->size_ineq = $self->poly.split->H->size0;
+ $self->poly.split->size_eq = 0;
+ $self->poly.split->Heq = NULL;
+ $self->poly.split->Keq = NULL;
}
|
Build numpy before pillow
So that setup tools are available. | @@ -1912,15 +1912,6 @@ function bv_python_build
export PYTHON_COMMAND="${PYHOME}/bin/python3"
fi
- check_if_py_module_installed "PIL"
- # use Pillow for when python 3
- info "Building the Python Pillow Imaging Library"
- build_pillow
- if [[ $? != 0 ]] ; then
- error "Pillow build failed. Bailing out."
- fi
- info "Done building the Python Pillow Imaging Library"
-
check_if_py_module_installed "numpy"
if [[ $? != 0 ]] ; then
info "Building the numpy module"
@@ -1931,6 +1922,15 @@ function bv_python_build
info "Done building the numpy module."
fi
+ check_if_py_module_installed "PIL"
+ # use Pillow for when python 3
+ info "Building the Python Pillow Imaging Library"
+ build_pillow
+ if [[ $? != 0 ]] ; then
+ error "Pillow build failed. Bailing out."
+ fi
+ info "Done building the Python Pillow Imaging Library"
+
if [[ "$BUILD_MPI4PY" == "yes" ]]; then
check_if_py_module_installed "mpi4py"
|
Fix compilation on Ubuntu Xenial due name clash | @@ -4016,19 +4016,19 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A
bool checkReporting = false;
bool checkClientCluster = false;
- const ButtonMap *buttonMap = nullptr;
+ const ButtonMap *buttonMapEntry = nullptr;
if (!isValid(sensor->buttonMapRef())) // TODO sensor.hasButtonMap()
{
- buttonMap = BM_ButtonMapForProduct(productHash(sensor), buttonMaps, buttonProductMap);
- if (buttonMap)
+ buttonMapEntry = BM_ButtonMapForProduct(productHash(sensor), buttonMaps, buttonProductMap);
+ if (buttonMapEntry)
{
- sensor->setButtonMapRef(buttonMap->buttonMapRef);
+ sensor->setButtonMapRef(buttonMapEntry->buttonMapRef);
}
}
else
{
- buttonMap = BM_ButtonMapForRef(sensor->buttonMapRef(), buttonMaps);
+ buttonMapEntry = BM_ButtonMapForRef(sensor->buttonMapRef(), buttonMaps);
}
QString cluster = "0x" + QString("%1").arg(ind.clusterId(), 4, 16, QLatin1Char('0')).toUpper();
@@ -4050,7 +4050,7 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A
if (!temp.empty() && !temp.key(zclFrame.commandId()).isEmpty()) { cmd = temp.key(zclFrame.commandId()) + " (" + cmd + ")"; }
}
- if (!buttonMap || buttonMap->buttons.empty())
+ if (!buttonMapEntry || buttonMapEntry->buttons.empty())
{
DBG_Printf(DBG_INFO, "[INFO] - No button map for: %s%s, endpoint: 0x%02X, cluster: %s, command: %s, payload: %s, zclSeq: %u\n",
qPrintable(sensor->modelId()), qPrintable(addressMode), ind.srcEndpoint(), qPrintable(cluster), qPrintable(cmd), qPrintable(zclPayload), zclFrame.sequenceNumber());
@@ -4451,7 +4451,7 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A
}
bool ok = false;
- for (const auto &buttonMap : buttonMap->buttons)
+ for (const auto &buttonMap : buttonMapEntry->buttons)
{
if (buttonMap.mode != Sensor::ModeNone && !ok)
{
|
exit early if reformatting produced no changes | @@ -22,6 +22,11 @@ RELPATH=$(dirname "$SCRIPTPATH")
$RELPATH/clang-format-diff.py -regex '.*(\.h$|\.c$|\.cl$)' -i -p1 -style GNU <$PATCHY
$RELPATH/clang-format-diff.py -regex '(.*(\.hh$|\.cc$))|(lib/llvmopencl/.*\.h)' -i -p1 -style LLVM <$PATCHY
+if [ -z "$(git diff)" ]; then
+ echo "No changes."
+ exit 0
+fi
+
git diff
echo "ACCEPT CHANGES ?"
|
update ya tool arc
correct process of --cached option - calculate diff with index
print diff between two blobs; between index and arbitrary commit
diff between worktree and index
show deleted files in diff | },
"arc": {
"formula": {
- "sandbox_id": [328709958],
+ "sandbox_id": [329831127],
"match": "arc"
},
"executable": {
|
[Rust] View runs sizer when an element is added | @@ -48,7 +48,10 @@ impl View {
*self.left_click_cb.borrow_mut() = Some(Box::new(f));
}
- pub fn add_component(&self, elem: Rc<dyn UIElement>) {
+ pub fn add_component(self: Rc<Self>, elem: Rc<dyn UIElement>) {
+ printf!("Adding component to view: {:?}\n", elem.frame());
+ // Ensure the component has a frame by running its sizer
+ elem.handle_superview_resize(self.current_inner_content_frame.borrow().size);
self.sub_elements.borrow_mut().push(elem);
}
}
|
feat(fabric test):
add fabric test case "TxSetArgs_argsMoreThanLimit" | @@ -311,6 +311,32 @@ START_TEST(test_002Transaction_0014TxSetArgs_Txptr_NULL)
}
END_TEST
+START_TEST(test_002Transaction_0015TxSetArgs_argsMoreThanLimit)
+{
+ BSINT32 rtnVal;
+ BoatHlfabricTx tx_ptr;
+ BoatHlfabricWallet *g_fabric_wallet_ptr = NULL;
+ BoatHlfabricWalletConfig wallet_config = get_fabric_wallet_settings();
+ BoatIotSdkInit();
+ /* 1. execute unit test */
+ rtnVal = BoatWalletCreate(BOAT_PROTOCOL_HLFABRIC, NULL, &wallet_config, sizeof(BoatHlfabricWalletConfig));
+ g_fabric_wallet_ptr = BoatGetWalletByIndex(rtnVal);
+
+ rtnVal = BoatHlfabricTxInit(&tx_ptr, g_fabric_wallet_ptr, NULL, "mycc", NULL, "mychannel", "Org1MSP");
+ ck_assert_int_eq(rtnVal, BOAT_SUCCESS);
+ rtnVal = BoatHlfabricWalletSetNetworkInfo(tx_ptr.wallet_ptr, wallet_config.nodesCfg);
+ ck_assert_int_eq(rtnVal, BOAT_SUCCESS);
+ long int timesec = 0;
+ time(×ec);
+ rtnVal = BoatHlfabricTxSetTimestamp(&tx_ptr, timesec, 0);
+ ck_assert_int_eq(rtnVal, BOAT_SUCCESS);
+ rtnVal = BoatHlfabricTxSetArgs(&tx_ptr, "invoke", "a", "b", "10", "c","d","e","f","c","d","e","f");
+ ck_assert_int_eq(rtnVal, BOAT_ERROR_COMMON_OUT_OF_MEMORY);
+ BoatIotSdkDeInit();
+ fabricWalletConfigFree(wallet_config);
+}
+END_TEST
+
Suite *make_transaction_suite(void)
{
/* Create Suite */
@@ -336,6 +362,7 @@ Suite *make_transaction_suite(void)
tcase_add_test(tc_transaction_api, test_002Transaction_0012TxSetTimestamp_TxPtr_NULL);
tcase_add_test(tc_transaction_api, test_002Transaction_0013TxSetArgs_Success);
tcase_add_test(tc_transaction_api, test_002Transaction_0014TxSetArgs_Txptr_NULL);
+ tcase_add_test(tc_transaction_api, test_002Transaction_0015TxSetArgs_argsMoreThanLimit);
return s_transaction;
}
|
Remove unnecessary paramter to process_dio_init_dag | /*---------------------------------------------------------------------------*/
extern rpl_of_t rpl_of0, rpl_mrhof;
static rpl_of_t * const objective_functions[] = RPL_SUPPORTED_OFS;
-static int init_dag_from_dio(rpl_dio_t *dio);
+static int process_dio_init_dag(rpl_dio_t *dio);
/*---------------------------------------------------------------------------*/
/* Allocate instance table. */
@@ -552,7 +552,7 @@ init_dag_from_dio(rpl_dio_t *dio)
}
/*---------------------------------------------------------------------------*/
static int
-process_dio_init_dag(uip_ipaddr_t *from, rpl_dio_t *dio)
+process_dio_init_dag(rpl_dio_t *dio)
{
#ifdef RPL_VALIDATE_DIO_FUNC
if(!RPL_VALIDATE_DIO_FUNC(dio)) {
@@ -601,7 +601,7 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
{
if(!curr_instance.used && !rpl_dag_root_is_root()) {
/* Attempt to init our DAG from this DIO */
- if(!process_dio_init_dag(from, dio)) {
+ if(!process_dio_init_dag(dio)) {
LOG_WARN("failed to init DAG\n");
return;
}
|
Add cancellation loop check for the sake of completeness | @@ -299,7 +299,7 @@ namespace Miningcore.Stratum
private async Task ProcessSendQueueAsync(CancellationToken ct)
{
- while(true)
+ while(!ct.IsCancellationRequested)
{
var msg = await sendQueue.ReceiveAsync(ct);
|
Increase geometry precision | @@ -180,7 +180,7 @@ namespace carto { namespace geocoding {
}
}
- static constexpr double PRECISION = 1.0e5;
+ static constexpr double PRECISION = 1.0e6;
EncodingStream& _stream;
PointConverter _pointConverter;
|
docs: reorder install of ohpc-base-compute to deal with singularity
gid consistency | %\vspace*{.5cm}
\subsubsection{Add \OHPC{} components} \label{sec:add_components}
-\input{common/add_to_compute_chroot_intro}
+\input{common/add_to_compute_chroot_intro_suse}
% begin_ohpc_run
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
# install. Note that these will be synchronized with future updates via the provisioning system.
[sms](*\#*) cp /etc/passwd /etc/group $CHROOT/etc
+# Add OpenHPC base components
+[sms](*\#*) (*\chrootinstall*) ohpc-base-compute
+
# Add SLURM client support meta-package and enable munge
[sms](*\#*) (*\chrootinstall*) ohpc-slurm-client
[sms](*\#*) chroot $CHROOT systemctl enable munge
|
Documentation change to GNSS only: SARA-R10M8S -> SARA-R510M8S. | @@ -308,7 +308,7 @@ int32_t uGnssPosGet(uDeviceHandle_t gnssHandle,
#ifdef U_CFG_SARA_R5_M8_WORKAROUND
if (pInstance->transportType == U_GNSS_TRANSPORT_AT) {
// Temporary change: on prototype versions of the
- // SARA-R10M8S module (production week (printed on the
+ // SARA-R510M8S module (production week (printed on the
// module label, upper right) earlier than 20/27)
// the LNA in the GNSS chip is not automatically switched
// on by the firmware in the cellular module, so we need
@@ -389,7 +389,7 @@ int32_t uGnssPosGetStart(uDeviceHandle_t gnssHandle,
#ifdef U_CFG_SARA_R5_M8_WORKAROUND
if (pInstance->transportType == U_GNSS_TRANSPORT_AT) {
// Temporary change: on prototype versions of the
- // SARA-R10M8S module (production week (printed on the
+ // SARA-R510M8S module (production week (printed on the
// module label, upper right) earlier than 20/27)
// the LNA in the GNSS chip is not automatically switched
// on by the firmware in the cellular module, so we need
@@ -502,7 +502,7 @@ int32_t uGnssPosGetRrlp(uDeviceHandle_t gnssHandle, char *pBuffer,
#ifdef U_CFG_SARA_R5_M8_WORKAROUND
if (pInstance->transportType == U_GNSS_TRANSPORT_AT) {
// Temporary change: on prototype versions of the
- // SARA-R10M8S module (production week (printed on the
+ // SARA-R510M8S module (production week (printed on the
// module label, upper right) earlier than 20/27)
// the LNA in the GNSS chip is not automatically switched
// on by the firmware in the cellular module, so we need
|
Improve new workspace name selection
Improves upon by using the first assigned workspace instead of
the last one. The order isn't explicitly guaranteed to be the same as in
the config, but in general works. | @@ -205,6 +205,7 @@ char *workspace_next_name(const char *output_name) {
&& workspace_by_name(wso->workspace) == NULL) {
free(target);
target = strdup(wso->workspace);
+ break;
}
}
if (target != NULL) {
|
doc: added link to docker images | @@ -21,6 +21,7 @@ applications' configurations, leveraging easy application integration.
## Often Used Links
- If you are new, start reading [Get Started](doc/GETSTARTED.md)
+- If you enjoy working with [docker](/scripts/docker/README.md) take a look at our docker images
- [Build server](https://build.libelektra.org/)
- [Website](https://www.libelektra.org)
- [API documentation](https://doc.libelektra.org/api/master/html/)
|
Bindings/Python: require at least Python 3.4 | @@ -16,8 +16,8 @@ include (${SWIG_USE_FILE})
include (LibAddMacros)
# set (PythonInterp_FIND_VERSION_EXACT ON)
-find_package (PythonInterp 3 QUIET)
-find_package (PythonLibs 3 QUIET)
+find_package (PythonInterp 3.4 QUIET)
+find_package (PythonLibs 3.4 QUIET)
if (NOT PYTHONINTERP_FOUND)
exclude_binding (python "python3 interpreter not found")
|
fix commit bits for huge page allocations | @@ -181,6 +181,7 @@ static bool mi_region_try_alloc_os(size_t blocks, bool commit, bool allow_large,
void* const start = _mi_arena_alloc_aligned(MI_REGION_SIZE, MI_SEGMENT_ALIGN, ®ion_commit, ®ion_large, &is_zero, &arena_memid, tld);
if (start == NULL) return false;
mi_assert_internal(!(region_large && !allow_large));
+ mi_assert_internal(!region_large || region_commit);
// claim a fresh slot
const uintptr_t idx = mi_atomic_increment(®ions_count);
@@ -194,8 +195,8 @@ static bool mi_region_try_alloc_os(size_t blocks, bool commit, bool allow_large,
mem_region_t* r = ®ions[idx];
r->arena_memid = arena_memid;
mi_atomic_write(&r->in_use, 0);
- mi_atomic_write(&r->dirty, (is_zero ? 0 : ~0UL));
- mi_atomic_write(&r->commit, (region_commit ? ~0UL : 0));
+ mi_atomic_write(&r->dirty, (is_zero ? 0 : MI_BITMAP_FIELD_FULL));
+ mi_atomic_write(&r->commit, (region_commit ? MI_BITMAP_FIELD_FULL : 0));
mi_atomic_write(&r->reset, 0);
*bit_idx = 0;
mi_bitmap_claim(&r->in_use, 1, blocks, *bit_idx, NULL);
@@ -291,6 +292,7 @@ static void* mi_region_try_alloc(size_t blocks, bool* commit, bool* is_large, bo
bool any_uncommitted;
mi_bitmap_claim(®ion->commit, 1, blocks, bit_idx, &any_uncommitted);
if (any_uncommitted) {
+ mi_assert_internal(!info.is_large);
bool commit_zero;
_mi_mem_commit(p, blocks * MI_SEGMENT_SIZE, &commit_zero, tld);
if (commit_zero) *is_zero = true;
@@ -304,6 +306,7 @@ static void* mi_region_try_alloc(size_t blocks, bool* commit, bool* is_large, bo
// unreset reset blocks
if (mi_bitmap_is_any_claimed(®ion->reset, 1, blocks, bit_idx)) {
+ mi_assert_internal(!info.is_large);
mi_assert_internal(!mi_option_is_enabled(mi_option_eager_commit) || *commit);
mi_bitmap_unclaim(®ion->reset, 1, blocks, bit_idx);
bool reset_zero;
|
fix a typo in error messages in BPF::attach_usdt()
it was something like: "Unable to enable USDT %sprovider:probe from binary PID 1234 for
probe handle_probe" | @@ -303,7 +303,7 @@ StatusTuple BPF::attach_uprobe(const std::string& binary_path,
StatusTuple BPF::attach_usdt_without_validation(const USDT& u, pid_t pid) {
auto& probe = *static_cast<::USDT::Probe*>(u.probe_.get());
if (!uprobe_ref_ctr_supported() && !probe.enable(u.probe_func_))
- return StatusTuple(-1, "Unable to enable USDT %s" + u.print_name());
+ return StatusTuple(-1, "Unable to enable USDT %s", u.print_name().c_str());
bool failed = false;
std::string err_msg;
|
Fix for bootstrap crash when VPP compiled with gcc-7
See issue | @@ -393,7 +393,7 @@ mfib_entry_alloc (u32 fib_index,
{
mfib_entry_t *mfib_entry;
- pool_get(mfib_entry_pool, mfib_entry);
+ pool_get_aligned(mfib_entry_pool, mfib_entry, CLIB_CACHE_LINE_BYTES);
fib_node_init(&mfib_entry->mfe_node,
FIB_NODE_TYPE_MFIB_ENTRY);
|
odissey: do not close client tls connection if disable | @@ -107,10 +107,8 @@ od_tls_frontend_accept(od_client_t *client,
machine_error(client->io));
return -1;
}
- od_log_client(logger, &client->id, "tls", "disabled, closing");
- od_frontend_error(client, SHAPITO_FEATURE_NOT_SUPPORTED,
- "SSL is not supported");
- return -1;
+ od_debug_client(logger, &client->id, "tls", "is disabled, ignoring");
+ return 0;
}
/* supported 'S' */
shapito_stream_write8(stream, 'S');
|
GroupsPane: reference correct associations object | @@ -158,8 +158,6 @@ export function GroupsPane(props: GroupsPaneProps) {
baseUrl={baseUrl}
>
<UnjoinedResource
- notebooks={props.notebooks}
- inbox={props.inbox}
baseUrl={baseUrl}
api={api}
association={association}
@@ -191,9 +189,8 @@ export function GroupsPane(props: GroupsPaneProps) {
<Route
path={relativePath('')}
render={(routeProps) => {
- const hasDescription = groupAssociation?.metadata?.description;
- const channelCount = Object.keys(props?.associations?.graph ?? {}).filter((e) => {
- return props?.associations?.graph?.[e]?.['group'] === groupPath;
+ const channelCount = Object.keys(associations?.graph ?? {}).filter((e) => {
+ return associations?.graph?.[e]?.['group'] === groupPath;
}).length;
let summary: ReactNode;
if(groupAssociation?.group) {
|
kappa: fix charge/discharge control setting order
Clone form CL:1916160
BRANCH=none
TEST=make BOARD=kappa | @@ -140,7 +140,7 @@ int board_set_active_charge_port(int charge_port)
CPRINTS("New chg p%d", charge_port);
/* ignore all request when discharge mode is on */
- if (force_discharge)
+ if (force_discharge && charge_port != CHARGE_PORT_NONE)
return EC_SUCCESS;
switch (charge_port) {
@@ -186,12 +186,12 @@ int board_discharge_on_ac(int enable)
port = charge_manager_get_active_charge_port();
}
- ret = board_set_active_charge_port(port);
+ ret = charger_discharge_on_ac(enable);
if (ret)
return ret;
force_discharge = enable;
- return charger_discharge_on_ac(enable);
+ return board_set_active_charge_port(port);
}
int pd_snk_is_vbus_provided(int port)
|
sse2: add NEON implementation of simde_mm_madd_epi16 | @@ -1689,6 +1689,12 @@ simde__m128i
simde_mm_madd_epi16 (simde__m128i a, simde__m128i b) {
#if defined(SIMDE_SSE2_NATIVE)
return SIMDE__M128I_C(_mm_madd_epi16(a.n, b.n));
+#elif defined(SIMDE_SSE2_NEON)
+ int32x4_t pl = vmull_s16(vget_low_s16(a.neon_i32), vget_low_s16(b.neon_i32));
+ int32x4_t ph = vmull_s16(vget_high_s16(a.neon_i32), vget_high_s16(b.neon_i32));
+ int32x2_t rl = vpadd_s32(vget_low_s32(pl), vget_high_s32(pl));
+ int32x2_t rh = vpadd_s32(vget_low_s32(ph), vget_high_s32(ph));
+ return SIMDE__M128I_NEON_C(i32, vcombine_s32(rl, rh));
#else
simde__m128i r;
SIMDE__VECTORIZE
|
ttf: sdl_ttf_test.go: Fix font path | @@ -30,7 +30,7 @@ func TestTTF(t *testing.T) {
t.Errorf("Failed to initialize TTF: %s\n", err)
}
- if font, err = OpenFont("../assets/test.ttf", 32); err != nil {
+ if font, err = OpenFont("../.go-sdl2-examples/assets/test.ttf", 32); err != nil {
t.Errorf("Failed to open font: %s\n", err)
}
defer font.Close()
|
fix file open 3 | @@ -264,11 +264,11 @@ int pre_main(const char *argv) {
}
}
- if(CMDFILE[0]) {
- parse_cmdline(CMDFILE);
- } else {
- parse_cmdline(argv);
+ if(CMDFILE[0] == '\0') {
+ milstr_ncpy(CMDFILE, "np2kai ", 512);
+ milstr_ncat(CMDFILE, argv, 512);
}
+ parse_cmdline(CMDFILE);
for (i = 0; i<64; i++)
xargv_cmd[i] = NULL;
|
Update docs/docs/classes.md | @@ -671,7 +671,7 @@ Annotations are access via the `.classAnnotations` and `.methodAnnotations` prop
For class annotations, the returned data structure returned is a dictionary with keys set to the names of the annotations and their values if present. If no value is provided to the annotation, the value associated with the key is set to `nil`.
-For mathod annotations, the returned data structure is also a dictionary, however the keys are the method names and the values are also dictionaries containing the annotation name and associated values. If no value is provided to the annotation, the value associated with the key is set to `nil`.
+For method annotations, the returned data structure is also a dictionary, however the keys are the method names and the values are also dictionaries containing the annotation name and associated values. If no value is provided to the annotation, the value associated with the key is set to `nil`.
```cs
print(AnnotatedClass.classAnnotations); // {"Annotation": nil}
|
Silence onOff2 unused variable warning | @@ -7369,6 +7369,7 @@ void DeRestPluginPrivate::handleZclAttributeReportIndicationXiaomiSpecial(const
}
// TODO: update light state for lumi.ctrl_ln2. onOff -> enpoint 01; onOff2 -> endpoint 02.
+ Q_UNUSED(onOff2); // silence compiler warning
for (Sensor &sensor : sensors)
{
|
ci: continue-on-error for now | @@ -9,6 +9,7 @@ jobs:
builds: [mlibc, mlibc-static, mlibc-ansi-only]
name: Build mlibc
runs-on: ubuntu-20.04
+ continue-on-error: true # Since the static build current fails.
steps:
- name: Install prerequisites
# Note: the default jsonschema is too old.
|
Update the cfuncs split | @@ -85,7 +85,7 @@ VERILATOR_OPT_FLAGS := \
--x-assign fast \
--x-initial fast \
--output-split 10000 \
- --output-split-cfuncs 10000
+ --output-split-cfuncs 100
# default flags added for external IP (ariane/NVDLA)
VERILOG_IP_VERILATOR_FLAGS := \
|
added additional information if the driver doesn't accept frequency settings | @@ -7389,6 +7389,7 @@ static inline void getscanlistchannel(const char *scanlistin)
static struct iwreq pwrq;
static char *fscanlistdup;
static char *tokptr;
+static int wantedfrequency;
fscanlistdup = strndup(scanlistin, 4096);
if(fscanlistdup == NULL) return;
@@ -7399,17 +7400,32 @@ while((tokptr != NULL) && (ptrfscanlist < fscanlist +FSCANLIST_MAX))
memset(&pwrq, 0, sizeof(pwrq));
memcpy(&pwrq.ifr_name, interfacename, IFNAMSIZ);
pwrq.u.freq.flags = IW_FREQ_FIXED;
- pwrq.u.freq.m = atoi(tokptr);
+ wantedfrequency = strtol(tokptr, NULL, 10);
+ pwrq.u.freq.m = wantedfrequency;
tokptr = strtok(NULL, ",");
if(pwrq.u.freq.m > 1000) pwrq.u.freq.e = 6;
- if(ioctl(fd_socket, SIOCSIWFREQ, &pwrq) < 0) continue;
- if(ioctl(fd_socket, SIOCGIWFREQ, &pwrq) < 0) continue;
+ if(ioctl(fd_socket, SIOCSIWFREQ, &pwrq) < 0)
+ {
+ fprintf(stdout, "frequency/channel %d not accepted by driver\n", wantedfrequency);
+ continue;
+ }
+ memset(&pwrq, 0, sizeof(pwrq));
+ memcpy(&pwrq.ifr_name, interfacename, IFNAMSIZ);
+ if(ioctl(fd_socket, SIOCGIWFREQ, &pwrq) < 0)
+ {
+ fprintf(stdout, "no frequency/channel reported by driver\n");
+ continue;
+ }
ptrfscanlist->frequency = pwrq.u.freq.m;
if((pwrq.u.freq.m >= 2407) && (pwrq.u.freq.m <= 2474)) ptrfscanlist->channel = (ptrfscanlist->frequency -2407)/5;
else if((pwrq.u.freq.m >= 2481) && (pwrq.u.freq.m <= 2487)) ptrfscanlist->channel = (pwrq.u.freq.m -2412)/5;
else if((pwrq.u.freq.m >= 5005) && (pwrq.u.freq.m <= 5980)) ptrfscanlist->channel = (pwrq.u.freq.m -5000)/5;
else if((pwrq.u.freq.m >= 5955) && (pwrq.u.freq.m <= 6415)) ptrfscanlist->channel = (pwrq.u.freq.m -5950)/5;
- else continue;
+ else
+ {
+ fprintf(stdout, "unexpected frequency/channel!\nwanted %d, reported from driver %d (exponent %d)\n", wantedfrequency, pwrq.u.freq.m, pwrq.u.freq.e);
+ continue;
+ }
if(((ptrfscanlist->channel) < 1) || ((ptrfscanlist->channel) > 255)) continue;
ptrfscanlist++;
}
|
Coding: Mention `reformat-cmake` | @@ -166,7 +166,7 @@ file `CMakeLists.txt` in the root folder of the repository you can use the follo
cmake-format CMakeLists.txt | unexpand | sponge CMakeLists.txt
```
-.
+. If you want to reformat the whole codebase you can use the script [`reformat-cmake`](/scripts/reformat-cmake).
### Markdown Guidelines
|
linux/perf: enable perf on execve both with persistent and non-pid fuzzing | @@ -135,13 +135,11 @@ static bool arch_perfCreate(run_t* run, pid_t pid, dynFileMethod_t method, int*
} else {
pe.exclude_kernel = 1;
}
- if (run->global->linux.pid > 0 || run->global->persistent == true) {
- pe.disabled = 0;
- pe.enable_on_exec = 0;
- } else {
+ if (run->global->linux.pid == 0) {
pe.disabled = 1;
pe.enable_on_exec = 1;
}
+ pe.exclude_hv = 1;
pe.type = PERF_TYPE_HARDWARE;
switch (method) {
|
readme: fix discord link | @@ -18,7 +18,7 @@ It's source and pre-compiled binaries can be found [here](https://github.com/Bos
## Community
-- [Offical Discord](https://discord.gg/gH49zBrK)
+- [Offical Discord](https://discord.gg/8StVhvB6Tm)
- [Unoffical Facebook Group](https://www.facebook.com/groups/quicksilverfirmware/?ref=share)
## Building
|
Improve comments about USE_VALGRIND in pg_config_manual.h.
These comments left the impression that USE_VALGRIND isn't really
essential for valgrind testing. But that's wrong, as I learned
the hard way today.
Discussion: | * enables detection of buffer accesses that take place without holding a
* buffer pin (or without holding a buffer lock in the case of index access
* methods that superimpose their own custom client requests on top of the
- * generic bufmgr.c requests). See also src/tools/valgrind.supp.
+ * generic bufmgr.c requests).
*
* "make installcheck" is significantly slower under Valgrind. The client
* requests fall in hot code paths, so USE_VALGRIND slows execution by a few
* percentage points even when not run under Valgrind.
*
+ * Do not try to test the server under Valgrind without having built the
+ * server with USE_VALGRIND; else you will get false positives from sinval
+ * messaging (see comments in AddCatcacheInvalidationMessage). It's also
+ * important to use the suppression file src/tools/valgrind.supp to
+ * exclude other known false positives.
+ *
* You should normally use MEMORY_CONTEXT_CHECKING with USE_VALGRIND;
* instrumentation of repalloc() is inferior without it.
*/
|
Address some windows issues in buffer.c | @@ -56,7 +56,7 @@ void janet_buffer_ensure(JanetBuffer *buffer, int32_t capacity, int32_t growth)
uint8_t *old = buffer->data;
if (capacity <= buffer->capacity) return;
int64_t big_capacity = capacity * growth;
- capacity = big_capacity > INT32_MAX ? INT32_MAX : big_capacity;
+ capacity = big_capacity > INT32_MAX ? INT32_MAX : (int32_t) big_capacity;
new_data = realloc(old, capacity * sizeof(uint8_t));
if (NULL == new_data) {
JANET_OUT_OF_MEMORY;
@@ -249,7 +249,7 @@ static void bitloc(int32_t argc, Janet *argv, JanetBuffer **b, int32_t *index, i
if (bitindex != x || bitindex < 0 || byteindex >= buffer->count)
janet_panicf("invalid bit index %v", argv[1]);
*b = buffer;
- *index = byteindex;
+ *index = (int32_t) byteindex;
*bit = which_bit;
}
@@ -309,8 +309,8 @@ static Janet cfun_blit(int32_t argc, Janet *argv) {
int64_t last = ((int64_t) offset_dest - offset_src) + length_src;
if (last > INT32_MAX)
janet_panic("buffer blit out of range");
- janet_buffer_ensure(dest, last, 2);
- if (last > dest->count) dest->count = last;
+ janet_buffer_ensure(dest, (int32_t) last, 2);
+ if (last > dest->count) dest->count = (int32_t) last;
memcpy(dest->data + offset_dest, src.bytes + offset_src, length_src);
return argv[0];
}
|
fix aikon_f4 in target.json | "name": "aikon_f4",
"configurations": [
{
- "name": "brushed.serial",
+ "name": "brushless.serial",
"defines": {
- "BRUSHED_TARGET": "",
+ "BRUSHLESS_TARGET": "",
"RX_UNIFIED_SERIAL": ""
}
}
|
[Chenyu Zhao] : update class PluginStorage and it's method | @@ -4,26 +4,10 @@ type PluginStorage struct {
pluginStorage map[string]Plugin
}
-func (p * PluginStorage)Init() {
-
-}
-
-type AllPluginStorage struct {
- * PluginStorage
-}
-
-func (p * AllPluginStorage)Watch() {
-
-}
-
-func (p * AllPluginStorage) Update() {
-
-}
-
-type TaskPluginStorage struct {
- * PluginStorage
+func (p *PluginStorage) CreatePluginStorage() PluginStorage {
+ return PluginStorage{}
}
-func (p * TaskPluginStorage)CollectData() {
+func (p *PluginStorage) CollectData() {
}
|
Badger2040: Fix input handling
Fixes input handling by clearing the button states to 0 when "wait_for_press". | @@ -291,6 +291,7 @@ namespace pimoroni {
}
void Badger2040::wait_for_press() {
+ _button_states = 0;
update_button_states();
while(_button_states == 0) {
update_button_states();
|
ia32/cpu.c: small changes in inline asm | #include "syspage.h"
#include "string.h"
#include "pmap.h"
-#include "spinlock.h"
extern int threads_schedule(unsigned int n, cpu_context_t *context, void *arg);
@@ -171,11 +170,8 @@ u32 cpu_getEFLAGS(void)
__asm__ volatile
(" \
pushf; \
- popl %%eax; \
- movl %%eax, %0"
- :"=g" (eflags)
- :
- :"eax");
+ popl %0"
+ : "=a" (eflags));
return eflags;
}
@@ -379,11 +375,7 @@ void *_cpu_initCore(void)
cpu.tss[hal_cpuGetID()].esp0 = (u32)&cpu.stacks[hal_cpuGetID()][511];
/* Set task register */
- __asm__ volatile (" \
- movl %0, %%eax; \
- ltr %%ax"
- :
- : "r" ((4 + cpu.ncpus) * 8));
+ __asm__ volatile ("ltr %%ax" : : "a" ((4 + cpu.ncpus) * 8));
return (void *)cpu.tss[hal_cpuGetID()].esp0;
}
|
BIKE R3 fix for gcc-4.8.2 | #define UNPACKLO(x, y) _mm_unpacklo_epi64((x), (y))
#define UNPACKHI(x, y) _mm_unpackhi_epi64((x), (y))
#define CLMUL(x, y, imm) _mm_clmulepi64_si128((x), (y), (imm))
-#define BSRLI(x, imm) _mm_bsrli_si128((x), (imm))
-#define BSLLI(x, imm) _mm_bslli_si128((x), (imm))
+#define BSRLI(x, imm) _mm_srli_si128((x), (imm))
+#define BSLLI(x, imm) _mm_slli_si128((x), (imm))
// 4x4 Karatsuba multiplication
_INLINE_ void gf2x_mul4_int(OUT __m128i c[4],
|
remove wrong comments on s5j | @@ -475,9 +475,7 @@ static void s5j_sflash_select(FAR struct spi_dev_s *spidev, enum spi_dev_e devid
* Name: s5j_sflash_setfrequency
*
* Description:
- * Support changing frequency. But we can't change frequency.
- * If you need to change frequency, please ask the broadcom.
- * This function is a part of spi_ops.
+ * Support changing frequency.
*
*****************************************************************************/
@@ -490,9 +488,7 @@ static uint32_t s5j_sflash_setfrequency(FAR struct spi_dev_s *spidev, uint32_t f
* Name: s5j_sflash_setmode
*
* Description:
- * Support changing mode(CPHA/CPOL). But we can't change mode.
- * If you need to change mode, please ask the broadcom.
- * This function is a part of spi_ops.
+ * Support changing mode(CPHA/CPOL).
*
*****************************************************************************/
|
Fix CreateProcess parameter usage | @@ -2583,6 +2583,7 @@ NTSTATUS PhCreateProcessWin32Ex(
)
{
NTSTATUS status;
+ PPH_STRING fileName = NULL;
PPH_STRING commandLine = NULL;
STARTUPINFO startupInfo;
PROCESS_INFORMATION processInfo;
@@ -2591,6 +2592,21 @@ NTSTATUS PhCreateProcessWin32Ex(
if (CommandLine) // duplicate because CreateProcess modifies the string
commandLine = PhCreateString(CommandLine);
+ if (FileName)
+ fileName = PhCreateString(FileName);
+ else
+ {
+ INT cmdlineArgCount;
+ PWSTR* cmdlineArgList;
+
+ // Try extract the filename or CreateProcess might execute the wrong executable.
+ if (commandLine && (cmdlineArgList = CommandLineToArgvW(commandLine->Buffer, &cmdlineArgCount)))
+ {
+ PhMoveReference(&fileName, PhCreateString(cmdlineArgList[0]));
+ LocalFree(cmdlineArgList);
+ }
+ }
+
newFlags = 0;
PhMapFlags1(&newFlags, Flags, PhpCreateProcessMappings, sizeof(PhpCreateProcessMappings) / sizeof(PH_FLAG_MAPPING));
@@ -2607,7 +2623,7 @@ NTSTATUS PhCreateProcessWin32Ex(
if (!TokenHandle)
{
if (CreateProcess(
- FileName,
+ PhGetString(fileName),
PhGetString(commandLine),
NULL,
NULL,
@@ -2626,7 +2642,7 @@ NTSTATUS PhCreateProcessWin32Ex(
{
if (CreateProcessAsUser(
TokenHandle,
- FileName,
+ PhGetString(fileName),
PhGetString(commandLine),
NULL,
NULL,
@@ -2642,6 +2658,8 @@ NTSTATUS PhCreateProcessWin32Ex(
status = PhGetLastWin32ErrorAsNtStatus();
}
+ if (fileName)
+ PhDereferenceObject(fileName);
if (commandLine)
PhDereferenceObject(commandLine);
|
More specific detection of Trust remote
In addition to PR | @@ -15569,8 +15569,9 @@ void DeRestPluginPrivate::delayedFastEnddeviceProbe(const deCONZ::NodeEvent *eve
skip = true; // Xiaomi Mija devices won't respond to ZCL read
DBG_Printf(DBG_INFO, "[4] Skipping additional attribute read - Model starts with 'lumi.'\n");
}
- else if (checkMacAndVendor(node, VENDOR_JENNIC) ||
- checkMacAndVendor(node, VENDOR_ADUROLIGHT))
+ else if ((checkMacAndVendor(node, VENDOR_JENNIC) || checkMacAndVendor(node, VENDOR_ADUROLIGHT))
+ && node->simpleDescriptors().size() == 2
+ && node->simpleDescriptors().front().deviceId() == DEV_ID_ZLL_NON_COLOR_CONTROLLER)
{
skip = true; // e.g. Trust remote (ZYCT-202)
DBG_Printf(DBG_INFO, "[4] Skipping additional attribute read - Assumed Trust remote (ZYCT-202)\n");
|
Temporarily remove FME threshold for verification purposes | @@ -1363,7 +1363,7 @@ static void search_pu_inter_ref(inter_search_info_t *info,
break;
}
- if (cfg->fme_level > 0 && info->best_cost < *inter_cost) {
+ if (cfg->fme_level > 0 && info->best_cost < MAX_DOUBLE) {
search_frac(info);
} else if (info->best_cost < MAX_DOUBLE) {
|
Fix old group0 delete | @@ -336,31 +336,38 @@ DeRestPluginPrivate::DeRestPluginPrivate(QObject *parent) :
}
// create default group
+ // get new id
if (gwGroup0 == 0)
{
- // get new id and replace old group0 and get new id
for (uint16_t i = 0xFFF0; i > 0; i--) // 0 and larger than 0xfff7 is not valid for Osram Lightify
{
Group* group = getGroupForId(i);
if (!group)
{
gwGroup0 = i;
+ break;
+ }
+ }
+ }
+
// delete old group 0
- Group* group = getGroupForId(0);
- if (group)
+ if (gwGroup0 != 0)
{
- group->setState(Group::StateDeleted);
- }
+ for (Group& group : groups)
+ {
+ if (group.address() == 0 && !(group.state() == Group::StateDeleted || group.state() == Group::StateDeleteFromDB))
+ {
+ group.setState(Group::StateDeleted);
queSaveDb(DB_CONFIG | DB_GROUPS, DB_LONG_SAVE_DELAY);
break;
}
}
}
+ // create new group 0
Group* group = getGroupForId(gwGroup0);
if (!group)
{
- // new default group
Group group;
group.setAddress(gwGroup0);
group.setName("All");
|
ethio: handles a result member in an error response
When using a Ganache for running a local Ethereum node, an error RPC
response can contain a 'result' member with the hash of the transaction,
even though that goes against the JSON-RPC spec | ++ parse-one-response
|= =json
^- (unit response:rpc)
+ ?. &(?=([%o *] json) (~(has by p.json) 'error'))
=/ res=(unit [@t ^json])
%. json
=, dejs-soft:format
(ot id+so result+some ~)
- ?^ res `[%result u.res]
+ ?~ res ~
+ `[%result u.res]
~| parse-one-response=json
- :+ ~ %error %- need
+ =/ error=(unit [id=@t ^json code=@ta mssg=@t])
%. json
=, dejs-soft:format
- (ot id+so error+(ot code+no message+so ~) ~)
+ :: A 'result' member is present in the error
+ :: response when using ganache, even though
+ :: that goes against the JSON-RPC spec
+ ::
+ (ot id+so result+some error+(ot code+no message+so ~) ~)
+ ?~ error ~
+ =* err u.error
+ `[%error id.err code.err mssg.err]
--
::
:: +read-contract: calls a read function on a contract, produces result hex
|
Update inlining options for `next` and `resume`. | #include "vector.h"
#endif
+static int arity1or2(JanetFopts opts, JanetSlot *args) {
+ (void) opts;
+ int32_t arity = janet_v_count(args);
+ return arity == 1 || arity == 2;
+}
static int fixarity1(JanetFopts opts, JanetSlot *args) {
(void) opts;
return janet_v_count(args) == 1;
@@ -63,6 +68,27 @@ static JanetSlot genericSSI(JanetFopts opts, int op, JanetSlot s, int32_t imm) {
return target;
}
+/* Emit an insruction that implements a form by itself. */
+static JanetSlot opfunction(
+ JanetFopts opts,
+ JanetSlot *args,
+ int op,
+ Janet defaultArg2) {
+ JanetCompiler *c = opts.compiler;
+ int32_t len;
+ len = janet_v_count(args);
+ JanetSlot t;
+ if (len == 1) {
+ t = janetc_gettarget(opts);
+ janetc_emit_sss(c, op, t, args[0], janetc_cslot(defaultArg2), 1);
+ return t;
+ } else if (len == 2) {
+ t = janetc_gettarget(opts);
+ janetc_emit_sss(c, op, t, args[0], args[1], 1);
+ }
+ return t;
+}
+
/* Emit a series of instructions instead of a function call to a math op */
static JanetSlot opreduce(
JanetFopts opts,
@@ -113,7 +139,7 @@ static JanetSlot do_get(JanetFopts opts, JanetSlot *args) {
return opreduce(opts, args, JOP_GET, janet_wrap_nil());
}
static JanetSlot do_next(JanetFopts opts, JanetSlot *args) {
- return opreduce(opts, args, JOP_NEXT, janet_wrap_nil());
+ return opfunction(opts, args, JOP_NEXT, janet_wrap_nil());
}
static JanetSlot do_modulo(JanetFopts opts, JanetSlot *args) {
return opreduce(opts, args, JOP_MODULO, janet_wrap_nil());
@@ -143,7 +169,7 @@ static JanetSlot do_yield(JanetFopts opts, JanetSlot *args) {
}
}
static JanetSlot do_resume(JanetFopts opts, JanetSlot *args) {
- return opreduce(opts, args, JOP_RESUME, janet_wrap_nil());
+ return opfunction(opts, args, JOP_RESUME, janet_wrap_nil());
}
static JanetSlot do_apply(JanetFopts opts, JanetSlot *args) {
/* Push phase */
@@ -270,7 +296,7 @@ static const JanetFunOptimizer optimizers[] = {
{fixarity1, do_error},
{minarity2, do_apply},
{maxarity1, do_yield},
- {fixarity2, do_resume},
+ {arity1or2, do_resume},
{fixarity2, do_in},
{fixarity3, do_put},
{fixarity1, do_length},
@@ -293,7 +319,7 @@ static const JanetFunOptimizer optimizers[] = {
{NULL, do_neq},
{fixarity2, do_propagate},
{fixarity2, do_get},
- {fixarity2, do_next},
+ {arity1or2, do_next},
{fixarity2, do_modulo},
{fixarity2, do_remainder},
};
|
During sensor search only check data of joining device for resource creation | @@ -2946,6 +2946,11 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
return;
}
+ if (fastProbeAddr.hasExt() && fastProbeAddr.ext() != node->address().ext())
+ {
+ return;
+ }
+
// check for new sensors
QString modelId;
QString manufacturer;
|
BugID:17831376:[utils] fix[WhiteScan][424420][BUFFER_SIZE_WARNING] | @@ -192,6 +192,7 @@ void *LITE_realloc_internal(const char *f, const int l, void *ptr, int size, ...
void *_create_mem_table(char *module_name, struct list_head *list_head)
{
module_mem_t *pos = NULL;
+ int len = 0;
if (!module_name || !list_head) {
return NULL;
@@ -202,7 +203,8 @@ void *_create_mem_table(char *module_name, struct list_head *list_head)
return NULL;
}
memset(pos, 0, sizeof(module_mem_t));
- strncpy(pos->mem_statis.module_name, module_name, sizeof(pos->mem_statis.module_name));
+ len = strlen(module_name);
+ memcpy(pos->mem_statis.module_name, module_name, (len >= sizeof(pos->mem_statis.module_name)) ? (sizeof(pos->mem_statis.module_name) - 1) : len);
INIT_LIST_HEAD(&pos->mem_statis.calling_stack.func_head);
|
fix bsp_leds project. | <FileType>5</FileType>
<FilePath>..\..\..\bsp\boards\scum\scm3_hardware_interface.h</FilePath>
</File>
+ <File>
+ <FileName>bucket_o_functions.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\..\..\bsp\boards\scum\bucket_o_functions.c</FilePath>
+ </File>
+ <File>
+ <FileName>bucket_o_functions.h</FileName>
+ <FileType>5</FileType>
+ <FilePath>..\..\..\bsp\boards\scum\bucket_o_functions.h</FilePath>
+ </File>
+ <File>
+ <FileName>retarget.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\..\..\bsp\boards\scum\retarget.c</FilePath>
+ </File>
</Files>
</Group>
<Group>
|
example/wifi/scan: fix README grammar
Merges | # Wifi SCAN Example
-This example shows how to use scan of ESP32.
+This example shows how to use the scan functionality of the Wi-Fi driver of ESP32.
-We have two way to scan, fast scan and all channel scan:
+Two scan methods are supported: fast scan and all channel scan.
-* fast scan: in this mode, scan will finish after find match AP even didn't scan all the channel, you can set thresholds for signal and authmode, it will ignore the AP which below the thresholds.
+* fast scan: in this mode, scan finishes right after a matching AP is detected, even if channels are not completely scanned. You can set thresholds for signal strength, as well as select desired authmodes provided by the AP's. The Wi-Fi driver will ignore AP's that fail to meet mentioned criteria.
-* all channel scan : scan will end after checked all the channel, it will store four of the whole matched AP, you can set the sort method base on rssi or authmode, after scan, it will choose the best one
+* all channel scan: scan will end only after all channel are scanned; the Wi-Fi driver will store 4 of the fully matching AP's. Sort methods for AP's include rssi and authmode. After the scan, the Wi-Fi driver selects the AP that fits best based on the sort.
-and try to connect. Because it need malloc dynamic memory to store match AP, and most of cases is to connect to better signal AP, so it needn't record all the AP matched. The number of matches is limited to 4 in order to limit dynamic memory usage. Four matches allows APs with the same SSID name and all possible auth modes - Open, WEP, WPA and WPA2.
+After the scan, the Wi-Fi driver will try to connect. Because it needs to malloc precious dynamic memory to store matching AP's, and, most of the cases, connect to the AP with the strongest reception, it does not need to record all the AP's matched. The number of matches stored is limited to 4 in order to limit dynamic memory usage. Among the 4 matches, AP's are allowed to carry the same SSID name and all possible auth modes - Open, WEP, WPA and WPA2.
|
implement enable disable interrupt | #define RFTIMER_MAX_COUNT 0x3ffffff // use a value less than 0xffffffff/61 and also equal to 2^n-1
#define TIMERLOOP_THRESHOLD 0xfffff // 0xffff is 2 seconds @ 32768Hz clock
-#define MINIMUM_COMPAREVALE_ADVANCE 10
+#define MINIMUM_COMPAREVALE_ADVANCE 5
// ========================== variable ========================================
@@ -95,10 +95,12 @@ void sctimer_enable(void){
// enable compare interrupt (this also cancels any pending interrupts)
RFTIMER_REG__COMPARE0_CONTROL = RFTIMER_COMPARE_ENABLE | \
RFTIMER_COMPARE_INTERRUPT_ENABLE;
+ ISER = 0x80;
}
void sctimer_disable(void){
RFTIMER_REG__COMPARE0_CONTROL = 0x0;
+ ICER = 0x80;
}
#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT
|
removed experimental for 8k5 | @@ -35,7 +35,7 @@ choice
AlphaData KU3 has ethernet and 8GB DDR3 SDRAM. Uses Xilinx FPGA XCKU060.
config AD8K5
- bool "Experimental: AlphaData 8K5 Card with Ethernet, 8GB DDR4 SDRAM and Xilinx KU115 FPGA"
+ bool "AlphaData 8K5 Card with Ethernet, 8GB DDR4 SDRAM and Xilinx KU115 FPGA"
select CAPI10
select DISABLE_NVME
help
|
https_request example: Perform request over HTTP/1.1 to enable keepalive timeout
Closes: | static const char *TAG = "example";
-static const char *REQUEST = "GET " WEB_URL " HTTP/1.0\r\n"
+static const char *REQUEST = "GET " WEB_URL " HTTP/1.1\r\n"
"Host: "WEB_SERVER"\r\n"
"User-Agent: esp-idf/1.0 esp32\r\n"
"\r\n";
|
Update the minor and patch versions | @@ -51,8 +51,8 @@ extern "C" {
// version 0, you should not be making any forward compatibility
// assumptions.
#define NNG_MAJOR_VERSION 1
-#define NNG_MINOR_VERSION 0
-#define NNG_PATCH_VERSION 1
+#define NNG_MINOR_VERSION 1
+#define NNG_PATCH_VERSION 0
#define NNG_RELEASE_SUFFIX "" // if non-empty, this is a pre-release
// Maximum length of a socket address. This includes the terminating NUL.
|
cmake: fix merge conflict
I'm surprised this made it through CI. Not sure whether to be amazed
or appalled that CMake accepted it, but I'm leaning towards the latter. | @@ -163,11 +163,8 @@ foreach(tst
"/x86/avx512f"
"/x86/avx512bw"
"/x86/avx512vl"
-<<<<<<< HEAD
"/x86/avx512dq"
-=======
"/x86/gfni"
->>>>>>> 243415e... Add gfni support in gfni.[hc]
"/x86/svml"
)
add_test(NAME "${tst}/${variant}" COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:run-tests> "${tst}")
|
Parallel test support for init_test_index_loc
Use File::Temp to create a temporary directory in 't' that will be
cleaned up at exit. A side effect is that the directory won't be
removed if the test crashes. | @@ -29,7 +29,6 @@ our @EXPORT_OK = qw(
uscon_dir
create_index
create_uscon_index
- test_index_loc
persistent_test_index_loc
init_test_index_loc
get_uscon_docs
@@ -44,6 +43,7 @@ use Lucy::Test;
use File::Spec::Functions qw( catdir catfile curdir updir );
use Encode qw( _utf8_off );
use File::Path qw( rmtree );
+use File::Temp qw( tempdir );
use Carp;
my $working_dir = catfile( curdir(), 'lucy_test' );
@@ -64,28 +64,15 @@ sub remove_working_dir {
return 1;
}
-# Return a location for a test index to be used by a single test file. If
-# the test file crashes it cannot clean up after itself, so we put the cleanup
-# routine in a single test file to be run at or near the end of the test
-# suite.
-sub test_index_loc {
- return catdir( $working_dir, 'test_index' );
-}
-
# Return a location for a test index intended to be shared by multiple test
# files. It will be cleaned as above.
sub persistent_test_index_loc {
return catdir( $working_dir, 'persistent_test_index' );
}
-# Destroy anything left over in the test_index location, then create the
-# directory. Finally, return the path.
+# Create a temporary test directory that will be removed at exit.
sub init_test_index_loc {
- my $dir = test_index_loc();
- rmtree $dir;
- die "Can't clean up '$dir'" if -e $dir;
- mkdir $dir or die "Can't mkdir '$dir': $!";
- return $dir;
+ return tempdir( DIR => 't', CLEANUP => 1 );
}
# Build a RAM index, using the supplied array of strings as source material.
|
[mod_ssi] check http_chunk_transfer_cqlen for err
pedantic check of http_chunk_transfer_cqlen() for error | @@ -1535,7 +1535,9 @@ static void mod_ssi_read_fd(request_st * const r, handler_ctx * const p, struct
* (reduce occurrence of copying to reallocate larger chunk) */
if (cq->last && cq->last->type == MEM_CHUNK
&& buffer_string_space(cq->last->mem) < 1023)
- http_chunk_transfer_cqlen(r, cq, chunkqueue_length(cq));
+ if (0 != http_chunk_transfer_cqlen(r, cq, chunkqueue_length(cq)))
+ chunkqueue_remove_empty_chunks(&r->write_queue);
+ /*(likely unrecoverable error if r->resp_send_chunked)*/
}
if (0 != rd) {
@@ -1551,7 +1553,9 @@ static void mod_ssi_read_fd(request_st * const r, handler_ctx * const p, struct
}
chunk_buffer_release(b);
- http_chunk_transfer_cqlen(r, cq, chunkqueue_length(cq));
+ if (0 != http_chunk_transfer_cqlen(r, cq, chunkqueue_length(cq)))
+ chunkqueue_remove_empty_chunks(&r->write_queue);
+ /*(likely error unrecoverable if r->resp_send_chunked)*/
}
|
Fix Cortex-M0 Cannot Execute Reboot | @@ -119,7 +119,7 @@ void rt_hw_hard_fault_exception(struct exception_stack_frame *contex)
#define SCB_HFSR (*(volatile const unsigned *)0xE000ED2C) /* HardFault Status Register */
#define SCB_MMAR (*(volatile const unsigned *)0xE000ED34) /* MemManage Fault Address register */
#define SCB_BFAR (*(volatile const unsigned *)0xE000ED38) /* Bus Fault Address Register */
-#define SCB_AIRCR (*(volatile unsigned long *)0xE000ED00) /* Reset control Address Register */
+#define SCB_AIRCR (*(volatile unsigned long *)0xE000ED0C) /* Reset control Address Register */
#define SCB_RESET_VALUE 0x05FA0004 /* Reset value, write to SCB_AIRCR can reset cpu */
#define SCB_CFSR_MFSR (*(volatile const unsigned char*)0xE000ED28) /* Memory-management Fault Status Register */
|
Set default texture filter before creating texture; | @@ -75,6 +75,9 @@ void lovrGraphicsInit() {
}
// Objects
+ state.depthTest = -1;
+ state.defaultFilter = FILTER_TRILINEAR;
+ state.defaultAnisotropy = 1.;
state.defaultShader = lovrShaderCreate(lovrDefaultVertexShader, lovrDefaultFragmentShader);
state.skyboxShader = lovrShaderCreate(lovrSkyboxVertexShader, lovrSkyboxFragmentShader);
int uniformId = lovrShaderGetUniformId(state.skyboxShader, "cube");
@@ -97,9 +100,6 @@ void lovrGraphicsInit() {
#endif
// State
- state.depthTest = -1;
- state.defaultFilter = FILTER_TRILINEAR;
- state.defaultAnisotropy = 1.;
lovrGraphicsReset();
atexit(lovrGraphicsDestroy);
}
|
NVMe: Create snap_config.sv at a different place | @@ -183,11 +183,11 @@ prepare_project: check_snap_settings prepare_logs
@ln -f -s $(SNAP_HDL_CORE)/dma_types_$(CAPI_VER).vhd_source $(SNAP_HDL_CORE)/dma_types.vhd;
@ln -f -s $(SNAP_HDL_CORE)/dma_buffer_$(CAPI_VER).vhd_source $(SNAP_HDL_CORE)/dma_buffer.vhd;
@ln -f -s $(SNAP_HDL_CORE)/dma_rams_$(CAPI_VER).vhd_source $(SNAP_HDL_CORE)/dma_rams.vhd;
- $(MAKE) -C $(SNAP_ROOT)/hardware/sim/nvme_lite
@echo -e "[PREPARE PROJECT.....] done `date +"%T %a %b %d %Y"`";
snap_preprocess_start: prepare_project
@echo -e "[SNAP PREPROCESS.....] start `date +"%T %a %b %d %Y"`";
+ $(MAKE) -C $(SNAP_ROOT)/hardware/sim/nvme_lite
$(SNAP_PP_FILES_VHD):
@if [ -e "$(snap_config_cflags)" ]; then \
|
chore(Makefile): add -pedantic flag | @@ -54,7 +54,7 @@ CFLAGS += -O0 -g -pthread \
-I. -I$(CEEUTILS_DIR) -I$(COMMON_DIR) -I$(THIRDP_DIR) \
-DLOG_USE_COLOR
-WFLAGS += -Wall -Wextra
+WFLAGS += -Wall -Wextra -pedantic
ifeq ($(static_debug),1)
CFLAGS += -D_STATIC_DEBUG
|
Convert wav files to 8bit automatically | @@ -29,6 +29,12 @@ export const compileWav = async (
wavFmt = wav.fmt as WaveFileFmt;
}
+ // Convert to 8bit if not already
+ if (wavFmt.bitsPerSample !== 8) {
+ wav.toBitDepth("8");
+ wavFmt = wav.fmt as WaveFileFmt;
+ }
+
if (
// wavFmt.numChannels !== 1 ||
// wavFmt.bitsPerSample !== 8 ||
|
udpated error msg | @@ -78,7 +78,7 @@ def draw():
graphics.set_pen(4)
graphics.rectangle(0, 170, 640, 25)
graphics.set_pen(1)
- graphics.text("Unable to display image! :(", 5, 175, 400, 2)
+ graphics.text("Unable to display image! Check your network settings in secrets.py", 5, 175, 600, 2)
graphics.set_pen(0)
graphics.rectangle(0, 375, 640, 25)
|
Fix multi message iso tp requests | @@ -372,7 +372,7 @@ class IsoTpMessage():
self._tx_first_frame()
def _tx_first_frame(self) -> None:
- if self.tx_len < 8:
+ if self.tx_len < self.max_len:
# single frame (send all bytes)
if self.debug: print("ISO-TP: TX - single frame")
msg = (bytes([self.tx_len]) + self.tx_dat).ljust(self.max_len, b"\x00")
@@ -380,7 +380,7 @@ class IsoTpMessage():
else:
# first frame (send first 6 bytes)
if self.debug: print("ISO-TP: TX - first frame")
- msg = (struct.pack("!H", 0x1000 | self.tx_len) + self.tx_dat[:6]).ljust(self.max_len, b"\x00")
+ msg = (struct.pack("!H", 0x1000 | self.tx_len) + self.tx_dat[:self.max_len - 2]).ljust(self.max_len - 2, b"\x00")
self._can_client.send([msg])
def recv(self) -> bytes:
|
Don't disconnect if there are issues w/the incoming message | @@ -481,8 +481,7 @@ remoteConfig()
numtries++;
rc = scope_recv(fds.fd, buf, sizeof(buf), MSG_DONTWAIT);
if (rc <= 0) {
- // Something has happened to our connection
- ctlDisconnect(g_ctl, CFG_CTL);
+ // Something has happened to this incoming message
break;
}
|
Fixed error in which InitializeOutputEqtide was somehow dropped from eqtide.c. | @@ -2311,7 +2311,7 @@ void WriteTideLock(BODY *body,CONTROL *control,OUTPUT *output,SYSTEM *system,UNI
strcat(cUnit,"");
}
-void (OUTPUT *output,fnWriteOutput fnWrite[]) {
+void InitializeOutputEqtide(OUTPUT *output,fnWriteOutput fnWrite[]) {
sprintf(output[OUT_BODYDSEMIDTEQTIDE].cName,"BodyDsemiDtEqtide");
sprintf(output[OUT_BODYDSEMIDTEQTIDE].cDescr,"Body's Contribution to dSemi/dt in EQTIDE");
|
noncart/nufft: properly propagate the lowmem flag
Otherwise, it will not be used in the calculation of the psf, which can
often be the largest nufft performed. | @@ -261,6 +261,7 @@ complex float* compute_psf(unsigned int N, const long img_dims[N], const long tr
struct nufft_conf_s conf = nufft_conf_defaults;
conf.periodic = periodic;
conf.toeplitz = false; // avoid infinite loop
+ conf.lowmem = lowmem;
debug_printf(DP_DEBUG2, "nufft kernel dims: ");
|
Protocol error if same secret twice. | @@ -1084,12 +1084,18 @@ int picoquic_enqueue_cnxid_stash(picoquic_cnx_t * cnx,
(int)sequence, (int)cnx->path[i]->remote_cnxid_sequence);
ret = PICOQUIC_TRANSPORT_PROTOCOL_VIOLATION;
}
+ else if (memcmp(secret_bytes, &cnx->path[i]->reset_secret, PICOQUIC_RESET_SECRET_SIZE) == 0) {
+ DBG_PRINTF("Path %d, Cnx_id: %02x%02x%02x%02x..., Sequence %d vs. %d, same secret\n",
+ i, cnx_id.id[0], cnx_id.id[1], cnx_id.id[2], cnx_id.id[3],
+ (int)sequence, (int)cnx->path[i]->remote_cnxid_sequence);
+ ret = PICOQUIC_TRANSPORT_PROTOCOL_VIOLATION;
+ }
}
if (ret == 0 && is_duplicate == 0) {
picoquic_probe_t * next_probe = cnx->probe_first;
- while (ret == 0 && next_probe != NULL) {
+ while (next_probe != NULL) {
if (sequence == next_probe->sequence) {
if (picoquic_compare_connection_id(&cnx_id, &next_probe->remote_cnxid) == 0)
{
@@ -1104,10 +1110,16 @@ int picoquic_enqueue_cnxid_stash(picoquic_cnx_t * cnx,
}
else {
ret = PICOQUIC_TRANSPORT_PROTOCOL_VIOLATION;
+ break;
}
}
else if (picoquic_compare_connection_id(&cnx_id, &next_probe->remote_cnxid) == 0) {
ret = PICOQUIC_TRANSPORT_PROTOCOL_VIOLATION;
+ break;
+ }
+ else if (memcmp(secret_bytes, next_probe->reset_secret, PICOQUIC_RESET_SECRET_SIZE) == 0) {
+ ret = PICOQUIC_TRANSPORT_PROTOCOL_VIOLATION;
+ break;
}
next_probe = next_probe->next_probe;
@@ -1117,7 +1129,7 @@ int picoquic_enqueue_cnxid_stash(picoquic_cnx_t * cnx,
if (ret == 0 && is_duplicate == 0) {
next_stash = cnx->cnxid_stash_first;
- while (next_stash != NULL) {
+ while (next_stash != NULL && ret == 0 && is_duplicate == 0) {
if (picoquic_compare_connection_id(&cnx_id, &next_stash->cnx_id) == 0)
{
if (next_stash->sequence == sequence &&
@@ -1132,6 +1144,9 @@ int picoquic_enqueue_cnxid_stash(picoquic_cnx_t * cnx,
else if (next_stash->sequence == sequence) {
ret = PICOQUIC_TRANSPORT_PROTOCOL_VIOLATION;
}
+ else if (memcmp(secret_bytes, next_stash->reset_secret, PICOQUIC_RESET_SECRET_SIZE) == 0) {
+ ret = PICOQUIC_TRANSPORT_PROTOCOL_VIOLATION;
+ }
last_stash = next_stash;
next_stash = next_stash->next_in_stash;
}
|
Report time spent in posix_fallocate() as a wait event.
When allocating DSM segments with posix_fallocate() on Linux (see commit
899bd785), report this activity as a wait event exactly as we would if
we were using file-backed DSM rather than shm_open()-backed DSM.
Author: Thomas Munro
Discussion: | @@ -371,10 +371,12 @@ dsm_impl_posix_resize(int fd, off_t size)
* interrupt pending. This avoids the possibility of looping forever
* if another backend is repeatedly trying to interrupt us.
*/
+ pgstat_report_wait_start(WAIT_EVENT_DSM_FILL_ZERO_WRITE);
do
{
rc = posix_fallocate(fd, 0, size);
} while (rc == EINTR && !(ProcDiePending || QueryCancelPending));
+ pgstat_report_wait_end();
/*
* The caller expects errno to be set, but posix_fallocate() doesn't
|
ames: try sponsors above .our | (emit duct %pass /public-keys %j %public-keys [n=ship ~ ~])
:: +send-blob: fire packet at .ship and maybe sponsors
::
- :: Send to .ship and sponsors until we find a direct lane or
- :: encounter .our in the sponsorship chain.
+ :: Send to .ship and sponsors until we find a direct lane,
+ :: skipping .our in the sponsorship chain.
::
:: If we have no PKI data for a recipient, enqueue the packet and
:: request the information from Jael if we haven't already.
::
=/ =peer-state +.u.ship-state
::
+ ?: =(our ship)
+ (try-next-sponsor sponsor.peer-state)
+ ::
?~ route=route.peer-state
(try-next-sponsor sponsor.peer-state)
::
::
?: =(ship sponsor)
event-core
- ?: =(our sponsor)
- event-core
^$(ship sponsor)
--
:: +attestation-packet: generate signed self-attestation for .her
|
Fix SSKDF to not claim a buffer size that is too small for the MAC
We also check that our buffer is sufficiently sized for the MAC output | @@ -239,7 +239,7 @@ static int SSKDF_mac_kdm(EVP_MAC_CTX *ctx_init,
goto end;
out_len = EVP_MAC_CTX_get_mac_size(ctx_init); /* output size */
- if (out_len <= 0)
+ if (out_len <= 0 || (mac == mac_buf && out_len > sizeof(mac_buf)))
goto end;
len = derived_key_len;
@@ -263,7 +263,7 @@ static int SSKDF_mac_kdm(EVP_MAC_CTX *ctx_init,
if (len == 0)
break;
} else {
- if (!EVP_MAC_final(ctx, mac, NULL, len))
+ if (!EVP_MAC_final(ctx, mac, NULL, out_len))
goto end;
memcpy(out, mac, len);
break;
|
Update templates/c/README.md | @@ -48,4 +48,4 @@ You can then run your cartridge as follows:
The script ```buildcart.sh``` does the above steps as a convenience.
## Additional Notes
-The TIC functions that provide standard library features are not added here. You should use the `memcpy` and `memset` functions provided by the C standard library instead.
\ No newline at end of file
+TIC-80 API functions that merely duplicate standard library functionality are not imported. Please use the `memcpy` and `memset` functions provided by the C standard library instead.
\ No newline at end of file
|
parallel-libs/slepc: update install stanza for latest version | @@ -73,7 +73,7 @@ make SLEPC_DIR=${RPM_BUILD_DIR}/%{pname}-%{version} PETSC=$PETSC_DIR
module load openblas
%endif
module load petsc
-make install
+make SLEPC_DIR=${RPM_BUILD_DIR}/%{pname}-%{version} PETSC=$PETSC_DIR install
# move from tmp install dir to %install_path
# dirname removes the last directory
|
Work around emscripten window limitation; | @@ -116,14 +116,8 @@ void lovrGraphicsPresent() {
void lovrGraphicsCreateWindow(int w, int h, bool fullscreen, int msaa, const char* title, const char* icon) {
lovrAssert(!state.window, "Window is already created");
+#ifndef EMSCRIPTEN
if ((state.window = glfwGetCurrentContext()) == NULL) {
-#ifdef EMSCRIPTEN
- glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
- glfwWindowHint(GLFW_SAMPLES, msaa);
- glfwWindowHint(GLFW_SRGB_CAPABLE, state.gammaCorrect);
-#else
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
@@ -131,6 +125,12 @@ void lovrGraphicsCreateWindow(int w, int h, bool fullscreen, int msaa, const cha
glfwWindowHint(GLFW_SAMPLES, msaa);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
glfwWindowHint(GLFW_SRGB_CAPABLE, state.gammaCorrect);
+#else
+ glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
+ glfwWindowHint(GLFW_SAMPLES, msaa);
+ glfwWindowHint(GLFW_SRGB_CAPABLE, state.gammaCorrect);
#endif
GLFWmonitor* monitor = glfwGetPrimaryMonitor();
@@ -157,9 +157,9 @@ void lovrGraphicsCreateWindow(int w, int h, bool fullscreen, int msaa, const cha
glfwMakeContextCurrent(state.window);
glfwSetWindowCloseCallback(state.window, onCloseWindow);
+#ifndef EMSCRIPTEN
}
-#ifndef EMSCRIPTEN
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
glfwSwapInterval(0);
glEnable(GL_LINE_SMOOTH);
|
Update mat4:set for vanilla lua; | @@ -1459,12 +1459,57 @@ static int l_lovrMat4Unpack(lua_State* L) {
int l_lovrMat4Set(lua_State* L) {
mat4 m = luax_checkvector(L, 1, V_MAT4, NULL);
- if (lua_gettop(L) >= 17) {
+ int top = lua_gettop(L);
+ int type = lua_type(L, 2);
+ if (type == LUA_TNONE || type == LUA_TNIL || (top == 2 && type == LUA_TNUMBER)) {
+ float x = luax_optfloat(L, 2, 1.f);
+ memset(m, 0, 16 * sizeof(float));
+ m[0] = m[5] = m[10] = m[15] = x;
+ } else if (top == 17) {
for (int i = 2; i <= 17; i++) {
- *m++ = luaL_checknumber(L, i);
+ *m++ = luax_checkfloat(L, i);
}
} else {
- luax_readmat4(L, 2, m, 3);
+ VectorType vectorType;
+ float* v = luax_tovector(L, 2, &vectorType);
+ if (vectorType == V_MAT4) {
+ mat4_init(m, v);
+ } else {
+ int index = 2;
+ mat4_identity(m);
+
+ float LOVR_ALIGN(16) position[4];
+ index = luax_readvec3(L, index, position, "nil, number, vec3, or mat4");
+ m[12] = position[0];
+ m[13] = position[1];
+ m[14] = position[2];
+
+ float* v = luax_tovector(L, index, &vectorType);
+ if (vectorType == V_QUAT) {
+ mat4_rotateQuat(m, v);
+ } else if ((top - index) == 3 && lua_type(L, top) == LUA_TNUMBER) {
+ float angle = luax_checkfloat(L, index++);
+ float ax = luax_checkfloat(L, index++);
+ float ay = luax_checkfloat(L, index++);
+ float az = luax_checkfloat(L, index++);
+ mat4_rotate(m, angle, ax, ay, az);
+ } else {
+ if (vectorType == V_VEC3) {
+ m[0] = v[0];
+ m[5] = v[1];
+ m[10] = v[2];
+ index++;
+ } else if (lua_type(L, index) == LUA_TNUMBER) {
+ m[0] = luax_checkfloat(L, index++);
+ m[5] = luax_checkfloat(L, index++);
+ m[10] = luax_checkfloat(L, index++);
+ }
+
+ float LOVR_ALIGN(16) rotation[4];
+ luax_readquat(L, index, rotation, NULL);
+ mat4_rotateQuat(m, rotation);
+ }
+ }
}
lua_settop(L, 1);
return 1;
|
Document SNI support in unbound-anchor.8.in. | @@ -69,6 +69,9 @@ The server name, it connects to https://name. Specify without https:// prefix.
The default is "data.iana.org". It connects to the port specified with \-P.
You can pass an IPv4 address or IPv6 address (no brackets) if you want.
.TP
+.B \-S
+Do not use SNI for the HTTPS connection. Default is to use SNI.
+.TP
.B \-b \fIaddress
The source address to bind to for domain resolution and contacting the server
on https. May be either an IPv4 address or IPv6 address (no brackets).
|
EIP712 signatures now computed on chain ID | @@ -488,8 +488,19 @@ static bool verify_contract_name_signature(uint8_t dname_length,
uint8_t hash[INT256_LENGTH];
cx_ecfp_public_key_t verifying_key;
cx_sha256_t hash_ctx;
+ uint64_t chain_id;
cx_sha256_init(&hash_ctx);
+
+ // Chain ID
+ chain_id = __builtin_bswap64(chainConfig->chainId);
+ cx_hash((cx_hash_t*)&hash_ctx,
+ 0,
+ (uint8_t*)&chain_id,
+ sizeof(chain_id),
+ NULL,
+ 0);
+
// Contract address
cx_hash((cx_hash_t*)&hash_ctx,
0,
@@ -558,8 +569,19 @@ static bool verify_field_name_signature(uint8_t dname_length,
uint8_t hash[INT256_LENGTH];
cx_ecfp_public_key_t verifying_key;
cx_sha256_t hash_ctx;
+ uint64_t chain_id;
cx_sha256_init(&hash_ctx);
+
+ // Chain ID
+ chain_id = __builtin_bswap64(chainConfig->chainId);
+ cx_hash((cx_hash_t*)&hash_ctx,
+ 0,
+ (uint8_t*)&chain_id,
+ sizeof(chain_id),
+ NULL,
+ 0);
+
// Contract address
cx_hash((cx_hash_t*)&hash_ctx,
0,
|
task: destroy task buffer when it's not a dyntag buf | @@ -168,7 +168,7 @@ static struct flb_task *task_alloc(struct flb_config *config)
/* Allocate the new task */
task = (struct flb_task *) flb_calloc(1, sizeof(struct flb_task));
if (!task) {
- perror("malloc");
+ flb_errno();
return NULL;
}
@@ -182,7 +182,6 @@ static struct flb_task *task_alloc(struct flb_config *config)
flb_trace("[task %p] created (id=%i)", task, task_id);
-
/* Initialize minimum variables */
task->id = task_id;
task->mapped = FLB_FALSE;
@@ -239,7 +238,7 @@ struct flb_task *flb_task_create(uint64_t ref_id,
route = flb_malloc(sizeof(struct flb_task_route));
if (!route) {
- perror("malloc");
+ flb_errno();
continue;
}
@@ -262,7 +261,7 @@ struct flb_task *flb_task_create(uint64_t ref_id,
if (flb_router_match(tag, o_ins->match)) {
route = flb_malloc(sizeof(struct flb_task_route));
if (!route) {
- perror("malloc");
+ flb_errno();
continue;
}
@@ -289,6 +288,12 @@ struct flb_task *flb_task_create(uint64_t ref_id,
int i;
int worker_id;
+ /* If no buffering is set, return right away */
+ if (!config->buffer_ctx) {
+ flb_debug("[task] created task=%p id=%i OK", task, task->id);
+ return task;
+ }
+
/* Generate content SHA1 and it Hexa representation */
flb_sha1_encode(buf, size, task->hash_sha1);
for (i = 0; i < 20; ++i) {
@@ -381,11 +386,7 @@ void flb_task_destroy(struct flb_task *task)
struct flb_task_route *route;
struct flb_task_retry *retry;
- flb_debug("[task] destroy task=%p (task_id=%i)", task, task->id);
-
- if (task->dt) {
- flb_input_dyntag_destroy(task->dt);
- }
+ flb_warn("[task] destroy task=%p (task_id=%i)", task, task->id);
/* Release task_id */
map_free_task_id(task->id, task->config);
@@ -401,8 +402,15 @@ void flb_task_destroy(struct flb_task *task)
mk_list_del(&task->_head);
if (task->mapped == FLB_FALSE) {
+ if (task->dt && task->buf) {
+ if (task->buf != task->dt->mp_sbuf.data) {
+ flb_free(task->buf);
+ }
+ }
+ else {
flb_free(task->buf);
}
+ }
#ifdef FLB_HAVE_BUFFERING
else {
/* Likely there is a qchunk associated to this tasks */
@@ -413,6 +421,11 @@ void flb_task_destroy(struct flb_task *task)
}
#endif
+ if (task->dt) {
+ flb_input_dyntag_destroy(task->dt);
+ }
+
+
/* Remove 'retries' */
mk_list_foreach_safe(head, tmp, &task->retries) {
retry = mk_list_entry(head, struct flb_task_retry, _head);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.