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
usable_obs (const double *x, const double *y0, const double *y1, int t, const double **py) { *py = y0; if (!na(x[t]) && !na(y0[t])) { return 1; } else if (!na(x[t]) && y1 != NULL && !na(y1[t])) { *py = y1; return 1; } else { return 0; } }
false
false
false
false
false
0
loop_backing_file(struct super_block *sb) { struct file *ret; struct loop_device *l; ret = NULL; if (MAJOR(sb->s_dev) == LOOP_MAJOR) { l = sb->s_bdev->bd_disk->private_data; ret = l->lo_backing_file; } return ret; }
false
false
false
false
false
0
md_gets(BIO *bp, char *buf, int size) { EVP_MD_CTX *ctx; unsigned int ret; ctx=bp->ptr; if (size < ctx->digest->md_size) return(0); if (EVP_DigestFinal_ex(ctx,(unsigned char *)buf,&ret)<=0) return -1; return((int)ret); }
false
false
false
false
false
0
str_AddChars(char *string,char *append,long len) { if(string==NULL) { string = (char*)malloc(len+1); memcpy(string,append,len); string[len] = 0; return(string); } int slen=strlen(string); string = (char*)realloc(string,slen+len+1); string[slen+len] = 0; memcpy(string+slen,appen...
false
false
false
false
false
0
create_fire_button_selector( const char *title, struct button_info *info, GtkBox *parent, GtkTreeModel *model ) { GtkWidget *frame, *box, *combo; GtkCellRenderer *renderer; GtkTreeIter iter; GtkTreePath *path; size_t i; frame = gtk_frame_new( title ); gtk_box_pack_start( pare...
false
false
false
false
false
0
ipmi_oem_fujitsu_get_error_led (ipmi_oem_state_data_t *state_data) { uint8_t bytes_rq[IPMI_OEM_MAX_BYTES]; uint8_t bytes_rs[IPMI_OEM_MAX_BYTES]; uint8_t state; int rs_len; int rv = -1; assert (state_data); assert (!state_data->prog_data->args->oem_options_count); /* Fujitsu OEM * * http://manua...
false
false
false
false
false
0
rad_packet_build(struct rad_packet_t *pack, uint8_t *RA) { struct rad_attr_t *attr; uint8_t *ptr; if (!pack->buf) { //ptr = mmap(NULL, REQ_LENGTH_MAX, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); ptr = mempool_alloc(buf_pool); //if (ptr == MAP_FAILED) { if (!ptr) { log_emerg("radius:packet: o...
false
true
false
false
false
1
e_source_to_string (ESource *source, gsize *length) { GHashTableIter iter; GKeyFile *key_file; gpointer group_name; gpointer extension; gchar *data; g_return_val_if_fail (E_IS_SOURCE (source), NULL); g_rec_mutex_lock (&source->priv->lock); key_file = source->priv->key_file; source_save_...
false
false
false
false
false
0
settings_model_real_iter_n_children (GtkTreeModel* base, GtkTreeIter* iter) { SettingsModel * self; gint result = 0; GtkTreeIter* _tmp0_; Directory* _tmp1_ = NULL; Directory* _tmp2_; GList* _tmp3_; GList* _tmp4_; guint _tmp5_ = 0U; gint _tmp6_; self = (SettingsModel*) base; _tmp0_ = iter; _tmp1_ = settings_...
false
false
false
false
false
0
lutil_progname( const char* name, int argc, char *argv[] ) { char *progname; if(argc == 0) { return (char *)name; } #ifdef HAVE_EBCDIC if (_trans_argv) { int i; for (i=0; i<argc; i++) __etoa(argv[i]); _trans_argv = 0; } #endif LUTIL_SLASHPATH( argv[0] ); progname = strrchr ( argv[0], *LDAP_DIRSEP ); p...
false
false
false
false
false
0
link_sna_to_packet(g2_packet_t *target, union combo_addr *source) { /* We Assume network byte order for the IP */ if(AF_INET == source->s.fam){ target->data_trunk.data = (void *)&source->in.sin_addr.s_addr; target->data_trunk.capacity = sizeof(uint32_t); } else { target->data_trunk.data = (void *)source->in6.s...
false
false
false
false
false
0
csd_lock_wait(struct call_single_data *csd) { while (smp_load_acquire(&csd->flags) & CSD_FLAG_LOCK) cpu_relax(); }
false
false
false
false
false
0
code_write(const output::pointer &fp, int code, int code_size) { trace(("code_write(fp = %08lX, code = 0x%.*X, code_size = %d)", (long)fp.get(), (code_size + 3) / 4, code, code_size)); pack_buffer |= code << pack_buffer_len; pack_buffer_len += code_size; trace(("pack_buffer = 0x%.*lX", (pack_buf...
false
false
false
false
false
0
ace_allocate_descriptors(struct net_device *dev) { struct ace_private *ap = netdev_priv(dev); int size; size = (sizeof(struct rx_desc) * (RX_STD_RING_ENTRIES + RX_JUMBO_RING_ENTRIES + RX_MINI_RING_ENTRIES + RX_RETURN_RING_ENTRIES)); ap->rx_std_ring = pci_alloc_consistent(ap->pdev, size, &ap...
false
false
false
false
false
0
find_charmap(const unsigned char *name) { unsigned char buf[1024]; unsigned char *p; struct charmap *m; struct builtin_charmap *b; FILE *f = NULL; int y; if (!name) return 0; /* Install some initial character maps */ if (!charmaps) load_builtins(); /* Alias? */ for (y=0; alias_table[y].alias; ++y) i...
false
false
false
false
false
0
_getFloatConstantLogicalIndexUse( size_t logicalIndex, size_t requestedSize, uint16 variability) { if (mFloatLogicalToPhysical.isNull()) return 0; GpuLogicalIndexUse* indexUse = 0; OGRE_LOCK_MUTEX(mFloatLogicalToPhysical->mutex); GpuLogicalIndexUseMap::iterator ...
false
false
false
false
false
0
getbeforeafter(widecharbuf &wbefore, widecharbuf &wafter) { std::vector<unicode_char> before, after; text.get_contents(before, after); wbefore.init_unicode(before.begin(), before.end()); wafter.init_unicode(after.begin(), after.end()); }
false
false
false
false
false
0
irqhandler(int irq, struct uio_info *info) { struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info); if (!pci_check_and_mask_intx(gdev->pdev)) return IRQ_NONE; /* UIO core will signal the user process. */ return IRQ_HANDLED; }
false
false
false
false
false
0
pg_toupper(unsigned char ch) { if (ch >= 'a' && ch <= 'z') ch += 'A' - 'a'; else if (IS_HIGHBIT_SET(ch) && islower(ch)) ch = toupper(ch); return ch; }
false
false
false
false
false
0
my_compose_create_hook(gpointer cw, gpointer data) { gint ii; GSList *walk; GtkActionEntry *entries; GtkActionGroup *action_group; Compose *compose = (Compose*)cw; guint num_entries = g_slist_length(python_compose_scripts_names); action_group = gtk_action_group_new("PythonPlugin"); gtk_action_group_add...
false
false
false
false
false
0
CreateMatrixOffsetOp(OpRcPtrVec & ops, const float * m44, const float * offset4, TransformDirection direction) { bool mtxIsIdentity = IsM44Identity(m44); bool offsetIsIdentity = IsVecEqualToZero(offset4, 4); if(mtxIsIdentity && offs...
false
false
false
false
false
0
i915_gem_open(struct drm_device *dev, struct drm_file *file) { struct drm_i915_file_private *file_priv; int ret; DRM_DEBUG_DRIVER("\n"); file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); if (!file_priv) return -ENOMEM; file->driver_priv = file_priv; file_priv->dev_priv = dev->dev_private; file_priv->fil...
false
false
false
false
false
0
HTS_Model_add_parameter(HTS_Model * model, size_t state_index, const char *string, double *mean, double *vari, double *msd, double weight) { size_t i; size_t tree_index, pdf_index; size_t len = model->vector_length * model->num_windows; HTS_Model_get_index(model, state_index, string, &tree_index, &pdf_inde...
false
false
false
false
false
0
oc_index_name_cmp( const void *v_name, const void *v_oir ) { const struct berval *name = v_name; const struct oindexrec *oir = v_oir; int i = name->bv_len - oir->oir_name.bv_len; if (i) return i; return strncasecmp( name->bv_val, oir->oir_name.bv_val, name->bv_len ); }
false
false
false
false
false
0
find_rsb_nodir(struct dlm_ls *ls, char *name, int len, uint32_t hash, uint32_t b, int dir_nodeid, int from_nodeid, unsigned int flags, struct dlm_rsb **r_ret) { struct dlm_rsb *r = NULL; int our_nodeid = dlm_our_nodeid(); int recover = (flags & R_RECEIVE_RECOVER); int error; retry: error = pre_rsb...
false
false
false
false
false
0
iw_add_segment(IndexWriter *iw, SegmentReader *sr) { SegmentInfo *si = sis_new_segment(iw->sis, 0, iw->store); FieldInfos *fis = iw->fis; FieldInfos *sub_fis = sr->ir.fis; int j; const int fis_size = sub_fis->size; bool must_map_fields = false; si->doc_cnt = IR(sr)->max_doc(IR(sr)); /* ...
false
false
false
false
false
0
arizona_identify_headphone(struct arizona_extcon_info *info) { struct arizona *arizona = info->arizona; int ret; if (info->hpdet_done) return; dev_dbg(arizona->dev, "Starting HPDET\n"); /* Make sure we keep the device enabled during the measurement */ pm_runtime_get(info->dev); info->hpdet_active = true; ...
false
false
false
false
false
0
writeEntry(const QString& key, bool value) { setValue(key, value); }
false
false
false
false
false
0
pforward_pass(int midi, int t, int tl, int A, int B, int N, pwint * HH, pwint * DD) { int i, j; int s, f, g, h, hh, e; for (i = 1; i <= midi; i++) { s = HH[0]; HH[0] = hh = t = t + tl; f = t - open_penalty1(A + i, B + 1); for (j = 1; j <= N; j++) { g = open_penalty1(A + i, B + j); h = e...
false
false
false
false
false
0
sprint_realloc_null(u_char ** buf, size_t * buf_len, size_t * out_len, int allow_realloc, const netsnmp_variable_list * var, const struct enum_list *enums, const char *hint, const char *units) { if ((var->type != ASN_NULL) && (...
false
false
false
false
false
0
insert_block(data_t *new_data) { static int next_block_spot = 0; if(BlocksInUse == MaxNumBlocks) { /* hit max, trigger garbage collection */ // gc_run_with_block(new_data); gc_run(); if(BlocksInUse == MaxNumBlocks) { printf("max number of blocks hit\n"); ...
false
true
false
false
false
1
RegisterSpaceGroup (int nb, ...) { if (m_HMName.length () > 0 && _SpaceGroups.sgbn[m_HMName] == NULL) _SpaceGroups.sgbn[m_HMName] = this; if (m_HallName.length () > 0 && _SpaceGroups.sgbn[m_HallName] == NULL) _SpaceGroups.sgbn[m_HallName] = this; if (nb == 0) return; va_list args; va_start (args, nb); strin...
false
false
false
false
false
0
free_ref_list(struct ref_list *ref_list) { int i; for (i = 0; i < ref_list->index; i++) { free(ref_list->list[i].name); free(ref_list->list[i].dest); } free(ref_list->list); }
false
false
false
false
false
0
trio_isfinite TRIO_ARGS1((number), double number) { int dummy; switch (trio_fpclassify_and_signbit(number, &dummy)) { case TRIO_FP_INFINITE: case TRIO_FP_NAN: return 0; default: return 1; } }
false
false
false
false
false
0
GetYear(JSContext *cx, JSBool fullyear, jsval *vp) { jsdouble result; if (!GetAndCacheLocalTime(cx, JS_THIS_OBJECT(cx, vp), vp, &result)) return JS_FALSE; if (JSDOUBLE_IS_FINITE(result)) { result = YearFromTime(result); /* Follow ECMA-262 to the letter, contrary to IE JScript. */ ...
false
false
false
false
false
0
xsh_pfits_get_bias_right_stdev(cpl_propertylist * plist) { double returnvalue = 0; check_msg (xsh_get_property_value (plist, XSH_BIAS_RIGHT_STDEV, CPL_TYPE_DOUBLE,&returnvalue), "Error reading keyword '%s'", XSH_BIAS_RIGHT_STDEV); cleanup: return returnvalue; }
false
false
false
false
false
0
SizeGF_IPMPX_SendWatermark(GF_IPMPX_Data *_p) { u32 size; GF_IPMPX_SendWatermark *p = (GF_IPMPX_SendWatermark*)_p; size = 1; if (p->payload) size += GF_IPMPX_GetByteArraySize(p->payload); if (p->opaqueData) size += GF_IPMPX_GetByteArraySize(p->opaqueData); return size; }
false
false
false
false
false
0
update_view (void) { // in case there is no mailbox to update view from if (!mailbox_) return; // Insert the values of the options into the GUI widgets and update // widget status mailbox_->update_gui (OPTSGUI_UPDATE, OPTGRP_MAILBOX, gtkbuilder_, filename_); type_view (); }
false
false
false
false
false
0
processRunning(HttpConn *conn) { int canProceed; // MOB - refactor canProceed = 1; if (conn->connError) { httpSetState(conn, HTTP_STATE_COMPLETE); } else { if (conn->endpoint) { httpProcessPipeline(conn); if (conn->connError || conn->connectorComplete) {...
false
false
false
false
false
0
getword(int c, char **token_r, gnc_t gnc, void *closure) { char buf[256]; int i = 0; c = skip_whitespace(c, gnc, closure); if(c < 0) return c; if(c == '"' || c == '\n') return -2; do { if(i >= 255) return -2; buf[i++] = c; c = gnc(closure); } while(c ...
false
false
false
false
false
0
PR_LockFile(PRFileDesc *fd) { PRStatus status = PR_SUCCESS; if (pt_TestAbort()) return PR_FAILURE; PR_Lock(_pr_flock_lock); while (-1 == fd->secret->lockCount) PR_WaitCondVar(_pr_flock_cv, PR_INTERVAL_NO_TIMEOUT); if (0 == fd->secret->lockCount) { fd->secret->lockCount = -1; ...
false
false
false
false
false
0
ntext_mdrag(GtkWidget *widget, GdkEventMotion *em, gpointer data) { NText *me = (NText *) data; TPoint c; int x,y; if (!em) return FALSE; if (!me->havesel) return FALSE; if (em->state & GDK_BUTTON1_MASK) { x = (int)(em->x); y = (int)(em->y); if (y > me->ch) { me->lineDown(1); ...
false
false
false
false
false
0
JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim) { TRACE("JVM_NewMultiArray(env=%p, eltClass=%p, dim=%p)", env, eltClass, dim); if(eltClass == NULL || dim == NULL) { signalException(java_lang_NullPointerException, NULL); return NULL; } else { int i; c...
false
true
false
false
false
1
set_version(int v) { if(v<1||v>40){ this->status|=QR_VERSIONINFO_INVALID; throw(0); } this->version=v; this->cells_par_side=this->version*4+17; return(this->version); }
false
false
false
false
false
0
kvm_cpu_accept_dm_intr(struct kvm_vcpu *vcpu) { return (!lapic_in_kernel(vcpu) || kvm_apic_accept_pic_intr(vcpu)); }
false
false
false
false
false
0
commit_path (gpointer key, gpointer value, gpointer user_data) { IBusInputPadConfig *config; const gchar *path = (const gchar *) key; SavedTable *saved_table = (SavedTable *) value; gchar *p; gchar *section; gchar *name; g_return_if_fail (key != NULL && value != NULL); g_return_if_fail ...
false
false
false
false
false
0
init_eq_buf(struct mlx5_eq *eq) { struct mlx5_eqe *eqe; int i; for (i = 0; i < eq->nent; i++) { eqe = get_eqe(eq, i); eqe->owner = MLX5_EQE_OWNER_INIT_VAL; } }
false
false
false
false
false
0
defineHDF5LibraryException(int maj_num) { H5E_major_t err_num = (H5E_major_t) maj_num; if (H5E_ARGS == err_num) return "ncsa/hdf/hdf5lib/exceptions/HDF5FunctionArgumentException"; else if (H5E_RESOURCE == err_num) return "ncsa/hdf/hdf5lib/exceptions/HDF5ResourceUnavailableException"; el...
false
false
false
false
false
0
finish_profile(pTHX) { /* can be called after the perl interp is destroyed, via libcexit */ int saved_errno = errno; #ifdef MULTIPLICITY if (orig_my_perl && my_perl != orig_my_perl) if (trace_level) { logwarn("~ finish_profile call from different interpreter ignored\n"); return; ...
false
false
false
false
false
0
e_credentials_equal (const ECredentials *credentials1, const ECredentials *credentials2) { struct equal_data ed; if (!credentials1 && !credentials2) return TRUE; if (credentials1 == credentials2) return TRUE; if (!credentials1 || !credentials2) return FALSE; g_return_val_if_fail (cre...
false
false
false
false
false
0
gfs2_setattr_size(struct inode *inode, u64 newsize) { struct gfs2_inode *ip = GFS2_I(inode); int ret; u64 oldsize; BUG_ON(!S_ISREG(inode->i_mode)); ret = inode_newsize_ok(inode, newsize); if (ret) return ret; ret = get_write_access(inode); if (ret) return ret; inode_dio_wait(inode); ret = gfs2_rs_all...
false
false
false
false
false
0
Perl_ck_repeat(pTHX_ OP *o) { PERL_ARGS_ASSERT_CK_REPEAT; if (cBINOPo->op_first->op_flags & OPf_PARENS) { o->op_private |= OPpREPEAT_DOLIST; cBINOPo->op_first = force_list(cBINOPo->op_first); } else scalar(o); return o; }
false
false
false
false
false
0
load_file( const char *path ) { gchar *file; struct stat s; void *data; int fd, r; g_assert( path != NULL ); fd = open( path, O_RDONLY ); if ( fd == -1 ) { g_error( "Can't open %s: %m", path ); return NULL; } r = fstat( fd, &s ); g_assert( r == 0 ); data = mmap( NULL, s...
false
false
false
false
false
0
go_font_ref (GOFont const *font) { g_return_val_if_fail (font != NULL, NULL); ((GOFont *)font)->ref_count++; ref_debug (g_warning ("ref added %p = %d", font, font->ref_count);); return font; }
false
false
false
false
false
0
scopedNameToDecl(const char* file, int line, const ScopedName* sn) { const Scope::Entry* se = Scope::current()->findScopedName(sn, file, line); if (se) { switch (se->kind()) { case Scope::Entry::E_MODULE: case Scope::Entry::E_DECL: case Scope::Entry::E_CALLABLE: case Scope::Entry::E_INHERITED:...
false
false
false
false
false
0
lbs_set_mac_control_sync(struct lbs_private *priv) { struct cmd_ds_mac_control cmd; int ret = 0; lbs_deb_enter(LBS_DEB_CMD); cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.action = cpu_to_le16(priv->mac_control); cmd.reserved = 0; ret = lbs_cmd_with_response(priv, CMD_MAC_CONTROL, &cmd); lbs_deb_leave(LBS_DEB_...
false
false
false
false
false
0
channel_pos (int cycles) { const int *diag; if (cycles < 0) return 0; diag = get_ch (); if (cycles < diag[0]) return cycles; cycles -= diag[0]; cycles %= diag[0]; return cycles; }
false
false
false
false
false
0
menutils_Swap(StreamInteractor* S) { if(!S->menutils_CheckStackSize(2)) return; std::string a = S->popString(); std::string b = S->popString(); S->mystack->push(a); S->mystack->push(b); }
false
false
false
false
false
0
GetId(std::string username) { LoginDatabase.escape_string(username); QueryResult* result = LoginDatabase.PQuery("SELECT id FROM account WHERE username = '%s'", username.c_str()); if (!result) return 0; else { uint32 id = (*result)[0].GetUInt32(); delete result; return...
false
false
false
false
false
0
hdf_num_attrs(NC *handle,/* IN: handle to SDS */ int32 vg /* IN: ref of top Vgroup */) { int count = 0; int t, n; int32 vs, tag; int32 id = -1; char class[H4_MAX_NC_CLASS] = ""; intn ret_value = FAIL; #ifdef HDF_NUM_ATTRS fprintf(stderr, "hdf_nu...
false
false
false
false
false
0
PyFFLayer_docompare(PyFF_Layer *self,PyObject *other, double pt_err, double spline_err) { SplineSet *ss, *ss2; int ret; SplinePoint *badpoint; ss = SSFromLayer(self); if ( PyType_IsSubtype(&PyFF_ContourType,((PyObject *)other)->ob_type) ) { ss2 = SSFromContour((PyFF_Contour *) other,NULL); } ...
false
false
false
false
false
0
igorplugusb_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_device *udev; struct usb_host_interface *idesc; struct usb_endpoint_descriptor *ep; struct igorplugusb *ir; struct rc_dev *rc; int ret; udev = interface_to_usbdev(intf); idesc = intf->cur_altsetting; if (idesc->de...
false
false
false
false
false
0
isAxisymmetricElement(char* abq_name) { if ( LibFront::ncEqualPartial(abq_name, "CAX") || LibFront::ncEqualPartial(abq_name, "CGAX") || LibFront::ncEqualPartial(abq_name, "DCAX") ) return true; return false; }
false
false
false
false
false
0
make_ioa_addr(const u08bits* saddr, int port, ioa_addr *addr) { if(!saddr || !addr) return -1; ns_bzero(addr, sizeof(ioa_addr)); if((strlen((const s08bits*)saddr) == 0)|| (inet_pton(AF_INET, (const s08bits*)saddr, &addr->s4.sin_addr) == 1)) { addr->s4.sin_family = AF_INET; #if defined(TURN_HAS_SIN_LEN)...
false
false
false
false
false
0
lua_user_input_string(lua_State *L) { const char *title = luaL_checkstring(L, 1); const char *default_str = luaL_optstring(L, 2, ""); const char *str = GetEditableStringInPopupWindow(100, title, default_str); if (!str) str = strdup(""); lua_pushstring(L, str); free((void *)str); return 1; }
false
false
false
false
false
0
optionsUpdate() { if(type_ == Group || type_ == Profile) { drawGroupIcon(); } else if(type_ == Contact) { if(!d->alerting) resetStatus(); else resetAnim(); } }
false
false
false
false
false
0
peas_plugin_loader_python_garbage_collect (PeasPluginLoader *loader) { PeasPluginLoaderPython *pyloader = PEAS_PLUGIN_LOADER_PYTHON (loader); /* * We both run the GC right now and we schedule * a further collection in the main loop. */ run_gc_protected (); if (pyloader->priv->idle_gc == 0) pyload...
false
false
false
false
false
0
__declcnv_tostr(char *s, word32 *wp, int32 trimblen, int32 widnumlen) { register int32 chi; word32 *quot, *u, r0; int32 wlen; struct xstk_t *xsp; wlen = wlen_(trimblen); push_xstk_(xsp, wlen*WBITS/2); quot = xsp->ap; memset(quot, 0, wlen*WRDBYTES); push_xstk_(xsp, wlen*WBITS/2); u = xsp->ap; cp_walign_(u, w...
false
false
false
false
true
1
operator()(double focal) const { Mat3 K; K << focal, 0, principal_point_(0), 0, focal, principal_point_(1), 0, 0, 1; Mat3 E; EssentialFromFundamental(F_, K, K, &E); Mat3 R; Vec3 t; MotionFromEssentialAndCorrespondence(E, K...
false
false
false
false
false
0
gap_story_selection_all_set(GapStoryBoard *stb, gboolean sel_state) { GapStoryElem *stb_elem; GapStorySection *section; if(stb == NULL) { return; } for(section = stb->stb_section; section != NULL; section = section->next) { for(stb_elem = section->stb_elem; stb_elem != NULL; stb_elem = stb_elem->next...
false
false
false
false
false
0
WriteImageInformation(void) { itkDebugMacro(<< "WriteImageInformation()"); // the IORegion is not required to be set so we must use GetNumberOfDimensions if ( this->GetNumberOfDimensions() != 2 ) { itkExceptionMacro( "JPEG2000ImageIO failed to write file: " << this->GetFileName() << std...
false
false
false
false
false
0
test_str_xor_normal() { string s1 = "hit the bull's eye"; string s2 = "the kid don't play"; string temp = ""; temp.push_back('\0'); string expected = "\x1c\x01\x11"; expected += temp; expected += "\x1f\x01\x01"; expected += temp; expected += "\x06\x1a\x02KSSP\t\x18\x1c"; string g...
false
false
false
false
false
0
permissionsList(const char *pattern) { PQExpBufferData buf; PGresult *res; printQueryOpt myopt = pset.popt; static const bool translate_columns[] = {false, false, true, false, false, false}; initPQExpBuffer(&buf); /* * we ignore indexes and toast tables since they have no meaningful rights */ printfPQExp...
false
false
false
false
false
0
lexer_InvokeMacro(Macro *m) { if(!m) return; if(verbose &4) cout << "Invoking macro: " << m->name() << endl; theMacroChain.push(m); m->prepareForInvocation(); int i=0; bool bValidParameter = false; do { i++; char s[256]; bValidParameter = getNextMacroParameter(s,sizeof(s)); ...
false
false
false
false
false
0
StartReplication(StartReplicationCmd *cmd) { StringInfoData buf; /* * Let postmaster know that we're streaming. Once we've declared us as a * WAL sender process, postmaster will let us outlive the bgwriter and * kill us last in the shutdown sequence, so we get a chance to stream all * remaining WAL at shutdo...
false
false
false
false
false
0
write_ontologies_gvdb (gboolean overwrite, GError **error) { gchar *filename; filename = g_build_filename (g_get_user_cache_dir (), "tracker", "ontologies.gvdb", NULL); if (overwrite || !g_file_test...
false
false
false
false
false
0
init_display(struct fbtft_par *par) { par->fbtftops.reset(par); write_reg(par, 0xEF, 0x03, 0x80, 0x02); write_reg(par, 0xCF, 0x00, 0XC1, 0X30); write_reg(par, 0xED, 0x64, 0x03, 0X12, 0X81); write_reg(par, 0xE8, 0x85, 0x00, 0x78); write_reg(par, 0xCB, 0x39, 0x2C, 0x00, 0x34, 0x02); write_reg(par, 0xF7, 0x20); w...
false
false
false
false
false
0
toString() const { return QString("Color [red: %1][green: %2][blue: %3][alpha: %4]").arg(mColor.red()).arg(green()).arg(blue()).arg(alpha()); }
false
false
false
false
false
0
oct_permute_dimensions(ap_manager_t* man, bool destructive, oct_t* a, ap_dimperm_t* permutation) { oct_internal_t* pr = oct_init_from_manager(man,AP_FUNID_ADD_DIMENSIONS,0); bound_t* m = a->closed ? a->closed : a->m; bound_t* mm; arg_assert(permutation->size==a->dim,return NULL;); if (!m) mm...
false
false
false
false
false
0
getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const { btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin); btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin); //avoid an illegal AABB when there are no children if (!m_children.size()) { localHa...
false
false
false
false
false
0
insert(FXint *ptr,FXint op,FXint arg){ if(code){ memmove(ptr+2,ptr,sizeof(FXint)*(pc-ptr)); ptr[0]=op; ptr[1]=arg; } pc+=2; return ptr; }
false
false
false
false
false
0
gem2tos_color(int nbpl, int index) { switch(nbpl) { case 1: return ((unsigned int)index<1 ? index : 1); case 2: return ((unsigned int)index<4 ? gem2tos_2bpl[index] : 3); case 4: return ((unsigned int)index<16 ? gem2tos_4bpl[index] : 15); case 8: return ((unsigned int)inde...
false
false
false
false
false
0
esl_hmm_Create(const ESL_ALPHABET *abc, int M) { ESL_HMM *hmm = NULL; int k,x; int status; ESL_ALLOC(hmm, sizeof(ESL_HMM)); hmm->t = NULL; hmm->e = NULL; ESL_ALLOC(hmm->t, sizeof(float *) * M); ESL_ALLOC(hmm->e, sizeof(float *) * M); ESL_ALLOC(hmm->eo, sizeof(float *) * abc->Kp); hmm->...
false
true
false
false
false
1
xmmsv_list_move (xmmsv_t *listv, int old_pos, int new_pos) { x_return_val_if_fail (listv, 0); x_return_val_if_fail (xmmsv_is_type (listv, XMMSV_TYPE_LIST), 0); return _xmmsv_list_move (listv->value.list, old_pos, new_pos); }
false
false
false
false
false
0
output_console_line(struct octeon_device *oct, struct octeon_console *console, size_t console_num, char *console_buffer, s32 bytes_read) { char *line; s32 i; line = console_buffer; for (i = 0; i < bytes_read; i++) { /* Output a line at a time, prefixed */ if (console_buffer[i] == '\n') { con...
false
true
false
false
false
1
show_event(ivl_event_t net) { unsigned idx; fprintf(out, " event %s (%u pos, %u neg, %u any);\n", ivl_event_basename(net), ivl_event_npos(net), ivl_event_nneg(net), ivl_event_nany(net)); for (idx = 0 ; idx < ivl_event_nany(net) ; idx += 1) { ivl_nexus_t nex = ivl_event_any(net, ...
false
false
false
false
false
0
WriteSourceFiles(int h, dprograms_t *progs, pbool sourceaswell) { includeddatafile_t *idf; qcc_cachedsourcefile_t *f; int num=0; int ofs; /* for (f = qcc_sourcefile; f ; f=f->next) { if (f->type == FT_CODE && !sourceaswell) continue; SafeWrite(h, f->filename, strlen(f->filename)+1); i = PRLittleLong(f...
false
true
false
false
false
1
pci_pos_write(cpu_gen_t *cpu,struct pci_device *dev, int reg,m_uint32_t value) { struct pos_oc3_data *d = dev->priv_data; #if DEBUG_ACCESS POS_LOG(d,"write 0x%x to PCI register 0x%x\n",value,reg); #endif switch(reg) { case PCI_REG_BAR0: vm_map_device(cpu->vm,&d->dev,(...
false
false
false
false
false
0
isAtomic() const { if (getType().isBool()) { return isBoolConst(); } if (validIsAtomicFlag()) { return getIsAtomicFlag(); } for (int k = 0; k < arity(); ++k) { if (!(*this)[k].isAtomic()) { setIsAtomicFlag(false); return false; } } setIsAtomicFlag(true); return true; }
false
false
false
false
false
0
speex_bits_peek_unsigned(SpeexBits *bits, int nbBits) { unsigned int d=0; int bitPtr, charPtr; char *chars; if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+nbBits>bits->nbBits) bits->overflow=1; if (bits->overflow) return 0; bitPtr=bits->bitPtr; charPtr=bits->charPtr; chars = b...
false
false
false
false
false
0
AddMarkSet(int line, int valueSet) { if (line < 0 || line > LinesTotal()) { return; } unsigned int m = valueSet; for (int i = 0; m; i++, m >>= 1) if (m & 1) static_cast<LineMarkers *>(perLineData[ldMarkers])-> AddMark(line, i, LinesTotal()); DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0,...
false
false
false
false
false
0
open_files(std::vector<std::string>& f) { for (unsigned int x = 0; x < f.size(); x++) { mdi.create_document(f[x]); } if (f.size() == 0) { mdi.create_document(); } present(); }
false
false
false
false
false
0
d_message(const int level, const char* ifmt, const char *msg) { char* fmt; if (debug < level) return; fprintf(stderr,"DEBUG: "); fmt = (char *)ifmt; if (!fmt) fmt = (char *)"%s\n"; fprintf(stderr, fmt, msg); fflush(stderr); }
false
false
false
false
false
0
ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap) { if (usb_set_interface(adap->dev->udev, 0, 3) < 0) err("set interface to alts=3 failed"); if (adap->fe_adap[0].fe == NULL) { /* FE 0 DVB-C */ adap->fe_adap[0].fe = dvb_attach(tda10023_attach, &tda10023_config, &adap->dev->i2c_adap, 0x48); if ...
false
false
false
false
false
0
get_request_uri () const { ACE::IOS::CString_OStream sos; if (!this->proxy_host_.empty ()) { sos << this->get_scheme ().c_str () << "://" << ACE::INet::URL_INetBase::get_host ().c_str (); if (ACE::INet::URL_INetBase::get_port () != HTTP_PORT) ...
false
false
false
false
false
0
__lambda15_ (Block4Data* _data4_, GeeSet* added, GeeSet* removed, const gchar* m, FolksPersona* a, FolksGroupDetailsChangeReason r) { AggregationTests * self; GeeSet* _tmp0_ = NULL; GeeSet* _tmp1_ = NULL; #line 630 "/home/treitter/collabora/folks/tests/folks/aggregation.vala" self = _data4_->self; #line 630 "/home/...
false
false
false
false
false
0
errorSymbol( EMSG_T *mesg, char *name, WORD32 col ) { char linecol[12]; char *s; if( pass == 2 ) { s = ( name == NULL ) ? "" : name ; errors++; sprintf( linecol, "(%d:%d)", lineno, col + 1 ); fprintf( errorfile, "%s%-9s : error: %s \"%s\" at Loc = %5.5o\n", ...
false
false
false
false
false
0
ews_next_request (gpointer _cnc) { EEwsConnection *cnc = _cnc; GSList *l; EwsNode *node; QUEUE_LOCK (cnc); l = cnc->priv->jobs; if (!l || g_slist_length (cnc->priv->active_job_queue) >= EWS_CONNECTION_MAX_REQUESTS) { QUEUE_UNLOCK (cnc); return FALSE; } node = (EwsNode *) l->data; if (g_getenv ("EWS_DE...
false
false
false
false
false
0
SetFITSUnsignedPixels(const size_t length, const size_t bits_per_pixel,unsigned char *pixels) { register ssize_t i; for (i=0; i < (ssize_t) length; i++) { *pixels^=0x80; pixels+=bits_per_pixel >> 3; } }
false
false
false
false
false
0
gwy_3d_label_user_size(Gwy3DLabel *label, gdouble user_size) { g_return_val_if_fail(GWY_IS_3D_LABEL(label), 0.0); if (label->fixed_size) return label->size; if (label->size != user_size) { label->size = user_size; g_object_notify(G_OBJECT(label), "size"); ...
false
false
false
false
false
0