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
get_stat_result(struct chirp_client *c, struct chirp_stat *info, time_t stoptime) { char line[CHIRP_LINE_MAX]; INT64_T fields; memset(info, 0, sizeof(*info)); if(!link_readline(c->link, line, CHIRP_LINE_MAX, stoptime)) { c->broken = 1; errno = ECONNRESET; return -1; } fields = sscanf(line, "%" SCNd64 " %...
true
true
false
false
false
1
get_non_symmetric_f (GMT_LONG *f, GMT_LONG n) { /* Return the product of the non-symmetric factors in f[] */ GMT_LONG i = 0, j = 1, retval = 1; if (n == 1) return(f[0]); while(i < n) { while(j < n && f[j] == f[i]) j++; if ((j-i)%2) retval *= f[i]; i = j; j = i + 1; } if (retval == 1) retval = 0; /* The...
false
false
false
false
false
0
get_pattern(const char *string, int case_matters) { struct pat_cache_entry *entry, **entry_ptr; entry = pat_cache; entry_ptr = &pat_cache; while (1) { if (entry->string && !strcmp(string, entry->string) && case_matters == entry->case_matters) { /* A cache hit; move this entry to the front o...
false
false
false
false
false
0
fl_hide_command_log( void ) { create_logger( ); if ( logger->cmd->visible ) fl_hide_form( logger->cmd ); }
false
false
false
false
false
0
b_resize() { char **src; int src_lines,i; char line[BUFFER_SIZE],*lp; int cont; int color; src_lines=b_bottom-b_first; if (term_width==COLS) return; term_width=COLS; /* FIXME: unlike old code, this will not work with a hard memory cap */ if (!(src=CALLOC(src_lines,char*...
false
false
false
false
false
0
sync() { if (!m_NeedsSync) return; if (m_UserSettings) m_UserSettings->sync(); if (m_NetworkSettings) m_NetworkSettings->sync(); m_NeedsSync = false; Q_EMIT userSettingsSynchronized(); }
false
false
false
false
false
0
dataSetList(std::ostream& os) { const int count = sizeof(records_)/sizeof(records_[0]); for (int i=0; i < count; ++i) { const DataSet *record = records_[i]; for (int j=0; record != 0 && record[j].number_ != 0xffff; ++j) { os << record[j] << "\n"; }...
false
false
false
false
false
0
gegl_buffer_create_sub_buffer (GeglBuffer *buffer, const GeglRectangle *extent) { g_return_val_if_fail (GEGL_IS_BUFFER (buffer), NULL); #if 1 if (extent == NULL || gegl_rectangle_equal (extent, &buffer->extent)) { g_object_ref (buffer); return buffer; } #...
false
false
false
false
false
0
MultiSolve(bool new_matrix, const Index* ia, const Index* ja, Index nrhs, double* rhs_vals, bool check_NegEVals, Index numberOfNegEVals) { DBG_START_METH("PardisoSolverInterface::MultiSolve",dbg_verbosity); DBG_ASSERT(!check_NegEVals || ProvidesInertia()); DBG_ASSERT(in...
false
false
false
false
false
0
styleCheckSubPrototype(LexAccessor &styler, unsigned int bk) { // backtrack to identify if we're starting a subroutine prototype // we also need to ignore whitespace/comments: // 'sub' [whitespace|comment] <identifier> [whitespace|comment] styler.Flush(); skipWhitespaceComment(styler, bk); if (bk == 0 || styler.S...
false
false
false
false
false
0
ocrdma_build_ud_hdr(struct ocrdma_qp *qp, struct ocrdma_hdr_wqe *hdr, struct ib_send_wr *wr) { struct ocrdma_ewqe_ud_hdr *ud_hdr = (struct ocrdma_ewqe_ud_hdr *)(hdr + 1); struct ocrdma_ah *ah = get_ocrdma_ah(ud_wr(wr)->ah); ud_hdr->rsvd_dest_qpn = ud_wr(wr)->remote_qpn; if (qp->qp_type == IB_QPT_GSI) u...
false
false
false
false
false
0
init_config_boards() { static gboolean called_once = FALSE; GList *python_boards; GList *list; PyObject* globals; static char *python_args[]={ "" }; static char* python_prog_name="gcompris"; char* boardclass; char* board_file_name; PyObject* main_module; char* boarddir; GcomprisProperties *propert...
false
false
false
false
false
0
good() const { if (io_->open() != 0) return false; IoCloser closer(*io_); return ImageFactory::checkType(imageType_, *io_, false); }
false
false
false
false
false
0
gdFreeDynamicCtx(struct gdIOCtx *ctx) { dynamicPtr *dp; dpIOCtx *dctx; dctx = (dpIOCtx *)ctx; dp = dctx->dp; gdFree(ctx); /* clean up the data block and return it */ /* 2.0.21: never free memory we don't own */ if((dp->data != NULL) && (dp->freeOK)) { gdFree(dp->data); dp->data = NULL; } dp->realSize ...
false
false
false
false
false
0
glade_signal_editor_drag_begin (GtkWidget *widget, GdkDragContext *context, gpointer user_data) { cairo_surface_t *s = NULL; GtkTreeModel *model; GtkTreeIter iter; GtkTreeSelection *selection; selection = gtk_tree_view_get_selection (GTK_TREE_V...
false
false
false
false
false
0
GetBalloonImage(vtkProp *prop) { vtkPropMapIterator iter = this->PropMap->find(prop); if ( iter != this->PropMap->end() ) { return (*iter).second.Image; } return NULL; }
false
false
false
false
false
0
getString(int tab1, int tab2) const { int i, pos = 0; char lines[15], cols[15], res[50]; if (m_line < 0) strcpy(lines, "?"); else sprintf(lines, "%d", m_line); if (m_col < 0) strcpy(cols, "?"); else sprintf(cols, "%d", m_col-1); for (i = tab1-strlen(lines); i > 0; i--) { res[pos++] = ' '; } i = 0; while (li...
false
false
false
false
false
0
xtr_get_set ( const char *p , const char *z , u8 *classp , u8 *valuep , int *countp ) { const char* q = xtr_get_token(p, z, classp, valuep, countp) ; if (!q) return NULL ; if (!*classp && *q == '-') { u8 range_top = 0 ; q = xtr_get_token(q+1, z, NULL, &range_top, NULL) ...
false
false
false
false
false
0
panel_properties_dialog_opacity_scale_setup (PanelPropertiesDialog *dialog, GtkBuilder *gui) { GtkWidget *opacity_label; GtkWidget *opacity_legend; dialog->opacity_scale = PANEL_GTK_BUILDER_GET (gui, "opacity_scale"); g_return_if_fail (dialog->opacity_scale != NULL); opacity_label = PANEL_GTK...
false
false
false
false
false
0
WBMPWriteInteger(Image *image,const size_t value) { int bits, flag, n; register ssize_t i; unsigned char buffer[5], octet; n=1; bits=28; flag=MagickFalse; for (i=4; i >= 0; i--) { octet=(unsigned char) ((value >> bits) & 0x7f); if ((flag == 0) && (octet != 0)) { ...
true
true
false
false
false
1
SetIntAndUpdateVideo(int *ptr, int value) { int old_value = *ptr; if (old_value != value) { *ptr = value; if (!VIDEOMODE_Update()) { *ptr = old_value; return FALSE; } } return TRUE; }
false
false
false
false
false
0
cr_parser_parse_declaration_core (CRParser * a_this) { CRToken *token = NULL; CRInputPos init_pos; enum CRStatus status = CR_ERROR; CRString *prop = NULL; g_return_val_if_fail (a_this && PRIVATE (a_this), CR_BAD_PARAM_ERROR); RECORD_INITIAL_POS (a_this, &init_pos); ...
false
false
false
false
false
0
ng_dev_fini(struct ng_devstate *dev) { switch (dev->type) { case NG_DEV_NONE: /* nothing */ break; case NG_DEV_VIDEO: dev->v->fini(dev->handle); break; case NG_DEV_DSP: dev->a->fini(dev->handle); break; case NG_DEV_MIX: dev->m->fini(dev->handle); break; } memset(dev,0,sizeof(*dev)); ...
false
false
false
false
false
0
hwloc__nolibxml_import_get_content(hwloc__xml_import_state_t state, char **beginp, size_t expected_length) { hwloc__nolibxml_import_state_data_t nstate = (void*) state->data; char *buffer = nstate->tagbuffer; size_t length; char *end; /* auto-closed tags have no content */ if (nstate->closed) re...
false
false
false
false
false
0
size_seg (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) { flagword flags; fragS *fragp; segment_info_type *seginfo; int x; valueT size, newsize; subseg_change (sec, 0); seginfo = seg_info (sec); if (seginfo && seginfo->frchainP) { for (fragp = seginfo->frchainP->frch_root; fragp; fra...
false
false
false
false
false
0
rb_mod_included_modules(VALUE mod) { VALUE ary = rb_ary_new(); VALUE p; for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) { if (BUILTIN_TYPE(p) == T_ICLASS) { rb_ary_push(ary, RBASIC(p)->klass); } } return ary; }
false
false
false
false
false
0
GetOrientationTypeMSD(WordsRange currRange) const { if (m_first) { if (currRange.GetStartPos() == 0) { return M; } else { return D; } } if (m_prevRange.GetEndPos() == currRange.GetStartPos()-1) { return M; } else if (m_prevRange.GetStartPos() == currRange.GetEndPos()+1) { return ...
false
false
false
false
false
0
P_Iconify_Window (Object w, Object scr) { Check_Type (w, T_Window); if (!XIconifyWindow (WINDOW(w)->dpy, WINDOW(w)->win, Get_Screen_Number (WINDOW(w)->dpy, scr))) Primitive_Error ("cannot iconify window"); return Void; }
false
false
false
false
false
0
map_who_sub(void *key,void *data,va_list ap) { struct charid2nick *p; int fd; nullpo_retr(-1, ap); nullpo_retr(-1, data); nullpo_retr(-1, p = (struct charid2nick *)data); fd = va_arg(ap,int); if( p->ip != 0 && p->port != 0 && !(battle_config.hide_GM_session && pc_numisGM(p->account_id)) ) clif_displaymessag...
false
false
false
false
false
0
cifs_inode_needs_reval(struct inode *inode) { struct cifsInodeInfo *cifs_i = CIFS_I(inode); struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); if (CIFS_CACHE_READ(cifs_i)) return false; if (!lookupCacheEnabled) return true; if (cifs_i->time == 0) return true; if (!cifs_sb->actimeo) return true; if...
false
false
false
false
false
0
usb_show_dynids(struct usb_dynids *dynids, char *buf) { struct usb_dynid *dynid; size_t count = 0; list_for_each_entry(dynid, &dynids->list, node) if (dynid->id.bInterfaceClass != 0) count += scnprintf(&buf[count], PAGE_SIZE - count, "%04x %04x %02x\n", dynid->id.idVendor, dynid->id.idProduct, ...
false
false
false
false
false
0
test_save_load() { SUITE_START("load and save"); BIT_ARRAY* arr1 = bit_array_create(0); BIT_ARRAY* arr2 = bit_array_create(0); // Empty array _test_save_load(arr1, arr2); // Ten 0s bit_array_resize(arr1, 10); _test_save_load(arr1, arr2); // Thousand 1s: bit_array_resize(arr1, 1000); bit_array_...
false
false
false
false
false
0
ext4_calculate_overhead(struct super_block *sb) { struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = sbi->s_es; ext4_group_t i, ngroups = ext4_get_groups_count(sb); ext4_fsblk_t overhead = 0; char *buf = (char *) get_zeroed_page(GFP_NOFS); if (!buf) return -ENOMEM; /* * Compute the overh...
false
false
false
false
false
0
orte_iof_base_write_event_destruct(orte_iof_write_event_t* wev) { opal_event_free(wev->ev); if (ORTE_PROC_IS_HNP) { int xmlfd = fileno(orte_xml_fp); if (xmlfd == wev->fd) { /* don't close this one - will get it later */ OBJ_DESTRUCT(&wev->outputs); return; ...
false
false
false
false
false
0
MakeSymbol(FILE *fp, unsigned int pins, int inputBubbles, int outputBubbles, int (*body)(FILE *, int, int, unsigned int, unsigned int)) { unsigned int i; int rc; int bodyx, bodyy; /* origin of body */ int outputx, outputy; /* origin of output pin */ int firstx, firsty; /* first end of first i...
true
true
false
false
false
1
faced_string_self_print (struct faced_string * faced_string, FILE * stream) { if (faced_string->string) fprintf (stream, "\"%s\": ", faced_string->string); else fprintf (stream, "\\%d: ", faced_string->reg_ref); fface_self_print (faced_string->face, stream); }
false
false
false
false
false
0
CorpseRemoved(uint32&) override { // TODO: would be better to cast a dummy spell Map* pMap = m_creature->GetMap(); if (!pMap || !pMap->IsBattleGround()) { return; } Map::PlayerList const& PlayerList = pMap->GetPlayers(); for (Map::PlayerList::co...
false
false
false
false
false
0
quota_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name) { int32_t ret = 0; if ((name != NULL) && strcasecmp (name, "trusted.limit.list") == 0) { ret = quota_send_dir_limit_to_cli (frame, this, loc->inode, ...
false
false
false
false
false
0
nm_auth_changed_func_unregister (GDestroyNotify callback, gpointer callback_data) { GSList *iter; for (iter = funcs; iter; iter = g_slist_next (iter)) { PkChangedInfo *info = iter->data; if ((callback == info->changed_callback) && (callback_data == info->changed_data)) { g_free (info); funcs = g_slist_del...
false
false
false
false
false
0
hts221_i2c_read(struct device *dev, u8 addr, int len, u8 *data) { struct i2c_msg msg[2]; struct i2c_client *client = to_i2c_client(dev); if (len > 1) addr |= I2C_AUTO_INCREMENT; msg[0].addr = client->addr; msg[0].flags = client->flags; msg[0].len = 1; msg[0].buf = &addr; msg[1].addr = client->addr; msg[1]...
false
false
false
false
false
0
range_fits_type_p (value_range_t *vr, unsigned precision, bool unsigned_p) { tree src_type; unsigned src_precision; double_int tem; /* We can only handle integral and pointer types. */ src_type = TREE_TYPE (vr->min); if (!INTEGRAL_TYPE_P (src_type) && !POINTER_TYPE_P (src_type)) return false; ...
false
false
false
false
false
0
PipelineModifiedCallback() { DataObjectPointer input = this->GetInput(0); if ( !input ) { itkExceptionMacro(<< "Need to set an input"); } ModifiedTimeType pipelineMTime = input->GetPipelineMTime(); if ( this->GetMTime() > pipelineMTime ) { pipelineMTime = this->GetMTime(); } // Pip...
false
false
false
false
false
0
addArg(const ArConfigArg &arg) { // Children can only be added to LIST or LIST_HOLDER type parameters if (!isListType()) { ArLog::log(ArLog::Normal, "ArConfigArg::addArg() child %s not added to %s (type %s), type must be %s or %s", arg.getName(), getName(), ...
false
false
false
false
false
0
scheduleUpdate() { if (m_updateRequested) return; m_updateRequested = true; QTimer::singleShot(0, this, SLOT(update())); }
false
false
false
false
false
0
get_res(anthy_context_t ac, char *res_buf, int conv) { struct anthy_conv_stat acs; int i; anthy_get_stat(ac, &acs); res_buf[0] = 0; if (!conv) { strcat(res_buf, "|"); } for (i = 0; i < acs.nr_segment; i++) { char buf[1024]; if (conv) { anthy_get_segment(ac, i, 0, buf, 1024); strca...
true
true
false
false
false
1
poll(bool can_read) { Debug( std::cout << "** Server(" << m_state << ") : " << std::endl; ); std::string out; if (m_state == SERVER_GREETING) { // send server greeting m_socket << "ATLAS " << m_outName << std::endl; m_state = CLIENT_GREETING; Debug( std::cout << "serv...
false
false
false
false
false
0
asn1_get_mpi( unsigned char **p, const unsigned char *end, mpi *X ) { int ret, len; if( ( ret = asn1_get_tag( p, end, &len, ASN1_INTEGER ) ) != 0 ) return( ret ); ret = mpi_read_binary( X, *p, len ); *p += len; return( ret ); }
false
false
false
false
false
0
pretty_process(const char *infile, bool file_is_expr, const char *outfile, const char *templ, ErrorHandler *errh) { String r_config; RouterT *r = pretty_read_router(infile, file_is_expr, errh, r_config); if (!r) return; // open output file FILE *outf = open_output_file(outfile, errh); ...
false
false
false
false
false
0
prepareForShutdown(int flags) { int save = flags & REDIS_SHUTDOWN_SAVE; int nosave = flags & REDIS_SHUTDOWN_NOSAVE; redisLog(REDIS_WARNING,"User requested shutdown..."); /* Kill the saving child if there is a background saving in progress. We want to avoid race conditions, for instance our savin...
false
false
false
false
false
0
__pyx_f_9lightning_4impl_14primal_cd_fast_7Squared_update(CYTHON_UNUSED struct __pyx_obj_9lightning_4impl_14primal_cd_fast_Squared *__pyx_v_self, CYTHON_UNUSED int __pyx_v_j, double __pyx_v_z_diff, double __pyx_v_C, int *__pyx_v_indices, double *__pyx_v_data, int __pyx_v_n_nz, CYTHON_UNUSED double *__pyx_v_y, double *_...
false
false
false
false
false
0
pod_startup4(struct work_struct *work) { struct usb_line6_pod *pod = container_of(work, struct usb_line6_pod, startup_work); struct usb_line6 *line6 = &pod->line6; CHECK_STARTUP_PROGRESS(pod->startup_progress, POD_STARTUP_SETUP); /* serial number: */ line6_read_serial_number(&pod->line6, &pod->serial_number...
false
false
false
false
false
0
ircclient_generate_nick(struct ircproxy *p, const char *tried) { char *c, *nick; int ret; c = nick = (char *)malloc(strlen(tried) + 2); strcpy(nick, tried); c += strlen(nick) - 1; /* We add -'s until we can't, then we move back through them cycling them 0..9 then finally _ until the whole ni...
false
true
false
false
false
1
gst_scaletempo_set_caps (GstBaseTransform * trans, GstCaps * incaps, GstCaps * outcaps) { GstScaletempo *scaletempo = GST_SCALETEMPO (trans); gint width, bps, nch, rate; gboolean use_int; GstAudioInfo info; if (!gst_audio_info_from_caps (&info, incaps)) return FALSE; nch = GST_AUDIO_INFO_CHANNELS...
false
false
false
false
false
0
AddKeepPath(const std::string& dir) { std::string cdir; Realpath(SystemTools::CollapseFullPath(dir).c_str(), cdir); SystemTools::AddTranslationPath(cdir, dir); }
false
false
false
false
false
0
internal_lock_count (call_frame_t *frame, xlator_t *this) { afr_local_t *local = NULL; afr_private_t *priv = NULL; int32_t call_count = 0; int i = 0; local = frame->local; priv = this->private; if (local->fd) { for (i = 0; i < priv->child_cou...
false
false
false
false
false
0
umclear(void) { UNDO *undo; for (undo = undos.link.next; undo != &undos; undo = undo->link.next) { UNDOREC *rec; for (rec = undo->recs.link.next; rec != &undo->recs; rec = rec->link.next) rec->min = 0; } }
false
false
false
false
false
0
makemainindex(const char *file, const char *index) { FILE *op; op = fopen(makepath(distpath, file, NULL), "w"); if (!op) die("cannot make file '%s'.", file); fputs_nl(gen_page_begin(title, TOPDIR), op); fputs_nl(body_begin, op); if (insert_header) fputs(gen_insert_header(TOPDIR), op); fputs(index, op); if ...
false
false
false
false
true
1
sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC) TSRMLS_DC) { if (SG(sapi_started) && EG(in_execution)) { return FAILURE; } sapi_module.treat_data = treat_data; return SUCCESS; }
false
false
false
false
false
0
H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata, hid_t dxpl_id) { const H5O_shared_t *shared_src = (const H...
false
false
false
false
false
0
amd_gpio_set(struct gpio_chip *chip, unsigned offset, int value) { struct amd_gpio *agp = to_agp(chip); u8 temp; unsigned long flags; spin_lock_irqsave(&agp->lock, flags); temp = ioread8(agp->pm + AMD_REG_GPIO(offset)); temp = (temp & AMD_GPIO_DEBOUNCE) | AMD_GPIO_MODE_OUT | (value ? AMD_GPIO_X_OUT_HI : AMD_GPIO...
false
false
false
false
false
0
prepareUtf8(const UString& s) { // Allocate a buffer big enough to hold all the characters plus \0 const int length = s.size(); _buffer = new char[length * 3 + 1]; // Also create buffer for positions. We need one extra character in there, // even past the \0 since the non-empty handling may jump one past the...
false
false
false
false
false
0
method_jitted (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji, int result) { if (result != MONO_PROFILE_OK) return; register_method_local (prof, method, ji); process_requests (prof); }
false
false
false
false
false
0
l3dss1_progress(struct l3_process *pc, u_char pr, void *arg) { struct sk_buff *skb = arg; int err = 0; u_char *p; if ((p = findie(skb->data, skb->len, IE_PROGRESS, 0))) { if (p[1] != 2) { err = 1; pc->para.cause = 100; } else if (!(p[2] & 0x70)) { switch (p[2]) { case 0x80: case 0x81: case 0x...
false
false
false
false
false
0
ceph_get_acl(struct inode *inode, int type) { int size; const char *name; char *value = NULL; struct posix_acl *acl; switch (type) { case ACL_TYPE_ACCESS: name = POSIX_ACL_XATTR_ACCESS; break; case ACL_TYPE_DEFAULT: name = POSIX_ACL_XATTR_DEFAULT; break; default: BUG(); } size = __ceph_getxattr(in...
false
false
false
false
false
0
enumDeclaration(Node *n) { String *name = Getattr(n, "name"); String *tdname = Getattr(n, "tdname"); /* Using name if tdname is empty. */ if(Len(tdname) == 0) tdname = name; if(!tdname || Strcmp(tdname, "") == 0) { Language::enumDeclaration(n); return SWIG_OK; } String *mangled_tdna...
false
false
false
false
false
0
unity_internal_scope_channel_create_backend_model (UnityInternalScopeChannel* self, GHashTable* metadata_schema, gboolean no_filtering, DeeSerializableModel** real_backend) { DeeSerializableModel* _vala_real_backend = NULL; DeeSerializableModel* result = NULL; DeeSequenceModel* backend = NULL; DeeSequenceModel* _tm...
false
false
false
false
false
0
dbop_lastdat(DBOP *dbop, int *size) { if (size) *size = dbop->lastsize; return dbop->lastdat; }
false
false
false
false
false
0
sockaddr_set_port(struct sockaddr *sa, in_port_t port) { switch (sa->sa_family) { case AF_INET: ((struct sockaddr_in *)sa)->sin_port = htons (port); break; case AF_INET6: ((struct sockaddr_in6 *)sa)->sin6_port = htons (port); break; } }
false
false
false
false
false
0
oom_adjust(void) { int fd, err; char path[64]; /* Avoid oom-killer */ sprintf(path, "/proc/%d/oom_adj", getpid()); fd = open(path, O_WRONLY); if (fd < 0) { fprintf(stderr, "can't adjust oom-killer's pardon %s, %m\n", path); return errno; } err = write(fd, "-17\n", 4); if (err < 0) { fprintf(stderr, "can...
false
false
false
false
false
0
gsl_complex_arg (gsl_complex z) { /* return arg(z), -pi < arg(z) <= +pi */ double x = GSL_REAL (z); double y = GSL_IMAG (z); if (x == 0.0 && y == 0.0) { return 0; } return atan2 (y, x); }
false
false
false
false
false
0
camAllocateYUVImageEx(CamImage *image, int width, int height, int depth) { int i,psize; image->nSize=sizeof(CamImage); image->channelSeq[0]='Y'; image->channelSeq[1]='U'; image->channelSeq[2]='V'; image->channelSeq[3]=0; image->colorModel[0]='Y'; image->colorModel[1]='U'; i...
false
false
false
false
false
0
ixgbe_check_cs4227(struct ixgbe_hw *hw) { u32 swfw_mask = hw->phy.phy_semaphore_mask; s32 status; u16 value; u8 retry; for (retry = 0; retry < IXGBE_CS4227_RETRIES; retry++) { status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); if (status) { hw_err(hw, "semaphore failed with %d\n", status); msleep(IX...
false
false
false
false
false
0
dgap_get_modem_info(struct channel_t *ch, unsigned int __user *value) { int result; u8 mstat; ulong lock_flags; spin_lock_irqsave(&ch->ch_lock, lock_flags); mstat = readb(&ch->ch_bs->m_stat); /* Append any outbound signals that might be pending... */ mstat |= ch->ch_mostat; spin_unlock_irqrestore(&ch->ch_loc...
false
false
false
false
false
0
BackendStartup(Port *port) { Backend *bn; /* for backend cleanup */ pid_t pid; /* * Create backend data structure. Better before the fork() so we can * handle failure cleanly. */ bn = (Backend *) malloc(sizeof(Backend)); if (!bn) { ereport(LOG, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("ou...
false
false
false
false
true
1
select( const QModelIndex &index, QItemSelectionModel::SelectionFlags command ) { // Don't allow the current selection to be cleared if ( !index.isValid() && ( command & QItemSelectionModel::Clear ) ) { return; } QItemSelectionModel::select( index, command ); }
false
false
false
false
false
0
gstspu_vobsub_handle_new_buf (GstDVDSpu * dvdspu, GstClockTime event_ts, GstBuffer * buf) { GstMapInfo map; guint8 *start, *end; SpuState *state = &dvdspu->spu_state; #if DUMP_DCSQ gst_dvd_spu_dump_dcsq (dvdspu, event_ts, buf); #endif if (G_UNLIKELY (gst_buffer_get_size (buf) < 4)) goto invalid; ...
false
false
false
false
false
0
IsCritical() const { if (IsNegative() == true || S->Type == pkgCache::Dep::Depends || S->Type == pkgCache::Dep::PreDepends) return true; return false; }
false
false
false
false
false
0
nm_utils_hwaddr_ntoa (gconstpointer addr, int type) { const guint8 *in = addr; GString *out = g_string_new (NULL); int left = nm_utils_hwaddr_len (type); while (left--) { if (out->len) g_string_append_c (out, ':'); g_string_append_printf (out, "%02X", *in++); } return g_string_free (out, FALSE); }
false
false
false
false
false
0
ComputeAllPossibleHelp(Planet* p) { map<int, pair<int, int> > help; int accumulated_help = 0; vector<Planet*> safe_planets = game_state->GetMySafePlanetsSortedByDistanceToPlanet(p->PlanetID()); for(vector<Planet*>::iterator it = safe_planets.begin(); it < safe_planets.end(); ++it) { int safe_planet_id = (*i...
false
false
false
false
false
0
cpcihp_generic_init(void) { int status; struct resource *r; struct pci_dev *dev; info(DRIVER_DESC " version: " DRIVER_VERSION); status = validate_parameters(); if (status) return status; r = request_region(port, 1, "#ENUM hotswap signal register"); if (!r) return -EBUSY; dev = pci_get_domain_bus_and_slo...
false
false
false
false
false
0
CreateDeviceCombo(Barry::Pin pin) { const Barry::Probe::Results &results = wxGetApp().GetResults(); // default to: // no device selected, if multiple available and no default given // no devices available, if nothing there // the first device, if only one exists int selected = 0; // create a list of selections...
false
false
false
false
false
0
sweepstrings (lua_State *L, int all) { int i; for (i=0; i<G(L)->strt.size; i++) { /* for each list */ G(L)->strt.nuse -= sweeplist(L, &G(L)->strt.hash[i], all); } }
false
false
false
false
false
0
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) { return ((e_config->powersave.min != cfdata->powersave_min) || (e_config->powersave.max != cfdata->powersave_max) || (e_config->powersave.none != cfdata->powersave_none) || (e_config->powersave.low !...
false
false
false
false
false
0
nsslowcert_DeletePermCRL(NSSLOWCERTCertDBHandle *handle, const SECItem *derName, PRBool isKRL) { SECStatus rv; certDBEntryType crlType = isKRL ? certDBEntryTypeKeyRevocation : certDBEntryTypeRevocation; rv = DeleteDBCrlEntry(handle, derName, crlType); if (rv != SECSuccess) goto done...
false
false
false
false
false
0
ocfs2_refresh_qinfo(struct ocfs2_mem_dqinfo *oinfo) { struct mem_dqinfo *info = sb_dqinfo(oinfo->dqi_gi.dqi_sb, oinfo->dqi_gi.dqi_type); struct ocfs2_lock_res *lockres = &oinfo->dqi_gqlock; struct ocfs2_qinfo_lvb *lvb = ocfs2_dlm_lvb(&lockres->l_lksb); struct buffer_head *bh = NULL; struct ocfs2_global_di...
false
false
false
false
false
0
filter_options(const char *argv[], bool blame) { filter_rev_parse(&opt_file_argv, "--no-revs", "--no-flags", argv); if (blame) filter_rev_parse(&opt_blame_argv, "--no-revs", "--flags", argv); else filter_rev_parse(&opt_diff_argv, "--no-revs", "--flags", argv); filter_rev_parse(&opt_rev_argv, "--symbolic", "--...
false
false
false
false
false
0
tds_free_compute_results(TDSSOCKET * tds) { int i; TDSCOMPUTEINFO ** comp_info = tds->comp_info; TDS_INT num_comp = tds->num_comp_info; tds->comp_info = NULL; tds->num_comp_info = 0; for (i = 0; i < num_comp; i++) { if (comp_info && comp_info[i]) { if (tds->current_results == comp_info[i]) tds->current...
false
false
false
false
false
0
php_ereg_eprint(int err, regex_t *re TSRMLS_DC) { char *buf = NULL, *message = NULL; size_t len; size_t buf_len; #ifdef REG_ITOA /* get the length of the message */ buf_len = regerror(REG_ITOA | err, re, NULL, 0); if (buf_len) { buf = (char *)safe_emalloc(buf_len, sizeof(char), 0); if (!buf) return; /* fail ...
false
false
false
false
false
0
Unpack_MEDIUM(UCHAR *in, UCHAR *out, USHORT origsize){ USHORT i, j, c; UCHAR u, *outend; initbitbuf(in); outend = out+origsize; while (out < outend) { if (GETBITS(1)!=0) { DROPBITS(1); *out++ = dms_text[dms_medium_text_loc++ & MBITMASK] = (UCHAR)GETBITS(8); DROPBITS(8); } else { DROPBITS(1); ...
false
false
false
false
false
0
test_search_sequence(sge_sl_list_t *list, bool forward, const char *key, const char *expected, u_long32 elems, const char *function) { bool ret = true; DENTER(TOP_LAYER, "test_sequence"); if (ret) { sge_sl_elem_t *next; sge_sl_elem_t *current; ret &= sge_sl_lock(list); ...
false
false
false
false
false
0
socket_connected(int s) { struct sockaddr si; socklen_t sl=sizeof si; if (getpeername(s,&si,&sl)) return 0; return 1; }
false
false
false
false
false
0
CloseAllFiles(bool dontsave) { // first try to close modified editors if (!dontsave && !QueryCloseAllFiles()) return false; // now free the rest of the project files Manager::Get()->GetEditorManager()->HideNotebook(); for (FilesList::iterator it = m_Files.begin(); it != m_Files.end(); ...
false
false
false
false
false
0
__tty_alloc_driver(unsigned int lines, struct module *owner, unsigned long flags) { struct tty_driver *driver; unsigned int cdevs = 1; int err; if (!lines || (flags & TTY_DRIVER_UNNUMBERED_NODE && lines > 1)) return ERR_PTR(-EINVAL); driver = kzalloc(sizeof(struct tty_driver), GFP_KERNEL); if (!driver) re...
false
false
false
false
false
0
dump_refreshCheckHelper(StoreEntry * sentry, const char *name, const refresh_check_helper * list) { const refresh_check_helper *node = list; const refresh_check_format *format; const wordlist *word; if (node) { storeAppendPrintf(sentry, "%s", name); if (node->children != DEFAULT_REFRESH_CHECK_CHILDREN...
false
false
false
false
false
0
gearman_result_string(const gearman_result_st *self) { if (not self or self->_type != GEARMAN_RESULT_BINARY) { gearman_string_t ret= {0, 0}; return ret; } return gearman_string(&self->value.string); }
false
false
false
false
false
0
lazy_vacuum_page(Relation onerel, BlockNumber blkno, Buffer buffer, int tupindex, LVRelStats *vacrelstats) { Page page = BufferGetPage(buffer); OffsetNumber unused[MaxOffsetNumber]; int uncnt = 0; START_CRIT_SECTION(); for (; tupindex < vacrelstats->num_dead_tuples; tupindex++) { BlockNumber tblk; O...
false
false
false
false
false
0
jpgDecode_openXform ( IP_XFORM_HANDLE *pXform) /* out: returned handle */ { PJDEC_INST g; INSURE (pXform != NULL); IP_MEM_ALLOC (sizeof(JDEC_INST), g); *pXform = g; memset (g, 0, sizeof(JDEC_INST)); g->dwValidChk = CHECK_VALUE; decode_init (g); return IP_DONE; fatal_error: ...
false
false
false
false
true
1
sco_connect(bdaddr_t *src, bdaddr_t *dst, uint16_t *handle, uint16_t *mtu) { struct sockaddr_sco addr; struct sco_conninfo conn; struct sco_options opts; socklen_t size; int s; if ((s = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_SCO)) < 0) { return -1; } memset(&addr, 0, sizeof(addr)); addr.sco_family = ...
false
false
false
false
false
0
FreeList(listOLD * pl, int nLevel) { /* Levels are: * 0 - GameTreeSeq * 1 - GameTree * 2 - Sequence * 3 - Node * 4 - Property */ if (nLevel == 1) { FreeList(pl->plNext->p, 2); /* initial sequence */ ListDelete(pl->plNext); nLevel = 0; /...
false
false
false
false
false
0
EnvvarStringTokeniser(const wxString& str) { #if defined(TRACE_ENVVARS) Manager::Get()->GetLogManager()->DebugLog(F(_T("EnvvarStringTokeniser"))); #endif // tokenise string like: // C:\Path;"D:\Other Path" wxArrayString out; wxString search = str; search.Trim(true).Trim(false); // trivial case: string ...
false
false
false
false
false
0