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 |
|---|---|---|---|---|---|---|
x509parse_keyfile( rsa_context *rsa, const char *path, const char *pwd )
{
int ret;
size_t n;
unsigned char *buf;
if ( (ret = load_file( path, &buf, &n ) ) != 0 )
return( ret );
if( pwd == NULL )
ret = x509parse_key( rsa, buf, n, NULL, 0 );
else
ret = x509parse_key( rsa... | false | false | false | false | false | 0 |
set_host_part_from(const url &arg)
{
protocol = arg.get_protocol();
hostname = arg.get_hostname();
port = arg.get_port();
} | false | false | false | false | false | 0 |
intel_th_pti_probe(struct intel_th_device *thdev)
{
struct device *dev = &thdev->dev;
struct resource *res;
struct pti_device *pti;
void __iomem *base;
int ret;
res = intel_th_device_get_resource(thdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
base = devm_ioremap(dev, res->start, resource_size(res));
... | false | false | false | false | false | 0 |
CreateDataChannel(
BaseSession* session, const std::string& content_name, bool rtcp) {
CreationParams params(session, content_name, rtcp, NULL);
return (Send(MSG_CREATEDATACHANNEL, ¶ms)) ? params.data_channel : NULL;
} | false | false | false | false | false | 0 |
mxtab_func (NODE *l, NODE *r, parser *p)
{
NODE *ret = aux_matrix_node(p);
if (ret != NULL && starting(p)) {
if (l->t == MAT && r->t == MAT) {
ret->v.m = matrix_matrix_xtab(l->v.m, r->v.m, &p->err);
} else if (l->t == VEC && r->t == VEC) {
const double *x = l->v.xvec;
const double *y = r->v.xv... | false | false | false | false | false | 0 |
valueEscapes(const Instruction *Inst) const {
const BasicBlock *BB = Inst->getParent();
for (const User *U : Inst->users()) {
const Instruction *UI = cast<Instruction>(U);
if (UI->getParent() != BB || isa<PHINode>(UI))
return true;
}
return false;
} | false | false | false | false | false | 0 |
WriteCLUT(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt8Number Precision, cmsStage* mpe)
{
cmsUInt8Number gridPoints[cmsMAXCHANNELS]; // Number of grid points in each dimension.
cmsUInt32Number i;
_cmsStageCLutData* CLUT = ( _cmsStageCLutData*) mpe -> Data;
if (CLUT ->HasFloatValues... | false | false | false | false | false | 0 |
GetLastFeature()
{
if (m_nFeatureCount < 0) {
m_poReader->ReadDataRecords(this);
}
if (m_bGeometryPerBlock && !m_bGeometry) {
LoadGeometry();
}
if (m_nFeatureCount < 1)
return NULL;
return m_papoFeature[m_nFeatureCount-1];
} | false | false | false | false | false | 0 |
initgroups_keys (int number, char *key[])
{
int ngrps = 100;
size_t grpslen = ngrps * sizeof (gid_t);
gid_t *grps = alloca (grpslen);
if (number == 0)
{
fprintf (stderr, _("Enumeration not supported on %s\n"), "initgroups");
return 3;
}
for (int i = 0; i < number; ++i)
{
int no... | false | false | false | false | false | 0 |
set_xrange_arg(unsigned& argi,
arg_data& ad,
bool& is_val_set,
double& val,
bool is_allow_zero,
bool is_no_max_check) {
const char* arg_label(ad.argstr[argi].c_str());
ad.argmark[argi] = true;
if (++argi>=ad.argstr.size()) {
... | false | false | false | false | false | 0 |
rb_str_succ(VALUE orig)
{
rb_encoding *enc;
VALUE str;
char *sbeg, *s, *e, *last_alnum = 0;
int c = -1;
long l;
char carry[ONIGENC_CODE_TO_MBC_MAXLEN] = "\1";
long carry_pos = 0, carry_len = 1;
enum neighbor_char neighbor = NEIGHBOR_FOUND;
str = rb_str_new5(orig, RSTRING_PTR(orig), ... | true | true | false | false | false | 1 |
DtInsertSubtable (
DT_SUBTABLE *ParentTable,
DT_SUBTABLE *Subtable)
{
DT_SUBTABLE *ChildTable;
Subtable->Peer = NULL;
Subtable->Parent = ParentTable;
Subtable->Depth = ParentTable->Depth + 1;
/* Link the new entry into the child list */
if (!Parent... | false | false | false | false | false | 0 |
wb_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
fd_t *fd, int32_t wbflags)
{
wb_local_t *local = NULL;
int32_t op_errno = EINVAL;
local = GF_CALLOC (1, sizeof (*local), gf_wb_mt_wb_local_t);
if (local == NULL) {
op_errno = ENOMEM;... | false | false | false | false | true | 1 |
byte_at(u32bit n) const
{
const u32bit WORD_BYTES = sizeof(word);
u32bit word_num = n / WORD_BYTES, byte_num = n % WORD_BYTES;
if(word_num >= size())
return 0;
else
return get_byte(WORD_BYTES - byte_num - 1, reg[word_num]);
} | false | false | false | false | false | 0 |
testEnumerate(CuTest *tc) {
struct fa *fa1 = make_good_fa(tc, "[ab](cc|dd)");
static const char *const fa1_expected[] =
{ "acc", "add", "bcc", "bdd" };
struct fa *fa_inf = make_good_fa(tc, "a(b*|d)c");
struct fa *fa_empty = make_good_fa(tc, "a?");
char **words;
int r;
r = fa_enumer... | false | false | false | false | false | 0 |
dns_compare(const void *s1, const void *s2, const void *buf)
{
const uint8_t *q = s1;
const uint8_t *p = s2;
unsigned int c0, c1;
while (1) {
c0 = p[0];
if (c0 >= 0xc0) {
/* Follow pointer */
c1 = p[1];
p = (const uint8_t *)buf + ((c0 - 0xc0) << 8) + c1;
} else if (c0) {
c... | false | false | false | false | false | 0 |
VP8ParseQuant(VP8Decoder* const dec) {
VP8BitReader* const br = &dec->br_;
const int base_q0 = VP8GetValue(br, 7);
const int dqy1_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dqy2_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dqy2_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
cons... | false | false | false | false | false | 0 |
write_real(GByteArray * bplist, double val)
{
uint64_t size = get_real_bytes(val); //cheat to know used space
uint8_t *buff = (uint8_t *) malloc(sizeof(uint8_t) + size);
buff[0] = BPLIST_REAL | Log2(size);
if (size == sizeof(double))
{
memcpy(buff + 1, &val, size);
}
else if (size ==... | false | true | false | false | false | 1 |
close_all_documents (GtrWindow * window, gboolean logout_mode)
{
GList *list;
list = get_modified_documents (window);
if (list != NULL)
{
GtkWidget *dlg;
dlg = gtr_close_confirmation_dialog_new (GTK_WINDOW (window),
list, logout_mode);
g_sig... | false | false | false | false | false | 0 |
menu_create(ITEM ** items, int count, int ncols, MenuNo number)
{
MENU *result;
WINDOW *menuwin;
int mrows, mcols;
int y = okMenuNo(number) ? MENU_Y : 0;
int x = menu_offset(number);
int margin = (y == MENU_Y) ? 1 : 0;
int maxcol = (ncols + x) < COLS ? ncols : (COLS - x - 1);
int maxrow ... | false | false | false | false | false | 0 |
bq2415x_remove(struct i2c_client *client)
{
struct bq2415x_device *bq = i2c_get_clientdata(client);
if (bq->nb.notifier_call)
power_supply_unreg_notifier(&bq->nb);
if (bq->notify_node)
of_node_put(bq->notify_node);
bq2415x_sysfs_exit(bq);
bq2415x_power_supply_exit(bq);
bq2415x_reset_chip(bq);
mutex_lock... | false | false | false | false | false | 0 |
bond_do_alb_xmit(struct sk_buff *skb, struct bonding *bond,
struct slave *tx_slave)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
struct ethhdr *eth_data = eth_hdr(skb);
if (!tx_slave) {
/* unbalanced or unassigned, send through primary */
tx_slave = rcu_dereference(bond->curr_active_slave)... | false | false | false | false | false | 0 |
CallBack_SendError( CString msg )
{
CMessageError * Object = new CMessageError();
Object->m_sError = msg;
return CallBack_SendObject(Object);
} | false | false | false | false | false | 0 |
trace_tree_ir(struct compilation_unit *cu)
{
struct basic_block *bb;
struct statement *stmt;
struct string *str;
if (!cu_matches_regex(cu))
return;
trace_printf("High-Level Intermediate Representation (HIR):\n\n");
for_each_basic_block(bb, &cu->bb_list) {
trace_printf("[bb %p]:\n\n", bb);
for_each_stmt(s... | false | false | false | false | false | 0 |
PyVTKObject_String(PyObject *op)
{
PyObject *func = PyObject_GetAttrString(op, (char*)"__str__");
if (func)
{
PyObject *res = PyEval_CallObject(func, (PyObject *)NULL);
Py_DECREF(func);
return res;
}
PyErr_Clear();
vtksys_ios::ostringstream vtkmsg_with_warning_C4701;
((PyVTKObject *)op)-... | false | false | false | false | false | 0 |
zend_do_foreach_end(const znode *foreach_token, const znode *as_token TSRMLS_DC) /* {{{ */
{
zend_op *container_ptr;
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMP;
opline->op1.opline_num = as_token->u.op.opline_num;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
CG(... | false | false | false | false | false | 0 |
list_iterator_start(list_t *restrict l) {
if (l->iter_active) return 0;
l->iter_pos = 0;
l->iter_active = 1;
l->iter_curentry = l->head_sentinel->next;
return 1;
} | false | false | false | false | false | 0 |
berDecodeAuthData(
struct berval *replyBV,
int *errCode,
size_t *retDataLen,
char *retData,
int *auth_state )
{
int rc=0, err = 0;
BerElement *replyBer = NULL;
struct berval challenge = {0};
if((replyBer = ber_init(replyBV)) == N... | false | false | false | false | false | 0 |
pick_up_timer_for_deadline_control(Ctrl_task *c, int pe_no,
Boolean *head_use_timer,
Boolean *tail_use_timer)
{
Block_info *b = ctrl_task_get_b_info(c);
Block *bpt = block_info_get_block(b);
Layer_info *l = block_info_get_layer_info(b);
... | false | false | false | false | false | 0 |
gtk_psfont_get_families(GList **families, gint *num_families)
{
if(!psfont_init || psfont_refcount == 0){
g_warning("PS fonts have not been initialized. Use gtk_psfont_init first.");
return;
}
*families = psfont_families;
*num_families = numf;
} | false | false | false | false | false | 0 |
_check_file (GFile *mount_root, const char *file_path, gboolean must_be_executable)
{
GFile *file;
GFileInfo *file_info;
gboolean ret;
ret = FALSE;
file = g_file_get_child (mount_root, file_path);
file_info = g_file_query_info (file,
G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE,
G_FILE_QUERY_INFO_N... | false | false | false | false | false | 0 |
process_recvd_msg(struct mddev *mddev, struct cluster_msg *msg)
{
if (WARN(mddev->cluster_info->slot_number - 1 == le32_to_cpu(msg->slot),
"node %d received it's own msg\n", le32_to_cpu(msg->slot)))
return;
switch (le32_to_cpu(msg->type)) {
case METADATA_UPDATED:
process_metadata_update(mddev, msg);
break;
... | false | false | false | false | false | 0 |
cc2520_fifop_irqwork(struct work_struct *work)
{
struct cc2520_private *priv
= container_of(work, struct cc2520_private, fifop_irqwork);
dev_dbg(&priv->spi->dev, "fifop interrupt received\n");
if (gpio_get_value(priv->fifo_pin))
cc2520_rx(priv);
else
dev_dbg(&priv->spi->dev, "rxfifo overflow\n");
cc2520_c... | false | false | false | false | false | 0 |
pr_width()
{
int n;
char option[20], *v;
for (n = 0; n < Nwidths; n++) {
strcpy(option, ".");
strcat(option, width_keys[n]);
strcat(option, "Width");
if ((v = pr_GetR(db, option)) != NULL) {
if (*v < '0' || *v > '9' || strlen(v) > 1)
fprintf(stderr, "gnuplot: illegal width value %s:%s\n", option... | false | false | false | false | false | 0 |
dsc_check_match_prompt(CDSC *dsc, const char *str, int count)
{
if (count != 0) {
char buf[MAXSTR+MAXSTR];
if (dsc->line_length < (unsigned int)(sizeof(buf)/2-1)) {
strncpy(buf, dsc->line, dsc->line_length);
buf[dsc->line_length] = '\0';
}
sprintf(buf+strlen(buf), "\n%%%%Begin%.40s: / %%%%End%.40s\n"... | true | true | false | false | false | 1 |
actionName(const QAction *a)
{
QString n = a->menuText(), n2;
for (int i = 0; i < (int)n.length(); i++) {
if (n[i] == '&' && n[i+1] != '&')
continue;
else if (n[i] == '&' && n[i+1] == '&')
n2 += '&';
else
n2 += n[i];
}
return n2;
} | false | false | false | false | false | 0 |
pm860x_onkey_probe(struct platform_device *pdev)
{
struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
struct pm860x_onkey_info *info;
int irq, ret;
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "No IRQ resource!\n");
return -EINVAL;
}
info = devm_kzalloc(&pdev->dev, sizeof(... | false | false | false | false | false | 0 |
test_object_tag_read__parse_without_message(void)
{
// read and parse a tag without a message field
git_repository *short_tag_repo;
git_tag *short_tag;
git_commit *commit;
git_oid id, id_commit;
// TODO: This is a little messy
cl_git_pass(git_repository_open(&short_tag_repo, cl_fixture("short_tag.git")));
git... | false | false | false | true | false | 1 |
get_reg_known_value (unsigned int regno)
{
if (regno >= FIRST_PSEUDO_REGISTER)
{
regno -= FIRST_PSEUDO_REGISTER;
if (regno < reg_known_value_size)
return reg_known_value[regno];
}
return NULL;
} | false | false | false | false | false | 0 |
checkout_submodule(
checkout_data *data,
const git_diff_file *file)
{
int error = 0;
git_submodule *sm;
/* Until submodules are supported, UPDATE_ONLY means do nothing here */
if ((data->strategy & GIT_CHECKOUT_UPDATE_ONLY) != 0)
return 0;
if ((error = git_futils_mkdir(
file->path, data->opts.target_direc... | false | false | false | false | false | 0 |
TIFFStartStrip(TIFF* tif, uint32 strip)
{
TIFFDirectory *td = &tif->tif_dir;
if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
return 0;
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
if (!(*tif->tif_setupdecode)(tif))
return (0);
tif->tif_flags |= TIFF_CODERSETUP;
}
t... | false | false | false | false | false | 0 |
AddFeature(const char* pszAptICAO,
double dfLat,
double dfLon,
double dfTrueHeading,
double dfLength,
... | false | false | false | false | false | 0 |
CreateLevelLump(const char *name)
{
lump_t *cur;
# if DEBUG_DIR
PrintDebug("Create Lump... %s\n", name);
# endif
// already exists ?
for (cur=wad.current_level->lev_info->children; cur; cur=cur->next)
{
if (strcmp(name, cur->name) == 0)
break;
}
if (cur)
{
if (cur->data)
UtilFre... | false | false | false | false | false | 0 |
has_guess_block_as_first_item( Junction *q )
#else
has_guess_block_as_first_item( q )
Junction *q;
#endif
{
Junction *alt;
for (alt=q; alt != NULL; alt= (Junction *) alt->p2 )
{
if ( first_item_is_guess_block((Junction *)alt->p1)!=NULL ) return 1;
}
return 0;
} | false | false | false | false | false | 0 |
market_unload_goods()
{
FirmMarket *curMarket = (FirmMarket*) firm_array[stop_array[dest_stop_id-1].firm_recno];
err_when(curMarket->firm_id != FIRM_MARKET);
memset(processed_raw_qty_array, 0, sizeof(char)*MAX_RAW);
memset(processed_product_raw_qty_array, 0, sizeof(char)*MAX_PRODUCT);
//-------------------------... | false | false | false | false | false | 0 |
gnumeric_fv (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
gnm_float rate = value_get_as_float (argv[0]);
gnm_float nper = value_get_as_float (argv[1]);
gnm_float pmt = value_get_as_float (argv[2]);
gnm_float pv = argv[3] ? value_get_as_float (argv[3]) : 0.;
int type = value_get_paytype (argv[4]);
... | false | false | false | false | false | 0 |
amd_gpio_request(struct gpio_chip *chip, unsigned offset)
{
struct amd_gpio *agp = to_agp(chip);
agp->orig[offset] = ioread8(agp->pm + AMD_REG_GPIO(offset)) &
(AMD_GPIO_DEBOUNCE | AMD_GPIO_MODE_MASK | AMD_GPIO_X_MASK);
dev_dbg(&agp->pdev->dev, "Requested gpio %d, data %x\n", offset, agp->orig[offset]);
return ... | false | false | false | false | false | 0 |
virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct drm_file *file_priv;
struct virtio_gpu_device *vgdev;
int r;
file_priv = filp->private_data;
vgdev = file_priv->minor->dev->dev_private;
if (vgdev == NULL) {
DRM_ERROR(
"filp->private_data->minor->dev->dev_private == NULL\n");
return ... | false | false | false | false | false | 0 |
cp_parser_pseudo_destructor_name (cp_parser* parser,
tree* scope,
tree* type)
{
bool nested_name_specifier_p;
/* Assume that things will not work out. */
*type = error_mark_node;
/* Look for the optional `::' operator. */
cp_parser_global_scope_opt (parser, /*current_scope_valid_p=*/true);
/... | false | false | false | false | false | 0 |
cli_cmd_volume_clrlks_opts_parse (const char **words, int wordcount,
dict_t **options)
{
int ret = -1;
int i = 0;
dict_t *dict = NULL;
char *kind_opts[4] = {"blocked", "granted", "all", NULL};
char *types[4] = {"inode", "entry", "p... | false | false | false | false | false | 0 |
ejecutar()
{
QList<sMarching_Cube> cubos;
QList<Cube> found = breadth_rec(largo_mundo);
//Ubicar los cubos (depth search octree)
foreach(const Cube& iterador, found){
Octree* arbol = new Octree(iterador);
cubos.append(depth_rec(arbol, arbol->get_raiz()));
delete arbol;
}
... | false | false | false | false | false | 0 |
LoadBattleMastersEntry()
{
mBattleMastersMap.clear(); // need for reload case
QueryResult* result = WorldDatabase.Query("SELECT entry,bg_template FROM battlemaster_entry");
uint32 count = 0;
if (!result)
{
BarGoLink bar(1);
bar.step();
sLog.ou... | false | false | false | false | false | 0 |
load_module(void)
{
struct ast_format tmp;
if (!(softmix_bridge.format_capabilities = ast_format_cap_alloc())) {
return AST_MODULE_LOAD_DECLINE;
}
ast_format_cap_add(softmix_bridge.format_capabilities, ast_format_set(&tmp, AST_FORMAT_SLINEAR, 0));
return ast_bridge_technology_register(&softmix_bridge);
} | false | false | false | false | false | 0 |
trex_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_TrackExtendsBox *ptr = (GF_TrackExtendsBox *)s;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->trackID = gf_bs_read_u32(bs);
ptr->def_sample_desc_index = gf_bs_read_u32(bs);
ptr->def_sample_duration = gf_bs_read_u32(bs);
ptr->def_sample_size = gf_... | false | false | false | false | false | 0 |
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__SelectorBar_OnKeyDown__00000014(struct __ecereNameSpace__ecere__com__Instance * this, unsigned int key, unsigned int ch)
{
if(key == 0x6E)
{
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__Instance * button,... | false | false | false | false | false | 0 |
xvip_graph_dma_init(struct xvip_composite_device *xdev)
{
struct device_node *ports;
struct device_node *port;
int ret;
ports = of_get_child_by_name(xdev->dev->of_node, "ports");
if (ports == NULL) {
dev_err(xdev->dev, "ports node not present\n");
return -EINVAL;
}
for_each_child_of_node(ports, port) {
r... | false | false | false | false | false | 0 |
BoxNodeInternal2( const double* ctr, double sz )
{
vtkIdType conn[4];
vtkPoints* pts = this->TraversedBounds->GetPoints();
conn[0] = pts->InsertNextPoint( ctr[0] - sz, ctr[1] - sz, ctr[2] );
conn[1] = pts->InsertNextPoint( ctr[0] + sz, ctr[1] - sz, ctr[2] );
conn[2] = pts->InsertNextPoint( ctr[0] + sz, ctr[1]... | false | false | false | false | false | 0 |
PKIX_Error_GetDescription(
PKIX_Error *error,
PKIX_PL_String **pDesc,
void *plContext)
{
PKIX_PL_String *descString = NULL;
#ifndef PKIX_ERROR_DESCRIPTION
char errorStr[32];
#endif
PKIX_ENTER(ERROR, "PKIX_Error_GetDescription");
PKIX_NULLCHECK_TWO(error, pDesc);
... | false | false | false | false | false | 0 |
CreateNode(unsigned int depth,
nSearchTreeNode parent,
nSearchTreeLabel label,
unsigned int labelstart,
unsigned int labellen)
{
return new ... | false | false | false | false | false | 0 |
icmXYZ2Luv(icmXYZNumber *w, double *out, double *in) {
double X = in[0], Y = in[1], Z = in[2];
double un, vn, u, v, fl, fu, fv;
un = (4.0 * w->X) / (w->X + 15.0 * w->Y + 3.0 * w->Z);
vn = (9.0 * w->Y) / (w->X + 15.0 * w->Y + 3.0 * w->Z);
u = (4.0 * X) / (X + 15.0 * Y + 3.0 * Z);
v = (9.0 * Y) / (X + 15.0 * Y + 3... | false | false | false | false | false | 0 |
dodatamatrix()
{
/* Reads species information and write factored data set */
long charindex, totalfactors, eu, chposition;
totalfactors = 0;
for (charindex = 0; charindex < (lastindex); charindex++) {
if (numstates[charindex] == 0)
totalfactors++;
else
totalfactors += numstates[charindex] -... | false | false | false | false | false | 0 |
aa_labelset_init(struct aa_labelset *ls)
{
AA_BUG(!ls);
rwlock_init(&ls->lock);
ls->root = RB_ROOT;
labelstats_init(&ls);
} | false | false | false | true | false | 1 |
qla2x00_clear_drv_active(struct qla_hw_data *ha)
{
if (IS_QLA8044(ha)) {
qla8044_idc_lock(ha);
qla8044_clear_drv_active(ha);
qla8044_idc_unlock(ha);
} else if (IS_QLA82XX(ha)) {
qla82xx_idc_lock(ha);
qla82xx_clear_drv_active(ha);
qla82xx_idc_unlock(ha);
}
} | false | false | false | false | false | 0 |
inter_maxtoabs(struct timeval **tv_io, struct timeval *tvbuf,
struct timeval now, struct timeval maxtime) {
/* tv_io may be 0 */
ldiv_t dr;
/*fprintf(stderr,"inter_maxtoabs now=%ld.%06ld maxtime=%ld.%06ld\n",
now.tv_sec,now.tv_usec,maxtime.tv_sec,maxtime.tv_usec);*/
if (!tv_io) return;
maxtime.tv_sec -=... | false | false | false | false | false | 0 |
mr_res_start_move_to(struct mlx4_dev *dev, int slave, int index,
enum res_mpt_states state, struct res_mpt **mpt)
{
struct mlx4_priv *priv = mlx4_priv(dev);
struct mlx4_resource_tracker *tracker = &priv->mfunc.master.res_tracker;
struct res_mpt *r;
int err = 0;
spin_lock_irq(mlx4_tlock(dev));
r = res_tracker... | false | false | false | false | false | 0 |
tty_flush(void)
{
ssize_t res;
if (ScreenCount) {
if (!el_no_echo)
res = write(el_outfd, Screen, ScreenCount);
ScreenCount = 0;
}
} | false | false | false | false | false | 0 |
mg_parse_header(const char *s, const char *var_name, char *buf,
size_t buf_size) {
return parse_header(s, s == NULL ? 0 : strlen(s), var_name, buf, buf_size);
} | false | false | false | false | false | 0 |
cm_mutex_new(void) {
#if GLIB_CHECK_VERSION(2,32,0)
GMutex *m = g_new0(GMutex, 1);
g_mutex_init(m);
return m;
#else
return g_mutex_new();
#endif
} | false | false | false | false | false | 0 |
bcf_sweep_destroy(bcf_sweep_t *sw)
{
int i;
for (i=0; i<sw->mrec; i++) bcf_empty1(&sw->rec[i]);
free(sw->idx);
free(sw->rec);
free(sw->lals);
bcf_hdr_destroy(sw->hdr);
hts_close(sw->file);
free(sw);
} | false | false | false | false | false | 0 |
reset_rec_accounting() {
unsigned int i;
for (i=0; i<projects.size(); i++) {
PROJECT* p = projects[i];
for (int j=0; j<coprocs.n_rsc; j++) {
p->rsc_pwf[j].reset_rec_accounting();
}
}
for (int j=0; j<coprocs.n_rsc; j++) {
rsc_work_fetch[j].reset_rec_accounting(... | false | false | false | false | false | 0 |
most_nd_stop(struct net_device *dev)
{
struct net_dev_context *nd = dev->ml_priv;
netdev_info(dev, "stop net device\n");
BUG_ON(nd->dev != dev);
netif_stop_queue(dev);
if (nd->channels_opened) {
most_stop_channel(nd->iface, nd->rx.ch_id, &aim);
most_stop_channel(nd->iface, nd->tx.ch_id, &aim);
nd->channel... | false | false | false | false | false | 0 |
set_sizes(double size, int Xratio, int Yratio)
{
/* Some code in generator assumes even dimension, so this is set to 2.
* Future topologies may also require even dimensions. */
/* The generator works also for odd values; keep this here for autogenerated
* height and width. */
const int even = 2;
/* In is... | false | false | false | false | false | 0 |
median_split(photon_t **p,
const unsigned int start, const unsigned int end,
const unsigned int median, const unsigned int axis)
{
unsigned int left = start;
unsigned int right = end;
while (right > left) {
const float v = p[right]->position[axis];
unsigned int i = left - 1;
unsigned int j = right;
for(... | false | false | false | false | false | 0 |
PIT_CheckLine(line_t * ld)
{
if (tmbbox[BOXRIGHT] <= ld->bbox[BOXLEFT]
|| tmbbox[BOXLEFT] >= ld->bbox[BOXRIGHT]
|| tmbbox[BOXTOP] <= ld->bbox[BOXBOTTOM]
|| tmbbox[BOXBOTTOM] >= ld->bbox[BOXTOP])
{
return (true);
}
if (P_BoxOnLineSide(tmbbox, ld) != -1)
{
retur... | false | false | false | false | false | 0 |
mschap_authorize(void * instance, REQUEST *request)
{
#define inst ((rlm_mschap_t *)instance)
VALUE_PAIR *challenge = NULL, *response = NULL;
challenge = pairfind(request->packet->vps, PW_MSCHAP_CHALLENGE);
if (!challenge) {
return RLM_MODULE_NOOP;
}
response = pairfind(request->packet->vps, PW_MSCHAP_RESPONSE... | false | false | false | false | false | 0 |
v_e_math_inv(VBigDig *inv, const VBigDig *u, const VBigDig *v)
{
VBigDig VBIGNUM(u1, 2*BITS), VBIGNUM(u3, 2*BITS), VBIGNUM(v1, 2*BITS), VBIGNUM(v3, 2 *BITS),
VBIGNUM(t1, 2*BITS), VBIGNUM(t3, 2*BITS), VBIGNUM(q, 2*BITS), VBIGNUM(w, 2*BITS);
int iter = 1;
v_bignum_set_one(u1);
v_bignum_set_bignum(u3, u);
v_bignu... | false | false | false | false | false | 0 |
mono_array_element_size (MonoClass *ac)
{
g_assert (ac->rank);
return ac->sizes.element_size;
} | false | false | false | false | false | 0 |
mono_threads_add_async_job (MonoThreadInfo *info, MonoAsyncJob job)
{
MonoAsyncJob old_job;
do {
old_job = (MonoAsyncJob) info->service_requests;
if (old_job & job)
return FALSE;
} while (InterlockedCompareExchange (&info->service_requests, old_job | job, old_job) != old_job);
return TRUE;
} | false | false | false | false | false | 0 |
locks_conflict(struct node *node, const struct lock *lock)
{
struct lock *l;
for (l = node->locks; l; l = l->next)
if (l->owner != lock->owner &&
lock->start <= l->end && l->start <= lock->end &&
(l->type == F_WRLCK || lock->type == F_WRLCK))
break;
return l;
} | false | false | false | false | false | 0 |
CopyEntry(vtkInformation* from,
vtkInformationIntegerVectorKey* key, int deep)
{
if (!deep)
{
key->ShallowCopy(from, this);
}
else
{
key->DeepCopy(from, this);
}
} | false | false | false | false | false | 0 |
qRgbaFromHsla(double h, double s, double l, double a)
{
double temp2 = l < 0.5 ? l * (1.0 + s) : l + s - l * s;
double temp1 = 2.0 * l - temp2;
return qRgba(static_cast<int>(calcHue(temp1, temp2, h + 1.0 / 3.0) * 255),
static_cast<int>(calcHue(temp1, temp2, h) * 255),
stat... | false | false | false | false | false | 0 |
test_collection_unlock (Test *test,
gconstpointer unused)
{
GError *error = NULL;
const gchar *prompt;
GVariant *unlocked;
GVariant *retval;
GVariant *element;
element = g_variant_new_object_path ("/org/freedesktop/secrets/collection/test");
retval = dbus_call_perform (test,
... | false | false | false | false | false | 0 |
unify_parameter_deduction_failure (bool explain_p, tree parm)
{
if (explain_p)
inform (input_location,
" couldn't deduce template parameter %qD", parm);
return 1;
} | false | false | false | false | false | 0 |
clear_path(you_row,you_col,y2,x2)
int you_row, you_col, y2, x2;
{
int dx, dy, s1, s2;
register int i, error, x, y, dxs, dys;
x = you_col; y = you_row;
dx = abs(x2-you_col); dy = abs(y2-you_row);
s1 = sign(x2-you_col); s2 = sign(y2-you_row);
if (s1 == 0) { /* same column */
if (s2 == 1)... | false | false | false | false | false | 0 |
command_T(command, argument)
char *command;
char *argument;
{
EB_Error_Code error_code;
EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS];
EB_Character_Code character_code;
Book *book;
char message[MAX_STRING_LENGTH + 1];
char title[EB_MAX_TITLE_LENGTH + 1];
int subbook_count;
int i,... | false | false | false | false | false | 0 |
symtab_node_asm_name (symtab_node node)
{
if (!DECL_ASSEMBLER_NAME_SET_P (node->symbol.decl))
return lang_hooks.decl_printable_name (node->symbol.decl, 2);
return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->symbol.decl));
} | false | false | false | false | false | 0 |
set_historyexpansion (struct cmdarg **args)
{
if (args[0] == NULL)
return cmdret_new (RET_SUCCESS, "%d", defaults.history_expansion);
#ifndef HAVE_HISTORY
if (ARG(0, number)) {
return cmdret_new (RET_FAILURE, "Not compiled with libhistory");
}
#endif
defaults.history_expansion = ARG(0, number);
return... | false | false | false | false | false | 0 |
savePapers(UserData *user)
{
if (!user->isModified())
return true;
if (!user->hasModifiedDynamicDataToStore())
return true;
QSqlDatabase DB = QSqlDatabase::database(Constants::USER_DB_CONNECTION);
if (!connectDatabase(DB, __LINE__)) {
return false;
}
QStringList papers... | false | false | false | false | false | 0 |
gmpc_mpddata_treeview_add_column (GmpcMpdDataTreeview * self, const char * columnname, int valuerow, int position)
{
#line 670 "gmpc-mpddata-treeview.c"
#define __GOB_FUNCTION__ "Gmpc:MpdData:Treeview::add_column"
#line 330 "gmpc-mpddata-treeview.gob"
g_return_val_if_fail (self != NULL, (GtkTreeViewColumn * )0);
#line... | false | false | false | false | false | 0 |
flush_queue(struct cgpu_info *cgpu)
{
struct work *work, *tmp;
int discarded = 0;
wr_lock(&cgpu->qlock);
HASH_ITER(hh, cgpu->queued_work, work, tmp) {
/* Can only discard the work items if they're not physically
* queued on the device. */
if (!work->queued) {
HASH_DEL(cgpu->queued_work, work);
discard... | false | false | false | false | false | 0 |
setProxy(gControl *proxy)
{
gControl *check = proxy;
while (check)
{
if (check == this)
return true;
check = check->_proxy;
}
if (_proxy)
_proxy->_proxy_for = NULL;
_proxy = proxy;
if (_proxy)
_proxy->_proxy_for = this;
return false;
} | false | false | false | false | false | 0 |
cr_string_dup (CRString const *a_this)
{
CRString *result = NULL ;
g_return_val_if_fail (a_this, NULL) ;
result = cr_string_new_from_gstring (a_this->stryng) ;
if (!result) {
cr_utils_trace_info ("Out of memory") ;
return NULL ;
}
cr_parsing_location_copy (&result->location,
... | false | false | false | false | false | 0 |
gst_qt_mux_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
GstQTMuxClass *klass = (GstQTMuxClass *) g_class;
GstQTMuxClassParams *params;
GstPadTemplate *videosinktempl, *audiosinktempl, *srctempl;
gchar *longname, *description;
params =
(GstQTMuxClassPara... | false | false | false | false | false | 0 |
Increment()
{
if (!this->Graph)
{
return;
}
vtkIdType lastVertex = this->Graph->GetNumberOfVertices();
vtkDistributedGraphHelper *helper = this->Graph->GetDistributedGraphHelper();
if (helper)
{
int myRank
= this->Graph->GetInformation()->Get(vtkDataObject::DATA_PIECE_NUMBER());
... | false | false | false | false | false | 0 |
getLocation(int geomIndex,
const Coordinate& p, std::vector<GeometryGraph*> *geom)
{
// compute location only on demand
if (ptInAreaLocation[geomIndex]==Location::UNDEF)
{
ptInAreaLocation[geomIndex]=algorithm::locate::SimplePointInAreaLocator::locate(p,
(*geom)[geomIndex]->getGeometry());
}
return ptInArea... | false | false | false | false | false | 0 |
numberToString(ExecState* exec, JSValue* v, const List& args)
{
double radixAsDouble = args[0]->toInteger(exec); // nan -> 0
if (radixAsDouble == 10 || args[0]->isUndefined())
return jsString(v->toString(exec));
if (radixAsDouble < 2 || radixAsDouble > 36)
return throwError(exec, RangeError... | false | false | false | false | false | 0 |
set(ComponentName::Id id) {
const char *s = rcs_ ? ComponentName::rcsName(id) : ComponentName::sdqlName(id);
obj = interp_->makeSymbol(interp_->makeStringC(s));
} | false | false | false | false | false | 0 |
ap_abstract1_forget_array(ap_manager_t* man,
bool destructive, ap_abstract1_t* a,
ap_var_t* tvar, size_t size,
bool project)
{
ap_dim_t* tdim;
size_t i;
ap_abstract1_t res;
tdim = malloc(size*sizeof(ap_dim_t));
for (i=0; i<size; i++){
tdim[i] = ap_environment_dim_of_var(a->env,tvar[i]);... | false | true | false | false | false | 1 |
OnWxEventHide(wxEvent& event)
{
event.Skip();
Hide();
wxObject* evtObj = event.GetEventObject();
if (evtObj)
{
wxWindow* evtWin = (wxWindow*)(evtObj);
evtWin->Disconnect(wxID_ANY, wxEVT_SHOW,
(wxObjectEventFunction)&DocumentationHelper::OnWxEventHide,
... | false | false | false | false | false | 0 |
ctlin_list(t_ctlin *x, t_symbol *s, int argc, t_atom *argv)
{
t_float ctlnumber = atom_getfloatarg(0, argc, argv);
t_float value = atom_getfloatarg(1, argc, argv);
t_float channel = atom_getfloatarg(2, argc, argv);
if (x->x_ctlno >= 0 && x->x_ctlno != ctlnumber) return;
if (x->x_channel > 0 && x->x... | 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.