Dataset Viewer
Auto-converted to Parquet Duplicate
repo_name
stringlengths
2
55
dataset
stringclasses
1 value
owner
stringlengths
3
31
lang
stringclasses
10 values
func_name
stringlengths
1
104
code
stringlengths
20
96.7k
docstring
stringlengths
1
4.92k
url
stringlengths
94
241
sha
stringlengths
40
40
BugChecker
github_2023
vitoplantamura
c
put_bits
static inline void put_bits(limb_t *tab, limb_t len, slimb_t pos, limb_t val) { limb_t i; int p; i = pos >> LIMB_LOG2_BITS; p = pos & (LIMB_BITS - 1); if (i < len) tab[i] |= val << p; if (p != 0) { i++; if (i < len) { tab[i] |= val >> (LIMB_BITS - p); ...
/***************************************************************/ /* Integer multiplication with FFT */ /* or LIMB_BITS at bit position 'pos' in tab */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/libbf.c#L7241-L7256
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetPerformByteOperation
ZyanStatus ZyanBitsetPerformByteOperation(ZyanBitset* destination, const ZyanBitset* source, ZyanBitsetByteOperation operation) { if (!destination || !source || !operation) { return ZYAN_STATUS_INVALID_ARGUMENT; } ZyanUSize s1; ZyanUSize s2; ZYAN_CHECK(ZyanVectorGetSize(&destination...
/* ---------------------------------------------------------------------------------------------- */ /* Logical operations */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L196-L224
8b81e76efe457b59be3a6e752efd43916ba0cabb
LenovoLegionLinux
github_2023
johnfanv2
c
eval_gbmd
static int eval_gbmd(acpi_handle handle, unsigned long *res) { return eval_int(handle, "VPC0.GBMD", res); }
//static int eval_qcho(acpi_handle handle, unsigned long *res) //{ // // \_SB.PCI0.LPC0.EC0.QCHO // return eval_int(handle, "QCHO", res); //}
https://github.com/johnfanv2/LenovoLegionLinux/blob/ae96a82adb879e729c5727c8769888b47ee1181f/kernel_module/legion-laptop.c#L1391-L1394
ae96a82adb879e729c5727c8769888b47ee1181f
teddycloud
github_2023
toniebox-reverse-engineering
c
f_sync
FRESULT f_sync ( FIL* fp /* Open file to be synced */ ) { FRESULT res; FATFS *fs; DWORD tm; BYTE *dir; res = validate(&fp->obj, &fs); /* Check validity of the file object */ if (res == FR_OK) { if (fp->flag & FA_MODIFIED) { /* Is there any change to the file? */ #if !FF_FS_TINY if (fp->flag & FA_DIRTY) {...
/*-----------------------------------------------------------------------*/ /* Synchronize the File */ /*-----------------------------------------------------------------------*/
https://github.com/toniebox-reverse-engineering/teddycloud/blob/83d3b29cbfc74e8f76f48f8782646c8e464055b2/fat/source/ff.c#L4135-L4205
83d3b29cbfc74e8f76f48f8782646c8e464055b2
teddycloud
github_2023
toniebox-reverse-engineering
c
putc_bfd
static void putc_bfd (putbuff* pb, TCHAR c) { UINT n; int i, nc; #if FF_USE_LFN && FF_LFN_UNICODE WCHAR hs, wc; #if FF_LFN_UNICODE == 2 DWORD dc; const TCHAR* tp; #endif #endif if (FF_USE_STRFUNC == 2 && c == '\n') { /* LF -> CRLF conversion */ putc_bfd(pb, '\r'); } i = pb->idx; /* Write index of pb->buf...
/* Buffered file write with code conversion */
https://github.com/toniebox-reverse-engineering/teddycloud/blob/83d3b29cbfc74e8f76f48f8782646c8e464055b2/fat/source/ff.c#L6578-L6704
83d3b29cbfc74e8f76f48f8782646c8e464055b2
flipper-zero-tutorials
github_2023
jamisonderek
c
gpio_7segment_disconnect_pin
void gpio_7segment_disconnect_pin(const GpioPin* pin) { furi_hal_gpio_init(pin, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow); furi_hal_gpio_write(pin, true); }
// Disconnects a GpioPin via OutputOpenDrive, PushPullNo, output true. // @pin pointer to GpioPin to disconnect.
https://github.com/jamisonderek/flipper-zero-tutorials/blob/89716a9b00eacce7055a75fddb5a3adde93f265f/gpio/gpio_7segment/gpio_7segment_app.c#L171-L174
89716a9b00eacce7055a75fddb5a3adde93f265f
flipper-zero-tutorials
github_2023
jamisonderek
c
rgbleds_reset
void rgbleds_reset(RgbLeds* leds) { for(int i = 0; i < leds->num_leds; i++) { leds->color[i] = 0x000000; } }
/** * @brief Resets the LEDs to their default color pattern (off). * @details This method resets the LEDs data to their default color pattern (off). * You must still call rgbleds_update to update the LEDs. * @param leds The RgbLeds struct to reset. */
https://github.com/jamisonderek/flipper-zero-tutorials/blob/89716a9b00eacce7055a75fddb5a3adde93f265f/js/flipboard/modules/js_rgbleds/rgbleds.c#L52-L56
89716a9b00eacce7055a75fddb5a3adde93f265f
SBEMU
github_2023
crazii
c
ct_timer_interrupt
static void ct_timer_interrupt(void *data, unsigned int status) { struct ct_timer *timer = data; /* Interval timer interrupt */ if ((status & IT_INT) && timer->ops->interrupt) timer->ops->interrupt(timer); }
/* * timer manager */
https://github.com/crazii/SBEMU/blob/f0cbde063396deb2c1246c9b3108a37755c68e9a/drivers/ctxfi/cttimer.c#L405-L412
f0cbde063396deb2c1246c9b3108a37755c68e9a
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
curlx_uztosi
int curlx_uztosi(size_t uznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(uznum <= (size_t) CURL_MASK_SINT); return (int)(uznum & (size_t) CURL_MASK_SINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif }
/* ** unsigned size_t to signed int */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/warnless.c#L181-L194
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_ipvalid
bool Curl_ipvalid(struct connectdata *conn) { if(conn->ip_version == CURL_IPRESOLVE_V6) return Curl_ipv6works(); return TRUE; }
/* * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've * been set and returns TRUE if they are OK. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/hostip6.c#L126-L131
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_infof
void Curl_infof(struct SessionHandle *data, const char *fmt, ...) { if(data && data->set.verbose) { va_list ap; size_t len; char print_buffer[2048 + 1]; va_start(ap, fmt); vsnprintf(print_buffer, sizeof(print_buffer), fmt, ap); va_end(ap); len = strlen(print_buffer); Curl_debug(data, C...
/* CURL_DO_LINEEND_CONV */ /* Curl_infof() is for info message along the way */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/sendf.c#L136-L148
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_single_getsock
int Curl_single_getsock(const struct connectdata *conn, curl_socket_t *sock, /* points to numsocks number of sockets */ int numsocks) { const struct SessionHandle *data = conn->data; int bitmap = GETSOCK_BLANK; unsigne...
/* * Curl_single_getsock() gets called by the multi interface code when the app * has requested to get the sockets for the current connection. This function * will then be called once for every connection that the multi interface * keeps track of. This function will only be called for connections that are * in the...
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/transfer.c#L1148-L1192
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_close
CURLcode Curl_close(struct SessionHandle *data) { struct Curl_multi *m; if(!data) return CURLE_OK; Curl_expire(data, 0); /* shut off timers */ m = data->multi; if(m) /* This handle is still part of a multi handle, take care of this first and detach this handle from there. */ curl_multi_...
/* * This is the internal function curl_easy_cleanup() calls. This should * cleanup and free all resources associated with this sessionhandle. * * NOTE: if we ever add something that attempts to write to a socket or * similar here, we must ignore SIGPIPE first. It is currently only done * when curl_easy_perform()...
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/url.c#L366-L450
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
get_request
static int get_request(curl_socket_t sock, struct httprequest *req) { int error; int fail = 0; int done_processing = 0; char *reqbuf = req->reqbuf; ssize_t got = 0; char *pipereq = NULL; size_t pipereq_length = 0; if(req->pipelining) { pipereq = reqbuf + req->checkindex; pipereq_length = req->...
/* return 0 on success, non-zero on failure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/tests/server/rtspd.c#L772-L880
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
pkey_cb
static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) { /* Since the structure must still be valid use ASN1_OP_FREE_PRE */ if(operation == ASN1_OP_FREE_PRE) { PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval; if (key->pkey->value.octet_string) OPENSSL_cleanse(key->...
/* Minor tweak to operation: zero private key data */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl/crypto/asn1/p8_pkey.c#L65-L76
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
asn1_do_lock
int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it) { const ASN1_AUX *aux; int *lck, ret; if ((it->itype != ASN1_ITYPE_SEQUENCE) && (it->itype != ASN1_ITYPE_NDEF_SEQUENCE)) return 0; aux = it->funcs; if (!aux || !(aux->flags & ASN1_AFLG_REFCOUNT)) return 0; lck = offset2ptr(*pval, aux->ref_o...
/* Do reference counting. The value 'op' decides what to do. * if it is +1 then the count is incremented. If op is 0 count is * set to 1. If op is -1 count is decremented and the return value * is the current refrence count or 0 if no reference count exists. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl/crypto/asn1/tasn_utl.c#L101-L126
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
TS_RESP_CTX_cleanup
static void TS_RESP_CTX_cleanup(TS_RESP_CTX *ctx) { TS_REQ_free(ctx->request); ctx->request = NULL; TS_RESP_free(ctx->response); ctx->response = NULL; TS_TST_INFO_free(ctx->tst_info); ctx->tst_info = NULL; }
/* Cleans up the variable part of the context. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl/crypto/ts/ts_rsp_sign.c#L495-L503
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
X509_STORE_CTX_trusted_stack
void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) { ctx->other_ctx = sk; ctx->get_issuer = get_issuer_sk; }
/* Set alternative lookup method: just a STACK of trusted certificates. * This avoids X509_STORE nastiness where it isn't needed. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl/crypto/x509/x509_vfy.c#L2128-L2132
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
app_info_free
static void app_info_free(APP_INFO *inf) { if (--(inf->references) <= 0) { if (inf->next != NULL) { app_info_free(inf->next); } OPENSSL_free(inf); } }
/* Valid iff num_disable > 0. * CRYPTO_LOCK_MALLOC2 is locked * exactly in this case (by the * thread named in disabling_thread). */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl_android/crypto/mem_dbg.c#L145-L155
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
asn1_collate_primitive
static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c) { ASN1_STRING *os=NULL; BUF_MEM b; int num; b.length=0; b.max=0; b.data=NULL; if (a == NULL) { c->error=ERR_R_PASSED_NULL_PARAMETER; goto err; } num=0; for (;;) { if (c->inf & 1) { c->eos=ASN1_const_check_infinite_end(&c...
/* We are about to parse 0..n d2i_ASN1_bytes objects, we are to collapse * them into the one structure that is then returned */ /* There have been a few bug fixes for this function from * Paul Keogh <paul.keogh@sse.ie>, many thanks to him */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl_android/crypto/asn1/a_bytes.c#L252-L313
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
BN_POOL_init
static void BN_POOL_init(BN_POOL *p) { p->head = p->current = p->tail = NULL; p->used = p->size = 0; }
/***********/ /* BN_POOL */ /***********/
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl_android/crypto/bn/bn_ctx.c#L360-L364
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
dynamic_data_ctx_free_func
static void dynamic_data_ctx_free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp) { if(ptr) { dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr; if(ctx->dynamic_dso) DSO_free(ctx->dynamic_dso); if(ctx->DYNAMIC_LIBNAME) OPENSSL_free((void*)ctx->DYNAMIC_LIBNAME); if(ct...
/* Because our ex_data element may or may not get allocated depending on whether * a "first-use" occurs before the ENGINE is freed, we have a memory leak * problem to solve. We can't declare a "new" handler for the ex_data as we * don't want a dynamic_data_ctx in *all* ENGINE structures of all types (this * is a bu...
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/openssl_android/crypto/engine/eng_dyn.c#L164-L180
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
png_destroy_write_struct
void PNGAPI png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr) { png_debug(1, "in png_destroy_write_struct"); if (png_ptr_ptr != NULL) { png_structrp png_ptr = *png_ptr_ptr; if (png_ptr != NULL) /* added in libpng 1.6.0 */ { png_destroy_info_struct(png_ptr,...
/* Free all memory used by the write. * In libpng 1.6.0 this API changed quietly to no longer accept a NULL value for * *png_ptr_ptr. Prior to 1.6.0 it would accept such a value and it would free * the passed in info_structs but it would quietly fail to free any of the data * inside them. In 1.6.0 it quietly does...
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/png/pngwrite.c#L900-L918
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
png_write_pHYs
void /* PRIVATE */ png_write_pHYs(png_structrp png_ptr, png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, int unit_type) { png_byte buf[9]; png_debug(1, "in png_write_pHYs"); if (unit_type >= PNG_RESOLUTION_LAST) png_warning(png_ptr, "Unrecognized unit type for pHYs chunk"); png...
/* Write the pHYs chunk */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/png/pngwutil.c#L1887-L1904
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
writepng_encode_image
int writepng_encode_image(mainprog_info *mainprog_ptr) { png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; /* as always, setjmp() must be called in every function that calls a * PNG-writing libpng function */ if (setjmp(mainprog_ptr...
/* returns 0 for success, 2 for libpng (longjmp) problem */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/png/contrib/gregbook/writepng.c#L259-L289
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
gpc_sRGB
static void gpc_sRGB(Pixel *out, const Pixel *in, const Background *back) { (void)back; out->r = isRGB(in->r); if (in->g == in->r) { out->g = out->r; if (in->b == in->r) out->b = out->r; else out->b = isRGB(in->b); } else { out->g = isRGB(in->g); ...
/* 16-bit to 8-bit conversions */ /* sRGB: convert linear components to sRGB, alpha := 255 */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/png/contrib/libtests/pngstest.c#L1598-L1631
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
is_leap
static int is_leap(int year) { /* Cast year to unsigned. The result is the same either way, but * C can generate faster code for unsigned mod than for signed * mod (especially for % 4 -- a good compiler should just grab * the last 2 bits when the LHS is unsigned). */ const unsigned int ayea...
/* year -> 1 if leap year, else 0. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Modules/datetimemodule.c#L176-L186
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
move_finalizers
static void move_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) { PyGC_Head *gc; PyGC_Head *next; /* March over unreachable. Move objects with finalizers into * `finalizers`. */ for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) { PyObject *op = FROM_GC(gc); ...
/* Move the objects in unreachable with __del__ methods into `finalizers`. * Objects moved into `finalizers` have gc_refs set to GC_REACHABLE; the * objects remaining in unreachable are left at GC_TENTATIVELY_UNREACHABLE. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Modules/gcmodule.c#L536-L556
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
sha_transform
static void sha_transform(SHAobject *sha_info) { int i; SHA_INT32 T, A, B, C, D, E, W[80], *WP; memcpy(W, sha_info->data, sizeof(sha_info->data)); longReverse(W, (int)sizeof(sha_info->data), sha_info->Endianness); for (i = 16; i < 80; ++i) { W[i] = W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16]; ...
/* do SHA transformation */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Modules/shamodule.c#L160-L217
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
deflate_slow
local block_state deflate_slow(s, flush) deflate_state *s; int flush; { IPos hash_head = NIL; /* head of hash chain */ int bflush; /* set if current block must be flushed */ /* Process the input block. */ for (;;) { /* Make sure that we always have enough lookahead, exce...
/* =========================================================================== * Same as above, but achieves better compression. We use a lazy * evaluation for matches: a match is finally adopted only if there is * no better match at the next window position. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Modules/zlib/deflate.c#L1554-L1674
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
int_print
static int int_print(PyIntObject *v, FILE *fp, int flags) /* flags -- not used but required by interface */ { long int_val = v->ob_ival; Py_BEGIN_ALLOW_THREADS fprintf(fp, "%ld", int_val); Py_END_ALLOW_THREADS return 0; }
/* ARGSUSED */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python/Objects/intobject.c#L442-L451
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
out_of_memory
LOCAL(void) out_of_memory (j_common_ptr cinfo, int which) /* Report an out-of-memory error and stop execution */ /* If we compiled MEM_STATS support, report alloc requests before dying */ { #ifdef MEM_STATS cinfo->err->trace_level = 2; /* force self_destruct to report stats */ #endif ERREXIT1(cinfo, JERR_OUT_OF_MEM...
/* MEM_STATS */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/python_modules/tools/jpeg-6b/jmemmgr.c#L216-L225
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
checkTreePage
static int checkTreePage( IntegrityCk *pCheck, /* Context for the sanity check */ int iPage, /* Page number of the page to check */ char *zParentContext, /* Parent context */ i64 *pnParentMinKey, i64 *pnParentMaxKey ){ MemPage *pPage; int i, rc, depth, d2, pgno, cnt; int hdr, cellStart; i...
/* ** Do various sanity checks on a single page of a tree. Return ** the tree depth. Root pages return 0. Parents of root pages ** return 1, and so forth. ** ** These checks are done: ** ** 1. Make sure that cells and freeblocks do not overlap ** but combine to completely cover the page. ** NO 2. ...
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/sqlite/sqlite3.c#L45990-L46197
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
removeFromBlockedList
static void removeFromBlockedList(sqlite3 *db){ sqlite3 **pp; assertMutexHeld(); for(pp=&sqlite3BlockedList; *pp; pp = &(*pp)->pNextBlocked){ if( *pp==db ){ *pp = (*pp)->pNextBlocked; break; } } }
/* ** Remove connection db from the blocked connections list. If connection ** db is not currently a part of the list, this function is a no-op. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/sqlite/sqlite3.c#L98900-L98909
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
fts3OffsetsFunc
static void fts3OffsetsFunc( sqlite3_context *pContext, /* SQLite function call context */ int nVal, /* Size of argument array */ sqlite3_value **apVal /* Array of arguments */ ){ Fts3Cursor *pCsr; /* Cursor handle passed through apVal[0] */ UNUSED_PARAMETER...
/* ** Implementation of the offsets() function for FTS3 */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/sqlite/sqlite3.c#L102042-L102057
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
deflatePending
int ZEXPORT deflatePending (strm, pending, bits) unsigned *pending; int *bits; z_streamp strm; { if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; if (pending != Z_NULL) *pending = strm->state->pending; if (bits != Z_NULL) *bits = strm->state->bi_valid; retu...
/* ========================================================================= */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/zip/deflate.c#L450-L461
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
gen_bitlen
local void gen_bitlen(s, desc) deflate_state *s; tree_desc *desc; /* the tree descriptor */ { ct_data *tree = desc->dyn_tree; int max_code = desc->max_code; const ct_data *stree = desc->stat_desc->static_tree; const intf *extra = desc->stat_desc->extra_bits; int base ...
/* =========================================================================== * Compute the optimal bit lengths for a tree and update the total bit length * for the current block. * IN assertion: the fields freq and dad are set, heap[heap_max] and * above are the tree nodes sorted by increasing frequency. * OU...
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/zip/trees.c#L488-L565
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
inflate_table9
int inflate_table9(type, lens, codes, table, bits, work) codetype type; unsigned short FAR *lens; unsigned codes; code FAR * FAR *table; unsigned FAR *bits; unsigned short FAR *work; { unsigned len; /* a code's length in bits */ unsigned sym; /* index of code symbols */ unsigned ...
/* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot include such an acknowledgment, I would appreciate that you keep this copyright string in the executable of your product. */ /* Build a set of tables to decode the pr...
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/zip/contrib/infback9/inftree9.c#L32-L324
4389085c8ce35cff887a4cc18fc47d1133d89ffb
audioFlux
github_2023
libAudioFlux
c
_conv_direct
static int _conv_direct(float *vArr1,int length1,float *vArr2,int length2, ConvModeType mode,float *vArr3){ int len=0; int start=0; if(mode==ConvMode_Full){ len=length1+length2-1; start=-length2+1; for(int i=start,n=0;i<length1;i++,n++){ for(int j=length2-1,k=i;j>=0;j--,k++){ float _value=0; ...
/*** 关于mode 以vArr1为准 N/M full N+M-1 same N valid N-M+1 ****/
https://github.com/libAudioFlux/audioFlux/blob/824f76d5f19d0358779e513d708a987e4fb9224e/src/dsp/conv_algorithm.c#L214-L255
824f76d5f19d0358779e513d708a987e4fb9224e
fenster
github_2023
zserge
c
G_SecretExitLevel
void G_SecretExitLevel (void) { // IF NO WOLF3D LEVELS, NO SECRET EXIT! if ( (gamemode == commercial) && (W_CheckNumForName("map31")<0)) secretexit = false; else secretexit = true; gameaction = ga_completed; }
// Here's for the german edition.
https://github.com/zserge/fenster/blob/e700581dfb7956dd161aee44fc0cff0663e789a1/examples/doom-c/g_game.c#L1335-L1344
e700581dfb7956dd161aee44fc0cff0663e789a1
fenster
github_2023
zserge
c
G_VanillaVersionCode
int G_VanillaVersionCode(void) { switch (gameversion) { case exe_doom_1_2: I_Error("Doom 1.2 does not have a version code!"); case exe_doom_1_666: return 106; case exe_doom_1_7: return 107; case exe_doom_1_8: return 108; cas...
// Get the demo version code appropriate for the version set in gameversion.
https://github.com/zserge/fenster/blob/e700581dfb7956dd161aee44fc0cff0663e789a1/examples/doom-c/g_game.c#L2040-L2056
e700581dfb7956dd161aee44fc0cff0663e789a1
fenster
github_2023
zserge
c
I_InitScale
void I_InitScale(byte *_src_buffer, byte *_dest_buffer, int _dest_pitch) { src_buffer = _src_buffer; dest_buffer = _dest_buffer; dest_pitch = _dest_pitch; }
// Called to set the source and destination buffers before doing the // scale.
https://github.com/zserge/fenster/blob/e700581dfb7956dd161aee44fc0cff0663e789a1/examples/doom-c/i_scale.c#L61-L66
e700581dfb7956dd161aee44fc0cff0663e789a1
fenster
github_2023
zserge
c
P_FindLowestCeilingSurrounding
fixed_t P_FindLowestCeilingSurrounding(sector_t* sec) { int i; line_t* check; sector_t* other; fixed_t height = INT_MAX; for (i=0 ;i < sec->linecount ; i++) { check = sec->lines[i]; other = getNextSector(check,sec); if (!other) continue; if (other->ceilingheight < height) ...
// // FIND LOWEST CEILING IN THE SURROUNDING SECTORS //
https://github.com/zserge/fenster/blob/e700581dfb7956dd161aee44fc0cff0663e789a1/examples/doom-c/p_spec.c#L391-L411
e700581dfb7956dd161aee44fc0cff0663e789a1
openvpn-ui
github_2023
d3vilh
c
unixOpen
static int unixOpen( sqlite3_vfs *pVfs, /* The VFS for which this is the xOpen method */ const char *zPath, /* Pathname of file to be opened */ sqlite3_file *pFile, /* The file descriptor to be filled in */ int flags, /* Input flags to control the opening */ int *...
/* ** Open the file zPath. ** ** Previously, the SQLite OS layer used three functions in place of this ** one: ** ** sqlite3OsOpenReadWrite(); ** sqlite3OsOpenReadOnly(); ** sqlite3OsOpenExclusive(); ** ** These calls correspond to the following combinations of flags: ** ** ReadWrite() -> (READWRITE...
https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L44613-L44892
690f84df426c13ad4742b61fd23e52fcdc489aa0
openvpn-ui
github_2023
d3vilh
c
sqlite3PagerSetSpillsize
SQLITE_PRIVATE int sqlite3PagerSetSpillsize(Pager *pPager, int mxPage){ return sqlite3PcacheSetSpillsize(pPager->pPCache, mxPage); }
/* ** Change the maximum number of in-memory pages that are allowed ** before attempting to spill pages to journal. */
https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L60624-L60626
690f84df426c13ad4742b61fd23e52fcdc489aa0
openvpn-ui
github_2023
d3vilh
c
sqlite3PagerSetFlags
SQLITE_PRIVATE void sqlite3PagerSetFlags( Pager *pPager, /* The pager to set safety level for */ unsigned pgFlags /* Various flags */ ){ unsigned level = pgFlags & PAGER_SYNCHRONOUS_MASK; if( pPager->tempFile ){ pPager->noSync = 1; pPager->fullSync = 0; pPager->extraSync = 0; }else{ ...
/* ** Adjust settings of the pager to those specified in the pgFlags parameter. ** ** The "level" in pgFlags & PAGER_SYNCHRONOUS_MASK sets the robustness ** of the database to damage due to OS crashes or power failures by ** changing the number of syncs()s when writing the journals. ** There are four levels: ** ** O...
https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L60710-L60743
690f84df426c13ad4742b61fd23e52fcdc489aa0
openvpn-ui
github_2023
d3vilh
c
sqlite3WalWriteLock
SQLITE_PRIVATE int sqlite3WalWriteLock(Wal *pWal, int bLock){ int rc = SQLITE_OK; assert( pWal->readLock<0 || bLock==0 ); if( bLock ){ assert( pWal->db ); if( walEnableBlocking(pWal) ){ rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1); if( rc==SQLITE_OK ){ pWal->writeLock = 1; } ...
/* ** If parameter bLock is true, attempt to enable blocking locks, take ** the WRITER lock, and then disable blocking locks. If blocking locks ** cannot be enabled, no attempt to obtain the WRITER lock is made. Return ** an SQLite error code if an error occurs, or SQLITE_OK otherwise. It is not ** an error if blocking...
https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L66966-L66983
690f84df426c13ad4742b61fd23e52fcdc489aa0
openvpn-ui
github_2023
d3vilh
c
sqlite3VdbeAssertMayAbort
SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){ int hasAbort = 0; int hasFkCounter = 0; int hasCreateTable = 0; int hasCreateIndex = 0; int hasInitCoroutine = 0; Op *pOp; VdbeOpIter sIter; if( v==0 ) return 0; memset(&sIter, 0, sizeof(sIter)); sIter.v = v; while( (pOp = opIt...
/* ** Check if the program stored in the VM associated with pParse may ** throw an ABORT exception (causing the statement, but not entire transaction ** to be rolled back). This condition is true if the main program or any ** sub-programs contains any of the following: ** ** * OP_Halt with P1=SQLITE_CONSTRAINT and P...
https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L85609-L85661
690f84df426c13ad4742b61fd23e52fcdc489aa0
openvpn-ui
github_2023
d3vilh
c
sessionStat1Sql
static int sessionStat1Sql(sqlite3 *db, SessionApplyCtx *p){ int rc = sessionSelectRow(db, "sqlite_stat1", p); if( rc==SQLITE_OK ){ rc = sessionPrepare(db, &p->pInsert, "INSERT INTO main.sqlite_stat1 VALUES(?1, " "CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, " "?3)...
/* ** Prepare statements for applying changes to the sqlite_stat1 table. ** These are similar to those created by sessionSelectRow(), ** sessionInsertRow(), sessionUpdateRow() and sessionDeleteRow() for ** other tables. */
https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L229415-L229432
690f84df426c13ad4742b61fd23e52fcdc489aa0
openvpn-ui
github_2023
d3vilh
c
fts5structEofMethod
static int fts5structEofMethod(sqlite3_vtab_cursor *cur){ Fts5StructVcsr *pCsr = (Fts5StructVcsr*)cur; return pCsr->pStruct==0; }
/* ** Return TRUE if the cursor has been moved off of the last ** row of output. */
https://github.com/d3vilh/openvpn-ui/blob/690f84df426c13ad4742b61fd23e52fcdc489aa0/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c#L249422-L249425
690f84df426c13ad4742b61fd23e52fcdc489aa0
Project-Alice
github_2023
schombert
c
ZSTD_findFrameCompressedSize
size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize) { return ZSTD_findFrameCompressedSize_advanced(src, srcSize, ZSTD_f_zstd1); }
/** ZSTD_findFrameCompressedSize() : * See docs in zstd.h * Note: compatible with legacy mode */
https://github.com/schombert/Project-Alice/blob/ad0c795edf7aab314439dbf68afca7a9a4c24bfb/src/zstd/decompress/zstd_decompress.c#L807-L810
ad0c795edf7aab314439dbf68afca7a9a4c24bfb
Project-Alice
github_2023
schombert
c
ZSTD_resetDStream
size_t ZSTD_resetDStream(ZSTD_DStream* dctx) { DEBUGLOG(4, "ZSTD_resetDStream"); FORWARD_IF_ERROR(ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only), ""); return ZSTD_startingInputLength(dctx->format); }
/* ZSTD_resetDStream() : * return : expected size, aka ZSTD_startingInputLength(). * this function cannot fail */
https://github.com/schombert/Project-Alice/blob/ad0c795edf7aab314439dbf68afca7a9a4c24bfb/src/zstd/decompress/zstd_decompress.c#L1770-L1775
ad0c795edf7aab314439dbf68afca7a9a4c24bfb
Project-Alice
github_2023
schombert
c
COVER_best_destroy
void COVER_best_destroy(COVER_best_t *best) { if (!best) { return; } COVER_best_wait(best); if (best->dict) { free(best->dict); } ZSTD_pthread_mutex_destroy(&best->mutex); ZSTD_pthread_cond_destroy(&best->cond); }
/** * Call COVER_best_wait() and then destroy the COVER_best_t. */
https://github.com/schombert/Project-Alice/blob/ad0c795edf7aab314439dbf68afca7a9a4c24bfb/src/zstd/dictBuilder/cover.c#L882-L892
ad0c795edf7aab314439dbf68afca7a9a4c24bfb
llvmbox
github_2023
rsms
c
fts_palloc
static int fts_palloc(FTS *sp, size_t size) { char *new; _DIAGASSERT(sp != NULL); #ifdef __FTS_COMPAT_LENGTH /* Protect against fts_pathlen overflow. */ if (size > USHRT_MAX + 1) { errno = ENAMETOOLONG; return (1); } #endif size = fts_pow2(size); new = realloc(sp->fts_path, size); if (new == 0) return (...
/* * Allow essentially unlimited paths; find, rm, ls should all work on any tree. * Most systems will allow creation of paths much longer than MAXPATHLEN, even * though the kernel won't resolve them. Round up the new size to a power of 2, * so we don't realloc the path 2 bytes at a time. */
https://github.com/rsms/llvmbox/blob/45b9a5a62f556bf8ec92899c18091109a14bbe2d/musl-fts/fts.c#L1153-L1174
45b9a5a62f556bf8ec92899c18091109a14bbe2d
llvmbox
github_2023
rsms
c
__eqsf2
int __eqsf2(fp_t a, fp_t b) { return __lesf2(a, b); }
// The alias mechanism doesn't work on Windows except for MinGW, so emit // wrapper functions.
https://github.com/rsms/llvmbox/blob/45b9a5a62f556bf8ec92899c18091109a14bbe2d/sysroots/compiler-rt/builtins/comparesf2.c#L73-L73
45b9a5a62f556bf8ec92899c18091109a14bbe2d
llvmbox
github_2023
rsms
c
csinhl
long double complex csinhl(long double complex z) { return csinh(z); }
//FIXME
https://github.com/rsms/llvmbox/blob/45b9a5a62f556bf8ec92899c18091109a14bbe2d/sysroots/libc/musl/src/complex/csinhl.c#L4-L7
45b9a5a62f556bf8ec92899c18091109a14bbe2d
llvmbox
github_2023
rsms
c
tre_make_trans
static reg_errcode_t tre_make_trans(tre_pos_and_tags_t *p1, tre_pos_and_tags_t *p2, tre_tnfa_transition_t *transitions, int *counts, int *offs) { tre_pos_and_tags_t *orig_p2 = p2; tre_tnfa_transition_t *trans; int i, j, k, l, dup, prev_p2_pos; if (transitions != NULL) while (p1->position >=...
/* Adds a transition from each position in `p1' to each position in `p2'. */
https://github.com/rsms/llvmbox/blob/45b9a5a62f556bf8ec92899c18091109a14bbe2d/sysroots/libc/musl/src/regex/regcomp.c#L2469-L2617
45b9a5a62f556bf8ec92899c18091109a14bbe2d
Flipper-Zero-RogueMaster-Firmware
github_2023
Kaliroot10
c
getRandomMove
Move getRandomMove(Position* position) { Move moves[MAX_BRANCHING_FACTOR]; int totalMoves = legalMoves(moves, position, position->toMove); int chosenMove = rand() % totalMoves; return moves[chosenMove]; }
/* _WIN32 */
https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/applications/plugins/.chess/fast_chess.c#L2806-L2811
f8b6725eac77eb4c833293d2c3be0b89a8a1678f
Flipper-Zero-RogueMaster-Firmware
github_2023
Kaliroot10
c
rfalNfcDepPSL
ReturnCode rfalNfcDepPSL(uint8_t BRS, uint8_t FSL) { ReturnCode ret; uint16_t rxLen; uint8_t msgIt; uint8_t txBuf[NFCIP_PSLREQ_LEN + NFCIP_PSLPAY_LEN]; uint8_t rxBuf[NFCIP_PSLRES_LEN]; msgIt = NFCIP_PSLREQ_LEN; txBuf[msgIt++] = BRS; txBuf[msgIt++] = FSL; /*************************...
/*******************************************************************************/
https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/lib/ST25RFAL002/source/rfal_nfcDep.c#L2078-L2132
f8b6725eac77eb4c833293d2c3be0b89a8a1678f
Flipper-Zero-RogueMaster-Firmware
github_2023
Kaliroot10
c
rfalST25xVPollerGetRandomNumber
ReturnCode rfalST25xVPollerGetRandomNumber( uint8_t flags, const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t* rcvLen) { rfalFieldOff(); platformDelay(RFAL_ST25TV02K_TRF_OFF); rfalNfcvPollerInitialize(); rfalFieldOnAndStartGT(); platformDelay(RFAL_ST25TV02K_TBOOT_RF)...
/*******************************************************************************/
https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/lib/ST25RFAL002/source/rfal_st25xv.c#L733-L754
f8b6725eac77eb4c833293d2c3be0b89a8a1678f
Flipper-Zero-RogueMaster-Firmware
github_2023
Kaliroot10
c
rfalTransceiveRunBlockingTx
static ReturnCode rfalTransceiveRunBlockingTx(void) { ReturnCode ret; do { rfalWorker(); ret = rfalGetTransceiveStatus(); } while(rfalIsTransceiveInTx() && (ret == ERR_BUSY)); if(rfalIsTransceiveInRx()) { return ERR_NONE; } return ret; }
/*******************************************************************************/
https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/lib/ST25RFAL002/source/st25r3916/rfal_rfst25r3916.c#L1560-L1573
f8b6725eac77eb4c833293d2c3be0b89a8a1678f
Flipper-Zero-RogueMaster-Firmware
github_2023
Kaliroot10
c
u8g2_SetupBuffer
void u8g2_SetupBuffer( u8g2_t* u8g2, uint8_t* buf, uint8_t tile_buf_height, u8g2_draw_ll_hvline_cb ll_hvline_cb, const u8g2_cb_t* u8g2_cb) { u8g2->font = NULL; //u8g2->kerning = NULL; //u8g2->get_kerning_cb = u8g2_GetNullKerning; //u8g2->ll_hvline = u8g2_ll_hvline_vertical_top_lsb; ...
/*============================================*/ /* This procedure is called after setting up the display (u8x8 structure). --> This is the central init procedure for u8g2 object */
https://github.com/Kaliroot10/Flipper-Zero-RogueMaster-Firmware/blob/f8b6725eac77eb4c833293d2c3be0b89a8a1678f/lib/u8g2/u8g2_setup.c#L72-L109
f8b6725eac77eb4c833293d2c3be0b89a8a1678f
PaxOS-8
github_2023
paxo-phone
c
iscleared
static int iscleared (global_State *g, const GCObject *o) { if (o == NULL) return 0; /* non-collectable value */ else if (novariant(o->tt) == LUA_TSTRING) { markobject(g, o); /* strings are 'values', so are never weak */ return 0; } else return iswhite(o); }
/* ** tells whether a key or value can be cleared from a weak ** table. Non-collectable objects are never removed from weak ** tables. Strings behave as 'values', so are never removed too. for ** other objects: if really collected, cannot keep them; for objects ** being finalized, keep them in keys, but not in values *...
https://github.com/paxo-phone/PaxOS-8/blob/ffa7fcb96f42632a2d6d61e7137d53bf809e673a/src/lib/lua/lgc.c#L185-L192
ffa7fcb96f42632a2d6d61e7137d53bf809e673a
PaxOS-8
github_2023
paxo-phone
c
traverseLclosure
static int traverseLclosure (global_State *g, LClosure *cl) { int i; markobjectN(g, cl->p); /* mark its prototype */ for (i = 0; i < cl->nupvalues; i++) { /* visit its upvalues */ UpVal *uv = cl->upvals[i]; markobjectN(g, uv); /* mark upvalue */ } return 1 + cl->nupvalues; }
/* ** Traverse a Lua closure, marking its prototype and its upvalues. ** (Both can be NULL while closure is being created.) */
https://github.com/paxo-phone/PaxOS-8/blob/ffa7fcb96f42632a2d6d61e7137d53bf809e673a/src/lib/lua/lgc.c#L604-L612
ffa7fcb96f42632a2d6d61e7137d53bf809e673a
PaxOS-8
github_2023
paxo-phone
c
report
static int report (lua_State *L, int status) { if (status != LUA_OK) { const char *msg = lua_tostring(L, -1); l_message(progname, msg); lua_pop(L, 1); /* remove message */ } return status; }
/* ** Check whether 'status' is not OK and, if so, prints the error ** message on the top of the stack. It assumes that the error object ** is a string, as it was either generated by Lua or by 'msghandler'. */
https://github.com/paxo-phone/PaxOS-8/blob/ffa7fcb96f42632a2d6d61e7137d53bf809e673a/src/lib/lua/lua.c#L121-L128
ffa7fcb96f42632a2d6d61e7137d53bf809e673a
GateEngine
github_2023
STREGAsGate
c
vorbis_analysis_wrote
int vorbis_analysis_wrote(vorbis_dsp_state *v, int vals){ vorbis_info *vi=v->vi; codec_setup_info *ci=vi->codec_setup; if(vals<=0){ int order=32; int i; float *lpc=alloca(order*sizeof(*lpc)); /* if it wasn't done earlier (very short sample) */ if(!v->preextrapolate) _preextrapolate_hel...
/* call with val<=0 to set eof */
https://github.com/STREGAsGate/GateEngine/blob/f755456c313b7e1b8686fd6fd599c29fcc732d64/Dependencies/Vorbis/block.c#L460-L520
f755456c313b7e1b8686fd6fd599c29fcc732d64
bread
github_2023
Theldus
c
handle_gdb_write_register
static int handle_gdb_write_register(const char *buff, size_t len) { uint32_t reg_num_gdb, reg_num_rm; const char *ptr, *dec; union minibuf value; static const int gdb_to_rm[] = /* EAX. */ /* GS. */ {7,6,5,4,3,2,1,0,13,15,14,12,11,10,9,8}; ptr = buff; expect_char('P', ptr, len)...
/** * @brief Handles the 'write register (P)' GDB command; * * Please note the the segment registers and EIP,EFLAGS * are 16-bit. An attempt to write a 32-bit value on them * will emit an error. * * Also note that the mapping from what we receive from * the serial device and the mapping expected by GDB * diffe...
https://github.com/Theldus/bread/blob/c4bb9efcae563481c31fa865b64e230d9888e627/gdb.c#L658-L704
c4bb9efcae563481c31fa865b64e230d9888e627
Hanshow-Auto-Updater
github_2023
MakersFunDuck
c
xTaskCheckForTimeOut
BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait ) { BaseType_t xReturn; configASSERT( pxTimeOut ); configASSERT( pxTicksToWait ); taskENTER_CRITICAL(); { /* Minor optimisation. The tick count cannot change in this block. */ const TickType_t xConstTickCount = xTi...
/*-----------------------------------------------------------*/
https://github.com/MakersFunDuck/Hanshow-Auto-Updater/blob/69306b53088f38eb913f933f63fce38946124457/ATC_TLSR_Paper-/Firmware/components/freertos/tasks.c#L3169-L3229
69306b53088f38eb913f933f63fce38946124457
Hanshow-Auto-Updater
github_2023
MakersFunDuck
c
MPU_xEventGroupSync
EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait ) { EventBits_t xReturn; BaseType_t xRunningPrivileged = xPortRaisePrivilege(); xReturn = xEventGroupSync( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTicksToWait ...
/*-----------------------------------------------------------*/
https://github.com/MakersFunDuck/Hanshow-Auto-Updater/blob/69306b53088f38eb913f933f63fce38946124457/ATC_TLSR_Paper-/Firmware/components/freertos/portable/Common/mpu_wrappers.c#L1094-L1103
69306b53088f38eb913f933f63fce38946124457
WinDiskWriter
github_2023
TechUnRestricted
c
wimlib_export_image
WIMLIBAPI int wimlib_export_image(WIMStruct *src_wim, int src_image, WIMStruct *dest_wim, const tchar *dest_name, const tchar *dest_description, int export_flags) { int ret; int start_src_image; int end_src_image; int orig_dest_image_count; int image; bool all_images = (src_image == ...
/* API function documented in wimlib.h */
https://github.com/TechUnRestricted/WinDiskWriter/blob/86a003b84ecf0e3e4edd315b202eca3f01c6c0cc/WinDiskWriter/libs/wimlib/src/export_image.c#L108-L295
86a003b84ecf0e3e4edd315b202eca3f01c6c0cc
WinDiskWriter
github_2023
TechUnRestricted
c
lzms_remove_bits
static forceinline void lzms_remove_bits(struct lzms_input_bitstream *is, unsigned num_bits) { is->bitbuf <<= num_bits; is->bitsleft -= num_bits; }
/* Remove @num_bits bits from the bitbuffer variable. */
https://github.com/TechUnRestricted/WinDiskWriter/blob/86a003b84ecf0e3e4edd315b202eca3f01c6c0cc/WinDiskWriter/libs/wimlib/src/lzms_decompress.c#L418-L423
86a003b84ecf0e3e4edd315b202eca3f01c6c0cc
WinDiskWriter
github_2023
TechUnRestricted
c
extract_encrypted_file
static int extract_encrypted_file(const struct wim_dentry *dentry, struct win32_apply_ctx *ctx) { void *rawctx; DWORD err; ULONG flags; bool retried; /* Temporarily build a Win32 path for OpenEncryptedFileRaw() */ build_win32_extraction_path(dentry, ctx); flags = CREATE_FOR_IMPORT | OVERWRITE_HIDDEN;...
/* * Write the raw encrypted data to the already-created file (or directory) * corresponding to @dentry. * * The raw encrypted data is provided in ctx->data_buffer, and its size is * ctx->encrypted_size. * * This function may close the target directory, in which case the caller needs * to re-open it if needed. ...
https://github.com/TechUnRestricted/WinDiskWriter/blob/86a003b84ecf0e3e4edd315b202eca3f01c6c0cc/WinDiskWriter/libs/wimlib/src/win32_apply.c#L2264-L2313
86a003b84ecf0e3e4edd315b202eca3f01c6c0cc
WinDiskWriter
github_2023
TechUnRestricted
c
generate_random_sid
static size_t generate_random_sid(wimlib_SID *sid, struct generation_context *ctx) { u32 r = rand32(); sid->revision = 1; if (r & 1) { /* Common SID */ r = (r >> 1) % ARRAY_LEN(common_sids); sid->sub_authority_count = common_sids[r].num_subauthorities; for (int i = 0; i < 6; i++) { sid->identifier_aut...
/* Generate a SID and return its size in bytes. */
https://github.com/TechUnRestricted/WinDiskWriter/blob/86a003b84ecf0e3e4edd315b202eca3f01c6c0cc/WinDiskWriter/libs/wimlib/src/test_support/test_support.c#L270-L300
86a003b84ecf0e3e4edd315b202eca3f01c6c0cc
rebar
github_2023
BurntSushi
c
show_parsed
static void show_parsed(compile_block *cb) { uint32_t *pptr = cb->parsed_pattern; for (;;) { int max, min; PCRE2_SIZE offset; uint32_t i; uint32_t length; uint32_t meta_arg = META_DATA(*pptr); fprintf(stderr, "+++ %02d %.8x ", (int)(pptr - cb->parsed_pattern), *pptr); if (*pptr < META_END) { ...
/************************************************* * Show the parsed pattern for debugging * *************************************************/ /* For debugging the pre-scan, this code, which outputs the parsed data vector, can be enabled. */
https://github.com/BurntSushi/rebar/blob/19aa8e8e3bd3a4bc0ef6e07774d900e5f4840fad/engines/pcre2/upstream/src/pcre2_compile.c#L922-L1181
19aa8e8e3bd3a4bc0ef6e07774d900e5f4840fad
rebar
github_2023
BurntSushi
c
convert_glob_char_in_class
static BOOL convert_glob_char_in_class(int class_index, PCRE2_UCHAR c) { switch (class_index) { case 1: return isalnum(c); case 2: return isalpha(c); case 3: return 1; case 4: return c == CHAR_HT || c == CHAR_SPACE; case 5: return iscntrl(c); case 6: return isdigit(c); case 7: return isgraph(c); case ...
/* Checks whether the character is in the class. Arguments: class_index class index c character Returns: !0 => character is found in the class 0 => otherwise */
https://github.com/BurntSushi/rebar/blob/19aa8e8e3bd3a4bc0ef6e07774d900e5f4840fad/engines/pcre2/upstream/src/pcre2_convert.c#L540-L560
19aa8e8e3bd3a4bc0ef6e07774d900e5f4840fad
GEARdrones
github_2023
Excitablecell
c
arm_cmplx_mult_real_f32
void arm_cmplx_mult_real_f32( float32_t * pSrcCmplx, float32_t * pSrcReal, float32_t * pCmplxDst, uint32_t numSamples) { float32_t in; /* Temporary variable to store input value */ uint32_t blkCnt; /* loop counters */ #if defined (ARM_MATH_DSP)...
/** * @ingroup groupCmplxMath */ /** * @defgroup CmplxByRealMult Complex-by-Real Multiplication * * Multiplies a complex vector by a real vector and generates a complex result. * The data in the complex arrays is stored in an interleaved fashion * (real, imag, real, imag, ...). * The parameter <code>numSamples<...
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f32.c#L73-L209
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
HAL_DCMI_EnableCrop
HAL_StatusTypeDef HAL_DCMI_EnableCrop(DCMI_HandleTypeDef *hdcmi) { /* Process Locked */ __HAL_LOCK(hdcmi); /* Lock the DCMI peripheral state */ hdcmi->State = HAL_DCMI_STATE_BUSY; /* Enable DCMI Crop feature */ hdcmi->Instance->CR |= (uint32_t)DCMI_CR_CROP; /* Change the DCMI state*/ hdcmi->State = H...
/** * @brief Enable the Crop feature. * @param hdcmi pointer to a DCMI_HandleTypeDef structure that contains * the configuration information for DCMI. * @retval HAL status */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi.c#L795-L813
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
HAL_DSI_Start
HAL_StatusTypeDef HAL_DSI_Start(DSI_HandleTypeDef *hdsi) { /* Process locked */ __HAL_LOCK(hdsi); /* Enable the DSI host */ __HAL_DSI_ENABLE(hdsi); /* Enable the DSI wrapper */ __HAL_DSI_WRAPPER_ENABLE(hdsi); /* Process unlocked */ __HAL_UNLOCK(hdsi); return HAL_OK; }
/** * @brief Start the DSI module * @param hdsi pointer to a DSI_HandleTypeDef structure that contains * the configuration information for the DSI. * @retval HAL status */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dsi.c#L1452-L1467
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
HAL_FMPI2C_Master_Transmit_IT
HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit_IT(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) { uint32_t xfermode; if (hfmpi2c->State == HAL_FMPI2C_STATE_READY) { if (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) ...
/** * @brief Transmit in master mode an amount of data in non-blocking mode with Interrupt * @param hfmpi2c Pointer to a FMPI2C_HandleTypeDef structure that contains * the configuration information for the specified FMPI2C. * @param DevAddress Target device address: The device 7 bits address v...
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c.c#L1614-L1673
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
HAL_I2SEx_TransmitReceive_DMA
HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size) { uint32_t *tmp = NULL; uint32_t tmp1 = 0U; ...
/** * @brief Full-Duplex Transmit/Receive data in non-blocking mode using DMA * @param hi2s pointer to a I2S_HandleTypeDef structure that contains * the configuration information for I2S module * @param pTxData a 16-bit pointer to the Transmit data buffer. * @param pRxData a 16-bit pointer to the ...
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c#L541-L672
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
HAL_LTDC_EnableDither
HAL_StatusTypeDef HAL_LTDC_EnableDither(LTDC_HandleTypeDef *hltdc) { /* Process locked */ __HAL_LOCK(hltdc); /* Change LTDC peripheral state */ hltdc->State = HAL_LTDC_STATE_BUSY; /* Enable Dither by setting DTEN bit */ LTDC->GCR |= (uint32_t)LTDC_GCR_DEN; /* Change the LTDC state*/ hltdc->State = HA...
/** * @brief Enable Dither. * @param hltdc pointer to a LTDC_HandleTypeDef structure that contains * the configuration information for the LTDC. * @retval HAL status */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c#L1059-L1077
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
HAL_PCCARD_ITCallback
__weak void HAL_PCCARD_ITCallback(PCCARD_HandleTypeDef *hpccard) { /* Prevent unused argument(s) compilation warning */ UNUSED(hpccard); /* NOTE : This function Should not be modified, when the callback is needed, the HAL_PCCARD_ITCallback could be implemented in the user file */ }
/** * @brief PCCARD interrupt feature callback * @param hpccard pointer to a PCCARD_HandleTypeDef structure that contains * the configuration information for PCCARD module. * @retval None */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c#L678-L685
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
HAL_PWREx_DisableMainRegulatorLowVoltage
void HAL_PWREx_DisableMainRegulatorLowVoltage(void) { *(__IO uint32_t *) CR_MRLVDS_BB = (uint32_t)DISABLE; }
/** * @brief Disables Main Regulator low voltage mode. * @note This mode is only available for STM32F401xx/STM32F410xx/STM32F411xx/STM32F412Zx/STM32F412Rx/STM32F412Vx/STM32F412Cx/ * STM32F413xx/STM32F423xxdevices. * @retval None */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c#L372-L375
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
HAL_RNG_ReadLastRandomNumber
uint32_t HAL_RNG_ReadLastRandomNumber(RNG_HandleTypeDef *hrng) { return (hrng->RandomNumber); }
/** * @brief Read latest generated random number. * @param hrng pointer to a RNG_HandleTypeDef structure that contains * the configuration information for RNG. * @retval random value */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c#L771-L774
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
HAL_SMBUS_UnRegisterCallback
HAL_StatusTypeDef HAL_SMBUS_UnRegisterCallback(SMBUS_HandleTypeDef *hsmbus, HAL_SMBUS_CallbackIDTypeDef CallbackID) { HAL_StatusTypeDef status = HAL_OK; /* Process locked */ __HAL_LOCK(hsmbus); if (HAL_SMBUS_STATE_READY == hsmbus->State) { switch (CallbackID) { case HAL_SMBUS_MASTER_TX_COMPLET...
/** * @brief Unregister an SMBUS Callback * SMBUS callback is redirected to the weak predefined callback * @param hsmbus Pointer to a SMBUS_HandleTypeDef structure that contains * the configuration information for the specified SMBUS. * @param CallbackID ID of the callback to be unre...
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_smbus.c#L687-L776
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
LL_DMA_Init
uint32_t LL_DMA_Init(DMA_TypeDef *DMAx, uint32_t Stream, LL_DMA_InitTypeDef *DMA_InitStruct) { /* Check the DMA Instance DMAx and Stream parameters*/ assert_param(IS_LL_DMA_ALL_STREAM_INSTANCE(DMAx, Stream)); /* Check the DMA parameters from DMA_InitStruct */ assert_param(IS_LL_DMA_DIRECTION(DMA_InitStruct->Di...
/** * @brief Initialize the DMA registers according to the specified parameters in DMA_InitStruct. * @note To convert DMAx_Streamy Instance to DMAx Instance and Streamy, use helper macros : * @arg @ref __LL_DMA_GET_INSTANCE * @arg @ref __LL_DMA_GET_STREAM * @param DMAx DMAx Instance * @p...
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c#L285-L378
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
FMC_NAND_Init
HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef *Init) { uint32_t tmpr = 0U; /* Check the parameters */ assert_param(IS_FMC_NAND_DEVICE(Device)); assert_param(IS_FMC_NAND_BANK(Init->NandBank)); assert_param(IS_FMC_WAIT_FEATURE(Init->Waitfeature)); assert_param(IS_FMC_NA...
/* defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) */ /** @defgroup HAL_FMC_NAND_Group1 Initialization/de-initialization functions * @brief Initialization and Configuration functions * @verbatim ==================================================================...
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c#L754-L806
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
LL_LPTIM_StructInit
void LL_LPTIM_StructInit(LL_LPTIM_InitTypeDef *LPTIM_InitStruct) { /* Set the default configuration */ LPTIM_InitStruct->ClockSource = LL_LPTIM_CLK_SOURCE_INTERNAL; LPTIM_InitStruct->Prescaler = LL_LPTIM_PRESCALER_DIV1; LPTIM_InitStruct->Waveform = LL_LPTIM_OUTPUT_WAVEFORM_PWM; LPTIM_InitStruct->Polarity...
/** * @brief Set each fields of the LPTIM_InitStruct structure to its default * value. * @param LPTIM_InitStruct pointer to a @ref LL_LPTIM_InitTypeDef structure * @retval None */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_lptim.c#L122-L129
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
USB_DisableGlobalInt
HAL_StatusTypeDef USB_DisableGlobalInt(USB_OTG_GlobalTypeDef *USBx) { USBx->GAHBCFG &= ~USB_OTG_GAHBCFG_GINT; return HAL_OK; }
/** * @brief USB_DisableGlobalInt * Disable the controller's Global Int in the AHB Config reg * @param USBx Selected device * @retval HAL status */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c#L234-L238
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
USB_ResetPort
HAL_StatusTypeDef USB_ResetPort(USB_OTG_GlobalTypeDef *USBx) { uint32_t USBx_BASE = (uint32_t)USBx; __IO uint32_t hprt0 = 0U; hprt0 = USBx_HPRT0; hprt0 &= ~(USB_OTG_HPRT_PENA | USB_OTG_HPRT_PCDET | USB_OTG_HPRT_PENCHNG | USB_OTG_HPRT_POCCHNG); USBx_HPRT0 = (USB_OTG_HPRT_PRST | hprt0); HAL_D...
/** * @brief USB_OTG_ResetPort : Reset Host Port * @param USBx Selected device * @retval HAL status * @note (1)The application must wait at least 10 ms * before clearing the reset bit. */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c#L1532-L1549
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
mpu_set_accel_fsr
int mpu_set_accel_fsr(unsigned char fsr) { unsigned char data; if (!(st.chip_cfg.sensors)) return -1; switch (fsr) { case 2: data = INV_FSR_2G << 3; break; case 4: data = INV_FSR_4G << 3; break; case 8: data = INV_FSR_8G << 3; break; ...
/** * @brief Set the accel full-scale range. * @param[in] fsr Desired full-scale range. * @return 0 if successful. */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/GearLL/Drivers/Devices/MPU6050/inv_mpu.c#L1248-L1278
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
mpu_set_int_level
int mpu_set_int_level(unsigned char active_low) { st.chip_cfg.active_low_int = active_low; return 0; }
/** * @brief Set interrupt level. * @param[in] active_low 1 for active low, 0 for active high. * @return 0 if successful. */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/GearLL/Drivers/Devices/MPU6050/inv_mpu.c#L1869-L1873
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
mpu_get_compass_fsr
int mpu_get_compass_fsr(unsigned short *fsr) { #ifdef AK89xx_SECONDARY fsr[0] = st.hw->compass_fsr; return 0; #else return -1; #endif }
/** * @brief Get the compass full-scale range. * @param[out] fsr Current full-scale range. * @return 0 if successful. */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/GearLL/Drivers/Devices/MPU6050/inv_mpu.c#L2590-L2598
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
SEGGER_SYSVIEW_RecordU32x4
void SEGGER_SYSVIEW_RecordU32x4(unsigned int EventID, U32 Para0, U32 Para1, U32 Para2, U32 Para3) { U8* pPayload; U8* pPayloadStart; RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 4 * SEGGER_SYSVIEW_QUANTA_U32); // pPayload = pPayloadStart; ENCODE_U32(pPayload, Para0); ENCODE_U32(pPayload, Para1); ENCODE_U32(p...
/********************************************************************* * * SEGGER_SYSVIEW_RecordU32x4() * * Function description * Formats and sends a SystemView packet containing 4 U32 parameter payload. * * Parameters * EventID - SystemView event ID. * Para0 - The 32-bit parameter encoded to System...
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone-F4/Middlewares/SEGGER/SEGGER_SYSVIEW.c#L1389-L1401
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
I2C_MasterReceive_RXNE
static void I2C_MasterReceive_RXNE(I2C_HandleTypeDef *hi2c) { if (hi2c->State == HAL_I2C_STATE_BUSY_RX) { uint32_t tmp; tmp = hi2c->XferCount; if (tmp > 3U) { /* Read data from DR */ *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR; /* Increment Buffer pointer */ hi2c->pBuffPt...
/** * @brief Handle RXNE flag for Master * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains * the configuration information for I2C module * @retval None */
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone_Lite/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c#L5615-L5715
489001958d76c251128a953a47555c68bfe65fd8
GEARdrones
github_2023
Excitablecell
c
UART_WaitOnFlagUntilTimeout
static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout) { /* Wait until flag is set */ while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) { /* Check for the Timeout */ if (Timeout != HAL_MAX_DEL...
/** * @brief This function handles UART Communication Timeout. * @param huart Pointer to a UART_HandleTypeDef structure that contains * the configuration information for the specified UART module. * @param Flag specifies the UART flag to check. * @param Status The new Flag status (SET or R...
https://github.com/Excitablecell/GEARdrones/blob/489001958d76c251128a953a47555c68bfe65fd8/Firmware/GEARdrone_Lite/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c#L3167-L3192
489001958d76c251128a953a47555c68bfe65fd8
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
17