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 |
|---|---|---|---|---|---|---|
compute_hessian (GnmNlsolve *nl, const gnm_float *xs, const gnm_float *g0)
{
gnm_float **H, *xs2;
const int n = nl->vars->len;
int i, j;
H = g_new (gnm_float *, n);
xs2 = g_memdup (xs, n * sizeof (gnm_float));
for (i = 0; i < n; i++) {
gnm_float x0 = xs[i];
gnm_float dx;
const gnm_float *g;
gnm_float ep... | false | false | false | false | false | 0 |
cert_EncodeNameConstraintSubTree(CERTNameConstraint *constraints,
PLArenaPool *arena,
SECItem ***dest,
PRBool permited)
{
CERTNameConstraint *current_constraint = constraints;
SECItem **items = NULL;
int count = 0;
int ... | false | false | false | false | false | 0 |
kdbbGetFullKeyName (KDB *handle, const char *forFilename, const Key *parentKey, Key *returned)
{
size_t size=0;
char *transformedName=0;
char *name;
/* Next 2 ifs are required to transform filename from UTF-8 */
transformedName = malloc(size=kdbiStrLen(forFilename));
strcpy(transformedName,forFilename);
if (kd... | false | true | false | false | false | 1 |
alloc_workbook (int magic)
{
/* allocating and initializing the Workbook struct */
biff_workbook *workbook = malloc (sizeof (biff_workbook));
if (!workbook)
return NULL;
workbook->magic1 = magic;
workbook->magic2 = FREEXL_MAGIC_END;
workbook->xls = NULL;
workbook->fat = NULL;
workbook->cfbf... | false | false | false | false | false | 0 |
ddf_FreeAmatrix(ddf_rowrange m,ddf_colrange d,ddf_Amatrix A)
{
ddf_rowrange i;
ddf_colrange j;
for (i = 0; i < m; i++) {
for (j = 0; j < d; j++) {
ddf_clear(A[i][j]);
}
}
if (A!=NULL) {
for (i = 0; i < m; i++) {
free(A[i]);
}
free(A);
}
} | false | false | false | false | false | 0 |
doesEHPadUnwindToCaller(const Instruction *EHPad) {
auto *CPI = dyn_cast<CleanupPadInst>(EHPad);
if (!CPI)
return EHPad->mayThrow();
// This cleanup does not return or unwind, so we say it unwinds to caller.
if (CPI->use_empty())
return true;
const Instruction *User = CPI->user_back();
if (auto *C... | false | false | false | false | false | 0 |
bcm590xx_parse_dt_reg_data(
struct platform_device *pdev,
struct of_regulator_match **bcm590xx_reg_matches)
{
struct bcm590xx_board *data;
struct device_node *np = pdev->dev.parent->of_node;
struct device_node *regulators;
struct of_regulator_match *matches = bcm590xx_matches;
int count = ARRAY_SIZE(bcm590xx_m... | false | false | false | false | false | 0 |
vAddEndTagsUntil2(diagram_type *pDiag, UCHAR ucTag1, UCHAR ucTag2)
{
UCHAR ucTopTag;
do {
ucTopTag = ucReadStack();
switch (ucTopTag) {
case TAG_CHAPTER:
case TAG_SECT1:
case TAG_SECT2:
case TAG_SECT3:
case TAG_SECT4:
... | false | false | false | false | false | 0 |
MultVectorImpl(Number alpha, const Vector &x,
Number beta, Vector &y) const
{
// A few sanity checks
DBG_ASSERT(Dim()==x.Dim());
DBG_ASSERT(Dim()==y.Dim());
DBG_ASSERT(IsValid(diag_));
// Take care of the y part of the addition
if ( beta!=0.0 ) {
y.Sca... | false | false | false | false | false | 0 |
visorhba_probe(struct visor_device *dev)
{
struct Scsi_Host *scsihost;
struct vhba_config_max max;
struct visorhba_devdata *devdata = NULL;
int i, err, channel_offset;
u64 features;
scsihost = scsi_host_alloc(&visorhba_driver_template,
sizeof(*devdata));
if (!scsihost)
return -ENODEV;
channel_offset ... | false | false | false | false | false | 0 |
pd_upper_series (gnm_float x, gnm_float y, gboolean log_p)
{
gnm_float term = x / y;
gnm_float sum = term;
do {
y++;
term *= x / y;
sum += term;
} while (term > sum * GNM_EPSILON);
/* sum = \sum_{n=1}^ oo x^n / (y*(y+1)*...*(y+n-1))
* = \sum_{n=0}^ oo x^(n+1) / (y*(y+1)*...*(y+... | false | false | false | false | false | 0 |
send(unsigned long value, unsigned long pagesize) {
char buf[32];
int left, bytes, res;
int hex_zeroes;
for (hex_zeroes = 0; (pagesize % 16) == 0; pagesize /= 16) {
hex_zeroes++;
}
sprintf(buf+1, "%lx", value*pagesize);
bytes = strlen(buf+1);
while (hex_zeroes-- > 0) {
bytes++;
... | true | true | false | false | false | 1 |
acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
union acpi_parse_object **op, u32 * arg_list, u32 * arg_count)
{
union acpi_generic_state *scope = parser_state->scope;
ACPI_FUNCTION_TRACE(ps_pop_scope);
/* Only pop the scope if there is in fact a next scope */
if (scope->common.next) {
scope = acp... | false | false | false | false | false | 0 |
impl_activate (ArioPlugin *plugin,
ArioShell *shell)
{
GtkUIManager *uimanager;
ArioInformationPlugin *pi = ARIO_INFORMATION_PLUGIN (plugin);
g_object_get (shell,
"ui-manager", &uimanager,
NULL);
pi->priv->source = ario_informat... | false | false | false | false | false | 0 |
ignore_flags(const char *str) {
int x, y, ret = 0;
char **arr;
if (!str)
return ret;
arr = array_make(str, "|,:", 0, 1, 0);
for (x = 0; arr[x]; x++) {
if (!xstrcmp(arr[x], "*")) {
ret = IGNORE_ALL;
break;
}
for (y = 0; ignore_labels[y].name; y++)
if (!xstrcasecmp(arr[x], ignore_labels[y].name)... | false | false | false | false | false | 0 |
token_acknowledged(unsigned long token, struct timeval *now)
{
ResponseCell *last_valid, *cell, *next;
last_valid = &kept_replies;
cell = kept_replies.next;
while(cell) {
next = cell->next;
/* Discard if it's the one or if the reply is stale */
if ((cell->next_tok == token) ||
((now->tv... | false | false | false | false | false | 0 |
__verify_dmabuf_ops(struct vb2_queue *q)
{
if (!(q->io_modes & VB2_DMABUF) || !q->mem_ops->attach_dmabuf ||
!q->mem_ops->detach_dmabuf || !q->mem_ops->map_dmabuf ||
!q->mem_ops->unmap_dmabuf)
return -EINVAL;
return 0;
} | false | false | false | false | false | 0 |
gnumeric_atanh (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
gnm_float t = value_get_as_float (argv[0]);
if (t <= -1.0 || t >= 1.0)
return value_new_error_NUM (ei->pos);
return value_new_float (gnm_atanh (value_get_as_float (argv[0])));
} | false | false | false | false | false | 0 |
git_attr_cache__is_cached(
git_repository *repo, git_attr_file_source source, const char *path)
{
git_buf cache_key = GIT_BUF_INIT;
git_strmap *files = git_repository_attr_cache(repo)->files;
const char *workdir = git_repository_workdir(repo);
bool rval;
if (workdir && git__prefixcmp(path, workdir) == 0)
path ... | false | false | false | false | false | 0 |
get_opclass_name(Oid opclass, Oid actual_datatype,
StringInfo buf)
{
HeapTuple ht_opc;
Form_pg_opclass opcrec;
char *opcname;
char *nspname;
bool isvisible;
/* Domains use their base type's default opclass */
if (OidIsValid(actual_datatype))
actual_datatype = getBaseType(actual_datatype);
ht_opc... | false | false | false | true | false | 1 |
gst_play_bin_suburidecodebin_block (GstElement * suburidecodebin,
gboolean block)
{
GstIterator *it = gst_element_iterate_src_pads (suburidecodebin);
gboolean done = FALSE;
GST_DEBUG_OBJECT (suburidecodebin, "Blocking suburidecodebin: %d", block);
if (!it)
return;
while (!done) {
GstPad *sinkpad... | false | false | false | false | false | 0 |
find_reconnect_server(int chat_type,
const char *addr, int port)
{
RECONNECT_REC *match, *last_proto_match;
GSList *tmp;
int count;
g_return_val_if_fail(addr != NULL, NULL);
/* check if there's a reconnection to the same host and maybe even
the same port */
match = last_proto_match = ... | false | false | false | false | false | 0 |
__ats_fun_63 (ats_clo_ref_type env0, ats_clo_ref_type env1, ats_ref_type arg0, ats_ref_type arg1, ats_ref_type arg2) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp236) ;
ATSlocal (ats_ptr_type, tmp237) ;
ATSlocal (ats_int_type, tmp238) ;
ATSlocal (ats_ptr_type, tmp239) ;
__ats_lab___ats_fun_63:
tmp237 = ats_ptrget_m... | false | false | false | false | false | 0 |
wusb_ck_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
int result;
struct usb_device *usb_dev;
struct wusbhc *wusbhc;
struct wusb_ckhdid ck;
result = sscanf(buf,
"%02hhx %02hhx %02hhx %02hhx "
"%02hhx %02hhx %02hhx %02hhx "
"%02hhx %02hhx %02hhx %... | false | false | false | false | false | 0 |
fm3130_alarm_irq_enable(struct device *dev, unsigned int enabled)
{
struct fm3130 *fm3130 = dev_get_drvdata(dev);
int ret = 0;
fm3130->regs[FM3130_RTC_CONTROL] =
i2c_smbus_read_byte_data(fm3130->client, FM3130_RTC_CONTROL);
dev_dbg(dev, "alarm_irq_enable: enable=%d, FM3130_RTC_CONTROL=%02x\n",
enabled, fm3130... | false | false | false | false | false | 0 |
tx_chunk_write(txdrv_t *tx, const void *data, size_t len)
{
struct attr *attr = tx->opaque;
size_t remain = len;
const char *ptr = data;
size_t written = 0;
g_assert((size_t) -1 != len && len > 0);
while (remain > 0) {
ssize_t acceptable = chunk_acceptable(tx, remain);
ssize_t r;
if (acceptable < 0)
r... | false | false | false | false | false | 0 |
recalc(unsigned int i) {
static char bufs[2][32];
static int index = 0;
char *tmp = bufs[index++];
unsigned int reszta = 0;
int j = 0;
if (index > 2)
index = 0;
while (i >= 1000 && j < 3) {
reszta = i % 1000;
i /= 1000;
j++;
}
if (reszta)
snprintf(tmp, 30, "%u,%.3u ", i, reszta);
else
snprintf... | false | false | false | false | false | 0 |
rdoptfile(const char *file, const char *keyword)
{
const char *inp;
char *outp;
int ch;
char *result = (char *) 0;
int outlen;
if (file != (char *) 0) {
close_optfile(); /* Close previous one */
result = envprocess(file);
if ((fid = fopen(result, "r")) == (FILE *) 0) {
if (errno == EACCES)
... | false | false | false | true | true | 1 |
updateMetrics()
{
QVector<QPair<QString,QString> > data;
QwtArray<double> x;
QwtArray<double> y;
we->rawData(data);
int curSecs = 0;
// create rideFile
QSharedPointer<RideFile> workout(new RideFile());
workout->mainwindow = hackMW;
workout->setRecIntSecs(1);
for(int i = 0; i < ... | false | false | false | false | false | 0 |
lookup(unsigned opcode, unsigned domain) {
for (unsigned i = 0, e = array_lengthof(ReplaceableInstrs); i != e; ++i)
if (ReplaceableInstrs[i][domain-1] == opcode)
return ReplaceableInstrs[i];
return nullptr;
} | false | false | false | false | false | 0 |
change_blocks_to_one_loop(Block *bpt)
{
Block *b = bpt;
Pe_statement *pept;
Quadruple *qr;
if (b->inner != NULL) {
change_blocks_to_one_loop_inner(b->inner);
}
for(pept = b->pre_head; pept != NULL; pept = pept->next) {
qr = search_do_qr_from_pe_stm(pept);
qr->op[2] = copy_operand(qr->op[1]... | false | false | false | false | false | 0 |
get_child_loop_by_line (LOOPSET *loop, int lno)
{
int i;
for (i=0; i<loop->n_children; i++) {
if (loop->children[i]->parent_line == lno) {
return loop->children[i];
}
}
return NULL;
} | false | false | false | false | false | 0 |
emitEnterEvent()
{
if (_inside)
return;
emit(SIGNAL(onEnterLeave), gEvent_Enter);
_inside = true;
} | false | false | false | false | false | 0 |
DrawAxialRatioPoints(Ant *antData) {
GLfloat point_color[4]; /** Color of points **/
int i; /** Loop counter **/
double range; /** Range of tilt **/
double current_value; /** Current color value **/
range=antData->fieldData->maxaxialratio - antDa... | false | false | false | false | false | 0 |
isLegalDSPCondCode(EVT Ty, ISD::CondCode CC) {
bool IsV216 = (Ty == MVT::v2i16);
switch (CC) {
case ISD::SETEQ:
case ISD::SETNE: return true;
case ISD::SETLT:
case ISD::SETLE:
case ISD::SETGT:
case ISD::SETGE: return IsV216;
case ISD::SETULT:
case ISD::SETULE:
case ISD::SETUGT:
case ISD::SETU... | false | false | false | false | false | 0 |
init_archetable(void) {
archetype *at;
LOG(llevDebug, " Setting up archetable...\n");
for (at = first_archetype; at != NULL; at = (at->more == NULL) ? at->next : at->more) {
if (at->name == NULL) {
LOG(llevError, "archetype without name? %s\n", at->clone.name ? at->clone.name : "(no clo... | false | false | false | false | false | 0 |
nss_ckmdSessionObject_GetObjectSize
(
NSSCKMDObject *mdObject,
NSSCKFWObject *fwObject,
NSSCKMDSession *mdSession,
NSSCKFWSession *fwSession,
NSSCKMDToken *mdToken,
NSSCKFWToken *fwToken,
NSSCKMDInstance *mdInstance,
NSSCKFWInstance *fwInstance,
CK_RV *pError
)
{
nssCKMDSessionObject *obj;
CK_ULON... | false | false | false | false | false | 0 |
_eio_dir_link(Ecore_Thread *thread, Eio_Dir_Copy *order,
long long *step, long long count,
int length_source, int length_dest)
{
const char *ln;
Eina_List *l;
char oldpath[PATH_MAX];
char target[PATH_MAX];
char buffer[PATH_MAX];
char *newpath;
/* Build once the base of ... | false | false | false | false | false | 0 |
xudc_stop_activity(struct xusb_udc *udc)
{
int i;
struct xusb_ep *ep;
for (i = 0; i < XUSB_MAX_ENDPOINTS; i++) {
ep = &udc->ep[i];
xudc_nuke(ep, -ESHUTDOWN);
}
} | false | false | false | false | false | 0 |
ignore_drive (GDrive *drive)
{
GIcon *icon;
if (g_drive_can_eject (drive) == FALSE ||
g_drive_has_media (drive) == FALSE) {
GRL_DEBUG ("%s: Not adding %s as cannot eject or has no media", __FUNCTION__,
g_drive_get_name (drive));
return TRUE;
}
/* Hack to avoid USB devices showing ... | false | false | false | false | false | 0 |
setup_xsettings_managers (GnomeXSettingsManager *manager)
{
GdkDisplay *display;
int i;
int n_screens;
gboolean res;
gboolean terminated;
display = gdk_display_get_default ();
n_screens = gdk_display_get_n_screens (display);
res = x... | false | false | false | false | false | 0 |
nand_init_ecc(void)
{
int i, j, a;
parity[0] = 0;
for (i = 1; i < 256; i++)
parity[i] = (parity[i&(i-1)] ^ 1);
for (i = 0; i < 256; i++) {
a = 0;
for (j = 0; j < 8; j++) {
if (i & (1<<j)) {
if ((j & 1) == 0)
a ^= 0x04;
if ((j & 2) == 0)
a ^= 0x10;
if ((j & 4) == 0)
a ^= 0x40;
... | false | false | false | false | false | 0 |
w_set_pause_and_busy_time(Private_Repl_Protocol *prp, long *pausetime, long *busywaittime)
{
LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> w_set_pause_and_busy_time\n" );
/* If neither are set, set busy time to its default */
if (!*pausetime && !*busywaittime)
{
*busywaittime = repl5_get_backoff_min(prp);
}
... | false | false | false | false | false | 0 |
FreeImage_SetTransparencyTable(FIBITMAP *dib, BYTE *table, int count) {
if (dib) {
count = MAX(0, MIN(count, 256));
if (FreeImage_GetBPP(dib) <= 8) {
((FREEIMAGEHEADER *)dib->data)->transparent = (count > 0) ? TRUE : FALSE;
((FREEIMAGEHEADER *)dib->data)->transparency_count = count;
if (table) {
... | false | false | false | false | false | 0 |
pkix_VerifyNode_Hashcode(
PKIX_PL_Object *object,
PKIX_UInt32 *pHashcode,
void *plContext)
{
PKIX_VerifyNode *node = NULL;
PKIX_UInt32 childrenHash = 0;
PKIX_UInt32 nodeHash = 0;
PKIX_ENTER(VERIFYNODE, "pkix_VerifyNode_Hashcode");
PKIX_NULLCHECK_TWO(objec... | false | false | false | false | false | 0 |
restoreSession()
{
Dialog::restoreSession();
QSettings settings;
synchronizedViewCB->setChecked(
settings.value(sessionKey() + "/autoapply").toBool());
} | false | false | false | false | false | 0 |
cx18_handle_to_stream(struct cx18 *cx, u32 handle)
{
int i;
struct cx18_stream *s;
if (handle == CX18_INVALID_TASK_HANDLE)
return NULL;
for (i = 0; i < CX18_MAX_STREAMS; i++) {
s = &cx->streams[i];
if (s->handle != handle)
continue;
if (cx18_stream_enabled(s))
return s;
}
return NULL;
} | false | false | false | false | false | 0 |
Scm__InitModule(void)
{
ScmObj mpl = SCM_NIL;
(void)SCM_INTERNAL_MUTEX_INIT(modules.mutex);
modules.table = SCM_HASH_TABLE(Scm_MakeHashTableSimple(SCM_HASH_EQ, 64));
/* standard module chain */
INIT_MOD(nullModule, SCM_SYM_NULL, mpl);
INIT_MOD(schemeModule, SCM_SYM_SCHEME, mpl);
INIT_MOD(g... | false | false | false | false | false | 0 |
GetBookmark(const char *Name, EPoint &P) {
vector_iterate(EBookmark*, BMarks, it)
if ((*it)->IsName(Name)) {
P = (*it)->GetPoint();
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
IsAxial()
{
double tor;
OBAtom *a,*b,*c;
OBBondIterator i,j,k;
for (a = BeginNbrAtom(i);a;a = NextNbrAtom(i))
if (a->GetHyb() == 3 && a->IsInRing() && !(*i)->IsInRing())
for (b = a->BeginNbrAtom(j);b;b = a->NextNbrAtom(j))
if (b != this && b->IsInRing() && b->GetHyb() == 3)
... | false | false | false | false | false | 0 |
snd_pcm_dshare_sync_area(snd_pcm_t *pcm)
{
snd_pcm_direct_t *dshare = pcm->private_data;
snd_pcm_uframes_t slave_hw_ptr, slave_appl_ptr, slave_size;
snd_pcm_uframes_t appl_ptr, size;
const snd_pcm_channel_area_t *src_areas, *dst_areas;
/* calculate the size to transfer */
size = dshare->appl_ptr - dshare->last_... | false | false | false | false | false | 0 |
getDeprecateSymbol(const ContainedPtr& p1, const ContainedPtr& p2)
{
string deprecateMetadata, deprecateSymbol;
if(p1->findMetaData("deprecate", deprecateMetadata) ||
(p2 != 0 && p2->findMetaData("deprecate", deprecateMetadata)))
{
deprecateSymbol = "ICE_DEPRECATED_API ";
}
return dep... | false | false | false | false | false | 0 |
Hash_Next(HashScan *scan)
{
HashNode *t;
HashNode *endt;
HashNode p;
p = (HashNode) (scan->cur_p);
if (p)
{
scan->cur_p = (char *) (p->next);
return (char *) (&(p->key));
}
t = (HashNode *) (scan->cur_t);
endt = (HashNode *) (scan->endt);
while (++t < endt)
{
p = *t;
... | false | false | false | false | false | 0 |
weight_UNLOPS_SUBT(PartonLevel* trial, AlphaStrong * asFSR,
AlphaStrong * asISR, double RN ) {
// Select a path of clusterings
History * selected = select(RN);
// Set scales in the states to the scales pythia would have set
selected->setScalesInHistory();
// So far, no reweighting
doubl... | false | false | false | false | false | 0 |
activeMacro() const
{
return inMacroMode() ? prevAtom().nucleus()->asUnknownInset() : 0;
} | false | false | false | false | false | 0 |
database_to_xml_internal(const char *xmlschema, bool nulls,
bool tableforest, const char *targetns)
{
StringInfo result;
List *nspid_list;
ListCell *cell;
char *xmlcn;
xmlcn = map_sql_identifier_to_xml_name(get_database_name(MyDatabaseId),
true, false);
result = makeStringInfo();
xm... | false | false | false | false | false | 0 |
lam_wrap_exec_sv(const lam_sv_t& sv)
{
int status;
int i, ac = 0;
char **av = 0;
char *tmp = NULL;
// Build up a C array of the args
for (i = 0; (string::size_type) i < sv.size(); ++i)
sfh_argv_add(&ac, &av, (char*) sv[i].c_str());
// There is no way to tell whether cnfexec returned non-zero becaus... | false | false | false | true | false | 1 |
movesniper (int n)
{
int i;
enemy[n].y += enemy[n].speedy;
if (enemy[n].y < SPRITE_SIZE / 2)
{
enemy[n].y = SPRITE_SIZE / 2;
enemy[n].speedy = fabs(enemy[n].speedy);
}
if (enemy[n].y > HEIGHT - (SPRITE_SIZE * 2))
{
enemy[n].y = HEIGHT - (SPRITE_SIZE * 2);
enemy[n].speedy = ... | false | false | false | false | false | 0 |
is_running(void) const { return (is_engine_created() == true && engine_repp->status() == ECA_ENGINE::engine_status_running); } | false | false | false | false | false | 0 |
tg3_bus_string(struct tg3 *tp, char *str)
{
if (tg3_flag(tp, PCI_EXPRESS)) {
strcpy(str, "PCI Express");
return str;
} else if (tg3_flag(tp, PCIX_MODE)) {
u32 clock_ctrl = tr32(TG3PCI_CLOCK_CTRL) & 0x1f;
strcpy(str, "PCIX:");
if ((clock_ctrl == 7) ||
((tr32(GRC_MISC_CFG) & GRC_MISC_CFG_BOARD_ID_MASK... | false | false | false | false | false | 0 |
ucs2strip(ucs2_char_t* str)
{
if (str && *str) {
ucs2_char_t* p = NULL;
for (p = str + ucs2len(str) - 1;str <= p;p--) {
if (!isucs2space(*p)) {
*(p + 1) = 0;
break;
}
}
for (p = str;p < str + ucs2len(str);p++) {
if (!isucs2space(*p)) {
break;
}
}
if (p != str) {
ucs2_char_t *q ... | false | false | false | false | false | 0 |
iscsit_load_discovery_tpg(void)
{
struct iscsi_param *param;
struct iscsi_portal_group *tpg;
int ret;
tpg = iscsit_alloc_portal_group(NULL, 1);
if (!tpg) {
pr_err("Unable to allocate struct iscsi_portal_group\n");
return -1;
}
/*
* Save iscsi_ops pointer for special case discovery TPG that
* doesn't exi... | false | false | false | false | false | 0 |
sendcw( /* returns > 0 (ok), -1 (error) */
int ident, /* radio ID */
char *string /* ASCII string */
)
{
u_char cmd[BMAX], *ptr;
struct cmd1msg rsp;
int temp, i;
ptr = cmd; *ptr++ = V_ASCII;
for (i = 0; string[i] != '\0'; i++)
*ptr++ = string[i];
*ptr++ = FI;
return (setcmda(ident, (u_char *)&cmd, (u_... | false | false | false | false | false | 0 |
get_sysfs_string(const char *path, char *buffer, int max_size)
{
FILE *fp;
int r = 0;
if (!(fp = fopen(path, "r"))) {
log_sys_error("fopen", path);
return 0;
}
if (!fgets(buffer, max_size, fp))
log_sys_error("fgets", path);
else
r = 1;
if (fclose(fp))
log_sys_error("fclose", path);
return r;
} | false | false | false | false | true | 1 |
gr_rle_getsize( int org_size, ubyte *src )
{
int i;
ubyte c, oc;
ubyte count;
int dest_size=0;
oc = *src++;
count = 1;
for (i=1; i<org_size; i++ ) {
c = *src++;
if ( c!=oc ) {
if ( count ) {
if ( (count==1) && (! IS_RLE_CODE(oc)) ) {
dest_size++;
} else {
dest_size++;
dest_size++;... | false | false | false | false | false | 0 |
evd_tls_certificate_get_pki_key (EvdTlsCertificate *self, GError **error)
{
EvdPkiPubkey *key = NULL;
gnutls_pk_algorithm_t algo;
gcry_sexp_t key_sexp;
g_return_val_if_fail (EVD_IS_TLS_CERTIFICATE (self), NULL);
if (self->priv->type == EVD_TLS_CERTIFICATE_TYPE_UNKNOWN)
{
g_set_error_literal (error... | false | false | false | false | false | 0 |
action_mnote_list (ExifData *ed, ExifParams p)
{
char b[TAG_VALUE_BUF], b1[TAG_VALUE_BUF], b2[TAG_VALUE_BUF];
unsigned int i, c, id;
ExifMnoteData *n;
const char *s;
size_t fieldwidth, width, bytes;
n = exif_data_get_mnote_data (ed);
if (!n) {
printf (_("Unknown format or nonexistent MakerNote.\n"));
return... | false | false | false | false | false | 0 |
inf_communication_registry_entry_free(gpointer data)
{
InfCommunicationRegistryEntry* entry;
InfXmlConnectionStatus status;
entry = (InfCommunicationRegistryEntry*)data;
/* Send all messages directly as we are freed and can't keep them around
* any longer. */
/* TODO: Ref the group on unregistration, so ... | false | false | false | false | false | 0 |
isl_multi_aff_multi_val_on_space(
__isl_take isl_space *space, __isl_take isl_multi_val *mv)
{
int i, n;
isl_space *space2;
isl_local_space *ls;
isl_multi_aff *ma;
if (!space || !mv)
goto error;
n = isl_multi_val_dim(mv, isl_dim_set);
space2 = isl_multi_val_get_space(mv);
space2 = isl_space_align_params(sp... | false | false | false | false | false | 0 |
chclear(ChunkAllocator* root) {
ChunkAllocator* iter = NULL;
if (!root)
return;
for (iter = root; iter; iter = iter->next) {
iter->current_chunk = iter->n_chunks;
}
} | false | false | false | false | false | 0 |
netsnmp_add_global_traphandler(int list, Netsnmp_Trap_Handler *handler)
{
netsnmp_trapd_handler *traph;
if ( !handler )
return NULL;
traph = SNMP_MALLOC_TYPEDEF(netsnmp_trapd_handler);
if ( !traph )
return NULL;
/*
* Add this new handler to the front of the appropriate list
... | false | false | false | false | false | 0 |
gdict_show_error_dialog (GtkWindow *parent,
const gchar *message,
const gchar *detail)
{
GtkWidget *dialog;
g_return_if_fail ((parent == NULL) || (GTK_IS_WINDOW (parent)));
g_return_if_fail (message != NULL);
dialog = gtk_message_dialog_new (parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
... | false | false | false | false | false | 0 |
verb_authorsyn(word w)
{
int i,j;
/* Check game-specific synonyms first */
/* Scan in reverse so later synonyms will override earlier ones */
for(i=TOTAL_VERB-1;i>0;i--)
for(j=synlist[i];syntbl[j]!=0;j++)
if (w==syntbl[j]) return i;
return 0;
} | false | false | false | false | false | 0 |
choose_item(int a_idx)
{
artifact_type *a_ptr = &a_info[a_idx];
int tval = 0;
int sval = 0;
object_kind *k_ptr;
int i;
s16b k_idx, r;
/*
* Pick a base item from the cumulative frequency table.
*
* Although this looks hideous, it provides for easy addition of
* future artifact types, simply by removing t... | false | false | false | false | false | 0 |
LogToLocal(FILE *location, char *Format, ...)
{
static char buffer[MAX_LOG_LINE_LENGTH];
va_list argp;
va_start(argp, Format);
pal_vsnprintf(buffer, sizeof(buffer), Format, argp);
va_end(argp);
/* location should be stdout or stderr. Print to that. */
if (fprintf(location, "%s\n", buffer) < 0) {
r... | false | false | false | false | false | 0 |
set_hdr_data_slots (fr_header * hdr)
{
int nSlots;
if (hdr->layer != 3) {
hdr->side_info_slots = 0;
hdr->main_slots = 0;
return TRUE;
}
nSlots = hdr->frame_slots - hdr->padding;
#if 0
if (hdr->version == MPEG_VERSION_1) {
g_print ("Calced %d main slots, table says %d\n", nSlots,
MPE... | false | false | false | false | false | 0 |
clutter_x11_texture_pixmap_destroyed (ClutterX11TexturePixmap *texture)
{
ClutterX11TexturePixmapPrivate *priv;
priv = texture->priv;
if (!priv->destroyed)
{
priv->destroyed = TRUE;
g_object_notify (G_OBJECT (texture), "destroyed");
}
/*
* Don't set window to None, that would destroy t... | false | false | false | false | false | 0 |
gui_radiogroup_get_checked( GuiWidget *widget )
{
if ( widget->type != GUI_RADIOGROUP )
return -1;
if ( widget->spec.radiogroup.max != 1 )
return -1;
return widget->spec.radiogroup.single_check;
} | false | false | false | false | false | 0 |
image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfile)
{
GtkAllocation allocation;
GdkPixbufAnimation *animation = NULL;
GdkPixbuf *pixbuf = NULL;
GError *error = NULL;
debug_print("image_viewer_show_mimepart\n");
animation = gdk_pixbuf_animation_new_from_file(imgfile, &error);
if (gdk_pixbuf_a... | false | false | false | false | false | 0 |
Pause(bool state)
{
m_pQueue->Lock();
if (!m_bInitialized)
{
m_pQueue->Unlock();
return -1;
}
if (m_bPaused != state)
{
m_bPaused = state;
pause((state) ? 1 : 0);
if (state)
{
m_dPauseTime = GetTime();
reset();
}
}
m_pQueue->Broadcast(); // in case audio renderer waits ... | false | false | false | false | false | 0 |
mono_g_hash_table_new_full (GHashFunc hash_func, GEqualFunc key_equal_func,
GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
{
MonoGHashTable *hash = mono_g_hash_table_new (hash_func, key_equal_func);
if (hash == NULL)
return NULL;
hash->key_destroy_func = key_destroy_func;
hash->value... | false | false | false | false | false | 0 |
str_upper (lua_State *L) {
size_t l;
size_t i;
luaL_Buffer b;
const char *s = luaL_checklstring(L, 1, &l);
char *p = luaL_buffinitsize(L, &b, l);
for (i=0; i<l; i++)
p[i] = toupper(uchar(s[i]));
luaL_pushresultsize(&b, l);
return 1;
} | false | false | false | false | false | 0 |
pmcraid_error_handler(struct pmcraid_cmd *cmd)
{
struct scsi_cmnd *scsi_cmd = cmd->scsi_cmd;
struct pmcraid_resource_entry *res = scsi_cmd->device->hostdata;
struct pmcraid_instance *pinstance = cmd->drv_inst;
struct pmcraid_ioasa *ioasa = &cmd->ioa_cb->ioasa;
u32 ioasc = le32_to_cpu(ioasa->ioasc);
u32 masked_ioa... | false | false | false | false | false | 0 |
graph_proxy_destroy(
graph_proxy_handle graph)
{
ASSERT(list_empty(&graph_ptr->monitors));
if (graph_ptr->active)
{
cdbus_unregister_object_signal_hooks(
cdbus_g_dbus_connection,
graph_ptr->service,
graph_ptr->object,
JACKDBUS_IFACE_PATCHBAY);
}
free(graph_ptr->object);
free(... | false | false | false | false | false | 0 |
slider_look(DimensionName d, Adjustable* a) const {
const OLKitImpl& i = *impl_;
const OL_Specs* s = i.specs_;
OL_Dragbox* b = new OL_Dragbox(this, s, d);
OL_Channel* c = new OL_Channel(this, s, a, d, b);
return new OL_Slider(s, a, i.style_, d, c, b);
} | false | false | false | false | false | 0 |
hso_std_serial_write_bulk_callback(struct urb *urb)
{
struct hso_serial *serial = urb->context;
int status = urb->status;
/* sanity check */
if (!serial) {
D1("serial == NULL");
return;
}
spin_lock(&serial->serial_lock);
serial->tx_urb_used = 0;
spin_unlock(&serial->serial_lock);
if (status) {
handle_u... | false | false | false | false | false | 0 |
UpdateForCurrentViewPoint()
{
m_gridRef.unlink();
if (GridType* grid = m_source->GetViewPoint().m_grid)
grid->AddWorldObject(this);
UpdateVisibilityForOwner();
} | false | false | false | false | false | 0 |
server_build_config (xlator_t *this, server_conf_t *conf)
{
data_t *data = NULL;
int ret = -1;
struct stat buf = {0,};
GF_VALIDATE_OR_GOTO ("server", this, out);
GF_VALIDATE_OR_GOTO ("server", conf, out);
ret = dict_get_int32 (this->options, "inode-lru-limit... | false | false | false | false | false | 0 |
createFaceCharts(CM_t *cm, int **ret_inface, int **ret_outface)
{
int status;
int *inface;
int *outface;
int nd, left, right, parent;
int v,w,y;
ESL_ALLOC(inface, sizeof(int) * cm->nodes);
ESL_ALLOC(outface, sizeof(int) * cm->nodes);
/* inface - the number of faces below us in descendant
* ... | false | false | false | false | false | 0 |
DecodeJPG(jpeg_decompress_struct* cinfo, tImageJPG *pImageData) {
jpeg_read_header(cinfo, TRUE);
jpeg_start_decompress(cinfo);
//int rem = cinfo->output_width%4;
pImageData->rowSpan = cinfo->output_width * cinfo->output_components;
pImageData->sizeX = cinfo->output_width;
pImageData->sizeY = cinfo->output_hei... | false | false | false | false | false | 0 |
xmlSecTmplTransformAddXPath2(xmlNodePtr transformNode, const xmlChar* type,
const xmlChar *expression, const xmlChar **nsList) {
xmlNodePtr xpathNode;
xmlSecAssert2(transformNode != NULL, -1);
xmlSecAssert2(type != NULL, -1);
xmlSecAssert2(expression != NULL, -1);
xpathNode... | false | false | false | false | false | 0 |
equals(VMG_ vm_obj_id_t self, const vm_val_t *val,
int depth) const
{
const char *p;
int p_is_list;
CVmObjVector *vec2;
size_t cnt;
size_t cnt2;
size_t idx;
/* if the recursion depth is excessive, throw an error */
if (depth > VM_MAX_TREE_DEPTH_EQ)
... | false | false | false | false | false | 0 |
drv_BuE_CT_pwm(int val)
{
static int PWM = -1;
char cmd[4] = ESC "Adm";
/* -1 is used to query the current PWM */
if (val == -1)
return PWM;
if (val < 0)
val = 0;
if (val > 255)
val = 255;
PWM = val;
cmd[2] = (char) val;
cmd[3] = val == 0 ? 1 : 2;
drv_generic_serial_write(c... | false | false | false | false | false | 0 |
get_idr(struct idr *idr, int *id)
{
int ret;
mutex_lock(&cooling_cpufreq_lock);
ret = idr_alloc(idr, NULL, 0, 0, GFP_KERNEL);
mutex_unlock(&cooling_cpufreq_lock);
if (unlikely(ret < 0))
return ret;
*id = ret;
return 0;
} | false | false | false | false | false | 0 |
do_deps_invalidate (Sheet *sheet)
{
GnmDepContainer *deps;
GSList *dyn_deps = NULL;
int i;
g_return_if_fail (IS_SHEET (sheet));
g_return_if_fail (sheet->being_invalidated);
g_return_if_fail (sheet->revive == NULL);
sheet->revive = go_undo_group_new ();
gnm_named_expr_collection_unlink (sheet->names);
deps ... | false | false | false | false | false | 0 |
ipmi_ek_compare_link_descriptor(
struct ipmi_ek_amc_p2p_connectivity_record record1, int index1,
struct ipmi_ek_amc_p2p_connectivity_record record2, int index2 )
{
int result = ERROR_STATUS;
if (record1.link_desc[index1].type == record2.link_desc[index2].type){
/*if it is an OEM type, we compare the ... | true | true | false | false | false | 1 |
RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)
{
UInt32 m = 1;
int i;
for (i = numBitLevels; i != 0;)
{
UInt32 bit;
i--;
bit = (symbol >> i) & 1;
RangeEnc_EncodeBit(rc, probs + m, bit);
m = (m << 1) | bit;
}
} | false | false | false | false | false | 0 |
debugChain(lofig_list *f)
{
ptype_list *p;
velosig *vs;
velocon *vc;
chain_list *ch;
p=getptype(f->USER, VEL_SIG);
for (vs=(velosig *)p->DATA; vs; vs=vs->NEXT) {
printf("+-%s[%ld:%ld]\n", vs->NAME, vs->LEFT, vs->RIGHT);
if (vs->TYPE=='M')
printf(" <%s[%ld:%ld]>\n", vs->SUPER-... | false | false | false | false | false | 0 |
thread_private_new_memory (basic_block entry_block, tree x)
{
gimple stmt = NULL;
enum tree_code code;
void **slot;
tm_new_mem_map_t elt, *elt_p;
tree val = x;
enum thread_memory_type retval = mem_transaction_local;
if (!entry_block
|| TREE_CODE (x) != SSA_NAME
/* Possible uninitialized use, ... | false | false | false | false | false | 0 |
csbe_write_var_type_qualifier_omit_const(cx, vp)
csbe_context *cx;
Var_table *vp;
{
if (vp->restrict_flg)
csbe_printf(cx, " restrict ");
if (vp->volatile_flg)
csbe_printf(cx, " volatile ");
} | 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.