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
FPGA_Library
github_2023
suisuisi
c
XIic_SetOptions
void XIic_SetOptions(XIic *InstancePtr, u32 NewOptions) { u32 CntlReg; Xil_AssertVoid(InstancePtr != NULL); XIic_IntrGlobalDisable(InstancePtr->BaseAddress); /* * Update the options in the instance and get the contents of the * control register such that the general call option can be modified. */ Instanc...
/************************** Constant Definitions ***************************/ /**************************** Type Definitions *****************************/ /***************** Macros (Inline Functions) Definitions *******************/ /************************** Function Prototypes ****************************/ /*******...
https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodHYGRO_v1_0/drivers/PmodHYGRO_v1_0/src/xiic_options.c#L116-L147
1e33525198872d63ced48e8f0cebaa2419b9eb22
FPGA_Library
github_2023
suisuisi
c
NAV_ReadRegister
void NAV_ReadRegister(PmodNAV *InstancePtr, uint8_t bInst, uint8_t bAddr, uint8_t bCntBytes, uint8_t *pData) { u8 recv[bCntBytes + 1]; int i = 0; for (i = 0; i < bCntBytes; i++) { recv[i + 1] = 0; } // Add write bit if (bInst == NAV_INST_AG) recv[0] = bAddr | 0x80; else re...
/* ------------------------------------------------------------ */ /*** void NAV_ReadRegister(PmodNAV *InstancePtr, uint8_t bInst, uint8_t bAddr, uint8_t bCntBytes, uint8_t *pData) ** ** Parameters: ** InstancePtr - instance of PmodNAV ** bInst - instrument Chip Select to be used: Accelerometer/Gyro, ...
https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodNAV_v1_0/drivers/PmodNAV_v1_0/src/PmodNAV.c#L565-L591
1e33525198872d63ced48e8f0cebaa2419b9eb22
FPGA_Library
github_2023
suisuisi
c
NAV_SetIntThresholdALT
void NAV_SetIntThresholdALT(PmodNAV *InstancePtr, float thVal) { u8 buffer[2]; u16 bthVal; // Converts the float value in gauss to raw magnetic field data to be written // in NAV_MAG_INT_THS_L/NAV_MAG_INT_THS_H registers bthVal = (u16) (thVal * 4096); // Split bytes // Make sure the first bit of th...
/* ------------------------------------------------------------ */ /*** void NAV_SetIntThresholdALT(PmodNAV *InstancePtr, float thVal) ** ** Parameters: ** InstancePtr - instance of PmodNAV ** thVal - the interrupt threshold parameter for alt instrument ** ** Return Value: ** None ** ** Error...
https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodNAV_v1_0/drivers/PmodNAV_v1_0/src/PmodNAV.c#L2100-L2113
1e33525198872d63ced48e8f0cebaa2419b9eb22
FPGA_Library
github_2023
suisuisi
c
DynRecvMasterData
static void DynRecvMasterData(XIic *InstancePtr) { u8 LoopCnt; u8 BytesInFifo; u8 BytesToRead; u32 CntlReg; /* * Device is a master receiving, get the contents of the control * register and determine the number of bytes in fifo to be read out. */ CntlReg = XIic_ReadReg(InstancePtr->BaseAddress, XIIC_CR_REG...
/*****************************************************************************/ /** * * This function is called when the receive register is full. The number * of bytes received to cause the interrupt is adjustable using the Receive FIFO * Depth register. The number of bytes in the register is read in the Receive * FIF...
https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodRTCC_v1_0/drivers/PmodRTCC_v1_0/src/xiic_dyn_master.c#L466-L555
1e33525198872d63ced48e8f0cebaa2419b9eb22
FPGA_Library
github_2023
suisuisi
c
DynSendMasterData
static void DynSendMasterData(XIic *InstancePtr) { u32 CntlReg; /* * In between 1st and last byte of message, fill the FIFO with more data * to send, disable the 1/2 empty interrupt based upon data left to * send. */ if (InstancePtr->SendByteCount > 1) { XIic_TransmitFifoFill(InstancePtr, XIIC_MASTER_ROLE...
/****************************************************************************** * * When the IIC Tx FIFO/register goes empty, this routine is called by the * interrupt service routine to fill the transmit FIFO with data to be sent. * * This function also is called by the Tx � empty interrupt as the data handling * is i...
https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodTMP3_v1_0/drivers/PmodTMP3_v1_0/src/xiic_dyn_master.c#L218-L294
1e33525198872d63ced48e8f0cebaa2419b9eb22
FPGA_Library
github_2023
suisuisi
c
WF_SecurityWpaSet
void WF_SecurityWpaSet(t_wpaContext* p_context) { #if defined(WF_ERROR_CHECKING) uint32_t errorCode; errorCode = UdSetSecurityWpa(p_context); if (errorCode != UD_SUCCESS) { EventEnqueue(WF_EVENT_ERROR, errorCode); return; } #endif /* WF_ERROR_CHECKING */ WF_SetSecurity(p_contex...
//============================================================================
https://github.com/suisuisi/FPGA_Library/blob/1e33525198872d63ced48e8f0cebaa2419b9eb22/ThreePart/digilent_ip/ip/Pmods/PmodWIFI_v1_0/drivers/PmodWIFI_v1_0/src/MRF24G/utility/wf_connection_profile.c#L367-L384
1e33525198872d63ced48e8f0cebaa2419b9eb22
MCUViewer
github_2023
klonyyy
c
HAL_DMAEx_ConfigMuxRequestGenerator
HAL_StatusTypeDef HAL_DMAEx_ConfigMuxRequestGenerator(DMA_HandleTypeDef *hdma, HAL_DMA_MuxRequestGeneratorConfigTypeDef *pRequestGeneratorConfig) { /* Check the parameters */ assert_param(IS_DMA_ALL_INSTANCE(hdma->Instance)); assert_param(IS_DMAMUX_REQUEST_GE...
/** * @brief Configure the DMAMUX request generator block used by the given DMA channel (instance). * @param hdma: pointer to a DMA_HandleTypeDef structure that contains * the configuration information for the specified DMA channel. * @param pRequestGeneratorConfig : pointer to HAL_...
https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_dma_ex.c#L141-L173
3650ed7feaff963ca76abcb72423ee220cdbfa69
MCUViewer
github_2023
klonyyy
c
HAL_EXTI_GetConfigLine
HAL_StatusTypeDef HAL_EXTI_GetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig) { __IO uint32_t *regaddr; uint32_t regval; uint32_t linepos; uint32_t maskline; uint32_t offset; /* Check null pointer */ if ((hexti == NULL) || (pExtiConfig == NULL)) { return HAL_ERROR; } /* ...
/** * @brief Get configuration of a dedicated Exti line. * @param hexti Exti handle. * @param pExtiConfig Pointer on structure to store Exti configuration. * @retval HAL Status. */
https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_exti.c#L268-L356
3650ed7feaff963ca76abcb72423ee220cdbfa69
MCUViewer
github_2023
klonyyy
c
FLASH_OB_BootLockConfig
static HAL_StatusTypeDef FLASH_OB_BootLockConfig(uint32_t BootLockConfig) { HAL_StatusTypeDef status; /* Check the parameters */ assert_param(IS_OB_BOOT_LOCK(BootLockConfig)); /* Wait for last operation to be completed */ status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if (status == H...
/** * @brief Configure the Boot Lock into Option Bytes. * @note To configure any option bytes, the option lock bit OPTLOCK must be * cleared with the call of HAL_FLASH_OB_Unlock() function. * @note New option bytes configuration will be taken into account in two cases: * - after an option...
https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_flash_ex.c#L1175-L1197
3650ed7feaff963ca76abcb72423ee220cdbfa69
MCUViewer
github_2023
klonyyy
c
HAL_TIM_PWM_Start_IT
HAL_StatusTypeDef HAL_TIM_PWM_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) { HAL_StatusTypeDef status = HAL_OK; uint32_t tmpsmcr; /* Check the parameters */ assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel)); /* Check the TIM channel state */ if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_T...
/** * @brief Starts the PWM signal generation in interrupt mode. * @param htim TIM PWM handle * @param Channel TIM Channel to be enabled * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected * @arg TIM_CHANNEL_2: TIM Channel 2 sel...
https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_tim.c#L1566-L1646
3650ed7feaff963ca76abcb72423ee220cdbfa69
MCUViewer
github_2023
klonyyy
c
HAL_TIM_IC_Stop_DMA
HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) { HAL_StatusTypeDef status = HAL_OK; /* Check the parameters */ assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel)); assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance)); /* Disable the Input Capture channel */ TIM_CCxC...
/** * @brief Stops the TIM Input Capture measurement in DMA mode. * @param htim TIM Input Capture handle * @param Channel TIM Channels to be disabled * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected * @arg TIM_CHANNEL_2: TIM ...
https://github.com/klonyyy/MCUViewer/blob/3650ed7feaff963ca76abcb72423ee220cdbfa69/example/MCUViewer_test/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_tim.c#L2546-L2608
3650ed7feaff963ca76abcb72423ee220cdbfa69
kui.nvim
github_2023
romgrk
c
cairo_xlib_surface_set_size
void cairo_xlib_surface_set_size (cairo_surface_t *abstract_surface, int width, int height) { cairo_xlib_surface_t *surface = (cairo_xlib_surface_t *) abstract_surface; cairo_status_t status; if (unlikely (abstract_surface->status)) return; if (unlikely (abstr...
/** * cairo_xlib_surface_set_size: * @surface: a #cairo_surface_t for the XLib backend * @width: the new width of the surface * @height: the new height of the surface * * Informs cairo of the new size of the X Drawable underlying the * surface. For a surface created for a Window (rather than a Pixmap), * this f...
https://github.com/romgrk/kui.nvim/blob/b3b2f53d6678dce86acc91043b32eab6059ce0cf/lua/kui/cairo/csrc/cairo/src/cairo-xlib-surface.c#L2090-L2131
b3b2f53d6678dce86acc91043b32eab6059ce0cf
QCVM
github_2023
erysdren
c
qcvm_set_parm_int
void qcvm_set_parm_int(qcvm_t *qcvm, int parm, int val) { GET_INT(OFS_PARM0 + (parm * 3)) = val; }
/* set integer parameter */
https://github.com/erysdren/QCVM/blob/acd27d22c040f0636df61b4c8fb92a81e455262a/qcvm/qcvm_parameters.c#L68-L71
acd27d22c040f0636df61b4c8fb92a81e455262a
ps4-ezremote-client
github_2023
cy33hc
c
terminate_jbc
void terminate_jbc() { if (!is_jailbroken()) return; // Restores original creds jbc_set_cred(&g_Cred); }
// Unload libjbc libraries
https://github.com/cy33hc/ps4-ezremote-client/blob/b7fe46cb94310f8591275d3c34107b5944137a4a/source/orbis_jbc.c#L115-L122
b7fe46cb94310f8591275d3c34107b5944137a4a
GlobalSfMpy
github_2023
zhangganlin
c
LZ4HC_Insert
FORCE_INLINE void LZ4HC_Insert (LZ4HC_Data_Structure* hc4, const BYTE* ip) { U16* chainTable = hc4->chainTable; U32* HashTable = hc4->hashTable; const BYTE* const base = hc4->base; const U32 target = (U32)(ip - base); U32 idx = hc4->nextToUpdate; while(idx < target) { U32 h = LZ4HC...
/* Update chains up to ip (excluded) */
https://github.com/zhangganlin/GlobalSfMpy/blob/ac6a0564d84e1d6e9a4077195e384d379aa20492/thirdparty/TheiaSfM/libraries/flann/src/cpp/flann/ext/lz4hc.c#L130-L149
ac6a0564d84e1d6e9a4077195e384d379aa20492
PumpkinOS
github_2023
migueletto
c
calcrate
static speed_t calcrate(int baudrate) { #ifdef B50 if (baudrate == 50) return B50; #endif #ifdef B75 if (baudrate == 75) return B75; #endif #ifdef B110 if (baudrate == 110) return B110; #endif #ifdef B134 if (baudrate == 134) return B134; #endif #ifdef B150 if (baudrate == 150) return B150; #endif #ifdef...
/*********************************************************************** * * Function: calcrate * * Summary: validates the selected baudrate * * Paramters: buadrate * * Returns: POSIX defined baudrate constant or terminates the process * if the requested baudrate is not supported. * *************...
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/Hotsync/unixserial.c#L649-L738
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
ListViewLoadTable
static void ListViewLoadTable (FormPtr frm) { UInt16 row; UInt16 recordNum; UInt16 lineHeight; UInt16 dataHeight; UInt16 tableHeight; UInt16 numRows; UInt32 uniqueID; FontID currFont; TablePtr table; MemHandle recordH; RectangleType r; table = GetObjectPtr (ListTable); TblGetBounds (...
/*********************************************************************** * * FUNCTION: ListViewLoadTable * * DESCRIPTION: This routine loads memo database records into * the list view form. * * PARAMETERS: recordNum index of the first record to display. * * RETURNED: nothing * * REVISION ...
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/MemoPad/MemoMain.c#L3046-L3132
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
duk_get_top_require_min
DUK_INTERNAL duk_idx_t duk_get_top_require_min(duk_hthread *thr, duk_idx_t min_top) { duk_idx_t ret; DUK_ASSERT_API_ENTRY(thr); ret = (duk_idx_t) (thr->valstack_top - thr->valstack_bottom); if (DUK_UNLIKELY(ret < min_top)) { DUK_ERROR_TYPE_INVALID_ARGS(thr); DUK_WO_NORETURN(return 0;); } return ret; }
/* Internal helper to get current top but to require a minimum top value * (TypeError if not met). */
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/duktape/duk_api_stack.c#L412-L423
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
duk_join
DUK_EXTERNAL void duk_join(duk_hthread *thr, duk_idx_t count) { DUK_ASSERT_API_ENTRY(thr); duk__concat_and_join_helper(thr, count, 1 /*is_join*/); }
/* DUK_USE_PREFER_SIZE */
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/duktape/duk_api_string.c#L161-L165
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
duk_debug_write_uint
DUK_INTERNAL void duk_debug_write_uint(duk_hthread *thr, duk_uint32_t x) { /* The debugger protocol doesn't support a plain integer encoding for * the full 32-bit unsigned range (only 32-bit signed). For now, * unsigned 32-bit values simply written as signed ones. This is not * a concrete issue except for 32-b...
/* Write unsigned 32-bit integer. */
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/duktape/duk_debugger.c#L758-L771
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
duk__bi_mul
DUK_LOCAL void duk__bi_mul(duk__bigint *x, duk__bigint *y, duk__bigint *z) { duk_small_int_t i, j, nx, nz; DUK_ASSERT(duk__bi_is_valid(y)); DUK_ASSERT(duk__bi_is_valid(z)); nx = y->n + z->n; /* max possible */ DUK_ASSERT(nx <= DUK__BI_MAX_PARTS); if (nx == 0) { /* Both inputs are zero; cases where only one ...
/* x <- y * z */
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/duktape/duk_numconv.c#L396-L507
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
read_restart_marker
METHODDEF(boolean) read_restart_marker (j_decompress_ptr cinfo) { /* Obtain a marker unless we already did. */ /* Note that next_marker will complain if it skips any data. */ if (cinfo->unread_marker == 0) { if (! next_marker(cinfo)) return FALSE; } if (cinfo->unread_marker == ((int) M_RST0 +...
/* * Read a restart marker, which is expected to appear next in the datastream; * if the marker is not there, take appropriate recovery action. * Returns FALSE if suspension is required. * * This is called by the entropy decoder after it has read an appropriate * number of MCUs. cinfo->unread_marker may be nonze...
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/jpeg-8d/jdmarker.c#L1158-L1185
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
absx6502
void absx6502(m6502_t *m6502) { SAVEPC = RM16(PC); PC++; PC++; if (m6502_cycles[m6502->opcode] == 4) if ((SAVEPC >> 8) != ((SAVEPC + X) >> 8)) m6502->clockticks6502++; SAVEPC += X; }
// ABS,X
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/libemulation/m6502.c#L224-L232
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
andcc
static void andcc(m6809_t *m6809) { uint8_t t; IMMBYTE(t); CC &= t; CHECK_IRQ_LINES; }
// case 0x1B: //ILLEGAL // case 0x1C: //ANDCC immediate #####
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/libemulation/m6809ops.c#L223-L229
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
sys_country
int sys_country(char *country, int len) { int r = -1; #ifdef WINDOWS char buf[32]; GEOID myGEO = GetUserGeoID(GEOCLASS_NATION); if (GetGeoInfoA(myGEO, GEO_ISO2, buf, sizeof(buf), 0)) { sys_strncpy(country, buf, len-1); r = 0; } #else char *s, *p, buf[32]; if ((s = getenv("LANG")) != NULL) { s...
/* The name of a locale consists of language codes, character encoding, and the description of a selected variant. A name starts with an ISO 639-1 lowercase two-letter language code, or an ISO 639-2 three-letter language code if the language has no two-letter code. For example, it is de for German, fr for French, and ...
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/libpit/sys.c#L344-L374
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
SW_FT_Vector_Length
SW_FT_Fixed SW_FT_Vector_Length(SW_FT_Vector* vec) { SW_FT_Int shift; SW_FT_Vector v; v = *vec; /* handle trivial cases */ if (v.x == 0) { return SW_FT_ABS(v.y); } else if (v.y == 0) { return SW_FT_ABS(v.x); } /* general case */ shift = ft_trig_prenorm(&v); ...
/* documentation is in fttrigon.h */
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/libpluto/sw_ft_math.c#L388-L411
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
loadline
static int loadline (lua_State *L) { int status; lua_settop(L, 0); if (!pushline(L, 1)) return -1; /* no input */ if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */ status = multiline(L); /* try as command, maybe with continuation lines */ lua_remove(L, 1); /* remove line from...
/* ** Read a line and try to load (compile) it first as an expression (by ** adding "return " in front of it) and second as a statement. Return ** the final status of load/call with the resulting function (if any) ** in the top of the stack. */
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/lua/lua.c#L372-L382
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
PumpkinOS
github_2023
migueletto
c
SetOutFileDir
VOID SetOutFileDir(const char *sz) { if (sz && strcmp(sz, ".") == 0) szOutFileDir = ""; else szOutFileDir = sz; }
/*----------------------------------------------------------------------------- | SetOutFileDir | | Set output file path -- no trailing / or \ -------------------------------------------------------------WESC------------*/
https://github.com/migueletto/PumpkinOS/blob/d31ba3aca31b73c8f1ce40dbf812ddffe44c22de/src/pilrc/util.c#L475-L482
d31ba3aca31b73c8f1ce40dbf812ddffe44c22de
T-Display-S3-AMOLED
github_2023
Xinyuan-LilyGO
c
begin_SDA_Read
void TFT_eSPI::begin_SDA_Read(void) { #ifdef TFT_SPI_OVERLAP // Reads in overlap mode not supported #else spi.end(); #endif }
/*************************************************************************************** ** Function name: beginSDA ** Description: Detach SPI from pin to permit software SPI ***************************************************************************************/
https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/TFT_eSPI/Processors/TFT_eSPI_ESP8266.c#L40-L47
edd133335c9f7c38d1e9be2d0eb67371f1f6428e
T-Display-S3-AMOLED
github_2023
Xinyuan-LilyGO
c
lv_example_flex_5
void lv_example_flex_5(void) { lv_obj_t * cont = lv_obj_create(lv_scr_act()); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW_WRAP); uint32_t i; for(i = 0; i < 9; i++) { lv_obj_t * obj = lv_obj_create(cont); lv_obj_set_size(obj, ...
/** * Demonstrate the effect of column and row gap style properties */
https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/examples/layouts/flex/lv_example_flex_5.c#L17-L49
edd133335c9f7c38d1e9be2d0eb67371f1f6428e
T-Display-S3-AMOLED
github_2023
Xinyuan-LilyGO
c
lv_example_style_9
void lv_example_style_9(void) { static lv_style_t style; lv_style_init(&style); lv_style_set_line_color(&style, lv_palette_main(LV_PALETTE_GREY)); lv_style_set_line_width(&style, 6); lv_style_set_line_rounded(&style, true); /*Create an object with the new style*/ lv_obj_t * obj = lv_line_c...
/** * Using the line style properties */
https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/examples/styles/lv_example_style_9.c#L7-L24
edd133335c9f7c38d1e9be2d0eb67371f1f6428e
T-Display-S3-AMOLED
github_2023
Xinyuan-LilyGO
c
lv_fs_fatfs_init
void lv_fs_fatfs_init(void) { /*---------------------------------------------------- * Initialize your storage device and File System * -------------------------------------------------*/ fs_init(); /*--------------------------------------------------- * Register the file system interface in...
/********************** * STATIC VARIABLES **********************/ /********************** * MACROS **********************/ /********************** * GLOBAL FUNCTIONS **********************/
https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/src/extra/libs/fsdrv/lv_fs_fatfs.c#L53-L84
edd133335c9f7c38d1e9be2d0eb67371f1f6428e
T-Display-S3-AMOLED
github_2023
Xinyuan-LilyGO
c
fillRectangle
static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]) { for (int dy = 0; dy < height; dy++) { for (int dx = 0; dx < width; dx++) setModule(qrcode, left + dx, top + dy, true); } }
// Sets every pixel in the range [left : left + width] * [top : top + height] to black.
https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/src/extra/libs/qrcode/qrcodegen.c#L559-L564
edd133335c9f7c38d1e9be2d0eb67371f1f6428e
T-Display-S3-AMOLED
github_2023
Xinyuan-LilyGO
c
lv_switch_trigger_anim
static void lv_switch_trigger_anim(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_switch_t * sw = (lv_switch_t *)obj; uint32_t anim_dur_full = lv_obj_get_style_anim_time(obj, LV_PART_MAIN); if(anim_dur_full > 0) { bool chk = lv_obj_get_state(obj) & LV_STATE_CHECKED; int32_t anim_st...
/** * Starts an animation for the switch knob. if the anim_time style property is greater than 0 * @param obj the switch to animate */
https://github.com/Xinyuan-LilyGO/T-Display-S3-AMOLED/blob/edd133335c9f7c38d1e9be2d0eb67371f1f6428e/lib/lvgl/src/widgets/lv_switch.c#L238-L274
edd133335c9f7c38d1e9be2d0eb67371f1f6428e
ch32v003fun
github_2023
cnlohr
c
adc_init
void adc_init( void ) { // ADCCLK = 24 MHz => RCC_ADCPRE = 0: divide by 2 RCC->CFGR0 &= ~(0x1F<<11); // Enable GPIOD and ADC RCC->APB2PCENR |= RCC_APB2Periph_GPIOD | RCC_APB2Periph_ADC1; // PD4 is analog input chl 7 GPIOD->CFGLR &= ~(0xf<<(4*4)); // CNF = 00: Analog, MODE = 00: Input // Reset the ADC to in...
/* * initialize adc for polling */
https://github.com/cnlohr/ch32v003fun/blob/92b39c8984cab685ab59d6cc6c108de21e21d98a/examples/adc_polled/adc_polled.c#L12-L48
92b39c8984cab685ab59d6cc6c108de21e21d98a
platform-ch32v
github_2023
Community-PIO-CH32V
c
EXTI_Line_Init
void EXTI_Line_Init(void) { GPIO_InitTypeDef GPIO_InitStructure = {0}; EXTI_InitTypeDef EXTI_InitStructure = {0}; NVIC_InitTypeDef NVIC_InitStructure = {0}; RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOC, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; GPIO_InitStructure....
/********************************************************************* * @fn EXTI_Line_Init * * @brief Configure EXTI Line7. * * @param none. * * @return none. */
https://github.com/Community-PIO-CH32V/platform-ch32v/blob/8af792530c1b16b24526f6e64e2ea1b383890047/examples/webserver-ch32v307-none-os/lib/NetLib/eth_driver_RMII.c#L172-L197
8af792530c1b16b24526f6e64e2ea1b383890047
AtomLdr
github_2023
NUL0x4C
c
FetchAesKetAndIv
VOID FetchAesKetAndIv(IN OUT PBYTE ctAesKey, IN OUT PBYTE ctAesIv) { for (int i = 0; i < IV_SIZE; i++) { ctAesIv[i] -= 0x03; } for (int i = 0; i < KEY_SIZE; i++) { ctAesKey[i] -= 0x03; } for (int i = 0; i < IV_SIZE; i++) { ctAesIv[i] ^= (BYTE)ctAesKey[0]; } for (int i = 1; i < KEY_SIZE; i++) { for (int ...
/* function to decrypt the aes key and iv */
https://github.com/NUL0x4C/AtomLdr/blob/f18cb75c28f312fb8edaa86ea7c65f148ff26d0d/AtomLdr/dllmain.c#L83-L99
f18cb75c28f312fb8edaa86ea7c65f148ff26d0d
duckdb-spatial
github_2023
duckdb
c
recoverTransferSettings
static void recoverTransferSettings(sqlite3_recover *p){ const char *aPragma[] = { "encoding", "page_size", "auto_vacuum", "user_version", "application_id" }; int ii; /* Truncate the output database to 0 pages in size. This is done by ** opening a new, empty, temp db, then using the back...
/* ** Transfer the following settings from the input database to the output ** database: ** ** + page-size, ** + auto-vacuum settings, ** + database encoding, ** + user-version (PRAGMA user_version), and ** + application-id (PRAGMA application_id), and */
https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/shell.c#L13507-L13559
aa95ed8049da630da45e763f3bb6e9aeb1891e34
duckdb-spatial
github_2023
duckdb
c
memsys5Size
static int memsys5Size(void *p){ int iSize, i; assert( p!=0 ); i = (int)(((u8 *)p-mem5.zPool)/mem5.szAtom); assert( i>=0 && i<mem5.nBlock ); iSize = mem5.szAtom * (1 << (mem5.aCtrl[i]&CTRL_LOGSIZE)); return iSize; }
/* ** Return the size of an outstanding allocation, in bytes. ** This only works for chunks that are currently checked out. */
https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L27076-L27083
aa95ed8049da630da45e763f3bb6e9aeb1891e34
duckdb-spatial
github_2023
duckdb
c
pagerOpenWalIfPresent
static int pagerOpenWalIfPresent(Pager *pPager){ int rc = SQLITE_OK; assert( pPager->eState==PAGER_OPEN ); assert( pPager->eLock>=SHARED_LOCK ); if( !pPager->tempFile ){ int isWal; /* True if WAL file exists */ rc = sqlite3OsAccess( pPager->pVfs, pPager->zWal, SQLITE_ACCESS_E...
/* ** Check if the *-wal file that corresponds to the database opened by pPager ** exists if the database is not empy, or verify that the *-wal file does ** not exist (by deleting it) if the database file is empty. ** ** If the database is not empty and the *-wal file exists, open the pager ** in WAL mode. If the data...
https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L58481-L58509
aa95ed8049da630da45e763f3bb6e9aeb1891e34
duckdb-spatial
github_2023
duckdb
c
sqlite3WalLimit
SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){ if( pWal ) pWal->mxWalSize = iLimit; }
/* ** Change the size to which the WAL file is trucated on each reset. */
https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L64512-L64514
aa95ed8049da630da45e763f3bb6e9aeb1891e34
duckdb-spatial
github_2023
duckdb
c
sqlite3WalBeginReadTransaction
SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ int rc; /* Return code */ int cnt = 0; /* Number of TryBeginRead attempts */ #ifdef SQLITE_ENABLE_SNAPSHOT int bChanged = 0; WalIndexHdr *pSnapshot = pWal->pSnapshot; #endif assert( pWal->c...
/* SQLITE_ENABLE_SNAPSHOT */ /* ** Begin a read transaction on the database. ** ** This routine used to be called sqlite3OpenSnapshot() and with good reason: ** it takes a snapshot of the state of the WAL and wal-index for the current ** instant in time. The current thread will continue to use this snapshot. ** Other ...
https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L65947-L66049
aa95ed8049da630da45e763f3bb6e9aeb1891e34
duckdb-spatial
github_2023
duckdb
c
vdbeAssertFieldCountWithinLimits
static void vdbeAssertFieldCountWithinLimits( int nKey, const void *pKey, /* The record to verify */ const KeyInfo *pKeyInfo /* Compare size with this KeyInfo */ ){ int nField = 0; u32 szHdr; u32 idx; u32 notUsed; const unsigned char *aKey = (const unsigned char*)pKey; if( CORRUPT_DB ) return; ...
/* ** Count the number of fields (a.k.a. columns) in the record given by ** pKey,nKey. The verify that this count is less than or equal to the ** limit given by pKeyInfo->nAllField. ** ** If this constraint is not satisfied, it means that the high-speed ** vdbeRecordCompareInt() and vdbeRecordCompareString() routines ...
https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L86235-L86254
aa95ed8049da630da45e763f3bb6e9aeb1891e34
duckdb-spatial
github_2023
duckdb
c
countOfViewOptimization
static int countOfViewOptimization(Parse *pParse, Select *p){ Select *pSub, *pPrior; Expr *pExpr; Expr *pCount; sqlite3 *db; if( (p->selFlags & SF_Aggregate)==0 ) return 0; /* This is an aggregate */ if( p->pEList->nExpr!=1 ) return 0; /* Single result column */ if( p->pWhere ) return 0; ...
/* ** Attempt to transform a query of the form ** ** SELECT count(*) FROM (SELECT x FROM t1 UNION ALL SELECT y FROM t2) ** ** Into this: ** ** SELECT (SELECT count(*) FROM t1)+(SELECT count(*) FROM t2) ** ** The transformation only works if all of the following are true: ** ** * The subquery is a UNION ALL of ...
https://github.com/duckdb/duckdb-spatial/blob/aa95ed8049da630da45e763f3bb6e9aeb1891e34/deps/vendor/sqlite3/src/sqlite3.c#L143883-L143949
aa95ed8049da630da45e763f3bb6e9aeb1891e34
clr
github_2023
ROCm
c
khrIcdOsLibraryUnload
void khrIcdOsLibraryUnload(void *library) { dlclose(library); }
// unload a library
https://github.com/ROCm/clr/blob/a8edb8d467ebb5678d2f4506bd01efd3aaeddcab/opencl/khronos/icd/loader/linux/icd_linux.c#L191-L194
a8edb8d467ebb5678d2f4506bd01efd3aaeddcab
view.py
github_2023
ZeroIntensity
c
handle_result
int handle_result( PyObject *raw_result, char **res_target, int *status_target, PyObject **headers_target, PyObject *raw_path, const char *method ) { /* * This calls handle_result_impl() internally, but * this function is the actual interface for handling a return value. * ...
/* * Generate HTTP response components (i.e. the body, status, and headers) from * a route return value. * * The result passed should be a tuple, or body string. This function * does not call __view_result__(), as that is up to the caller. * * The body output parameter will be a string on the heap, * and is res...
https://github.com/ZeroIntensity/view.py/blob/7fe291b0feb5f5ae2da3fbf552010a4ee4e470ef/src/_view/results.c#L304-L367
7fe291b0feb5f5ae2da3fbf552010a4ee4e470ef
doom-teletext
github_2023
lukneu
c
AM_rotate
void AM_rotate ( fixed_t* x, fixed_t* y, angle_t a ) { fixed_t tmpx; tmpx = FixedMul(*x,finecosine[a>>ANGLETOFINESHIFT]) - FixedMul(*y,finesine[a>>ANGLETOFINESHIFT]); *y = FixedMul(*x,finesine[a>>ANGLETOFINESHIFT]) + FixedMul(*y,finecosine[a>>ANGLETOFINESHIFT]); *x = tmpx; }
// // Rotation in 2D. // Used to rotate player arrow line character. //
https://github.com/lukneu/doom-teletext/blob/b9f5fd1cd89a15150c4efcc02f63f6e0e7ce21f4/doom-teletext/am_map.c#L1178-L1195
b9f5fd1cd89a15150c4efcc02f63f6e0e7ce21f4
CMSIS_6
github_2023
ARM-software
c
Default_Handler
void Default_Handler(void) { while(1); }
/*---------------------------------------------------------------------------- Default Handler for Exceptions / Interrupts *----------------------------------------------------------------------------*/
https://github.com/ARM-software/CMSIS_6/blob/1a1799c6c58c47e737bb19523483344a25d29895/CMSIS/CoreValidation/Layer/Target/CA9/RTE/Device/ARMCA9/startup_ARMCA9.c#L146-L148
1a1799c6c58c47e737bb19523483344a25d29895
CMSIS_6
github_2023
ARM-software
c
ARM_USBH_PipeTransferGetResult
uint32_t ARM_USBH_PipeTransferGetResult (ARM_USBH_PIPE_HANDLE pipe_hndl) { return 0; }
/** \fn int32_t ARM_USBH_PipeTransfer (ARM_USBH_PIPE_HANDLE pipe_hndl, uint32_t packet, uint8_t *data, uint32_t num) \details The function \b ARM_USBH_PipeTransfer generates packets for sending or receiving data from an USB Endpoint. The function specifies the buffer with data to send or for data to receive and the nu...
https://github.com/ARM-software/CMSIS_6/blob/1a1799c6c58c47e737bb19523483344a25d29895/CMSIS/Documentation/Doxygen/Driver/src/Driver_USBH.c#L399-L401
1a1799c6c58c47e737bb19523483344a25d29895
fdskey
github_2023
ClusterM
c
HAL_TIM_IC_Stop_DMA
HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) { HAL_StatusTypeDef status = HAL_OK; /* Check the parameters */ assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance)); /* Disable the Input Capture channel */ TIM_CCx...
/** * @brief Stops the TIM Input Capture measurement in DMA mode. * @param htim TIM Input Capture handle * @param Channel TIM Channels to be disabled * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected * @arg TIM_CHANNEL_2: TIM ...
https://github.com/ClusterM/fdskey/blob/f07ab82864a9f4a2e7b14b37f1837715edb0d0fe/FdsKey/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.c#L2542-L2604
f07ab82864a9f4a2e7b14b37f1837715edb0d0fe
fdskey
github_2023
ClusterM
c
HAL_TIMEx_CommutCallback
__weak void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim) { /* Prevent unused argument(s) compilation warning */ UNUSED(htim); /* NOTE : This function should not be modified, when the callback is needed, the HAL_TIMEx_CommutCallback could be implemented in the user file */ }
/** * @} */ /** @defgroup TIMEx_Exported_Functions_Group6 Extended Callbacks functions * @brief Extended Callbacks functions * @verbatim ============================================================================== ##### Extended Callbacks functions ##### ============================...
https://github.com/ClusterM/fdskey/blob/f07ab82864a9f4a2e7b14b37f1837715edb0d0fe/FdsKey/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim_ex.c#L2606-L2614
f07ab82864a9f4a2e7b14b37f1837715edb0d0fe
nostr-signing-device
github_2023
lnbits
c
bn_read_le
void bn_read_le(const uint8_t *in_number, bignum256 *out_number) { int i; uint32_t temp = 0; for (i = 0; i < 8; i++) { // invariant: temp = (in_number % 2^(32i)) >> 30i // get next limb = (in_number % 2^(32(i+1))) >> 32i uint32_t limb = read_le(in_number + i * 4); // temp = (in_number % 2^(32(i+1))) << 30i ...
// convert a raw little endian 256 bit value into a normalized bignum. // out_number is partly reduced (since it fits in 256 bit).
https://github.com/lnbits/nostr-signing-device/blob/1956e5933b3da5e49d30db9b8597497b157a5cbc/libraries/uBitcoin/src/utility/trezor/bignum.c#L126-L142
1956e5933b3da5e49d30db9b8597497b157a5cbc
llama.cpp
github_2023
ggerganov
c
ggml_compute_forward_sgn_f32
static void ggml_compute_forward_sgn_f32( const struct ggml_compute_params * params, struct ggml_tensor * dst) { const struct ggml_tensor * src0 = dst->src[0]; if (params->ith != 0) { return; } assert(ggml_is_contiguous_1(src0)); assert(ggml_is_contiguous_1(dst)); asse...
// ggml_compute_forward_sgn
https://github.com/ggerganov/llama.cpp/blob/4078c77f9891831f29ffc7c315c8ec6695ba5ce7/ggml/src/ggml-cpu/ggml-cpu.c#L6205-L6227
4078c77f9891831f29ffc7c315c8ec6695ba5ce7
llama.cpp
github_2023
ggerganov
c
ggml_compute_forward_soft_max_ext_back_f32
static void ggml_compute_forward_soft_max_ext_back_f32( const struct ggml_compute_params * params, struct ggml_tensor * dst) { const struct ggml_tensor * src0 = dst->src[0]; const struct ggml_tensor * src1 = dst->src[1]; GGML_ASSERT(ggml_is_contiguous(src0)); GGML_ASSERT(ggml_is_contig...
// ggml_compute_forward_soft_max_ext_back
https://github.com/ggerganov/llama.cpp/blob/4078c77f9891831f29ffc7c315c8ec6695ba5ce7/ggml/src/ggml-cpu/ggml-cpu.c#L8967-L9049
4078c77f9891831f29ffc7c315c8ec6695ba5ce7
bloomz.cpp
github_2023
NouamaneTazi
c
ggml_vec_set_i8
inline static void ggml_vec_set_i8(const int n, int8_t * x, const int8_t v) { for (int i = 0; i < n; ++i) x[i] = v; }
// // fundamental operations //
https://github.com/NouamaneTazi/bloomz.cpp/blob/9614897a272e69a64ca9e57102cd1f86b2d2e34b/Bloomer/bloomz/ggml.c#L1205-L1205
9614897a272e69a64ca9e57102cd1f86b2d2e34b
RuntimeSpeechRecognizer
github_2023
gtreshchev
c
ggml_v_silu
inline static __m512 ggml_v_silu(__m512 x) { const __m512 one = _mm512_set1_ps(1); const __m512 zero = _mm512_setzero_ps(); const __m512 neg_x = _mm512_sub_ps(zero, x); const __m512 exp_neg_x = ggml_v_expf(neg_x); const __m512 one_plus_exp_neg_x = _mm512_add_ps(one, exp_neg_x); return _mm512_div...
// computes silu x/(1+exp(-x)) in single precision vector
https://github.com/gtreshchev/RuntimeSpeechRecognizer/blob/4faa894a1ed82e8cf4013c4adebdc8fa130471d3/Source/ThirdParty/ggml/src/ggml.c#L2705-L2712
4faa894a1ed82e8cf4013c4adebdc8fa130471d3
dillo-plus
github_2023
crossbowerbt
c
File_serve_client
static void File_serve_client(void *data, int f_write) { char *dpip_tag = NULL, *cmd = NULL, *url = NULL, *path; ClientInfo *client = data; int st; while (1) { _MSG("File_serve_client %p, flags=%d state=%d\n", client, client->flags, client->state); if (client->flags & (FILE_DONE | FIL...
/* * Serve this client. */
https://github.com/crossbowerbt/dillo-plus/blob/7d093e6bddcb3338938ea5959844e62ff1f9b76f/dpi/file.c#L524-L590
7d093e6bddcb3338938ea5959844e62ff1f9b76f
whisper.rn
github_2023
mybigday
c
wsp_ggml_compute_forward_clamp_f32
static void wsp_ggml_compute_forward_clamp_f32( const struct wsp_ggml_compute_params * params, struct wsp_ggml_tensor * dst) { const struct wsp_ggml_tensor * src0 = dst->src[0]; if (params->ith != 0) { return; } float min; float max; memcpy(&min, (float *) dst->op_para...
// wsp_ggml_compute_forward_clamp
https://github.com/mybigday/whisper.rn/blob/844cbde318fe8962d0d378e0c093f3cb8000f9a0/cpp/ggml-cpu.c#L9057-L9095
844cbde318fe8962d0d378e0c093f3cb8000f9a0
nsproxy
github_2023
nlzy
c
pbuf_memcmp
u16_t pbuf_memcmp(const struct pbuf *p, u16_t offset, const void *s2, u16_t n) { u16_t start = offset; const struct pbuf *q = p; u16_t i; /* pbuf long enough to perform check? */ if (p->tot_len < (offset + n)) { return 0xffff; } /* get the correct pbuf from chain. We know it succeeds because of p->t...
/** * @ingroup pbuf * Compare pbuf contents at specified offset with memory s2, both of length n * * @param p pbuf to compare * @param offset offset into p at which to start comparing * @param s2 buffer to compare * @param n length of buffer to compare * @return zero if equal, nonzero otherwise * (0xff...
https://github.com/nlzy/nsproxy/blob/9dd996380a4d1e8edaca359cbf32969f74d0286c/lwip/pbuf.c#L1433-L1461
9dd996380a4d1e8edaca359cbf32969f74d0286c
VkDoom
github_2023
dpjudas
c
ChunkCount
static int ChunkCount(const WebPDemuxer* const dmux, const char fourcc[4]) { const uint8_t* const mem_buf = dmux->mem_.buf_; const Chunk* c; int count = 0; for (c = dmux->chunks_; c != NULL; c = c->next_) { const uint8_t* const header = mem_buf + c->data_.offset_; if (!memcmp(header, fourcc, TAG_SIZE)) ...
// ----------------------------------------------------------------------------- // Chunk iteration
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/webp/src/demux/demux.c#L898-L907
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
c
DoVerticalFilter_SSE2
static WEBP_INLINE void DoVerticalFilter_SSE2(const uint8_t* in, int width, int height, int stride, int row, int num_rows, uint8_t* out) { const size_t start_offset = row * stride;...
//------------------------------------------------------------------------------ // Vertical filter.
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/webp/src/dsp/filters_sse2.c#L110-L137
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
c
pthread_cond_destroy
static int pthread_cond_destroy(pthread_cond_t* const condition) { int ok = 1; #ifdef USE_WINDOWS_CONDITION_VARIABLE (void)condition; #else ok &= (CloseHandle(condition->waiting_sem_) != 0); ok &= (CloseHandle(condition->received_sem_) != 0); ok &= (CloseHandle(condition->signal_event_) != 0); #endif return...
// Condition
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/webp/src/utils/thread_utils.c#L131-L141
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
SphereSfM
github_2023
json87
c
vl_aib_merge_nodes
void vl_aib_merge_nodes (VlAIB * aib, vl_uint i, vl_uint j, vl_uint new) { vl_uint last_entry = aib->nentries - 1 ; vl_uint c, n ; /* clear the list of nodes to update */ aib->nwhich = 0; /* make sure that i is smaller than j */ if(i > j) { vl_uint tmp = j; j = i; i = tmp; } /* ------------------------...
/** ------------------------------------------------------------------ ** @internal ** @brief Merges two nodes i,j in the internal datastructure ** ** @param aib A pointer to the internal data structure ** @param i The index of one member of the pair to merge ** @param j The index of the other member of th...
https://github.com/json87/SphereSfM/blob/1a01a12be58af8f4f3a8245ea2a0018828336ee8/lib/VLFeat/aib.c#L271-L333
1a01a12be58af8f4f3a8245ea2a0018828336ee8
SphereSfM
github_2023
json87
c
vl_dsift_delete
VL_EXPORT void vl_dsift_delete (VlDsiftFilter * self) { _vl_dsift_free_buffers (self) ; if (self->convTmp2) vl_free (self->convTmp2) ; if (self->convTmp1) vl_free (self->convTmp1) ; vl_free (self) ; }
/** ------------------------------------------------------------------ ** @brief Delete DSIFT filter ** @param self DSIFT filter. **/
https://github.com/json87/SphereSfM/blob/1a01a12be58af8f4f3a8245ea2a0018828336ee8/lib/VLFeat/dsift.c#L483-L490
1a01a12be58af8f4f3a8245ea2a0018828336ee8
SphereSfM
github_2023
json87
c
vl_svm_logistic_loss
double vl_svm_logistic_loss (double inner,double label) { double z = label * inner ; if (z >= 0) { return log(1.0 + exp(-z)) ; } else { return -z + log(exp(z) + 1.0) ; } }
/** @brief SVM l2 loss ** @copydetails VlSvmLossFunction */
https://github.com/json87/SphereSfM/blob/1a01a12be58af8f4f3a8245ea2a0018828336ee8/lib/VLFeat/svm.c#L1759-L1768
1a01a12be58af8f4f3a8245ea2a0018828336ee8
FreshCryptoLib
github_2023
rdubois-crypto
c
CheckDel
static void CheckDel(void* ptr, const char* k, size_t klen) { int* state = (int*) ptr; CheckCondition(*state == 2); CheckEqual("bar", k, klen); (*state)++; }
// Callback from leveldb_writebatch_iterate()
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/c_test.c#L108-L113
8179e08cac72072bd260796633fec41fdfd5b441
AlpacaChat
github_2023
niw
c
ggml_vec_set_i8
inline static void ggml_vec_set_i8(const int n, int8_t * x, const int8_t v) { for (int i = 0; i < n; ++i) x[i] = v; }
// // fundamental operations //
https://github.com/niw/AlpacaChat/blob/9b5600eb4624cb7739b6df03d3acde76cb7bd2ef/Sources/alpaca.cpp/ggml.c#L1205-L1205
9b5600eb4624cb7739b6df03d3acde76cb7bd2ef
af
github_2023
zeldaret
c
Fado_ConstructStringVectors
void Fado_ConstructStringVectors(vc_vector** stringVectors, FairyFileInfo* fileInfo, int numFiles) { int currentFile; size_t currentSym; for (currentFile = 0; currentFile < numFiles; currentFile++) { FairySym* symtab = fileInfo[currentFile].symtabInfo.sectionData; stringVectors[currentFile...
/** * For each input file, construct a vector of pointers to the starts of the strings defined in that file. */
https://github.com/zeldaret/af/blob/f013a028f42a1b11134bc5f22f28e9f48236b6f0/tools/fado/src/fado.c#L33-L52
f013a028f42a1b11134bc5f22f28e9f48236b6f0
tuyaZigbee
github_2023
doctor64
c
contactSensor_zclReportCmd
static void contactSensor_zclReportCmd(u16 clusterId, zclReportCmd_t *pReportCmd) { printf("contactSensor_zclReportCmd\n"); }
/********************************************************************* * @fn contactSensor_zclReportCmd * * @brief Handler for ZCL Report command. * * @param pInHdlrMsg - incoming message to process * * @return None */
https://github.com/doctor64/tuyaZigbee/blob/3a85776223ac4e689871b3b21852b9fc46325835/IASsensor/zcl_contactSensorCb.c#L248-L252
3a85776223ac4e689871b3b21852b9fc46325835
tuyaZigbee
github_2023
doctor64
c
tuyaLight_colorTimerStop
static void tuyaLight_colorTimerStop(void) { if(colorTimerEvt){ TL_ZB_TIMER_CANCEL(&colorTimerEvt); } }
/********************************************************************* * @fn tuyaLight_colorTimerStop * * @brief * * @param None * * @return None */
https://github.com/doctor64/tuyaZigbee/blob/3a85776223ac4e689871b3b21852b9fc46325835/light/zcl_colorCtrlCb.c#L247-L252
3a85776223ac4e689871b3b21852b9fc46325835
tuyaZigbee
github_2023
doctor64
c
tuyaSwitch_zclStoreSceneRspCmdHandler
static void tuyaSwitch_zclStoreSceneRspCmdHandler(storeSceneRsp_t *pStoreSceneRsp) { }
/********************************************************************* * @fn tuyaSwitch_zclStoreSceneRspCmdHandler * * @brief Handler for ZCL store scene response command. * * @param pStoreSceneRsp * * @return None */
https://github.com/doctor64/tuyaZigbee/blob/3a85776223ac4e689871b3b21852b9fc46325835/switch/zcl_tuyaSwitchCb.c#L611-L614
3a85776223ac4e689871b3b21852b9fc46325835
Flipper-Zero-Game-Boy-Pokemon-Trading
github_2023
kbembedded
c
pokemon_stat_calc
void pokemon_stat_calc(PokemonData* pdata, DataStat stat) { furi_assert(pdata); uint8_t iv; uint16_t ev; uint8_t base; uint8_t level; uint16_t calc; level = pokemon_stat_get(pdata, STAT_LEVEL, NONE); base = table_stat_base_get( pdata->pokemon_table, pokemon_stat_get(pdata, STAT_...
/* Calculates stat from current level */
https://github.com/kbembedded/Flipper-Zero-Game-Boy-Pokemon-Trading/blob/8769074c727ef3fa2da83e30daaf1aa964349c7e/src/pokemon_data.c#L855-L879
8769074c727ef3fa2da83e30daaf1aa964349c7e
Linux0.11
github_2023
TonyWriting
c
rw_interrupt
static void rw_interrupt(void) { if (result() != 7 || (ST0 & 0xf8) || (ST1 & 0xbf) || (ST2 & 0x73)) { if (ST1 & 0x02) { printk("Drive %d is write protected\n\r",current_drive); floppy_deselect(current_drive); end_request(0); } else bad_flp_intr(); do_fd_request(); return; } if (command == FD_READ...
/* * Ok, this interrupt is called after a DMA read/write has succeeded, * so we check the results, and copy any buffers. */
https://github.com/TonyWriting/Linux0.11/blob/7fecb719e8261e274d827dc43dc1424bd26cc483/kernel/blk_drv/floppy.c#L250-L267
7fecb719e8261e274d827dc43dc1424bd26cc483
lidar-slam-detection
github_2023
w111liang222
c
socket_wait
static int socket_wait(int fd, int is_read) { fd_set fds, *fdr = 0, *fdw = 0; struct timeval tv; int ret; tv.tv_sec = 5; tv.tv_usec = 0; // 5 seconds time out FD_ZERO(&fds); FD_SET(fd, &fds); if (is_read) fdr = &fds; else fdw = &fds; ret = select(fd+1, fdr, fdw, 0, &tv); #ifndef _WIN32 if (ret == -1) perror("...
/* In winsock.h, the type of a socket is SOCKET, which is: "typedef * u_int SOCKET". An invalid SOCKET is: "(SOCKET)(~0)", or signed * integer -1. In knetfile.c, I use "int" for socket type * throughout. This should be improved to avoid confusion. * * In Linux/Mac, recv() and read() do almost the same thing. You c...
https://github.com/w111liang222/lidar-slam-detection/blob/d57a923b3972d0a0bfdfc0016c32de53c26b9f9f/slam/thirdparty/fast_gicp/thirdparty/nvbio/contrib/htslib/knetfile.c#L60-L80
d57a923b3972d0a0bfdfc0016c32de53c26b9f9f
lidar-slam-detection
github_2023
w111liang222
c
ss_insertionsort
static void ss_insertionsort(const unsigned char *T, const int *PA, int *first, int *last, int depth) { int *i, *j; int t; int r; for(i = last - 2; first <= i; --i) { for(t = *i, j = i + 1; 0 < (r = ss_compare(T, PA + t, PA + *j, depth));) { do { *(j - 1) = *j; } while((++j < last) &...
/* Insertionsort for small size groups */
https://github.com/w111liang222/lidar-slam-detection/blob/d57a923b3972d0a0bfdfc0016c32de53c26b9f9f/slam/thirdparty/fast_gicp/thirdparty/nvbio/contrib/libdivsufsort-lite/divsufsort.c#L241-L257
d57a923b3972d0a0bfdfc0016c32de53c26b9f9f
cs2-sdk
github_2023
bruhmoment21
c
operands_set_tsi
_INLINE_ void operands_set_tsi(_DInst* di, _Operand* op, _OperandType type, uint16_t size, unsigned int index) { op->type = type; op->index = (uint8_t)index; op->size = size; di->usedRegistersMask |= _REGISTERTORCLASS[index]; }
/* A helper function to set operand's type, size and index. */
https://github.com/bruhmoment21/cs2-sdk/blob/3fdb26b0eba5a7335f011c68bb5c7ef5a3171144/cs2-sdk/libs/distorm/src/operands.c#L51-L57
3fdb26b0eba5a7335f011c68bb5c7ef5a3171144
microkernel-book
github_2023
nuta
c
sys_task_exit
__noreturn static void sys_task_exit(void) { task_exit(EXP_GRACE_EXIT); }
// 実行中タスクを正常終了する。
https://github.com/nuta/microkernel-book/blob/8665ccb23eef1136f2bfcd4770e43a3388fba78a/kernel/syscall.c#L120-L122
8665ccb23eef1136f2bfcd4770e43a3388fba78a
react-native-nitro-sqlite
github_2023
margelo
c
sqlite3TreeViewWindow
SQLITE_PRIVATE void sqlite3TreeViewWindow(TreeView* pView, const Window* pWin, u8 more) { int nElement = 0; if (pWin == 0) return; if (pWin->pFilter) { sqlite3TreeViewItem(pView, "FILTER", 1); sqlite3TreeViewExpr(pView, pWin->pFilter, 0); sqlite3TreeViewPop(&pView); } sqlite3TreeViewPush(&pVie...
/* ** Generate a human-readable explanation for a Window object */
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L31036-L31109
09d9159c7d3aca803c69fda2b626868338acbb50
react-native-nitro-sqlite
github_2023
margelo
c
winShmUnmap
static int winShmUnmap(sqlite3_file* fd, /* Database holding shared memory */ int deleteFlag /* Delete after closing if true */ ) { winFile* pDbFd; /* Database holding shared-memory */ winShm* p; /* The connection to be closed */ winShmNode* pShmNode; /* The underlying s...
/* ** Close a connection to shared-memory. Delete the underlying ** storage if deleteFlag is true. */
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L47001-L47038
09d9159c7d3aca803c69fda2b626868338acbb50
react-native-nitro-sqlite
github_2023
margelo
c
memdbDeviceCharacteristics
static int memdbDeviceCharacteristics(sqlite3_file* pFile) { UNUSED_PARAMETER(pFile); return SQLITE_IOCAP_ATOMIC | SQLITE_IOCAP_POWERSAFE_OVERWRITE | SQLITE_IOCAP_SAFE_APPEND | SQLITE_IOCAP_SEQUENTIAL; }
/* ** Return the device characteristic flags supported by an memdb-file. */
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L49514-L49517
09d9159c7d3aca803c69fda2b626868338acbb50
react-native-nitro-sqlite
github_2023
margelo
c
sqlite3PagerSharedLock
SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager* pPager) { int rc = SQLITE_OK; /* Return code */ /* This routine is only called from b-tree and only when there are no ** outstanding pages. This implies that the pager state should either ** be OPEN or READER. READER is only possible if the pager is or was in ...
/* ** This function is called to obtain a shared lock on the database file. ** It is illegal to call sqlite3PagerGet() until after this function ** has been successfully called. If a shared-lock is already held when ** this function is called, it is a no-op. ** ** The following operations are also performed by this fun...
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L58291-L58495
09d9159c7d3aca803c69fda2b626868338acbb50
react-native-nitro-sqlite
github_2023
margelo
c
sqlite3BtreeSeekCount
SQLITE_PRIVATE sqlite3_uint64 sqlite3BtreeSeekCount(Btree* pBt) { u64 n = pBt->nSeek; pBt->nSeek = 0; return n; }
/* ** Return and reset the seek counter for a Btree object. */
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L66055-L66059
09d9159c7d3aca803c69fda2b626868338acbb50
react-native-nitro-sqlite
github_2023
margelo
c
sqlite3VdbeIOTraceSql
SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe* p) { int nOp = p->nOp; VdbeOp* pOp; if (sqlite3IoTrace == 0) return; if (nOp < 1) return; pOp = &p->aOp[0]; if (pOp->opcode == OP_Init && pOp->p4.z != 0) { int i, j; char z[1000]; sqlite3_snprintf(sizeof(z), z, "%s", pOp->p4.z); for (i ...
/* ** Print an IOTRACE message showing SQL content. */
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L82084-L82110
09d9159c7d3aca803c69fda2b626868338acbb50
react-native-nitro-sqlite
github_2023
margelo
c
sqlite3_blob_bytes
SQLITE_API int sqlite3_blob_bytes(sqlite3_blob* pBlob) { Incrblob* p = (Incrblob*)pBlob; return (p && p->pStmt) ? p->nByte : 0; }
/* ** Query a blob handle for the size of the data. ** ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob ** so no mutex is required for access. */
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L96615-L96618
09d9159c7d3aca803c69fda2b626868338acbb50
react-native-nitro-sqlite
github_2023
margelo
c
jsonIs4Hex
static int jsonIs4Hex(const char* z) { int i; for (i = 0; i < 4; i++) if (!sqlite3Isxdigit(z[i])) return 0; return 1; }
/* ** Return true if z[] begins with 4 (or more) hexadecimal digits */
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L194002-L194008
09d9159c7d3aca803c69fda2b626868338acbb50
react-native-nitro-sqlite
github_2023
margelo
c
jsonEachColumn
static int jsonEachColumn(sqlite3_vtab_cursor* cur, /* The cursor */ sqlite3_context* ctx, /* First argument to sqlite3_result_...() */ int i /* Which column to return */ ) { JsonEachCursor* p = (JsonEachCursor*)cur; JsonNode* pThis = &p->s...
/* Return the value of a column */
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L195566-L195668
09d9159c7d3aca803c69fda2b626868338acbb50
react-native-nitro-sqlite
github_2023
margelo
c
sessionDiffHooks
static void sessionDiffHooks(sqlite3_session* pSession, SessionDiffCtx* pDiffCtx) { pSession->hook.pCtx = (void*)pDiffCtx; pSession->hook.xOld = sessionDiffOld; pSession->hook.xNew = sessionDiffNew; pSession->hook.xCount = sessionDiffCount; pSession->hook.xDepth = sessionDiffDepth; }
/* ** Install the diff hooks on the session object passed as the only ** argument. */
https://github.com/margelo/react-native-nitro-sqlite/blob/09d9159c7d3aca803c69fda2b626868338acbb50/package/cpp/sqlite/sqlite3.c#L211450-L211456
09d9159c7d3aca803c69fda2b626868338acbb50
Nissan-LEAF-Battery-Upgrade
github_2023
dalathegreat
c
HAL_CAN_RxFifo1FullCallback
__weak void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan) { /* Prevent unused argument(s) compilation warning */ UNUSED(hcan); /* NOTE : This function Should not be modified, when the callback is needed, the HAL_CAN_RxFifo1FullCallback could be implemented in the user file */ }
/** * @brief Rx FIFO 1 full callback. * @param hcan pointer to a CAN_HandleTypeDef structure that contains * the configuration information for the specified CAN. * @retval None */
https://github.com/dalathegreat/Nissan-LEAF-Battery-Upgrade/blob/96cee856d7fb38b2e72736ddfccb8e07eb7bb594/Software/CANBRIDGE-2port/source/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c#L2259-L2268
96cee856d7fb38b2e72736ddfccb8e07eb7bb594
Nissan-LEAF-Battery-Upgrade
github_2023
dalathegreat
c
HAL_RCC_GetClockConfig
void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pFLatency) { /* Check the parameters */ assert_param(RCC_ClkInitStruct != NULL); assert_param(pFLatency != NULL); /* Set all possible values for the Clock type parameter --------------------*/ RCC_ClkInitStruct->ClockType = RCC_CLO...
/** * @brief Get the RCC_ClkInitStruct according to the internal * RCC configuration registers. * @param RCC_ClkInitStruct pointer to an RCC_ClkInitTypeDef structure that * contains the current clock configuration. * @param pFLatency Pointer on the Flash Latency. * @retval None */
https://github.com/dalathegreat/Nissan-LEAF-Battery-Upgrade/blob/96cee856d7fb38b2e72736ddfccb8e07eb7bb594/Software/CANBRIDGE-2port/source/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c#L1312-L1340
96cee856d7fb38b2e72736ddfccb8e07eb7bb594
sqlwrite
github_2023
plasma-umass
c
zipfileColumn
static int zipfileColumn( sqlite3_vtab_cursor *cur, /* The cursor */ sqlite3_context *ctx, /* First argument to sqlite3_result_...() */ int i /* Which column to return */ ){ ZipfileCsr *pCsr = (ZipfileCsr*)cur; ZipfileCDS *pCDS = &pCsr->pCurrent->cds; int rc = SQLITE_OK; swit...
/* ** Return values of columns for the row at which the series_cursor ** is currently pointing. */
https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/shell.c#L8711-L8793
099aec4292676b58c179e4d6e11635e624fcd289
sqlwrite
github_2023
plasma-umass
c
read32bits
static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){ unsigned char ac[4]; int rc = sqlite3OsRead(fd, ac, sizeof(ac), offset); if( rc==SQLITE_OK ){ *pRes = sqlite3Get4byte(ac); } return rc; }
/* ** Read a 32-bit integer from the given file descriptor. Store the integer ** that is read in *pRes. Return SQLITE_OK if everything worked, or an ** error code is something goes wrong. ** ** All values are stored on disk as big-endian. */
https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L56589-L56596
099aec4292676b58c179e4d6e11635e624fcd289
sqlwrite
github_2023
plasma-umass
c
sqlite3PagerCommitPhaseOne
SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( Pager *pPager, /* Pager object */ const char *zSuper, /* If not NULL, the super-journal name */ int noSync /* True to omit the xSync on the db file */ ){ int rc = SQLITE_OK; /* Return code */ assert( p...
/* ** Sync the database file for the pager pPager. zSuper points to the name ** of a super-journal file that should be written into the individual ** journal file. zSuper may be NULL, which is interpreted as no ** super-journal (a single database transaction). ** ** This routine ensures that: ** ** * The database fil...
https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L61867-L62079
099aec4292676b58c179e4d6e11635e624fcd289
sqlwrite
github_2023
plasma-umass
c
sqlite3PagerWalFramesize
SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ assert( pPager->eState>=PAGER_READER ); return sqlite3WalFramesize(pPager->pWal); }
/* ** A read-lock must be held on the pager when this function is called. If ** the pager is in WAL mode and the WAL file currently contains one or more ** frames, return the size in bytes of the page images stored within the ** WAL frames. Otherwise, if this is not a WAL database or the WAL file ** is empty, return 0....
https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L63209-L63212
099aec4292676b58c179e4d6e11635e624fcd289
sqlwrite
github_2023
plasma-umass
c
geopolyCcwFunc
static void geopolyCcwFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ GeoPoly *p = geopolyFuncParam(context, argv[0], 0); (void)argc; if( p ){ if( geopolyArea(p)<0.0 ){ int ii, jj; for(ii=1, jj=p->nVertex-1; ii<jj; ii++, jj--){ GeoCoord t = GeoX(p,ii); GeoX(...
/* ** Implementation of the geopoly_ccw(X) function. ** ** If the rotation of polygon X is clockwise (incorrect) instead of ** counter-clockwise (the correct winding order according to RFC7946) ** then reverse the order of the vertexes in polygon X. ** ** In other words, this routine returns a CCW polygon regardless of...
https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L206454-L206477
099aec4292676b58c179e4d6e11635e624fcd289
sqlwrite
github_2023
plasma-umass
c
geopolyBBoxFunc
static void geopolyBBoxFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ GeoPoly *p = geopolyBBox(context, argv[0], 0, 0); (void)argc; if( p ){ sqlite3_result_blob(context, p->hdr, 4+8*p->nVertex, SQLITE_TRANSIENT); sqlite3_free(p); } }
/* ** Implementation of the geopoly_bbox(X) SQL function. */
https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L206619-L206631
099aec4292676b58c179e4d6e11635e624fcd289
sqlwrite
github_2023
plasma-umass
c
fts5DecodeStructure
static void fts5DecodeStructure( int *pRc, /* IN/OUT: error code */ Fts5Buffer *pBuf, const u8 *pBlob, int nBlob ){ int rc; /* Return code */ Fts5Structure *p = 0; /* Decoded structure object */ rc = fts5StructureDecode(pBlob, nBlob, 0, &p); if( rc!...
/* ** This is part of the fts5_decode() debugging aid. ** ** Arguments pBlob/nBlob contain a serialized Fts5Structure object. This ** function appends a human-readable representation of the same object ** to the buffer passed as the second argument. */
https://github.com/plasma-umass/sqlwrite/blob/099aec4292676b58c179e4d6e11635e624fcd289/sqlite3.c#L237040-L237056
099aec4292676b58c179e4d6e11635e624fcd289
Understanding-VITS
github_2023
JunityZhan
c
__Pyx_pretend_to_initialize
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
/* __GNUC__ */
https://github.com/JunityZhan/Understanding-VITS/blob/908a46a2af87606c3039a402cc7af3984ef8aafd/monotonic_align/core.c#L817-L817
908a46a2af87606c3039a402cc7af3984ef8aafd
ragnar
github_2023
cococry
c
switchclientdesktop
void switchclientdesktop(state_t* s, client_t* cl, int32_t desktop) { char** names = (char**)malloc(s->monfocus->desktopcount * sizeof(char*)); for (size_t i = 0; i < s->monfocus->desktopcount ; i++) { names[i] = strdup(s->monfocus->activedesktops[i].name); } // Create the desktop if it was not created yet ...
/** * @brief Switches the desktop of a given client and hides that client. * * @param s The window manager's state * @param cl The client to switch the desktop of * @param desktop The desktop to set the client of */
https://github.com/cococry/ragnar/blob/8b95f82411d8956a29fb556cc6a9ab721492e985/src/ragnar.c#L1283-L1301
8b95f82411d8956a29fb556cc6a9ab721492e985
Server
github_2023
2004Scape
c
makeMaps_e
static void makeMaps_e ( EState* s ) { Int32 i; s->nInUse = 0; for (i = 0; i < 256; i++) if (s->inUse[i]) { s->unseqToSeq[i] = s->nInUse; s->nInUse++; } }
/*---------------------------------------------------*/ /*--- The back end proper ---*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/
https://github.com/2004Scape/Server/blob/408c538428f8fb0cd7fd387ebece0a8c9cbcac57/src/3rdparty/bzip2-wasm/bzip2-1.0.8/compress.c#L105-L115
408c538428f8fb0cd7fd387ebece0a8c9cbcac57
Whisper-Finetune
github_2023
yeyupiaoling
c
ggml_compute_forward_conv_transpose_1d_f16_f32
static void ggml_compute_forward_conv_transpose_1d_f16_f32( const struct ggml_compute_params * params, const struct ggml_tensor * src0, const struct ggml_tensor * src1, struct ggml_tensor * dst) { GGML_ASSERT(src0->type == GGML_TYPE_F16); GGML_ASSERT(src1->type == GGML_TYPE...
// ggml_compute_forward_conv_transpose_1d
https://github.com/yeyupiaoling/Whisper-Finetune/blob/e763980251b3307e6518ba2a352f56192bc1c43b/AndroidDemo/app/src/main/jni/whisper/libwhisper/ggml.c#L11502-L11594
e763980251b3307e6518ba2a352f56192bc1c43b