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 |
|---|---|---|---|---|---|---|
git_reference_name_to_id(
git_oid *out, git_repository *repo, const char *name)
{
int error;
git_reference *ref;
if ((error = git_reference_lookup_resolved(&ref, repo, name, -1)) < 0)
return error;
git_oid_cpy(out, git_reference_target(ref));
git_reference_free(ref);
return 0;
} | false | false | false | false | false | 0 |
obj_delivery()
{
register struct obj *otmp, *otmp2;
register int nx, ny;
long where;
for (otmp = migrating_objs; otmp; otmp = otmp2) {
otmp2 = otmp->nobj;
if (otmp->ox != u.uz.dnum || otmp->oy != u.uz.dlevel) continue;
obj_extract_self(otmp);
where = otmp->owornmask; /* destination code */
... | false | false | false | false | false | 0 |
up_device_to_text_history (UpDevice *device, GString *string, const gchar *type)
{
guint i;
GPtrArray *array;
UpHistoryItem *item;
/* get a fair chunk of data */
array = up_device_get_history_sync (device, type, 120, 10, NULL, NULL);
if (array == NULL)
return;
/* pretty print */
g_string_append_printf (stri... | false | false | false | false | false | 0 |
get_shaded_client_window_pos(
FvwmWindow *fw, rectangle *ret_g)
{
rectangle big_g;
size_borders b;
get_window_borders(fw, &b);
big_g = (IS_MAXIMIZED(fw)) ? fw->g.max : fw->g.normal;
get_relative_geometry(&big_g, &big_g);
switch (SHADED_DIR(fw))
{
case DIR_S:
case DIR_SW:
case DIR_SE:
ret_g->y = 1 - big_g.... | false | false | false | false | false | 0 |
e2_setup_block_mode(Epson_Scanner * s)
{
int maxreq;
DBG(5, "%s\n", __func__);
s->block = SANE_TRUE;
if (s->hw->connection == SANE_EPSON_SCSI)
maxreq = sanei_scsi_max_request_size;
else if (s->hw->connection == SANE_EPSON_USB)
maxreq = 128 * 1024;
else
maxreq = 32 * 1024;
/* XXX verify if this can b ex... | false | false | false | false | false | 0 |
io_error(void)
{
#ifndef WINCE
if(errno == EINTR)
return;
#endif
CELL error = tag_object(from_char_string(strerror(errno)));
general_error(ERROR_IO,error,F,NULL);
} | false | false | false | false | false | 0 |
from_local_8_bit(const std::string& s)
{
typedef codecvt<wchar_t, char, mbstate_t> facet_type;
return from_8_bit(s,
BOOST_USE_FACET(facet_type, locale()));
} | false | false | false | false | false | 0 |
gnc_sxes_del_sx(SchedXactions *sxes, SchedXaction *sx)
{
GList *to_remove;
to_remove = g_list_find(sxes->sx_list, sx);
if (to_remove == NULL)
return;
sxes->sx_list = g_list_delete_link(sxes->sx_list, to_remove);
qof_event_gen(&sxes->inst, GNC_EVENT_ITEM_REMOVED, (gpointer)sx);
} | false | false | false | false | false | 0 |
smoothStep(float x, float a, float b)
{
if (x < a) return(0.f);
if (x >= b) return(1.f);
x = (x - a)/(b - a); // normalize to [0:1]
return(x*x * (3.f - 2.f*x));
} | false | false | false | false | false | 0 |
insertDefsUses(MachineBasicBlock::iterator MI,
SmallSet<unsigned, 32>& RegDefs,
SmallSet<unsigned, 32>& RegUses)
{
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
const MachineOperand &MO = MI->getOperand(i);
if (!MO.isReg())
continue... | false | false | false | false | false | 0 |
attach(Interpreter *interp)
{
// ::attach can be called many times, so handle that
if (!m_contexts[interp])
m_contexts[interp] = new InterpreterContext;
KJS::Debugger::attach(interp);
} | false | false | false | false | false | 0 |
cfg_get_section(struct cfg_domain *domain, char *sname)
{
struct cfg_section *section;
section = cfg_find_section(domain,sname);
if (NULL == section) {
section = malloc(sizeof(*section));
memset(section,0,sizeof(*section));
section->name = strdup(sname);
INIT_LIST_HEAD(§ion->entries);
list_add_tai... | false | false | false | false | false | 0 |
mcprint(char *data, int len)
/* ship binary character data to the printer via mc4/mc5/mc5p */
{
char *mybuf, *switchon;
size_t onsize, offsize, res;
errno = 0;
if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) {
errno = ENODEV;
return (ERR);
}
if (prtr_non) {
switchon = TPARM_1(prtr_... | false | false | false | false | false | 0 |
discard_initial_data(void)
{
unsigned char tempbuf[4];
/* Do full startup discards when in pipe mode */
if (arguments->pipemode)
if (xread(tempbuf, sizeof tempbuf)) exit(EXIT_FAIL);
/* Bootstrap data for FIPS tests */
if (xread(tempbuf, sizeof tempbuf)) exit(EXIT_FAIL);
return tempbuf[0] | (tempbuf[1] << 8) ... | false | false | false | false | false | 0 |
registerFdEventHelper(FdEventHandlerPtr event)
{
int i;
int fd = event->fd;
for(i = 0; i < fdEventNum; i++)
if(poll_fds[i].fd == fd)
break;
if(i >= fdEventNum)
i = allocateFdEventNum(fd);
if(i < 0) {
free(event);
return NULL;
}
event->next = NUL... | false | false | false | false | false | 0 |
panel_parse_plugin(xconf *xc)
{
plugin_instance *plug = NULL;
gchar *type = NULL;
ENTER;
xconf_get_str(xconf_find(xc, "type", 0), &type);
if (!type || !(plug = plugin_load(type))) {
ERR( "fbpanel: can't load %s plugin\n", type);
return;
}
plug->panel = p;
XCG(xc, "ex... | false | false | false | false | false | 0 |
rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv,
u32 key_mgt)
{
DBG_8723A("%s, key_mgt = 0x%x\n", __func__, key_mgt);
if (key_mgt == WLAN_AKM_SUITE_8021X)
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
else if (key_mgt == WLAN_AKM_SUITE_PSK)
psecuritypriv->dot11AuthAlgrthm = dot1... | false | false | false | false | false | 0 |
sxgbe_common_interrupt(int irq, void *dev_id)
{
struct net_device *netdev = (struct net_device *)dev_id;
struct sxgbe_priv_data *priv = netdev_priv(netdev);
int status;
status = priv->hw->mac->host_irq_status(priv->ioaddr, &priv->xstats);
/* For LPI we need to save the tx status */
if (status & TX_ENTRY_LPI_MODE... | false | false | false | false | false | 0 |
paint(QPainter* p,
const QStyleOptionViewItem &option, int row)
{
// kError() << "KsirkChatItem::paint";
Q_UNUSED(row);
QTextDocument fake; // used to allow to compute lines height
fake.setHtml("gpl");
fake.setDefaultFont(option.font);
fake.adjustSize();
fake.setTextWidth ( -1 );
qr... | false | false | false | false | false | 0 |
open( int flags )
{
int res = base->open( flags );
if( res >= 0 )
lastFlags = flags;
return res;
} | false | false | false | false | false | 0 |
get_basefndecls (tree name, tree t)
{
tree methods;
tree base_fndecls = NULL_TREE;
int n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t));
int i;
/* Find virtual functions in T with the indicated NAME. */
i = lookup_fnfields_1 (t, name);
if (i != -1)
for (methods = (*CLASSTYPE_METHOD_VEC (t))[i];
... | false | false | false | false | false | 0 |
stv0680_get_video_mode(struct gspca_dev *gspca_dev)
{
/* Note not sure if this init of usb_buf is really necessary */
memset(gspca_dev->usb_buf, 0, 8);
gspca_dev->usb_buf[0] = 0x0f;
if (stv_sndctrl(gspca_dev, 0, 0x87, 0, 0x08) != 0x08) {
PERR("Get_Camera_Mode failed");
return stv0680_handle_error(gspca_dev, -E... | false | false | false | false | false | 0 |
invert (header *hd)
/***** invert
compute -matrix.
*****/
{ header *result,*st=hd;
hd=getvalue(hd);
if (error) return;
if (isinterval(hd))
result=map1i(interval_invert,hd);
else result=map1(real_invert,complex_invert,hd);
if (!error) moveresult(st,result);
} | false | false | false | false | false | 0 |
_get_serialnos(OggVorbis_File *vf, long **s, int *n){
ogg_page og;
*s=NULL;
*n=0;
while(1){
ogg_int64_t llret=_get_next_page(vf,&og,CHUNKSIZE);
if(llret==OV_EOF)return(0);
if(llret<0)return(llret);
if(!ogg_page_bos(&og)) return 0;
/* look for duplicate serialnos; add this one if unique */... | false | false | false | false | false | 0 |
prep_recalc (void)
{
int pnum;
char *variant;
/* eror messages should work in HTML mode (text/html) too */
if (recalc.mode == '-' || /* just recalc, no different provider */
recalc.mode == 'b' || /* do lcr with booked providers */
recalc.mode == 'B' ) /* do lcr with all providers */
return 1;
if (recalc... | false | false | false | false | false | 0 |
slap_sasl_getopt(
void *context,
const char *plugin_name,
const char *option,
const char **result,
unsigned *len)
{
if ( strcmp( option, "auxprop_plugin" )) {
return SASL_FAIL;
}
if ( slap_sasl_auxprops )
*result = slap_sasl_auxprops;
else
*result = "slapd";
return SASL_OK;
} | false | false | false | false | false | 0 |
gst_avdtp_find_caps(GstAvdtpSink *sink,
uint8_t codec_type)
{
struct bt_get_capabilities_rsp *rsp = sink->data->caps;
codec_capabilities_t *codec = (void *) rsp->data;
int bytes_left = rsp->h.length - sizeof(*rsp);
while (bytes_left > 0) {
if ((codec->type == codec_type) &&
!(codec->lock & BT_WRITE_LOC... | false | false | false | false | false | 0 |
autohelperowl_attackpat380(int trans, int move, int color, int action)
{
int a, b, c;
UNUSED(color);
UNUSED(action);
a = AFFINE_TRANSFORM(614, trans, move);
b = AFFINE_TRANSFORM(647, trans, move);
c = AFFINE_TRANSFORM(648, trans, move);
return !ATTACK_MACRO(a) && !play_attack_defend_n(OTHER_COLOR(color)... | false | false | false | false | false | 0 |
write_header (CamelStream *stream,
const gchar *name,
const gchar *value,
GCancellable *cancellable,
GError **error)
{
GString *buffer;
gssize n_written;
buffer = g_string_new (name);
g_string_append_c (buffer, ':');
if (!isspace (value[0]))
g_string_appen... | false | false | false | false | false | 0 |
file_resolve_path(const char *pathname) {
static Stream *s = 0;
if(!s)
s = new_stream(strlen(pathname) + strlen(FILE_SUBDIR) + 1);
if(!file_verify_path(pathname))
return NULL;
stream_add_string(s, FILE_SUBDIR);
if(pathname[0] == '/')
stream_add_string(s, pathname + 1);
else
stream_add_strin... | false | false | false | false | false | 0 |
closeEvent(QCloseEvent *e)
{
if (testSave()) {
theBoard.clearBoardLayout();
clean = true;
numTiles = 0;
statusChanged();
update();
// Save the window geometry.
Prefs::setEditorGeometry(geometry());
Prefs::self()->writeConfig();
e->accept();
... | false | false | false | false | false | 0 |
insns_safe_to_move_p (rtx from, rtx to, rtx *new_to)
{
int eh_region_count = 0;
int past_to_p = 0;
rtx r = from;
/* By default, assume the end of the region will be what was
suggested. */
if (new_to)
*new_to = to;
while (r)
{
if (GET_CODE (r) == NOTE)
{
switch (NOTE_LINE_NUMBER (r)... | false | false | false | false | false | 0 |
lbs_add_rates(u8 *rates)
{
size_t i;
for (i = 0; i < ARRAY_SIZE(lbs_rates); i++) {
u8 rate = lbs_rates[i].bitrate / 5;
if (rate == 0x02 || rate == 0x04 ||
rate == 0x0b || rate == 0x16)
rate |= 0x80;
rates[i] = rate;
}
return ARRAY_SIZE(lbs_rates);
} | false | false | false | false | false | 0 |
extractCylinder( const TPoint2D ¢er, const double radius, const double zmin, const double zmax, CPointsMap *outMap )
{
outMap->clear();
for( size_t k = 0; k < x.size(); k++ )
{
if( (z[k] <= zmax && z[k] >= zmin) && ( sqrt(square(center.x-x[k])+square(center.y-y[k])) < radius ) )
outMap->insertPoint( x[k], y... | false | false | false | false | false | 0 |
writememoryandtemporalcontents(map<string,int> &temporal)
{
cout<<"Memory:";
memory.write();
cout<<"temporal:";
for (map<string,int>::iterator it=temporal.begin();it!=temporal.end();it++) {
cout<<","<<it->first<<"="<<it->second;
}
cout<<endl;
} | false | false | false | false | false | 0 |
branch(Home home, const IntVarArgs& x,
IntVarBranch vars, IntValBranch vals,
IntBranchFilter bf, IntVarValPrint vvp) {
using namespace Int;
if (home.failed()) return BrancherHandle();
vars.expand(home,x);
ViewArray<IntView> xv(home,x);
ViewSel<IntView>* vs[1] = {
Branch::vi... | false | false | false | false | false | 0 |
gdt_table_get_header(gdt_table *t, int j)
{
const char * s = string_array_get(t->headers, j);
if (s == NULL) {
write_anonymous_header(t->header_temp, GDT_HEADER_TEMP_SIZE, j);
return t->header_temp;
}
return s;
} | false | false | false | false | false | 0 |
gen_memory_barrier (void)
{
rtx operand0;
rtx _val = 0;
start_sequence ();
{
rtx operands[1];
#line 34 "../../src/gcc/config/i386/sync.md"
{
operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
MEM_VOLATILE_P (operands[0]) = 1;
if (!(TARGET_64BIT || TARGET_SSE2))
{
emit_insn (gen_m... | false | false | false | false | false | 0 |
Scm_Compare(ScmObj x, ScmObj y)
{
ScmClass *cx, *cy;
/* Shortcut for typical case */
if (SCM_NUMBERP(x) && SCM_NUMBERP(y))
return Scm_NumCmp(x, y);
if (SCM_STRINGP(x) && SCM_STRINGP(y))
return Scm_StringCmp(SCM_STRING(x), SCM_STRING(y));
if (SCM_CHARP(x) && SCM_CHARP(y))
ret... | false | false | false | false | false | 0 |
plot_area(struct Map_info *P_map, int area, double shift)
{
struct line_pnts *Points;
int j, ret, ni, island;
/* allocate memory for coordinates */
Points = Vect_new_line_struct();
/* plot areas */
if (0 > (ret = Vect_get_area_points(P_map, area, Points))) {
if (ret == -1)
G_warning(_("R... | false | false | false | false | false | 0 |
FieldMult(unsigned char a, unsigned char b)
{
const unsigned char ReductionPoly = 0x3;
unsigned char x = a, ret = 0;
int i;
for(i = 0; i < 4; i++) {
if((b>>i)&1) ret ^= x;
if(x&0x8) {
x <<= 1;
x ^= ReductionPoly;
}
else x <<= 1;
}
return ret&WORDFILTER;
} | false | false | false | false | false | 0 |
cpuint_reset_cpu(int cpunum)
{
int irqline;
/* start with interrupts enabled, so the generic routine will work even if */
/* the machine doesn't have an interrupt enable port */
interrupt_enable[cpunum] = 1;
for (irqline = 0; irqline < MAX_IRQ_LINES; irqline++)
{
interrupt_vector[cpunum][irqline] = cp... | false | false | false | false | false | 0 |
setTextFont( const QFont &font )
{
Q_D( TextAnnotation );
if (!d->pdfAnnot)
{
d->textFont = font;
return;
}
if (d->pdfAnnot->getType() != Annot::typeFreeText)
return;
AnnotFreeText * ftextann = static_cast<AnnotFreeText*>(d->pdfAnnot);
GooString * da = TextAnnotati... | false | false | false | false | false | 0 |
findsent_forward(count, at_start_sent)
long count;
int at_start_sent; /* cursor is at start of sentence */
{
while (count--)
{
findsent(FORWARD, 1L);
if (at_start_sent)
find_first_blank(&curwin->w_cursor);
if (count == 0 || at_start_sent)
decl(&curwin->w_cursor);
at_start_sent = !at... | false | false | false | false | false | 0 |
skipoverword (bufp) /* Return pointer to end of a word */
register unsigned char *
bufp; /* Start of word -- MUST BE A REAL START */
{
register unsigned char *
lastboundary;
register int scharlen; /* Length of a string character */
lastboundary = NULL;
for ( ; ; )
{
if (*bufp == '\0'... | false | false | false | false | false | 0 |
f_sgn(union argument *arg)
{
struct value a;
(void) arg; /* avoid -Wunused warning */
(void) pop(&a);
switch (a.type) {
case INTGR:
push(Ginteger(&a, (a.v.int_val > 0) ? 1 :
(a.v.int_val < 0) ? -1 : 0));
break;
case CMPLX:
push(Ginteger(&a, (a.v.cmplx_val.real > 0.0) ? 1 :
... | false | false | false | false | false | 0 |
n_print (const char *format, ...)
{
va_list args;
if (_name)
g_print ("%s", _name);
va_start (args, format);
g_vprintf (format, args);
va_end (args);
} | false | false | false | false | false | 0 |
alloceinter (aMin, aMax)
long aMin, aMax;
{
struct eInter_s *newInter;
if (!(newInter = (struct eInter_s*)mbkalloc(sizeof (struct eInter_s)))) {
eprinth ("util_Inter.c");
eprintf ("Not enough memory to allcate an interval element.\n");
EXIT (1);
}
newInter->min = aMin;
newInter->max = aMax... | false | false | false | true | false | 1 |
splitNode(const SbOctTreeFuncs & itemfuncs)
{
SbBox3f childbox[8];
SbOctTreeNode::split3Way(this->nodesize, childbox);
int i;
for (i = 0; i < 8; i++) {
this->children[i] = new SbOctTreeNode(childbox[i]);
}
const int n = this->items.getLength();
for (i = 0; i < n; i++) {
void *item = this->items[i... | false | false | false | false | false | 0 |
init_main(void) {
make_function("BY", Lby);
make_si_function("ARGC", siLargc);
make_si_function("ARGV", siLargv);
#ifdef UNIX
make_si_function("GETENV", siLgetenv);
#endif
make_si_function("MARK-VS", siLmark_vs);
make_si_function("CHECK-VS", siLcheck_vs);
make_si_function("RESET-STACK-LIMITS", siLr... | false | false | false | false | false | 0 |
multLeft(const dimeMatrix &m) // this = m * this
{
dimeMatrix copy = *this;
dxfdouble (*mat1)[4] = (dxfdouble (*)[4])m.matrix;
dxfdouble (*mat2)[4] = (dxfdouble (*)[4])copy.matrix;
int i, j, n;
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
matrix[i][j] = 0.0f;
for (n = 0; n < 4; ... | false | false | false | false | false | 0 |
ExecInitJunkFilter(List *targetList, bool hasoid, TupleTableSlot *slot)
{
JunkFilter *junkfilter;
TupleDesc cleanTupType;
int cleanLength;
AttrNumber *cleanMap;
ListCell *t;
AttrNumber cleanResno;
/*
* Compute the tuple descriptor for the cleaned tuple.
*/
cleanTupType = ExecCleanTypeFromTL(targetList,... | false | false | false | false | false | 0 |
translateSpecialNumberInverse(const scpi_special_number_def_t * specs, scpi_special_number_t type) {
int i;
if (specs == NULL) {
return NULL;
}
for (i = 0; specs[i].name != NULL; i++) {
if (specs[i].type == type) {
return specs[i].name;
}
}
return NULL;... | false | false | false | false | false | 0 |
find_mci_by_dev(struct device *dev)
{
struct mem_ctl_info *mci;
struct list_head *item;
edac_dbg(3, "\n");
list_for_each(item, &mc_devices) {
mci = list_entry(item, struct mem_ctl_info, link);
if (mci->pdev == dev)
return mci;
}
return NULL;
} | false | false | false | false | false | 0 |
setDataToUi()
{
Core::ISettings *s = settings();
previewer->setHeaderHtml(s->value(DrugsDB::Constants::S_USERHEADER).toString());
previewer->setFooterHtml(s->value(DrugsDB::Constants::S_USERFOOTER).toString());
previewer->setWatermarkHtml(s->value(DrugsDB::Constants::S_WATERMARK_HTML).toString());
p... | false | false | false | false | false | 0 |
ath6kl_recovery_resume(struct ath6kl *ar)
{
if (!ar->fw_recovery.enable)
return;
clear_bit(RECOVERY_CLEANUP, &ar->flag);
if (!ar->fw_recovery.hb_poll)
return;
ar->fw_recovery.hb_pending = false;
ar->fw_recovery.seq_num = 0;
ar->fw_recovery.hb_misscnt = 0;
mod_timer(&ar->fw_recovery.hb_timer,
jiffies +... | false | false | false | false | false | 0 |
_e2_edftdlg_focus_in_cb (GtkWidget *treeview,
GdkEventFocus *event, E2_FileTypeDlgRuntime *rt)
{
if (treeview == rt->views[E2_CATPANE])
rt->currentID = E2_CATPANE;
else if (treeview == rt->views[E2_EXTPANE])
rt->currentID = E2_EXTPANE;
else
rt->currentID = E2_CMDPANE;
GtkTreeIter iter;
if (!_e2_edftdlg_find... | false | false | false | false | false | 0 |
ar9003_hw_init_txpower_cck(struct ath_hw *ah, u8 *rate_array)
{
ah->tx_power[0] = rate_array[ALL_TARGET_LEGACY_1L_5L];
ah->tx_power[1] = rate_array[ALL_TARGET_LEGACY_1L_5L];
ah->tx_power[2] = min(rate_array[ALL_TARGET_LEGACY_1L_5L],
rate_array[ALL_TARGET_LEGACY_5S]);
ah->tx_power[3] = min(rate_array[ALL_TA... | false | false | false | false | false | 0 |
input_data_mixed_double (const guint8 * _in, gfloat * out, guint len,
guint channels, gfloat max_value, guint op, guint nfft)
{
guint i, j, ip = 0;
gfloat v;
gdouble *in = (gdouble *) _in;
for (j = 0; j < len; j++) {
v = in[ip++];
for (i = 1; i < channels; i++)
v += in[ip++];
out[op] = v ... | false | false | false | false | false | 0 |
hackrf_copy_stream(struct hackrf_dev *dev, void *dst, void *src,
unsigned int src_len)
{
memcpy(dst, src, src_len);
/* calculate sample rate and output it in 10 seconds intervals */
if (unlikely(time_is_before_jiffies(dev->jiffies_next))) {
#define MSECS 10000UL
unsigned int msecs = jiffies_to_msecs(j... | false | false | false | false | false | 0 |
setValueToken(unsigned i, Text &text,
AttributeContext &context,
unsigned &specLength)
{
AttributeValue *value = def(i)->makeValueFromToken(text, context,
specLength);
if (def(i)->isConref())
conref_ = 1;
vec_[i].setValue(value);
if (value)
vec_[i].setSemantics(def(i)->makeSemanti... | false | false | false | false | false | 0 |
ceph_init_file(struct inode *inode, struct file *file, int fmode)
{
struct ceph_file_info *cf;
int ret = 0;
struct ceph_inode_info *ci = ceph_inode(inode);
struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb);
struct ceph_mds_client *mdsc = fsc->mdsc;
switch (inode->i_mode & S_IFMT) {
case S_IFREG:
/* ... | false | false | false | false | true | 1 |
globus_l_gfs_getpwuid(
uid_t uid)
{
int rc;
int pw_buflen;
char * pw_buffer;
struct passwd pwent_mem;
struct passwd * pw_result;
... | false | false | false | false | false | 0 |
do_enumerate (GVfsBackend *backend,
GVfsJobEnumerate *job,
const char *filename,
GFileAttributeMatcher *attribute_matcher,
GFileQueryInfoFlags flags)
{
GFile *file;
GFileInfo *info;
GError *error;
GFileEnumerator *enumerator;
gboolean res;
g_pri... | false | false | false | false | false | 0 |
i915_error_state_free(struct kref *error_ref)
{
struct drm_i915_error_state *error = container_of(error_ref,
typeof(*error), ref);
int i;
for (i = 0; i < ARRAY_SIZE(error->ring); i++) {
i915_error_object_free(error->ring[i].batchbuffer);
i915_error_object_free(error->ring[i].wa_batchbuffer);
i915_err... | false | false | false | false | false | 0 |
_scriptBreak(GR_PangoRenderInfo &ri)
{
UT_return_val_if_fail(ri.m_pText && ri.m_pGlyphs && ri.m_pItem, false);
GR_CairoPangoItem * pItem = (GR_CairoPangoItem*)ri.m_pItem;
// fill the static buffer with UTF8 text
UT_return_val_if_fail(ri.getUTF8Text(), false);
// the buffer has to have at least one more slot tha... | false | false | false | false | false | 0 |
go()
{
if (!tfile || fflush(tfile) < 0 || ferror(tfile) < 0)
{
fail(strerror(errno));
return;
}
if (!checkServer())
return;
PostTask *p=new PostTask(origCallback, *myServer, tfile);
if (!p)
{
fail(strerror(errno));
return;
}
try {
myServer->installTask(p);
tfile=NULL;
origCallback=NULL;
} ... | false | false | false | false | false | 0 |
set_attribs( FL_OBJECT * obj,
int boxtype,
int col1,
int col2,
int lcol,
int align,
int lsize,
int lstyle,
const char * label )
{
obj->boxtype = box... | false | false | false | false | false | 0 |
gwy_tool_level3_set_zero_changed(GtkToggleButton *check,
GwyToolLevel3 *tool)
{
tool->args.set_zero = gtk_toggle_button_get_active(check);
if (tool->args.instant_apply)
gwy_tool_level3_apply(tool);
} | false | false | false | false | false | 0 |
standby()
{
mMips->setActive(true);
const QColor black(50,50,50);
const QColor white(255,255,255);
QBrush blackBrush(black);
QBrush whiteBrush(black);
QPalette blackPalette(white, black);
QPalette whitePalette(white, white);
this->setPalette(whitePalette);
this->setAutoFillB... | false | false | false | false | false | 0 |
WriteBuildFileTop()
{
// We do that only once for the top CMakeLists.txt file.
if(!this->isRootMakefile())
return;
// For the build file.
this->WriteProjectHeader(this->GetBuildFileStream());
this->WriteNinjaFilesInclusion(this->GetBuildFileStream());
// For the rule file.
this->WriteProjectHeader(t... | false | false | false | false | false | 0 |
driveOrder(char move)
{
if (canDrive()) {
if (m_symbols.getLeft() == move) {
return goLeft();
}
if (m_symbols.getRight() == move) {
return goRight();
}
if (m_symbols.getUp() == move) {
return goUp();
}
if (m_symbols.getDown(... | false | false | false | false | false | 0 |
ad7816_probe(struct spi_device *spi_dev)
{
struct ad7816_chip_info *chip;
struct iio_dev *indio_dev;
unsigned short *pins = spi_dev->dev.platform_data;
int ret = 0;
int i;
if (!pins) {
dev_err(&spi_dev->dev, "No necessary GPIO platform data.\n");
return -EINVAL;
}
indio_dev = devm_iio_device_alloc(&spi_de... | false | false | false | false | false | 0 |
CmpNoCase(const CServerPath &op) const
{
if (m_bEmpty != op.m_bEmpty)
return 1;
else if (m_data->m_prefix != op.m_data->m_prefix)
return 1;
else if (m_type != op.m_type)
return 1;
if (m_data->m_segments.size() > op.m_data->m_segments.size())
return 1;
else if (m_data->m_segments.size() < op.m_data->m_segm... | false | false | false | false | false | 0 |
send_text_status(struct unistimsession *pte, const char *text)
{
BUFFSEND;
int i;
if (unistimdebug) {
ast_verb(0, "Sending status text\n");
}
if (pte->device) {
if (pte->device->status_method == 1) { /* For new firmware and i2050 soft phone */
int n = strlen(text);
/* Must send individual button separat... | false | false | false | false | false | 0 |
UpdateChunks() {
if (!pResourceListChunk) return;
// make sure INFO list chunk exists
RIFF::List* lstINFO = pResourceListChunk->GetSubList(LIST_TYPE_INFO);
String defaultName = "";
String defaultCreationDate = "";
String defaultSoftware = "";
String defaultCom... | false | false | false | false | false | 0 |
policy_has_boost_freq(struct cpufreq_policy *policy)
{
struct cpufreq_frequency_table *pos, *table = policy->freq_table;
if (!table)
return false;
cpufreq_for_each_valid_entry(pos, table)
if (pos->flags & CPUFREQ_BOOST_FREQ)
return true;
return false;
} | false | false | false | false | false | 0 |
translateSyntaxNoSwitch(SdBuilder &sdBuilder,
WideChar syntaxChar, Char &docChar,
Number &count)
{
Number n;
StringC str;
CharsetDeclRange::Type type;
const PublicId *id;
if (sdBuilder.sd->internalCharsetIsDocCharset()
&& sdBuilder.syntaxCharsetDecl.getCharInfo(syntaxChar,
id,
... | false | false | false | false | false | 0 |
_sequence_definition_free(struct bt_definition *definition)
{
struct definition_sequence *sequence =
container_of(definition, struct definition_sequence, p);
struct bt_definition *len_definition = &sequence->length->p;
uint64_t i;
if (sequence->string)
(void) g_string_free(sequence->string, TRUE);
if (sequenc... | false | false | false | false | false | 0 |
test_reset_hard__resetting_reverts_modified_files(void)
{
git_buf path = GIT_BUF_INIT, content = GIT_BUF_INIT;
int i;
static const char *files[4] = {
"current_file",
"modified_file",
"staged_new_file",
"staged_changes_modified_file" };
static const char *before[4] = {
"current_file\n",
"modified_file\nm... | true | true | false | false | false | 1 |
OnKeyUp( wxKeyEvent &event )
{
if (m_finished)
{
event.Skip();
return;
}
// auto-grow the textctrl:
wxSize parentSize = m_owner->GetSize();
wxPoint myPos = m_text->GetPosition();
wxSize mySize = m_text->GetSize();
int sx, sy;
m_text->GetTextExtent(m_text->GetValue() ... | false | false | false | false | false | 0 |
ssl3_GetCurveNameForServerSocket(sslSocket *ss)
{
SECKEYPublicKey * svrPublicKey = NULL;
ECName ec_curve = ec_noName;
int signatureKeyStrength = 521;
int requiredECCbits = ss->sec.secretKeyBits * 2;
if (ss->ssl3.hs.kea_def->kea == kea_ecdhe_ecdsa) {
svrPublicKey = SSL_GET_SERVER_PUBLI... | false | false | false | false | false | 0 |
qt_ignore_sigpipe()
{
static QBasicAtomicInt atom = Q_BASIC_ATOMIC_INITIALIZER(0);
if (atom.testAndSetRelaxed(0, 1)) {
struct sigaction noaction;
memset(&noaction, 0, sizeof(noaction));
noaction.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &noaction, 0);
}
} | false | false | false | false | false | 0 |
dump_payload(packet_t *pkt)
{
char holder[PAYLOAD_SIZE];
int bytes;
/* Quit if we're in minimal mode */
if (my_args->m)
return;
/* Set the layer */
set_layer(LAYER_APPLICATION);
/* display announcement */
display_header_banner("Payload");
/* The rest of the packet is payload, so lets grab... | true | true | false | false | false | 1 |
convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
{
struct nesting_info *const info = (struct nesting_info *) wi->info;
bool need_chain = false, need_stmts = false;
tree clause, decl;
int dummy;
bitmap new_suppress;
new_suppress = BITMAP_GGC_ALLOC ();
bitmap_copy (new_suppress, inf... | false | false | false | false | false | 0 |
cl5_operation_parameters_done (struct slapi_operation_parameters *sop)
{
if(sop!=NULL) {
switch(sop->operation_type)
{
case SLAPI_OPERATION_BIND:
slapi_ch_free((void **)&(sop->p.p_bind.bind_saslmechanism));
if (sop->p.p_bind.bind_creds)
ber_bvecfree((struct berval**)&(sop->p.p_bind.bind_creds));
if... | false | false | false | false | false | 0 |
dwReceivePermanently(dwDevice_t* dev, bool val) {
dev->permanentReceive = val;
if(val) {
// in case permanent, also reenable receiver once failed
dwSetReceiverAutoReenable(dev, true);
dwWriteSystemConfigurationRegister(dev);
}
} | false | false | false | false | false | 0 |
send (Message_ptr m)
{
// Simulate message loss and reordering.
//
if (params_.simulator ())
{
if ((ACE_OS::rand () % 17) != 0)
{
Lock l (mutex_);
if (hold_.get ())
{
send_ (m);
send_ (hold_);
hold_ = Message_ptr (0);
}
... | false | false | false | false | false | 0 |
ezxml_vget(ezxml_t xml, va_list ap)
{
char *name = va_arg(ap, char *);
int idx = -1;
if (name && *name) {
idx = va_arg(ap, int);
xml = ezxml_child(xml, name);
}
return (idx < 0) ? xml : ezxml_vget(ezxml_idx(xml, idx), ap);
} | false | false | false | false | false | 0 |
file_depth ( char * file ) {
int len, kk, depth;
len = strlen(file);
if (len)
len--; // Avoid ending '/'
for (kk = 0, depth = 0; kk < len; kk++) {
if (file[kk] == '/')
depth++;
}
return depth;
} | false | false | false | false | false | 0 |
CascadeExponentiate(const Integer &x, const Integer &e1, const Integer &y, const Integer &e2) const
{
if (m_modulus.IsOdd())
{
MontgomeryRepresentation dr(m_modulus);
return dr.ConvertOut(dr.CascadeExponentiate(dr.ConvertIn(x), e1, dr.ConvertIn(y), e2));
}
else
return AbstractRing<Integer>::CascadeExponentiat... | false | false | false | false | false | 0 |
e_cal_client_generate_instances_sync (ECalClient *client,
time_t start,
time_t end,
ECalRecurInstanceFn cb,
gpointer cb_data)
{
GSList *objects = NULL;
g_return_if_f... | false | false | false | false | false | 0 |
sccnxp_console_write(struct console *co, const char *c, unsigned n)
{
struct sccnxp_port *s = (struct sccnxp_port *)co->data;
struct uart_port *port = &s->port[co->index];
unsigned long flags;
spin_lock_irqsave(&s->lock, flags);
uart_console_write(port, c, n, sccnxp_console_putchar);
spin_unlock_irqrestore(&s->l... | false | false | false | false | false | 0 |
brw_gs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
{
struct brw_context *brw = brw_context(ctx);
struct brw_gs_prog_key key;
uint32_t old_prog_offset = brw->gs.base.prog_offset;
struct brw_gs_prog_data *old_prog_data = brw->gs.prog_data;
bool success;
if (!prog->_LinkedShaders[... | false | false | false | false | false | 0 |
e1000_update_nvm_checksum_generic(struct e1000_hw *hw)
{
s32 ret_val;
u16 checksum = 0;
u16 i, nvm_data;
DEBUGFUNC("e1000_update_nvm_checksum");
for (i = 0; i < NVM_CHECKSUM_REG; i++) {
ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
if (ret_val) {
DEBUGOUT("NVM Read Error while updating checksum.\n");
... | false | false | false | false | false | 0 |
screen_word (const zchar *s)
{
zchar c;
while ((c = *s++) != 0)
if (c == ZC_NEW_FONT)
s++;
else if (c == ZC_NEW_STYLE)
s++;
else
screen_char (c);
} | false | false | false | false | false | 0 |
md5_final(unsigned char *digest, MD5_CONTEXT *ctx)
{
if (!ctx->finalized)
do_final(ctx);
memcpy(digest, ctx->buf, 16);
} | false | false | false | false | false | 0 |
libbfio_file_seek_offset(
libbfio_file_io_handle_t *file_io_handle,
off64_t offset,
int whence,
libcerror_error_t **error )
{
static char *function = "libbfio_file_seek_offset";
if( file_io_handle == NULL )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
... | false | false | false | false | false | 0 |
add_cycle_to_list(
cycle *s_cycle, /* pointer to the cycle to be added to the list */
cycle_list *s_cycle_list /* input cycle list to be updated */
)
{
int c;
if ( ! simple_cycle(s_cycle) ) {
free_cycle(s_cycle);
return(s_cycle_list);
}
for ( c = 0; c < s_cycle_list->cnum; c... | false | false | false | false | false | 0 |
setBorderTile (const QString spriteKey, const int x, const int y)
{
int index = x * m_tilesHigh + y;
KGameRenderedItem * t = m_renderer->getBorderItem (spriteKey,
m_tiles.at(index));
m_tiles[index] = t;
if (t) {
s... | 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.