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 |
|---|---|---|---|---|---|---|
amdlibCopyRegionInfo(amdlibREGION *srcRegions,
amdlibREGION *dstRegions,
int nbRegions,
amdlibERROR_MSG errMsg)
{
int i, j;
/* For each regions */
for (i=0; i < nbRegions; i... | false | false | false | false | false | 0 |
adin_tcpip_standby(int freq, void *port_str)
{
int port;
port = atoi((char *)port_str);
if ((adinnet_sd = ready_as_server(port)) < 0) {
jlog("Error: adin_tcpip: cannot ready for server\n");
return FALSE;
}
jlog("Stat: adin_tcpip: ready for server\n");
return TRUE;
} | false | false | false | false | true | 1 |
gth_browser_activate_action_bookmarks_add (GtkAction *action,
GthBrowser *browser)
{
GBookmarkFile *bookmarks;
GFile *location;
char *uri;
location = gth_browser_get_location (browser);
if (location == NULL)
return;
bookmarks = gth_main_get_default_bookmarks ();
uri = g_file_get_uri... | false | false | false | false | false | 0 |
run()
{
SuspendFlags &s = SuspendFlags::getSuspendFlags();
while (true) {
if (s.getState() != SuspendFlags::NORMAL) {
SE_LOG_DEBUG(NULL, "terminating because of suspend or abort signal");
break;
}
if (m_operation &&
m_operation()) {
SE_LOG_... | false | false | false | false | false | 0 |
mouseReleaseEvent(QGraphicsSceneMouseEvent * /*event*/)
{
if (!m_pressed)
return;
m_pressed = false;
update();
emit clicked();
} | false | false | false | false | false | 0 |
new_mode (enum mode_class cl, const char *name,
const char *file, unsigned int line)
{
struct mode_data *m;
static unsigned int count = 0;
m = find_mode (name);
if (m)
{
error ("%s:%d: duplicate definition of mode \"%s\"",
trim_filename (file), line, name);
error ("%s:%d: previous defi... | false | false | false | false | false | 0 |
ext2_remount (struct super_block * sb, int * flags, char * data)
{
struct ext2_sb_info * sbi = EXT2_SB(sb);
struct ext2_super_block * es;
struct ext2_mount_options old_opts;
unsigned long old_sb_flags;
int err;
sync_filesystem(sb);
spin_lock(&sbi->s_lock);
/* Store the old options */
old_sb_flags = sb->s_fla... | false | false | false | false | false | 0 |
FuncSMALLEST_FIELD_VECFFE( Obj self, Obj vec)
{
Obj elm;
UInt deg,deg1,deg2,i,len,p,q;
UInt isVecFFE =IsVecFFE(vec);
len = LEN_PLIST(vec);
if (len == 0)
return Fail;
elm = ELM_PLIST(vec,1);
if (!isVecFFE && !IS_FFE(elm))
return Fail;
deg = DegreeFFE(elm);
p = CharFFE(elm);
for (i = 2; i <= ... | false | false | false | false | false | 0 |
mbfl_buffer_converter_new2(
const mbfl_encoding *from,
const mbfl_encoding *to,
int buf_initsz)
{
mbfl_buffer_converter *convd;
/* allocate */
convd = (mbfl_buffer_converter*)mbfl_malloc(sizeof (mbfl_buffer_converter));
if (convd == NULL) {
return NULL;
}
/* initialize */
convd->from = from;
convd->t... | false | false | false | false | false | 0 |
pos_in_clist(Clist lst, Topform c)
{
Clist_pos p = c->containers;
while (p && p->list != lst)
p = p->nocc;
return p;
} | false | false | false | false | false | 0 |
check_filter(dbcallback_i& cb, TABLE *table, const prep_stmt& pst,
const record_filter *filters, const uchar *filter_buf)
{
DBG_FILTER(fprintf(stderr, "check_filter\n"));
size_t pos = 0;
for (const record_filter *f = filters; f->op.begin() != 0; ++f) {
const string_ref& op = f->op;
const string_ref& val... | false | false | false | false | false | 0 |
getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
istringstream is(to_utf8(cmd.argument()));
string s;
is >> s;
if (s != "tabular")
break;
is >> s;
if (s == "add-vline-left" || s == "add-vline-right") {
flag.message(bforma... | false | false | false | false | false | 0 |
t1_hinter__adjust_stem_hints_by_missed_flex(t1_hinter * self, t1_glyph_space_coord g0,
t1_glyph_space_coord gm, int k)
{
/* While fixing a missed flex, a part of outline is shifted.
If there are stem hints pointing to that outline part, we need to move... | false | false | false | false | false | 0 |
output_comp_unit (dw_die_ref die, int output_if_empty)
{
const char *secname, *oldsym;
char *tmp;
htab_t extern_map;
/* Unless we are outputting main CU, we may throw away empty ones. */
if (!output_if_empty && die->die_child == NULL)
return;
/* Even if there are no children of this DIE, we must outp... | false | false | false | false | false | 0 |
Lispinput(std::istream& is, char* buf, int size) {
int res;
if(is) {
// If interactive, read line by line; otherwise read as much as we
// can gobble
if(CVC3::parserTemp->interactive) {
// Print the current prompt
std::cout << CVC3::parserTemp->getPrompt() << std::flush;
// Set the pro... | false | false | false | false | false | 0 |
checkAtoms() {
for (int i=0; root_prop_ids[i] != 0; ++i) {
if (root_prop_atoms[i] == None) {
root_prop_atoms[i] = XInternAtom(display(), root_prop_ids[i], False);
}
}
} | false | false | false | false | true | 1 |
gdl_dock_item_grip_destroy (GtkObject *object)
{
GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP (object);
if (grip->_priv) {
GdlDockItemGripPrivate *priv = grip->_priv;
if (priv->title_layout) {
g_object_unref (priv->title_layout);
priv->title_layout = NULL;
}
... | false | false | false | false | false | 0 |
find_writable_file(struct cifsInodeInfo *cifs_inode,
bool fsuid_only)
{
struct cifsFileInfo *open_file, *inv_file = NULL;
struct cifs_sb_info *cifs_sb;
struct cifs_tcon *tcon;
bool any_available = false;
int rc;
unsigned int refind = 0;
/* Having a null inode here (because mapping->host was set to zero by
... | false | false | false | false | false | 0 |
rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
{ /* exclude ICV */
/* Intermediate Buffers */
int length;
u8 *pframe, *prwskey; /* *payload,*iv */
struct sta_info *stainfo;
struct rx_pkt_attrib *prxattrib = &((struct recv_frame *)precvframe)->attrib;
struct security_priv *psecuritypriv = &padapter... | false | false | false | false | false | 0 |
process_ops(struct filter_pred *preds,
struct filter_pred *op, void *rec)
{
struct filter_pred *pred;
int match = 0;
int type;
int i;
/*
* Micro-optimization: We set type to true if op
* is an OR and false otherwise (AND). Then we
* just need to test if the match is equal to
* the type, and if it... | false | false | false | false | false | 0 |
Bootstrapper_add_to_archive(Bootstrapper *bs,
gchar *path){
register gchar *option, *command;
register gint ret_val;
register gchar *key, *tmp;
register gchar *ar = "ar",
*ar_init = "cSq", /* czr for OSF */
*ar_append = "Sq"; ... | false | false | false | false | false | 0 |
addresses (ulong mask) {
ulong ctr=1;
int i=32;
while (i-- > 0) {
if (! (mask & 1)) {
ctr += ctr;
}
mask >>= 1;
}
return ctr;
} | false | false | false | false | false | 0 |
wrap_sms_construct (GType object_type, struct sms* message, gint index) {
WrapSms* self = NULL;
gint _tmp0_ = 0;
struct sms* _tmp1_ = NULL;
struct sms* _tmp2_ = NULL;
enum sms_type _tmp3_ = 0;
g_return_val_if_fail (message != NULL, NULL);
self = (WrapSms*) g_type_create_instance (object_type);
_tmp0_ = index;
... | false | false | false | false | false | 0 |
modperl_interp_clone_init(modperl_interp_t *interp)
{
dTHXa(interp->perl);
MpInterpCLONED_On(interp);
PERL_SET_CONTEXT(aTHX);
/* XXX: hack for bug fixed in 5.6.1 */
if (PL_scopestack_ix == 0) {
ENTER;
}
/* clear @DynaLoader::dl_librefs so we only dlclose() those
* which are ... | false | false | false | false | false | 0 |
NewXMLObject(JSContext *cx, JSXML *xml)
{
JSObject *obj;
obj = js_NewObject(cx, &js_XMLClass, NULL, NULL);
if (!obj)
return NULL;
obj->setPrivate(xml);
METER(xml_stats.xmlobj);
return obj;
} | false | false | false | false | false | 0 |
addPolygonsByOptimizer(Polygons& polygons, GCodePathConfig* config)
{
PathOrderOptimizer orderOptimizer(lastPosition);
for(unsigned int i=0;i<polygons.size();i++)
orderOptimizer.addPolygon(polygons[i]);
orderOptimizer.optimize();
for(unsigned int i=0;i<orderOptimizer.polyOrder.size();i++)
{
... | false | false | false | false | false | 0 |
list_graphics_drivers()
{
int i = 0;
while (gfx_get_driver_name(i)) {
if (i != 0)
printf(", ");
printf("%s", gfx_get_driver_name(i));
i++;
}
printf("\n");
} | false | false | false | false | false | 0 |
P_SetPsprite(player_t * player, int position, statenum_t stnum)
{
pspdef_t *psp;
state_t *state;
psp = &player->psprites[position];
do
{
if (!stnum)
{ // Object removed itself.
psp->state = NULL;
break;
}
state = &states[... | false | false | false | false | false | 0 |
init_mwenv(int oldu)
{
char **ep, **nep;
/* Allow space for all the new ones plus null ont' end Count
existing ones assuming we find none. */
unsigned ecount = sizeof(purgenv)/sizeof(purgenv[0]) + 1;
for (ep = environ; *ep; ep++)
ecount++;
if (!(newenviron = (char **) malloc(ecount * sizeof(char *)))... | false | true | false | false | false | 1 |
AppendEnv(
std::vector<std::string>* env)
{
std::vector<std::string> origEnv = GetEnvironmentVariables();
if (env && env->size()>0)
{
std::vector<std::string>::const_iterator eit;
for (eit = env->begin(); eit!= env->end(); ++eit)
{
PutEnv(eit->c_str());
}
}
return origEnv;
} | false | false | false | false | false | 0 |
get_arrow_move(guint state, guint flag_pos, guint flag_neg)
{
guint flags;
flags = state & (flag_pos | flag_neg);
if (flags == (flag_pos | flag_neg) || flags == 0)
/* Both keys are pressed, or none => don't move. */
return 0.0;
if (state & flag_pos)
/* Left or up. */
r... | false | false | false | false | false | 0 |
appendTextToBuf(UT_GrowBuf & buf) const
{
if(getContainerType() == FL_CONTAINER_BLOCK)
{
const fl_BlockLayout * pBL = static_cast<const fl_BlockLayout *>(this);
pBL->appendTextToBuf(buf);
return;
}
const fl_ContainerLayout * pCL = getFirstLayout();
while(pCL)
{
pCL->appendTextToBuf(buf);
pCL = pCL->getN... | false | false | false | false | false | 0 |
niu_reset_rx_bmac(struct niu *np)
{
int limit;
nw64_mac(BRXMAC_SW_RST, BRXMAC_SW_RST_RESET);
limit = 1000;
while (--limit >= 0) {
if (!(nr64_mac(BRXMAC_SW_RST) & BRXMAC_SW_RST_RESET))
break;
udelay(100);
}
if (limit < 0) {
dev_err(np->device, "Port %u RX BMAC would not reset, BRXMAC_SW_RST[%llx]\n",
... | false | false | false | false | false | 0 |
register_lm_open_cb(LmConnection *connection, gboolean success,
gpointer user_data)
{
struct register_data *rd;
rd = user_data;
if (!success)
goto err;
rd->handler = lm_message_handler_new(handle_register, rd, NULL);
send_register(rd);
return;
err:
signal_emit("xmpp registration failed", 3, rd->username... | false | false | false | false | false | 0 |
sb_tagged_write_clause_jmap(String_buf sb, Topform c, I3list map)
{
Term t;
if (c->compressed)
t = NULL;
else
t = topform_to_term(c);
if (c->id != 0) {
/* BV(2007-jul-13) */
sb_append(sb, "c ");
sb_append_id(sb, c->id, map);
sb_append(sb, " ");
}
if (t == NULL)
sb_appe... | false | false | false | false | false | 0 |
current_series_index (const DATASET *dset, const char *vname)
{
int v = -1;
if (dset != NULL && vname != NULL && *vname != '\0') {
v = series_index(dset, vname);
if (v >= dset->v) {
v = -1;
}
}
return v;
} | false | false | false | false | false | 0 |
prio_add (priority_st * priority_list, unsigned int algo)
{
register int i = 0;
while (priority_list->priority[i] != 0)
{
if (algo == priority_list->priority[i])
return; /* if it exists */
i++;
}
if (i < MAX_ALGOS)
{
priority_list->priority[i] = algo;
p... | false | false | false | false | false | 0 |
GetIntDefault(const char* name, int32 def)
{
ACE_TString val;
return GetValueHelper(mConf, name, val) ? atoi(val.c_str()) : def;
} | false | false | false | false | false | 0 |
ECPGresultByDescriptor(int line, const char *name)
{
PGresult **resultpp = ECPGdescriptor_lvalue(line, name);
if (resultpp)
return *resultpp;
return NULL;
} | false | false | false | false | false | 0 |
wl1271_reg_notify(struct wiphy *wiphy,
struct regulatory_request *request)
{
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
struct wl1271 *wl = hw->priv;
/* copy the current dfs region */
if (request)
wl->dfs_region = request->dfs_region;
wlcore_regdomain_config(wl);
} | false | false | false | false | false | 0 |
maxn (lua_State *L) {
lua_Number max = 0;
luaL_checktype(L, 1, LUA_TTABLE);
lua_pushnil(L); /* first key */
while (lua_next(L, 1)) {
lua_pop(L, 1); /* remove value */
if (lua_type(L, -1) == LUA_TNUMBER) {
lua_Number v = lua_tonumber(L, -1);
if (v > max) max = v;
}
}
lua_pushnumber(... | false | false | false | false | false | 0 |
getFibonacci(int n)
{
if(n == 0)
{
return 0;
}
if(n == 1)
{
return 1;
}
return ( (pow(PHI, n) - pow(PSI, n)) / (sqrt(5)) );
} | false | false | false | false | false | 0 |
wl1273_fm_vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *tuner)
{
struct wl1273_device *radio = video_get_drvdata(video_devdata(file));
struct wl1273_core *core = radio->core;
u16 val;
int r;
dev_dbg(radio->dev, "%s\n", __func__);
if (tuner->index > 0)
return -EINVAL;
strlcpy(tuner... | false | true | false | false | true | 1 |
tear_down_upload_document (UploadDocumentData *data, gconstpointer _test_params)
{
const UploadDocumentTestParams *test_params = _test_params;
gchar *trace_name;
/* The trace name needs to take the test parameters into account. */
trace_name = g_strdup_printf ("teardown-upload-document_%s-%s-%s-%s",
... | false | false | false | false | false | 0 |
dint (dnum)
double dnum;
{
double dn;
if (dnum < 0.0)
dn = -floor (-dnum);
else
dn = floor (dnum);
return (dn);
} | false | false | false | false | false | 0 |
alc5632_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{
struct snd_soc_codec *codec = codec_dai->codec;
u16 iface = 0;
/* set master/slave audio interface */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
iface = ALC5632_DAI_SDP_MASTER_MODE;
break;
case SND_SOC_DAIF... | false | false | false | false | false | 0 |
bcm_sysport_get_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
struct bcm_sysport_priv *priv = netdev_priv(dev);
int i;
if (netif_running(dev))
bcm_sysport_update_mib_counters(priv);
for (i = 0; i < BCM_SYSPORT_STATS_LEN; i++) {
const struct bcm_sysport_stats *s;
char *p;
... | false | false | false | false | false | 0 |
vtag_lookup(struct vtag *s, char const *key, enum vtag_lookup_mode mode, char *sep)
{
char *value;
GSList *slist;
size_t length = 0;
struct valuestore vs = {0, 0};
if (!(slist = slist_lookup(s, key)))
return NULL;
switch (mode) {
case VLM_FIRST:
return strdup(sl... | false | true | false | false | false | 1 |
printarcs(int i, dfa *d, FILE *fp)
{
arc *a;
state *s;
int j, k;
s = d->d_state;
for (j = 0; j < d->d_nstates; j++, s++) {
fprintf(fp, "static arc arcs_%d_%d[%d] = {\n",
i, j, s->s_narcs);
a = s->s_arc;
for (k = 0; k < s->s_narcs; k++, a++)
fprintf(fp... | false | false | false | false | false | 0 |
snd_dragonfly_quirk_db_scale(struct usb_mixer_interface *mixer,
struct usb_mixer_elem_info *cval,
struct snd_kcontrol *kctl)
{
/* Approximation using 10 ranges based on output measurement on hw v1.2.
* This seems close to the cubic mapping e.g. alsamixer uses. */
static const DECLARE_TLV_DB_RANGE(scale,... | false | false | false | false | false | 0 |
__aat2870_write(struct aat2870_data *aat2870, u8 addr, u8 val)
{
u8 msg[2];
int ret;
if (addr >= AAT2870_REG_NUM) {
dev_err(aat2870->dev, "Invalid address, 0x%02x\n", addr);
return -EINVAL;
}
if (!aat2870->reg_cache[addr].writeable) {
dev_err(aat2870->dev, "Address 0x%02x is not writeable\n",
addr);
r... | false | false | false | false | false | 0 |
history_filename(const wcstring &name, const wcstring &suffix)
{
wcstring path;
if (! path_get_config(path))
return L"";
wcstring result = path;
result.append(L"/");
result.append(name);
result.append(L"_history");
result.append(suffix);
return result;
} | false | false | false | false | false | 0 |
destroy(FontFamilyRep* r) {
for (int i = 0; i < r->count_; ++i) {
delete r->names_[i];
}
delete r->names_;
delete r->weights_;
delete r->slants_;
delete r->widths_;
delete r->sizes_;
} | false | false | false | false | true | 1 |
server_truncate (rpcsvc_request_t *req)
{
server_state_t *state = NULL;
call_frame_t *frame = NULL;
gfs3_truncate_req args = {{0,},};
int ret = -1;
int op_errno = 0;
... | false | false | false | false | false | 0 |
set_enum(const char *name, const confenum_t *tbl, int value)
{
char buf[32];
for ( ; tbl->string != 0 ; tbl++)
{
if (value == tbl->value)
{
set_string(name, tbl->string);
return;
}
}
snprintf(buf, sizeof(buf), "%d", value);
set_string(name, buf);
} | false | false | false | false | false | 0 |
SetDisplayed(bool d, bool immediately)
{
if (sg_Displayed == false && d == true && sg_DisplayStatus < .01)
sg_SpinStatus = eCoord(0, 1);
sg_Displayed = d;
if (immediately)
sg_DisplayStatus = d ? 1 : 0;
} | false | false | false | false | false | 0 |
do_file_groups(char* name)
{
int32 vg0_id, /* vgroup identifier */
vg1_id, /* vgroup identifier */
vg2_id, /* vgroup identifier */
file1_id; /* HDF file identifier */
/* create a HDF file */
if ((file1_id = Hopen (name, DFACC_CREATE, (int16)0))<0)
... | false | false | false | false | false | 0 |
kiocb_cancel(struct aio_kiocb *kiocb)
{
kiocb_cancel_fn *old, *cancel;
/*
* Don't want to set kiocb->ki_cancel = KIOCB_CANCELLED unless it
* actually has a cancel function, hence the cmpxchg()
*/
cancel = ACCESS_ONCE(kiocb->ki_cancel);
do {
if (!cancel || cancel == KIOCB_CANCELLED)
return -EINVAL;
o... | false | false | false | false | false | 0 |
sa_simplesearch(const sauchar_t *T, saidx_t Tsize,
const saidx_t *SA, saidx_t SAsize,
saint_t c, saidx_t *idx) {
saidx_t size, lsize, rsize, half;
saidx_t i, j, k, p;
saint_t r;
if(idx != NULL) { *idx = -1; }
if((T == NULL) || (SA == NULL) || (Tsize < 0) || (SAsize < 0)) { ret... | false | false | false | false | false | 0 |
ips_usrcmd(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb)
{
IPS_SG_LIST sg_list;
uint32_t cmd_busaddr;
METHOD_TRACE("ips_usrcmd", 1);
if ((!scb) || (!pt) || (!ha))
return (0);
/* Save the S/G list pointer so it doesn't get clobbered */
sg_list.list = scb->sg_list.list;
cmd_busaddr = scb->scb_busaddr;
... | false | false | false | false | false | 0 |
tei_id_chk_resp(struct FsmInst *fi, int event, void *arg)
{
struct teimgr *tm = fi->userdata;
u_char *dp = arg;
int tei;
tei = dp[3] >> 1;
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "identity check resp tei %d", tei);
if (tei == tm->l2->tei)
tm->rcnt++;
} | false | false | false | false | false | 0 |
PrintPercents(const int counts[4], int total) {
int s;
for (s = 0; s < 4; ++s) {
fprintf(stderr, "| %2d%%", 100 * counts[s] / total);
}
fprintf(stderr, "| %7d\n", total);
} | false | false | false | false | false | 0 |
VimosIfuGet2DWCSFromPointing
(double raVimos, double decVimos,
double posAngle,
cpl_size nxFibers, cpl_size nyFibers, double fiberSize,
double epoch, double equinox)
{
/* VIMOS IFU offset from the field center: */
/* 667" along x (West for PA=0, dec=0) */
/* 1.7" along -y (South for PA=0,... | false | false | false | false | false | 0 |
do_generate_vertex() {
set_master_generate(false);
do_generate_vertex_class();
do_generate_vertex_property_class(false);
if (FE.get_current_proc()->find_info_bool(GPS_FLAG_USE_EDGE_PROP)) do_generate_vertex_property_class(true);
do_generate_message_class();
} | false | false | false | false | false | 0 |
mkstraux(flg,str,len,mode)
int flg; /* fSTRING or fBYTESTRING */
char *str;
unsigned len;
int mode; /* mode = 0: string not moved during gc */
{
unsigned k;
struct strcell *ptr;
truc obj;
char *cpt;
if(mode)
obj = newobj(flg,SIZEOFSTRING(len),(trucptr *)&ptr);
else
obj = n... | false | false | false | false | true | 1 |
remove_irq(unsigned int irq, struct irqaction *act)
{
struct irq_desc *desc = irq_to_desc(irq);
if (desc && !WARN_ON(irq_settings_is_per_cpu_devid(desc)))
__free_irq(irq, act->dev_id);
} | false | false | false | false | false | 0 |
em_write_DNL (
PJENC_INST g,
int nlines) /* number of lines (raster rows) in the JPEG file */
{
PUT_MARKER(g, MARKER_DNL);
PUT_INT(g, 4); /* the length */
PUT_INT(g, nlines);
} | false | false | false | false | false | 0 |
readFragment(istream *ifs, UINT32 fragmentId,
OBMol *pmol, map<UINT32, int> &atoms,
list<cdBond> &bonds)
{
char errorMsg[BUFF_SIZE];
UINT16 tag;
UINT16 size;
UINT32 id;
//char u32[4];
int depth = 1;
cerr<<"Read... | false | false | false | false | false | 0 |
ensure_credentials_sync (GoaProvider *provider,
GoaObject *object,
gint *out_expires_in,
GCancellable *cancellable,
GError **error)
{
GoaIdentityServiceIdentity *identity;
GoaAccount ... | false | false | false | false | false | 0 |
ofono_read_contexts (NMModemOfono *self)
{
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
DBusGConnection *bus;
DBusGProxy *settings_proxy;
GHashTable *properties;
GError *error = NULL;
char *imsi = NULL;
nm_log_dbg (LOGD_MB, "in %s", __func__);
nm_log_info (LOGD_MB, "trying to read IMSI contex... | false | false | false | false | false | 0 |
remove_project_dir(PROJECT& p) {
int retval;
retval = client_clean_out_dir(p.project_dir(), "remove project dir");
if (retval) {
msg_printf(&p, MSG_INTERNAL_ERROR, "Can't delete file %s", boinc_failed_file);
return retval;
}
return remove_project_owned_dir(p.project_dir());
} | false | false | false | false | false | 0 |
tls_flush(struct wrap_io *wio)
{
struct gnutella_socket *s = wio->ctx;
socket_check(s);
if (s->tls.snarf) {
if (GNET_PROPERTY(tls_debug > 1)) {
g_debug("tls_flush: snarf=%zu host=%s fd=%d",
s->tls.snarf,
host_addr_port_to_string(s->addr, s->port), s->file_desc);
}
(void ) tls_write_intern(wio, N... | false | false | false | false | false | 0 |
attachment_delete(void){
int atn = atoi(PD("atn","0"));
char *zDocView;
struct tm *pTm;
time_t t;
char **az;
char zDate[200];
login_check_credentials();
throttle(1,1);
az = db_query("SELECT tn, size, date, user, mime, fname, description "
"FROM attachment WHERE atn=%d", atn);
if( az... | true | true | false | false | true | 1 |
morsekey_configure_event(GtkWidget *wdg,GdkEventConfigure *ev)
{
gdk_draw_drawable(morsekey_drawingarea->window,morsekey_gc,
sharedmem->doiambic?iambickey_bg_pixmap:straightkey_bg_pixmap,
0,0,0,0,morsekey_width,morsekey_height);
return(TRUE);
} | false | false | false | false | false | 0 |
work_area_style_write_xml(const output::pointer &fp, const char *name, work_area_style_ty *this_thing)
{
if (!this_thing)
return;
trace(("work_area_style_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing));
assert(name);
assert(((work_area_style_ty *)this_thing)->reference_coun... | false | false | false | false | false | 0 |
sp_color_hsl_to_rgb_floatv (float *rgb, float h, float s, float l)
{
if (s == 0) {
rgb[0] = l;
rgb[1] = l;
rgb[2] = l;
} else {
float v2;
if (l < 0.5) {
v2 = l * (1 + s);
} else {
v2 = l + s - l*s;
}
float v1 = 2*l - v2;
... | false | false | false | false | false | 0 |
on_show_system_colors_activate (GtkMenuItem *menuitem, gpointer user_data)
{
if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem)))
{
/* re-add the system colors */
add_rgb_file (get_system_file (), SYSTEM_COLOR);
}
else
{
/* hide the system colors. unfortunately we have to remove them
sin... | false | false | false | false | false | 0 |
InsertChild(w)
Widget w;
{
CandidatePanelWidget cpw = (CandidatePanelWidget)XtParent(w);
CompositeWidgetClass super = (CompositeWidgetClass)XtClass(cpw)->core_class.superclass;
String params[1];
Cardinal num_params;
if (!XtIsSubclass(w, convDisplayObjectClass)) {
params[0] = XtClass(cpw)->core_cla... | false | false | false | false | false | 0 |
ufraw_set_warning(ufraw_data *uf, const char *format, ...)
{
// Set warning only if no error was set before
if (uf->status != UFRAW_ERROR) uf->status = UFRAW_WARNING;
if (format != NULL) {
va_list ap;
va_start(ap, format);
char *message = g_strdup_vprintf(format, ap);
va_end(... | false | false | false | false | false | 0 |
gf_cli3_1_delete_volume_cbk (struct rpc_req *req, struct iovec *iov,
int count, void *myframe)
{
gf_cli_rsp rsp = {0,};
int ret = -1;
cli_local_t *local = NULL;
char *volname = NULL;
... | false | false | false | false | false | 0 |
wnck_tasklist_active_window_changed (WnckScreen *screen,
WnckWindow *previous_window,
WnckTasklist *tasklist)
{
WnckWindow *active_window;
WnckWindow *initial_window;
WnckTask *active_task = NULL;
/* FIXME: check for group modal window */
initial_window = act... | false | false | false | false | false | 0 |
rv3029c2_i2c_write_regs(struct i2c_client *client, u8 reg, u8 const buf[],
unsigned len)
{
if ((reg > RV3029C2_USR1_RAM_PAGE + 7) ||
(reg + len > RV3029C2_USR1_RAM_PAGE + 8))
return -EINVAL;
return i2c_smbus_write_i2c_block_data(client, reg, len, buf);
} | false | false | false | false | false | 0 |
do_pri_file(aufs_bindex_t bindex, struct file *file)
{
char a[32];
if (!file || IS_ERR(file)) {
dpri("f%d: err %ld\n", bindex, PTR_ERR(file));
return -1;
}
a[0] = 0;
if (bindex < 0
&& !IS_ERR_OR_NULL(file->f_path.dentry)
&& au_test_aufs(file->f_path.dentry->d_sb)
&& au_fi(file))
snprintf(a, s... | true | true | false | false | false | 1 |
vector_op_ceq(
vector* tgt, /*!< Target vector for storage of results */
const vector* left, /*!< Expression on left of greater-than-or-equal sign */
const vector* right /*!< Expression on right of greater-than-or-equal sign */
) { PROFILE(VECTOR_OP_CEQ);
bool retval; /* Return value for this functi... | false | false | false | false | false | 0 |
aa_str_alloc(int size, gfp_t gfp)
{
struct counted_str *str;
str = kmalloc(sizeof(struct counted_str) + size, gfp);
if (!str)
return NULL;
kref_init(&str->count);
return str->name;
} | false | false | false | false | false | 0 |
_parse_file_header(int fd, struct rm_file_header *file_header)
{
if (read(fd, file_header, sizeof(struct rm_file_header)) == -1) {
fprintf(stderr, "ERROR: could not read file header\n");
return -1;
}
if (memcmp(file_header->type, ".RMF", 4) != 0) {
fprintf(stderr, "ERROR: invalid he... | false | false | false | false | false | 0 |
debrief_buttons_init()
{
ui_button_info *b;
int i;
for ( i=0; i<NUM_BUTTONS; i++ ) {
b = &Buttons[gr_screen.res][i];
b->button.create( &Debrief_ui_window, "", b->x, b->y, 60, 30, 0 /*b->flags & REPEAT*/, 1 );
// set up callback for when a mouse first goes over a button
b->button.set_highlight_action( common... | false | false | false | false | false | 0 |
between(const MSDate& d1_,const MSDate& d2_) const
{ return MSBoolean(_date>=d1_._date&&_date<=d2_._date); } | false | false | false | false | false | 0 |
go_bezier_spline_to_path (GOBezierSpline *sp)
{
int i, j;
GOPath *path = go_path_new ();
go_path_move_to (path, sp->x[0], sp->y[0]);
for (i = j = 1; i < sp->n; i++, j += 3)
go_path_curve_to (path, sp->x[j], sp->y[j], sp->x[j+1], sp->y[j+1], sp->x[j+2], sp->y[j+2]);
if (sp->closed) {
go_path_curve_to (path, sp-... | false | false | false | false | false | 0 |
isLoopInvariant(const Loop *QueryLoop) const {
// Add recurrences are never invariant in the function-body (null loop).
if (!QueryLoop)
return false;
// This recurrence is variant w.r.t. QueryLoop if QueryLoop contains L.
if (QueryLoop->contains(L))
return false;
// This recurrence is invariant w.r.... | false | false | false | false | false | 0 |
newProgressOperation( QObject *sender, const QString &text, int maximum,
QObject *obj, const char *slot, Qt::ConnectionType type )
{
ProgressBar *newBar = new ProgressBar( 0 );
newBar->setDescription( text );
newBar->setMaximum( maximum );
connect( sender, SIGNA... | false | false | false | false | false | 0 |
seahorse_pgp_key_canonize_id (const gchar *keyid)
{
gchar *str;
GQuark id;
str = seahorse_pgp_key_calc_id (keyid, 0);
g_return_val_if_fail (str, 0);
id = g_quark_from_string (str);
g_free (str);
return id;
} | false | false | false | false | false | 0 |
mpn_tracea_file (const char *filename,
const mp_ptr *a, int count, mp_size_t size)
{
char *s;
int i;
TMP_DECL;
TMP_MARK;
s = (char *) TMP_ALLOC (strlen (filename) + 50);
for (i = 0; i < count; i++)
{
sprintf (s, "%s%d", filename, i);
mpn_trace_file (s, a[i], size);
... | false | false | false | false | false | 0 |
_sort_job_by_state(void *void1, void *void2)
{
int diff;
job_info_t *job1 = (job_info_t *) void1;
job_info_t *job2 = (job_info_t *) void2;
diff = strcmp(job_state_string(job1->job_state),
job_state_string(job2->job_state));
if (reverse_order)
diff = -diff;
return diff;
} | false | false | false | false | false | 0 |
iwl_check_abort_status(struct iwl_priv *priv,
u8 frame_count, u32 status)
{
if (frame_count == 1 && status == TX_STATUS_FAIL_RFKILL_FLUSH) {
IWL_ERR(priv, "Tx flush command to flush out all frames\n");
if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
queue_work(priv->workqueue, &priv->tx_flush);
}
} | false | false | false | false | false | 0 |
point_sl(Point *pt1, Point *pt2)
{
return (FPeq(pt1->x, pt2->x)
? (double) DBL_MAX
: (pt1->y - pt2->y) / (pt1->x - pt2->x));
} | false | false | false | false | false | 0 |
crypt_luksDump(struct crypt_options *options)
{
struct crypt_device *cd = NULL;
int r;
r = _crypt_init(&cd, CRYPT_LUKS1, options, 1, 0);
if(r < 0)
return r;
r = crypt_dump(cd);
crypt_free(cd);
return 0;
} | false | false | false | false | false | 0 |
glusterfs_translator_info_response_send (rpcsvc_request_t *req, int ret,
char *msg, dict_t *output)
{
gd1_mgmt_brick_op_rsp rsp = {0,};
gf_boolean_t free_ptr = _gf_false;
GF_ASSERT (req);
rsp.op_ret = ret;
rsp.op_errno = 0;... | false | false | false | false | false | 0 |
modeNumber(bool & cc, tcPDPtr parent,
const tPDVector & children) const {
long parentID = parent->id();
long id1 = children[0]->id();
long id2 = children[1]->id();
cc = false;
long out1 = _outgoing[0]->id();
long out2 = _outgoing[1]->id();
if( parentID == _incoming->id() &&
((id1 == out1... | false | false | false | false | false | 0 |
lockAndAdd
(
ThreadIdentifierRef aTid, Int aFlag
)
{
SemaphoreOperationStatus aStatus( SUCCESS );
//
// Wait on the semaphore or not, depending on
// flag
//
if( (aStatus = AbstractSemaphore::setLock( aFlag ) ) == SUCCESS )
{
// If we are... | 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.