message
stringlengths
6
474
diff
stringlengths
8
5.22k
Detail steps for fuzzing debug
@@ -12,19 +12,48 @@ Refer [Libfuzzer] official document if you want more detail. You can build and run code by yourself. [OSS-Fuzz] offers convenient scripts ```sh -$ cd $PATH_TO_OSS_FUZZ +cd $PATH_TO_OSS_FUZZ # build Docker image -$ python infra/helper.py build_image msquic +python infra/helper.py build_image msquic # build fuzzing code, memory sanitizer is not supported yet -$ python infra/helper.py build_fuzzers --sanitizer <address/memory/undefined> msquic +python infra/helper.py build_fuzzers --sanitizer <address/memory/undefined> msquic # run fuzzing -$ python infra/helper.py run_fuzzer msquic $YOUR_COOL_FUZZING +python infra/helper.py run_fuzzer msquic $YOUR_COOL_FUZZING ``` Refer [OSS-Fuzz official document] for more detail ## Reproduce and debug issue -[Reproduce] -[Debug] +### Prep +Download test case file from oss-fuzz issue ticket from [OSS-Fuzz issues] +Build base image for repro and debug +```sh +export TESTFILE=$YOUR_TEST_FILE +git clone --depth=1 https://github.com/google/oss-fuzz.git +cd oss-fuzz +python infra/helper.py pull_images +python infra/helper.py build_image msquic +python infra/helper.py build_fuzzers --sanitizer <address/memory/undefined> msquic +``` +### Reproduce issue +Reproduce issue with spinquic +```sh +cd oss-fuzz +python infra/helper.py reproduce msquic spinquic $TESTFILE +``` + +### Debug issue +```sh +cd oss-fuzz +cp $TESTFILE build/out/msquic/testcase +# Launch docker container +python3 infra/helper.py shell base-runner-debug +# Run gdb in the container +gdb --args /out/msquic/spinquic /out/msquic/testcase +``` + +Refer links for more details +- [Reproduce] +- [Debug] ## Monitor your fuzzing Once fuzzing is deployed on OSS-Fuzz infra, it continuously run and report issue if it detects @@ -44,6 +73,7 @@ You might need to change `Dockerfile` and/or `build.sh` for installing libraries [OSS-Fuzz]: https://github.com/google/oss-fuzz [OSS-Fuzz official document]: https://google.github.io/oss-fuzz [msquic project directory]: https://github.com/google/oss-fuzz/tree/master/projects/msquic +[OSS-Fuzz issues]: https://bugs.chromium.org/p/oss-fuzz/issues/list?q=msquic [LibFuzzer]: https://llvm.org/LibFuzzer [Reproduce]: https://google.github.io/oss-fuzz/advanced-topics/reproducing/ [Debug]: https://google.github.io/oss-fuzz/advanced-topics/debugging/
VERSION bump to version 0.12.15
@@ -32,7 +32,7 @@ set(CMAKE_C_FLAGS_DEBUG "-g -O0") # set version set(LIBNETCONF2_MAJOR_VERSION 0) set(LIBNETCONF2_MINOR_VERSION 12) -set(LIBNETCONF2_MICRO_VERSION 14) +set(LIBNETCONF2_MICRO_VERSION 15) set(LIBNETCONF2_VERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION}.${LIBNETCONF2_MICRO_VERSION}) set(LIBNETCONF2_SOVERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION})
Work around old esp-tools
#---------------------------------------------------------------------------------------- SIM_OPT_CXXFLAGS := -O3 +# Workaround: esp-isa-sim doesn't install libriscv, +# so don't link with libriscv if it doesn't exist +# potentially breaks some configs + +ifeq (,$(wildcard $RISCV/lib/libriscv.so)) +$(warning libriscv not found) +LRISCV="" +else +LRISCV="-lriscv" +endif + SIM_CXXFLAGS = \ $(CXXFLAGS) \ $(SIM_OPT_CXXFLAGS) \ @@ -18,7 +29,7 @@ SIM_LDFLAGS = \ -Wl,-rpath,$(RISCV)/lib \ -L$(sim_dir) \ -L$(dramsim_dir) \ - -lriscv \ + $(LRISCV) \ -lfesvr \ -ldramsim \ $(EXTRA_SIM_LDFLAGS)
linux/arch: missing prctl(PR_SET_PDEATHSIG, SIGKILL) - missing bracket
@@ -128,7 +128,7 @@ pid_t arch_fork(honggfuzz_t * hfuzz, fuzzer_t * fuzzer) if (prctl (PR_SET_PDEATHSIG, (unsigned long)SIGKILL, (unsigned long)0, (unsigned long)0, (unsigned long)0) == -1) { - PLOG_W("prctl(PR_SET_PDEATHSIG, SIGKILL"); + PLOG_W("prctl(PR_SET_PDEATHSIG, SIGKILL)"); } if (hfuzz->linux.cloneFlags & CLONE_NEWNET) { if (arch_ifaceUp("lo") == false) {
Retain a reference on the cn until the perf counter is updated
@@ -3303,11 +3303,13 @@ void cn_comp(struct cn_compaction_work *w) { u64 tstart; + struct cn *cn = w->cw_tree->cn; struct perfc_set *pc = w->cw_pc; tstart = perfc_lat_start(pc); cn_comp_compact(w); + cn_ref_get(cn); if (w->cw_rspill_conc) { struct cn_tree_node *node; @@ -3323,7 +3325,9 @@ cn_comp(struct cn_compaction_work *w) /* Non-root spill (only one at a time per node). */ cn_comp_finish(w); } + perfc_lat_record(pc, PERFC_LT_CNCOMP_TOTAL, tstart); + cn_ref_put(cn); } /**
readme DOC add docs link badge
[![BSD license](https://img.shields.io/badge/License-BSD-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Build](https://github.com/CESNET/libnetconf2/workflows/libnetconf2%20CI/badge.svg)](https://github.com/CESNET/libnetconf2/actions?query=workflow%3A%22libnetconf2+CI%22) +[![Docs](https://img.shields.io/badge/docs-link-blue)](https://netopeer.liberouter.org/doc/libnetconf2/) [![Coverity Scan Build Status](https://scan.coverity.com/projects/7642/badge.svg)](https://scan.coverity.com/projects/7642) **libnetconf2** is a NETCONF library in C intended for building NETCONF clients
schema compile BUGFIX dev node copy double free in extensions Fixes
@@ -1508,6 +1508,8 @@ lysc_refine_free(const struct ly_ctx *ctx, struct lysc_refine *rfn) void lysp_dev_node_free(const struct ly_ctx *ctx, struct lysp_node *dev_pnode) { + LY_ARRAY_COUNT_TYPE u; + if (!dev_pnode) { return; } @@ -1550,6 +1552,12 @@ lysp_dev_node_free(const struct ly_ctx *ctx, struct lysp_node *dev_pnode) return; } + /* extension parsed tree and children were not duplicated */ + LY_ARRAY_FOR(dev_pnode->exts, u) { + dev_pnode->exts[u].parsed = NULL; + dev_pnode->exts[u].child = NULL; + } + lysp_node_free((struct ly_ctx *)ctx, dev_pnode); }
drivers/task_manager : Add NULL checking after sched_gettcb sched_gettcb can return NULL when cannot find the tcb. In this case, we should not use the tcb in the below.
@@ -130,6 +130,10 @@ static int taskmgr_pthread_group_join(pid_t parent_pid, pid_t child_pid) parent_group = taskmgr_get_group_struct(parent_pid); child_tcb = (struct pthread_tcb_s *)sched_gettcb(child_pid); + if (child_tcb == NULL) { + tmdbg("[TM] Cannot find Child TCB.\n"); + return ERROR; + } ret = taskmgr_group_bind(parent_group, child_tcb); if (ret != OK) { tmdbg("[TM] Group bind is failed.\n");
fixed crash on export
@@ -1587,10 +1587,10 @@ typedef struct s32 cartSize; } EmbedHeader; -static const void* embedCart(Console* console, u8* data, s32* size) +static void* embedCart(Console* console, u8* app, s32* size) { tic_mem* tic = console->tic; - + u8* data = NULL; void* cart = malloc(sizeof(tic_cartridge)); if(cart) @@ -1615,16 +1615,16 @@ static const void* embedCart(Console* console, u8* data, s32* size) memcpy(header.sig, TicCartSig, SIG_SIZE); s32 finalSize = appSize + sizeof header + header.cartSize; - data = realloc(data, finalSize); + data = malloc(finalSize); if (data) { + memcpy(data, app, appSize); memcpy(data + appSize, &header, sizeof header); memcpy(data + appSize + sizeof header, zipData, header.cartSize); *size = finalSize; } - else data = NULL; } free(zipData); @@ -1687,12 +1687,12 @@ static void onNativeExportGet(const HttpGetData* data) free(exportData); s32 size = data->done.size; - void* buf = data->done.data; printLine(console); const char* path = fsGetFilePath(console->fs, filename); - if(embedCart(console, buf, &size) + void* buf = NULL; + if((buf = embedCart(console, data->done.data, &size)) && fsWriteFile(path, buf, size)) { chmod(path, 0755); @@ -1707,6 +1707,9 @@ static void onNativeExportGet(const HttpGetData* data) } commandDone(console); + + if (buf) + free(buf); } break; default:
data tree BUGFIX handle insert sibling matching params
@@ -2016,6 +2016,11 @@ lyd_insert_sibling(struct lyd_node *sibling, struct lyd_node *node, struct lyd_n LY_CHECK_RET(lyd_insert_check_schema(lysc_data_parent(sibling->schema), node->schema)); } + if (sibling == node) { + /* we need to keep the connection to siblings so we can insert into them */ + sibling = sibling->prev; + } + if (node->parent || node->prev->next) { lyd_unlink_tree(node); }
Added openSUSE instructions to readme PR
@@ -87,6 +87,32 @@ If you are using Solus, to install [MangoHud](https://dev.getsol.us/source/mango sudo eopkg it mangohud ``` +#### openSUSE + +If you run openSUSE Leap or Tumbleweed you can get Mangohud from the official repositories. +There are two packages, [mangohud](https://software.opensuse.org/package/mangohud) for 64bit and [mangohud-32bit](https://software.opensuse.org/package/mangohud-32bit) for 32bit application support. +To have Mangohud working for both 32bit and 64bit applications you need to install both packages even on a 64bit operating system. + +``` +sudo zypper in mangohud mangohud-32bit +``` + +Leap doesn't seem to have the 32bit package. + +Leap 15.2 + +``` +sudo zypper addrepo -f https://download.opensuse.org/repositories/games:tools/openSUSE_Leap_15.2/games:tools.repo +sudo zypper install mangohud +``` + +Leap 15.3 + +``` +sudo zypper addrepo -f https://download.opensuse.org/repositories/games:tools/openSUSE_Leap_15.3/games:tools.repo +sudo zypper install mangohud +``` + #### Flatpak If you are using Flatpaks, you will have to add the [Flathub repository](https://flatpak.org/setup/) for your specific distribution, and then, to install it, execute:
filters_sse2.c: quiet integer sanitizer warnings with clang7+ quiets conversion warnings like: implicit conversion from type 'int' of value -114 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 142 (8-bit, unsigned)
@@ -163,7 +163,8 @@ static void GradientPredictDirect_SSE2(const uint8_t* const row, _mm_storel_epi64((__m128i*)(out + i), H); } for (; i < length; ++i) { - out[i] = row[i] - GradientPredictor_SSE2(row[i - 1], top[i], top[i - 1]); + out[i] = (uint8_t)(row[i] - + GradientPredictor_SSE2(row[i - 1], top[i], top[i - 1])); } } @@ -188,7 +189,7 @@ static WEBP_INLINE void DoGradientFilter_SSE2(const uint8_t* in, // Filter line-by-line. while (row < last_row) { - out[0] = in[0] - in[-stride]; + out[0] = (uint8_t)(in[0] - in[-stride]); GradientPredictDirect_SSE2(in + 1, in + 1 - stride, out + 1, width - 1); ++row; in += stride; @@ -223,7 +224,7 @@ static void HorizontalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, uint8_t* out, int width) { int i; __m128i last; - out[0] = in[0] + (prev == NULL ? 0 : prev[0]); + out[0] = (uint8_t)(in[0] + (prev == NULL ? 0 : prev[0])); if (width <= 1) return; last = _mm_set_epi32(0, 0, 0, out[0]); for (i = 1; i + 8 <= width; i += 8) { @@ -238,7 +239,7 @@ static void HorizontalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, _mm_storel_epi64((__m128i*)(out + i), A7); last = _mm_srli_epi64(A7, 56); } - for (; i < width; ++i) out[i] = in[i] + out[i - 1]; + for (; i < width; ++i) out[i] = (uint8_t)(in[i] + out[i - 1]); } static void VerticalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, @@ -259,7 +260,7 @@ static void VerticalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, _mm_storeu_si128((__m128i*)&out[i + 0], C0); _mm_storeu_si128((__m128i*)&out[i + 16], C1); } - for (; i < width; ++i) out[i] = in[i] + prev[i]; + for (; i < width; ++i) out[i] = (uint8_t)(in[i] + prev[i]); } } @@ -306,7 +307,7 @@ static void GradientUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, if (prev == NULL) { HorizontalUnfilter_SSE2(NULL, in, out, width); } else { - out[0] = in[0] + prev[0]; // predict from above + out[0] = (uint8_t)(in[0] + prev[0]); // predict from above GradientPredictInverse_SSE2(in + 1, prev + 1, out + 1, width - 1); } }
(543) enable HTTP events in CLI Previously, the runtime config generated by the CLI had HTTP events disabled when connecting to Cribl/LogStream. That logic has been changed so HTTP is always enabled.
@@ -154,6 +154,12 @@ func (c *Config) setDefault() error { Field: ".*", Value: ".*", }, + { + WatchType: "http", + Name: ".*", + Field: ".*", + Value: ".*", + }, // { // WatchType: "metric", // Name: ".*", @@ -176,15 +182,6 @@ func (c *Config) setDefault() error { }, } - if c.CriblDest == "" { - c.sc.Event.Watch = append(c.sc.Event.Watch, ScopeWatchConfig{ - WatchType: "http", - Name: ".*", - Field: ".*", - Value: ".*", - }) - } - return nil }
apps/examples/nsh: Remove APPNAME, PRIORITY, and STACKSIZE settings from Makefile to avoid showing nsh in Builtin Apps.
############################################################################ # apps/examples/nsh/Makefile # -# Copyright (C) 2007-2008, 2010-2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2007-2008, 2010-2012, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -39,13 +39,6 @@ include $(APPDIR)/Make.defs # NuttShell (NSH) Example -CONFIG_EXAMPLES_NSH_PRIORITY ?= SCHED_PRIORITY_DEFAULT -CONFIG_EXAMPLES_NSH_STACKSIZE ?= 2048 - -APPNAME = nsh -PRIORITY = $(CONFIG_EXAMPLES_NSH_PRIORITY) -STACKSIZE = $(CONFIG_EXAMPLES_NSH_STACKSIZE) - ASRCS = CSRCS = MAINSRC = nsh_main.c
Improve `libscope.so` handling in `setupConfigure` do not overwrite the `/usr/lib/appscope/libscope.so` if already exists
@@ -526,12 +526,13 @@ closeFd: * Configure the environment * - setup /etc/profile.d/scope.sh * - extract memory to filter file /usr/lib/appscope/scope_filter - * - extract libscope.so to /usr/lib/appscope/libscope.so + * - extract libscope.so to /usr/lib/appscope/libscope.so if it doesn't exists * - patch the library * Returns status of operation 0 in case of success, other value otherwise */ int setupConfigure(void *filterFileMem, size_t filterSize) { + struct stat st = {0}; DIR *dirp; // Setup /etc/profile.d/scope.sh @@ -557,6 +558,11 @@ setupConfigure(void *filterFileMem, size_t filterSize) { return -1; } + // Do not overwrite the /usr/lib/appscope/libscope.so if it already exists + if (scope_stat(LIBSCOPE_LOC, &st) == 0) { + return 0; + } + // Extract libscope.so to /usr/lib/appscope/libscope.so if (libdirExtractLibraryTo(LIBSCOPE_LOC)) { scope_fprintf(scope_stderr, "extract libscope.so failed\n");
ci: Skip 'tests/internal/input_chunk.c' on Windows This unittest relies on chunkio's file storage, which Windows port does not support yet. Let's skip it for now.
@@ -19,6 +19,7 @@ cmake -G "NMake Makefiles" ` -D FLB_WITHOUT_flb-it-aws_credentials_profile=On ` -D FLB_WITHOUT_flb-it-aws_credentials_sts=On ` -D FLB_WITHOUT_flb-it-aws_util=On ` + -D FLB_WITHOUT_flb-it-input_chunk=On ` ../ # COMPILE
log: fix message for "info" logs in sim Messages logged at "info" level were printing as "WRN" which was misleading.
@@ -112,7 +112,7 @@ int sim_log_enabled(int level); #define BOOT_LOG_INF(_fmt, ...) \ do { \ if (sim_log_enabled(BOOT_LOG_LEVEL_INFO)) { \ - printf("[WRN] " _fmt "\n", ##__VA_ARGS__); \ + printf("[INF] " _fmt "\n", ##__VA_ARGS__); \ } \ } while (0) #else
HSL: Remove debug
@@ -111,16 +111,11 @@ static void read_table1(snap_membus_t *mem, table1_t t1[TABLE1_SIZE], { unsigned int i, j; - fprintf(stderr, "TABLE1 %d elements @ %p\n", t1_used, mem); - - /* extract data into target table1, or FIFO maybe? */ j = 0; for (i = 0; i < t1_used; i++) { /* copy the string ... */ copy_hashkey(mem[j], t1[i].name); t1[i].age = mem[j + 1](31, 0); - - fprintf(stderr, " %d name: %s age: %d\n", i, t1[i].name, t1[i].age); j += 2; } } @@ -130,12 +125,8 @@ static void read_table2(snap_membus_t *mem, table2_t t2[TABLE2_SIZE], { unsigned int i, j; - fprintf(stderr, "TABLE2 %d elements\n", t2_used); - - /* extract data into target table2, or FIFO maybe? */ j = 0; for (i = 0; i < t2_used; i++) { - printf(" reading table2 entry %d\n", i); copy_hashkey(mem[j], t2[i].name); copy_hashkey(mem[j + 1], t2[i].animal); j += 2;
conn: describe +fyrd interface to %khan
** ** request-id is a client-supplied atomic identifier that will ** be returned along with the response, to allow correlating -** responses with requests. it may be reused; e.g. 0 could be -** supplied every time for a client that doesn't care about -** responses. +** responses with requests. ** ** %fyrd is a request to run a thread. its arguments are -** described in the %khan vane, which handles these. it produces -** either %avow (on success) or %fail (on failure.) +** described in the ++khan section of sys/lull.hoon. to +** summarize: ** -** %peek is a namespace read request (aka scry). they are +** +$ task $%(... [%fyrd p=fyrd]) :: +** +$ fyrd [=bear name=term =mark data=(cask)] :: thread request +** +$ bear $@(desk [desk case]) :: partial +beak +** +** the passed mark is applied to the output. the cask (short for +** (cask *)) at data contains the input mark. e.g. to run -code +** with ~ as input, receiving output as a +tape, with request-id +** set to 32, send the +jam of this noun over the socket with +** newt framing: +** +** [32 %fyrd [%base %code %tape [%noun ~]]] +** +** responses to %fyrd are either %fail if something went wrong +** in the driver, or %avow to indicate success or failure from +** %khan. +avow is: (each (cask) goof). +** +** %peek is a namespace read request (aka scry), and will be ** forwarded directly to arvo. its arguments are the nom of the ** external peek interface in arvo, at arm 22. (lyc is always ** `~, i.e. request from self.) that is:
Fix pushIntegral Bound cannot happen in the pushed type, as it may be smaller than Lua.Integer.
@@ -66,7 +66,8 @@ pushIntegral :: (Integral a, Show a) => a -> Lua () pushIntegral i = let maxInt = fromIntegral (maxBound :: Lua.Integer) minInt = fromIntegral (minBound :: Lua.Integer) - in if i >= minInt && i <= maxInt + i' = fromIntegral i :: Prelude.Integer + in if i' >= minInt && i' <= maxInt then pushinteger $ fromIntegral i else pushString $ show i
test/motion_lid.c: Format with clang-format BRANCH=none TEST=none
@@ -48,8 +48,7 @@ static int accel_read(const struct motion_sensor_t *s, intv3_t v) return EC_SUCCESS; } -static int accel_set_range(struct motion_sensor_t *s, - const int range, +static int accel_set_range(struct motion_sensor_t *s, const int range, const int rnd) { s->current_range = range; @@ -63,8 +62,7 @@ static int accel_get_resolution(const struct motion_sensor_t *s) int test_data_rate[2] = { 0 }; -static int accel_set_data_rate(const struct motion_sensor_t *s, - const int rate, +static int accel_set_data_rate(const struct motion_sensor_t *s, const int rate, const int rnd) { test_data_rate[s - motion_sensors] = rate; @@ -148,11 +146,10 @@ static void wait_for_valid_sample(void) static int test_lid_angle(void) { - - struct motion_sensor_t *base = &motion_sensors[ - CONFIG_LID_ANGLE_SENSOR_BASE]; - struct motion_sensor_t *lid = &motion_sensors[ - CONFIG_LID_ANGLE_SENSOR_LID]; + struct motion_sensor_t *base = + &motion_sensors[CONFIG_LID_ANGLE_SENSOR_BASE]; + struct motion_sensor_t *lid = + &motion_sensors[CONFIG_LID_ANGLE_SENSOR_LID]; int lid_angle; /* We don't have TASK_CHIP so simulate init ourselves */ @@ -189,10 +186,9 @@ static int test_lid_angle(void) wait_for_valid_sample(); lid_angle = motion_lid_get_angle(); - cprints(CC_ACCEL, "LID(%d, %d, %d)/BASE(%d, %d, %d): %d", - lid->xyz[X], lid->xyz[Y], lid->xyz[Z], - base->xyz[X], base->xyz[Y], base->xyz[Z], - lid_angle); + cprints(CC_ACCEL, "LID(%d, %d, %d)/BASE(%d, %d, %d): %d", lid->xyz[X], + lid->xyz[Y], lid->xyz[Z], base->xyz[X], base->xyz[Y], + base->xyz[Z], lid_angle); TEST_ASSERT(lid_angle == 0); /* Set lid open to 90 degrees. */ @@ -319,7 +315,6 @@ static int test_lid_angle(void) return EC_SUCCESS; } - void run_test(int argc, char **argv) { test_reset();
time: add strict event time type checking
@@ -247,6 +247,14 @@ int flb_time_append_to_msgpack(struct flb_time *tm, msgpack_packer *pk, int fmt) return ret; } +static inline int is_eventtime(msgpack_object *obj) +{ + if (obj->via.ext.type != 0 || obj->via.ext.size != 8) { + return FLB_FALSE; + } + return FLB_TRUE; +} + int flb_time_msgpack_to_time(struct flb_time *time, msgpack_object *obj) { uint32_t tmp; @@ -261,6 +269,11 @@ int flb_time_msgpack_to_time(struct flb_time *time, msgpack_object *obj) time->tm.tv_nsec = ((obj->via.f64 - time->tm.tv_sec) * ONESEC_IN_NSEC); break; case MSGPACK_OBJECT_EXT: + if (is_eventtime(obj) != FLB_TRUE) { + flb_warn("[time] unknown ext type. type=%d size=%d", + obj->via.ext.type, obj->via.ext.size); + return -1; + } memcpy(&tmp, &obj->via.ext.ptr[0], 4); time->tm.tv_sec = (uint32_t) ntohl(tmp); memcpy(&tmp, &obj->via.ext.ptr[4], 4);
workflow: fix artifact path, git commit
@@ -18,6 +18,21 @@ jobs: run: | sudo apt update sudo apt install gcc-multilib g++-multilib ninja-build python3-setuptools python3-wheel mesa-common-dev libxnvctrl-dev libdbus-1-dev + - name: Prepare Artifact Git Info + shell: bash + run: | + echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}" + ARTIFACT_NAME="commit-$(git rev-parse --short "$GITHUB_SHA")" + if [ ${{ github.event_name == 'pull_request' }} ]; then + echo "##[set-output name=short-sha;]$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")" + if [ ! -z "${{ github.event.pull_request.number }}" ]; then + ARTIFACT_NAME="pr-${{ github.event.pull_request.number }}-commit-$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")" + fi + else + echo "##[set-output name=short-sha;]$(git rev-parse --short "$GITHUB_SHA")" + fi + echo "##[set-output name=artifact-metadata;]${ARTIFACT_NAME}" + id: git-vars - name: Build release package env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -40,6 +55,6 @@ jobs: uses: actions/upload-artifact@v2 continue-on-error: true with: - name: MangoHud-${{github.ref}}-${{github.sha}} - path: ${{runner.workspace}}/build/MangoHud-*tar.gz + name: MangoHud-${{steps.git-vars.outputs.artifact-metadata}} + path: ${{runner.workspace}}/MangoHud/build/MangoHud-*tar.gz retention-days: 30 \ No newline at end of file
Check that table is non-NULL in nbr_table_add_lladdr
@@ -354,6 +354,10 @@ nbr_table_add_lladdr(nbr_table_t *table, const linkaddr_t *lladdr, nbr_table_rea nbr_table_item_t *item; nbr_table_key_t *key; + if(table == NULL) { + return NULL; + } + /* Allow lladdr-free insertion, useful e.g. for IPv6 ND. * Only one such entry is possible at a time, indexed by linkaddr_null. */ if(lladdr == NULL) {
Default NDK path detection for Xamarin/Android builds
@@ -154,8 +154,7 @@ if args.androidsdkpath == 'auto' and args.target == 'android': if args.androidndkpath == 'auto' and args.target == 'android': args.androidndkpath = os.environ.get('ANDROID_NDK_HOME', None) if args.androidndkpath is None: - print "ANDROID_NDK_HOME variable not set" - exit(-1) + args.androidndkpath = os.path.join(args.androidsdkpath, 'ndk-bundle') args.defines += ';' + getProfiles()[args.profile].get('defines', '') args.defines += ';TARGET_XAMARIN' args.cmakeoptions += ';' + getProfiles()[args.profile].get('cmake-options', '')
[core] add decls in connections.h
#define _CONNECTIONS_H_ #include "first.h" -#include "base.h" +#include "base_decls.h" + +struct server_socket; /* declaration */ __attribute_cold__ void connections_free(server *srv); @@ -14,8 +16,8 @@ void connection_periodic_maint (server *srv, time_t cur_ts); int connection_send_1xx (request_st *r, connection *con); -connection * connection_accept(server *srv, server_socket *srv_sock); -connection * connection_accepted(server *srv, server_socket *srv_socket, sock_addr *cnt_addr, int cnt); +connection * connection_accept(server *srv, struct server_socket *srv_sock); +connection * connection_accepted(server *srv, struct server_socket *srv_socket, sock_addr *cnt_addr, int cnt); void connection_state_machine(connection *con);
[kernel] fix small typo
@@ -118,7 +118,7 @@ void D1MinusLinearOSI::initializeWorkVectorsForDS(double t, SP::DynamicalSystem // Check dynamical system type Type::Siconos dsType = Type::value(*ds); - assert(dsType == Type::LagrangianLinearTIDS || dsType == Type::LagrangianDS || Type::NewtonEulerDS); + assert(dsType == Type::LagrangianLinearTIDS || dsType == Type::LagrangianDS || dsType == Type::NewtonEulerDS); if(dsType == Type::LagrangianDS || dsType == Type::LagrangianLinearTIDS) {
[hsa] Copy buffers in case of CL_MEM_USE_HOST_PTR and HSA Base profile Also: Do not assume that FULL_PROFILE and EMBEDDED_PROFILE match HSA_PROFILE_FULL/BASE. Always advertise FULL_PROFILE with the HSA driver for now.
@@ -720,8 +720,7 @@ pocl_hsa_init (unsigned j, cl_device_id dev, const char *parameters) HSA_CHECK(hsa_agent_get_info(d->agent, HSA_AGENT_INFO_PROFILE, &d->agent_profile)); - dev->profile = ((d->agent_profile == HSA_PROFILE_FULL) ? "FULL_PROFILE" - : "EMBEDDED_PROFILE"); + dev->profile = "FULL_PROFILE"; uint64_t hsa_freq; HSA_CHECK(hsa_system_get_info(HSA_SYSTEM_INFO_TIMESTAMP_FREQUENCY, @@ -786,12 +785,22 @@ pocl_hsa_malloc (cl_device_id device, cl_mem_flags flags, size_t size, if (flags & CL_MEM_USE_HOST_PTR) { - POCL_MSG_PRINT_INFO("HSA: hsa_memory_register (CL_MEM_USE_HOST_PTR)\n"); assert(host_ptr != NULL); - // TODO bookkeeping of mem registrations + if (d->agent_profile == HSA_PROFILE_FULL) + { + POCL_MSG_PRINT_INFO + ("HSA: CL_MEM_USE_HOST_PTR FULL profile: hsa_memory_register()\n"); + /* TODO bookkeeping of mem registrations. */ hsa_memory_register(host_ptr, size); return host_ptr; } + else + { + POCL_MSG_PRINT_INFO + ("HSA: CL_MEM_USE_HOST_PTR BASE profile: cached device copy\n"); + return pocl_hsa_malloc_account(mem, size, d->global_region); + } + } if (flags & CL_MEM_COPY_HOST_PTR) { @@ -956,12 +965,23 @@ setup_kernel_args (pocl_hsa_device_data_t *d, else { cl_mem m = *(cl_mem *)al->value; - uint64_t temp = 0; + uint64_t dev_ptr = 0; if (m->device_ptrs) - temp = (uint64_t)m->device_ptrs[cmd->device->dev_id].mem_ptr; + { + dev_ptr = (uint64_t)m->device_ptrs[cmd->device->dev_id].mem_ptr; + if (m->flags & CL_MEM_USE_HOST_PTR && + d->agent_profile == HSA_PROFILE_BASE) + { + POCL_MSG_PRINT_INFO + ("HSA: Copy HOST_PTR allocated %lu byte buffer " + "from %p to %p due to having a BASE profile agent.\n", + m->size, m->mem_host_ptr, dev_ptr); + hsa_memory_copy((void*)dev_ptr, m->mem_host_ptr, m->size); + } + } else - temp = (uint64_t)m->mem_host_ptr; - memcpy (write_pos, &temp, sizeof(uint64_t)); + dev_ptr = (uint64_t)m->mem_host_ptr; + memcpy (write_pos, &dev_ptr, sizeof(uint64_t)); } write_pos += sizeof(uint64_t); }
Fancy grep regex
@@ -64,8 +64,7 @@ SUT_PATH=(`find "$BUILD_HOME" -name "bin" -type d`) # hack to determine latest tag from GitHub LATEST_URL="https://github.com/OpenWaterAnalytics/epanet-example-networks/releases/latest" -temp_url="$(curl -sI "${LATEST_URL}" | grep -iE "^Location:")" -LATEST_TAG="${temp_url##*/}" +LATEST_TAG="$(curl -sI "${LATEST_URL}" | grep -Po 'tag\/\K(v\S+)')" TEST_URL="https://codeload.github.com/OpenWaterAnalytics/epanet-example-networks/tar.gz/${LATEST_TAG}" BENCH_URL="https://github.com/OpenWaterAnalytics/epanet-example-networks/releases/download/${LATEST_TAG}/benchmark-${PLATFORM}-${REF_BUILD_ID}.tar.gz"
Fix scrolling issues with the definitions finder
@@ -916,13 +916,17 @@ fileprivate func parseArgs(_ args: inout [String]) { lines.append(range) } - if lines.indices.contains(def.line-1) { + if lines.indices.contains(def.line-1), textView.contentSize.height > textView.frame.height { let substringRange = lines[def.line-1] let glyphRange = textView.layoutManager.glyphRange(forCharacterRange: substringRange, actualCharacterRange: nil) let rect = textView.layoutManager.boundingRect(forGlyphRange: glyphRange, in: textView.textContainer) let topTextInset = textView.textContainerInset.top let contentOffset = CGPoint(x: 0, y: topTextInset + rect.origin.y) + if textView.contentSize.height-contentOffset.y > textView.frame.height { textView.setContentOffset(contentOffset, animated: true) + } else { + textView.scrollToBottom() + } } } }) {
Don't abort when we can't open a file.
@@ -47,8 +47,10 @@ mergeuse(char *path) st = file->file.globls; f = fopen(path, "r"); - if (!f) - die("Couldn't open %s\n", path); + if (!f) { + fprintf(stderr, "couldn't open %s\n", path); + exit(1); + } loaduse(path, f, st, Visexport); fclose(f); }
makefile: install the demo scripts The demos scripts are not installed when "make install" is invoked. This patch adds a rule to copy them to /usr/share/acrn
@@ -80,6 +80,8 @@ DISTCLEAN_OBJS := $(shell find $(BASEDIR) -name '*.o') PROGRAM := acrn-dm +SAMPLES := $(wildcard samples/*) + all: include/version.h $(PROGRAM) @echo -n "" @@ -117,5 +119,9 @@ $(DM_OBJDIR)/%.o: %.c $(HEADERS) [ ! -e $@ ] && mkdir -p $(dir $@); \ $(CC) $(CFLAGS) -c $< -o $@ -install: $(DM_OBJDIR)/$(PROGRAM) +install: $(DM_OBJDIR)/$(PROGRAM) install-samples install -D $(DM_OBJDIR)/$(PROGRAM) $(DESTDIR)/usr/bin/$(PROGRAM) + +install-samples: $(SAMPLES) + install -d $(DESTDIR)/usr/share/acrn/demo + install -t $(DESTDIR)/usr/share/acrn/demo $^
Unexpectedly dropped package => error reporting fixed
@@ -507,7 +507,7 @@ void t4p4s_after_launch(int idx) { int t4p4s_normal_exit() { t4p4s_print_stats(); - if (encountered_error) { + if (encountered_error || packet_with_error_counter>0) { debug(T4LIT(Normal exit,success) " but " T4LIT(errors in processing packets,error) "\n"); return 3; }
fix MI_ prefix for libraries
@@ -210,13 +210,13 @@ endif() if(WIN32) list(APPEND mi_libraries psapi shell32 user32 advapi32 bcrypt) else() - find_library(LIBPTHREAD pthread) - if (LIBPTHREAD) - list(APPEND mi_libraries ${LIBPTHREAD}) + find_library(MI_LIBPTHREAD pthread) + if (MI_LIBPTHREAD) + list(APPEND mi_libraries ${MI_LIBPTHREAD}) endif() - find_library(LIBRT rt) - if(LIBRT) - list(APPEND mi_libraries ${LIBRT}) + find_library(MI_LIBRT rt) + if(MI_LIBRT) + list(APPEND mi_libraries ${MI_LIBRT}) endif() endif() @@ -228,9 +228,11 @@ endif() # Install and output names # ----------------------------------------------------------------------------- -set(mi_install_libdir "${CMAKE_INSTALL_LIBDIR}") # for dynamic/shared library and symlinks +# dynamic/shared library and symlinks always go to /usr/local/lib equivalent +set(mi_install_libdir "${CMAKE_INSTALL_LIBDIR}") -# install at top level or use versioned directories for side-by-side installation? +# static libraries and object files, includes, and cmake config files +# are either installed at top level, or use versioned directories for side-by-side installation (default) if (MI_INSTALL_TOPLEVEL) set(mi_install_objdir "${CMAKE_INSTALL_LIBDIR}") set(mi_install_incdir "${CMAKE_INSTALL_INCLUDEDIR}")
ifdef for inet6 in log_addr definition.
* just like its done in Unbound via the same log_addr(VERB_LEVEL, const char*, sockaddr_storage*) */ static void -log_addr(const char* descr, struct sockaddr_storage* addr, short family) +log_addr(const char* descr, +#ifdef INET6 + struct sockaddr_storage* addr, +#else + struct sockaddr_in* addr, +#endif + short family) { char str_buf[64]; if(family == AF_INET) {
remove fprintf warnings for invalid mfl and no enable mfl
@@ -450,14 +450,12 @@ static int s2n_recv_client_sct_list(struct s2n_connection *conn, struct s2n_stuf static int s2n_recv_client_max_frag_len(struct s2n_connection *conn, struct s2n_stuffer *extension) { if (!conn->config->enable_server_mfl) { - fprintf(stderr, "warning: Maximum Fragmentation Length not enabled in S2N server, continuing with default max\n"); return 0; } uint8_t mfl_code; GUARD(s2n_stuffer_read_uint8(extension, &mfl_code)); if (mfl_code > S2N_TLS_MAX_FRAG_LEN_4096 || mfl_code_to_length[mfl_code] > S2N_TLS_MAXIMUM_FRAGMENT_LENGTH) { - fprintf(stderr, "warning: Invalid Maximum Fragmentation Length requested, continuing TLS handshake with default length\n"); return 0; }
os/fs/driver/mtd: Fix svace errors Fix - improper type casting between integer type variables Fix - possibly unreachable code Fix - result of mathematical operation subject to overflow
@@ -941,9 +941,9 @@ static ssize_t smart_write(FAR struct inode *inode, FAR const unsigned char *buf /* Convert SMART blocks into MTD blocks. */ - mtdstartblock = start_sector * dev->mtdBlksPerSector; - mtdblockcount = nsectors * dev->mtdBlksPerSector; - mtdBlksPerErase = dev->mtdBlksPerSector * dev->sectorsPerBlk; + mtdstartblock = (off_t)start_sector * (off_t)dev->mtdBlksPerSector; + mtdblockcount = (off_t)nsectors * (off_t)dev->mtdBlksPerSector; + mtdBlksPerErase = (off_t)dev->mtdBlksPerSector * (off_t)dev->sectorsPerBlk; fvdbg("mtdsector: %d mtdnsectors: %d\n", mtdstartblock, mtdblockcount); @@ -1819,7 +1819,7 @@ static int smart_set_wear_level(FAR struct smart_struct_s *dev, uint16_t block, static int smart_scan(FAR struct smart_struct_s *dev) { int sector; - int ret; + int ret = OK; uint16_t totalsectors; uint16_t prerelease; uint16_t logicalsector; @@ -5019,7 +5019,7 @@ static int smart_journal_release_sector(FAR struct smart_struct_s *dev, uint16_t struct smart_sect_header_s header; size_t offset; - offset = psector * dev->sectorsize; + offset = (off_t)psector * (off_t)dev->sectorsize; ret = MTD_READ(dev->mtd, offset, sizeof(struct smart_sect_header_s), (FAR uint8_t *)&header); if (ret != sizeof(struct smart_sect_header_s)) { fdbg("Read header failed psector : %d offset : %d\n", psector, offset); @@ -5159,7 +5159,7 @@ static int smart_journal_process_transaction(FAR struct smart_struct_s *dev, jou case SMART_JOURNAL_TYPE_COMMIT: { /* Write given data in rwbuffer from users, except mtd header */ - ret = MTD_WRITE(dev->mtd, psector * dev->sectorsize + mtd_size, dev->sectorsize - mtd_size, (FAR uint8_t *)&dev->rwbuffer[mtd_size]); + ret = MTD_WRITE(dev->mtd, ((off_t)psector * dev->sectorsize) + (off_t)mtd_size, dev->sectorsize - mtd_size, (FAR uint8_t *)&dev->rwbuffer[mtd_size]); if (ret != dev->sectorsize - mtd_size) { fdbg("write data failed ret : %d\n", ret); return -EIO;
hslua-core: make "LuaE e" an instance of class MonadFail
@@ -48,6 +48,9 @@ import qualified HsLua.Core.Utf8 as Utf8 #if !MIN_VERSION_base(4,12,0) import Data.Semigroup (Semigroup ((<>))) #endif +#if !MIN_VERSION_base(4,13,0) +import Control.Monad.Fail (MonadFail (..)) +#endif -- | A Lua operation. -- @@ -122,10 +125,21 @@ throwTypeMismatchError expected idx = do pushTypeMismatchError expected idx throwErrorAsException +-- +-- Orphan instances +-- + instance LuaError e => Alternative (LuaE e) where empty = failLua "empty" x <|> y = x `Catch.catch` (\(_ :: e) -> y) +instance LuaError e => MonadFail (LuaE e) where + fail = failLua + +-- +-- Helpers +-- + -- | Takes a failable HsLua function and transforms it into a -- monadic 'Lua' operation. Throws an exception if an error -- occured.
sdl: Update TODO.md for SDL2 2.0.8
+## 2.0.8 + +### Hints + +[ ] SDL_HINT_IOS_HIDE_HOME_INDICATOR +[ ] SDL_HINT_RETURN_KEY_HIDES_IME +[ ] SDL_HINT_TV_REMOTE_AS_JOYSTICK +[ ] SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR +[ ] SDL_HINT_VIDEO_DOUBLE_BUFFER + +### Surface + +[ ] SDL_SetYUVConversionMode() +[ ] SDL_GetYUVConversionMode() + +### Android + +[ ] SDL_IsAndroidTV() + +### Mac OS X / iOS / tvOS + +[x] SDL_RenderGetMetalLayer() +[x] SDL_RenderGetMetalCommandEncoder() + +### Windows UWP + +[ ] SDL_WinRTGetDeviceFamily() + ## 2.0.7 ### General
[cmake] rc in version does not work
# --- set siconos current version --- set(MAJOR_VERSION 4) set(MINOR_VERSION 4) -set(PATCH_VERSION 0.rc) +set(PATCH_VERSION 0) set(SICONOS_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") ### SOVERSION
Fix ShaderFlag parsing;
@@ -1376,9 +1376,9 @@ static void luax_parseshaderflags(lua_State* L, int index, ShaderFlag flags[MAX_ lovrAssert(lua_istable(L, -1), "Shader flags must be a table"); lua_pushnil(L); while (lua_next(L, -2) != 0) { - ShaderFlag* flag = &flags[++*count]; + ShaderFlag* flag = &flags[(*count)++]; - lovrAssert(*count < MAX_SHADER_FLAGS, "Too many shader flags (max is %d)", MAX_SHADER_FLAGS); + lovrAssert(*count <= MAX_SHADER_FLAGS, "Too many shader flags (max is %d)", MAX_SHADER_FLAGS); if (lua_type(L, -2) == LUA_TSTRING) { flag->name = lua_tostring(L, -2);
decoding net: make the fail case more visible
@@ -155,7 +155,9 @@ run_test(Test) :- call(Test), writeln(" Succeeds!") ) ; ( - writeln(" !!! Fails !!!") + writeln("#################################################"), + writeln(" !!! Fails !!!"), + writeln("#################################################") ). :- export run_all_tests/0.
Underscore as shift+rctrl.
@@ -93,8 +93,8 @@ static const LRKCNV lrcnv101[] = /* @ and : keys for western qwerty kb */ {RETROK_BACKQUOTE, 0x1a}, {RETROK_QUOTE, 0x27}, - /* _ as shift+F11 for western qwerty kb */ - {RETROK_F11, 0x33}, + /* _ as shift+rctrl for western qwerty kb */ + {RETROK_RCTRL, 0x33}, /* MacOS Yen */ //{0xa5, 0x0d}
Cleanup launch.json Vscode correct the path to library - currently path points to shell wrapper which results failing in the debug process distinguish targets for x86_64 and aarch64
"version": "0.2.0", "configurations": [ { - "name": "(gdb) curl w/preload", + "name": "(gdb) curl x86_64 w/preload", "type": "cppdbg", "request": "launch", "program": "/usr/bin/curl", //"args": ["http://nghttp2.org/robots.txt"], "args": ["-s", "-o", "/dev/null", "--http1.1", "https://www.google.com/"], //"args": ["-s", "-o", "/dev/null", "http://www.google.com/"], - //"args": ["-s", "-o", "/dev/null", "https://www.google.com/"], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [ - { "name":"LD_PRELOAD", "value":"lib/linux/libscope.so"} + { "name":"LD_PRELOAD", "value":"lib/linux/x86_64/libscope.so"} ], "externalConsole": false, "MIMode": "gdb", ] }, { - "name": "(gdb) ldscope curl", + "name": "(gdb) curl aarch64 w/preload", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/bin/linux/ldscope", + "program": "/usr/bin/curl", + "args": ["-s", "-o", "/dev/null", "--http1.1", "https://www.google.com/"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [ + { "name":"LD_PRELOAD", "value":"lib/linux/aarch64/libscope.so"} + ], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { "text": "-gdb-set follow-fork-mode child"}, + { "text": "-gdb-set detach-on-fork on"} + ] + }, + { + "name": "(gdb) ldscope curl x86_64", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/bin/linux/x86_64/ldscope", + "args": ["curl", "--http2-prior-knowledge", "nghttp2.org/robots.txt"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [ ], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { "text": "-gdb-set follow-fork-mode child"}, + { "text": "-gdb-set detach-on-fork on"} + ] + }, + { + "name": "(gdb) ldscope curl aarch64", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/bin/linux/aarch64/ldscope", "args": ["curl", "--http2-prior-knowledge", "nghttp2.org/robots.txt"], - //"args": ["curl", "nghttp2.org/robots.txt"], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [ ],
Fixed attribute name in documentation.
@@ -1292,7 +1292,7 @@ CUPS-Get-PPDs Response: <dt>"document-number" (integer(1:MAX)): - <dd>The client MUST supply a document number to retrieve. The <tt>document-count</tt> attribute for the job defines the maximum document number that can be specified. In the case of jobs with banners (<tt>job-sheets</tt> is not "none"), document number 1 will typically contain the start banner and document number N will typically contain the end banner. + <dd>The client MUST supply a document number to retrieve. The <tt>number-of-documents</tt> attribute for the job defines the maximum document number that can be specified. In the case of jobs with banners (<tt>job-sheets</tt> is not "none"), document number 1 will typically contain the start banner and document number N will typically contain the end banner. </dl>
AppVeyor: Enable Python only for MSVC 64 bit.
@@ -63,7 +63,11 @@ $CMAKE_FLAGS = "$CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Release" $CMAKE_FLAGS = "$CMAKE_FLAGS -DTINYSPLINE_ENABLE_CSHARP=True" $CMAKE_FLAGS = "$CMAKE_FLAGS -DTINYSPLINE_ENABLE_D=True" $CMAKE_FLAGS = "$CMAKE_FLAGS -DTINYSPLINE_ENABLE_JAVA=True" +if ($Env:COMPILER -eq "msvc") { + if ($Env:PLATFORM -eq "Win64") { $CMAKE_FLAGS = "$CMAKE_FLAGS -DTINYSPLINE_ENABLE_PYTHON=True" + } +}
[core] add label for 308 Permanent Redirect x-ref:
@@ -77,6 +77,7 @@ static keyvalue http_status[] = { { 305, "Use Proxy" }, { 306, "(Unused)" }, { 307, "Temporary Redirect" }, + { 308, "Permanent Redirect" }, { 400, "Bad Request" }, { 401, "Unauthorized" }, { 402, "Payment Required" },
[bus][pci] load bars for devices even if their address is 0 Probe the size first, and if that turns up anything, mark the bar as valid, even if the address is set to 0. The address can be configured in a later pass of the bus manager. Also print the bars on boot.
@@ -289,6 +289,14 @@ void device::dump(size_t indent) { } char str[14]; printf("dev %s %04hx:%04hx\n", pci_loc_string(loc_, str), config_.vendor_id, config_.device_id); + for (size_t b = 0; b < countof(bars_); b++) { + if (bars_[b].valid) { + for (size_t i = 0; i < indent + 1; i++) { + printf(" "); + } + printf("BAR %zu: addr %#llx size %#zx io %d valid %d\n", b, bars_[b].addr, bars_[b].size, bars_[b].io, bars_[b].valid); + } + } } // walk the device's capability list, reading them in and creating sub objects per @@ -473,7 +481,6 @@ status_t device::load_bars() { // io address bars_[i].io = true; bars_[i].addr = bar_addr & ~0x3; - bars_[i].valid = (bars_[i].addr != 0); // probe size by writing all 1s and seeing what bits are masked uint32_t size = 0; @@ -483,11 +490,12 @@ status_t device::load_bars() { // mask out bottom bits, invert and add 1 to compute size bars_[i].size = ((size & ~0b11) ^ 0xffff) + 1; + + bars_[i].valid = (bars_[i].size != 0); } else if ((bar_addr & 0b110) == 0) { // 32bit memory address bars_[i].io = false; bars_[i].addr = bar_addr & ~0xf; - bars_[i].valid = (bars_[i].addr != 0); // probe size by writing all 1s and seeing what bits are masked uint32_t size = 0; @@ -497,6 +505,8 @@ status_t device::load_bars() { // mask out bottom bits, invert and add 1 to compute size bars_[i].size = (~(size & ~0b1111)) + 1; + + bars_[i].valid = (bars_[i].size != 0); } else if ((bar_addr & 0b110) == 2) { // 64bit memory address if (i % 2) { @@ -506,7 +516,6 @@ status_t device::load_bars() { bars_[i].io = false; bars_[i].addr = bar_addr & ~0xf; bars_[i].addr |= (uint64_t)config_.type0.base_addresses[i + 1] << 32; - bars_[i].valid = true; // probe size by writing all 1s and seeing what bits are masked uint64_t size; @@ -523,6 +532,8 @@ status_t device::load_bars() { // mask out bottom bits, invert and add 1 to compute size bars_[i].size = (~(size & ~(uint64_t)0b1111)) + 1; + bars_[i].valid = (bars_[i].size != 0); + // mark the next entry as invalid i++; bars_[i].valid = false;
net/lwip: Add initialization of union variable in tcp Initialize global union variable used in tcp of lwip
@@ -131,9 +131,8 @@ static const u8_t tcp_persist_backoff[7] = { 3, 6, 12, 24, 48, 96, 120 }; /** List of all TCP PCBs bound but not yet (connected || listening) */ struct tcp_pcb *tcp_bound_pcbs = NULL; /** List of all TCP PCBs in LISTEN state */ -union tcp_listen_pcbs_t tcp_listen_pcbs; -/** List of all TCP PCBs that are in a state in which - * they accept or send data. */ +union tcp_listen_pcbs_t tcp_listen_pcbs = {NULL}; +/** List of all TCP PCBs that are in a state in which they accept or send data. */ struct tcp_pcb *tcp_active_pcbs = NULL; /** List of all TCP PCBs in TIME-WAIT state */ struct tcp_pcb *tcp_tw_pcbs = NULL;
Document MBEDTLS_ALLOW_PRIVATE_ACCESS inside test/helpers.h.
#ifndef TEST_HELPERS_H #define TEST_HELPERS_H +/* Most fields of publicly available structs are private and are wrapped with + * MBEDTLS_PRIVATE macro. This define allows tests to access the private fields + * directly (without using the MBEDTLS_PRIVATE wrapper). */ #define MBEDTLS_ALLOW_PRIVATE_ACCESS #if !defined(MBEDTLS_CONFIG_FILE)
Modify typing error in procfs
@@ -135,7 +135,7 @@ static const struct procfs_entry_s g_procfsentries[] = { {"mtd", &mtd_procfsoperations}, #endif -#if defined(CONFIG_MTD_PARTITION) && !defined(CONFIG_FS_PROCFS_EXCLUDE_PARTITON) +#if defined(CONFIG_MTD_PARTITION) && !defined(CONFIG_FS_PROCFS_EXCLUDE_PARTITIONS) {"partitions", &part_procfsoperations}, #endif
Add note about new standards
oidc-agent (4.2.5-1) unstable; urgency=medium * Initial package for Debian. (Closes: #980462) + * Upgrade to standards version 4.6.0.1 (no changes needed) -- Marcus Hardt <marcus@hardt-it.de> Tue, 28 Dec 2021 12:51:36 +0200
shm main MAITENANCE added dep rebuilding explanation
@@ -2475,6 +2475,13 @@ sr_shmmain_shm_add(sr_conn_ctx_t *conn, struct lyd_node *sr_mod) return err_info; } + /* + * Dependencies of old modules are rebuild because of possible + * 1) new inverse dependencies when new modules depend on the old ones; + * 2) new dependencies in the old modules in case they were added by foreign augments in the new modules. + * Checking these cases would probably be more costly than just always rebuilding all dependnecies. + */ + /* remove all dependencies of all modules from SHM */ sr_shmmain_shm_del_modules_deps(&conn->main_shm, conn->ext_shm.addr, (sr_mod_t *)(conn->main_shm.addr + sizeof(sr_main_shm_t)));
mangoapp: set static height to include benchmark
@@ -155,10 +155,7 @@ int main(int, char**) // Rendering ImGui::Render(); static int display_w, display_h; - if((Clock::now() - logger->last_log_end()) < 12s) - glfwSetWindowSize(window, window_size.x + 145.f, window_size.y + 325.f); - else - glfwSetWindowSize(window, window_size.x + 45.f, window_size.y + 10.f); + glfwSetWindowSize(window, window_size.x + 45.f, window_size.y + 325.f); glfwGetFramebufferSize(window, &display_w, &display_h); glEnable(GL_DEPTH_TEST); glEnable(GL_BLEND);
fix: add ck_assert in 'test_007Transfer_0002TransferFailureNullParam'
@@ -128,7 +128,8 @@ START_TEST(test_007Transfer_0002TransferFailureNullParam) BoatIotSdkInit(); - ethereumWalletPrepare(); + result = ethereumWalletPrepare(); + ck_assert(rtnVal == BOAT_SUCCESS); result = BoatEthTxInit(g_ethereum_wallet_ptr, &tx_ctx, BOAT_TRUE, NULL, "0x333333",
perf-tools/tau: explicit compilers in serial build
@@ -132,6 +132,8 @@ export CONFIG_ARCH=%{machine} -arch=%{machine} \ -prefix=/tmp%{install_path} \ -exec-prefix= \ + -c++=$CXX \ + -cc=$CC \ -fortran=$fcomp \ -iowrapper \ -slog2 \
Fix SharedIconCacheHashtableEqual
@@ -635,7 +635,7 @@ static BOOLEAN SharedIconCacheHashtableEqualFunction( if (IS_INTRESOURCE(entry1->Name)) { if (IS_INTRESOURCE(entry2->Name)) - return entry1->Name == entry2->Name; + return PtrToUlong(entry1->Name) == PtrToUlong(entry2->Name); else return FALSE; }
Document that BIO_gets() preserves '\n'.
@@ -34,7 +34,8 @@ in B<buf>. Usually this operation will attempt to read a line of data from the BIO of maximum length B<size-1>. There are exceptions to this, however; for example, BIO_gets() on a digest BIO will calculate and return the digest and other BIOs may not support BIO_gets() at all. -The returned string is always NUL-terminated. +The returned string is always NUL-terminated and the '\n' is preserved +if present in the input data. BIO_write() attempts to write B<len> bytes from B<buf> to BIO B<b>.
extmod/modiodevices: enable power for known device In the long run, power requirements can be read from the sensor. Until then, we do this manually to ensure we only activate power on sensors that are known to support it.
@@ -41,6 +41,16 @@ STATIC mp_obj_t iodevices_LUMPDevice_make_new(const mp_obj_type_t *type, size_t self->pbdev = pbdevice_get_device(port_num, PBIO_IODEV_TYPE_ID_LUMP_UART); + // FIXME: Read sensor capability flag to see which sensor uses power. As + // a precaution, only enable power for selected known sensors for now. + pbio_port_t _port; + pbio_iodev_type_id_t id; + uint8_t curr_mode; + uint8_t num_values; + pbdevice_get_info(self->pbdev, &_port, &id, &curr_mode, &num_values); + bool power = (id == PBIO_IODEV_TYPE_ID_SPIKE_COLOR_SENSOR || id == PBIO_IODEV_TYPE_ID_SPIKE_ULTRASONIC_SENSOR); + pbdevice_set_power_supply(self->pbdev, power); + return MP_OBJ_FROM_PTR(self); }
CI: travis: update rules
@@ -11,9 +11,8 @@ compiler: notifications: irc: "irc.freenode.net#monkey" -# Disable SSL as the test box have a old PolarSSL version (Ubuntu 12.04) -# before_install: -# - sudo apt-get update -qq -# - sudo apt-get install -y libpolarssl-dev +before_script: + - cd build + - cmake ../ -script: ./configure --trace && make +script: make
doc: small readability improvment
@@ -196,7 +196,7 @@ you up-to-date with the multi-language support provided by Elektra. ## Documentation -- <<TODO>> +- Small readability improvement _(@Toniboyyy)_ - <<TODO>> - <<TODO>> - <<TODO>>
Fix style in sway-bar(5) manpage
@@ -50,17 +50,17 @@ Commands **wrap_scroll** <yes|no>:: Enables or disables wrapping when scrolling through workspaces with the - scroll wheel. Default is no. + scroll wheel. Default is _no_. **workspace_buttons** <yes|no>:: - Enables or disables workspace buttons on the bar. Default is yes. + Enables or disables workspace buttons on the bar. Default is _yes_. **strip_workspace_numbers** <yes|no>:: If set to _yes_, then workspace numbers will be omitted from the workspace - button and only the custom name will be shown. + button and only the custom name will be shown. Default is _no_. **binding_mode_indicator** <yes|no>:: - Enable or disable binding mode indicator. It's enabled by default. + Enable or disable binding mode indicator. Default is _yes_. **height** <height>:: Sets the height of the bar. Default height will match the font size.
don't error on <hr> continuation
?. ?- p.cur :: :: can't(/directly) contain text - ?($rule $lord $list) ~|(bad-leaf-container+p.cur !!) + ?($lord $list) ~|(bad-leaf-container+p.cur !!) :: - :: only one line in a header - $head | + :: only one line in a header/break + ?($head $rule) | :: :: literals need to end with a blank line ?($code $poem $expr) (gte col.pic col)
rand/rand_unix.c: omit error from DSO_global_lookup. If built with no-dso, DSO_global_lookup leaves "unsupported" message in error queue. Since there is a fall-back code, it's unnecessary distraction.
@@ -247,7 +247,9 @@ int syscall_random(void *buf, size_t buflen) * - Linux since 3.17 with glibc 2.25 * - FreeBSD since 12.0 (1200061) */ + ERR_set_mark(); p_getentropy.p = DSO_global_lookup("getentropy"); + ERR_pop_to_mark(); if (p_getentropy.p != NULL) return p_getentropy.f(buf, buflen) == 0 ? buflen : 0;
Fixed clock initialisation for mcu's where one port is missing.
@@ -187,69 +187,69 @@ hal_gpio_clk_enable(uint32_t port_idx) __HAL_RCC_GPIOB_CLK_ENABLE(); } break; +#endif #if HAL_GPIO_PORT_COUNT > 2 case 2: if (!__HAL_RCC_GPIOC_IS_CLK_ENABLED()) { __HAL_RCC_GPIOC_CLK_ENABLE(); } break; +#endif #if HAL_GPIO_PORT_COUNT > 3 case 3: if (!__HAL_RCC_GPIOD_IS_CLK_ENABLED()) { __HAL_RCC_GPIOD_CLK_ENABLE(); } break; +#endif #if HAL_GPIO_PORT_COUNT > 4 && defined GPIOE_BASE case 4: if (!__HAL_RCC_GPIOE_IS_CLK_ENABLED()) { __HAL_RCC_GPIOE_CLK_ENABLE(); } break; +#endif #if HAL_GPIO_PORT_COUNT > 5 case 5: if (!__HAL_RCC_GPIOF_IS_CLK_ENABLED()) { __HAL_RCC_GPIOF_CLK_ENABLE(); } break; +#endif #if HAL_GPIO_PORT_COUNT > 6 case 6: if (!__HAL_RCC_GPIOG_IS_CLK_ENABLED()) { __HAL_RCC_GPIOG_CLK_ENABLE(); } break; +#endif #if HAL_GPIO_PORT_COUNT > 7 case 7: if (!__HAL_RCC_GPIOH_IS_CLK_ENABLED()) { __HAL_RCC_GPIOH_CLK_ENABLE(); } break; +#endif #if HAL_GPIO_PORT_COUNT > 8 case 8: if (!__HAL_RCC_GPIOI_IS_CLK_ENABLED()) { __HAL_RCC_GPIOI_CLK_ENABLE(); } break; +#endif #if HAL_GPIO_PORT_COUNT > 9 case 9: if (!__HAL_RCC_GPIOJ_IS_CLK_ENABLED()) { __HAL_RCC_GPIOJ_CLK_ENABLE(); } break; +#endif #if HAL_GPIO_PORT_COUNT > 10 case 10: if (!__HAL_RCC_GPIOK_IS_CLK_ENABLED()) { __HAL_RCC_GPIOK_CLK_ENABLE(); } break; -#endif -#endif -#endif -#endif -#endif -#endif -#endif -#endif -#endif #endif default: assert(0);
BugID:16944965: Fix path to eml3047/Config.in
@@ -27,7 +27,7 @@ source "board/cy8ckit-062/Config.in" source "board/esp32devkitc/Config.in" source "board/frdmkl81z/Config.in" source "board/stm32l496g-discovery/Config.in" -source "board/eml3047_new/Config.in" +source "board/eml3047/Config.in" source "board/evkbimxrt1050/Config.in" source "board/mk3239/Config.in" source "board/dh5021a_evb/Config.in"
"right-size" cardinality of doErrorMetric fields.
@@ -328,10 +328,10 @@ doErrorMetric(enum metric_t type, int count, enum control_type_t source, } event_field_t fields[] = { - STRFIELD("proc", g_cfg.procname, 2), + STRFIELD("proc", g_cfg.procname, 4), NUMFIELD("pid", g_cfg.pid, 7), - STRFIELD("host", g_cfg.hostname, 2), - STRFIELD("operation", func, 2), + STRFIELD("host", g_cfg.hostname, 4), + STRFIELD("op", func, 3), STRFIELD("unit", "operation", 1), FIELDEND }; @@ -355,11 +355,11 @@ doErrorMetric(enum metric_t type, int count, enum control_type_t source, } event_field_t fields[] = { - STRFIELD("proc", g_cfg.procname, 2), + STRFIELD("proc", g_cfg.procname, 4), NUMFIELD("pid", g_cfg.pid, 7), - STRFIELD("host", g_cfg.hostname, 2), - STRFIELD("operation", func, 2), - STRFIELD("file", name, 2), + STRFIELD("host", g_cfg.hostname, 4), + STRFIELD("op", func, 3), + STRFIELD("file", name, 5), STRFIELD("unit", "operation", 1), FIELDEND }; @@ -381,11 +381,11 @@ doErrorMetric(enum metric_t type, int count, enum control_type_t source, * always. We can change that by adding the test here. */ event_field_t fields[] = { - STRFIELD("proc", g_cfg.procname, 2), + STRFIELD("proc", g_cfg.procname, 4), NUMFIELD("pid", g_cfg.pid, 7), - STRFIELD("host", g_cfg.hostname, 2), - STRFIELD("operation", func, 2), - STRFIELD("domain", name, 2), + STRFIELD("host", g_cfg.hostname, 4), + STRFIELD("op", func, 3), + STRFIELD("domain", name, 5), STRFIELD("unit", "operation", 1), FIELDEND };
fix rise and fall limits in mcpha-pulser-start.c
@@ -43,7 +43,7 @@ void usage() fprintf(stderr, " rate - pulse rate expressed in counts per second (from 1 to 100000),\n"); fprintf(stderr, " dist - pulse distribution (0 for uniform, 1 for poisson),\n"); fprintf(stderr, " rise - pulse rise time expressed in nanoseconds (from 0 to 100),\n"); - fprintf(stderr, " fall - pulse fall time expressed in microseconds,\n"); + fprintf(stderr, " fall - pulse fall time expressed in microseconds (from 0 to 100),\n"); fprintf(stderr, " file - text file containing the spectrum.\n"); } @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) dist = value; value = strtol(argv[4], &end, 10); - if(errno != 0 || end == argv[4] || value < 0 || value > 50) + if(errno != 0 || end == argv[4] || value < 0 || value > 100) { usage(); return EXIT_FAILURE; @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) rise = value; value = strtol(argv[5], &end, 10); - if(errno != 0 || end == argv[5] || value < 0 || value > 50) + if(errno != 0 || end == argv[5] || value < 0 || value > 100) { usage(); return EXIT_FAILURE;
python: do not crash if pp was not initialized
@@ -349,6 +349,7 @@ error: int PYTHON_PLUGIN_FUNCTION (Close) (ckdb::Plugin * handle, ckdb::Key * errorKey) { ElektraPluginProcess * pp = static_cast<ElektraPluginProcess *> (elektraPluginGetData (handle)); + if (!pp) return 0; moduleData * data = static_cast<moduleData *> (elektraPluginProcessGetData (pp)); if (pp && elektraPluginProcessIsParent (pp)) { @@ -390,6 +391,7 @@ int PYTHON_PLUGIN_FUNCTION (Get) (ckdb::Plugin * handle, ckdb::KeySet * returned } ElektraPluginProcess * pp = static_cast<ElektraPluginProcess *> (elektraPluginGetData (handle)); + if (!pp) return 0; if (elektraPluginProcessIsParent (pp)) return elektraPluginProcessSend (pp, ELEKTRA_PLUGINPROCESS_GET, returned, parentKey); moduleData * data = static_cast<moduleData *> (elektraPluginProcessGetData (pp)); @@ -400,6 +402,7 @@ int PYTHON_PLUGIN_FUNCTION (Get) (ckdb::Plugin * handle, ckdb::KeySet * returned int PYTHON_PLUGIN_FUNCTION (Set) (ckdb::Plugin * handle, ckdb::KeySet * returned, ckdb::Key * parentKey) { ElektraPluginProcess * pp = static_cast<ElektraPluginProcess *> (elektraPluginGetData (handle)); + if (!pp) return 0; if (elektraPluginProcessIsParent (pp)) return elektraPluginProcessSend (pp, ELEKTRA_PLUGINPROCESS_SET, returned, parentKey); moduleData * data = static_cast<moduleData *> (elektraPluginProcessGetData (pp)); @@ -410,6 +413,7 @@ int PYTHON_PLUGIN_FUNCTION (Set) (ckdb::Plugin * handle, ckdb::KeySet * returned int PYTHON_PLUGIN_FUNCTION (Error) (ckdb::Plugin * handle, ckdb::KeySet * returned, ckdb::Key * parentKey) { ElektraPluginProcess * pp = static_cast<ElektraPluginProcess *> (elektraPluginGetData (handle)); + if (!pp) return 0; if (elektraPluginProcessIsParent (pp)) return elektraPluginProcessSend (pp, ELEKTRA_PLUGINPROCESS_ERROR, returned, parentKey); moduleData * data = static_cast<moduleData *> (elektraPluginProcessGetData (pp));
Replace magic 16 with sane constant.
@@ -23,6 +23,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); static int start_scan(void); +#define POSITION_STATE_DATA_LEN 16 + static struct bt_conn *default_conn; static struct bt_uuid_128 uuid = BT_UUID_INIT_128(ZMK_SPLIT_BT_SERVICE_UUID); @@ -33,9 +35,9 @@ static u8_t notify_func(struct bt_conn *conn, struct bt_gatt_subscribe_params *params, const void *data, u16_t length) { - static u8_t position_state[16]; + static u8_t position_state[POSITION_STATE_DATA_LEN]; - u8_t changed_positions[16]; + u8_t changed_positions[POSITION_STATE_DATA_LEN]; if (!data) { LOG_DBG("[UNSUBSCRIBED]"); @@ -45,12 +47,12 @@ static u8_t notify_func(struct bt_conn *conn, LOG_DBG("[NOTIFICATION] data %p length %u", data, length); - for (int i = 0; i < 16; i++) { + for (int i = 0; i < POSITION_STATE_DATA_LEN; i++) { changed_positions[i] = ((u8_t *)data)[i] ^ position_state[i]; position_state[i] = ((u8_t *)data)[i]; } - for (int i = 0; i < 16; i++) { + for (int i = 0; i < POSITION_STATE_DATA_LEN; i++) { for (int j = 0; j < 8; j++) { if (changed_positions[i] & BIT(j)) { u32_t position = (i * 8) + j;
typechecker-regex-prototype: fix libfa build on debian, remove unused declaration
-- -- @copyright BSD License (see LICENSE.md or https://www.libelektra.org) -- -module FiniteAutomata (FiniteAutomata, State, BasicAutomata (..), +module FiniteAutomata (FiniteAutomata, BasicAutomata (..), compile, makeBasic, asRegexp, minimize, FiniteAutomata.concat, union, intersect, complement, minus, iter, contains, equals, overlap) where @@ -20,7 +20,6 @@ import Foreign.C.String (withCString) {#context lib="libfa" prefix = "fa" #} {#pointer *fa as FiniteAutomata foreign finalizer free newtype #} -{#pointer *state as State foreign newtype #} {#enum fa_basic as BasicAutomata { underscoreToCase } deriving (Show, Eq) #}
wireless/bluetooth/btsak: Removed bogus name from structure. This was left over from a previous change and had me confused for awhile.
@@ -182,9 +182,9 @@ static void btsak_cmd_scanget(FAR struct btsak_s *btsak, FAR char *cmd, for (i = 0; i < btreq.btr_nrsp; i++) { rsp = &result[i]; - printf("%d.\tname: %s\n", i + 1, rsp->sr_name); - printf("\taddr: " + printf("%2d.\taddr: " "%02x:%02x:%02x:%02x:%02x:%02x type: %d\n", + i + 1, rsp->sr_addr.val[0], rsp->sr_addr.val[1], rsp->sr_addr.val[2], rsp->sr_addr.val[3], rsp->sr_addr.val[4], rsp->sr_addr.val[5],
mangoapp: notifier
@@ -28,6 +28,7 @@ overlay_params params {}; static ImVec2 window_size; static uint32_t vendorID; static std::string deviceName; +static notify_thread notifier; struct mangoapp_msg_header { long msg_type; // Message queue ID, never change @@ -121,6 +122,8 @@ int main(int, char**) create_fonts(params, sw_stats.font1, sw_stats.font_text); HUDElements.convert_colors(params); init_cpu_stats(params); + notifier.params = &params; + start_notifier(notifier); deviceName = (char*)glGetString(GL_RENDERER); sw_stats.deviceName = deviceName; if (deviceName.find("Radeon") != std::string::npos
landscape: altered RemoteContent regexes for images, video, and audio to include period literal. This prevents URLs ending in 'mov', 'ogg', etc. from rendering as empty video/audio, allowing people to learn about Isaac Asimov and William Rees-Mogg.
@@ -38,10 +38,10 @@ export interface RemoteContentProps { } export const IMAGE_REGEX = new RegExp( - /(jpg|img|png|gif|tiff|jpeg|webp|webm|svg)$/i + /(\.jpg|\.img|\.png|\.gif|\.tiff|\.jpeg|\.webp|\.webm|\.svg)$/i ); -export const AUDIO_REGEX = new RegExp(/(mp3|wav|ogg|m4a)$/i); -export const VIDEO_REGEX = new RegExp(/(mov|mp4|ogv)$/i); +export const AUDIO_REGEX = new RegExp(/(\.mp3|\.wav|\.ogg|\.m4a)$/i); +export const VIDEO_REGEX = new RegExp(/(\.mov|\.mp4|\.ogv)$/i); const emptyRef = () => {}; export function RemoteContent(props: RemoteContentProps) {
handle invalid pm_socket requests
@@ -145,7 +145,7 @@ def process_request(json_str, num_candidates=10): try: reqs = json.loads(json_str) except json.decoder.JSONDecodeError as e: - logging.error('Request invalid') + logging.error('Received invalid request') return logging.debug(json_str) @@ -154,11 +154,15 @@ def process_request(json_str, num_candidates=10): for req in reqs: pma = PropertyMultiArray() for p, val in req.items(): + try: if isinstance(val, list): pma.add([policy.PropertyArray(policy.dict_to_properties({p: v})[0]) for v in val]) else: pp = policy.dict_to_properties({p: val})[0] pma.add(policy.PropertyArray(pp)) + except policy.NEATPropertyError as e: + logging.error('Received invalid request: ' + str(e)) + return requests.extend(pma.expand()) # local_endpoint handling
close h2client stream on goaway
@@ -655,6 +655,7 @@ static int handle_goaway_frame(struct st_h2o_http2client_conn_t *conn, h2o_http2 kh_foreach_value(conn->streams, stream, { if (stream->stream_id > payload.last_stream_id) { call_callback_with_error(stream, h2o_httpclient_error_refused_stream); + close_stream(stream); } });
build UPDATE abi base soversion 2.25.1 Plugin API NBC changes.
@@ -459,7 +459,7 @@ gen_doc("${doxy_files}" ${LIBYANG_VERSION} ${LIBYANG_DESCRIPTION} ${project_logo # generate API/ABI report if ("${BUILD_TYPE_UPPER}" STREQUAL "ABICHECK") - lib_abi_check(yang "${headers}" ${LIBYANG_SOVERSION_FULL} d2f1608b348fc256742f9543d2187397c615d733) + lib_abi_check(yang "${headers}" ${LIBYANG_SOVERSION_FULL} 003fa46e190930912e4d3f7b178c671c0662f671) endif() # source code format target for Makefile
Fix native module issue.
@@ -1568,7 +1568,7 @@ value, one key will be ignored." path)) (def require - "(require module)\n\n + "(require module & args)\n\n Require a module with the given name. Will search all of the paths in module/paths, then the path as a raw file path. Returns the new environment returned from compiling and running the file." @@ -1596,21 +1596,18 @@ value, one key will be ignored." (def cache @{}) (def loading @{}) - (fn require [path args &] + (fn require [path & args] (when loading.path (error (string "circular dependency: module " path " is loading"))) - (def {:exit exit-on-error} (or args {})) - (def check cache.path) - (if check + (def {:exit exit-on-error} (table ;args)) + (if-let [check cache.path] check + (if-let [f (find-mod path)] (do + # Normal janet module (def newenv (make-env)) (set cache.path newenv) (set loading.path true) - (def f (find-mod path)) - (if f - (do - # Normal janet module (defn chunks [buf _] (file/read f 1024 buf)) (run-context newenv chunks (fn [sig x f source] @@ -1618,34 +1615,28 @@ value, one key will be ignored." (status-pp sig x f source) (if exit-on-error (os/exit 1)))) path) - (file/close f)) + (file/close f) + (set loading.path false) + newenv) (do # Try native module (def n (find-native path)) (if (not n) (error (string "could not open file for module " path))) - ((native n) newenv))) - (set loading.path false) - newenv))))) + (native n))))))) (defn import* "Import a module into a given environment table. This is the functional form of (import ...) that expects and explicit environment table." [env path & args] - (def targs (table ;args)) (def {:as as - :prefix prefix} targs) - (def newenv (require path targs)) - (var k (next newenv nil)) - (def {:meta meta} newenv) + :prefix prefix} (table ;args)) + (def newenv (require path ;args)) (def prefix (or (and as (string as "/")) prefix (string path "/"))) - (while k - (def v newenv.k) - (when (not v:private) + (loop [[k v] :pairs newenv :when (not v:private)] (def newv (table/setproto @{:private true} v)) - (put env (symbol prefix k) newv)) - (set k (next newenv k)))) + (put env (symbol prefix k) newv))) (defmacro import "Import a module. First requires the module, and then merges its
build x64 by default for Windows
@@ -21,7 +21,7 @@ jobs: shell: cmd run: | cd build - cmake -G "Visual Studio 16 2019" -A Win32 -T v141_xp -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .. + cmake -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .. cmake --build . --config %BUILD_TYPE% --parallel - name: Deploy @@ -44,7 +44,7 @@ jobs: shell: cmd run: | cd build - cmake -G "Visual Studio 16 2019" -A Win32 -T v141_xp -DBUILD_SDLGPU=On -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .. + cmake -G "Visual Studio 16 2019" -DBUILD_SDLGPU=On -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .. cmake --build . --config %BUILD_TYPE% --parallel - name: Deploy @@ -67,7 +67,7 @@ jobs: shell: cmd run: | cd build - cmake -G "Visual Studio 16 2019" -A Win32 -DBUILD_SDL=Off -DBUILD_SOKOL=On -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .. + cmake -G "Visual Studio 16 2019" -DBUILD_SDL=Off -DBUILD_SOKOL=On -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .. cmake --build . --config %BUILD_TYPE% --parallel cp bin/tic80-sokol.exe bin/tic80.exe
Quick documentation for yr_bitmask_* macros.
@@ -32,6 +32,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <yara/integers.h> +// +// Utility macros for working with bitmaps. +// +// Declare a bitmask of n bits: +// YR_BITMASK my_bitmask[YR_BITMASK_SIZE(n)]; +// +// Clear all bits: +// yr_bitmask_clear_all(my_bitmask) +// +// Set bit n to 1: +// yr_bitmask_set(my_bitmask, n) +// +// Clear bit n (set to 0): +// yr_bitmask_clear(my_bitmask, n) +// +// Check if bit n is set: +// yr_bitmask_isset(my_bitmask, n) +// + #define YR_BITMASK unsigned long
OcBootManagementLib: Assign image LoadOptions as Unicode
@@ -872,6 +872,8 @@ InternalLoadBootEntry ( EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; VOID *EntryData; UINT32 EntryDataSize; + CONST CHAR8 *Args; + UINT32 ArgsLen; ASSERT (BootPolicy != NULL); ASSERT (BootEntry != NULL); @@ -974,16 +976,24 @@ InternalLoadBootEntry ( BootEntry->LoadOptions )); + LoadedImage->LoadOptionsSize = 0; + LoadedImage->LoadOptions = NULL; + if (BootEntry->LoadOptions == NULL && (BootEntry->Type == OcBootApple || BootEntry->Type == OcBootAppleRecovery)) { - LoadedImage->LoadOptionsSize = (UINT32)AsciiStrLen (Context->AppleBootArgs); - if (LoadedImage->LoadOptionsSize > 0) { - LoadedImage->LoadOptionsSize += 1; - LoadedImage->LoadOptions = Context->AppleBootArgs; - } + Args = Context->AppleBootArgs; + ArgsLen = (UINT32)AsciiStrLen (Args); } else { - LoadedImage->LoadOptionsSize = BootEntry->LoadOptionsSize; - LoadedImage->LoadOptions = BootEntry->LoadOptions; + Args = BootEntry->LoadOptions; + ArgsLen = BootEntry->LoadOptionsSize; + ASSERT (ArgsLen == AsciiStrLen (Args)); + } + + if (ArgsLen > 0) { + LoadedImage->LoadOptions = AsciiStrCopyToUnicode (Args, ArgsLen); + if (LoadedImage->LoadOptions != NULL) { + LoadedImage->LoadOptionsSize = ArgsLen * sizeof (CHAR16) + sizeof (CHAR16); + } } if (BootEntry->Type == OcBootCustom) {
Deactivate offscreen actors from asm
@@ -620,28 +620,35 @@ _UpdateActors:: loop_exit: + ;; Deactivate Offscreen Actors ---------------------------------------------- + ; b=loop index + ld b, #0 ;; b = 0 + delete_loop_cond: + ; If b == actors_active_size + ld hl, #_actors_active_delete_count + ld a, (hl) ;; a = actors_active_delete_count + cp b ;; compare a and b + jp z, delete_loop_exit ;; if b == a goto loop_exit + push bc ;; store loop index - ; ; b=loop index - ; ld b, #0 ;; b = 0 - ; delete_loop_cond: - ; ; If b == actors_active_size - ; ld hl, #_actors_active_delete_count - ; ld a, (hl) ;; a = actors_active_delete_count - ; cp b ;; compare a and b - ; jp z, delete_loop_exit ;; if b == a goto loop_exit - - - ; ld a, #1 - ; push bc - ; push af - ; inc sp - ; call _DeactivateActiveActor - - ; jp delete_loop_cond ;; goto loop_cond + ; Load actor index into a + ld hl, #_actors_active_delete + ld a, b + _add_a h l + ld a, (hl) + ; Call DeactivateActiveActor(a) + push af + inc sp + call _DeactivateActiveActor + inc sp - ; delete_loop_exit: + ; Restore loop index from stack + pop bc ;; retreive b as loop index + inc b ;; b++ + jp delete_loop_cond ;; goto loop_cond + delete_loop_exit: ret
[update] check whether it's a same console device.
@@ -1116,7 +1116,7 @@ RTM_EXPORT(rt_console_get_device); * * @param name the name of new console device * - * @return the old console device handler + * @return the old console device handler on successful, or RT_NULL on failure. */ rt_device_t rt_console_set_device(const char *name) { @@ -1127,6 +1127,10 @@ rt_device_t rt_console_set_device(const char *name) /* find new console device */ new_device = rt_device_find(name); + + /* check whether it's a same device */ + if (new_device == old_device) return RT_NULL; + if (new_device != RT_NULL) { if (_console_device != RT_NULL)
Remove gp_resgroup_memory_policy from postgres.conf gp_resgroup_memory_policy is recently introduced by resource group module, so when running binary swap cases, the old binary can not recognize it, so remove it to make cases pass
@@ -489,13 +489,6 @@ log_autostats=off # print additional autostats information gp_resqueue_memory_policy = 'eager_free' # memory request based queueing. # eager_free, auto or none -#--------------------------------------------------------------------------- -# RESOURCE GROUP -#--------------------------------------------------------------------------- -gp_resgroup_memory_policy = 'eager_free' # memory assignment policy for - # resource group. - # eager_free, auto or none - #--------------------------------------------------------------------------- # EXTERNAL TABLES #---------------------------------------------------------------------------
poppy: Lower VCCIO from 0.975V to 0.850V CQ-DEPEND=CL:*591042 BRANCH=poppy TEST=No regressions observed. Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh
@@ -419,11 +419,11 @@ static void board_pmic_disable_slp_s0_vr_decay(void) /* * VCCIOCNT: * Bit 6 (0) - Disable decay of VCCIO on SLP_S0# assertion - * Bits 5:4 (00) - Nominal output voltage: 0.975V + * Bits 5:4 (00) - Nominal output voltage: 0.850V * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion * Bits 1:0 (10) - VR set to AUTO operating mode */ - i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x30, 0xa); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x30, 0x3a); /* * V18ACNT: @@ -458,11 +458,11 @@ static void board_pmic_enable_slp_s0_vr_decay(void) /* * VCCIOCNT: * Bit 6 (1) - Enable decay of VCCIO on SLP_S0# assertion - * Bits 5:4 (00) - Nominal output voltage: 0.975V + * Bits 5:4 (00) - Nominal output voltage: 0.850V * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion * Bits 1:0 (10) - VR set to AUTO operating mode */ - i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x30, 0x4a); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x30, 0x7a); /* * V18ACNT:
Update sgemm_kernel_16x4_skylakex_2.c
@@ -376,5 +376,5 @@ CNAME(BLASLONG m, BLASLONG n, BLASLONG k, float alpha, float * __restrict__ A, f if(n_count>0) COMPUTE(1) return 0; } - +#include <immintrin.h> #include "sgemm_direct_skylakex.c"
[trace] Split performance metrics at `nop` instruction
@@ -505,6 +505,11 @@ def main(): False, time_info, args.offl, not args.saddr, args.permissive) if perf_metrics[0]['start'] is None: perf_metrics[0]['start'] = time_info[1] + # Create a new section after every 'nop' instruction + if 'nop' in ann_insn: + perf_metrics[-1]['end'] = time_info[1] + perf_metrics.append(defaultdict(int)) + perf_metrics[-1]['start'] = time_info[1] if not empty: print(ann_insn) else:
Replace leftover MAKE_ROUTING_NONE with MAKE_ROUTING_NULLROUTING
@@ -15,7 +15,7 @@ PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES) # REST Engine shall use Erbium CoAP implementation MODULES += os/net/app-layer/coap -MAKE_ROUTING = MAKE_ROUTING_NONE +MAKE_ROUTING = MAKE_ROUTING_NULLROUTING all: $(CONTIKI_PROJECT)
dm: hyper_dmabuf: clean up assert validate fd before use it
#include <stdlib.h> #include <string.h> #include <unistd.h> -#include <assert.h> #include <pthread.h> #include "dm.h" @@ -343,8 +342,9 @@ virtio_hyper_dmabuf_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts) virtio_hyper_dmabuf_k_stop(); virtio_hyper_dmabuf_k_reset(); kstatus = VIRTIO_DEV_INITIAL; - assert(vbs_k_hyper_dmabuf_fd >= 0); + if (vbs_k_hyper_dmabuf_fd >= 0) { close(vbs_k_hyper_dmabuf_fd); + } vbs_k_hyper_dmabuf_fd = -1; }
doc: getting_started.md: text updates
@@ -96,7 +96,7 @@ Search for "CartoMobileSDK.WinPhone10" or use url: "https://www.nuget.org/packag If you do not want to use package manager, you can download SDK from the [Github mobile-sdk project releases page]( https://github.com/CartoDB/mobile-sdk/releases) -## Registering your Mobile App +## Registering your App You must register your mobile applications under your CARTO.com account settings. Once an app is added, you can retrieve the mobile app license key, which is needed for your app code. @@ -141,7 +141,7 @@ The following procedure describes how to register mobile apps under your account The Mobile apps page refreshes, displaying the added mobile application and the features enabled. -### Access your Mobile API Key +### Access your API Key Once your mobile apps are registered for your account, you can retrieve the API Key for each application. This is useful when you need to copy and paste the API Key for mobile development. @@ -169,7 +169,7 @@ Mobile App API Keys cannot be regenerated manually, but are automatically regene You will receive a notification when mobile api keys are regenerated. -### Delete a Mobile App +### Deleting an App Once a mobile application is saved, you cannot edit the Platform setting. As an alternative, you can delete the application and [recreate it](#registering-your-mobile-app) with new settings. @@ -621,7 +621,7 @@ _**Note:** The Windows Phone 10 implementation of the Mobile SDK is experimenta **Tip:** .Net [sample app](#xamarin-and-windows-phone-samples) contains two solutions: one for Windows Phone and another for Xamarin, and they share one project _hellomap-shared_ with map-related code. -#### Create a WP App +#### Creating a WP App Follow these steps in order to create a Windows Phone (WP) mobile application. @@ -676,7 +676,7 @@ private Carto.Ui.MapView mapView; </pre> -#### Add a Marker (WP) +#### Adding a Marker (WP) To create a map marker at a defined coordinate on a Windows Phone mobile app, add following code (after creating a [MapView](#basic-map-features).
libflash: fix memory leak on flash_exit() LeakSanitizer caught this with libflash/test/test-flash.c: Direct leak of 4096 byte(s) in 1 object(s) allocated from: 0x7f72546ee850 in malloc (/lib64/libasan.so.4+0xde850) 0x405ff0 in flash_init libflash/test/../libflash.c:830 0x408632 in main libflash/test/test-flash.c:382 0x7f7253540509 in __libc_start_main (/lib64/libc.so.6+0x20509)
@@ -863,8 +863,11 @@ bail: void flash_exit(struct blocklevel_device *bl) { /* XXX Make sure we are idle etc... */ - if (bl) - free(container_of(bl, struct flash_chip, bl)); + if (bl) { + struct flash_chip *c = container_of(bl, struct flash_chip, bl); + free(c->smart_buf); + free(c); + } } void flash_exit_close(struct blocklevel_device *bl, void (*close)(struct spi_flash_ctrl *ctrl))
adds bash completion for argument options for oidc-token
@@ -25,12 +25,12 @@ _needArgument() { return 0 } -#TODO completion for options _oidc-token() { - local cur prev opts + local cur prev prevprev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" + prevprev="${COMP_WORDS[COMP_CWORD-2]}" local IFS=$'\t\n' opts="--listaccounts --time= @@ -50,6 +50,22 @@ _oidc-token() { COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi + + if [[ "$cur" == "=" ]]; then + prev+="=" + cur="" + fi + if [[ "$prev" == "=" ]]; then + prev="$prevprev$prev" + fi + case $prev in + "--scope=") + local IFS=$'#\n' + local someScopes="openid #offline_access #profile #phone #address " + COMPREPLY=( $(compgen -W "${someScopes}" -- ${cur}) ) + return 0 + ;; + esac if [[ ${cur} == * ]] && _needArgument ; then COMPREPLY=( $(compgen -W "${shortnames}" -- ${cur}) ) return 0
do not report warnning if Slua.getClass
@@ -332,7 +332,7 @@ namespace SLua #if SLUA_CHECK_REFLECTION int isReflect = LuaDLL.luaS_pushobject(l, index, getAQName(o), gco, udCacheRef); - if (isReflect != 0 && checkReflect) + if (isReflect != 0 && checkReflect && !(o is LuaClassObject)) { Logger.LogWarning(string.Format("{0} not exported, using reflection instead", o.ToString())); }
Mismatch In Joint Tessellation Factor
@@ -144,7 +144,7 @@ namespace carto { if (style.getLineJoinType() == LineJoinType::LINE_JOIN_TYPE_BEVEL) { segments = deltaAngle != 0 ? 1 : 0; } else { //style.getLineJoinType() == LineJoinType::ROUND - segments = static_cast<int>(std::ceil(std::abs(deltaAngle) * style.getWidth() * LINE_ENDPOINT_TESSELATION_FACTOR)); + segments = static_cast<int>(std::ceil(std::abs(deltaAngle) * style.getWidth() * LINE_JOIN_TESSELATION_FACTOR)); } coordCount += segments;
docs: updata README_en.md updata README_en.md
@@ -58,7 +58,7 @@ After these files copied, the directory structure should look like: After compiling, static library `libboatvendor.a` and `libboatwallet.a` will be created in `<MT3620 Root>/BoAT-X-Framework/lib` directory. -### 2. Debug demo program +## Debug demo program 1. Copy`<MT3620 Root>/BoAT-X-Framework/lib` into `<MT3620 Root>/customer/boatiotsdk`.
hark-graph-hook: correctly get rear of index
update-core ?- mode.kind %count (hark %unread-count place %.y 1) - %each (hark %unread-each place /(rsh 4 (scot %ui (rear index.post)))) + %each (hark %unread-each place /(rsh 4 (scot %ui (rear self-idx)))) %none update-core == == update-core ?- mode.kind %count (hark %unread-count place %.n 1) - %each (hark %read-each place /(rsh 4 (scot %ui (rear index.post)))) + %each (hark %read-each place /(rsh 4 (scot %ui (rear self-idx)))) %none update-core == ==
Tests: print path to unit.log file when it was saved.
@@ -52,6 +52,9 @@ class TestUnit(unittest.TestCase): if '--leave' not in sys.argv and success: shutil.rmtree(self.testdir) + else: + self._print_path_to_log() + def check_modules(self, *modules): self._run() @@ -191,11 +194,16 @@ class TestUnit(unittest.TestCase): for skip in self.skip_alerts: alerts = [al for al in alerts if re.search(skip, al) is None] + if alerts: + self._print_path_to_log() self.assertFalse(alerts, 'alert(s)') if not self.skip_sanitizer: - self.assertFalse(re.findall('.+Sanitizer.+', log), - 'sanitizer error(s)') + sanitizer_errors = re.findall('.+Sanitizer.+', log) + + if sanitizer_errors: + self._print_path_to_log() + self.assertFalse(sanitizer_error, 'sanitizer error(s)') if found: print('skipped.') @@ -219,6 +227,9 @@ class TestUnit(unittest.TestCase): return ret + def _print_path_to_log(self): + print('Path to unit.log:\n' + self.testdir + '/unit.log') + class TestUnitHTTP(TestUnit): def http(self, start_str, **kwargs):
fix(chainmaker): if compiling "chainmaker" by CMake, return an error and slove this problem .#843
@@ -28,7 +28,6 @@ wait for its receipt. #include "boatplatform_internal.h" #include "common/request.pb-c.h" #include "common/transaction.pb-c.h" -#include "common/common.pb-c.h" BOAT_RESULT generateTxRequestPayloadPack(BoatHlchainmakerTx *tx_ptr, char *method, char* contract_name, BoatFieldVariable *output_ptr) {
motor: tidy mix scaling
@@ -79,16 +79,11 @@ static float motord(float in, int x) { static void motor_mixer_scale_calc(float mix[4]) { #ifdef BRUSHLESS_MIX_SCALING - uint8_t mix_scaling = 0; - // only enable once really in the air - if (flags.on_ground) { - mix_scaling = 0; - } else { - mix_scaling = flags.in_air; + if (flags.on_ground || !flags.in_air) { + return; } - if (mix_scaling) { float mix_min = 1000.0f; float mix_max = -1000.0f; @@ -104,11 +99,11 @@ static void motor_mixer_scale_calc(float mix[4]) { mix_max = (1 + CLIPPING_LIMIT); } - float mix_range = mix_max - mix_min; float reduce_amount = 0.0f; + const float mix_range = mix_max - mix_min; if (mix_range > 1.0f) { - float scale = 1.0f / mix_range; + const float scale = 1.0f / mix_range; for (int i = 0; i < 4; i++) mix[i] *= scale; @@ -122,11 +117,8 @@ static void motor_mixer_scale_calc(float mix[4]) { reduce_amount = mix_min; } - if (reduce_amount != 0.0f) { for (int i = 0; i < 4; i++) mix[i] -= reduce_amount; - } - } #endif #ifdef BRUSHED_MIX_SCALING
Update: Guarantee BELIEF_CONCEPT_MATCH_TARGET belief concept matches, avoiding the system being lazy after busy times
@@ -351,9 +351,23 @@ void Cycle_Inference(long currentTime) { //Inferences #if STAGE==2 - long countConceptsMatched = 0; for(int i=0; i<eventsSelected; i++) { + long countConceptsMatched = 0; + bool fired[CONCEPTS_MAX] = {0}; //whether a concept already fired + for(;;) + { + long countConceptsMatchedNew = 0; + //Adjust dynamic firing threshold: (proportional "self"-control) + double conceptPriorityThresholdCurrent = conceptPriorityThreshold; + long countConceptsMatchedAverage = Stats_countConceptsMatchedTotal / currentTime; + double set_point = BELIEF_CONCEPT_MATCH_TARGET; + double process_value = countConceptsMatchedAverage; + double error = process_value - set_point; + double increment = error*CONCEPT_THRESHOLD_ADAPTATION; + conceptPriorityThreshold = MIN(1.0, MAX(0.0, conceptPriorityThreshold + increment)); + //IN_DEBUG( printf("conceptPriorityThreshold=%f\n", conceptPriorityThreshold); ) + Event *e = &selectedEvents[i]; Term subterms_of_e[6] = {0}; //subterms up to level 2 for(int j=0; j<5; j++) @@ -365,15 +379,6 @@ void Cycle_Inference(long currentTime) Truth dummy_truth = {0}; RuleTable_Apply(e->term, dummy_term, e->truth, dummy_truth, e->occurrenceTime, e->stamp, currentTime, priority, 1, false, NULL, 0); IN_DEBUG( puts("Event was selected:"); Event_Print(e); ) - //Adjust dynamic firing threshold: (proportional "self"-control) - double conceptPriorityThresholdCurrent = conceptPriorityThreshold; - long countConceptsMatchedAverage = Stats_countConceptsMatchedTotal / currentTime; - double set_point = BELIEF_CONCEPT_MATCH_TARGET; - double process_value = countConceptsMatchedAverage; - double error = process_value - set_point; - double increment = error*CONCEPT_THRESHOLD_ADAPTATION; - conceptPriorityThreshold = MIN(1.0, MAX(0.0, conceptPriorityThreshold + increment)); - //printf("conceptPriorityThreshold=%f\n", conceptPriorityThreshold); //Main inference loop: #pragma omp parallel for for(int j=0; j<concepts.itemsAmount; j++) @@ -384,6 +389,11 @@ void Cycle_Inference(long currentTime) { continue; } + if(fired[j]) + { + continue; + } + fired[j] = true; //first filter based on common term (semantic relationship) bool has_common_term = false; for(int k=0; k<5; k++) @@ -418,6 +428,7 @@ void Cycle_Inference(long currentTime) { #pragma omp critical { + countConceptsMatchedNew++; countConceptsMatched++; Stats_countConceptsMatchedTotal++; } @@ -487,6 +498,11 @@ void Cycle_Inference(long currentTime) { Stats_countConceptsMatchedMax = countConceptsMatched; } + if(countConceptsMatched >= BELIEF_CONCEPT_MATCH_TARGET || countConceptsMatchedNew == 0) + { + break; + } + } } #endif }