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 |
|---|---|---|---|---|---|---|
ComputeDepths()
{
float *vector = this->ComputeProjectionVector();
vtkIdType numcells = this->Input->GetNumberOfCells();
float *center = this->CellCenters->GetPointer(0);
float *depth = this->CellDepths->GetPointer(0);
for (vtkIdType i = 0; i < numcells; i++)
{
*(depth++) = vtkMath::Dot(center, vecto... | false | false | false | false | false | 0 |
OnCommand(wxCommandEvent& event) {
switch(event.GetId()) {
case ID_BROWSE_PROGRAM:
if(progbox != NULL) {
wxString dirname;
wxString filename = progbox->GetValue();
if(filename.empty()) {
if(dirbox != NULL)
dirname = dirbox->GetValue... | false | false | false | false | false | 0 |
NumDigits(int number)
{
return (log10(number) == ceil(log10(number)) ? //log10 of number gives number of digits, except when number is a power of 10,
log10(number)+1 : //in which case we must add one
ceil(log10(number)));
} | false | false | false | false | false | 0 |
inWorkArea() const {
if (doNotCover())
return false;
if (isFullscreen())
return false;
if (getActiveLayer() >= WinLayerDock)
return false;
if (fStrutLeft != 0 ||
fStrutRight != 0 ||
fStrutTop != 0 ||
fStrutBottom != 0)
return false;
return true... | false | false | false | false | false | 0 |
exsltSaxonLineNumberFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlNodePtr cur = NULL;
if (nargs == 0) {
cur = ctxt->context->node;
} else if (nargs == 1) {
xmlXPathObjectPtr obj;
xmlNodeSetPtr nodelist;
int i;
if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_NODESET)) {
xsltTra... | false | false | false | false | false | 0 |
recv_msg_newkeys() {
TRACE(("<- MSG_NEWKEYS"))
TRACE(("enter recv_msg_newkeys"))
/* simply check if we've sent SSH_MSG_NEWKEYS, and if so,
* switch to the new keys */
if (ses.kexstate.sentnewkeys) {
TRACE(("while SENTNEWKEYS=1"))
gen_new_keys();
kexinitialise(); /* we've finished with this kex */
TRA... | false | false | false | false | false | 0 |
is_none_reloc (unsigned int reloc_type)
{
switch (elf_header.e_machine)
{
case EM_68K: /* R_68K_NONE. */
case EM_386: /* R_386_NONE. */
case EM_SPARC32PLUS:
case EM_SPARCV9:
case EM_SPARC: /* R_SPARC_NONE. */
case EM_MIPS: /* R_MIPS_NONE. */
case EM_PARISC: /* R_PARIS... | false | false | false | false | false | 0 |
decl_address_invariant_p (const_tree op)
{
/* The conditions below are slightly less strict than the one in
staticp. */
switch (TREE_CODE (op))
{
case PARM_DECL:
case RESULT_DECL:
case LABEL_DECL:
case FUNCTION_DECL:
return true;
case VAR_DECL:
if ((TREE_STATIC (op) || DE... | false | false | false | false | false | 0 |
_access_info_cb(void *data,
Evas_Object *obj,
Elm_Widget_Item *item __UNUSED__)
{
Evas_Object *spinner;
const char *txt = elm_widget_access_info_get(obj);
spinner = ELM_WIDGET_DATA(data)->obj;
if (!txt) txt = elm_layout_text_get(spinner, "elm.text");
if (txt) return strdu... | false | false | false | false | false | 0 |
reset_bkm(struct IsdnCardState *cs)
{
if (cs->typ == ISDN_CTYPE_BKM_A4T) {
I20_REGISTER_FILE *pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base);
/* Issue the I20 soft reset */
pI20_Regs->i20SysControl = 0xFF; /* all in */
mdelay(10);
/* Remove the soft reset */
pI20_Regs->i20SysControl = sysRESET | 0x... | false | false | false | false | false | 0 |
WriteMetadataPayload(
const HANDLE_FDK_METADATA_ENCODER hMetaData,
const AAC_METADATA * const pMetadata
)
{
FDK_METADATA_ERROR err = METADATA_OK;
if ( (hMetaData==NULL) || (pMetadata==NULL) ) {
err = METADATA_INVALID_HANDLE;
goto bail;
}
hMetaData->nExten... | false | false | false | false | false | 0 |
http_check_status_line(struct httplocalfile *lf)
{
int res;
char *line;
do {
res = http_get_line(lf, &line);
if(res < 0)
return res;
res = http_process_status_line(lf, line);
av_free(line);
} while(res == 0);
if(res < 0)
return res;
... | false | false | false | false | false | 0 |
setCellTrim(unsigned int row, unsigned int column, const char* data) {
unsigned int idx = m_firstCell[row] + column;
unsigned int size = std::min<unsigned int>(m_cellSize[idx], strlen(data));
for (unsigned int i = 0; i < size; i++) {
m_buffer[m_cellPos[idx] + i] = data[i];
}
m_cellSize[idx] = size;
} | false | false | false | false | false | 0 |
embBtreeIndexEntry(EmbPBtreeEntry entry,
ajuint dbno)
{
AjBool dotrunc = ajFalse;
ajuint iref;
if(!indexId)
indexId = ajBtreeIdNew(entry->refcount);
if(entry->do_id)
{
if(ajStrGetLen(entry->id) > entry->idlen)
{
dotrunc = ajTrue;
... | false | false | false | false | false | 0 |
cypress_reconnect(struct psmouse *psmouse)
{
int tries = CYTP_PS2_CMD_TRIES;
int rc;
do {
cypress_reset(psmouse);
rc = cypress_detect(psmouse, false);
} while (rc && (--tries > 0));
if (rc) {
psmouse_err(psmouse, "Reconnect: unable to detect trackpad.\n");
return -1;
}
if (cypress_set_absolute_mode(ps... | false | false | false | false | false | 0 |
pva_read_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st;
if (!(st = av_new_stream(s, 0)))
return AVERROR(ENOMEM);
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_MPEG2VIDEO;
st->need_parsing = AVSTREAM_PARSE_FULL;
av_set_pts_info(st, 32... | false | false | false | false | false | 0 |
FindToken(const char *s)
{
int i;
for (i = 0; keywords[i].token > 0; i++)
if (!strcasecmp(s, keywords[i].name)) {
yylval = keywords[i].value;
return keywords[i].token;
}
Die("%s:%d: Unknown keyword `%s'\n", Opt_modedb, line, s);
} | false | false | false | false | false | 0 |
sgen_fragment_allocator_par_range_alloc (SgenFragmentAllocator *allocator, size_t desired_size, size_t minimum_size, size_t *out_alloc_size)
{
SgenFragment *frag, *min_frag;
size_t current_minimum;
restart:
min_frag = NULL;
current_minimum = minimum_size;
#ifdef NALLOC_DEBUG
InterlockedIncrement (&alloc_count);
... | false | false | false | false | false | 0 |
featGff2FromLine(AjPFeattable thys, const AjPStr line,
float version)
{
AjPFeature gf = NULL;
AjPStr token = NULL;
ajint Start = 0;
ajint End = 0;
float fscore = 0.0;
ajint itemp;
char strand;
ajint frame;
if(!ajStrGetLen(line)... | false | false | false | false | false | 0 |
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
GObject *object;
NMModemGenericPrivate *priv;
DBusGConnection *bus;
object = G_OBJECT_CLASS (nm_modem_generic_parent_class)->constructor (type, n_construct_params, construct_params);
if (!object)
return NULL;
... | false | false | false | false | false | 0 |
Front(Queue *Q,void *result)
{
size_t idx;
if (Q == NULL) {
iError.RaiseError("iQueue.Front",CONTAINER_ERROR_BADARG);
return CONTAINER_ERROR_BADARG;
}
idx = iList.Size(Q->Items);
if (idx == 0)
return 0;
return iList.CopyElement(Q->Items,0,result);
} | false | false | false | false | false | 0 |
afr_mark_biggest_of_fools_as_source (int32_t *sources, int32_t **pending_matrix,
afr_node_character *characters,
int child_count)
{
int32_t biggest_witness = 0;
int nsources = 0;
int32_t *witne... | false | false | false | false | false | 0 |
e_int_config_mime_edit(E_Config_Mime_Icon *data, void *data2)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
E_Container *con;
E_Config_Dialog_Data *cfdata;
if (e_config_dialog_find("E", "fileman/mime_edit_dialog")) return NULL;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->data = data;
... | false | false | false | false | false | 0 |
calc_tabsize()
{
#ifdef _DEBUG
std::cout << "TabNotebook::calc_tabsize\n";
#endif
GtkNotebook *notebook = gobj();
GList * children = notebook->children;
for( int i = 0; children ; ++i, children = children->next ){
GtkNotebookPage* page = ( GtkNotebookPage* ) children->data;
SKELETON::... | false | false | false | false | false | 0 |
show_srp_rport_roles(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct srp_rport *rport = transport_class_to_srp_rport(dev);
int i;
char *name = NULL;
for (i = 0; i < ARRAY_SIZE(srp_rport_role_names); i++)
if (srp_rport_role_names[i].value == rport->roles) {
name = srp_rport_role_n... | false | true | false | false | false | 1 |
get_symbol_pos(unsigned long addr,
unsigned long *symbolsize,
unsigned long *offset)
{
unsigned long symbol_start = 0, symbol_end = 0;
unsigned long i, low, high, mid;
/* This kernel should never had been booted. */
BUG_ON(!kallsyms_addresses);
/* Do a binary search on the sorted kallsyms_address... | false | false | false | false | false | 0 |
go_option_menu_remove_menu (GOOptionMenu *option_menu)
{
g_return_if_fail (GO_IS_OPTION_MENU (option_menu));
if (option_menu->menu)
{
if (GTK_MENU_SHELL (option_menu->menu)->active)
g_signal_emit_by_name (option_menu->menu, "cancel", 0);
gtk_menu_detach (GTK_MENU (option_menu->menu));
}... | false | false | false | false | false | 0 |
p_pw_set_strings_for_mask_name_combo(GapStbPropWidget *pw)
{
GapStoryBoard *stb;
GapStoryElem *stb_elem;
gint index_of_active_item;
gint index;
gint remove_position;
char *curr_mask_name;
gchar *l_txt;
if(pw == NULL) {return;}
if(pw->mask_name_combo == NULL) {return;}
curr_mask_name = NULL;
... | false | false | false | false | false | 0 |
ldap_op_add (LDAPOp *op,
EBookBackend *backend,
EDataBook *book,
EDataBookView *view,
gint opid,
gint msgid,
LDAPOpHandler handler,
LDAPOpDtor dtor)
{
EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
op->backend = backend... | false | false | false | false | false | 0 |
nv_percent(cap)
cmdarg_T *cap;
{
pos_T *pos;
#ifdef FEAT_FOLDING
linenr_T lnum = curwin->w_cursor.lnum;
#endif
cap->oap->inclusive = TRUE;
if (cap->count0) /* {cnt}% : goto {cnt} percentage in file */
{
if (cap->count0 > 100)
clearopbeep(cap->oap);
else
{
cap->oap->motion_type ... | false | false | false | false | false | 0 |
combineWeightsBySorting(WeightList &Weights) {
// Sort so edges to the same node are adjacent.
std::sort(Weights.begin(), Weights.end(),
[](const Weight &L,
const Weight &R) { return L.TargetNode < R.TargetNode; });
// Combine adjacent edges.
WeightList::iterator O = Weights.begin();... | false | false | false | false | false | 0 |
gog_lin_reg_curve_build_values (GogLinRegCurve *rc, double const *x_vals, double const *y_vals, int n)
{
int i, used;
double x, y;
double xmin, xmax;
gog_reg_curve_get_bounds (&rc->base, &xmin, &xmax);
if (rc->x_vals == NULL)
rc->x_vals = g_new0 (double*, 1);
g_free (*rc->x_vals);
*rc->x_vals = g_new (double, ... | false | false | false | false | false | 0 |
rsvg_new_filter_primitive_diffuse_lighting (void)
{
RsvgFilterPrimitiveDiffuseLighting *filter;
filter = g_new (RsvgFilterPrimitiveDiffuseLighting, 1);
_rsvg_node_init (&filter->super.super, RSVG_NODE_TYPE_FILTER_PRIMITIVE_DIFFUSE_LIGHTING);
filter->super.in = g_string_new ("none");
filter->super.re... | false | false | false | false | false | 0 |
CheckForPhysRegDependency(SDNode *Def, SDNode *User, unsigned Op,
const TargetRegisterInfo *TRI,
const TargetInstrInfo *TII,
unsigned &PhysReg, int &Cost) {
if (Op != 2 || User->getOpcode() != ISD::CopyTo... | false | false | false | false | false | 0 |
HistoryComboBoxEntry(
const std::string& history_file, unsigned int length):
m_history(history_file, length)
{
set_model(m_history.get_store());
set_text_column(m_history.get_columns().text);
get_entry()->signal_key_press_event().connect(
sigc::mem_fun(
*this,
&HistoryComboBoxEntry::on_entry_key_press_eve... | false | false | false | false | false | 0 |
crw_check_weapon( int weapon_num, int collide_next_check )
{
float next_check_time;
weapon *wp;
wp = &Weapons[weapon_num];
// if this weapons life left > time before next collision, then we cannot remove it
crw_status[WEAPON_INDEX(wp)] = CRW_IN_PAIR;
next_check_time = ((float)(timestamp_until(collide_next_check... | false | false | false | false | false | 0 |
description_loaded (GUPnPControlPoint *control_point,
GUPnPXMLDoc *doc,
const char *udn,
const char *service_type,
const char *description_url)
{
xmlNode *element;
SoupURI *url_base;
/* Sa... | false | false | false | false | false | 0 |
SendValidSourceResult(const CUInt128& keyID, uint32_t ip, uint16_t port, uint16_t startPosition, uint64_t fileSize, const CKadUDPKey& senderKey)
{
SrcHash* currSrcHash = NULL;
SrcHashMap::iterator itSrcHash = m_Sources_map.find(keyID);
if (itSrcHash != m_Sources_map.end()) {
currSrcHash = itSrcHash->second;
CMem... | false | false | false | false | false | 0 |
performWriteOperation(ArchiveOperation Operation, object::Archive *OldArchive,
std::vector<NewArchiveIterator> *NewMembersP) {
object::Archive::Kind Kind;
switch (FormatOpt) {
case Default: {
Triple T(sys::getProcessTriple());
if (T.isOSDarwin())
Kind = object::Archive::K_BSD;
... | false | false | false | false | false | 0 |
tor_memmem(const void *_haystack, size_t hlen,
const void *_needle, size_t nlen)
{
#if defined(HAVE_MEMMEM) && (!defined(__GNUC__) || __GNUC__ >= 2)
tor_assert(nlen);
return memmem(_haystack, hlen, _needle, nlen);
#else
/* This isn't as fast as the GLIBC implementation, but it doesn't need to
* be. ... | false | false | false | false | false | 0 |
x509_akid_note_serial(void *context, size_t hdrlen,
unsigned char tag,
const void *value, size_t vlen)
{
struct x509_parse_context *ctx = context;
struct asymmetric_key_id *kid;
pr_debug("AKID: serial: %*phN\n", (int)vlen, value);
if (!ctx->akid_raw_issuer || ctx->cert->akid_id)
return 0;
kid = asym... | false | false | false | false | false | 0 |
bitfill_aligned_rev(struct fb_info *p, unsigned long __iomem *dst,
int dst_idx, unsigned long pat, unsigned n, int bits,
u32 bswapmask)
{
unsigned long val = pat, dat;
unsigned long first, last;
if (!n)
return;
first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask);
last = ~fb_shifted_pixels_ma... | false | false | false | false | false | 0 |
which_bucket(const int entry_n, const char *file,
const unsigned int line)
{
unsigned int bucket;
if (line == 0) {
if (file == NULL) {
bucket = 0;
}
else {
/* we hash on the address in file -- should be a return-address */
bucket = hash((unsigned char *)&file, sizeof(char *... | false | false | false | false | false | 0 |
qede_alloc_mem_rxq(struct qede_dev *edev,
struct qede_rx_queue *rxq)
{
int i, rc, size, num_allocated;
rxq->num_rx_buffers = edev->q_num_rx_buffers;
rxq->rx_buf_size = NET_IP_ALIGN +
ETH_OVERHEAD +
edev->ndev->mtu +
QEDE_FW_RX_ALIGN_END;
/* Allocate the parallel driver ring for Rx buff... | false | false | false | false | false | 0 |
mcsidx_to_tgtpwridx(unsigned int mcs_idx, u8 base_pwridx)
{
u8 mod_idx = mcs_idx % 8;
if (mod_idx <= 3)
return mod_idx ? (base_pwridx + 1) : base_pwridx;
else
return base_pwridx + 4 * (mcs_idx / 8) + mod_idx - 2;
} | false | false | false | false | false | 0 |
rb_set_class_path(klass, under, name)
VALUE klass, under;
const char *name;
{
VALUE str;
if (under == rb_cObject) {
str = rb_str_new2(name);
}
else {
str = rb_str_dup(rb_class_path(under));
rb_str_cat2(str, "::");
rb_str_cat2(str, name);
}
rb_ivar_set(klass, classpath, str);
} | false | false | false | false | false | 0 |
g_vfs_backend_afp_browse_finalize (GObject *object)
{
GVfsBackendAfpBrowse *afp_backend = G_VFS_BACKEND_AFP_BROWSE (object);
g_object_unref (afp_backend->mount_tracker);
if (afp_backend->addr)
g_object_unref (afp_backend->addr);
g_free (afp_backend->user);
g_free (afp_backend->logged_in_user);
if ... | false | false | false | false | false | 0 |
del_ipv4_miniroute ( struct ipv4_miniroute *miniroute ) {
DBG ( "IPv4 del %s", inet_ntoa ( miniroute->address ) );
DBG ( "/%s ", inet_ntoa ( miniroute->netmask ) );
if ( miniroute->gateway.s_addr )
DBG ( "gw %s ", inet_ntoa ( miniroute->gateway ) );
DBG ( "via %s\n", miniroute->netdev->name );
netdev_put ( min... | false | false | false | false | false | 0 |
details_combobox_changed(GtkComboBox *combobox) {
T_item item;
g_return_if_fail (combobox);
item = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (combobox),
"details_item"));
g_return_if_fail ((item > 0) && (item < T_ITEM_NUM));
details_get_item(item, FALSE);
} | false | false | false | false | false | 0 |
lm3530_mode_get(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct lm3530_data *drvdata;
int i, len = 0;
drvdata = container_of(led_cdev, struct lm3530_data, led_dev);
for (i = 0; i < ARRAY_SIZE(mode_map); i++)
if (drvdata->mode == mode... | false | false | false | false | false | 0 |
IsLocked(v8::Isolate* isolate) {
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
if (internal_isolate == NULL) {
internal_isolate = i::Isolate::GetDefaultIsolateForLocking();
}
return internal_isolate->thread_manager()->IsLockedByCurrentThread();
} | false | false | false | false | false | 0 |
OnStatisticsPrevProject( wxCommandEvent& WXUNUSED(event) ) {
wxLogTrace(wxT("Function Start/End"), wxT("CViewStatistics::OnStatisticsPrevProject - Function Begin"));
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
wxASSERT(pFrame);
wxASSERT(wxDynamic... | false | false | false | false | false | 0 |
decrypt_password_legacy (const std::string &passphrase,
const std::string &password)
{
#ifdef USE_PASSWORD
// Build passtable
std::string passtable = passphrase;
std::string buffer;
for (std::string::size_type i = 0; i < passtable.size(); i++)
if (buffer.find(passtable[i]) == std::string::npos)
buff... | false | false | false | false | false | 0 |
min_partial_store(struct kmem_cache *s, const char *buf,
size_t length)
{
unsigned long min;
int err;
err = kstrtoul(buf, 10, &min);
if (err)
return err;
set_min_partial(s, min);
return length;
} | false | false | false | false | false | 0 |
GetPSFonts () {
if (_fonts == nil) {
_fonts = new UList;
CollectFontsFromGraphic(GetGraphicComp()->GetGraphic(), _fonts);
}
return _fonts;
} | false | false | false | false | false | 0 |
main_window_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
gboolean cancel_quit = FALSE;
is_app_closing = TRUE;
cancel_quit = !document_manager_can_all_tabs_be_saved(main_window.docmg);
is_app_closing = FALSE;
if (cancel_quit) {
update_app_title(document_manager_get_current_docume... | false | false | false | false | false | 0 |
cmpXPathSegs(const SplashXPathSeg &seg0, const SplashXPathSeg &seg1) {
SplashCoord x0, y0, x1, y1;
if (seg0.flags & splashXPathFlip) {
x0 = seg0.x1;
y0 = seg0.y1;
} else {
x0 = seg0.x0;
y0 = seg0.y0;
}
if (seg1.flags & splashXPathFlip) {
x1 = seg1.x1;
y1 = seg1.y1;
} else {
x1 =... | false | false | false | false | false | 0 |
kmclipm_image_save(const cpl_image *img,
const char *filename,
cpl_type_bpp bpp,
const cpl_propertylist *pl,
unsigned mode,
double rej_val)
{
cpl_... | false | false | false | false | false | 0 |
EffectKillCreditGroup(SpellEffectIndex eff_idx)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
((Player*)unitTarget)->RewardPlayerAndGroupAtEvent(m_spellInfo->EffectMiscValue[eff_idx], unitTarget);
} | false | false | false | false | false | 0 |
gth_main_get_file_source_for_uri (const char *uri)
{
GthFileSource *file_source = NULL;
GList *scan;
for (scan = Main->priv->file_sources; scan; scan = scan->next) {
GthFileSource *registered_file_source = scan->data;
if (gth_file_source_supports_scheme (registered_file_source, uri)) {
file_source =... | false | false | false | false | false | 0 |
fts_sort (FTS *sp, FTSENT *head, register size_t nitems)
{
register FTSENT **ap, *p;
/* On most modern hosts, void * and FTSENT ** have the same
run-time representation, and one can convert sp->fts_compar to
the type qsort expects without problem. Use the heuristic that
... | false | false | false | false | false | 0 |
WriteText(FILE *fp) const
{
// Check file
if (!fp) fp = stdout;
// Print values
for (int k = 0; k < ZResolution(); k++) {
for (int j = 0; j < YResolution(); j++) {
for (int i = 0; i < XResolution(); i++) {
fprintf(fp, "%g ", GridValue(i, j, k));
}
fprintf(fp, "\n");
... | false | false | false | false | false | 0 |
wl1273_fm_vidioc_s_input(struct file *file, void *priv,
unsigned int i)
{
struct wl1273_device *radio = video_get_drvdata(video_devdata(file));
dev_dbg(radio->dev, "%s\n", __func__);
if (i != 0)
return -EINVAL;
return 0;
} | false | false | false | false | false | 0 |
m88ds3103_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage fe_sec_voltage)
{
struct m88ds3103_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
int ret;
unsigned int utmp;
bool voltage_sel, voltage_dis;
dev_dbg(&client->dev, "fe_sec_voltage=%d\n", fe_sec_voltage);
if (!dev->war... | false | false | false | false | false | 0 |
cgcef_getscn(CGCEf *cgcef, size_t index) {
CGCEf_Scn *scn;
if (!cgcef) {
return NULL;
}
cgcef_assert(cgcef->e_magic == CGCEF_MAGIC);
if (cgcef->e_kind != CGCEF_K_CGCEF) {
seterr(ERROR_NOTCGCEF);
}
else if (cgcef->e_ehdr || _cgcef_cook(cgcef)) {
for (scn = cgcef->e_scn_1; scn; scn = scn->... | false | false | false | false | false | 0 |
fsp_quad_import_commit_all (fsp_link *link, int flags)
{
int errors = 0;
for (fs_segment segment = 0; segment < link->segments; ++segment) {
unsigned char *out = message_new(FS_COMMIT_QUAD, segment, 4);
memcpy (out + FS_HEADER, &flags, sizeof(flags));
fsp_write_replica(link, out, 4);
free(out);
}... | false | false | false | false | false | 0 |
Mark (int Line) {
if (Line<LineCount) {
if (Lines[Line]->Status&4) Lines[Line]->Status|=2;
return 1;
} else return 0;
} | false | false | false | false | false | 0 |
nextopt( int argc, char **argv, char *args )
{
char *a, *p ;
if ( nxtoptind >= argc || *(a = argv[nxtoptind]) != '-' ) return -1 ;
nxtoptind++ ;
if ( ! *(a+1) || ( ( p = strchr ( args, *(a+1) ) ) == 0 ) )
return msg ( "Eunknown option (%s)", a ), '?' ;
if ( *(p+1) != ':' ) nxtoptarg = 0 ;
else
i... | false | false | false | false | false | 0 |
clutter_feature_available (ClutterFeatureFlags feature)
{
if (G_UNLIKELY (!__features))
{
g_critical ("Unable to check features. Have you initialized Clutter?");
return FALSE;
}
return (__features->flags & feature);
} | false | false | false | false | false | 0 |
testlib_test_perform(bool success)
{
if (success) {
tests_passed++;
std::cout << " PASSED\n" << std::flush;
} else {
tests_failed++;
std::cout << "**FAILED**\n" << std::flush;
}
} | false | false | false | false | false | 0 |
parse_events (const gchar *events)
{
gchar **ranges_strv;
GList *ranges = NULL;
int i;
ranges_strv = g_strsplit (events, ",", 0);
for (i = 0; ranges_strv[i]; i++)
{
struct event_range *er = g_slice_new (struct event_range);
gchar *p = NULL;
er->first = atoi (ranges_strv[i]);
p = strchr (r... | false | false | false | false | false | 0 |
setup (Test *test, gconstpointer unused)
{
test->module = test_secret_module_initialize_and_enter ();
test->session = test_secret_module_open_session (TRUE);
test->collection = g_object_new (GKM_TYPE_SECRET_COLLECTION,
"module", test->module,
"identifier", "te... | false | false | false | false | false | 0 |
g_vfs_afp_volume_read_from_fork_finish (GVfsAfpVolume *volume,
GAsyncResult *res,
gsize *bytes_read,
GError **error)
{
GSimpleAsyncResult *simple;
g_return_val_if_fail (g_sim... | false | false | false | false | false | 0 |
sourceview_io_new (Sourceview* sv)
{
SourceviewIO* sio;
g_return_val_if_fail (ANJUTA_IS_SOURCEVIEW(sv), NULL);
sio = SOURCEVIEW_IO(g_object_new (SOURCEVIEW_TYPE_IO, NULL));
sio->sv = sv;
g_object_weak_ref (G_OBJECT (sv), on_sourceview_finalized, sio);
/* Store a separate pointer to the shell since we want to ... | false | false | false | false | false | 0 |
BandCtl(float *freq, const int band_num,
sigc::slot<void> gain_slot,
sigc::slot<void> freq_slot,
sigc::slot<void> Q_slot,
sigc::slot<void> type_slot, int *semafor
):
button_align(Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER, 0.0, 0.0),
combo_align(Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER, 0.0, 0.0){
Glib::ustring text... | false | false | false | false | false | 0 |
traverse_every_el_preorder(TRAVERSE_STACK *stack)
{
FUNCNAME("traverse_every_el_preorder");
EL *el;
int i;
if (stack->stack_used == 0) /* first call */
{
if (stack->traverse_mesh->n_macro_el == 0) return(nil);
stack->traverse_mel = stack->traverse_mesh->macro_els;
stack->stack_used = 1;
... | false | false | false | false | false | 0 |
CRMF_CertReqMsgSetCertRequest (CRMFCertReqMsg *inCertReqMsg,
CRMFCertRequest *inCertReq)
{
PORT_Assert (inCertReqMsg != NULL && inCertReq != NULL);
if (inCertReqMsg == NULL || inCertReq == NULL) {
return SECFailure;
}
inCertReqMsg->certReq = crmf_copy_cert_request(inCertReqMsg->poolp... | false | false | false | false | false | 0 |
kui_manager_get_terminal_keys_kui_map(struct kui_manager *kuim,
enum cgdb_key key, std_list kui_map_set)
{
struct kui_map_set *map_set;
struct kuictx *terminalkeys;
std_list map_sets;
std_list_iterator iter, kui_map_set_iter;
void *data;
const char *keycode_str;
if (!kuim)
r... | false | false | false | false | true | 1 |
networkstatus_dump_bridge_status_to_file(time_t now)
{
char *status = networkstatus_getinfo_by_purpose("bridge", now);
const or_options_t *options = get_options();
char *fname = NULL;
tor_asprintf(&fname, "%s"PATH_SEPARATOR"networkstatus-bridges",
options->DataDirectory);
write_str_to_file(fnam... | false | false | false | false | false | 0 |
get_disk(struct lib_context *lc, struct dev_info *di, struct isw *isw)
{
struct isw_disk *disk;
if ((disk = _get_disk(isw, di)))
return disk;
LOG_ERR(lc, NULL, "%s: Could not find disk %s in the metadata",
handler, di->path);
} | false | false | false | false | false | 0 |
getvar_i(var *v)
{
char *s;
if ((v->type & (VF_NUMBER | VF_CACHED)) == 0) {
v->number = 0;
s = v->string;
if (s && *s) {
debug_printf_eval("getvar_i: '%s'->", s);
v->number = my_strtod(&s);
debug_printf_eval("%f (s:'%s')\n", v->number, s);
if (v->type & VF_USER) {
s = skip_spaces(s);
if (*s... | false | false | false | false | false | 0 |
BeginGroup(GROUP_TYPE type)
{
unsigned lastIndent = (m_groups.empty() ? 0 : m_groups.top()->indent);
m_curIndent += lastIndent;
std::auto_ptr <Group> pGroup(new Group(type));
// transfer settings (which last until this group is done)
pGroup->modifiedSettings = m_modifiedSettings;
// set up group
p... | false | false | false | false | false | 0 |
getAddrLabelSymbol(const BasicBlock *BB) {
// Lazily create AddrLabelSymbols.
if (AddrLabelSymbols == 0)
AddrLabelSymbols = new MMIAddrLabelMap(Context);
return AddrLabelSymbols->getAddrLabelSymbol(const_cast<BasicBlock*>(BB));
} | false | false | false | false | false | 0 |
lp5562_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int ret;
struct lp55xx_chip *chip;
struct lp55xx_led *led;
struct lp55xx_platform_data *pdata = dev_get_platdata(&client->dev);
struct device_node *np = client->dev.of_node;
if (!pdata) {
if (np) {
pdata = lp55xx_of_populate_pdata(... | false | false | false | false | false | 0 |
draw_in_pixmap ( GdkDrawable *drawable )
{
if ( gp_point_array_size (m_priv->pa) > 0 )
{
GdkPoint * points = gp_point_array_data (m_priv->pa);
gint n_points = gp_point_array_size (m_priv->pa);
if ( m_priv->cv->filled == FILLED_BACK )
{
gdk_draw_polygon ( drawable, m_priv->gcb, TRUE, points, n_points);
... | false | false | false | false | false | 0 |
sky2_link_up(struct sky2_port *sky2)
{
struct sky2_hw *hw = sky2->hw;
unsigned port = sky2->port;
u16 reg;
static const char *fc_name[] = {
[FC_NONE] = "none",
[FC_TX] = "tx",
[FC_RX] = "rx",
[FC_BOTH] = "both",
};
/* enable Rx/Tx */
reg = gma_read16(hw, port, GM_GP_CTRL);
reg |= GM_GPCR_RX_ENA | GM_... | false | false | false | false | false | 0 |
long_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (memory_operand (op, mode)) && (
#line 1001 "../../../src/gcc/config/i386/predicates.md"
(memory_address_length (op, false)));
} | false | false | false | false | false | 0 |
gupnp_dlna_int_range_new (gint min,
gint max)
{
GUPnPDLNAIntRange *range;
g_return_val_if_fail (min <= max, NULL);
range = g_slice_new (GUPnPDLNAIntRange);
range->min = min;
range->max = max;
return range;
} | false | false | false | false | false | 0 |
arg_from_parm_pack_p (tree arg_pack, tree parm_pack)
{
/* For clarity in the comments below let's use the representation
argument_pack<elements>' to denote an argument pack and its
elements.
In the 'if' block below, we want to detect cases where
ARG_PACK is argument_pack<PARM_PACK...>. I.e, we w... | false | false | false | false | false | 0 |
lirc_irq_handler(int i, void *blah)
{
struct timeval tv;
int counter, dcd;
u8 status;
long deltv;
int data;
static int last_dcd = -1;
if ((sinp(UART_IIR) & UART_IIR_NO_INT)) {
/* not our interrupt */
return IRQ_NONE;
}
counter = 0;
do {
counter++;
status = sinp(UART_MSR);
if (counter > RS_ISR_PASS... | false | false | false | false | false | 0 |
sys_getrealtime(void)
{
#ifndef _WIN32
static struct timeval then;
struct timeval now;
gettimeofday(&now, 0);
if (then.tv_sec == 0 && then.tv_usec == 0) then = now;
return ((now.tv_sec - then.tv_sec) +
(1./1000000.) * (now.tv_usec - then.tv_usec));
#else
LARGE_INTEGER now;
QueryP... | false | false | false | false | false | 0 |
hw_adc_init(struct hw *hw, const struct adc_conf *info)
{
int err;
u32 data, ctl;
/* Set ADC reset bit as output */
data = hw_read_20kx(hw, GPIO_CTRL);
data |= (0x1 << 15);
hw_write_20kx(hw, GPIO_CTRL, data);
/* Initialize I2C */
err = hw20k2_i2c_init(hw, 0x1A, 1, 1);
if (err < 0) {
dev_alert(hw->card->de... | false | false | false | false | false | 0 |
popup_sabotage_dialog(struct city *pcity)
{
if(!spy_sabotage_shell){
Position x, y;
Dimension width, height;
spy_sabotage_shell_is_modal=1;
create_improvements_list(client.conn.playing, pcity, spy_sabotage_shell_is_modal);
XtVaGetValues(toplevel, XtNwidth, &width, XtNheight, &height, NULL)... | false | false | false | false | false | 0 |
kbdd_get_layout_name( uint32_t id, char ** layout)
{
if ( id < 0 || id>=_group_count ) return 0;
dbg( "layout: %s",_group_names[id] );
*layout = strdup( (const char *)_group_names[id] );
return 1;
} | true | true | false | false | false | 1 |
escape_single_quote(char *p, int inuni)
{
string_t s = string_init(NULL);
int l=xstrlen(p);
#if USE_UNICODE
if (inuni)
{
int r;
mbtowc(NULL, NULL, 0); /* reset */
while (l>0)
{
if ((r = mbtowc(NULL, p, l)) == -1)
string_append_c(s, '?'), r=1;
else if (r == 1)
{
if (*p == '\'')
string_a... | false | false | false | false | false | 0 |
_tp_dbus_daemon_list_names_idle (gpointer data)
{
ListNamesContext *context = data;
char **array = NULL;
const gchar * const *result = NULL;
GError *error = NULL;
if (context->callback == NULL)
{
DEBUG ("Caller no longer cares (weak object vanished), ignoring");
return FALSE;
}
if (con... | false | false | false | false | false | 0 |
_GMatrixEditGetActiveTextField(GGadget *g) {
GMatrixEdit *gme = (GMatrixEdit *) g;
if ( gme->edit_active )
return( gme->tf );
return( NULL );
} | false | false | false | false | false | 0 |
vi_process_web_trails(struct vih *vih, char *ref, char *req)
{
int res, plen, google;
char buf[VI_LINE_MAX];
char *src;
if (vi_is_image(req)) return 0;
plen = vi_is_internal_link(ref);
google = vi_is_google_link(ref);
if (plen) {
src = (ref[plen] == '\0') ? "/" : ref+plen;
} else if (google) {
if (Config_g... | false | false | false | false | false | 0 |
SEI_realloc(WordEntry **in, uint32 *len)
{
if (*len == 0 || in == NULL)
{
*len = 8;
in = palloc(sizeof(WordEntry *) * (*len));
}
else
{
*len *= 2;
in = repalloc(in, sizeof(WordEntry *) * (*len));
}
return in;
} | false | false | false | false | false | 0 |
get_object_details(void)
{
uint32_t i;
struct object_entry **sorted_by_offset;
sorted_by_offset = xcalloc(nr_objects, sizeof(struct object_entry *));
for (i = 0; i < nr_objects; i++)
sorted_by_offset[i] = objects + i;
qsort(sorted_by_offset, nr_objects, sizeof(*sorted_by_offset), pack_offset_sort);
for (i = 0... | 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.