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 |
|---|---|---|---|---|---|---|
picoLCD_get_key(Driver *drvthis)
{
PrivateData *p = drvthis->private_data;
lcd_packet keydata;
char *keystr = NULL;
int keys_read = 0;
int key_pass = 0;
int two_keys = 0;
debug(RPT_DEBUG, "%s: get_key start (timeout %d)",
drvthis->name, p->key_timeout);
while (! keys_read) {
get_key_event(p->lcd, &ke... | false | false | false | false | false | 0 |
serial_alloc_from_fragment (SgenFragment **previous, SgenFragment *frag, size_t size)
{
char *p = frag->fragment_next;
char *end = p + size;
if (end > frag->fragment_end)
return NULL;
frag->fragment_next = end;
if (frag->fragment_end - end < SGEN_MAX_NURSERY_WASTE) {
*previous = frag->next;
/* Clear th... | false | false | false | false | false | 0 |
SkelCopy(Skel *os)
{
Skel *s;
if (os == NULL) return (NULL);
s = OOGLNewE(Skel, "new SKEL");
*s = *os;
s->p = OOGLNewNE(float, os->nvert * os->pdim, "Skel vertices");
s->c = os->nc > 0 ? OOGLNewNE(ColorA, os->nc, "Skel colors") : NULL;
s->l = OOGLNewNE(Skline, os->nlines, "Skel lines");
s->vi = OOGL... | false | false | false | false | false | 0 |
k90_store_current_profile(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
int ret;
struct usb_interface *usbif = to_usb_interface(dev->parent);
struct usb_device *usbdev = interface_to_usbdev(usbif);
int profile;
if (kstrtoint(buf, 10, &profile))
return -EINVAL;
... | false | false | false | false | false | 0 |
tlv320aic23_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{
struct snd_soc_codec *codec = codec_dai->codec;
u16 iface_reg;
iface_reg = snd_soc_read(codec, TLV320AIC23_DIGT_FMT) & (~0x03);
/* set master/slave audio interface */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT... | false | false | false | false | false | 0 |
fs_hash_literal_crc64(const char *str, fs_rid attr)
{
uint64_t top;
if (!str) {
return 0;
}
top = crc64(str);
top ^= ((fs_rid)attr) >> 2;
top &= 0x7FFFFFFFFFFFFFFFLL;
return top;
} | false | false | false | false | false | 0 |
test_get_dates (TestCaseFixture *fixture,
gconstpointer user_data)
{
GList *loc;
TplEntity *entity;
entity = tpl_entity_new (ID, TPL_ENTITY_CONTACT, NULL, NULL);
tpl_log_manager_get_dates_async (fixture->manager,
fixture->account, entity, TPL_EVENT_MASK_ANY,
get_dates_async_cb, fixture);
g_m... | false | false | false | false | false | 0 |
bsdsocklib_SetSocketSignals (TrapContext *context)
{
struct socketbase *sb = get_socketbase (context);
BSDTRACE ((_T("SetSocketSignals(0x%08lx,0x%08lx,0x%08lx) -> "), m68k_dreg (regs, 0), m68k_dreg (regs, 1), m68k_dreg (regs, 2)));
sb->eintrsigs = m68k_dreg (regs, 0);
sb->eventsigs = m68k_dreg (regs, 1);
return ... | false | false | false | false | false | 0 |
changeLastStruxFmtNoUndo(PT_DocPosition dpos, PTStruxType pst,
const gchar ** attrs, const gchar ** props,
bool bSkipEmbededSections)
{
UT_return_val_if_fail (NULL != m_fragments.getFirst(), false);
pf_Frag * pf = m_fragments.findFirstFragBeforePos(dpos);
UT_return_val_if_fail ( pf, false )... | false | false | false | false | false | 0 |
applyInsertions()
{
le_int32 growAmount = fInsertionList->getGrowAmount();
if (growAmount == 0) {
return fGlyphCount;
}
le_int32 newGlyphCount = fGlyphCount + growAmount;
LEGlyphID *newGlyphs = (LEGlyphID *) LE_GROW_ARRAY(fGlyphs, newGlyphCount);
if (newGlyphs == NULL) {
// ... | false | false | false | false | false | 0 |
tea_test(void)
{
tea_key_t key;
tea_block_t value;
tea_block_t encrypted;
tea_block_t decrypted;
int i;
char in[80];
char out[80];
char recovered[80];
STATIC_ASSERT(sizeof(key.v) == TEA_KEY_SIZE);
STATIC_ASSERT(sizeof(value.v) == TEA_BLOCK_SIZE);
for (i = 0; i < 10; i++) {
int j;
bool randomized = FALS... | false | false | false | false | false | 0 |
gst_dialog_finalize (GObject *object)
{
GstDialog *dialog = GST_DIALOG (object);
GstDialogPrivate *priv = GST_DIALOG_GET_PRIVATE (dialog);
if (priv->builder)
g_object_unref (priv->builder);
if (priv->child)
gtk_widget_destroy (priv->child);
g_free (priv->title);
g_free (priv->widget_name);
g_slist_free (... | false | false | false | false | false | 0 |
netsnmp_external_event_info(int *numfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
{
netsnmp_large_fd_set lreadfds;
netsnmp_large_fd_set lwritefds;
netsnmp_large_fd_set lexceptfds;
netsnmp_large_fd_set_init(&lreadfds, FD_SETSIZE);
netsnmp_large_fd_set_init(&lwritefds, FD_SETSIZE);
netsnmp_large... | false | false | false | false | false | 0 |
drawbound(c)
Client *c;
{
int x, y, dx, dy;
ScreenInfo *s;
s = c->screen;
x = c->x;
y = c->y;
dx = c->dx;
dy = c->dy;
if (dx < 0) {
x += dx;
dx = -dx;
}
if (dy < 0) {
y += dy;
dy = -dy;
}
if (dx <= 2 || dy <= 2)
return;
XDrawRectangle(dpy, s->root, s->gc, x, y, dx-1, dy-1);
XDrawRectangle(dpy, ... | false | false | false | false | false | 0 |
elm_radio_state_value_set(Evas_Object *obj,
int value)
{
ELM_RADIO_CHECK(obj);
ELM_RADIO_DATA_GET(obj, sd);
sd->value = value;
if (sd->value == sd->group->value) _state_set(obj, EINA_TRUE);
else _state_set(obj, EINA_FALSE);
} | false | false | false | false | false | 0 |
g_safe_open(char *file, int fl)
{
int flags = fl;
int fd;
reopen:
fd = open(file, flags);
if (fd == -1 && errno == EPERM && (flags & O_NOATIME)) {
static int no_atime_warned;
if (!no_atime_warned) {
log(1, "WARNING: You can change the ownership of the maps to the same user for faster reading\n");
no_atime... | false | false | false | false | true | 1 |
fjes_irq_watch_task(struct work_struct *work)
{
struct fjes_adapter *adapter = container_of(to_delayed_work(work),
struct fjes_adapter, interrupt_watch_task);
local_irq_disable();
fjes_intr(adapter->hw.hw_res.irq, adapter);
local_irq_enable();
if (fjes_rxframe_search_exist(adapter, 0) >= 0)
napi_schedule(&a... | false | false | false | false | false | 0 |
clutter_bind_constraint_set_property (GObject *gobject,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ClutterBindConstraint *bind = CLUTTER_BIND_CONSTRAINT (gobject);
switch (... | false | false | false | false | false | 0 |
JimParseExprIrrational(struct JimParserCtx *pc)
{
const char *Tokens[] = { "NaN", "nan", "NAN", "Inf", "inf", "INF", NULL };
const char **token;
for (token = Tokens; *token != NULL; token++) {
int len = strlen(*token);
if (strncmp(*token, pc->p, len) == 0) {
pc->tstart = pc->p;... | false | false | false | false | false | 0 |
gst_base_parse_check_upstream (GstBaseParse * parse)
{
GstFormat fmt = GST_FORMAT_TIME;
gint64 stop;
if (gst_pad_query_peer_duration (parse->sinkpad, &fmt, &stop))
if (GST_CLOCK_TIME_IS_VALID (stop) && stop) {
/* upstream has one, accept it also, and no further updates */
gst_base_parse_set_durat... | false | false | false | false | false | 0 |
gegl_node_add_child (GeglNode *self,
GeglNode *child)
{
g_return_val_if_fail (GEGL_IS_NODE (self), NULL);
g_return_val_if_fail (GEGL_IS_NODE (child), NULL);
g_return_val_if_fail (child->priv->parent == NULL, NULL);
self->priv->children = g_slist_prepend (self->priv->children,
... | false | false | false | false | false | 0 |
emit_pattern_after (rtx pattern, rtx after, bool skip_debug_insns,
rtx (*make_raw) (rtx))
{
rtx prev = after;
if (skip_debug_insns)
while (DEBUG_INSN_P (prev))
prev = PREV_INSN (prev);
if (INSN_P (prev))
return emit_pattern_after_setloc (pattern, after, INSN_LOCATION (prev),
make_r... | false | false | false | false | false | 0 |
getBoreVector(FXint sx,FXint sy,FXVec3f& point,FXVec3f& dir){
FXVec3f p=eyeToWorld(screenToEye(sx,sy,(FXfloat)(diameter-distance)));
if(PARALLEL==projection)
point=eyeToWorld(screenToEye(sx,sy,0.0f));
else
point=eyeToWorld(FXVec3f(0.0f,0.0f,0.0f));
dir=normalize(p-point);
return TRUE;
} | false | false | false | false | false | 0 |
runcreate(int argc, char** argv) {
bool argbrk = false;
const char* path = NULL;
int32_t oflags = 0;
int32_t opts = 0;
for (int32_t i = 2; i < argc; i++) {
if (!argbrk && argv[i][0] == '-') {
if (!std::strcmp(argv[i], "--")) {
argbrk = true;
} else if (!std::strcmp(argv[i], "-otr")) {
... | false | false | false | false | false | 0 |
summary_update_status(SummaryView *summaryview)
{
GtkCMCTree *ctree = GTK_CMCTREE(summaryview->ctree);
GtkCMCTreeNode *node;
MsgInfo *msginfo;
summaryview->total_size =
summaryview->deleted = summaryview->moved = summaryview->copied = 0;
for (node = GTK_CMCTREE_NODE(GTK_CMCLIST(ctree)->row_list);
node != ... | false | false | false | false | false | 0 |
pdf_viewer_index_row_activated(GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer data)
{
GtkTreeIter iter;
GtkTreeModel *model = gtk_tree_view_get_model(tree_view);
PdfViewer *viewer = (PdfViewer *)data;
gint page_num = 0;
debug_print("index_row_activated\... | false | false | false | false | false | 0 |
on_menu_options_library_activate (GtkMenuItem *menuitem,
SpiceLibrary *spicelib)
{
GList *tmp;
GtkTreeIter iter;
if (spicelib->dialog == NULL) {
spicelib->store=gtk_list_store_new(1, G_TYPE_STRING);
for (tmp=g_list_first(spicelib->libs); tmp != NULL;
... | false | false | false | false | false | 0 |
findUpdateFiles(bool dirtyOnly)
{
QStringList result;
const QStringList list = KGlobal::dirs()->findAllResources("data", "kconf_update/*.upd",
KStandardDirs::NoDuplicates);
for (QStringList::ConstIterator it = list.constBegin();
it != list.constEnd();
++i... | false | false | false | false | false | 0 |
sram_remove(struct platform_device *pdev)
{
struct sram_dev *sram = platform_get_drvdata(pdev);
sram_free_partitions(sram);
if (gen_pool_avail(sram->pool) < gen_pool_size(sram->pool))
dev_err(sram->dev, "removed while SRAM allocated\n");
if (sram->clk)
clk_disable_unprepare(sram->clk);
return 0;
} | false | false | false | false | false | 0 |
isl_map_flatten(__isl_take isl_map *map)
{
int i;
if (!map)
return NULL;
if (!map->dim->nested[0] && !map->dim->nested[1])
return map;
map = isl_map_cow(map);
if (!map)
return NULL;
for (i = 0; i < map->n; ++i) {
map->p[i] = isl_basic_map_flatten(map->p[i]);
if (!map->p[i])
goto error;
}
map->d... | false | false | false | false | true | 1 |
HandleGiveDeckStatus(const cec_command &command)
{
if (m_processor->CECInitialised() && m_processor->IsHandledByLibCEC(command.destination))
{
CCECPlaybackDevice *device = CCECBusDevice::AsPlaybackDevice(GetDevice(command.destination));
if (device && device->TransmitDeckStatus(command.initiator, true))
... | false | false | false | false | false | 0 |
confirm_delete_directly (CommonJob *job,
GList *files)
{
char *prompt;
int file_count;
int response;
/* Just Say Yes if the preference says not to confirm. */
if (!should_confirm_trash ()) {
return TRUE;
}
file_count = g_list_length (files);
g_assert (file_count > 0);
if (can_delete_files_without_conf... | false | false | false | false | false | 0 |
fh_index (format_data_t form, int argc _GL_UNUSED_PARAMETER,
char *argv[] _GL_UNUSED_PARAMETER)
{
int indx = if_nametoindex (form->name);
if (indx == 0)
error (EXIT_FAILURE, errno,
"No index number found for interface `%s'",
form->name);
*column += printf ("%i", indx);
had_output = 1;
} | false | false | false | false | false | 0 |
check_derived_func (JPL_Class &cls, JPL_Function &func,
PointCutContext &context, Binding &binding, Condition &cond) {
Condition unused;
bool do_subclasses = true;
const set<int> &derived_classes = cls.derived_class_ids ();
for (set<int>::const_iterator i = derived_classes.begin ();
i != derived_classes.e... | false | false | false | false | false | 0 |
varies() const
{
loopv(vals) if(vals[i] != vals[0]) return true;
return false;
} | false | false | false | false | false | 0 |
decode_token(u16 token)
{
bool handy_flag = TRUE;
switch (token) {
case 0x0b5:
new_token();
break;
case 0x0b6: /* Named Token */
case 0x0ca: /* External Token */
named_token();
break;
case 0x012:
bquote();
break;
case 0x010:
blit();
break;
case 0x0cc:
offset16();
break;
case 0x013: ... | false | false | false | false | false | 0 |
AddDistance( wxChar const *name, std::vector<double> d,
bool setAsPercent, double min, double max )
{
GRA_distanceCharacteristic *dc =
new GRA_distanceCharacteristic(name,d,setAsPercent,min,max);
characteristics_.push_back( dc );
} | false | false | false | false | false | 0 |
res_dorange(struct sess *sp, const char *r, ssize_t *plow, ssize_t *phigh)
{
ssize_t low, high, has_low;
(void)sp;
if (strncmp(r, "bytes=", 6))
return;
r += 6;
/* The low end of range */
has_low = low = 0;
if (!vct_isdigit(*r) && *r != '-')
return;
while (vct_isdigit(*r)) {
has_low = 1;
low *= 10;
l... | false | false | false | false | false | 0 |
moh_release(struct ast_channel *chan, void *data)
{
struct mohdata *moh = data;
struct mohclass *class = moh->parent;
struct ast_format oldwfmt;
ao2_lock(class);
AST_LIST_REMOVE(&moh->parent->members, moh, list);
ao2_unlock(class);
close(moh->pipe[0]);
close(moh->pipe[1]);
ast_format_copy(&oldwfmt, &moh->... | false | false | false | false | false | 0 |
stPinchSegment_putSegmentFirstInBlock(stPinchSegment *segment) {
if(segment->block != NULL) {
if(segment->block->headSegment != segment) {
stPinchSegment *pBlockSegment = segment->block->headSegment;
while(pBlockSegment->nBlockSegment != segment) {
pBlockSegment = pBl... | false | false | false | false | false | 0 |
QtUtilGetTextSize (QPainter const *pPainter, QFont const *pFont, const QString &Str, int *pDx, int *pDy)
{
QFontMetrics *pFontMetrics;
QRect Rect;
CHK (QtUtilGetFontMetrics (pPainter, pFont, &pFontMetrics))
Rect = pFontMetrics->boundingRect(Str);
if (pDx) *pDx = Rect.width ();
if (pDy) *pDy... | false | false | false | false | false | 0 |
container_at(x, y, countem)
int x,y;
boolean countem;
{
struct obj *cobj, *nobj;
int container_count = 0;
for(cobj = level.objects[x][y]; cobj; cobj = nobj) {
nobj = cobj->nexthere;
if(Is_container(cobj)) {
container_count++;
if (!countem) break;
}
}
return container_count;
} | false | false | false | false | false | 0 |
strip_line(char *line)
{
char *p = line + strlen(line);
while (p > line && (p[-1] == '\n' || p[-1] == '\r'))
*p-- = 0;
} | false | false | false | false | false | 0 |
clocks_window_on_select_none_activate (ClocksWindow* self) {
GtkStack* _tmp0_ = NULL;
GtkWidget* _tmp1_ = NULL;
GtkWidget* _tmp2_ = NULL;
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->stack;
_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
_tmp2_ = _tmp1_;
clocks_clock_activate_select_none (G_TYPE_CHECK_I... | false | false | false | false | false | 0 |
saveSelection(Stream &stream) const
{
BitmapFinder bmFinder;
for (int i = 0; i < count(); ++i) {
if (select(i))
object(i)->accept(bmFinder);
}
stream << "<ipeselection>\n";
int id = 1;
for (std::vector<Bitmap>::const_iterator it = bmFinder.iBitmaps.begin();
it != bmFinder.iBitmaps.end(); ++... | false | false | false | false | false | 0 |
evaluateScript(const QString &URL, const DOMString &script)
{
if (m_evaluated || !isValidScript())
return;
KHTMLPart *part = document()->part();
if (part) {
KJSProxy *proxy = KJSProxy::proxy(part);
if (proxy) {
m_evaluated = true;
proxy->evaluate(URL, 0, scri... | false | false | false | false | false | 0 |
pixDisplayMultiple(const char *filepattern)
{
char buffer[L_BUF_SIZE];
#ifdef _WIN32
char pathname[MAX_PATH];
char *dir, *tail;
#endif /* _WIN32 */
PROCNAME("pixDisplayMultiple");
if (!filepattern || strlen(filepattern) == 0)
return ERROR_INT("filepattern not defined", procName, 1);
#ifndef _W... | false | false | false | false | false | 0 |
xmms_collection_foreach_in_namespace (xmms_coll_dag_t *dag, guint nsid, GHFunc f, void *udata)
{
gint i;
if (nsid == XMMS_COLLECTION_NSID_ALL) {
for (i = 0; i < XMMS_COLLECTION_NUM_NAMESPACES; ++i) {
g_hash_table_foreach (dag->collrefs[i], f, udata);
}
} else if (nsid != XMMS_COLLECTION_NSID_INVALID) {
g_h... | false | false | false | false | false | 0 |
compute_farthest (struct edge_list *edge_list, int n_exprs,
sbitmap *st_avout, sbitmap *st_avin, sbitmap *st_antin,
sbitmap *kill, sbitmap *farthest)
{
sbitmap difference, temp_bitmap;
int x, num_edges;
basic_block pred, succ;
num_edges = NUM_EDGES (edge_list);
difference = sbitmap_alloc (n_exprs);
... | false | false | false | false | false | 0 |
convert_and_write_fi(int fd, const FCELL * buf)
{
struct fileinfo *fcb = &G__.fileinfo[fd];
CELL *p = (CELL *) fcb->data;
int i;
for (i = 0; i < fcb->cellhd.cols; i++)
if (G_is_f_null_value(&buf[i]))
G_set_c_null_value(&p[i], 1);
else
p[i] = (CELL) buf[i];
return G_put_c_raster_row(fd,... | false | false | false | false | false | 0 |
translate_stringtable( po_file_t po, stringtable_t *stt,
language_t *lang, int *found )
{
stringtable_t *new, *head = NULL, *tail = NULL;
int i;
while (stt)
{
new = xmalloc( sizeof(*new) );
*new = *stt;
new->lvc.language = lang;
... | false | false | false | false | false | 0 |
post_Y(int *A,int *B,int pos){
if(A[pos]<0)
return B[pos];
if(B[pos]<0)
return A[pos];
return (A[pos]+B[pos])>>1;
} | false | false | false | false | false | 0 |
onMouseButtonDown(MouseEventArgs& e)
{
// base class processing
Window::onMouseButtonDown(e);
if (e.button == LeftButton)
{
// ensure all inputs come to us for now
if (captureInput())
{
// get position of mouse as co-ordinates local to this window.
Point localPos(CoordConverter::screenToWindow(*this, e... | false | false | false | false | false | 0 |
tour2d3_idle_func (displayd *dsp)
{
ggobid *gg = GGobiFromDisplay (dsp);
cpaneld *cpanel = &dsp->cpanel;
gboolean doit = !cpanel->t2d3.paused;
if (doit) {
tour2d3_run (dsp, gg);
gdk_flush ();
}
return (doit);
} | false | false | false | false | false | 0 |
on_rad_playlist_mode_toggled (GtkToggleButton *btn, GbemolPreferences *obj)
{
int mode = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (btn), "mode"));
if (gtk_toggle_button_get_active (btn))
{
gbemol_cfg_set_int ("playlist", "mode", mode);
gbemol_playlist_set_mode (obj->app->pls, mode);
}
} | false | false | false | false | false | 0 |
gal_a11y_e_cell_get_extents (AtkComponent *component,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type)
{
GalA11yECell *a11y = GAL_A11Y_E_CELL (component)... | false | false | false | false | false | 0 |
isCSECandidate(MachineInstr *MI) {
if (MI->isPosition() || MI->isPHI() || MI->isImplicitDef() || MI->isKill() ||
MI->isInlineAsm() || MI->isDebugValue())
return false;
// Ignore copies.
if (MI->isCopyLike())
return false;
// Ignore stuff that we obviously can't move.
if (MI->mayStore() || MI->... | false | false | false | false | false | 0 |
deserialize(Serialization_data &data){
Value *result=NULL;
if(data.flags>=SERIALIZED_STRING && data.flags<(SERIALIZED_STRING+256)){
// String->deserialize uses passed string
if(data.length>0)
data.ptr=pa_strdup(data.ptr, data.length);
result=deserialize_string(data);
}
if (!result)
throw Exception(PAR... | false | false | false | false | false | 0 |
mwifiex_misc_ioctl_gen_ie(struct mwifiex_private *priv,
struct mwifiex_ds_misc_gen_ie *gen_ie,
u16 action)
{
struct mwifiex_adapter *adapter = priv->adapter;
switch (gen_ie->type) {
case MWIFIEX_IE_TYPE_GEN_IE:
if (action == HostCmd_ACT_GEN_GET) {
gen_ie->len = priv->wpa_ie_len;
memcpy(gen... | false | true | false | false | false | 1 |
CM_InitBoxHull (void)
{
int i;
int side;
cnode_t *c;
cplane_t *p;
cbrushside_t *s;
box_headnode = numnodes;
box_planes = &map_planes[numplanes];
if (numnodes+6 > MAX_MAP_NODES
|| numbrushes+1 > MAX_MAP_BRUSHES
|| numleafbrushes+1 > MAX_MAP_LEAFBRUSHES
|| numbrushsides+6 > MAX_MAP_BRUSHS... | false | false | false | false | false | 0 |
arizona_extcon_hp_clamp(struct arizona_extcon_info *info,
bool clamp)
{
struct arizona *arizona = info->arizona;
unsigned int mask = 0, val = 0;
unsigned int cap_sel = 0;
int ret;
switch (arizona->type) {
case WM8998:
case WM1814:
mask = 0;
break;
case WM5110:
case WM8280:
mask = ARIZONA_HP1L_SH... | false | false | false | false | false | 0 |
fill_profile_combo (GtrWindow *window)
{
GSList *profiles, *l;
GtkWidget *menu_item;
const gchar *name;
profiles = gtr_profile_manager_get_profiles (window->priv->prof_manager);
for (l = profiles; l != NULL; l = g_slist_next (l))
{
GtrProfile *profile = GTR_PROFILE (l->data);
name = gtr_pro... | false | false | false | false | false | 0 |
vnl_solve_qp_non_neg_sum_one_step(const vnl_matrix<double>& H,
const vnl_vector<double>& g,
vnl_vector<double>& x,
vcl_vector<bool>& valid,
unsigned& n_valid)
{
/... | false | false | false | false | false | 0 |
WriteState(State *state) {
Symbol *endOf = state->endOf;
fwprintf(gen, L"\t\tcase %d:\n", state->nr);
if (existLabel[state->nr])
fwprintf(gen, L"\t\t\tcase_%d:\n", state->nr);
if (endOf != NULL && state->firstAction != NULL) {
fwprintf(gen, L"\t\t\trecEnd = pos; recKind = %d;\n", endOf->n);
}
bool ctxEnd = s... | false | false | false | false | false | 0 |
oc_destroy( void )
{
ObjectClass *o;
while( !LDAP_STAILQ_EMPTY(&oc_list) ) {
o = LDAP_STAILQ_FIRST(&oc_list);
LDAP_STAILQ_REMOVE_HEAD(&oc_list, soc_next);
oc_delete_names( o );
}
avl_free( oc_index, oc_destroy_one );
while( !LDAP_STAILQ_EMPTY(&oc_undef_list) ) {
o = LDAP_STAILQ_FIRST(&oc_undef_list);
... | false | false | false | false | false | 0 |
test_miditofreq()
{
smpl_t a, b;
fprintf(stdout, "b = aubio_miditofreq(a): [");
for ( a = -123.; a < 400.; a += 20. ) {
b = aubio_miditofreq(a);
fprintf(stdout, "(%.2f, %.2f), ", a, b);
}
b = aubio_miditofreq(a);
fprintf(stdout, "(%.2f, %.2f), ", a, b);
a = -69.5;
b = aubio_miditofreq(a);
fp... | false | false | false | false | false | 0 |
setNamespaceColumnVisibility(List *namespace, bool cols_visible)
{
ListCell *lc;
foreach(lc, namespace)
{
ParseNamespaceItem *nsitem = (ParseNamespaceItem *) lfirst(lc);
nsitem->p_cols_visible = cols_visible;
}
} | false | false | false | false | false | 0 |
ajBtreeWriteParamsS(const AjPBtcache cache, const AjPStr fn,
const AjPStr ext, const AjPStr idir)
{
AjPStr fname = NULL;
AjPFile outf = NULL;
fname = ajStrNewRes(128);
if(ajStrGetLen(idir))
ajFmtPrintS(&fname,"%S%s%S.p%S",idir,SLASH_STRING,fn,ext);
else
ajF... | false | false | false | false | false | 0 |
can_skip_filter_test(
Slapi_PBlock *pb,
struct slapi_filter *f,
int scope,
IDList *idl
)
{
int rc = 0;
/* Is the ID list ALLIDS ? */
if ( ALLIDS(idl)) {
/* If so, then can't optimize */
return rc;
}
/* Is this a base scope search? */
if ( scope == LDAP... | false | false | false | false | false | 0 |
stk500v2_set_sck_period(PROGRAMMER * pgm, double v)
{
unsigned int d;
unsigned char dur;
double f = 1 / v;
if (f >= 1.8432E6)
d = 0;
else if (f > 460.8E3)
d = 1;
else if (f > 115.2E3)
d = 2;
else if (f > 57.6E3)
d = 3;
else
d = (unsigned int)ceil(1 / (24 * f / (double)STK500V2_XTAL)... | false | false | false | false | false | 0 |
uart_clps711x_console_setup(struct console *co, char *options)
{
int baud = 38400, bits = 8, parity = 'n', flow = 'n';
int ret, index = co->index;
struct clps711x_port *s;
struct uart_port *port;
unsigned int quot;
u32 ubrlcr;
if (index < 0 || index >= UART_CLPS711X_NR)
return -EINVAL;
port = clps711x_uart.... | false | false | false | false | false | 0 |
freebox_found (FreeboxMonitor *mon,
const char *name,
GrlPlugin *plugin)
{
GrlFreeboxSource *source;
GrlRegistry *registry;
if (g_object_get_data (G_OBJECT (plugin), "source") != NULL)
return;
GRL_DEBUG ("Found a Freebox: %s", name);
source = grl_freebox_source_ne... | false | false | false | false | false | 0 |
eps_read_block_header(unsigned char *buf, int buf_size,
eps_block_header *hdr)
{
char *str;
/* Sanity checks */
if (!buf || !hdr) {
return EPS_PARAM_ERROR;
}
if (buf_size < 1) {
return EPS_PARAM_ERROR;
}
/* Extract first header field: block type *... | false | false | false | false | false | 0 |
escape(const char* text, char *bf, int len)
{
char *bfp = bf;
int multiline = strchr(text, '\n') != NULL;
int eol = 0;
int textlen = strlen(text);
if ((textlen > 0) && (text[textlen-1] == '\n'))
eol = 1;
*bfp++ = '"';
--len;
if (multiline) {
*bfp++ = '"';
*bfp++ = '\n';
*bfp++ = '"';
len -= 3;
}
... | false | false | false | false | false | 0 |
adv_unit_execute_path(struct unit *punit, struct pf_path *path)
{
const bool is_ai = unit_owner(punit)->ai_controlled;
int i;
/* We start with i = 1 for i = 0 is our present position */
for (i = 1; i < path->length; i++) {
struct tile *ptile = path->positions[i].tile;
int id = punit->id;
if (same_... | false | false | false | false | false | 0 |
ipmi_oem_dell_reset_power_consumption_data (ipmi_oem_state_data_t *state_data)
{
uint8_t bytes_rq[IPMI_OEM_MAX_BYTES];
uint8_t bytes_rs[IPMI_OEM_MAX_BYTES];
int rs_len;
int rv = -1;
assert (state_data);
assert (state_data->prog_data->args->oem_options_count == 1);
/* achu: XXX
*
* "both" or "all" ... | false | false | false | false | false | 0 |
ex_tabnext(eap)
exarg_T *eap;
{
switch (eap->cmdidx)
{
case CMD_tabfirst:
case CMD_tabrewind:
goto_tabpage(1);
break;
case CMD_tablast:
goto_tabpage(9999);
break;
case CMD_tabprevious:
case CMD_tabNext:
goto_tabpage(eap->addr_count == 0 ? -1 : -(int)eap->line2);
break;
de... | false | false | false | false | false | 0 |
newblock(BlockHeap *bh)
{
MemBlock *newblk = NULL;
Block *b = NULL;
int i = 0;
void *offset = NULL;
/* Setup the initial data structure. */
if ((b = calloc(1, sizeof(Block))) == NULL)
return 1;
b->freeElems = bh->elemsPerBlock;
b->next = bh->base;
b->alloc_size = bh->elemsPerBlock * (bh->elemSiz... | false | false | false | false | false | 0 |
mouseMoveEvent(QMouseEvent *e)
{
if (needLayout)
layoutItems();
foreach (const PreviewCursor *c, list)
{
if (c->rect().contains(e->pos()))
{
if (c != current)
{
setCursor(*c);
current = c;
}
return;
... | false | false | false | false | false | 0 |
ReadDiyFp(Vector<const char> buffer,
DiyFp* result,
int* remaining_decimals) {
int read_digits;
uint64_t significand = ReadUint64(buffer, &read_digits);
if (buffer.length() == read_digits) {
*result = DiyFp(significand, 0);
*remaining_decimals = 0;
} else {
... | false | false | false | false | false | 0 |
read_count_file (void)
{
unsigned ix;
unsigned version;
unsigned tag;
function_t *fn = NULL;
int error = 0;
if (!gcov_open (da_file_name, 1))
{
fnotice (stderr, "%s:cannot open data file\n", da_file_name);
return 1;
}
if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC))
{
... | true | true | false | false | false | 1 |
TerminateProcess (gpointer process, gint32 exitCode)
{
struct _WapiHandle_process *process_handle;
gboolean ok;
int signo;
int ret;
pid_t pid;
if ((GPOINTER_TO_UINT (process) & _WAPI_PROCESS_UNHANDLED) == _WAPI_PROCESS_UNHANDLED) {
/* This is a pseudo handle */
pid = (pid_t)(GPOINTER_TO_UINT (process) & _WA... | false | false | false | false | false | 0 |
display_delete_chars(struct display *display, int row, int column,
int chars, int columns)
{
struct cell *cell;
if (row < 0 || row >= display->rows ||
column < 0 || column >= display->columns)
return;
if (column + columns > display->columns)
columns = display->columns - column;
if (chars > columns)
... | false | false | false | false | false | 0 |
_gdPutColors (gdImagePtr im, gdIOCtx * out)
{
int i;
gdPutC (im->trueColor, out);
if (!im->trueColor) {
gdPutWord (im->colorsTotal, out);
}
gdPutInt (im->transparent, out);
if (!im->trueColor) {
for (i = 0; (i < gdMaxColors); i++) {
gdPutC ((unsigned char) im->red[i], out);
gdPutC ((unsigned char) im->... | false | false | false | false | false | 0 |
RenameRole(const char *oldname, const char *newname)
{
HeapTuple oldtuple,
newtuple;
TupleDesc dsc;
Relation rel;
Datum datum;
bool isnull;
Datum repl_val[Natts_pg_authid];
bool repl_null[Natts_pg_authid];
bool repl_repl[Natts_pg_authid];
int i;
Oid roleid;
rel = heap_open(AuthIdRelationId, Row... | false | false | true | true | false | 1 |
start_hotspot (GtkButton *button, NetDeviceWifi *device_wifi)
{
NMDevice *device;
const GPtrArray *connections;
gchar *active_ssid;
NMClient *client;
GtkWidget *dialog;
GtkWidget *window;
GtkWidget *widget;
GString *str;
active_ssid = NULL;
... | false | false | false | false | false | 0 |
_anchor_hover_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
if (wd->anchor_hover.pop) evas_object_del(wd->anchor_hover.pop);
wd->anchor_hover.pop = NULL;
evas_object_event_callback_del_full(wd-... | false | false | false | false | false | 0 |
pmbus_add_boolean(struct pmbus_data *data,
const char *name, const char *type, int seq,
struct pmbus_sensor *s1,
struct pmbus_sensor *s2,
u16 reg, u8 mask)
{
struct pmbus_boolean *boolean;
struct sensor_device_attribute *a;
boolean = devm_kzalloc(data->dev, sizeof(*boolean), GFP_KERN... | false | false | false | false | false | 0 |
zot_pipe(PIPE_S **syspipe)
{
if((*syspipe)->args){
free((void *) (*syspipe)->args);
(*syspipe)->args = NULL;
}
if((*syspipe)->argv){
free((void *) (*syspipe)->argv);
(*syspipe)->argv = NULL;
}
if((*syspipe)->tmp){
free((void *) (*syspipe)->tmp);
(*syspipe)->tmp = NULL;
}
#ifdef _WINDOWS... | false | false | false | false | false | 0 |
alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
struct alc_spec *spec = codec->spec;
static const struct hda_verb gpio_init[] = {
{ 0x01, AC_VERB_SET_GPIO_MASK, 0x08 },
{ 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x08 },
{}
};
if (action == HDA_FIXUP_ACT_PRE_PROB... | false | false | false | false | false | 0 |
diff_unmodified_pair(struct diff_filepair *p)
{
/* This function is written stricter than necessary to support
* the currently implemented transformers, but the idea is to
* let transformers to produce diff_filepairs any way they want,
* and filter and clean them up here before producing the output.
*/
struct... | false | false | false | false | false | 0 |
canon_value_cmp (rtx tval, rtx cval)
{
return !cval
|| CSELIB_VAL_PTR (tval)->uid < CSELIB_VAL_PTR (cval)->uid;
} | false | false | false | false | false | 0 |
arglist_get_value(list_t *list, const char *name)
{
listitem_t *i;
char *p;
for (i = list->first; i; i = i->next) {
if (i->next && !strcmp(name, (char*)i->data))
return (char*)i->next->data;
else if (!prefixcmp((char*)i->data, name)) {
p = &((char*)i->data)[strlen(na... | false | false | false | false | false | 0 |
rr_read_eeprom_word(struct rr_private *rrpriv,
size_t offset)
{
__be32 word;
if ((rr_read_eeprom(rrpriv, offset,
(unsigned char *)&word, 4) == 4))
return be32_to_cpu(word);
return 0;
} | false | false | false | false | false | 0 |
unschedule()
{
if (!scheduled())
return;
Master* master = _owner->master();
master->lock_timers();
int old_schedpos1 = _schedpos1;
if (_schedpos1 > 0) {
remove_heap<4>(master->_timer_heap.begin(), master->_timer_heap.end(),
master->_timer_heap.begin() + _schedpos1 - 1,
heap_less(... | false | false | false | false | false | 0 |
copy() {
JArithmeticDecoderStats *stats;
stats = new JArithmeticDecoderStats(contextSize);
memcpy(stats->cxTab, cxTab, contextSize);
return stats;
} | false | false | false | false | false | 0 |
image_cleanup_handler (zbar_image_t *image)
{
SV *data = zbar_image_get_userdata(image);
if(!data)
/* FIXME this is internal error */
return;
/* release reference to cleanup data */
SvREFCNT_dec(data);
} | false | false | false | false | false | 0 |
hns_ppe_srst_by_port(struct dsaf_device *dsaf_dev, u32 port, u32 val)
{
u32 reg_val = 0;
u32 reg_addr;
reg_val |= RESET_REQ_OR_DREQ << port;
if (val == 0)
reg_addr = DSAF_SUB_SC_PPE_RESET_REQ_REG;
else
reg_addr = DSAF_SUB_SC_PPE_RESET_DREQ_REG;
dsaf_write_reg(dsaf_dev->sc_base, reg_addr, reg_val);
} | false | false | false | false | false | 0 |
addressmap_ent_free(void *_ent)
{
addressmap_entry_t *ent;
if (!_ent)
return;
ent = _ent;
tor_free(ent->new_address);
tor_free(ent);
} | false | false | false | false | false | 0 |
_bfd_elfcore_make_pseudosection (bfd *abfd,
char *name,
size_t size,
ufile_ptr filepos)
{
char buf[100];
char *threaded_name;
size_t len;
asection *sect;
/* Build the section name. */
sprintf (buf, "%s/%d", name, elfcore_make_pid (abfd));
len = strlen (buf) + 1;
threaded_name = (char *... | true | true | false | false | false | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.