functionSource stringlengths 20 97.4k | CWE-119 bool 2
classes | CWE-120 bool 2
classes | CWE-469 bool 2
classes | CWE-476 bool 2
classes | CWE-other bool 2
classes | combine int64 0 1 |
|---|---|---|---|---|---|---|
find_last_free_sector(struct gpt_header *header,
struct gpt_entry *ents)
{
uint32_t i, last_moved;
uint64_t last = 0;
if (!header || !ents)
goto done;
/* start by assuming the last usable LBA is available */
last = le64_to_cpu(header->last_usable_lba);
do {
last_moved = 0;
for (i = 0; i < le32_t... | false | false | false | false | false | 0 |
safe_strcmp(const char* a, const char* b)
{
if(a == NULL)
return b != NULL; /* a is NULL, b is not */
if(b == NULL) /* b is NULL, a is not */
return 1;
return strcmp(a, b);
} | false | false | false | false | false | 0 |
XtWSDestroyGCSet(gcset)
XWSGC gcset;
{
int i;
int flag;
for (i = 0; i < 4; i++) {
if (gcset->fe[i].gc == NULL)
continue;
flag = gcset->fe[i].flag;
if (flag & GCCREAT)
XtDestroyGC(gcset->fe[i].gc);
/* can't free XFontStruct data allocated by XWSSetGCSet()
* because I can't figure out which display i... | false | false | false | false | false | 0 |
libconf_parse(char *c, off_t len) {
off_t off=0;
char tb[256];
int te, line=1;
struct lc_centry *config=NULL,
*cce=NULL,
*lce=NULL;
cce=calloc(1, sizeof(struct lc_centry));
config=cce;
while(1) {
te=gettoken(c, len, tb, &off);
switch(te) {
case(TOKEN_NEWLINE):
line++;
break;
ca... | false | false | false | false | false | 0 |
fdflag_close_exec(int fd, bool flag)
{
int oflag, mode;
oflag = fcntl(fd, F_GETFD, 0);
if (oflag < 0)
return false;
mode = flag ? (oflag | FD_CLOEXEC) : (oflag & ~FD_CLOEXEC);
return (fcntl(fd, F_SETFD, mode) == 0);
} | false | false | false | false | false | 0 |
test_diff_diffiter__iterate_randomly_while_saving_state(void)
{
git_repository *repo = cl_git_sandbox_init("status");
git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
git_diff_list *diff = NULL;
diff_expects exp = {0};
git_diff_patch *patches[PATCH_CACHE];
size_t p, d, num_d;
memset(patches, 0, sizeof(patches));
... | false | false | false | false | false | 0 |
sst_parse_module_memcpy(struct intel_sst_drv *sst_drv_ctx,
struct fw_module_header *module, struct list_head *memcpy_list)
{
struct fw_block_info *block;
u32 count;
int ret_val = 0;
void __iomem *ram_iomem;
dev_dbg(sst_drv_ctx->dev, "module sign %s size %x blocks %x type %x\n",
module->signature, module->mod... | false | false | false | false | false | 0 |
record_delete(record* r, int flags)
{
btree *bt = r->tree;
record parent; // Parent folder of the deleted record
hfsp_cat_key parentKey;
UInt16 type = r->record.type;
int result = 0;
if (type == HFSP_FOLDER && !(flags & RECORD_DELETE_DIRECT))
{
record thread;
// locate... | false | false | false | false | false | 0 |
SetName(const char* newname )
{
if ( name )
{
delete [] name;
name = 0;
}
if (newname)
{
if ( strlen(newname) )
{
name = new char[strlen(newname)+1];
strcpy(name,newname);
}
}
} | false | false | false | false | false | 0 |
fso_gsm_plus_cmti_real_parse (FsoGsmAbstractAtCommand* base, const gchar* response, GError** error) {
FsoGsmPlusCMTI * self;
const gchar* _tmp0_ = NULL;
gchar* _tmp1_ = NULL;
gint _tmp2_ = 0;
GError * _inner_error_ = NULL;
self = (FsoGsmPlusCMTI*) base;
g_return_if_fail (response != NULL);
_tmp0_ = response;
F... | false | false | false | false | false | 0 |
rb_connect_tryconnect(rb_fde_t *F, void *notused)
{
int retval;
if(F == NULL || F->connect == NULL || F->connect->callback == NULL)
return;
/* Try the connect() */
retval = connect(F->fd,
(struct sockaddr *)&F->connect->hostaddr,
GET_SS_LEN(&F->connect->hostaddr));
/* Error? */
if(retval < 0)
{
/*
... | false | false | false | false | false | 0 |
rest_proxy_call_invoke_async (RestProxyCall *call,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GSimpleAsyncResult *result;
RestProxyCallPrivate *priv;
SoupMessage *mes... | false | false | false | false | false | 0 |
match_inspect(VALUE match)
{
const char *cname = rb_obj_classname(match);
VALUE str;
int i;
struct re_registers *regs = RMATCH_REGS(match);
int num_regs = regs->num_regs;
struct backref_name_tag *names;
VALUE regexp = RMATCH(match)->regexp;
if (regexp == 0) {
return rb_sprintf("... | false | false | false | false | false | 0 |
pull_up_simple_union_all(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte)
{
int varno = ((RangeTblRef *) jtnode)->rtindex;
Query *subquery = rte->subquery;
int rtoffset = list_length(root->parse->rtable);
List *rtable;
/*
* Make a modifiable copy of the subquery's rtable, so we can adjust
* uppe... | false | false | false | false | false | 0 |
dump_daq_start (void* handle)
{
DumpImpl* impl = (DumpImpl*)handle;
const char* name = impl->name ? impl->name : DAQ_DUMP_FILE;
pcap_t* pcap;
int dlt;
uint16_t snap;
int ret = impl->module->start(impl->handle);
if ( ret )
return ret;
dlt = impl->module->get_datalink_type(impl-... | false | false | false | false | false | 0 |
gst_event_new_segment (const GstSegment * segment)
{
GstEvent *event;
g_return_val_if_fail (segment != NULL, NULL);
g_return_val_if_fail (segment->rate != 0.0, NULL);
g_return_val_if_fail (segment->applied_rate != 0.0, NULL);
g_return_val_if_fail (segment->format != GST_FORMAT_UNDEFINED, NULL);
GST_CAT_IN... | false | false | false | false | false | 0 |
ffirow(fitsfile *fptr, /* I - FITS file pointer */
LONGLONG firstrow, /* I - insert space AFTER this row */
/* 0 = insert space at beginning of table */
LONGLONG nrows, /* I - number of rows to insert */
... | false | false | false | false | false | 0 |
bcm_gpio_set_power(struct bcm_device *dev, bool powered)
{
if (powered && !IS_ERR(dev->clk) && !dev->clk_enabled)
clk_enable(dev->clk);
gpiod_set_value(dev->shutdown, powered);
gpiod_set_value(dev->device_wakeup, powered);
if (!powered && !IS_ERR(dev->clk) && dev->clk_enabled)
clk_disable(dev->clk);
dev->cl... | false | false | false | false | false | 0 |
get_codec_nid(struct kobject *kobj, struct hdac_device **codecp)
{
struct device *dev = kobj_to_dev(kobj->parent->parent);
int nid;
ssize_t ret;
ret = kstrtoint(kobj->name, 16, &nid);
if (ret < 0)
return ret;
*codecp = dev_to_hdac_dev(dev);
return nid;
} | false | false | false | false | false | 0 |
nautilus_is_home_directory (GFile *dir)
{
static GFile *home_dir = NULL;
if (home_dir == NULL) {
home_dir = g_file_new_for_path (g_get_home_dir ());
}
return g_file_equal (dir, home_dir);
} | false | false | false | false | true | 1 |
pack_rev(char *dest, char *src, int count, MPI_Datatype dtype)
{
switch (dtype->dt_format) {
/*
* Select optimal copy and reverse function.
*/
case LAM_DTBASIC:
switch (dtype->dt_size) {
case 1:
lam_memcpy(dest, src, count);
break;
case 2:
lam_copyrev2(dest, src, count);
break;
... | false | false | false | false | false | 0 |
Aggro(Unit* pWho) override
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
DoScriptText(urand(0, 1) ? SAY_ATTACKED_1 : SAY_ATTACKED_2, m_creature, pWho);
}
} | false | false | false | false | false | 0 |
printException(const Completion& c, const UString& sourceURL)
{
JSLock lock;
ExecState* exec = globalExec();
CString f = sourceURL.UTF8String();
CString message = c.value()->toObject(exec)->toString(exec).UTF8String();
int line = c.value()->toObject(exec)->get(exec, "line")->toUInt32(exec);
#if PLAT... | false | false | false | false | false | 0 |
var66_loonie (flam3_iter_helper *f, double weight) {
/* Loonie in the Apophysis Plugin Pack */
/*
* !!! Note !!!
* This code uses the variation weight in a non-standard fashion, and
* it may change or even be removed in future versions of flam3.
*/
double r2 = f->precalc_sumsq;
double ... | false | false | false | false | false | 0 |
rtmp_connect(struct connectdata *conn, bool *done)
{
RTMP *r = conn->proto.generic;
SET_RCVTIMEO(tv,10);
r->m_sb.sb_socket = conn->sock[FIRSTSOCKET];
/* We have to know if it's a write before we send the
* connect request packet
*/
if(conn->data->set.upload)
r->Link.protocol |= RTMP_FEATURE_WRITE;... | false | false | false | false | false | 0 |
__log_stat_print(env, flags)
ENV *env;
u_int32_t flags;
{
u_int32_t orig_flags;
int ret;
orig_flags = flags;
LF_CLR(DB_STAT_CLEAR | DB_STAT_SUBSYSTEM);
if (flags == 0 || LF_ISSET(DB_STAT_ALL)) {
ret = __log_print_stats(env, orig_flags);
if (flags == 0 || ret != 0)
return (ret);
}
if (LF_ISSET(DB_STAT_... | false | false | false | false | false | 0 |
rtl_init_rxcfg(struct rtl8169_private *tp)
{
void __iomem *ioaddr = tp->mmio_addr;
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_01:
case RTL_GIGA_MAC_VER_02:
case RTL_GIGA_MAC_VER_03:
case RTL_GIGA_MAC_VER_04:
case RTL_GIGA_MAC_VER_05:
case RTL_GIGA_MAC_VER_06:
case RTL_GIGA_MAC_VER_10:
case RTL_GIGA_MAC... | false | false | false | false | false | 0 |
putline_UYVP (GstBlendVideoFormatInfo * dest,
GstBlendVideoFormatInfo * srcinfo, const guint8 * line, guint xoff, int j)
{
int i;
guint8 *destline = GET_LINE (dest, 0, j) + xoff * 3;
for (i = 0; i < srcinfo->width; i += 2) {
guint16 y0, y1;
guint16 u0;
guint16 v0;
y0 = line[4 * (i + 0) + 1];... | false | false | false | false | false | 0 |
netboot ( struct net_device *netdev ) {
struct setting vendor_class_id_setting
= { .tag = DHCP_VENDOR_CLASS_ID };
struct setting pxe_discovery_control_setting
= { .tag = DHCP_PXE_DISCOVERY_CONTROL };
struct setting pxe_boot_menu_setting
= { .tag = DHCP_PXE_BOOT_MENU };
char buf[256];
struct in_addr next_serv... | false | false | false | false | false | 0 |
norm_heapincr (uintnat i)
{
#define Psv (Wsize_bsize (Page_size))
i = ((i + Psv - 1) / Psv) * Psv;
if (i < Heap_chunk_min) i = Heap_chunk_min;
return i;
} | false | false | false | false | false | 0 |
ReleaseChiSymbolBuf( ChewingData *pgdata, ChewingOutput *pgo )
{
int throwEnd;
uint16 bufPhoneSeq[ MAX_PHONE_SEQ_LEN + 1 ];
char bufWordSeq[ MAX_PHONE_SEQ_LEN * MAX_UTF8_SIZE + 1 ];
throwEnd = CountReleaseNum( pgdata );
pgo->nCommitStr = throwEnd;
if ( throwEnd ) {
/*
* count how many chinese words in "chi... | true | true | false | false | true | 1 |
objects_removed_cb (GObject *object,
GList *objects,
GMainLoop *loop)
{
GList *l;
for (l = objects; l; l = l->next) {
ECalComponentId *id = l->data;
test_print (
"Object removed: uid: %s, rid: %s\n",
id->uid, id->rid);
}
subtest_passed (SUBTEST_OBJECTS_REMOVED, l... | false | false | false | false | false | 0 |
nvkm_notify_put(struct nvkm_notify *notify)
{
struct nvkm_event *event = notify->event;
unsigned long flags;
if (likely(event) &&
test_and_clear_bit(NVKM_NOTIFY_USER, ¬ify->flags)) {
spin_lock_irqsave(&event->refs_lock, flags);
nvkm_notify_put_locked(notify);
spin_unlock_irqrestore(&event->refs_lock, f... | false | false | false | false | false | 0 |
rb_vmdebug_stack_dump_raw(rb_thread_t *th, rb_control_frame_t *cfp)
{
#if 0
VALUE *sp = cfp->sp, *bp = cfp->bp;
VALUE *lfp = cfp->lfp;
VALUE *dfp = cfp->dfp;
VALUE *p, *st, *t;
fprintf(stderr, "-- stack frame ------------\n");
for (p = st = th->stack; p < sp; p++) {
fprintf(stderr, "%04ld (%p)... | false | false | false | false | true | 1 |
ap_dimchange2_fprint(FILE* stream, ap_dimchange2_t* dimchange2)
{
fprintf(stream,"add: ");
if (dimchange2->add){
ap_dimchange_fprint(stream,dimchange2->add);
}
else {
fprintf(stream,"NULL\n");
}
fprintf(stream,"remove: ");
if (dimchange2->remove){
ap_dimchange_fprint(stream,dimchange2->remove)... | false | false | false | false | false | 0 |
parse_ids( const AnyOption *option, const char *arg )
{
u32 val = 0;
int alen = strlen( arg );
char *abuf = alloca( alen + 1 );
memcpy( abuf, arg, alen + 1 );
if (! strcasecmp( arg, "help" )) {
fprintf( stderr, "\nCheck 'dfbinfo' for valid values.\n\n" );
return fa... | false | true | false | false | false | 1 |
OutputINChI2(char *pStr, int nStrLen,
INCHI_SORT *pINChISortTautAndNonTaut2[][TAUT_NUM],
int iINChI,
ORIG_STRUCT *pOrigStruct,
int bDisconnectedCoord, int bOutputType, int bINChIOutputOptions,
int bXml, int bAbcNumbers,int bCtPredecess... | false | false | false | false | false | 0 |
create_group_dir( const char *name, const char *groupdir,
uid_t uid, gid_t gid )
{
struct stat st;
if( ! groupdir || groupdir[ 0 ] != '/' )
{
msglog( MSG_WARNING, "create_group_dir: invalid path" );
return 0;
}
if( ! lstat( groupdir, &st ) )
{
if( ! ( S_ISDIR( st.st_mode ) ) )
{
msglog( MSG_ALE... | false | false | false | false | false | 0 |
_wrap_svn_txdelta_to_svndiff2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
svn_txdelta_window_handler_t *arg1 = (svn_txdelta_window_handler_t *) 0 ;
void **arg2 = (void **) 0 ;
svn_stream_t *arg3 = (svn_stream_t *) 0 ;
int arg4 ;
apr_pool_t *arg5 = (apr_pool_t *) 0 ;
apr_pool... | false | false | false | false | false | 0 |
new_prand(
int di, /* Dimensionality of device space */
double ilimit, /* Ink limit (sum of device coords max) */
int tinp, /* Total number of points to generate, including fixed */
fxpos *fxlist, /* List of existing fixed points (may be NULL) */
int fxno, /* Number of existing fixes points */
int quasi, ... | false | false | false | false | false | 0 |
GetAllMatches( OGRField *psKey, long* panFIDList, int* nFIDCount, int* nLength )
{
GByte *pabyKey = BuildKey( psKey );
long nFID;
if (panFIDList == NULL)
{
panFIDList = (long *) CPLMalloc(sizeof(long) * 2);
*nFIDCount = 0;
*nLength = 2;
}
nFID = poINDFile->FindFirst( iI... | false | false | false | false | false | 0 |
Read(void* buffer, size_t buffer_len,
size_t* read, int* error) {
ASSERT(socket_ != NULL);
int result = socket_->Recv(buffer, buffer_len);
if (result < 0) {
if (socket_->IsBlocking())
return SR_BLOCK;
if (error)
*error = socket_->GetError();
return SR_ERROR;... | false | false | false | false | false | 0 |
jdToCE(int32_t julianDay, int32_t jdEpochOffset, int32_t& year, int32_t& month, int32_t& day)
{
int32_t c4; // number of 4 year cycle (1461 days)
int32_t r4; // remainder of 4 year cycle, always positive
c4 = ClockMath::floorDivide(julianDay - jdEpochOffset, 1461, r4);
year = 4 * c4 + (r4/365 - r4/146... | false | false | false | false | false | 0 |
mmc_select_card(struct mmc_card *card)
{
BUG_ON(!card);
return _mmc_select_card(card->host, card);
} | false | false | false | false | false | 0 |
send(int sockfd, const void *buf, size_t len, int flags)
{
hostile_initialize();
(void) pthread_once(&function_lookup_once, set_local);
if (is_called() == false)
{
if (__function.frequency)
{
if (--not_until < 0 && random() % __function.frequency)
{
__function._used++;
shu... | false | false | false | false | false | 0 |
atoui( const char *Value, unsigned int *ConvertedValue )
{
unsigned int Digit;
#define MAX_TENTH ( UINT_MAX / 10 )
*ConvertedValue = 0;
while ( *Value >= '0' && *Value <='9')
{
Digit = *Value - '0';
/*
* Check for overflow before multiplying.
*/
if ( *ConvertedValue > MAX_TENTH ... | false | false | false | false | false | 0 |
ProcessGUCArray(ArrayType *array,
GucContext context, GucSource source, GucAction action)
{
int i;
Assert(array != NULL);
Assert(ARR_ELEMTYPE(array) == TEXTOID);
Assert(ARR_NDIM(array) == 1);
Assert(ARR_LBOUND(array)[0] == 1);
for (i = 1; i <= ARR_DIMS(array)[0]; i++)
{
Datum d;
bool isnull;
char... | false | false | false | false | false | 0 |
mcache_set_maxcache(
MCACHE *mp, /* IN: MCACHE cookie */
int32 maxcache /* IN: max pages to cache */)
{
if (mp != NULL)
{ /* currently allow the current cache to grow up */
if (mp->maxcache < maxcache)
mp->maxcache = maxcache;
else /* maxcache is less than curren... | false | false | false | false | false | 0 |
vect_mark_pattern_stmts (gimple orig_stmt, gimple pattern_stmt,
tree pattern_vectype)
{
stmt_vec_info pattern_stmt_info, def_stmt_info;
stmt_vec_info orig_stmt_info = vinfo_for_stmt (orig_stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (orig_stmt_info);
bb_vec_info bb_vinfo = ST... | false | false | false | false | false | 0 |
ibis_gsi_mad_ctrl_bind(
IN ibis_gsi_mad_ctrl_t* const p_ctrl,
IN const uint8_t mad_class,
IN const uint8_t class_version,
IN osm_bind_handle_t *p_h_bind)
{
osm_bind_info_t bind_info;
ib_api_status_t status = IB_SUCCESS;
OSM_LOG_ENTER(p_ctrl->p_log);
if( *p_h_bind != OSM_BIND_INVALID_HANDLE )
{
o... | false | false | false | false | false | 0 |
searchMessages(const mail::searchParams &searchInfo,
mail::searchCallback &callback)
{
vector<size_t> empty;
callback.success(empty);
} | false | false | false | false | false | 0 |
pentium_core_get_frequency(void)
{
u32 fsb = 0;
u32 msr_lo, msr_tmp;
int ret;
rdmsr(MSR_FSB_FREQ, msr_lo, msr_tmp);
/* see table B-2 of 25366920.pdf */
switch (msr_lo & 0x07) {
case 5:
fsb = 100000;
break;
case 1:
fsb = 133333;
break;
case 3:
fsb = 166667;
break;
case 2:
fsb = 200000;
break;
... | false | false | false | false | false | 0 |
efx_siena_sriov_vfs_init(struct efx_nic *efx)
{
struct pci_dev *pci_dev = efx->pci_dev;
struct siena_nic_data *nic_data = efx->nic_data;
unsigned index, devfn, sriov, buftbl_base;
u16 offset, stride;
struct siena_vf *vf;
int rc;
sriov = pci_find_ext_capability(pci_dev, PCI_EXT_CAP_ID_SRIOV);
if (!sriov)
retu... | false | false | false | false | false | 0 |
XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName)
{
/* Block after XML_Parse()/XML_ParseBuffer() has been called.
XXX There's no way for the caller to determine which of the
XXX possible error cases caused the XML_STATUS_ERROR return.
*/
if (ps_parsing == XML_PARSING || ps_parsing == XML_... | false | false | false | false | false | 0 |
attach_process_clear (AttachProcess * ap, gint ClearRequest)
{
GtkTreeModel *model;
// latest ps output
switch (ClearRequest)
{
case CLEAR_UPDATE:
case CLEAR_FINAL:
if (ap->ps_output)
{
g_free (ap->ps_output);
}
case CLEAR_INITIAL:
ap->ps_output = NULL;
}
// helper variables
switch (ClearRequest)... | false | false | false | false | false | 0 |
binding_striding_parse_step_size(const char* parameter)
{
/* striding:<amount>:<step-size>: */
if (parameter != NULL && strstr(parameter, "striding") != NULL) {
/* fetch "striding:" */
if (sge_strtok(parameter, ":") != NULL) {
if (sge_strtok(NULL, ":") != NULL) {
/* fetch step s... | false | false | false | false | false | 0 |
registration_is_cacheable(mca_mpool_base_registration_t *reg)
{
return (mca_mpool_grdma_component.leave_pinned &&
!(reg->flags &
(MCA_MPOOL_FLAGS_CACHE_BYPASS |
MCA_MPOOL_FLAGS_PERSIST |
MCA_MPOOL_FLAGS_INVALID)));
} | false | false | false | false | false | 0 |
round_push (size)
rtx size;
{
int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
if (align == 1)
return size;
if (GET_CODE (size) == CONST_INT)
{
int new = (INTVAL (size) + align - 1) / align * align;
if (INTVAL (size) != new)
size = GEN_INT (new);
}
else
{
/* CEIL_DIV... | false | false | false | false | false | 0 |
find_buffer(avar)
typval_T *avar;
{
buf_T *buf = NULL;
if (avar->v_type == VAR_NUMBER)
buf = buflist_findnr((int)avar->vval.v_number);
else if (avar->v_type == VAR_STRING && avar->vval.v_string != NULL)
{
buf = buflist_findname_exp(avar->vval.v_string);
if (buf == NULL)
{
/* No full path n... | false | false | false | false | false | 0 |
updateContext(Core::IContext *object, const Core::Context &additionalContexts)
{
Q_UNUSED(additionalContexts);
// qWarning() << "*** TemplatesViewManager::updateContext ***";
// if (object)
// qWarning() << object;
Templates::TemplatesView *view = 0;
do {
if (!object) {
if (... | false | false | false | false | false | 0 |
Keyak_ProcessAssociatedData(Keccak_ParallelDuplexInstances* duplex, const unsigned char *data, unsigned int dataSizeInBytes, int last, int bodyFollows)
{
unsigned int rhoInBytes = (duplex->rate-4)/8;
unsigned int totalByteInputIndex = Keccak_ParallelDuplexGetTotalInputIndex(duplex);
while(dataSizeInBytes >... | false | false | false | false | false | 0 |
intersectMasks(uint32_t* dest, const uint32_t* source1, int32_t len) {
int32_t i;
uint32_t oredDest = 0;
for (i = 0 ; i < len ; ++i) {
oredDest |= (dest[i] &= source1[i]);
}
return oredDest == 0;
} | false | false | false | false | false | 0 |
bgav_demuxer_peek_packet_read(void * stream1, int force)
{
bgav_packet_t * ret;
bgav_stream_t * s = stream1;
bgav_demuxer_context_t * demuxer = s->demuxer;
if(demuxer->flags & BGAV_DEMUXER_PEEK_FORCES_READ)
force = 1;
ret = bgav_packet_buffer_peek_packet_read(s->packet_buffer);
if(ret)
return... | false | false | false | false | false | 0 |
glade_project_introspect_gtk_version (GladeProject *project)
{
GladeProjectFormat fmt;
GladeWidget *widget;
GList *list, *l;
gint target_major = 2, target_minor = 0;
fmt = glade_project_get_format (project);
if (fmt == GLADE_PROJECT_FORMAT_GTKBUILDER)
target_minor = 12;
else
target_minor = 6;
for (list ... | false | false | false | false | false | 0 |
vce_v2_0_mc_resume(struct amdgpu_device *adev)
{
uint64_t addr = adev->vce.gpu_addr;
uint32_t size;
WREG32_P(mmVCE_CLOCK_GATING_A, 0, ~(1 << 16));
WREG32_P(mmVCE_UENC_CLOCK_GATING, 0x1FF000, ~0xFF9FF000);
WREG32_P(mmVCE_UENC_REG_CLOCK_GATING, 0x3F, ~0x3F);
WREG32(mmVCE_CLOCK_GATING_B, 0xf7);
WREG32(mmVCE_LMI_C... | false | false | false | false | false | 0 |
ipa_set_node_agg_value_chain (struct cgraph_node *node,
struct ipa_agg_replacement_value *aggvals)
{
if (vec_safe_length (ipa_node_agg_replacements) <= (unsigned) cgraph_max_uid)
vec_safe_grow_cleared (ipa_node_agg_replacements, cgraph_max_uid + 1);
(*ipa_node_agg_replacements)[node->uid] = aggvals;
} | false | false | false | false | false | 0 |
writeFilesToLog(string const& logFile)
{
ofstream f(logFile.c_str(), ios::app);
if (!f)
throw XErrno(logFile);
copy(mFiles.begin(), mFiles.end(), ostream_iterator<string>(f, "\n"));
} | false | false | false | false | false | 0 |
dbus_g_proxy_call_with_timeout (DBusGProxy *proxy,
const char *method,
int timeout,
GError **error,
GType first_arg_type,
...)
{
gboolean ret;
guint call_id = 0;
va_list args;
GValueArray *in_ar... | false | false | false | false | false | 0 |
marshalArgs(cdrStream& s)
{
CORBA::ULong num_args = pd_arguments->count();
for( CORBA::ULong i = 0; i < num_args; i++ ){
CORBA::NamedValue_ptr arg = pd_arguments->item(i);
if( arg->flags() & CORBA::ARG_IN )
arg->value()->NP_marshalDataOnly(s);
}
if( !CORBA::is_nil(pd_contexts) ) {
ContextList... | false | false | false | false | false | 0 |
gl518_detect(struct i2c_client *client, struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
int rev;
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA |
I2C_FUNC_SMBUS_WORD_DATA))
return -ENODEV;
/* Now, we do the remaining detection. */
if ((gl518_read_value(cli... | false | false | false | false | false | 0 |
create_priv_dialog(struct dialog_data *ddata, const ULONG priv, const int isuser)
{
static int expanded = 0;
int cnt;
GtkWidget *frame, *vbox, *button;
char *pr;
/* Get messages if we haven't got them already */
if (!expanded) {
for (cnt = 0; cnt < NUM_PRIVS; cnt++)
ptab[cnt].string = gprompt(ptab[cnt... | false | false | false | false | false | 0 |
twang_draw (Display *dpy, Window window, void *closure)
{
struct state *st = (struct state *) closure;
if (st->img_loader) /* still loading */
{
st->img_loader = load_image_async_simple (st->img_loader, 0, 0, 0, 0, 0);
if (! st->img_loader) { /* just finished */
grabImage_done (st);
... | false | false | false | false | false | 0 |
rt2800usb_autorun_detect(struct rt2x00_dev *rt2x00dev)
{
__le32 *reg;
u32 fw_mode;
int ret;
reg = kmalloc(sizeof(*reg), GFP_KERNEL);
if (reg == NULL)
return -ENOMEM;
/* cannot use rt2x00usb_register_read here as it uses different
* mode (MULTI_READ vs. DEVICE_MODE) and does not pass the
* magic value USB_M... | false | false | false | false | false | 0 |
qpol_avrule_get_perm_iter(const qpol_policy_t * policy, const qpol_avrule_t * rule, qpol_iterator_t ** perms)
{
policydb_t *db = NULL;
avtab_ptr_t avrule = NULL;
perm_state_t *ps = NULL;
if (perms) {
*perms = NULL;
}
if (!policy || !rule || !perms) {
ERR(policy, "%s", strerror(EINVAL));
errno = EINVAL;
... | false | false | false | false | false | 0 |
spec() const
{
if (specType == KDateTime::TimeZone)
return KDateTime::Spec(specZone);
else
return KDateTime::Spec(specType, specUtcOffset);
} | false | false | false | false | false | 0 |
jl_load_file_expr(char *fname, jl_value_t *ast)
{
jl_array_t *b = ((jl_expr_t*)ast)->args;
size_t i;
volatile size_t lineno=0;
if (((jl_expr_t*)ast)->head == jl_continue_sym) {
jl_errorf("syntax error: %s", jl_string_data(jl_exprarg(ast,0)));
}
JL_TRY {
jl_register_toplevel_eh();... | false | false | false | false | true | 1 |
desc_enqueue_avail (gpointer _desc)
{
Descriptor *desc = (Descriptor *) _desc;
Descriptor *old_head;
g_assert (desc->anchor.data.state == STATE_EMPTY);
g_assert (!desc->in_use);
do {
old_head = desc_avail;
desc->next = old_head;
mono_memory_write_barrier ();
} while (InterlockedCompareExchangePointer ((gp... | false | false | false | false | false | 0 |
WriteFloat(const float r, FILE * output)
{
int j;
unsigned char *pc;
pc = (unsigned char *) &r;
for (j = 0; j < 4; ++j)
putc(*(pc++), output);
} | false | false | false | false | false | 0 |
create_dir(struct archive_write_disk *a, char *path)
{
struct stat st;
struct fixup_entry *le;
char *slash, *base;
mode_t mode_final, mode;
int r;
r = ARCHIVE_OK;
/* Check for special names and just skip them. */
slash = strrchr(path, '/');
if (slash == NULL)
base = path;
... | false | false | false | false | false | 0 |
ContractSplit(Node *n) {
String *contract = Getattr(n, "feature:contract");
Hash *result;
if (!contract)
return NULL;
result = NewHash();
String *current_section = NewString("");
const char *current_section_name = Rules[0].section;
List *l = SplitLines(contract);
Iterator i;
for (i = First(l); ... | false | false | false | false | false | 0 |
myAntMove(){
vector<Location>::iterator it;
for(it = state.myAnts.begin();it < state.myAnts.end(); it++){
if(state.grid[it->row][it->col].moved > 0){
continue;
}
int moveToMake = -1;
for(int d=0; d<NUMDIRECTIONS; d++)
{
int i = (d+state.turn/4)... | false | false | false | false | false | 0 |
gc_mark_module(jl_module_t *m)
{
size_t i;
void **table = m->bindings.table;
for(i=1; i < m->bindings.size; i+=2) {
if (table[i] != HT_NOTFOUND) {
jl_binding_t *b = (jl_binding_t*)table[i];
gc_setmark(b);
if (b->value != NULL)
GC_Markval(b->value);... | false | false | false | false | false | 0 |
store_port_pkey(struct mlx4_port *p, struct port_attribute *attr,
const char *buf, size_t count)
{
struct port_table_attribute *tab_attr =
container_of(attr, struct port_table_attribute, attr);
int idx;
int err;
/* do not allow remapping Dom0 virtual pkey table */
if (p->slave == mlx4_master_func_num(... | false | false | false | false | false | 0 |
internal_shift_right(
/*
* INTERNAL_FROM_S_TO_R | INTERNAL_FROM_L_TO_S
*/
int mode,
struct tree_balance *tb,
int h, int pointer_amount)
{
struct buffer_info dest_bi, src_bi;
struct buffer_head *cf;
int d_key_position;
int nr;
internal_define_dest_src_infos(mode, tb, h, &dest_bi, &s... | false | false | false | false | true | 1 |
Write(std::ostream &out, unsigned int i) const
{
if (_type == COMMENT)
{
out << _data << "\n";
return;
}
// imprime les infos des objets
for (int j = i; j > 0; --j)
out <<"\t";
out << "<";
if (_type == HEADER)
out << "?";
out << _name;
if (... | false | false | false | false | false | 0 |
renderer_at_x (GtkSourceGutter *gutter,
gint x,
gint *start,
gint *width)
{
GList *item;
gint s;
gint w;
update_gutter_size (gutter);
s = 0;
for (item = gutter->priv->renderers; item; item = g_list_next (item))
{
Renderer *render... | false | false | false | false | false | 0 |
autoconnect ()
{
const char *server_domain;
server_domain = vink_config ("domain");
if (-1 == vink_client_connect (cl, server_domain, VINK_XMPP))
{
do_log (&ARRAY_GET (&windows, 0), L"Failed to connect to server for '%s': %s",
server_domain, vink_last_error ());
return;
}
v... | false | false | false | false | false | 0 |
__ham_46_hashmeta(dbp, real_name, flags, fhp, h, dirtyp)
DB *dbp;
char *real_name;
u_int32_t flags;
DB_FH *fhp;
PAGE *h;
int *dirtyp;
{
HMETA33 *newmeta;
COMPQUIET(dbp, NULL);
COMPQUIET(real_name, NULL);
COMPQUIET(flags, 0);
COMPQUIET(fhp, NULL);
newmeta = (HMETA33 *)h;
/* Update the version. */
newmeta... | false | false | false | false | false | 0 |
getmouseaction(char leading_char)
{
static MOUSE m;
#if UNIXPC
if(unixpcmouse == YES && leading_char == ESC) {
/* Called if cscope received an ESC character. See if it is
* a mouse report and if so, decipher it. A mouse report
* looks like: "<ESC>[?xx;yy;b;rM"
*/
int x = 0, y = 0, button = 0, reason... | false | false | false | false | false | 0 |
check_control_content_type_header(Octstr **body_part, Octstr *boundary)
{
long content_pos;
long message_start_pos;
message_start_pos = octstr_search(*body_part, boundary, 0);
if ((content_pos = octstr_case_nsearch(*body_part, octstr_imm("Content-Type:"), 0,
message_start_pos)) < 0 ||
... | false | false | false | false | false | 0 |
git_odb_open(git_odb **out, const char *objects_dir)
{
git_odb *db;
git_odb_backend *loose, *packed;
int error;
if ((error = git_odb_new(&db)) < 0)
return error;
/* add the loose object backend */
if (git_odb_backend_loose(&loose, objects_dir) == 0) {
error = git_odb_add_backend(db, loose);
if (error < 0)... | false | false | false | false | false | 0 |
getForm() const
{
NodeImpl *p = parentNode();
while(p)
{
if( p->id() == ID_FORM )
return static_cast<HTMLFormElementImpl *>(p);
if( p->parentNode() && p->parentNode()->id() == ID_TABLE && p->previousSibling() )
{
p = p->previousSibling();
continue;... | false | false | false | false | false | 0 |
sym_get_warm_start(sym_environment *env, int copy_warm_start)
{
warm_start_desc * ws;
if (!env->warm_start){
printf("sym_get_warm_start_desc():");
printf("The env. warm start description is empty!\n");
return(NULL);
}
if (copy_warm_start){
ws = create_copy_warm_start(env->warm_... | false | false | false | false | false | 0 |
expand_array_region_semnode_sb(Array_region_list_semnode *region,
Operand *r,
Operand *d)
{
Array_range_semnode *range;
int dim;
for (range = region->dim_head, dim = 0;
range != NULL && dim < d->tbl.a->dim;
range = range->next_... | false | false | false | false | false | 0 |
flimage_swapbuffer( FL_IMAGE * im )
{
int sw = im->sw ? im->sw : im->w,
sh = im->sh ? im->sh : im->h;
XCopyArea(im->xdisplay, im->pixmap, im->win, im->gc,
im->sx, im->sy, sw, sh, im->wx, im->wy);
return 0;
} | false | false | false | false | false | 0 |
p_attw_preview_events_cb (GtkWidget *widget
, GdkEvent *event
, GapStbAttrWidget *attw)
{
GdkEventExpose *eevent;
GdkEventButton *bevent;
GapStbMainGlobalParams *sgpp;
gint img_idx;
if ((attw->stb_elem_refptr == NULL)
|| (attw->stb_refptr... | false | false | false | false | false | 0 |
writeBoundingBox(const core::aabbox3df& box)
{
Writer->writeElement(L"boundingBox", true,
L"minEdge", getVectorAsStringLine(box.MinEdge).c_str(),
L"maxEdge", getVectorAsStringLine(box.MaxEdge).c_str());
} | false | false | false | false | false | 0 |
EstimateLibraryStateSpace(void)
{
DynamicFileList *file_scanner;
Size size = 1;
for (file_scanner = file_list;
file_scanner != NULL;
file_scanner = file_scanner->next)
size = add_size(size, strlen(file_scanner->filename) + 1);
return size;
} | false | false | false | false | false | 0 |
ng_check_magic(int magic, char *plugname, char *type)
{
char *h;
h=strrchr(plugname,'/');
if (h)
h++;
else
h=plugname;
if (magic != NG_PLUGIN_MAGIC) {
fprintf(stderr, "ERROR: plugin magic mismatch [me=%x,%s=%x]\n",
NG_PLUGIN_MAGIC,h,magic);
return -1;
}
#if 0
if (ng_debug)
fprin... | false | false | false | false | false | 0 |
collapse(byte a[]) {
int i;
byte res = 0;
for(i = 0; i < SHARES; i++) {
res ^= a[i];
}
return res;
} | false | false | false | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.