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
iwl_dbgfs_bt_tx_prio_write(struct iwl_mvm *mvm, char *buf, size_t count, loff_t *ppos) { u32 bt_tx_prio; if (sscanf(buf, "%u", &bt_tx_prio) != 1) return -EINVAL; if (bt_tx_prio > 4) return -EINVAL; mvm->bt_tx_prio = bt_tx_prio; return count; }
false
false
false
false
false
0
read_pixel_shiftreg(offs_t offset) { if (state.config->to_shiftreg) state.config->to_shiftreg(offset, &state.shiftreg[0]); #if 0 else logerror("To ShiftReg function not set. PC = %08X\n", PC); #endif return state.shiftreg[0]; }
false
false
false
false
false
0
onDragEnabledChanged(WindowEventArgs& e) { fireEvent(EventDragEnabledChanged, e, EventNamespace); // abort current drag operation if dragging gets disabled part way through if (!d_draggingEnabled && d_dragging) { releaseInput(); } }
false
false
false
false
false
0
regcache_read(struct regmap *map, unsigned int reg, unsigned int *value) { int ret; if (map->cache_type == REGCACHE_NONE) return -ENOSYS; BUG_ON(!map->cache_ops); if (!regmap_volatile(map, reg)) { ret = map->cache_ops->read(map, reg, value); if (ret == 0) trace_regmap_reg_read_cache(map, reg, *valu...
false
false
false
false
false
0
_update_tags_string (FrogrPicture *self) { FrogrPicturePrivate *priv = FROGR_PICTURE_GET_PRIVATE (self); /* Reset previous tags string */ g_free (priv->tags_string); priv->tags_string = NULL; /* Set the tags_string value, if needed */ if (priv->tags_list != NULL) { GSList *item = NULL; gch...
false
false
false
false
false
0
ExtractChallenge(tChallenge *c, char *String) { char *s, *e, *Token, *Value; int len; memset(c, 0, sizeof(tChallenge)); Token = (char*) pal_malloc( pal_strlen(String)+1 ); Value = (char*) pal_malloc( pal_strlen(String)+1 ); *Token=*Value=0; for(s=e=String; ; e++) { if(*e== ',' || *e == '\r' || *e ...
false
true
true
false
false
1
raw_array(const redisReply *r, size_t *sz) { unsigned int i; char *ret, *p; /* compute size */ *sz = 0; *sz += 1 + integer_length(r->elements) + 2; for(i = 0; i < r->elements; ++i) { redisReply *e = r->element[i]; switch(e->type) { case REDIS_REPLY_STRING: *sz += 1 + integer_length(e->len) + 2 ...
false
false
false
false
false
0
conf_ok(GHashTable *table) { if (!table){ if (gcomprisBoard) pause_board(FALSE); return; } g_hash_table_foreach(table, (GHFunc) save_table, NULL); if (gcomprisBoard){ GHashTable *config; if (profile_conf) config = gc_db_get_board_conf(); else config = table; if (str...
false
false
false
false
false
0
mark_symbols_for_renaming (gimple stmt) { tree op; ssa_op_iter iter; update_stmt (stmt); /* Mark all the operands for renaming. */ FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_ALL_OPERANDS) if (DECL_P (op)) mark_sym_for_renaming (op); }
false
false
false
false
false
0
DumpMIDIMultiTrack ( MIDIMultiTrack *mlt ) { MIDIMultiTrackIterator i ( mlt ); const MIDITimedBigMessage *msg; i.GoToTime ( 0 ); do { int trk_num; if ( i.GetCurEvent ( &trk_num, &msg ) ) { fprintf ( stdout, "#%2d - ", trk_num ); DumpMIDITimedBigMessa...
false
false
false
false
false
0
insertmacro(cmdstr, count) char *cmdstr; int count; { if (macro >= NMACROS) error(); else if (*cmdstr != 0) { macro++; mcr[macro].mtext = cmdstr; /* point at the text */ mcr[macro].ip = cmdstr; /* starting index */ mcr[macro].m_iter = count; /* # times to do the macro */ } }
false
false
false
false
false
0
execmd_read_page_sector(struct mtd_info *mtd, int page_addr) { struct sh_flctl *flctl = mtd_to_flctl(mtd); int sector, page_sectors; enum flctl_ecc_res_t ecc_result; page_sectors = flctl->page_size ? 4 : 1; set_cmd_regs(mtd, NAND_CMD_READ0, (NAND_CMD_READSTART << 8) | NAND_CMD_READ0); writel(readl(FLCMNCR(fl...
false
false
false
false
false
0
SzReadArchiveProperties(CSzData *sd) { for (;;) { UInt64 type; RINOK(SzReadID(sd, &type)); if (type == k7zIdEnd) break; SzSkeepData(sd); } return SZ_OK; }
false
false
false
false
false
0
histogram_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button, HistogramToolState *state) { data_analysis_output_t *dao; analysis_tools_data_histogram_t *data; GtkWidget *w; data = g_new0 (analysis_tools_data_histogram_t, 1); dao = parse_output ((GenericToolState *)state, NULL); data->base.input = ...
false
false
false
false
false
0
g_vfs_http_input_stream_send (GInputStream *stream, GCancellable *cancellable, GError **error) { GVfsHttpInputStreamPrivate *priv; g_return_val_if_fail (G_VFS_IS_HTTP_INPUT_STREAM (stream), FALSE); priv = G_VFS_HTTP_INPUT_STREAM_GET_PRIVATE (stream); if (priv->stream) return TRUE...
false
false
false
false
false
0
process (GeglOperation *operation, GeglOperationContext *context, const gchar *output_pad, const GeglRectangle *result, gint level) { GeglBuffer *buffer = ensure_buffer (operation); if (buffer) { g_object_ref (buffer); /* Add an e...
false
false
false
false
false
0
ppd_file_callback(GtkWidget *widget, gpointer data) { const gchar *name = gtk_entry_get_text(GTK_ENTRY(widget)); if (name && pv && pv->v) { stp_parameter_t desc; stp_vars_t *v = stp_vars_create_copy(pv->v); stp_set_file_parameter(v, "PPDFile", name); stp_describe_parameter(v, "ModelName"...
false
false
false
false
false
0
init_dirty_segmap(struct f2fs_sb_info *sbi) { struct dirty_seglist_info *dirty_i = DIRTY_I(sbi); struct free_segmap_info *free_i = FREE_I(sbi); unsigned int segno = 0, offset = 0; unsigned short valid_blocks; while (1) { /* find dirty segment based on free segmap */ segno = find_next_inuse(free_i, MAIN_SEGS(s...
false
false
false
false
false
0
EndPrepare(GlobalTransaction gxact) { TransactionId xid = gxact->proc.xid; TwoPhaseFileHeader *hdr; char path[MAXPGPATH]; XLogRecData *record; pg_crc32 statefile_crc; pg_crc32 bogus_crc; int fd; /* Add the end sentinel to the list of 2PC records */ RegisterTwoPhaseRecord(TWOPHASE_RM_END_ID, 0, NUL...
false
false
false
false
false
0
remove_directory(string directory) { struct stat config_stat; struct dirent *entry; if(Utils::Io::check_directory(directory)) { if(directory.substr(directory.length()-1,1) != "/") directory += "/"; DIR *dir = opendir(directory.c_str()); if(!dir) return 0; else { wh...
false
false
false
false
false
0
__connman_service_set_config(struct connman_service *service, const char *file_id, const char *entry) { if (service == NULL) return; g_free(service->config_file); service->config_file = g_strdup(file_id); g_free(service->config_entry); service->config_entry = g_strdup(entry); }
false
false
false
false
false
0
Read(void *buffer) { short int * img_buffer = (short int *)buffer; IPLFileNameList::IteratorType it = m_FilenameList->begin(); IPLFileNameList::IteratorType itend = m_FilenameList->end(); for (; it != itend; it++ ) { std::string curfilename = ( *it )->GetImageFileName(); std::if...
false
false
false
false
false
0
xchdir(int fd) { if (((fd == 0) ? chdir("/") : fchdir(fd)) == -1) die1sys(1, "Could not change base directory"); }
false
false
false
false
false
0
parse_pcr(int64_t *ppcr_high, int *ppcr_low, const uint8_t *packet) { int afc, len, flags; const uint8_t *p; unsigned int v; afc = (packet[3] >> 4) & 3; if (afc <= 1) return -1; p = packet + 4; len = p[0]; p++; if (len == 0) return -1; flags ...
false
false
false
false
false
0
tag_image_read (VFSFile * handle, void * * data, int64_t * size) { tag_module_t * module = find_tag_module (handle, TAG_TYPE_NONE); if (module == NULL || module->read_image == NULL) return FALSE; return module->read_image (handle, data, size); }
false
false
false
false
false
0
testOBRotorListFixedBonds() { // 1 2 3 4 5 6 7 8 // C-C-C-C-C-C-C-C // 0 1 2 3 4 5 6 OBMolPtr mol = OBTestUtil::ReadFile("octane.cml"); // test with no bonds fixed OBRotorList rlist1; rlist1.Setup(*mol); OB_ASSERT(rlist1.Size() == 5); // test with bond 3 fixed OBBitVec fixedBonds; fixedBonds.Se...
false
false
false
false
false
0
pmc551_read(struct mtd_info *mtd, loff_t from, size_t len, size_t * retlen, u_char * buf) { struct mypriv *priv = mtd->priv; u32 soff_hi, soff_lo; /* start address offset hi/lo */ u32 eoff_hi, eoff_lo; /* end address offset hi/lo */ unsigned long end; u_char *ptr; u_char *copyto = buf; #ifdef CONFIG_MTD_PMC55...
false
false
false
false
false
0
AssignChannel(gboolean (*server_function)(GIOChannel *,GIOCondition,void *)) { if(my_socket->getSocket() > 0) { GIOChannel *channel = g_io_channel_unix_new(my_socket->getSocket()); GIOCondition condition = (GIOCondition)(G_IO_IN | G_IO_HUP | G_IO_ERR); #if GLIB_MAJOR_VERSION >= 2 GError *err = NULL; ...
false
false
false
false
false
0
start_caching(struct btrfs_root *root) { struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; struct task_struct *tsk; int ret; u64 objectid; if (!btrfs_test_opt(root, INODE_MAP_CACHE)) return; spin_lock(&root->ino_cache_lock); if (root->ino_cache_state != BTRFS_CACHE_NO) { spin_unlock(&root->ino_cache_l...
false
false
false
false
false
0
get_cmd(char *prompt, char *allowed, char def) { char result = 0; char got_key; uint32_t index; set_canon(0); while ( result == 0 ) { printf("%s (%c)?", prompt, def); got_key = read_key(); printf("\n"); if (got_key == ENTER_KEY) { result = def; } else { for (index = 0; index < strlen(allowed); inde...
false
false
false
false
false
0
RehashCatCache(CatCache *cp) { dlist_head *newbucket; int newnbuckets; int i; elog(DEBUG1, "rehashing catalog cache id %d for %s; %d tups, %d buckets", cp->id, cp->cc_relname, cp->cc_ntup, cp->cc_nbuckets); /* Allocate a new, larger, hash table. */ newnbuckets = cp->cc_nbuckets * 2; newbucket = (dlist_h...
false
false
false
false
false
0
p_create_or_replace_orig_and_opre_layer (GapStbAttrWidget *attw , gint img_idx , gint32 duration) { gint32 l_framenr_start; gint32 l_framenr; gint32 l_prefetch_framenr; GapStorySection *section; section = gap_story_find_section_by_stb_ele...
false
false
false
false
false
0
putpwent (p, stream) const struct passwd *p; FILE *stream; { if (p == NULL || stream == NULL) { __set_errno (EINVAL); return -1; } if (p->pw_name[0] == '+' || p->pw_name[0] == '-') { if (fprintf (stream, "%s:%s:::%s:%s:%s\n", p->pw_name, _S (p->pw_passwd), _S (p->p...
false
false
false
false
false
0
ap_php_conv_10(register wide_int num, register bool_int is_unsigned, register bool_int * is_negative, char *buf_end, register int *len) { register char *p = buf_end; register u_wide_int magnitude; if (is_unsigned) { magnitude = (u_wide_int) num; *is_negative = FALSE; } else { *is_negative = (num < 0); ...
false
false
false
false
false
0
init(Processor *new_cpu) { _address = _opcode = _state = 0; hll_mode = ASM_MODE; // add the 'main' pma to the list pma context's. Processors may // choose to add multiple pma's to the context list. The gui // will build a source browser for each one of these. The purpose // is to provide more than one way...
false
false
false
false
false
0
CreateCircle(bool filled) { int circleRes = 16; vtkIdType ptIds[17]; double x[3], theta; // Allocate storage vtkPolyData *poly = vtkPolyData::New(); VTK_CREATE(vtkPoints,pts); VTK_CREATE(vtkCellArray, circle); VTK_CREATE(vtkCellArray, outline); // generate points around the circle x[2] = 0.0; ...
false
false
false
false
false
0
programmer_echo(int port, char ch) { unsigned char command; command = 2; write(port,&command,1); write(port,&ch,1); read(port,&command,1); if( command != ch ) { printf("DEBUG: Bad echo: %c != %c\n", command, ch); return -1; } return 0; }
false
true
false
false
true
1
GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj **objv, CONST char *opts[], int type, int create, int *optPtr, void **addrPtr) { int opt; void *addr; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return 0; } if (Tcl_GetIndexFromObj(interp, objv[1], opts, "...
false
false
false
false
false
0
dot_pg_pass_warning(PGconn *conn) { /* If it was 'invalid authorization', add .pgpass mention */ if (conn->dot_pgpass_used && conn->password_needed && conn->result && /* only works with >= 9.0 servers */ strcmp(PQresultErrorField(conn->result, PG_DIAG_SQLSTATE), ERRCODE_INVALID_PASSWORD) == 0) { char pgp...
false
false
false
false
false
0
_struct_new (PyObject *kw) { StructObject * const that = PyObject_New (StructObject, (PyTypeObject *) &StructType); g_assert (that != NULL && kw != NULL); that->dict = kw; that->repr = NULL; return (PyObject *) that; }
false
false
false
false
false
0
resolveArrayLength(Expression *e) { if (e->op == TOKnull) return 0; if (e->op == TOKslice) { uinteger_t ilo = ((SliceExp *)e)->lwr->toInteger(); uinteger_t iup = ((SliceExp *)e)->upr->toInteger(); return iup - ilo; } if (e->op == TOKstring) { return ((StringExp *)e)->...
false
false
false
false
false
0
auxgetinfo(lua_State*L,const char*what,lua_Debug*ar, Closure*f,CallInfo*ci){ int status=1; if(f==NULL){ info_tailcall(ar); return status; } for(;*what;what++){ switch(*what){ case'S':{ funcinfo(ar,f); break; } case'l':{ ar->currentline=(ci)?currentline(L,ci):-1; break; } case'u':{ ar->nups=f->c.nupvalues; break; } case...
false
false
false
false
false
0
radeon_atif_get_sbios_requests(acpi_handle handle, struct atif_sbios_requests *req) { union acpi_object *info; size_t size; int count = 0; info = radeon_atif_call(handle, ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS, NULL); if (!info) return -EIO; size = *(u16 *)info->buffer.pointer; if (size < 0xd) { count = ...
false
false
false
false
false
0
sgmlExtensionHtmlElementBegin(SGML_PARSER *parser, void *userContext, const char *elementName) { SGML_EXTENSION_HTML *ext = (SGML_EXTENSION_HTML *)userContext; DOM_ELEMENT *element = domElementNew(elementName); int x = 0, match = 0; if (ext->flags & SGML_EXTENSION_HTML_FLAG_STRIPELEMENT) return; if (ext->fla...
false
false
false
false
false
0
dessert_cli_get_cfg(int argc, char** argv) { FILE* cfg; const char* path_head = "/etc/"; const char* path_tail = ".conf"; char* str = alloca(strlen(argv[0])+1); strcpy(str, argv[0]); char* ptr = strtok(str, "/"); char* daemon = ptr; while (ptr != NULL) { daemon = ptr; ptr = strtok(NULL, "/"); } if (arg...
false
true
false
false
true
1
c_common_pch_pragma (cpp_reader *pfile, const char *name) { int fd; if (!cpp_get_options (pfile)->preprocessed) { error ("pch_preprocess pragma should only be used with -fpreprocessed"); inform (input_location, "use #include instead"); return; } fd = open (name, O_RDONLY | O_BINARY, 06...
false
false
false
false
false
0
do_fw4_ack(struct cxgbi_device *cdev, struct sk_buff *skb) { struct cxgbi_sock *csk; struct cpl_fw4_ack *rpl = (struct cpl_fw4_ack *)skb->data; unsigned int tid = GET_TID(rpl); struct cxgb4_lld_info *lldi = cxgbi_cdev_priv(cdev); struct tid_info *t = lldi->tids; csk = lookup_tid(t, tid); if (unlikely(!csk)) p...
false
false
false
false
false
0
calculate_xml_digest_v2(xmlNode * source, gboolean do_filter) { char *digest = NULL; char *buffer = NULL; int offset, max; static struct qb_log_callsite *digest_cs = NULL; crm_trace("Begin digest %s", do_filter?"filtered":""); if (do_filter && BEST_EFFORT_STATUS) { /* Exclude the statu...
false
false
false
false
false
0
configure(Vector<String> &conf, ErrorHandler *errh) { if (conf.size() != noutputs()) return errh->error("need %d arguments, one per output port", noutputs()); // leverage IPFilter's parsing Vector<String> new_conf; for (int i = 0; i < conf.size(); i++) new_conf.push_back(String(i) + " " + conf[i]); re...
false
false
false
false
false
0
gt_region_mapping_get_sequence_length(GtRegionMapping *rm, unsigned long *length, GtStr *seqid, GtError *err) { int had_err; unsigned long filenum, seqnum, GT_UNUSED offset; gt_error_check(err); GT_UNUSED GtRange range; gt_ass...
false
false
false
false
false
0
_parse_accessible_playlists(JNIEnv* env, BITBUFFER* buf) { // skip length specifier bb_seek(buf, 32, SEEK_CUR); int count = bb_read(buf, 11); jobjectArray playlists = bdj_make_array(env, "java/lang/String", count); jboolean access_to_all_flag = bb_read(buf, 1); jboolean autostart_first_playlis...
true
true
false
false
false
1
WriteBytes(int nBytesToWrite, GByte *pabySrcBuf) { if (m_eAccess == TABWrite && m_poBlockManagerRef && (m_nBlockSize - m_nCurPos) < nBytesToWrite) { int nNewBlockOffset = m_poBlockManagerRef->AllocNewBlock(); SetNextToolBlock(nNewBlockOffset); if (CommitToFile() != 0 || ...
false
false
false
false
false
0
matcher(UText *input, PatternIsUTextFlag /*flag*/, UErrorCode &status) const { RegexMatcher *retMatcher = matcher(status); if (retMatcher != NULL) { retMatcher->fDeferredStatus = status; retMatche...
false
false
false
false
false
0
selectAllWires(ViewGeometry::WireFlag flag) { int boardCount; ItemBase * board = findSelectedBoard(boardCount); if (boardCount == 0 && autorouteTypePCB()) { QMessageBox::critical(this, tr("Fritzing"), tr("Your sketch does not have a board yet! Please add a PCB in order to use t...
false
false
false
false
false
0
DecodePredicateOperand(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder) { if (Val == 0xF) return MCDisassembler::Fail; // AL predicate is not allowed on Thumb1 branches. if (Inst.getOpcode() == ARM::tBcc && Val == 0xE) return MCDisassembler::Fail; Inst.addOpe...
false
false
false
false
false
0
xmalloc_freelist_grab(struct xfreelist *fl, void *block, size_t length, bool split, size_t *allocated) { size_t blksize = fl->blocksize; size_t len = length; void *p = block; g_assert(blksize >= len); xfl_remove_selected(fl, block); /* * If the block is larger than the size we requested, the remainder * i...
false
false
false
false
false
0
lsr_read_sync_tolerance(GF_LASeRCodec *lsr, GF_Node *n) { u32 flag; GF_LSR_READ_INT(lsr, flag, 1, "syncTolerance"); if (flag) { GF_FieldInfo info; GF_LSR_READ_INT(lsr, flag, 1, "syncTolerance"); lsr->last_error = gf_node_get_attribute_by_tag(n, TAG_SVG_ATT_syncTolerance, 1, 0, &info); if (flag) ((SMIL_SyncTo...
false
false
false
false
false
0
mgslpc_put_char(struct tty_struct *tty, unsigned char ch) { MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; unsigned long flags; if (debug_level >= DEBUG_LEVEL_INFO) { printk("%s(%d):mgslpc_put_char(%d) on %s\n", __FILE__, __LINE__, ch, info->device_name); } if (mgslpc_paranoia_check(info, tty->name, "...
false
false
false
false
false
0
event_master_add_timer (struct event_master *em, EventCallback func, void *arg, long sec) { struct timeval tv_now; struct event *e, *f; e = event_master_event_get (em, EVENT_TYPE_TIMER, func, arg); if (e == NULL) return NULL; gettimeofday (&tv_now, NULL); tv_now.tv_sec += sec; ...
false
false
false
false
false
0
job_mark_check(const std::string &fname) { struct stat st; if(lstat(fname.c_str(),&st) != 0) return false; if(!S_ISREG(st.st_mode)) return false; return true; }
false
false
false
false
false
0
php_skip_variable(php_stream * stream TSRMLS_DC) { off_t length = ((unsigned int)php_read2(stream TSRMLS_CC)); if (length < 2) { return 0; } length = length - 2; php_stream_seek(stream, (long)length, SEEK_CUR); return 1; }
false
false
false
false
false
0
PyFFFont_CreateUnicodeChar(PyObject *self, PyObject *args) { int uni, enc; char *name=NULL; FontViewBase *fv = ((PyFF_Font *) self)->fv; SplineChar *sc; if ( !PyArg_ParseTuple(args,"i|s", &uni, &name ) ) return( NULL ); if ( uni<-1 || uni>=unicode4_size ) { PyErr_Format(PyExc_ValueError, "Unic...
false
false
false
false
false
0
globus_l_gram_tokenize(char * command, char ** args, int * n) { int i, x; char * cp; char * cp2; char ** arg; char * tmp_str = NULL; arg = args; i = *n - 1; for (cp = strtok(command, " \t\n"); cp != 0; ) { if ( cp[0] == '\'' && cp[strlen(cp) - 1] != '\'' ) { cp2 = strtok(NULL, "...
false
true
false
false
false
1
updateStatisticsMove(const moverecord * pmr, matchstate * pms, const listOLD * plGame, statcontext * psc) { FixMatchState(pms, pmr); switch (pmr->mt) { case MOVE_GAMEINFO: IniStatcontext(psc); updateStatcontext(psc, pmr, pms, plGame); break; case MOVE_NORMAL: if (pmr->f...
false
false
false
false
false
0
gtk_tree_view_focus(GtkTreeView *view) { GtkTreeModel *model; GtkTreePath *path; GtkTreeIter iter; if ((model = gtk_tree_view_get_model(view)) && gtk_tree_model_get_iter_first(model, &iter) && (path = gtk_tree_model_get_path(model, &iter))) { gtk_tree_view_set_cursor(view, path, NULL, FALSE); ...
false
false
false
false
false
0
checkEnvironment(cchar *program) { #if BLD_UNIX_LIKE char *home; home = mprGetCurrentPath(); if (unixSecurityChecks(program, home) < 0) { return -1; } app->pathVar = sjoin("PATH=", getenv("PATH"), ":", mprGetAppDir(), NULL); putenv(app->pathVar); #endif return 0; }
false
false
false
false
true
1
find_png_eoi(unsigned char *buffer, const size_t len) { unsigned char *end_data, *data, chunk_code[PNG_CODE_LEN + 1]; struct png_chunk chunk; u_int32_t datalen; /* Move past the PNG header */ data = (buffer + PNG_SIG_LEN); end_data = (buffer + len - (sizeof(struct png_chunk) + PNG_CRC_LEN)); ...
false
false
false
false
false
0
cb_func_document_action(guint key_id) { GeanyDocument *doc = document_get_current(); if (doc == NULL) return TRUE; switch (key_id) { case GEANY_KEYS_DOCUMENT_REPLACETABS: on_replace_tabs_activate(NULL, NULL); break; case GEANY_KEYS_DOCUMENT_REPLACESPACES: on_replace_spaces_activate(NULL, NULL); ...
false
false
false
false
false
0
log_time(uint32 process_utime) { pticks++; if (++psaveind >= PBUFLEN) psaveind = 0; process_utime_save[psaveind] = process_utime; if (process_utime > process_max_utime) process_max_utime = process_utime; if (process_utime < process_min_utime) process_min_utime = process_utime...
false
false
false
false
false
0
initial_integrate(int vflag) { double dtfm; // update v and x of atoms in group double **x = atom->x; double **v = atom->v; double **f = atom->f; double *rmass = atom->rmass; double *mass = atom->mass; int *type = atom->type; int *mask = atom->mask; int nlocal = atom->nlocal; if (igroup == atom-...
false
false
false
false
false
0
genie_exp_complex (NODE_T * p) { A68_REAL *re, *im; double r; im = (A68_REAL *) (STACK_OFFSET (-ALIGNED_SIZE_OF (A68_REAL))); re = (A68_REAL *) (STACK_OFFSET (-2 * ALIGNED_SIZE_OF (A68_REAL))); RESET_ERRNO; r = exp (VALUE (re)); VALUE (re) = r * cos (VALUE (im)); VALUE (im) = r * sin (VALUE (im)); MAT...
false
false
false
false
false
0
_mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v ) { GET_CURRENT_CONTEXT(ctx); struct gl_1d_map *map1d; struct gl_2d_map *map2d; GLuint i, n; GLfloat *data; GLuint comps; GLsizei numBytes; comps = _mesa_evaluator_components(target); if (!comps) { _mesa_error( ...
false
false
false
false
false
0
OptimizeBlock(BasicBlock &BB) { SunkAddrs.clear(); bool MadeChange = false; CurInstIterator = BB.begin(); for (BasicBlock::iterator E = BB.end(); CurInstIterator != E; ) MadeChange |= OptimizeInst(CurInstIterator++); return MadeChange; }
false
false
false
false
false
0
RenderTranslucentPolygonalGeometry(vtkViewport* viewport) { vtkDebugMacro(<< "vtkImageStack::RenderTranslucentPolygonalGeometry"); if (!this->IsIdentity) { this->PokeMatrices(this->GetMatrix()); } int rendered = 0; vtkImageSlice *image = 0; vtkCollectionSimpleIterator pit; vtkIdType n = 0; t...
false
false
false
false
false
0
substituteRegister(unsigned FromReg, unsigned ToReg, unsigned SubIdx, const TargetRegisterInfo &RegInfo) { if (TargetRegisterInfo::isPhysicalRegister(ToReg)) { if (SubIdx) ToReg = RegInfo.getSub...
false
false
false
false
false
0
dce_v8_0_encoder_disable(struct drm_encoder *encoder) { struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig; amdgpu_atombios_encoder_dpms(encoder, DRM_MODE_DPMS_OFF); if (amdgpu_atombios_encoder_is_digital(encoder)) { if (amdgpu_atombios_encoder_get_encoder_mo...
false
false
false
false
false
0
gst_raw_parse_convert (GstRawParse * rp, GstFormat src_format, gint64 src_value, GstFormat dest_format, gint64 * dest_value) { gboolean ret = FALSE; GST_DEBUG ("converting value %" G_GINT64_FORMAT " from %s (%d) to %s (%d)", src_value, gst_format_get_name (src_format), src_format, gst_format_ge...
false
false
false
false
false
0
set_smark_cb(AW_window *aw, AW_CL cd1, AW_CL cd2){ AED_window *aedw = (AED_window *)cd1; GB_transaction dummy(GLOBAL_gb_main); AED_area_entry *ae = aedw->selected_area_entry; if (!ae) return; GBDATA *gbd = ae->ad_species->get_GBDATA(); if (!gbd) return; GB_write_flag( gbd, cd2 ); aedw->expo...
false
false
false
false
false
0
either_nan_p(ScmObj arg0, ScmObj arg1) { if (SCM_FLONUMP(arg0) && SCM_IS_NAN(SCM_FLONUM_VALUE(arg0))) return TRUE; if (SCM_FLONUMP(arg1) && SCM_IS_NAN(SCM_FLONUM_VALUE(arg1))) return TRUE; return FALSE; }
false
false
false
false
false
0
ConnectPlease(struct connectdata *conn, struct Curl_dns_entry *hostaddr, bool *connected) { CURLcode result; Curl_addrinfo *addr; struct SessionHandle *data = conn->data; char *hostname = data->change.proxy?conn->proxy.name:conn->host.name; infof(da...
false
false
false
false
false
0
search(AWT_species_set *set,long *best_co){ AWT_species_set *result = 0; long i; long best_cost = 0x7fffffff; unsigned char *sbs = set->bitstring; for (i=nsets-1;i>=0;i--){ long j; long sum = 0; unsigned char *rsb = sets[i]->bitstring; for (j=nspecies/8 -1 + 1; j>=0;j...
false
false
false
false
false
0
enumDeclaration(Node *n) { if (!ImportMode) { emit_children(n); } return SWIG_OK; }
false
false
false
false
false
0
xml_sax_orientation (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob) { XMLSaxParseState *state = (XMLSaxParseState *)xin->user_state; PrintInformation *pi; GtkPageOrientation orient = GTK_PAGE_ORIENTATION_PORTRAIT; xml_sax_must_have_sheet (state); pi = state->sheet->print_info; #warning TODO: we should also hand...
false
false
false
false
false
0
kdb2_firstkey() { datum item; if (__cur_db == NULL) { no_open_db(); item.dptr = 0; item.dsize = 0; return (item); } return (kdb2_dbm_firstkey(__cur_db)); }
false
false
false
false
false
0
PK11_GetAllSlotsForCert(CERTCertificate *cert, void *arg) { nssCryptokiObject **ip; PK11SlotList *slotList; NSSCertificate *c; nssCryptokiObject **instances; PRBool found = PR_FALSE; if (!cert) { PORT_SetError(SEC_ERROR_INVALID_ARGS); return NULL; } c = STAN_GetNSSCertificate(cert); ...
false
false
false
false
false
0
o_isptr(void) { VALUE *vp; long r; vp = stack; if (vp->v_type == V_ADDR) vp = vp->v_addr; r = 0; switch(vp->v_type) { case V_OPTR: r = 1; break; case V_VPTR: r = 2; break; case V_SPTR: r = 3; break; case V_NPTR: r = 4; break; } freevalue(stack); stack->v_num = itoq(r); stack->v_type = V_NUM; stack->v_...
false
false
false
false
false
0
folder_set_message_user_tag (CamelFolder *folder, const gchar *uid, const gchar *name, const gchar *value) { CamelMessageInfo *info; g_return_if_fail (folder->summary != NULL); info = camel_folder_summary_get (folder->summary, u...
false
false
false
false
false
0
profile_get_string(profile_t profile, const char *name, const char *subname, const char *subsubname, const char *def_val, char **ret_string) { const char *value; long retval; if (profile) { retval = profile_get_value(profile, name, subname, subsubname, &value); if (retval == PROF_NO_SECTION ||...
false
false
false
false
false
0
showEvent(QShowEvent* event) { QFontMetrics metrics(m_symbol_preview_item->font()); float size = metrics.height() * 1.5f; m_symbol_preview->fitInView(0, 0, size, size); m_view->setFocus(); QDialog::showEvent(event); }
false
false
false
false
false
0
ConvertedString(w, encoding, format, length, string) Widget w; Atom *encoding; int *format; int *length; XtPointer *string; { CannaObject obj = (CannaObject)w; iBuf *ib = obj->canna.ibuf; wchar *wbuf, *wp; int len, wlen; extern int convJWStoCT(); int offset = ib->offset; if (ib == NULL) ret...
false
false
false
false
false
0
find(int symid) { if (symid==-1) return nil; ALIterator i; for (First(i); !Done(i); Next(i)) { Attribute* attr = GetAttr(i); if (attr->SymbolId() == symid) { return attr->Value(); } } return nil; }
false
false
false
false
false
0
dibusb2_0_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) { u8 b[3] = { 0 }; int ret; if ((ret = dibusb_streaming_ctrl(adap,onoff)) < 0) return ret; if (onoff) { b[0] = DIBUSB_REQ_SET_STREAMING_MODE; b[1] = 0x00; if ((ret = dvb_usb_generic_write(adap->dev,b,2)) < 0) return ret; } b[0] = DIBU...
false
false
false
false
false
0
print_node(const xmlNode * root, int depth) { xmlNode *node; for (node = root; node; node = node->next) { int i; if (node->type != XML_ELEMENT_NODE) continue; for (i = 0; i < depth; i++) printf(" "); printf("%s\n", node->name); print_node(node->chi...
false
false
false
false
false
0
dane_int_within_range(const char* arg, int max, const char* name) { char* endptr; /* utility var for strtol usage */ int val = strtol(arg, &endptr, 10); if ((val < 0 || val > max) || (errno != 0 && val == 0) /* out of range */ || endptr == arg /* no digits */ || *endptr != '\0' /* more ...
false
false
false
false
false
0
IsTokenAcceptable(int token, int parent_token) { if (token == TokenEnumerator::kNoSecurityToken || token == security_token_id_) return true; if (token == TokenEnumerator::kInheritsSecurityToken) { ASSERT(parent_token != TokenEnumerator::kInheritsSecurityToken); return parent_token == TokenEn...
false
false
false
false
false
0
_xdg_mime_magic_matchlet_compare_level(XdgMimeMagicMatchlet *matchlet, const void *data, size_t len, int indent) { while ((matchlet != NULL) && (matchlet->i...
false
false
false
false
false
0
is_primary_selection(ED4_terminal *object ) { ED4_list_elem *tmp_elem; ED4_selection_entry *tmp_entry; tmp_elem = ( ED4_list_elem *) selected_objects.last(); if (!tmp_elem) return 0; tmp_entry = ( ED4_selection_entry *) tmp_elem->elem(); return (tmp_entry != NULL) && (tmp_entry->object...
false
false
false
false
false
0
escape_str (const gchar *str) { GString *s; guint n; s = g_string_new (NULL); if (str == NULL) goto out; for (n = 0; str[n] != '\0'; n++) { guint c = str[n] & 0xff; if (g_ascii_isalnum (c) || c=='_') g_string_append_c (s, c); else g_string_append_printf (s, "\\%o",...
false
false
false
false
false
0
free_channel(aChannel *chptr) { Reg Link *tmp; Link *obtmp; int len = sizeof(aChannel) + strlen(chptr->chname), now = 0; if (chptr->history == 0 || timeofday >= chptr->history) /* no lock, nor expired lock, channel is no more, free it */ now = 1; if (*chptr->chname != '!' || now) { while ((tmp ...
false
false
false
false
false
0
if_indextoname(unsigned int interface,char* blub) { struct ifreq ifr; int fd; fd=socket(AF_INET6,SOCK_DGRAM,0); if (fd<0) fd=socket(AF_INET,SOCK_DGRAM,0); ifr.ifr_ifindex=interface; if (ioctl(fd,SIOCGIFNAME,&ifr)==0) { int i; close(fd); for (i=0; i<IFNAMSIZ-1; i++) if (!(blub[i]=ifr.ifr_n...
false
false
false
false
false
0