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
alloc_grey_ramp(unsigned int max_size) { cmap_size = global.visual->map_entries; if (cmap_size > max_size) cmap_size = max_size; if (cmap_size > 256) cmap_size = 256; cmap = (CMAP_ENTRY *)XtMalloc(cmap_size * sizeof cmap[0]); while (cmap_size >= N_GREYS) if (alloc_greys(cmap, cmap_size)) br...
false
false
false
false
false
0
kcm_ccache_store_cred(krb5_context context, kcm_ccache ccache, krb5_creds *creds, int copy) { krb5_error_code ret; krb5_creds *tmp; KCM_ASSERT_VALID(ccache); HEIMDAL_MUTEX_lock(&ccache->mutex); ret = kcm_ccache_store_cred_internal(context, ccache, creds, copy, &tmp); HE...
false
false
false
false
false
0
gt_aligned_segment_ungap_seq_and_qual(GtAlignedSegment *as) { unsigned long pos, srcpos; gt_assert(as != NULL); for (srcpos = 0, pos = 0; srcpos < as->alen; srcpos++) { if (as->s[srcpos] != '-') { if (pos != srcpos) { gt_assert(pos < srcpos); as->s[pos] = as->s[srcpos]; ...
false
false
false
false
false
0
GetMetadata( const char *pszDomain ) { /* -------------------------------------------------------------------- */ /* PCIDSK only supports metadata in the default domain. */ /* -------------------------------------------------------------------- */ if( pszDomain != NULL && strlen(pszDomain) > 0 ) ...
false
false
false
false
false
0
get_chunk_size(char *b) { long chunksize = 0; size_t chunkbits = sizeof(long) * 8; ap_xlate_proto_from_ascii(b, strlen(b)); if (!apr_isxdigit(*b)) { /* * Detect invalid character at beginning. This also works for empty * chunk size lines. */ return INVALID_CH...
false
false
false
false
false
0
gff3_in_stream_next(GtNodeStream *ns, GtGenomeNode **gn, GtError *err) { GtGFF3InStream *is; gt_error_check(err); is = gff3_in_stream_cast(ns); return gt_node_stream_next(is->last_stream, gn, err); }
false
false
false
false
false
0
create_tags (Glib::RefPtr<Gtk::TextBuffer>& textbuf_) { Glib::RefPtr<Gtk::TextBuffer::Tag> refTag; refTag = textbuf_->create_tag("bold"); #ifdef GLIBMM_PROPERTIES_ENABLED refTag->property_weight().set_value(Pango::WEIGHT_BOLD); #else refTag->set_property ("weight", Pango::WEIGHT_BOLD); #endif refTag = textbuf_->...
false
false
false
false
false
0
setOption(const QString& name, const QVariant& value) { if (state() == Starting || state() == NotStarted) { m_optionBuffer[name] = value; return; } EngineOption* option = getOption(name); if (option == 0) { qDebug() << this->name() << "doesn't have option" << name; return; } if (!option->isValid(value...
false
false
false
false
false
0
compare (const value_base& other) const throw () { int base = compare_base (other); return (base == YIELD_COMPARE) ? 0 : base; }
false
false
false
false
false
0
gem_init_phy(struct gem *gp) { u32 mifcfg; /* Revert MIF CFG setting done on stop_phy */ mifcfg = readl(gp->regs + MIF_CFG); mifcfg &= ~MIF_CFG_BBMODE; writel(mifcfg, gp->regs + MIF_CFG); if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE) { int i; /* Those delay sucks, the HW seem to love them though, I'll * ...
false
false
false
false
false
0
BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb) { int ret = 0; BIGNUM *t, *p1p2, *pm1; /* Only even e supported */ if (!BN_is_odd(e)) return 0; BN_CTX_start(ctx); if (!p1) p1 = BN_CTX_get(c...
false
false
false
false
false
0
paned_restore_position(GtkPaned *paned, property_t prop) { guint32 pos; g_return_if_fail(paned); gui_prop_get_guint32_val(prop, &pos); gtk_paned_set_position(paned, pos); }
false
false
false
false
false
0
on_refresh() { const std::vector<JoystickDescription>& joysticks = Joystick::get_joysticks(); device_list->clear(); for(std::vector<JoystickDescription>::const_iterator i = joysticks.begin(); i != joysticks.end(); ++i) { Gtk::ListStore::iterator it = device_list->append(); (*it)[DeviceListColumn...
false
false
false
false
false
0
print(UChar* src, int32_t srcLen,const char *tagStart,const char *tagEnd, UErrorCode *status){ int32_t bufCapacity = srcLen*4; char *buf = NULL; int32_t bufLen = 0; if(U_FAILURE(*status)){ return; } buf = (char*) (uprv_malloc(bufCapacity)); if(buf==0){ fprintf(stde...
false
false
false
false
false
0
nm_device_hw_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware) { gboolean success; guint32 tries = 0; g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); if (nm_device_hw_is_up (self)) goto out; nm_log_info (LOGD_HW, "(%s): bringing up device.", nm_device_get_iface (self)); if (NM_DEVICE_GET_C...
false
false
false
false
false
0
rb_dlcfunc_new(void (*func)(), int type, const char *name, ID calltype) { VALUE val; struct cfunc_data *data; rb_secure(4); if( func ){ val = TypedData_Make_Struct(rb_cDLCFunc, struct cfunc_data, &dlcfunc_data_type, data); data->ptr = (void *)(VALUE)func; data->name = name ? strdup(name) : NULL; d...
false
false
false
false
false
0
db_int(int iDflt, const char *zSql, ...){ va_list ap; Stmt s; int rc; va_start(ap, zSql); db_vprepare(&s, 0, zSql, ap); va_end(ap); if( db_step(&s)!=SQLITE_ROW ){ rc = iDflt; }else{ rc = db_column_int(&s, 0); } db_finalize(&s); return rc; }
false
false
false
false
false
0
tcl_bind_list_expmem(tcl_bind_list_t *tl) { int tot = 0; tcl_bind_mask_t *tm; for (tm = tl->first; tm; tm = tm->next) tot += tcl_bind_mask_expmem(tm); tot += sizeof(*tl); return tot; }
false
false
false
false
false
0
getPackSize() { VT_MPI_INT buffersize = 0; VT_MPI_INT size; // maxStackDepth MPI_Pack_size( 1, MPI_UNSIGNED, MPI_COMM_WORLD, &size ); buffersize += size; // totalInvocations, maxInvocations, timerResolution, messageCount, // collectiveCount MPI_Pack_size( 5, MPI_UNSIGNED_LONG, MPI_COMM_WORLD, &size ); buffe...
false
false
false
false
false
0
cmsSetAdaptationState(cmsFloat64Number d) { cmsFloat64Number OldVal = GlobalAdaptationState; if (d >= 0) GlobalAdaptationState = d; return OldVal; }
false
false
false
false
false
0
jaw_component_get_size (AtkComponent *component, gint *width, gint *height) { JawObject *jaw_obj = JAW_OBJECT(component); ComponentData *data = jaw_object_get_interface_data(jaw_obj, INTERFACE_COMPONENT); jobject atk_component = data->atk_component; JNIEnv *jniEnv = jaw_util_get_jni_env(); jclass classAtkCompo...
false
false
false
false
false
0
offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y, addr_space_t as) { enum rtx_code ycode = GET_CODE (y); rtx z; rtx y1 = y; rtx *y2; int (*addressp) (enum machine_mode, rtx, addr_space_t) = (strictp ? strict_memory_address_addr_space_p : memory_address_addr_space_p)...
false
false
false
false
false
0
emitSearchGraph (FILE* fp, sgraph* sg) { cell* cp; snode* np; sedge* ep; point p; int i; fputs ("graph G {\n", fp); fputs (" node[shape=point]\n", fp); for (i = 0; i < sg->nnodes; i++) { np = sg->nodes+i; cp = np->cells[0]; if (cp == np->cells[1]) { pointf pf = midPt (cp); p...
false
false
false
false
false
0
ade7758_probe_trigger(struct iio_dev *indio_dev) { struct ade7758_state *st = iio_priv(indio_dev); int ret; st->trig = iio_trigger_alloc("%s-dev%d", spi_get_device_id(st->us)->name, indio_dev->id); if (!st->trig) { ret = -ENOMEM; goto error_ret; } ret = request_irq(st->us->irq, ade7758_data_r...
false
false
false
false
false
0
save_playlists_real (void) { int lists = playlist_count (); const char * folder = get_path (AUD_PATH_PLAYLISTS_DIR); /* save playlists */ char * * order = g_malloc (sizeof (char *) * (lists + 1)); GHashTable * saved = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); for (int i =...
false
false
false
false
false
0
on_draw_game() { if(board->is_fight_to_robot()){ board->draw_move(); } else if(board->is_network_game()){ if(board->is_human_player()){ board->send_to_socket("draw"); }else{ Gtk::MessageDialog dialog(*this, _("Warning"), false); Glib::ustring msg =_("Only ask rue game when you are going,so wait ...
false
false
false
false
false
0
qib_verbs_unregister_sysfs(struct qib_devdata *dd) { struct qib_pportdata *ppd; int i; for (i = 0; i < dd->num_pports; i++) { ppd = &dd->pport[i]; if (qib_cc_table_size && ppd->congestion_entries_shadow) { sysfs_remove_bin_file(&ppd->pport_cc_kobj, &cc_setting_bin_attr); sysfs_remove_bin_file(&ppd-...
false
false
false
false
false
0
gtkmenu_gtk_menu_detach(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_) { ScmObj menu_scm; GtkMenu* menu; ScmObj SCM_SUBRARGS[1]; int SCM_i; SCM_ENTER_SUBR("gtk-menu-detach"); for (SCM_i=0; SCM_i<1; SCM_i++) { SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i); } menu_scm = SCM_SUBRARGS[0]; if (!SCM_GTK_MENU_P(...
false
false
false
false
false
0
ajSqlconnectionNewData(AjESqlconnectionClient client, const AjPStr user, const AjPStr password, const AjPStr host, const AjPStr port, ...
false
false
false
false
false
0
conv_output_closer(ScmPort *port) { ScmConvInfo *info = (ScmConvInfo*)port->src.buf.data; int r; /* if there's remaining bytes in buf, send them to the remote port. */ if (info->ptr > info->buf) { Scm_Putz(info->buf, (int)(info->ptr - info->buf), info->remote); info->ptr = info->buf; ...
false
false
false
false
false
0
tree_view_object_update_cb(AmitkObject * object, gpointer data) { AmitkTreeView * tree_view = data; GtkTreeIter iter; GtkTreeModel * model; GdkPixbuf * pixbuf; g_return_if_fail(AMITK_IS_TREE_VIEW(tree_view)); g_return_if_fail(AMITK_IS_OBJECT(object)); if (tree_view_find_object(tree_view, object, &iter)...
false
false
false
false
false
0
k5_ad_find_module(krb5_context kcontext, krb5_authdata_context context, krb5_flags flags, const krb5_data *name) { int i; struct _krb5_authdata_context_module *ret = NULL; for (i = 0; i < context->n_modules; i++) { struct _krb5_authdata_context_...
false
false
false
false
false
0
men_z135_handle_rx(struct men_z135_port *uart) { struct uart_port *port = &uart->port; struct tty_port *tport = &port->state->port; int copied; u16 size; int room; size = get_rx_fifo_content(uart); if (size == 0) return; /* Avoid accidently accessing TX FIFO instead of RX FIFO. Last * longword in RX FIFO...
false
false
false
false
false
0
paintEvent( QPaintEvent *event ) { QPainter painter( this ); painter.setClipRegion( event->region() ); QStyleOption opt; opt.init(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this); painter.setRenderHint( QPainter::Antialiasing, true ); painter.save(); drawContents...
false
false
false
false
false
0
sinfo_print_cpl_frameset(const cpl_frameset *frames) { /* Two special cases: a NULL frame set and an empty frame set */ if (frames == NULL) { sinfo_msg("NULL"); } else { const cpl_frame *f = NULL; check( f = cpl_frameset_get_first_const(frames), "Erro...
false
false
false
false
false
0
generate_tristrip_ushort_first2first( unsigned start, unsigned nr, void *_out ) { ushort *out = (ushort*)_out; unsigned i, j; (void)j; for (i = start, j = 0; j < nr; j+=3, i++) { (out+j)[0] = (ushort)(i); (out+j)[1] = (ushort)(i+1+(i&1)); (out+j)[2] = (ushort)(i+2-(i&1)); } }
false
false
false
false
false
0
_ecore_file_download(const char *url, const char *dst, Ecore_File_Download_Completion_Cb completion_cb, Ecore_File_Download_Progress_Cb progress_cb, void *data, Ecore_File_Download_Job **job_ret, ...
false
false
false
false
true
1
split_message( const char *message, char ***lines, size_t *count, size_t line_length ) { const char *ptr = message; int position; line_length *= 8; /* Setup so we'll allocate the first line as soon as we get the first word */ *lines = NULL; *count = 0; position = line_length; while( *ptr ) {...
false
false
false
true
true
1
memmap_init_zone(unsigned long size, int nid, unsigned long zone, unsigned long start_pfn, enum memmap_context context) { pg_data_t *pgdat = NODE_DATA(nid); unsigned long end_pfn = start_pfn + size; unsigned long pfn; struct zone *z; unsigned long nr_initialised = 0; if (highest_memmap_pfn < end_pfn - 1) hig...
false
false
false
false
false
0
efx_farch_filter_remove_safe(struct efx_nic *efx, enum efx_filter_priority priority, u32 filter_id) { struct efx_farch_filter_state *state = efx->filter_state; enum efx_farch_filter_table_id table_id; struct efx_farch_filter_table *table; unsigned int filter_idx; struct efx_farch_filter_spec *spec; int ...
false
false
false
false
false
0
extract_tags_count (GstOggStream * pad, ogg_packet * packet) { /* packet 2 must be comment packet */ if (packet->bytes > 0 && pad->n_header_packets_seen == 1) { tag_list_from_vorbiscomment_packet (packet, NULL, 0, &pad->taglist); if (!pad->taglist) pad->taglist = gst_tag_list_new (); if (pad->bi...
false
false
false
false
false
0
clear_marks () { unsigned order; for (order = 2; order < NUM_ORDERS; order++) { size_t num_objects = OBJECTS_PER_PAGE (order); size_t bitmap_size = BITMAP_SIZE (num_objects + 1); page_entry *p; for (p = G.pages[order]; p != NULL; p = p->next) { #ifdef ENABLE_CHECKING /* The data sh...
false
false
false
false
false
0
_verifyUTF8( const unsigned char* c_str ) { std::string tmp( reinterpret_cast<const char*>( c_str ) ); return _verifyUTF8( tmp ); }
false
false
false
false
false
0
nlmsvc_release_host(struct nlm_host *host) { if (host == NULL) return; dprintk("lockd: release server host %s\n", host->h_name); WARN_ON_ONCE(!host->h_server); atomic_dec(&host->h_count); }
false
false
false
false
false
0
role_grid_pre_remove (GogObject *parent, GogObject *grid) { GogChart *chart = GOG_CHART (parent); g_return_if_fail (chart->grid == grid); chart->grid = NULL; }
false
false
false
false
false
0
MapWidget(GtkWidget *widget) { if (widget && IS_WIDGET_VISIBLE(widget) && !IS_WIDGET_MAPPED(widget)) { gtk_widget_map(widget); } }
false
false
false
false
false
0
my_fgetc( FILE * const f ) { int ch; bool comment = false; do { ch = std::fgetc( f ); if( ch == '#' ) comment = true; else if( ch == '\n' || ch == EOF ) comment = false; } while( comment ); return ch; }
false
false
false
false
false
0
create_progress_dialog(const gchar * filename, gpointer cancel_data, gboolean is_saving) { GtkButton *cancel; GtkTable *table; gchar *title; file_label = GTK_LABEL(gtk_label_new(NULL)); gtk_label_set_ellipsize(file_label, PANGO_ELLIPSIZE_MIDDLE); gtk_widget_sh...
false
false
false
false
false
0
isclef(s, gotoctave, octave, strict) char* s; int *gotoctave, *octave; int strict; /* part of K: parsing - looks for a clef in K: field */ /* format is K:string where string is treble, bass, baritone, tenor, */ /* alto, mezzo, soprano or K:clef=arbitrary */ { int gotclef; s...
false
false
false
false
false
0
ec2_set_edtime(sge_evc_class_t *thiz, int interval) { int ret = 0; sge_evc_t *sge_evc = (sge_evc_t *)thiz->sge_evc_handle; DENTER(EVC_LAYER, "ec2_set_edtime"); if (sge_evc->ec == NULL) { ERROR((SGE_EVENT, MSG_EVENT_UNINITIALIZED_EC)); } else { ret = (lGetUlong(sge_evc->ec, EV_d_time) !...
false
false
false
false
false
0
FindTA1(BYTE * Atr, BYTE * TA1) { if (Atr[1] & 0x10) { *TA1 = Atr[2]; return G_OK; } else { return -1; } }
false
false
false
false
false
0
static_start_scope (gamgi_window *window) { GtkWidget *dialog = window->dialog0; GtkWidget *entry; GtkWidget *combo; char token[GAMGI_ENGINE_TOKEN]; int row; /******************************************************************** * initialize with the same defaults used in gamgi_gtk_plane_create * ********************...
true
true
false
false
false
1
copy_procsets(stream *s, bool HaveTrueTypes, bool stripping) { int code; code = write_opdfread(s); if (code < 0) return code; code = write_tt_encodings(s, HaveTrueTypes); return code; }
false
false
false
false
false
0
Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding ) { p = SkipWhiteSpace( p, _encoding ); // Find the beginning, find the end, and look for // the stuff in-between. TiXmlDocument* document = GetDocument(); if ( !p || !*p || !StringEqual( p, "<?xml-stylesheet", true, _encoding ) ) { if ( docu...
false
false
false
false
false
0
select_generate_sel_table(select_t * sel) { register cmph_uint8 * bits_table = (cmph_uint8 *)sel->bits_vec; register cmph_uint32 part_sum, old_part_sum; register cmph_uint32 vec_idx, one_idx, sel_table_idx; part_sum = vec_idx = one_idx = sel_table_idx = 0; for(;;) { // FABIANO: Should'n it be one_idx...
false
false
false
false
false
0
computeCalibrationData (int color, int width, unsigned char *source, int *data) { int p, i, l; int sum; memset (data, 0, (3 * 5100 + 768 + 3) * sizeof (int)); /* 0 -> 5099 */ for (i = 0; i < width; i++) { /* red calibration data */ if (color >= RGB_MODE) { /* compute average */ sum ...
false
false
false
false
false
0
slurm_get_cpuset(char *path, pid_t pid, size_t size, cpu_set_t *mask) { int fd, rc; char file_path[PATH_MAX]; char mstr[1 + CPU_SETSIZE * 4]; snprintf(file_path, sizeof(file_path), "%s/%scpus", path, cpuset_prefix); fd = open(file_path, O_RDONLY); if (fd < 0) { error("open(%s): %m", file_path); return -1;...
true
true
false
false
true
1
GetNumWrongData(const byte * curPtr, const int maxnum) { int count = 0; if (1 == maxnum) { return (1); } while (*(curPtr + count) != *(curPtr + count + 1) && maxnum > count) { count++; } return (count); }
false
false
false
false
false
0
Ns_UTimedWaitForEvent(Ns_Event *event, Ns_Mutex *lock, int seconds, int microseconds) { Ns_Time to, *timePtr; if (seconds <= 0 && microseconds <= 0) { timePtr = NULL; } else { Ns_GetTime(&to); Ns_IncrTime(&to, seconds, microseconds); timePtr = &to; } return Ns_CondTimedWait((N...
false
false
false
false
false
0
npw_page_set_language (NPWPage *page, gint language) { if (page->language <= language) { page->language = language; return TRUE; } else { return FALSE; } }
false
false
false
false
false
0
on_tool_previewoff_toggled (GtkWidget *widget, void * user) { gboolean value = gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (widget)); config_set_value ("compile_status", (!value)? "True": "False"); if (value) previewgui_stop_preview (gui->previewgui); else previewgu...
false
false
false
false
false
0
usnic_port_immutable(struct ib_device *ibdev, u8 port_num, struct ib_port_immutable *immutable) { struct ib_port_attr attr; int err; err = usnic_ib_query_port(ibdev, port_num, &attr); if (err) return err; immutable->pkey_tbl_len = attr.pkey_tbl_len; immutable->gid_tbl_len = attr.gid_tbl_len; retu...
false
true
false
false
false
1
mprGetListCapacity(MprList *lp) { mprAssert(lp); if (lp == 0) { return 0; } return lp->capacity; }
false
false
false
false
false
0
pos_equality_in_clauses(Plist clauses) { if (clauses == NULL) return FALSE; else { Topform c = clauses->v; if (contains_pos_eq(c->literals)) return TRUE; else return pos_equality_in_clauses(clauses->next); } }
false
false
false
false
false
0
open(int port, Type type, const char *openOnIP) { int ret; char localhost[maxHostNameLen()]; myError=NoErr; myErrorStr.clear(); if ((type == TCP) && ((myFD=socket(AF_INET, SOCK_STREAM, 0)) < 0)) { myErrorStr="Failure to make TCP socket"; ArLog::logErrorFromOS(ArLog::Normal, "ArSocket::open: could n...
false
false
false
false
false
0
gsb_data_reconcile_cmp_int (struct_reconcile *reconcile_1, struct_reconcile *reconcile_2) { gint result; if ( ! reconcile_1 -> reconcile_final_date ) return -1; else if ( ! reconcile_2 -> reconcile_final_date ) return 1; else result = g_date_compare ( rec...
false
false
false
false
false
0
geoclue_connectivity_get_ap_mac (GeoclueConnectivity *self) { if (self != NULL && GEOCLUE_CONNECTIVITY_GET_INTERFACE (self)->get_ap_mac != NULL) return GEOCLUE_CONNECTIVITY_GET_INTERFACE (self)->get_ap_mac (self); /* Hack when not using NetworkManager */ return geoclue_connectivity_get_router_mac (self); }
false
false
false
false
false
0
gst_frei0r_filter_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstFrei0rFilter *self = GST_FREI0R_FILTER (object); GstFrei0rFilterClass *klass = GST_FREI0R_FILTER_GET_CLASS (object); GST_OBJECT_LOCK (self); if (!gst_frei0r_set_property (self->f0r_instance, klas...
false
false
false
false
false
0
main_build_database_progress_cb (GvaProcess *process, GParamSpec *pspec, gpointer user_data) { guint total_supported = GPOINTER_TO_UINT (user_data); gdouble fraction = 0.0; if (total_supported != 0) { guin...
false
false
false
false
false
0
fits_write_data_I(FILE* fid, int16_t value, anbool flip) { if (flip) v16_hton(&value); if (fwrite(&value, 2, 1, fid) != 1) { fprintf(stderr, "Failed to write a short to FITS file: %s\n", strerror(errno)); return -1; } return 0; }
false
false
false
false
false
0
vectorToTextFile( const vector<size_t> &vec, const string &fileName, bool append, bool byRows ) { FILE *f=os::fopen(fileName.c_str(),append ? "at" : "wt"); if (!f) return false; for (vector<size_t>::const_iterator it=vec.begin();it!=vec.end();++it) os::fprintf(f,byRows ? "%u ":"%u\n",static_cast<unsigned int>(*i...
false
false
false
false
false
0
sxgbe_get_rx_ctxt_tstamp_status(struct sxgbe_rx_ctxt_desc *p) { if ((p->tstamp_hi == 0xffffffff) && (p->tstamp_lo == 0xffffffff)) { pr_err("Time stamp corrupted\n"); return 0; } return p->tstamp_available; }
false
false
false
false
false
0
TransformLine(Image& im, const Key& k, float x1, float y1, float x2, float y2) { int r1, c1, r2, c2; float s, c, len; /* The scaling of the unit length arrow is set to half the width of the region used to compute the keypoint descriptor. */ len = 0.5 * SIFT::IndexSize * SIFT::MagFac...
false
false
false
false
false
0
db_get_pass(void *handle, const char *qpw, const char *key, char **ppass) { struct _dico_ldap_handle *lp = handle; LDAPMessage *res, *msg; int rc; struct berval **values; res = _dico_ldap_search(lp, lp->user_filter, qpw, key); if (!res) return 1; rc = ldap_count_entries(lp->ldap, res)...
false
false
false
false
false
0
x86_get_branch_target( x86_insn_t *insn ) { x86_oplist_t *op_lst; if (! insn || ! insn->operands ) { return NULL; } for (op_lst = insn->operands; op_lst; op_lst = op_lst->next ) { if ( op_lst->op.access & op_execute ) { return &(op_lst->op); } } return NULL; }
false
false
false
false
true
1
should_keep_alive(const struct mg_connection *conn) { struct connection *c = MG_CONN_2_CONN(conn); const char *method = conn->request_method; const char *http_version = conn->http_version; const char *header = mg_get_header(conn, "Connection"); return method != NULL && (!strcmp(method, "GET") || c->endpoi...
false
false
false
false
false
0
initEmpty(void) { // check the shared memory area first // shared memory is protected by our transaction call on the card // Transaction trans; CKYStatus status = trans.begin(conn); if( status != CKYSUCCESS ) { handleConnectionError(); } loadReaderObject(); readCUID(); }
false
false
false
false
false
0
scale_matrix(double** matrix, int rows, int cols, double reps){ int i,j; for(i=0;i<rows;i++) { for(j=0;j<cols;j++) { matrix[i][j]=matrix[i][j]*reps; } } return; }
false
false
false
false
false
0
regenhp(int percent) { s32b new_chp, new_chp_frac; int old_chp; /* Save the old hitpoints */ old_chp = p_ptr->chp; /* Extract the new hitpoints */ new_chp = ((long)p_ptr->mhp) * percent + PY_REGEN_HPBASE; p_ptr->chp += (s16b)(new_chp >> 16); /* div 65536 */ /* check for overflow */ if ((p_ptr->chp < 0) &&...
false
false
false
false
false
0
getDynamicProperties( DynamicProperties */*dProps*/, const IndicClassTable *classTable ) { LEUnicode currentChar; LEUnicode virama; LEUnicode workChars[2]; LEGlyphStorage workGlyphs; IndicReorderingOutput workOutput(workChars, workGlyphs, NULL); //le_int32 offset = 0; // First find the ...
false
false
false
false
false
0
checkDestHostIP(int * chanId, struct addrinfo * DestHost) { int i = 0; while (i < MAX_NUM_THREAD) { if ((signalChannels[i].socket != -1) && (ARE_INET_ADDR_EQUAL(DestHost, signalChannels[i].DestAddr))) { signalChannels[i].flows++; *chanId = i; return true; } i++; } return...
false
false
false
false
false
0
gcm_done(gcm_state *gcm, unsigned char *tag, unsigned long *taglen) { unsigned long x; int err; LTC_ARGCHK(gcm != NULL); LTC_ARGCHK(tag != NULL); LTC_ARGCHK(taglen != NULL); if (gcm->buflen > 16 || gcm->buflen < 0) { return CRYPT_INVALID_ARG; } if ((err...
false
false
false
true
false
1
datafield_to_field(GwyDataField *datafield, gboolean maxzero) { gdouble **ret; gint col, row; gdouble max; max = maxzero ? gwy_data_field_get_max(datafield) : 0.0; ret = _gwy_morph_lib_dallocmatrix(datafield->yres, datafield->xres); for (row = 0; row < datafield->yres; row++) { for (co...
false
false
false
false
false
0
its_finalize(JSContext *cx, JSObject *obj) { jsval *rootedVal; if (its_noisy) fprintf(gOutFile, "finalizing it\n"); rootedVal = (jsval *) JS_GetPrivate(cx, obj); if (rootedVal) { JS_RemoveRoot(cx, rootedVal); JS_SetPrivate(cx, obj, NULL); delete rootedVal; } }
false
false
false
false
false
0
switchToPlainText() { if (d->mMode == Rich) { d->mMode = Plain; // TODO: Warn the user about this? QMetaObject::invokeMethod(this, "insertPlainTextImplementation"); setAcceptRichText(false); emit textModeChanged(d->mMode); } }
false
false
false
false
false
0
_e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Container *con) { E_Config_Dialog_View *v; v = E_NEW(E_Config_Dialog_View, 1); if (!v) return 0; /* view methods */ v->create_cfdata = _e_desktop_edit_create_data; v->free_cfdata = _e_desktop_edit_free_data; v->basic.apply_cfdata = _e_desktop_...
false
false
false
false
false
0
update( int dT ) { switch ( banners.size() ) { case 0: break; case 1: banners[0]->update( dT ); break; default: { banners[0]->update( dT ); if ( banners[0]->movingAway() ) { banners[1]->update( dT ); } break; } } }
false
false
false
false
false
0
setScene(QGraphicsScene * scene) { if (scene != m_scene) { // set the scene removeFromScene(); m_scene = scene; // add existing items to the new scene if (m_scene && !m_wordItems.isEmpty()) foreach (WordItem * word, m_wordItems) m_scene->addItem(w...
false
false
false
false
false
0
drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, struct drm_plane *primary, struct drm_plane *cursor, const struct drm_crtc_funcs *funcs) { struct drm_mode_config *config = &dev->mode_config; int ret; WARN_ON(primary && primary->type != DRM_PLANE_TYPE_PRIMARY); WA...
false
false
false
false
false
0
normal_params_hash_to_str(gpointer key, gpointer value, gpointer user_data) { gint key_int; gchar * str_tmp = *(gchar **) user_data; if (str_tmp == NULL ) { return; } key_int = atoi((char *)key) - 1; if( key_int < 0 ) { return; } strncpy(str_tmp + key_int * ARGVI_MAX_LEN, (char*)value, ARGVI_MAX_LEN - 1...
true
true
false
false
true
1
sti_sas_init_sas_registers(struct snd_soc_codec *codec, struct sti_sas_data *data) { int ret; /* * DAC and SPDIF are activated by default * put them in IDLE to save power */ /* Initialise bi-phase formatter to disabled */ ret = snd_soc_update_bits(codec, STIH407_AUDIO_GLUE_CTRL, SPDIF_BIPHAS...
false
false
false
false
false
0
ssl_set_ciphersuites_for_version( ssl_context *ssl, const int *ciphersuites, int major, int minor ) { if( major != SSL_MAJOR_VERSION_3 ) return; if( minor < SSL_MINOR_VERSION_0 || minor > SSL_MINOR_VERSION_3 ) return; ssl->ciphersuite_list[minor] = ci...
false
false
false
false
false
0
wa_seg_iso_pack_desc_cb(struct urb *urb) { struct wa_seg *seg = urb->context; struct wa_xfer *xfer = seg->xfer; struct wahc *wa; struct device *dev; struct wa_rpipe *rpipe; unsigned long flags; unsigned rpipe_ready = 0; u8 done = 0; switch (urb->status) { case 0: spin_lock_irqsave(&xfer->lock, flags); wa...
false
false
false
false
false
0
updateCustomGaugeFrame(int frame_offset) { if(!custom_gauge) { return; } if (frame_offset < 0 ||frame_offset > custom_frame.num_frames) { return; } custom_frame_offset = frame_offset; }
false
false
false
false
false
0
compute_array_to_seek(int32 *user_seek, /* OUT: user seek */ int32 *array_indicies, /* IN: user array indicies */ int32 nt_size, /* IN: number type size */ int32 ndims, /* IN: number of dims */ DIM_REC *ddims ...
false
false
false
false
false
0
offsetSlot(Value *base, const LValue *lval) { if (!lval->compound || (lval->compMask & 0x1)) return base; Value *slot = cloneShallow(func, base); slot->reg.data.offset += (ffs(lval->compMask) - 1) * lval->reg.size; slot->reg.size = lval->reg.size; return slot; }
false
false
false
false
false
0
Check_Integer_Field(FIELD * field, const void * argp) { const integerARG *argi = (const integerARG *)argp; long low = argi->low; long high = argi->high; int prec = argi->precision; unsigned char *bp = (unsigned char *)field_buffer(field,0); char *s = (char *)bp; long va...
false
false
false
false
false
0
matrixInverse(matrix *pOut, float* pDet, const matrix *pM) { matrix adjoint; float det; int i; matrixAdjoint(&adjoint, &det, pM); if(pDet) *pDet = det; if(det == 0) return NULL; for(i = 0; i < 16; i++) { pOut->m[i] = adjoint.m[i] / det; } return pOut; }
false
false
false
false
false
0
RecoverBoundary(vtkPolyData *source) { vtkCellArray *lines=source->GetLines(); vtkCellArray *polys=source->GetPolys(); vtkIdType *pts = 0; vtkIdType npts = 0; vtkIdType i, p1, p2; int *triUse; // Recover the edges of the mesh for ( lines->InitTraversal(); lines->GetNextCell(npts,pts); ) { for...
false
false
false
false
false
0
pdacf_pcm_trigger(struct snd_pcm_substream *subs, int cmd) { struct snd_pdacf *chip = snd_pcm_substream_chip(subs); struct snd_pcm_runtime *runtime = subs->runtime; int inc, ret = 0, rate; unsigned short mask, val, tmp; if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE) return -EBUSY; switch (cmd) { case SNDRV...
false
false
false
false
false
0