message
stringlengths 6
474
| diff
stringlengths 8
5.22k
|
---|---|
out_forward: set upstream flags using instance flags | @@ -752,6 +752,7 @@ static int forward_config_simple(struct flb_forward *ctx,
return -1;
}
ctx->u = upstream;
+ flb_output_upstream_set(ctx->u, ins);
/* Shared Key */
tmp = flb_output_get_property("shared_key", ins);
|
freertos: added a FreeRTOS property returning "original" include path | @@ -31,6 +31,9 @@ idf_component_register(SRCS "${srcs}"
REQUIRES app_trace
PRIV_REQUIRES soc)
+idf_component_get_property(COMPONENT_DIR freertos COMPONENT_DIR)
+idf_component_set_property(freertos ORIG_INCLUDE_PATH "${COMPONENT_DIR}/include/freertos/")
+
if(CONFIG_FREERTOS_DEBUG_OCDAWARE)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=uxTopUsedPriority")
endif()
|
refactor: remove redundant function from bot-channel.c | @@ -65,16 +65,6 @@ void on_delete(
discord_delete_channel(client, msg->channel_id, NULL);
}
-void on_edit_permissions(
- struct discord *client,
- const struct discord_user *bot,
- const struct discord_message *msg)
-{
- if (msg->author->bot) return;
-
- discord_delete_channel(client, msg->channel_id, NULL);
-}
-
int main(int argc, char *argv[])
{
const char *config_file;
@@ -93,14 +83,13 @@ int main(int argc, char *argv[])
discord_set_prefix(client, "channel.");
discord_set_on_command(client, "create", &on_create);
discord_set_on_command(client, "delete_here", &on_delete);
- discord_set_on_command(client, "edit_permissions", &on_edit_permissions);
discord_set_on_channel_create(client, &on_channel_create);
discord_set_on_channel_update(client, &on_channel_update);
discord_set_on_channel_delete(client, &on_channel_delete);
- printf("\n\nThis bot demonstrates how easy it is to create/delete channels\n"
+ printf("\n\(USE WITH CAUTION) nThis bot demonstrates how easy it is to create/delete channels\n"
"1. Type 'channel.create <channel_name>' anywhere to create a new channel\n"
- "2. (USE WITH CAUTION) Type 'channel.delete_here' to delete the current channel\n"
+ "2. Type 'channel.delete_here' to delete the current channel\n"
"\nTYPE ANY KEY TO START BOT\n");
fgetc(stdin); // wait for input
|
switch synonym for eval_set | @@ -1743,10 +1743,10 @@ def train(params, pool=None, dtrain=None, logging_level=None, verbose=None, iter
num_boost_round : int
Synonym for iterations. Only one of these parameters should be set.
- evals : Pool or tuple (X, y)
+ eval_set : Pool or tuple (X, y)
Dataset for evaluation.
- eval_set : Pool or tuple (X, y)
+ evals : Pool or tuple (X, y)
Synonym for evals. Only one of these parameters should be set.
plot : bool, optional (default=False)
|
kingler: print TCPC reset
TEST=none
BRANCH=none
Tested-by: Eric Yilun Lin | @@ -228,6 +228,7 @@ __override int board_rt1718s_set_frs_enable(int port, int enable)
void board_reset_pd_mcu(void)
{
+ CPRINTS("Resetting TCPCs...");
/* reset C0 ANX3447 */
/* Assert reset */
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_usb_c0_tcpc_rst), 1);
|
Fix crash in obt module.
The time to free device resources was too short due to
the use of HIGH_QOS queires.
Tested-by: Kishen Maloor | @@ -874,7 +874,7 @@ obt_discovery_cb(const char *anchor, const char *uri, oc_string_array_t types,
}
memcpy(device->uuid.id, uuid.id, 16);
device->endpoint = endpoint;
- oc_set_delayed_callback(device, free_device, DISCOVERY_CB_DELAY + 2);
+ oc_set_delayed_callback(device, free_device, OBT_CB_TIMEOUT);
if ((long)user_data == OC_OBT_UNOWNED_DISCOVERY) {
oc_do_get(uri, ep, "owned=FALSE", &obt_check_owned, HIGH_QOS, device);
} else {
|
[refactor] Remove duplicated codes | @@ -23,6 +23,13 @@ static int systemPrint(lua_State *L)
return 0;
}
+static char *getDbKey(lua_State *L)
+{
+ lua_pushvalue(L, 1); /* prefix key */
+ lua_concat(L, 2); /* dbKey(prefix..key) */
+ return (char *)lua_tostring(L, -1);
+}
+
int setItemWithPrefix(lua_State *L)
{
char *dbKey;
@@ -36,9 +43,7 @@ int setItemWithPrefix(lua_State *L)
luaL_checkstring(L, 1);
luaL_checkany(L, 2);
luaL_checkstring(L, 3);
- lua_pushvalue(L, 1);
- lua_concat(L, 2);
- dbKey = (char *)lua_tostring(L, -1);
+ dbKey = getDbKey(L);
jsonValue = lua_util_get_json (L, 2, false);
if (jsonValue == NULL) {
lua_error(L);
@@ -73,10 +78,7 @@ int getItemWithPrefix(lua_State *L)
}
luaL_checkstring(L, 1);
luaL_checkstring(L, 2);
- lua_pushvalue(L, 1);
- lua_concat(L, 2);
- dbKey = (char *)lua_tostring(L, -1);
-
+ dbKey = getDbKey(L);
ret = LuaGetDB(L, service, dbKey);
if (ret < 0) {
lua_error(L);
@@ -111,10 +113,7 @@ int delItemWithPrefix(lua_State *L)
}
luaL_checkstring(L, 1);
luaL_checkstring(L, 2);
- lua_pushvalue(L, 1);
- lua_concat(L, 2);
- dbKey = (char *)lua_tostring(L, -1);
-
+ dbKey = getDbKey(L);
ret = LuaDelDB(L, service, dbKey);
if (ret < 0) {
lua_error(L);
|
Fix RouteMatchingRequest serialization | @@ -404,7 +404,7 @@ namespace carto {
if (customParams.is<picojson::object>()) {
json = customParams.get<picojson::object>();
}
- json["locations"] = picojson::value(locations);
+ json["shape"] = picojson::value(locations);
json["shape_match"] = picojson::value("map_snap");
json["costing"] = picojson::value(profile);
json["units"] = picojson::value("kilometers");
|
docs: update watermark for RC | % for non-released DRAFT - comment out for GA release
\usepackage[firstpage]{draftwatermark}
-\usepackage{draftwatermark}
-\SetWatermarkText{Tech Preview}
-\SetWatermarkScale{0.45}
+%\usepackage{draftwatermark}
+%\SetWatermarkText{Tech Preview}
+%\SetWatermarkHorCenter{0.55\paperwidth}
+\SetWatermarkVerCenter{0.6\paperheight}
+\SetWatermarkText{\parbox{38cm}{\centering Release \\ Candidate}}
+\SetWatermarkScale{0.4}
% ----------- Variables to change per release -------------
-\newcommand{\OHPCVersion}{2.0.0}
+\newcommand{\OHPCVersion}{2.0.0 RC1}
\newcommand{\OHPCVerTree}{2.0}
% ---------------------------------------------------------
|
Reduce the file size | @@ -4,7 +4,8 @@ use Net::EmptyPort qw(check_port empty_port);
use Test::More;
use t::Util;
-plan skip_all => 'skipping for now';
+plan skip_all => 'nghttp not found'
+ unless prog_exists('nghttp');
my $upstream_port = empty_port();
@@ -24,7 +25,7 @@ hosts:
proxy.reverse.url: http://127.0.0.1:$upstream_port
EOT
-my $huge_file_size = 50 * 1024 * 1024;
+my $huge_file_size = 5 * 1024 * 1024;
my $huge_file = create_data_file($huge_file_size);
my $doit = sub {
|
Remove extra comma in man page example code | @@ -92,7 +92,7 @@ AES-256-CBC into a buffer:
size_t datalen;
ectx = OSSL_ENCODER_CTX_new_for_pkey(pkey,
- OSSL_KEYMGMT_SELECT_KEYPAIR,
+ OSSL_KEYMGMT_SELECT_KEYPAIR
| OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS,
format, structure,
NULL);
|
Fix player sprite type and num frames | @@ -330,13 +330,9 @@ void LoadScene(UINT16 index)
triggers[i].events_ptr.offset = *(data_ptr++) + (*(data_ptr++) * 256);
}
- // Load collisions
-
- // Initialise player position
- ReadBankedBankPtr(DATA_PTRS_BANK, &sprite_bank_ptr, &sprite_bank_ptrs[map_next_sprite]);
- sprite_ptr = ((UWORD)bank_data_ptrs[sprite_bank_ptr.bank]) + sprite_bank_ptr.offset;
- sprite_frames = ReadBankedUBYTE(sprite_bank_ptr.bank, sprite_ptr);
+ // Initialise player
+ sprite_frames = DIV_4(LoadSprite(map_next_sprite, 0));
player.enabled = TRUE;
player.moving = FALSE;
player.collisionsEnabled = TRUE;
@@ -344,11 +340,8 @@ void LoadScene(UINT16 index)
player.pos.y = map_next_pos.y;
player.dir.x = map_next_dir.x;
player.dir.y = map_next_dir.y;
- // player.sprite_type = SPRITE_ACTOR_ANIMATED;
- player.sprite_type = SPRITE_STATIC;
- // player.sprite_type = sprite_frames == 6 ? SPRITE_ACTOR_ANIMATED : sprite_frames == 3 ? SPRITE_ACTOR : SPRITE_STATIC;
+ player.sprite_type = sprite_frames == 6 ? SPRITE_ACTOR_ANIMATED : sprite_frames == 3 ? SPRITE_ACTOR : SPRITE_STATIC;
player.frames_len = sprite_frames == 6 ? 2 : sprite_frames == 3 ? 1 : sprite_frames;
-
player.sprite_index = SpritePoolNext();
InitScroll();
|
LoongArch64: Fix dnrm2_tiny testcase failure | @@ -53,6 +53,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define s4 $f9
#define ALPHA $f4
#define max $f5
+#define INF $f6
PROLOGUE
@@ -61,6 +62,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
LDINT INCX, 0(INCX)
#endif
+ // Init INF
+ addi.d TEMP, $r0, 0x7FF
+ slli.d TEMP, TEMP, 52
+ MTC INF, TEMP
+
MTC s1, $r0
bge $r0, N, .L999
slli.d INCX, INCX, BASE_SHIFT
@@ -198,7 +204,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CMPEQ $fcc0, s1, a1
fcvt.d.s ALPHA, ALPHA
bcnez $fcc0, .L999
+
fdiv.d ALPHA, ALPHA, s1
+ CMPEQ $fcc0, INF, ALPHA
+ bcnez $fcc0, .L999
+
MOV max, s1
MOV s1, a1
MOV s2, a1
|
Skip early data basic check temp | @@ -282,6 +282,9 @@ run_test "TLS 1.3: G->m: PSK: configured ephemeral only, good." \
0 \
-s "key exchange mode: ephemeral$"
+# skip the basic check now cause it will randomly trigger the anti-replay protection in gnutls_server
+# Add it back once we fix the issue
+skip_next_test
requires_gnutls_tls1_3
requires_config_enabled MBEDTLS_DEBUG_C
requires_config_enabled MBEDTLS_SSL_CLI_C
|
util: Remove unnecessary halt in gdbinit
The reset on the line before is sufficient.
BRANCH=none
TEST=none | @@ -70,8 +70,6 @@ define target hookpost-remote
load {EC_DIR}/build/{BOARD}/{BIN_DIR}/{BIN_NAME}.obj
echo \ Resetting target
monitor reset
- echo \ Halting target
- monitor halt
echo \ Setting breakpoint on main
b main
end\n
|
sysdeps/managarm: Implement SETPROPERTY DRM ioctl | @@ -2116,6 +2116,39 @@ int sys_ioctl(int fd, unsigned long request, void *arg, int *result) {
*result = 0;
return 0;
}
+ case DRM_IOCTL_MODE_SETPROPERTY: {
+ auto param = reinterpret_cast<drm_mode_connector_set_property *>(arg);
+
+ managarm::fs::CntRequest<MemoryAllocator> req(getSysdepsAllocator());
+ req.set_req_type(managarm::fs::CntReqType::PT_IOCTL);
+ req.set_command(request);
+ req.set_drm_property_id(param->prop_id);
+ req.set_drm_property_value(param->value);
+ req.set_drm_obj_id(param->connector_id);
+
+ auto [offer, send_req, recv_resp] = exchangeMsgsSync(
+ handle,
+ helix_ng::offer(
+ helix_ng::sendBragiHeadOnly(req, getSysdepsAllocator()),
+ helix_ng::recvInline())
+ );
+ HEL_CHECK(offer.error());
+ HEL_CHECK(send_req.error());
+ HEL_CHECK(recv_resp.error());
+
+ managarm::fs::SvrResponse<MemoryAllocator> resp(getSysdepsAllocator());
+ resp.ParseFromArray(recv_resp.data(), recv_resp.length());
+
+ if(resp.error() != managarm::fs::Errors::SUCCESS) {
+ mlibc::infoLogger() << "\e[31mmlibc: DRM_IOCTL_MODE_SETPROPERTY(" << param->prop_id << ") error " << (int) resp.error() << "\e[39m"
+ << frg::endlog;
+ *result = 0;
+ return EINVAL;
+ }
+
+ *result = 0;
+ return 0;
+ }
case DRM_IOCTL_MODE_GETPLANERESOURCES: {
auto param = reinterpret_cast<drm_mode_get_plane_res *>(arg);
|
Gate memchr call behind a check on the lenght of the list
This gets rid of an ASAN UB warning:
```
/build/src/main.c:445:16: runtime error: null pointer passed as argument 1, which is declared to never be null
/usr/include/string.h:93:34: note: nonnull attribute specified here
``` | @@ -392,7 +392,8 @@ static int on_client_hello_ptls(ptls_on_client_hello_t *_self, ptls_t *tls, ptls
}
/* switch to raw public key context if requested and available */
- if (memchr(params->server_certificate_types.list, PTLS_CERTIFICATE_TYPE_RAW_PUBLIC_KEY,
+ if (params->server_certificate_types.count > 0
+ && memchr(params->server_certificate_types.list, PTLS_CERTIFICATE_TYPE_RAW_PUBLIC_KEY,
params->server_certificate_types.count) != NULL) {
if (ssl_config->alternate_ptls_ctx != NULL) {
assert(ssl_config->alternate_ptls_ctx->use_raw_public_keys);
|
[LoongArch64] Also amend the tdep_init_done within `Gglobal.c`. | @@ -27,7 +27,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "dwarf_i.h"
HIDDEN define_lock (loongarch64_lock);
-HIDDEN int tdep_init_done;
+HIDDEN atomic_bool tdep_init_done;
HIDDEN void
tdep_init (void)
|
OpenCorePlatform: Fix partial platform data update | @@ -718,7 +718,6 @@ OcLoadPlatformSupport (
ExposeOem = (Config->Misc.Security.ExposeSensitiveData & OCS_EXPOSE_OEM_INFO) != 0;
- if (ExposeOem || Config->PlatformInfo.UpdateSmbios) {
Status = OcSmbiosTablePrepare (&SmbiosTable);
if (!EFI_ERROR (Status)) {
OcSmbiosExtractOemInfo (
@@ -731,8 +730,23 @@ OcLoadPlatformSupport (
Config->PlatformInfo.UseRawUuidEncoding,
ExposeOem
);
+ } else {
+ UseOemSerial = FALSE;
+ UseOemUuid = FALSE;
+ UseOemMlb = FALSE;
+ UseOemRom = FALSE;
+ }
+
+ DEBUG ((
+ DEBUG_INFO,
+ "OC: PlatformInfo auto %d OEM SN %d OEM UUID %d OEM MLB %d OEM ROM %d\n",
+ Config->PlatformInfo.Automatic,
+ UseOemSerial,
+ UseOemUuid,
+ UseOemMlb,
+ UseOemRom
+ ));
- if (Config->PlatformInfo.UpdateSmbios) {
if (Config->PlatformInfo.Automatic) {
if (!UseOemSerial) {
AsciiStrCpyS (
@@ -762,6 +776,8 @@ OcLoadPlatformSupport (
}
}
+ if (!EFI_ERROR (Status)) {
+ if (Config->PlatformInfo.UpdateSMBIOS) {
SmbiosUpdateMode = OcSmbiosGetUpdateMode (
OC_BLOB_GET (&Config->PlatformInfo.UpdateSmbiosMode)
);
@@ -778,7 +794,6 @@ OcLoadPlatformSupport (
} else {
DEBUG ((DEBUG_WARN, "OC: Unable to obtain SMBIOS - %r\n", Status));
}
- }
if (Config->PlatformInfo.UpdateDataHub) {
OcPlatformUpdateDataHub (Config, CpuInfo, UsedMacInfo);
|
Fix name_filter limitation | @@ -1267,7 +1267,7 @@ Value name_filter(const Array& params, bool fHelp)
oName.push_back(Pair("name", name));
string value = stringFromVch(txName.vchValue);
- oName.push_back(Pair("value", limitString(value, 300, "\n...(value too large - use name_show to see full value)")));
+ oName.push_back(Pair("value", limitString(value, -1, "\n...(value too large - use name_show to see full value)")));
oName.push_back(Pair("registered_at", nHeight)); // pos = 2 in comparison function (above name_filter)
|
Remove dead code
We have a step to run gpinitstandby in mgmt_utils.py. Removing this code
to make it more likely that we standardize on using the step in
mgmt_utils.py. | @@ -4,20 +4,6 @@ import socket
import inspect
from gppylib.commands.base import Command
-class GpInitStandby(Command):
- """This is a wrapper for gpinitstandby."""
- def __init__(self, standby_host, mdd=None):
- if not mdd:
- mdd = os.getenv('MASTER_DATA_DIRECTORY')
- cmd_str = 'export MASTER_DATA_DIRECTORY=%s; gpinitstandby -a -s %s' % (mdd, standby_host)
- Command.__init__(self, 'run gpinitstandby', cmd_str)
-
- def run(self, validate=True):
- print "Running gpinitstandby: %s" % self
- Command.run(self, validateAfter=validate)
- result = self.get_results()
- return result
-
class GpSegInstall(Command):
"""
This is a wrapper for gpseginstall
@@ -64,7 +50,7 @@ class GpDeleteSystem(Command):
class TestCluster:
- def __init__(self, hosts = None, base_dir = '/tmp/default_gpinitsystem', standby_enabled = False):
+ def __init__(self, hosts = None, base_dir = '/tmp/default_gpinitsystem'):
"""
hosts: lists of cluster hosts. master host will be assumed to be the first element.
base_dir: cluster directory
@@ -102,7 +88,6 @@ class TestCluster:
self.mirror_enabled = False
self.number_of_segments = 2
self.number_of_hosts = len(self.hosts)-1
- self.standby_enabled = standby_enabled
self.number_of_expansion_hosts = 0
self.number_of_expansion_segments = 0
@@ -152,8 +137,6 @@ class TestCluster:
# run gpinitsystem
clean_env = 'unset MASTER_DATA_DIRECTORY; unset PGPORT;'
gpinitsystem_cmd = clean_env + 'gpinitsystem -a -c %s ' % (self.init_file)
- if self.standby_enabled:
- gpinitsystem_cmd += ' -s {} -P {} '.format(self.hosts[0], int(self.master_port)+1)
res = run_shell_command(gpinitsystem_cmd, 'run gpinitsystem', verbose=True)
# initsystem returns 1 for warnings and 2 for errors
if res['rc'] > 1:
|
adjust environment variables to current Makefile | @@ -35,7 +35,7 @@ echo "ENV: "
env | grep -i rpm
echo "PWD"
pwd
-make install INSTALL_PATH=${RPM_BUILD_ROOT}/usr MAN_PATH=${RPM_BUILD_ROOT}/usr/share/man CONFIG_PATH=${RPM_BUILD_ROOT}/etc
+make install BIN_PATH=${RPM_BUILD_ROOT}/usr MAN_PATH=${RPM_BUILD_ROOT}/usr/share/man CONFIG_PATH=${RPM_BUILD_ROOT}/etc
%files
%defattr(-,root,root,-)
|
Reset default scroll and zoom in sample project | "startY": 0,
"showCollisions": true,
"showConnections": true,
- "worldScrollX": 215,
+ "worldScrollX": 0,
"worldScrollY": 0,
- "zoom": 200,
+ "zoom": 100,
"customColorsEnabled": true,
"defaultBackgroundPaletteIds": [
"default-bg-1",
|
memleak: fix false positive on failed allocations
memleak tool reports a failed allocation as a leak,
because the NULL address is never freed. | @@ -209,10 +209,12 @@ static inline int gen_alloc_exit2(struct pt_regs *ctx, u64 address) {
info.size = *size64;
sizes.delete(&pid);
+ if (address != 0) {
info.timestamp_ns = bpf_ktime_get_ns();
info.stack_id = stack_traces.get_stackid(ctx, STACK_FLAGS);
allocs.update(&address, &info);
update_statistics_add(info.stack_id, info.size);
+ }
if (SHOULD_PRINT) {
bpf_trace_printk("alloc exited, size = %lu, result = %lx\\n",
|
[chainmaker][#436]add tests test_03Contract_0008QueryFailureTxNull | @@ -141,12 +141,7 @@ START_TEST(test_03Contract_0003InvokeFailureContractNull)
ck_assert_int_eq(result, BOAT_SUCCESS);
result = BoatHlchainmakerContractInvoke(&tx_ptr, "save", NULL, true, &invoke_reponse); ;
- ck_assert(result == BOAT_SUCCESS);
- if (result == BOAT_SUCCESS)
- {
- ck_assert(invoke_reponse.code == BOAT_SUCCESS);
- ck_assert(invoke_reponse.gas_used == 0);
- }
+ ck_assert(result == BOAT_ERROR_INVALID_ARGUMENT);
}
END_TEST
@@ -221,6 +216,17 @@ START_TEST(test_03Contract_0007InvokeSucessSyncOff)
}
END_TEST
+START_TEST(test_03Contract_0008QueryFailureTxNull)
+{
+ BOAT_RESULT result;
+ BoatHlchainmakerTx tx_ptr;
+ BoatInvokeReponse invoke_reponse;
+
+ result = BoatHlchainmakerContractInvoke(NULL, "save", "fact", true, &invoke_reponse); ;
+ ck_assert(result == BOAT_ERROR_INVALID_ARGUMENT);
+}
+END_TEST
+
Suite *make_contract_suite(void)
{
/* Create Suite */
@@ -240,6 +246,9 @@ Suite *make_contract_suite(void)
tcase_add_test(tc_contract_api, test_03Contract_0006InvokeSucessSyncOn);
tcase_add_test(tc_contract_api, test_03Contract_0007InvokeSucessSyncOff);
+ tcase_add_test(tc_contract_api, test_03Contract_0008QueryFailureTxNull);
+
+
return s_contract;
|
improved warning: do not set monitor mode by third party tools (iwconfig, iw, airmon-ng) | @@ -7493,7 +7493,7 @@ printf("%s %s (C) %s ZeroBeat\n"
" press GPIO button to terminate hcxdumptool\n"
" hardware modification is necessary, read more:\n"
" https://github.com/ZerBea/hcxdumptool/tree/master/docs\n"
- " do not set monitor mode by third party tools\n"
+ " do not set monitor mode by third party tools (iwconfig, iw, airmon-ng)\n"
" do not run hcxdumptool on logical (NETLINK) interfaces (monx, wlanxmon)\n"
" do not run hcxdumptool in combination with tools (channel hopper), that take access to the interface (except: tshark, wireshark, tcpdump)\n"
"\n"
|
[scripts] Also benchmark 2-Hive configuration | @@ -11,7 +11,7 @@ if [[ ! -f $app ]]; then
fi
# Run all three scenarios
-scenarios=('Original' '1Hive' '4Hives')
+scenarios=('Original' '1Hive' '2Hives' '4Hives')
for scenario in "${scenarios[@]}"; do
echo $scenario
# Do some changes to get the correct HW state
@@ -23,6 +23,8 @@ for scenario in "${scenarios[@]}"; do
num_hives=0
elif [[ "$scenario" == "1Hive" ]]; then
num_hives=1
+ elif [[ "$scenario" == "2Hives" ]]; then
+ num_hives=2
else
num_hives=4
fi
|
Fixed issue where restoring from disk would increment MAX.TS. | @@ -3001,6 +3001,18 @@ inc_cache_ii32 (GKHashStorage * store, GModule module, GSMetric metric, uint32_t
return inc_ii32 (cache, ckey, kh_val (hash, k));
}
+static int
+ins_cache_iu64 (GKHashStorage * store, GModule module, GSMetric metric, uint32_t key,
+ uint32_t ckey) {
+ khash_t (iu64) * hash = get_hash_from_store (store, module, metric);
+ khash_t (iu64) * cache = get_hash_from_cache (module, metric);
+ khint_t k;
+
+ if ((k = kh_get (iu64, hash, key)) == kh_end (hash))
+ return -1;
+ return ins_iu64 (cache, ckey, kh_val (hash, k));
+}
+
static int
inc_cache_iu64 (GKHashStorage * store, GModule module, GSMetric metric, uint32_t key,
uint32_t ckey) {
@@ -3048,7 +3060,7 @@ ins_raw_num_data (GModule module, uint32_t date) {
inc_cache_ii32 (store, module, MTRC_VISITORS, kh_val (kmap, k), ckey);
inc_cache_iu64 (store, module, MTRC_BW, kh_val (kmap, k), ckey);
inc_cache_iu64 (store, module, MTRC_CUMTS, kh_val (kmap, k), ckey);
- inc_cache_iu64 (store, module, MTRC_MAXTS, kh_val (kmap, k), ckey);
+ ins_cache_iu64 (store, module, MTRC_MAXTS, kh_val (kmap, k), ckey);
ins_cache_is32 (store, module, MTRC_METHODS, kh_val (kmap, k), ckey);
ins_cache_is32 (store, module, MTRC_PROTOCOLS, kh_val (kmap, k), ckey);
}
|
userintr: check passed cond id | @@ -43,9 +43,14 @@ int userintr_setHandler(unsigned int n, int (*f)(unsigned int, void *), void *ar
if (p != NULL) {
r->inth->pmap = &p->mapp->pmap;
- if (cond > 0 && ((t = resource_get(p, cond)) != NULL))
+ if (cond > 0) {
+ if ((t = resource_get(p, cond)) == NULL) {
+ resource_free(r);
+ return -EINVAL;
+ }
r->inth->cond = &t->waitq;
}
+ }
if ((res = hal_interruptsSetHandler(r->inth)) != EOK) {
resource_free(r);
|
srpd_rotation BUGFIX string format check added | @@ -374,9 +374,15 @@ srpd_rotation_change_cb(sr_session_ctx_t *session, uint32_t sub_id, const char *
} else if (!strcmp(node->schema->name, "output-dir")) {
/* safe update of the output_folder (srpd_rotation_loop() reads output_folder!) */
temp = ATOMIC_PTR_LOAD_RELAXED(opts->output_folder);
- dir_str = strdup(lyd_get_value(node));
- if (!dir_str) {
- SRPLG_LOG_ERR("srpd_rotation", "strdup() failed (%s:%d)", __FILE__, __LINE__);
+
+ /* check whether there is a '/' at the end to further append other strings */
+ if (lyd_get_value(node)[strlen(lyd_get_value(node)) - 1] != '/') {
+ rc = asprintf(&dir_str, "%s/", lyd_get_value(node));
+ } else {
+ rc = asprintf(&dir_str, "%s", lyd_get_value(node));
+ }
+ if (rc == -1) {
+ SRPLG_LOG_ERR("srpd_rotation", "asprintf() failed (%s:%d) (%s)", __FILE__, __LINE__, strerror(errno));
goto cleanup;
}
ATOMIC_PTR_STORE_RELAXED(opts->output_folder, dir_str);
|
options/elf: Add more typedefs and structs | @@ -24,6 +24,7 @@ typedef int32_t Elf64_Sword;
typedef uint64_t Elf64_Xword;
typedef int64_t Elf64_Sxword;
typedef uint16_t Elf64_Section;
+typedef Elf64_Half Elf64_Versym;
typedef uint32_t Elf32_Addr;
typedef uint32_t Elf32_Off;
@@ -33,6 +34,7 @@ typedef int32_t Elf32_Sword;
typedef uint64_t Elf32_Xword;
typedef int64_t Elf32_Sxword;
typedef uint16_t Elf32_Section;
+typedef Elf32_Half Elf32_Versym;
#define EI_NIDENT (16)
@@ -70,6 +72,36 @@ typedef struct {
Elf64_Half e_shstrndx; /* Section name string table index */
} Elf64_Ehdr;
+typedef struct {
+ Elf32_Half vd_version; /* Version revision */
+ Elf32_Half vd_flags; /* Version information */
+ Elf32_Half vd_ndx; /* Version Index */
+ Elf32_Half vd_cnt; /* Number of associated aux entries */
+ Elf32_Word vd_hash; /* Version name hash value */
+ Elf32_Word vd_aux; /* Offset in bytes to verdaux array */
+ Elf32_Word vd_next; /* Offset in bytes to next verdef entry */
+} Elf32_Verdef;
+
+typedef struct {
+ Elf64_Half vd_version; /* Version revision */
+ Elf64_Half vd_flags; /* Version information */
+ Elf64_Half vd_ndx; /* Version Index */
+ Elf64_Half vd_cnt; /* Number of associated aux entries */
+ Elf64_Word vd_hash; /* Version name hash value */
+ Elf64_Word vd_aux; /* Offset in bytes to verdaux array */
+ Elf64_Word vd_next; /* Offset in bytes to next verdef entry */
+} Elf64_Verdef;
+
+typedef struct {
+ Elf32_Word vda_name; /* Version or dependency names */
+ Elf32_Word vda_next; /* Offset in bytes to next verdaux entry */
+} Elf32_Verdaux;
+
+typedef struct {
+ Elf64_Word vda_name; /* Version or dependency names */
+ Elf64_Word vda_next; /* Offset in bytes to next verdaux entry */
+} Elf64_Verdaux;
+
enum {
ET_NONE = 0,
ET_REL = 1,
|
Add new quote fields to oecertdump output | @@ -305,14 +305,22 @@ oe_result_t output_sgx_report(const uint8_t* report, size_t report_size)
printf(" cpusvn (hex): ");
oe_hex_dump(report_body->cpusvn, OE_COUNTOF(report_body->cpusvn));
printf(" miscselect: 0x%x\n", report_body->miscselect);
+ printf(" isvextprodid (hex): ");
+ oe_hex_dump(
+ report_body->isvextprodid, OE_COUNTOF(report_body->isvextprodid));
printf(" attributes (hex): ");
oe_hex_dump(&report_body->attributes, sizeof(report_body->attributes));
printf(" mrenclave (hex): ");
- oe_hex_dump(report_body->mrenclave, sizeof(report_body->mrenclave));
+ oe_hex_dump(report_body->mrenclave, OE_COUNTOF(report_body->mrenclave));
printf(" mrsigner (hex): ");
- oe_hex_dump(report_body->mrsigner, sizeof(report_body->mrsigner));
+ oe_hex_dump(report_body->mrsigner, OE_COUNTOF(report_body->mrsigner));
+ printf(" configid (hex): ");
+ oe_hex_dump(report_body->configid, OE_COUNTOF(report_body->configid));
printf(" isvprodid: 0x%x\n", report_body->isvprodid);
printf(" isvsvn: 0x%x\n", report_body->isvsvn);
+ printf(" configsvn: 0x%x\n", report_body->configsvn);
+ printf(" isvfamilyid (hex): ");
+ oe_hex_dump(report_body->isvfamilyid, OE_COUNTOF(report_body->isvfamilyid));
printf(" report_data (hex): ");
oe_hex_dump(&report_body->report_data, sizeof(report_body->report_data));
printf(" } report_body\n");
@@ -337,9 +345,10 @@ oe_result_t output_sgx_report(const uint8_t* report, size_t report_size)
oe_hex_dump(
&qe_report_body->attributes, sizeof(qe_report_body->attributes));
printf(" mrenclave (hex): ");
- oe_hex_dump(qe_report_body->mrenclave, sizeof(qe_report_body->mrenclave));
+ oe_hex_dump(
+ qe_report_body->mrenclave, OE_COUNTOF(qe_report_body->mrenclave));
printf(" mrsigner (hex): ");
- oe_hex_dump(qe_report_body->mrsigner, sizeof(qe_report_body->mrsigner));
+ oe_hex_dump(qe_report_body->mrsigner, OE_COUNTOF(qe_report_body->mrsigner));
printf(" isvprodid: 0x%x\n", qe_report_body->isvprodid);
printf(" isvsvn: 0x%x\n", qe_report_body->isvsvn);
printf(" report_data (hex): ");
|
Favorites API uses json body for delete
Moved favorites delete API from using in URL ID to using a json body to provide the ID
Favorite ID are URL and therefore are not suited to be passed through URLs. | @@ -55,7 +55,8 @@ public class Favorites {
final JSONObject jsonResponse = new JSONObject();
final DatafariMainConfiguration config = DatafariMainConfiguration.getInstance();
if (config.getProperty(DatafariMainConfiguration.LIKESANDFAVORTES).contentEquals("false")) {
- // Likes and favorites are not activated, build an error response with a 503 code and not activated reason
+ // Likes and favorites are not activated, build an error response with a 503
+ // code and not activated reason
JSONObject extra = new JSONObject();
extra.put("details", "Feature not activated");
return RestAPIUtils.buildErrorResponse(503, "Service unavailable", extra);
@@ -91,7 +92,8 @@ public class Favorites {
if (authenticatedUserName != null) {
final DatafariMainConfiguration config = DatafariMainConfiguration.getInstance();
if (config.getProperty(DatafariMainConfiguration.LIKESANDFAVORTES).contentEquals("false")) {
- // Likes and favorites are not activated, build an error response with a 503 code and not activated reason
+ // Likes and favorites are not activated, build an error response with a 503
+ // code and not activated reason
JSONObject extra = new JSONObject();
extra.put("details", "Feature not activated");
return RestAPIUtils.buildErrorResponse(503, "Service unavailable", extra);
@@ -119,23 +121,27 @@ public class Favorites {
}
}
- @DeleteMapping(value = "/rest/v1.0/users/current/favorites/{favoriteID}", produces = "application/json;charset=UTF-8")
+ @DeleteMapping(value = "/rest/v1.0/users/current/favorites", produces = "application/json;charset=UTF-8", consumes = "application/json;charset=UTF-8")
public String removeFavorite(final HttpServletRequest request, final HttpServletResponse response,
- @PathVariable("favoriteID") String favoriteID) {
+ @RequestBody String jsonParam) {
final String authenticatedUserName = AuthenticatedUserName.getName(request);
if (authenticatedUserName != null) {
final DatafariMainConfiguration config = DatafariMainConfiguration.getInstance();
if (config.getProperty(DatafariMainConfiguration.LIKESANDFAVORTES).contentEquals("false")) {
- // Likes and favorites are not activated, build an error response with a 503 code and not activated reason
+ // Likes and favorites are not activated, build an error response with a 503
+ // code and not activated reason
JSONObject extra = new JSONObject();
extra.put("details", "Feature not activated");
return RestAPIUtils.buildErrorResponse(503, "Service unavailable", extra);
}
try {
+ final JSONParser parser = new JSONParser();
+ try {
+ JSONObject params = (JSONObject) parser.parse(jsonParam);
+ String favoriteID = (String) params.get("id");
String[] favoriteIDArray = { favoriteID };
List<String> favorites = Favorite.getFavorites(authenticatedUserName, favoriteIDArray);
if (favorites.size() == 1) {
- final JSONParser parser = new JSONParser();
try {
final JSONObject content = (JSONObject) parser.parse(favorites.get(0));
Favorite.deleteFavorite(authenticatedUserName, favoriteID);
@@ -149,6 +155,9 @@ public class Favorites {
// Cannot delete something that is not there
throw new DataNotFoundException(
"Couldn't find favorite with id " + favoriteID + " for the current user.");
+ } catch (ParseException e) {
+ throw new BadRequestException("Couldn't parse the JSON body");
+ }
} catch (DatafariServerException e) {
throw new InternalErrorException("Unexpected error while deleting favorite.");
}
|
mysqlclient-python was added | @@ -165,7 +165,8 @@ ALLOW yabs/amazon/cache_proxy -> contrib/python/toredis
ALLOW yql/udfs/common/python/python_arc -> contrib/python/toredis
DENY .* -> contrib/python/toredis
-# contrib/python/MySQL-python dosen't support Python 3, use pymysql instead of this.
+# contrib/python/MySQL-python dosen't support Python 3, use mysqlclient-python
+# or pymysql instead of this.
ALLOW adfox/amacs/tests/functional/libs/builders -> contrib/python/MySQL-python
ALLOW adfox/amacs/tests/functional/libs/config -> contrib/python/MySQL-python
ALLOW adfox/amacs/tests/functional/libs/db -> contrib/python/MySQL-python
|
bn/bn_lib.c: make BN_bn2binpad computationally constant-time.
"Computationally constant-time" means that it might still leak
information about input's length, but only in cases when input
is missing complete BN_ULONG limbs. But even then leak is possible
only if attacker can observe memory access pattern with limb
granularity. | #include "internal/cryptlib.h"
#include "bn_lcl.h"
#include <openssl/opensslconf.h>
+#include "internal/constant_time_locl.h"
/* This stuff appears to be completely unused, so is deprecated */
#if OPENSSL_API_COMPAT < 0x00908000L
@@ -416,24 +417,30 @@ BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
/* ignore negative */
static int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen)
{
- int i;
+ int i, j, top;
BN_ULONG l;
- bn_check_top(a);
i = BN_num_bytes(a);
if (tolen == -1)
tolen = i;
else if (tolen < i)
return -1;
- /* Add leading zeroes if necessary */
- if (tolen > i) {
- memset(to, 0, tolen - i);
- to += tolen - i;
+
+ if (i == 0) {
+ OPENSSL_cleanse(to, tolen);
+ return tolen;
}
- while (i--) {
+
+ top = a->top * BN_BYTES;
+ for (i = 0, j = tolen; j > 0; i++) {
+ unsigned int mask;
+
+ mask = constant_time_lt(i, top);
+ i -= 1 & ~mask; /* stay on top limb */
l = a->d[i / BN_BYTES];
- *(to++) = (unsigned char)(l >> (8 * (i % BN_BYTES))) & 0xff;
+ to[--j] = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask);
}
+
return tolen;
}
|
VERSION bump to version 1.4.28 | @@ -31,7 +31,7 @@ endif()
# micro version is changed with a set of small changes or bugfixes anywhere in the project.
set(SYSREPO_MAJOR_VERSION 1)
set(SYSREPO_MINOR_VERSION 4)
-set(SYSREPO_MICRO_VERSION 27)
+set(SYSREPO_MICRO_VERSION 28)
set(SYSREPO_VERSION ${SYSREPO_MAJOR_VERSION}.${SYSREPO_MINOR_VERSION}.${SYSREPO_MICRO_VERSION})
# Version of the library
|
server: updated TLS usage and grouped TLS initialization in an instance safe way | #include <monkey/mk_scheduler.h>
#include <monkey/mk_plugin.h>
#include <monkey/mk_clock.h>
+#include <monkey/mk_thread.h>
#include <monkey/mk_mimetype.h>
+#include <monkey/mk_http_thread.h>
pthread_once_t mk_server_tls_setup_once = PTHREAD_ONCE_INIT;
static void mk_set_up_tls_keys()
{
- MK_TLS_INIT();
- mk_thread_keys_init();
+ MK_INIT_INITIALIZE_TLS_UNIVERSAL();
+ MK_INIT_INITIALIZE_TLS();
+
+ mk_http_thread_initialize_tls();
}
void mk_server_info(struct mk_server *server)
@@ -130,6 +134,9 @@ struct mk_server *mk_server_create()
mk_core_init();
+ /* Init thread keys */
+ pthread_once(&mk_server_tls_setup_once, mk_set_up_tls_keys);
+
/* Init Kernel version data */
kern_version = mk_kernel_version();
kern_features = mk_kernel_features(kern_version);
@@ -150,6 +157,8 @@ struct mk_server *mk_server_create()
mk_mimetype_init(server);
+ pthread_mutex_init(&server->vhost_fdt_mutex, NULL);
+
return server;
}
@@ -178,9 +187,6 @@ int mk_server_setup(struct mk_server *server)
return -1;
}
- /* Init thread keys */
- pthread_once(&mk_server_tls_setup_once, mk_set_up_tls_keys);
-
/* Configuration sanity check */
mk_config_sanity_check(server);
@@ -193,14 +199,6 @@ int mk_server_setup(struct mk_server *server)
return 0;
}
-
-void mk_thread_keys_init(void)
-{
- /* Create thread keys */
- pthread_key_create(&mk_utils_error_key, NULL);
-}
-
-
void mk_exit_all(struct mk_server *server)
{
uint64_t val;
|
Fix celix cxx14/17 option in conanfile.py | @@ -163,8 +163,9 @@ class CelixConan(ConanFile):
if opt.startswith('build_'):
setattr(self.options, opt, True)
if not self.options.celix_cxx14:
- self.options.build_cxx_remote_service_admin = False
+ self.options.celix_cxx17 = false
if not self.options.celix_cxx17:
+ self.options.build_cxx_remote_service_admin = False
self.options.build_promises = False
self.options.build_pushstreams = False
if not self.options.build_cxx_remote_service_admin:
|
Retry when we get a mixed up packet.
There's better ways to do this, but we can fix that when
we make this sanely multithreaded and get rid of the big
lock. | @@ -325,14 +325,15 @@ const tquery = {srv, host, t
const rquery = {srv, host, id
var pktbuf : byte[1024]
- var pkt
- var pfd
- var r, n
+ var pkt, pfd, giveup
+ var r, n, inf
+ giveup = std.now() + 1000*Timeout
+:again
pfd = [
[.fd=srv, .events=sys.Pollin, .revents=0]
][:]
- r = sys.poll(pfd[:], Timeout)
+ r = sys.poll(pfd[:], (std.now() - giveup : int)/1000)
if r < 0
-> `Err `Badconn
elif r == 0
@@ -343,7 +344,13 @@ const rquery = {srv, host, id
-> `Err `Badconn
;;
pkt = pktbuf[:n]
- -> hosts(pkt, host, id)
+ inf = hosts(pkt, host, id)
+ match inf
+ | `std.Err `Badresp:
+ goto again
+ | _:
+ -> inf
+ ;;
;;
}
|
Add pss_rsae sig algs into test conf | @@ -263,12 +263,24 @@ int send_cb( void *ctx, unsigned char const *buf, size_t len )
#if defined(MBEDTLS_X509_CRT_PARSE_C)
#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_RSA_C)
+#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
#define MBEDTLS_SSL_SIG_ALG( hash ) (( hash << 8 ) | MBEDTLS_SSL_SIG_ECDSA), \
+ ( 0x800 | hash ), \
(( hash << 8 ) | MBEDTLS_SSL_SIG_RSA),
+
+#else
+#define MBEDTLS_SSL_SIG_ALG( hash ) (( hash << 8 ) | MBEDTLS_SSL_SIG_ECDSA), \
+ (( hash << 8 ) | MBEDTLS_SSL_SIG_RSA),
+#endif
#elif defined(MBEDTLS_ECDSA_C)
#define MBEDTLS_SSL_SIG_ALG( hash ) (( hash << 8 ) | MBEDTLS_SSL_SIG_ECDSA),
#elif defined(MBEDTLS_RSA_C)
+#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
+#define MBEDTLS_SSL_SIG_ALG( hash ) ( 0x800 | hash ), \
+ (( hash << 8 ) | MBEDTLS_SSL_SIG_RSA),
+#else
#define MBEDTLS_SSL_SIG_ALG( hash ) (( hash << 8 ) | MBEDTLS_SSL_SIG_RSA),
+#endif
#else
#define MBEDTLS_SSL_SIG_ALG( hash )
#endif
|
decapitate peel:ut | */
#include "all.h"
-
-/* logic
-*/
u3_noun
_cqfu_peel(u3_noun van,
u3_noun sut,
u3_noun way,
- u3_noun met)
+ u3_noun axe)
{
- if ( c3__gold == met ) {
- return u3nc(c3y, c3y);
- }
- else switch ( way ) {
- default: return u3m_bail(c3__fail);
+ u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
+ u3_noun gat = u3j_cook("_cqfu_peel-peel", von, "peel");
- case c3__both: return u3nc(c3n, c3n);
- case c3__free: return u3nc(c3y, c3y);
- case c3__read: return u3nc(((met == c3__zinc) ? c3y : c3n), c3n);
- case c3__rite: return u3nc(((met == c3__iron) ? c3y : c3n), c3n);
- }
+ gat = u3i_molt(gat, u3x_sam_2, u3k(way), u3x_sam_3, u3k(axe), 0);
+
+ return u3n_nock_on(gat, u3k(u3x_at(u3x_bat, gat)));
}
/* boilerplate
u3_noun
u3wfu_peel(u3_noun cor)
{
- u3_noun sut, way, met, van;
+ u3_noun sut, way, axe, van;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &way,
- u3x_sam_3, &met,
+ u3x_sam_3, &axe,
u3x_con, &van,
0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
- return _cqfu_peel(van, sut, way, met);
+ return u3qfu_peel(van, sut, way, axe);
}
}
u3qfu_peel(u3_noun van,
u3_noun sut,
u3_noun way,
- u3_noun met)
+ u3_noun axe)
{
- return _cqfu_peel(van, sut, way, met);
+ return _cqfu_peel(van, sut, way, axe);
}
|
bleprph-emspi - Replace stub console with full. | @@ -37,7 +37,7 @@ pkg.deps:
- net/nimble/host/services/gatt
- net/nimble/host/store/config
- net/nimble/transport/emspi
- - sys/console/stub
+ - sys/console/full
- sys/id
- sys/log/full
- sys/stats/full
|
Fix potentional problem with dummy persistence. | @@ -757,7 +757,7 @@ namespace Miningcore
// register repositories
builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
.Where(t =>
- t.Namespace.StartsWith(typeof(ShareRepository).Namespace))
+ t?.Namespace?.StartsWith(typeof(ShareRepository).Namespace) == true)
.AsImplementedInterfaces()
.SingleInstance();
}
|
Fix doc/benchmarks.md typos | @@ -163,7 +163,7 @@ The `full_init` vs `part_init` suffixes are whether
is unset or set.
The libgif library doesn't export any API for decode-to-BGRA or decode-to-RGBA,
-so there are mimic numbers to compare to for the `bgra` suffix.
+so there are no mimic numbers to compare to for the `bgra` suffix.
name speed vs_mimic
@@ -229,7 +229,7 @@ To reproduce these numbers:
For comparison, here are Rust 1.37.0's numbers, using the
[image-rs/image-gif](https://github.com/image-rs/image-gif) crate, easily the
-top result for [crates.io 'gif'](https://crates.io/search?q=gif).
+top `crates.io` result for ["gif"](https://crates.io/search?q=gif).
name speed vs_mimic
|
Calculate satd cost for whole non-square blocks as well. | @@ -1308,7 +1308,6 @@ static void search_pu_inter_bipred(inter_search_info_t *info,
const image_list_t *const ref = info->state->frame->ref;
uint8_t (*ref_LX)[16] = info->state->frame->ref_LX;
const videoframe_t * const frame = info->state->tile->frame;
- const int cu_width = LCU_WIDTH >> depth;
const int x = info->origin.x;
const int y = info->origin.y;
const int width = info->width;
@@ -1361,7 +1360,7 @@ static void search_pu_inter_bipred(inter_search_info_t *info,
const kvz_pixel *rec = &lcu->rec.y[SUB_SCU(y) * LCU_WIDTH + SUB_SCU(x)];
const kvz_pixel *src = &frame->source->y[x + y * frame->source->width];
uint32_t cost =
- kvz_satd_any_size(cu_width, cu_width, rec, LCU_WIDTH, src, frame->source->width);
+ kvz_satd_any_size(width, height, rec, LCU_WIDTH, src, frame->source->width);
uint32_t bitcost[2] = { 0, 0 };
|
config_tools: update clang-format file
Remove the AlwaysBreakTemplateDeclarations setting in clang-format file
to fix the issue about "make defconfig". | @@ -17,7 +17,6 @@ AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
|
Run go5 test several times | @@ -35,6 +35,8 @@ coroutine void dummy(void) {
}
int main() {
+ int i;
+ for(i = 0; i != 5; ++i) {
/* Test go_mem. */
char *stack = malloc(65536);
assert(stack);
@@ -45,7 +47,7 @@ int main() {
rc = hclose(cr);
errno_assert(rc == 0);
free(stack);
-
+ }
return 0;
}
|
rework gui->set_scale() | @@ -50,7 +50,7 @@ static CLAP_CONSTEXPR const char CLAP_EXT_GUI[] = "clap.gui";
// embed using https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setparent
static const CLAP_CONSTEXPR char CLAP_WINDOW_API_WIN32[] = "win32";
-// uses logical size
+// uses logical size, don't call clap_plugin_gui->set_scale()
static const CLAP_CONSTEXPR char CLAP_WINDOW_API_COCOA[] = "cocoa";
// uses physical size
@@ -117,12 +117,13 @@ typedef struct clap_plugin_gui {
void (*destroy)(const clap_plugin_t *plugin);
// Set the absolute GUI scaling factor, and override any OS info.
+ // Should not be used if the windowing api relies upon logical pixels.
+ //
// If the plugin prefers to work out the scaling factor itself by querying the OS directly,
- // then return false and ignore the call.
+ // then ignore the call.
//
- // Return true on success.
- // [main-thread,optional]
- bool (*set_scale)(const clap_plugin_t *plugin, double scale);
+ // [main-thread]
+ void (*set_scale)(const clap_plugin_t *plugin, double scale);
// Get the current size of the plugin UI.
// clap_plugin_gui->create() must have been called prior to asking the size.
|
another round of +cue comments | @@ -89,13 +89,12 @@ u3qe_cue(u3_atom a)
//
u3_atom cur = 0;
- // the bitwidth and produce from reading at cursor
+ // the bitwidth and product from reading at cursor
//
u3_atom wid, pro;
// read from atom at cursor
- // push on to the stack and continue (cell-head recursion)
- // or set .wid and .pro and goto give
+ //
// TRANSFER .cur
//
pass: {
@@ -105,6 +104,8 @@ u3qe_cue(u3_atom a)
// low bit unset, (1 + cur) points to an atom
//
+ // produce atom and the width we read
+ //
if ( 0 == tag_y ) {
u3_noun bur;
{
@@ -131,6 +132,8 @@ u3qe_cue(u3_atom a)
// next bit set, (2 + cur) points to a backref
//
+ // produce referenced value and the width we read
+ //
if ( 1 == tag_y ) {
u3_noun bur;
{
@@ -153,6 +156,8 @@ u3qe_cue(u3_atom a)
// next bit unset, (2 + cur) points to the head of a cell
//
+ // push a frame to mark HEAD recursion and read the head
+ //
{
_cue_push(mov, off, CUE_HEAD, cur, 0, 0);
@@ -161,11 +166,10 @@ u3qe_cue(u3_atom a)
}
}
- // pop off the stack and read from .wid and .pro
- // push on to the stack and goto pass (cell-tail recursion)
- // or pop the stack and continue (goto give)
+ // consume: popped stack frame, .wid and .pro from above.
+ //
// TRANSFER .wid, .pro, and contents of .fam_u
- // NOTE: .cur is in scope, but we have already lost our reference to it
+ // (.cur is in scope, but we have already lost our reference to it)
//
give: {
cueframe fam_u = _cue_pop(mov, off);
@@ -175,14 +179,15 @@ u3qe_cue(u3_atom a)
c3_assert(0);
}
- // fam_u is our stack root, we're done
+ // fam_u is our stack root, we're done.
//
case CUE_ROOT: {
break;
}
- // .wid and .pro are the head of the cell at fam_u.cur,
- // save them on the stack, set the cursor to the tail and rad
+ // .wid and .pro are the head of the cell at fam_u.cur.
+ // save them (and the cell cursor) in a TAIL frame,
+ // set the cursor to the tail and read there.
//
case CUE_HEAD: {
_cue_push(mov, off, CUE_TAIL, fam_u.cur, wid, pro);
@@ -192,8 +197,8 @@ u3qe_cue(u3_atom a)
}
// .wid and .pro are the tail of the cell at fam_u.cur,
- // cons up the cell (and memoize), calculate its total width,
- // and "give" the new value
+ // construct the cell, memoize it, and produce it along with
+ // its total width (as if it were a read from above).
//
case CUE_TAIL: {
pro = u3nc(fam_u.hed, pro);
|
warn harder, with snark | @@ -496,7 +496,8 @@ _dawn_come(u3_noun stars)
c3_rand(eny_w);
eny = u3i_words(16, eny_w);
- fprintf(stderr, "boot: mining a comet. May take up to 30 minutes.\r\n");
+ fprintf(stderr, "boot: mining a comet. May take up to an hour.\r\n");
+ fprintf(stderr, "If you want to boot faster, get an Azimuth point.\r\n");
seed = u3dc("come:dawn", u3k(stars), u3k(eny));
u3z(eny);
|
gitlab/ci: testing installation and linking | @@ -4,13 +4,16 @@ stages: [build, test]
before_script:
- apt-get -qq update && apt-get -qq install -y automake autoconf gcc g++ gcovr make valgrind time curl
-# build from scratch
-compile:
+# build and install from scratch
+install:
stage: build
script:
- ./bootstrap.sh
- ./configure --enable-strict
- make -j4
+ - make install
+ - ldconfig
+ - make check-link
artifacts: # save output objects for test stages
paths: [makefile, configure, config.h, config.h.in]
|
hv: mmu: remove strict check for deleting page table mapping
When we support PCI MSI-X table BAR remapping, we may re-delete the MSI-X table BAR
region. This patch removes strict check for deleting page table mapping. | @@ -96,7 +96,7 @@ static void modify_or_del_pte(const uint64_t *pde, uint64_t vaddr_start, uint64_
for (; index < PTRS_PER_PTE; index++) {
uint64_t *pte = pt_page + index;
- if (mem_ops->pgentry_present(*pte) == 0UL) {
+ if ((mem_ops->pgentry_present(*pte) == 0UL) && (type == MR_MODIFY)) {
ASSERT(false, "invalid op, pte not present");
} else {
local_modify_or_del_pte(pte, prot_set, prot_clr, type, mem_ops);
@@ -127,7 +127,7 @@ static void modify_or_del_pde(const uint64_t *pdpte, uint64_t vaddr_start, uint6
uint64_t *pde = pd_page + index;
uint64_t vaddr_next = (vaddr & PDE_MASK) + PDE_SIZE;
- if (mem_ops->pgentry_present(*pde) == 0UL) {
+ if ((mem_ops->pgentry_present(*pde) == 0UL) && (type == MR_MODIFY)) {
ASSERT(false, "invalid op, pde not present");
} else {
if (pde_large(*pde) != 0UL) {
@@ -170,7 +170,7 @@ static void modify_or_del_pdpte(const uint64_t *pml4e, uint64_t vaddr_start, uin
uint64_t *pdpte = pdpt_page + index;
uint64_t vaddr_next = (vaddr & PDPTE_MASK) + PDPTE_SIZE;
- if (mem_ops->pgentry_present(*pdpte) == 0UL) {
+ if ((mem_ops->pgentry_present(*pdpte) == 0UL) && (type == MR_MODIFY)) {
ASSERT(false, "invalid op, pdpte not present");
} else {
if (pdpte_large(*pdpte) != 0UL) {
@@ -222,7 +222,7 @@ void mmu_modify_or_del(uint64_t *pml4_page, uint64_t vaddr_base, uint64_t size,
while (vaddr < vaddr_end) {
vaddr_next = (vaddr & PML4E_MASK) + PML4E_SIZE;
pml4e = pml4e_offset(pml4_page, vaddr);
- if (mem_ops->pgentry_present(*pml4e) == 0UL) {
+ if ((mem_ops->pgentry_present(*pml4e) == 0UL) && (type == MR_MODIFY)) {
ASSERT(false, "invalid op, pml4e not present");
} else {
modify_or_del_pdpte(pml4e, vaddr, vaddr_end, prot_set, prot_clr, mem_ops, type);
|
[bsp/wch/arm/Libraries/ch32_drivers/drv_rtc_ch32f10x.c]: rename rtc ops. | @@ -106,8 +106,8 @@ const static struct rt_rtc_ops rtc_ops =
.set_secs = ch32f1_set_secs,
.get_alarm = RT_NULL,
.set_alarm = RT_NULL,
- .get_usecs = RT_NULL,
- .set_usecs = RT_NULL};
+ .get_timeval = RT_NULL,
+ .set_timeval = RT_NULL};
int rt_hw_rtc_init(void)
{
|
publish: no-op on some other cases as well | ?: ?=([@ ^] app-path)
~& [%assuming-ported-legacy-publish app-path]
`[%'~' app-path]
- ~| [%weird-publish app-path]
- !!
+ ~&([%weird-publish app-path] ~)
=/ resource-indices
.^ (jug resource group-path)
%gy
=/ groups=(unit (set path))
(~(get by resource-indices) [%publish app-path])
?~ groups ~
- `(snag 0 ~(tap in u.groups))
+ =/ group-paths ~(tap in u.groups)
+ ?~ group-paths ~
+ `i.group-paths
--
::
++ metadata-hook-poke
|
Fix build issues for implicit declaration for `esp_fill_random` | #include <string.h>
#include <stdio.h>
#include <stdbool.h>
-#include <esp_system.h>
+#include <esp_random.h>
/* ToDo - Remove this once appropriate solution is available.
We need to define this for the file as ssl_misc.h uses private structures from mbedtls,
|
Pass the pointer to the factory | @@ -12,20 +12,20 @@ extern "C" {
struct clap_plugin_factory {
/* Get the number of plugins available.
* [thread-safe] */
- uint32_t (*get_plugin_count)(void);
+ uint32_t (*get_plugin_count)(const struct clap_plugin_factory *factory);
/* Retrieves a plugin descriptor by its index.
* Returns null in case of error.
* The descriptor does not need to be freed.
* [thread-safe] */
- const clap_plugin_descriptor *(*get_plugin_descriptor)(uint32_t index);
+ const clap_plugin_descriptor *(*get_plugin_descriptor)(const struct clap_plugin_factory *factory, uint32_t index);
/* Create a clap_plugin by its plugin_id.
* The returned pointer must be freed by calling plugin->destroy(plugin);
* The plugin is not allowed to use the host callbacks in the create method.
* Returns null in case of error.
* [thread-safe] */
- const clap_plugin *(*create_plugin)(const clap_host *host, const char *plugin_id);
+ const clap_plugin *(*create_plugin)(const struct clap_plugin_factory *factory, const clap_host *host, const char *plugin_id);
};
#ifdef __cplusplus
|
netutils/usrsock_rpmsg: Switch the nonblocking mode by psock_ioctl instead
since it's more simpler than psock_ioctl | #include <nuttx/config.h>
#include <errno.h>
-#include <fcntl.h>
#include <poll.h>
#include <pthread.h>
#include <string.h>
#include <sys/eventfd.h>
+#include <sys/ioctl.h>
#include <nuttx/net/dns.h>
#include <nuttx/net/net.h>
@@ -212,14 +212,11 @@ static int usrsock_rpmsg_socket_handler(struct rpmsg_endpoint *ept,
pthread_mutex_lock(&priv->mutex);
if (priv->socks[i].s_conn == NULL)
{
- ret = psock_socket(req->domain, req->type, req->protocol,
- &priv->socks[i]);
+ ret = psock_socket(req->domain, req->type | SOCK_NONBLOCK,
+ req->protocol, &priv->socks[i]);
pthread_mutex_unlock(&priv->mutex);
if (ret >= 0)
{
- psock_fcntl(&priv->socks[i], F_SETFL,
- psock_fcntl(&priv->socks[i], F_GETFL) | O_NONBLOCK);
-
priv->epts[i] = ept;
ret = i; /* Return index as the usockid */
}
@@ -664,9 +661,9 @@ static int usrsock_rpmsg_accept_handler(struct rpmsg_endpoint *ept,
pthread_mutex_unlock(&priv->mutex);
if (ret >= 0)
{
- psock_fcntl(&priv->socks[i], F_SETFL,
- psock_fcntl(&priv->socks[i], F_GETFL) | O_NONBLOCK);
+ int nonblock = 1;
+ psock_ioctl(&priv->socks[i], FIONBIO, &nonblock);
priv->epts[i] = ept;
/* Append index as usockid to the payload */
|
migration: correcting take-migrate ship | ++ on-agent
|= [=wire =sign:agent:gall]
^- (quip card _this)
+ ~& src.bol
=^ cards state
?+ wire [- state]:(on-agent:def wire sign)
[%pyre *] (take-pyre:gc t.wire sign)
- [%gladio @ ~] (take-migrate:gc sign)
+ [%gladio @ ~] (take-migrate:gc (scot %p i.t.wire) sign)
::
[%try-rejoin @ *]
?> ?=(%poke-ack -.sign)
^- (quip card _state)
=^ cards-1=(list card) wait
~(migrate-start gladio bol)
+ ~& wait
=/ cards-2=(list card)
%+ turn ~(tap in wait)
|= =ship
[%pass / %pyre leaf/"{<wire>} failed" u.p.sign]~
::
++ take-migrate
- |= =sign:agent:gall
+ |= [=ship =sign:agent:gall]
^- (quip card _state)
- ~& migrating/src.bol
+ ~& [migrating ship src.bol]
?: ?=(%poke-ack -.sign)
`state
- :_ state(wait (~(del in wait) src.bol))
+ :_ state(wait (~(del in wait) ship))
^- (list card)
- %+ welp (~(migrate-ship gladio bol) src.bol)
+ %+ welp (~(migrate-ship gladio bol) ship)
?: ?=(%kick -.sign) :: TODO: check queued watches don't get kicked
*(list card)
:_ *(list card)
- [%pass /gladio/(scot %p src.bol) %agent [src.bol %groups] %leave ~]
+ [%pass /gladio/(scot %p ship) %agent [ship %groups] %leave ~]
::
++ peek-group
|= rid=resource
|
Update pkg/grid/src/components/Checkbox.tsx | @@ -20,7 +20,6 @@ export const Checkbox: React.FC<RadixCheckbox.CheckboxProps> = ({
<div className="flex content-center space-x-2">
<RadixCheckbox.Root
className={classNames('default-ring rounded-lg bg-white h-7 w-7', className)}
- // style={{ width: 28, height: 28 }}
checked={proxyChecked}
onCheckedChange={proxyOnCheckedChange}
disabled={disabled}
|
Enable bindings and attribute reporting for IKEA Fyrtur and Kadrilj devices | @@ -1906,6 +1906,8 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
sensor->modelId().startsWith(QLatin1String("S2")) ||
// IKEA
sensor->modelId().startsWith(QLatin1String("TRADFRI")) ||
+ sensor->modelId().startsWith(QLatin1String("FYRTUR")) ||
+ sensor->modelId().startsWith(QLatin1String("KADRILJ")) ||
sensor->modelId().startsWith(QLatin1String("SYMFONISK")) ||
// Keen Home
sensor->modelId().startsWith(QLatin1String("SV01-")) ||
|
fix for ipv6 hosts if logout url is set | @@ -2455,6 +2455,7 @@ apr_byte_t oidc_validate_redirect_url(request_rec *r, oidc_cfg *c,
apr_hash_index_t *hi = NULL;
size_t i = 0;
char *url = apr_pstrndup(r->pool, redirect_to_url, OIDC_MAX_URL_LENGTH);
+ char *url_ipv6_aware = NULL;
// replace potentially harmful backslashes with forward slashes
for (i = 0; i < strlen(url); i++)
@@ -2487,8 +2488,15 @@ apr_byte_t oidc_validate_redirect_url(request_rec *r, oidc_cfg *c,
}
} else if ((uri.hostname != NULL) && (restrict_to_host == TRUE)) {
c_host = oidc_get_current_url_host(r, c->x_forwarded_headers);
- if ((strstr(c_host, uri.hostname) == NULL)
- || (strstr(uri.hostname, c_host) == NULL)) {
+
+ if (strchr(uri.hostname, ':')) { /* v6 literal */
+ url_ipv6_aware = apr_pstrcat(r->pool, "[", uri.hostname, "]", NULL);
+ } else {
+ url_ipv6_aware = uri.hostname;
+ }
+
+ if ((strstr(c_host, url_ipv6_aware) == NULL)
+ || (strstr(url_ipv6_aware, c_host) == NULL)) {
*err_str = apr_pstrdup(r->pool, "Invalid Request");
*err_desc =
apr_psprintf(r->pool,
|
docs(discord): improve discord_strerror() description | @@ -413,9 +413,9 @@ void discord_global_cleanup();
/**
* @brief Return the meaning of ORCAcode
- * @note client may be NULL, but this will give a generic error message
+ * @note if the client parameter is provided, the raw JSON error string will be given for ORCA_DISCORD_JSON_CODE code
* @param code the ORCAcode to be explained
- * @param client the client created with discord_init()
+ * @param client the client created with discord_init(), NULL for generic error descriptions
* @return a string containing the code meaning
*/
const char* discord_strerror(ORCAcode code, struct discord *client);
|
Fix Error: ascii/mbascii.c:118:25: error: unused variable 'ucLRC' [-Werror,-Wunused-variable] | @@ -115,7 +115,6 @@ static volatile eMBBytePos eBytePos;
static volatile uint8_t *pucSndBufferCur;
static volatile uint16_t usSndBufferCount;
-static volatile uint8_t ucLRC;
static volatile uint8_t ucMBLFCharacter;
/****************************************************************************
@@ -130,11 +129,11 @@ static uint8_t prvucMBint8_t2BIN(uint8_t ucCharacter)
}
else if ((ucCharacter >= 'A') && (ucCharacter <= 'F'))
{
- return (uint8_t)(ucCharacter - 'A' + 0x0A);
+ return (uint8_t)(ucCharacter - 'A' + 0x0a);
}
else
{
- return 0xFF;
+ return 0xff;
}
}
@@ -144,9 +143,9 @@ static uint8_t prvucMBBIN2int8_t(uint8_t ucByte)
{
return (uint8_t)('0' + ucByte);
}
- else if ((ucByte >= 0x0A) && (ucByte <= 0x0F))
+ else if ((ucByte >= 0x0a) && (ucByte <= 0x0f))
{
- return (uint8_t)(ucByte - 0x0A + 'A');
+ return (uint8_t)(ucByte - 0x0a + 'A');
}
else
{
@@ -241,7 +240,7 @@ eMBErrorCode eMBASCIIReceive(uint8_t *pucRcvAddress, uint8_t **pucFrame,
* size of address field and CRC checksum.
*/
- *pusLength = (uint16_t)(usRcvBufferPos - MB_SER_PDU_PDU_OFF - MB_SER_PDU_SIZE_LRC);
+ *pusLength = usRcvBufferPos - MB_SER_PDU_PDU_OFF - MB_SER_PDU_SIZE_LRC;
/* Return the start of the Modbus PDU to the caller. */
@@ -318,6 +317,7 @@ bool xMBASCIIReceiveFSM(void)
*/
case STATE_RX_RCV:
+
/* Enable timer for character timeout. */
vMBPortTimersEnable();
@@ -356,7 +356,7 @@ bool xMBASCIIReceiveFSM(void)
eRcvState = STATE_RX_IDLE;
- /* Disable previously activated timer because of error state. */
+ /* Disable previously activated timer due to error state. */
vMBPortTimersDisable();
}
@@ -466,7 +466,7 @@ bool xMBASCIITransmitFSM(void)
break;
case BYTE_LOW_NIBBLE:
- ucByte = prvucMBBIN2int8_t((uint8_t)(*pucSndBufferCur & 0x0F));
+ ucByte = prvucMBBIN2int8_t((uint8_t)(*pucSndBufferCur & 0x0f));
xMBPortSerialPutByte((int8_t)ucByte);
pucSndBufferCur++;
eBytePos = BYTE_HIGH_NIBBLE;
@@ -514,6 +514,7 @@ bool xMBASCIITransmitFSM(void)
*/
case STATE_TX_IDLE:
+
/* enable receiver/disable transmitter. */
vMBPortSerialEnable(true, false);
@@ -530,13 +531,14 @@ bool xMBASCIITimerT1SExpired(void)
/* If we have a timeout we go back to the idle state and wait for
* the next frame.
*/
+
case STATE_RX_RCV:
case STATE_RX_WAIT_EOF:
eRcvState = STATE_RX_IDLE;
break;
default:
- DEBUGASSERT((eRcvState == STATE_RX_RCV) || (eRcvState == STATE_RX_WAIT_EOF));
+ DEBUGASSERT(eRcvState == STATE_RX_RCV || eRcvState == STATE_RX_WAIT_EOF);
break;
}
|
rune/libenclave: Sanity check the returned error of rune exec
If the returned error is empty, don't raise an error in any way. | @@ -302,7 +302,13 @@ func remoteExec(agentPipe *os.File, config *configs.InitEnclaveConfig, notifySig
logrus.Debug("awaiting for signal forwarder exiting ...")
<-sigForwarderExit
logrus.Debug("signal forwarder exited")
- return resp.Exec.ExitCode, fmt.Errorf(resp.Exec.Error)
+
+ if resp.Exec.Error == "" {
+ err = nil
+ } else {
+ err = fmt.Errorf(resp.Exec.Error)
+ }
+ return resp.Exec.ExitCode, err
}
func forwardSignalToParent(conn io.Writer, notifySignal chan os.Signal, notifyExit <-chan struct{}) <-chan struct{} {
|
build: fix formatting of comments | @@ -15,7 +15,8 @@ check_binding_included ("swig_python" IS_INCLUDED SUBDIRECTORY "swig/python")
if (IS_INCLUDED)
add_subdirectory (python)
else ()
- check_binding_included ("swig_python3" IS_INCLUDED SUBDIRECTORY "swig/python" SILENT) # rename swig_python3 to swig_python - TODO
+ # TODO rename swig_python3 to swig_python
+ check_binding_included ("swig_python3" IS_INCLUDED SUBDIRECTORY "swig/python" SILENT)
# remove sometime in the future
if (IS_INCLUDED)
exclude_binding ("swig_python3" "swig_python3 has been renamed to swig_python")
|
[DYNAREC] Refactored the printer generator (3) | @@ -28,7 +28,7 @@ def arr2hex(a, forceBin=False):
return "0b" + ''.join(map(str, a))
else:
al = len(a)
- return int2hex(sum([v * 2**(al - i - 1) for i, v in enumerate(a)]), ceil(al / 4))
+ return int2hex(sum(v * 2**(al - i - 1) for i, v in enumerate(a)), ceil(al / 4))
def sz2str(sz, forceBin=False):
return int2hex(2 ** sz - 1) if not forceBin else ("0b" + "1" * sz)
@@ -234,31 +234,38 @@ def main(root, ver, __debug_forceAllDebugging=False):
statements.append(statement[:-1])
curSplt = curSplt + 1
- # Now get the (correct!) remainder and glue everything together
+ # Now get the (correct!) remainder(s)
dynvars = [dynvar.split(',') for dynvar in spltln[curSplt].split(';')]
- if any([len(dynvar) != len(statements) + 2 for dynvar in dynvars]):
+ if any(len(dynvar) != len(statements) + 2 for dynvar in dynvars):
fail(KeyError, "Not enough or too many commas (@@ modifier, final part)!")
+ dynvars = list(map(lambda i: [dv[i] for dv in dynvars], range(len(dynvars[0]))))
- for i, stmt in enumerate(statements):
+ # Glue everything together
+ for stmt, vals in zip(statements, dynvars[1:]):
append("if (" + stmt + ") {\n")
- for dynvar in dynvars:
- append(dynvar[0] + " = " + dynvar[i + 1] + ";\n")
+ for var, val in zip(dynvars[0], vals):
+ append(var + " = " + val + ";\n")
append("} else ")
append("{\n")
- for dynvar in dynvars:
- append(dynvar[0] + " = " + dynvar[-1] + ";\n")
+ for var, val in zip(dynvars[0], dynvars[-1]):
+ append(var + " = " + val + ";\n")
append("}\n")
curSplt = curSplt + 1
else:
- # Simple string switch (true then op = str1, false then op = str2, separated by commas)
- if len(dynvar) != len(eq) + 1:
+ # Standard if, standard statement
+ dynvars = [dynvar.split(',') for dynvar in spltln[curSplt].split(';')]
+ dynvars[-1][-1] = dynvars[-1][-1][:-1]
+ if any(len(dynvar) != len(eq) + 1 for dynvar in dynvars):
fail(ValueError, "Not enough/too many possibilities in string switch")
+ dynvars = list(map(lambda i: [dv[i] for dv in dynvars], range(len(dynvars[0]))))
- for e, dv in zip(eq[1:], dynvar[1:-1]):
+ for e, vals in zip(eq[1:], dynvars[1:]):
append("if (" + eq[0] + " == " + e + ") {\n")
- append(dynvar[0] + " = " + dv + ";\n} else ")
+ for var, val in zip(dynvars[0], vals):
+ append(var + " = " + val + ";\n} else ")
append("{\n")
- append(dynvar[0] + " = " + dynvar[-1][:-1] + ";\n}\n")
+ for var, val in zip(dynvars[0], dynvars[-1]):
+ append(var + " = " + val + ";\n}\n")
curSplt = curSplt + 1
elif spltln[curSplt] == "set":
# Set a (new?) variable
|
support rocketchip longname from generator | extra comments | subprojects specify configs | @@ -26,15 +26,21 @@ SBT_PROJECT ?= $(PROJECT)
TB ?= TestDriver
TOP ?= RocketTop
-# make it so that you only change 1 param to change most or all of them!
+#########################################################################################
+# subproject overrides
+# description:
+# - make it so that you only change 1 param to change most or all of them!
+# - mainly intended for quick developer setup for common flags
+# - for each you only need to specify a CONFIG
+#########################################################################################
SUB_PROJECT ?= example
-# for a BOOM based system (provides all necessary params)
+
+# for a BOOM based example system
ifeq ($(SUB_PROJECT),boomexample)
MODEL=BoomTestHarness
- CONFIG=DefaultBoomConfig
TOP=BoomTop
endif
-# for BOOM developers (only need to provide a CONFIG)
+# for BOOM developers
ifeq ($(SUB_PROJECT),boom)
PROJECT=boom.system
MODEL=TestHarness
@@ -46,12 +52,11 @@ endif
ifeq ($(SUB_PROJECT),rocketchip)
PROJECT=freechips.rocketchip.system
MODEL=TestHarness
- CONFIG=DefaultConfig
CFG_PROJECT=freechips.rocketchip.system
SBT_PROJECT=rebarrocketchip
TOP=ExampleRocketSystem
endif
-# for Hwacha developers (only need to provide a CONFIG)
+# for Hwacha developers
ifeq ($(SUB_PROJECT),hwacha)
PROJECT=freechips.rocketchip.system
MODEL=TestHarness
@@ -59,7 +64,6 @@ ifeq ($(SUB_PROJECT),hwacha)
SBT_PROJECT=hwacha
TOP=ExampleRocketSystem
TB=TestDriver
- CONFIG=HwachaConfig
endif
#########################################################################################
@@ -75,8 +79,8 @@ REBAR_FIRRTL_DIR = $(base_dir)/tools/firrtl
long_name = $(PROJECT).$(MODEL).$(CONFIG)
# if building from rocketchip, override the long_name to match what they expect
-ifeq ($(SBT_PROJECT),rebarrocketchip)
- long_name=$(PROJECT).$(CONFIG)
+ifeq ($(PROJECT),freechips.rocketchip.system)
+ long_name=$(CFG_PROJECT).$(CONFIG)
endif
FIRRTL_FILE ?= $(build_dir)/$(long_name).fir
|
os/arch/arm/src/stm32l4: Configure GPIO pin : PC13 for EXTI interrupt | #include "up_internal.h"
#include "stm32l4_rtc.h"
#include <tinyara/rtc.h>
+#include "stm32l4.h"
+#include "stm32l4_gpio.h"
+#include "stm32l4_userspace.h"
+#include "stm32l4_start.h"
+#include "stm32l4xx_hal_interface.h"
/****************************************************************************
* Pre-processor Definitions
#endif
#define PM_IDLE_DOMAIN 0 /* Revisit */
+#define STM32L4_EXT_JOYKEY_ACTIVITY 4
#ifdef CONFIG_SCHED_TICKSUPPRESS
#ifndef CONFIG_STM32L4_RTC
/****************************************************************************
* Private Functions
****************************************************************************/
+void up_extiisr(int irq, uint32_t *regs)
+{
+ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13);
+ up_lowputc('i');
+ pm_activity(PM_IDLE_DOMAIN, STM32L4_EXT_JOYKEY_ACTIVITY);
+}
+
+void set_exti_button(void)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE();
+ __HAL_RCC_GPIOC_CLK_ENABLE(); /*Configure GPIO pin : PC13 */
+ __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE();
+ GPIO_InitStruct.Pin = GPIO_PIN_13;
+ GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /* EXTI interrupt init*/
+ HAL_NVIC_SetPriority(EXTI15_10_IRQn, 2, 0);
+ HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
+ (void)irq_attach(STM32L4_IRQ_EXTI1510, (xcpt_t)up_extiisr, NULL);
+}
/****************************************************************************
* Name: up_idlepm
@@ -175,6 +203,9 @@ static void up_idlepm(void)
break;
case PM_SLEEP:
+ /* Set EXTI interrupt */
+ set_exti_button();
+
(void)stm32l4_pmstop2();
/* Re configure clocks */
|
artik05x: add verify option into download script
Conflicts:
build/configs/artik05x/artik05x_download.sh | @@ -51,11 +51,13 @@ OPTIONS:
For examples:
`basename $0` --board=artik053 ALL
- `basename $0` --board=artik055s BOOTLOADER
+ `basename $0` --board=artik053s --verify
+ `basename $0` --board=artik055s --secure
Options:
--board[="<board-name>"] select target board-name
--secure choose secure mode
+ --verify verify downloaded image if you need
ALL write each firmware image into FLASH
BOOTLOADER not supported yet
RESOURCE not supported yet
@@ -79,7 +81,7 @@ romfs()
pushd ${OPENOCD_DIR_PATH} > /dev/null
${OPENOCD_BIN_PATH}/openocd -f artik05x.cfg -s "$BOARD_DIR_PATH/../artik05x/scripts" -c " \
- flash_write rom ${OUTPUT_BINARY_PATH}/romfs.img; \
+ flash_write rom ${OUTPUT_BINARY_PATH}/romfs.img $VERIFY; \
exit" || exit 1
popd > /dev/null
fi
@@ -107,14 +109,14 @@ download()
# Download all binaries using openocd script
pushd ${OPENOCD_DIR_PATH} > /dev/null
- ${OPENOCD_BIN_PATH}/openocd -f artik05x.cfg -s "$BOARD_DIR_PATH/../artik05x/scripts" -c " \
- flash_protect off;\
- flash_write bl1 ${FW_DIR_PATH}/bl1.bin; \
+ ${OPENOCD_BIN_PATH}/openocd -f artik05x.cfg -s $BOARD_DIR_PATH/../artik05x/scripts -c \
+ "flash_protect off; \
+ flash_write bl1 ${FW_DIR_PATH}/bl1.bin $VERIFY;
flash_protect on; \
- flash_write bl2 ${FW_DIR_PATH}/bl2.bin; \
- flash_write sssfw ${FW_DIR_PATH}/sssfw.bin; \
- flash_write wlanfw ${FW_DIR_PATH}/wlanfw.bin; \
- flash_write os ${TIZENRT_BIN}; \
+ flash_write bl2 ${FW_DIR_PATH}/bl2.bin $VERIFY; \
+ flash_write sssfw ${FW_DIR_PATH}/sssfw.bin $VERIFY; \
+ flash_write wlanfw ${FW_DIR_PATH}/wlanfw.bin $VERIFY; \
+ flash_write os ${TIZENRT_BIN} $VERIFY; \
exit" || exit 1
popd > /dev/null
@@ -185,6 +187,9 @@ while test $# -gt 0; do
--secure)
signing
;;
+ --verify)
+ VERIFY=verify
+ ;;
ALL)
download
;;
|
zuse: fix +del-span in +tab | ?~ a a
?~ b a
?: =(key.n.a u.b)
- a(l r.a)
+ r.a
?: (compare key.n.a u.b)
- $(a a(l r.a))
+ $(a r.a)
a(l $(a l.a))
--
:: +tap: convert to list, smallest to largest
|
FIPS: Fix compiler errors in rsa_chk.c when building with `-DFIPS_MODE` | @@ -25,11 +25,9 @@ int RSA_check_key(const RSA *key)
int RSA_check_key_ex(const RSA *key, BN_GENCB *cb)
{
#ifdef FIPS_MODE
- if (!(rsa_sp800_56b_check_public(key)
+ return rsa_sp800_56b_check_public(key)
&& rsa_sp800_56b_check_private(key)
- && rsa_sp800_56b_check_keypair(key, NULL, -1, RSA_bits(key))
- return 0;
-
+ && rsa_sp800_56b_check_keypair(key, NULL, -1, RSA_bits(key));
#else
BIGNUM *i, *j, *k, *l, *m;
BN_CTX *ctx;
|
oc_event_callback: fix double free memory
We can't remove the currently processed delayed callback because when
the callback returns OC_EVENT_DONE, a double release occurs. So we set up
the flag to remove it, and when it's over, we've removed it. | @@ -83,6 +83,8 @@ OC_LIST(timed_callbacks);
OC_MEMB(event_callbacks_s, oc_event_callback_t,
1 + OCF_D * OC_MAX_NUM_DEVICES + OC_MAX_APP_RESOURCES +
OC_MAX_NUM_CONCURRENT_REQUESTS * 2);
+static oc_event_callback_t *currently_processed_event_cb;
+static bool currently_processed_event_cb_delete;
OC_PROCESS(timed_callback_events, "OC timed callbacks");
@@ -538,6 +540,12 @@ oc_ri_remove_timed_event_callback(void *cb_data, oc_trigger_t event_callback)
while (event_cb != NULL) {
if (event_cb->data == cb_data && event_cb->callback == event_callback) {
+ if (currently_processed_event_cb == event_cb) {
+ // We can't remove the currently processed delayed callback because when
+ // the callback returns OC_EVENT_DONE, a double release occurs. So we
+ // set up the flag to remove it, and when it's over, we've removed it.
+ currently_processed_event_cb_delete = true;
+ } else {
OC_PROCESS_CONTEXT_BEGIN(&timed_callback_events);
oc_etimer_stop(&event_cb->timer);
OC_PROCESS_CONTEXT_END(&timed_callback_events);
@@ -545,6 +553,7 @@ oc_ri_remove_timed_event_callback(void *cb_data, oc_trigger_t event_callback)
oc_memb_free(&event_callbacks_s, event_cb);
break;
}
+ }
event_cb = event_cb->next;
}
}
@@ -576,9 +585,11 @@ poll_event_callback_timers(oc_list_t list, struct oc_memb *cb_pool)
while (event_cb != NULL) {
next = event_cb->next;
-
if (oc_etimer_expired(&event_cb->timer)) {
- if (event_cb->callback(event_cb->data) == OC_EVENT_DONE) {
+ currently_processed_event_cb = event_cb;
+ currently_processed_event_cb_delete = false;
+ if ((event_cb->callback(event_cb->data) == OC_EVENT_DONE) ||
+ currently_processed_event_cb_delete) {
oc_list_remove(list, event_cb);
oc_memb_free(cb_pool, event_cb);
event_cb = oc_list_head(list);
@@ -594,6 +605,8 @@ poll_event_callback_timers(oc_list_t list, struct oc_memb *cb_pool)
event_cb = next;
}
+ currently_processed_event_cb = NULL;
+ currently_processed_event_cb_delete = false;
}
static void
|
mesh: Fix confusing language in log messages
Both "store" and "clear" are verbs, so putting them after each other
is just confusing. Use "clean" consistently when clearing settings
entries. | @@ -844,14 +844,26 @@ static void schedule_store(int flag)
static void clear_iv(void)
{
- BT_DBG("Clearing IV");
- settings_save_one("bt_mesh/IV", NULL);
+ int err;
+
+ err = settings_save_one("bt_mesh/IV", NULL);
+ if (err) {
+ BT_ERR("Failed to clear IV");
+ } else {
+ BT_DBG("Cleared IV");
+ }
}
static void clear_net(void)
{
- BT_DBG("Clearing Network");
- settings_save_one("bt_mesh/Net", NULL);
+ int err;
+
+ err = settings_save_one("bt_mesh/Net", NULL);
+ if (err) {
+ BT_ERR("Failed to clear Network");
+ } else {
+ BT_DBG("Cleared Network");
+ }
}
static void store_pending_net(void)
@@ -968,7 +980,7 @@ static void store_rpl(struct bt_mesh_rpl *entry)
static void clear_rpl(void)
{
- int i;
+ int i, err;
BT_DBG("");
@@ -981,7 +993,12 @@ static void clear_rpl(void)
}
snprintk(path, sizeof(path), "bt_mesh/RPL/%x", rpl->src);
- settings_save_one(path, NULL);
+ err = settings_save_one(path, NULL);
+ if (err) {
+ BT_ERR("Failed to clear RPL");
+ } else {
+ BT_DBG("Cleared RPL");
+ }
memset(rpl, 0, sizeof(*rpl));
}
@@ -1068,28 +1085,46 @@ static void store_pending_cfg(void)
static void clear_cfg(void)
{
- BT_DBG("Clearing configuration");
- settings_save_one("bt_mesh/Cfg", NULL);
+ int err;
+
+ err = settings_save_one("bt_mesh/Cfg", NULL);
+ if (err) {
+ BT_ERR("Failed to clear configuration");
+ } else {
+ BT_DBG("Cleared configuration");
+ }
}
static void clear_app_key(u16_t app_idx)
{
char path[20];
+ int err;
BT_DBG("AppKeyIndex 0x%03x", app_idx);
snprintk(path, sizeof(path), "bt_mesh/AppKey/%x", app_idx);
- settings_save_one(path, NULL);
+ err = settings_save_one(path, NULL);
+ if (err) {
+ BT_ERR("Failed to clear AppKeyIndex 0x%03x", app_idx);
+ } else {
+ BT_DBG("Cleared AppKeyIndex 0x%03x", app_idx);
+ }
}
static void clear_net_key(u16_t net_idx)
{
char path[20];
+ int err;
BT_DBG("NetKeyIndex 0x%03x", net_idx);
snprintk(path, sizeof(path), "bt_mesh/NetKey/%x", net_idx);
- settings_save_one(path, NULL);
+ err = settings_save_one(path, NULL);
+ if (err) {
+ BT_ERR("Failed to clear NetKeyIndex 0x%03x", net_idx);
+ } else {
+ BT_DBG("Cleared NetKeyIndex 0x%03x", net_idx);
+ }
}
static void store_net_key(struct bt_mesh_subnet *sub)
|
build: link to mbedtls-2.13.0 | @@ -251,8 +251,8 @@ if(FLB_TLS)
option(ENABLE_TESTING OFF)
option(ENABLE_PROGRAMS OFF)
option(INSTALL_MBEDTLS_HEADERS OFF)
- add_subdirectory(lib/mbedtls-2.8.0 EXCLUDE_FROM_ALL)
- include_directories(lib/mbedtls-2.8.0/include)
+ add_subdirectory(lib/mbedtls-2.13.0 EXCLUDE_FROM_ALL)
+ include_directories(lib/mbedtls-2.13.0/include)
endif()
# Metrics
|
build FEATURE add comment for sr_clean and shm_clean targets
Refs | @@ -314,12 +314,14 @@ endif()
add_custom_target(shm_clean
COMMAND rm -rf /dev/shm/sr_*
COMMAND rm -rf /dev/shm/srsub_*
+ COMMENT "Removing all volatile SHM files prefixed with \"sr\""
)
# phony target for clearing all sysrepo data
add_custom_target(sr_clean
COMMAND rm -rf ${REPO_PATH}
DEPENDS shm_clean
+ COMMENT "Removing the whole persistent repository \"${REPO_PATH}\""
)
# uninstall
|
Don't use -O0 for unit test LD_PRELOAD
Wuninitialized does not play nice with -O0 for some compilers. | @@ -23,7 +23,7 @@ include ../../s2n.mk
CRUFT += $(wildcard *.so)
-LD_PRELOAD_CFLAGS = -Wno-unreachable-code -O0
+LD_PRELOAD_CFLAGS = -Wno-unreachable-code
$(OVERRIDES)::
${CC} ${DEFAULT_CFLAGS} ${DEBUG_CFLAGS} ${LD_PRELOAD_CFLAGS} -shared -fPIC [email protected] -o [email protected] -ldl
|
fix -s (response filter) to work | @@ -714,7 +714,7 @@ def handle_quic_event(cpu, data, size):
if allowed_quic_event and ev.type != allowed_quic_event:
return
- if ev.type == "send_response_header": # HTTP-level events
+ if ev.type == "h2o__send_response_header": # HTTP-level events
if not verbose:
return
if allowed_res_header_name and ev.h2o_header_name != allowed_res_header_name:
|
Correct comments around MQTT | @@ -505,7 +505,7 @@ mqtt_process_incoming_message(esp_mqtt_client_p client) {
/* Debug message */
ESP_DEBUGF(ESP_CFG_DBG_MQTT_STATE,
- "[MQTT] Processing package type %s\r\n", mqtt_msg_type_to_str(msg_type));
+ "[MQTT] Processing packet type %s\r\n", mqtt_msg_type_to_str(msg_type));
/* Check received packet type */
switch (msg_type) {
@@ -689,8 +689,11 @@ mqtt_parse_incoming(esp_mqtt_client_p client, esp_pbuf_p pbuf) {
"[MQTT] Remaining length received: %d bytes\r\n", (int)client->msg_rem_len);
if (client->msg_rem_len > 0) {
- /* Are all remaining bytes part of single buffer? */
- /* Compare with more as idx is one byte behind vs data position by 1 byte */
+ /*
+ * Check if all data bytes are part of single pbuf.
+ * this is done by check if current idx position vs length is more than expected data length
+ * Check must be "greater as" due to idx currently pointing to last length byte and not beginning of data
+ */
if ((buff_len - idx) > client->msg_rem_len) {
void* tmp_ptr = client->rx_buff;
size_t tmp_len = client->rx_buff_len;
|
Update HttpClient_Curl.cpp
Remove redundant variable | @@ -73,7 +73,6 @@ namespace ARIASDK_NS_BEGIN {
auto curlOperation = std::make_shared<CurlHttpOperation>(curlRequest->m_method, curlRequest->m_url, callback, requestHeaders, curlRequest->m_body);
curlRequest->SetOperation(curlOperation);
- auto operationLifetime = std::weak_ptr<CurlHttpOperation>(curlOperation);
// The liftime of curlOperation is guarnteed by the call to result.wait() in the d'tor.
curlOperation->SendAsync([this, callback, requestId](CurlHttpOperation& operation) {
|
core: remove debug output | #include <kdbinternal.h>
-// TODO: remove
-
-#include <unistd.h>
-
-void output_meta (Key * k)
-{
- const Key * meta;
-
- keyRewindMeta (k);
- while ((meta = keyNextMeta (k)) != 0)
- {
- ELEKTRA_LOG_DEBUG (", %s: %s", keyName (meta), (const char *) keyValue (meta));
- }
- ELEKTRA_LOG_DEBUG ("\n");
-}
-
-void output_key (Key * k)
-{
- // output_meta will print endline
- ELEKTRA_LOG_DEBUG ("key: %s, string: %s", keyName (k), keyString (k));
- output_meta (k);
-}
-
-void output_keyset (KeySet * ks)
-{
- Key * k;
- ksRewind (ks);
- while ((k = ksNext (ks)) != 0)
- {
- output_key (k);
- }
-}
-void logSplitDebug (KDB * handle)
-{
- if (!handle->split)
- {
- ELEKTRA_LOG_DEBUG ("!!!!! NO SPLIT in KDB");
- return;
- }
- ELEKTRA_LOG_DEBUG (">>>> NEW KDB SPLIT");
- ELEKTRA_LOG_DEBUG (">>>> alloc: %zu", handle->split->alloc);
- ELEKTRA_LOG_DEBUG (">>>> size: %zu", handle->split->size);
-
- for (size_t i = 0; i < handle->split->size; i++)
- {
- ELEKTRA_LOG_DEBUG (">>>> NEW SPLIT: %zu", i);
- Key * k = handle->split->parents[i];
- ELEKTRA_LOG_DEBUG (">>>> backend handle specsize:\t%zi", handle->split->handles[i]->specsize);
- ELEKTRA_LOG_DEBUG (">>>> backend handle dirsize:\t%zi", handle->split->handles[i]->dirsize);
- ELEKTRA_LOG_DEBUG (">>>> backend handle usersize:\t%zi", handle->split->handles[i]->usersize);
- ELEKTRA_LOG_DEBUG (">>>> backend handle systemsize:\t%zi", handle->split->handles[i]->systemsize);
-
- ELEKTRA_LOG_DEBUG (">>>> syncbits: %u", handle->split->syncbits[i]);
- ELEKTRA_LOG_DEBUG (">>>> parent key: %s, string: %s, strlen: %ld, valSize: %ld", keyName (k), keyString (k),
- strlen (keyString (k)), keyGetValueSize (k));
- ELEKTRA_LOG_DEBUG (">>>> keyset size: %zi", ksGetSize (handle->split->keysets[i]));
-
- output_keyset (handle->split->keysets[i]);
- ELEKTRA_LOG_DEBUG (">>>> END SPLIT: %zu", i);
- }
-}
-
-// TODO: remove end
/**
* @defgroup kdb KDB
@@ -1073,10 +1010,6 @@ int kdbGet (KDB * handle, KeySet * ks, Key * parentKey)
goto cachemiss;
}
- ELEKTRA_LOG_DEBUG ("#################### START KEYSET: CACHE_HIT");
- output_keyset (ks);
- ELEKTRA_LOG_DEBUG ("#################### END KEYSET: CACHE_HIT");
-
keySetName (parentKey, keyName (initialParent));
splitUpdateFileName (split, handle, parentKey);
keyDel (initialParent);
|
proc: No need to use cycles, use only microsecond API
JIRA: | @@ -416,11 +416,11 @@ static void _threads_updateWakeup(time_t now, thread_t *min)
wakeup = t->wakeup - now;
}
else {
- wakeup = hal_timerUs2Cyc(SYSTICK_INTERVAL);
+ wakeup = SYSTICK_INTERVAL;
}
- if (wakeup > hal_timerUs2Cyc(SYSTICK_INTERVAL + SYSTICK_INTERVAL / 8))
- wakeup = hal_timerUs2Cyc(SYSTICK_INTERVAL);
+ if (wakeup > SYSTICK_INTERVAL + SYSTICK_INTERVAL / 8)
+ wakeup = SYSTICK_INTERVAL;
hal_timerSetWakeup(wakeup);
}
@@ -437,7 +437,7 @@ int threads_timeintr(unsigned int n, cpu_context_t *context, void *arg)
return EOK;
hal_spinlockSet(&threads_common.spinlock, &sc);
- now = hal_timerGetCyc();
+ now = hal_timerGetUs();
for (;; i++) {
t = lib_treeof(thread_t, sleeplinkage, lib_rbMinimum(threads_common.sleeping.root));
@@ -957,8 +957,8 @@ static void _proc_threadEnqueue(thread_t **queue, time_t timeout, int interrupti
current->interruptible = interruptible;
if (timeout) {
- now = hal_timerGetCyc();
- current->wakeup = now + hal_timerUs2Cyc(timeout);
+ now = hal_timerGetUs();
+ current->wakeup = now + timeout;
lib_rbInsert(&threads_common.sleeping, ¤t->sleeplinkage);
_threads_updateWakeup(now, NULL);
}
@@ -992,12 +992,12 @@ int proc_threadSleep(unsigned long long us)
hal_spinlockSet(&threads_common.spinlock, &sc);
- now = hal_timerGetCyc();
+ now = hal_timerGetUs();
current = threads_common.current[hal_cpuGetID()];
current->state = SLEEP;
current->wait = NULL;
- current->wakeup = now + hal_timerUs2Cyc(us);
+ current->wakeup = now + us;
current->interruptible = 1;
lib_rbInsert(&threads_common.sleeping, ¤t->sleeplinkage);
@@ -1153,10 +1153,10 @@ time_t proc_uptime(void)
spinlock_ctx_t sc;
hal_spinlockSet(&threads_common.spinlock, &sc);
- time = hal_timerGetCyc();
+ time = hal_timerGetUs();
hal_spinlockClear(&threads_common.spinlock, &sc);
- return hal_timerCyc2Us(time);
+ return time;
}
@@ -1193,7 +1193,7 @@ time_t proc_nextWakeup(void)
hal_spinlockSet(&threads_common.spinlock, &sc);
thread = lib_treeof(thread_t, sleeplinkage, lib_rbMinimum(threads_common.sleeping.root));
if (thread != NULL) {
- now = hal_timerGetCyc();
+ now = hal_timerGetUs();
if (now >= thread->wakeup)
wakeup = 0;
else
@@ -1423,8 +1423,8 @@ static void threads_idlethr(void *arg)
for (;;) {
wakeup = proc_nextWakeup();
- if (wakeup > hal_timerUs2Cyc(2000))
- hal_cpuLowPower(hal_timerCyc2Us(wakeup));
+ if (wakeup > 2000)
+ hal_cpuLowPower(wakeup);
hal_cpuHalt();
}
|
HTTP parser: relaxed checking of fields values.
Allowing characters up to 0xFF doesn't conflict with RFC 7230.
Particularly, this make it possible to pass unencoded data
through HTTP headers, which can be useful. | @@ -699,8 +699,7 @@ nxt_http_lookup_field_end(u_char *p, u_char *end)
#define nxt_field_end_test_char(ch) \
\
- /* Values below 0x20 become more than 0xDF. */ \
- if (nxt_slow_path((u_char) ((ch) - 0x20) > 0x5E)) { \
+ if (nxt_slow_path((ch) < 0x20)) { \
return &(ch); \
}
|
profile: safely access status | @@ -84,7 +84,7 @@ export function Profile(props: any) {
) : null}
<Text maxWidth='18rem' overflowX='hidden' textOverflow="ellipsis"
whiteSpace="nowrap"
- overflow="hidden" display="inline-block" verticalAlign="middle">{contact.status}</Text>
+ overflow="hidden" display="inline-block" verticalAlign="middle">{contact?.status ?? ""}</Text>
</Row>
<Row width="100%" height="300px">
{cover}
|
dooly: add usb-c 1 port throttling
dooly is puff variant but has usb-c 1 port,
this patch adds usb-c 1 port throttling when OCP.
BRANCH=puff
TEST=make BOARD=dooly | @@ -1074,6 +1074,10 @@ static void power_monitor(void)
ppc_set_vbus_source_current_limit(0, rp);
tcpm_select_rp_value(0, rp);
pd_update_contract(0);
+
+ ppc_set_vbus_source_current_limit(1, rp);
+ tcpm_select_rp_value(1, rp);
+ pd_update_contract(1);
}
if (diff & THROT_TYPE_A) {
int typea_bc = (new_state & THROT_TYPE_A) ? 1 : 0;
|
dispatcher: fix build without gzip/bzip2, issue | @@ -75,8 +75,13 @@ typedef struct _connection {
typedef struct _z_strm {
int sock;
union {
+#ifdef HAVE_GZIP
z_stream z;
+#endif
+#ifdef HAVE_BZIP2
bz_stream bz;
+#endif
+ char dummy;
} hdl;
char ibuf[METRIC_BUFSIZ];
unsigned short ipos;
|
source greenplum_path as gpadmin
On Ubuntu, env vars are not inherited during `su gpadmin -c "commands"`
in the same way as Centos. The PATH was missing the gpdb install dir,
and psql commands failed. | @@ -25,7 +25,7 @@ function make_cluster() {
source "${GREENPLUM_INSTALL_DIR}/greenplum_path.sh"
export DEFAULT_QD_MAX_CONNECT=150
pushd gpdb_src/gpAux/gpdemo
- su gpadmin -c "make create-demo-cluster"
+ su gpadmin -c "source ${GREENPLUM_INSTALL_DIR}/greenplum_path.sh && make create-demo-cluster"
popd
}
|
Adding support for CGColorSpaceGetNumberOfComponents/kCGColorSpaceModelIndexed
and fixing CGColorSpaceGetNumberOfComponents/kCGColorSpaceModelPattern to return base colorspace components. | @@ -162,20 +162,21 @@ CGColorSpaceModel CGColorSpaceGetModel(CGColorSpaceRef colorSpace) {
@Status Caveat
@Notes Doesn't support all colorSpaces
*/
-size_t CGColorSpaceGetNumberOfComponents(CGColorSpaceRef pSpace) {
- RETURN_RESULT_IF_NULL(pSpace, 0);
- CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace);
-
- switch (colorSpaceModel) {
+size_t CGColorSpaceGetNumberOfComponents(CGColorSpaceRef colorSpace) {
+ RETURN_RESULT_IF_NULL(colorSpace, 0);
+ CGColorSpaceModel model = CGColorSpaceGetModel(colorSpace);
+ switch (model) {
case kCGColorSpaceModelRGB:
return 3;
case kCGColorSpaceModelPattern:
+ return colorSpace->BaseColorSpace() != nullptr ? CGColorSpaceGetNumberOfComponents(colorSpace->BaseColorSpace()) : 0;
case kCGColorSpaceModelMonochrome:
+ case kCGColorSpaceModelIndexed:
return 1;
case kCGColorSpaceModelCMYK:
return 4;
default:
- UNIMPLEMENTED_WITH_MSG("Colorspace Unsupported. Model: %d", colorSpaceModel);
+ UNIMPLEMENTED_WITH_MSG("Colorspace Unsupported. Model: %d", model);
return 0;
}
}
|
util/iteflash: Fix resource leak
Found-by: Coverity Scan
Commit-Ready: Patrick Georgi
Tested-by: Patrick Georgi | @@ -1134,6 +1134,7 @@ int write_flash2(struct ftdi_context *ftdi, const char *filename,
if (res <= 0) {
fprintf(stderr, "Cannot read %s\n", filename);
free(buffer);
+ fclose(hnd);
return -EIO;
}
fclose(hnd);
|
apps/system/utils: fix typo in utils_ps.c
ARRARY -> ARRAY | #include "utils_proc.h"
-#define STATENAMES_ARRARY_SIZE (sizeof(utils_statenames) / sizeof(utils_statenames[0]))
+#define STATENAMES_ARRAY_SIZE (sizeof(utils_statenames) / sizeof(utils_statenames[0]))
#define PS_BUFLEN 128
static const char *utils_statenames[] = {
@@ -111,7 +111,7 @@ static void ps_print_values(char *buf)
}
state = atoi(stat_info[PROC_STAT_STATE]);
- if (state <= 0 || STATENAMES_ARRARY_SIZE <= state) {
+ if (state <= 0 || STATENAMES_ARRAY_SIZE <= state) {
return;
}
|
Remove unused struct members reserved_oids and global_reserved_oids | @@ -296,8 +296,6 @@ typedef struct
char *db_ctype;
int db_encoding;
RelInfoArr rel_arr; /* array of all user relinfos */
-
- char *reserved_oids; /* as a string */
} DbInfo;
typedef struct
@@ -381,8 +379,6 @@ typedef struct
char major_version_str[64]; /* string PG_VERSION of cluster */
uint32 bin_version; /* version returned from pg_ctl */
const char *tablespace_suffix; /* directory specification */
-
- char *global_reserved_oids; /* OID preassign calls for shared objects */
} ClusterInfo;
|
Correct documented return value for BIO_get_mem_data()
CLA: trivial | @@ -122,9 +122,12 @@ There should be an option to set the maximum size of a memory BIO.
BIO_s_mem() and BIO_s_secmem() return a valid memory B<BIO_METHOD> structure.
-BIO_set_mem_eof_return(), BIO_get_mem_data(), BIO_set_mem_buf() and BIO_get_mem_ptr()
+BIO_set_mem_eof_return(), BIO_set_mem_buf() and BIO_get_mem_ptr()
return 1 on success or a value which is less than or equal to 0 if an error occurred.
+BIO_get_mem_data() returns the total number of bytes available on success,
+0 if b is NULL, or a negative value in case of other errors.
+
BIO_new_mem_buf() returns a valid B<BIO> structure on success or NULL on error.
=head1 EXAMPLES
|
Added threshold to joystick axis | #include "game/level/script.h"
#define LEVEL_GRAVITY 1500.0f
+#define JOYSTICK_THRESHOLD 1000
struct Level
{
@@ -274,9 +275,9 @@ int level_input(Level *level,
player_move_left(level->player);
} else if (keyboard_state[SDL_SCANCODE_D]) {
player_move_right(level->player);
- } else if (the_stick_of_joy && SDL_JoystickGetAxis(the_stick_of_joy, 0) < 0) {
+ } else if (the_stick_of_joy && SDL_JoystickGetAxis(the_stick_of_joy, 0) < -JOYSTICK_THRESHOLD) {
player_move_left(level->player);
- } else if (the_stick_of_joy && SDL_JoystickGetAxis(the_stick_of_joy, 0) > 0) {
+ } else if (the_stick_of_joy && SDL_JoystickGetAxis(the_stick_of_joy, 0) > JOYSTICK_THRESHOLD) {
player_move_right(level->player);
} else {
player_stop(level->player);
|
gpio: Add migration guide notes for the gpio interrupt breaking change (61282cc5dd14d2f74868384067820a55e1deddd0) | @@ -31,7 +31,13 @@ ADC
GPIO
----
-The previous Kconfig option `RTCIO_SUPPORT_RTC_GPIO_DESC` has been removed, thus the ``rtc_gpio_desc`` array is unavailable. Please use ``rtc_io_desc`` array instead.
+- The previous Kconfig option `RTCIO_SUPPORT_RTC_GPIO_DESC` has been removed, thus the ``rtc_gpio_desc`` array is unavailable. Please use ``rtc_io_desc`` array instead.
+
+- GPIO interrupt users callbacks should no longer read the GPIO interrupt status register to get the triggered GPIO's pin number. Users should use the callback argument to determine the GPIO's pin number instead.
+
+ - Previously, when a GPIO interrupt occurs, the GPIO's interrupt status register is cleared after calling the user callbacks. Thus, it was possible for users to read the GPIO's interrupt status register inside the callback to determine which GPIO was triggered.
+ - However, clearing the interrupt status after the user callbacks can potentially cause edge-triggered interrupts to be lost. For example, if an edge-triggered interrupt (re)triggers while the user callbacks are being called, that interrupt will be cleared without its registered user callback being handled.
+ - Now, the GPIO's interrupt status register is cleared **before** invoking the user callbacks. Thus, users can no longer read the GPIO interrupt status register to determine which pin has triggered the interrupt. Instead, users should use the callback argument to pass the pin number.
.. only:: SOC_SDM_SUPPORTED
|
fix typo, add comment | @@ -54,6 +54,12 @@ int account_matchByState(const struct oidc_account* p1,
return strcmp(state1, state2) == 0;
}
+/**
+ * reads the pubclient.conf file and updates the account struct if a public
+ * client is found for that issuer, also setting the redirect uris
+ * @param account the account struct to be updated
+ * @return the updated account struct, or @c NULL
+ */
struct oidc_account* updateAccountWithPublicClientInfo(
struct oidc_account* account) {
if (account == NULL) {
@@ -67,7 +73,7 @@ struct oidc_account* updateAccountWithPublicClientInfo(
while ((node = list_iterator_next(it))) {
char* client = strtok(node->val, "@");
char* iss = strtok(NULL, "@");
- // syslog(LOG_AUTHPRIV | LOG_DEBUG, "Found pub lcient for '%s'", iss);
+ // syslog(LOG_AUTHPRIV | LOG_DEBUG, "Found public client for '%s'", iss);
if (compIssuerUrls(issuer_url, iss)) {
char* client_id = strtok(client, ":");
char* client_secret = strtok(NULL, ":");
|
[build] Add WORKING_DIRECTORY for IDE | @@ -18,16 +18,20 @@ endif()
add_custom_target(build ALL DEPENDS aergocli aergosvr aergoluac brick)
-add_custom_target(aergocli GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"${LDFLAGS} -X github.com/aergoio/aergo/cmd/aergocli/cmd.githash=`git rev-parse HEAD`\" ../cmd/aergocli/...
+add_custom_target(aergocli GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"${LDFLAGS} -X github.com/aergoio/aergo/cmd/aergocli/cmd.githash=`git rev-parse HEAD`\" ./cmd/aergocli/...
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS vendor libtool)
-add_custom_target(aergosvr GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"${LDFLAGS}\" ../cmd/aergosvr/...
+add_custom_target(aergosvr GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"${LDFLAGS}\" ./cmd/aergosvr/...
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS vendor libtool)
-add_custom_target(aergoluac GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"${LDFLAGS}\" ../cmd/aergoluac/...
+add_custom_target(aergoluac GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"${LDFLAGS}\" ./cmd/aergoluac/...
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS vendor libtool)
-add_custom_target(brick GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"${LDFLAGS} -X github.com/aergoio/aergo/cmd/brick/context.GitHash=`git describe --tags`\" ../cmd/brick/...
+add_custom_target(brick GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"${LDFLAGS} -X github.com/aergoio/aergo/cmd/brick/context.GitHash=`git describe --tags`\" ./cmd/brick/...
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS vendor libtool)
set(VENDOR ${CMAKE_CURRENT_LIST_DIR}/vendor)
@@ -39,9 +43,11 @@ add_custom_target(vendor DEPENDS ${VENDOR})
add_custom_target(deps DEPENDS vendor libtool)
-add_custom_target(check go test -timeout 60s ../...
+add_custom_target(check go test -timeout 60s ./...
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS build)
-add_custom_target(cover-check go test -coverprofile c.out ../...
+add_custom_target(cover-check go test -coverprofile c.out ./...
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS build)
add_custom_target(distclean go clean ..
|
Travis: Do not preload ASAN library | @@ -232,12 +232,8 @@ before_script:
script:
- ninja
- |
- if [[ "$ASAN" = "ON" && "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then
- # preload required libraries (LD_PRELOAD is a space separated list)
- UBSAN_LIBRARY=$(find /usr/ -name '*libclang_rt.ubsan_standalone_cxx-x86_64.so')
- LD_PRELOAD="$UBSAN_LIBRARY" ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) ninja run_all
- elif [[ "$ASAN" = "ON" ]]; then
- ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) ninja run_all
+ if [[ "$ASAN" = "ON" ]]; then
+ ninja run_all
else
ninja install
ninja run_all && kdb run_all
|
fixed transfer to incorrect address | @@ -175,7 +175,8 @@ int cheatcoin_do_xfer(void *outv, const char *amount, const char *address) {
xfer.remains = cheatcoins2amount(amount);
if (!xfer.remains) { if (out) fprintf(out, "Xfer: nothing to transfer.\n"); return 1; }
if (xfer.remains > cheatcoin_get_balance(0)) { if (out) fprintf(out, "Xfer: balance too small.\n"); return 1; }
- cheatcoin_address2hash(address, xfer.fields[XFER_MAX_IN].hash);
+ if (cheatcoin_address2hash(address, xfer.fields[XFER_MAX_IN].hash))
+ { if (out) fprintf(out, "Xfer: incorrect address.\n"); return 1; }
cheatcoin_wallet_default_key(&xfer.keys[XFER_MAX_IN]);
xfer.outsig = 1;
g_cheatcoin_state = CHEATCOIN_STATE_XFER;
|
Require ConBee/RaspBee firmware 0x26190500 | @@ -63,7 +63,7 @@ DEFINES += GIT_COMMMIT=\\\"$$GIT_COMMIT\\\" \
# Minimum version of the RaspBee firmware
# which shall be used in order to support all features for this software release (case sensitive)
-DEFINES += GW_MIN_RPI_FW_VERSION=0x26160500
+DEFINES += GW_MIN_RPI_FW_VERSION=0x26190500
# Minimum version of the deRFusb23E0X firmware
# which shall be used in order to support all features for this software release
|
Fix Windows 7 issue with PhCreatePipe | @@ -6208,7 +6208,7 @@ NTSTATUS PhCreatePipe(
)
{
NTSTATUS status;
- PACL pipeAcl;
+ PACL pipeAcl = NULL;
HANDLE pipeDirectoryHandle;
HANDLE pipeReadHandle;
HANDLE pipeWriteHandle;
@@ -6253,7 +6253,6 @@ NTSTATUS PhCreatePipe(
RtlCreateSecurityDescriptor(&securityDescriptor, SECURITY_DESCRIPTOR_REVISION);
RtlSetDaclSecurityDescriptor(&securityDescriptor, TRUE, pipeAcl, FALSE);
- RtlFreeHeap(RtlProcessHeap(), 0, pipeAcl);
oa.SecurityDescriptor = &securityDescriptor;
}
@@ -6277,6 +6276,9 @@ NTSTATUS PhCreatePipe(
if (!NT_SUCCESS(status))
{
+ if (pipeAcl)
+ RtlFreeHeap(RtlProcessHeap(), 0, pipeAcl);
+
NtClose(pipeDirectoryHandle);
return status;
}
@@ -6305,6 +6307,9 @@ NTSTATUS PhCreatePipe(
*PipeWriteHandle = pipeWriteHandle;
}
+ if (pipeAcl)
+ RtlFreeHeap(RtlProcessHeap(), 0, pipeAcl);
+
NtClose(pipeDirectoryHandle);
return status;
}
|
make: use `shell` command to extract version string | @@ -329,7 +329,7 @@ endif
ifeq ("$(wildcard ${IDF_PATH}/version.txt)","")
IDF_VER_T := $(shell cd ${IDF_PATH} && git describe --always --tags --dirty)
else
-IDF_VER_T := `cat ${IDF_PATH}/version.txt`
+IDF_VER_T := $(shell cat ${IDF_PATH}/version.txt)
endif
IDF_VER := $(shell echo "$(IDF_VER_T)" | cut -c 1-31)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.