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
table_ABS (struct GMTMATH_INFO *info, double **stack[], GMT_LONG *constant, double *factor, GMT_LONG last, GMT_LONG col, GMT_LONG n_row) /*OPERATOR: ABS 1 1 abs (A). */ { GMT_LONG i; double a = 0.0; if (gmtdefs.verbose && constant[last] && factor[last] == 0.0) fprintf (stderr, "%s: Warning, operand == 0!\n", GMT_p...
false
false
false
false
false
0
copy_string_array (array) ARRAY *array; { register int i; ARRAY *copy; if (!array) return (ARRAY *)NULL; copy = array_create (sizeof (char *)); copy->size = array->size; copy->sindex = array->sindex; copy->width = array->width; copy->array = (char **)xmalloc ((1 + array->sindex) * sizeof (c...
false
false
false
false
false
0
_e2_name_filter_dialog_ok (E2_NmFltDlgData *data) { const gchar *s = gtk_entry_get_text (GTK_ENTRY (data->pattern_entry)); if (*s == '\0') e2_output_print_error (_("Invalid filename pattern"), FALSE); else { //filter pattern is saved as utf, as required for matching, later // g_strlcpy (view->name_filter.p...
false
false
false
false
false
0
labviewer_make_weap_window(Button* caller) { GUIObject *cbp; TreeItem *cwip, *stip; int x; if (Lab_mode == LAB_MODE_WEAPON) { return; } // switch the class window to weapon mode labviewer_set_class_window(LAB_MODE_WEAPON); if ( (Lab_class_window == NULL) || (Lab_class_toolbar == NULL) ) { Int3(); Lab_...
false
false
false
false
false
0
libmail_gpg_import_do(const char *p, size_t n, int (*dump_func)(const char *, size_t, void *), void *voidarg) { if (libmail_gpg_write(p, n, dump_func, dump_func, NULL, 0, voidarg)) { libmail_gpg_cleanup(); return (-1); } return (0); }
false
false
false
false
false
0
zget_typed_line (qconn, fstrip) struct sconnection *qconn; boolean fstrip; { static boolean flastcr; char *zalc; size_t calc; size_t cgot; #if DEBUG > 1 int cchars; int iolddebug; cchars = 0; iolddebug = iDebug; if (FDEBUGGING (DEBUG_CHAT)) { ulog (LOG_DEBUG_START, "zget_typed_l...
false
false
false
false
false
0
FillPixel(int x, int y) { void *ptr; int *ext = this->ImageData->GetExtent(); int z = this->DefaultZ; // Pre-multiply coords if needed if (this->Ratio[0] != 1.0) { x = static_cast<int>(static_cast<double>(x) * this->Ratio[0]); } if (this->Ratio[1] != 1.0) { y = static_cast<int>(static_c...
false
false
false
false
false
0
namespace_uri(const xml_node& node) { namespace_uri_predicate pred = node.name(); xml_node p = node; while (p) { xml_attribute a = p.find_attribute(pred); if (a) return a.value(); p = p.parent(); } return PUGIXML_TEXT(""); }
false
false
false
false
false
0
completion_get(command_ty *) { complete_ty *result; string_ty *project_name; project_ty *pp; int mask; arglex2_retable(0); arglex(); project_name = 0; while (arglex_token != arglex_token_eoln) { switch (arglex_token) { default: result = generic_argumen...
false
false
false
false
false
0
GFD_dircreatefailed(GIOControl *gio) { /* We couldn't create the directory */ struct gfc_data *d = gio->userdata; if ( !_ggadget_use_gettext ) { unichar_t buffer[500]; unichar_t title[30]; u_strcpy(title, GStringGetResource(_STR_Couldntcreatedir,NULL)); u_strcpy(buffer, title); uc_strcat(buffer,": ")...
false
false
false
false
false
0
oc_mb_fill_cmapping01(oc_mb_map_plane _mb_map[3], const oc_fragment_plane _fplanes[3],int _xfrag0,int _yfrag0){ ptrdiff_t fragi; int j; _yfrag0>>=1; fragi=_yfrag0*(ptrdiff_t)_fplanes[1].nhfrags+_xfrag0; for(j=0;j<2;j++){ _mb_map[1][j]=fragi+_fplanes[1].froffset; _mb_map[2][j]=fragi+_fplanes[2]....
false
false
false
false
false
0
tmp_file_record_size4(int fd) { unsigned int size = tmp_file_pos; if (tmp_file_error) return -1; if (write_and_check(fd, &size, 4)) return -1; return 0; }
false
false
false
false
false
0
snd_ice1712_hoontech_init(struct snd_ice1712 *ice) { struct hoontech_spec *spec; int box, chn; ice->num_total_dacs = 8; ice->num_total_adcs = 8; spec = kzalloc(sizeof(*spec), GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; ICE1712_STDSP24_SET_ADDR(spec->boxbits, 0); ICE1712_STDSP24_CLOCK(spec->b...
false
false
false
false
false
0
get_color () const throw () { if (has_value ()) switch (value) { case S: return Tango::ORANGE; case P: return Tango::BUTTER; case D: return Tango::LIGHT_SCARLET_RED; case F: return Tango::DARK_PLUM; } return Tango::LIGHT_ALUMINIUM; }
false
false
false
false
false
0
find_name_in_header(type8s * name, type8 upper) { type16s header_pos = 0; type8s pic_name[8]; type8 i; for (i = 0; i < 8; i++) pic_name[i] = 0; strncpy(pic_name,name,6); if (upper) { for (i = 0; i < 8; i++) pic_name[i] = (type8s)toupper(pic_name[i]); } while (header_pos < gfx2_hsize) ...
false
true
false
false
false
1
check_duplicate_warning(THD *thd, char *msg, ulong length) { List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list()); MYSQL_ERROR *err; while ((err= it++)) { if (strncmp(msg, err->get_message_text(), length) == 0) { return true; } } return false; }
false
false
false
false
false
0
usbtiny_set_chunk_size (PROGRAMMER * pgm, int period) { PDATA(pgm)->chunk_size = CHUNK_SIZE; // start with the maximum (default) while (PDATA(pgm)->chunk_size > 8 && period > 16) { // Reduce the chunk size for a slow SCK to reduce // the maximum time of a single USB transfer. PDATA(pgm)->chunk_siz...
false
false
false
false
false
0
gst_qt_mux_add_3gp_str (GstQTMux * qtmux, const GstTagList * list, const char *tag, const char *tag2, guint32 fourcc) { gchar *str = NULL; guint number; g_return_if_fail (gst_tag_get_type (tag) == G_TYPE_STRING); g_return_if_fail (!tag2 || gst_tag_get_type (tag2) == G_TYPE_UINT); if (!gst_tag_list_get_s...
false
false
false
false
false
0
is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) { if (codec->no_jack_detect) return false; if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT)) return false; if (get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) & AC_DEFCFG_MISC_NO_PRESENCE) return false; if (!(get_wcaps(cod...
false
false
false
false
false
0
drv_Sample_start(const char *section) { int contrast; int rows = -1, cols = -1; char *s; char cmd[1]; s = cfg_get(section, "Size", NULL); if (s == NULL || *s == '\0') { error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); return -1; } if (sscanf(s, "%dx%d", &cols, &ro...
false
false
false
false
false
0
replaceColumnPFI ( CoinIndexedVector * regionSparse, int pivotRow, double alpha) { CoinBigIndex *startColumn=startColumnU_.array()+numberRows_; int *indexRow=indexRowU_.array(); CoinFactorizationDouble *element=elementU_.array(); CoinFactorizationDouble * pivotRegion = pivotRegion_.array()+n...
false
false
false
false
false
0
HFAParseBandInfo( HFAInfo_t *psInfo ) { HFAEntry *poNode; /* -------------------------------------------------------------------- */ /* Find the first band node. */ /* -------------------------------------------------------------------- */ psInfo->nBands = 0; poN...
false
false
false
false
false
0
bnxt_set_channels(struct net_device *dev, struct ethtool_channels *channel) { struct bnxt *bp = netdev_priv(dev); int req_tx_rings, req_rx_rings, tcs; bool sh = false; int tx_xdp = 0; int rc = 0; if (channel->other_count) return -EINVAL; if (!channel->combined_count && (!channel->rx_count || !ch...
false
false
false
false
false
0
matchobj_print(MatchObj* mo, int loglvl) { double ra,dec; loglevel(loglvl, " log-odds ratio %g (%g), %i match, %i conflict, %i distractors, %i index.\n", mo->logodds, exp(mo->logodds), mo->nmatch, mo->nconflict, mo->ndistractor, mo->nindex); xyzarr2radecdeg(mo->center, &ra, &dec); loglevel(loglvl, " RA,Dec = ...
false
false
false
false
false
0
fm10k_free_q_vector(struct fm10k_intfc *interface, int v_idx) { struct fm10k_q_vector *q_vector = interface->q_vector[v_idx]; struct fm10k_ring *ring; fm10k_dbg_q_vector_exit(q_vector); fm10k_for_each_ring(ring, q_vector->tx) interface->tx_ring[ring->queue_index] = NULL; fm10k_for_each_ring(ring, q_vector->rx...
false
false
false
false
false
0
update_ht_cap(struct _adapter *padapter, u8 *pie, uint ie_len) { u8 *p, max_ampdu_sz; int i, len; struct sta_info *bmc_sta, *psta; struct ieee80211_ht_cap *pht_capie; struct recv_reorder_ctrl *preorder_ctrl; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; struct ...
false
false
false
false
false
0
test_core_pqueue__max_heap_size(void) { git_pqueue pq; int i, vals[100]; cl_git_pass(git_pqueue_init(&pq, GIT_PQUEUE_FIXED_SIZE, 50, cmp_ints)); for (i = 0; i < 100; ++i) { vals[i] = (i & 1) ? 100 - i : i; cl_git_pass(git_pqueue_insert(&pq, &vals[i])); } cl_assert_equal_i(50, git_pqueue_size(&pq)); for (...
false
false
false
false
false
0
neededBits(unsigned vals) { unsigned bits = 1; while ((1U << bits) < vals) ++bits; return bits; }
false
false
false
false
false
0
afslog_cells(struct kafs_data *data, char **cells, int max, uid_t uid, const char *homedir) { int ret = 0; int i; for (i = 0; i < max; i++) { int er = (*data->afslog_uid)(data, cells[i], 0, uid, homedir); if (er) ret = er; } return ret; }
false
false
false
false
false
0
clock( bool ClockState ) { // A clock has happened. Either we sent one or we recieved one. bool onbeat; bool allDone = false; if( !m_sspstat || ! m_sspcon) return; unsigned int sspstat_val = m_sspstat->value.get(); unsigned int sspcon_val = m_sspcon->value.get(); //cout << "SPi clock " << ClockState ...
false
false
false
false
false
0
identifier_first() { int n ; for (n = 0 ; n < 64 ; n++) { if (identifier_hash[n]) return identifier_hash[n] ; } return 0 ; }
false
false
false
false
false
0
gt_select_visitor_set_single_intron_factor(GtNodeVisitor *nv, double single_intron_factor) { GtSelectVisitor *select_visitor = select_visitor_cast(nv); gt_assert(single_intron_factor >= 1.0); select_visitor->single_intron_factor = single_intron_factor; }
false
false
false
false
false
0
print(raw_ostream &OS, const Module* M) const { // Calling some PT methods may cause caches to be updated, however // this should be safe for the same reason its safe for SCEV. PointerTracking &PT = *const_cast<PointerTracking*>(this); for (inst_iterator I=inst_begin(*FF), E=inst_end(*FF); I != E; ++I) { if...
false
false
false
false
false
0
__ecereMethod___ecereNameSpace__ecere__gfx__Surface_VLine(struct __ecereNameSpace__ecere__com__Instance * this, int y1, int y2, int x) { struct __ecereNameSpace__ecere__gfx__Surface * __ecerePointer___ecereNameSpace__ecere__gfx__Surface = (struct __ecereNameSpace__ecere__gfx__Surface *)(this ? (((char *)this) + __ecere...
false
false
false
false
false
0
fw_exec( fw_action *act, GHashTable *conf ) { GHashTable *data; GPtrArray *env; gchar *cmd, **arg, **n; data = g_hash_dup( conf ); // // Than add specifics about this particular client, if any if (act->p != NULL) { g_hash_set( data, "IP", act->p->ip ); g_hash_set( data, "MAC", act->p...
false
false
false
false
false
0
e_kbd_int_free(E_Kbd_Int *ki) { if (ki->themedir) eina_stringshare_del(ki->themedir); if (ki->syskbds) eina_stringshare_del(ki->syskbds); if (ki->sysdicts) eina_stringshare_del(ki->sysdicts); _e_kbd_int_layouts_free(ki); _e_kbd_int_matches_free(ki); _e_kbd_int_layout_free(ki); ecore_event_handler_d...
true
true
false
false
false
1
WriteFinalWeights(const char* filename, const Point& point) { ofstream ofs(filename); if (!ofs) { cerr << "Cannot open " << filename << endl; return false; } ofs << point << endl; return true; }
false
false
false
false
false
0
GetCachedFileProp(const char* pszURL) { CPLMutexHolder oHolder( &hMutex ); CachedFileProp* cachedFileProp = cacheFileSize[pszURL]; if (cachedFileProp == NULL) { cachedFileProp = (CachedFileProp*) CPLMalloc(sizeof(CachedFileProp)); cachedFileProp->eExists = EXIST_UNKNOWN; cachedF...
false
false
false
false
false
0
load( const QDomElement& root ) { if( root.tagName() != domId() ) return false; clear(); QDomNode n = root.firstChild(); while ( !n.isNull() ) { QDomElement e = n.toElement(); if ( ( !e.isNull() ) && ( e.tagName() == DOM_LANGUAGE_ITEM ) ) { QLanguageItem * container = mFactory->buildLanguageItem(&e)...
false
false
false
false
false
0
continuation_stack_pop(void) { DECLARE_INTERNAL_FUNCTION("continuation_stack_pop"); return NULLP(l_continuation_stack) ? SCM_FALSE : POP(l_continuation_stack); }
false
false
false
false
false
0
expand_block_tm (struct tm_region *region, basic_block bb) { gimple_stmt_iterator gsi; for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); ) { gimple stmt = gsi_stmt (gsi); switch (gimple_code (stmt)) { case GIMPLE_ASSIGN: /* Only memory reads/writes need to be instrumented. */ if (gimple_assi...
false
false
false
false
false
0
transport_ssh_startup(void){ char *zIn; /* An input line received back from remote */ int nWait; /* Number of times waiting for the MOTD */ char zProbe[40]; /* Text of the random probe */ int nProbe; /* Size of probe message */ i...
true
true
false
false
false
1
pool_strdup_withterm(POOL *pool, const char *string, int term) { const char *p = strchr(string, term); int size = p ? p - string : strlen(string); return obstack_copy0(&pool->obstack, string, size); }
false
false
false
false
false
0
GVA_open_read_pref(const char *filename, gint32 vid_track, gint32 aud_track ,const char *preferred_decoder ,gboolean disable_mmx ) { t_GVA_Handle *handle; if(gap_debug) printf("GVA_open_read_pref: START\n"); if((gap_debug) && (preferred_decoder)) printf("GVA_ope...
false
false
false
false
false
0
real_execute() { const XEvent &last = Fluxbox::instance()->lastEvent(); if (last.type == ButtonPress) { const XButtonEvent &be = last.xbutton; fbwindow().startTabbing(be); } }
false
false
false
false
false
0
__Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); }
false
false
false
false
false
0
cec_set_osd_string(cec_logical_address iLogicalAddress, cec_display_control duration, const char *strMessage) { if (cec_parser) return cec_parser->SetOSDString(iLogicalAddress, duration, strMessage) ? 1 : 0; return -1; }
false
false
false
false
false
0
afr_sh_entry_impunge_hardlink (call_frame_t *impunge_frame, xlator_t *this, int child_index) { afr_private_t *priv = NULL; afr_local_t *impunge_local = NULL; afr_self_heal_t *impunge_sh = NULL; loc_t *loc = NULL; ...
false
false
false
false
false
0
HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot, HPDF_REAL width, HPDF_UINT16 dash_on, HPDF_UINT16 dash_off) { HPDF_Array array; HPDF_STATUS ret; HPDF_PTRACE((" HPDF_LinkAnnot_SetBorderSt...
false
false
false
false
false
0
fli_get_underline_pos( const char * label, const char * sc ) { int c; const char *p; /* Find the first non-special char in the shortcut string */ for ( c = '\0', p = sc; ! c && *p; p++ ) { if ( isalnum( ( int ) *p ) ) { if ( p == sc ) ...
false
false
false
false
false
0
cc_insert_custom_command_items(GtkMenu *me, const gchar *label, const gchar *tooltip, gint idx) { GtkWidget *item; gint key_idx = -1; GeanyKeyBinding *kb = NULL; switch (idx) { case 0: key_idx = GEANY_KEYS_FORMAT_SENDTOCMD1; break; case 1: key_idx = GEANY_KEYS_FORMAT_SENDTOCMD2; break; case 2: key_idx = GEA...
false
false
false
false
false
0
printk_buf(int level, const u8 * data, u32 len) { char line[81]; u32 ofs = 0; if (!(ipw2100_debug_level & level)) return; while (len) { printk(KERN_DEBUG "%s\n", snprint_line(line, sizeof(line), &data[ofs], min(len, 16U), ofs)); ofs += 16; len -= min(len, 16U); } }
true
true
false
false
false
1
iblock_alloc_device(struct se_hba *hba, const char *name) { struct iblock_dev *ib_dev = NULL; ib_dev = kzalloc(sizeof(struct iblock_dev), GFP_KERNEL); if (!ib_dev) { pr_err("Unable to allocate struct iblock_dev\n"); return NULL; } pr_debug( "IBLOCK: Allocated ib_dev for %s\n", name); return &ib_dev->dev; }
false
false
false
false
false
0
f2fs_dev_is_umounted(struct f2fs_configuration *c) { struct stat st_buf; int ret = 0; ret = is_mounted(MOUNTED, c->device_name); if (ret) { MSG(0, "\tError: Not available on mounted device!\n"); return -1; } /* * if failed due to /etc/mtab file not present * try with /proc/mounts. */ ret = is_mounted...
false
false
false
false
false
0
cache_node_insert (Cache *cache, const char *key) { CacheNode *node; cache->size++; if (cache->size > cache->max_size) cache_expire_unused (cache); node = g_slice_alloc (cache->node_size); node->key = g_strdup (key); node->cache = cache; g_hash_table_insert (cache->node_hash, node->key, node); list_pr...
false
false
false
false
false
0
brcmf_fws_macdesc_use_req_credit(struct brcmf_fws_mac_descriptor *entry, struct sk_buff *skb) { if (entry->requested_credit > 0) { entry->requested_credit--; brcmf_skb_if_flags_set_field(skb, REQUESTED, 1); brcmf_skb_if_flags_set_field(skb, REQ_CREDIT, 1); if (entry->state != BRCMF_FWS_STATE_CLOSE) brc...
false
false
false
false
false
0
expand_blanks(char *s) { int inquote = 0; char *sp; // points to src char *cp; // points to modified copy char last = '\0'; // last character sp = s; cp = _grTempString; while (*sp != '\0') { if (*sp == '"') { if (inquote) inquote--; else inquote++; } #if 1 // 2.060 // Han...
false
false
false
false
false
0
Redisplay (tdmInteractor I, tdmInteractorRedrawMode redrawMode) { DEFDATA(I,CursorData) ; DEFPORT(I_PORT_HANDLE) ; ENTRY(("Redisplay(0x%x, %d)", I, redrawMode)); if (PDATA(visible)) { PRINT(("interactor is visible")); Config(I, redrawMode) ; if (PDATA(mode) == XmROAM_MODE && PDATA(reset...
false
false
false
false
false
0
func_jacob_expe_D( const CArrayDouble<6> &eps, const CPose3D &D, CArrayDouble<12> &Y) { CPose3D incr; CPose3D::exp(eps,incr); const CPose3D expe_D = incr + D; expe_D.getAs12Vector(Y); }
false
false
false
false
false
0
RecordLocation( const Message* descriptor, DescriptorPool::ErrorCollector::ErrorLocation location, int line, int column) { if (source_location_table_ != NULL) { source_location_table_->Add(descriptor, location, line, column); } }
false
false
false
false
false
0
procall(FILE *fp, long pos, struct exiftags *t, const unsigned char *buf) { int r, rc, found; found = rc = 0; if (ctags) { switch (ctags) { case ET_CREATE: rc = copyallts(fp, pos, t, buf, EXIF_T_DATETIME, "created"); break; case ET_GEN: rc = copyallts(fp, pos, t, buf, EXIF_T_DATETIMEORIG, ...
false
false
false
false
false
0
ep93xx_spi_process_message(struct ep93xx_spi *espi, struct spi_message *msg) { unsigned long timeout; struct spi_transfer *t; int err; /* * Enable the SPI controller and its clock. */ err = ep93xx_spi_enable(espi); if (err) { dev_err(&espi->pdev->dev, "failed to enable SPI controller\n"); msg-...
false
false
false
false
false
0
recv_response(struct ste_message *msg) { uint32_t status; uint8_t *param; DBG_VERBOSE("msg_id 0x%x", msg->id); if (msg->id == STE_END_SAP_RSP) { sap_disconnect_rsp(u8500.sap_data); simd_close(); return; } param = msg->payload; status = *(uint32_t *)param; param += sizeof(status); DBG_VERBOSE("status ...
false
false
false
false
false
0
compare_right(const char *a, const char *b) { int bias = 0; /* The longest run of digits wins. That aside, the greatest value wins, but we can't know that it will until we've scanned both numbers to know that they have the same magnitude, so we remember it in BIAS. */ for (;; a++, b++...
false
false
false
false
false
0
set_id3_data(struct id3data *us, unsigned char *start, int id3version) { us->size = get_frame_size(start, id3version); if (!(us->data = malloc(us->size))) { fprintf(stderr, "set_id3_data: malloc failure\n"); return; } memcpy(us->data, start + 10, us->size); }
false
false
false
false
false
0
Push( PathNode* pNode ) { MPASSERT( pNode->inOpen == 0 ); MPASSERT( pNode->inClosed == 0 ); #ifdef DEBUG_PATH_DEEP printf( "Open Push: " ); graph->PrintStateInfo( pNode->state ); printf( " total=%.1f\n", pNode->totalCost ); #endif // Add sorted. Lowest to highest cost path. Note that the senti...
false
false
false
false
false
0
make_complement (char *sequence, unsigned int length) { char *complement; int i, j; complement = (char *) CALLOC_IN(length+1,sizeof(char)); for (i = length-1, j = 0; i >= 0; i--, j++) { complement[j] = complCode[(int) sequence[i]]; } complement[length] = '\0'; return complement; }
false
false
false
false
false
0
operator<<(Instruction *inst) { if (pos >= size - 1) throw MemEx("Out of space", pos); data[pos++] = inst; inst->mem = this; return *this; }
false
false
false
false
false
0
unaligned_object_size(CELL pointer) { F_TUPLE *tuple; F_TUPLE_LAYOUT *layout; switch(untag_header(get(pointer))) { case ARRAY_TYPE: case BIGNUM_TYPE: return array_size(array_capacity((F_ARRAY*)pointer)); case BYTE_ARRAY_TYPE: return byte_array_size( byte_array_capacity((F_BYTE_ARRAY*)pointer)); case BIT...
false
false
false
false
false
0
dy_prtlpphase (dyphase_enum phase, bool abbrv) /* This routine returns a print representation of the lp phase passed as a parameter. Parameter: phase: an lp phase code. abbrv: TRUE to get a two-letter abbreviation, FALSE for the long version Returns: print string */ { const char *rtnnme = "dy_prt...
false
false
false
false
false
0
readInitFile(t_Params *ptParams, int* anZ) { FILE *ifp = NULL; char *szLine = NULL; char *szTok, *pcError; int i = 0; szLine = (char *) malloc(sizeof(char)*BIG_LINE_LENGTH); if(!szLine) goto memoryError; ifp = fopen(ptParams->szInitFile, "r"); if(ifp){ /*read header line*/ while(fgets(s...
false
false
false
false
true
1
tegra_slink_transfer_one(struct spi_master *master, struct spi_device *spi, struct spi_transfer *xfer) { struct tegra_slink_data *tspi = spi_master_get_devdata(master); int ret; reinit_completion(&tspi->xfer_completion); ret = tegra_slink_start_transfer_one(spi, xfer); if (ret < 0) { dev_err(tsp...
false
false
false
false
false
0
tryExecuteStatement(PGconn *con, const char *sql) { PGresult *res; res = PQexec(con, sql); if (PQresultStatus(res) != PGRES_COMMAND_OK) { fprintf(stderr, "%s", PQerrorMessage(con)); fprintf(stderr, "(ignoring this error and continuing anyway)\n"); } PQclear(res); }
false
false
false
false
false
0
NewOperationC ( const Char * name, Int narg, const Char * nams, ObjFunc hdlr ) { Obj oper; #ifdef PREALLOCATE_TABLES Obj cache; Obj methods; UInt i; #endif /* create the functio...
false
false
false
false
false
0
SimplifyStringSet(set<string> *ss) { // Now make sure that the strings aren't redundant. For example, if // we know "ab" is a required string, then it doesn't help at all to // know that "abc" is also a required string, so delete "abc". This // is because, when we are performing a string search to filter // ...
false
false
false
false
false
0
init(const vector<Lorentz5Momentum>& meMomenta) { if ( children.empty() ) { massRange.first = meMomenta[externalId].mass(); massRange.second = massRange.first; momentum.setMass(meMomenta[externalId].mass()); if ( externalId == 1 ) momentum = meMomenta[1]; return; } children[0].init(meM...
false
false
false
false
false
0
zzip_entry_data_offset(ZZIP_ENTRY * entry) { struct zzip_file_header file_header; if (! entry) return -1; ___ zzip_off_t offset = zzip_entry_fread_file_header(entry, &file_header); if (! offset) return -1; offset += zzip_file_header_sizeof_tails(&file_header); if (fseeko(entry->d...
false
true
false
false
false
1
direct_pte_prefetch_many(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp, u64 *start, u64 *end) { struct page *pages[PTE_PREFETCH_NUM]; struct kvm_memory_slot *slot; unsigned access = sp->role.access; int i, ret; gfn_t gfn; gfn = kvm_mmu_page_get_gfn(sp, start - sp->spt); slot = gfn_to_memslot_di...
false
false
false
false
true
1
amdgpu_sa_bo_manager_start(struct amdgpu_device *adev, struct amdgpu_sa_manager *sa_manager) { int r; if (sa_manager->bo == NULL) { dev_err(adev->dev, "no bo for sa manager\n"); return -EINVAL; } /* map the buffer */ r = amdgpu_bo_reserve(sa_manager->bo, false); if (r) { dev_err(adev->dev, "(%d)...
false
false
false
false
false
0
analyze() { if (!Saiph::polymorphed() && _wield_weapon != ILLEGAL_ITEM && _wield_weapon != Inventory::keyForSlot(SLOT_WEAPON)) World::setAction(new action::Wield(this, _wield_weapon, WEAPON_WIELD_PRIORITY)); }
false
false
false
false
false
0
vp_listdebug(VALUE_PAIR *vp) { char tmpPair[70]; for (; vp; vp = vp->next) { vp_prints(tmpPair, sizeof(tmpPair), vp); DEBUG2(" %s", tmpPair); } }
true
true
false
false
false
1
setValue(NodeImpl::Id id, DOMStringImpl *value, const PrefixName& prefix, bool nsAware) { if (!id) return; // Passing in a null value here causes the attribute to be removed. This is a khtml extension // (the spec does not specify what to do in this situation). int exceptioncode = 0; if (!value) { ...
false
false
false
false
false
0
parse( std::string url ){ // Part url into (protocol, rest) std::vector< std::string > parts = split_string( url, "://" ); std::string rest; // If something essential is missing.... if( parts.size() < 2 ){ // error handling throw std::string( "Invalid URI!" ); return; } protocol = parts[0]; // If ...
false
false
false
false
false
0
ath6kl_wmi_ap_profile_commit(struct wmi *wmip, u8 if_idx, struct wmi_connect_cmd *p) { struct sk_buff *skb; struct wmi_connect_cmd *cm; int res; skb = ath6kl_wmi_get_new_buf(sizeof(*cm)); if (!skb) return -ENOMEM; cm = (struct wmi_connect_cmd *) skb->data; memcpy(cm, p, sizeof(*cm)); res = ath6kl_wmi_...
false
false
false
false
false
0
APar_MetaData_atom_Init(const char* atom_path, const char* MD_Payload, const uint32_t atomFlags) { //this will handle the vanilla iTunes-style metadata atoms; genre will be handled elsewehere because it gets carried on 2 different atoms, and artwork gets special treatment because it can have multiple child data ato...
false
false
false
false
false
0
string_hash_function (gconstpointer key) { guint ret; int i; ret = 0; for (i=0; ((char *) key)[i] != '\0' && i < 3; i++) ret += ((char *) key)[i]; return (ret); }
true
true
false
false
false
1
loadavg_compare(const void *a, const void *b) { struct search_idle_host_state *const *aa = a; struct search_idle_host_state *const *bb = b; const struct search_idle_host_state *p = *aa; const struct search_idle_host_state *q = *bb; const float l1 = (p->loadavg + p->scheduled*VIRTUAL_LOAD_FOR_SCHEDULED_HOST) / p-...
false
false
false
false
false
0
triangle(double x,double y,double l,double h, const char* color, const char* link, bool leftright) { char buf[512]; if (link != 0 && link[0]!=0) { // open the optional link tag fprintf(fic_repr,"<a xlink:href=\"%s\">\n", xmlcode(link, buf)); } // draw triangle+circle float r = 1.5; /...
false
false
false
false
false
0
open_decoder(LHAReader *reader, LHADecoderProgressCallback callback, void *callback_data) { // Can only read from a normal file. if (reader->curr_file_type != CURR_FILE_NORMAL) { return 0; } reader->inner_decoder = lha_basic_reader_decode(reader->reader); if (re...
false
false
false
false
false
0
unset_axislabel_or_title(text_label *label) { struct position default_offset = { character, character, character, 0., 0., 0. }; if (label) { free(label->text); label->text = NULL; free(label->font); label->font = NULL; label->offset = default_offset; label->textcolor.type = TC_DEFAULT; } }
false
false
false
false
false
0
glade_gtk_file_filter_read_widget (GladeWidgetAdaptor *adaptor, GladeWidget *widget, GladeXmlNode *node) { if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) || glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE))) return; /* First chain up and read in all the ...
false
false
false
false
false
0
reset( int pairs ) { // expand allocations a bit RETURN_ERR( sample_buf.resize( (pairs + (pairs >> 2)) * 2 ) ); resize( pairs ); resampler_size = oversamples_per_frame + (oversamples_per_frame >> 2); return resampler.buffer_size( resampler_size ); }
false
false
false
false
false
0
gsb_data_budget_set_budget_from_string ( gint transaction_number, const gchar *string, gboolean is_transaction ) { gchar **tab_char; gint budget_number; /* the simpliest is to split in 2 parts, transaction and scheduled, * but the 2 parts are exactly the...
false
false
false
false
false
0
ellipt_est_fct(const EL_INFO *el_info, void *data) { EL *el = el_info->el; REAL det = 0.0, est_el; REAL_D Lambda[N_LAMBDA]; int face; int dim = el_info->mesh->dim; const S_CHAR *bound = ((dim == 3) ? el_info->face_bound : el_info->edge_bound); EL ...
false
false
false
false
false
0
perform(complete_ty *cp, shell_ty *sh) { complete_filename_ty *this_thing; string_ty *prefix; string_ty *prefix_dir; string_ty *prefix_ent; size_t j; string_list_ty names; this_thing = (complete_filename_ty *)cp; prefix = shell_prefix_get(sh); // // ...
false
false
false
false
false
0
setDayFocus(QDate &date, bool bFlag) { int d = date.day(); int w = date.dayOfWeek(); if (w == 7) w = 0; int r = (d + (6 - w) + 7 -1)/7; QString add = QString("%1-%2").arg(r).arg(w+1); if (bFlag) { resetcalendardate(QString::number(date.day())); } map->value(add)->se...
false
false
false
false
false
0
tag_release_one(struct mvumi_hba *mhba, struct mvumi_tag *st, unsigned short tag) { BUG_ON(st->top >= st->size); st->stack[st->top++] = tag; }
false
false
false
false
false
0
getBlockWeight(const BasicBlock *BB) const { bool Found = false; uint64_t Weight = 0; for (auto &I : BB->getInstList()) { const ErrorOr<uint64_t> &R = getInstWeight(I); if (R && R.get() >= Weight) { Weight = R.get(); Found = true; } } if (Found) return Weight; else return std...
false
false
false
false
false
0
gst_multiudpsink_clear_internal (GstMultiUDPSink * sink, gboolean lock) { GST_DEBUG_OBJECT (sink, "clearing"); /* we only need to remove the client structure, there is no additional * socket or anything to free for UDP */ if (lock) g_mutex_lock (sink->client_lock); g_list_foreach (sink->clients, (GFunc) ...
false
false
false
false
false
0
names_mark_index(name_table * nt, name_index_t nidx) { name_string_t *pnstr = names_index_string_inline(nt, nidx); if (pnstr->mark) return false; pnstr->mark = 1; return true; }
false
false
false
false
false
0