Skip to content

Instantly share code, notes, and snippets.

View UplinkCoder's full-sized avatar

Stefan Koch UplinkCoder

View GitHub Profile
#define SPWAN_TASK(RESULT, FUNC, ...) do { \
taskqueue_t* q = &CurrentWorker()->Queue; \
task_t task = {0}; \
CTX_TYPE(FUNC) ctx = {__VA_ARGS__}; \
CTX_TYPE(FUNC)* ctxPtr = &ctx; \
STATIC_ASSERT(sizeof(task._inlineContext) >= sizeof(CTX_TYPE(FUNC)), \
"Context size too large for inline context storage"); \
task.Context = task._inlineContext; \
task.TaskFunction = CAT(FUNC, Task); \
task.Parent = CurrentTask(); \
uint8_t getMask(const int16_t hash, const int16x8_t LRU)
{
// assert(hash & 0xF == 0);
const int16x8_t hash8 = {hash, hash, hash, hash,
hash, hash, hash, hash};
const int16x8_t LRUHashes = LRU & ~0xF;
const int16x8_t matches = LRUHashes == hash8;
// == sets the result element to 0xFF on match
const int16x8_t multi = {1 << 0, 1 << 1, 1 << 2, 1 << 3,
1 << 4, 1 << 5, 1 << 6, 1 << 7};
#define struct_key 0x6e9213
#define union_key 0x5a08cc
#define enum_key 0x42259d
#define auto_key 0x447fd2
#define void_key 0x4c07ce
#define char_key 0x44aaee
#define short_key 0x5ca984
#define int_key 0x3fff6d
#define long_key 0x46cc25
#define float_key 0x5a71a0
if ( (unsigned __int8)((v4 & 0xDF) - 65) <= 0x19u || WORD2(_RCX) == 95 )
{
v27 = -1;
HIDWORD(_RCX) = 0;
do
{
if ( (unsigned __int8)((v12 & 0xDF) - 65) > 0x19u && v12 != 95 && (unsigned int)(v12 - 48) > 9 )
break;
++HIDWORD(_RCX);
++v6;
if ( WORD2(_RCX) )
{
v11 = v9 - 1;
v12 = *(v9 - 1);
eatenChars += v6;
switch ( v12 )
{
default:
goto LABEL_17;
case '~':
#pragma once
#include <stdint.h>
#include <stdlib.h>
#define MAIN int main (int argc, char* argv[])
#define RANGE(FROM, TO) for (int it = (FROM); it < (TO); it++)
#define FOR(E, RANGE_) \
for(auto& E = (RANGE_).begin(), const auto& __end = (RANGE).end(); \
int write(int fd, const char*, unsigned long long length);
#define stderr_out(str) \
write(2, str, sizeof(str))
int main(int argc, char* argv[]) {
if (argc != 2)
{
stderr_out(
"bin_print expects one argument exactly which is the number to convert in hex or dec\n");
return -1;
From 7050d61d1c8a14077d0399ad5a7422aad16b79a8 Mon Sep 17 00:00:00 2001
From: Stefan Koch <[email protected]>
Date: Tue, 8 Feb 2022 11:14:38 +0100
Subject: [PATCH] Add __attribute__(naked)
---
tcc.h | 3 ++-
tccgen.c | 13 +++++++++++--
tcctok.h | 1 +
3 files changed, 14 insertions(+), 3 deletions(-)
#include <stdint.h>
extern char* u64tostr(uint64_t v, char buffer[21])
{
int i;
buffer[20] = '\0';
if (!v)
{
buffer[19] = '0';
return &buffer[19];
diff -Naur ghex-3.18.4/src/findreplace.c ghex-3.18.4.b/src/findreplace.c
--- ghex-3.18.4/src/findreplace.c 2019-07-13 08:18:43.000000000 +0200
+++ ghex-3.18.4.b/src/findreplace.c 2022-01-30 12:59:06.423961593 +0100
@@ -651,8 +651,10 @@
display_error_dialog(win,
_("Can not position cursor beyond the "
"End Of File!"));
- else
+ else {
gtk_hex_set_cursor(win->gh, byte);