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
zzn2_copy(zzn2 *x,zzn2 *w) { if (x==w) return; copy(x->a,w->a); copy(x->b,w->b); }
false
false
false
false
false
0
frame() const { QString value = explicitAttribute( "frame", "none" ); return interpretFrameType( value, 0, 0 ); }
false
false
false
false
false
0
mono_gc_finalizers_for_domain (MonoDomain *domain, MonoObject **out_array, int out_size) { int result; LOCK_GC; sgen_process_fin_stage_entries (); result = finalizers_for_domain (domain, out_array, out_size, &minor_finalizable_hash); if (result < out_size) { result += finalizers_for_domain (domain, out_array + ...
false
false
false
false
false
0
gen_sibcall (rtx operand0, rtx operand1, rtx operand2) { rtx _val = 0; start_sequence (); { rtx operands[3]; operands[0] = operand0; operands[1] = operand1; operands[2] = operand2; #line 8732 "../../src/gcc/config/arm/arm.md" { if (operands[2] == NULL_RTX) operands[2] = const0_rtx; ...
false
false
false
false
false
0
EvaluatePosition (double *x, double *closestPoint, int &subId, double pcoords[3], double &minDist2, double *weights) { double pc[3], dist2; int ignoreId, i, returnStatus = 0, status; doubl...
false
false
false
false
false
0
displayTextsIf() { if (!m_initialized) return; if (m_hidden) return; if (!isVisible()) return; displayTexts(); }
false
false
false
false
false
0
next() { if(ind<fnum) { ind++; return curr(); } return 0; }
false
false
false
false
false
0
cell_center (FttCell * cell, gpointer * data) { FttVector * p = data[0], pos; if (p->x == G_MAXDOUBLE) { GfsDomain * domain = data[1]; ClosestGrid * grid = data[2]; GtsPoint * v; ftt_cell_pos (cell, &pos); pos.z = 0.; v = gts_point_new (gts_point_class (), pos.x, pos.y, pos.z); if (gfs...
false
false
false
false
false
0
realtime_sqlite3_load(const char *database, const char *table, const char *configfile, struct ast_config *config, struct ast_flags flags, const char *suggested_include_file, const char *who_asked) { char *sql; struct cfg_entry_args args; if (ast_strlen_zero(table)) { ast_log(LOG_WARNING, "Must have a table to que...
false
false
false
false
false
0
aac_sa_ioremap(struct aac_dev * dev, u32 size) { if (!size) { iounmap(dev->regs.sa); return 0; } dev->base = dev->regs.sa = ioremap(dev->base_start, size); return (dev->base == NULL) ? -1 : 0; }
false
false
false
false
false
0
dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length) { int num; int i; num = DWC3_NUM_INT(dwc->hwparams.hwparams1); dwc->num_event_buffers = num; dwc->ev_buffs = devm_kzalloc(dwc->dev, sizeof(*dwc->ev_buffs) * num, GFP_KERNEL); if (!dwc->ev_buffs) return -ENOMEM; for (i = 0; i < num; i++) { ...
false
false
false
false
false
0
Resize () { const char* keyLabel = _info->GetKeyLabel(); Graphic* bg; boolean invert = false; Iterator i; _picture->First(i); if (_picture->Done(i)) { bg = new F_Rect(0, 0, xmax, ymax, stdgraphic); invert = _highlighted; } else { bg = new F_Rect(0, 0, xmax, ymax, _...
false
false
false
false
false
0
git_config_get_bool(int *out, const git_config *cfg, const char *name) { const char *value = NULL; int ret; if ((ret = get_string(&value, cfg, name)) < 0) return ret; return git_config_parse_bool(out, value); }
false
false
false
false
false
0
request_swap_ns(struct request *req, struct nameserver *ns) { if (ns && req->ns != ns) { EVUTIL_ASSERT(req->ns->requests_inflight > 0); req->ns->requests_inflight--; ns->requests_inflight++; req->ns = ns; } }
false
false
false
false
false
0
Lcopy_readtable() { # line 2276 "read.d" int narg; register object *DPPbase=vs_base; #define from DPPbase[0+0] #define to DPPbase[0+1] narg = vs_top - vs_base; if (narg < 0) too_few_arguments(); if (narg <= 0 + 0) { vs_push(current_readtable()); narg++; } if (narg <= 0 + 1) { vs_push(Cnil); narg++; ...
false
false
false
false
false
0
prev_hist(void) { return H.Pos == 0 ? NULL : H.Lines[--H.Pos]; }
false
false
false
false
false
0
separate_arrays(GArray *spectra, guint *ncurves, GwyDataLine ***curves, guint *ncoords, gdouble **coords, guint *nselected, guint32 **selected) { guint isize, i; *ncurves = spectra->len; *curves = g_new(GwyDataL...
false
false
false
false
false
0
counterScopeToString( uint32_t properties ) { switch( properties & OTF_COUNTER_SCOPE_BITS ) { CASE_RETURN( SCOPE, START ); CASE_RETURN( SCOPE, POINT ); CASE_RETURN( SCOPE, LAST ); CASE_RETURN( SCOPE, NEXT ); default: { static char unknown_buffer[ 64 ]; sprintf( unknown_buffer, "UNKNOWN <%u>", properties ...
false
false
false
false
false
0
xsh_pre_abs (const xsh_pre * pre) { cpl_image *result = NULL; int *result_data = NULL; float *data = NULL; int i, size; XSH_ASSURE_NOT_NULL( pre); /* Handle data unit + plist */ check ( data = cpl_image_get_data_float( pre->data)); check( result = cpl_image_new( pre->nx, pre->ny, CPL_TYPE_INT)); ch...
false
false
false
false
false
0
gva_action_previous_game_cb (GtkAction *action) { GtkTreeSelection *selection; GtkTreeModel *model; GtkTreePath *path; GtkTreeView *view; GtkTreeIter iter; gboolean valid; gint n_nodes; gint index; view = GTK_TREE_VIEW (GVA_WIDGET_MAIN_TREE_VIEW);...
false
false
false
false
false
0
floor125( double x ) { if ( x == 0.0 ) return 0.0; double sign = ( x > 0 ) ? 1.0 : -1.0; const double lx = ::log10( qFabs( x ) ); const double p10 = qwtFloorF( lx ); double fr = qPow( 10.0, lx - p10 ); if ( fr >= 10.0 ) fr = 10.0; else if ( fr >= 5.0 ) fr = 5.0; ...
false
false
false
false
false
0
gretl_xml_encode_to_buf (char *targ, const char *src, int n) { const char *s = src; int len = strlen(s) + 1; if (!g_utf8_validate(src, -1, NULL)) { fprintf(stderr, "gretl_xml_encode_to_buf: source not UTF-8\n"); return 1; } while (*s) { if (*s == '&') len += 4; else if (*s == '<') len += 3; e...
false
false
false
false
false
0
CheckpointerShmemInit(void) { Size size = CheckpointerShmemSize(); bool found; CheckpointerShmem = (CheckpointerShmemStruct *) ShmemInitStruct("Checkpointer Data", size, &found); if (!found) { /* * First time through, so initialize. Note that we zero the whole * requests array; this is s...
false
false
false
false
false
0
dTimerResolution() { unsigned long cc1[2],cc2[2]; getClockCount (cc1); do { getClockCount (cc2); } while (cc1[0]==cc2[0] && cc1[1]==cc2[1]); do { getClockCount (cc1); } while (cc1[0]==cc2[0] && cc1[1]==cc2[1]); double t1 = loadClockCount (cc1); double t2 = loadClockCount (cc2); return (t1-...
false
false
false
false
false
0
connectToDataSource(const QString &source) { d->mDataSource = PluginLoader::getInstance()->engine(source); if (!d->mDataSource.data()) return 0; connect(d->mDataSource.data(), SIGNAL(ready()), this, SLOT(onReady())); return true; }
false
false
false
false
false
0
generateCodeMetaClasses(void) { ClassList* currentClassList; Class* currentClass; /* Generate init */ fprintf(asmFile, "_init:\n"); currentClassList = metaClasses; while (!currentClassList->isEmpty) { currentClass = currentClassList->head; fprintf(asmFile, "\t// Generate Metacla...
false
false
false
false
false
0
camel_mime_message_init (CamelMimeMessage *mime_message) { gint ii; mime_message->recipients = g_hash_table_new ( camel_strcase_hash, camel_strcase_equal); for (ii = 0; recipient_names[ii] != NULL; ii++) { g_hash_table_insert ( mime_message->recipients, (gpointer) recipient_names[ii], camel_internet_ad...
false
false
false
false
false
0
main() { const unsigned long int intmax = 1000000; unsigned long int *phi = new unsigned long int[intmax + 1]; for (unsigned long int i = 0; i < intmax + 1; ++i) { phi[i] = i; } for (unsigned long int i = 2; i < intmax + 1; ++i) { if (i == phi[i]) { --phi[i]; ...
false
false
false
false
false
0
__lambda2_ (ConfigurationEditor* self, GdkEventKey* event) { gboolean result = FALSE; GdkEventKey _tmp0_; guint _tmp1_; g_return_val_if_fail (event != NULL, FALSE); _tmp0_ = *event; _tmp1_ = _tmp0_.keyval; if (_tmp1_ == ((guint) GDK_KEY_Escape)) { GtkBox* _tmp2_; _tmp2_ = self->priv->search_box; gtk_widget...
false
false
false
false
false
0
md5_to_hex(char *out, char *md5) { int i; for (i=0; i<16; i++) { unsigned char c = md5[i]; *out++ = '0' + ((c&0xf0)>>4) + (c>=0xa0)*('a'-'9'-1); *out++ = '0' + (c&0x0f) + ((c&0x0f)>=0x0a)*('a'-'9'-1); } *out = '\0'; }
false
false
false
false
false
0
brcmf_p2p_ifp_removed(struct brcmf_if *ifp) { struct brcmf_cfg80211_info *cfg; struct brcmf_cfg80211_vif *vif; brcmf_dbg(INFO, "P2P: device interface removed\n"); vif = ifp->vif; cfg = wdev_to_cfg(&vif->wdev); cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; rtnl_lock(); cfg80211_unregister_wdev(&vif->wdev);...
false
false
false
false
false
0
print_ht_capability(__u16 cap) { #define PRINT_HT_CAP(_cond, _str) \ do { \ if (_cond) \ printf("\t\t\t" _str "\n"); \ } while (0) printf("\t\tCapabilities: 0x%02x\n", cap); PRINT_HT_CAP((cap & BIT(0)), "RX LDPC"); PRINT_HT_CAP((cap & BIT(1)), "HT20/HT40"); PRINT_HT_CAP(!(cap & BIT(1)), "HT20"); PRINT_HT...
false
false
false
false
false
0
createDocumentTreeNode(const E_RelationshipType relationshipType, const E_ValueType valueType) { DSRDocumentTreeNode *node = NULL; switch (valueType) { case VT_Text: node = new DSRTextTreeNode(relationshipType); break; ...
false
false
false
false
false
0
Argument_usage(Argument *arg, gchar *synopsis){ register ArgumentOption *ao; register gint i; Argument_show_version(arg); g_print("\n%s: %s\n", arg->name, arg->desc); if(synopsis){ g_print("%s\n", synopsis); } else { g_print("Synopsis:\n--------\n%s", arg->name); for(i = ...
false
false
false
false
false
0
__iwl_up(struct iwl_priv *priv) { struct iwl_rxon_context *ctx; int ret; lockdep_assert_held(&priv->mutex); if (test_bit(STATUS_EXIT_PENDING, &priv->status)) { IWL_WARN(priv, "Exit pending; will not bring the NIC up\n"); return -EIO; } for_each_context(priv, ctx) { ret = iwlagn_alloc_bcast_station(priv, ...
false
false
false
false
false
0
Perl_op_refcnt_lock(pTHX) { dVAR; PERL_UNUSED_CONTEXT; OP_REFCNT_LOCK; }
false
false
false
false
false
0
CreateDefaultRepresentation() { if ( !this->WidgetRep ) { this->WidgetRep = vtkParallelopipedRepresentation::New(); this->WidgetRep->SetRenderer(this->CurrentRenderer); } }
false
false
false
false
false
0
find_match(gfx_res_conf_t *conflist, int type, int nr, int loop, int cel) { while (conflist) { if (resource_matches_patternlists(conflist, type, nr, loop, cel)) { #ifdef DEBUG fprintf(stderr, "[DEBUG:gfx-res] Found match!\n"); #endif return conflist; } conflist = conflist->next; } return NUL...
false
false
false
false
false
0
bnxt_update_vf_mac(struct bnxt *bp) { struct hwrm_func_qcaps_input req = {0}; struct hwrm_func_qcaps_output *resp = bp->hwrm_cmd_resp_addr; bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_QCAPS, -1, -1); req.fid = cpu_to_le16(0xffff); mutex_lock(&bp->hwrm_cmd_lock); if (_hwrm_send_message(bp, &req, sizeof(req), HWRM...
false
false
false
false
false
0
gauche__threadsmake_thread(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_) { ScmObj thunk_scm; ScmProcedure* thunk; ScmObj name_scm; ScmObj name; ScmObj SCM_SUBRARGS[3]; int SCM_i; SCM_ENTER_SUBR("make-thread"); if (SCM_ARGCNT >= 3 && !SCM_NULLP(SCM_ARGREF(SCM_ARGCNT-1))) Scm_Error("too many argu...
false
false
false
false
false
0
rdp_recv_logon_error_info(rdpRdp* rdp, STREAM* s) { uint32 errorNotificationType; uint32 errorNotificationData; stream_read_uint32(s, errorNotificationType); /* errorNotificationType (4 bytes) */ stream_read_uint32(s, errorNotificationData); /* errorNotificationData (4 bytes) */ }
false
false
false
false
false
0
gst_video_mark_draw_box (GstVideoMark * videomark, guint8 * data, gint width, gint height, gint row_stride, gint pixel_stride, guint8 color) { gint i, j; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { data[pixel_stride * j] = color; } data += row_stride; } }
false
false
false
false
false
0
PushTableEnv(GrpLineAndFile & lnf, std::string staTableName) { Symbol psymTable = SymbolTable()->FindSymbol(staTableName); if (!psymTable || !psymTable->FitsSymbolType(ksymtTable)) { g_errorList.AddError(1181, NULL, "Invalid table name: ", staTableName, lnf); return PushGeneralEnv(lnf); // just push a c...
false
false
false
false
false
0
fixup_use_point(struct mtd_info *mtd) { struct map_info *map = mtd->priv; if (!mtd->_point && map_is_linear(map)) { mtd->_point = cfi_intelext_point; mtd->_unpoint = cfi_intelext_unpoint; } }
false
false
false
false
false
0
Detect(const Image &image, vector<Feature *> *features, DetectorData **data) { int num_corners = 0; ByteImage *byte_image = image.AsArray3Du(); if (byte_image) { // Algorithm : // a. Detect. // b. ComputeScores. // c. NonMaxSuppresion. ...
false
false
false
false
false
0
_regulator_suspend_finish(struct device *dev, void *data) { struct regulator_dev *rdev = dev_to_rdev(dev); int ret; mutex_lock(&rdev->mutex); if (rdev->use_count > 0 || rdev->constraints->always_on) { if (!_regulator_is_enabled(rdev)) { ret = _regulator_do_enable(rdev); if (ret) dev_err(dev, "Fai...
false
false
false
false
false
0
fdilate_1_36(l_uint32 *datad, l_int32 w, l_int32 h, l_int32 wpld, l_uint32 *datas, l_int32 wpls) { l_int32 i; register l_int32 j, pwpls; register l_uint32 *sptr, *dptr; l_int32 wpls2, wpls3, wpls4; l_int32 ...
false
false
false
false
false
0
CreateQuantPixels(TreeNode tree, Pointer input, unsigned char *output, int knt, int float_pixels) { int i; unsigned char *s = (unsigned char *)input; unsigned char *d = output; int skipsize; struct color pbuf; skipsize = float_pixels ? 3*sizeof(float) : sizeof(struct color); for (i...
false
false
false
false
false
0
doContext() { ContactViewItem *i = (ContactViewItem *)selectedItem(); if(!i) return; ensureItemVisible(i); if(i->type() == ContactViewItem::Group) setOpen(i, !i->isOpen()); else qlv_contextPopup(i, viewport()->mapToGlobal(QPoint(32, itemPos(i))), 0); }
false
false
false
false
false
0
H5A_close(H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) HDassert(attr); HDassert(attr->shared); /* Close the object's symbol-table entry */ if(attr->obj_opened && (H5O_close(&(attr->oloc)) < 0)) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FA...
false
false
false
false
false
0
onCmdFilter(FXObject*,FXSelector sel,void*){ if (FXSELID(sel)==ID_FILTER_MODE && filterfield->getText().empty()) return 1; if (FXSELTYPE(sel)==SEL_CHANGED) { getApp()->addTimeout(this,ID_FILTER,TIME_MSEC(500)); return 1; } if (FXSELTYPE(sel)==SEL_COMMAND){ getApp()->removeTimeout(this,ID_FILTE...
false
false
false
false
false
0
order(const DenseMatrix &t, const std::vector<DenseMatrix> &basis, unsigned k) { bool eq = true; for (unsigned j = 0; j < t.ncols(); j++) { CSYMPY_ASSERT(is_a<Integer>(*t.get(0, j))); mpz_class t_ = rcp_static_cast<const Integer>(t.get(0, j))->as_mpz(); CSYMPY_ASSERT(is_a<Integer>(*bas...
false
false
false
false
false
0
init_lower(zwinid *lower) { zwinid lower_win = &game_windows[0]; glui32 i; if(lower) *lower = lower_win; if(lower_win->win) { z_pause_timed_input(lower_win); glk_window_close(lower_win->win, NULL); } set_stylehints(lower_win->current.fore, lower_win->current.back); lower_win->dirty = T...
false
false
false
false
false
0
ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh) { int ret = OMPI_SUCCESS; int delete_flag = 0; char name[256]; if(mca_io_ompio_coll_timing_info){ strcpy (name, "WRITE"); if (!ompi_io_ompio_empty_print_queue(WRITE_PRINT_QUEUE)){ ret = ompi_io_ompio_print_time_info(W...
true
true
false
false
false
1
__set_numval(struct expr_t *ndp, word32 av, word32 bv, int32 blen) { ndp->optyp = NUMBER; if (blen <= WBITS) { ndp->ru.xvi = __alloc_shareable_cval(av, bv, blen); } else __case_terr(__FILE__, __LINE__); ndp->szu.xclen = blen; if (bv == 0) ndp->ibase = BDEC; }
true
true
false
false
false
1
ftpPasvCallback(int fd, int status, void *data) { FtpStateData *ftpState = data; debug(9, 3) ("ftpPasvCallback\n"); if (status != COMM_OK) { debug(9, 2) ("ftpPasvCallback: failed to connect. Retrying without PASV.\n"); ftpState->fwd->flags.dont_retry = 0; /* this is a retryable error */ ftpState->fwd->fl...
false
false
false
false
false
0
cb_set_export_option (const char *key, const char *value, GError **err, gpointer user) { Workbook *wb = user; GnmStfExport *stfe = gnm_stf_get_stfe (G_OBJECT (wb)); const char *errtxt; if (strcmp (key, "sheet") == 0) { Sheet *sheet = workbook_sheet_by_name (wb, value); if (!sheet) { errtxt = _("Ther...
false
false
false
false
false
0
doesSelectionContainRevision() const { fl_BlockLayout* pBlock; fp_Run* pRun; UT_sint32 x, y, x2, y2; UT_uint32 h; bool b; UT_uint32 iPos1 = UT_MIN(m_iInsPoint, getSelectionAnchor()); UT_uint32 iPos2 = UT_MAX(m_iInsPoint, getSelectionAnchor()); _findPositionCoords(iPos1, false, x, y, x2, y2, h, b,&pBlock, &pRu...
false
false
false
false
false
0
e1000_pcix_mmrbc_workaround_generic(struct e1000_hw *hw) { u16 cmd_mmrbc; u16 pcix_cmd; u16 pcix_stat_hi_word; u16 stat_mmrbc; DEBUGFUNC("e1000_pcix_mmrbc_workaround_generic"); /* Workaround for PCI-X issue when BIOS sets MMRBC incorrectly */ if (hw->bus.type != e1000_bus_type_pcix) return; e1000_read_pci_...
false
false
false
false
false
0
CheckArgumentValue(std::string const& arg) { // Handle states specific to this command. if(this->ArgumentDoing == ArgumentDoingLabels) { this->Labels.insert(arg); return true; } // Look for other arguments. return this->Superclass::CheckArgumentValue(arg); }
false
false
false
false
false
0
embed_signature(DSPAM_CTX *CTX, AGENT_CTX *ATX) { struct nt_node *node_nt; struct nt_c c_nt; char toplevel_boundary[128] = { 0 }; ds_message_part_t block; int i = 0; if (CTX->training_mode == DST_NOTRAIN || ! ATX->signature[0]) return 0; node_nt = c_nt_first (CTX->message->components, &c_nt); if ...
false
false
false
false
false
0
pump_execute_status (call_frame_t *frame, xlator_t *this) { afr_private_t *priv = NULL; pump_private_t *pump_priv = NULL; uint64_t number_files = 0; char filename[PATH_MAX]; char *dict_str = NULL; int32_t op_ret = 0; int32_t op_errno = 0; dict_t *dict ...
false
false
false
false
false
0
isSingleOrLead(const int32_t (*stateTable)[256], uint8_t state, UBool isDBCSOnly, uint8_t b) { const int32_t *row=stateTable[state]; int32_t entry=row[b]; if(MBCS_ENTRY_IS_TRANSITION(entry)) { /* lead byte */ return hasValidTrailBytes(stateTable, (uint8_t)MBCS_ENTRY_TRANSITION_STATE(entry)); }...
false
false
false
false
false
0
ddf_FreeMatrix(ddf_MatrixPtr M) { ddf_rowrange m1; ddf_colrange d1; if (M!=NULL) { if (M->rowsize<=0) m1=1; else m1=M->rowsize; if (M->colsize<=0) d1=1; else d1=M->colsize; if (M!=NULL) { ddf_FreeAmatrix(m1,d1,M->matrix); ddf_FreeArow(d1,M->rowvec); set_free(M->linset); free(M...
false
false
false
false
false
0
track_pc (struct fdi *fdi, int max_sector) { int i, gap3; uae_u8 *p = fdi->track_src; switch (max_sector) { case 8: gap3 = 116; break; case 9: gap3 = 54; break; default: gap3 = 100; /* fixme */ break; } s11 (fdi); for (i = 0; i < max_sector; i++) { byte_mfm_add (fdi, 0x4e); byte_mfm_add (fdi, ...
false
false
false
false
false
0
unicode_buf_cmp(const struct unicode_buf *a, const struct unicode_buf *b) { size_t i; for (i=0; i<a->len && i<b->len; i++) { if (a->ptr[i] < b->ptr[i]) return -1; if (a->ptr[i] > b->ptr[i]) return 1; } return (a->len < b->len ? -1:a->len > b->len ? 1:0); }
false
false
false
false
false
0
diff_cursors(sp_pcontext *ctx, bool exclusive) { uint n= 0; sp_pcontext *pctx= this; sp_pcontext *last_ctx= NULL; while (pctx && pctx != ctx) { n+= pctx->m_cursors.elements; last_ctx= pctx; pctx= pctx->parent_context(); } if (pctx) return (exclusive && last_ctx ? n - last_ctx->m_cursors....
false
false
false
false
false
0
param_get_debug_level(char *buffer, const struct kernel_param *kp) { int result = 0; int i; result = sprintf(buffer, "%-25s\tHex SET\n", "Description"); for (i = 0; i < ARRAY_SIZE(acpi_debug_levels); i++) { result += sprintf(buffer + result, "%-25s\t0x%08lX [%c]\n", acpi_debug_levels[i].name, ...
false
false
false
false
false
0
GetFlag(const char* field) { int index = this->FindFlag(field); if ( index == -1 ) { return -1; } else { return this->CopyFieldFlags[index].IsCopied; } }
false
false
false
false
false
0
gst_gnome_vfs_sink_render (GstBaseSink * basesink, GstBuffer * buf) { GnomeVFSFileSize written, cur_pos; GstGnomeVFSSink *sink; GnomeVFSResult result; GstFlowReturn ret; sink = GST_GNOME_VFS_SINK (basesink); if (gnome_vfs_tell (sink->handle, &cur_pos) == GNOME_VFS_OK) { /* bring up to date with curren...
false
false
false
false
false
0
GetTimeSeriesData( int itemID, const char *vName, const char *vType, vtkFloatArray *result ) { int retVal = 0; if ( this->OpenCurrentFile() ) { int numTimesteps = this->GetNumberOfTimeSteps(); result->SetNumberOfComponents( 1 ); result->SetNumberOfTuples( ...
false
false
false
false
false
0
navSetHoldHeading(float targetHeading) { // signbit() returns true if negative sign if (signbit(targetHeading)) // use targetHeading as relative to bearing to target { navData.holdHeading = compassNormalize(navData.holdCourse + targetHeading); } else // use targetHeading as absolute heading { navData.holdH...
false
false
false
false
false
0
na_append(char *plink_dir, char *name) { int l, sz; char *p; const int cur = na.cur - na.o; l = strlen(plink_dir) + strlen(name) + 2; sz = na.bytes + l; p = realloc(na.o, sz); if (!p) AuFin("realloc"); na.o = p; na.bytes = sz; na.cur = p + cur; na.cur += sprintf(na.cur, "%s/%s", plink_dir, name) + 1; na...
false
true
false
false
false
1
load(int complain) { int x, y, z; FILE *f; if (!filename) return; f = fopen(filename, "r"); if (!f) { if (complain) perror(filename); return; } memset(grid, 0, sizeof(grid)); layer = 0; while (fscanf(f, "%d%*[^0-9-]", &x) > 0) { if (x == 127) break; if (x <= 0) { ...
false
false
false
false
true
1
print_offsets(void) { if (!verbose) return; #define print_offset(struct, member) fprintf(fp, \ "koffset(" #struct ", " #member ") = %d\n", koffset(struct, member)) print_offset(trace_array, buffer); print_offset(tracer, name); print_offset(ring_buffer, pages); print_offset(ring_buffer, flags); print_offse...
false
true
false
false
true
1
trialDiv(char *num, FILE *fp){ fseek(fp, 0, SEEK_SET) ; // Create the bignum object BIGNUM *bn_num = NULL ; BIGNUM *bn_word = NULL ; BN_CTX *bn_ctx = NULL ; BIGNUM *bn_rem = NULL ; bn_num = BN_new() ; bn_word = BN_new() ; bn_ctx = BN_CTX_new() ; bn_rem = BN_new() ; if (bn_num == NULL){ fprintf(stderr, ...
false
false
false
false
true
1
posix_entrylk (call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc, const char *basename, entrylk_cmd cmd, entrylk_type type, dict_t *xdata) { GF_LOG_OCCASIONALLY (gf_posix_lk_log, this->name, GF_LOG_CRITICAL, "\"features/locks\" transla...
false
false
false
false
false
0
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) { YYUSE (yyvaluep); YYUSE (yylocationp); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END }
false
false
false
false
false
0
queryClose() { kDebug(); if ((m_automaton->state() == GameAutomaton::INIT) || (m_automaton->state() == GameAutomaton::INTERLUDE)) { switch ( KMessageBox::warningYesNo( this, i18n("Do you want to quit the game?")) ) { case KMessageBox::Yes : break; default: return false; } }...
false
false
false
false
false
0
fm10k_reuse_rx_page(struct fm10k_ring *rx_ring, struct fm10k_rx_buffer *old_buff) { struct fm10k_rx_buffer *new_buff; u16 nta = rx_ring->next_to_alloc; new_buff = &rx_ring->rx_buffer[nta]; /* update, and store next to alloc */ nta++; rx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0; /* transfer p...
false
false
false
false
false
0
s2250_s_ctrl(struct v4l2_ctrl *ctrl) { struct s2250 *state = container_of(ctrl->handler, struct s2250, hdl); struct i2c_client *client = v4l2_get_subdevdata(&state->sd); u16 oldvalue; switch (ctrl->id) { case V4L2_CID_BRIGHTNESS: read_reg_fp(client, VPX322_ADDR_BRIGHTNESS0, &oldvalue); write_reg_fp(client, VP...
false
false
false
false
false
0
main(int argc, char** argv) { struct termios oldtio, newtio; char buf; int fd; char script[SLEN]; fd = open(PORT, O_RDWR | O_NOCTTY); if (fd < 0) { perror(PORT); return 1; } tcgetattr(fd, &oldtio); bzero(&newtio, sizeof(newtio)); newtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD; newtio.c_iflag = IGNP...
false
false
false
false
false
0
conf_end_block(struct TopConf *tc) { if(tc->tc_efunc) return tc->tc_efunc(tc); rb_free(conf_cur_block_name); return 0; }
false
false
false
false
false
0
jpc_dec_decodecblks(jpc_dec_t *dec, jpc_dec_tile_t *tile) { jpc_dec_tcomp_t *tcomp; int compcnt; jpc_dec_rlvl_t *rlvl; int rlvlcnt; jpc_dec_band_t *band; int bandcnt; jpc_dec_prc_t *prc; int prccnt; jpc_dec_cblk_t *cblk; int cblkcnt; for (compcnt = dec->numcomps, tcomp = tile->tcomps; compcnt > 0; --comp...
false
false
false
false
false
0
strip_dir(const char *vg_name, const char *dev_dir) { size_t len = strlen(dev_dir); if (!strncmp(vg_name, dev_dir, len)) vg_name += len; return vg_name; }
false
false
false
false
false
0
drv_CW_start(const char *section) { int i; char *model; char buffer[16]; model = cfg_get(section, "Model", NULL); if (model != NULL && *model != '\0') { for (i = 0; Models[i].type != 0xff; i++) { if (strcasecmp(Models[i].name, model) == 0) break; } if (Models[i].type == 0xff) { error...
true
true
false
false
true
1
reset() { if (filter_) filter_->reset(); }
false
false
false
false
false
0
gst_text_overlay_text_pad_link (GstPad * pad, GstPad * peer) { GstTextOverlay *overlay; overlay = GST_TEXT_OVERLAY (gst_pad_get_parent (pad)); if (G_UNLIKELY (!overlay)) return GST_PAD_LINK_REFUSED; GST_DEBUG_OBJECT (overlay, "Text pad linked"); overlay->text_linked = TRUE; gst_object_unref (overlay...
false
false
false
false
false
0
find_inode(void *dev) { struct fpga_inode *temp_chip = fpga_first_inode; if (temp_chip == NULL) return temp_chip; /* Search for the last fpga CI chip or find it by dev */ while ((temp_chip != NULL) && (temp_chip->internal->dev != dev)) temp_chip = temp_chip->next_inode; return temp_chip; }
false
false
false
false
false
0
trash_backend_finalize (GObject *object) { GVfsBackendTrash *backend = G_VFS_BACKEND_TRASH (object); /* get rid of these first to stop a flood of event notifications * from being emitted while we're tearing down the TrashWatcher */ if (backend->file_monitor) g_object_unref (backend->file_monitor); ba...
false
false
false
false
false
0
ensure(printbuffer *p,int needed) { char *newbuffer;int newsize; if (!p || !p->buffer) return 0; needed+=p->offset; if (needed<=p->length) return p->buffer+p->offset; newsize=pow2gt(needed); newbuffer=(char*)cJSON_malloc(newsize); if (!newbuffer) {cJSON_free(p->buffer);p->length=0,p->buffer=0;return 0;} if (ne...
false
false
false
false
false
0
reloadRequestWithoutDisposition (QNetworkReply* reply) { QNetworkRequest req (reply->request()); req.setRawHeader("x-kdewebkit-ignore-disposition", "true"); QWebFrame* frame = qobject_cast<QWebFrame*> (req.originatingObject()); if (!frame) return; frame->load(req); }
false
false
false
false
false
0
show() { int mouse_x=0; int mouse_y=0; // Gets the coordinates of the mouse getMousePosition(&mouse_x, &mouse_y); // Check to make sure menu will be displayed on the screen. if (mouse_x + width > xres) { x = xres - width - 1; right_edge=true; } else { x = mouse_x; right_edge=false; } ...
false
false
false
false
false
0
_SCI_MALLOC(size_t size, const char *file, int line, const char *funct) { void *res; #ifdef MALLOC_DEBUG INFO_MEMORY("_SCI_MALLOC()", size, file, line, funct); #endif ALLOC_MEM((res = malloc(size)), size, file, line, funct) #ifdef POISON_MEMORY { memset(res, 0xa5, size); } #endif return res; }
false
false
false
true
false
1
get6_address_index(const struct ares_in6_addr *addr, const struct apattern *sortlist, int nsort) { int i; for (i = 0; i < nsort; i++) { if (sortlist[i].family != AF_INET6) continue; if (!ares_bitncmp(addr, ...
false
false
false
false
false
0
fasl_read_buf(fasl_port* p, void* buf, int n){ if((p->memp+n) <= p->memq){ memcpy(buf, p->memp, n); p->memp += n; } else { fprintf(stderr, "fasl_read_buf: read beyond eof\n"); exit(-1); } }
false
false
false
false
false
0
filename(char *path) { static char file[MAXPATHLEN]; char *cp; if (path[strlen(path)-1] == '/') return ""; else { for (cp = path+strlen(path); cp > path && *(cp-1) != '/'; cp--) ; if (cp == path+1) cp--; strncpy(file, cp, sizeof(file)); f...
false
false
false
false
false
0
execute (std::istream &in, Object *root, std::ostream *output, std::istream *input, bool setCurrentClass, bool add_return) { parserLock.acquire(true) ; Scope *oldscope = currentScope ; int oldsl = currentScopeLevel ; interrupted = false ; currentStack = root ; currentScope = root->block ;...
false
false
false
false
false
0
_vala_boxes_sidebar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { BoxesSidebar * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_SIDEBAR, BoxesSidebar); #line 12 "/extra-data/checkout/gnome/gnome-boxes/src/sidebar.vala" switch (property_id) { #line 12 "/extra-da...
false
false
false
false
false
0
main2() { DiscreteUniform<int> rng(100); rng.seed((unsigned int)time(0)); for (int i=0; i < 100; ++i) cout << rng.random() << " "; cout << endl; return 0; }
false
false
false
false
false
0