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
ComputeColumn(const char *Ptr, size_t Size) { // If our previous scan pointer is inside the buffer, assume we already // scanned those bytes. This depends on raw_ostream to not change our buffer // in unexpected ways. if (Ptr <= Scanned && Scanned <= Ptr + Size) { // Scan all characters added since our last...
false
false
false
false
false
0
DumpIntHex(FILE *trace, const char *attName, u32 val, u32 indent, Bool XMTDump, Bool single_byte) { StartAttribute(trace, attName, indent, XMTDump); if (single_byte) { fprintf(trace, "0x%02X", val); } else { fprintf(trace, "0x%08X", val); } EndAttribute(trace, indent, XMTDump); }
false
false
false
false
false
0
gfm_server_replicate_file_from_to(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *srchost; char *dsthost; gfarm_int32_t flags; struct process *process; gfarm_int32_t cfd; struct host *src, *dst; struct inode *inode; struct file_replicating *fr; int srcport; gfarm_ino_t ino; gfarm_int6...
false
false
false
false
false
0
parser_make_precedence_t (Parser* self, LexerTokenType type) { guint result = 0U; LexerTokenType _tmp0_ = 0; Precedence _tmp1_ = 0; guint _tmp2_ = 0U; g_return_val_if_fail (self != NULL, 0U); _tmp0_ = type; _tmp1_ = parser_get_precedence (self, _tmp0_); _tmp2_ = self->priv->depth_level; result = _tmp1_ + (_tmp...
false
false
false
false
false
0
permuted(IntegerVector const &permutation, SymmetricComplex const &complex, bool withSymmetry)const { /* Cone ret; ret.dimension=dimension; ret.multiplicity=multiplicity;*/ set<int> r; for(vector<int>::const_iterator i=indices.begin();i!=indices.end();i++) { IntegerVector ny=SymmetryGroup::compose...
false
false
false
false
false
0
gkm_mock_C_InitToken (CK_SLOT_ID slotID, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen, CK_UTF8CHAR_PTR pLabel) { g_assert (slotID == GKM_TEST_SLOT_ONE && "Invalid slotID"); g_assert (pPin != NULL && "Invalid pPin"); g_assert (strlen ("TEST PIN") && "Invalid ulPinLen"); g_assert (strncmp ((gchar*)pP...
false
false
false
false
false
0
double2XYZtype(float number_in) { short s; unsigned short m; if (number_in < 0) { number_in = 0; #ifdef DEBUG gs_warn("Negative CIEXYZ in created ICC Profile"); #endif } s = (short) number_in; m = (unsigned short) ((number_in - s) * 65536.0); return((icS15Fixed16Number) ((s...
false
false
false
false
false
0
uv_fs_futime(uv_loop_t* loop, uv_fs_t* req, uv_file file, double atime, double mtime, uv_fs_cb cb) { const char* path = NULL; uv_fs_req_init(loop, req, UV_FS_FUTIME, path, cb); #if HAVE_FUTIMES WRAP_EIO(UV_FS_FUTIME, eio_futime, _futime, ARGS3(file, atime, mtime)) #else uv__set_sys_error(loop, ENOSYS); ...
false
false
false
false
false
0
destroy_board_list() { Board *board; while(g_list_length(board_list)>0) { board = g_list_nth_data(board_list, 0); board_list = g_list_remove (board_list, board); destroy_board(board); } }
false
false
false
false
false
0
gfire_filetransfer_event(gfire_filetransfer *p_transfer, guint32 p_event, guint32 p_type) { if(!p_transfer) return; if(p_event == 1 && p_type == 2) { purple_debug_misc("gfire", "P2P: Buddy aborted transfer\n"); gfire_p2p_session_remove_file_transfer(p_transfer->session, p_transfer, FALSE); } }
false
false
false
false
false
0
adt7316_set_int_mask(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { struct iio_dev *dev_info = dev_to_iio_dev(dev); struct adt7316_chip_info *chip = iio_priv(dev_info); u16 data; int ret; u8 mask; ret = kstrtou16(buf, 16, &data); if (ret || data >= ADT7316_VDD_INT_MASK +...
false
true
false
false
true
1
dlm_free_rsb(struct dlm_rsb *r) { if (r->res_lvbptr) dlm_free_lvb(r->res_lvbptr); kmem_cache_free(rsb_cache, r); }
false
false
false
false
false
0
general_plist_writer (object type) { /* the XLIB object and the new value are already on the stack */ CHECK_TYPE(STACK_1,type); { object new_value = popSTACK(); pushSTACK(O(object_xlib__plist)); /* the slot */ pushSTACK(new_value); /* new value */ funcall (L(set_s...
false
false
false
false
false
0
RemovePlayerDirty ( ePlayerNetID* player ) { tASSERT( player ); tASSERT( player->currentTeam == this ); // remove player without shuffling the list for ( int i = players.Len()-2; i >= player->teamListID; --i ) { ePlayerNetID * shuffle = players(i); players.Remove( shuffle, shuffle->...
false
false
false
false
false
0
update_all (GduWindow *window) { ShowFlags show_flags = {0}; DetailsPage page = DETAILS_PAGE_NOT_IMPLEMENTED; /* figure out page to display */ if (window->current_object != NULL) { if (udisks_object_peek_drive (window->current_object) != NULL || udisks_object_peek_block (window->current_obj...
false
false
false
false
false
0
rb_crypt(const char *key, const char *salt) { /* First, check if we are supposed to be using a replacement * hash instead of DES... */ if(salt[0] == '$' && (salt[2] == '$' || salt[3] == '$')) { switch(salt[1]) { case '1': return rb_md5_crypt(key, salt); break; case '2': /* Handles both 2 and 2a -...
false
false
false
false
false
0
cb_timer_button_release(GtkWidget *widget, GdkEventButton *ev) { gint tstate, timer_command; if (timer_button_state != TB_PRESSED) return FALSE; set_timer_button_state(save_tb_state); if (! in_button(DECAL(timer_panel), ev)) return FALSE; switch (timer_button_type) { case TIMER_TYPE_NONE: case TIMER_T...
false
false
false
false
false
0
parse_sar_m_opt(char *argv[], int *opt, struct activity *act[]) { char *t; for (t = strtok(argv[*opt], ","); t; t = strtok(NULL, ",")) { if (!strcmp(t, K_CPU)) { SELECT_ACTIVITY(A_PWR_CPUFREQ); } else if (!strcmp(t, K_FAN)) { SELECT_ACTIVITY(A_PWR_FAN); } else if (!strcmp(t, K_IN)) { SELECT_ACTIVI...
false
false
false
false
false
0
map(void) { if (displayToolTip()==MSTrue) { if (mapped()==MSFalse) timer()->reset(); } }
false
false
false
false
false
0
tree_popup_activate_cb(GtkCheckMenuItem *item, gpointer user_data) { GtkWindow *dialog = g_object_get_data(G_OBJECT(item), "dialog"); switch (GPOINTER_TO_INT(user_data)) { case ACTION_ADD: { add_button_click_cb(NULL, dialog); break; } case ACTION_EDIT: { edit_button_click_cb(NULL, dialog); bre...
false
false
false
false
false
0
open() { MenuImpl& i = *impl_; GlyphIndex index = i.item_; if (index >= 0) { MenuItem* mi = item(index); TelltaleState* t = mi->state(); if (t != nil && t->test(TelltaleState::is_enabled)) { t->set(TelltaleState::is_active, true); if (mi->menu() != nil) { mi->menu()->unselect(); Action* a =...
false
false
false
false
false
0
registry_create(rdpRegistry* registry) { registry->fp = fopen((char*)registry->file, "w+"); if (registry->fp == NULL) { printf("registry_create: error opening [%s] for writing\n", registry->file); return; } registry_print(registry, registry->fp); fflush(registry->fp); }
false
false
false
false
true
1
locateMouse(XFontStruct *fs, const char *text, int textLen, int x, bool *rightSide) { int i; int prev_x = x; int spaceWidth; bool dummy; if (rightSide == NULL) rightSide = &dummy; for (i = 0; (x > 0) && (i < textLen); ++i) { prev_x = x; if (fs->per_char == NULL) /* Monospace f...
false
false
false
false
false
0
parse_bool (bool & val, tstring const & str) { log4cplus::tistringstream iss (STD_NAMESPACE string(str.c_str(), str.length())); STD_NAMESPACE string word; if (! (iss >> word)) return false; tchar ch; if (iss >> ch) return false; word = STD_NAMESPACE string (helpers::toLower (word...
false
false
false
false
false
0
x25_asy_close_tty(struct tty_struct *tty) { struct x25_asy *sl = tty->disc_data; int err; /* First make sure we're connected. */ if (!sl || sl->magic != X25_ASY_MAGIC) return; rtnl_lock(); if (sl->dev->flags & IFF_UP) dev_close(sl->dev); rtnl_unlock(); err = lapb_unregister(sl->dev); if (err != LAPB_OK)...
false
false
false
false
false
0
be_async_grp5_evt_process(struct be_adapter *adapter, struct be_mcc_compl *compl) { u8 event_type = (compl->flags >> ASYNC_EVENT_TYPE_SHIFT) & ASYNC_EVENT_TYPE_MASK; switch (event_type) { case ASYNC_EVENT_COS_PRIORITY: be_async_grp5_cos_priority_process(adapter, compl); break; case ASYNC_EVENT_QO...
false
false
false
false
false
0
clusterReadHandler(aeEventLoop *el, int fd, void *privdata, int mask) { char buf[1024]; ssize_t nread; clusterMsg *hdr; clusterLink *link = (clusterLink*) privdata; int readlen; REDIS_NOTUSED(el); REDIS_NOTUSED(mask); again: if (sdslen(link->rcvbuf) >= 4) { hdr = (clusterMsg*) l...
false
false
false
false
false
0
return_cnp(struct hfi1_ibport *ibp, struct hfi1_qp *qp, u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, u8 sc5, const struct ib_grh *old_grh) { u64 pbc, pbc_flags = 0; u32 bth0, plen, vl, hwords = 5; u16 lrh0; u8 sl = ibp->sc_to_sl[sc5]; struct hfi1_ib_header hdr; struct hfi1_other_headers *ohdr; struct pio_bu...
false
false
false
false
false
0
newfile(enum PTYPE type, char *name) { if (type == P_ARG) prog.pctl.curr = name; else if ((prog.pctl.bp = Bopen(name, OREAD)) == 0) quit("Cannot open pattern-file: %s\n", name); prog.type = type; }
false
false
false
false
false
0
citizens_count(const struct city *pcity) { /* Use int here to check for an possible overflow at the end. */ int count = 0; if (game.info.citizen_nationality != TRUE) { return city_size_get(pcity); } citizens_iterate(pcity, pslot, nationality) { /* If the citizens of a nation is greater than 0 there ...
false
false
false
false
false
0
takesLimits() const { return sym_->inset == "cmex" || sym_->inset == "lyxboldsymb" || sym_->inset == "esint" || sym_->extra == "funclim"; }
false
false
false
false
false
0
SelfOrder(int startId, vtkKdNode *kd) { int nextId; if (kd->GetLeft() == NULL) { kd->SetID(startId); kd->SetMaxID(startId); kd->SetMinID(startId); nextId = startId + 1; } else { kd->SetID(-1); nextId = vtkKdTree::SelfOrder(startId, kd->GetLeft()); nextId = vtkKdTree::Self...
false
false
false
false
false
0
addr_book_change_list(char **error) { char *p; jmp_buf save_jmp_buf; int *save_nesting_level; dprint((3, "--- addr_book_change_list ---\n")); save_nesting_level = cpyint(ab_nesting_level); memcpy(save_jmp_buf, addrbook_changed_unexpectedly, sizeof(jmp_buf)); if(setjmp(addrbook_changed...
false
false
false
false
false
0
find_regno_partial (rtx *ptr, void *data) { find_regno_partial_param *param = (find_regno_partial_param *)data; unsigned reg = param->regno_to_find; param->retval = NULL_RTX; if (*ptr == NULL_RTX) return 0; switch (GET_CODE (*ptr)) { case ZERO_EXTRACT: case SIGN_EXTRACT: case STRICT_LOW_...
false
false
false
false
false
0
pdata_print(register const u_char * pptr, register u_int len, u_int16_t op_msk, int indent) { const struct pathdata_h *pdh = (struct pathdata_h *)pptr; char *ib = indent_pr(indent, 0); u_int minsize = 0; TCHECK(*pdh); if (len < sizeof(struct pathdata_h)) goto trunc; if (vflag >= 3) { printf("\n%sPathdat...
false
false
false
false
false
0
opj_stream_create(OPJ_UINT32 p_size,bool l_is_input) { opj_stream_private_t * l_stream = 00; l_stream = (opj_stream_private_t*) opj_malloc(sizeof(opj_stream_private_t)); if (! l_stream) { return 00; } memset(l_stream,0,sizeof(opj_stream_private_t)); l_stream->m_buffer_size = p_size; l_stream->m_...
false
false
false
false
false
0
escape_sql_id(const Glib::ustring& id) { if(id.empty()) { std::cerr << G_STRFUNC << ": id is empty." << std::endl; return id; } Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection(); if(!gda_connection) { std::cerr << G_STRFUNC << ": No gda_connection." << std::endl; return...
false
false
false
false
false
0
setSourceModel(QAbstractItemModel *newSourceModel) { if (sourceModel()) { disconnect(sourceModel(), SIGNAL(modelReset()), this, SLOT(sourceReset())); disconnect(sourceModel(), SIGNAL(layoutChanged()), this, SLOT(sourceReset())); disconnect(sourceModel(), SIGNAL(rowsInserted(const QModelIndex...
false
false
false
false
false
0
fontName( QwtMathMLDocument::MmlFont type ) const { switch ( type ) { case QwtMathMLDocument::NormalFont: return m_normal_font_name; case QwtMathMLDocument::FrakturFont: return m_fraktur_font_name; case QwtMathMLDocument::SansSerifFont: return m_sans_s...
false
false
false
false
false
0
table_I0 (struct GMTMATH_INFO *info, double **stack[], GMT_LONG *constant, double *factor, GMT_LONG last, GMT_LONG col, GMT_LONG n_row) /*OPERATOR: I0 1 1 Modified Bessel function of A (1st kind, order 0). */ { GMT_LONG i; double a = 0.0; if (constant[last]) a = GMT_i0 (factor[last]); for (i = 0; i < n_row; i++) ...
false
false
false
false
false
0
create_gtk_actor (int i) { GtkWidget *button, *vbox, *entry, *bin, *scroll; ClutterActor *gtk_actor; int j; gtk_actor = gtk_clutter_actor_new (); bin = gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (gtk_actor)); scroll = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GT...
false
false
false
false
false
0
mailmime_id_write_driver(int (* do_write)(void *, const char *, size_t), void * data, int * col, char * id) { int r; r = mailimf_string_write_driver(do_write, data, col, "Content-ID: ", 12); if (r != MAILIMF_NO_ERROR) return r; r = mailimf_string_write_driver(do_write, data, col, "<", 1); if (r != MAILI...
false
false
false
false
false
0
gm_searchable_text_view_find_first(GtkTextView *text_view, const gchar *str, GmSearchableSearchFlags flags) { GtkTextIter iter; GtkTextBuffer *buffer; g_return_val_if_fail(text_view != NULL, FALSE); buffer = gtk_text_view_get_buffer(text_view); if (buffer) { if (flags & GM_SEARCHABLE_SEARCH_BACKWARDS)...
false
false
false
false
false
0
getAdjustmentFromTextureTarget(unsigned TextureType, bool hasLOD, unsigned SrcSelect[4], unsigned CT[4], bool &useShadowVariant) { enum TextureTypes { TEXTURE_1D = 1, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE, TEXTU...
false
false
false
false
false
0
NP_parameter(CORBA::Long index) const { CORBA::Any* rv = new CORBA::Any; try { switch (index) { case 0: *rv <<= (const char* ) pd_name; break; default: if( (index >= 1) && ((CORBA::ULong)index < (1+NP_member_count())) ) *rv <<= (const char* )pd_members[index-1]; else throw COR...
false
false
false
false
false
0
gen_vec_unpacku_float_hi_v4si (rtx operand0, rtx operand1) { rtx operand2; rtx operand3; rtx operand4; rtx operand5; rtx operand6; rtx operand7; rtx operand8; rtx _val = 0; start_sequence (); { rtx operands[9]; operands[0] = operand0; operands[1] = operand1; #line 3020 "../../src/gcc/co...
false
false
false
false
true
1
cdc_ncm_set_dgram_size(struct usbnet *dev, int new_size) { struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; u8 iface_no = ctx->control->cur_altsetting->desc.bInterfaceNumber; __le16 max_datagram_size; u16 mbim_mtu; int err; /* set default based on descriptors */ ctx->max_datagram_size = clamp_t(u32...
false
false
false
false
false
0
omap_hsmmc_regs_show(struct seq_file *s, void *data) { struct mmc_host *mmc = s->private; struct omap_hsmmc_host *host = mmc_priv(mmc); seq_printf(s, "mmc%d:\n", mmc->index); seq_printf(s, "sdio irq mode\t%s\n", (mmc->caps & MMC_CAP_SDIO_IRQ) ? "interrupt" : "polling"); if (mmc->caps & MMC_CAP_SDIO_IRQ) { ...
false
false
false
false
false
0
getDir() { char workDir[1024]; char * newLine = "\n"; if(getcwd(workDir, sizeof(workDir)) != NULL) if(strcmp(workDir, "/") == 0) { return workDir; } else { return workDir; } else printf("Unable to get current working directory!"); return; }
true
true
false
false
true
1
live_track_add_partition (live_track_p ptr, int partition) { int root; root = basevar_index (ptr->map, partition); /* If this base var wasn't live before, it is now. Clear the element list since it was delayed until needed. */ if (bitmap_set_bit (ptr->live_base_var, root)) bitmap_clear (ptr->live_ba...
false
false
false
false
false
0
dvi_patch_skew_dvp_low(void) { switch (viaparinfo->chip_info->gfx_chip_name) { case UNICHROME_K8M890: { viafb_write_reg_mask(CR99, VIACR, 0x03, BIT0 + BIT1); break; } case UNICHROME_P4M900: { viafb_write_reg_mask(CR99, VIACR, 0x08, BIT0 + BIT1 + BIT2 + BIT3); break; } case UNICHROME...
false
false
false
false
false
0
nvkm_client_del(struct nvkm_client **pclient) { struct nvkm_client *client = *pclient; int i; if (client) { nvkm_client_fini(client, false); for (i = 0; i < ARRAY_SIZE(client->notify); i++) nvkm_client_notify_del(client, i); nvkm_object_dtor(&client->object); kfree(*pclient); *pclient = NULL; } }
false
false
false
false
false
0
FillHeader(wxString &mFilePath, const wxString& dmod_folder, char *header512, fileinfo *finfo) { // Get file information // Only store regular files if (!S_ISREG(finfo->mode)) return false; // Start collecting data. char* ptr = header512; // filename strncpy(ptr, (dmod_folder.Lower() + _T("/") + mFi...
false
false
false
false
false
0
skk_rom_kana_node_construct (GType object_type, SkkRomKanaEntry* entry) { SkkRomKanaNode * self = NULL; SkkRomKanaEntry* _tmp0_; SkkRomKanaEntry* _tmp1_; self = (SkkRomKanaNode*) g_object_new (object_type, NULL); _tmp0_ = entry; _tmp1_ = _skk_rom_kana_entry_dup0 (_tmp0_); _skk_rom_kana_entry_free0 (self->entry);...
false
false
false
false
false
0
FaceBBox(const R3MeshFace *f) const { // Update the face bbox if (!(f->flags[R3_MESH_FACE_BBOX_UPTODATE])) UpdateFaceBBox((R3MeshFace *) f); // Return the bbox of the face return f->bbox; }
false
false
false
false
false
0
check_plugin_path(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) { /* check for invalid nsslapd-pluginPath */ char **vals = slapi_entry_attr_get_charray (e, ATTR_P...
false
false
false
false
false
0
F_mpz_get_mpz(mpz_t x, const F_mpz_t f) { if (!COEFF_IS_MPZ(*f)) mpz_set_si(x, *f); // set x to small value else { mpz_set(x, F_mpz_arr + COEFF_TO_OFF(*f)); // set x to large value } }
false
false
false
false
false
0
wait(Mutex *mutex, unsigned long int ms) { PThreadConditionPrivateData *pd = static_cast<PThreadConditionPrivateData *>(_prvData); PThreadMutexPrivateData *mpd = static_cast<PThreadMutexPrivateData *>(mutex->_prvData); // wait time is now in ms milliseconds, so need to convert to seconds...
false
false
false
false
false
0
get_cell(struct cache *cache, dm_oblock_t oblock, struct prealloc *structs, struct dm_bio_prison_cell **cell_result) { int r; struct dm_cell_key key; struct dm_bio_prison_cell *cell_prealloc; cell_prealloc = prealloc_get_cell(structs); build_key(oblock, to_oblock(from_oblock(oblock) + 1ULL), &k...
false
false
false
false
false
0
define_macro(string *name, string *text) { macro *m; // The new macro macroDictionary::iterator mi; // To search defined macros if ( ( mi = macros.find(*name)) != macros.end() ) { m = (*mi).second; delete m->text; m->text = text; } else { m = new macro(text, name); macros[*name] = m; } ...
false
false
false
false
false
0
hfi1_destroy_cq(struct ib_cq *ibcq) { struct hfi1_ibdev *dev = to_idev(ibcq->device); struct hfi1_cq *cq = to_icq(ibcq); flush_kthread_work(&cq->comptask); spin_lock(&dev->n_cqs_lock); dev->n_cqs_allocated--; spin_unlock(&dev->n_cqs_lock); if (cq->ip) kref_put(&cq->ip->ref, hfi1_release_mmap_info); else vf...
false
false
false
false
false
0
isdn_net_ciscohdlck_slarp_send_request(isdn_net_local *lp) { struct sk_buff *skb; unsigned char *p; skb = isdn_net_ciscohdlck_alloc_skb(lp, 4 + 14); if (!skb) return; p = skb_put(skb, 4 + 14); /* cisco header */ *(u8 *)(p + 0) = CISCO_ADDR_UNICAST; *(u8 *)(p + 1) = CISCO_CTRL; *(__be16 *)(p + 2) = cpu_to_...
false
false
false
false
false
0
array_check(array *a) { if(a == NULL) { return array_malloc(); } return a; }
false
false
false
false
false
0
memsize_820() { int i, n, nr; struct e820entry nm[E820MAX]; /* Clean up, adjust and copy the BIOS-supplied E820-map. */ nr = sanitize_e820_map(e820, nm, e820_nr); /* If there is not a good 820 map use the BIOS 801/88 info */ if (nr < 1 || nr > E820MAX) { memsize_801(); return; } /* Build the memory map f...
false
false
false
false
false
0
GetMethods(Object o, int what, PFE *fieldMethod, PFE *cfieldMethod, int *gFlag) { Class class = DXGetObjectClass(o); if (class == CLASS_GROUP) class = DXGetGroupClass((Group)o); switch(class) { case CLASS_FIELD: { Object attr; char *str; MethodTableEntry *m; if (DXEmptyField...
false
false
false
false
false
0
generateMAC(void* parameters) { pdebug("generateMAC()\n"); bool chunk_maced = false; chunk* update_chunk = NULL; macParams* params = parameters; const uint64_t mac_size = (uint64_t)params->mac_context->digest_byte_size; //iterate through the queue until the DONE flag is received and update...
false
false
false
false
true
1
cvt_sdoor_to_door(lev) struct rm *lev; { int newmask = lev->doormask & ~WM_MASK; #ifdef REINCARNATION if (Is_rogue_level(&u.uz)) /* rogue didn't have doors, only doorways */ newmask = D_NODOOR; else #endif /* newly exposed door is closed */ if (!(newmask & D_LOCKED)) newmask |= D_CLOSED; lev->...
false
false
false
false
false
0
text_key_add(struct iscsi_connection *conn, char *key, char *value) { int keylen = strlen(key); int valuelen = strlen(value); int len = keylen + valuelen + 2; char *buffer; int max_len; if (conn->state == STATE_FULL) max_len = conn->session_param[ISCSI_PARAM_MAX_XMIT_DLENGTH].val; else max_len = conn->rsp_b...
false
false
false
false
false
0
cdk_kbnode_walk (cdk_kbnode_t root, cdk_kbnode_t * ctx, int all) { cdk_kbnode_t n; do { if (!*ctx) { *ctx = root; n = root; } else { n = (*ctx)->next; *ctx = n; } } while (!all && n && n->is_deleted); return n; }
false
false
false
false
false
0
ds2781_get_voltage(struct ds2781_device_info *dev_info, int *voltage_uV) { int ret; char val[2]; int voltage_raw; ret = w1_ds2781_read(dev_info, val, DS2781_VOLT_MSB, 2 * sizeof(u8)); if (ret < 0) return ret; /* * The voltage value is located in 10 bits across the voltage MSB * and LSB registers in two's ...
false
false
false
false
false
0
m_motd(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { static time_t last_used = 0; if((last_used + ConfigFileEntry.pace_wait) > rb_current_time() || !ratelimit_client(source_p, 6)) { /* safe enough to give this on a local connect only */ sendto_one(source_p, form_str(RPL_LOAD2...
false
false
false
false
false
0
TreeInsertHelp(rb_red_blk_tree* tree, rb_red_blk_node* z) { /* This function should only be called by InsertRBTree (see above) */ rb_red_blk_node* x; rb_red_blk_node* y; rb_red_blk_node* nil=tree->nil; z->left=z->right=nil; y=tree->root; x=tree->root->left; while( x != nil) { y=x; if (1 == t...
false
false
false
false
false
0
libsmtp_part_send (char *libsmtp_body_data, unsigned int libsmtp_body_length, \ struct libsmtp_session_struct *libsmtp_session) { struct libsmtp_part_struct *libsmtp_temp_part; int libsmtp_int_errorstate; /* Headers must have been sent before body data goes out, but we must still be in body sta...
false
false
false
false
false
0
snd_intel8x0_codec_read(struct snd_ac97 *ac97, unsigned short reg) { struct intel8x0 *chip = ac97->private_data; unsigned short res; unsigned int tmp; if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) { if (! chip->in_ac97_init) dev_err(chip->card->dev, "codec_read %d: semaphore is not rea...
false
false
false
false
false
0
copyFrom(const CPointPDF &o) { MRPT_START if (this == &o) return; // It may be used sometimes if (o.GetRuntimeClass()==CLASS_ID(CPointPDFSOG)) { m_modes = static_cast<const CPointPDFSOG*>(&o)->m_modes; } else { // Approximate as a mono-modal gaussian pdf: this->resize(1); m_modes[0].log_w = 0; o.get...
false
false
false
false
false
0
client3_1_link (call_frame_t *frame, xlator_t *this, void *data) { clnt_local_t *local = NULL; clnt_conf_t *conf = NULL; clnt_args_t *args = NULL; gfs3_link_req req = {{0,},}; int ret = 0; int op_errno = EST...
false
true
false
true
false
1
doloop_register_get (rtx head ATTRIBUTE_UNUSED, rtx tail ATTRIBUTE_UNUSED) { #ifdef HAVE_doloop_end rtx reg, condition, insn, first_insn_not_to_check; if (!JUMP_P (tail)) return NULL_RTX; /* TODO: Free SMS's dependence on doloop_condition_get. */ condition = doloop_condition_get (tail); if (! condition...
false
false
false
false
false
0
cmd_defnode(struct command *cmd) { const char *name = arg_value(cmd, "name"); const char *path = arg_value(cmd, "expr"); const char *value = arg_value(cmd, "value"); /* Make 'defnode foo ""' mean the same as 'defnode foo' */ if (value != NULL && strlen(value) == 0) value = NULL; aug_def...
false
false
false
false
false
0
split_opts(char **argv, int *argcp, char *s) { while (s && *s) { while (isspace((unsigned char) *s)) ++s; if (*s == '\0') break; argv[(*argcp)++] = s; while (*s && !isspace((unsigned char) *s)) ++s; if (*s) *s++ = '\0'; } }
false
false
false
false
false
0
vport_find(IPAddress gw, int16_t port) { for (int vp = _vport_head; vp >= 0; vp = _vport[vp].ll_next) if (_vport[vp].gw == gw && _vport[vp].port == port) return vp; if (_vport_empty_head < 0 && _vport_size == _vport_capacity) { if (_vport_capacity == vport_capacity_limit) return -ENOMEM; VirtualPor...
false
false
false
false
false
0
eat_alpha_numeric(CONF *conf, char *p) { for (;;) { if (IS_ESC(conf,*p)) { p=scan_esc(conf,p); continue; } if (!IS_ALPHA_NUMERIC_PUNCT(conf,*p)) return(p); p++; } }
false
false
false
false
false
0
gpk_vendor_init (GpkVendor *vendor) { gboolean ret; vendor->priv = GPK_VENDOR_GET_PRIVATE (vendor); vendor->priv->file = g_key_file_new (); ret = g_key_file_load_from_file (vendor->priv->file, "/etc/PackageKit/Vendor.conf", G_KEY_FILE_NONE, NULL); if (!ret) g_warning ("file not found"); }
false
false
false
false
false
0
do_enumerate (GVfsBackend *backend, GVfsJobEnumerate *job, const char *filename, GFileAttributeMatcher *matcher, GFileQueryInfoFlags flags) { SoupMessage *msg; Multistatus ms; xmlNodeIter iter; gboolean res; GError ...
false
false
false
false
false
0
create_secret_door(croom, walls) struct mkroom *croom; xchar walls; /* any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */ { xchar sx, sy; /* location of the secret door */ int count; for(count = 0; count < 100; count++) { sx = rn1(croom->hx - croom->lx + 1, croom->lx); sy = rn1(croom->hy - ...
false
false
false
false
false
0
browse_result_relay_cb (GrlSource *source, guint operation_id, GrlMedia *media, guint remaining, gpointer user_data, const GError *error) { GError *_error; struct BrowseRelayCb *brc = (struct Brow...
false
false
false
false
false
0
display_update_critical( int x, int y ) { int beam_x, beam_y; get_beam_position( &beam_x, &beam_y ); beam_x -= DISPLAY_BORDER_WIDTH_COLS; beam_y -= DISPLAY_BORDER_HEIGHT; if( beam_y < 0 ) { beam_x = beam_y = 0; } else if( beam_y >= DISPLAY_HEIGHT ) { beam_x = DISPLAY_WIDTH_COLS; beam_y = DISP...
false
false
false
false
false
0
dump() { errs() << "SystemZRRIAddressMode " << this << '\n'; if (BaseType == RegBase) { errs() << "Base.Reg "; if (Base.Reg.getNode() != 0) Base.Reg.getNode()->dump(); else errs() << "nul"; errs() << '\n'; } else { errs() << " Base.FrameIndex...
false
false
false
false
false
0
get_biggest_block( maximum ) ushort maximum; { ushort maxblock; ushort top = maximum; ushort bottom = 0; if (!toomuch_mem(maximum)) return(maximum); /* If there's enough memory */ else { gprintf(ERROR, "Running out of memory...\n"); maxblock = calc_middle( top, bottom ); whil...
false
false
false
false
false
0
tab_completion_set_to_last_history(GtkWidget *entry) { TabCompData *td = g_object_get_data(G_OBJECT(entry), "tab_completion_data"); const gchar *buf; if (!td || !td->has_history) return NULL; buf = history_list_find_last_path_by_key(td->history_key); if (buf) { gtk_entry_set_text(GTK_ENTRY(td->entry), buf); ...
false
false
false
false
false
0
message_color_define(u16b type, byte color) { msgcolor_t *mc = messages->colors; if (!mc) { messages->colors = ZNEW(msgcolor_t); messages->colors->type = type; messages->colors->color = color; return 0; } while (mc->next) { if (mc->type == type) { mc->color = color; return 0; } mc = mc->ne...
false
false
false
false
false
0
base_key_length(const cipher_type_t *cipher, int key_length) { if (cipher->id != AES_ICM) return key_length; else if (key_length > 16 && key_length < 30) return 16; return key_length - 14; }
false
false
false
false
false
0
clear_unreachable_ephemerons (ScanCopyContext ctx) { CopyOrMarkObjectFunc copy_func = ctx.copy_func; GrayQueue *queue = ctx.queue; EphemeronLinkNode *current = ephemeron_list, *prev = NULL; MonoArray *array; Ephemeron *cur, *array_end; char *tombstone; while (current) { char *object = current->array; if (!...
false
false
false
false
false
0
vdtree_sort_cb(GtkTreeModel *store, GtkTreeIter *a, GtkTreeIter *b, gpointer data) { NodeData *nda; NodeData *ndb; gtk_tree_model_get(store, a, DIR_COLUMN_POINTER, &nda, -1); gtk_tree_model_get(store, b, DIR_COLUMN_POINTER, &ndb, -1); if (!nda->fd && !ndb->fd) return 0; if (!nda->fd) return 1; if (!ndb->fd) re...
false
false
false
false
false
0
compute_shift (guint value) { guint i = 0; while ((value >> i) > 1) i++; return i; }
false
false
false
false
false
0
gcr_union_collection_take (GcrUnionCollection *self, GcrCollection *collection) { GList *objects, *l; g_return_if_fail (GCR_IS_UNION_COLLECTION (self)); g_return_if_fail (GCR_IS_COLLECTION (collection)); g_return_if_fail (!g_hash_table_lookup (self->pv->collections, collection)); g_obj...
false
false
false
false
false
0
GetDistance(int b) { OBMol *mol = (OBMol*)GetParent(); return(( this->GetVector() - mol->GetAtom(b)->GetVector() ).length()); }
false
false
false
false
false
0
server_has_persistence (void) { gboolean has; GList *caps; GList *l; caps = notify_get_server_caps (); if (caps == NULL) { fprintf (stderr, "Failed to receive server caps.\n"); return FALSE; } l = g_list_find_custom (caps, "pe...
false
false
false
false
false
0
rm(const string &filename) { if( remove( filename.c_str() ) != 0 ) cerr << "Error deleting file" << endl; // else // cerr << "file succesfully deleted" << endl; }
false
false
false
false
false
0
Mono_Posix_Syscall_setxattr (const char *path, const char *name, unsigned char *value, mph_size_t size, gint32 flags) { gint32 ret; mph_return_if_size_t_overflow (size); #ifdef EA_UNIX { int _flags; if (Mono_Posix_FromXattrFlags (flags, &_flags) == -1) return -1; #if __APPLE__ ret = setxattr (path, name, v...
false
false
false
false
false
0
gth_sa_echo_reference_sequence(const GthSA *sa, GthInput *input, bool format, GtFile *outfp) { gt_assert(sa && input); gth_input_echo_reference_sequence(input, format, sa->ref_file_num, sa->ref_seq_num, sa->ref_strand_forward, ...
false
false
false
false
false
0