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 |
|---|---|---|---|---|---|---|
do_basic(void)
{
int client_fd;
SSL *ssl_clnt;
SSL_CTX *ssl_clnt_ctx = ssl_ctx_new(
DEFAULT_CLNT_OPTION, SSL_DEFAULT_CLNT_SESS);
usleep(200000); /* allow server to start */
if ((client_fd = client_socket_init(g_port)) < 0)
goto error;
if (ssl_obj_l... | false | false | false | false | true | 1 |
func_is (struct _ESExp *f,
gint argc,
struct _ESExpResult **argv,
gpointer data)
{
EBookBackendLDAPSExpData *ldap_data = data;
ESExpResult *r;
if (argc == 2
&& argv[0]->type == ESEXP_RES_STRING
&& argv[1]->type == ESEXP_RES_STRING) {
gchar *propname = argv[0]->value.string;
... | false | false | false | false | false | 0 |
setPointerAlignment(uint32_t AddrSpace, unsigned ABIAlign,
unsigned PrefAlign,
uint32_t TypeByteWidth) {
if (PrefAlign < ABIAlign)
report_fatal_error(
"Preferred alignment cannot be less than the ABI alignment");
PointersTy::iter... | false | false | false | false | false | 0 |
atc_pcm_capture_start(struct ct_atc *atc, struct ct_atc_pcm *apcm)
{
struct src *src;
struct src_mgr *src_mgr = atc->rsc_mgrs[SRC];
int i, multi;
if (apcm->started)
return 0;
apcm->started = 1;
multi = apcm->substream->runtime->channels;
/* Set up converting SRCs */
for (i = 0; i < apcm->n_srcc; i++) {
sr... | false | false | false | false | false | 0 |
mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv,
struct sk_buff *skb)
{
struct host_cmd_ds_chan_rpt_event *rpt_event;
struct mwifiex_ie_types_chan_rpt_data *rpt;
u8 *evt_buf;
u16 event_len, tlv_len;
rpt_event = (void *)(skb->data + sizeof(u32));
event_len = skb->len - (sizeof(struct host_c... | false | false | false | false | false | 0 |
restore_from_file(VMG_ vm_obj_id_t self,
class CVmFile *fp, CVmObjFixup *fixups)
{
char buf[VMB_DATAHOLDER];
/* if we don't already have an extension, allocate one */
if (ext_ == 0)
ext_ = (char *)G_mem->get_var_heap()
->alloc_mem(sizeof(... | false | false | false | false | false | 0 |
e_cal_generate_instances (ECal *ecal,
time_t start,
time_t end,
ECalRecurInstanceFn cb,
gpointer cb_data)
{
g_return_if_fail (E_IS_CAL (ecal));
e_cal_client_generate_instances_sync (
ecal->priv->client, start, e... | false | false | false | false | false | 0 |
test_collection_instance (const gchar *label)
{
TestCollection *collection = NULL;
g_assert (label);
if (!all_collections) {
all_collections = g_hash_table_new (g_str_hash, g_str_equal);
} else {
collection = g_hash_table_lookup (all_collections, label);
if (collection != NULL)
return g_object_ref (colle... | false | false | false | false | false | 0 |
bt_final(torrent_ctx *ctx, unsigned char result[20])
{
if (ctx->index > 0) {
bt_store_piece_sha1(ctx); /* flush buffered data */
}
bt_generate_torrent(ctx);
if (result) memcpy(result, ctx->btih, btih_hash_size);
} | true | true | false | false | false | 1 |
zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC) /* {{{ */
{
zval *retval;
zend_class_entry *ce;
switch (type) {
case IS_STRING:
ce = Z_OBJCE_P(readobj);
if (ce->__tostring &&
(zend_call_method_with_0_params(&readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exce... | false | false | false | false | false | 0 |
handle_scalar_return (const char *vname, void *ptr)
{
int err = 0;
if (gretl_is_scalar(vname)) {
*(double *) ptr = gretl_scalar_get_value(vname, NULL);
} else {
*(double *) ptr = NADBL;
err = E_UNKVAR; /* FIXME */
}
return err;
} | false | false | false | false | false | 0 |
routerlist_retry_directory_downloads(time_t now)
{
router_reset_status_download_failures();
router_reset_descriptor_download_failures();
if (get_options()->DisableNetwork)
return;
update_networkstatus_downloads(now);
update_all_descriptor_downloads(now);
} | false | false | false | false | false | 0 |
output_zchar_to_streams(uint8_t *zchar_src)
{
TRACE_LOG("Converting zchars from %lx.\n",
(unsigned long int)(zchar_src - z_mem));
do
{
zchar_src = zchar_to_z_ucs(
z_ucs_output_buffer,
Z_UCS_OUTPUT_BUFFER_SIZE,
zchar_src);
TRACE_LOG("zchar-src %p, mbstage: %d, currentchar: %d,... | false | false | false | false | false | 0 |
create_fetch(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type,
isc_taskaction_t callback, const char *caller)
{
unsigned int fopts = 0;
if (dns_rdataset_isassociated(&val->frdataset))
dns_rdataset_disassociate(&val->frdataset);
if (dns_rdataset_isassociated(&val->fsigrdataset))
dns_rdataset_di... | false | false | false | false | false | 0 |
clearFloatsIfNeeded(RenderObject* child, MarginInfo& marginInfo, int oldTopPosMargin, int oldTopNegMargin, int yPos)
{
int heightIncrease = getClearDelta(child, yPos);
if (heightIncrease) {
// Increase our height by the amount we had to clear.
bool selfCollapsing = child->isSelfCollapsingBlock(... | false | false | false | false | false | 0 |
ParseURLExtensions (const char* str,
char **_url,
char **_target)
{
if (!str || !str[0])
return false;
/* FIXMEchpe allo whitespace in front? */
if (str[0] != '<')
return false;
/* The expected form is "<URL> T<target> E<name=value pairs>".
* But since this is untrusted... | false | false | false | false | false | 0 |
cram_decode_aux(cram_container *c, cram_slice *s,
cram_block *blk, cram_record *cr) {
int i, r = 0, out_sz = 1;
int32_t TL;
unsigned char *TN;
if (!c->comp_hdr->TL_codec) return -1;
r |= c->comp_hdr->TL_codec->decode(s, c->comp_hdr->TL_codec, blk,
(char *)&TL, &out_sz);
if... | false | false | false | false | false | 0 |
_session_timeout (ipmiconsole_ctx_t c)
{
struct timeval current;
struct timeval timeout;
assert (c);
assert (c->magic == IPMICONSOLE_CTX_MAGIC);
timeval_add_ms (&(c->session.last_ipmi_packet_received), c->config.session_timeout_len, &timeout);
if (gettimeofday (¤t, NULL) < 0)
{
IPMICONSOLE... | false | false | false | false | false | 0 |
check_path(const char *data)
{
p_map *m;
char *ptr;
char d[1024];
strncpy(d, data, 1024);
d[1023] = '\0';
m = _map;
ptr = strtok(d, "/");
while (ptr != 0)
{
if (m->get_allow_subkeys())
break;
p_map::const_iterator m_it = m->find(ptr);
if (m_it == m->end())
{
... | false | false | false | false | false | 0 |
pmcraid_allocate_hcams(struct pmcraid_instance *pinstance)
{
pinstance->ccn.msg = pci_alloc_consistent(
pinstance->pdev,
PMCRAID_AEN_HDR_SIZE +
sizeof(struct pmcraid_hcam_ccn_ext),
&(pinstance->ccn.baddr));
pinstance->ldn.msg = pci_alloc_consistent(
pinstance->pdev,
PMCRAID_AEN_HDR_SIZE... | false | false | false | false | false | 0 |
CON_ToggleConsole( void )
{
SCR_EndLoadingPlaque (); // get rid of loading plaque
Key_ClearTyping ();
CON_ClearNotify( );
if (cls.key_dest == key_console)
{
M_ForceMenuOff ();
Cvar_Set ("paused", "0");
}
else
{
M_ForceMenuOff ();
cls.key_dest = key_console;
if (Cvar_VariableValue (... | false | false | false | false | false | 0 |
php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
{
char *s1, *s2;
int s1_len, s2_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &s1, &s1_len, &s2, &s2_len) == FAILURE) {
return;
}
RETURN_LONG(strnatcmp_ex(s1, s1_len,
s2, s2_len,
fold_case));
} | false | true | false | false | true | 1 |
bfa_ioc_fwver_clear(struct bfa_ioc *ioc)
{
u32 pgnum, pgoff, loff = 0;
int i;
pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
pgoff = PSS_SMEM_PGOFF(loff);
writel(pgnum, ioc->ioc_regs.host_page_num_fn);
for (i = 0; i < (sizeof(struct bfi_ioc_image_hdr) / sizeof(u32)); i++) {
writel(0, ioc->ioc_regs.smem... | false | false | false | false | false | 0 |
findDesc(tag_ref_ptr dd)
{
int i;
for (i = 0; i < he_numDesc; i++)
if ((he_desc[i].tag == dd->tag) && (he_desc[i].ref == dd->ref))
return i;
return FAIL;
} | false | false | false | false | false | 0 |
compare(const DcmElement& rhs) const
{
int result = DcmElement::compare(rhs);
if (result != 0)
{
return result;
}
/* cast away constness (dcmdata is not const correct...) */
DcmAttributeTag* myThis = NULL;
DcmAttributeTag* myRhs = NULL;
myThis = OFconst_cast(DcmAttributeTag*, th... | false | false | false | false | false | 0 |
kui_tree_node_delete(struct kui_tree_node *ktnode,
struct kui_tree_node **from, int *klist)
{
struct kui_tree_node *node;
int found;
if (!ktnode)
return -1;
/* base case */
if (klist[0] == 0)
return 0;
if (kui_tree_find(klist[0], ktnode->children, &found, &node) == -1... | false | false | false | false | false | 0 |
Csreparse(Cstring *iot, char *buf, int size, int flags)
{
MMIOT f;
___mkd_initmmiot(&f, 0);
___mkd_reparse(buf, size, 0, &f);
___mkd_emblock(&f);
SUFFIX(*iot, T(f.out), S(f.out));
___mkd_freemmiot(&f, 0);
} | false | false | false | false | false | 0 |
write_ent_proc (Node *node, void *closure)
{
Entnode *entnode = node->data;
if (closure != NULL && entnode->type != ENT_FILE)
*(int *) closure = 1;
if (fputentent (entfile, entnode))
error (1, errno, "cannot write %s", entfilename);
return 0;
} | false | false | false | false | false | 0 |
jk_pool_alloc(jk_pool_t *p, size_t size)
{
void *rc = NULL;
if (size == 0)
return NULL;
size = JK_ALIGN_DEFAULT(size);
if ((p->size - p->pos) >= size) {
rc = &(p->buf[p->pos]);
p->pos += size;
}
else {
if (p->dyn_size == p->dyn_pos) {
size_t new_dyn_s... | false | false | false | false | false | 0 |
listTopics(tColoredString &s, tString const &base, std::map<tString, eHelpTopic>::const_iterator begin, std::map<tString, eHelpTopic>::const_iterator const &end) {
bool printed_start = false;
for(;begin != end; ++begin) {
if(!begin->first.StartsWith(base)) {
continue;
... | false | false | false | false | false | 0 |
LoadFile()
{
// reading content of the file
m_Editor = Manager::Get()->GetEditorManager()->GetBuiltinEditor(m_FileName);
if ( m_Editor )
m_FileContent = m_Editor->GetControl()->GetText();
else
{
wxFFile File(m_FileName,_T("rb"));
if ( !File.IsOpened() )
return;
File.ReadAll(&m_FileConte... | false | false | false | false | false | 0 |
LagrangianCalc()
{
// probabilities
double p0,p1;
double sign_entropy;
// Do Lagrangian costs calculation
for ( int q=m_bottom_idx ; q<=m_top_idx ; q += m_index_step )
{
m_costs[q].Error = m_error_total[q]/double(m_count1);
m_costs[q].Error = std::sqrt( m_costs[q].Err... | false | false | false | false | false | 0 |
read_files(char *file_list, opal_list_t *file_values)
{
int i, count;
/* Iterate through all the files passed in -- read them in reverse
order so that we preserve unix/shell path-like semantics (i.e.,
the entries farthest to the left get precedence) */
mca_base_var_file_list = opal_argv_spli... | false | false | false | false | false | 0 |
start_corpse_timeout(struct obj *body)
{
long when; /* rot away when this old */
long corpse_age; /* age of corpse */
int rot_adjust;
short action;
#define TAINT_AGE (50L) /* age when corpses go bad */
#define TROLL_REVIVE_CHANCE 37 /* 1/37 chance for 50 turns ~ 75% chance */
#define ROT_AGE (250L) /*... | false | false | false | false | false | 0 |
PyvtkRearrangeFields_RemoveOperation_s3(PyObject *self, PyObject *args)
{
vtkPythonArgs ap(self, args, "RemoveOperation");
vtkObjectBase *vp = ap.GetSelfPointer(self, args);
vtkRearrangeFields *op = static_cast<vtkRearrangeFields *>(vp);
int temp0;
char *temp1 = NULL;
int temp2;
int temp3;
PyObject *re... | false | false | false | false | false | 0 |
incValue( int nSteps )
{
if ( isValid() )
setNewValue( d_data->value + double( nSteps ) * d_data->step, true );
} | false | false | false | false | false | 0 |
upd_class(const int row, struct sctrl *scp)
{
classcode_t in = whexnum(jscr, row, scp, JREQ.spq_class);
if (in == JREQ.spq_class)
return 0;
if (!(mypriv->spu_flgs & PV_COVER))
in &= mypriv->spu_class;
if (in == 0L) {
mvwaddstr(jscr, row, scp->col, hex_disp(JREQ.spq_class, 1));
disp_str = hex_disp(mypr... | false | false | false | false | false | 0 |
TestSupportedType (char const *mime_type, char const* babel_type, bool writeable)
{
AddMimeType (m_SupportedMimeTypes, mime_type);
if (babel_type)
RegisterBabelType (mime_type, babel_type);
if (writeable)
AddMimeType (m_WriteableMimeTypes, mime_type);
/* OBFormat *f = OBConversion::FormatFromMIME (mime_type);
i... | false | false | false | false | false | 0 |
getTypeString(const QualType &QT,
std::string &Str,
bool &Typename)
{
const Type *Ty = QT.getTypePtr();
Type::TypeClass TC = Ty->getTypeClass();
switch (TC) {
case Type::SubstTemplateTypeParm: {
const SubstTemplateTypeParmType *TP =
... | false | false | false | false | false | 0 |
previousCodePoint(UErrorCode & /*errorCode*/) {
if(pos == 0) {
return U_SENTINEL;
}
UChar32 c = s->char32At(pos - 1);
pos -= U16_LENGTH(c);
return c;
} | false | false | false | false | false | 0 |
handleMessage( int num )
{
QString msg;
uchar d = readChar();
for( uint i = 0; i < d; i++ ) {
msg[i] = readChar();
}
if( msg.contains(": /")) {
sendMessage( _theSockets.at( num )->getPlayer(), msg );
QStringList list = msg.split(": /");
handleCommand( num, list.at(1) );
}
} | false | false | false | false | false | 0 |
operator=(const CglStored& rhs)
{
if (this != &rhs) {
CglCutGenerator::operator=(rhs);
requiredViolation_=rhs.requiredViolation_;
cuts_=rhs.cuts_;
delete probingInfo_;
if (rhs.probingInfo_)
probingInfo_ = new CglTreeProbingInfo(*rhs.probingInfo_);
else
probingInfo_ = NULL;
dele... | false | false | false | false | false | 0 |
EmitJal(const MCSubtargetInfo &STI, MCSymbol *Symbol) {
MCInst I;
I.setOpcode(Mips::JAL);
I.addOperand(
MCOperand::createExpr(MCSymbolRefExpr::create(Symbol, OutContext)));
OutStreamer->EmitInstruction(I, STI);
} | false | false | false | false | false | 0 |
empty_area (const Selector & selector) const {
if (jet_def().jet_algorithm() == kt_algorithm) {
// run the naive algorithm
return ClusterSequenceAreaBase::empty_area(selector);
} else {
return ClusterSequence1GhostPassiveArea::empty_area(selector);
}
} | false | false | false | false | false | 0 |
generate_old_dump(void)
{
int dbnum;
mode_t old_umask;
prep_status("Creating dump of global objects");
/* run new pg_dumpall binary for globals */
exec_prog(UTILITY_LOG_FILE, NULL, true,
"\"%s/pg_dumpall\" %s --globals-only --quote-all-identifiers "
"--binary-upgrade %s -f %s",
new_cluster.bind... | false | false | false | false | false | 0 |
estimated_stack_frame_size (struct cgraph_node *node)
{
HOST_WIDE_INT size = 0;
size_t i;
tree var;
struct function *fn = DECL_STRUCT_FUNCTION (node->symbol.decl);
push_cfun (fn);
init_vars_expansion ();
FOR_EACH_LOCAL_DECL (fn, i, var)
if (auto_var_in_fn_p (var, fn->decl))
size += expand_one... | false | false | false | false | false | 0 |
dapm_new_pga(struct snd_soc_dapm_widget *w)
{
int i, ret;
for (i = 0; i < w->num_kcontrols; i++) {
ret = dapm_create_or_share_kcontrol(w, i);
if (ret < 0)
return ret;
}
return 0;
} | false | false | false | false | false | 0 |
mxf_metadata_essence_container_data_write_tags (MXFMetadataBase * m,
MXFPrimerPack * primer)
{
MXFMetadataEssenceContainerData *self =
MXF_METADATA_ESSENCE_CONTAINER_DATA (m);
GList *ret =
MXF_METADATA_BASE_CLASS
(mxf_metadata_essence_container_data_parent_class)->write_tags (m,
primer);... | false | false | false | false | false | 0 |
bottomOfSelection()
{
QTextCursor cursor = textEdit->textCursor();
if (cursor.hasSelection())
cursor.setPosition(qMax(cursor.position(), cursor.anchor()));
return cursor;
} | false | false | false | false | false | 0 |
test_cgroup_attach_task(int retcode, struct cgroup *cgrp,
const char *group1, const char *group2, pid_t pid, int k, int i)
{
int retval;
char tasksfile[FILENAME_MAX], tasksfile2[FILENAME_MAX];
/* Check, In case some error is expected due to a negative scenario */
if (retcode) {
if (pid)
retval = cgroup_attac... | true | true | false | false | false | 1 |
decl_to_string (tree decl, int verbose)
{
int flags = 0;
if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == RECORD_TYPE
|| TREE_CODE (decl) == UNION_TYPE || TREE_CODE (decl) == ENUMERAL_TYPE)
flags = TFF_CLASS_KEY_OR_ENUM;
if (verbose)
flags |= TFF_DECL_SPECIFIERS;
else if (TREE_CODE (decl)... | false | false | false | false | false | 0 |
textbox_cleanup(struct widget *tb, char *text)
{
char *s = (char *)tb->data;
xfree(tb->data);
tb->data = strdup("");
} | false | false | false | false | false | 0 |
multifetch(ESL_GETOPTS *go, FILE *ofp, int outfmt, char *keyfile, ESLX_MSAFILE *afp)
{
ESL_KEYHASH *keys = esl_keyhash_Create();
ESL_FILEPARSER *efp = NULL;
ESL_MSA *msa = NULL;
int nali = 0;
char *key;
int keylen;
int keyidx;
int ... | false | false | false | false | false | 0 |
cmp(const char *stringz, void *s, size_t slen)
{
size_t len1 = strlen(stringz);
if (len1 != slen)
return len1 - slen;
return memcmp(stringz, s, slen);
} | false | false | false | false | false | 0 |
cfg_layout_initialize (unsigned int flags)
{
rtx x;
basic_block bb;
initialize_original_copy_tables ();
cfg_layout_rtl_register_cfg_hooks ();
record_effective_endpoints ();
/* Make sure that the targets of non local gotos are marked. */
for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
{... | false | false | false | false | false | 0 |
vt_do_kdskbmode(int console, unsigned int arg)
{
struct kbd_struct *kb = kbd_table + console;
int ret = 0;
unsigned long flags;
spin_lock_irqsave(&kbd_event_lock, flags);
switch(arg) {
case K_RAW:
kb->kbdmode = VC_RAW;
break;
case K_MEDIUMRAW:
kb->kbdmode = VC_MEDIUMRAW;
break;
case K_XLATE:
kb->kbdm... | false | false | false | false | false | 0 |
elan_i2c_read_block(struct i2c_client *client,
u16 reg, u8 *val, u16 len)
{
__le16 buf[] = {
cpu_to_le16(reg),
};
struct i2c_msg msgs[] = {
{
.addr = client->addr,
.flags = client->flags & I2C_M_TEN,
.len = sizeof(buf),
.buf = (u8 *)buf,
},
{
.addr = client->addr,
.flags = (client... | false | false | false | false | false | 0 |
oid_rt_get_preamble_mode_hdl(struct oid_par_priv *poid_par_priv)
{
struct _adapter *padapter = (struct _adapter *)
(poid_par_priv->adapter_context);
u32 preamblemode = 0;
if (poid_par_priv->type_of_oid != QUERY_OID)
return RNDIS_STATUS_NOT_ACCEPTED;
if (poid_par_priv->information_buf_len >= sizeof(u32)) ... | false | false | false | false | false | 0 |
gmpc_tools_database_update_tracker_stop_updating (GmpcToolsDatabaseUpdateTracker* self) {
GtkImage* _tmp0_;
GtkImage* _tmp1_;
GtkContainer* _tmp2_;
GtkContainer* _tmp3_;
GtkImage* _tmp4_;
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->image;
if (_tmp0_ == NULL) {
return;
}
_tmp1_ = self->priv->image;... | false | false | false | false | false | 0 |
send_contacts(int n)
{
dchat_pdu_t pdu; // pdu with contact information
char* contact_str; // pointer to a string representation of a contact
int i;
int ret; // return value
int pdu_len = 0; // total content length of pdu-packet that will be sent
contact_t* contact; // contact ... | false | true | false | false | false | 1 |
send_message(int type, void* buf, int len) {
struct nlmsghdr nl;
struct iovec iovec[2];
if (nlsock < 0)
return 0;
memset(&nl, 0, sizeof(nl));
nl.nlmsg_len = NLMSG_LENGTH(len);
nl.nlmsg_type = type;
nl.nlmsg_flags = NLM_F_REQUEST;
nl.nlmsg_pid = xgetpid();
memset(&iovec, 0, sizeof(iovec));
iovec[0].iov_... | false | false | false | false | false | 0 |
Load(const String& s)
{
String data(s);
char *token;
// Format is "%s\t%d\t%d\t%d\t%d
token = strtok(data, "\t");
if (!token)
return NOTOK;
Word(token);
token = strtok(0, "\t");
if (!token)
return NOTOK;
DocID(atoi(token));
token = strtok(0, "\t");
if (!token)
return NOTOK;
Flags... | false | false | false | false | false | 0 |
GTForePos(GTextField *gt,int pos, int ismeta) {
int newpos=pos,sel;
if ( ismeta && !gt->dobitext )
newpos = GTextFieldSelForeword(gt->text,pos);
else if ( ismeta ) {
sel = GTextFieldGetOffsetFromOffset(gt,GTextFieldFindLine(gt,pos),pos);
newpos = GTextFieldSelForeword(gt->bidata.text,sel);
newpos = gt-... | true | true | false | false | true | 1 |
lvl_free (a_level *lvl)
{
if (lvl->private) {
XFREE0 (lvl->private->tile);
XFREE0 (lvl->private->sound_track_alias);
XFREE0 (lvl->private->tile_sprite_map_basename);
XFREE0 (lvl->private);
}
XFREE0 (lvl->square_type);
XFREE0 (lvl->square_walls_out);
XFREE0 (lvl->square_direction);
XFREE0 (lv... | false | false | false | false | false | 0 |
usb_audio_disconnect(struct usb_interface *intf)
{
struct snd_usb_audio *chip = usb_get_intfdata(intf);
struct snd_card *card;
struct list_head *p;
if (chip == (void *)-1L)
return;
card = chip->card;
mutex_lock(®ister_mutex);
if (atomic_inc_return(&chip->shutdown) == 1) {
struct snd_usb_stream *as;
s... | false | false | false | false | false | 0 |
createAbstractFileFromIBootIM(AbstractFile* file) {
InfoIBootIM* info;
AbstractFile* toReturn;
uint8_t *compressed;
if(!file) {
return NULL;
}
info = (InfoIBootIM*) malloc(sizeof(InfoIBootIM));
info->file = file;
file->seek(file, 0);
file->read(file, &(info->header), sizeof(info->header));
flipIBootIMHea... | false | true | false | false | true | 1 |
encode(UINT8* buff,UINT32* bufflen,UINT32 type)
{
switch (type)
{
case XML_X509DATA:
memcpy(buff,"<X509Data>",10);
UINT32 len=10;
LP_CERTSTORE_ENTRY tmp;
tmp=m_pCertList;
UINT32 space=*bufflen-10;
while(tmp!=NULL)
{
*bufflen=space;
tmp->pCert->encode(buff+len,... | false | false | false | false | false | 0 |
cp_parser_functional_cast (cp_parser* parser, tree type)
{
vec<tree, va_gc> *vec;
tree expression_list;
tree cast;
bool nonconst_p;
if (!type)
type = error_mark_node;
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
expression_li... | false | false | false | false | false | 0 |
dblayer_get_full_inst_dir(struct ldbminfo *li, ldbm_instance *inst,
char *buf, int buflen)
{
char *parent_dir = NULL;
int mylen = 0;
if (!inst)
return NULL;
if (inst->inst_parent_dir_name) /* e.g., /var/lib/dirsrv/slapd-ID/db */
{
parent_dir = inst->inst_p... | false | true | false | false | false | 1 |
update()
{
QCA_logTextMessage(QString("tls[%1]: update").arg(q->objectName()), Logger::Information);
if(blocked)
{
QCA_logTextMessage(QString("tls[%1]: ignoring update while blocked").arg(q->objectName()), Logger::Information);
return;
}
if(!actionQueue.isEmpty())
{
QCA_logTextMessage(QString("t... | false | false | false | false | false | 0 |
evhttp_connection_set_local_address(struct evhttp_connection *evcon,
const char *address)
{
EVUTIL_ASSERT(evcon->state == EVCON_DISCONNECTED);
if (evcon->bind_address)
mm_free(evcon->bind_address);
if ((evcon->bind_address = mm_strdup(address)) == NULL)
event_err(1, "%s: strdup", __func__);
} | false | false | false | false | false | 0 |
pcnet32_open ( struct net_device *netdev )
{
struct pcnet32_private *priv = netdev_priv ( netdev );
unsigned long ioaddr = priv->pci_dev->ioaddr;
int rc;
u16 val;
/* Setup TX and RX descriptors */
if ( ( rc = pcnet32_setup_tx_resources ( priv ) ) != 0 ) {
DBG ( "Error setting up TX resources\n" );
goto err_s... | false | false | false | false | false | 0 |
readBTNodeDescriptor(uint32_t num, BTree* tree) {
BTNodeDescriptor* descriptor;
descriptor = (BTNodeDescriptor*) malloc(sizeof(BTNodeDescriptor));
if(!READ(tree->io, num * tree->headerRec->nodeSize, sizeof(BTNodeDescriptor), descriptor))
return NULL;
FLIPENDIAN(descriptor->fLink);
FLIPENDIAN(de... | false | false | false | false | false | 0 |
mark_complete(const char *path, const unsigned char *sha1, int flag, void *cb_data)
{
struct commit *commit = lookup_commit_reference_gently(sha1, 1);
if (commit) {
commit->object.flags |= COMPLETE;
insert_by_date(commit, &complete);
}
return 0;
} | false | false | false | false | false | 0 |
showLabel(bool showIt, ViewLayer * viewLayer) {
if (showIt == this->isVisible()) return;
if (showIt && !m_initialized) {
if (m_owner == NULL) return;
if (m_owner->scene() == NULL) return;
bool flipped = (viewLayer->viewLayerID() == ViewLayer::Silkscreen0Label);
if (m_owner->viewID() != ViewLayer::PCBView) ... | false | false | false | false | false | 0 |
read_data_compressed(int fd, int row, unsigned char *data_buf,
int *nbytes)
{
struct fileinfo *fcb = &G__.fileinfo[fd];
off_t t1 = fcb->row_ptr[row];
off_t t2 = fcb->row_ptr[row + 1];
ssize_t readamount = t2 - t1;
unsigned char *cmp = G__.compressed_buf;
int n;
if (lseek(fd, t1, SEEK_SE... | false | true | false | false | true | 1 |
xnode_orphan_check(const xnode_t * const xn)
{
etree_t t;
xnode_check(xn);
etree_init_root(&t, xn, TRUE, offsetof(xnode_t, node));
g_assert(etree_is_orphan(&t, xn));
} | false | false | false | false | false | 0 |
yToRow(unsigned y_)
{
int row=0;
if (y_==0) row=0;
else row=y_/textHeight();
row=(row>=numLines()?numLines()-1:row);
return row;
} | false | false | false | false | false | 0 |
gst_capsfilter_transform_caps (GstBaseTransform * base,
GstPadDirection direction, GstCaps * caps, GstCaps * filter)
{
GstCapsFilter *capsfilter = GST_CAPSFILTER (base);
GstCaps *ret, *filter_caps, *tmp;
GST_OBJECT_LOCK (capsfilter);
filter_caps = gst_caps_ref (capsfilter->filter_caps);
GST_OBJECT_UNLOCK... | false | false | false | false | false | 0 |
runModal(XAP_Frame * pFrame)
{
// build the dialog
GtkWidget * cf = _constructWindow();
UT_return_if_fail(cf);
setHeightEntry();
setWidthEntry();
double height = UT_convertToInches(getHeightString());
double width = UT_convertToInches(getWidthString());
if((height > 0.0001) && (width > 0.0001))
m_dHeight... | false | false | false | false | false | 0 |
serialize(BinaryOutput& b) const {
int r,c;
for (c = 0; c < 3; ++c) {
for (r = 0; r < 3; ++r) {
b.writeFloat32(elt[r][c]);
}
}
} | false | false | false | false | false | 0 |
rename(const char *name, const char *to)
{
int idx;
idx = find_entry(to);
if (idx >= 0)
return KCT_ERROR_EXIST;
idx = find_entry(name);
if (idx < 0)
return KCT_ERROR_NOENT;
return rename(idx, to);
} | false | false | false | false | false | 0 |
on_highlight_widget(GtkWidget *grab_window,
GdkEventMotion *event,
ParasiteWindow *parasite)
{
GdkWindow *selected_window;
gint x, y, width, height;
ensure_highlight_window(parasite);
gtk_widget_hide(parasite->highlight_window);
selected_window = gdk_displa... | false | false | false | false | false | 0 |
init_rxtx_rings(struct net_device *dev)
{
struct netdev_private *np = netdev_priv(dev);
int i;
np->rx_head_desc = &np->rx_ring[0];
np->tx_ring = (struct w840_tx_desc*)&np->rx_ring[RX_RING_SIZE];
/* Initial all Rx descriptors. */
for (i = 0; i < RX_RING_SIZE; i++) {
np->rx_ring[i].length = np->rx_buf_sz;
np-... | false | false | false | false | false | 0 |
lookupFunction(const Function *F) {
// Function not found, look it up... start by figuring out what the
// composite function name should be.
std::string ExtName = "lle_";
FunctionType *FT = F->getFunctionType();
for (unsigned i = 0, e = FT->getNumContainedTypes(); i != e; ++i)
ExtName += getTypeID(FT->ge... | false | false | false | false | false | 0 |
get_single_pad (GstElement * element, GstPadDirection direction)
{
GstPad *pad = NULL;
GST_OBJECT_LOCK (element);
if (direction == GST_PAD_SRC) {
if (element->numsrcpads == 1)
pad = element->srcpads->data;
} else {
if (element->numsinkpads == 1)
pad = element->sinkpads->data;
}
if (pad... | false | false | false | false | false | 0 |
init_display(struct fbtft_par *par)
{
par->fbtftops.reset(par);
/* startup sequence for MI0283QT-9A */
write_reg(par, 0x01); /* software reset */
mdelay(5);
write_reg(par, 0x28); /* display off */
/* --------------------------------------------------------- */
write_reg(par, 0xCF, 0x00, 0x83, 0x30);
write_reg(... | false | false | false | false | false | 0 |
operator=(const CollationKey& other)
{
if (this != &other)
{
if (other.isBogus())
{
return setToBogus();
}
if (other.fBytes != NULL)
{
ensureCapacity(other.fCount);
if (isBogus())
{
return *this;
... | false | false | false | false | false | 0 |
P_Vector_To_List (Object vec) {
register unsigned int i;
Object list, tail, cell;
GC_Node3;
Check_Type (vec, T_Vector);
list = tail = Null;
GC_Link3 (vec, list, tail);
for (i = 0; i < VECTOR(vec)->size; i++, tail = cell) {
cell = Cons (VECTOR(vec)->data[i], Null);
if (Nullp ... | false | false | false | false | false | 0 |
instantiate_scev (basic_block instantiate_below, struct loop *evolution_loop,
tree chrec)
{
tree res;
htab_t cache = htab_create (10, hash_scev_info, eq_scev_info, del_scev_info);
if (dump_file && (dump_flags & TDF_SCEV))
{
fprintf (dump_file, "(instantiate_scev \n");
fprintf (dump_file, " (... | false | false | false | false | false | 0 |
upgdn(BW *bw)
{
bw = (BW *) bw->parent->main->object;
if (bw->o.hex ? bw->cursor->byte/16 == bw->b->eof->byte/16 : bw->cursor->line == bw->b->eof->line)
return -1;
if (pgamnt < 0)
scrdn(bw, bw->h / 2 + bw->h % 2, 1);
else if (pgamnt < bw->h)
scrdn(bw, bw->h - pgamnt, 1);
else
scrdn(bw, 1, 1);
return 0;
} | false | false | false | false | false | 0 |
dwc2_complete_non_isoc_xfer_ddma(struct dwc2_hsotg *hsotg,
struct dwc2_host_chan *chan,
int chnum,
enum dwc2_halt_status halt_status)
{
struct list_head *qtd_item, *qtd_tmp;
struct dwc2_qh *qh = chan->qh;
struct dwc2_qtd *qtd = NULL;
int xfer_done;
int desc_num = 0;
if (chan->halt_s... | false | false | false | false | false | 0 |
bogus_sum(void *data, size_t len) {
uint64_t res = 0, tmp = 0;
uint64_t *ptr = (uint64_t *)data;
while(len >= sizeof(uint64_t)) {
res ^= *ptr++;
len -= sizeof(uint64_t);
}
if(len > 0) {
memcpy(&tmp, ptr, len);
res ^= tmp;
}
return res;
} | false | false | false | false | false | 0 |
mos_median_in_slit(cpl_table *table, cpl_table *slits, int slit,
char *label, double *mvalue)
{
int position = cpl_table_get_int(slits, "position", slit, NULL);
int length = cpl_table_get_int(slits, "length", slit, NULL);
cpl_table *tmp = cpl_table_extract(... | false | false | false | false | false | 0 |
addHtmlData(T_AllowGet tTo, const void* pData, UT_sint32 iNumBytes, bool xhtml)
{
if (xhtml)
{
return addData (tTo, AP_CLIPBOARD_APPLICATION_XHTML, pData, iNumBytes) ? true : false;
}
return addData (tTo, AP_CLIPBOARD_TXT_HTML, pData, iNumBytes) ? true : false;
} | false | false | false | false | false | 0 |
PopulateEdgeIds(void)
{
this->m_EdgeIds.resize(0);
std::vector<int> edgePtIds;
edgePtIds.resize(2);
// edge 0
edgePtIds[0] = 0;
edgePtIds[1] = 1;
this->m_EdgeIds.push_back(edgePtIds);
// edge 1
edgePtIds[0] = 1;
edgePtIds[1] = 2;
this->m_EdgeIds.push_back(edgePtIds);
// edge 2
edgePtIds[0]... | false | false | false | false | false | 0 |
fetch_mails (gboolean statusonly) throw (pop_err)
{
std::map<guint,std::string> msg_uid;
// STAT
guint total = command_stat ();
// We want to retrieve a maximum of _max_collected_mail uidl
// so we have to check the total number and find corresponding
// starting index (start).
guint start = 1, num = biff_->va... | false | false | false | false | false | 0 |
setTextColor( QColor textColor )
{
m_customColor = true;
if( textColor == this->textColor() )
return;
QPalette myPalette( m_label->palette() );
myPalette.setColor( QPalette::WindowText, textColor );
m_label->setPalette( myPalette );
} | false | false | false | false | false | 0 |
FindCell(double x[3], vtkCell *vtkNotUsed(cell),
vtkIdType vtkNotUsed(cellId),
double tol2,
int& subId, double pcoords[3], double *weights)
{
int idx[3];
// Compute the voxel index
if ( this->ComputeStructuredCoord... | false | false | false | false | false | 0 |
CL_RunDLights (void)
{
int i;
cdlight_t *dl;
dl = cl_dlights;
for (i=0 ; i<MAX_DLIGHTS ; i++, dl++)
{
if (!dl->radius)
continue;
if (dl->die < cl.time) {
dl->radius = 0;
return;
}
//dl->radius -= cls.frametime*dl->decay;
if (dl->radius < 0.0f)
dl->radius = 0.0f;
}
} | 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.