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
sum_file(const char *file, unsigned type) { #define buf bb_common_bufsiz1 unsigned long long total_bytes = 0; int fd, r; /* The sum of all the input bytes, modulo (UINT_MAX + 1). */ unsigned s = 0; fd = open_or_warn_stdin(file); if (fd == -1) return 0; while (1) { size_t bytes_read = safe_read(fd, buf, BU...
false
false
false
false
false
0
sheet_set_hide_zeros (Sheet *sheet, gboolean hide) { hide = !!hide; if (sheet->hide_zero == hide) return; sheet->hide_zero = hide; sheet_mark_dirty (sheet); sheet_cell_foreach (sheet, (GHFunc)cb_sheet_set_hide_zeros, NULL); }
false
false
false
false
false
0
operator()(const GLEFileLocation& s1, const GLEFileLocation& s2) const { if (s1.getExt() == s2.getExt()) { if (s1.getName() == s2.getName()) { return s1.getFullPath() < s2.getFullPath(); } else { return s1.getName() < s2.getName(); } } else { if (str_i_equals(s1.getExt(), "GLE")) return true; ...
false
false
false
false
false
0
advance_lfo(FM_OPN *OPN) { UINT8 pos; UINT8 prev_pos; if (OPN->lfo_inc) /* LFO enabled ? */ { prev_pos = OPN->lfo_cnt>>LFO_SH & 127; OPN->lfo_cnt += OPN->lfo_inc; pos = (OPN->lfo_cnt >> LFO_SH) & 127; /* update AM when LFO output changes */ /*if (prev_pos != pos)*/ /* actually I c...
false
false
false
false
false
0
snippets_init (const gchar* filename) { GuSnippets* s = g_new0 (GuSnippets, 1); gchar* dirname = g_path_get_dirname (filename); g_mkdir_with_parents (dirname, DIR_PERMS); g_free (dirname); slog (L_INFO, "snippets : %s\n", filename); s->filename = g_strdup (filename); s->accel_group = gtk_a...
false
false
false
false
false
0
read_mask(const RrInstance *inst, const gchar *path, RrTheme *theme, const gchar *maskname, RrPixmapMask **value) { gboolean ret = FALSE; gchar *s; gint hx, hy; /* ignored */ guint w, h; guchar *b; s = g_build_filename(path, maskname, NULL); ...
false
false
false
false
false
0
set_system_clock(const bool hclock_valid, const time_t newtime, const bool testing) { int retcode; if (!hclock_valid) { warnx(_ ("The Hardware Clock does not contain a valid time, so " "we cannot set the System Time from it.")); retcode = 1; } else { struct timeval tv; struct tm *broken;...
false
false
false
false
false
0
usb_serial_disconnect(struct usb_interface *interface) { int i; struct usb_serial *serial = usb_get_intfdata(interface); struct device *dev = &interface->dev; struct usb_serial_port *port; struct tty_struct *tty; usb_serial_console_disconnect(serial); mutex_lock(&serial->disc_mutex); /* must set a flag, to si...
false
false
false
false
false
0
rsvg_css_parse_list (const char *in_str, guint * out_list_len) { char *ptr, *tok; char *str; guint n = 0; GSList *string_list = NULL; gchar **string_array = NULL; str = g_strdup (in_str); tok = strtok_r (str, ", \t", &ptr); if (tok != NULL) { if (strcmp (tok, " ") != 0) { ...
false
false
false
false
false
0
give_tribute(const char* tributeStr) { //---------------------------------------------// // // Send: // <King>'s Kingdom offers you <$999> in aid/tribute. // You offer <King>'s Kingdom <$999> in aid/tribute. // // Reply: // <King>'s Kingdom accepts/rejects your aid/tribute of <$999>. // You accept/reject the <...
false
false
false
false
false
0
execute_variable_command (command, vname) char *command, *vname; { char *last_lastarg; sh_parser_state_t ps; save_parser_state (&ps); last_lastarg = get_string_value ("_"); if (last_lastarg) last_lastarg = savestring (last_lastarg); parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEV...
false
false
false
false
false
0
visu_ui_stipple_combobox_setSelection(VisuUiStippleCombobox* stippleComboBox, guint16 stipple) { GtkTreeIter iter; gboolean validIter; GObjectClass *klass; GtkListStore *model; guint tmpStipple; g_return_val_if_fail(stipple && VISU_UI_IS_STIPPLE_COMBOBOX(stippleComboBox), FALSE); DBG_fprintf...
false
false
false
false
false
0
state_version_major_e(char ch) { if (ch == ' ' || ch == '\t') { state = &HeaderParser::state_version_major_e; return; } else if (ch == '.') { state = &HeaderParser::state_version_minor; return; } else { ...
false
false
false
false
false
0
mjacobi (header *hd) { header *st=hd,*result,*hd1; double *m,max,neumax,*mr; int r,c,i,j; hd=getvalue(hd); if (error) return; if (hd->type!=s_matrix) wrong_arg_in("jacobi"); getmatrix(hd,&r,&c,&m); if (r!=c) wrong_arg_in("jacobi"); if (r<2) { moveresult(st,hd); return; } hd1=new_matrix(r,r,""); if (error) retu...
false
false
false
false
false
0
IDirectFBFont_GetStringWidth( IDirectFBFont *thiz, const char *text, int bytes, int *ret_width ) { DFBResult ret; int width = 0; DIRECT_INTERFACE_GET_DATA(IDirectFBFont) D_DEBUG_...
false
false
false
false
false
0
extract_ke() { double *vcm; double ke = 0.0; for (int i = 0; i < nlocal_body; i++) { vcm = body[i].vcm; ke += body[i].mass * (vcm[0]*vcm[0] + vcm[1]*vcm[1] + vcm[2]*vcm[2]); } double keall; MPI_Allreduce(&ke,&keall,1,MPI_DOUBLE,MPI_SUM,world); return 0.5*keall; }
false
false
false
false
false
0
step1() { for (int row = 0; row < size; ++row) { double minimum = grid_.at(row).at(0); for (int column = 1; column < size; ++column) minimum = std::min(minimum, grid_.at(row).at(column)); for (int column = 0; column < size; ++column) grid_[row][column] -= minimum; ...
false
false
false
false
false
0
rtsx_pci_ms_drv_remove(struct platform_device *pdev) { struct realtek_pci_ms *host = platform_get_drvdata(pdev); struct rtsx_pcr *pcr; struct memstick_host *msh; int rc; if (!host) return 0; pcr = host->pcr; pcr->slots[RTSX_MS_CARD].p_dev = NULL; pcr->slots[RTSX_MS_CARD].card_event = NULL; msh = host->msh;...
false
false
false
false
false
0
do_languages_line(apr_pool_t *p, const char **lang_line) { apr_array_header_t *lang_recs = apr_array_make(p, 2, sizeof(char *)); if (!lang_line) { return lang_recs; } while (**lang_line) { char **new = (char **) apr_array_push(lang_recs); ...
false
false
false
false
false
0
js_generic_native_method_dispatcher(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { jsval fsv; JSFunctionSpec *fs; JSObject *tmp; if (!JS_GetReservedSlot(cx, JSVAL_TO_OBJECT(argv[-2]), 0, &fsv)) return JS_FALSE; fs = (JSFunctionSpec ...
false
false
false
false
false
0
mos7720_throttle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct moschip_port *mos7720_port; int status; mos7720_port = usb_get_serial_port_data(port); if (mos7720_port == NULL) return; if (!mos7720_port->open) { dev_dbg(&port->dev, "%s - port not opened\n", __func__); r...
false
false
false
false
true
1
get_fetch_map(const struct ref *remote_refs, const struct refspec *refspec, struct ref ***tail, int missing_ok) { struct ref *ref_map, **rmp; if (refspec->pattern) { ref_map = get_expanded_map(remote_refs, refspec); } else { const char *name = refspec->src[0] ? refspec->src : "HEAD"; ref_map = ge...
false
false
false
false
false
0
dht_discover_complete (xlator_t *this, call_frame_t *discover_frame) { dht_local_t *local = NULL; call_frame_t *main_frame = NULL; int op_errno = 0; int ret = -1; dht_layout_t *layout = NULL; local = discover_frame->local; layo...
false
false
false
false
false
0
SetTransparency(Uint8 t, bool bRecursive) { if(_mid->simplebackground || _mid->nocache) { PG_Widget::SetTransparency(t, bRecursive); return; } if(t == 255) { DeleteThemedSurface(_mid->cachesurface); _mid->cachesurface = NULL; } else if(GetTransparency() == 255) { CreateSurface(); } PG_Widget::SetTransp...
false
false
false
false
false
0
qlcnic_sriov_pf_reinit(struct qlcnic_adapter *adapter) { struct qlcnic_hardware_context *ahw = adapter->ahw; int err; if (!qlcnic_sriov_enable_check(adapter)) return 0; ahw->op_mode = QLCNIC_SRIOV_PF_FUNC; err = qlcnic_sriov_pf_init(adapter); if (err) return err; dev_info(&adapter->pdev->dev, "%s: op_mod...
false
false
false
false
false
0
dumpmem (uaecptr addr, uaecptr *nxmem, int lines) { TCHAR line[MAX_LINEWIDTH + 1]; for (;lines--;) { addr = dumpmem2 (addr, line, sizeof(line)); debug_out (_T("%s"), line); if (!debug_out (_T("\n"))) break; } *nxmem = addr; }
false
false
false
false
false
0
operator==(const SerializableMock& other) { COMPARE(ValInt, other.ValInt); COMPARE(ValFloat, other.ValFloat); COMPARE(ValString, other.ValString); COMPARE(ValStringW, other.ValStringW); if ( memcmp( ValBinary, other.ValBinary, BINARY_BLOCK_SIZE) != 0 ) { logTestString("Not identical %s in %s:%d"...
false
false
false
false
false
0
mascii (header *hd) { header *st=hd,*result; hd=getvalue(hd); if (error) return; if (hd->type!=s_string) wrong_arg_in("ascii"); result=new_real(*stringof(hd),""); if (error) return; moveresult(st,result); }
false
false
false
false
false
0
pd4990a_process_command(void) { switch(pd4990a_getcommand()) { case 0x1: //load output register bitno=0; if(reading) pd4990a_readbit(); //prepare first bit shiftlo=0; shifthi=0; break; case 0x2: writting=0; //store register to current date pd4990a_update_date(); break; ...
false
false
false
false
false
0
handle_cli_stun_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { switch (cmd) { case CLI_INIT: e->command = "stun set debug {on|off}"; e->usage = "Usage: stun set debug {on|off}\n" " Enable/Disable STUN (Simple Traversal of UDP through NATs)\n" " debugging\n"; return NU...
false
false
false
false
false
0
SEC_PKCS5GetCryptoAlgorithm(SECAlgorithmID *algid) { SECOidTag pbeAlg; SECOidTag cipherAlg; if(algid == NULL) return SEC_OID_UNKNOWN; pbeAlg = SECOID_GetAlgorithmTag(algid); cipherAlg = sec_pkcs5GetCryptoFromAlgTag(pbeAlg); if ((cipherAlg == SEC_OID_PKCS5_PBKDF2) && (pbeAlg != SEC_OID_PKC...
false
false
false
false
false
0
mca_scoll_basic_barrier(struct oshmem_group_t *group, long *pSync, int alg) { int rc = OSHMEM_SUCCESS; /* Arguments validation */ if (!group) { SCOLL_ERROR("Active set (group) of PE is not defined"); rc = OSHMEM_ERR_BAD_PARAM; } if ((rc == OSHMEM_SUCCESS) && oshmem_proc_group_is_me...
false
false
false
false
false
0
wl1271_acx_fm_coex(struct wl1271 *wl) { struct wl1271_acx_fm_coex *acx; int ret; wl1271_debug(DEBUG_ACX, "acx fm coex setting"); acx = kzalloc(sizeof(*acx), GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; } acx->enable = wl->conf.fm_coex.enable; acx->swallow_period = wl->conf.fm_coex.swallow_period; a...
false
false
false
false
false
0
shapeCheck(K a, K p, I d) { //Descend through list a marking shape p as -1 where it doesn't correspond I at=a->t, an=a->n; if(at>0 || an!=kI(p)[d]) kI(p)[d]=-1;//Mismatch or atom means p length too long else if(at && d < p->n-1) kI(p)[d+1]=-1;//Another case of p being too long else if(!at && an && kI(p)[d]!=-1...
false
false
false
false
true
1
afr_sh_data_erase_pending (call_frame_t *frame, xlator_t *this) { afr_local_t *local = NULL; afr_self_heal_t *sh = NULL; afr_private_t *priv = NULL; int call_count = 0; int i = 0; dict_t **erase_xattr = NULL; local = frame...
false
false
false
false
false
0
scm_c_vector_length (SCM v) { if (SCM_I_IS_VECTOR (v)) return SCM_I_VECTOR_LENGTH (v); else return scm_to_size_t (scm_vector_length (v)); }
false
false
false
false
false
0
GetPreprocessorType() { const unsigned int undoIndex = m_TokenIndex; const unsigned int undoLine = m_LineNumber; MoveToNextChar(); while (SkipWhiteSpace() || SkipComment()) ; const wxString token = DoGetToken(); switch (token.Len()) { case 2: if (token == Token...
false
false
false
false
false
0
onQueryTip(FXObject*sender,FXSelector sel,void* ptr){ if(FXTopWindow::onQueryTip(sender,sel,ptr)) return 1; if((flags&FLAG_TIP) && !tip.empty() && !grabbed() ){ sender->handle(this,FXSEL(SEL_COMMAND,ID_SETSTRINGVALUE),(void*)&tip); return 1; } return 0; }
false
false
false
false
false
0
test_copy_attribute (void) { GckAttribute attr, copy; gck_attribute_init_ulong (&attr, ATTR_TYPE, 88); gck_attribute_init_copy (&copy, &attr); gck_attribute_clear (&attr); g_assert (gck_attribute_get_ulong (&copy) == 88); g_assert (copy.type == ATTR_TYPE); gck_attribute_clear (&copy); }
false
false
false
false
false
0
p_cgi_url_unescape (PyObject *self, PyObject *args) { char *s; PyObject *rv; char *r; if (!PyArg_ParseTuple(args, "s:urlUnescape(str)", &s)) return NULL; r = strdup(s); if (r == NULL) return PyErr_NoMemory(); cgi_url_unescape (r); rv = Py_BuildValue ("s", r); free (r); return rv; }
false
false
false
false
false
0
fixtitle(PyUnicodeObject *self) { register Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register Py_UNICODE *e; int previous_is_cased; /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) { Py_UNICODE ch = Py_UNICODE_TOTITLE(*p); if (*p != ch) { ...
false
false
false
false
false
0
H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int *result) { const H5A_bt2_ud_common_t *bt2_udata = (const H5A_bt2_ud_common_t *)_bt2_udata; const H5A_dense_bt2_name_rec_t *bt2_rec = (const H5A_dense_bt2_name_rec_t *)_bt2_rec; herr_t ret_value = SUCCEED; /* Return va...
false
false
false
false
false
0
adapter_set_discovering(struct btd_adapter *adapter, gboolean discovering) { const char *path = adapter->path; adapter->discovering = discovering; emit_property_changed(connection, path, ADAPTER_INTERFACE, "Discovering", DBUS_TYPE_BOOLEAN, &discovering); if (discovering) return; g_slist_foreach...
false
false
false
false
false
0
write_cache_file(char *file, time_t date, char *ipaddr) { FILE *fp = NULL; if((fp=fopen(file, "w")) == NULL) { return(-1); } fprintf(fp, "%ld,%s\n", date, ipaddr); fclose(fp); return 0; }
false
false
false
false
false
0
defs_to_undefined (insn) rtx insn; { struct df_link *currdef; for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef; currdef = currdef->next) { if (values[DF_REF_REGNO (currdef->ref)].lattice_val != UNDEFINED) SET_BIT (ssa_edges, DF_REF_REGNO (currdef->ref)); values[DF_REF_REGNO (cur...
false
false
false
false
false
0
makeFilename(unsigned int &seed, const char *dir, const char *prefix, const char *postfix, OFString &filename) { OFBool done = OFFalse; OFBool result = OFTrue; struct stat stat_buf; int stat_result = 0; unsigned tries = 0; do { // create filename filename.clear(); if (dir) { filename...
false
false
false
false
false
0
OpenWorldCommunityGridProjectsPage() const { wxLogTrace(wxT("Function Start/End"), wxT("CWelcomePage::OpenWorldCommunityGridProjectsPage - Function Begin")); CWizardAttach* pWAP = ((CWizardAttach*)GetParent()); wxASSERT(pWAP); wxASSERT(wxDynamicCast(pWAP, CWizardAttach)); wxLaunchDefaultBrowser(w...
false
false
false
false
false
0
cts_cbc_encrypt(struct crypto_cts_ctx *ctx, struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int offset, unsigned int nbytes) { int bsize = crypto_blkcipher_blocksize(desc->tfm); u8 tmp[bsize], tmp2[bsize]; struct blkcipher_desc lcldesc; struct sc...
false
false
false
false
false
0
PixelWrite (uae_u8 *mem, int bits, uae_u32 fgpen, int Bpp, uae_u32 mask) { switch (Bpp) { case 1: if (mask != 0xFF) fgpen = (fgpen & mask) | (mem[bits] & ~mask); mem[bits] = (uae_u8)fgpen; break; case 2: ((uae_u16 *)mem)[bits] = (uae_u16)fgpen; break; ...
false
false
false
false
false
0
updateLayout() { ChatEdit* newEdit = createTextEdit(); if (textEdit_) { // all syntaxhighlighters should be removed while we move // the documents around, and should be reattached afterwards textEdit_->setCheckSpelling(false); newEdit->setCheckSpelling(false); moveData(newEdit, textEdit_); newEdit->set...
false
false
false
false
false
0
FastFileLock(struct FF_Handle *i) { if (!i) return NULL; #if defined HAVE_MMAP || defined _WIN32 char *buffer = NULL; if(!g_MemMap) return NULL; #endif #if defined HAVE_MMAP || defined _WIN32 buffer = (char*)g_MemMap; buffer += i->off; return SDL_RWFromMem(buffer, i->len); #else fseek(g_File, i-...
false
false
false
false
false
0
fos_open (const char *path, struct fuse_file_info *fi) { int ret = 0; char *location; location = trim_fosname (path); if ((fi->flags & 3) != O_RDONLY) ret = -EACCES; else if (!fosfat_isopenexm (fosfat, location)) ret = -ENOENT; if (location) free (location); return ret; }
false
false
false
false
false
0
flmLFileIndexBuild( FDB * pDb, LFILE * pIxLFile, IXD * pIxd, FLMBOOL bDoInBackground, FLMBOOL bCreateSuspended, FLMBOOL * pbLogCompleteIndexSet) { RCODE rc = FERR_OK; if( pDb->uiFlags & FDB_REPLAYING_RFL) { // Don't index now. The RFL function INDEX_SET will // generate index keys. if...
false
false
false
false
false
0
dane_X509_any_subject_alt_name_matches_server_name( X509 *cert, ldns_rdf* server_name) { GENERAL_NAMES* names; GENERAL_NAME* name; unsigned char* subject_alt_name_str = NULL; int i, n; names = X509_get_ext_d2i(cert, NID_subject_alt_name, 0, 0 ); if (! names) { /* No subjectAltName extension */ return false;...
false
false
false
false
false
0
ReadFileToString(const std::string& filename, std::string* data) { FILE *f = fopen(filename.c_str(), "rb"); if (f == 0) { LOG(INFO) << "Can't open file: " << filename; return false; } fseek(f, 0, SEEK_END); int size = ftell(f); fseek(f, 0, SEEK_SET); // There should be a faster way to do this, can...
false
false
false
false
false
0
_postorder(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { result = _postorder(ap->l, func, result); result = _postorder(ap->r, func, result); result = (*func) (ap->d, result); } return result; }
false
false
false
false
false
0
main(int argc, char* argv[]) { try { process(argc, argv); } catch (error& e) { cerr << e << endl; exit(EXIT_FAILURE); } catch (std::bad_alloc) { cerr << "Low memory" << endl; exit(EXIT_FAILURE); } catch (...) { cerr << "Unknown error" << endl; exit(EXIT_FAILURE); } return EXIT_SUCCESS; }
false
false
false
false
false
0
gamgi_mesa_pick_orbital (gamgi_orbital *orbital, int class, gamgi_object **array) { gamgi_dlist *dlist; unsigned char color_old[3], color_new[3]; double rotate[16]; double *center; double scale; int *dots; if (class == GAMGI_ENGINE_ORBITAL) { *array++ = GAMGI_CAST_OBJECT orbital; gamgi_mesa_select_old (color_ol...
false
false
false
false
false
0
ecc_encrypt_raw (int algo, gcry_mpi_t *resarr, gcry_mpi_t k, gcry_mpi_t *pkey, int flags) { ECC_public_key pk; mpi_ec_t ctx; gcry_mpi_t result[2]; int err; (void)algo; (void)flags; if (!k || !pkey[0] || !pkey[1] || !pkey[2] || !pkey[3] || !pkey[4] || !pkey[5]) return GPG_ERR_B...
false
false
false
false
false
0
val2txt(double val, int mode) { static char buf[64]; double aval = fabs(val); double sval, asval; char suffix; int ddigits; switch(mode) { case 1: sprintf(buf, "% .4g", val); break; case 0: default: if (1e12 <= aval) { suffix = 'T'; sval = val / 1e12; } else if(1e9 <= aval...
true
true
false
false
false
1
lbtf_setup_firmware(struct lbtf_private *priv) { int ret = -1; lbtf_deb_enter(LBTF_DEB_FW); /* * Read priv address from HW */ eth_broadcast_addr(priv->current_addr); ret = lbtf_update_hw_spec(priv); if (ret) { ret = -1; goto done; } lbtf_set_mac_control(priv); lbtf_set_radio_control(priv); ret = 0;...
false
false
false
false
false
0
ms_ping(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { struct Client *target_p; const char *origin, *destination; if (parc < 2 || EmptyString(parv[1])) { sendto_one(source_p, form_str(ERR_NOORIGIN), me.name, parv[0]); return; } origin = source_p->name; destin...
false
false
false
false
false
0
edge_length_q_hess(e_info) struct qinfo *e_info; { int m,j,jj,k,kk; REAL value = 0.0; REAL len,density,fudge; REAL sumgrad[2][MAXCOORD]; REAL sumhess[2][2][MAXCOORD][MAXCOORD]; REAL tang[MAXCOORD]; if ( METH_INSTANCE(e_info->method)->flags & USE_DENSITY ) density = get_edge_density(e_info->id); else...
false
false
false
false
false
0
mprInsertCharToBuf(MprBuf *bp, int c) { if (bp->start == bp->data) { return MPR_ERR_BAD_STATE; } *--bp->start = c; return 0; }
false
false
false
false
false
0
small_smb2_init(__le16 smb2_command, struct cifs_tcon *tcon, void **request_buf) { int rc; unsigned int total_len; struct smb2_pdu *pdu; rc = smb2_reconnect(smb2_command, tcon); if (rc) return rc; /* BB eventually switch this to SMB2 specific small buf size */ *request_buf = cifs_small_buf_get(); if (*req...
false
false
false
false
false
0
runnerName(const QString &id) const { if (runner(id)) { return runner(id)->name(); } else { return d->advertiseSingleRunnerIds.value(id, QString()); } }
false
false
false
false
false
0
hermon_eth_close ( struct net_device *netdev ) { struct hermon_port *port = netdev->priv; struct ib_device *ibdev = port->ibdev; struct hermon *hermon = ib_get_drvdata ( ibdev ); int rc; /* Close port */ if ( ( rc = hermon_cmd_close_port ( hermon, ibdev->port ) ) != 0 ) { DBGC ( hermon, "Hermon %p port %d coul...
false
false
false
false
false
0
stream_get_duration_string (Stream *stream) { if (!stream) return NULL; gchar *duration, *position, *ret; if (stream->duration >= 0) { gint hour, min, sec; split_nanoseconds (stream->duration, &hour, &min, &sec); duration = g_strdup_printf ("%u:%02u:%02u", hour, min, sec); } else { ...
false
false
false
false
false
0
_regmap_raw_multi_reg_write(struct regmap *map, const struct reg_sequence *regs, size_t num_regs) { int ret; void *buf; int i; u8 *u8; size_t val_bytes = map->format.val_bytes; size_t reg_bytes = map->format.reg_bytes; size_t pad_bytes = map->format.pad_bytes; size_t pair_size = reg_bytes ...
false
false
false
false
false
0
dialog_changed(buf, checkall) buf_T *buf; int checkall; /* may abandon all changed buffers */ { char_u buff[IOSIZE]; int ret; buf_T *buf2; dialog_msg(buff, _("Save changes to \"%s\"?"), (buf->b_fname != NULL) ? buf->b_fname : (char_u *)_("Untitled")); if (checkall) ret = vim_dialog...
false
false
false
false
false
0
rtl8723be_phy_bb_config(struct ieee80211_hw *hw) { bool rtstatus = true; struct rtl_priv *rtlpriv = rtl_priv(hw); u16 regval; u8 b_reg_hwparafile = 1; u32 tmp; u8 crystalcap = rtlpriv->efuse.crystalcap; rtl8723_phy_init_bb_rf_reg_def(hw); regval = rtl_read_word(rtlpriv, REG_SYS_FUNC_EN); rtl_write_word(rtlpriv...
false
false
false
false
false
0
copy_remote_gzip_file(struct remote_file *rfp, char *file, char *ttystr) { int done; char sendbuf[BUFSIZE]; char readbuf[READBUFSIZE]; char gziphdr[DATA_HDRSIZE]; char *bufptr, *p1; FILE *pipe; size_t gtot; struct stat sbuf; ulong pct, ret, req, tot, total; sprintf(readbuf,...
true
true
false
false
true
1
lol_free( LOL *lol ) { int i; for( i = 0; i < lol->count; i++ ) list_free( lol->list[i] ); lol->count = 0; }
false
false
false
false
false
0
git_repository_open_ext( git_repository **repo_ptr, const char *start_path, unsigned int flags, const char *ceiling_dirs) { int error; git_buf path = GIT_BUF_INIT, parent = GIT_BUF_INIT; git_repository *repo; if (repo_ptr) *repo_ptr = NULL; error = find_repo(&path, &parent, start_path, flags, ceiling_dirs)...
false
false
false
false
false
0
LoadGeometry() { int nInvalid; #ifdef DEBUG_TIMING clock_t start, end; #endif if (m_bGeometry) return 0; nInvalid = 0; m_bGeometry = TRUE; #ifdef DEBUG_TIMING start = clock(); #endif if (m_nFeatureCount < 0) { m_poReader->ReadDataRecords(this); ...
false
false
false
false
false
0
zbuildfunction(i_ctx_t *i_ctx_p) { os_ptr op = osp; gs_function_t *pfn; int code = fn_build_function(i_ctx_p, op, &pfn, imemory, 0, 0); if (code < 0) return code; code = make_function_proc(i_ctx_p, op, pfn); if (code < 0) gs_function_free(pfn, true, imemory); return 0; }
false
false
false
false
true
1
IniPath(void) { cvar_t *p; if (!*_inipath) { p = gi.cvar("ininame", "action.ini", 0); if (p->string && *(p->string)) sprintf(_inipath, "%s/%s", GAMEVERSION, p->string); else sprintf(_inipath, "%s/%s", GAMEVERSION, "action.ini"); } return _inipath; }
false
false
false
false
false
0
regex_search_get_real_start (GtkSourceSearchContext *search, const GtkTextIter *start, GtkTextIter *real_start, gint *start_pos) { gint max_lookbehind = g_regex_get_max_lookbehind (search->priv->regex); *real_start = *start; for (*start_pos = 0; *start_pos ...
false
false
false
false
false
0
structseq_contains(PyStructSequence *obj, PyObject *o) { PyObject *tup; int result; tup = make_tuple(obj); if (!tup) return -1; result = PySequence_Contains(tup, o); Py_DECREF(tup); return result; }
false
false
false
false
false
0
__ecereMethod_ProjectSettings_OnPostCreate(struct __ecereNameSpace__ecere__com__Instance * this) { struct ProjectSettings * __ecerePointer_ProjectSettings = (struct ProjectSettings *)(this ? (((char *)this) + __ecereClass_ProjectSettings->offset) : 0); __ecereMethod_ProjectSettings_UpdateDialogTitle(this); __ecereProp...
false
false
false
false
false
0
us_midi_parser_parse( us_midi_parser_t *self, uint8_t b, us_midi_msg_t *msg ) { /* No matter what state we are currently in we must deal with bytes with the high bit set first. */ us_midi_msg_init( msg ); if ( b & 0x80 ) { /* check for system messages (>=0xf0) *...
false
false
false
false
false
0
Getmem(struct Global *global, int size) { /* * Get a block of free memory. */ char *result; if ((result = (char *)Malloc((unsigned) size)) == NULL) cfatal(global, FATAL_OUT_OF_MEMORY); return(result); }
false
false
false
false
false
0
addAssociatedWidget(QWidget *widget) { if(!_associatedWidgets.contains(widget)) { widget->addActions(actions()); _associatedWidgets.append(widget); connect(widget, SIGNAL(destroyed(QObject *)), SLOT(associatedWidgetDestroyed(QObject *))); } }
false
false
false
false
false
0
readSignificant() { Token t; do { t = read(); } while ((t.type() == Token::COMMENT) || (t.type() == Token::NEWLINE)); return t; }
false
false
false
false
false
0
moveto(File *f, Range r) { Posn p1 = r.p1, p2 = r.p2; f->dot.r.p1 = p1; f->dot.r.p2 = p2; if(f->rasp){ telldot(f); outTsl(Hmoveto, f->tag, f->dot.r.p1); } }
false
false
false
false
false
0
plainto_tsquery_byid(PG_FUNCTION_ARGS) { Oid cfgid = PG_GETARG_OID(0); text *in = PG_GETARG_TEXT_P(1); TSQuery query; QueryItem *res; int32 len; query = parse_tsquery(text_to_cstring(in), pushval_morph, ObjectIdGetDatum(cfgid), true); if (query->size == 0) PG_RETURN_TSQUERY(query); /* clean out any...
false
true
false
false
false
1
print_report ( char *method, int stats [COLAMD_STATS] ) { int i1, i2, i3 ; if (!stats) { PRINTF ("%s: No statistics available.\n", method) ; return ; } i1 = stats [COLAMD_INFO1] ; i2 = stats [COLAMD_INFO2] ; i3 = stats [COLAMD_INFO3] ; if (stats [COLAMD_STATUS] >= 0) ...
false
false
false
false
false
0
doprg() { if(master&0x80) { ROM_BANK16(0x8000,master&0x1F); } else { ROM_BANK8(0x8000,mapbyte2[4]); ROM_BANK8(0xa000,mapbyte2[5]); } }
false
false
false
false
false
0
libdef_func(BuildCtx *ctx, char *p, int arg) { if (arg != LIBINIT_CF) ffasmfunc++; if (ctx->mode == BUILD_libdef) { if (modstate == 0) { fprintf(stderr, "Error: no module for function definition %s\n", p); exit(1); } if (regfunc == REGFUNC_NOREG) { if (optr+1 > obuf+sizeof(obuf)) {...
false
true
false
false
false
1
da9062_set_suspend_voltage(struct regulator_dev *rdev, int uv) { struct da9062_regulator *regl = rdev_get_drvdata(rdev); const struct da9062_regulator_info *rinfo = regl->info; int ret, sel; sel = regulator_map_voltage_linear(rdev, uv, uv); if (sel < 0) return sel; sel <<= ffs(rdev->desc->vsel_mask) - 1; re...
false
false
false
false
false
0
unites_to (MOID_T * m, MOID_T * u) { /* Uniting U (m) */ MOID_T *v = NO_MOID; PACK_T *p; if (u == MODE (SIMPLIN) || u == MODE (SIMPLOUT)) { return (m); } for (p = PACK (u); p != NO_PACK; FORWARD (p)) { /* Prefer []->[] over []->FLEX [] */ if (m == MOID (p)) { v = MOID (p); } else if (v == NO...
false
false
false
false
false
0
__parport_register_driver(struct parport_driver *drv, struct module *owner, const char *mod_name) { if (list_empty(&portlist)) get_lowlevel_driver (); if (drv->devmodel) { /* using device model */ int ret; /* initialize common driver fields */ drv->driver.name = drv->name; drv->driver.bus = &pa...
false
false
false
false
false
0
theora_dec_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value, GstFormat * dest_format, gint64 * dest_value) { gboolean res = TRUE; GstTheoraDec *dec; guint64 scale = 1; if (src_format == *dest_format) { *dest_value = src_value; return TRUE; } dec = GST_THEORA_DEC (gst_pad_g...
false
false
false
false
false
0
process (GeglOperation *operation, GeglBuffer *input, GeglBuffer *output, const GeglRectangle *result, gint level) { GeglChantO *o = GEGL_CHANT_PROPERTIES (operation); gint x = result->x; /* initial x *...
false
false
false
false
false
0
stringset_three(string_list_ty *result) { while (stringset_token == STRINGSET_WORD) { string_list_append_unique(result, stringset_token_value); stringset_lex(); } }
false
false
false
false
false
0
slgt_compat_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { struct slgt_info *info = tty->driver_data; int rc = -ENOIOCTLCMD; if (sanity_check(info, tty->name, "compat_ioctl")) return -ENODEV; DBGINFO(("%s compat_ioctl() cmd=%08X\n", info->device_name, cmd)); switch (cmd) { case MGSL...
false
false
false
false
false
0
init_from_mem_pool(int data_size) { master_pos = uint8korr(mem_pool + SL_MASTER_POS_OFFSET); master_port = uint2korr(mem_pool + SL_MASTER_PORT_OFFSET); master_host = mem_pool + SL_MASTER_HOST_OFFSET; master_host_len = (uint) strlen(master_host); // safety master_log = master_host + master_host_len + 1; if...
false
false
false
false
false
0
rwm_op_bind( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *) op->o_bd->bd_info; int rc; rwm_op_cb *roc = rwm_callback_get( op ); rc = rwm_op_dn_massage( op, rs, "bindDN", &roc->ros ); if ( rc != LDAP_SUCCESS ) { op->o_bd->bd_info = (BackendInfo *)on->on_info; send_ldap_error( op, r...
false
false
false
false
false
0
value_is_empty(const Gnome::Gda::Value& value) { if(value.is_null()) return true; switch(value.get_value_type()) { case(0): return true; //Empty and invalid. It has not been initalized with a type. case(G_TYPE_STRING): return value.get_string().empty(); default: return false; //...
false
false
false
false
false
0
cib_process_default(const char *op, int options, const char *section, xmlNode * req, xmlNode * input, xmlNode * existing_cib, xmlNode ** result_cib, xmlNode ** answer) { int result = pcmk_ok; crm_trace("Processing \"%s\" event", op); *answer = NULL; if (op == NU...
false
false
false
false
false
0