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_option_group (CutModuleFactory *factory, GOptionContext *context) { CutXMLStreamFactory *xml = CUT_XML_STREAM_FACTORY(factory); GOptionGroup *group; GOptionEntry entries[] = { {NULL} }; if (CUT_MODULE_FACTORY_CLASS(parent_class)->set_option_group) CUT_MODULE_FACTORY_CLASS(parent...
false
false
false
false
false
0
git_branch_list_command_monitor_changed (GFileMonitor *file_monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, GitBranchListCommand *self) { /* Git must overwrite this file d...
false
false
false
false
false
0
v4lconvert_grey_to_yuv420(const unsigned char *src, unsigned char *dest, const struct v4l2_format *src_fmt) { int x, y; /* Y */ for (y = 0; y < src_fmt->fmt.pix.height; y++) for (x = 0; x < src_fmt->fmt.pix.width; x++) *dest++ = *src++; /* Clear U/V */ memset(dest, 0x80, src_fmt->fmt.pix.width * src_fmt->...
false
false
false
false
false
0
node_extract_user_agent(struct gnutella_node *n, const header_t *head) { const char *field; field = header_get(head, "User-Agent"); if (field) { const char *token = header_get(head, "X-Token"); if ( !version_check(field, token, n->addr) || !node_is_authentic(field, head) ) { n->flags |= NODE_F_FAKE_N...
false
false
false
false
false
0
layer3hybrid(int ch,int gr,REAL in[SBLIMIT][SSLIMIT], REAL out[SSLIMIT][SBLIMIT]) { layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]); int bt1,bt2; REAL *prev1,*prev2; prev1=prevblck[ch][currentprevblock][0]; prev2=prevblck[ch][currentprevblock^1][0]; bt1 = gi->mixed_block_flag ? 0 : gi->bl...
false
false
false
false
false
0
output_pending_init_elements (int all, struct obstack * braced_init_obstack) { struct init_node *elt = constructor_pending_elts; tree next; retry: /* Look through the whole pending tree. If we find an element that should be output now, output it. Otherwise, set NEXT to the element that comes fi...
false
false
false
false
false
0
P_Create_Aux2_Table(dbDriver * driver, char *tab_name) { dbTable *auxiliar_tab; dbColumn *column; auxiliar_tab = db_alloc_table(2); db_set_table_name(auxiliar_tab, tab_name); db_set_table_description(auxiliar_tab, "Intermediate interpolated values"); column = db_get_table_column(auxili...
false
false
false
false
false
0
dis_interfaces (MonoImage *m, guint32 typedef_row, MonoGenericContainer *container) { plocator_t loc; guint start; gboolean first_interface = 1; guint32 cols [MONO_INTERFACEIMPL_SIZE]; char *intf; MonoTableInfo *table = &m->tables [MONO_TABLE_INTERFACEIMPL]; if (!table->base) return; loc.t = table; loc.col...
false
false
false
false
false
0
MakeInputIterator(Compaction* c) { ReadOptions options; options.verify_checksums = options_->paranoid_checks; options.fill_cache = false; // Level-0 files have to be merged together. For other levels, // we will make a concatenating iterator per level. // TODO(opt): use concatenating iterator for level-0 ...
false
false
false
false
false
0
LLVMGetBasicBlocks(LLVMValueRef FnRef, LLVMBasicBlockRef *BasicBlocksRefs){ Function *Fn = unwrap<Function>(FnRef); for (Function::iterator I = Fn->begin(), E = Fn->end(); I != E; I++) *BasicBlocksRefs++ = wrap(I); }
false
false
false
false
false
0
devm_iio_device_match(struct device *dev, void *res, void *data) { struct iio_dev **r = res; if (!r || !*r) { WARN_ON(!r || !*r); return 0; } return *r == data; }
false
false
false
false
false
0
cb_panel_motion(GtkWidget *widget, GdkEventButton *ev) { GdkModifierType state; GList *list; FSmon *fs; GkrellmDecal *d; PangoFontDescription *font_desc; gchar buf[128]; gint w, x_delta = 0; state = ev->state; if ( !fs_in_motion || !(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK)) || !fs_in_moti...
false
false
false
false
false
0
mx_style_get_property (MxStyle *style, MxStylable *stylable, GParamSpec *pspec, GValue *value) { MxStylePrivate *priv; g_return_if_fail (MX_IS_STYLE (style)); g_return_if_fail (MX_IS_STYLABLE (stylable)); g_return_if_fail (pspec != NUL...
false
false
false
false
false
0
doobject(Object o, Object whichone, int fexcept) { Object newo = NULL; Object subo = NULL; switch (DXGetObjectClass(o)) { case CLASS_STRING: return doselect(o, whichone, IS_STRING, fexcept); case CLASS_GROUP: switch (DXGetGroupClass((Group)o)) { case CLASS_SERIES: return doselect(o,...
false
false
false
false
false
0
operator-(const FXRegion& r) const { FXRegion res; #ifndef WIN32 XSubtractRegion((Region)region,(Region)r.region,(Region)res.region); #else CombineRgn((HRGN)res.region,(HRGN)region,(HRGN)r.region,RGN_DIFF); #endif return res; }
false
false
false
false
false
0
Reconfig(const char *name) { super::Reconfig(name); if(!xstrcmp(name,"fish:charset") && recv_buf && send_buf) { if(!IsSuspended()) cache->TreeChanged(this,"/"); const char *charset=ResMgr::Query("fish:charset",hostname); if(charset && *charset) { send_buf->SetTranslation(charset,fal...
false
false
false
false
false
0
locks_overlap(struct file_lock *fl1, struct file_lock *fl2) { return ((fl1->fl_end >= fl2->fl_start) && (fl2->fl_end >= fl1->fl_start)); }
false
false
false
false
false
0
itsp_read_header(chm_metadata_t *metadata, off_t offset) { chm_itsp_header_t *itsp_hdr = &metadata->itsp_hdr; if (!chm_read_data(metadata->map, (char *)itsp_hdr, offset, CHM_ITSP_LEN)) return FALSE; if (memcmp(itsp_hdr->signature, "ITSP", 4) != 0) { cli_dbgmsg("ITSP signature mismatch\n"); return FALSE; } ...
false
false
false
false
false
0
glade_gtk_about_dialog_read_widget (GladeWidgetAdaptor * adaptor, GladeWidget * widget, GladeXmlNode * node) { if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) || glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE))) return; /* First chain up and read in all the normal propertie...
false
false
false
false
false
0
_method_success_check(void *data, __UNUSED__ DBusMessage *msg, DBusError *error) { const char *name = data; if ((!error) || (!dbus_error_is_set(error))) { printf("SUCCESS: method %s() finished successfully.\n", name); return; } printf("FAILURE: method %s() finished with error: %s %s\n", name, ...
false
false
false
false
false
0
_policy_border_show(E_Border *bd) { if (!bd) return; /* make sure we have a name so that we don't handle windows like E's root */ if (!bd->client.icccm.name) return; // printf("Border Show: %s\n", bd->client.icccm.class); /* trap for special windows so we can ignore hides below them */ if (e_illume...
false
false
false
false
false
0
rpm_bidder_bid(struct archive_read_filter_bidder *self, struct archive_read_filter *filter) { const unsigned char *b; ssize_t avail; int bits_checked; (void)self; /* UNUSED */ b = __archive_read_filter_ahead(filter, 8, &avail); if (b == NULL) return (0); bits_checked = 0; /* * Verify Header Magic Byt...
false
false
false
false
false
0
nvbios_extend(struct nvkm_bios *bios, u32 length) { if (bios->size < length) { u8 *prev = bios->data; if (!(bios->data = kmalloc(length, GFP_KERNEL))) { bios->data = prev; return -ENOMEM; } memcpy(bios->data, prev, bios->size); bios->size = length; kfree(prev); return 1; } return 0; }
false
true
false
false
false
1
contains_after_aligning_divs(__isl_keep isl_basic_map *bmap_i, struct isl_coalesce_info *info_j) { int known; isl_mat *div_i, *div_j, *div; int *exp1 = NULL; int *exp2 = NULL; isl_ctx *ctx; int subset; known = isl_basic_map_divs_known(bmap_i); if (known < 0 || !known) return known; ctx = isl_basic_map_get...
false
false
false
false
false
0
setPlayer(const QString& name, Chess::Side side) { m_player = name.toLatin1(); m_playerSide = side; }
false
false
false
false
false
0
SetResult(RESULT ** result, const int type, const void *value) { if (*result == NULL) { if ((*result = NewResult()) == NULL) return NULL; } else if (type == R_NUMBER) { DelResult(*result); } if (type == R_NUMBER) { (*result)->type = R_NUMBER; (*result)->size = 0; (*result)->number = *(double ...
false
false
false
false
false
0
wacom_ac_get_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val) { struct wacom *wacom = power_supply_get_drvdata(psy); int ret = 0; switch (psp) { case POWER_SUPPLY_PROP_PRESENT: /* fall through */ case POWER_SUPPLY_PROP_ONLINE: val->intval = wacom->wac...
false
false
false
false
false
0
chipio_write_data_multiple(struct hda_codec *codec, const u32 *data, unsigned int count) { int status = 0; if (data == NULL) { codec_dbg(codec, "chipio_write_data null ptr\n"); return -EINVAL; } while ((count-- != 0) && (status == 0)) status = chipio_write_data(codec, *data++); return ...
false
false
false
false
false
0
CalcTranslation ( Connector* c, float px, float py, float& dx, float& dy ) { const float thresh = .0001; float cx, cy, ox, oy; Transformer rel; c->GetGraphic()->Parent()->TotalTransformation(rel); c->GetCenter(cx, cy); rel.InvTransform(0., 0., ox, oy); rel.InvTransform(px - cx, py - cy,...
false
false
false
false
false
0
setintr(register Namep v) #endif { int k; if(k = intrfunct(v->fvarname)) { if ((*(struct Intrpacked *)&k).f4) if (noextflag) goto unknown; else dcomplex_seen++; v->vardesc.varno = k; } else { unknown: dclerr("unknown intrinsic function", v); return; } if(v->vstg == STGUNKNOWN) v->vstg ...
false
false
false
false
true
1
angle(struct value *val) { switch (val->type) { case INTGR: return ((val->v.int_val >= 0) ? 0.0 : M_PI); case CMPLX: if (val->v.cmplx_val.imag == 0.0) { if (val->v.cmplx_val.real >= 0.0) return (0.0); else return (M_PI); } return (atan2(val->v.cmplx_val.imag, val->v.cmplx_val.real)...
false
false
false
false
false
0
zxid_get_tas3_fault_sc2(zxid_conf* cf, zxid_fault* flt) { if (!flt || !flt->detail || !flt->detail->Status || !flt->detail->Status->code || !flt->detail->Status->code->g.s) return 0; return zx_str_to_c(cf->ctx, &flt->detail->Status->code->g); }
false
false
false
false
false
0
mytimesig(int nn, int dd, int cc, int bb) { int denom = 1; while (dd-- > 0) denom *= 2; prtime(); printf("TimeSig %d/%d %d %d\n", nn, denom, cc, bb); M0 += (Mf_currtime-T0)/(Beat*Measure); T0 = Mf_currtime; Measure = nn; Beat = 4 * Clicks / denom; }
false
false
false
false
false
0
midgard_replicator_serialize_blob (MidgardObject *object) { GType attachment_type = g_type_from_name ("midgard_attachment"); g_return_val_if_fail (g_type_is_a (G_OBJECT_TYPE (object), attachment_type), NULL); MidgardBlob *blob = midgard_blob_new(object, NULL); if(!blob) return NULL; gsize bytes_read = 0; ...
false
false
false
false
false
0
UpdateBoundsCheck(int index, int* checked_up_to) { if (index > *checked_up_to) { *checked_up_to = index; } }
false
false
false
false
false
0
nfa_to_dfa(nfa_node *start) #else nfa_to_dfa(start) nfa_node *start; #endif { register dfa_node *d_state, *trans_d_state; register int a; set t; int last_done; unsigned *nfa_list; unsigned *reach_list; reach_list = (unsigned *) malloc((2+nfa_allocated)*sizeof(unsigned)); if (!start) return NULL; t = set_of(NF...
false
true
false
true
true
1
rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key) { unsigned long zero=0; LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(key != NULL); /* type valid? */ if (!(key->type == PK_PRIVATE) && (type == PK_PRIVATE)) { return CRYPT_PK_INVALID_TYPE; ...
false
false
false
true
false
1
e_contact_store_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter) { EContactStore *contact_store = E_CONTACT_STORE (tree_model); gint index; g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), FALSE); g_return_val_if_fail (ITER_IS_VALID (contact_store, iter), FALSE); ...
false
false
false
false
false
0
model_stats_init (MODEL *pmod) { int i; pmod->ess = pmod->tss = NADBL; pmod->sigma = NADBL; pmod->rsq = pmod->adjrsq = NADBL; pmod->fstt = pmod->chisq = NADBL; pmod->lnL = NADBL; pmod->ybar = pmod->sdy = NADBL; pmod->dw = pmod->rho = NADBL; for (i=0; i<C_MAX; i++) { pmod->criterio...
false
false
false
false
false
0
MapScalars(vtkDataSet* output, double alpha, int multiply_with_alpha, vtkDataSet* input) { int cellFlag; double orig_alpha; vtkDataArray* scalars = vtkAbstractMapper::GetScalars(input, this->ScalarMode, this->ArrayAccessMode, this->ArrayId, this->ArrayName, cellFlag); vtkPointData* oppd = output->G...
false
false
false
false
false
0
free_element_contents(element elt) { switch (elt.key) { case STR: case SPACE: case RAW: case HTMLBLOCK: case HTML: case VERBATIM: case CODE: case NOTE: free(elt.contents.str); elt.contents.str = NULL; break; case LINK: case IMAGE: ...
false
false
false
false
false
0
crypt_trad(const char *key, const char *setting) { char *rv; static char buf[2]; if ((rv = crypt(key, setting)) == NULL) { buf[0] = setting && (*setting == 'x') ? '*' : 'x'; buf[1] = '\0'; rv = buf; } return (rv); }
true
true
false
false
true
1
scan4minutiae_vertically(MINUTIAE *minutiae, unsigned char *bdata, const int iw, const int ih, const int imapval, const int nmapval, const int scan_x, const int scan_y, const int scan_w, const int scan_h, const LFSPARMS *lfsparms) { int ...
false
false
false
false
false
0
p54_convert_output_limits(struct ieee80211_hw *dev, u8 *data, size_t len) { struct p54_common *priv = dev->priv; if (len < 2) return -EINVAL; if (data[0] != 0) { wiphy_err(dev->wiphy, "unknown output power db revision:%x\n", data[0]); return -EINVAL; } if (2 + data[1] * sizeof(struct pda_cha...
false
true
false
false
false
1
ustate_own_free(void *that) { ustate_own_ty *this_thing; this_thing = (ustate_own_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("ustate_own_free(this_thing = %08lX)\n{\n", ...
false
false
false
false
false
0
sci_port_get_sas_address(struct isci_port *iport, struct sci_sas_address *sas) { u32 index; sas->high = 0; sas->low = 0; for (index = 0; index < SCI_MAX_PHYS; index++) if (iport->phy_table[index]) sci_phy_get_sas_address(iport->phy_table[index], sas); }
false
false
false
false
false
0
exit_program_final(void) { LayoutWindow *lw = NULL; /* make sure that external editors are loaded, we would save incomplete configuration otherwise */ layout_editors_reload_finish(); remote_close(remote_connection); collect_manager_flush(); save_options(options); keys_save(); accel_map_save(); if (layout...
false
false
false
false
false
0
__lock_id_pp(dbenv, idp) DB_ENV *dbenv; u_int32_t *idp; { DB_THREAD_INFO *ip; ENV *env; int ret; env = dbenv->env; ENV_REQUIRES_CONFIG(env, env->lk_handle, "DB_ENV->lock_id", DB_INIT_LOCK); ENV_ENTER(env, ip); REPLICATION_WRAP(env, (__lock_id(env, idp, NULL)), 0, ret); ENV_LEAVE(env, ip); return (ret...
false
false
false
false
false
0
end_of(off_t start, off_t len) { if (len == 0) return off_max(); return start + len - 1; }
false
false
false
false
false
0
gconf_cell_renderer_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, const GdkRectangle *background_area, const GdkRectangle *cell_area, GtkCellRendererState flags) { GtkWidget *entry; GConf...
false
false
false
false
false
0
cbf_skip_whitespace (cbf_file *file, const char **line, const char **curpoint, int *freshline) { static const char end = '\0'; const char *c; int comment_level; /* Repeating the end of a line? */ if (*freshline) ...
false
false
false
false
false
0
fwnet_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) { struct fw_device *device = fw_parent_device(unit); struct fw_card *card = device->card; struct net_device *net; bool allocated_netdev = false; struct fwnet_device *dev; unsigned max_mtu; int ret; union fwnet_hwaddr *ha; mutex_lo...
false
false
false
false
false
0
php_stdiop_close(php_stream *stream, int close_handle TSRMLS_DC) { int ret; php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; assert(data != NULL); #if HAVE_MMAP if (data->last_mapped_addr) { munmap(data->last_mapped_addr, data->last_mapped_len); data->last_mapped_addr = NULL; } #elif d...
false
false
false
false
false
0
cpp_example_alpha_composite() { CamImage source,dest,mask; // Load an image source.load_bmp("resources/alfa156.bmp"); // Allocate a 4 channels image mask.alloc_rgba(source.width,source.height); // Draw a rectangle in the mask image mask.set(0); mask.draw_rectangle(72,20,260,...
false
false
false
false
false
0
gwy_tool_roughness_Xsk(GwyDataLine *data_line) { gdouble Xsk = 0.0, s; const gdouble *data; gint i, res; g_return_val_if_fail(GWY_IS_DATA_LINE(data_line), Xsk); res = gwy_data_line_get_res(data_line); data = gwy_data_line_get_data_const(data_line); for (i = 0; i < res; i++) { s = ...
false
false
false
false
false
0
encdesc_read_header(GtEncdesc *encdesc, FILE *fp) { unsigned long cur_field_num; DescField *cur_field; encdesc_header_io_basics(encdesc, fp, encdesc_gt_xfread); encdesc->fields = gt_calloc((size_t) encdesc->num_of_fields, sizeof (DescField)); for (cur_field_num = 0; cur...
false
false
false
false
false
0
SetCMakeRoot() { // use the CMAKE_ROOT from cmake which should have been // found by now const char* root= this->MakefileMap->GetDefinition("CMAKE_ROOT"); if(root) { this->CMakeRoot = root; cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " << this->CMakeRoo...
false
false
false
false
false
0
quirk_passive_release(struct pci_dev *dev) { struct pci_dev *d = NULL; unsigned char dlc; /* We have to make sure a particular bit is set in the PIIX3 ISA bridge, so we have to go out and find it. */ while ((d = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, d))) { pci_read_config_byte(d,...
false
false
false
false
false
0
analogtv_free_image(analogtv *it) { if (it->image) { if (it->use_shm) { #ifdef HAVE_XSHM_EXTENSION destroy_xshm_image(it->dpy, it->image, &it->shm_info); #endif } else { XDestroyImage(it->image); } it->image=NULL; } }
false
false
false
false
false
0
ide_disk_hpa_set_capacity(ide_drive_t *drive, u64 set_max, int lba48) { set_max = idedisk_set_max_address(drive, set_max, lba48); if (set_max) drive->capacity64 = set_max; return set_max; }
false
false
false
false
false
0
char_width(char *codeset) { if (strcmp("UTF-16", codeset) == 0) { return 2; } else if (strcmp("UTF-32", codeset) == 0) { return 4; } return 1; }
false
false
false
false
false
0
test_set_exc_info(PyObject *self, PyObject *args) { PyObject *orig_exc; PyObject *new_type, *new_value, *new_tb; PyObject *type, *value, *tb; if (!PyArg_ParseTuple(args, "OOO:test_set_exc_info", &new_type, &new_value, &new_tb)) return NULL; PyErr_GetExcInfo(&type, ...
false
false
false
false
false
0
IPIsLoopback(const IPAddress& ip) { static const IPAddress kIPv4Loopback(INADDR_LOOPBACK); static const IPAddress kIPv6Loopback(in6addr_loopback); switch (ip.family()) { case AF_INET: { return ip == kIPv4Loopback; } case AF_INET6: { return ip == kIPv6Loopback; } } return false; }
false
false
false
false
false
0
gmpc_meta_text_view_query_text_from_song (GmpcMetaTextView * self, mpd_Song * song) { #line 484 "gmpc-meta-text-view.c" #define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::query_text_from_song" #line 150 "gmpc-meta-text-view.gob" g_return_if_fail (self != NULL); #line 150 "gmpc-meta-text-view.gob" g_return_if_fail (GMPC_I...
false
false
false
false
false
0
SetUpdateExtentInfo(vtkXMLDataElement *eDSA, vtkInformationVector *infoVector, int piece, int numPieces) { if (!eDSA) { return 1; } int i; // Cycle through each data array for(i = 0; i < eDSA->GetNumberOfNestedEle...
false
false
false
false
false
0
handleEventComment( void *firsthandlerarg, uint64_t time, uint32_t process, const char* comment, OTF_KeyValueList* list ) { Control* control= (Control*) firsthandlerarg; while ( control->checkTime( time ) ) ; if ( control->copyEvents ) return ( 0 == OTF_Writer_writeEventCommentKV( co...
false
false
false
false
false
0
Run() { const StaticData &staticData = StaticData::Instance(); const TranslationSystem &system = staticData.GetTranslationSystem(TranslationSystem::DEFAULT); const size_t translationId = m_source->GetTranslationId(); VERBOSE(2,"\nTRANSLATING(" << translationId << "): " << *m_source); if (staticDat...
false
false
false
false
false
0
revise_thrashing_dragon(int color, float our_score, float advantage) { int pos; signed char safe_stones[BOARDMAX]; float strength[BOARDMAX]; /* Trust the owl code's opinion if we are behind. */ if (our_score < advantage) return 0; if (disable_threat_computation || !thrashing_dragon || dra...
true
true
false
false
false
1
localsearch(Population &thisPop, Local_Search *local_method, int outlev, FILE *logFile) { // apply local search (if not NULL) to population with // frequency search_freq // (this code moved from call_glss.cc into methods of // the GA/LGA and PSO since their needs differed so - M Pique Jun 2011) if(local_method...
false
false
false
false
false
0
category_scheduled_set_div_id ( gint scheduled_number, int no_div ) { if ( scheduled_number ) { gsb_data_scheduled_set_category_number ( scheduled_number, no_div); if ( !gsb_data_scheduled_get_category_number (scheduled_number)) gsb_data_scheduled_set_account_number_transfer ( scheduled_numb...
false
false
false
false
false
0
amsemaphore_decrement(amsemaphore_t* o, unsigned int dec) { int sdec; g_return_if_fail(o != NULL); sdec = (int) dec; g_return_if_fail(sdec >= 0); g_mutex_lock(o->mutex); while (o->value < sdec) { g_cond_wait(o->decrement_cond, o->mutex); } o->value -= sdec; check_empty(o); ...
false
false
false
false
false
0
event_modify(const int fd, const int read, const int write, const int active) { int i; for (i = 0; i < event_count; i++) { if (events[i].fd == fd) { events[i].read = read; events[i].write = write; events[i].active = active; break; } } event_count--; events = realloc(events, siz...
false
true
false
false
true
1
WriteFile ( LFA_FileRef sourceRef, const std::string & sourcePath ) { IgnoreParam ( sourcePath ); XMP_AbortProc abortProc = this->parent->abortProc; void * abortArg = this->parent->abortArg; const bool checkAbort = (abortProc != 0); LFA_FileRef destRef = this->parent->fileRef; // Capture the "b...
false
false
false
false
false
0
dc_opendir(const char *path) { dcap_url *url; struct vsp_node *node; DIR *dir; url = (dcap_url *)dc_getURL(path); if( url == NULL ) { dc_debug(DC_INFO, "Using system native opendir for %s.", path); return system_opendir(path); } node = new_vsp_node( path ); if( node == NULL ) { free(url->file); free...
true
true
false
false
true
1
gpx_track_disp(const waypoint* waypointp) { fs_xml* fs_gpx; int first_in_trk; first_in_trk = waypointp->Q.prev == &current_trk_head->waypoint_list; if (waypointp->wpt_flags.new_trkseg) { if (!first_in_trk) { gbfprintf(ofd, "</trkseg>\n"); } gbfprintf(ofd, "<trkseg>\n"); } gbfprintf(ofd, ...
false
false
false
false
false
0
xencons_disconnect_backend(struct xencons_info *info) { if (info->irq > 0) unbind_from_irqhandler(info->irq, NULL); info->irq = 0; if (info->evtchn > 0) xenbus_free_evtchn(info->xbdev, info->evtchn); info->evtchn = 0; if (info->gntref > 0) gnttab_free_grant_references(info->gntref); info->gntref = 0; if (i...
false
false
false
false
false
0
wf_find_variable(WaveFile *wf, char *varname, int swpno) { int i; WvTable *wt; if(swpno >= wf->wf_ntables) return NULL; for(i = 0; i < wf->wf_ndv; i++) { wt = wf_wtable(wf, swpno); if(0==strcmp(wt->dv[i].wv_name, varname)) return &wt->dv[i]; } return NULL; }
false
false
false
false
false
0
mapChanged(void) { ArTime maxScanTimeChanged = findMaxMapScanTimeChanged(); // ArLog::log(level, "ArMap: Calling mapChanged callbacks"); if (!myTimeMapInfoChanged.isAt(myMapInfo->getTimeChanged()) || !myTimeMapObjectsChanged.isAt(myMapObjects->getTimeChanged()) || !myTimeMapSupplementChanged.isAt(myMa...
false
false
false
false
false
0
add_excludes_from_file(struct dir_struct *dir, const char *fname) { if (add_excludes_from_file_1(fname, "", 0, NULL, &dir->exclude_list[EXC_FILE]) < 0) die("cannot use %s as an exclude file", fname); }
false
false
false
false
false
0
tok_free(t) register struct token *t; { #ifdef DEBUG /* Check if we are freeing free token */ register struct token *p; for (p = tok_pool; p; p = p->next) if (p == t) fatal("freeing free token"); #endif /* Free neighbours and subordinates first */ if (t->next) tok_free(t->next); if (t...
false
false
false
false
false
0
cxx_eval_array_reference (const constexpr_call *call, tree t, bool allow_non_constant, bool addr, bool *non_constant_p, bool *overflow_p) { tree oldary = TREE_OPERAND (t, 0); tree ary = cxx_eval_constant_expression (call, oldary, allow_non_constant, addr, non_constant_p, overflow_p); tre...
false
false
false
false
false
0
vdi_dns_walk_cache(const struct sess *sp, struct vdi_dns *vs, const char *hostname) { struct director *backend = NULL; int ret; AZ(pthread_rwlock_rdlock(&vs->rwlock)); ret = vdi_dns_cache_has(sp, vs, hostname, &backend, 0); AZ(pthread_rwlock_unlock(&vs->rwlock)); if (!ret) { /* * XXX: Isn't there ...
false
false
false
false
false
0
is_in_regions(bam1_t *bam_line, stats_t *stats) { if ( !stats->regions ) return 1; if ( bam_line->core.tid >= stats->nregions || bam_line->core.tid<0 ) return 0; if ( !stats->is_sorted ) error("The BAM must be sorted in order for -t to work.\n"); regions_t *reg = &stats->regions[bam_line->core.tid]; ...
false
false
false
false
false
0
mark_visited(int state_no, int symbol) { struct node *p; if (visited.map[state_no] == NULL) /* 1st time we see state_no? */ { visited.list[state_no] = visited.root; visited.root = state_no; } p = Allocate_node(); p -> value = symbol; p -> next = visited.map[state_no]; v...
false
false
false
false
false
0
cifs_negotiate_protocol(const unsigned int xid, struct cifs_ses *ses) { int rc = 0; struct TCP_Server_Info *server = ses->server; if (!server->ops->need_neg || !server->ops->negotiate) return -ENOSYS; /* only send once per connect */ if (!server->ops->need_neg(server)) return 0; set_credits(server, 1); r...
false
false
false
false
false
0
tempfile_in_same_dir(char *filename, char *prefix, char **ret_dir) { #ifndef MAXPATH #define MAXPATH 1000 /* Longest file path we can deal with */ #endif char dir[MAXPATH+1]; char *dirp = NULL; char *ret_file = NULL; if(filename){ char *lc; if((lc = last_cmpnt(filename)) != NULL){ int to_co...
false
false
false
false
false
0
e_util_icon_size_normalize(unsigned int desired) { const unsigned int *itr, known_sizes[] = { 16, 22, 24, 32, 36, 48, 64, 72, 96, 128, 192, 256, 0 }; for (itr = known_sizes; *itr > 0; itr++) if (*itr >= desired) return *itr; return 256; /* largest know size? */ }
false
false
false
false
false
0
CreateBaseAtCreature(Creature* creature) { if (!creature) { sLog.outError("CRITICAL: NULL pointer passed into CreateBaseAtCreature()"); return false; } CreatureCreatePos pos(creature, creature->GetOrientation()); uint32 guid = creature->GetMap()->GenerateLocalLowGuid(HIGHGUID_PET);...
false
false
false
false
false
0
ea_cell_table_set_cell (EaCellTable *cell_data, gint row, gint column, gpointer cell) { gint index; g_return_val_if_fail (cell_data, FALSE); index = ea_cell_table_get_index (cell_data, column, row); if (index == -1) return FALSE; if (cell...
false
false
false
false
false
0
match_next_magic(const str* part, str* result, unsigned options) { DIR* dir; direntry* entry; striter path; int count; count = 0; if (!str_copy(&tmplist, result)) return -1; if (!str_truncate(result, 0)) return -1; striter_loop(&path, &tmplist, 0) { if ((dir = opendir(path.startptr)) == 0) continue;...
false
false
false
false
false
0
fgrep_gtkrc_for (gchar *needle) { gchar *path_to_gtkrc = g_strdup_printf("%s/.gtkrc-2.0", homedir); FILE *gtkrc = fopen(path_to_gtkrc, "r"); char tempbuf[16384], *commentsearch; g_free (path_to_gtkrc); if (!gtkrc) return 0; while (!feof (gtkrc)) { fgets (tempbuf, 16383, gtkrc); /* Strip co...
false
false
false
false
false
0
setup_frontend(struct arguments *args, struct dvb_v5_fe_parms *parms) { int rc; uint32_t freq; if (args->silent < 2) { rc = dvb_fe_retrieve_parm(parms, DTV_FREQUENCY, &freq); if (rc < 0) { PERROR("can't get the frequency"); return -1; } fprintf(stderr, "tuning to %i Hz\n", freq); } rc = dvb_fe...
false
false
false
false
false
0
hb_label_set_colvalue(GtkLabel *label, gdouble value, gboolean minor) { gchar strbuffer[G_ASCII_DTOSTR_BUF_SIZE]; gchar *markuptxt; gchar *color = NULL; mystrfmon(strbuffer, G_ASCII_DTOSTR_BUF_SIZE-1, value, minor); if(value != 0.0 && PREFS->custom_colors == TRUE) { color = get_normal_color_amount(value); //g...
false
false
false
false
false
0
hns_mac_init(struct dsaf_device *dsaf_dev) { int i; int ret; size_t size; struct hns_mac_cb *mac_cb; size = sizeof(struct hns_mac_cb) * DSAF_MAX_PORT_NUM_PER_CHIP; dsaf_dev->mac_cb = devm_kzalloc(dsaf_dev->dev, size, GFP_KERNEL); if (!dsaf_dev->mac_cb) return -ENOMEM; for (i = 0; i < DSAF_MAX_PORT_NUM_PER_C...
false
false
false
false
false
0
update_file_is_binary_by_attr( git_repository *repo, git_diff_file *file) { const char *value; /* because of blob diffs, cannot assume path is set */ if (!file->path || !strlen(file->path)) return 0; if (git_attr_get(&value, repo, 0, file->path, "diff") < 0) return -1; if (GIT_ATTR_FALSE(value)) file->fl...
false
false
false
false
false
0
GetSelectedUserTemplate() const { int sel = XRCCTRL(*this, "lstUser", wxListBox)->GetSelection(); return sel != -1 ? XRCCTRL(*this, "lstUser", wxListBox)->GetString(sel) : _T(""); }
false
false
false
false
false
0
dump_realloc_oid_to_string(const oid * objid, size_t objidlen, u_char ** buf, size_t * buf_len, size_t * out_len, int allow_realloc, char quotechar) { if (buf) { int i, alen; for (i = 0, alen = 0; i < (int)...
false
false
false
false
false
0
hdnode_private_ckd(HDNode *inout, uint32_t i) { uint8_t data[1 + 32 + 4]; uint8_t I[32 + 32]; uint8_t fingerprint[32]; bignum256 a, b; if (i & 0x80000000) { // private derivation data[0] = 0; memcpy(data + 1, inout->private_key, 32); } else { // public derivation memcpy(data, inout->public_key, 33); } wr...
false
false
false
false
false
0
git_path_is_empty_dir(const char *path) { int error; git_buf dir = GIT_BUF_INIT; if (!git_path_isdir(path)) return false; if ((error = git_buf_sets(&dir, path)) != 0) giterr_clear(); else error = git_path_direach(&dir, 0, path_found_entry, NULL); git_buf_free(&dir); return !error; }
false
false
false
false
false
0
ajFeatGetTagS(const AjPFeature thys, const AjPStr name, ajint num, AjPStr* val) { AjIList iter = NULL; AjPTagval item = NULL; ajint inum = 0; AjBool isnote; ajint noteposcolon=0; ajint noteposvalue=0; const AjPStr tagval = NULL; isnote = ajStrMatchC(name, ...
false
false
false
false
false
0