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 |
|---|---|---|---|---|---|---|
audio_group_open(void)
{
int i;
if(_is_open)
return;
memset(grouptab, 0, sizeof(grouptab));
for(i = 0; i < AUDIO_MAX_GROUPS; ++i)
acc_copya(&grouptab[i].ctl, &a_group_def_ctl);
_is_open = 1;
} | false | false | false | false | false | 0 |
H5PTappend( hid_t table_id,
size_t nrecords,
const void * data )
{
htbl_t * table;
/* Find the table struct from its ID */
if((table = (htbl_t *) H5Iobject_verify(table_id, H5PT_ptable_id_type)) == NULL)
goto out;
/* If we are asked to write 0 records,... | false | false | false | false | false | 0 |
addTaggedPairIG(
const CHertzianViscoElasticIGP &prms,
int tag1,
int mask1,
int tag2,
int mask2
)
{
TaggedIGPCommand igpCmd(getGlobalRankAndComm());
igpCmd.appendIGP(prms);
igpCmd.append(prms.m_A);
igpCmd.append(prms.m_E);
igpCmd.append(prms.m_nu);
igpCmd.append(tag1);
igpCmd.append(mask1);
ig... | false | false | false | false | false | 0 |
giggle_remote_apply_config (GiggleRemote *remote,
GHashTable *config)
{
GiggleRemotePriv *priv;
GiggleRemoteBranch *branch;
const char *url, *pull, *push;
const char *prefix = NULL;
char *key;
g_return_if_fail (GIGGLE_IS_REMOTE (remote));
g_return_if_fail (NULL != config... | false | false | false | false | false | 0 |
gf_isom_get_mpeg4_subtype(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex)
{
GF_TrackBox *trak;
GF_Box *entry;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !DescriptionIndex) return 0;
entry = (GF_Box*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->othe... | false | false | false | false | false | 0 |
renderDots(int wing_index, int screen_index, int num_wings_to_draw)
{
int i, sx, sy, is_bright, bitmap = -1;
if ( Wingman_status_dots.first_frame < 0 ) {
return;
}
if(num_wings_to_draw == 1) {
sx = position[0] + single_wing_offsets[0];
sy = position[1] + single_wing_offsets[1];
} else if ( grow_mode == GRO... | false | false | false | false | false | 0 |
rotate_left(BiTreeNode **node) {
BiTreeNode *left, *grandchild;
left = bitree_left(*node);
if(((AvlNode *)bitree_data(left))->factor == AVL_LFT_HEAVY) {
bitree_left(*node) = bitree_right(left);
bitree_right(left) = *node;
((AvlNode *)bitree_data(*node))->factor = AVL_BALANCED;
((AvlNode *)bitree_data(left)... | false | false | false | false | false | 0 |
gr_start_dma(struct gr_ep *ep)
{
struct gr_request *req;
u32 dmactrl;
if (list_empty(&ep->queue)) {
ep->dma_start = 0;
return;
}
req = list_first_entry(&ep->queue, struct gr_request, queue);
/* A descriptor should already have been allocated */
BUG_ON(!req->curr_desc);
/*
* The DMA controller can not ... | false | false | false | false | false | 0 |
truncstrsub(buf, str, bufsz)
char *buf;
size_t bufsz;
const char *str;
{
if (strlen(str) < bufsz)
strcpy(buf, str);
else if (bufsz == 0)
complain("internal error"); /* cannot even fit NUL */
else {
strncpy(buf, str, bufsz - 1);
buf[bufsz-1] = '\0';
}
} | false | false | false | false | false | 0 |
setAttribute(const c8* attributeName, video::ITexture* value )
{
IAttribute* att = getAttributeP(attributeName);
if (att)
att->setTexture(value);
else
Attributes.push_back(new CTextureAttribute(attributeName, value, Driver));
} | false | false | false | false | false | 0 |
append_inner_node_end(struct llist *result,
struct rnode *current)
{
if (! append_element(result, strdup(")")))
return FAILURE;
if (strcmp("", current->label) != 0)
if (! append_element(result, strdup(current->label)))
return FAILURE;
if (show_addresses)
if (! append_element( result, masprintf("@%p", cur... | false | false | false | false | false | 0 |
setText(const UnicodeString& source,
UErrorCode& status)
{
if (U_FAILURE(status)) {
return;
}
string_ = source;
const UChar *s = string_.getBuffer();
CollationIterator *newIter;
UBool numeric = rbc_->settings->isNumeric();
if (rbc_->settings->d... | false | false | false | false | false | 0 |
paramSetValueAtTime(OfxParamHandle paramHandle,
OfxTime time, // time in frames
...)
{
# ifdef OFX_DEBUG_PARAMETERS
std::cout << "OFX: paramSetValueAtTime - " << paramHandle << ' ' << time << ' ';
# endif
... | false | false | false | false | false | 0 |
parse_address(Octstr **address, long *type_of_address)
{
long pos;
Octstr *copy;
pos = octstr_len(*address) - 1;
/*
* Delete first separator, if there is one. This will help our parsing later.
*/
if (octstr_get_char(*address, 0) == '/')
octstr_delete(*address, 0, 1);
/*
* WAP-209, chapter 8... | false | false | false | false | false | 0 |
bcm2048_fops_poll(struct file *file,
struct poll_table_struct *pts)
{
struct bcm2048_device *bdev = video_drvdata(file);
int retval = 0;
poll_wait(file, &bdev->read_queue, pts);
if (bdev->rds_data_available)
retval = POLLIN | POLLRDNORM;
return retval;
} | false | false | false | false | false | 0 |
tds_free_socket(TDSSOCKET * tds)
{
if (tds) {
if (tds->authentication)
tds->authentication->free(tds, tds->authentication);
tds->authentication = NULL;
tds_free_all_results(tds);
tds_free_env(tds);
while (tds->dyns)
tds_free_dynamic(tds, tds->dyns);
while (tds->cursors)
tds_cursor_deallocated(tds,... | false | false | false | false | false | 0 |
_elm_genlist_item_odd_even_update(Elm_Gen_Item *it)
{
if (!it->item->nostacking)
{
if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even)
{
if (it->deco_all_view) evas_object_lower(it->deco_all_view);
else evas_object_lower(VIEW(it));
}
else
... | false | false | false | false | false | 0 |
mixer_ctl_feature_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct usb_mixer_elem_info *cval = kcontrol->private_data;
int c, cnt, val, oval, err;
int changed = 0;
if (cval->cmask) {
cnt = 0;
for (c = 0; c < MAX_CHANNELS; c++) {
if (!(cval->cmask & (1 << c)))
continu... | false | false | false | false | false | 0 |
_warnerr(krb5_context context, int do_errtext,
krb5_error_code code, int level, const char *fmt, va_list ap)
{
char xfmt[7] = "";
const char *args[2], **arg;
char *msg = NULL;
const char *err_str = NULL;
krb5_error_code ret;
args[0] = args[1] = NULL;
arg = args;
if(fmt){
strlcat(xfmt... | false | false | false | false | false | 0 |
AcpiEvNotifyDispatch (
void *Context)
{
ACPI_GENERIC_STATE *Info = (ACPI_GENERIC_STATE *) Context;
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_FUNCTION_ENTRY ();
/* Invoke a global notify handler if installed */
if (Info->Notify.Global->Handler)
{
Info->Not... | false | false | false | false | false | 0 |
cls_send_stop_character(struct jsm_channel *ch)
{
if (!ch)
return;
if (ch->ch_stopc != __DISABLED_CHAR) {
ch->ch_xoff_sends++;
writeb(ch->ch_stopc, &ch->ch_cls_uart->txrx);
}
} | false | false | false | false | false | 0 |
execute_test(void)
{
git_oid oid, check;
git_commit *commit;
git_tree *tree;
git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
cl_git_pass(git_reference_name_to_id(&oid, g_repo, "refs/heads/branch1"));
cl_git_pass(git_commit_lookup(&commit, g_repo, &oid));
cl_git_pass(git_commit_tree(&tree, commit));
opts.chec... | false | false | false | false | false | 0 |
AutoCompleteGetCurrentText(char *buffer) {
if (ac.Active()) {
int item = ac.lb->GetSelection();
char selected[1000];
selected[0] = '\0';
if (item != -1) {
ac.lb->GetValue(item, selected, sizeof(selected));
if (buffer != NULL)
strcpy(buffer, selected);
return strlen(selected);
}
}
if (buffer !=... | false | false | false | false | false | 0 |
process_clause(Mclause c, Mstate state)
{
if (c->subsumed)
return;
else if (c->u.active == 0) {
if (flag(Opt->trace))
printf("\t\t\t\t\t** BACKUP **\n");
state->ok = FALSE;
return;
}
else if (c->u.active != 1)
return; /* nonunit, so do nothing */
else {
/* OK, we have a nonsubs... | false | false | false | true | false | 1 |
do_set_mempolicy(unsigned short mode, unsigned short flags,
nodemask_t *nodes)
{
struct mempolicy *new, *old;
NODEMASK_SCRATCH(scratch);
int ret;
if (!scratch)
return -ENOMEM;
new = mpol_new(mode, flags, nodes);
if (IS_ERR(new)) {
ret = PTR_ERR(new);
goto out;
}
task_lock(current);
ret = mpol_... | false | false | false | false | false | 0 |
dump(TInfoSink& infoSink) const
{
infoSink.debug << getName().c_str() << ": " << type.getQualifierString() << " " << type.getBasicString();
if (type.isArray())
{
infoSink.debug << "[0]";
}
infoSink.debug << "\n";
} | false | false | false | false | false | 0 |
drawBall(GdkGC *gc, int x,int y,int color,int radius) {
int j,k;
j=x; k=y; if (effectiveFlip()) j=7-j; else k=7-k;
gdk_rgb_gc_set_foreground(gc,color);
gdk_draw_arc(yidget->window,gc,FALSE,
borx+j*sqside+sqside/2-radius,
morey+bory+k*sqside+sqside/2-radius,
radius*2, radius*2, 0, 360*64)... | false | false | false | false | false | 0 |
takeFirstComment() {
CommentSet::iterator it = m_comments.begin();
if( it == m_comments.end() ) return Comment();
Comment ret = *it;
m_comments.erase(it);
/* kDebug() << "taken first comment in line" << (*it).line() << "new count:" << m_comments.size();*/
return ret;
} | false | false | false | false | false | 0 |
window_save_items(WINDOW_REC *window, CONFIG_NODE *node)
{
GSList *tmp;
node = config_node_section(node, "items", NODE_TYPE_LIST);
for (tmp = window->items; tmp != NULL; tmp = tmp->next)
signal_emit("layout save item", 3, window, tmp->data, node);
} | false | false | false | false | false | 0 |
sg_vector_create(size_t block_size, size_t alloc_count, size_t initial_used,
const sg_vector_init_info * const info) {
size_t block_shift = 0;
TRACE_LOG_FMT("vector", "allocating vector fitting for %lu items and use %lu of them", alloc_count, initial_used);
while( ((unsigned)1 << block_shift) < block_size )
... | false | false | false | false | false | 0 |
gfarm_pgsql_xattr_removeall(struct db_xattr_arg *arg)
{
gfarm_error_t e;
const char *paramValues[1];
char inumber[GFARM_INT64STRLEN + 1];
char *diag;
char *command;
sprintf(inumber, "%" GFARM_PRId64, arg->inum);
paramValues[0] = inumber;
if (arg->xmlMode) {
command = "DELETE FROM XmlAttr "
"WHERE inumber ... | true | true | false | false | true | 1 |
adm8211_interrupt(int irq, void *dev_id)
{
#define ADM8211_INT(x) \
do { \
if (unlikely(stsr & ADM8211_STSR_ ## x)) \
wiphy_debug(dev->wiphy, "%s\n", #x); \
} while (0)
struct ieee80211_hw *dev = dev_id;
struct adm8211_priv *priv = dev->priv;
u32 stsr = ADM8211_CSR_READ(STSR);
ADM8211_CSR_WRITE(ST... | false | false | false | false | false | 0 |
ring_buffer_read_prepare(struct ring_buffer *buffer, int cpu)
{
struct ring_buffer_per_cpu *cpu_buffer;
struct ring_buffer_iter *iter;
if (!cpumask_test_cpu(cpu, buffer->cpumask))
return NULL;
iter = kmalloc(sizeof(*iter), GFP_KERNEL);
if (!iter)
return NULL;
cpu_buffer = buffer->buffers[cpu];
iter->cpu_... | false | false | false | false | false | 0 |
attachment_load_write_cb (GOutputStream *output_stream,
GAsyncResult *result,
LoadContext *load_context)
{
EAttachment *attachment;
GCancellable *cancellable;
GInputStream *input_stream;
gssize bytes_written;
GError *error = NULL;
bytes_written = g_output_strea... | false | false | false | false | false | 0 |
closefiles(struct progstate *const state)
{
if (state->ofd != 1 && state->ofd != 2 && state->ofd != -1)
if (close(state->ofd) == -1) {
perror("Cannot close outfile");
}
if (state->ifd != 0 && state->ifd != -1)
if (close(state->ifd) == -1) {
perror("Cannot close infile");
}
} | false | false | false | false | false | 0 |
cafebabe_annotations_attribute_init(struct cafebabe_annotations_attribute *a, struct cafebabe_stream *s)
{
int err = 0;
err = cafebabe_stream_read_uint16(s, &a->num_annotations);
if (err)
goto out;
a->annotations = calloc(a->num_annotations, sizeof(struct cafebabe_annotation));
if (!a->annotations) {
err = -... | false | false | false | false | false | 0 |
getHintsOffset2()
{
int hintsOffset2 = 0; // default to 0
Object obj1, obj2;
if (linDict.isDict() &&
linDict.dictLookup("H", &obj1)->isArray() &&
obj1.arrayGetLength()>=4) {
if (obj1.arrayGet(2, &obj2)->isInt() &&
obj2.getInt() > 0) {
hintsOffset2 = obj2.getInt();
} else {
... | false | false | false | false | false | 0 |
evas_common_polygon_points_clear(RGBA_Polygon_Point *points)
{
if (points)
{
while (points)
{
RGBA_Polygon_Point *old_p;
old_p = points;
points = (RGBA_Polygon_Point *)eina_inlist_remove(EINA_INLIST_GET(points), EINA_INLIST_GET(points));
free(old_p);
}
}
return NULL;
} | false | false | false | false | false | 0 |
mincdec()
{
++mcount;
Ex(&target);
buildsegword(&target);
if (target.indcount == 0x0 && segword == WORDBIT)
opcode |= 0x40 | rm[target.base];
else
buildunary(0xFE | segword);
} | false | false | false | false | false | 0 |
write_state_a_string (const char *s)
{
char c;
fputs (" \"", state_file);
for (; *s != 0; s++)
{
c = *s;
switch (c)
{
case '\a':
fputs ("\\a", state_file);
break;
case '\b':
fputs ("\\b", state_file);
break;
case '\t':
fputs ("\\t", state_file);
break;
case '\n':
fputs (... | false | false | false | false | false | 0 |
UVException(int errorno,
const char *syscall,
const char *msg,
const char *path) {
if (syscall_symbol.IsEmpty()) {
syscall_symbol = NODE_PSYMBOL("syscall");
errno_symbol = NODE_PSYMBOL("errno");
errpath_symbol = NODE_PSYMBOL("path"... | false | false | false | false | false | 0 |
bfa_nw_ioc_mbox_isr(struct bfa_ioc *ioc)
{
struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod;
struct bfi_mbmsg m;
int mc;
if (bfa_ioc_msgget(ioc, &m)) {
/**
* Treat IOC message class as special.
*/
mc = m.mh.msg_class;
if (mc == BFI_MC_IOC) {
bfa_ioc_isr(ioc, &m);
return;
}
if ((mc >= BFI_MC_... | false | false | false | false | false | 0 |
cgit_clone_objects(struct cgit_context *ctx)
{
if (!ctx->qry.path) {
html_status(400, "Bad request", 0);
return;
}
if (!strcmp(ctx->qry.path, "info/packs")) {
print_pack_info(ctx);
return;
}
send_file(ctx, git_path("objects/%s", ctx->qry.path));
} | false | false | false | false | false | 0 |
waitforack(struct lam_ssi_rpi_proc *ps, int from, int tag, MPI_Comm comm,
int *len)
{
struct lam_ssi_rpi_envl env;
struct lam_ssi_rpi_envl *inenv;
int err;
/*
* If currently busy doing a buffered receive on the socket complete it.
*/
if (ps->cp_readfn == tcp_proc_read_buffer) {
if ((err = ps->... | false | false | false | false | false | 0 |
Show(bool show)
{
if (show && !IsShown())
readConfigSettings();
return wxFrame::Show(show);
} | false | false | false | false | false | 0 |
empty()
{
if( papoGeoms != NULL )
{
for( int i = 0; i < nGeomCount; i++ )
{
delete papoGeoms[i];
}
OGRFree( papoGeoms );
}
nGeomCount = 0;
papoGeoms = NULL;
nCoordDimension = 2;
} | false | false | false | false | false | 0 |
nfsd4_decode_create_session(struct nfsd4_compoundargs *argp,
struct nfsd4_create_session *sess)
{
DECODE_HEAD;
u32 dummy;
READ_BUF(16);
COPYMEM(&sess->clientid, 8);
sess->seqid = be32_to_cpup(p++);
sess->flags = be32_to_cpup(p++);
/* Fore channel attrs */
READ_BUF(28);
dummy = be32_to_cpup(p++); /* he... | false | false | false | false | false | 0 |
set_to_value()
{
// If we're already set to a value, this is a no-op.
if (pd_null) {
pd_null = 0;
setNumComponents(pd_componentTCs.length());
pd_curr_index = 0;
DynAnyConstrBase::set_to_initial_value();
}
} | false | false | false | false | false | 0 |
Java_org_gdal_gdal_gdalJNI_ReadDirRecursive(JNIEnv *jenv, jclass jcls, jstring jarg1) {
jobject jresult = 0 ;
char *arg1 = (char *) 0 ;
char **result = 0 ;
(void)jenv;
(void)jcls;
arg1 = 0;
if (jarg1) {
arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
if (!arg1) return 0;
}
result = (char ... | false | false | false | false | false | 0 |
maildir_fetch_msg( store_t *gctx, message_t *gmsg, msg_data_t *data,
int (*cb)( int sts, void *aux ), void *aux )
{
maildir_store_t *ctx = (maildir_store_t *)gctx;
maildir_message_t *msg = (maildir_message_t *)gmsg;
int fd, ret;
struct stat st;
char buf[_POSIX_PATH_MAX];
for (;;) {
nfsnprint... | false | false | false | false | false | 0 |
exactSeed( const std::string& letters ){
std::string result;
for( unsigned i = 0; i < letters.size(); ++i ){
if( i > 0 ) result += ' ';
result += letters[i];
}
return result;
} | false | false | false | false | false | 0 |
RemoveTypeById(Oid typeOid)
{
Relation relation;
HeapTuple tup;
relation = heap_open(TypeRelationId, RowExclusiveLock);
tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typeOid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", typeOid);
simple_heap_delete(relation, &tup->t_self);
... | false | false | false | true | false | 1 |
mycalloc(size_t nelem, size_t elsize)
{
void *p;
if ( (p = calloc(nelem,elsize)) == NULL) {
#if defined(_WIN32) && !defined(__CYGWIN32__)
jlog("Error: mymalloc: failed to clear-allocate %Iu bytes\n", nelem*elsize);
#else
jlog("Error: mymalloc: failed to clear-allocate %zu bytes\n", nelem*elsize);
#endif
... | false | false | false | false | false | 0 |
hhash_unsorted_seek_valid(hhash_t *tbl, uint32_t idx)
{
while (idx < tbl->size) {
if (tbl->item[idx].d != NULL) {
break;
}
++idx;
}
return idx;
} | false | false | false | false | false | 0 |
_ipmi_pet_init (ipmi_pet_state_data_t *state_data)
{
struct ipmi_pet_arguments *args;
int rv = -1;
assert (state_data);
args = state_data->prog_data->args;
if (!args->sdr.ignore_sdr_cache)
{
struct sensor_entity_id_counts *entity_ptr = NULL;
if (sdr_cache_create_and_load (state_data... | false | false | false | false | false | 0 |
bacon_video_widget_set_zoom (BaconVideoWidget *bvw,
BvwZoomMode mode)
{
g_return_if_fail (BACON_IS_VIDEO_WIDGET (bvw));
if (bvw->priv->frame == NULL)
return;
totem_aspect_frame_set_expand (TOTEM_ASPECT_FRAME (bvw->priv->frame),
(mode == BVW_ZOOM_EXPAND));
} | false | false | false | false | false | 0 |
ena_com_wait_for_abort_completion(struct ena_com_dev *ena_dev)
{
struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue;
unsigned long flags;
spin_lock_irqsave(&admin_queue->q_lock, flags);
while (atomic_read(&admin_queue->outstanding_cmds) != 0) {
spin_unlock_irqrestore(&admin_queue->q_lock, flags);
... | false | false | false | false | false | 0 |
drag_begin
(
GtkWidget *widget, // The view window.
GdkDragContext *context,
gpointer data // ->Chunk_chooser.
)
{
cout << "In DRAG_BEGIN" << endl;
Chunk_chooser *chooser = (Chunk_chooser *) data;
if (chooser->selected < 0)
return FALSE; // ++++Display a halt bitmap.
#if 0
// Get ->chunk.
Chunk_inf... | false | false | false | false | false | 0 |
stars_draw_background()
{
if (Nmodel_num < 0)
return;
if (Nmodel_bitmap >= 0) {
model_set_forced_texture(Nmodel_bitmap);
Nmodel_flags |= MR_FORCE_TEXTURE;
}
// draw the model at the player's eye with no z-buffering
model_set_alpha(1.0f);
model_render(Nmodel_num, &Nmodel_orient, &Eye_position, Nmodel_fla... | false | false | false | false | false | 0 |
writeNorm16(UChar32 start, UChar32 end, uint32_t value) {
if(value!=0) {
const Norm *p=norms+value;
int32_t offset=p->offset>>Norm::OFFSET_SHIFT;
int32_t norm16=0;
UBool isDecompNo=FALSE;
UBool isCompNoMaybe=FALSE;
switch(p->offset&Norm::OFFSET_MASK) {
case No... | false | false | false | false | false | 0 |
inf_gtk_browser_model_filter_browser_iter_to_tree_iter(InfGtkBrowserModel* m,
InfcBrowser* browser,
InfcBrowserIter* iter,
GtkTreeIter* tree_iter)
{
GtkT... | false | false | false | false | false | 0 |
gwy_app_recent_file_list_open(GtkWidget *list)
{
GtkTreeSelection *selection;
GtkTreeModel *store;
GtkTreeIter iter;
GwyRecentFile *rf;
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
if (!gtk_tree_selection_get_selected(selection, &store, &iter))
return;
gtk_tree_mode... | false | false | false | false | false | 0 |
StoreCnfNodeByNodeRecur (
DdManager *ddMgr /* IN: DD Manager */,
DdNode *f /* IN: BDD node to be stored */,
int *bddIds /* IN: BDD ids for variables */,
int *cnfIds /* IN: CNF ids for variables */,
FILE *fp /* IN: store file */,
int *clauseN /* OUT: number of clauses ... | false | false | false | false | false | 0 |
write_spi(struct fbtft_par *par, void *buf, size_t len)
{
struct spi_transfer t = {
.tx_buf = buf,
.len = len,
.speed_hz = 1000000,
};
struct spi_message m;
fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
"%s(len=%d): ", __func__, len);
if (!par->spi) {
dev_err(par->info->device,
... | false | false | false | false | false | 0 |
lame_init_bitstream(lame_global_flags * gfp)
{
lame_internal_flags *const gfc = gfp->internal_flags;
gfp->frameNum = 0;
if (gfp->write_id3tag_automatic) {
(void) id3tag_write_v2(gfp);
}
/* initialize histogram data optionally used by frontend */
memset(gfc->bitrate_stereoMode_Hist, 0, s... | false | false | false | false | false | 0 |
scsi_target_block(struct device *dev)
{
if (scsi_is_target_device(dev))
starget_for_each_device(to_scsi_target(dev), NULL,
device_block);
else
device_for_each_child(dev, NULL, target_block);
} | false | false | false | false | false | 0 |
TIFFSetClientInfo( TIFF *tif, void *data, const char *name )
{
TIFFClientInfoLink *link = tif->tif_clientinfo;
/*
** Do we have an existing link with this name? If so, just
** set it.
*/
while( link != NULL && strcmp(link->name,name) != 0 )
link = link->next;
if( link != NULL )
... | false | false | false | false | false | 0 |
ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
u8 *cmd_buf, u32 cmd_len,
u8 *rsp_buf, u32 rsp_len,
u32 timeout)
{
struct ath_hw *ah = wmi->drv_priv->ah;
struct ath_common *common = ath9k_hw_common(ah);
u16 headroom = sizeof(struct htc_frame_hdr) +
sizeof(struct wmi_cmd_hdr);
struct sk_b... | false | true | false | false | false | 1 |
xps_parse_resource_reference(xps_document *doc, xps_resource *dict, char *att, char **urip)
{
char name[1024];
char *s;
if (strstr(att, "{StaticResource ") != att)
return NULL;
fz_strlcpy(name, att + 16, sizeof name);
s = strrchr(name, '}');
if (s)
*s = 0;
return xps_find_resource(doc, dict, name, urip);
... | false | false | false | false | false | 0 |
estimate_similarity(struct diff_filespec *src,
struct diff_filespec *dst,
int minimum_score)
{
/* src points at a file that existed in the original tree (or
* optionally a file in the destination tree) and dst points
* at a newly created file. They may be quite similar, in which
* case we wa... | false | false | false | false | false | 0 |
mc_cal_afs(bcf_p1aux_t *ma)
{
int k;
long double sum = 0.;
memset(ma->afs1, 0, sizeof(double) * (ma->M + 1));
mc_cal_y(ma);
for (k = 0, sum = 0.; k <= ma->M; ++k)
sum += (long double)ma->phi[k] * ma->z[k];
for (k = 0; k <= ma->M; ++k) {
ma->afs1[k] = ma->phi[k] * ma->z[k] / sum;
if (isnan(ma->afs1[k]) || is... | false | false | false | false | false | 0 |
lra_free_copies (void)
{
lra_copy_t cp;
while (copy_vec.length () != 0)
{
cp = copy_vec.pop ();
lra_reg_info[cp->regno1].copies = lra_reg_info[cp->regno2].copies = NULL;
pool_free (copy_pool, cp);
}
} | false | false | false | false | false | 0 |
already_in_confid (key)
Af_key *key;
{
char *name;
register struct linked_list *clist;
name = atRetAttr (key, AF_ATTBOUND);
if (confid_list == (struct linked_list *) NIL) {
if ((confid_list = (struct linked_list *)
malloc (sizeof(struct linked_list))) == (struct linked_list *)NIL)
errexit (10,... | false | false | false | false | false | 0 |
index_open(Oid relationId, LOCKMODE lockmode)
{
Relation r;
r = relation_open(relationId, lockmode);
if (r->rd_rel->relkind != RELKIND_INDEX)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is not an index",
RelationGetRelationName(r))));
return r;
} | false | false | false | false | false | 0 |
delete_inner_hmdf_table_for_blocks(Block *head)
{
Block *bpt;
for (bpt = head; bpt != NULL; bpt = bpt->next) {
if (bpt->hmdf != NULL
&& is_inner_of_acc_block(bpt)) {
#ifdef DEBUG_HETERO_HMDF
fprintf(stderr,
"HMDF Table is deleted.(Module:%s Block:%d MTG_ID:%d... | false | false | false | false | false | 0 |
update_mode(char *pkgspec)
{
encap_list_t *installed_l, *update_l;
encap_listptr_t lp;
char name[MAXPATHLEN], ver[MAXPATHLEN] = "";
int i;
#ifdef DEBUG
printf("==> update_mode(\"%s\")\n", pkgspec);
#endif
if (pkgspec == NULL)
return update_all();
if (verbose)
printf("epkg: updating package %s...\n", pkgsp... | true | true | false | false | false | 1 |
UpdateControlValueFromBPF(TData pos)
{
if(mConfig.HasBPFAmount())
{
TControlData amount = mConfig.GetBPFAmount().GetValue(pos);
mAmountCtrl.DoControl(amount);
return true;
}
else return false;
} | false | false | false | false | false | 0 |
ausb11_extend(ausb_dev_handle *ah){
int rv;
libusb_device *dev;
ausb11_extra *xh;
xh=malloc(sizeof *xh);
if (xh==0) {
DEBUGP(ah, "memory full\n");
return -1;
}
memset(xh, 0, sizeof(*xh));
/* get libusb representation of the given device */
dev=ausb_libusb1_get_usbdev(&(ah->device));
if (de... | false | false | false | false | false | 0 |
getModImmOpValue(const MCInst &MI, unsigned Op,
SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &ST) const {
const MCOperand &MO = MI.getOperand(Op);
// Support for fixups (MCFixup)
if (MO.isExpr()) {
const MCExpr *Expr = MO.getExpr();
... | false | false | false | false | false | 0 |
i_memory_used(MemBlock *m)
{
int words=0;
int i;
int maximum;
while(m) {
i = m->base << I_MEM_BITS;
maximum = i + MAX_I_MEM;
while (i < maximum) {
if ((i_memory_get(m, i) & MEM_USED_MASK)) {
words++;
}
i++;
}
m = m->next;
}
return words;
} | false | false | false | false | false | 0 |
configure(Vector<String> &conf, ErrorHandler *errh)
{
_force = false;
return Args(conf, this, errh).read_p("FORCE", _force).complete();
} | false | false | false | false | false | 0 |
find_extensions_min5c3(int nbtot, int nbop, EDGE **on4, int non4,
EDGE **on3, int non3, EDGE **ext5_sw, int *next5_sw)
/* List the inequivalent extensions for the 3-connected phase on mindeg 5.
If on4!=NULL, it is a list of all edges on nf4-cycles (min form).
If on3!=NULL, on3[0..non3-1] ... | false | false | false | false | false | 0 |
db_lru_cleanup(int bytes_to_remove){
while (bytes_to_remove > 0 && db.lru_head != NULL){
cache_entry* l = db.lru_head;
//Skip if currently deleting
assert(!l->deleted);
bytes_to_remove -= l->data_length;
if (l->refs == 0){
db_entry_incref(l);
db_entry_handle_delete(l);
db_entry_deref(l);
}
el... | false | false | false | false | false | 0 |
lwgeom_serialize_buf(LWGEOM *lwgeom, uchar *buf, size_t *retsize)
{
int type = TYPE_GETTYPE(lwgeom->type);
LWDEBUGF(2, "lwgeom_serialize_buf called with a %s",
lwgeom_typename(type));
switch (type)
{
case POINTTYPE:
lwpoint_serialize_buf((LWPOINT *)lwgeom, buf, retsize);
break;
case LINETYPE:
lwli... | false | false | false | false | false | 0 |
ajDomainNew(ajuint n, AjEDomainType type)
{
AjPDomain domain = NULL;
if((type != ajEDomainTypeSCOP) && (type != ajEDomainTypeCATH))
{
ajWarn("Bad args passed to ajDomainNew");
return NULL;
}
AJNEW0(domain);
if(type == ajEDomainTypeSCOP)
{
domain->Scop = ajScopNew(n... | false | false | false | false | false | 0 |
fig_resolve_color(GVJ_t *job, gvcolor_t * color)
{
int object_code = 0; /* always 0 for color */
int i, new;
switch (color->type) {
case COLOR_STRING:
for (i = 0; figcolor[i]; i++) {
if (streq(figcolor[i], color->u.string)) {
color->u.index = i;
break;
}
}
break;
cas... | false | false | false | false | false | 0 |
get_cpu_nr(unsigned int max_nr_cpus, int highest)
{
int cpu_nr;
if ((cpu_nr = get_sys_cpu_nr(highest)) == 0) {
/* /sys may be not mounted. Use /proc/stat instead */
cpu_nr = get_proc_cpu_nr();
}
if (cpu_nr > max_nr_cpus) {
fprintf(stderr, _("Cannot handle so many processors!\n"));
exit(1);
}
return cpu... | false | false | false | false | false | 0 |
VLOG2Initializer() {
vmodule_lock.AssertHeld();
// Can now parse --vmodule flag and initialize mapping of module-specific
// logging levels.
inited_vmodule = false;
const char* vmodule = FLAGS_vmodule.c_str();
const char* sep;
VModuleInfo* head = NULL;
VModuleInfo* tail = NULL;
while ((sep = strchr(vm... | false | false | false | false | false | 0 |
png_set_sCAL(png_structp png_ptr, png_infop info_ptr,
int unit, double width, double height)
{
png_debug1(1, "in %s storage function", "sCAL");
if (png_ptr == NULL || info_ptr == NULL)
return;
info_ptr->scal_unit = (png_byte)unit;
info_ptr->scal_pixel_width = width;
info_ptr-... | false | false | false | false | false | 0 |
FindAction(State *state, wchar_t ch) {
for (Action *a = state->firstAction; a != NULL; a = a->next)
if (a->typ == Node::chr && ch == a->sym) return a;
else if (a->typ == Node::clas) {
CharSet *s = tab->CharClassSet(a->sym);
if (s->Get(ch)) return a;
}
return NULL;
} | false | false | false | false | false | 0 |
check_and_replace_src (GstWrapperCameraBinSrc * self)
{
GstBin *cbin = GST_BIN_CAST (self);
GstBaseCameraSrc *bcamsrc = GST_BASE_CAMERA_SRC_CAST (self);
if (self->src_vid_src && self->src_vid_src == self->app_vid_src) {
GST_DEBUG_OBJECT (self, "No need to change current videosrc");
return TRUE;
}
if... | false | false | false | false | false | 0 |
imageinfo_lua_recmaps_as_table(lua_State *L)
{
GtImageInfo **ii;
unsigned long num, i;
ii = check_imageinfo(L, 1);
gt_assert(ii);
num = gt_image_info_num_of_rec_maps(*ii);
if (num>0)
{
lua_newtable(L);
for (i=0;i<num;i++)
{
lua_pushnumber(L, i+1);
push_recmap_as_table(L, gt_image_i... | false | false | false | false | false | 0 |
dfsnonspecialwidth(const GtArrayBoundswithchar *bwci)
{
unsigned long idx, addwidth = 0;
for (idx = 0; idx < bwci->nextfreeBoundswithchar; idx++)
{
addwidth += bwci->spaceBoundswithchar[idx].rbound -
bwci->spaceBoundswithchar[idx].lbound;
}
return addwidth;
} | false | false | false | false | false | 0 |
M_Write_Material(FEMObjectMaterial *Material)
{
if(std::string(Material->m_MaterialName) == "MaterialLinearElasticity")
{
*this->m_WriteStream << '<' << "MaterialLinearElasticity" << ">\n";
*this->m_WriteStream << "\t" << Material->m_GN << "\t% Global object number\n";
*this->m_WriteStream << "\tE : ... | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
ESL_GETOPTS *go = NULL; /* command line processing */
ESL_STOPWATCH *w = esl_stopwatch_Create();
struct cfg_s cfg;
/* Set processor specific flags */
impl_Init();
cfg.alifile = NULL;
cfg.hmmfile = NULL;
/* Parse the command line
*/
... | false | false | false | false | false | 0 |
stats_oper(struct Client *source_p)
{
struct oper_conf *oper_p;
rb_dlink_node *ptr;
if(!IsOper(source_p) && ConfigFileEntry.stats_o_oper_only)
{
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, "%s", form_str(ERR_NOPRIVILEGES));
return;
}
RB_DLINK_FOREACH(ptr, oper_conf_list.head)
{
oper_p = ptr->data;
... | false | false | false | false | false | 0 |
toXml( QXmlStreamWriter *writer ) const
{
for( int i = 0; i < m_biases.count(); i++ )
{
writer->writeStartElement( m_biases[i]->name() );
writer->writeAttribute( "weight", QString::number(m_weights[i]) );
m_biases[i]->toXml( writer );
writer->writeEndElement();
}
} | false | false | false | false | false | 0 |
on_MenuPopup_activate_layout()
{
finish_editing();
signal_user_requested_layout().emit();
} | false | false | false | false | false | 0 |
on_tree_selection_changed(GtkTreeSelection *selection, gpointer data)
{
gboolean have_sel = (gtk_tree_selection_count_selected_rows(selection) > 0);
gboolean multi_sel = (gtk_tree_selection_count_selected_rows(selection) > 1);
if (popup_items.open != NULL)
gtk_widget_set_sensitive(popup_items.open, have_sel);
if... | false | false | false | false | false | 0 |
isp116x_suspend(struct platform_device *dev, pm_message_t state)
{
VDBG("%s: state %x\n", __func__, state.event);
return 0;
} | 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.