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 |
|---|---|---|---|---|---|---|
gf_volume_name_validate (const char *volume_name)
{
const char *vname = NULL;
if (volume_name == NULL) {
gf_log_callingfn (THIS->name, GF_LOG_WARNING, "argument invalid");
return -1;
}
if (!isalpha (volume_name[0]))
return 1;
for... | false | false | false | false | false | 0 |
of_msi_get_domain(struct device *dev,
struct device_node *np,
enum irq_domain_bus_token token)
{
struct device_node *msi_np;
struct irq_domain *d;
/* Check for a single msi-parent property */
msi_np = of_parse_phandle(np, "msi-parent", 0);
if (msi_np && !of_property_read_bool(msi_np, "#msi-cells... | false | false | false | false | false | 0 |
HandleSetSystemAudioMode(const cec_command &command)
{
if (command.parameters.size == 1)
{
CCECAudioSystem *device = CCECBusDevice::AsAudioSystem(GetDevice(command.initiator));
if (device)
{
device->SetSystemAudioModeStatus((cec_system_audio_status)command.parameters[0]);
return COMMAND_HAND... | false | false | false | false | false | 0 |
parse_tag_line(lbuf,
#ifdef FEAT_EMACS_TAGS
is_etag,
#endif
tagp)
char_u *lbuf; /* line to be parsed */
#ifdef FEAT_EMACS_TAGS
int is_etag;
#endif
tagptrs_T *tagp;
{
char_u *p;
#ifdef FEAT_EMACS_TAGS
char_u *p_7f;
if (is_etag)
{
/*
* There are two formats for an emacs t... | false | false | false | false | false | 0 |
dohide()
{
boolean ismimic = youmonst.data->mlet == S_MIMIC;
if (u.uundetected || (ismimic && youmonst.m_ap_type != M_AP_NOTHING)) {
You("are already hiding.");
return(0);
}
if (ismimic) {
/* should bring up a dialog "what would you like to imitate?" */
youmonst.m_ap_type = M_AP_OBJECT;
youmonst.mappeara... | false | false | false | false | false | 0 |
DisplayNumString(file, i)
FILE *file;
uzoff_t i;
{
char tempstrg[100];
int j;
char *s = tempstrg;
WriteNumString(i, tempstrg);
/* skip spaces */
for (j = 0; j < 3; j++) {
if (*s != ' ') break;
s++;
}
fprintf(file, "%s", s);
return 0;
} | false | false | false | false | false | 0 |
fs_emu_stat_queue_add_entry(fs_emu_stat_queue* stat_queue, int data,
int threshold) {
if (stat_queue->queue == NULL) {
fs_log("fs_emu_stat_queue_add_entry: queue is null");
return;
}
if (stat_queue->clear) {
for (int i = 0; i < stat_queue->max_count; i++) {
fs_... | false | false | false | false | false | 0 |
getModRefBehavior(const Function *F) {
FunctionModRefBehavior Min = FMRB_UnknownModRefBehavior;
if (FunctionInfo *FI = getFunctionInfo(F)) {
if (FI->getModRefInfo() == MRI_NoModRef)
Min = FMRB_DoesNotAccessMemory;
else if ((FI->getModRefInfo() & MRI_Mod) == 0)
Min = FMRB_OnlyReadsMemory;
}
... | false | false | false | false | false | 0 |
btreeSecLeftLeaf(AjPBtcache cache, AjPBtKeywild wild)
{
AjPBtpage root = NULL;
AjPBtpage page = NULL;
ajulong right = 0UL;
ajuint nodetype = 0U;
ajuint nkeys = 0U;
ajuint keylimit = 0U;
ajuint i;
AjPBtMem arrays = NULL;
ajulong *parray = NULL;
unsigned char *buf;
... | false | false | false | false | false | 0 |
op_intercept(void *invec, void *outvec, int *len, MPI_Datatype *datatype)
{
_REAL_MPI_::Op* op = _REAL_MPI_::Intracomm::current_op;
MPI::Datatype thedata = *datatype;
((MPI::User_function*)op->op_user_function)(invec, outvec, *len, thedata);
//JGS the above cast is a bit of a hack, I'll explain:
// the type ... | false | false | false | false | false | 0 |
cli_seek (cli_infos_t *infos, command_context_t *ctx)
{
xmmsc_result_t *res;
command_arg_time_t t;
if (command_arg_time_get (ctx, 0, &t)) {
if (t.type == COMMAND_ARG_TIME_OFFSET) {
res = xmmsc_playback_seek_ms (infos->sync, t.value.offset * 1000, XMMS_PLAYBACK_SEEK_CUR);
} else {
res = xmmsc_playback_seek... | false | false | false | false | false | 0 |
fan_write_cmd_speed(const char *cmd, int *rc)
{
int speed;
/* TODO:
* Support speed <low> <medium> <high> ? */
if (sscanf(cmd, "speed %d", &speed) != 1)
return 0;
*rc = fan_set_speed(speed);
if (*rc == -ENXIO)
pr_err("speed command accepted for unsupported access mode %d\n",
fan_control_access_mo... | false | false | false | false | false | 0 |
G_zero_cell_buf(CELL * buf)
{
int i = G_window_cols();
while (i--)
*buf++ = 0;
return 0;
} | false | false | false | false | false | 0 |
iscsi_iser_get_ep_param(struct iscsi_endpoint *ep,
enum iscsi_param param, char *buf)
{
struct iser_conn *iser_conn = ep->dd_data;
int len;
switch (param) {
case ISCSI_PARAM_CONN_PORT:
case ISCSI_PARAM_CONN_ADDRESS:
if (!iser_conn || !iser_conn->ib_conn.cma_id)
return -ENOTCONN;
return iscsi_conn_g... | false | false | false | false | false | 0 |
games_scores_backend_new (GamesScoreStyle style,
char *base_name,
char *name)
{
GamesScoresBackend *backend;
gchar *fullname;
backend = GAMES_SCORES_BACKEND (g_object_new (GAMES_TYPE_SCORES_BACKEND,
NULL));
if (name[0] == '\0') /* Name is "" */
fullname = g_strjoin ("... | false | false | false | false | false | 0 |
signal_state_up(struct dchannel *dch, int info, char *msg)
{
struct sk_buff *skb;
int id, data = info;
if (debug & DEBUG_HFCMULTI_STATE)
printk(KERN_DEBUG "%s: %s\n", __func__, msg);
id = TEI_SAPI | (GROUP_TEI << 8); /* manager address */
skb = _alloc_mISDN_skb(MPH_INFORMATION_IND, id, sizeof(data), &data,
... | false | false | false | false | false | 0 |
mock_module_enumerate_objects (CK_SESSION_HANDLE handle,
MockEnumerator func,
gpointer user_data)
{
GHashTableIter iter;
gpointer key;
gpointer value;
Session *session;
gboolean private;
g_assert (the_objects);
g_assert (func);
/* Token obj... | false | false | false | false | false | 0 |
process(const LEReferenceTo<SingleSubstitutionFormat2Subtable> &base, GlyphIterator *glyphIterator, LEErrorCode &success, const LEGlyphFilter *filter) const
{
LEGlyphID glyph = glyphIterator->getCurrGlyphID();
le_int32 coverageIndex = getGlyphCoverage(base, glyph, success);
if (coverageIndex >= 0) {
... | false | false | false | false | false | 0 |
getUImm6Lsl2Encoding(const MCInst &MI, unsigned OpNo,
SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &STI) const {
const MCOperand &MO = MI.getOperand(OpNo);
if (MO.isImm()) {
unsigned Value = MO.getImm();
return Value >> 2;
}
return 0;
} | false | false | false | false | false | 0 |
test_find_suffix()
{
int at = SuffixArray_find_suffix(sarry, test2, sizeof(test2));
mu_assert(at != -1, "Failed to find the suffix.");
at = SuffixArray_find_suffix(sarry, "yo", sizeof("yo"));
mu_assert(at == -1, "Should fail to find yo.");
return NULL;
} | false | false | false | false | false | 0 |
gst_encoding_target_finalize (GstEncodingTarget * target)
{
GST_DEBUG ("Finalizing");
if (target->name)
g_free (target->name);
if (target->category)
g_free (target->category);
if (target->description)
g_free (target->description);
g_list_foreach (target->profiles, (GFunc) gst_mini_object_unref, ... | false | false | false | false | false | 0 |
activate(bool canWarp) {
manager->lockFocus();
if (fWinState & (WinStateHidden | WinStateMinimized))
setState(WinStateHidden | WinStateMinimized, 0);
if (!visibleOn(manager->activeWorkspace()))
manager->activateWorkspace(getWorkspace());
manager->unlockFocus();
focus(canWarp);
} | false | false | false | false | false | 0 |
beoboot_probe(const char *buf, off_t len)
{
struct beoboot_header bb_header;
const char *cmdline, *kernel;
int result;
if ((uintmax_t)len < (uintmax_t)sizeof(bb_header)) {
return -1;
}
memcpy(&bb_header, buf, sizeof(bb_header));
if (memcmp(bb_header.magic, BEOBOOT_MAGIC, 4) != 0) {
return -1;
}
if (bb_head... | false | true | false | false | false | 1 |
console_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev);
struct solos_card *card = atmdev->dev_data;
struct sk_buff *skb;
unsigned int len;
spin_lock(&card->cli_queue_lock);
skb = skb_dequeue(&card->cli_queue[SOLOS_... | false | true | false | false | false | 1 |
selectionChanged( const QModelIndex &idx)
{
QString type = tm_->data(idx.sibling(idx.row(), 1), Qt::DisplayRole).toString();
QString comment = tm_->data(idx.sibling(idx.row(), 3), Qt::DisplayRole).toString();
lb_path->setText("<b>"+Qt::escape(tm_->indexToOptionName(idx))+"</b>");
lb_comment->setText(comment);
upda... | false | false | false | false | false | 0 |
parse_element(xmlNodePtr node, simple_binary_t **slbxml)
{
Octstr *name,
*nameos;
unsigned char status_bits,
sl_hex;
int add_end_tag;
xmlAttrPtr attribute;
name = octstr_create((char *)node->name);
if (octstr_len(name) == 0) {
octstr_destroy(name);
return... | false | false | false | false | false | 0 |
bus_client_policy_append_rule (BusClientPolicy *policy,
BusPolicyRule *rule)
{
_dbus_verbose ("Appending rule %p with type %d to policy %p\n",
rule, rule->type, policy);
if (!_dbus_list_append (&policy->rules, rule))
return FALSE;
bus_policy_rule_ref (rule... | false | false | false | false | false | 0 |
scramble(const nstring &str)
{
//
// The 'A' prefix that indicates which version of scrambling this is
// (the first, obviously, since we only do one kind of scrambling so
// far).
//
nstring_accumulator buffer;
buffer.push_back('A');
for (size_t j = 0; j < str.size(); j++)
buffer.push_... | false | false | false | false | false | 0 |
panel_ditem_editor_set_uri (PanelDItemEditor *dialog,
const char *uri)
{
g_return_if_fail (PANEL_IS_DITEM_EDITOR (dialog));
if (!dialog->priv->uri && (!uri || !uri [0]))
return;
if (dialog->priv->uri && uri && uri [0] &&
!strcmp (dialog->priv->uri, uri))
return;
if (dialog->priv->uri)
g_f... | false | false | false | false | false | 0 |
is_gsharedvt_type (MonoType *t)
{
return (t->type == MONO_TYPE_VAR || t->type == MONO_TYPE_MVAR) && t->data.generic_param->serial == 1;
} | false | false | false | false | false | 0 |
EmitKey()
{
if(!good())
return;
EMITTER_STATE curState = m_pState->GetCurState();
FLOW_TYPE flowType = m_pState->GetCurGroupFlowType();
if(curState != ES_WAITING_FOR_BLOCK_MAP_ENTRY && curState != ES_DONE_WITH_BLOCK_MAP_VALUE
&& curState != ES_WAITING_FOR_FLOW_MAP_ENTRY && curState != ES_DONE_WITH_F... | false | false | false | false | false | 0 |
UT_go_guess_encoding (const char *raw, size_t len, const char *user_guess,
char **utf8_str)
{
int try_nb;
gboolean debug = FALSE;
g_return_val_if_fail (raw != NULL, NULL);
for (try_nb = 1; 1; try_nb++) {
const char *guess;
GError *error = NULL;
char *utf8_data;
switch (try_nb) {
case 1: guess =... | false | false | false | false | true | 1 |
stripfromend(char *s)
{
char *p;
int done = 0;
p = s + strlen(s);
while(p != s && !done)
{
if(!isalnum((int)*p))
*p = 0;
else
done = 1;
p--;
}
} | false | false | false | false | false | 0 |
refill_work(struct work_struct *work)
{
struct virtnet_info *vi =
container_of(work, struct virtnet_info, refill.work);
bool still_empty;
int i;
for (i = 0; i < vi->curr_queue_pairs; i++) {
struct receive_queue *rq = &vi->rq[i];
napi_disable(&rq->napi);
still_empty = !try_fill_recv(vi, rq, GFP_KERNEL);
... | false | false | false | false | false | 0 |
xtensa_interfaceOperand_interface (xtensa_isa isa, xtensa_opcode opc,
int ifOp)
{
xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
xtensa_iclass_internal *iclass;
int iclass_id;
CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
iclass_id = intisa->opcodes[opc].iclass_id;
iclass = &intisa->icla... | false | true | false | false | false | 1 |
init_pwm(struct lm8323_chip *lm, int id, struct device *dev,
const char *name)
{
struct lm8323_pwm *pwm;
BUG_ON(id > 3);
pwm = &lm->pwm[id - 1];
pwm->id = id;
pwm->fade_time = 0;
pwm->brightness = 0;
pwm->desired_brightness = 0;
pwm->running = false;
pwm->enabled = false;
INIT_WORK(&pwm->work, lm8323... | false | false | false | false | false | 0 |
get_one_option(int optid, const struct my_option *opt,
char *argument)
{
my_bool add_option= TRUE;
switch (optid) {
case '?':
printf("%s Ver %s Distrib %s, for %s (%s)\n",
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE(... | false | false | false | false | false | 0 |
parse_schedTable( const char *token, char *line )
{
char owner[SCHED_STR1_LEN+1];
char name[ SCHED_STR1_LEN+1];
char time_bits[22]; /* schedWeekDay..schedMinute */
void *vp;
size_t len;
netsnmp_tdata_row *row;
struct schedTable_entry *entry;
DEBUGMSGTL(("disman:schedule:co... | true | true | false | false | false | 1 |
putFileContentsIntoElement(DcmElement *elem, const char *filename)
{
OFCondition ec = EC_Normal;
#ifdef EXPERIMENTAL_READ_FROM_FILE
/* create stream object for binary file */
DcmInputFileStream fileStream(filename);
ec = fileStream.status();
if (ec.good())
{
/* NB: if size is odd file wi... | false | false | false | false | false | 0 |
gdata_oauth2_authorizer_constructed (GObject *object)
{
EGDataOAuth2AuthorizerPrivate *priv;
GType service_type;
GList *domains;
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (e_gdata_oauth2_authorizer_parent_class)->
constructed (object);
priv = E_GDATA_OAUTH2_AUTHORIZER_GET_PRIVATE (object... | false | false | false | false | false | 0 |
error_bio_list(struct bio_list *bios, int error)
{
struct bio *bio;
while ((bio = bio_list_pop(bios))) {
bio->bi_error = error;
bio_endio(bio);
}
} | false | false | false | false | false | 0 |
e1000_io_slot_reset(struct pci_dev *pdev)
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
u16 aspm_disable_flag = 0;
int err;
pci_ers_result_t result;
if (adapter->flags2 & FLAG2_DISABLE_ASPM_L0S)
aspm_disable_flag =... | false | false | false | false | false | 0 |
initPanelizerOutput(const QString & panelFilename, const QString & msg) {
PanelizerFileNames.clear();
QFileInfo info(panelFilename);
PanelizerOutputPath = info.absoluteDir().absoluteFilePath("panelizer_output.txt");
QDateTime dt = QDateTime::currentDateTime();
writePanelizerOutput(QString("\n------... | false | false | false | false | false | 0 |
checkPrimitiveCount(u32 prmCount) const
{
const u32 m = getMaximalPrimitiveCount();
if (prmCount > m)
{
char tmp[1024];
sprintf(tmp,"Could not draw triangles, too many primitives(%u), maxium is %u.", prmCount, m);
os::Printer::log(tmp, ELL_ERROR);
return false;
}
return true;
} | false | false | false | false | false | 0 |
finish_translation_unit (void)
{
/* In case there were missing closebraces,
get us back to the global binding level. */
pop_everything ();
while (current_namespace != global_namespace)
pop_namespace ();
/* Do file scope __FUNCTION__ et al. */
finish_fname_decls ();
} | false | false | false | false | false | 0 |
__vfat_striptail_len(unsigned int len, const char *name)
{
while (len && name[len - 1] == '.')
len--;
return len;
} | false | false | false | false | false | 0 |
defineMapping(const utf32 codepoint, const String& image_name,
const float horz_advance)
{
const Image& image(d_glyphImages->getImage(image_name));
float adv = (horz_advance == -1.0f) ?
(float)(int)(image.getWidth() + image.getOffsetX()) :
horz_advance;
if (d... | false | false | false | false | false | 0 |
_PyArg_ParseTupleAndKeywords_SizeT(PyObject *args,
PyObject *keywords,
const char *format,
char **kwlist, ...)
{
int retval;
va_list va;
if ((args == NULL || !PyTuple_Check(args)) ||
(keywords != N... | false | false | false | false | false | 0 |
Clear()
{
if (this->Managed)
{
switch (this->Superclass::Type)
{
case LABELLIST:
case SCALARLIST:
case VECTORLIST:
case STRINGLIST:
this->VtkObjectPtr->Delete();
break;
case LABELLISTLIST:
delete this->LabelListListPtr;
break;
case ENTR... | false | false | false | false | false | 0 |
value_point(InstrCt *ct, int p, SplinePoint *sp, real fudge) {
int score = 0;
int EM = ct->gic->sf->ascent + ct->gic->sf->descent;
uint8 touchflag = ct->xdir?tf_x:tf_y;
if (IsCornerExtremum(ct->xdir, ct->contourends, ct->bp, p) ||
IsExtremum(ct->xdir, p, sp))
score+=4;
if (same... | false | false | false | false | false | 0 |
mbe_dumpImbe7100x4400Data (char *imbe_d)
{
int i;
char *imbe;
imbe = imbe_d;
for (i = 0; i < 88; i++)
{
if ((i == 7) || (i == 19) || (i == 31) || (i == 43) || (i == 54) || (i == 65))
{
printf (" ");
}
printf ("%i", *imbe);
imbe++;
}
} | false | false | false | false | false | 0 |
sessionMetaData(const QString &key) const
{
QString value;
KIO::Integration::AccessManager *manager = qobject_cast<KIO::Integration::AccessManager *>(networkAccessManager());
if (manager)
value = manager->sessionMetaData().value(key);
return value;
} | false | false | false | false | false | 0 |
sb_cat_copy(String_buf sb1, String_buf sb2)
{
/* Note that this is inefficient if there are many chunks in either sb. */
int i;
char c;
for (i = 0; (c = sb_char(sb2, i)); i++)
sb_append_char(sb1, c);
} | false | false | false | false | false | 0 |
ref_list_remove_element (RefQueueEntry **prev, RefQueueEntry *element)
{
do {
/* Guard if head is changed concurrently. */
while (*prev != element)
prev = &(*prev)->next;
} while (prev && InterlockedCompareExchangePointer ((void*)prev, element->next, element) != element);
} | false | false | false | false | false | 0 |
read_cx_shading_image(Microtek2_Scanner *ms)
{
SANE_Status status;
Microtek2_Device *md;
uint32_t shading_bytes, linesize, buffer_size;
uint8_t *buf;
int max_lines, lines_to_read, remaining_lines;
md = ms->dev;
shading_bytes = ms->n_control_bytes * 8 * md->shading_length;
if ( ms->curr... | false | false | false | false | false | 0 |
ijmlist_lnk_remove_by_index(jmlist jml,jmlist_index index)
{
jmlist_debug(__func__,"called with jml=%p, index=%u",jml,index);
if( !jml->lnk_list.usage )
{
jmlist_debug(__func__,"trying to remove from empty list");
jmlist_debug(__func__,"returning with failure.");
jmlist_errno = JMLIST_ERROR_EMPTY_LIST;
retu... | false | false | false | false | false | 0 |
hawki_imglist_create_variances_and_delete
(cpl_imagelist * imagelist_raw,
double gain,
double ron,
int ndit,
int ndsamples)
{
cpl_imagelist * variances;
variances = cpl_imagelist_new();
/* Loop on the frames */
while(cpl_imagelist_get_size(imagelist_r... | false | false | false | false | false | 0 |
ungrab_vertex(graph *g,vertex *v){
edge_list *el=v->edges;
activate_vertex(g,v);
while(el){
edge_list *next=el->next;
edge *e=el->edge;
vertex *other=(e->A==v?e->B:e->A);
other->attached_to_grabbed=0;
el=next;
}
v->grabbed=0;
} | false | false | false | false | false | 0 |
evdns_base_free(struct evdns_base *base, int fail_requests)
{
EVDNS_LOCK(base);
evdns_base_free_and_unlock(base, fail_requests);
} | false | false | false | false | false | 0 |
sh_insert (GnmStyleHash *h, GnmStyle *st)
{
GSList *s = g_slist_prepend (NULL, st);
guint32 hv = gnm_style_hash (st);
GSList *l = g_hash_table_lookup (h, GUINT_TO_POINTER (hv));
if (l) {
s->next = l->next;
l->next = s;
} else {
g_hash_table_insert (h, GUINT_TO_POINTER (hv), s);
}
} | false | false | false | false | false | 0 |
getMarginBefore(void) const
{
if (isFirstLineInBlock() && getBlock()->getPrev())
{
fl_ContainerLayout * pPrevC = getBlock()->getPrev();
UT_sint32 iBottomMargin = 0;
bool bLoop = true;
while(bLoop)
{
if(pPrevC->getContainerType() == FL_CONTAINER_BLOCK)
{
bLoop = false;
iBottomMargin = static_ca... | false | false | false | false | false | 0 |
__log_recover(dblp)
DB_LOG *dblp;
{
DBT dbt;
DB_ENV *dbenv;
DB_LOGC *logc;
DB_LSN lsn;
ENV *env;
LOG *lp;
u_int32_t cnt, rectype;
int ret;
logfile_validity status;
env = dblp->env;
dbenv = env->dbenv;
logc = NULL;
lp = dblp->reginfo.primary;
/*
* Find a log file. If none exist, we simply return, lea... | false | false | false | false | false | 0 |
_run_script_and_set_env(const char *name, const char *path, stepd_step_rec_t *job)
{
int status, rc, nread;
pid_t cpid;
int pfd[2], offset = 0;
char buf[4096];
xassert(job->env);
if (path == NULL || path[0] == '\0')
return 0;
debug("[job %u] attempting to run %s [%s]", job->jobid, name, path);
if (access(p... | true | true | false | false | true | 1 |
microtune_mt7202dtf_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv;
u8 cfg, cpump, band_select;
u8 data[4];
u32 div;
struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = data, .len = ... | false | false | false | false | false | 0 |
AR_2_IndicateRelease(PRIVATE_NETWORKKEY ** /*network*/,
PRIVATE_ASSOCIATIONKEY ** association, int nextState, void * /*params*/)
{
unsigned char
buffer[128],
pduType,
pduReserve;
unsigned long
pduLength;
/* Read remaining unimportant bytes of the A-RELEASE-RQ PDU */... | false | false | false | false | false | 0 |
nvkm_fifo_chan_inst(struct nvkm_fifo *fifo, u64 inst, unsigned long *rflags)
{
struct nvkm_fifo_chan *chan;
unsigned long flags;
spin_lock_irqsave(&fifo->lock, flags);
list_for_each_entry(chan, &fifo->chan, head) {
if (chan->inst->addr == inst) {
list_del(&chan->head);
list_add(&chan->head, &fifo->chan);
... | false | false | false | false | false | 0 |
pvl_newlist()
{
struct pvl_list_t *L;
if ( ( L = (struct pvl_list_t*)malloc(sizeof(struct pvl_list_t))) == 0)
{
errno = ENOMEM;
return 0;
}
L->MAGIC = pvl_list_count;
pvl_list_count++;
L->head = 0;
L->tail = 0;
L->count = 0;
L->p = 0;
return L;
} | false | false | false | false | false | 0 |
notify(const Coord& c, const HitInfo& info)
{
if (info.type == HitInfo::HIT &&
!info.shipDestroyed) {
// non-fatal hit, destroy ship now
return new DestroyStrategy(m_player, m_sea, m_state, c);
}
else {
return 0;
}
}
} | false | false | false | false | false | 0 |
setWindowSize(SbVec2s winsizearg)
{
#if COIN_DEBUG
if (winsizearg[0]<0) {
SoDebugError::postWarning("SbViewportRegion::setWindowSize",
"winsize[0] (%d) should be >=0. Clamped to 0.",
winsizearg[0]);
winsizearg[0]=0;
}
if (winsizearg[1]<0) {
S... | false | false | false | false | false | 0 |
create_tables()
{
int i;
//probe_tab
for (i=0; i<256; i++)
MP_probe_tab[i] = FALSE;
const unsigned char *true_chars = (const unsigned char *)"atgucnATGUCN";
for (i = 0; true_chars[i]; ++i) {
MP_probe_tab[true_chars[i]] = TRUE;
}
} | false | false | false | false | false | 0 |
startp(Hashspptr * pp)
{
PIDTYPE pid;
#ifdef OLD_VERSION
char segn[10];
#endif
char slotn[10]; /* Should be big enough! */
#ifdef STRUCT_SIG
struct sigstruct_name zc;
zc.sighandler_el = SIG_DFL;
sigmask_clear(zc);
zc.sigflags_el = 0;
#endif
while ((pid = fork()) < 0)
sleep(10);
if (pid > 0) { /* Par... | true | true | false | false | true | 1 |
nth_string(const char *strings, int n)
{
while (n) {
n--;
strings += strlen(strings) + 1;
}
return strings;
} | false | false | false | false | false | 0 |
data_record2res(dns_msg_resource_t *res, data_config_t *conf, data_record_t *record)
{
void *name, *data;
if ((name = data_record_name(conf, record)) == NULL)
return -1;
if ((data = data_record_data(conf, record)) == NULL)
return -1;
STRLCPY(res->mr_q.mq_name, name, sizeof(res->mr_q.mq... | false | false | false | false | false | 0 |
dbd_param_flag(cmd_parms *cmd, void *dconf, int flag)
{
svr_cfg *svr = ap_get_module_config(cmd->server->module_config,
&dbd_module);
switch ((long) cmd->info) {
case cmd_persist:
svr->cfg->persist = flag;
break;
}
return NULL;
} | false | false | false | false | false | 0 |
fltEpsilon()
{
float machEps = 1.0f;
do {
machEps /= 2.0f;
} while ((float)(1.0 + (machEps/2.0)) != 1.0);
return machEps;
} | false | false | false | false | false | 0 |
fuse_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata)
{
fuse_state_t *state;
fuse_in_header_t *finh;
fuse_private_t *priv = NULL;
struct... | false | false | false | false | false | 0 |
Perl_whichsig_pvn(pTHX_ const char *sig, STRLEN len)
{
char* const* sigv;
PERL_ARGS_ASSERT_WHICHSIG_PVN;
PERL_UNUSED_CONTEXT;
for (sigv = (char* const*)PL_sig_name; *sigv; sigv++)
if (strlen(*sigv) == len && memEQ(sig,*sigv, len))
return PL_sig_num[sigv - (char* const*)PL_sig_name];
#ifdef SIGCL... | false | false | false | false | false | 0 |
brcms_c_setband_inact(struct brcms_c_info *wlc, uint bandunit)
{
struct brcms_hardware *wlc_hw = wlc->hw;
u32 macintmask;
u32 macctrl;
brcms_dbg_mac80211(wlc_hw->d11core, "wl%d\n", wlc_hw->unit);
macctrl = bcma_read32(wlc_hw->d11core,
D11REGOFFS(maccontrol));
WARN_ON((macctrl & MCTL_EN_MAC) != 0);
/* ... | false | false | false | false | false | 0 |
hash_create(int nelem)
{
HASH *table = malloc(sizeof(HASH));
if(nelem == 0)
nelem = 2;
table->nelem = nelem;
table->table = calloc(nelem, sizeof(struct hash_elem *));
return table;
} | false | false | false | false | false | 0 |
check_send(struct IsdnCardState *cs, u_char rdm)
{
struct BCState *bcs;
if (rdm & BSTAT_RDM1) {
if ((bcs = sel_bcs_isar(cs, 1))) {
if (bcs->mode) {
send_frames(bcs);
}
}
}
if (rdm & BSTAT_RDM2) {
if ((bcs = sel_bcs_isar(cs, 2))) {
if (bcs->mode) {
send_frames(bcs);
}
}
}
} | false | false | false | false | false | 0 |
mvumi_alloc_cmds(struct mvumi_hba *mhba)
{
int i;
struct mvumi_cmd *cmd;
for (i = 0; i < mhba->max_io; i++) {
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd)
goto err_exit;
INIT_LIST_HEAD(&cmd->queue_pointer);
list_add_tail(&cmd->queue_pointer, &mhba->cmd_pool);
if (mhba->hba_capability & HS_CAPABI... | false | false | false | false | false | 0 |
GC_unregister_disappearing_link(void * * link)
{
struct disappearing_link *curr_dl;
DCL_LOCK_STATE;
if (((word)link & (ALIGNMENT-1)) != 0) return(0); /* Nothing to do. */
LOCK();
curr_dl = GC_unregister_disappearing_link_inner(&GC_dl_hashtbl, link);
UNLOCK();
if (NULL == curr_dl) return 0;... | false | false | false | false | false | 0 |
mca_fs_ufs_file_set_size (mca_io_ompio_file_t *fh,
OMPI_MPI_OFFSET_TYPE size)
{
int err = 0;
err = ftruncate(fh->fd, size);
fh->f_comm->c_coll.coll_bcast (&err,
1,
MPI_INT,
OM... | false | false | false | false | false | 0 |
exec(QPoint pos)
{
// initial selection
select(d->history.size() - d->historyPos - 1);
// position list
QPoint tl = d->e->mapToGlobal(d->e->rect().topLeft());
QPoint br = d->e->mapToGlobal(d->e->rect().bottomRight());
pos = d->e->mapToGlobal(pos);
ensurePolished();
adjustSize();
int rw = width() * 3 /... | false | false | false | false | false | 0 |
libset_write_script (const char *fname)
{
PRN *prn;
int err = 0;
/* FIXME maybe adjust path for fname? */
prn = gretl_print_new_with_filename(fname, &err);
if (!err) {
print_settings(prn, OPT_NONE);
gretl_print_destroy(prn);
}
return err;
} | false | false | false | false | false | 0 |
_ar_db_fetch_user(authreg_t ar, char *username, char *realm)
{
DB *db;
DBT key, val;
int err;
creds_t creds;
log_debug(ZONE, "fetching auth creds for user '%s' realm '%s'", username, realm);
db = _ar_db_get_realm_db(ar, realm);
if(db == NULL)
return NULL;
memset(&key, 0, sizeo... | false | false | false | false | false | 0 |
TextHeight( const char *str, unsigned short linew,
unsigned short spacing ) const {
unsigned short lines = 0;
int pos = 0, endpos = strlen(str);
while ( pos < endpos ) {
pos += FitText( &str[pos], linew, true );
++lines;
}
return lines * (Height() + spacing);
} | false | false | false | false | false | 0 |
snd_ensoniq_playback2_open(struct snd_pcm_substream *substream)
{
struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
ensoniq->mode |= ES_MODE_PLAY2;
ensoniq->playback2_substream = substream;
runtime->hw = snd_ensoniq_playback2;
snd_pcm_set_sync(subs... | false | false | false | false | false | 0 |
OnAddFileToProject(wxCommandEvent& event)
{
ProjectManager *prjManager = Manager::Get()->GetProjectManager();
cbProject* prj = nullptr;
wxString basePath;
if (event.GetId() == idMenuAddFile)
{
prj = prjManager->GetActiveProject();
if (prj)
basePath = prj->GetBasePath();
... | false | false | false | false | false | 0 |
lame_getcallback(sasl_conn_t *conn __attribute__((unused)),
unsigned long callbackid,
int (**pproc)(),
void **pcontext)
{
if(callbackid == SASL_CB_VERIFYFILE) {
*pproc = vf;
*pcontext = NULL;
return SASL_OK;
}
return SASL_FAIL;
} | false | false | false | false | false | 0 |
set_connection_device (MyApp *app)
{
int ctype;
char *dev = NULL;
gboolean changed;
ctype = gconf_client_get_int (app->client,
CONFBASE"/connection_type", NULL);
changed = FALSE;
switch (ctype) {
case CONNECTION_BLUETOOTH:
dev = gconf_client_get_string (app->client,
CONFBASE"/bluetoo... | false | false | false | false | false | 0 |
nexus_attacker_act(tenm_object *my, const tenm_object *player)
{
int i;
int theta;
/* sanity check */
if (my == NULL)
{
fprintf(stderr, "nexus_attacker_act: my is NULL\n");
return 0;
}
if (player == NULL)
return 0;
(my->count[0])++;
/* escaped */
if (my->count[0] > 2400)
return 1;... | false | false | false | false | false | 0 |
partition (struct String *str, int left, int right, int* i_, int* j_){
int i = *i_;
int j = *j_;
char PM;
int c; // pro presun
i = left;
j = right;
PM = str->Value [(i+j)/2];
do
{
while (str->Value [i] < PM) i++;
while (str->Value [j] > PM) j--;
if (i <= j)
{
c = str->Value [i];
str->Value[i... | false | false | false | false | true | 1 |
Save (xmlDocPtr xml) const
{
xmlNodePtr node = xmlNewDocNode (xml, NULL, (xmlChar*) ((m_IsPair)? "electron-pair": "electron"), NULL);
SaveId (node);
char *buf;
if (m_Pos) {
char const *buf;
switch (m_Pos) {
case POSITION_NE:
buf = "ne";
break;
case POSITION_NW:
buf = "nw";
break;
case POSITION... | false | false | false | false | false | 0 |
save()
{
int parentId = 0;
if ( m_parent )
parentId = m_parent->id();
SqlStorage* sqlStorage = CollectionManager::instance()->sqlStorage();
if( !sqlStorage )
return;
if ( m_dbId != -1 )
{
//update existing
QString query = "UPDATE playlist_groups SET parent_id=%1... | false | false | false | false | false | 0 |
keyPressEvent( QKeyEvent *event )
{
if ( event->isAutoRepeat() && event->key() == Qt::Key_Space )
Q_EMIT clicked();
QPushButton::keyPressEvent( event );
} | false | false | false | false | false | 0 |
process(ast_procdef* p) {
//1. Group Assign --> Foreach
ss2_group_assign ga;
gm_traverse_sents(p, &ga); // mark
ga.post_process(); // process
} | false | false | false | false | false | 0 |
faim_cb_chat_info_update(aim_session_t *sess, aim_frame_t *fr, ...)
{
va_list ap;
aim_userinfo_t *userinfo;
struct aim_chat_roominfo *roominfo;
char *roomname;
int usercount;
char *roomdesc;
fu16_t unknown_c9, unknown_d2, unknown_d5, maxmsglen, maxvisiblemsglen;
fu32_t creationtime;
va_start(ap, fr);
roominf... | false | false | false | false | false | 0 |
alternate_stats_message (int i, PRN *prn)
{
const char *msg[] = {
N_("Statistics based on the original data"),
N_("Statistics based on the weighted data"),
N_("Statistics based on the rho-differenced data"),
N_("Statistics based on the transformed data")
};
if (plain_format(prn)) {
pprintf(prn, "%s:\n... | false | false | false | false | false | 0 |
gt_obo_stanza_get_value(const GtOBOStanza *obo_stanza,
const char *stanza_key,
unsigned long num)
{
GtStrArray *sa;
gt_assert(obo_stanza);
if ((sa = gt_hashmap_get(obo_stanza->content, stanza_key)))
return gt_str_array_get(sa, num);
ret... | 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.