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
printargs(tcp) struct tcb *tcp; { if (entering(tcp)) { int i; for (i = 0; i < tcp->u_nargs; i++) tprintf("%s%#lx", i ? ", " : "", tcp->u_arg[i]); } return 0; }
false
false
false
false
false
0
dolisten(globus_io_handle_t *handlep) { globus_result_t r; char errmsg[MAXERRMSG]; if (loglevel > 3) logit(LOG_DEBUG, "dolisten:"); if ((r = globus_io_tcp_register_listen(handlep, listencb, NULL)) != GLOBUS_SUCCESS) { logit(LOG_WARNING, "dolisten: globus_io_tcp_register_listen: %s", globuser...
false
false
false
false
false
0
clist_find_pseudoband(gx_device_clist_reader *crdev, int band, cmd_block *cb) { clist_file_ptr bfile = crdev->page_info.bfile; int64_t save_pos = crdev->page_info.bfile_end_pos; int64_t start_pos; /* Go to the start of the last command block */ start_pos = crdev->page_info.bfile_end_pos - sizeof(c...
false
false
false
false
false
0
CPLCreateThread( CPLThreadFunc pfnMain, void *pThreadArg ) { CPLStdCallThreadInfo *psInfo; pthread_attr_t hThreadAttr; psInfo = (CPLStdCallThreadInfo*) CPLCalloc(sizeof(CPLStdCallThreadInfo),1); psInfo->pAppData = pThreadArg; psInfo->pfnMain = pfnMain; psInfo->bJoinable = FALSE; pthread_...
false
false
false
false
false
0
CreateTextVector(bool bSetupVScroll) { int w = my_width - 6 - ((my_vscroll->IsVisible() || !my_vscroll->IsHidden()) ? my_vscroll->w : 0); // now split the text into lines my_textdata.clear(); unsigned int start = 0, end = 0, last = 0; PG_String temp; do { Uint16 lineWidth = 0; temp = my_text.substr(start, ...
false
false
false
false
false
0
FslSetWriteMode(FSLIO *fslio, int mode) { if (fslio==NULL) FSLIOERR("FslSetWriteMode: Null pointer passed for FSLIO"); fslio->write_mode = mode; }
false
false
false
false
false
0
xbaeRowColToXY(mw, row, column, x, y) XbaeMatrixWidget mw; int row; int column; int *x; int *y; { /* * If we are in a fixed cell, calculate x/y relative to Matrixs * window (take into account labels etc) */ if (IS_FIXED(mw, row, column)) { /* * Ignore horiz_origin if we are i...
false
false
false
false
false
0
setsignal(int signo) { char *t; char cur_act, new_act; struct sigaction act; t = trap[signo]; new_act = S_DFL; if (t != NULL) { /* trap for this sig is set */ new_act = S_CATCH; if (t[0] == '\0') /* trap is "": ignore this sig */ new_act = S_IGN; } if (rootshell && new_act == S_DFL) { switch (signo) ...
false
false
false
false
false
0
putDirect(const Identifier& propertyName, JSValue* value, int attr) { size_t index = symbolTable->get(propertyName.ustring().rep()); if (index != missingSymbolMarker()) { LocalStorageEntry& entry = localStorage[index]; entry.val.valueVal = value; entry.attributes = attr; return; ...
false
false
false
false
false
0
cbrdissect(struct vars * v, struct subre * t, chr *begin, /* beginning of relevant substring */ chr *end) /* end of same */ { int n = t->subno; size_t numreps; size_t tlen; size_t brlen; chr *brstring; chr *p; int min = t->min; int max = t->max; assert(t != NULL); assert(t...
false
false
false
false
false
0
main(int argc, char** argv) { int i; int minsize = 1, maxsize = MAXSIZE; if (argc > 1) minsize = atoi (argv[1]); if (argc > 2) maxsize = atoi (argv[2]); for (i = minsize; i <= maxsize; ++i) bench(i); printf ("/* 0:mulredc 1:mul+redc_1 2:mul+redc_2 3:mul+redc_n */\n"); printf ("#define TUN...
false
false
false
false
true
1
unread(const void *data, size_t len) { if (buffer_position >= buffer_end) { // // If the buffer is empty, just mangle the pointers to // make it possible to push the characters back. // buffer_end = buffer + buffer_size; buffer_position = buffer_end - len; memcpy(buffer_position, data, len); return; ...
false
false
false
false
false
0
db_escape_string(JCR *jcr, char *snew, char *old, int len) { char *n, *o; n = snew; o = old; while (len--) { switch (*o) { case '\'': *n++ = '\''; *n++ = '\''; o++; break; case 0: *n++ = '\\'; *n++ = 0; o++; break; ...
false
false
false
false
false
0
get_mg_ptr (SV *sv) { MAGIC *mg; if ((mg = mg_find (sv, PERL_MAGIC_ext))) { return mg->mg_ptr; } return NULL; }
false
false
false
false
false
0
mail_config_summary_page_dispose (GObject *object) { EMailConfigSummaryPagePrivate *priv; priv = E_MAIL_CONFIG_SUMMARY_PAGE_GET_PRIVATE (object); if (priv->account_source != NULL) { g_signal_handler_disconnect ( priv->account_source, priv->account_source_changed_id); g_object_unref (priv->account_source)...
false
false
false
false
false
0
gitfo_close_cached(gitfo_cache *ioc) { git_file fd; if (gitfo_flush_cached(ioc) < 0) return GIT_ERROR; fd = ioc->fd; free(ioc->cache); free(ioc); return gitfo_close(fd); }
false
false
false
false
false
0
nv20CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { CoreSurface *destination = state->destination; CoreSurface *source = state->source; switch (destination->config.format) { case DSPF_A8: case DSPF_LUT8: cas...
false
false
false
false
false
0
hwi_process_default_pdu_ring(struct beiscsi_conn *beiscsi_conn, struct beiscsi_hba *phba, struct i_t_dpdu_cqe *pdpdu_cqe) { struct hwi_controller *phwi_ctrlr; struct hwi_async_pdu_context *pasync_ctx; struct async_pdu_handle *pasync_handle = NULL; unsigned int cq_index = -1; uint16_t cri_index = BE_GET...
false
false
false
false
false
0
cc_background_xml_load_list_finish (GAsyncResult *async_result) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (async_result); CcBackgroundXml *data; g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); g_warn_if_fail (g_simple_async_result_get_source_tag (result) == cc_background_xml_load_list_as...
false
false
false
false
false
0
JNU_PrintString(JNIEnv *env, char *hdr, jstring string) { if (string == NULL) { fprintf(stderr, "%s: is NULL\n", hdr); } else { const char *stringPtr = JNU_GetStringPlatformChars(env, string, 0); if (stringPtr == 0) return; fprintf(stderr, "%s: %s\n", hdr, stringPtr);...
false
false
false
false
false
0
_elm_config_engine_set(const char *engine) { if (_elm_config->engine && strcmp(_elm_config->engine, engine)) eina_stringshare_del(_elm_config->engine); _elm_config->engine = eina_stringshare_add(engine); }
false
false
false
false
false
0
gt_ggc_mx_VEC_ipa_edge_args_t_gc (void *x_p) { struct VEC_ipa_edge_args_t_gc * const x = (struct VEC_ipa_edge_args_t_gc *)x_p; if (ggc_test_and_set_mark (x)) { { size_t i0; size_t l0 = (size_t)(((*x).base).num); for (i0 = 0; i0 != l0; i0++) { if ((*x).base.vec[i0].jump_fu...
false
false
false
false
false
0
CompareSeeds(const void *c1, const void *c2) { int seed1 = *(int *)c1; int seed2 = *(int *)c2; int gapdiff = CompareSeedGaps[seed1] - CompareSeedGaps[seed2]; if (gapdiff != 0) return(gapdiff); /* fewer gaps is better */ double outdiff = CompareSeedNJ->outDistances[seed1] - CompareSeedNJ->outDistances[seed2]; ...
false
false
false
false
false
0
sd_start(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; reg_w_var(gspca_dev, start_7302, page3_7302, sizeof(page3_7302)); sd->sof_read = 0; sd->autogain_ignore_frames = 0; atomic_set(&sd->avg_lum, 270 + sd->brightness->val); /* start stream */ reg_w(gspca_dev, 0xff, 0x01); reg_w(gs...
false
false
false
false
false
0
SkipToWord( SectionType sType, vtkIdType sId, vtkIdType wordNumber ) { LSDynaFamilySectionMark mark; if ( sType != TimeStepSection && sType < ElementDeletionState ) { assert( sId < (int)this->Adaptations.size() ); if ( sId < 0 ) sId = 0; mark = this->AdaptationsMarkers[sId].Marks[ sType ]; ...
false
false
false
false
false
0
sshv2_open_file (gftp_request * request, const char *file, off_t startsize, guint32 mode) { char *tempstr, *endpos; sshv2_params * params; sshv2_message message; guint32 num; size_t len; int ret; g_return_val_if_fail (request != NULL, GFTP_EFATAL); g_return_val_if_fail (request->proton...
false
true
false
false
false
1
command_usage(char *error) { FILE *out = stdout; int i; if (error) { out = stderr; fprintf(out, "Error: %s\n", error); } fprintf(out, "strongSwan %s PKI tool\n", VERSION); if (active == help_idx) { fprintf(out, "loaded plugins: %s\n", lib->plugins->loaded_plugins(lib->plugins)); } fprintf(out, "u...
false
false
false
false
false
0
slotMetadataChanged( Meta::TrackPtr track ) { DEBUG_BLOCK // if we are listening to a stream, take the new metadata as a "new track" if( track && The::engineController()->isStream() ) messageNotify( Current ); }
false
false
false
false
false
0
test_new_free (void) { adcli_attrs *attrs; attrs = adcli_attrs_new (); assert (attrs != NULL); adcli_attrs_free (attrs); }
false
false
false
false
false
0
check_for_exceptions() const { if( severity_ == 0 ) return; TextReader* ths = const_cast<TextReader*>(this); int severity = severity_; ths->severity_ = 0; //TODO: Offer an alternative when not using exceptions? #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED if( severity == XML_PARSER_SEVERITY_ERROR ) ...
false
false
false
false
false
0
sym_get_col_upper(sym_environment *env, double *colub) { if (!env->mip || !env->mip->n || !env->mip->ub){ if(env->par.verbosity >= 1){ printf("sym_get_col_upper():There is no loaded mip description or\n"); printf("there is no loaded column description!\n"); } return(FUNCTION_TERMINATED_ABNORMAL...
false
false
false
false
false
0
make_modifytable(CmdType operation, List *resultRelations, List *subplans, List *returningLists, List *rowMarks, int epqParam) { ModifyTable *node = makeNode(ModifyTable); Plan *plan = &node->plan; double total_size; ListCell *subnode; Assert(list_length(resultRelations) == list_length(subplans));...
false
false
false
false
false
0
statistics() { EntryMap::Iterator it; kDebug(7001) << "Entries watched:"; if (m_mapEntries.count()==0) { kDebug(7001) << " None."; } else { it = m_mapEntries.begin(); for( ; it != m_mapEntries.end(); ++it ) { Entry* e = &(*it); kDebug(7001) << " " << *e; foreach(Client* c, e-...
false
false
false
false
false
0
deleteObject(obj) CcWnnObject obj; { ObjRec *objp, *objp0; for (objp0 = NULL, objp = ObjList; objp != NULL; objp0 = objp, objp = objp->next) { if (objp->obj == obj) { if (objp0 == NULL) { ObjList = objp->next; } else { objp0->next = objp->next; } XtFree((char *)objp); return; ...
false
false
false
false
false
0
get_data_len(unsigned char *pkey, int *index) { int data_len=0; int i,len_octet_count; if (pkey[(*index)++]&0x2) { //seperator if(pkey[(*index)] >= 128){ len_octet_count = pkey[(*index)]^0x80; for(i=0;i<len_octet_count;i++) { data_len = data_len | pkey[++(*index)]; } (*index)++; }else...
false
false
false
false
false
0
infd_note_plugin_text_session_write(InfdStorage* storage, InfSession* session, const gchar* path, gpointer user_data, GError** error) { InfUserTable* table; InfTextBuffer* ...
false
false
false
false
false
0
snic_cleanup(struct snic *snic) { unsigned int i; int ret; svnic_dev_disable(snic->vdev); for (i = 0; i < snic->intr_count; i++) svnic_intr_mask(&snic->intr[i]); for (i = 0; i < snic->wq_count; i++) { ret = svnic_wq_disable(&snic->wq[i]); if (ret) return ret; } /* Clean up completed IOs */ snic_fwcq...
false
false
false
false
false
0
brcmf_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev, const u8 *mac, struct station_parameters *params) { struct brcmf_if *ifp = netdev_priv(ndev); s32 err; brcmf_dbg(TRACE, "Enter, MAC %pM, mask 0x%04x set 0x%04x\n", mac, params->sta_flags_mask, params->sta_flags_set); /* Ignor...
false
false
false
false
false
0
recinq(ncid, nrecvars, recvarids, recsizes) int ncid; int *nrecvars; int *recvarids; long *recsizes; { int iv; int rvarids[VARS]; int nrvars = numrecvars(ncid, rvarids); if (nrvars == -1) return -1; if (nrecvars) *nrecvars = nrvars; if (recvarids) for (iv ...
false
false
false
false
false
0
putc_entity(int ch, /* I - Character */ FILE *fp) /* I - File */ { if (ch == '&') fputs("&amp;", fp); else if (ch == '<') fputs("&lt;", fp); else putc(ch, fp); }
false
false
false
false
false
0
check_black_distance_helper(dns_rbtnode_t *node, size_t *distance) { size_t dl, dr, dd; if (node == NULL) { *distance = 1; return (ISC_TRUE); } if (!check_black_distance_helper(LEFT(node), &dl)) return (ISC_FALSE); if (!check_black_distance_helper(RIGHT(node), &dr)) return (ISC_FALSE); if (!check_blac...
false
false
false
false
false
0
ReadbbFile(const char * file,long & nbsol,long & lsol,const int typesol,const int dim) { MeshIstream frbb(file); int dimlu,typesollu; long i; double *sol =0; frbb >> dimlu >> nbsol >> lsol >> typesollu ; if(typesol != typesollu ) { cerr << " incorrect type of solution (read) " << typesollu << ...
false
false
false
false
false
0
convertToPSEmbed(const char *filein, const char *fileout, l_int32 level) { const char nametif[] = "/tmp/junk_convert_ps_embed.tif"; const char namejpg[] = "/tmp/junk_convert_ps_embed.jpg"; l_int32 d, format; PIX *pix, *pixs; PROCNAME("convertToPSEmbed"); i...
false
false
false
false
false
0
_matewnck_application_process_property_notify (MatewnckApplication *app, XEvent *xevent) { /* This prop notify is on the leader window */ if (xevent->xproperty.atom == XA_WM_NAME || xevent->xproperty.atom == _matewnck_atom_get ("_NET_WM_NAME") || ...
false
false
false
false
false
0
CHECK_address(void *ptr, size_t len) { offset_t i; if (len < 0) return TRUE; CHECK_enter(); if (sigsetjmp(CHECK_jump, TRUE) == 0) { for (i = 0; i < len; i += 1024) _dummy = ((int *)ptr)[i]; _dummy = ((int *)ptr)[len >> 2]; } CHECK_leave(); return _got_error; }
false
false
false
false
false
0
cmptags(const void *p1, const void *p2) { #endif //return strcmp(TagMem + TagD[*(int *)p1].Tag, // TagMem + TagD[*(int *)p2].Tag); int r = strcmp(TagMem + TagD[*(int *)p1].Tag, TagMem + TagD[*(int *)p2].Tag); if (r != 0) return r; r = strcmp(TagMem + TagD[*(int *)p1].FileName, ...
false
false
false
false
false
0
tunnel_bind(int bind_fd, int dns_fd) { char packet[64*1024]; struct sockaddr_in from; socklen_t fromlen; struct fw_query *query; unsigned short id; int r; fromlen = sizeof(struct sockaddr); r = recvfrom(bind_fd, packet, sizeof(packet), 0, (struct sockaddr*)&from, &fromlen); if (r <= 0) return 0; id = ...
true
true
false
false
false
1
git_oid_mkstr(git_oid *out, const char *str) { size_t p; for (p = 0; p < sizeof(out->id); p++, str += 2) { int v = (from_hex[(unsigned char)str[0]] << 4) | from_hex[(unsigned char)str[1]]; if (v < 0) return GIT_ENOTOID; out->id[p] = (unsigned char)v; } return GIT_SUCCESS; }
false
false
false
false
false
0
charset_best_mask (unsigned int mask) { const char *lang; guint i; for (i = 0; i < G_N_ELEMENTS (charinfo); i++) { if (charinfo[i].bit & mask) { lang = g_mime_charset_language (charinfo[i].name); if (!lang || (locale_lang && !strncmp (locale_lang, lang, 2))) return charinfo[i].name; } } retur...
false
false
false
false
false
0
directory_set(string_ty *client_side, string_ty *server_side) { directory_ty *dp; dp = directory_new(client_side, server_side); curdir = dp; if (!dir_info_cs) { dir_info_cs = new symtab_ty(5); dir_info_cs->set_reap(dir_reaper); } dir_info_cs->assign(client_side, dp); if (!dir_info_...
false
false
false
false
false
0
get_zero_bits_MSB(cram_block *block) { int n = 0, b; do { b = block->data[block->byte] >> block->bit; if (--block->bit == -1) { block->bit = 7; block->byte++; } n++; } while (!(b&1)); return n-1; }
false
false
false
false
false
0
geoclue_nominatim_freeform_address_to_position (GcIfaceGeocode *iface, const char *address, GeocluePositionFields *fields, double *latitude, ...
false
false
false
false
false
0
grnnew(int n, real_t x[], real_t a[]) { int k,l; for (k=n-1; k>=0; k--) for (l=n-1; l>=n-1-k; l--) a[l] += a[l+1]*x[n-1-k]; }
false
false
false
false
false
0
put_server_conn_state (xlator_t *this, rpc_transport_t *xprt) { GF_VALIDATE_OR_GOTO ("server", this, out); GF_VALIDATE_OR_GOTO ("server", xprt, out); xprt->xl_private = NULL; out: return; }
false
false
false
false
false
0
index_seek (GstPad * pad, GstEvent * event) { GstIndexEntry *entry; GstMpeg2dec *mpeg2dec; gdouble rate; GstFormat format; GstSeekFlags flags; GstSeekType cur_type, stop_type; gint64 cur, stop; mpeg2dec = GST_MPEG2DEC (GST_PAD_PARENT (pad)); gst_event_parse_seek (event, &rate, &format, &flags, ...
false
false
false
false
false
0
decrRefCount(void *obj) { robj *o = obj; #ifdef DEBUG_REFCOUNT if (o->type == REDIS_STRING) printf("Decrement '%s'(%p), now is: %d\n",o->ptr,o,o->refcount-1); #endif if (--(o->refcount) == 0) { switch(o->type) { case REDIS_STRING: freeStringObject(o); break; case REDIS_LIST:...
false
false
false
false
false
0
ath6kl_get_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) { struct ath6kl_vif *vif = netdev_priv(dev); struct ath6kl *ar = vif->ar; int i = 0; struct target_stats *tgt_stats; memset(data, 0, sizeof(u64) * ATH6KL_STATS_LEN); ath6kl_read_tgt_stats(ar, vif); tgt_stats = &vif-...
false
false
false
false
false
0
maki_dbus_kick (const gchar* server, const gchar* channel, const gchar* who, const gchar* message, GError** error) { makiServer* serv; makiInstance* inst = maki_instance_get_default(); if ((serv = maki_instance_get_server(inst, server)) != NULL) { if (message[0]) { maki_server_send_printf(serv, "KICK %s %s ...
false
false
false
false
false
0
aes_unwrap ( const void *kek, const void *src, void *dest, int nblk ) { u8 A[8], B[16]; u8 *R; int i, j; void *aes_ctx = malloc ( AES_CTX_SIZE ); if ( ! aes_ctx ) return -1; cipher_setkey ( &aes_algorithm, aes_ctx, kek, 16 ); /* Set up */ memcpy ( A, src, 8 ); memmove ( dest, src + 8, nblk * 8 ); /* Unw...
false
false
false
false
false
0
gtktextview_gtk_text_view_scroll_to_mark(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_) { ScmObj text_view_scm; GtkTextView* text_view; ScmObj mark_scm; GtkTextMark* mark; ScmObj within_margin_scm; double within_margin; ScmObj use_align_scm; int use_align; ScmObj xalign_scm; double xalign; ScmObj ya...
false
false
false
false
false
0
memcpy_uppcase (dest, src, len LOCALE_PARAM) CHAR_T *dest; const CHAR_T *src; size_t len; LOCALE_PARAM_DECL { while (len-- > 0) dest[len] = TOUPPER ((UCHAR_T) src[len], loc); return dest; }
false
false
false
false
false
0
chv_gpio_get(struct gpio_chip *chip, unsigned offset) { struct chv_pinctrl *pctrl = gpiochip_to_pinctrl(chip); int pin = chv_gpio_offset_to_pin(pctrl, offset); unsigned long flags; u32 ctrl0, cfg; raw_spin_lock_irqsave(&chv_lock, flags); ctrl0 = readl(chv_padreg(pctrl, pin, CHV_PADCTRL0)); raw_spin_unlock_irqre...
false
false
false
false
false
0
elf_rel_size(struct mem_ehdr *ehdr) { size_t rel_size = 0; if (ehdr->ei_class == ELFCLASS32) { rel_size = sizeof(Elf32_Rel); } else if (ehdr->ei_class == ELFCLASS64) { rel_size = sizeof(Elf64_Rel); } else { die("Bad elf class"); } return rel_size; }
false
false
false
false
false
0
jspeStatementSwitch() { JSP_ASSERT_MATCH(LEX_R_SWITCH); JSP_MATCH('('); JsVar *switchOn = jspeAssignmentExpression(); JSP_MATCH_WITH_CLEANUP_AND_RETURN(')', jsvUnLock(switchOn), 0); JSP_MATCH_WITH_CLEANUP_AND_RETURN('{', jsvUnLock(switchOn), 0); JSP_SAVE_EXECUTE(); bool execute = JSP_SHOULD_EXECUTE; boo...
false
false
false
false
false
0
parport_daisy_init(struct parport *port) { int detected = 0; char *deviceid; static const char *th[] = { /*0*/"th", "st", "nd", "rd", "th" }; int num_ports; int i; int last_try = 0; again: /* Because this is called before any other devices exist, * we don't have to claim exclusive access. */ /* If mux pres...
false
false
false
false
false
0
check_duplicate_cu (dw_die_ref cu, htab_t htable, unsigned int *sym_num) { struct cu_hash_table_entry dummy; struct cu_hash_table_entry **slot, *entry, *last = &dummy; dummy.max_comdat_num = 0; slot = (struct cu_hash_table_entry **) htab_find_slot_with_hash (htable, cu, htab_hash_string (cu->die_id.die_sy...
false
false
false
false
false
0
ndarray_pop(PyObject *self, PyObject *dummy) { NDArrayObject *nd = (NDArrayObject *)self; if (ND_IS_CONSUMER(nd)) { PyErr_SetString(PyExc_BufferError, "structure of re-exporting object is immutable"); return NULL; } if (nd->head->exports > 0) { PyErr_Format(PyExc_Buff...
false
false
false
false
false
0
setup_apply_to_sess (session_gui *gui) { #ifdef USE_GTKSPELL GtkSpell *spell; #endif mg_update_xtext (gui->xtext); if (prefs.hex_gui_ulist_style) gtk_widget_set_style (gui->user_tree, input_style); if (prefs.hex_gui_input_style) { extern char cursor_color_rc[]; char buf[256]; sprintf (buf, cursor_color_...
true
true
false
false
true
1
datafile_alloc() { cdatafile *f; if ((f=malloc(sizeof(cdatafile)))==NULL) return NULL; f->path[0]=0; f->fd=-1; f->simul=false; f->open=false; f->sparse=false; return f; }
false
false
false
false
false
0
memstick_power_on(struct memstick_host *host) { int rc = host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_ON); if (!rc) rc = host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_SERIAL); return rc; }
false
false
false
false
false
0
doGetLineString( qint64 line ) const { if ( line >= nbLines_ ) { return QString(); /* exception? */ } dataMutex_.lock(); fileMutex_.lock(); file_->open( QIODevice::ReadOnly ); file_->seek( (line == 0) ? 0 : linePosition_[line-1] ); QString string = QString( file_->readLine() ); file_->cl...
false
false
false
false
false
0
tp_dbus_properties_mixin_dup_all (GObject *self, const gchar *interface_name) { TpDBusPropertiesMixinIfaceImpl *iface_impl; TpDBusPropertiesMixinIfaceInfo *iface_info; TpDBusPropertiesMixinPropImpl *prop_impl; /* no key destructor needed - the keys are immortal */ GHashTable *values = g_hash_table_new_ful...
false
false
false
false
false
0
_parse(struct plugin *plugin, struct lms_context *ctxt, const struct lms_file_info *finfo, void *match) { struct lms_audio_info info = { }; int r, fd; fd = open(finfo->path, O_RDONLY); if (fd < 0) return -errno; r = _parse_wave(fd, &info); if (r < 0) goto done; /* I...
false
false
false
false
false
0
crossings_dbl_to_int(const row_crossings_dbl_t &in) { row_crossings_t out; for(size_t i=0; i<in.size(); i+=2) { int from = (int)ceil(in[i] - EPSILON); int to = (int)floor(in[i+1] + EPSILON); if(to > from) { out.push_back(from); out.push_back(to); } } return out; }
false
false
false
false
false
0
fso_framework_bin_builder_insert_uint32 (FsoFrameworkBinBuilder* self, guint32 val, gint position) { GList* l = NULL; gint _tmp0_ = 0; GList* _tmp1_ = NULL; guint32 _tmp2_ = 0U; guint32 _tmp3_ = 0U; g_return_if_fail (self != NULL); _tmp0_ = position; _tmp1_ = fso_framework_bin_builder_get_at (self, _tmp0_, (gui...
false
false
false
false
false
0
copy_arrays(int i, int j, int delflag) { int m,iper,nper,ni,nj; for (m = 0; m < nvector; m++) { nper = peratom[m]; ni = nper*i; nj = nper*j; for (iper = 0; iper < nper; iper++) vectors[m][nj++] = vectors[m][ni++]; } }
false
false
false
false
false
0
match_index(UPSINFO *ups, int offset, const GENINFO * vs, const char *v) { char x[MAXSTRING]; if (!vs) { /* Shouldn't ever happen so abort if it ever does. */ Error_abort1("%s: Bogus configuration table! Fix and recompile.\n", argvalue); } if (!sscanf(v, "%s", x)) return FAILURE...
false
false
false
false
false
0
bcm_sf2_port_intr_disable(struct bcm_sf2_priv *priv, int port) { unsigned int off; switch (port) { case 7: off = P7_IRQ_OFF; break; case 0: /* Port 0 interrupts are located on the first bank */ intrl2_0_mask_set(priv, P_IRQ_MASK(P0_IRQ_OFF)); intrl2_0_writel(priv, P_IRQ_MASK(P0_IRQ_OFF), INTRL2...
false
false
false
false
false
0
str_replace(str_t *str, ssize_t idx, size_t amount, const char *string) { size_t length; size_t len; str_check(str); g_assert(size_is_non_negative(amount)); g_assert(string != NULL); length = strlen(string); len = str->s_len; if (idx < 0) /* Stands for chars before end */ idx += len; if G_UNLIKELY(i...
false
false
false
false
false
0
udp_open_common ( struct interface *xfer, struct sockaddr *peer, struct sockaddr *local, int promisc ) { struct sockaddr_tcpip *st_peer = ( struct sockaddr_tcpip * ) peer; struct sockaddr_tcpip *st_local = ( struct sockaddr_tcpip * ) local; struct udp_connection *udp; int port; int rc; /* Allocat...
false
false
false
false
false
0
fetion_buddy_scribe(fetion_account *ac) { gchar *res, *body; fetion_sip *sip; sip_header *eheader; sip = ac->sip; fetion_sip_set_type(sip, SIP_SUBSCRIPTION); eheader = sip_event_header_create(SIP_EVENT_PRESENCE); fetion_sip_add_header(sip, eheader); body = generate_subscribe_body...
false
false
false
false
false
0
preproc_evaluate_unary( PreprocessInfo *info, preproc_tokenizer *tokens, preproc_int_t *val, int *is_unsigned) { int op = tokens->tok; int result = VTK_PARSE_OK; if (op != '+' && op != '-' && op != '~' && op != '!') { return preproc_evaluate_single(info, tokens, val, is_unsigned); } preproc_ne...
false
false
false
false
false
0
RotateAtom_ (AtomS *atomSP, VectorS *vector1SP, VectorS *vector2SP, double angle) { VectorS rot_axis_vectorS; double abs_value; VectorS radius_vectorS; VectorS parallel_vectorS; VectorS perpendicular_vectorS; double perpendicular_part; double reciprocal_abs_value; VectorS unit_vector1S, unit_vector2S; double...
false
false
false
false
false
0
ssh_userauth_kbdint_getnprompts(ssh_session session) { if(session==NULL) return SSH_ERROR; if(session->kbdint == NULL) { ssh_set_error_invalid(session); return SSH_ERROR; } return session->kbdint->nprompts; }
false
false
false
false
false
0
VolumeSlide(MODCHANNEL *pChn, UINT param) //-------------------------------------------------------- { if (param) pChn->nOldVolumeSlide = param; else param = pChn->nOldVolumeSlide; LONG newvolume = pChn->nVolume; if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_STM|MOD_TYPE_AMF)) { if ((param & 0x0F) == 0x0F) {...
false
false
false
false
false
0
bs_aio_open(struct scsi_lu *lu, char *path, int *fd, uint64_t *size) { *fd = backed_file_open(path, O_RDWR|O_LARGEFILE|O_DIRECT, size); /* If we get access denied, try opening the file in readonly mode */ if (*fd == -1 && (errno == EACCES || errno == EROFS)) { *fd = backed_file_open(path, O_RDONLY|O_LARGEFILE|O_DI...
false
false
false
false
false
0
valid_name(const char *str) { if (!str || !*str) return false; char mc = mapchar[(uint8)*str]; if (mc == '_' || mc == '?' || mc == 'A' || mc == '@') { str++; while (*str) { mc = mapchar[(uint8)*str]; if (mc == '_' || mc == '?' || mc == 'A' || mc == '0' || mc == ':' || mc == '.' || mc == '@') { str++; ...
false
false
false
false
false
0
WriteConnections(const char* targetName, std::set<std::string>& insertedNodes, std::set<std::string>& insertedConnections, cmGeneratedFileStream& str) const { std::map<cmStdString, const cmTarget* >::const_iter...
false
false
false
false
false
0
ChanWrite (Tcl_Interp *interp, CONST char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr) { int Type = CXIMAGE_FORMAT_UNKNOWN; char * cxFormat = NULL; Tcl_Obj *data = NULL; Tcl_Channel chan = Tcl_OpenFileChannel(interp, fileName, "w", 0644); if (chan == NULL) return TCL_ERROR; if (format) {...
false
false
false
false
false
0
int_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad) { int mx,i; EX_CLASS_ITEM *item; void *ptr; CRYPTO_EX_DATA_FUNCS **storage = NULL; if((item = def_get_class(class_index)) == NULL) return; CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA); mx = sk_CRYPTO_EX_DATA_FUNCS_num(item->meth); if(mx > 0) { stor...
false
false
false
false
false
0
seq_show(struct seq_file *m, void *v) { struct files_struct *files = NULL; int f_flags = 0, ret = -ENOENT; struct file *file = NULL; struct task_struct *task; task = get_proc_task(m->private); if (!task) return -ENOENT; files = get_files_struct(task); put_task_struct(task); if (files) { int fd = proc_fd...
false
false
false
false
false
0
g_Ctoc(const Char * str, char *buf, unsigned int len) { while (len--) { if ((*buf++ = (char) *str++) == EOS) return 0; } return 1; }
false
false
false
false
false
0
delete_user_vars_of_type (GretlType type, PRN *prn) { int err = 0; if (type == GRETL_TYPE_MATRIX || type == GRETL_TYPE_BUNDLE || type == GRETL_TYPE_STRING || type == GRETL_TYPE_DOUBLE || type == GRETL_TYPE_LIST) { int level = gretl_function_depth(); if (level == 0 && user_var_callback != NULL && (t...
false
false
false
false
false
0
meta_draw_op_list_new (int n_preallocs) { MetaDrawOpList *op_list; g_return_val_if_fail (n_preallocs >= 0, NULL); op_list = g_new (MetaDrawOpList, 1); op_list->refcount = 1; op_list->n_allocated = n_preallocs; op_list->ops = g_new (MetaDrawOp*, op_list->n_allocated); op_list->n_ops = 0; return op_li...
false
false
false
false
false
0
handle_size(char *params) { /* Size> takes two parameters: * a positive integer, an arbitrary string */ int n; // The positive integer char *extra; // The arbitrary string if(params == NULL) { return -1; } /* Size extra to fit all it would need to */ extra = (char...
false
false
false
false
false
0
fs_session_parse_telephony_event_started (FsSession *session, GstMessage *message, FsDTMFMethod *method, FsDTMFEvent *event, guint8 *volume) { const GstStructure *s; const GValue *value; g_return_val_if_fail (session != NULL, FALSE); if (!check_message (message, session, "farstream-telephony-event...
false
false
false
false
false
0
interpolator_merge (GfsInterpolator * a, GfsInterpolator * b) { guint i; for (i = 0; i < b->n; i++) { FttCell * c = b->c[i]; guint j; for (j = 0; j < a->n && c != a->c[j]; j++) ; if (j < a->n) a->w[j] += b->w[i]; else { #if FTT_2D g_assert (j < 7); #else g_assert (j < 29...
false
false
false
false
false
0
guestfs_tar_out_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { GuestfsTarOut *self = GUESTFS_TAR_OUT(object); GuestfsTarOutPrivate *priv = self->priv; switch (property_id) { case PROP_GUESTFS_TAR_OUT_COMPRESS: g_free(priv->compress); priv->compress = g_...
false
false
false
false
false
0
xfs_attr3_leaf_freextent( struct xfs_trans **trans, struct xfs_inode *dp, xfs_dablk_t blkno, int blkcnt) { struct xfs_bmbt_irec map; struct xfs_buf *bp; xfs_dablk_t tblkno; xfs_daddr_t dblkno; int tblkcnt; int dblkcnt; int nmap; int error; /* * Roll through the "value", invalidating the at...
false
false
false
false
false
0
lam_nukeprocs(void) { LIST *tmp; tmp = plist; /* * The process list is set to null and we free the temporary to avoid a * nasty recursion when a signal occurs in al_free(). */ plist = 0; curproc = 0; if (tmp) { (void) al_free(tmp); } if (lam_procs != NULL) free(lam_procs); lam_num_procs = 0; }
false
false
false
false
false
0