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
batch_list(Picklerobject *self, PyObject *iter) { PyObject *obj = NULL; PyObject *firstitem = NULL; int i, n; static char append = APPEND; static char appends = APPENDS; assert(iter != NULL); if (self->proto == 0) { /* APPENDS isn't available; do one at a time. */ for (;;)...
false
false
false
false
false
0
SetSavedNodesLevel(nodes_to_save) int nodes_to_save; { int i; for (i=0; i<MaxNumberOfLevels; i++) { SavedNodes[i].num_to_save = (i==0 ? nodes_to_save : (SavedNodes[i-1].num_to_save - ((int) ((double)(SavedNodes[i-1].num_to_save*i) * .25 + 0.5)))); } }
false
false
false
false
false
0
caribou_key_model_release (CaribouKeyModel* self) { guint _tmp0_ = 0U; gboolean _tmp2_ = FALSE; gboolean _tmp3_ = FALSE; gboolean _tmp7_ = FALSE; guint _tmp15_ = 0U; g_return_if_fail (self != NULL); _tmp0_ = self->priv->hold_tid; if (_tmp0_ != ((guint) 0)) { guint _tmp1_ = 0U; _tmp1_ = self->priv->hold_tid;...
false
false
false
false
false
0
zend_do_if_after_statement(const znode *closing_bracket_token, unsigned char initialize TSRMLS_DC) /* {{{ */ { int if_end_op_number = get_next_op_number(CG(active_op_array)); zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); zend_llist *jmp_list_ptr; opline->opcode = ZEND_JMP; /* save for backpatching...
false
false
false
false
false
0
is_correct_endfilter (VerifyContext *ctx, guint offset) { int i; MonoExceptionClause *clause; for (i = 0; i < ctx->header->num_clauses; ++i) { clause = &ctx->header->clauses [i]; if (clause->flags != MONO_EXCEPTION_CLAUSE_FILTER) continue; if (MONO_OFFSET_IN_FILTER (clause, offset)) return clause; if ...
false
false
false
false
false
0
GetPointsInRegion(int leafNodeId) { if ( (leafNodeId < 0) || (leafNodeId >= this->NumberOfLeafNodes)) { vtkErrorMacro("vtkOctreePointLocator::GetPointsInRegion invalid leaf node ID"); return NULL; } if (!this->LocatorIds) { // don't build locator since leafNodeId is probably garbage anyways...
false
false
false
false
false
0
populate_file_descriptors( fd_set * const fds ) { int i; int fd_max = 0; FD_ZERO( fds ); for ( i = 0; i < globs.jobs; ++i ) { int fd; if ( ( fd = cmdtab[ i ].fd[ OUT ] ) > 0 ) { if ( fd > fd_max ) fd_max = fd; FD_SET( fd, fds ); } if (...
false
false
false
false
false
0
skl_set_power_well(struct drm_i915_private *dev_priv, struct i915_power_well *power_well, bool enable) { uint32_t tmp, fuse_status; uint32_t req_mask, state_mask; bool is_enabled, enable_requested, check_fuse_status = false; tmp = I915_READ(HSW_PWR_WELL_DRIVER); fuse_status = I915_READ(SKL_FUSE_STATUS); swit...
false
false
false
false
false
0
pop_labels (tree block) { if (named_labels) { htab_traverse (named_labels, pop_labels_1, block); named_labels = NULL; } }
false
false
false
false
false
0
overlap(const CalendarItem &item) const { return ending() > item.beginning() && beginning() < item.ending(); }
false
false
false
false
false
0
e_int_config_desklock_intl(E_Container *con, const char *params __UNUSED__) { E_Config_Dialog *cfd; E_Config_Dialog_View *v; if (e_config_dialog_find("E", "language/desklock_language_settings")) return NULL; v = E_NEW(E_Config_Dialog_View, 1); v->create_cfdata = _create_desklock_data; v->free_cfdata...
false
false
false
false
false
0
print(raw_ostream &OS, const Module *M) const { for (const auto &I : instructions(*F)) { const Instruction *Inst = &I; DepSetMap::const_iterator DI = Deps.find(Inst); if (DI == Deps.end()) continue; const DepSet &InstDeps = DI->second; for (const auto &I : InstDeps) { const Instruct...
false
false
false
false
false
0
qpol_default_policy_find(char **path) { int rt; if (path == NULL) { errno = EINVAL; return -1; } *path = NULL; /* Try default source policy first as a source policy contains * more useful information. */ if ((rt = search_policy_source_file(path)) <= 0) { return rt; } /* Try a binary policy */ return se...
false
false
false
false
false
0
ajp_parse_header(request_rec *r, proxy_dir_conf *conf, ajp_msg_t *msg) { apr_byte_t result; apr_status_t rc; rc = ajp_msg_get_uint8(msg, &result); if (rc != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00994) "ajp_parse_headers:...
false
false
false
false
false
0
env_has_key(env, key) VALUE env, key; { char *s; s = StringValuePtr(key); if (strlen(s) != RSTRING(key)->len) rb_raise(rb_eArgError, "bad environment variable name"); if (getenv(s)) return Qtrue; return Qfalse; }
false
false
false
false
false
0
nDim() const { if ( phasespace() ) { size_t nout = diagrams().front()->partons().size()-2; int n = phasespace()->nDim(nout); return n; } throw Exception() << "MatchboxMEBase::nDim() expects a MatchboxPhasespace object.\n" << "Please check your setup." << Exception::abortnow; return 0; }
false
false
false
false
false
0
enqueueFact(const Theorem& thm) { // d_core->addFact(thm); TRACE("search props", "SearchEngineFast::enqueueFact(", thm.getExpr(), ") {"); if(thm.isAbsLiteral()) { addLiteralFact(thm); } d_factQueue.push_back(thm); TRACE_MSG("search props", "SearchEngineFast::enqueueFact => }"); }
false
false
false
false
false
0
addHelpOption() { QString shortName(m_options.contains(tr("h")) ? "" : "h"); QString longName(tr("help")); BooleanOptionPtr option(new BooleanOption(shortName, longName)); option->setHelp(tr("show this information and terminate")); addOption(option); return option; }
false
false
false
false
false
0
mt352_pinnacle_init(struct dvb_frontend* fe) { static u8 clock_config [] = { CLOCK_CTL, 0x3d, 0x28 }; static u8 reset [] = { RESET, 0x80 }; static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 }; static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0xa0 }; static u8 capt_range_cfg[] = { CAPT_RANGE, 0x31 }; ...
false
false
false
false
false
0
pg_strdup(const char *string) { char *tmp; if (!string) exit_horribly(NULL, NULL, "cannot duplicate null pointer\n"); tmp = strdup(string); if (!tmp) exit_horribly(NULL, NULL, "out of memory\n"); return tmp; }
false
false
false
false
false
0
p_sort(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann) { IntVarArgs x = s.arg2intvarargs(ce[0]); IntVarArgs y = s.arg2intvarargs(ce[1]); IntVarArgs xy(x.size()+y.size()); for (int i=x.size(); i--;) xy[i] = x[i]; for (int i=y.size(); i--;) xy[i+x.size()] = y[i]; u...
false
false
false
false
false
0
setTemplateFile() { QString currentFileName = ui.templateCombo->currentText(); #ifdef KTIKZ_TEMPLATES_INSTALL_DIR if (currentFileName.isEmpty() && QFileInfo(KTIKZ_TEMPLATES_INSTALL_DIR).isDir()) currentFileName = KTIKZ_TEMPLATES_INSTALL_DIR; #endif const Url url = FileDialog::getOpenUrl(this, tr("Select a tem...
false
false
false
false
false
0
stk500hv_chip_erase(PROGRAMMER * pgm, AVRPART * p, enum hvmode mode) { int result; unsigned char buf[3]; pgm->pgm_led(pgm, ON); if (mode == PPMODE) { buf[0] = CMD_CHIP_ERASE_PP; buf[1] = p->chiperasepulsewidth; buf[2] = p->chiperasepolltimeout; } else { buf[0] = CMD_CHIP_ERASE_HVSP; buf[...
false
false
false
false
false
0
st_tty_wakeup(struct tty_struct *tty) { struct st_data_s *st_gdata = tty->disc_data; pr_debug("%s ", __func__); /* don't do an wakeup for now */ clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); /* * schedule the internal wakeup instead of calling directly to * avoid lockup (port->lock needed in tty->ops->write is...
false
false
false
false
false
0
NVConvert24To16Frame (const std::vector<unsigned char>& logodata) { std::vector<unsigned char> result(LogoInfo::width * LogoInfo::height * 2); Convert24To16Frame(&logodata[0], &result[0], LogoInfo::width * LogoInfo::height, LogoInfo::width); return result; }
false
false
false
false
false
0
lockFileWithLink(KDE_struct_stat &st_buf) { const QByteArray lockFileName = QFile::encodeName( m_fileName ); int result = KDE_lstat( lockFileName, &st_buf ); if (result == 0) { return KLockFile::LockFail; } KTemporaryFile uniqueFile(m_componentData); uniqueFile.setFileTemplate(m_fileName); if (!uniq...
false
false
false
false
false
0
find_interactive_cl(void) { FILE *fin, *fout; fin = fopen("/dev/tty", "r"); fout = fopen("/dev/tty", "w"); if (!fin || !fout) { printf("interaction failure: cannot find tty.\n"); fprintf(stderr, "interaction failure: cannot find tty.\n"); return(NULL); } else { int id; struct clause *...
false
false
false
false
true
1
x2sys_get_data_path (char *track_path, char *track, char *suffix) { int id; GMT_LONG add_suffix = FALSE; char geo_path[BUFSIZ], dotsuffix[GMT_TEXT_LEN]; if (track[0] == '/' || track[1] == ':') { /* Full path given, just return it */ strcpy(track_path, track); return (0); } /* Check if we need to append suf...
false
false
false
false
false
0
eepromTest(void) { bool status; status = eepromTestConnection(); if (status) { DEBUG_PRINT("I2C connection [OK].\n"); } else { DEBUG_PRINT("I2C connection [FAIL].\n"); } return status; }
false
false
false
false
false
0
rewind_state (GckEnumeratorState *args, GckEnumeratorFunc handler) { g_assert (args); g_assert (handler); g_assert (args->handler); while (handler != args->handler) { args->handler = (args->handler) (args, FALSE); g_assert (args->handler); } return handler; }
false
false
false
false
false
0
base64_decode( unsigned char *dst, int *dlen, const unsigned char *src, int slen ) { int i, j, n; unsigned long x; unsigned char *p; for( i = j = n = 0; i < slen; i++ ) { if( ( slen - i ) >= 2 && src[i] == '\r' && src[i + 1] == '\n' ) continue; ...
false
false
false
false
false
0
gaussian_psf(struct psf *psf, double ovs, double s) { int xi, yi; double rs, v, vol = 0.0; s *= ovs; d3_printf("gauss_psf: s=%.3f\n", s); for (xi = 0; xi < psf->w; xi ++) for (yi = 0; yi < psf->h; yi++) { rs = sqr(xi - psf->cx - psf->dx) + sqr(yi - psf->cy - psf->dy); v = exp( - rs / 2 / sqr(s)); vol...
false
false
false
false
false
0
lame_get_AudiophileGain(const lame_global_flags * gfp) { if (is_lame_global_flags_valid(gfp)) { lame_internal_flags const *const gfc = gfp->internal_flags; if (is_lame_internal_flags_valid(gfc)) { return 0; } } return 0; }
false
false
false
false
false
0
compile_grep_patterns(struct grep_opt *opt) { struct grep_pat *p; if (opt->all_match) opt->extended = 1; for (p = opt->pattern_list; p; p = p->next) { switch (p->token) { case GREP_PATTERN: /* atom */ case GREP_PATTERN_HEAD: case GREP_PATTERN_BODY: if (!opt->fixed) compile_regexp(p, opt); break...
false
false
false
false
false
0
processInitializer (statementInfo *const st) { const boolean inEnumBody = insideEnumBody (st); int c = cppGetc (); if (c != '=') { cppUngetc (c); c = skipInitializer (st); st->assignment = TRUE; if (c == ';') setToken (st, TOKEN_SEMICOLON); else if (c == ',') setToken (st, TOKEN_COMMA); else if (...
false
false
false
false
false
0
isChildArg(const char *infoName, const char *argText) const { if (ArUtil::isStrEmpty(infoName) || ArUtil::isStrEmpty(argText)) { return false; } std::map<std::string, std::map<std::string, bool> >::const_iterator iter1 = myInfoNameToMa...
false
false
false
false
false
0
on_action_edit_copy(GtkAction *action, GmAppView *view) { GtkWidget *active = gtk_window_get_focus(GTK_WINDOW(view)); GtkClipboard *clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); GtkTextBuffer *buf; GtkTextIter start, end; GmWorldView *world_view; world_view = gm_app_view_active_world_view(view); if (world...
false
false
false
false
false
0
CompareAverageOfL2Norm( vtkDataSet *dsA, vtkDataSet *dsB, double tol) { vtkDataArray *daA=0; vtkDataArray *daB=0; int status=0; // Compare points if the dataset derives from // vtkPointSet. vtkPointSet *ptSetA=vtkPointSet::SafeDownCast(dsA); vtkPointSet *ptSetB=vtkPointSet::SafeDo...
false
false
false
false
false
0
anthy_set_seg_class(struct word_list* wl) { int head_pos; enum dep_class dc; enum seg_class seg_class; if (!wl) return; head_pos = wl->head_pos; dc = wl->part[PART_DEPWORD].dc; seg_class = SEG_HEAD; if (wl->part[PART_CORE].len == 0) { seg_class = SEG_BUNSETSU; } else { switch (head_pos) { ...
false
false
false
false
false
0
bson_append_binary( bson *b, const char *name, char type, const char *str, size_t len ) { if ( type == BSON_BIN_BINARY_OLD ) { size_t subtwolen = len + 4; if ( bson_append_estart( b, BSON_BINDATA, name, 4+1+4+len ) == BSON_ERROR ) return BSON_ERROR; bson_append32_as_int( b, ( int...
false
false
false
false
false
0
updateName_WOSD(XMLSTR lpszName) { if (!d) { free(lpszName); return NULL; } if (d->lpszName&&(lpszName!=d->lpszName)) free((void*)d->lpszName); d->lpszName=lpszName; return lpszName; }
false
false
false
false
false
0
option_get_command(dstr_t *cmd, option_t *opt, int optionset, int section) { const char *valstr; choice_t *choice = NULL; dstrclear(cmd); if (option_is_composite(opt)) return composite_get_command(cmd, opt, optionset, section); if (section >= 0 && !option_is_in_section(opt, section)) ...
false
false
false
false
false
0
eet_pbkdf2_sha1(const char *key, int key_len, const unsigned char *salt, unsigned int salt_len, int iter, unsigned char *res, int res_len) { unsign...
false
false
false
false
true
1
stdclock_set_mclk(struct snd_ice1712 *ice, unsigned int rate) { unsigned char val, old; /* check MT02 */ if (ice->eeprom.data[ICE_EEP2_ACLINK] & VT1724_CFG_PRO_I2S) { val = old = inb(ICEMT1724(ice, I2S_FORMAT)); if (rate > 96000) val |= VT1724_MT_I2S_MCLK_128X; /* 128x MCLK */ else val &= ~VT1...
false
false
false
false
false
0
EnvRemoveBreak( void *theEnv, void *theRule) { #if MAC_MCW || IBM_MCW || MAC_XCD #pragma unused(theEnv) #endif struct defrule *thePtr; int rv = FALSE; for (thePtr = (struct defrule *) theRule; thePtr != NULL; thePtr = thePtr->disjunct) { if (thePtr->afterBreakpoint == 1) ...
false
false
false
false
false
0
bcm54xx_adjust_rxrefclk(struct phy_device *phydev) { u32 orig; int val; bool clk125en = true; /* Abort if we are using an untested phy. */ if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 && BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 && BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M) return; val = bcm_phy_r...
false
false
false
false
false
0
parser_gsm_end (MobileParser *parser, const char *name) { if (!strcmp (name, "gsm")) { g_free (parser->text_buffer); parser->text_buffer = NULL; parser->state = PARSER_PROVIDER; } }
false
false
false
false
false
0
clearChildren() { for (Children::iterator it = _children.begin(), e = _children.end(); it != e; ++it) { XMLNode_as* node = *it; node->setParent(0); if (!node->_object) { // The node is not GC'd because it has no associated object. // See XMLNode_as class...
false
false
false
false
false
0
dw_spi_mid_init(struct dw_spi *dws) { void __iomem *clk_reg; u32 clk_cdiv; clk_reg = ioremap_nocache(MRST_CLK_SPI_REG, 16); if (!clk_reg) return -ENOMEM; /* Get SPI controller operating freq info */ clk_cdiv = readl(clk_reg + dws->bus_num * sizeof(u32)); clk_cdiv &= CLK_SPI_CDIV_MASK; clk_cdiv >>= CLK_SPI_C...
false
false
false
false
false
0
better_match (IsBetter prev) { if (prev == WorseMatch) return prev; set_cur_rank(); if (cur_rank >= worst_rank) return WorseMatch; else if (cur_rank < best_rank) return BetterMatch; else if (cur_rank == best_rank) return prev; else // cur_rank > best_rank if (prev...
false
false
false
false
false
0
brasero_session_cfg_session_loaded (BraseroTrackDataCfg *track, BraseroMedium *medium, gboolean is_loaded, BraseroSessionCfg *session) { BraseroBurnFlag session_flags; BraseroSessionCfgPrivate *priv; priv = BRASERO_SESSION_CFG_PRIVATE (session); if (priv->disabled) return; priv->sessio...
false
false
false
false
false
0
br_iface_player_base_init (gpointer klass) { static gboolean initialized = FALSE; if (initialized) { return; } initialized = TRUE; signals[COMPLETED] = g_signal_new ("uri-completed", G_OBJECT_CLASS_TYPE (klass), ...
false
false
false
false
false
0
asoc_ssc_exit(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct ssc_device *ssc = platform_get_drvdata(pdev); if (ssc->pdata->use_dma) atmel_pcm_dma_platform_unregister(dev); else atmel_pcm_pdc_platform_unregister(dev); snd_soc_unregister_component(dev); }
false
false
false
false
false
0
sigmaKin() { // Pick new flavour. idNew = 1 + int( qCnQuarkNew * rndmPtr->flat() ); mNew = particleDataPtr->m0(idNew); m2New = mNew*mNew; // Calculate kinematics dependence. double sigQC = 0.; sigS = 0.; if (sH > 4. * m2New) { sigS = (4./9.) * (tH2 + uH2) / sH2...
false
false
false
false
false
0
SoundOff(int start,int end,unsigned short val) // SOUND OFF PSX COMMAND { int ch; for(ch=start;ch<end;ch++,val>>=1) // loop channels { if(val&1) // && s_chan[i].bOn) mmm... { s_chan[ch].bStop=1; } } }
false
false
false
false
false
0
merge_comps (unsigned fathers[], unsigned sizes[], unsigned a, unsigned b) { unsigned ca = component_of (fathers, a); unsigned cb = component_of (fathers, b); if (ca == cb) return; if (sizes[ca] < sizes[cb]) { sizes[cb] += sizes[ca]; fathers[ca] = cb; } else { sizes[ca] += ...
false
false
false
false
false
0
gst_avi_mux_start_chunk (GstByteWriter * bw, const gchar * tag, guint32 fourcc) { guint chunk_offset; if (tag) gst_byte_writer_put_data (bw, (const guint8 *) tag, 4); else gst_byte_writer_put_uint32_le (bw, fourcc); chunk_offset = gst_byte_writer_get_pos (bw); /* real chunk size comes later */ gst...
false
false
false
false
false
0
setPen( const QPen &pen ) { if ( d_data->majPen != pen || d_data->minPen != pen ) { d_data->majPen = pen; d_data->minPen = pen; itemChanged(); } }
false
false
false
false
false
0
force_maximize (rp_window *win) { if (!win) win = current_window(); if (!win) return; maximize_normal(win); /* Reposition the window. */ move_window (win); /* This little dance is to force a maximize event. If the window is already "maximized" X11 will optimize away the event since to geometry ...
false
false
false
false
false
0
isight_samples(struct isight *isight, const __be16 *samples, unsigned int count) { struct snd_pcm_runtime *runtime; unsigned int count1; if (!ACCESS_ONCE(isight->pcm_running)) return; runtime = isight->pcm->runtime; if (isight->buffer_pointer + count <= runtime->buffer_size) { memcpy(runtime->dma_area ...
false
false
false
false
false
0
xenbus_probe_frontend(struct xen_bus_type *bus, const char *type, const char *name) { char *nodename; int err; /* ignore console/0 */ if (!strncmp(type, "console", 7) && !strncmp(name, "0", 1)) { DPRINTK("Ignoring buggy device entry console/0"); return 0; } nodename = kasprintf(GFP_KERNEL, "%s/%s/%s", ...
false
false
false
false
false
0
itc_command(int command, int on_stack) { ensure_weight_vector(); if (!_weight_vector.size()) return error(errVector, command); int base = size() - on_stack; switch (command) { case Cs::othcITC_load: { if (on_stack != 1) return error(errOthersubr, command); int offset = (int)at(base...
false
false
false
false
false
0
context_lex_add_ineq(struct isl_context *context, isl_int *ineq, int check, int update) { struct isl_context_lex *clex = (struct isl_context_lex *)context; if (isl_tab_extend_cons(clex->tab, 1) < 0) goto error; clex->tab = add_lexmin_ineq(clex->tab, ineq); if (check) { int v = tab_has_valid_sample(clex->tab, ...
false
false
false
false
false
0
removeTab(int index) { if (index >= d->pages.count() || index < 0) { return; } d->newPageAnim->stop(); d->oldPageAnim->stop(); int oldCurrentIndex = d->tabProxy->native->currentIndex(); d->tabProxy->native->removeTab(index); d->currentIndex = oldCurrentIndex; int currentIndex ...
false
false
false
false
false
0
main(int argc, char *argv[]) { if (argc < 2) { cerr << "Usage: RuleTableToTree rule >Rules/rule.tree" << endl ; exit(0) ; } lifeerrors::seterrorhandler(&mylifeerrors) ; my_ruletable_algo *rta = new my_ruletable_algo() ; string err = rta->loadrule(argv[1]) ; if (err.size() > 0) { cerr...
false
false
false
false
false
0
toArray() const { int size = d->n.encoded_size(Botan::BigInt::Binary); // return at least 8 bits if(size == 0) { SecureArray a(1); a[0] = 0; return a; } int offset = 0; SecureArray a; // make room for a sign bit if needed if(d->n.get_bit((size * 8) - 1)) { ++size; a.resize(size); a[0] = 0; ++...
false
false
false
false
false
0
Load(FILE *stream, ReadFunction loadFn,void *arg) { size_t i; unsigned char *p; Vector *result,AL; guid Guid; if (stream == NULL) { NullPtrError("Load"); return NULL; } if (loadFn == NULL) { loadFn = DefaultLoadFunction; arg = &AL.ElementSize; } if (f...
false
false
false
false
true
1
immediateEncodingFromString (const std::string &s, bool hasOpSizePrefix) { if(!hasOpSizePrefix) { // For instructions without an OpSize prefix, a declared 16-bit register or // immediate encoding is special. ENCODING("i16imm", ENCODING_IW) } ENCODING("i32i8imm", ENCODING_IB) ENCOD...
false
false
false
false
false
0
dom_tree_to_transaction( xmlNodePtr node, QofBook *book ) { Transaction *trn; gboolean successful; struct trans_pdata pdata; g_return_val_if_fail(node, NULL); g_return_val_if_fail(book, NULL); trn = xaccMallocTransaction(book); g_return_val_if_fail(trn, NULL); xaccTransBeginEdit(trn); ...
false
false
false
false
false
0
addbuf(ESL_SQFILE *sqfp, ESL_SQ *sq, int64_t nres) { ESL_DSQ x; ESL_SQASCII_DATA *ascii = &sqfp->data.ascii; if (sq->dsq != NULL) { while (nres) { x = sq->abc->inmap[(int) ascii->buf[ascii->bpos++]]; if (x <= 127) { nres--; sq->dsq[++sq->n] = x; } } /* we skipped IGNORED, EOL. E...
false
false
false
false
false
0
think_mobile_spy() { Unit* unitPtr = unit_array[spy_place_para]; //--- if the spy is on the ship, nothing can be done ---// if( !unitPtr->is_visible() ) return 0; //---- if the spy has stopped and there is no new action ----// if( unitPtr->is_ai_all_stop() && (!notify_cloaked_nation_flag || cloaked_nati...
false
false
false
false
false
0
orte_info_show_mca_group_params(const mca_base_var_group_t *group, bool want_internal) { const mca_base_var_t *var; const int *variables; int ret, i, j, count; const int *groups; char **strings; variables = OPAL_VALUE_ARRAY_GET_BASE(&group->group_vars, const int); count = opal_value_array_g...
false
false
false
false
false
0
Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { /* C::B begin */ #if defined (__WXMAC__) || wxCHECK_VERSION(2, 9, 0) style ...
false
false
false
false
false
0
cpl_column_absolute(cpl_column *column) { const char *fid = "cpl_column_absolute"; cpl_type type = cpl_column_get_type(column); cpl_size length; cpl_size nullcount; cpl_size i; if (column == 0x0) return cpl_error_set(fid, CPL_ERROR_NULL_INPUT); switch (type) { ca...
false
false
false
false
false
0
orinoco_process_scan_results(struct work_struct *work) { struct orinoco_private *priv = container_of(work, struct orinoco_private, process_scan); struct orinoco_scan_data *sd, *temp; unsigned long flags; void *buf; int len; int type; spin_lock_irqsave(&priv->scan_lock, flags); list_for_each_entry_safe(sd, te...
false
false
false
false
false
0
arg_to_string(const char *arg) { const char *start; int len; start = arg; len = 0; while (*start && *start == ' ') start++; if (!(*(start++) == '"')) return NULL; while (start[len] != '"') len++; return strndup(start, len); }
false
false
false
false
false
0
generate_css_style (GtkSourceStyleScheme *scheme) { GString *final_style; GtkSourceStyle *style, *style2; final_style = g_string_new (""); style = gtk_source_style_scheme_get_style (scheme, STYLE_TEXT); append_css_style (final_style, style, ""); style = gtk_source_style_scheme_get_style (scheme, STYLE_SELECTED...
false
false
false
false
false
0
ReportError(DieWhenReporting should_die, const char* format, ...) { char error_message[255]; va_list ap; va_start(ap, format); vsnprintf(error_message, sizeof(error_message), format, ap); va_end(ap); fprintf(stderr, "%s", error_message); fflush(stderr); // should be unnecessary, but cygwin's rxvt buffer...
false
false
false
false
false
0
Oct6100GetInstanceSize( tPOCT6100_CHIP_OPEN f_pChipOpen, tPOCT6100_GET_INSTANCE_SIZE f_pGetSize ) { tOCT6100_API_INSTANCE_SIZES InstanceSizes; UINT32 ulResult; /* Check user configuration for errors and conflicts. */ ulResult = Oct6100ApiCheckChipConfiguration( f_pChipOpen ); if ( ulResult != cOC...
false
false
false
false
false
0
embIepPkNewFile(AjPFile pkfile, double ***pK) { if(!*pK) *pK = embIepPkNew(); embIepPkReadFile(*pK, pkfile); /* read pK values */ return ajTrue; }
false
false
false
false
false
0
tda9875_checkit(struct CHIPSTATE *chip) { struct v4l2_subdev *sd = &chip->sd; int dic, rev; dic = chip_read2(chip, 254); rev = chip_read2(chip, 255); if (dic == 0 || dic == 2) { /* tda9875 and tda9875A */ v4l2_info(sd, "found tda9875%s rev. %d.\n", dic == 0 ? "" : "A", rev); return 1; } return 0; }
false
false
false
false
false
0
term_win_init(term_win *s, int w, int h) { int y; /* Make the window access arrays */ s->a = C_ZNEW(h, byte *); s->c = C_ZNEW(h, wchar_t *); /* Make the window content arrays */ s->va = C_ZNEW(h * w, byte); s->vc = C_ZNEW(h * w, wchar_t); /* Make the terrain access arrays */ s->ta = C_ZNEW(h, byte *); s->t...
false
false
false
false
false
0
encodePDS_MPIM_local_Extension_1(GRIBPACK *lGrib, long *zs, int *isec1) { // int isvn; long localextlen, i; long z = *zs; localextlen = getLocalExtLen(isec1); for ( i = 0; i < localextlen-6; i++ ) { Put1Byte(isec1[24+i]); } /* 6 bytes explicitly encoded below: ...
false
false
false
false
false
0
starfire_video_update(int scanline, int count) { UINT8 *pix = &starfire_videoram[scanline]; UINT8 *col = &starfire_colorram[scanline]; int x, y; /* update any dirty scanlines in this range */ for (x = 0; x < 256; x += 8) { for (y = 0; y < count; y++) if (scanline_dirty[scanline + y]) { in...
false
false
false
false
false
0
drag_drop (GtkWidget * widget, GdkDragContext * context, int x, int y, unsigned int time, ListModel * model) { g_signal_stop_emission_by_name (widget, "drag-drop"); bool_t success = TRUE; int row = calc_drop_row (model, widget, x, y); if (model->dragging && MODEL_HAS_CB (model, shift_rows)) /* draggi...
false
false
false
false
false
0
rescue(void) { rescuing = 1; if(dol > zero) { addr1 = zero+1; addr2 = dol; io = create("ed.hup", OWRITE, 0666); if(io > 0){ Binit(&iobuf, io, OWRITE); putfile(); } } fchange = 0; quit(); }
false
false
false
false
false
0
gtpfunc_reg_genmove(const std::string &str, size_t i, bool has_id, unsigned id) { i = skip_space(str, i); throw_syntax_error_if_end_of_line(str, i); int color; i = read_color(str, i, color); if (cur_game_info.is_game_play() && color == cur_game_info.get_player()) { random_off(); int pos = get_com...
false
false
false
false
false
0
CreateErrnoException(const Arguments& args) { HandleScope scope; int errorno = args[0]->Int32Value(); String::Utf8Value syscall(args[1]->ToString()); Local<Value> exception = ErrnoException(errorno, *syscall); return scope.Close(exception); }
false
false
false
false
false
0
run() { uint32 realCurrTime = 0; uint32 realPrevTime = WorldTimer::tick(); uint32 prevSleepTime = 0; // used for balanced full tick time length near WORLD_SLEEP_CONST ///- While we have not World::m_stopEvent, update the world while (!World::IsStopped()) { ...
false
false
false
false
false
0
unix_fstat(value fd) { int ret; struct stat buf; ret = fstat(Int_val(fd), &buf); if (ret == -1) uerror("fstat", Nothing); if (buf.st_size > Max_long && (buf.st_mode & S_IFMT) == S_IFREG) unix_error(EOVERFLOW, "fstat", Nothing); return stat_aux(0, &buf); }
false
false
false
false
false
0
get_right_estr(EXPSTR * dest, EXPSTR * src, size_t num) { if (num >= src->es_len) num = src->es_len - 1; return (get_mid_estr(dest, src, (src->es_len - num - 1), num)); }
false
false
false
false
false
0
update(RNG *rng) { for (unsigned int r = 0; r < _aux.size(); ++r) { _aux[r]->update(rng); } updateLM(rng); }
false
false
false
false
false
0
search_result_append(SearchData *sd, MatchFileData *mfd) { FileData *fd; GtkListStore *store; GtkTreeIter iter; gchar *text_size; gchar *text_dim = NULL; fd = mfd->fd; if (!fd) return; text_size = text_from_size(fd->size); if (mfd->width > 0 && mfd->height > 0) text_dim = g_strdup_printf("%d x %d", mfd->wid...
false
false
false
false
false
0
init_png_cmap(void) { unsigned int i; if (p_cmap_inited) return; p_cmap_inited = True; if (!cmap) return; p_cmap = (png_color *)XtMalloc(cmap_size * sizeof p_cmap[0]); for (i = 0 ; i < cmap_size ; i++) { p_cmap[i].red = cmap[i].r; p_cmap[i].green = cmap[i].g; p_cmap[i].blue = cmap[i]....
false
false
false
false
false
0
gwy_hmarker_box_draw_box(GwyMarkerBox *mbox) { GtkWidget *widget; GtkStateType state, gcstate; gint height, width; widget = GTK_WIDGET(mbox); state = GTK_WIDGET_STATE(widget); width = widget->allocation.width; height = widget->allocation.height; if (state == GTK_STATE_INSENSITIVE) ...
false
false
false
false
false
0
elants_i2c_query_fw_id(struct elants_data *ts) { struct i2c_client *client = ts->client; int error, retry_cnt; const u8 cmd[] = { CMD_HEADER_READ, E_ELAN_INFO_FW_ID, 0x00, 0x01 }; u8 resp[HEADER_SIZE]; for (retry_cnt = 0; retry_cnt < MAX_RETRIES; retry_cnt++) { error = elants_i2c_execute_command(client, cmd, si...
false
false
false
false
false
0
nautilus_icon_info_new_for_pixbuf (GdkPixbuf *pixbuf, gint scale) { NautilusIconInfo *icon; icon = g_object_new (NAUTILUS_TYPE_ICON_INFO, NULL); if (pixbuf) { icon->pixbuf = g_object_ref (pixbuf); } icon->orig_scale = scale; return icon; }
false
false
false
false
false
0
constAdditiveExpression() { INTEGER right, result ; result = constMultExpression() ; for (;;) { if (!newLineRead && match (PLUS)) { right = constMultExpression() ; result += right ; } else if (!newLineRead && match (MINUS)) { right = constMultExpression() ...
false
false
false
false
false
0
private_data_string(uint16_t private_data, char *str, int str_len) { if (str_len > 0) str[0] = '\0'; if (str_len < 55) { error("private_data_string: output buffer too small"); return; } if (private_data & PRIVATE_DATA_JOBS) strcat(str, "jobs"); //4 len if (private_data & PRIVATE_DATA_NODES) { if (str[0]...
false
true
false
false
false
1
verify(dst_key_t *key, dns_name_t *name, dns_rdataset_t *rdataset, dns_rdata_t *rdata, ns_client_t *client) { isc_result_t result; dns_fixedname_t fixed; isc_boolean_t ignore = ISC_FALSE; dns_fixedname_init(&fixed); again: result = dns_dnssec_verify3(name, rdataset, key, ignore, client->view->maxb...
false
false
false
false
false
0