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
mtdswap_handle_badblock(struct mtdswap_dev *d, struct swap_eb *eb) { int ret; loff_t offset; d->spare_eblks--; eb->flags |= EBLOCK_BAD; mtdswap_eb_detach(d, eb); eb->root = NULL; /* badblocks not supported */ if (!mtd_can_have_bb(d->mtd)) return 1; offset = mtdswap_eb_offset(d, eb); dev_warn(d->dev, "Mar...
false
false
false
false
false
0
Perl_try_amagic_bin(pTHX_ int method, int flags) { dVAR; dSP; SV* const left = TOPm1s; SV* const right = TOPs; SvGETMAGIC(left); if (left != right) SvGETMAGIC(right); if (SvAMAGIC(left) || SvAMAGIC(right)) { SV * const tmpsv = amagic_call(left, right, method, ((flags & AMGf_assign)...
false
false
false
false
false
0
ShowStretch(MapX,MapY,RefX,RefY) /* Called from rubber banding routine. */ int RefX,RefY,MapX,MapY; { struct ks *SQDesc, *SQDesc1; struct ka OBB, BB; struct p *Path, *pp; int Layer; int Width; for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc) { if (SQDesc->ksPointer->oInfo !=...
false
false
false
false
false
0
resolveSystemId(const XML_Char *base, const XML_Char *systemId, XML_Char **toFree) { XML_Char *s; *toFree = 0; if (!base || *systemId == T('/') #if (defined(WIN32) || defined(__WATCOMC__)) || *systemId == T('\\') || (isAsciiLetter(systemId[0]) && systemId[1] == T(':')) #endif ...
false
false
false
false
false
0
operator>>(QDataStream &in, Credentials &myObj) { #ifdef ENABLE_REMOTE_WIDGETS if (!QCA::isSupported(REQUIRED_FEATURES)) { kWarning() << "QCA doesn't support " << REQUIRED_FEATURES; return in; } QString privateKeyString; QString publicKeyString; uint version; in >> version >> m...
false
false
false
false
false
0
post_force(int vflag) { double **f = atom->f; int *mask = atom->mask; int nlocal = atom->nlocal; double dot; for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { dot = f[i][0]*xdir + f[i][1]*ydir + f[i][2]*zdir; f[i][0] = dot * xdir; f[i][1] = dot * ydir; f[i][2] = dot * zdi...
false
false
false
false
false
0
CheckFileSkip(void) { // I sometimes add code here to only process images based on certain // criteria - for example, only to convert non progressive Jpegs to progressives, etc.. if (FilterModel){ // Filtering processing by camera model. // This feature is useful when pictures from multiple...
false
false
false
false
false
0
do_test(struct cmd_context *ctx) { enum { ONLINE=0, OFFLINE, EXTERNAL_LB, } test_type; int err; struct ethtool_test *test; struct ethtool_gstrings *strings; if (ctx->argc > 1) exit_bad_args(); if (ctx->argc == 1) { if (!strcmp(ctx->argp[0], "online")) { test_type = ONLINE; } else if (!strcmp(*ct...
false
false
false
false
false
0
plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "dvdsubdec", GST_RANK_NONE, GST_TYPE_DVD_SUB_DEC) || !gst_element_register (plugin, "dvdsubparse", GST_RANK_NONE, GST_TYPE_DVD_SUB_PARSE)) { return FALSE; } GST_DEBUG_CATEGORY_INIT (gst_dvd_sub_dec_debug, "dvdsubd...
false
false
false
false
false
0
toString(bool rotate) const { int fields[32]; int it; for(int i=0; i<32; i++) { it = item(i); if(rotate) fields[31-i] = (~it&7)-1; else fields[i] = it; } QString str; for(int i=0; i<32; i++) str += QString("").sprintf("%.2u", fields[i]); return str; }
false
false
false
false
false
0
hfc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { int err = -ENOMEM; struct hfc_pci *card; struct _hfc_map *m = (struct _hfc_map *)ent->driver_data; card = kzalloc(sizeof(struct hfc_pci), GFP_ATOMIC); if (!card) { printk(KERN_ERR "No kmem for HFC card\n"); return err; } card->pdev = pdev; ...
false
false
false
false
false
0
PrintBool ( Obj bool ) { if ( bool == True ) { Pr( "true", 0L, 0L ); } else if ( bool == False ) { Pr( "false", 0L, 0L ); } else if ( bool == Fail ) { Pr( "fail", 0L, 0L ); } else if ( bool == SFail ) { Pr( "SuPeRfail", 0L, 0L ); } ...
false
false
false
false
false
0
fp_value_constructor4(fp_value_ty *this, time_t a1, time_t a2, string_ty *a3, string_ty *a4) { trace(("fp_value_constructor4(this = %p, oldest = %ld, youngest = %ld, " "cfp = \"%s\", ifp = \"%s\")\n{\n", this, a1, a2, (a3 ? a3->str_text : ""), (a4 ? a4->str_text : ""))); if (a1 > a2) ...
false
false
false
false
false
0
manageSslStruct(MprSsl *ssl, int flags) { if (flags & MPR_MANAGE_MARK) { mprMark(ssl->key); mprMark(ssl->cert); mprMark(ssl->keyFile); mprMark(ssl->certFile); mprMark(ssl->caFile); mprMark(ssl->caPath); mprMark(ssl->ciphers); } else if (flags & MPR_MANAGE...
false
false
false
false
false
0
tick_in( SAMPLE * s ) { if( !m_data ) return FALSE; *s = *m_ptr_curr++; return TRUE; }
false
false
false
false
false
0
increment_address(Bit8u channel) { BX_SELECTED_CONTROLLER(channel).sector_count--; if (BX_SELECTED_CONTROLLER(channel).lba_mode) { off_t current_address; calculate_logical_address(channel, &current_address); current_address++; BX_SELECTED_CONTROLLER(channel).head_no = (Bit8u)((current_a...
false
false
false
false
false
0
smsc911x_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct smsc911x_data *pdata = netdev_priv(dev); if (!netif_running(dev) || !pdata->phy_dev) return -EINVAL; return phy_mii_ioctl(pdata->phy_dev, ifr, cmd); }
false
false
false
false
false
0
go_pixbuf_finalize (GObject *obj) { GOPixbuf *pixbuf = GO_PIXBUF (obj); if (pixbuf->pixbuf) g_object_unref (pixbuf->pixbuf); if (pixbuf->surface) cairo_surface_destroy (pixbuf->surface); (parent_klass->finalize) (obj); }
false
false
false
false
false
0
alloc_chunk(git_revwalk *walk) { void *chunk; chunk = git__calloc(COMMITS_PER_CHUNK, CHUNK_STEP); if (chunk == NULL) return GIT_ENOMEM; walk->chunk_size = 0; return git_vector_insert(&walk->memory_alloc, chunk); }
false
false
false
false
false
0
xmalloc_freecore(void *ptr, size_t len) { g_assert(ptr != NULL); g_assert(size_is_positive(len)); g_assert(xmalloc_round(len) == len); /* * If the address lies within the break, there's nothing to do, unless * the freed segment is at the end of the break. The memory is not lost * forever: it should be put b...
false
false
false
false
false
0
EndModal(int retCode) { if (retCode == wxID_OK) { m_Project->SetTitle(XRCCTRL(*this, "txtProjectName", wxTextCtrl)->GetValue()); m_Project->SetPlatforms(GetPlatformsFromString(XRCCTRL(*this, "txtPlatformProj", wxTextCtrl)->GetValue())); UpdateNameInTree(m_Project); m_Project->Set...
false
false
false
false
false
0
makeMatrixCameraRelative3x4( float *mat3x4, size_t numFloats ) { const Vector3 &cameraRelativePosition = mCurrentCamera->getDerivedPosition(); for( size_t i=0; i<numFloats >> 2; i += 3 ) { const Vector3 worldTrans( mat3x4[(i+0) * 4 + 3], mat3x4[(i+1) * 4 + 3], ...
false
false
false
false
false
0
check_closed(win, fp, use_levelp, level, maybe_smallp, lnum_off) win_T *win; fold_T *fp; int *use_levelp; /* TRUE: outer fold had FD_LEVEL */ int level; /* folding depth */ int *maybe_smallp; /* TRUE: outer this had fd_small == MAYBE */ linenr_T lnum_off; /* line number offse...
false
false
false
false
false
0
Frame_Time (void) { static float previous_time; if ( SkipAFewFrames ) return previous_time; previous_time = (1.0 / FPSover1); return (previous_time); }
false
false
false
false
false
0
games_scores_backend_get_lock (GamesScoresBackend * self) { gint error; if (self->priv->fd != -1) { /* Assume we already have the lock and rewind the file to * the beginning. */ setgid_io_seek (self->priv->fd, 0, SEEK_SET); return TRUE; /* Assume we already have the lock. */ } ...
false
false
false
false
false
0
hwloc_nolibxml_import_diff(const char *xmlpath, const char *xmlbuffer, int xmlbuflen, hwloc_topology_diff_t *firstdiffp, char **refnamep) { struct hwloc__xml_import_state_s state, childstate; hwloc__nolibxml_import_state_data_t nstate = (void*) state.data; char *refname = NULL; char *buffer, *tmp, *tag; ...
false
true
false
false
true
1
InverseCDF(double p, const ParametersType & params) { if ( params.GetSize() != 1 ) { itkGenericExceptionMacro( "Invalid number of parameters to describe distribution. Expected 1 parameter, but got " << params.size() << " parameters."); } return ChiSquareDistribution::InverseCDF( p, sta...
false
false
false
false
false
0
deleteWidget(QWidget *widget) { Q_D(KSelectAction); if (QToolButton *toolButton = qobject_cast<QToolButton *>(widget)) d->m_buttons.removeAll(toolButton); else if (KComboBox *comboBox = qobject_cast<KComboBox *>(widget)) d->m_comboBoxes.removeAll(comboBox); KAction::deleteWidget(widget);...
false
false
false
false
false
0
glade_gtk_action_widgets_get_area (GladeWidget *widget, gchar *action_area) { GladeWidgetAdaptor *adaptor = glade_widget_get_adaptor (widget); GObject *object; object = glade_widget_adaptor_get_internal_child (adaptor, glade_widget_get_object (widget), ...
false
false
false
false
false
0
system_n_restrictions (const equation_system *sys) { int nr = 0; if (sys->R != NULL && (sys->flags & SYSTEM_RESTRICT)) { nr = gretl_matrix_rows(sys->R); } return nr; }
false
false
false
false
false
0
_fill_data(E_Config_Dialog_Data *cfdata) { char path[4096]; size_t len; cfdata->show_splash = e_config->show_splash; cfdata->splash = NULL; if (e_config->init_default_theme) cfdata->splash = strdup(e_config->init_default_theme); else { e_prefix_data_concat_static(path, "data/themes/...
false
false
false
false
false
0
ambigousTrack( Meta::TrackList tracks, QString oldUrl ) { Q_UNUSED( tracks ); QString text; // TODO: wording; etc. text = i18nc( "Track has been matched ambigously, format: Url", "Multiple ambiguous matches found for <b><font color='red'>%1</font></b>, has been discarded.", oldUrl ); ...
false
false
false
false
false
0
qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha) { struct qla_hw_data *ha = vha->hw; scsi_qla_host_t *vp; unsigned long flags = 0; if (vha->vp_idx) return; if (list_empty(&ha->vp_list)) return; clear_bit(VP_DPC_NEEDED, &vha->dpc_flags); if (!(ha->current_topology & ISP_CFG_F)) return; spin_lock_irqsave(&h...
false
false
false
false
false
0
zMakeEasFrom3 (const zFeatureFactory *fac, coor_t pos, zSFList* sfl) { coor_t i, begin, end; zSfeature* exon; if (zGetUScore(fac->scan[START],pos+1) > MINIMUM_TWINSCAN_SIGNAL_SCORE) { /* min size 9 */ end = pos - 7; /* prevents overlap with start codon model */ /* and allows enough...
false
false
false
false
false
0
add_op_parse(CODE code) { if (!mul_op_parse(code)) return 0; while (1) { int op; if (CHKOP("+")) op = OP_PLUS; else if (CHECK('-')) op = OP_MINUS; else break; DROP(); gen(code, OP_PUSH); if (!mul_op_parse(code)) return 0; gen(code, op); } return 1; }
false
false
false
false
false
0
setRowColNames (const CoinMpsIO &mps) { int nameDiscipline,m,n ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDi...
false
false
false
false
false
0
mark_used_regs_combine (rtx x) { RTX_CODE code = GET_CODE (x); unsigned int regno; int i; switch (code) { case LABEL_REF: case SYMBOL_REF: case CONST: CASE_CONST_ANY: case PC: case ADDR_VEC: case ADDR_DIFF_VEC: case ASM_INPUT: #ifdef HAVE_cc0 /* CC0 must die in the insn ...
false
false
false
false
false
0
_gcry_cipher_setiv (gcry_cipher_hd_t hd, const void *iv, size_t ivlen) { gcry_err_code_t rc = 0; switch (hd->mode) { case GCRY_CIPHER_MODE_CCM: rc = _gcry_cipher_ccm_set_nonce (hd, iv, ivlen); break; default: rc = cipher_setiv (hd, iv, ivlen); break; } return ...
false
false
false
false
false
0
DecodeIntPairRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler::Success; if (RegNo > 31) return MCDisassembler::Fail; if ((RegNo & 1)) S = MCDisassembler::SoftFail; unsigned RegisterPair = IntPairDec...
false
false
false
false
false
0
dib8096p_agc_startup(struct dvb_frontend *fe) { struct dvb_usb_adapter *adap = fe->dvb->priv; struct dib0700_adapter_state *state = adap->priv; struct dibx000_bandwidth_config pll; struct dibx090p_best_adc adc; u16 target; int ret; ret = state->set_param_save(fe); if (ret < 0) return ret; memset(&pll, 0, si...
false
false
false
false
false
0
fn_datetime_equal(fs_query *q, fs_value a, fs_value b) { if (a.attr == fs_c.xsd_datetime && b.attr == fs_c.xsd_datetime && (a.in != -1 || b.in != -1)) return fs_value_boolean(a.in == b.in); if (a.lex && b.lex) { return fs_value_boolean(iso8601_compare(a.lex, b.lex) == 0); } return fs_...
false
false
false
false
false
0
tgt_agent_rw_agent_state(struct fw_card *card, int tcode, void *data, struct sbp_target_agent *agent) { int state; switch (tcode) { case TCODE_READ_QUADLET_REQUEST: pr_debug("tgt_agent AGENT_STATE READ\n"); spin_lock_bh(&agent->lock); state = agent->state; spin_unlock_bh(&agent->lock); *(__be32 *)data...
false
false
false
false
false
0
NewFunctionCT ( UInt type, UInt size, const Char * name_c, Int narg, const Char * nams_c, ObjFunc hdlr ) { Obj name_o; /* name as an object */ Obj nams_o; ...
false
false
false
false
false
0
command_groups_getInfo(flickcurl* fc, int argc, char *argv[]) { flickcurl_group* group = NULL; const char* group_id = argv[1]; const char* lang = argv[2]; group = flickcurl_groups_getInfo(fc, group_id, lang); if(group) { command_print_group(group); flickcurl_free_group(group); } return (grou...
false
false
false
false
false
0
ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) { int transfer, err; const void *data = hif_dev->fw_data; size_t len = hif_dev->fw_size; u32 addr = AR9271_FIRMWARE; u8 *buf = kzalloc(4096, GFP_KERNEL); u32 firm_offset; if (!buf) return -ENOMEM; while (len) { transfer = min_t(size_t, len, 4096); ...
false
false
false
false
false
0
incomingConnection(int socketDescriptor) { Connection *connection = new Connection(this); connection->setSocketDescriptor(socketDescriptor); emit newConnection(connection); }
false
false
false
false
false
0
parse_http_response(char *buf, int len, struct mg_request_info *ri) { int result = parse_http_message(buf, len, ri); return result > 0 && !strncmp(ri->request_method, "HTTP/", 5) ? result : -1; }
false
false
false
false
false
0
e_hints_window_size_get(E_Border *bd) { int ret; unsigned int sizes[4]; memset(sizes, 0, sizeof(sizes)); ret = ecore_x_window_prop_card32_get(bd->client.win, E_ATOM_BORDER_SIZE, sizes, 4); if (ret != 4) return 0; bd->x = sizes[0]; bd->y = sizes[1]; ...
false
false
false
false
false
0
minimum_disc_with_1point( CL_Circlef &smalldisc, const std::vector<CL_Pointf> &points, int start, unsigned int i) { // Get first disc (between the first point and `points[i]`) smalldisc.position = CL_LineMath::midpoint(points[start], points[i]); smalldisc.radius = points[start].distance(points[i]) / 2.0; fo...
false
false
false
false
false
0
js_GetCallVarChecked(JSContext *cx, JSObject *obj, jsid id, jsval *vp) { if (!CallPropertyOp(cx, obj, id, vp, JSCPK_VAR, JS_FALSE)) return JS_FALSE; return CheckForEscapingClosure(cx, obj, vp); }
false
false
false
false
false
0
port_renamed( struct graph * graph_ptr, uint64_t client_id, uint64_t port_id, const char * old_port_name, const char * new_port_name) { struct list_head * node_ptr; struct monitor * monitor_ptr; list_for_each(node_ptr, &graph_ptr->monitors) { monitor_ptr = list_entry(node_ptr, struct monitor, sib...
false
false
false
false
false
0
move_promote(int move) { int code, piece; ASSERT(move_is_ok(move)); ASSERT(MOVE_IS_PROMOTE(move)); code = (move >> 12) & 3; piece = PromotePiece[code]; if (SQUARE_RANK(MOVE_TO(move)) == Rank8) { piece |= WhiteFlag; } else { ASSERT(SQUARE_RANK(MOVE_TO(move))==Rank1); piece |= ...
false
false
false
false
false
0
ecore_file_dir_is_empty(const char *dir) { Eina_File_Direct_Info *info; Eina_Iterator *it; it = eina_file_direct_ls(dir); if (!it) return -1; EINA_ITERATOR_FOREACH(it, info) { eina_iterator_free(it); return 0; } eina_iterator_free(it); return 1; }
false
false
false
false
false
0
get_locked (Test *test, const gchar *path, const gchar *interface) { GVariant *retval; GVariant *prop; GError *error = NULL; gboolean locked; retval = g_dbus_connection_call_sync (test->service.connection, test->service.bus_name, ...
false
false
false
false
false
0
aw_help_show_external_format(const char *help_file, const char *viewer) { // Called to show *.ps or *.pdf in external viewer. // Can as well show *.suffix.gz (decompresses to temporary *.suffix) struct stat st; GB_ERROR error = NULL; char sys[1024]; sys[0] = 0; if (stat(help...
false
false
false
false
false
0
tl_process_group(tl_group * group, int *activated) { int again = 1; tl_timer *timer, *timer1; int minwait = INT_MAX; tl_update_time(); if (activated != NULL) *activated = 0; while (again) { group->slowdown = 0; again = 0; minwait = INT_MAX; timer = group->next; while (timer != NULL) { ...
false
false
false
false
false
0
__event_getindex (struct event_pool *event_pool, int fd, int idx) { int ret = -1; int i = 0; GF_VALIDATE_OR_GOTO ("event", event_pool, out); if (idx > -1 && idx < event_pool->used) { if (event_pool->reg[idx].fd == fd) ret = idx; } ...
false
false
false
false
false
0
setup_tun_interface(unsigned int flags, unsigned change, void *data) { struct connman_private_network *pn = data; unsigned char prefixlen; DBusMessageIter array, dict; const char *server_ip; const char *peer_ip; const char *subnet_mask; int err; DBG("index %d flags %d change %d", pn->index, flags, change); ...
false
false
false
false
false
0
gst_avi_demux_index_next (GstAviDemux * avi, GstAviStream * stream, guint last, gboolean keyframe) { GstAviIndexEntry *entry; gint i; for (i = last + 1; i < stream->idx_n; i++) { entry = &stream->index[i]; if (!keyframe || ENTRY_IS_KEYFRAME (entry)) { return i; } } return stream->idx_n ...
false
false
false
false
false
0
G_zlib_expand(const unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) { int err, nbytes; z_stream c_stream; /* Catch error condition */ if (src == NULL || dst == NULL) return -2; /* Don't do anything if either of these are true */ if (src_sz <= 0 || dst_sz <= 0) return 0...
false
false
false
false
false
0
kex_agree_kex_hostkey(LIBSSH2_SESSION * session, unsigned char *kex, unsigned long kex_len, unsigned char *hostkey, unsigned long hostkey_len) { const LIBSSH2_KEX_METHOD **kexp = libssh2_kex_methods; unsigned char *s; if (session->kex_prefs)...
false
false
false
false
false
0
create_connect_properties (NMConnection *connection) { NMSettingGsm *setting; NMSettingPPP *s_ppp; GHashTable *properties; const char *str; setting = nm_connection_get_setting_gsm (connection); properties = value_hash_create (); str = nm_setting_gsm_get_number (setting); if (str) value_hash_add_str (propert...
false
false
false
false
false
0
gregorian2julian (day, month, year) int *day; int *month; int *year; /* Converts a Gregorian date to a Julian date. */ { if (*year < greg->year || ((*year == greg->year) && (*month < greg->month || ((*month == greg->month) && (*day < greg->first_day))))) { auto Greg_struct ...
false
false
false
false
false
0
gst_audio_info_init (GstAudioInfo * info) { g_return_if_fail (info != NULL); memset (info, 0, sizeof (GstAudioInfo)); info->finfo = gst_audio_format_get_info (GST_AUDIO_FORMAT_UNKNOWN); memset (&info->position, 0xff, sizeof (info->position)); }
false
false
false
false
false
0
uap_stack_pointer(void *uap) { /* There is a race condition here, but in practice a signal delivered during stack frame setup/teardown or while transitioning from Factor to C is a sign of things seriously gone wrong, not just a divide by zero or stack underflow in the listener */ if(in_code_heap_p(UAP_PROGRAM_COUN...
false
false
false
false
false
0
gretl_matrix_covariogram (const gretl_matrix *X, const gretl_matrix *u, const gretl_matrix *w, int p, int *err) { gretl_matrix *V; gretl_matrix *G; gretl_matrix *xtj; double uu; int j, k, t, T; if (gretl_is_null_matrix(X)) { return NULL; } k = X->cols; T = X->rows;...
false
false
false
false
false
0
rehash_node (void) { int i, inx; struct node_record *node_ptr = node_record_table_ptr; xfree (node_hash_table); node_hash_table = xmalloc (sizeof (struct node_record *) * node_record_count); for (i = 0; i < node_record_count; i++, node_ptr++) { if ((node_ptr->name == NULL) || (node_ptr->name[0] ==...
false
false
false
false
false
0
CfVoidQueryDB(CfdbConn *cfdb,char *query) { if (!cfdb->connected) { return; } /* If we don't need to retrieve table entries...*/ CfNewQueryDB(cfdb,query); CfDeleteQuery(cfdb); }
false
false
false
false
false
0
RemoveDeadStores(MachineBasicBlock* MBB) { // FIXME: This could be much more aggressive, but we need to investigate // the compile time impact of doing so. bool changed = false; SmallVector<MachineInstr*, 4> toErase; for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; ++I) { ...
false
false
false
false
false
0
GetComment(Oid oid, Oid classoid, int32 subid) { Relation description; ScanKeyData skey[3]; SysScanDesc sd; TupleDesc tupdesc; HeapTuple tuple; char *comment; /* Use the index to search for a matching old tuple */ ScanKeyInit(&skey[0], Anum_pg_description_objoid, BTEqualStrategyNumber, F_OIDEQ, ...
false
false
false
false
false
0
validate_header( const struct evkeyvalq* headers, const char *key, const char *value) { const char *real_val = evhttp_find_header(headers, key); if (real_val == NULL) return (-1); if (strcmp(real_val, value) != 0) return (-1); return (0); }
false
false
false
false
false
0
oid_groups(reiserfs_blocknr_hint_t * hint) { if (hint->inode) { unsigned long hash; __u32 oid; __u32 dirid; int bm; dirid = le32_to_cpu(INODE_PKEY(hint->inode)->k_dir_id); /* * keep the root dir and it's first set of subdirs close to * the start of the disk */ if (dirid <= 2) hash = (hint->...
false
false
false
false
false
0
parse_move(const std::string & str) const { /* * Compare the input against all possible moves in coordinate * notation and SAN. */ Movelist moves; generate_moves(&moves); moves.filter_illegal(*this); for (unsigned int i=0; i<moves.size(); i++) { Move mov = moves[i]; if (str == mov.str() || str == mov.sa...
false
false
false
false
false
0
wait_for_msg_done(struct smi_info *smi_info) { enum si_sm_result smi_result; smi_result = smi_info->handlers->event(smi_info->si_sm, 0); for (;;) { if (smi_result == SI_SM_CALL_WITH_DELAY || smi_result == SI_SM_CALL_WITH_TICK_DELAY) { schedule_timeout_uninterruptible(1); smi_result = smi_info->han...
false
false
false
false
false
0
prefs_themes_update_buttons(const ThemesData *tdata) { ThemesPage *theme = tdata->page; gboolean can_rem, can_use; can_use = !IS_CURRENT_THEME(tdata->displayed); can_rem = can_use && !IS_INTERNAL_THEME(tdata->displayed); if (theme->btn_use != NULL) gtk_widget_set_sensitive(theme->btn_use, can_use); if (th...
false
false
false
false
false
0
DeadlockIfCantLockInValidators(const char* flag, bool value) { if (!value) { return true; } vector<CommandLineFlagInfo> dummy; GetAllFlags(&dummy); return true; }
false
false
false
false
false
0
normalize_cond_1 (gimple cond, norm_cond_t norm_cond, enum tree_code cond_code) { enum gimple_code gc; enum tree_code cur_cond_code; tree rhs1, rhs2; gc = gimple_code (cond); if (gc != GIMPLE_ASSIGN) { VEC_safe_push (gimple, heap, norm_cond->conds, cond); r...
false
false
false
false
false
0
input_cgraph_opt_section (struct lto_file_decl_data *file_data, const char *data, size_t len, VEC (cgraph_node_ptr, heap) * nodes) { const struct lto_function_header *header = (const struct lto_function_header *) data; const int cfg_offset = sizeof (struct lto_function_header); const int main...
false
false
false
false
false
0
css_open(const char *target) { dvd_input_t dev; /* Allocate the handle structure */ dev = (dvd_input_t) malloc(sizeof(*dev)); if(dev == NULL) { fprintf(stderr, "libdvdread: Could not allocate memory.\n"); return NULL; } /* Really open it with libdvdcss */ dev->dvdcss = DVDcss_open(target); if(...
false
false
false
false
false
0
canonicalize_message(Email_message *em) { int i; Ds *ds; if (em->dkim == NULL) return(0); canon_headers(em); /* Separate last header line from start of message body. */ ds = ds_set(NULL, "\r\n"); canon_body(em); ds_dsappend(em->dkim->canon_mesg, 1, 3, em->dkim->canon_headers, ds, em->dkim->ca...
false
false
false
false
false
0
_gtk_clutter_embed_set_child_active (GtkClutterEmbed *embed, GtkWidget *child, gboolean active) { GdkWindow *child_window; child_window = gtk_widget_get_window (child); if (active) { embed->priv->n_active_children+...
false
false
false
false
false
0
storvsc_on_channel_callback(void *context) { struct vmbus_channel *channel = (struct vmbus_channel *)context; struct hv_device *device; struct storvsc_device *stor_device; u32 bytes_recvd; u64 request_id; unsigned char packet[ALIGN(sizeof(struct vstor_packet), 8)]; struct storvsc_cmd_request *request; int ret; ...
false
false
false
false
false
0
flush() { trace(("output::flush(this = %08lX)\n{\n", (long)this)); if (buffer_position > buffer) { size_t nbytes = buffer_position - buffer; write_inner(buffer, nbytes); buffer_position = buffer; } flush_inner(); trace(("}\n")); }
false
false
false
false
false
0
beiscsi_map_pci_bars(struct beiscsi_hba *phba, struct pci_dev *pcidev) { u8 __iomem *addr; int pcicfg_reg; addr = ioremap_nocache(pci_resource_start(pcidev, 2), pci_resource_len(pcidev, 2)); if (addr == NULL) return -ENOMEM; phba->ctrl.csr = addr; phba->csr_va = addr; phba->csr_pa.u.a64.address ...
false
false
false
false
false
0
adau1761_dejitter_fixup(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); struct adau *adau = snd_soc_codec_get_drvdata(codec); /* After any power changes have been made the dejitter circuit * has to be reinitialized. */ regm...
false
false
false
false
false
0
boundaryOnLine(int line) const { return start().line() == line || end().line() == line; }
false
false
false
false
false
0
print_common_obsolete_callback(OMSTREAM& o, LANGUAGE* lang)const { assert(lang); bool more = false; if (_set[s_NONE]) { _func[s_NONE]->print_common_obsolete_callback(o, lang); more = true; }else{ } for (int i = sCOUNT-1; i != s_NONE; --i) { if (_set[i]) { if (more) { o << ' '; }else...
false
false
false
false
false
0
unscale_volume(cd_vol, max) int cd_vol, max; { int vol = 0, top = max, bot = 0, scaled = 0; /*cd_vol = (cd_vol * 100 + (max_volume - 1)) / max_volume;*/ while (bot <= top) { vol = (top + bot) / 2; scaled = (vol * vol) / max; if (cd_vol <= scaled) top = vol - 1; else bot = vol + 1; } /* Might ha...
false
false
false
false
false
0
process(mail::imap &imapAccount, Token t) { if (t == EOL) return; if (t != ATOM) { error(imapAccount); return; } size_t n=0; istringstream i(t.text.c_str()); i >> n; if (n == 0 || imapAccount.currentFolder == NULL || n > imapAccount.currentFolder->index.size()) { error(imapAccount); return;...
false
false
false
false
false
0
s6e63m0_set_brightness(struct backlight_device *bd) { int ret = 0, brightness = bd->props.brightness; struct s6e63m0 *lcd = bl_get_data(bd); if (brightness < MIN_BRIGHTNESS || brightness > bd->props.max_brightness) { dev_err(&bd->dev, "lcd brightness should be %d to %d.\n", MIN_BRIGHTNESS, MAX_BRIGHTNESS); ...
false
false
false
false
false
0
knh_bytes_nsname(kbytes_t t) { size_t i, s = 0; for(i = t.len - 1; i > 0; i--) { if(t.utext[i] == '/' || t.utext[i] == '\\') { s = i + 1; break; } } for(i = s; i < t.len; i++) { if(t.utext[i] == '.') { t.utext = t.utext + s; t.len =...
false
false
false
false
false
0
open_local_file(orte_dfs_request_t *dfs) { char *filename; orte_dfs_tracker_t *trk; /* extract the filename from the uri */ if (NULL == (filename = opal_filename_from_uri(dfs->uri, NULL))) { /* something wrong - error was reported, so just get out */ if (NULL != dfs->open_cbfunc) { ...
false
false
false
false
false
0
recv (char * buffer, size_t size, int flags) { int result; #ifndef WIN32_NOTCYGWIN if (!flags) { // this allows us to use non-sockets with the library result = ::read (fileno, buffer, size); } else { result = ::recv (fileno, buffer, size, flags); } #else result = ::recv (fi...
false
false
false
false
false
0
get_cvs_tmp_dir (void) { const char *retval; if (tmpdir_cmdline) retval = tmpdir_cmdline; else if (config && config->TmpDir) retval = config->TmpDir; else retval = get_system_temp_dir (); if (!retval) retval = TMPDIR_DFLT; if (!retval || !*retval) error (1, 0, "No temp dir specified."); re...
false
false
false
false
false
0
_gcr_display_view_start_details (GcrDisplayView *self, GcrRenderer *renderer) { GtkTextChildAnchor *anchor; GcrDisplayItem *item; GtkTextIter iter; g_return_if_fail (GCR_IS_DISPLAY_VIEW (self)); item = lookup_display_item (self, renderer); g_return_if_fail (item); if (item->details) { g_warning ("A GcrRender...
false
false
false
false
false
0
compare_occurs (const void *void_first, const void *void_second) { #define first ((const OCCURS *) void_first) #define second ((const OCCURS *) void_second) int value; value = compare_words (&first->key, &second->key); return value == 0 ? first->key.start - second->key.start : value; #undef first #undef second }
false
false
false
false
false
0
icon_container_set_workarea (NemoIconContainer *icon_container, GdkScreen *screen, long *workareas, int n_items) { int left, right, top, bottom; int screen_width, screen_height; int i; left = right = top = bottom = 0; screen_width = gdk_scr...
false
false
false
false
false
0
zx_DEC_ELEM_gl_geoinfo(struct zx_ctx* c, struct zx_gl_geoinfo_s* x) { struct zx_elem_s* el = x->gg.kids; switch (el->g.tok) { case zx_gl_CoordinateReferenceSystem_ELEM: if (!x->CoordinateReferenceSystem) x->CoordinateReferenceSystem = (struct zx_gl_CoordinateReferenceSystem_s*)el; return 1; case z...
false
false
false
false
false
0
ExpandMatMove(const TanBoard anBoard, int anMove[8], int *pc, const unsigned int anDice[2]) { int i, j, k; int c = *pc; if (anDice[0] != anDice[1]) { if ((unsigned int) (anMove[0] - anMove[1]) == (anDice[0] + anDice[1])) { int an[8]; /* consolidated move, e.g. 61: 11/4. ...
false
false
false
false
false
0
canWriteXfer(const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer) { OFBool canWrite = OFTrue; if (newXfer == EXS_Unknown) canWrite = OFFalse; else if (!elementList->empty()) { DcmObject *dO; elementList->seek(ELP_first); do { ...
false
false
false
false
false
0