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 |
|---|---|---|---|---|---|---|
print_quality (FILE *fp, char *quality, int querylength,
int hardclip_low, int hardclip_high, int shift) {
int i;
int c;
if (quality == NULL) {
putc('*',fp);
} else {
for (i = hardclip_low; i < querylength - hardclip_high; i++) {
if ((c = quality[i] + shift) <= 32) {
fprintf(stderr,"Warn... | false | false | false | false | false | 0 |
gs_mapcolor(typbuff * cobuff, gsurf_att * coloratt, int offset)
{
if (coloratt->lookup) {
/* for now, but may add larger color lookup capabilities later,
so would have to use GET_MAPATT */
return (coloratt->lookup[cobuff->cb[offset]]);
}
return (cobuff->ib[offset]);
} | false | false | false | false | false | 0 |
getLastArg(OptSpecifier Id0, OptSpecifier Id1,
OptSpecifier Id2) const {
Arg *Res = nullptr;
for (const_iterator it = begin(), ie = end(); it != ie; ++it) {
if ((*it)->getOption().matches(Id0) ||
(*it)->getOption().matches(Id1) ||
(*it)->getOption().matches(Id2)) {
... | false | false | false | false | false | 0 |
alGetListener3i(ALenum eParam, ALint *plValue1, ALint *plValue2, ALint *plValue3)
{
ALCcontext *Context;
Context = GetContextRef();
if(!Context) return;
if(plValue1 && plValue2 && plValue3)
{
switch (eParam)
{
case AL_POSITION:
LockContext(Context);
... | false | false | false | false | false | 0 |
profile_default_gamma(profile_data *p)
{
if (!strcmp(p->name, "No profile")
|| !strcmp(p->name, "Color matrix")
|| !strncmp(p->productName, "Nikon D", 7)
|| !strncmp(p->productName, "Adobe RGB (1998)", 16))
return 0.45;
else
return 1.0;
} | false | false | false | false | false | 0 |
get_variant(
DBusMessageIter * iter_ptr,
struct jack_parameter_variant * parameter_ptr)
{
DBusMessageIter variant_iter;
int type;
dbus_bool_t boolean;
dbus_int32_t int32;
dbus_uint32_t uint32;
char * string;
dbus_message_iter_recurse(iter_ptr, &variant_iter);
log_debug("variant signature: '%s'", db... | false | false | false | false | false | 0 |
find_header (SoupHeader *hdr_array, const char *interned_name, int nth)
{
int i;
for (i = 0; hdr_array[i].name; i++) {
if (hdr_array[i].name == interned_name) {
if (nth-- == 0)
return i;
}
}
return -1;
} | false | false | false | false | false | 0 |
gf_isom_get_track_from_id(GF_MovieBox *moov, u32 trackID)
{
u32 i, count;
GF_TrackBox *trak;
if (!moov || !trackID) return NULL;
count = gf_list_count(moov->trackList);
for (i = 0; i<count; i++) {
trak = (GF_TrackBox*)gf_list_get(moov->trackList, i);
if (trak->Header->trackID == trackID) return trak;
}
ret... | false | false | false | false | false | 0 |
parse_cmdline_execd(char **argv)
{
lList *ref_list = NULL, *alp = NULL, *pcmdline = NULL;
lListElem *aep;
u_long32 help = 0;
DENTER(TOP_LAYER, "parse_cmdline_execd");
alp = sge_parse_cmdline_execd(argv+1, &pcmdline);
if(alp) {
/*
** high level parsing error! show answer list... | false | false | false | false | false | 0 |
_scsih_check_access_status(struct MPT3SAS_ADAPTER *ioc, u64 sas_address,
u16 handle, u8 access_status)
{
u8 rc = 1;
char *desc = NULL;
switch (access_status) {
case MPI2_SAS_DEVICE0_ASTATUS_NO_ERRORS:
case MPI2_SAS_DEVICE0_ASTATUS_SATA_NEEDS_INITIALIZATION:
rc = 0;
break;
case MPI2_SAS_DEVICE0_ASTATUS_SATA_... | false | false | false | false | false | 0 |
loc_simpvbfor( ScanFor )
vbfor_list *ScanFor;
{
ScanFor->VARIABLE = (*VbhFunctionL)( ScanFor->VARIABLE );
if ( ScanFor->LEFT != (vexexpr *)0 )
{
ScanFor->LEFT = (*VbhFunctionR)( ScanFor->LEFT );
}
if ( ScanFor->RIGHT != (vexexpr *)0 )
{
ScanFor->RIGHT = (*VbhFunctionR)( ScanFor->RIGHT );
}
... | false | false | false | false | false | 0 |
matchCacheHandler(HttpConn *conn, HttpRoute *route, int dir)
{
HttpCache *cache;
mprAssert(route->caching);
if ((cache = conn->tx->cache = lookupCacheControl(conn)) == 0) {
/* Caching not configured for this route */
return HTTP_ROUTE_REJECT;
}
if (cache->flags & HTTP_CACHE_CLIEN... | false | false | false | false | false | 0 |
d_post_options (const char ** fn)
{
// Canonicalize the input filename.
if (in_fnames == NULL)
{
in_fnames = XNEWVEC (const char *, 1);
in_fnames[0] = "";
}
else if (strcmp (in_fnames[0], "-") == 0)
in_fnames[0] = "";
// The front end considers the first input file to be the main one.
... | false | false | false | false | false | 0 |
prep_addr (char * buf, char * object) {
struct nodeent * ne;
*index(buf, '/') = 0;
if ( strcmp(buf, "0.0") == 0 && ! numeric ) {
strcpy(buf, "*");
} else if ( !numeric ) {
if ( (ne = getnodebyname(buf)) != NULL ) {
if ( (ne = getnodebyaddr((const char *)ne->n_addr, ne->n_length, ne->n_addrtype)) != NU... | false | true | true | false | false | 1 |
iscsit_tpg_add_portal_group(struct iscsi_tiqn *tiqn, struct iscsi_portal_group *tpg)
{
if (tpg->tpg_state != TPG_STATE_FREE) {
pr_err("Unable to add iSCSI Target Portal Group: %d"
" while not in TPG_STATE_FREE state.\n", tpg->tpgt);
return -EEXIST;
}
iscsit_set_default_tpg_attribs(tpg);
if (iscsi_create_def... | false | false | false | false | false | 0 |
III_antialias (gfloat xr[SBLIMIT][SSLIMIT],
gfloat hybridIn[SBLIMIT][SSLIMIT], gr_info_t * gr_info)
{
/* Static shared computed constants */
static int init = 0;
static gfloat sca[8], scs[8];
gfloat bu, bd; /* upper and lower butterfly inputs */
int ss, sb, sblim;
const gfloat *ca = sca;
... | false | false | false | false | false | 0 |
get_xid_object_and_display (object type, object obj, Display **dpyf)
{
pushSTACK(type);
pushSTACK(obj);
CHECK_TYPE(STACK_0, STACK_1);
if (dpyf) { /* do we want the display? */
pushSTACK(STACK_0); pushSTACK(O(object_xlib__display));
funcall(L(slot_value), 2); pushSTACK(value1);
*dpyf... | false | false | false | false | false | 0 |
GDCfnt_sz( char *s,
enum GDC_font_size gdfontsz,
char *ftfont,
double ftfptsz,
double rad, /* w,h still relative to horiz. */
char **sts )
{
struct fnt_sz_t rtnval;
int len;
char *err = NULL;
#ifdef HAVE_LIBFREETYPE
if( ftfont && ftfptsz )
{
int brect[8];
/*... | false | false | false | false | false | 0 |
CreateFunctionGlobal(SQFUNCTION func,const SQChar * scriptFuncName,const SQChar * typeMask) {
PushRootTable(); // Push root table.
// CreateFunction(scriptFuncName,func,numParams,typeMask);
SquirrelObject ret = CreateFunction(func,scriptFuncName,typeMask);
Pop(1); // Pop root table.
return ret;
} | false | false | false | false | false | 0 |
pk_engine_notify_updates_changed_cb (PkNotify *notify, PkEngine *engine)
{
g_return_if_fail (PK_IS_ENGINE (engine));
g_debug ("emitting updates-changed");
g_dbus_connection_emit_signal (engine->priv->connection,
NULL,
PK_DBUS_PATH,
PK_DBUS_INTERFACE,
"UpdatesChanged",
... | false | false | false | false | false | 0 |
update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_len, int cam_idx)
{
unsigned int ie_len;
struct ndis_802_11_var_ie *pIE;
int supportRateNum = 0;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
pIE = (struct ndis_802... | false | false | false | false | false | 0 |
tree_search_key(TREE *tree, const void *key,
TREE_ELEMENT **parents, TREE_ELEMENT ***last_pos,
enum ha_rkey_function flag, void *custom_arg)
{
int cmp;
TREE_ELEMENT *element= tree->root;
TREE_ELEMENT **last_left_step_parent= NULL, **last_right_step_parent= NULL;
TREE... | false | false | false | false | false | 0 |
ipmi_fru_write_from_bin(struct ipmi_intf * intf,
char * pFileName,
uint8_t fruId)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;
struct fru_info fru;
uint8_t msg_data[4];
uint8_t *pFruBuf;
uint16_t len = 0;
FILE *pFile;
msg_data[0] = fruId;
memset(&req, 0, sizeof (req));
req.msg.netfn = IPMI_NETFN_STORAGE... | false | false | false | false | true | 1 |
crush_bucket_remove_item(struct crush_bucket *b, int item)
{
/* invalidate perm cache */
b->perm_n = 0;
switch (b->alg) {
case CRUSH_BUCKET_UNIFORM:
return crush_remove_uniform_bucket_item((struct crush_bucket_uniform *)b, item);
case CRUSH_BUCKET_LIST:
return crush_remove_list_bucket_item((struct crush_bucke... | false | false | false | false | false | 0 |
TargPrintNode(const GNode *gn, int pass)
{
const LstNode *tln;
if (!OP_NOP(gn->type)) {
printf("#\n");
if (gn == mainTarg) {
printf("# *** MAIN TARGET ***\n");
}
if (pass == 2) {
if (gn->unmade) {
printf("# %d unmade children\n", gn->unmade);
} else {
printf("# No unmade children\n");
}
... | false | false | false | false | false | 0 |
Compute_Trace_ALL(Alignment *align, Work_Data *ework)
{ _Work_Data *work = (_Work_Data *) ework;
Trace_Waves wave;
Path *path;
char *aseq, *bseq;
int M, N;
path = align->path;
aseq = align->aseq;
bseq = align->bseq;
M = path->aepos-path->abpos;
N = path->bepos-path->bbpos;
{ int64 s;
int... | false | false | false | false | false | 0 |
GDALServerSpawnAsyncFinish(GDALServerSpawnedProcess* ssp)
{
if( bRecycleChild && ssp->p->bOK )
{
/* Store the descriptor in a free slot if available for a */
/* later reuse */
CPLMutexHolderD(GDALGetphDMMutex());
for(int i = 0; i < nMaxRecycled; i ++)
{
if( as... | false | false | false | false | false | 0 |
gdk_pixbuf_save_to_buffer (GdkPixbuf *pixbuf,
gchar **buffer,
gsize *buffer_size,
const char *type,
GError **error,
...)
{
gchar **ke... | false | false | false | false | false | 0 |
fr_file_selector_dialog_get_default_size (FrFileSelectorDialog *self,
int *default_width,
int *default_height)
{
int width, height;
g_settings_get (self->priv->settings, PREF_FILE_SELECTOR_WINDOW_SIZE, "(ii)", &width, &height);
if ((width > 0) && (height > 0)) {
*de... | false | false | false | false | false | 0 |
get_num_name( int number )
{
int num = 0;
std::string name = get_name( number );
for( int i = 1; i <= m_id_header; ++i ){
if( get_name( i ) == name ) ++num;
}
return num;
} | false | false | false | false | false | 0 |
gretl_model_get_scalar (const MODEL *pmod, ModelDataIndex idx,
DATASET *dset, int *err)
{
double x = NADBL;
if (pmod == NULL) {
*err = E_BADSTAT;
return x;
}
if (idx == M_GMMCRIT && pmod->ci != GMM) {
*err = E_BADSTAT;
return x;
}
switch (idx) {
case M_ESS:
case M_GM... | false | false | false | false | false | 0 |
aim_rx_data(struct mbo *mbo)
{
const u32 zero = 0;
struct net_dev_context *nd;
char *buf = mbo->virt_address;
u32 len = mbo->processed_length;
struct sk_buff *skb;
struct net_device *dev;
nd = get_net_dev_context(mbo->ifp);
if (!nd || !nd->channels_opened || nd->rx.ch_id != mbo->hdm_channel_id)
return -EIO;
... | false | false | false | false | false | 0 |
__bst_min_value(Node* root)
{
Node* node = root->left;
while(node->left != NULL) {
node = node->left;
}
return node->data;
} | false | false | false | false | false | 0 |
pe_boardname(struct qib_devdata *dd)
{
char *n;
u32 boardid, namelen;
boardid = SYM_FIELD(dd->revision, Revision,
BoardID);
switch (boardid) {
case 2:
n = "InfiniPath_QLE7140";
break;
default:
qib_dev_err(dd, "Unknown 6120 board with ID %u\n", boardid);
n = "Unknown_InfiniPath_6120";
break;
}
... | false | false | false | false | false | 0 |
ensIntronsupportingevidenceNewCpy(
const EnsPIntronsupportingevidence ise)
{
EnsPIntronsupportingevidence pthis = NULL;
if (!ise)
return NULL;
AJNEW0(pthis);
pthis->Use = 1U;
pthis->Identifier = ise->Identifier;
pthis->Adaptor = ise->Adaptor;
pthis->Feature = ensF... | false | false | false | false | false | 0 |
GC_stopped_mark(stop_func)
GC_stop_func stop_func;
{
register int i;
int dummy;
# if defined(PRINTTIMES) || defined(CONDPRINT)
CLOCK_TYPE start_time, current_time;
# endif
# ifdef PRINTTIMES
GET_TIME(start_time);
# endif
# if defined(CONDPRINT) && !defined(PRINTTIMES)
if (GC_print_stats) GET_TIME... | false | false | false | false | false | 0 |
tp_base_contact_list_fill_groups_contact_attributes (GObject *obj,
const GArray *contacts,
GHashTable *attributes_hash)
{
TpBaseContactList *self = _tp_base_connection_find_channel_manager (
(TpBaseConnection *) obj, TP_TYPE_BASE_CONTACT_LIST);
guint i;
g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self))... | false | false | false | false | false | 0 |
zrtp_initializeZrtpEngine(ZrtpContext* zrtpContext,
zrtp_Callbacks *cb, const char* id,
const char* zidFilename,
void* userData,
int32_t mitmMode)
{
std::string clientIdString(id);
zrtpC... | false | false | false | false | false | 0 |
unity_blacklist_manager_get_blacklist_name (UnityBlacklistManager* self) {
gchar* result = NULL;
gchar* app_id = NULL;
UnityMusicPlayer* _tmp0_ = NULL;
GAppInfo* _tmp1_ = NULL;
GAppInfo* _tmp2_ = NULL;
const gchar* _tmp3_ = NULL;
gchar* _tmp4_ = NULL;
const gchar* _tmp5_ = NULL;
gchar** components = NULL;
con... | false | false | false | false | false | 0 |
formExportation(Form::FormMain *form, const QString &patientUid)
{
FormExportation formExport;
// Use FormManager EpisodeModel
EpisodeModel *model = formCore().episodeManager().episodeModel(form);
model->setCurrentPatient(patientUid);
// Get *all* episodes
QModelInde... | false | false | false | false | false | 0 |
snmp_comstr_build(u_char * data,
size_t * length,
u_char * psid,
size_t * slen, long *version, size_t messagelen)
{
long verfix = *version;
u_char *h1 = data;
u_char *h1e;
size_t hlength = *length;
/*
* ... | false | false | false | false | false | 0 |
add(const map<string,float>& domainCount,float count,
const MaybeLog& maybeLog,
std::vector<float>& denseValues,
std::map<std::string,float>& sparseValues) const
{
typedef vector< string >::const_iterator I;
for (I i = m_domain.list.begin(); i != m_domain.list.end(); i++ ) {
map<stri... | false | false | false | false | false | 0 |
SetLineSearchAccuracy(double f)
{
if ( f == m_LineSearchAccuracy )
{
return;
}
m_LineSearchAccuracy = f;
if ( m_OptimizerInitialized )
{
m_VnlOptimizer->line_search_accuracy = m_LineSearchAccuracy;
}
this->Modified();
} | false | false | false | false | false | 0 |
_check_entry_for_updates(ipAddressTable_rowreq_ctx * rowreq_ctx,
void **magic)
{
netsnmp_container *ipaddress_container = (netsnmp_container*)magic[0];
netsnmp_container *to_delete = (netsnmp_container*)magic[1];
/*
* check for matching entry using secondary index.
... | false | false | false | false | false | 0 |
collection_dialog_save_close(gchar *path, CollectionData *cd)
{
if (!path) path = cd->path;
if (!path) path = cd->name;
collection_save_or_load_dialog(path, DIALOG_SAVE_CLOSE, cd);
} | false | false | false | false | false | 0 |
dds_db_open(
BackendDB *be,
ConfigReply *cr )
{
slap_overinst *on = (slap_overinst *)be->bd_info;
dds_info_t *di = on->on_bi.bi_private;
int rc = 0;
void *thrctx = ldap_pvt_thread_pool_context();
if ( slapMode & SLAP_TOOL_MODE )
return 0;
if ( DDS_OFF( di ) ) {
goto done;
}
if ( SLAP_SINGLE_SHADOW( b... | false | false | false | false | false | 0 |
on_view_path_activated (GdMainView *self,
GtkTreePath *path)
{
GdkModifierType state;
gtk_get_current_event_state (&state);
if (self->priv->selection_mode || (state & GDK_CONTROL_MASK) != 0)
{
if (!self->priv->selection_mode)
g_signal_emit (self, signals[SELECTION_MODE_REQUEST... | false | false | false | false | false | 0 |
aclParseHeader(void *data)
{
char *t;
acl_hdr_data **hd = data;
acl_hdr_data *q;
t = strtokFile();
if (NULL == t) {
debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line);
debug(28, 0) ("aclParseHeader: No data defined '%s'\n", t);
return;
}
q = xcalloc(1, size... | false | false | false | false | false | 0 |
q_facet_tension_value(f_info)
struct qinfo *f_info;
{ REAL area;
int i,j,k;
REAL diag[MAXCOORD];
REAL D[MAXCOORD]; /* diag^-1 */
REAL U[MAXCOORD][MAXCOORD];
if ( web.modeltype == QUADRATIC ) return q_facet_tension_q(f_info);
if ( web.modeltype == LAGRANGE )
return lagrange_facet_tension_value(f_inf... | false | false | false | false | false | 0 |
gl646_init_regs_for_shading (Genesys_Device * dev)
{
SANE_Status status = SANE_STATUS_GOOD;
Genesys_Settings settings;
/* 1: no half_ccd, 2: use half number of pixels */
int half_ccd = 1;
int cksel = 1;
DBG (DBG_proc, "gl646_init_register_for_shading: start\n");
/* when shading all (full width) line, we... | false | true | false | false | false | 1 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Number of Points per Piece: "
<< this->NumberOfPointsPerPiece << "\n";
os << indent << "Number of Pieces: "
<< this->NumberOfPieces << "\n";
os << indent << "Memory Limit: "
<< this->MemoryLi... | false | false | false | false | false | 0 |
i2400m_roq_queue_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq,
struct sk_buff * skb, unsigned sn)
{
struct device *dev = i2400m_dev(i2400m);
unsigned nsn, old_ws, len;
d_fnstart(2, dev, "(i2400m %p roq %p skb %p sn %u)\n",
i2400m, roq, skb, sn);
len = skb_queue_len(&roq->queue);
nsn = __i2400m_... | false | false | false | false | false | 0 |
multi_pxo_com_init(int input_len)
{
int idx;
// create the interface window
Multi_pxo_com_window.create(0, 0, gr_screen.max_w,gr_screen.max_h, 0);
Multi_pxo_com_window.set_mask_bmap(Multi_pxo_com_mask_fname[gr_screen.res]);
// create the interface buttons
for(idx=0; idx<MULTI_PXO_COM_NUM_BUTTONS; idx++){
//... | false | false | false | false | false | 0 |
gst_dvd_sub_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
{
GstDvdSubParse *parse = GST_DVD_SUB_PARSE (parent);
GstAdapter *adapter;
GstBuffer *outbuf = NULL;
GstFlowReturn ret = GST_FLOW_OK;
adapter = parse->adapter;
GST_LOG_OBJECT (parse, "%" G_GSIZE_FORMAT " bytes, ts: %" GST_TIME_FOR... | false | false | false | false | false | 0 |
write_pcm_s32(struct amdtp_stream *s,
struct snd_pcm_substream *pcm,
__be32 *buffer, unsigned int frames)
{
struct amdtp_am824 *p = s->protocol;
struct snd_pcm_runtime *runtime = pcm->runtime;
unsigned int channels, remaining_frames, i, c;
const u32 *src;
channels = p->pcm_channels;
src = (void *)runti... | false | false | false | false | false | 0 |
ipmi_dump_lan_packet_ipmb (int fd,
const char *prefix,
const char *hdr,
const char *trlr,
const void *pkt,
unsigned int pkt_len,
fiid_template_t tmpl_lan_msg_... | false | false | false | false | false | 0 |
method_B3(const int *account, int *weight) {
if (account[0] < 9) {
number2Array("0007654320", weight);
return algo01(11, weight, false, 10, account);
} // variant 1 (method "32")
if (account[0] == 9) {
number2Array("4327654320", weight);
return algo01(11, weight, false, 10, account);
} // variant 2 ... | false | false | false | false | false | 0 |
cm_get_contexts_reply(DBusPendingCall *call, void *user_data)
{
struct modem_data *modem = user_data;
DBusMessageIter array, dict, entry, value;
DBusMessage *reply;
DBusError error;
DBG("%s", modem->path);
modem->call_get_contexts = NULL;
reply = dbus_pending_call_steal_reply(call);
dbus_error_init(&error);... | false | false | false | false | false | 0 |
get_sum_y2 (MODEL *pmod, int ylagno, const DATASET *dset)
{
const double *ylag = dset->Z[ylagno];
double sumy2 = 0;
int t;
for (t=pmod->t1; t<=pmod->t2; t++) {
sumy2 += ylag[t] * ylag[t];
}
return sumy2;
} | false | false | false | false | false | 0 |
update_children_level (FttCell * parent)
{
if (!FTT_CELL_IS_LEAF (parent)) {
FttOct * oct = parent->children;
guint n;
oct->level = ftt_cell_level (parent);
for (n = 0; n < FTT_CELLS; n++)
if (!FTT_CELL_IS_DESTROYED (&(oct->cell[n])))
update_children_level (&(oct->cell[n]));
}
} | false | false | false | false | false | 0 |
ass_drawing_free(ASS_Drawing* drawing)
{
if (drawing) {
free(drawing->text);
FT_Outline_Done(drawing->ftlibrary, &drawing->outline);
}
free(drawing);
} | false | false | false | false | false | 0 |
prealloc_get_cell(struct prealloc *p)
{
struct dm_bio_prison_cell *r = NULL;
if (p->cell1) {
r = p->cell1;
p->cell1 = NULL;
} else if (p->cell2) {
r = p->cell2;
p->cell2 = NULL;
} else
BUG();
return r;
} | false | false | false | false | false | 0 |
visu_data_getFilesAsLabel(const VisuData *data)
{
GList *lst;
GString *str;
gchar *s;
g_return_val_if_fail(VISU_IS_DATA(data), (gchar*)0);
if (!data->priv->files)
return (gchar*)0;
DBG_fprintf(stderr, "Visu Data: retrieve all filenames"
" from the VisuData %p.\n", (gpointer)data);
str = g_st... | false | false | false | false | false | 0 |
_remove_scroll_row_timeout(GtkWidget *widget) {
g_return_if_fail(widget);
g_object_set_data(G_OBJECT(widget), "scroll_row_timeout", NULL);
g_object_set_data(G_OBJECT(widget), "scroll_row_times", NULL);
} | false | false | false | false | false | 0 |
proc_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat)
{
struct inode *inode = d_inode(dentry);
struct proc_dir_entry *de = PDE(inode);
if (de && de->nlink)
set_nlink(inode, de->nlink);
generic_fillattr(inode, stat);
return 0;
} | false | false | false | false | false | 0 |
expose_event_handler(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
{
cairo_t *cr;
cairo_rectangle_t s;
GdkRectangle *rects;
int n_rects;
int i;
term_data *td;
int t = -1;
const char *str;
str = gtk_widget_get_name(widget);
sscanf(str, "term_drawing_area_%d", &t);
if (t != -1)
{
td = &d... | false | false | false | false | false | 0 |
_queue_append(Evas_Object *obj, int command, Evas_Object *icon, Evas_Object *end,
const char *label, int header, void (*func)(void *data), void *data,
const char *val, int relative, int use_relative, int item)
{
E_Widget_Data *wd;
E_Widget_Queue_Item *qi;
wd = e_widget_data_get(obj... | false | false | false | false | false | 0 |
slotTurn(QDataStream &in, bool turn)
{
QByteArray buffer;
QDataStream out(&buffer,QIODevice::WriteOnly);
//fprintf(stderr," KComputer::slotTurn(turn=%d)\n",turn);
//fflush(stderr);
if (turn)
{
// Create a move
MoveResult result = think(in,out,false);
int id = KGameMessage::IdPlayerI... | false | false | false | false | false | 0 |
_wapi_handle_check_share_by_pid (struct _WapiFileShare *share_info)
{
#if defined(__native_client__)
g_assert_not_reached ();
#elif defined(HAVE_KILL)
if (kill (share_info->opened_by_pid, 0) == -1 &&
(errno == ESRCH ||
errno == EPERM)) {
/* It's gone completely (or there's a new process
* owned by som... | false | false | false | false | false | 0 |
GenerateJumpTable() {
for (int i = 0; i < jump_table_.length(); i++) {
JumpTableEntry* info = jump_table_[i];
__ bind(&(info->label_));
__ Jump(info->address_, RelocInfo::RUNTIME_ENTRY);
}
return !is_aborted();
} | false | false | false | false | false | 0 |
addLanguageExtensionMap (const langType language,
const char* extension)
{
vString* const str = vStringNewInit (extension);
Assert (0 <= language && language < (int) LanguageCount);
stringListAdd (LanguageTable [language]->currentExtensions, str);
} | false | false | false | false | false | 0 |
rate_value(int rate, u8 *value)
{
int i;
for (i = 0; i < ARRAY_SIZE(rate_table); i++) {
if (rate_table[i].rate >= rate) {
*value = rate_table[i].sr;
return 0;
}
}
*value = rate_table[0].sr;
return -EINVAL;
} | false | false | false | false | false | 0 |
EmitEnterBlock(JSContext *cx, JSParseNode *pn, JSCodeGenerator *cg)
{
JS_ASSERT(PN_TYPE(pn) == TOK_LEXICALSCOPE);
if (!EmitObjectOp(cx, pn->pn_objbox, JSOP_ENTERBLOCK, cg))
return false;
JSObject *blockObj = pn->pn_objbox->object;
jsint depth = AdjustBlockSlot(cx, cg, OBJ_BLOCK_DEPTH(cx, blockO... | false | false | false | false | false | 0 |
loadFile(const char* filename)
{
FILE* file = fopen(filename, "rt");
if( !file )
{
printf("Failed to open %s for reading\n", filename);
return 0;
}
fseek(file, 0, SEEK_END);
const int size = ftell(file);
fseek(file, 0, SEEK_SET);
char* result = new char[size+1];
const int count = (int)fread(result, 1, si... | false | false | false | false | false | 0 |
synusb_post_reset(struct usb_interface *intf)
{
struct synusb *synusb = usb_get_intfdata(intf);
struct input_dev *input_dev = synusb->input;
int retval = 0;
if ((input_dev->users || (synusb->flags & SYNUSB_IO_ALWAYS)) &&
usb_submit_urb(synusb->urb, GFP_NOIO) < 0) {
retval = -EIO;
}
mutex_unlock(&input_de... | false | false | false | false | false | 0 |
dlmfs_get_inode(struct inode *parent,
struct dentry *dentry,
umode_t mode)
{
struct super_block *sb = parent->i_sb;
struct inode * inode = new_inode(sb);
struct dlmfs_inode_private *ip;
if (!inode)
return NULL;
inode->i_ino = get_next_ino();
inode_init_owner(inode, parent, mode);
inode->i_a... | false | false | false | false | false | 0 |
start_epoll(int port, EpollSocketWatcher &socket_handler, int backlog, int max_events) {
_backlog = backlog;
_port = port;
if (_thread_pool == NULL) {
int core_size = get_nprocs();
LOG_INFO("thread pool not set, we will build for core size:%d", core_size);
_thread_pool = new ThreadP... | false | false | false | false | false | 0 |
mapi_table_fill(struct mapi_table *tbl, const mapi_proc *procs)
{
const struct mapi_table *noop = table_get_noop();
int i;
for (i = 0; i < mapi_num_stubs; i++) {
const struct mapi_stub *stub = mapi_stub_map[i];
int slot = stub_get_slot(stub);
mapi_func func = (mapi_func) procs[i];
if ... | false | false | false | false | false | 0 |
char_emphasis(
struct Blob *ob,
struct render *rndr,
char *data,
size_t offset,
size_t size
){
char c = data[0];
size_t ret;
if( size>2 && data[1]!=c ){
/* whitespace cannot follow an opening emphasis */
if( data[1]==' '
|| data[1]=='\t'
|| data[1]=='\n'
|| (ret = parse_emph1(ob,... | false | false | false | false | false | 0 |
gst_m3u8_client_get_duration (GstM3U8Client * client)
{
GstClockTime duration = 0;
g_return_val_if_fail (client != NULL, GST_CLOCK_TIME_NONE);
GST_M3U8_CLIENT_LOCK (client);
/* We can only get the duration for on-demand streams */
if (!client->current->endlist) {
GST_M3U8_CLIENT_UNLOCK (client);
ret... | false | false | false | false | false | 0 |
WidenVecOp_STORE(SDNode *N) {
// We have to widen the value but we want only to store the original
// vector type.
StoreSDNode *ST = cast<StoreSDNode>(N);
SmallVector<SDValue, 16> StChain;
if (ST->isTruncatingStore())
GenWidenVectorTruncStores(StChain, ST);
else
GenWidenVectorStores(StChain, ST);
... | false | false | false | false | false | 0 |
attr_cache_lock(git_attr_cache *cache)
{
GIT_UNUSED(cache); /* avoid warning if threading is off */
if (git_mutex_lock(&cache->lock) < 0) {
giterr_set(GITERR_OS, "Unable to get attr cache lock");
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
step_next(struct step *step, struct tree *ctx,
struct tree *node) {
while (node != NULL) {
switch (step->axis) {
case SELF:
node = NULL;
break;
case CHILD:
node = node->next;
break;
case DESCENDANT:
... | false | false | false | false | false | 0 |
user_in_group(struct user *user, struct group *group)
{
struct group_assignment *ga;
if (user == NULL || group == NULL) /* either is already removed */
return (0);
if (user_is_invalidated(user))
return (0);
if (group_is_invalidated(group))
return (0);
for (ga = user->groups.group_next; ga != &user->groups... | false | false | false | false | false | 0 |
rb_quad_pack(buf, val)
char *buf;
VALUE val;
{
long len;
memset(buf, 0, QUAD_SIZE);
val = rb_to_int(val);
if (FIXNUM_P(val)) {
val = rb_int2big(FIX2LONG(val));
}
len = RBIGNUM(val)->len * SIZEOF_BDIGITS;
if (len > QUAD_SIZE) {
rb_raise(rb_eRangeError, "bignum too big to convert in... | false | false | false | false | false | 0 |
sd_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
int fr_h_sz = 0, lum_offset = 0, len_after_sof = 0;
struct sd *sd = (struct sd *) gspca_dev;
struct cam *cam = &gspca_dev->cam;
u8 *sof;
sof = find_sof(gspca_dev, data, len);
if (sof) {
if (sd->bri... | false | false | false | false | false | 0 |
parse_include (pfile)
cpp_reader *pfile;
{
const unsigned char *dir;
const cpp_token *header;
if (pfile->directive == &dtable[T_PRAGMA])
dir = U"pragma dependency";
else
dir = pfile->directive->name;
/* Allow macro expansion. */
header = get_token_no_padding (pfile);
if (header->type != CP... | false | false | false | false | false | 0 |
floatformat_ibm_long_double_is_valid (const struct floatformat *fmt,
const void *from)
{
const unsigned char *ufrom = (const unsigned char *) from;
const struct floatformat *hfmt = fmt->split_half;
long top_exp, bot_exp;
int top_nan = 0;
top_exp = get_field (ufrom, hfmt->byteorder, hfmt->totalsize,... | false | false | false | false | false | 0 |
mftxt_timesig(nn,dd,cc,bb)
{
int denom = 1;
while ( dd-- > 0 )
denom *= 2;
if (prtime()) return;
printf("Metatext time signature=%d/%d\n",nn,denom);
/* printf("Time signature=%d/%d MIDI-clocks/click=%d \
32nd-notes/24-MIDI-clocks=%d\n", nn,denom,cc,bb); */
} | false | false | false | false | false | 0 |
search_missing_combinations () {
char buf[APPEARS_SEQSIZE+1 ];
uint32_t cmp;
uint32_t i,j;
uint32_t sp[4];
int match;
for (i=0;i<SP_TB_NUM ;i++){
sp[0]=(Table_SP[i]>>BITS_PER_TOKEN*0) & masks[0];
sp[1]=(Table_SP[i]>>BITS_PER_TOKEN*1) & masks[0];
// d_print (sp[1], buf);
sp[2]=(Table_SP[i]>>BITS_PER_TOKEN*2) & mas... | false | false | false | false | false | 0 |
InvalidatePath(const CServer& server, const CServerPath& path, const wxString& subdir /*=_T("")*/)
{
tCacheIterator iter = m_cache.find(server);
if (iter == m_cache.end())
return;
CSourcePath sourcePath;
sourcePath.source = path;
sourcePath.subdir = subdir;
CServerPath target;
tServerCacheIterator serverIte... | false | false | false | false | false | 0 |
runOnMachineFunction(MachineFunction &Fn) {
MRI = &Fn.getRegInfo();
TII = Fn.getTarget().getInstrInfo();
// Find dead PHI cycles and PHI cycles that can be replaced by a single
// value. InstCombine does these optimizations, but DAG legalization may
// introduce new opportunities, e.g., when i64 values are ... | false | false | false | false | false | 0 |
enumProperties(gem::Properties&readable,
gem::Properties&writeable) {
/*
framerate
mode
operationmode
isospeed
isochannel
transmission
oneshot
multishot
*/
gem::any type;
std::string key;
readable.clear();
writeable.clear();
key="framerate"; type=0;
readable .... | false | false | false | false | false | 0 |
gst_rtp_session_chain_send_rtp_common (GstRtpSession * rtpsession,
gpointer data, gboolean is_list)
{
GstRtpSessionPrivate *priv;
GstFlowReturn ret;
GstClockTime timestamp, running_time;
GstClockTime current_time;
priv = rtpsession->priv;
GST_LOG_OBJECT (rtpsession, "received RTP %s", is_list ? "list"... | false | false | false | false | false | 0 |
pk_transaction_past_get_timestamp (PkTransactionPast *past)
{
GDateTime *datetime;
gint64 timestamp;
g_return_val_if_fail (PK_IS_TRANSACTION_PAST (past), 0);
datetime = pk_transaction_past_get_datetime (past);
if (datetime == NULL)
return 0;
timestamp = g_date_time_to_unix (datetime);
g_date_time_unref (date... | false | false | false | false | false | 0 |
show(MARK *m)
{
mvaddch(m->y, m->x, m->value);
if (m->mode == 0) { /* along the x-direction */
m->x += m->inc;
if (m->x >= COLS) {
m->x = COLS - 1;
m->inc = -m->dir * m->inc;
m->y += m->inc;
m->mode = 1;
} else if (m->x < 0) {
m->x = 0;
m->inc = -m->dir * m->inc;
m->y += m... | false | false | false | false | false | 0 |
_secret_schema_ref_if_nonstatic (const SecretSchema *schema)
{
if (schema && g_atomic_int_get (&schema->reserved) > 0)
secret_schema_ref ((SecretSchema *)schema);
return schema;
} | false | false | false | false | false | 0 |
crypto_kw_alloc(struct rtattr **tb)
{
struct crypto_instance *inst = NULL;
struct crypto_alg *alg = NULL;
int err;
err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER);
if (err)
return ERR_PTR(err);
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
CRYPTO_ALG_TYPE_MASK);
if (IS_ERR(alg))
r... | false | false | false | false | false | 0 |
int2roman (int num)
{
#define ROMAN_BUFF_LEN 512
/* buffer for storing conversions */
char roman_string[ROMAN_BUFF_LEN];
/* wrap long2roman_r() with library buffer */
char *result = int2roman_r(num, roman_string, ROMAN_BUFF_LEN);
if (!result)
return NULL;
return g_strdup(r... | false | false | false | false | false | 0 |
platform_lcd_match(struct lcd_device *lcd, struct fb_info *info)
{
struct platform_lcd *plcd = to_our_lcd(lcd);
struct plat_lcd_data *pdata = plcd->pdata;
if (pdata->match_fb)
return pdata->match_fb(pdata, info);
return plcd->us->parent == info->device;
} | 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.