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 |
|---|---|---|---|---|---|---|
pack_backend__read(void **buffer_p, size_t *len_p, git_otype *type_p, git_odb_backend *backend, const git_oid *oid)
{
struct git_pack_entry e;
git_rawobj raw;
int error;
if ((error = pack_entry_find(&e, (struct pack_backend *)backend, oid)) < 0 ||
(error = git_packfile_unpack(&raw, e.p, &e.offset)) < 0)
return... | false | false | false | false | false | 0 |
sha1_hash(const unsigned char data[], unsigned long len, sha1_ctx ctx[1])
{ sha1_32t pos = (sha1_32t)(ctx->count[0] & SHA1_MASK),
space = SHA1_BLOCK_SIZE - pos;
const unsigned char *sp = data;
if((ctx->count[0] += len) < len)
++(ctx->count[1]);
while(len >= space) /* tr... | false | false | false | false | false | 0 |
_dxf_Insert_Translucent(SortList sl, void *xfp, int i)
{
SortListP slp = (SortListP)sl;
Sort next;
if (!slp->sortBlockList || slp->sortBlockList->numUsed == DXHW_TLIST_BLOCKSIZE)
{
SortBlock tmp = DXAllocate(sizeof(struct sortBlock));
if (! tmp)
return 0;
tmp->next = slp->sortBlockList;
tmp-... | false | false | false | false | false | 0 |
AES_xtime(uint32_t x)
{
return x = (x&0x80) ? (x<<1)^0x1b : x<<1;
} | false | false | false | false | false | 0 |
xml_sax_print_errors_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
XMLSaxParseState *state = (XMLSaxParseState *)xin->user_state;
if (xin->content->str == NULL || *xin->content->str == 0)
/* 1.11.x or later file */
return;
xml_sax_must_have_sheet (state);
if (strcmp (xin->content->str, "as_blank") ==... | false | false | false | false | false | 0 |
findIncDecBefore(MachineBasicBlock::iterator MBBI, unsigned Reg,
ARMCC::CondCodes Pred, unsigned PredReg, int &Offset) {
Offset = 0;
MachineBasicBlock &MBB = *MBBI->getParent();
MachineBasicBlock::iterator BeginMBBI = MBB.begin();
MachineBasicBlock::iterator EndMBBI = MBB.end();
if (MBBI == B... | false | false | false | false | false | 0 |
usnic_uiom_interval_node_alloc(long int start, long int last, int ref_cnt,
int flags)
{
struct usnic_uiom_interval_node *interval = kzalloc(sizeof(*interval),
GFP_ATOMIC);
if (!interval)
return NULL;
interval->start = start;
interval->last = last;
interval->flags = flags;
interval->ref_cnt = ref_cn... | false | false | false | false | false | 0 |
list_type_expmem(struct list_type *t)
{
int tot = 0;
for (; t; t = t->next)
tot += sizeof(struct list_type) + strlen(t->extra) + 1;
return tot;
} | false | false | false | false | false | 0 |
save_expanded_node (GtkTreeView *view, GtkTreePath *path, gpointer user_data)
{
GList **list = (GList **)user_data;
GtkTreeModel *model;
GtkTreeIter iter;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
if (gtk_tree_model_get_iter (model, &iter, path))
{
GString *str;
GtkTreeIter child;
str = g_s... | false | false | false | false | false | 0 |
load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size)
{
enum ucode_state ret;
/* free old equiv table */
free_equiv_cpu_table();
ret = __load_microcode_amd(family, data, size);
if (ret != UCODE_OK)
cleanup();
#ifdef CONFIG_X86_32
/* save BSP's matching patch for early load */
if (cpu_data(cpu... | false | false | false | false | false | 0 |
mpfr_div_2ui (mpfr_ptr y, mpfr_srcptr x, unsigned long n, mpfr_rnd_t rnd_mode)
{
int inexact;
MPFR_LOG_FUNC (
("x[%Pu]=%.*Rg n=%lu rnd=%d", mpfr_get_prec(x), mpfr_log_prec, x, n,
rnd_mode),
("y[%Pu]=%.*Rg inexact=%d", mpfr_get_prec(y), mpfr_log_prec, y, inexact));
if (MPFR_UNLIKELY (MPFR_IS_SINGULA... | false | false | false | false | false | 0 |
gen_load_avs_llprefixlen()
{
struct slist *s1, *s2;
/*
* Generate code to load the length of the AVS header into
* the register assigned to hold that length, if one has been
* assigned. (If one hasn't been assigned, no code we've
* generated uses that prefix, so we don't need to generate any
* code to loa... | false | false | false | false | false | 0 |
imximage_verify_header(unsigned char *ptr, int image_size,
struct image_tool_params *params)
{
struct imx_header *imx_hdr = (struct imx_header *) ptr;
if (detect_imximage_version(imx_hdr) == IMXIMAGE_VER_INVALID)
return -FDT_ERR_BADSTRUCTURE;
return 0;
} | false | false | false | false | false | 0 |
mesh_PointList_get(int sel, Geom *geom, va_list *args) {
HPoint3 *pt;
Mesh *m = (Mesh *)geom;
TransformPtr t;
pt = OOGLNewNE(HPoint3, m->nu * m->nv, msg);
t = va_arg(*args, TransformPtr);
return GeomCall(GeomMethodSel("PointList_fillin"), geom, t, 0, pt);
} | false | false | false | false | false | 0 |
joe_towupper(struct charmap *foo,int c)
{
int idx;
if (c>=0x61 && c<=0x7A)
return c+0x41-0x61;
else if(c<128)
return c;
if (!data_wctype_toupper_i) {
int x;
int y = -1;
data_wctype_toupper_i = (struct interval *)joe_malloc(sizeof(data_wctype_toupper));
toupper_cvt = (int *)joe_malloc(sizeof(data_wcty... | false | false | false | false | false | 0 |
gst_net_time_provider_thread (gpointer data)
{
GstNetTimeProvider *self = data;
struct sockaddr_in tmpaddr;
socklen_t len;
GstNetTimePacket *packet;
gint ret;
while (TRUE) {
GST_LOG_OBJECT (self, "doing select");
ret = gst_poll_wait (self->priv->fdset, GST_CLOCK_TIME_NONE);
GST_LOG_OBJECT (self... | false | false | false | false | false | 0 |
LexString(string in_line, string& errstr) {
list<_kis_lex_rec> ret;
int curstate = _kis_lex_none;
_kis_lex_rec cpr;
string tempstr;
char lastc = 0;
char c = 0;
cpr.type = _kis_lex_none;
cpr.data = "";
ret.push_back(cpr);
for (size_t pos = 0; pos < in_line.length(); pos++) {
lastc = c;
c = in_line[pos];
... | false | false | false | false | false | 0 |
globus_gram_job_manager_rsl_eval_one_attribute(
globus_gram_jobmanager_request_t * request,
char * attribute,
char ** value)
{
globus_list_t * attributes;
globus_list_t * node;
globus_rsl_t * ... | false | false | false | false | false | 0 |
Add(OBBase* pOb, std::streampos seekpos)
{
///Adds a fingerprint
vector<unsigned int> vecwords;
if(!_pFP)
return false;
if(_pFP->GetFingerprint(pOb, vecwords, _nbits))
{
_pindex->header.words = vecwords.size(); //Use size as returned from fingerprint
if(_pindex->fptdata.em... | false | false | false | false | false | 0 |
gt_EMINumMatchesLeft(const struct BWTSeqExactMatchesIterator *iter)
{
gt_assert(iter);
if (iter->nextMatchBWTPos > iter->bounds.end)
return 0;
else
return iter->bounds.end - iter->bounds.start;
} | false | false | false | false | false | 0 |
raw_read_blk(io_channel channel,
struct unix_private_data *data,
unsigned long long block,
int count, void *bufv)
{
errcode_t retval;
ssize_t size;
ext2_loff_t location;
int actual = 0;
unsigned char *buf = bufv;
size = (count < 0) ? -count : count * channel->block_size;
data->io_st... | false | false | false | false | false | 0 |
_clutter_debug_messagev (const char *format,
va_list var_args)
{
static gint64 last_debug_stamp;
gchar *stamp, *fmt;
gint64 cur_time, debug_stamp;
cur_time = g_get_monotonic_time ();
/* if the last debug message happened less than a second ago, just
* show the increments inst... | false | false | false | false | false | 0 |
doCancel()
{
busy_->start();
AHCExecuteTask* t = new AHCExecuteTask(receiver_,AHCommand(node_,sessionId_,AHCommand::Cancel), client_->rootTask());
connect(t,SIGNAL(finished()),SLOT(commandExecuted()));
t->go(true);
} | false | false | false | false | false | 0 |
add_scripti(int a)
{
while(a>=0x40){
add_scriptb(a|0xc0);
a=(a-0x40)>>6;
}
add_scriptb(a|0x80);
} | false | false | false | false | false | 0 |
_cdio_stream_open_if_necessary(CdioDataSource_t *p_obj)
{
if (!p_obj) return false;
if (!p_obj->is_open) {
if (p_obj->op.open(p_obj->user_data)) {
cdio_warn ("could not open input stream...");
return false;
} else {
cdio_debug ("opened source...");
p_obj->is_open = 1;
p_obj->p... | false | false | false | false | true | 1 |
find_contact_in_group_by_nick(const char *nick, grouplist *gl)
{
LList *l;
if (nick == NULL || gl == NULL)
return NULL;
for (l = gl->members; l; l = l->next) {
if (!strcasecmp(((struct contact *)l->data)->nick, nick))
return (struct contact *)l->data;
}
return NULL;
} | false | false | false | false | false | 0 |
operator<<(const FormattedString &FS) {
unsigned Len = FS.Str.size();
int PadAmount = FS.Width - Len;
if (FS.RightJustify && (PadAmount > 0))
this->indent(PadAmount);
this->operator<<(FS.Str);
if (!FS.RightJustify && (PadAmount > 0))
this->indent(PadAmount);
return *this;
} | false | false | false | false | false | 0 |
ds1wm_probe(struct platform_device *pdev)
{
struct ds1wm_data *ds1wm_data;
struct ds1wm_driver_data *plat;
struct resource *res;
int ret;
if (!pdev)
return -ENODEV;
ds1wm_data = devm_kzalloc(&pdev->dev, sizeof(*ds1wm_data), GFP_KERNEL);
if (!ds1wm_data)
return -ENOMEM;
platform_set_drvdata(pdev, ds1wm_da... | false | false | false | false | false | 0 |
MochaCtlFreeAblArray( AblArray )
ablarray *AblArray;
{
long Index;
if ( AblArray == (ablarray *)0 ) return;
for ( Index = 0; Index < AblArray->WIDTH; Index++ )
{
freeablexpr( AblArray->ARRAY[ Index ] );
}
autfreeheap( (void *)AblArray->ARRAY, sizeof( ablexpr *) * AblArray->WIDTH );
autfreeheap( ... | false | false | false | false | false | 0 |
player_controller_establish_mpris_connection (PlayerController* self) {
gboolean _tmp0_ = FALSE;
gint _tmp1_ = 0;
gboolean _tmp3_ = FALSE;
gboolean* _tmp4_ = NULL;
gchar* _tmp5_ = NULL;
gchar* _tmp6_ = NULL;
Mpris2Controller* _tmp7_ = NULL;
g_return_if_fail (self != NULL);
_tmp1_ = self->current_state;
if (_t... | false | false | false | false | false | 0 |
handle_word(zword dictionarytable, const char *text,
zword word_start, int length,
zword *parse_dest,
BOOL write_unrecognized, int *parsed_words)
{
zword word_num;
word_num = find_word(dictionarytable, text + word_start, length);
#ifdef SMART_TOKENISER
if(!word_num)
word_num = smart_tokeniser(di... | false | false | false | false | false | 0 |
fuse_lib_removexattr(fuse_req_t req, fuse_ino_t ino,
const char *name)
{
struct fuse *f = req_fuse_prepare(req);
char *path;
int err;
err = get_path(f, ino, &path);
if (!err) {
struct fuse_intr_data d;
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_removexattr(f->fs, path, name);
fuse_finish_inter... | false | false | false | false | false | 0 |
GetDataDir(wxString fileToFind) const
{
/*
* Finding the resources in all cases is a difficult task,
* due to the huge variety of diffent systems and their filesystem
* structure.
* Basically we just check a couple of paths for presence of the resources,
* and hope we find them. If not, the user can still sp... | false | false | false | false | false | 0 |
xlib_rgb_alloc_scratch_image (void)
{
if (static_image_idx == N_IMAGES)
{
#ifndef NO_FLUSH
XFlush(image_info->display);
#endif
#ifdef VERBOSE
printf ("flush, %d puts since last flush\n", sincelast);
sincelast = 0;
#endif
static_image_idx = 0;
horiz_y = IMAGE_HEIGHT;
vert_x = IM... | false | false | false | false | false | 0 |
snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels,
unsigned int items, const char *const names[])
{
info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
info->count = channels;
info->value.enumerated.items = items;
if (!items)
return 0;
if (info->value.enumerated.item >= items)
info->valu... | false | false | false | false | false | 0 |
monitor_poll_all_fss_once(struct itable *filesysms, struct filesys_info *acc)
{
struct filesys_info *f;
uint64_t dev_id;
bzero(acc, sizeof( struct filesys_info ));
itable_firstkey(filesysms);
while(itable_nextkey(filesysms, &dev_id, (void **) &f))
{
monitor_poll_fs_once(f);
acc_dsk_usage(&acc->disk, &f->d... | false | false | false | false | false | 0 |
storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI,
unsigned SrcReg, bool isKill, int FrameIdx,
const TargetRegisterClass *RC,
const... | false | false | false | false | false | 0 |
unknown_ext_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent, int supported)
{
switch(flag & X509V3_EXT_UNKNOWN_MASK) {
case X509V3_EXT_DEFAULT:
return 0;
case X509V3_EXT_ERROR_UNKNOWN:
if(supported)
BIO_printf(out, "%*s<Parse Error>", indent, "");
else
BIO_printf(out, "%*s<Not Sup... | false | false | false | false | false | 0 |
chd_dump(cmph_t *mphf, FILE *fd)
{
register size_t nbytes;
chd_data_t *data = (chd_data_t *)mphf->data;
__cmph_dump(mphf, fd);
// Dumping CHD_PH perfect hash function
DEBUGP("Dumping CHD_PH perfect hash function with %u bytes to disk\n", data->packed_chd_phf_size);
nbytes = fwrite(&data->packed_chd_phf_size, s... | false | false | false | false | false | 0 |
PyvtkDataSet_GetCell_s1(PyObject *self, PyObject *args)
{
vtkPythonArgs ap(self, args, "GetCell");
vtkObjectBase *vp = ap.GetSelfPointer(self, args);
vtkDataSet *op = static_cast<vtkDataSet *>(vp);
vtkIdType temp0;
PyObject *result = NULL;
if (op && !ap.IsPureVirtual() && ap.CheckArgCount(1) &&
ap.G... | false | false | false | false | false | 0 |
updateFormattedLineSplitPointSequence(const string &sequence)
{
assert(formattedLine.length() > 0);
if (!isOkToSplitFormattedLine())
return;
// check for logical conditional
if (sequence == "||" || sequence == "&&"|| sequence == "or"|| sequence == "and")
{
if (shouldBreakLineAfterLogical)
maxAndOr = fo... | false | false | false | false | false | 0 |
getcwd_real(char *buf, size_t size)
{
int ret;
char *path;
size_t alloc_size = size;
if (size == 0) {
if (buf != NULL) {
__set_errno(EINVAL);
return NULL;
}
alloc_size = MAX (PATH_MAX, getpagesize ());
}
path=buf;
if (buf == NULL) {
pa... | false | false | false | false | false | 0 |
range_is_ok(int min, int max) {
if (!value_is_ok(min)) return false;
if (!value_is_ok(max)) return false;
if (min >= max) return false; // alpha-beta-like ranges cannot be null
return true;
} | false | false | false | false | false | 0 |
opal_daemon_init(char *working_dir)
{
#if defined(HAVE_FORK)
pid_t pid;
int fd;
if ((pid = fork()) < 0) {
return OPAL_ERROR;
} else if (pid != 0) {
exit(0); /* parent goes bye-bye */
}
/* child continues */
#if defined(HAVE_SETSID)
setsid(); /* become session leader ... | false | false | false | false | false | 0 |
GetCompLambda( const EncPicture& my_picture,
const CompSort csort )
{
const PictureParams& pparams = my_picture.GetPparams();
const PictureSort psort = pparams.PicSort();
float lambda;
if ( psort.IsIntra() ){
if ( m_is_a_cut )
lambda = m_encpa... | false | false | false | false | false | 0 |
ssl_cmd_SSLCADNRequestPath(cmd_parms *cmd, void *dcfg,
const char *arg)
{
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
const char *err;
if ((err = ssl_cmd_check_dir(cmd, &arg))) {
return err;
}
sc->server->pks->ca_name_path = arg;
return NULL;... | false | false | false | false | false | 0 |
process_packet_first_pass(capture_file *cf, epan_dissect_t *edt,
gint64 offset, struct wtap_pkthdr *whdr,
const guchar *pd)
{
frame_data fdlocal;
guint32 framenum;
gboolean passed;
/* The frame number of this packet is one more than the count of
frames in thi... | false | false | false | false | false | 0 |
drv260x_parse_dt(struct device *dev,
struct drv260x_data *haptics)
{
struct device_node *np = dev->of_node;
unsigned int voltage;
int error;
error = of_property_read_u32(np, "mode", &haptics->mode);
if (error) {
dev_err(dev, "%s: No entry for mode\n", __func__);
return error;
}
error = of_property_r... | false | false | false | false | false | 0 |
lpphy_loopback(struct b43_wldev *dev)
{
struct lpphy_iq_est iq_est;
int i, index = -1;
u32 tmp;
memset(&iq_est, 0, sizeof(iq_est));
lpphy_set_trsw_over(dev, true, true);
b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVR, 1);
b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0xFFFE);
b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0... | false | false | false | false | false | 0 |
findComment(char const *source, comment_match_t &match)
{
match.at = NULL;
for (int c=0; c<comments; c++) {
char *pos = (char *)strstr(source, comment[c].src);
if (!match.at || (pos && pos < match.at)) {
match.at = pos;
match.data = &comment[c];
}
}
} | false | false | false | false | false | 0 |
selectTextures(const irr::core::stringw& name)
{
for (irr::u32 i=0; i<irr::video::MATERIAL_MAX_TEXTURES; ++i)
TextureControls[i]->selectTextureByName(name);
} | false | false | false | false | false | 0 |
git_pathspec__vinit(
git_vector *vspec, const git_strarray *strspec, git_pool *strpool)
{
size_t i;
memset(vspec, 0, sizeof(*vspec));
if (git_pathspec_is_empty(strspec))
return 0;
if (git_vector_init(vspec, strspec->count, NULL) < 0)
return -1;
for (i = 0; i < strspec->count; ++i) {
int ret;
const cha... | false | false | false | false | false | 0 |
dump_bitmap (FILE *file, const_sbitmap bmap)
{
unsigned int i, n, j;
unsigned int set_size = bmap->size;
unsigned int total_bits = bmap->n_bits;
fprintf (file, " ");
for (i = n = 0; i < set_size && n < total_bits; i++)
for (j = 0; j < SBITMAP_ELT_BITS && n < total_bits; j++, n++)
{
if (n != 0 && ... | false | false | false | false | false | 0 |
read_binary_auto_entry(char *& data, auto_entry_t * entry,
transaction_t *& xact_pool)
{
bool ignore;
read_binary_entry_base(data, entry, xact_pool, ignore);
value_expr_t * expr;
read_binary_value_expr(data, expr);
// the item_predicate constructor will acquire the reference
entry->predicate = new it... | false | false | false | false | false | 0 |
write_bmp_depth_header(gx_device_printer *pdev, FILE *file, int depth,
const byte *palette /* [4 << depth] */,
int raster)
{
/* BMP scan lines are padded to 32 bits. */
ulong bmp_raster = raster + (-raster & 3);
int height = pdev->height;
int quads = (depth ... | false | false | false | false | false | 0 |
sensors_match_chip(const sensors_chip_name *chip1,
const sensors_chip_name *chip2)
{
if ((chip1->prefix != SENSORS_CHIP_NAME_PREFIX_ANY) &&
(chip2->prefix != SENSORS_CHIP_NAME_PREFIX_ANY) &&
strcmp(chip1->prefix, chip2->prefix))
return 0;
if ((chip1->bus.type != SENSORS_BUS_TYPE_ANY) &&
(ch... | false | false | false | false | false | 0 |
setMessage(const char* str, ...) {
char msgbuff[1024];
va_list vl;
va_start(vl, str);
vsnprintf(msgbuff, 1024, str, vl);
va_end(vl);
message = std::string(msgbuff);
message_timer = 5.0;
} | false | false | false | false | false | 0 |
pager_get_page_contents(Pager *pPager,Page *pPage,int noContent)
{
int rc = UNQLITE_OK;
if( pPager->is_mem || noContent || pPage->pgno >= pPager->dbSize ){
/* Do not bother reading, zero the page contents only */
SyZero(pPage->zData,pPager->iPageSize);
return UNQLITE_OK;
}
if( (pPager->iOpenFlags & UNQLITE_OP... | false | false | false | false | false | 0 |
regpiece(int *flagp)
{
char* ret;
char op;
char* next;
int flags;
ret = regatom(&flags);
if (ret == NULL)
return(NULL);
op = *regparse;
if (!ISREPN(op))
{
*flagp = flags;
return(ret);
}
if (!(flags&HASWIDTH) && op != '?' )
{
regerror( REGERR_OP_COULD_BE_EMPTY );
return NULL;
}
switch (op)
{
... | false | false | false | false | false | 0 |
_cl5UpgradeMajor(char *fromVersion, char *toVersion)
{
PRDir *dir = NULL;
PRDirEntry *entry = NULL;
DB *thisdb = NULL;
CL5OpenMode backup;
int rc = 0;
backup = s_cl5Desc.dbOpenMode;
s_cl5Desc.dbOpenMode = CL5_OPEN_CLEAN_RECOVER;
/* CL5_OPEN_CLEAN_RECOVER does 1 and 2 */
rc = _cl5AppInit ();
if (rc != CL5_SUC... | true | true | false | false | false | 1 |
system_write_dword(bx_address laddr, Bit32u data)
{
unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 3);
Bit32u lpf = LPFOf(laddr);
bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex];
if (tlbEntry->lpf == lpf) {
// See if the TLB entry privilege level allows us write access
// from this CPL.
if... | false | false | false | false | false | 0 |
GetValueAsInt(METAIO_STL::string optionName,
METAIO_STL::string fieldName)
{
METAIO_STL::string fieldname = fieldName;
if(fieldName == "")
{
fieldname = optionName;
}
OptionVector::const_iterator it = m_OptionVector.begin();
while(it != m_OptionVector.end())
{
if((*it).name ==... | false | false | false | false | false | 0 |
ActivateTool (const string& toolname, bool activate)
{
if (m_Tools[toolname]) {
if (activate) {
if (m_pActiveTool != m_Tools[toolname]) {
if (m_pActiveTool)
m_pActiveTool->Activate (false);
m_pActiveTool = m_Tools[toolname];
m_pActiveTool->Activate (true);
GtkToggleToolButton* button = (GtkTo... | false | false | false | false | false | 0 |
solve(Polynomial *lu)
{
if(!lu)
return(NULL);
if(lu->rows!=this->cols+1)
throw((void *)NULL);
//
// check rank
//
int rank=0,i,j,k;
for(j=0;j<lu->cols;j++){
bool is_zero_cols=true;
for(k=j;k<lu->cols;k++){
... | false | false | false | false | false | 0 |
teranetics_aneg_done(struct phy_device *phydev)
{
int reg;
/* auto negotiation state can only be checked when using copper
* port, if using fiber port, just lie it's done.
*/
if (!phy_read_mmd(phydev, MDIO_MMD_VEND1, 93)) {
reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
return (reg < 0) ? reg : (reg &... | false | false | false | false | false | 0 |
bSetNetLstFile( const wxString & rosFName )
{
// Attempt to set the netlist file name in the gNetList process object
if( ! m_oPrcGNetList.bSetNetLstFile( rosFName ) ) return( FALSE );
// Configure stuff in the main frame
if( m_poFrmMain != NULL )
{
m_poFrmMain->m_oNetLst.bSetLoadFile( rosFName ); // Set... | false | false | false | false | false | 0 |
calc_fps(struct v4l2_subdev *sd, u32 *numerator, u32 *denominator)
{
struct mt9v011 *core = to_mt9v011(sd);
unsigned height, width, hblank, vblank, speed;
unsigned row_time, t_time;
u64 frames_per_ms;
unsigned tmp;
height = mt9v011_read(sd, R03_MT9V011_HEIGHT);
width = mt9v011_read(sd, R04_MT9V011_WIDTH);
hbla... | false | false | false | false | false | 0 |
adv76xx_read_check(struct adv76xx_state *state,
int client_page, u8 reg)
{
struct i2c_client *client = state->i2c_clients[client_page];
int err;
unsigned int val;
err = regmap_read(state->regmap[client_page], reg, &val);
if (err) {
v4l_err(client, "error reading %02x, %02x\n",
client->addr, reg);
... | false | false | false | false | false | 0 |
getdatasock (const char *mode)
{
int s, t, tries;
if (data >= 0)
return fdopen (data, mode);
seteuid ((uid_t) 0);
s = socket (ctrl_addr.ss_family, SOCK_STREAM, 0);
if (s < 0)
goto bad;
/* Enables local reuse address. */
{
int on = 1;
if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR,
(c... | false | false | false | false | false | 0 |
get_builder_file (const gchar *filename,
const gchar *root,
const gchar *domain,
const gchar *first_required_widget,
va_list args)
{
GtkBuilder *builder;
const char *name;
GObject **object_ptr;
GError *erro... | false | false | false | false | false | 0 |
SAR_Alignment_add_region(SAR_Alignment *sar_alignment,
Region *src_region, Region *dst_region){
register gint suffix;
g_assert(sar_alignment->last_hsp);
g_assert(sar_alignment->last_match);
g_assert(!sar_alignment->last_region);
suffix = (HSP_query_end(sar_alignment->last... | false | false | false | false | false | 0 |
nilfs_segctor_scan_file_dsync(struct nilfs_sc_info *sci,
struct inode *inode)
{
LIST_HEAD(data_buffers);
size_t n, rest = nilfs_segctor_buffer_rest(sci);
int err;
n = nilfs_lookup_dirty_data_buffers(inode, &data_buffers, rest + 1,
sci->sc_dsync_start,
sci->sc_dsync_end);
err = nilfs_segct... | false | false | false | false | false | 0 |
ComputeNumbers()
{
if ( this->GetMTime() > this->ComputeTime )
{
int nb = 0;
int pnb = 0;
int count;
int maxNb = 0;
unsigned long memory=0;
int firstComponentIndex=0;
int c = this->GetNumberOfAttributes();
for(int i = 0; i < c; ++i)
{
count = this->GetAttribut... | false | false | false | false | false | 0 |
ctf_close_trace(struct bt_trace_descriptor *tdp)
{
struct ctf_trace *td = container_of(tdp, struct ctf_trace, parent);
int ret;
if (td->streams) {
int i;
for (i = 0; i < td->streams->len; i++) {
struct ctf_stream_declaration *stream;
int j;
stream = g_ptr_array_index(td->streams, i);
if (!stream)
... | false | false | false | false | false | 0 |
IncrementLocatorZ()
{
int x, y;
int *ptr;
ptr = this->LocatorPointIds;
for (y = 0; y < this->LocatorDimY; ++y)
{
for (x = 0; x < this->LocatorDimX; ++x)
{
ptr[0] = ptr[4];
ptr[3] = ptr[1];
ptr[1] = ptr[2] = ptr[4] = -1;
ptr += 5;
}
}
} | false | false | false | false | false | 0 |
cf_tai64_sub(value v1, value v2)
{
CAMLparam2(v1, v2);
int64 dt;
dt = Cf_tai64_val(v1)->s - Cf_tai64_val(v2)->s;
CAMLreturn(copy_int64(dt));
} | false | false | false | false | false | 0 |
focusblur_fft_work_add_buffer_zero (FblurFftBuffer *fft)
{
gfloat *buf;
buf = focusblur_fft_work_add_buffer (fft);
if (buf)
focusblur_fft_real_fill (buf, 0.0f, fft->work.nelements);
return buf;
} | false | false | false | false | false | 0 |
write_file (gchar * filename, gchar * content)
{
FILE *fp;
fp = fopen (filename, "w");
if (fp == NULL)
{
fprintf (stderr, "!!! ERROR: Error opening %s\n", filename);
perror ("ERROR");
errors++;
}
fprintf (fp, "%s", content);
fclose (fp);
} | false | false | false | false | false | 0 |
map_to_memory_cache_client(void * x) {
int err = 0;
Context * ctx = NULL;
MapToMemoryArgs * args = (MapToMemoryArgs *)x;
Channel * c = cache_channel();
ctx = id2ctx(args->id);
if (ctx == NULL) err = ERR_INV_CONTEXT;
else if (ctx->exited) err = ERR_ALREADY_EXITED;
code_area_cnt = 0;
... | false | false | false | false | false | 0 |
brackets_necessary( int top_operation, debugger_expression *operand )
{
enum precedence_t top_precedence, bottom_precedence;
top_precedence = binaryop_precedence( top_operation );
bottom_precedence = operand->precedence;
/* If the top level operation has a higher precedence than the
bottom level operat... | false | false | false | false | false | 0 |
newClause(void* mem, Solver& s, const Literal* lits, uint32 size, const ClauseInfo& extra) {
assert(size >= 2 && mem);
return new (mem) Clause(s, extra, lits, size, size, false);
} | false | false | false | false | false | 0 |
gfire_game_manager_closed_cb(GtkObject *p_object, gpointer *p_data)
{
if(gfire_gtk_builder)
{
g_object_unref(G_OBJECT(gfire_gtk_builder));
gfire_gtk_builder = NULL;
}
} | false | false | false | false | false | 0 |
unity_internal_aggregator_scope_impl_get_type (void) {
static volatile gsize unity_internal_aggregator_scope_impl_type_id__volatile = 0;
if (g_once_init_enter (&unity_internal_aggregator_scope_impl_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (UnityInternalAggregatorScopeImplClass), (G... | false | false | false | false | false | 0 |
WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL)
return false;
ostream& ofs = *pConv->GetOutStream();
OBMol workingmol(*pmol); // Copy the molecule
//*** Coordinate generation ***
//Generate coordinates only if no existing 2D coordinates
if... | false | false | false | false | false | 0 |
GSgetModDateTM(GopherObj *gs)
{
static struct tm time;
char *cp;
#ifndef NO_MKTIME
time_t converted;
#endif
if ( (gs->gplus == NULL) || (STRget(gs->gplus->ModDate) == NULL) )
return NULL;
cp = strchr(STRget(gs->gplus->ModDate), '<');
if (cp == NULL)
return NULL;
#def... | false | false | false | false | false | 0 |
init_scan_state( void)
{
base = 0x0a;
pci_is_last_image = TRUE;
incolon = FALSE;
is_instance = FALSE;
set_hdr_flag( FLAG_HEADERLESS);
reset_fcode_ranges();
first_fc_starter = TRUE;
if ( last_colon_filename != NULL ) free( last_colon_filename);
if ( instance_filename != NULL ) free( i... | false | false | false | false | false | 0 |
logfs_truncate_direct(struct inode *inode, u64 size)
{
struct logfs_inode *li = logfs_inode(inode);
struct write_control wc;
struct page *page;
int e;
int err;
alloc_inode_block(inode);
for (e = I0_BLOCKS - 1; e >= 0; e--) {
if (size > (e+1) * LOGFS_BLOCKSIZE)
break;
wc.ofs = li->li_data[e];
if (!wc.... | false | false | false | false | false | 0 |
existsCommand(redisClient *c) {
long long count = 0;
int j;
for (j = 1; j < c->argc; j++) {
expireIfNeeded(c->db,c->argv[j]);
if (dbExists(c->db,c->argv[j])) count++;
}
addReplyLongLong(c,count);
} | false | false | false | false | false | 0 |
escape_string(const QString &in)
{
QString out;
for(int n = 0; n < in.length(); ++n)
{
if(in[n] == '\\')
out += "\\\\";
else if(in[n] == ':')
out += "\\c";
else
out += in[n];
}
return out;
} | false | false | false | false | false | 0 |
BuildPacket(WorldPacket *packet)
{
MANGOS_ASSERT(packet->empty()); // shouldn't happen
ByteBuffer buf(4 + (m_outOfRangeGUIDs.empty() ? 0 : 1 + 4 + 9 * m_outOfRangeGUIDs.size()) + m_data.wpos());
buf << (uint32) (!m_outOfRangeGUIDs.empty() ? m_blockCount + 1 : m_blockCount);
if... | false | false | false | false | false | 0 |
proc_read_ipc(fcgid_ipc *ipc_handle, const char *buffer,
apr_size_t *size)
{
int retcode, unix_socket;
fcgid_namedpipe_handle *handle_info;
struct pollfd pollfds[1];
handle_info = (fcgid_namedpipe_handle *) ipc_handle->ipc_handle_info;
unix_socket = handle_info->handle_so... | false | true | false | false | true | 1 |
cha_exit_file(status, format, a, b, c, d, e, f, g, h)
int status;
char *format, *a, *b, *c, *d, *e, *f, *g, *h;
{
if (Cha_errno)
return;
if (Cha_stderr != stderr)
fputs("500 ", Cha_stderr);
if (progpath)
fprintf(Cha_stderr, "%s: ", progpath);
if (LineNo == 0)
; /* do n... | false | false | false | false | false | 0 |
main(int argc,char *argv[])
{
int arg,err=1;
char *fpr=NULL,*url=NULL,*keyfile=NULL,*name=NULL;
if(argc==1)
{
usage(stderr);
return 1;
}
else if(argc>1 && strcmp(argv[1],"--version")==0)
{
#if defined(HAVE_CONFIG_H) && defined(VERSION)
printf ("make-dns-cert (GnuPG) " VERSION "\n"... | false | true | false | false | true | 1 |
sigmainv0(real xi, real eta, real& u, real& v)
const throw() {
bool retval = false;
if (eta > real(1.25) * _Ev.KE() ||
(xi < -real(0.25) * _Eu.E() && xi < eta - _Ev.KE())) {
// sigma as a simple pole at w = w0 = Eu.K() + i * Ev.K() and sigma is
// approximated by
//
// sigma ... | false | false | false | false | false | 0 |
CryptoOutputStream(std::ostream& ostr, Cipher& cipher, std::streamsize bufferSize):
CryptoIOS(ostr, cipher.createDecryptor(), bufferSize),
std::ostream(&_buf)
{
} | false | false | false | false | false | 0 |
siff_read_packet(AVFormatContext *s, AVPacket *pkt)
{
SIFFContext *c = s->priv_data;
int size;
if (c->has_video){
if (c->cur_frame >= c->frames)
return AVERROR(EIO);
if (c->curstrm == -1){
c->pktsize = get_le32(s->pb) - 4;
c->flags = get_le16(s->pb);
... | false | true | false | false | false | 1 |
on_add_button_clicked(void)
{
gchar *name = NULL, *command = NULL;
gboolean ok;
ok = edit_action_dialog(&name, &command);
if (ok && name[0] != '\0' && command[0] != '\0') {
GtkTreeIter new_iter;
if (has_selection)
gtk_list_store_insert_after(list_store, &new_iter, &iter);
... | false | false | false | false | false | 0 |
read(DcmInputStream &inStream,
const E_TransferSyntax ixfer,
const E_GrpLenEncoding glenc,
const Uint32 maxReadLength)
{
OFCondition l_error = changeXfer(ixfer);
if (l_error.good())
return DcmSequenc... | false | false | false | false | false | 0 |
bmp_untransform_coord(EVG_Texture *_this, s32 _x, s32 _y, Fixed *outx, Fixed *outy)
{
u32 checkx, checky;
Fixed x, y, dim;
/* reverse to texture coords*/
x = INT2FIX(_x);
y = INT2FIX(_y);
gf_mx2d_apply_coords(&_this->smat, &x, &y);
checkx = checky = 0;
if (ABS(x)< FIX_ONE/20) checkx = 1;
if (ABS(y)< FIX_ONE/... | false | false | false | false | false | 0 |
visitAllocaInst(AllocaInst &I) {
if (isa<ConstantInt>(I.getArraySize()))
// This isn't undefined behavior, it's just an obvious pessimization.
Assert1(&I.getParent()->getParent()->getEntryBlock() == I.getParent(),
"Pessimization: Static alloca outside of entry block", &I);
// TODO: Check for an... | 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.