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
set_alias (cmd_parms *cmd, void *mconfig, const char *alias) { per_dir_config *config = mconfig; module_cfg *sconfig; sconfig = ap_get_module_config (cmd->server->module_config, &mono_module); config->alias = (char *) alias; if (search_for_alias (alias, sconfig) == -1) { char *err = apr_pstrcat (cmd->pool, "Ser...
false
false
false
false
false
0
pg_wchar2mule_with_len(const pg_wchar *from, unsigned char *to, int len) { int cnt = 0; while (len > 0 && *from) { unsigned char lb; lb = (*from >> 16) & 0xff; if (IS_LC1(lb)) { *to++ = lb; *to++ = *from & 0xff; cnt += 2; } else if (IS_LC2(lb)) { *to++ = lb; *to++ = (*from >> 8) & 0x...
false
false
false
false
false
0
_sel_desk_gen_cb(void *data) { E_Config_Dialog_Data *cfdata = data; const char *s = e_widget_ilist_selected_value_get(cfdata->obj.mimelist); if ((s) && (cfdata->selmime)) { if (cfdata->ini) efreet_ini_string_set(cfdata->ini, cfdata->selmime, s); } }
false
false
false
false
false
0
_job_dealloc(void *job_gres_data, void *node_gres_data, int node_offset, char *gres_name, uint32_t job_id, char *node_name) { int i, len, gres_cnt; gres_job_state_t *job_gres_ptr = (gres_job_state_t *) job_gres_data; gres_node_state_t *node_gres_ptr = (gres_node_state_t *) node_gres_data; /* * Validate ...
false
false
false
false
false
0
nvme_free_iod(struct nvme_dev *dev, struct request *req) { struct nvme_iod *iod = blk_mq_rq_to_pdu(req); const int last_prp = dev->ctrl.page_size / 8 - 1; int i; __le64 **list = iod_list(req); dma_addr_t prp_dma = iod->first_dma; if (iod->npages == 0) dma_pool_free(dev->prp_small_pool, list[0], prp_dma); for ...
false
false
false
false
false
0
memory_clear(PyMemoryViewObject *self) { (void)_memory_release(self); Py_CLEAR(self->mbuf); return 0; }
false
false
false
false
false
0
row_raw_format_str( /*===============*/ const char* data, /*!< in: raw data */ ulint data_len, /*!< in: raw data length in bytes */ ulint prtype, /*!< in: precise type */ char* buf, /*!< out: output buffer */ ulint buf_size, /*!< in: output buffer size in bytes */ ibool* format_in_hex) /*!< out:...
false
false
false
false
false
0
p7_trace_GetExpectedAccuracy(const P7_TRACE *tr) { float accuracy = 0.0; int z; for (z = 0; z < tr->N; z++) accuracy += tr->pp[z]; return accuracy; }
false
false
false
false
false
0
_list_formats(struct lib_context *lc, enum fmt_type type) { struct format_list *fmt_list; list_for_each_entry(fmt_list, LC_FMT(lc), list) { if (type == fmt_list->fmt->format) log_format(lc, fmt_list->fmt); } }
false
false
false
false
false
0
crmf_copy_name(CERTName *destName, CERTName *srcName) { PLArenaPool *poolp = NULL; SECStatus rv; if (destName->arena != NULL) { poolp = destName->arena; } else { poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE); } if (poolp == NULL) { return SECFailure; } /* Need to do this so that CERT_CopyN...
false
false
false
false
false
0
M192CW(uint32 A, uint8 V) { //Ying Lie Qun Xia Zhuan (Chinese), //You Ling Xing Dong (China) (Unl) [this will be mistakenly headered as m074 sometimes] if ((V == 8) || (V == 9) || (V == 0xA) || (V == 0xB)) setchr1r(0x10, A, V); else setchr1r(0, A, V); }
false
false
false
false
false
0
parse_crashkernel_simple(char *cmdline, unsigned long long *crash_size, unsigned long long *crash_base) { char *cur = cmdline; *crash_size = memparse(cmdline, &cur); if (cmdline == cur) { pr_warn("crashkernel: memory value expected\n"); return -EINVAL; } if (*cur == '@') *crash_base = mempa...
false
false
false
false
false
0
brasero_data_project_file_renamed (BraseroFileMonitor *monitor, BraseroFileMonitorType type, gpointer callback_data, const gchar *old_name, const gchar *new_name) { BraseroFileNode *sibling; BraseroFileNode *node; /* If old_name is NULL then it means the event is against callback. * Ot...
false
false
false
false
false
0
adjust(signed deviation, int device) { signed fd = open("/dev/mixer", O_RDONLY | O_NONBLOCK), volume; if(fd == -1) { fprintf(stderr, "Can't open mixer device. %s.\n", strerror(errno)); return -1; } else { /* Read volume. */ ioctl(fd, MIXER_READ(device), & volume); volume += deviation; if(volume < 0...
false
false
false
false
false
0
nodeForIndex(const QModelIndex &index) const { return m_model->nodeForIndex(mapToSource(index)); }
false
false
false
false
false
0
set_cancel_request() { cancel_request = true; // set process time to now so it is picked up straight away set_process_time(0); mark_modification(); }
false
false
false
false
false
0
pathlist(const char *pattern, const char *dbpath) { GFIND *gp; CONVERT *cv; const char *path, *p; regex_t preg; int count; int target = GPATH_SOURCE; if (oflag) target = GPATH_BOTH; if (Oflag) target = GPATH_OTHER; if (pattern) { int flags = 0; char edit[IDENTLEN+1]; if (!Gflag) flags |= REG_EXT...
true
true
false
false
false
1
set_drag_cursor (GtkWidget *widget) { if (widget->window) { GdkCursor *cursor; GdkPixbuf *pixbuf; pixbuf = gdk_pixbuf_new_from_file (UIDIR G_DIR_SEPARATOR_S "hand-open.png", NULL); cursor = gdk_cursor_new_from_pixbuf (gdk_display_get_default (), pixbuf, 12, 12); gdk_window_s...
false
false
false
false
false
0
set_loop_opts (LOOPSET *loop, gretlopt opt) { if (opt & OPT_P) { loop_set_progressive(loop); } if (opt & OPT_V) { loop_set_verbose(loop); } if (opt & OPT_Q) { loop_set_quiet(loop); } }
false
false
false
false
false
0
skipCmdLine(const char * cmd, size_t len) { const char * separator = cmdlineSeparator(cmd, len); if (separator == NULL) { return len; } else { return separator + 1 - cmd; } }
false
false
false
false
false
0
do_pwrite_device (const char *device, const char *content, size_t size, int64_t offset) { if (offset < 0) { reply_with_error ("offset is negative"); return -1; } int fd = open (device, O_WRONLY|O_CLOEXEC); if (fd == -1) { reply_with_perror ("open: %s", device); return -1; } ...
false
false
false
false
true
1
fc_read(struct file *f, char __user *buf, size_t count, loff_t *offp) { struct fmc_device *fmc = f->private_data; unsigned long addr; uint32_t val; if (count < sizeof(val)) return -EINVAL; count = sizeof(val); addr = *offp; if (addr > fmc->memlen) return -ESPIPE; /* Illegal seek */ val = fmc_read...
false
false
false
false
false
0
evrpc_register_object(const char *name, void *(*req_new)(void*), void *req_new_arg, void (*req_free)(void *), int (*req_unmarshal)(void *, struct evbuffer *), void *(*rpl_new)(void*), void *rpl_new_arg, void (*rpl_free)(void *), int (*rpl_complete)(void *), void (*rpl_marshal)(struct evbuffer *, voi...
false
false
false
false
false
0
insert_dc32(const char *name, int32_t *data, int len, uint8_t len_type, const char *dc32) { int n; // FIXME: For dc32, the len_type should be dc32 always. if (len_type == TYPE_SHORT) { fprintf(out, " dw %d ; %s.length\n", len, name); } else if (len_type == TYPE_INT) { fprintf(out, " %s %d...
false
false
false
false
false
0
fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end) { unsigned int name_len, val_len; while (p < end) { name_len = *p++; if (UNEXPECTED(name_len >= 128)) { if (UNEXPECTED(p + 3 >= end)) return 0; name_len = ((name_len & 0x7f) << 24); name_len |= (*p++ << 16); name_len |= (*p++ <<...
false
false
false
false
false
0
add_tokf(char* pp1,int n,TOKENS tok, int* ntok, char* outbuff, int tj) { char* token_start; // for(vi=1;vi<=*ntok;vi++) printf("(add_tokf) tok[%d]=%s\n",vi,tok[vi]); (*ntok)++; // tok[*ntok] = outbuff; // // save the starting position // token_start = outbuff; // printf("tok=%u outbuf=%u\n",tok,outbuff); // for(v...
false
false
false
false
false
0
ters_bij(double zeta, Param *param) { double tmp = param->beta * zeta; if (tmp > param->ca1) return pow(tmp, -param->powern/(2.0*param->powern_del)); if (tmp < param->ca4) return 1.0; return pow(1.0 + pow(tmp,param->powern), -1.0/(2.0*param->powern_del)); }
false
false
false
false
false
0
dump() const { qDebug( "dn: %s", qPrintable( mDn ) ); QMap<QString, QStringList>::ConstIterator it; for ( it = mValues.begin(); it != mValues.end(); ++it ) { for ( int i = 0; i < it.value().count(); ++i ) { qDebug( "%s: %s", qPrintable( it.key() ), qPrintable( it.value()[ i ] ) ); } } qDebug( ...
false
false
false
false
false
0
_foreach_joliet_incompatible_make_list_cb (BraseroJolietKey *key, GSList *nodes, MakeTrackData *data) { GSList *iter; /* now exclude all nodes and graft them with a joliet compatible name */ for (iter = nodes; iter; iter = iter->next) { BraseroFileNode *node; BraseroGraftPt *graft; node = ite...
false
false
false
false
false
0
__rw_allowable (pl_inode_t *pl_inode, posix_lock_t *region, glusterfs_fop_t op) { posix_lock_t *l = NULL; int ret = 1; list_for_each_entry (l, &pl_inode->ext_list, list) { if (locks_overlap (l, region) && !same_owner (l, region)) { ...
false
false
false
false
false
0
dse_numsubordinates(Slapi_Entry *entry) { int ret= 0; Slapi_Attr *read_attr = NULL; size_t current_sub_count = 0; /* Get the present value of the subcount attr, or 0 if not present */ ret = slapi_entry_attr_find(entry,subordinatecount,&read_attr); if (0 == ret) { /* decode the value */ Slapi_Value *sval;...
false
false
false
false
true
1
ap_generator0_fprint(FILE* stream, ap_generator0_t* gen, char** name_of_dim) { char* str = NULL; switch(gen->gentyp){ case AP_GEN_LINE: str = "LINE: "; break; case AP_GEN_RAY: str = "RAY: "; break; case AP_GEN_VERTEX: str = "VERTEX: "; break; case AP_GEN_LINEMOD: str = "...
false
false
false
false
false
0
finish_depth_computation( git_pqueue *list, git_revwalk *walk, struct possible_tag *best) { unsigned long seen_commits = 0; int error, i; while (git_pqueue_size(list) > 0) { git_commit_list_node *c = git_pqueue_pop(list); seen_commits++; if (c->flags & best->flag_within) { size_t index = 0; while (gi...
false
false
false
false
false
0
edit_cb(metro_t* metro) { GtkTreeSelection* selection; if (debug) g_print("Edit button clicked.\n"); selection = gtk_tree_view_get_selection(metro->profiles_tree); if (gtk_tree_selection_get_selected(selection, NULL, NULL)) { edit_profile(metro); } else if (debug) g_print("edit_cb(): No Prof...
false
false
false
false
false
0
process_close (gpointer handle, gpointer data) { struct _WapiHandle_process *process_handle; DEBUG ("%s", __func__); process_handle = (struct _WapiHandle_process *) data; if (process_handle->mono_process && process_handle->self == _wapi_getpid ()) InterlockedDecrement (&process_handle->mono_process->handle_coun...
false
false
false
false
false
0
buffer_send(struct Buffer *buffer, int sockfd, int flags) { ssize_t bytes; struct iovec iov[2]; struct msghdr msg = { NULL, // *msg_name 0, // msg_namelen iov, // *msg_iov 0, // msg_iovlen NULL, // *msg_control 0, // msg_controllen ...
false
false
false
false
false
0
snd_seq_timer_get_cur_time(struct snd_seq_timer *tmr) { snd_seq_real_time_t cur_time; unsigned long flags; spin_lock_irqsave(&tmr->lock, flags); cur_time = tmr->cur_time; if (tmr->running) { struct timeval tm; int usec; do_gettimeofday(&tm); usec = (int)(tm.tv_usec - tmr->last_update.tv_usec); if (usec...
false
false
false
false
false
0
btmrvl_sdio_remove(struct sdio_func *func) { struct btmrvl_sdio_card *card; if (func) { card = sdio_get_drvdata(func); if (card) { /* Send SHUTDOWN command & disable interrupt * if user removes the module. */ if (user_rmmod) { btmrvl_send_module_cfg_cmd(card->priv, MODULE_SHUTDOWN_REQ); ...
false
false
false
false
false
0
nilfs_ioctl_do_get_bdescs(struct the_nilfs *nilfs, __u64 *posp, int flags, void *buf, size_t size, size_t nmembs) { struct nilfs_bmap *bmap = NILFS_I(nilfs->ns_dat)->i_bmap; struct nilfs_bdesc *bdescs = buf; int ret, i; down_read(&nilfs->ns_segctor_sem); for (i = 0; i < nmembs; i++) { ret = nilfs_bmap_look...
false
false
false
false
false
0
snapshot_additional_pages(struct zone *zone) { unsigned int rtree, nodes; rtree = nodes = DIV_ROUND_UP(zone->spanned_pages, BM_BITS_PER_BLOCK); rtree += DIV_ROUND_UP(rtree * sizeof(struct rtree_node), LINKED_PAGE_DATA_SIZE); while (nodes > 1) { nodes = DIV_ROUND_UP(nodes, BM_ENTRIES_PER_LEVEL); rtree ...
false
false
false
false
false
0
__ecereProp_StringsBox_Get_strings(struct __ecereNameSpace__ecere__com__Instance * this) { struct StringsBox * __ecerePointer_StringsBox = (struct StringsBox *)(this ? (((char *)this) + __ecereClass_StringsBox->offset) : 0); struct __ecereNameSpace__ecere__com__Instance * array = __ecereNameSpace__ecere__com__eInstance...
false
false
false
true
false
1
dns64_lookup(const dns_name_t *zone, const dns_name_t *name, void *dbdata, dns_sdblookup_t *lookup, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo) { builtin_t *b = (builtin_t *) dbdata; UNUSED(methods); UNUSED(clientinfo); if (name->labels == 0 && name->length == 0) return (b->do_lo...
false
false
false
false
false
0
main(int argc, char *argv[], char *envp[]) #endif #endif { int Err = 0; int Option; int Slient = 0; #ifndef _WIN32 struct rlimit rlim; // On some systems core dumps are disabled by default, // enable them so we can debug this thing ! rlim.rlim_cur = RLIM_INFINITY; rlim.rlim_max = RLIM_INFINITY; ...
false
false
false
false
false
0
probe_docg4(struct platform_device *pdev) { struct mtd_info *mtd; struct nand_chip *nand; void __iomem *virtadr; struct docg4_priv *doc; int len, retval; struct resource *r; struct device *dev = &pdev->dev; r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (r == NULL) { dev_err(dev, "no io memory resou...
false
false
false
false
false
0
ccf_create_gray_conversion_table(cct_cube cube) { cct_8_true_conversion_table answer; int i; answer = (cct_8_true_conversion_table) calloc(1, sizeof(struct ccs_8_true_conversion_table)); for (i = 0; i < 256; i++) { int j; int min_dist = 400000; /* big number ! */ int min_entry; for (j = ...
true
true
false
false
true
1
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__MenuItem_NotifySelect__00000009(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * selection, unsigned int mods) { struct OutputView * __ecerePointer_OutputView = (struct OutputView *)(this ? (((char *)this) + __e...
false
false
false
false
false
0
mono_dl_open_runtime_lib (const char* lib_name, int flags, char **error_msg) { MonoDl *runtime_lib = NULL; char buf [4096]; int binl; *error_msg = NULL; binl = mono_dl_get_executable_path (buf, sizeof (buf)); if (binl != -1) { char *base; char *resolvedname, *name; buf [binl] = 0; resolvedname = mono_pa...
false
false
false
false
false
0
major_handle_gc_param (const char *opt) { if (g_str_has_prefix (opt, "evacuation-threshold=")) { const char *arg = strchr (opt, '=') + 1; int percentage = atoi (arg); if (percentage < 0 || percentage > 100) { fprintf (stderr, "evacuation-threshold must be an integer in the range 0-100.\n"); exit (1); } ...
false
false
false
false
false
0
set_parse_v1(int c, char **argv, int invert, unsigned int *flags, const void *entry, struct xt_entry_match **match) { struct xt_set_info_match_v1 *myinfo = (struct xt_set_info_match_v1 *) (*match)->data; struct xt_set_info *info = &myinfo->match_set; switch (c) { case '2': fprintf(stderr, "--set opti...
false
false
false
false
false
0
AddText(const std::string& text) { if (text == STR_EMPTY) return; if (last_child_ && last_child_->IsText()) { last_child_->AsText()->AddText(text); return; } XmlChild ** pprev = last_child_ ? &(last_child_->next_child_) : &first_child_; last_child_ = *pprev = new XmlText(text); }
false
false
false
false
false
0
BaseException_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyBaseExceptionObject *self; self = (PyBaseExceptionObject *)type->tp_alloc(type, 0); if (!self) return NULL; /* the dict is created on the fly in PyObject_GenericSetAttr */ self->message = self->dict = NULL; self-...
false
false
false
false
false
0
isp1760_ep_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) { struct isp1760_request *req; req = kzalloc(sizeof(*req), gfp_flags); if (!req) return NULL; return &req->req; }
false
false
false
false
false
0
blit_screen_yuy2() { int i,j; Uint32 *buf=(Uint32*)overlay->pixels[0]; Uint16 *t=back->pixels; static Uint8 rumble=0; static Uint8 rb_time=0; // printf("%d\n",back->pitch>>1); if (conf.gb_type&SUPER_GAMEBOY) { buf+=(overlay->pitches[0]>>2)*40+48; } if (rb_on) { rumble=2-rumble; t...
false
false
false
false
false
0
zd_tx_watchdog_disable(struct zd_usb *usb) { struct zd_usb_tx *tx = &usb->tx; if (tx->watchdog_enabled) { dev_dbg_f(zd_usb_dev(usb), "\n"); tx->watchdog_enabled = 0; cancel_delayed_work_sync(&tx->watchdog_work); } }
false
false
false
false
false
0
bg_scan_pri() { int cnt, i; byte *src, *dest; if (WX <= 0) return; i = S; cnt = WX; dest = PRI; src = lcd.vbank[1] + ((R_LCDC&0x08)?0x1C00:0x1800) + (T<<5); if (!priused(src)) { memset(dest, 0, cnt); return; } memset(dest, src[i++&31]&128, 8-U); dest += 8-U; cnt -= 8-U; if (cnt <= 0) return; whil...
false
false
false
false
false
0
GetAreaIdByAreaFlag(uint16 areaflag, uint32 map_id) { AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); if (entry) { return entry->ID; } else { return 0; } }
false
false
false
false
false
0
_grid_clear_all(Evas_Object *obj) { Elm_Phocam_Grid *g; ELM_PHOTOCAM_DATA_GET(obj, sd); EINA_LIST_FREE (sd->grids, g) { _grid_clear(obj, g); free(g); } }
false
false
false
false
false
0
DGG_cutLHS(DGG_constraint_t *c, double *x) { int i; double lhs = 0.0; for(i=0; i < c->nz; i++) lhs += c->coeff[i]*x[c->index[i]]; return lhs; }
false
false
false
false
false
0
savePath( QString file ) { QString path; #ifdef WIN32 path = UnicornUtils::appDataPath(); if ( path.isEmpty() ) path = QApplication::applicationDirPath(); else path += "/Last.fm/Client"; #else path = UnicornUtils::appDataPath() + "/Last.fm"; #endi...
false
false
false
false
false
0
DrawTileSurface(SDL_Surface* src, const PG_Rect& r, SDL_Surface* dst, Uint8 blend = 0) { PG_Rect srcrect; PG_Rect dstrect; // tile the background image over the r in surface dstrect = r; srcrect.SetRect(0, 0, src->w, src->h); int yc = (r.my_height / src->h) +1; int xc = (r.my_width / src->w) +1; if(blend > ...
false
false
false
false
false
0
xfs_calc_iunlink_remove_reservation( struct xfs_mount *mp) { return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) + max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size); }
false
false
false
false
false
0
uartslkInit(void) { USART_InitTypeDef USART_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; EXTI_InitTypeDef extiInit; /* Enable GPIO and USART clock */ RCC_AHB1PeriphClockCmd(UARTSLK_GPIO_PERIF, ENABLE); ENABLE_UARTSLK_RCC(UARTSLK_PERIF, ENABLE); /* Configure...
false
false
false
false
false
0
operator==( self_constref other ) { if( m_end && other.m_end ) return true; if( (!m_end && other.m_end) || (m_end && !other.m_end) ) { return false; } return m_apPropertyNumber == other.m_apPropertyNumber && m_pocoliter == other.m_pocoliter; }
false
false
false
false
false
0
radioProcessInstance(radioInstance_t *r) { serialPort_t *s = r->serialPort; int8_t q; switch (r->radioType) { case RADIO_TYPE_SPEKTRUM11: case RADIO_TYPE_SPEKTRUM10: case RADIO_TYPE_DELTANG: while (serialAvailable(s)) if (spektrumCharIn(r, serialRead(s))) { r->lastUpdate = timerMicros(); radi...
false
false
false
false
false
0
mouseover_win(GtkWidget * widget, GdkEventButton * event, gpointer data) { Win *win = (Win *) data; g_signal_handler_disconnect(G_OBJECT(win->win), win->handlerid); win->handlerid = g_signal_connect(G_OBJECT(win->win), "leave-notify-event", G_CALLBACK(mouseout_win), data); if (win->timeout_id) { g...
false
false
false
false
false
0
IPrcParse(const pfPrcTag* tag, plResManager* mgr) { if (tag->getName() == "AvBrainGenericParams") { fType = tag->getParam("Type", "0").toUint(); fWhichStage = tag->getParam("Stage", "0").toUint(); fSetTime = tag->getParam("SetTime", "False").toBool(); fNewTime = tag->getParam("NewTim...
false
false
false
false
false
0
create_didl_for_file (const char *file_path, const char *title, const char *parent_id) { GUPnPDIDLLiteWriter *writer; GUPnPDIDLLiteObject *item; char *didl; char *new_title; const char *upnp_class; writer = gupnp_didl_lite_writ...
false
false
false
false
false
0
fsysdep_remember_reception (qsys, zto, ztemp) const struct uuconf_system *qsys; const char *zto ATTRIBUTE_UNUSED; const char *ztemp; { char *zfile; int o; zfile = zsreceived_name (qsys, ztemp); if (zfile == NULL) return TRUE; o = creat (zfile, IPUBLIC_FILE_MODE); if (o < 0) { i...
false
false
false
false
false
0
new_temp_expr_table (var_map map) { temp_expr_table_p t; unsigned x; t = XNEW (struct temp_expr_table_d); t->map = map; t->partition_dependencies = XCNEWVEC (bitmap, num_ssa_names + 1); t->expr_decl_uids = XCNEWVEC (bitmap, num_ssa_names + 1); t->kill_list = XCNEWVEC (bitmap, num_var_partitions (map) + ...
false
false
false
false
false
0
capture_stderr(PyObject *self, PyObject *args) { char *str = NULL; if (!PyArg_ParseTuple(args, "s", &str)) return NULL; g_string_append(captured_stderr, str); Py_INCREF(Py_None); return Py_None; }
false
false
false
false
false
0
testRenderHint(QScriptContext *ctx, QScriptEngine *eng) { DECLARE_SELF(QPainter, testRenderHint); return QScriptValue(eng, self->testRenderHint(static_cast<QPainter::RenderHint>(ctx->argument(0).toInt32()))); }
false
false
false
false
false
0
adf_vf2pf_request_version(struct adf_accel_dev *accel_dev) { unsigned long timeout = msecs_to_jiffies(ADF_IOV_MSG_RESP_TIMEOUT); struct adf_hw_device_data *hw_data = accel_dev->hw_device; u32 msg = 0; int ret; msg = ADF_VF2PF_MSGORIGIN_SYSTEM; msg |= ADF_VF2PF_MSGTYPE_COMPAT_VER_REQ << ADF_VF2PF_MSGTYPE_SHIFT; ...
false
false
false
false
false
0
JoinGroups(int idA, int idB) { if (idA == idB) return; std::list < PuzzlePieceSprite * >::iterator it; for (it = puzzlePieces.begin(); it != puzzlePieces.end(); it++) { if ((*it)->group == idB) { (*it)->group = idA; (*it)->grouped = true; } } if (idA <= lastSingleGroup) { int idC = NextGroup(); fo...
false
false
false
false
false
0
disturb(struct player *p, int stop_search, int unused_flag) { /* Unused parameter */ (void)unused_flag; /* Cancel repeated commands */ cmd_cancel_repeat(); /* Cancel Resting */ if (p->resting) { p->resting = 0; p->redraw |= PR_STATE; } /* Cancel running */ if (p->running) { p_ptr->running = 0; /* ...
false
false
false
false
false
0
otp_async_challenge(char challenge[OTP_MAX_CHALLENGE_LEN + 1], int len) { unsigned char rawchallenge[OTP_MAX_CHALLENGE_LEN]; int i; otp_get_random(rawchallenge, len); /* Convert the raw bytes to ASCII decimal. */ for (i = 0; i < len; ++i) challenge[i] = '0' + rawchallenge[i] % 10; challenge[len] = '\0...
true
true
false
false
false
1
_process_resv_idle_time(List resv_usage_list, List assoc_usage_list) { ListIterator r_itr; local_resv_usage_t *r_usage; local_id_usage_t *a_usage = NULL; int seconds; int last_id = -1; r_itr = list_iterator_create(resv_usage_list); while((r_usage = list_next(r_itr))) { char *assoc = NULL; ListIterator tmp_i...
false
false
false
false
false
0
telepathy_observer_observe_ft_channel (TelepathyObserver* self, TpSimpleObserver* observer, TpAccount* account, TpConnection* connection, TpChannel* b_channel, TpChannelDispatchOperation* dispatch_operation, GList* requests, TpObserveChannelsContext* context) { Block5Data* _data5_; TpSimpleObserver* _tmp0_ = NULL; T...
false
false
false
false
false
0
dlm_print_reco_node_status(struct dlm_ctxt *dlm) { struct dlm_reco_node_data *ndata; struct dlm_lock_resource *res; mlog(ML_NOTICE, "%s(%d): recovery info, state=%s, dead=%u, master=%u\n", dlm->name, task_pid_nr(dlm->dlm_reco_thread_task), dlm->reco.state & DLM_RECO_STATE_ACTIVE ? "ACTIVE" : "inactive",...
false
false
false
false
false
0
hfs_read_inode(struct inode *inode, void *data) { struct hfs_iget_data *idata = data; struct hfs_sb_info *hsb = HFS_SB(inode->i_sb); hfs_cat_rec *rec; HFS_I(inode)->flags = 0; HFS_I(inode)->rsrc_inode = NULL; mutex_init(&HFS_I(inode)->extents_lock); INIT_LIST_HEAD(&HFS_I(inode)->open_dir_list); /* Initialize ...
false
false
false
false
false
0
external_gengrid_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const Eina_List *params) { Elm_Params_Gengrid *mem; Edje_External_Param *param; const Eina_List *l; mem = ELM_NEW(Elm_Params_Gengrid); if (!mem) return NULL; EINA_LIST_FOREACH(params, l, param) { if (...
false
false
false
false
false
0
queue_map(queue_t q, int (*f) (queue_element_t, void *), void *vp) { queue_node_ptr_t p; int ret; if (!q) return 0; p = q->head; while (p != NULL) { ret = f(p->element, vp); if (ret) return ret; p = p->next; } return 0; }
false
false
false
false
false
0
receiveLine(std::string& line) { // An old wisdom goes: be strict in what you emit // and generous in what you accept. int ch = get(); while (ch != EOF_CHAR && ch != '\r' && ch != '\n') { line += (char) ch; ch = get(); } if (ch == '\r' && peek() == '\n') get(); else if (ch == EOF_CHAR) return false; re...
false
false
false
false
false
0
jdwp_tracker_close( asocket* s ) { JdwpTracker* tracker = (JdwpTracker*) s; asocket* peer = s->peer; if (peer) { peer->peer = NULL; peer->close(peer); } remove_socket(s); tracker->prev->next = tracker->next; tracker->next->prev = tracker->prev; free(s); }
false
false
false
false
false
0
clk_rcg2_set_parent(struct clk_hw *hw, u8 index) { struct clk_rcg2 *rcg = to_clk_rcg2(hw); int ret; u32 cfg = rcg->parent_map[index].cfg << CFG_SRC_SEL_SHIFT; ret = regmap_update_bits(rcg->clkr.regmap, rcg->cmd_rcgr + CFG_REG, CFG_SRC_SEL_MASK, cfg); if (ret) return ret; return update_config(rcg); }
false
false
false
false
false
0
jump_forw() { POSITION pos; POSITION end_pos; if (ch_end_seek()) { error("Cannot seek to end of file", NULL_PARG); return; } /* * Note; lastmark will be called later by jump_loc, but it fails * because the position table has been cleared by pos_clear below. * So call it here before calling pos_clear. ...
false
false
false
false
false
0
show_spliced_alignment(GthSA *sa, GthInput *input, bool gs2out, unsigned long minintronlength, unsigned long widthforgenpos, unsigned long showintronmaxlen, unsigned long translati...
false
false
false
false
false
0
ext2fs_inode_i_blocks(ext2_filsys fs, struct ext2_inode *inode) { return (inode->i_blocks | (fs->super->s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_HUGE_FILE ? (__u64)inode->osd2.linux2.l_i_blocks_hi << 32 : 0)); }
false
false
false
false
false
0
getAtom( const XMLNode* atomNode ) { std::ostringstream os; os.str(""); if( !atomNode || (atomNode->getName() != "observed-fluent") ) { std::cout<<"<client> ERROR: There is something wrong with the atom node"<<std::endl; return NULL; } // get predicate name std::string predicate_name; i...
false
false
false
false
false
0
callsystem_getenv(char ** env[], const char * key) { char ** i; size_t sz; sz = strlen(key); if(!env || !*env) return NULL; for(i = *env; *i; ++i) if(!strncmp(key,*i,sz) &&(*i)[sz] == '=') return &(*i)[sz+1]; return NULL; }
false
false
false
false
false
0
result_to_string (xmmsv_t *val, column_def_t *coldef, gchar *buffer) { gint realsize; gint ival; const gchar *sval; gchar *value; switch (xmmsv_dict_entry_get_type (val, coldef->arg.string)) { case XMMSV_TYPE_NONE: /* Yeah, lots of code duplication, lets fix that */ value = NULL; if (!strcmp (coldef->arg.s...
false
false
false
false
false
0
printError(FILE* fout, const char* usage, bool exitProgram) { if (errarg==0) return; if (usage) fprintf(fout, "%s\n", usage); if (err_valmissing) fprintf(fout, "Error: value required for option '%s'\n", _argv[errarg]); else fprintf(fout, "Error: invalid argument '%s'\n", _argv[errarg]); if (exitProg...
false
false
false
false
false
0
main(int argc, char **argv) { struct gen_opt opt; if (argc < 2) { opt.output = stdout; } else { opt.output = fopen(argv[1], "w"); if (!opt.output) { perror("fopen"); exit(EXIT_FAILURE); } } opt.indent_level = 1; opt.use_if_threshold = 3; ...
false
false
false
false
true
1
setWordWrap(bool wordWrap) { d->wordWrap = wordWrap; d->textLabel->setWordWrap(wordWrap); QSizePolicy policy = sizePolicy(); policy.setHeightForWidth(wordWrap); setSizePolicy(policy); d->updateLayout(); // Without this, when user does wordWrap -> !wordWrap -> wordWrap, a minimum // heigh...
false
false
false
false
false
0
ocfs2_split_and_insert(handle_t *handle, struct ocfs2_extent_tree *et, struct ocfs2_path *path, struct buffer_head **last_eb_bh, int split_index, struct ocfs2_extent_rec *orig_split_rec, struct ocfs2_alloc_context *meta_ac) { int ret = 0, depth; unsigned int insert_range, rec_range...
false
false
false
false
false
0
_dcmi_specification_conformance (ipmi_dcmi_state_data_t *state_data, uint8_t *parameter_revision) { fiid_obj_t obj_cmd_rs = NULL; uint8_t major, minor; uint64_t val; int rv = -1; assert (state_data); assert (parameter_revision); if (!(obj_cmd_rs = fiid_obj_create (tmpl_cmd_dcmi_get_dcmi_capability_info_...
false
false
false
false
false
0
list_account_compare_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer userdata) { gint result = 0; gint dt1, dt2; Account *entry1, *entry2; //gchar *name1, *name2; gtk_tree_model_get(model, a, LST_DSPACC_DATATYPE, &dt1, LST_DSPACC_DATAS, &entry1, //LST_DSPACC_NAME, &name1, ...
false
false
false
false
false
0
UT_parseCMYKColor(const char *p, UT_RGBColor& c) { // yes, i know that CMYK->RGB is lossy... DAL // WARNING: !!!!UNTESTED!!!! UT_DEBUGMSG(("DOM: parsing CMYK value!!\n")); int cyanVal = 0; int magentaVal = 0; int yellowVal = 0; int kVal = 0; p += 5; // advance past "CMYK(" UT_uint32 inde...
false
false
false
false
false
0
startElement( const QString &, const QString &, const QString & qName, const QXmlAttributes & atts ) { if( qName == "general" && _state == StateInit ) { _state = StateDocument; } else if( qName == "vision" && _state == StateDocument ) { _state = StateVision; } else if ( qName == "calendar" && _state == StateDocu...
false
false
false
false
false
0
post(Home home, Term* t, int n, FloatRelType frt, FloatVal c, Reify r) { Region re(home); rel(home, extend(home,re,t,n), frt, c, r); dopost(home, t, n, FRT_EQ, 0.0); }
false
false
false
false
false
0
poslib_degstr(char *&src, char pre, char post) { int deg, min = 0, sec = 0, msec = 0; u_int32 ret; string tmp; deg = txt_to_int(read_entry(src).c_str()); tmp = read_entry(src); if (isdigit(tmp[0])) { min = txt_to_int(tmp.c_str()); tmp = read_entry(src); if (isdigit(tmp[0])) { if (strchr(t...
false
false
false
false
false
0