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
ufs_symlink (struct inode * dir, struct dentry * dentry, const char * symname) { struct super_block * sb = dir->i_sb; int err; unsigned l = strlen(symname)+1; struct inode * inode; if (l > sb->s_blocksize) return -ENAMETOOLONG; inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO); err = PTR_ERR(inode); if (IS_E...
false
false
false
false
false
0
nhi_interrupt_work(struct work_struct *work) { struct tb_nhi *nhi = container_of(work, typeof(*nhi), interrupt_work); int value = 0; /* Suppress uninitialized usage warning. */ int bit; int hop = -1; int type = 0; /* current interrupt type 0: TX, 1: RX, 2: RX overflow */ struct tb_ring *ring; mutex_lock(&nhi->l...
false
false
false
false
false
0
chkIsCountIndex( STATE_INFO * pStateInfo, FLMUINT uiIndexNum, FLMBOOL * pbIsCountIndex) { RCODE rc = FERR_OK; FDB * pDb = pStateInfo->pDb; IXD * pIxd; if (RC_BAD( rc = fdictGetIndex( pDb->pDict, pDb->pFile->bInLimitedMode, uiIndexNum, NULL, &pIxd, TRUE))) { goto Exit; } *pbIsCountIndex = (FLMB...
false
false
false
false
false
0
VisitBinaryOperator(BinaryOperator *BO) { if (!BO->isComparisonOp()) return true; handleOneOperand(BO->getLHS()); handleOneOperand(BO->getRHS()); return true; }
false
false
false
false
false
0
check_name(const char *z){ if( !wiki_name_is_wellformed((const unsigned char *)z) ){ style_header("Wiki Page Name Error"); cgi_printf("The wiki name \"<span class=\"wikiError\">%h</span>\" is not well-formed.\n" "Rules for wiki page names:\n",(z)); well_formed_wiki_name_rules(); style_foote...
false
false
false
false
false
0
pixGenerateJpegData(PIX *pixs, l_int32 ascii85flag, l_int32 quality) { l_int32 d; char *tname; L_COMPRESSED_DATA *cid; PROCNAME("pixGenerateJpegData"); if (!pixs) return (L_COMPRESSED_DATA *)ERROR_PTR("pixs not defined", ...
false
false
false
false
false
0
w_option_value (Wire *w, SANE_Word type, SANE_Word size, void **value) { SANE_Word len, element_size; WireCodecFunc w_value; switch (type) { case SANE_TYPE_BOOL: case SANE_TYPE_INT: case SANE_TYPE_FIXED: w_value = (WireCodecFunc) sanei_w_word; element_size = sizeof (SANE_Word); ...
false
false
false
false
false
0
Pdata_poplist(Pdata *self, Py_ssize_t start) { PyObject *list; Py_ssize_t len, i, j; len = Py_SIZE(self) - start; list = PyList_New(len); if (list == NULL) return NULL; for (i = start, j = 0; j < len; i++, j++) PyList_SET_ITEM(list, j, self->data[i]); Py_SIZE(self) = start;...
false
false
false
false
false
0
test_socks_5_auth_before_negotiation(void *ptr) { SOCKS_TEST_INIT(); /* SOCKS 5 Send username/password */ ADD_DATA(buf, "\x01\x02me\x02me"); test_assert(fetch_from_buf_socks(buf, socks, get_options()->TestSocks, get_options()->SafeSocks) == ...
false
false
false
false
false
0
service_set_signal(GtkService *service) { GtkServicePrivate *priv = service->priv; GdkPixbuf *image = NULL; const char *type, *info; type = connman_service_get_type(service->path); if (g_strcmp0(type, "wifi") == 0) { uint8_t strength; strength = connman_service_get_strength(service->path); cui_theme_get_...
false
false
false
false
false
0
uniform_generate (unsigned level, int y_state, const wfa_t *wfa, const void *model) { unsigned state, n; word_t *domains = fiasco_calloc (wfa->states + 1, sizeof (word_t)); for (state = 0, n = 0; state < wfa->states; state++) if (usedomain (state, wfa)) domains [n++] = state; domains [n] = -...
false
false
false
false
false
0
rewrite_leave_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, basic_block bb ATTRIBUTE_UNUSED) { /* Restore CURRDEFS to its original state. */ while (VEC_length (tree, block_defs_stack) > 0) { tree tmp = VEC_pop (tree, block_defs_stack); tree saved_def, var; if (tmp == NULL_T...
false
false
false
false
false
0
findUnitAndExtractFast(DWARFDebugInfoEntryMinimal &DIE, const DWARFUnit *Unit, uint32_t *Offset) { Unit = Unit->getUnitSection().getUnitForOffset(*Offset); return (Unit && DIE.extractFast(Unit, Offset)) ? Unit : nullptr; }
false
false
false
false
false
0
Stop() { int nr_terminal_rows = GetTerminalSize().rows; if (nr_terminal_rows > 0) { SetupTerminalScrollArea(nr_terminal_rows + 1); // override the progress line (sledgehammer) static const char* clear_screen_below_cursor = "\033[J"; std::cout << clear_screen_below_cursor; } child...
false
false
false
false
true
1
Nviz_set_volume_attr_default(int id) { int rows, cols, depths; int max; GVL_get_dims(id, &rows, &cols, &depths); max = (rows > cols) ? rows : cols; max = (depths > max) ? depths : max; max = max / 35; if (max < 1) max = 1; if (max > cols) max = cols / 2; if (max > rows) max ...
false
false
false
false
false
0
eager_fpu_setup(char *s) { if (!strcmp(s, "on")) eagerfpu = ENABLE; else if (!strcmp(s, "off")) eagerfpu = DISABLE; else if (!strcmp(s, "auto")) eagerfpu = AUTO; return 1; }
false
false
false
false
false
0
bx_read_configuration(const char *rcfile) { // parse rcfile first, then parse arguments in order. BX_INFO (("reading configuration from %s", rcfile)); if (parse_bochsrc(rcfile) < 0) { BX_PANIC (("reading from %s failed", rcfile)); return -1; } // update log actions for (int level=0; level<N_LOGLEV; ...
false
false
false
false
false
0
do_pan(struct Cell_head *window) { int screen_x, screen_y, button; int end = 0, printmenu = 1; while (!end) { if (printmenu) { fprintf(stderr, _("\n\nButtons:\n")); fprintf(stderr, _("Left: Pan\n")); fprintf(stderr, _("Right: Quit\n")); printmenu = 0; } R_get_location_with_pointe...
false
false
false
false
false
0
doscommkdir(argc, argv) int argc; char *CONST argv[]; { if (checkarg(argc, argv) < 0) return(RET_FAIL); if (Xmkdir(argv[1], 0777) < 0) { dosperror(argv[1]); return(RET_FAIL); } return(RET_SUCCESS); }
false
false
false
false
false
0
substr(int start, int len) const { astring ret; if (start > _len) return ret; if (start < 0) { start += _len; if (start < 0) start = 0; } if (len < 0) { len = _len-start; if (len < 0) len = 0; } ret.assign(_data+start, len); return ret; }
false
false
false
false
false
0
unit_help_callback(struct widget *pWidget) { if (Main.event.button.button == SDL_BUTTON_LEFT) { Unit_type_id unit_id = MAX_ID - pWidget->ID; popdown_advanced_terrain_dialog(); popup_unit_info(unit_id); } return -1; }
false
false
false
false
false
0
stage_height(const fn_call& fn) { // setter if ( fn.nargs > 0 ) { IF_VERBOSE_ASCODING_ERRORS( log_aserror(_("Stage.height is a read-only property!")); ); return as_value(); } // getter movie_root& m = getRoot(fn); return as_value(m.getStageHeight());...
false
false
false
false
false
0
LoadFile( const char* filename ) { Clear(); FILE* fp = callfopen( filename, "rb" ); if ( !fp ) { SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 ); return _errorID; } LoadFile( fp ); fclose( fp ); return _errorID; }
false
false
false
false
false
0
wbc_gtk_style_feedback (WorkbookControl *wbc, GnmStyle const *changes) { WBCGtk *wbcg = (WBCGtk *)wbc; if (changes) wbc_gtk_style_feedback_real (wbc, changes); else if (0 == wbcg->idle_update_style_feedback) wbcg->idle_update_style_feedback = g_timeout_add (200, (GSourceFunc) cb_wbc_gtk_style_feedback, wbc);...
false
false
false
false
false
0
id3_get_unsync_data(unsigned char *dest, const unsigned char *src, unsigned long srclen) { unsigned long k = 0, i; for (i = 0; i < srclen; i++) { if (dest) dest[k] = src[i]; k++; if (src[i] == 0xff && i + 1 < srclen && src[i+1] == 0x00) i++; } return k; }
false
false
false
false
false
0
brasero_graft_point_copy (BraseroGraftPt *graft) { BraseroGraftPt *newgraft; g_return_val_if_fail (graft != NULL, NULL); newgraft = g_new0 (BraseroGraftPt, 1); newgraft->path = g_strdup (graft->path); if (graft->uri) newgraft->uri = g_strdup (graft->uri); return newgraft; }
false
false
false
false
false
0
createSbrDec (SBR_CHANNEL * hSbrChannel, HANDLE_SBR_HEADER_DATA hHeaderData, /*!< Static control data */ TRANSPOSER_SETTINGS *pSettings, const int downsampleFac, /*!< Downsampling factor */ const UINT qmfFlags, /*!< flags -> 1: HQ/LP sele...
false
false
false
false
false
0
get_pending_event_list (std::vector<AudioEvent> & pending_event_list) { PWaitAndSignal m(event_list_mutex); AudioEvent event; std::vector <AudioEvent> new_event_list; unsigned long time = get_time_ms(); pending_event_list.clear(); while (event_list.size() > 0) { event = *(event_list.begin()); event_...
false
false
false
false
false
0
ddf_SetInequalitySets(ddf_ConePtr cone) { ddf_rowrange i; set_emptyset(cone->GroundSet); set_emptyset(cone->EqualitySet); set_emptyset(cone->NonequalitySet); for (i = 1; i <= (cone->parent->m); i++){ set_addelem(cone->GroundSet, i); if (cone->parent->EqualityIndex[i]==1) set_addelem(cone->Equalit...
false
false
false
false
false
0
read_packet(int *type, void *payload, size_t max_len) { size_t size, data_size; unsigned char start[4]; unsigned int checksum_exp, checksum_act; unsigned char *data; if (gbfread(start, sizeof(start), 1, file_handle) != 1) { if (gbfeof(file_handle)) { return 0; } fatal(MYNAME ": Format err...
true
true
false
false
false
1
FlmStorage2INT64( FLMUINT uiValueType, FLMUINT uiValueLength, const FLMBYTE * pucValue, FLMINT64 * pi64Num) { RCODE rc = FERR_OK; FLMUINT64 ui64Num; FLMBOOL bNegFlag; if( RC_OK(rc = flmBcd2Num64( uiValueType, uiValueLength, pucValue, &ui64Num, &bNegFlag))) { if (bNegFlag) { // If bNeg...
false
false
false
false
false
0
UpdateHashCounter(CModel *cModel, uint64_t pModelIdx, uint8_t symbol) { uint32_t n, i, hIndex = (uint32_t)(pModelIdx % HASH_SIZE); for(n = 0 ; n < cModel->hTable.entrySize[hIndex] ; n++) if(cModel->hTable.entries[hIndex][n].key == pModelIdx) { if(++cModel->hTable.entries[hIndex][n].counters[symbol...
false
false
false
false
false
0
store_blessed( pTHX_ stcxt_t *cxt, SV *sv, int type, HV *pkg) { SV *hook; I32 len; char *classname; I32 classnum; TRACEME(("store_blessed, type %d, class \"%s\"", type, HvNAME_get(pkg))); /* * Look for a hook for this blessed SV and redirect to store_hook() * if needed. */ hook = pkg_can(aTH...
false
false
false
false
false
0
emit_handle (pIIR_ArchitectureDeclaration a ,string &str, RegionStack &rstack) { // The current C++ source code is not associated with any real // VHDL source line last_pos_info = emit_posinfo(NO_SOURCE_LINE, str, last_pos_info, 0); str += "/* handle for simulator to find architecture */\n"; // handle func s...
false
false
false
false
false
0
MakeShape() { if (text != nil) { const Font* f = output->GetFont(); shape->width += f->Width(text); shape->height += f->Height(); } shape->Rigid(); }
false
false
false
false
false
0
vmw_resource_move_notify(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem) { struct vmw_dma_buffer *dma_buf; if (mem == NULL) return; if (bo->destroy != vmw_dmabuf_bo_free && bo->destroy != vmw_user_dmabuf_destroy) return; dma_buf = container_of(bo, struct vmw_dma_buffer, base); if (mem-...
false
false
false
false
false
0
e_iterator_set (EIterator *iterator, gconstpointer object) { if (E_ITERATOR_GET_CLASS (iterator)->set) E_ITERATOR_GET_CLASS (iterator)->set (iterator, object); }
false
false
false
false
false
0
gitg_config_accumulate (GitgShell *shell, gchar **buffer, GitgConfig *config) { gchar **ptr = buffer; while (*ptr) { g_string_append (config->priv->accumulated, *ptr); ++ptr; } }
false
false
false
false
false
0
history_arg_extract (first, last, string) int first, last; const char *string; { register int i, len; char *result; int size, offset; char **list; /* XXX - think about making history_tokenize return a struct array, each struct in array being a string and a length to avoid the calls to str...
false
false
false
false
false
0
os_desc_unlink(struct config_item *os_desc_ci, struct config_item *usb_cfg_ci) { struct gadget_info *gi = container_of(to_config_group(os_desc_ci), struct gadget_info, os_desc_group); struct usb_composite_dev *cdev = &gi->cdev; mutex_lock(&gi->lock); if (gi->udc_name) unregister_gadget(gi); cdev->os_d...
false
false
false
false
false
0
_mpd_cap(mpd_t *result, const mpd_context_t *ctx) { uint32_t dummy; mpd_ssize_t len, r; if (result->len > 0 && result->digits > ctx->prec) { _mpd_idiv_word(&len, &r, ctx->prec, MPD_RDIGITS); len = (r == 0) ? len : len+1; if (r != 0) { result->data[len-1] %= mpd_pow10[r]...
false
false
false
false
false
0
nex_input(bool rem_out) { NexusSet*result = base_? base_->nex_input(rem_out) : new NexusSet(); NexusSet*tmp = expr_->nex_input(rem_out); if (tmp == NULL) { delete result; return NULL; } result->add(*tmp); delete tmp; /* See the comment for NetESignal below. */ if (ba...
false
false
false
false
false
0
tree_content_set( struct tree_entry *root, const char *p, const unsigned char *sha1, const uint16_t mode) { struct tree_content *t = root->tree; const char *slash1; unsigned int i, n; struct tree_entry *e; slash1 = strchr(p, '/'); if (slash1) n = slash1 - p; else n = strlen(p); if (!n) die("Empty pat...
false
false
false
false
false
0
dns_msg_read_question(dns_msg_question_t *qdata, dns_msg_handle_t *handle) { if (msg_decode_name(handle, qdata->mq_name, sizeof(qdata->mq_name)) < 0) return -1; if (msg_skip_name(handle) < 0) return -1; MSG_READ16(qdata->mq_type, handle); MSG_READ16(qdata->mq_class, handle); return...
false
false
false
false
false
0
dichl_destroy(cdichl *d) { cdichlitem *item, *next; if (d==NULL) return -1; item=d->head; while (item!=NULL) { next=item->next; free(item->str); free(item); item=next; } free(d); return 0; }
false
false
false
false
false
0
ListSortInteger(Jim_Obj **lhsObj, Jim_Obj **rhsObj) { jim_wide lhs = 0, rhs = 0; if (Jim_GetWide(sort_info->interp, *lhsObj, &lhs) != JIM_OK || Jim_GetWide(sort_info->interp, *rhsObj, &rhs) != JIM_OK) { longjmp(sort_info->jmpbuf, JIM_ERR); } return JimSign(lhs - rhs) * sort_info->order...
false
false
false
false
false
0
driver_create_file(struct device_driver *drv, const struct driver_attribute *attr) { int error; if (drv) error = sysfs_create_file(&drv->p->kobj, &attr->attr); else error = -EINVAL; return error; }
false
false
false
false
false
0
get_directive(char *string) { int index = -1; register int x; for(x=0; x < MAXTEMPLATE; x++) { if(!strncmp(string, templates[x].name, strlen(templates[x].name))) { index = x; break; } } return index; }
false
false
false
false
false
0
OutputAsmField(struct AsmField * field, struct __ecereNameSpace__ecere__com__Instance * f) { ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({ struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f; __internal_ClassInst ? __internal_ClassInst->...
false
false
false
false
false
0
interpolate_point4d(POINT4D *A, POINT4D *B, POINT4D *I, double F) { #if PARANOIA_LEVEL > 0 double absF=fabs(F); if ( absF < 0 || absF > 1 ) { lwerror("interpolate_point4d: invalid F (%g)", F); } #endif I->x=A->x+((B->x-A->x)*F); I->y=A->y+((B->y-A->y)*F); I->z=A->z+((B->z-A->z)*F); I->m=A->m+((B->m-A->m)*F); ...
false
false
false
false
false
0
indexOf(UChar32 c) const { if (c < MIN_VALUE || c > MAX_VALUE) { return -1; } int32_t i = 0; int32_t n = 0; for (;;) { UChar32 start = list[i++]; if (c < start) { return -1; } UChar32 limit = list[i++]; if (c < limit) { return n...
false
false
false
false
false
0
callHalVolumeUnmount() { QDBusConnection c = QDBusConnection::systemBus(); QString udi = m_device->udi(); QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.Hal", udi, "org.freedesktop.Hal.Device.Volume", ...
false
false
false
false
false
0
e2_context_menu_show (guint button, guint32 time, gint type) { // FileInfo *info; //FIXME if we need to disable refresh during the popup, // make all menu choices depart via a fn that enables refresh again //#ifdef E2_REFRESH_DEBUG // printd (DEBUG, "disable refresh, context menu show"); //#endif // e2_filelist_disable...
false
false
false
false
false
0
r8a66597_set_wedge(struct usb_ep *_ep) { struct r8a66597_ep *ep; unsigned long flags; ep = container_of(_ep, struct r8a66597_ep, ep); if (!ep || !ep->ep.desc) return -EINVAL; spin_lock_irqsave(&ep->r8a66597->lock, flags); ep->wedge = 1; spin_unlock_irqrestore(&ep->r8a66597->lock, flags); return usb_ep_set...
false
false
false
false
false
0
get_user_is_in_group(const Glib::ustring& user, const Glib::ustring& group) { const type_vec_strings users = get_database_users(group); type_vec_strings::const_iterator iterFind = std::find(users.begin(), users.end(), user); return (iterFind != users.end()); }
false
false
false
false
false
0
mt9t031_g_volatile_ctrl(struct v4l2_ctrl *ctrl) { struct mt9t031 *mt9t031 = container_of(ctrl->handler, struct mt9t031, hdl); const u32 shutter_max = MT9T031_MAX_HEIGHT + MT9T031_VERTICAL_BLANK; s32 min, max; switch (ctrl->id) { case V4L2_CID_EXPOSURE_AUTO: min = mt9t031->exposure->minimum; max = ...
false
false
false
false
false
0
interface_bss_removed(DBusMessageIter *iter, void *user_data) { struct supplicant_interface *interface = user_data; struct supplicant_network *network; const char *path = NULL; dbus_message_iter_get_basic(iter, &path); if (path == NULL) return; network = g_hash_table_lookup(interface->bss_mapping, path); if ...
false
false
false
false
false
0
set_file_pos_all(Screen *t) { /* Step through all windows */ W *w = t->topwin; do { if (w->watom == &watomtw) { BW *bw = w->object; set_file_pos(bw->b->name, bw->cursor->line); } w = w->link.next; } while(w != t->topwin); /* Set through orphaned buffers */ set_file_pos_orphaned(); }
false
false
false
false
false
0
doParseXml(DataSource &source, int &reason) { Document *self = new Document; ImlParser parser(source); return doParse(self, parser, reason); }
false
false
false
false
false
0
ario_lyrics_editor_search_cb (GtkButton *button, ArioLyricsEditor *lyrics_editor) { ARIO_LOG_FUNCTION_START; GtkWidget *lyricsselect; ArioLyricsCandidate *candidate; ArioLyricsEditorData *data; char *artist; char *title; if (!lyrics_...
false
false
false
false
false
0
collect_floats_value_with_info (GnmValue const *val, GnmEvalPos const *ep, CollectFlags flags, int *n, GSList **info, GnmValue **error) { GnmExpr expr_val; GnmExprConstPtr argv[1] = { &expr_val }; gnm_float *res; gnm_expr_constant_init (&expr_val.constant, val); res = collect_floats (1, argv, ep, flags, n...
false
false
false
false
false
0
themeChanged() { frames.clear(); rotationAngle = svg->elementSize("hint-rotation-angle").width(); //use an angle near to rotationAngle but that it fits an integer number of times in 360 int nFrames = 360/rotationAngle; rotationAngle = 360/nFrames; }
false
false
false
false
false
0
p_create_new_section(GapStbSecpropWidget *spw) { GapStorySection *new_section; gchar *new_section_name; if(spw == NULL) { return; } if(spw->stb_refptr == NULL) { return; } new_section = NULL; new_section_name = gap_story_generate_new_unique_section_name(spw->stb_refptr); if(new_section_name != NULL)...
false
false
false
false
false
0
is_intrinsic_module_p (Module *m) { if (!std_intrinsic_module) return false; return m == std_intrinsic_module; }
false
false
false
false
false
0
data(const QModelIndex& index, int role ) const { if (!index.isValid()) return QVariant(); if (!hasIndex(index.row(), index.column(), index.parent())) return QVariant(); const QStringList domains=d->m_browser->domains(); if (role==Qt::DisplayRole) return domains[index.row()]; return QVariant(); }
false
false
false
false
false
0
aclutil_print_aci (aci_t *aci_item, char *type) { char str[BUFSIZ]; const char *dn; if ( ! slapi_is_loglevel_set ( SLAPI_LOG_ACL ) ) return; if (!aci_item) { slapi_log_error (SLAPI_LOG_ACL, plugin_name, "acl__print_aci: Null item\n"); return; } slapi_log_error (SLAPI_LOG_ACL, plugin_name, "***B...
false
false
false
false
false
0
_tenFiberIntegrate_RK4(tenFiberContext *tfx, double forwDir[3]) { double loc[3], k1[3], k2[3], k3[3], k4[3], c1, c2, c3, c4, h; int gret; h = tfx->stepSize; c1 = h/6.0; c2 = h/3.0; c3 = h/3.0; c4 = h/6.0; _tenFiberStep[tfx->fiberType](tfx, k1); ELL_3V_SCALE_ADD2(loc, 1, tfx->wPos, 0.5*h, k1); _tenFiberP...
false
false
false
false
false
0
tb_fads_init(void) { tb_fads_t * tb_fads; /* alloc space for the data structure for passing ui info */ if ((tb_fads = g_try_new(tb_fads_t,1)) == NULL) { g_warning(_("couldn't allocate memory space for tb_fads_t")); return NULL; } tb_fads->reference_count = 1; tb_fads->dialog = NULL; tb_fads->da...
false
false
false
false
false
0
HMAC_Create(const SECHashObject *hash_obj, const unsigned char *secret, unsigned int secret_len, PRBool isFIPS) { SECStatus rv; HMACContext * cx = PORT_ZNew(HMACContext); if (cx == NULL) return NULL; rv = HMAC_Init(cx, hash_obj, secret, secret_len, isFIPS); cx->wasAllocated = PR_TRUE; ...
false
false
false
false
false
0
release(const Event& e) { SliderImpl& s = *impl_; if (s.dragging_) { if (s.showing_old_thumb_) { s.showing_old_thumb_ = false; s.old_thumb_->redraw(); } s.dragging_ = false; if (s.aborted_) { s.aborted_ = false; return; } Coord x, y; s.get_position(this, e, x, y); move_to(x - s.xoffs...
false
false
false
false
false
0
speex_buffer_read(SpeexBuffer *st, void *_data, int len) { int end, end1; char *data = _data; if (len > st->available) { SPEEX_MEMSET(data+st->available, 0, st->size-st->available); len = st->available; } end = st->read_ptr + len; end1 = end; if (end1 > st->size) end1 = st->siz...
false
false
false
false
false
0
workValuesIntoTransform( SbMatrix &mtx, const SbVec3f *translationPtr, const SbRotation *rotationPtr, const SbVec3f *scaleFactorPtr, const SbRotation *scaleOrientationPtr, const SbVec3f *centerPtr ) { SbVec3f trans, scale; SbRotation rot, scaleOrient; SbVec3f cent...
false
false
false
false
false
0
git_transport_local(git_transport **out) { transport_local *t; t = git__malloc(sizeof(transport_local)); if (t == NULL) return GIT_ENOMEM; t->parent.connect = local_connect; t->parent.ls = local_ls; t->parent.close = local_close; t->parent.free = local_free; *out = (git_transport *) t; return GIT_SUCCESS...
false
false
false
false
false
0
uri_path_parse(char *path) { char *p, *s; Ds *ds; Dsvec *dsv; dsv = dsvec_init(NULL, sizeof(Ds *)); if (path == NULL) { dsvec_add_ptr(dsv, NULL); return(dsv); } if (*path == '/') path++; for (p = s = strdup(path); *p != '\0'; p++) { if (*p == '/') { *p++ = '\0'; if (url_decode(s, NULL, &d...
false
false
false
false
false
0
execute(CEGuiSample* sampleApp) { // if initialisation failed or was cancelled by user, bail out now. if (d_ogreRoot && d_initialised) { // perform sample initialisation sampleApp->initialiseSample(); // start rendering via Ogre3D engine. CEGUI_TRY { d_og...
false
false
false
false
false
0
gt_block_set_range(GtBlock *block, GtRange r) { gt_assert(block && r.start <= r.end); block->range = r; }
false
false
false
false
false
0
mapFromChart( const Span& span, const QModelIndex& idx, const QList<Constraint>& constraints ) const { assert( model() ); if ( !idx.isValid() ) return false; assert( idx.model()==model() ); QDateTime st = d->chartXtoDateTime(span.start()); QDateTime et = d->chartXtoDateTime(span.start()+span.le...
false
false
false
false
false
0
ftp_regular_transfer(struct connectdata *conn, bool *dophase_done) { CURLcode result=CURLE_OK; bool connected=0; struct SessionHandle *data = conn->data; struct ftp_conn *ftpc = &conn->proto.ftpc; data->reqdata.size = -1; /* make sure this is unknown at this point */ Curl_pgrs...
false
false
false
false
false
0
rb_thread_inspect(thread) VALUE thread; { char *cname = rb_obj_classname(thread); rb_thread_t th = rb_thread_check(thread); const char *status = thread_status_name(th->status); VALUE str; size_t len = strlen(cname)+7+16+9+1; str = rb_str_new(0, len); /* 7:tags 16:addr 9:status 1:nul */ ...
false
false
false
false
false
0
ftt_cell_locate (FttCell * root, FttVector target, gint max_depth) { FttVector pos; gdouble size; g_return_val_if_fail (root != NULL, NULL); ftt_cell_pos (root, &pos); size = ftt_cell_size (root)/2.; if (target.x > pos.x + size || target.x < pos.x - size || target.y > pos.y + size || t...
false
false
false
false
false
0
ff_read_shortcut( FL_OBJECT * obj ) { int r; char *shortcut; if ( ( r = ff_read( "%s", &shortcut ) ) < 0 ) return ff_err( "Can't read expected object shortcut" ); if ( r == 1 ) { set_shortcut( obj, shortcut ); fl_safe_free( shortcut ); } return 0; }
false
false
false
false
false
0
wheelEvent(QWheelEvent* event) { if (event->orientation() == Qt::Vertical) { QApplication::sendEvent(m_scrollbar, event); } else { QApplication::sendEvent(m_text->horizontalScrollBar(), event); } event->ignore(); QWidget::wheelEvent(event); }
false
false
false
false
false
0
msi_wmi_query_block(int instance, int *ret) { acpi_status status; union acpi_object *obj; struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; status = wmi_query_block(MSIWMI_BIOS_GUID, instance, &output); obj = output.pointer; if (!obj || obj->type != ACPI_TYPE_INTEGER) { if (obj) { pr_err("query...
false
false
false
false
false
0
mark_maximal_literals(Literals lits) { Literals lit; if (Maximal_flag == -1) fatal_error("mark_maximal_literals, init_maximal() was not called"); /* Note: we mark the atom, not the literal. */ for (lit = lits; lit; lit = lit->next) { if (max_lit_test(lits, lit)) term_flag_set(lit->atom, Maxim...
false
false
false
false
false
0
close_scope_cb(GtkWidget *, gpointer user_data) { GtkWidget *list = (GtkWidget *)user_data; if (list) { GtkTreeIter iter; gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(user_data)), NULL, &iter); scope_entry *se = NULL; gtk_tree_model_get(GTK_TREE_MODEL(gtk_tree_view_get_model...
false
false
false
false
false
0
NsTclAdpExceptionObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj **objv) { NsInterp *itPtr = arg; char *exception; int bool; if (objc != 1 && objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "?varName?"); return TCL_ERROR; } if (itPtr->adp.exception == ADP_OK) { bool = 0; ...
false
false
false
false
false
0
ChannelMapEdit_Changed(void) { /* * New channel map. */ if (ChannelList) { hdhomerun_channel_list_destroy(ChannelList); ChannelList = NULL; } const gchar *cChannelMap = gtk_combo_box_get_active_text(ChannelMapEdit); if (!cChannelMap) { gtk_spin_button_set_range(ChannelNumberSpin, 0, 255); return; } ...
false
false
false
false
false
0
on_start_element(const Glib::ustring& name, const xmlpp::SaxParser::AttributeList& attributes) { std::cout << "Start:" << name << std::endl; depth++; // Print attributes: for (xmlpp::SaxParser::AttributeList::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter) { std::cout << " Attribute...
false
false
false
false
false
0
get_num_type_from_symbol(gchar* symbol) { gint k; for(k=0;k<Ncenters;k++) { if(strcmp(symbol,GeomOrb[k].Symb)==0) return (gint)GeomOrb[k].NumType; } return -1; }
false
false
false
false
false
0
setChipClock(unsigned int frequency) { pll_value_t pll; unsigned int ulActualMxClk; /* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */ if (getChipType() == SM750LE) return; if (frequency) { /* * Set up PLL, a structure to hold the value to be set in clocks. */ pll.inputFreq = DEFAU...
false
false
false
false
false
0
ReadBody() { _response._contents = 0; // Initialize the string char docBuffer[8192]; int bytesRead = 0; int bytesToGo = _response._content_length; if (bytesToGo < 0 || bytesToGo > _max_document_size) bytesToGo = _max_document_size; while (bytesToGo > 0) { int len = ...
false
false
false
false
false
0
addqconstant(NUMBER *q) { register NUMBER **tp; /* pointer to current number */ register NUMBER *t; /* number being tested */ unsigned long index; /* index into constant table */ long numlen; /* numerator length */ long denlen; /* denominator length */ HALF numlow; /* bottom value of numerator */ HALF denlow;...
false
false
false
true
false
1
cmd_cherry(int argc, const char **argv, const char *prefix) { struct rev_info revs; struct patch_ids ids; struct commit *commit; struct commit_list *list = NULL; const char *upstream; const char *head = "HEAD"; const char *limit = NULL; int verbose = 0; if (argc > 1 && !strcmp(argv[1], "-v")) { verbose = 1;...
true
true
true
false
false
1
cmdSave(void) { // transfer any persistent properties into the doc const gchar ** ppProps = getViewPersistentProps(); m_pDoc->setProperties(ppProps); _updateDatesBeforeSave(false); UT_Error tmpVar; tmpVar = m_pDoc->save(); if (!tmpVar) { notifyListeners(AV_CHG_SAVE); } return tmpVar; }
false
false
false
false
false
0
setUseIPv4(bool b) { if(b == use4) return; use4 = b; if(!started) return; if(use4) { if(use6) { tryPublish4(); } else { sess.reset(); tryPublish(); } } else { pub4.cancel(); have4 = false; if(!use6) sess.defer(this, "doDisable"); } }
false
false
false
false
false
0
main(int argc, char** argv) { Session* session = new Session("gclock", argc, argv, options); WidgetKit& kit = *WidgetKit::instance(); UpdatableTime* utime = new UpdatableTime(); tic = new IOCallback(UpdatableTime)( utime, &UpdatableTime::tic_handler); TimeGlyph* tg = new TimeGlyph(session->style()...
false
false
false
false
false
0
via_cmdbuf_lag(drm_via_private_t *dev_priv) { uint32_t agp_base = dev_priv->dma_offset + (uint32_t) dev_priv->agpAddr; uint32_t hw_addr = *(dev_priv->hw_addr_ptr) - agp_base; return ((hw_addr <= dev_priv->dma_low) ? (dev_priv->dma_low - hw_addr) : (dev_priv->dma_wrap + dev_priv->dma_low - hw_addr)); }
false
false
false
false
false
0
fullest_bucket(struct tdb_context *tdb, const tdb_off_t *group, unsigned new_bucket) { unsigned counts[1 << TDB_HASH_GROUP_BITS] = { 0 }; unsigned int i, best_bucket; /* Count the new entry. */ counts[new_bucket]++; best_bucket = new_bucket; for (i = 0; i < (1 << TDB_HASH_GROUP_BITS); i++) {...
false
false
false
false
false
0
status_set_angle_xy(const char *tooltip, struct coord v) { if (!v.x && !v.y) status_set_angle(tooltip, "a = 0 deg"); else status_set_angle(tooltip, "a = %3.1f deg", theta_vec(v)); }
false
false
false
false
false
0
set_voltage_sel(struct regulator_dev *rdev, unsigned selector) { const struct supply_info *info; struct tps6524x *hw; hw = rdev_get_drvdata(rdev); info = &supply_info[rdev_get_id(rdev)]; if (rdev->desc->n_voltages == 1) return -EINVAL; return write_field(hw, &info->voltage, selector); }
false
false
false
false
false
0