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
tt_suite_add_test(tt_testsuite_t *suite, const char *name, void (*function)(void)) { tt_test_t *test = calloc(1, sizeof(tt_test_t)); test->name = strdup(name); test->function = function; if(suite->last_test != NULL) suite->last_test->next = test; suite->last_test = test; if(sui...
false
false
false
false
false
0
GetNthKey( unsigned int n ) { if (n >= this->Tags.size()) { return NULL; } return this->Tags[n].c_str(); }
false
false
false
false
false
0
inter4pol (short* buf, float index, long size){ double frac, a, b, c, d, cminusb; short* fp; long lindex = (long)index; /* 4 point interpolation taken from tabread4~ of pd (pure-data.org) */ if ((float)lindex == index) // no need to interpolate: return (*(buf + lindex) / 32767.); if (!size) return 0.; if...
false
false
false
false
false
0
read_line (GstRTSPConnection * conn, guint8 * buffer, guint * idx, guint size) { while (TRUE) { guint8 c; gint r; if (conn->read_ahead == READ_AHEAD_EOH) { /* the last call to read_line() already determined that we have reached * the end of the headers, so convey that information now */ ...
false
false
false
false
false
0
GetValue(NPPVariable aVariable, void *aValue) { if (aVariable == NPPVpluginScriptableNPObject) { if (_scriptObject) { void **v = (void **)aValue; NPN_RetainObject(_scriptObject); *v = _scriptObject; } else { gnash::log_debug("_scriptObject is not assi...
false
false
false
false
false
0
configure(Vector<String> &conf, ErrorHandler *errh) { errh->warning("SetAnnoByte(ANNO, VALUE) is obsolete, use Paint(VALUE, ANNO) instead"); return Args(conf, this, errh) .read_mp("ANNO", AnnoArg(1), _offset) .read_mp("VALUE", _value).complete(); }
false
false
false
false
false
0
APar_ReturnChildrenAtoms(short this_atom, uint8_t atom_index) { short child_atom = 0; uint8_t total_children = 0; short iter = parsedAtoms[this_atom].NextAtomNumber; while (true) { if ((parsedAtoms[iter].AtomicLevel == parsedAtoms[this_atom].AtomicLevel + 1 && this_atom > 0) || ...
false
false
false
false
false
0
IsInSelection(const wxPoint2DDouble &pt) const { register int n, count = m_blocks.GetCount(); for (n=0; n<count; n++) { if (m_blocks[n].Contains(pt)) return true; } return false; }
false
false
false
false
false
0
main(int argc, char **argv) { wavSound*s; FILE *fin; FILE *fout; if (argc < 4 || argc > 6) { printf("Usage 1: %s <file.wav> <output.c> <soundname>\n", argv[0]); printf("Usage 2: %s <file.wav> <output.c> <soundname> <amount of samples>\n", argv[0]); exit(0); } fin = fopen(argv[1], "r"); s = loadWaveHeade...
false
false
false
false
true
1
gfire_filetransfer_data_packet_request(gfire_filetransfer *p_transfer, guint64 p_offset, guint32 p_size, guint32 p_msgid) { if(!p_transfer || purple_xfer_get_type(p_transfer->xfer) != PURPLE_XFER_SEND || p_offset >= p_transfer->size || p_size > 0x01E00000 /* 30 MB */) return; guint8 *data = g_malloc(...
false
true
false
false
true
1
hybrid_account_set_connection_string(HybridAccount *account, const gchar *string) { g_return_if_fail(account != NULL); gtk_label_set_markup(GTK_LABEL(account->login_tips), string); }
false
false
false
false
false
0
zero_extended_scalar_load_operand_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) #line 738 "../../src/gcc/config/i386/predicates.md" { unsigned n_elts; op = maybe_get_pool_constant (op); if (!(op && GET_CODE (op) == CONST_VECTOR)) return false; n_elts = CONST_VECTOR_NUNITS (op); for (n_elts--; n_e...
false
false
false
false
false
0
bus_matchmaker_unref (BusMatchmaker *matchmaker) { _dbus_assert (matchmaker->refcount > 0); matchmaker->refcount -= 1; if (matchmaker->refcount == 0) { int i; for (i = DBUS_MESSAGE_TYPE_INVALID; i < DBUS_NUM_MESSAGE_TYPES; i++) { RulePool *p = matchmaker->rules_by_type + i; ...
false
false
false
false
false
0
lookup(unsigned VR) { unsigned RInd = TargetRegisterInfo::virtReg2Index(VR); // Grow the vector to at least 32 elements. if (RInd >= CVect.size()) CVect.resize(std::max(RInd+16, 32U), 0); const BitTracker::RegisterCell *CP = CVect[RInd]; if (CP == 0) CP = CVect[RInd] = &BT....
false
false
false
false
false
0
show_bios_limit(struct cpufreq_policy *policy, char *buf) { unsigned int limit; int ret; if (cpufreq_driver->bios_limit) { ret = cpufreq_driver->bios_limit(policy->cpu, &limit); if (!ret) return sprintf(buf, "%u\n", limit); } return sprintf(buf, "%u\n", policy->cpuinfo.max_freq); }
false
true
false
false
false
1
dump_scs_line(Boolean reset_pp, Boolean always_nl) { int i; Boolean any_data = False; /* Find the last non-space character in the line buffer. */ for (i = mpp; i >= 1; i--) { if (trnbuf[i].data_len != 0 || linebuf[i] != ' ') break; } /* * If there is data there, print it with a trailing newline and * c...
false
false
false
false
false
0
inspect_load(GKeyFile *config, const char *section) { char *name = utils_key_file_get_string(config, section, "name"); gchar *expr = utils_key_file_get_string(config, section, "expr"); gint hb_mode = utils_get_setting_integer(config, section, "hbit", HB_DEFAULT); char *frame = utils_key_file_get_string(config, sect...
false
false
false
false
false
0
plugin_configure(GtkDialog * dialog) { gint i; GtkWidget *label, *vbox, *author_label; vbox = gtk_vbox_new(FALSE, 6); label = gtk_label_new(_("Select a pastebin:")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); author_label = gtk_label_new(_("Enter the author name:")); gtk_misc_set_al...
false
false
false
false
false
0
parseCommonRQ(DcmDataset *obj, Uint16 *command, Uint16 *messageID, Uint16 *dataSetType) { OFCondition cond = getAndDeleteUS(obj, DCM_CommandField, command); RET(cond); cond = getAndDeleteUS(obj, DCM_MessageID, messageID); RET(cond); cond = getAndDeleteUS(obj, DCM_DataSetType, dataSetType); RET(cond); ...
false
false
false
false
false
0
AcceptServerConnect(struct connectdata *conn) { struct SessionHandle *data = conn->data; curl_socket_t sock = conn->sock[SECONDARYSOCKET]; curl_socket_t s = CURL_SOCKET_BAD; #ifdef ENABLE_IPV6 struct Curl_sockaddr_storage add; #else struct sockaddr_in add; #endif curl_socklen_t size = (curl_socklen_t) sizeo...
false
false
false
false
false
0
fetch_validx(struct gspca_dev *gspca_dev, struct validx *tbl, int len) { int n; for (n = 0; n < len; n++) { if (tbl[n].idx != 0xffff) ctrl_out(gspca_dev, 0x40, 1, tbl[n].val, tbl[n].idx, 0, NULL); else if (tbl[n].val == 0xffff) break; else msleep(tbl[n].val); } return n; }
false
false
false
false
false
0
ChooseIndexColumnNames(List *indexElems) { List *result = NIL; ListCell *lc; foreach(lc, indexElems) { IndexElem *ielem = (IndexElem *) lfirst(lc); const char *origname; const char *curname; int i; char buf[NAMEDATALEN]; /* Get the preliminary name from the IndexElem */ if (ielem->indexcoln...
false
false
false
false
false
0
nfs3_fdcache_remove (struct nfs3_state *nfs3, fd_t *fd) { struct nfs3_fd_entry *fde = NULL; uint64_t ctxaddr = 0; if ((!nfs3) || (!fd)) return -1; LOCK (&nfs3->fdlrulock); { fd_ctx_get (fd, nfs3->nfsx, &ctxaddr); ...
false
false
false
false
false
0
sjlj_build_landing_pads (void) { int num_dispatch; num_dispatch = vec_safe_length (cfun->eh->lp_array); if (num_dispatch == 0) return; sjlj_lp_call_site_index.safe_grow_cleared (num_dispatch); num_dispatch = sjlj_assign_call_site_values (); if (num_dispatch > 0) { rtx dispatch_label = gen_la...
false
false
false
true
false
1
hc55516_clock_w(int num, int state) { struct hc55516_data *chip = &hc55516[num]; int clock = state & 1, diffclock; /* update the clock */ diffclock = clock ^ chip->last_clock; chip->last_clock = clock; /* speech clock changing (active on rising edge) */ if (diffclock && clock) { double integrato...
false
false
false
false
false
0
add_hidden_capitalized_word(char * word, int wbl, int wcl, unsigned short * flags, int al, char * dp, int captype) { // add inner capitalized forms to handle the following allcap forms: // Mixed caps: OpenOffice.org -> OPENOFFICE.ORG // Allcaps with suffixes: CIA's -> CIA'S if (((captype == HUHC...
false
true
false
false
false
1
mr_shift(_MIPD_ big x,int n,big w) { /* set w=x.(mr_base^n) by shifting */ mr_lentype s; int i,bl; mr_small *gw=w->w; #ifdef MR_OS_THREADS miracl *mr_mip=get_mip(); #endif if (mr_mip->ERNUM) return; copy(x,w); if (w->len==0 || n==0) return; MR_IN(33) if (mr_notint(w)) mr_berror(_MIP...
false
false
false
false
false
0
_content_set(Evas_Object *obj, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); Evas_Object *prev_content; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->content && wd->content == content) return; if (wd->items) { _remove_items(wd); _list_del(wd); ...
false
false
false
false
false
0
gzip_bidder_init(struct archive_read_filter *self) { struct private_data *state; static const size_t out_block_size = 64 * 1024; void *out_block; self->code = ARCHIVE_COMPRESSION_GZIP; self->name = "gzip"; state = (struct private_data *)calloc(sizeof(*state), 1); out_block = (unsigned char...
false
false
false
false
false
0
ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout) { u8 stat = 0; while (timeout--) { /* * Turn this into a schedule() sleep once I'm sure * about locking issues (2.5 work ?). */ mdelay(1); stat = hwif->tp_ops->read_status(hwif); if ((stat & ATA_BUSY) == 0) return 0; /* * Assume a va...
false
false
false
false
false
0
save() { if( _quest ) { _quest->setName( _name->getValue() ); _quest->setDescription( _description->getValue() ); _quest->setType( (Quest::QuestType)_type->currentItem() ); _quest->setConfirmationNeeded( _needConfirmation->getValue() ); _quest->setConfirmationQuestion( _confirmationQuestion->getValue() ); ...
false
false
false
false
false
0
addRenderSystemToName( const String & name ) { // Use the current render system RenderSystem* rs = Root::getSingleton().getRenderSystem(); return rs->getName() + "_" + name; }
false
false
false
false
false
0
fcoe_str_to_dev_loss(const char *buf, unsigned long *val) { int ret; ret = kstrtoul(buf, 0, val); if (ret) return -EINVAL; /* * Check for overflow; dev_loss_tmo is u32 */ if (*val > UINT_MAX) return -EINVAL; return 0; }
false
false
false
false
false
0
nemo_undo_register_full (GList *atoms, GObject *undo_manager_search_start_object, const char *operation_name, const char *undo_menu_item_label, const char *undo_menu_item_hint, const char *redo_menu_item_label, const char *redo_menu_item_hint) { NemoUndoTransaction *tran...
false
false
false
false
false
0
transport_remove_classdev(struct attribute_container *cont, struct device *dev, struct device *classdev) { struct transport_container *tcont = attribute_container_to_transport_container(cont); struct transport_class *tclass = class_to_transport_class(cont->class); if (tclass->remove) tclass->...
false
false
false
false
false
0
cursorcmd() { #ifdef KANJI int i; int col = 1; int row = 0; for (i = 0; col < cmdspos && i < cmdpos; ++i) { if (ISkanji(cmdbuff[i])) { if (col >= (Columns - 1)) { col = 2; row++; } else if (col >= (Columns - 2)) { col = 0; row++; } else col += 2; i++; } el...
true
true
false
false
true
1
posix_file_xfer_deliver_iob ( struct xfer_interface *xfer, struct io_buffer *iobuf, struct xfer_metadata *meta ) { struct posix_file *file = container_of ( xfer, struct posix_file, xfer ); /* Keep track of file position solely for the filesize */ if ( meta->whence != SEEK_CUR ) file->pos = 0; ...
false
false
false
false
false
0
any_external_decl (tree id) { tree decl = IDENTIFIER_SYMBOL_VALUE (id); tree t; if (decl == 0 || TREE_CODE (decl) == ERROR_MARK) return 0; else if (TREE_CODE (decl) != TYPE_DECL && DECL_EXTERNAL (decl)) return decl; t = purpose_member (id, truly_local_externals); if (t) return TREE_VALUE (t); ...
false
false
false
false
false
0
readi(struct inode *ip, char *dst, uint off, uint n) { uint tot, m; struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) return -1; return devsw[ip->major].read(ip, dst, n); } if(off > ip->size || off + n < off) return -1; if(off + n > i...
false
true
false
false
true
1
diag(DiagonalMatrix& m, const ColumnVector& diagvals) { Tracer tr("diag"); m.ReSize(diagvals.Nrows()); m=0.0; for (int j=1; j<=diagvals.Nrows(); j++) m(j)=diagvals(j); return 0; }
false
false
false
false
false
0
vim_version_dir(vimdir) char_u *vimdir; { char_u *p; if (vimdir == NULL || *vimdir == NUL) return NULL; p = concat_fnames(vimdir, (char_u *)VIM_VERSION_NODOT, TRUE); if (p != NULL && mch_isdir(p)) return p; vim_free(p); p = concat_fnames(vimdir, (char_u *)RUNTIME_DIRNAME, TRUE); if (p...
false
false
false
false
false
0
fromQuadrilaterals(AnnotQuadrilaterals *hlquads) const { QList< HighlightAnnotation::Quad > quads; if ( !hlquads || !hlquads->getQuadrilateralsLength() ) return quads; const int quadsCount = hlquads->getQuadrilateralsLength(); double MTX[6]; fillTransformationMTX(MTX); for (int q = 0;...
false
false
false
false
false
0
substitute_pseudo (rtx *loc, int old_regno, rtx new_reg) { rtx x = *loc; bool result = false; enum rtx_code code; const char *fmt; int i, j; if (x == NULL_RTX) return false; code = GET_CODE (x); if (code == REG && (int) REGNO (x) == old_regno) { enum machine_mode mode = GET_MODE (*loc); ...
false
false
false
false
false
0
rsa_key_check (struct rsa_secret_key_s *skey) { int err = 0; gcry_mpi_t t = gcry_mpi_snew (0); gcry_mpi_t t1 = gcry_mpi_snew (0); gcry_mpi_t t2 = gcry_mpi_snew (0); gcry_mpi_t phi = gcry_mpi_snew (0); /* check that n == p * q */ gcry_mpi_mul (t, skey->p, skey->q); if (gcry_mpi_cmp( t, skey->n) ) { ...
false
false
false
false
false
0
_print_pn_min_memory(job_info_t * job, int width, bool right_justify, char* suffix) { char min_mem[10]; char tmp_char[21]; if (job == NULL) /* Print the Header instead */ _print_str("MIN_MEMORY", width, right_justify, true); else { tmp_char[0] = '\0'; job->pn_min_memory &= (~MEM_PER_CPU); convert_...
false
false
false
false
false
0
sodium_memcmp(const void * const b1_, const void * const b2_, size_t len) { const unsigned char *b1 = (const unsigned char *) b1_; const unsigned char *b2 = (const unsigned char *) b2_; size_t i; unsigned char d = (unsigned char) 0U; for (i = 0U; i < len; i++) { d |= b1...
false
false
false
false
false
0
sdb_query_result_validate_field (SymbolDBQueryResult *result, IAnjutaSymbolField field, GError **err) { g_return_val_if_fail (err == NULL || *err == NULL, FALSE); if (field >= IANJUTA_SYMBOL_FIELD_END) { g_set_error (err, SYMBOL_DB_QUERY_RESULT_ER...
false
false
false
false
false
0
lam_ssi_coll_lam_basic_allreduce_inter(void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm intercomm) { int local_rank, root; MPI_Comm local_comm; int is_low; local_comm = intercomm->c_ssi_coll_lam_basic_data->local_comm; is_low = intercomm->c_ssi_coll_lam_basic_d...
false
false
false
false
false
0
tcp_start(int port) { int ret; struct sockaddr_in saddr; int fd; fd = socket(AF_INET, SOCK_STREAM, 0); if (fd < 0) { clog(CL_ERROR, "Create socket failed\n"); return -1; } set_server_socket(fd); saddr.sin_family = AF_INET; saddr.sin_addr.s_addr = htonl(INADDR_ANY); saddr.sin_port = htons(port); ret = b...
false
false
false
false
false
0
JustReachedHome() override { if (m_pInstance) { if (Creature* pEmperor = m_pInstance->GetSingleCreatureFromStorage(NPC_EMPEROR)) { // if evade, then check if he is alive. If not, start make portal if (!pEmperor->IsAlive()) { ...
false
false
false
false
false
0
luaI_openlib(lua_State*L,const char*libname, const luaL_Reg*l,int nup){ if(libname){ int size=libsize(l); luaL_findtable(L,(-10000),"_LOADED",1); lua_getfield(L,-1,libname); if(!lua_istable(L,-1)){ lua_pop(L,1); if(luaL_findtable(L,(-10002),libname,size)!=NULL) luaL_error(L,"name conflict for module "LUA_QL("%s"),libna...
false
false
false
false
false
0
is_send_from_grf() { switch (opcode) { case SHADER_OPCODE_SHADER_TIME_ADD: case VS_OPCODE_PULL_CONSTANT_LOAD_GEN7: return true; default: return false; } }
false
false
false
false
false
0
kfd_event_destroy(struct kfd_process *p, uint32_t event_id) { struct kfd_event *ev; int ret = 0; mutex_lock(&p->event_mutex); ev = lookup_event_by_id(p, event_id); if (ev) destroy_event(p, ev); else ret = -EINVAL; mutex_unlock(&p->event_mutex); return ret; }
false
false
false
false
false
0
systemIdFilename(const StringC &systemId, StringC &filename) { if (systemId.size() == 0) return -1; Owner<InputSource> in(EntityManager->open(systemId, *SystemCharset, InputSourceOrigin::make(), 0, *App)); if (!in) return 0; Xchar c = in->get(*App); StorageObjec...
false
false
false
false
false
0
cmd_cd(const char *data) { char *str; g_return_if_fail(data != NULL); if (*data == '\0') return; str = convert_home(data); chdir(str); g_free(str); }
false
false
false
false
false
0
ensure_bus_data (DBusConnection *connection) { BusData *bd; if (!dbus_connection_allocate_data_slot (&bus_data_slot)) return NULL; bd = dbus_connection_get_data (connection, bus_data_slot); if (bd == NULL) { bd = dbus_new0 (BusData, 1); if (bd == NULL) { dbus_connec...
false
false
false
false
false
0
bind_transfer_to_peer (FileteaNode *self, EvdPeer *peer, FileTransfer *transfer) { GQueue *peer_transfers; peer_transfers = g_hash_table_lookup (self->priv->transfers_by_peer, peer); if (peer_transfers == NULL) { peer_transfers = g_queue_new (); g_hash_table_insert (self->priv->transfers_by_peer,...
false
false
false
false
false
0
write_state_files_list (void) { int i = 0; /* Write the list of files with their lang_bitmap. */ fprintf (state_file, "\n(!fileslist %d\n", (int) num_gt_files); for (i = 0; i < (int) num_gt_files; i++) { const char *cursrcrelpath = NULL; const input_file *curfil = gt_files[i]; /* Most of ...
false
false
false
false
false
0
ata_sas_port_init(struct ata_port *ap) { int rc = ap->ops->port_start(ap); if (rc) return rc; ap->print_id = atomic_inc_return(&ata_print_id); return 0; }
false
false
false
false
false
0
print(iter_type f, iter_type l) { for (iter_type i = f; i != l; ++i) print(*i); }
false
false
false
false
false
0
handle_trickle(MSG_FROM_HOST& mfh) { int retval; printf( "got trickle-up \n%s\n\n", mfh.xml ); DB_MSG_TO_HOST mth; mth.clear(); mth.create_time = time(0); mth.hostid = mfh.hostid; safe_strcpy(mth.variety, mfh.variety); mth.handled = false; sprintf(mth.xml, ...
false
false
false
false
false
0
real_arithmetic (REAL_VALUE_TYPE *r, int icode, const REAL_VALUE_TYPE *op0, const REAL_VALUE_TYPE *op1) { enum tree_code code = (enum tree_code) icode; if (op0->decimal || (op1 && op1->decimal)) return decimal_real_arithmetic (r, code, op0, op1); switch (code) { case PLUS_EXPR: /* Clear any...
false
false
false
false
false
0
min_max(PyObject *args, PyObject *kwds, int op) { PyObject *v, *it, *item, *val, *maxitem, *maxval, *keyfunc=NULL; const char *name = op == Py_LT ? "min" : "max"; if (PyTuple_Size(args) > 1) v = args; else if (!PyArg_UnpackTuple(args, (char *)name, 1, 1, &v)) return NULL; if (kwds ...
false
false
false
false
false
0
Curses_clear_window(Window * window) { int y, x; if (!inited) return 1; for (y = window->top + 1; y < window->bottom; y++) { move(y, x = window->left + 1); while (x++ < window->right) addch(' '); } Curses_outline_window(window); refresh(); return 0; }
false
false
false
false
false
0
brcmf_ops_sdio_resume(struct device *dev) { struct brcmf_bus *bus_if = dev_get_drvdata(dev); struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; struct sdio_func *func = container_of(dev, struct sdio_func, dev); brcmf_dbg(SDIO, "Enter: F%d\n", func->num); if (func->num != SDIO_FUNC_2) return 0; brcmf_sdio...
false
false
false
false
false
0
dlm_callback_work(struct work_struct *work) { struct dlm_lkb *lkb = container_of(work, struct dlm_lkb, lkb_cb_work); struct dlm_ls *ls = lkb->lkb_resource->res_ls; void (*castfn) (void *astparam); void (*bastfn) (void *astparam, int mode); struct dlm_callback callbacks[DLM_CALLBACKS_SIZE]; int i, rv, resid; mem...
false
false
false
false
false
0
pdb_decode_acct_ctrl(const char *p) { int acct_ctrl = 0; int done = 0; /* * Check if the account type bits have been encoded after the * NT password (in the form [NDHTUWSLXI]). */ if (*p != '[') return 0; for (p++; *p && !done; p++) { switch (*p) { case 'N': /* 'N'o password. */ acct_ctrl |= ACB...
false
false
false
false
false
0
clear(void) { set(INVALID, "", ""); myIntType = INT_NOT; myOwnPointedTo = false; if (myOwnPointedTo && myIntPointer != NULL) delete myIntPointer; myIntPointer = NULL; if (myOwnPointedTo && myIntShortPointer != NULL) delete myIntShortPointer; myIntShortPointer = NULL; if (myOwnPointedTo && myInt...
false
false
false
false
false
0
brasero_volume_finalize (GObject *object) { BraseroVolumePrivate *priv; priv = BRASERO_VOLUME_PRIVATE (object); BRASERO_MEDIA_LOG ("Finalizing Volume object"); if (priv->cancel) { g_cancellable_cancel (priv->cancel); g_object_unref (priv->cancel); priv->cancel = NULL; } G_OBJECT_CLASS (brase...
false
false
false
false
false
0
remove_custom_shortcut (GtkTreeModel *model, GtkTreeIter *iter) { CcKeyboardItem *item; GPtrArray *keys_array; GVariantBuilder builder; char **settings_paths; int i; gtk_tree_model_get (model, iter, DETAIL_KEYENTRY_COLUMN, &item, -1); /* not a custom shortcut ...
false
false
false
false
false
0
addcheckresult(int rc, char type, char *param, int total, int warn, int crit, int min, int max) { struct checkresult *res=malloc(sizeof(struct checkresult)), *temp; res->rc=rc; res->checktype=type; res->checkoption=strdup(param); res->value=total; res->warn=warn; res->crit=crit; res->min=min; res->max=ma...
false
false
false
false
false
0
write_player_track(track) { register unsigned int iteration; playerCount = track; memset(melop, 0, MAX_RECURSION*2); if(!globalWritten) { if(!mf_write_meta_event(0, copyright_notice, copyright, strlen(copyright))) { fprintf(stderr, "Error writing midi file!\n"); return -1; } mf_write_tempo((long)60000...
false
false
false
false
false
0
init_layer3_gainpow2_mmx(mpg123_handle *fr, int i) { if(!fr->p.down_sample) return DOUBLE_TO_REAL(16384.0 * pow((double)2.0,-0.25 * (double) (i+210) )); else return DOUBLE_TO_REAL(pow((double)2.0,-0.25 * (double) (i+210))); }
false
false
false
false
false
0
parseAttributes(int p0, NodePtr node, bool *quickClose) { *quickClose = false; int p = p0; NamedNodeMap attributes; while (p<len) { /*printf("ch:%c\n",ch);*/ p = skipwhite(p); int ch = get(p); /*printf("ch:%c\n",ch);*/ if (ch == '?' || ch == '>')//d...
false
false
false
false
false
0
doDuties() { SPtr<TIfaceIface> iface = ClntIfaceMgr().getIfaceByID(this->Iface); if (!MRD) { ostringstream iaLst; ostringstream pdLst; SPtr<TOpt> ptrOpt; firstOption(); while(ptrOpt=getOption()) { switch( ptrOpt->getOptType()) { case OPTI...
false
false
false
false
false
0
rehash(Hashtable *old, unsigned long size, Memman *treespace) { /* Construct a new hash table out of an old one, using same buckets */ unsigned long i, magic; Hashindex *p, *nextp; Hashtable *ans; char *c; if (treespace != NULL && size * sizeof(Hashindex *) < BLOCKSIZE) { ans = (Hashtable *)submalloc(t...
false
false
false
false
false
0
coverage() const throw () { if (_d[1] == 3) return Coverage(_d.offset_subtable(F3_HSIZE), 0, false); else return Coverage(); }
false
false
false
false
false
0
open_tsfile(job_rec *jr) /* Open the timestamp file for job jr */ { jr->timestamp_fd = open(jr->ident, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); if (jr->timestamp_fd == -1) die_e("Can't open timestamp file for job %s", jr->ident); fcntl(jr->timestamp_fd, F_SETFD, 1); /* set close-on-exec flag */ /* We w...
false
false
false
false
false
0
DumpLSRSendEvent(GF_SceneDumper *sdump, GF_Command *com) { char szID[1024]; char *lsrns = sd_get_lsr_namespace(com->in_scene); DUMP_IND(sdump); fprintf(sdump->trace, "<%sSendEvent ref=\"%s\" event=\"%s\"", lsrns, lsr_format_node_id(com->node, com->RouteID, szID), gf_dom_event_get_name(com->send_event_name) )...
true
true
false
false
false
1
knh_Bytes_ensureZero(CTX ctx, kBytes *ba) { size_t size = BA_size(ba); size_t capacity = ba->dim->capacity; if(size == capacity) { knh_Bytes_expands(ctx, ba, k_grow(capacity)); } ba->bu.ubuf[BA_size(ba)] = 0; return ba->bu.text; }
false
false
false
false
false
0
stringToFrameImageComponent(const String& str) { if (str == "TopLeftCorner") { return FIC_TOP_LEFT_CORNER; } if (str == "TopRightCorner") { return FIC_TOP_RIGHT_CORNER; } if (str == "BottomLeftCorner") { return FIC_B...
false
false
false
false
false
0
em28xx_dvb_fini(struct em28xx *dev) { struct em28xx_dvb *dvb; struct i2c_client *client; if (dev->is_audio_only) { /* Shouldn't initialize IR for this interface */ return 0; } if (!dev->board.has_dvb) { /* This device does not support the extension */ return 0; } if (!dev->dvb) return 0; em28xx_in...
false
false
false
false
false
0
send_join_packet(net_addr* addr,join_request *jr) { ubyte data[MAX_PACKET_SIZE]; int packet_size; // build the header and add the request BUILD_HEADER(JOIN); add_join_request(data, &packet_size, jr); psnet_send(addr, data, packet_size); }
false
false
false
false
false
0
genConvert(VnCharset & incs, VnCharset & outcs, ByteInStream & input, ByteOutStream & output) { StdVnChar stdChar; int bytesRead, bytesWritten; incs.startInput(); outcs.startOutput(); int ret = 1; while (!input.eos()) { stdChar = 0; if (incs.nextInput(input, stdChar, bytesRead)) { if (stdChar != IN...
false
false
false
false
false
0
dmi_sel_raw_read_io(struct dmi_sysfs_entry *entry, const struct dmi_system_event_log *sel, char *buf, loff_t pos, size_t count) { ssize_t wrote = 0; sel_io_reader io_reader = sel_io_readers[sel->access_method]; while (count && pos < sel->area_length) { count--; *(buf++) = io_reader(sel, pos++); ...
false
false
false
false
false
0
diagram_lua_new_from_array(lua_State *L) { GtDiagram **diagram; GtArray *nodes; GtRange range; GtStyle *style; /* get array */ nodes = genome_node_table_to_array(L); /* get range */ range.start = luaL_checklong(L, 2); range.end = luaL_checklong(L, 3); luaL_argcheck(L, range.start > 0, 2, "must be ...
false
false
false
false
false
0
ensMapperunitNewCpy(const EnsPMapperunit mu) { EnsPMapperunit pthis = NULL; if (!mu) return NULL; AJNEW0(pthis); pthis->Objectidentifier = mu->Objectidentifier; pthis->Start = mu->Start; pthis->End = mu->End; pthis->Use = 1U; return pthis; }
false
false
false
false
false
0
BK_hess_project(S,B,x) struct linsys *S; /* factored and constrained system */ REAL *B; /* incoming vector */ REAL *x; /* solution, may be incoming */ { REAL *T1,*T2,*T3; int i; if ( S->CN == 0 ) return; T1 = (REAL *)temp_calloc(2*S->CN+S->N,sizeof(REAL)); T2 = T1 + S->CN; T3 = T2 + S->CN; sp_aug_solv...
false
false
false
false
false
0
shmem_mapping(struct address_space *mapping) { if (!mapping->host) return false; return mapping->host->i_sb->s_op == &shmem_ops; }
false
false
false
false
false
0
unit_duplicate( Unit *unit ) { Unit *new = calloc(1,sizeof(Unit)); memcpy(new,unit,sizeof(Unit)); unit_set_generic_name(new, units->count + 1, unit->prop.name); if (unit->sel_prop==&unit->prop) new->sel_prop=&new->prop; else new->sel_prop=&new->trsp_prop; new->backup = calloc( 1,...
false
false
false
false
false
0
ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { BN_CTX *new_ctx = NULL; BN_MONT_CTX *mont = NULL; BIGNUM *one = NULL; int ret = 0; if (group->field_data1 != NULL) { BN_MONT_CTX_free(group->field_data1); group->field_data1 = NULL; } if (group...
false
false
false
false
false
0
select( int sel_start, int sel_end ) const { QList<LineChunk> list; if ( ( sel_start < start_ ) && ( sel_end < start_ ) ) { // Selection BEFORE this chunk: no change list << LineChunk( *this ); } else if ( sel_start > end_ ) { // Selection AFTER this chunk: no change lis...
false
false
false
false
false
0
clone_payload(const unsigned char *pkt_ptr, size_t bytes_left) { struct isakmp_generic hdr; unsigned char *clone_ptr; size_t payload_len; /* * Ensure that there is sufficient data to fill the generic * header. */ if (bytes_left < sizeof(struct isakmp_generic)) { return NULL; } /* * Fill in the ...
false
false
false
false
false
0
vlv_psr_disable(struct intel_dp *intel_dp) { struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct drm_device *dev = intel_dig_port->base.base.dev; struct drm_i915_private *dev_priv = dev->dev_private; struct intel_crtc *intel_crtc = to_intel_crtc(intel_dig_port->base.base.crtc); uint32_t ...
false
false
false
false
false
0
FDKaacEnc_CalcAutoCorrValue( const FIXP_DBL *spectrum, const INT startLine, const INT stopLine, const INT lag, const INT scale ) { int i; FIXP_DBL result = FL2FXCONST_DBL(0.f); if (lag=...
false
false
false
false
false
0
element_path (const GList *elements) { GString *string; const GList *node; string = g_string_new(NULL); for (node = elements; node; node = g_list_next(node)) { g_string_append(string, "/"); g_string_append(string, node->data); } return g_string_free(string, FALSE); }
false
false
false
false
false
0
print_init_quad(char *buf, RfmQuad q) { if (q == NULL) { return buf; } buf += sprintf(buf, "\n quadruple {\n"); for (; q != NULL; q = q->next) { buf += sprintf(buf, " "); PrintQuad(buf, q); NEW_LINE(buf); } buf += sprintf(buf, " } %% quadruple\n"); return buf; }
false
false
false
false
false
0
iruserok_af (raddr, superuser, ruser, luser, af) const void *raddr; int superuser; const char *ruser, *luser; sa_family_t af; { struct sockaddr_storage ra; size_t ralen; memset (&ra, '\0', sizeof(ra)); switch (af){ case AF_INET: ra.ss_family = AF_INET; memcpy (&(((struct sockaddr_...
false
false
false
false
false
0
xenbus_free_evtchn(struct xenbus_device *dev, int port) { struct evtchn_close close; int err; close.port = port; err = HYPERVISOR_event_channel_op(EVTCHNOP_close, &close); if (err) xenbus_dev_error(dev, err, "freeing event channel %d", port); return err; }
false
false
false
false
false
0
get_client_host(aClient *cptr) { static char nbuf[HOSTLEN * 2 + USERLEN + 5]; if (!MyConnect(cptr)) return cptr->name; if (!cptr->user) return get_client_name(cptr, TRUE); #ifdef UNIXPORT if (IsUnixSocket(cptr)) sprintf(nbuf, "%s[%s]", cptr->name, ME); else #endif (void)sprintf(nbuf, "%s[%-.*s@%-.*s]", ...
false
false
false
false
false
0