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
addFastRegAlloc(FunctionPass *RegAllocPass) { addPass(&PHIEliminationID, false); addPass(&TwoAddressInstructionPassID, false); if (RegAllocPass) addPass(RegAllocPass); }
false
false
false
false
false
0
parse_uint16(char *value, uint16_t *uint16) { int v; enum command_result result; result = parse_int(value, &v); if (result != command_success) return command_error; if (v < 0 || v > 0xffff) return command_error; *uint16 = v; return command_success; }
false
false
false
false
false
0
PyFFFont_Round(PyFF_Font *self, PyObject *args) { double factor=1; FontViewBase *fv = self->fv; SplineFont *sf = fv->sf; EncMap *map = fv->map; int i, gid; if ( !PyArg_ParseTuple(args,"|d",&factor ) ) return( NULL ); for ( i=0; i<map->enccount; ++i ) if ( (gid=map->map[i])!=-1 && sf->glyphs...
false
false
false
false
false
0
fill_buffer(aac_buffer *b) { int bread; if (b->bytes_consumed > 0) { if (b->bytes_into_buffer) { memmove((void*)b->buffer, (void*)(b->buffer + b->bytes_consumed), b->bytes_into_buffer*sizeof(unsigned char)); } if (!b->at_eof) { ...
false
false
false
false
false
0
scalarproduct_int16_c(int16_t * v1, int16_t * v2, int order, int shift) { int res = 0; while (order--) res += (*v1++ * *v2++) >> shift; return res; }
false
false
false
false
false
0
ks0127_init(struct v4l2_subdev *sd) { u8 *table = reg_defaults; int i; v4l2_dbg(1, debug, sd, "reset\n"); msleep(1); /* initialize all registers to known values */ /* (except STAT, 0x21, 0x22, TEST and 0x38,0x39) */ for (i = 1; i < 33; i++) ks0127_write(sd, i, table[i]); for (i = 35; i < 40; i++) ks0127...
false
false
false
false
false
0
do_matrix_peek(int *image, int row, int col, int en) { int n, h, shift, next_shift; int row_array_len = read_int(image, 0, en); int column_array_len; int cell_offset; /* find row */ if (row_array_len == 0) { return 0; } for (n = 0; ; n++) { h = hash(row, row_array_len, n); if (read_int(imag...
false
false
false
false
false
0
getCube( DdManager * manager, st_table * visited, DdNode * f, int cost) { DdNode *sol, *tmp; DdNode *my_dd, *T, *E; cuddPathPair *T_pair, *E_pair; int Tcost, Ecost; int complement; my_dd = Cudd_Regular(f); complement = Cudd_IsComplement(f); sol = one; cuddRef(sol); ...
false
false
false
false
false
0
gee_concurrent_list_node_try_mark (GeeConcurrentListNode* self) { g_return_if_fail (self != NULL); { gboolean _tmp0_ = FALSE; _tmp0_ = TRUE; while (TRUE) { gboolean _tmp1_ = FALSE; GeeConcurrentListNode* next_node = NULL; GeeConcurrentListNode* _tmp3_ = NULL; gboolean _result_ = FALSE; GeeConcurr...
false
false
false
false
false
0
show_state(int) { ssp->show(stderr); if (config.hr_allocate_slots) { hr_info.show(stderr); } }
false
false
false
false
false
0
vnic_dev_init_devcmd1(struct vnic_dev *vdev) { vdev->devcmd = vnic_dev_get_res(vdev, RES_TYPE_DEVCMD, 0); if (!vdev->devcmd) return -ENODEV; vdev->devcmd_rtn = _vnic_dev_cmd; return 0; }
false
false
false
false
false
0
ntru_mult_int_64(NtruIntPoly *a, NtruIntPoly *b, NtruIntPoly *c, uint16_t modulus) { uint16_t N = a->N; if (N != b->N) return 0; if (modulus & (modulus-1)) /* check that modulus is a power of 2 */ return 0; c->N = N; ntru_mult_karatsuba_64((int16_t*)&a->coeffs, (int16_t*)&b->coeff...
false
false
false
false
false
0
fe_add_rawlog (server *serv, char *text, int len, int outbound) { char **split_text; char *new_text; int i; if (!serv->gui->rawlog_window) return; split_text = g_strsplit (text, "\r\n", 0); for (i = 0; i < g_strv_length (split_text); i++) { if (split_text[i][0] == 0) break; if (outbound) new_text...
false
false
false
false
false
0
run() { uint16 raport = sConfig.GetIntDefault("Ra.Port", 3443); std::string stringip = sConfig.GetStringDefault("Ra.IP", "0.0.0.0"); ACE_INET_Addr listen_addr(raport, stringip.c_str()); if (m_Acceptor->open(listen_addr, m_Reactor, ACE_NONBLOCK) == -1) ...
false
false
false
false
false
0
_add_connection(netsnmp_tcpconn_entry *entry, netsnmp_container *container) { tcpConnectionTable_rowreq_ctx *rowreq_ctx; DEBUGMSGTL(("tcpConnectionTable:access", "creating new entry\n")); /* * allocate an row context and set the index(es), then add it to * the container */ rowreq_ctx = ...
false
false
false
false
false
0
__subn_set_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data, struct ib_device *ibdev, u8 port, u32 *resp_len) { struct hfi1_ibport *ibp = to_iport(ibdev, port); u8 *p = data; int i; if (am) { smp->status |= IB_SMP_INVALID_FIELD; return reply((struct ib_mad_hdr *)smp); } for (i = 0; i < ARRA...
false
false
false
false
false
0
main(argc, argv) int argc; char **argv; { if (argc != 3) exit(E_ARGCNT); dacport = atoi(argv[1]); /* obtain DAC port */ // printf(" FDD. Dacport (%d) \n", dacport); debug = atoi(argv[2]); host_list = NULL; host_end = NULL; hlist_cnt = 0; dachostid = sng_gethostid(); initFdd(); startFdd(); }
false
false
false
false
false
0
PyFFGlyphPen_lineTo(PyObject *self, PyObject *args) { SplineChar *sc = ((PyFF_GlyphPen *) self)->sc; int layer = ((PyFF_GlyphPen *) self)->layer; SplinePoint *sp; SplineSet *ss; double x,y; if ( ((PyFF_GlyphPen *) self)->ended ) { PyErr_Format(PyExc_EnvironmentError, "The lineTo operator must ...
false
false
false
false
false
0
findProfile( const gchar *pnName ) { GList *psList = getProfiles(); struct sProfile *psProfile = NULL; while ( psList != NULL ) { psProfile = psList -> data; if ( psProfile != NULL ) { if ( !strcmp( psProfile -> pnName, pnName ) ) { return psProfile; } } psList = psList -> next; } return NULL;...
false
false
false
false
false
0
search_files_editor_loaded (SearchFiles* sf, IAnjutaEditor* editor) { search_box_set_search_string(sf->priv->search_box, sf->priv->last_search_string); if (sf->priv->last_replace_string) { search_box_set_replace_string(sf->priv->search_box, sf->priv->la...
false
false
false
false
false
0
kvm_vcpu_compat_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { struct kvm_vcpu *vcpu = filp->private_data; void __user *argp = compat_ptr(arg); int r; if (vcpu->kvm->mm != current->mm) return -EIO; switch (ioctl) { case KVM_SET_SIGNAL_MASK: { struct kvm_signal_mask __user *sigmask_a...
false
false
false
false
false
0
ossl_rsa_to_text(VALUE self) { EVP_PKEY *pkey; BIO *out; VALUE str; GetPKeyRSA(self, pkey); if (!(out = BIO_new(BIO_s_mem()))) { ossl_raise(eRSAError, NULL); } if (!RSA_print(out, pkey->pkey.rsa, 0)) { /* offset = 0 */ BIO_free(out); ossl_raise(eRSAError, NULL); } str = ossl_memb...
false
false
false
false
false
0
FindName(const char* name, const kwsys_stl::vector<kwsys_stl::string>& userPaths, bool no_system_path) { // Add the system search path to our path first kwsys_stl::vector<kwsys_stl::string> path; if (!no_system_path) { SystemTools::GetPath(path, "CMAKE_FILE_PATH"); SystemTools::G...
false
false
false
false
false
0
SetCells(vtkIdType ncells, vtkIdTypeArray *cells) { if ( cells && cells != this->Ia ) { this->Modified(); this->Ia->Delete(); this->Ia = cells; this->Ia->Register(this); this->NumberOfCells = ncells; this->InsertLocation = cells->GetMaxId() + 1; this->TraversalLocation = 0; } }
false
false
false
false
false
0
unique_input_switch_destroy( UniqueInputSwitch *input_switch ) { int i; DirectLink *n; SwitchConnection *connection; UniqueContext *context; D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); context = input_switch->context; D_MAGIC_ASSERT( context, UniqueCon...
false
false
false
false
false
0
locks(Task_locker* tl) { if (this->member_ != NULL) tl->add(this, this->next_blocker_); }
false
false
false
false
false
0
dib8000_update_lna(struct dib8000_state *state) { u16 dyn_gain; if (state->cfg.update_lna) { // read dyn_gain here (because it is demod-dependent and not tuner) dyn_gain = dib8000_read_word(state, 390); if (state->cfg.update_lna(state->fe[0], dyn_gain)) { dib8000_restart_agc(state); return 1; } } re...
false
false
false
false
false
0
mgdevice_OPENGL() { _mgf = mgopenglfuncs; if (_mgc != NULL && _mgc->devno != MGD_OPENGL) _mgc = NULL; return(0); }
false
false
false
false
false
0
il_write_targ_mem(struct il_priv *il, u32 addr, u32 val) { unsigned long reg_flags; spin_lock_irqsave(&il->reg_lock, reg_flags); if (likely(_il_grab_nic_access(il))) { _il_wr(il, HBUS_TARG_MEM_WADDR, addr); _il_wr(il, HBUS_TARG_MEM_WDAT, val); _il_release_nic_access(il); } spin_unlock_irqrestore(&il->reg_lo...
false
false
false
false
false
0
murrine_draw_slider_path (cairo_t *cr, int x, int y, int width, int height, int roundness) { int radius = MIN (roundness, MIN (width/2.0, height/2.0)); cairo_move_to (cr, x+radius, y); cairo_arc (cr, x+width-radius, y+radius, radius, M_PI*1.5, M_PI*2); cairo_line...
false
false
false
false
false
0
phylogeneticTree(string* phylipName, string* clustalName, string* distName, string* nexusName, string pimName) { TreeNames treeNames; treeNames.clustalName = *clustalName; treeNames.distName = *distName; treeNames.nexusName = *nexusName; treeNames.phylipName = *phylipN...
false
false
false
false
false
0
prune_extra_labels(struct rooted_tree *target_tree, struct hash *kept) { struct list_elem *el; for (el=target_tree->nodes_in_order->head; NULL != el; el=el->next) { struct rnode *current = el->data; char *label = current->label; if (0 == strcmp("", label)) continue; if (is_root(current)) continue; if (NULL...
false
false
false
false
false
0
nfs3_proc_lookup(struct inode *dir, struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr, struct nfs4_label *label) { struct nfs3_diropargs arg = { .fh = NFS_FH(dir), .name = name->name, .len = name->len }; struct nfs3_diropres res = { .fh = fhandle, .fattr = fattr }; struct rpc_...
false
false
false
false
false
0
glfwGetOSMesaContext(GLFWwindow* handle) { _GLFWwindow* window = (_GLFWwindow*) handle; _GLFW_REQUIRE_INIT_OR_RETURN(NULL); if (window->context.client == GLFW_NO_API) { _glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL); return NULL; } return window->context.osmesa.handle; }
false
false
false
false
false
0
distance(v1,v2) vertex_id v1,v2; { REAL *c1,*c2; REAL sum; int i; c1 = get_coord(v1); c2 = get_coord(v2); sum = 0.0; for ( i = 0 ; i < SDIM ; i++ ) sum += (c1[i] - c2[i])*(c1[i] - c2[i]); return sqrt(sum); }
false
false
false
false
false
0
qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport, int defer) { struct fc_rport *rport; scsi_qla_host_t *base_vha; unsigned long flags; if (!fcport->rport) return; rport = fcport->rport; if (defer) { base_vha = pci_get_drvdata(vha->hw->pdev); spin_lock_irqsave(vha->host->host_loc...
false
false
false
false
false
0
pid_create(const char* file) { FILE *fp; int lock; size_t i; strncpy(pid_file, file, sizeof(pid_file) - 5); pid_file[sizeof(pid_file)-5] = '\0'; for(i = strlen(pid_file); i != 0; i--) { if(pid_file[i] == '/' || pid_file[i] == '\\') break; if(pid_file[i] == '.') { pid_file[i] = '\0'; break; } } ...
false
false
false
false
false
0
gl841_bulk_read_data (Genesys_Device * dev, uint8_t addr, uint8_t * data, size_t len) { SANE_Status status; size_t size, target; uint8_t outdata[8], *buffer; DBG (DBG_io, "gl841_bulk_read_data: requesting %lu bytes\n", (u_long) len); if (len == 0) return SANE_STATUS_GOOD; status = ...
false
false
false
false
false
0
dJointGetPistonPositionRate ( dJointID j ) { dxJointPiston* joint = ( dxJointPiston* ) j; dUASSERT ( joint, "bad joint argument" ); checktype ( joint, Piston ); // get axis in global coordinates dVector3 ax; dMULTIPLY0_331 ( ax, joint->node[0].body->posr.R, joint->axis1 ); // The linear ve...
false
false
false
false
false
0
NsDbOpen(Ns_DbHandle *handle) { DbDriver *driverPtr = NsDbGetDriver(handle); Ns_Log(Notice, "dbdrv: opening database '%s:%s'", handle->driver, handle->datasource); if (driverPtr == NULL || driverPtr->openProc == NULL || (*driverPtr->openProc) (handle) != NS_OK) { Ns_Log(Error, "dbdrv: failed to ope...
false
false
false
false
false
0
xsocket_type(len_and_sockaddr **lsap, int family, int sock_type) { len_and_sockaddr *lsa; int fd; int len; if (family == AF_UNSPEC) { #if ENABLE_FEATURE_IPV6 fd = socket(AF_INET6, sock_type, 0); if (fd >= 0) { family = AF_INET6; goto done; } #endif family = AF_INET; } fd = xsocket(family, sock_typ...
false
false
false
false
false
0
iax2_parse_allow_disallow(struct ast_codec_pref *pref, iax2_format *formats, const char *list, int allowing) { int res; struct ast_format_cap *cap = ast_format_cap_alloc_nolock(); if (!cap) { return 1; } ast_format_cap_from_old_bitfield(cap, *formats); res = ast_parse_allow_disallow(pref, cap, list, allowing);...
false
false
false
false
false
0
hotkey_notify_wakeup(const u32 hkey, bool *send_acpi_ev, bool *ignore_acpi_ev) { /* 0x2000-0x2FFF: Wakeup reason */ *send_acpi_ev = true; *ignore_acpi_ev = false; switch (hkey) { case TP_HKEY_EV_WKUP_S3_UNDOCK: /* suspend, undock */ case TP_HKEY_EV_WKUP_S4_UNDOCK: /* hibernation, undock */ hotkey_wak...
false
false
false
false
false
0
alx_init_sw(struct alx_priv *alx) { struct pci_dev *pdev = alx->hw.pdev; struct alx_hw *hw = &alx->hw; int err; err = alx_identify_hw(alx); if (err) { dev_err(&pdev->dev, "unrecognized chip, aborting\n"); return err; } alx->hw.lnk_patch = pdev->device == ALX_DEV_ID_AR8161 && pdev->subsystem_vendor == P...
false
false
false
false
false
0
tonga_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode) { if (hwmgr->fan_ctrl_is_in_default_mode) { hwmgr->fan_ctrl_default_mode = PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, CG_FDO_CTRL2, FDO_PWM_MODE); hwmgr->tmin = PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, CG...
false
false
false
false
false
0
bnx2x_dcbx_read_mib(struct bnx2x *bp, u32 *base_mib_addr, u32 offset, int read_mib_type) { int max_try_read = 0; u32 mib_size, prefix_seq_num, suffix_seq_num; struct lldp_remote_mib *remote_mib ; struct lldp_local_mib *local_mib; switch (read_mib_type) { case DCBX_READ_LOCAL_MIB: ...
false
false
false
false
false
0
afr_sh_data_fxattrop (call_frame_t *frame, xlator_t *this, afr_fxattrop_cbk_t fxattrop_cbk) { afr_self_heal_t *sh = NULL; afr_local_t *local = NULL; afr_private_t *priv = NULL; dict_t *xattr_req = NULL; int32_t *zero_pending = NULL...
false
false
false
false
false
0
catchhup(int n) { unsigned cnt; struct hhash *hp, *np; #ifdef UNSAFE_SIGNALS signal(n, SIG_IGN); #endif for (cnt = 0; cnt < NETHASHMOD; cnt++) { for (hp = nhashtab[cnt]; hp; hp = np) { if (hp->dosname) free(hp->dosname); if (hp->actname) free(hp->actname); np = hp->hn_next; free((ch...
false
false
false
false
false
0
speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out) { int i; spx_int32_t N; float float_out[MAX_IN_SAMPLES]; int ret; speex_decoder_ctl(state, SPEEX_GET_FRAME_SIZE, &N); ret = (*((SpeexMode**)state))->dec(state, bits, float_out); for (i=0;i<N;i++) { if (float_out[i]>32767.f) ...
false
false
false
false
false
0
iscsi_login_post_auth_non_zero_tsih( struct iscsi_conn *conn, u16 cid, u32 exp_statsn) { struct iscsi_conn *conn_ptr = NULL; struct iscsi_conn_recovery *cr = NULL; struct iscsi_session *sess = conn->sess; /* * By following item 5 in the login table, if we have found * an existing ISID and a valid/existing ...
false
false
false
false
false
0
oss_get_volume( void ) { int v, cmd, devs; int curvol = 0; if( fd < 0 ) fd = open( mixer_device, O_RDONLY ); if( fd != -1 ) { ioctl( fd, SOUND_MIXER_READ_DEVMASK, &devs ); if( devs & mixer_dev_mask ) { cmd = MIXER_READ( mixer_channel ); } else { return curvol; } ioctl( fd, cmd, &v ); curvol = (...
false
false
false
false
false
0
expat_default_handler(XMLParserObject* self, const XML_Char* data_in, int data_len) { PyObject* key; PyObject* value; PyObject* res; if (data_len < 2 || data_in[0] != '&') return; if (PyErr_Occurred()) return; key = PyUnicode_DecodeUTF8(data_in + 1, data_...
true
true
false
false
false
1
chkArg2(STRPTR command, STRPTR arg1, STRPTR arg2) { BOOL ok = TRUE; if (cmdArgNum != 2) { fprintf(stderr, "two arguments required for command `%s': " "%s and %s\n", command, arg1, arg2); set_return_code(RC_ERROR); ok = FALSE; } return (ok); }
false
false
false
false
false
0
gs_shading_Fb_init(gs_shading_t ** ppsh, const gs_shading_Fb_params_t * params, gs_memory_t * mem) { gs_shading_Fb_t *psh; gs_matrix imat; int code = check_CBFD((const gs_shading_params_t *)params, params->Function, params->Domain, 2); if (code < 0 || ...
false
false
false
false
false
0
iommu_pc_get_set_reg_val(struct amd_iommu *iommu, u8 bank, u8 cntr, u8 fxn, u64 *value, bool is_write) { u32 offset; u32 max_offset_lim; /* Check for valid iommu and pc register indexing */ if (WARN_ON((fxn > 0x28) || (fxn & 7))) return -ENODEV; offset = (u32)(((0x40|bank) << 12) | (cntr << 8) ...
false
false
false
false
false
0
process_send_command_request(bool entry) { if (entry) { // Prepare the request command buffer m_buffer[0] = SOCKS4_VERSION; switch (m_proxyCommand) { case PROXY_CMD_CONNECT: m_buffer[1] = SOCKS4_CMD_CONNECT; break; case PROXY_CMD_BIND: m_buffer[1] = SOCKS4_CMD_BIND; break; case PROXY_CM...
false
false
false
false
false
0
caml_final_do_young_roots (scanning_action f) { uintnat i; Assert (old <= young); for (i = old; i < young; i++){ Call_action (f, final_table[i].fun); Call_action (f, final_table[i].val); } }
false
false
false
false
false
0
md5_final_text(char *buf, MD5_CONTEXT *ctx) { static const char *chars = "abcdefghijklmnopqrstuvwxyz234567"; int bit; if (!ctx->finalized) do_final(ctx); for (bit = 0; bit < 16*8; bit += 5) { int first_char = bit / 8; int val = ctx->buf[first_char] >> (bit % 8); if (bit + 8 > (first_char + 1) * 8 && first_c...
false
false
false
false
false
0
test_extension_python_activatable_subject_refcount (PeasEngine *engine, PeasPluginInfo *info) { PeasExtension *extension; GObject *object; PyObject *wrapper; /* Create the 'object' property value, to be similar to a GtkWindow * instance: a sunk GInitia...
false
false
false
false
false
0
gdl_dock_item_button_image_draw (GtkWidget *widget, cairo_t *cr) { GdlDockItemButtonImage *button_image; GtkStyleContext *context; GdkRGBA color; g_return_val_if_fail (widget != NULL, 0); button_image = GDL_DOCK_ITEM_BUTTON_IMAGE (widget); /* Set up the pe...
false
false
false
false
false
0
gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader) { GdkPixbufLoaderPrivate *priv; g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), NULL); priv = loader->priv; if (priv->animation) return gdk_pixbuf_animation_get_static_image (priv->animation); else...
false
false
false
false
false
0
_rtl88e_get_chnl_group(u8 chnl) { u8 group = 0; if (chnl < 3) group = 0; else if (chnl < 6) group = 1; else if (chnl < 9) group = 2; else if (chnl < 12) group = 3; else if (chnl < 14) group = 4; else if (chnl == 14) group = 5; return group; }
false
false
false
false
false
0
updateLitScores(bool firstTime) { TRACE("search literals", "updateLitScores(size=", d_litsByScores.size(), ") {"); unsigned count, score; if (firstTime && followChaff) { ::stable_sort(d_litsByScores.begin(), d_litsByScores.end(), compareLits); } for(size_t i=0; i< d_litsByScores.size(); ++i) { // R...
false
false
false
false
false
0
abs_diff (const unsigned char *in1, const unsigned char *in2, const int stride) { int s; int i, j, diff; s = 0; for (i = 0; i < 2 * DCTSIZE; i++) { for (j = 0; j < 2 * DCTSIZE; j++) { diff = in1[j] - in2[j]; s += diff * diff; } in1 += stride; in2 += stride; } return s; }
false
false
false
false
false
0
close() { thread::MutexGuard guard (access_mutex); out.close(); delete[] buffer; buffer = 0; closed = true; }
false
false
false
false
false
0
ir_edit_gainline(GxIREdit *ir_edit, cairo_t *c, GdkEventExpose *event) { GxRgba clr; get_color(ir_edit, &clr, "gain-line-color", &gain_line_color); double j, g; int n; gain_points *p; if (ir_edit->linear || !ir_edit->data) { return; } cairo_save(c); cairo_rectangle(c,0, 0, ir_edit->graph_x, ir_edit->graph_y)...
false
false
false
false
false
0
log_window_show(LogWindow *logwin) { GtkTextView *text = GTK_TEXT_VIEW(logwin->text); GtkTextBuffer *buffer = logwin->buffer; GtkTextMark *mark; logwin->hidden = FALSE; if (logwin->never_shown) gtk_text_view_set_buffer(GTK_TEXT_VIEW(logwin->text), logwin->buffer); logwin->never_shown = FALSE; mark = gtk_te...
false
false
false
false
false
0
edit(const CoordinateSequence *cs, const Geometry *geom) { if (cs->getSize()==0) return NULL; unsigned int csSize=cs->getSize(); vector<Coordinate> *vc = new vector<Coordinate>(csSize); // copy coordinates and reduce for (unsigned int i=0; i<csSize; ++i) { Coordinate ...
false
false
false
false
false
0
anzeigen() { Color c = Color(150, 150, 150); Area::fillBorder(c); int spz = Cuyo::getSpielerZahl(); malRahmen(spz == 1 ? L_fenster_breite_1sp : L_fenster_breite_2sp); if (spz == 1) { malVertRand(chooseX(L_spielfeld_x, 1, 0) - L_rand); } else { malVertRand(chooseX(L_spielfeld_x, 2, 0) - L_r...
false
false
false
false
false
0
R_PointToDist(fixed_t x, fixed_t y) { int angle; fixed_t dx, dy, temp; fixed_t dist; dx = abs(x - viewx); dy = abs(y - viewy); if (dy > dx) { temp = dx; dx = dy; dy = temp; } angle = (tantoangle[FixedDiv(dy, dx) >> DBITS] + ANG90) >> ANGLETOFINESHIF...
false
false
false
false
false
0
recv_tiger(struct tiger_hw *card, u8 irq_stat) { u32 idx; int cnt = card->recv.size / 2; /* Note receive is via the WRITE DMA channel */ card->last_is0 &= ~NJ_IRQM0_WR_MASK; card->last_is0 |= (irq_stat & NJ_IRQM0_WR_MASK); if (irq_stat & NJ_IRQM0_WR_END) idx = cnt - 1; else idx = card->recv.size - 1; if ...
false
false
false
false
false
0
fprintROWS () { struct row_s *pRow; for (pRow = LV_row; pRow != NULL; pRow = pRow->next) { fprintf (DEF_FILE, "ROW %s %s %ld %ld %s DO %ld BY %ld STEP %ld %ld ;\n", pRow->rowName, pRow->rowType, pRow->x, pRow->y, DEF_orient2a(pRow->...
false
false
false
false
false
0
usbhs_fifo_clear_dcp(struct usbhs_pipe *pipe) { struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); struct usbhs_fifo *fifo = usbhsf_get_cfifo(priv); /* CFIFO */ /* clear DCP FIFO of transmission */ if (usbhsf_fifo_select(pipe, fifo, 1) < 0) return; usbhsf_fifo_clear(pipe, fifo); usbhsf_fifo_unselect(pipe, fif...
false
false
false
false
false
0
irc_getchan_int(session_t *s, const char *name, int checkchan) { char *ret, *tmp; irc_private_t *j = irc_private(s); if (!xstrlen(name)) return NULL; if (!xstrncasecmp(name, IRC4, 4)) ret = xstrdup(name); else ret = irc_uid(name); if (checkchan == 2) return ret; tmp = SOP(_005_CHANTYPES); if (tmp ...
false
false
false
false
false
0
atkin_chunk_sieve_psquares(char* chunk, llong lower, llong upper, const char* sieved) { const llong chunk_size = upper - lower; for (llong p = 7; p * p < upper; ++p) { if (sieved[p] == 1) { llong p_sqr = p*p; llong mod = lower % p_sqr; llong i = p_sqr * (...
false
false
false
false
false
0
ar5523_cmd_tx_cb(struct urb *urb) { struct ar5523_tx_cmd *cmd = urb->context; struct ar5523 *ar = cmd->ar; if (urb->status) { ar5523_err(ar, "Failed to TX command. Status = %d\n", urb->status); cmd->res = urb->status; complete(&cmd->done); return; } if (!(cmd->flags & AR5523_CMD_FLAG_READ)) { cmd...
false
false
false
false
false
0
ping_try (GdmHostChooserWidget *widget) { do_ping (widget, FALSE); widget->priv->ping_tries --; if (widget->priv->ping_tries <= 0) { widget->priv->ping_try_id = 0; return FALSE; } else { return TRUE; } }
false
false
false
false
false
0
gst_rtp_mux_readjust_rtp_timestamp_locked (GstRTPMux * rtp_mux, GstRTPMuxPadPrivate * padpriv, GstRTPBuffer * rtpbuffer) { guint32 ts; guint32 sink_ts_base = 0; if (padpriv && padpriv->have_clock_base) sink_ts_base = padpriv->clock_base; ts = gst_rtp_buffer_get_timestamp (rtpbuffer) - sink_ts_base + ...
false
false
false
false
false
0
mcp23s17_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n) { u8 tx[2]; int status; if ((n + reg) > sizeof(mcp->cache)) return -EINVAL; tx[0] = mcp->addr | 0x01; tx[1] = reg << 1; status = spi_write_then_read(mcp->data, tx, sizeof(tx), (u8 *)vals, n * 2); if (status >= 0) { while...
false
false
false
false
false
0
computeScale(int& width, int& height, double borderX, double borderY, bool modify, agg::trans_affine* trans, bool exact) { double scale; double virtual_width = mMax_X - mMin_X; double virtual_height = mMax_Y - mMin_Y; double target_width = width - 2.0 * borderX; double target_he...
false
false
false
false
false
0
command_file(argument_count, arguments) int argument_count; char *arguments[]; { Book *book; char absolute_path[PATH_MAX + 1]; EBNet_Content_Type content_type; const char *prefix; char actual_file_name[EB_MAX_FILE_NAME_LENGTH + 1]; char message[EBNET_MAX_LINE_LENGTH + 1]; EBNet_Error...
false
false
false
false
false
0
ParseStanza(vector<metaIndex *> &List, pkgTagSection &Tags, int i, FileFd &Fd) { map<string, string> Options; string Enabled = Tags.FindS("Enabled"); if (Enabled.size() > 0 && StringToBool(Enabled...
false
false
false
false
false
0
lp8788_config_ldo_enable_mode(struct platform_device *pdev, struct lp8788_ldo *ldo, enum lp8788_ldo_id id) { struct lp8788 *lp = ldo->lp; struct lp8788_platform_data *pdata = lp->pdata; enum lp8788_ext_ldo_en_id enable_id; u8 en_mask[] = { [EN_ALDO1] = LP8788_EN_SEL_ALDO1_M, [EN_ALDO234] = LP8788_EN...
false
false
false
false
false
0
BERDecode(BufferedTransformation &bt) { BERSequenceDecoder subjectPublicKeyInfo(bt); BERSequenceDecoder algorithm(subjectPublicKeyInfo); GetAlgorithmID().BERDecodeAndCheck(algorithm); bool parametersPresent = algorithm.EndReached() ? false : BERDecodeAlgorithmParameters(algorithm); algorithm.MessageEnd(); ...
false
false
false
false
false
0
FoldGui4Cli(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); char chNext = styler[startPos]; int styleNext...
false
false
false
false
false
0
fixup_botched_add(struct ctlr_info *h, struct hpsa_scsi_dev_t *added) { /* called when scsi_add_device fails in order to re-adjust * h->dev[] to match the mid layer's view. */ unsigned long flags; int i, j; spin_lock_irqsave(&h->lock, flags); for (i = 0; i < h->ndevices; i++) { if (h->dev[i] == added) { ...
false
false
false
false
false
0
unregister_index(netsnmp_variable_list * varbind, int remember, netsnmp_session * ss) { struct snmp_index *idxptr, *idxptr2; struct snmp_index *prev_oid_ptr, *prev_idx_ptr; int res, res2, i; #if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(TESTING) if (netsnmp_ds_get_b...
false
false
false
false
false
0
selectVSplatUimmPow2(SDValue N, SDValue &Imm) const { APInt ImmValue; EVT EltTy = N->getValueType(0).getVectorElementType(); if (N->getOpcode() == ISD::BITCAST) N = N->getOperand(0); if (selectVSplat(N.getNode(), ImmValue, EltTy.getSizeInBits()) && ImmValue.getBitWidth() == EltTy.getSizeInBits()) { ...
false
false
false
false
false
0
xen_boot_params_init_edd(void) { #if IS_ENABLED(CONFIG_EDD) struct xen_platform_op op; struct edd_info *edd_info; u32 *mbr_signature; unsigned nr; int ret; edd_info = boot_params.eddbuf; mbr_signature = boot_params.edd_mbr_sig_buffer; op.cmd = XENPF_firmware_info; op.u.firmware_info.type = XEN_FW_DISK_INFO;...
false
false
false
false
false
0
lua_isnumber (lua_State *L, int idx) { TObject n; const TObject *o = luaA_indexAcceptable(L, idx); return (o != NULL && tonumber(o, &n)); }
false
false
false
false
false
0
Set_location ( char *text // ->first digit of line #. ) { char *name; int line = strtol(text, &name, 10); char *ename; name = Find_name(name, ename); if (!name) return; //cout << "Setting location at line " << line - 1 << endl; // We're 0-based. Uc_location::set_cur(name, line - 1); *name = '"'; /...
false
false
false
false
false
0
save_result(GabeditFileChooser *SelecFile, gint response_id) { gchar *fileName; GtkWidget *textResult = NULL; gchar *temp; FILE *file; gint i; if(response_id != GTK_RESPONSE_OK) return; fileName = gabedit_file_chooser_get_current_file(SelecFile); if ((!fileName) || (strcmp(fileName,"") == 0)) { M...
false
false
false
false
false
0
e_int_border_menu_hook_add(E_Border_Menu_Hook_Cb cb, const void *data) { E_Border_Menu_Hook *h; if (!cb) return NULL; h = E_NEW(E_Border_Menu_Hook, 1); if (!h) return NULL; h->cb = cb; h->data = (void*)data; menu_hooks = eina_list_append(menu_hooks, h); return h; }
false
false
false
false
false
0
cmdline_parser_release (struct gengetopt_args_info *args_info) { unsigned int i; free_string_field (&(args_info->add_all_arg)); free_string_field (&(args_info->add_all_orig)); free_string_field (&(args_info->recursive_arg)); free_string_field (&(args_info->recursive_orig)); free_string_field (&(args_info->s...
false
false
false
false
false
0
irqsoff_print_header(struct seq_file *s) { struct trace_array *tr = irqsoff_trace; if (is_graph(tr)) print_graph_headers_flags(s, GRAPH_TRACER_FLAGS); else trace_default_header(s); }
false
false
false
false
false
0
HPDF_Annotation_New (HPDF_MMgr mmgr, HPDF_Xref xref, HPDF_AnnotType type, HPDF_Rect rect) { HPDF_Annotation annot; HPDF_Array array; HPDF_STATUS ret = HPDF_OK; HPDF_REAL tmp; HPDF_PTRACE((" HPDF_Annotation_New\n")...
false
false
false
false
false
0
srp_send_tsk_mgmt(struct srp_rdma_ch *ch, u64 req_tag, u64 lun, u8 func, u8 *status) { struct srp_target_port *target = ch->target; struct srp_rport *rport = target->rport; struct ib_device *dev = target->srp_host->srp_dev->dev; struct srp_iu *iu; struct srp_tsk_mgmt *tsk_mgmt; int res; if (!ch->connect...
false
false
false
false
false
0
ldns_dnssec_zone_add_rr(ldns_dnssec_zone *zone, ldns_rr *rr) { ldns_status result = LDNS_STATUS_OK; ldns_dnssec_name *cur_name; ldns_rbnode_t *cur_node; ldns_rr_type type_covered = 0; if (!zone || !rr) { return LDNS_STATUS_ERR; } if (!zone->names) { zone->names = ldns_rbtree_create(ldns_dname_compare_v); ...
false
false
false
false
false
0
mtr_min(A) VARIABLE *A; { VARIABLE *C; double *a = MATR(A), *c; int nrowa = NROW(A), ncola = NCOL(A); int i, j; if (nrowa == 1 || ncola == 1) { C = var_temp_new(TYPE_DOUBLE, 1, 1); c = MATR(C); *c = *a++; nrowa = max(ncola, nrowa); for(i = 1; i < nrowa; i++, a++) *c = min(*c, *a); ...
false
false
false
false
false
0
bringSlavesUpToMin(EventSelector *es, int fd, unsigned int flags, void *data) { Slave *s; char reason[200]; minScheduled = 0; if (NUM_RUNNING_SLAVES >= Settings.minSlaves) { /* Enough slaves, so do nothing */ return; } /* Start a slave */ s = Slaves[STATE_STOPPED]; if...
true
true
false
false
false
1