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
rcBuildDistanceField(rcContext* ctx, rcCompactHeightfield& chf) { rcAssert(ctx); ctx->startTimer(RC_TIMER_BUILD_DISTANCEFIELD); if (chf.dist) { rcFree(chf.dist); chf.dist = 0; } unsigned short* src = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP)...
false
false
false
false
true
1
WriteMolecule(OBBase* pOb, OBConversion* pConv) { OBMol* pmol = dynamic_cast<OBMol*>(pOb); if(pmol==NULL) return false; //Define some references so we can use the old parameter names ostream &ofs = *pConv->GetOutStream(); OBMol &mol = *pmol; char buffer[BUFF_SIZE]; snprintf(buffer...
false
false
false
false
false
0
make_row_distinct_op(ParseState *pstate, List *opname, RowExpr *lrow, RowExpr *rrow, int location) { Node *result = NULL; List *largs = lrow->args; List *rargs = rrow->args; ListCell *l, *r; if (list_length(largs) != list_length(rargs)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERR...
false
false
false
false
false
0
get_device_status(int fd) { struct termios t; if (fd < 0) return 0; return !tcgetattr(fd, &t); }
false
false
false
false
false
0
printFunctionSummary(raw_ostream &OS, const FunctionVector &Funcs) const { for (const GCOVFunction *Func : Funcs) { uint64_t EntryCount = Func->getEntryCount(); uint32_t BlocksExec = 0; for (const GCOVBlock &Block : Func->blocks()) if (Block.getNumDstEdges() && Bl...
false
false
false
false
false
0
soap_write_date(time_t date) { struct tm date_parts; Octstr* out; if (date < 0) /* sanity check - I don't think it should ever happen, but I don't want to get support calls at 2am because some gateway in the UK went bananas. */ return octstr_create("ERROR"); /* split up epoc...
false
false
false
false
false
0
get_base_info(struct file *fp, void __user *ubase, __u32 len) { struct hfi1_base_info binfo; struct hfi1_ctxtdata *uctxt = ctxt_fp(fp); struct hfi1_devdata *dd = uctxt->dd; ssize_t sz; unsigned offset; int ret = 0; trace_hfi1_uctxtdata(uctxt->dd, uctxt); memset(&binfo, 0, sizeof(binfo)); binfo.hw_version = d...
false
false
false
false
false
0
mono_load_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field) { MONO_REQ_GC_UNSAFE_MODE; static MonoMethod *getter = NULL; MonoDomain *domain = mono_domain_get (); MonoTransparentProxy *tp = (MonoTransparentProxy *) this_obj; MonoClass *field_class; MonoMethodMessage *msg; MonoArray...
false
false
false
false
true
1
multiply_parameters( int curr_parameter ) { ActionTemplate *tmp; int i, j, t, n; if ( curr_parameter == lnum_multiply_parameters ) { tmp = new_ActionTemplate( lo_num ); for ( i = 0; i < lo->num_vars; i++ ) { tmp->inst_table[i] = lo->inst_table[i]; } tmp->next = gtemplates; gtemplates ...
false
false
false
false
false
0
demodulate(Term t, Mindex demods, Ilist *just_head, BOOL lex_order_vars) { int flag = claim_term_flag(); Term result; if (demods->unif_type == ORDINARY_UNIF) result = demod(t, demods, flag, just_head, lex_order_vars); else result = demod_bt(t, demods, -1, flag, just_head); term_flag_clear_recursively...
false
false
false
false
false
0
fsbe_get_operand_unit_size(Operand *op) { switch(op->kind){ case KIND_VAR: return(op->tbl.v->size); case KIND_ARRAY: return(op->tbl.a->size / op->tbl.a->total); default: fprintf(stderr, "ERROR(fsbe_get_operand_unit_size): not implemented kind: %s\n", ...
false
false
false
false
false
0
hash_delete(char *name, hashtable *ht) #else hash_delete(name, ht) char *name; hashtable *ht; #endif { hashnode *hp; hp = hash_bucket(name, ht); if (*hp) { free((char *) *hp); *hp = 0; } }
false
false
false
false
false
0
data_write_file( disk_t *d, FILE *file, int seclen ) { int len = 0x80 << seclen; if( fwrite( &d->track[ d->i ], len, 1, file ) != 1 ) return 1; return 0; }
false
false
false
false
false
0
gv_set_defaults(geovect * gv) { int i; if (!gv) { return (-1); } G_debug(5, "gv_set_defaults() id=%d", gv->gvect_id); gv->filename = NULL; gv->n_lines = gv->n_surfs = gv->use_mem = 0; gv->x_trans = gv->y_trans = gv->z_trans = 0.0; gv->lines = NULL; gv->fastlines = NULL; g...
false
false
false
false
false
0
gtk_knob_set_animation (GtkKnob *knob, GtkKnobAnim *anim) { g_return_if_fail (knob != NULL); g_return_if_fail (anim != NULL); g_return_if_fail (GTK_IS_KNOB (knob)); knob->anim = (GtkKnobAnim *)anim; knob->width = anim->frame_width; knob->height = anim->height; if (gtk_widget_get_realize...
false
false
false
false
false
0
testDebugContext(void ) { SVUT_SET_CONTEXT("test","value"); SVUT_ASSERT_EQUAL(2,3); }
false
false
false
false
false
0
parseCommonRSP(DcmDataset *obj, Uint16 *command, Uint16 *messageIDBeingRespondedTo, Uint16 *dataSetType, Uint16 *status) { OFCondition cond = getAndDeleteUS(obj, DCM_CommandField, command); RET(cond); cond = getAndDeleteUS(obj, DCM_MessageIDBeingRespondedTo, messageIDBeingRespondedTo); RET(cond); co...
false
false
false
false
false
0
icpHandleUdp(int sock, void *data) { int *N = &incoming_sockets_accepted; struct sockaddr_in from; socklen_t from_len; LOCAL_ARRAY(char, buf, SQUID_UDP_SO_RCVBUF); int len; int icp_version; int max = INCOMING_ICP_MAX; commSetSelect(sock, COMM_SELECT_READ, icpHandleUdp, NULL, 0); whil...
false
false
false
false
false
0
rad_recv_header(int sockfd, fr_ipaddr_t *src_ipaddr, int *src_port, int *code) { ssize_t data_len, packet_len; uint8_t header[4]; struct sockaddr_storage src; socklen_t sizeof_src = sizeof(src); data_len = recvfrom(sockfd, header, sizeof(header), MSG_PEEK, (struct sockaddr *)&src, &sizeof_src); if...
false
false
false
false
false
0
writeRegistry(){ if (shown()) { getApp()->reg().writeIntEntry("window","remote-x",getX()); getApp()->reg().writeIntEntry("window","remote-y",getY()); getApp()->reg().writeIntEntry("window","remote-width",getWidth()); getApp()->reg().writeIntEntry("window","remote-height",getHeight()); } }
false
false
false
false
false
0
ResetAfterSkip(VP8EncIterator* const it) { if (it->mb_->type_ == 1) { *it->nz_ = 0; // reset all predictors it->left_nz_[8] = 0; } else { *it->nz_ &= (1 << 24); // preserve the dc_nz bit } }
false
false
false
false
false
0
DrealEraseRecWin( Rectangle ) rdsrec_list *Rectangle; { drealrecwin *ScanRecWin; drealrecwin *DelRecWin; rdsbegin(); if ( ! IsDrealOneWindow( Rectangle ) ) { ScanRecWin = DREAL_WINDOW( Rectangle ); do { DelRecWin = ScanRecWin; ScanRecWin = ScanRecWin->NEXT; DrealFreeRec...
false
false
false
false
false
0
glade_widget_create_packing_properties (GladeWidget *container, GladeWidget *widget) { GladePropertyClass *property_class; GladeProperty *property; GList *list, *packing_props = NULL; /* XXX TODO: by checking with some GladePropertyClass metadata, decide * which packing properties go on w...
false
false
false
false
false
0
matrix_assign_variable(pk_internal_t* pk, bool destructive, matrix_t* mat, ap_dim_t dim, numint_t* tab) { size_t i,j,var; bool den; matrix_t* nmat; var = pk->dec + dim; den = numint_cmp_int(tab[0],1)>0; nmat = destructive ? mat : _matrix_alloc_int(mat->nbrows,mat->nbcolumns,fals...
false
false
false
false
false
0
curl_easy_getinfo(CURL *curl, CURLINFO info, ... ) { va_list ap; long *var; va_start(ap,info); switch(info) { case CURLINFO_RESPONSE_CODE: var=va_arg(ap,long *); *var=curl->status; break; default: break; } return handle_error(curl,CURLE_OK,NULL); }
false
false
false
false
false
0
save_VertexAttrib3fvARB(GLuint index, const GLfloat * v) { if (index < MAX_VERTEX_GENERIC_ATTRIBS) save_Attr3fARB(index, v[0], v[1], v[2]); else index_error(); }
false
false
false
false
false
0
SerialOpen(void){ // open the port // O_RDWR = read/write // O_NOCTTY = not controlling // O_NDELAY = don't wait for other port to open if((fd = open(SERIALPORT, (O_RDWR | O_NOCTTY | O_NDELAY))) == -1){ // could not open the port printf("Could not open serial communications - %s Error number: %d\n", SERIALPO...
false
false
false
false
false
0
visitSREM(SDNode *N) { SDValue N0 = N->getOperand(0); SDValue N1 = N->getOperand(1); ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0); ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1); EVT VT = N->getValueType(0); // fold (srem c1, c2) -> c1%c2 if (N0C && N1C && !N1C->isNullValue()) return DAG.Fo...
false
false
false
false
false
0
nfs4_init_client(struct nfs_client *clp, const struct rpc_timeout *timeparms, const char *ip_addr) { char buf[INET6_ADDRSTRLEN + 1]; struct nfs_client *old; int error; if (clp->cl_cons_state == NFS_CS_READY) { /* the client is initialised already */ dprintk("<-- nfs4_init_client() = 0 [already ...
false
false
false
false
false
0
theorem_weapon_shot_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) { fprintf(stderr, "normal_shot_act: my is NULL\n"); return 0; } if (player == NULL) return 0; my->count[2] = theorem_weapon_shot_seek(my->x, my->y, ...
false
false
false
false
false
0
rtl8180_conf_tx(struct ieee80211_hw *dev, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) { struct rtl8180_priv *priv = dev->priv; u8 cw_min, cw_max; /* nothing to do ? */ if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8180) return 0; cw_min = fls(params->cw...
false
false
false
false
false
0
init_s3_values(FLOAT ** p, int (*s3ind)[2], int npart, FLOAT const *bval, FLOAT const *bval_width, FLOAT const *norm) { FLOAT s3[CBANDS][CBANDS]; /* The s3 array is not linear in the bark scale. * bval[x] should be used to get the bark value. */ int i, j, k; int number...
false
false
false
false
true
1
InvokeByIndex (int aIndex, const NPVariant *argv, uint32_t argc, NPVariant *_result) { TOTEM_LOG_INVOKE (aIndex, totemGMPControls); switch (Methods (aIndex)) { case ePause: /* void pause (); */ Plugin...
false
false
false
false
false
0
baseURL() { // try to find the style sheet. If found look for its url. // If it has none, look for the parentsheet, or the parentNode and // try to find out about their url StyleSheetImpl *sheet = stylesheet(); if(!sheet) return KUrl(); if(!sheet->href().isNull()) return KUrl( sheet->...
false
false
false
false
false
0
dParseFloatFormat(char *buf, int *num, int *size) { char *tmp, *period; tmp = buf; while (*tmp++ != '(') ; *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ while (*tmp != 'E' && *tmp != 'e' && *tmp != 'D' && *tmp != 'd' && *tmp != 'F' && *tmp != 'f') { /* May find kP before nE/nD/nF, l...
false
false
false
false
false
0
pvr2_ioread_start(struct pvr2_ioread *cp) { int stat; struct pvr2_buffer *bp; if (cp->enabled) return 0; if (!(cp->stream)) return 0; pvr2_trace(PVR2_TRACE_START_STOP, "/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp); while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != NULL) { stat = pvr2_buffer_que...
false
false
false
false
false
0
P_maxpos(f) FILE *f; { long savepos = ftell(f); long val; if (fseek(f, 0L, SEEK_END)) return -1; val = ftell(f); if (fseek(f, savepos, SEEK_SET)) return -1; return val; }
false
false
false
false
false
0
isTree (const Tree& t, const Node& n, Tree& a) { if ((t->node() == n) && (t->arity() == 1)) { a=t->branch(0); return true; } else { return false; } }
false
false
false
false
false
0
afr_fd_ctx_get (fd_t *fd, xlator_t *this) { uint64_t ctx = 0; afr_fd_ctx_t *fd_ctx = NULL; int ret = 0; ret = fd_ctx_get (fd, this, &ctx); if (ret < 0) goto out; fd_ctx = (afr_fd_ctx_t *)(long) ctx; out: return fd_ctx; }
false
false
false
false
false
0
THX_ck_entersub_pad_scalar(pTHX_ OP *entersubop, GV *namegv, SV *ckobj) { OP *pushop, *argop; PADOFFSET padoff = NOT_IN_PAD; SV *a0, *a1; ck_entersub_args_proto(entersubop, namegv, ckobj); pushop = cUNOPx(entersubop)->op_first; if(!pushop->op_sibling) pushop = cUNOPx(pushop)->op_first; argop...
false
false
false
false
false
0
Change() { if( PlanarConfiguration != 0 && PlanarConfiguration != 1 ) return false; // seriously Output = Input; if( Input->GetPixelFormat().GetSamplesPerPixel() != 3 ) { return true; } assert( Input->GetPhotometricInterpretation() == PhotometricInterpretation::YBR_FULL || Input->GetPhotometricI...
false
false
false
false
false
0
cue_print (FILE *fp, Cd *cd) { Cdtext *cdtext = cd_get_cdtext(cd); int i; /* track */ Track *track = NULL; /* print global information */ if (NULL != cd_get_catalog(cd)) { fprintf(fp, "CATALOG %s\n", cd_get_catalog(cd)); } cue_print_cdtext(cdtext, fp, 0); /* print track information */ for (i = 1; i <= cd_...
false
false
false
false
false
0
gwy_plain_tool_data_switched(GwyTool *tool, GwyDataView *data_view) { GwyPlainTool *plain_tool; gwy_debug("%s %p", GWY_TOOL_GET_CLASS(tool)->title, data_view); if (GWY_TOOL_CLASS(gwy_plain_tool_parent_class)->data_switched) GWY_TOOL_CLASS(gwy_plain_tool_parent_class)->d...
false
false
false
false
false
0
bfa_ioc_debug_save_ftrc(struct bfa_ioc_s *ioc) { int tlen; if (ioc->dbg_fwsave_once) { ioc->dbg_fwsave_once = BFA_FALSE; if (ioc->dbg_fwsave_len) { tlen = ioc->dbg_fwsave_len; bfa_ioc_debug_fwtrc(ioc, ioc->dbg_fwsave, &tlen); } } }
false
false
false
false
false
0
kmod_list_prev(const struct kmod_list *list, const struct kmod_list *curr) { if (list == NULL || curr == NULL) return NULL; if (list == curr) return NULL; return container_of(curr->node.prev, struct kmod_list, node); }
false
false
false
false
false
0
netxen_issue_cmd(struct netxen_adapter *adapter, struct netxen_cmd_args *cmd) { u32 rsp; u32 signature = 0; u32 rcode = NX_RCODE_SUCCESS; signature = NX_CDRP_SIGNATURE_MAKE(adapter->ahw.pci_func, NXHAL_VERSION); /* Acquire semaphore before accessing CRB */ if (netxen_api_lock(adapter)) return NX_RCODE_TI...
false
false
false
false
false
0
ok() { double weight; QString tmp=weightLineEdit->text(); weight_sscanf(tmp, "%lf", &weight); if(weight<0.0 || weight>100){ QMessageBox::warning(this, tr("FET information"), tr("Invalid weight")); return; } if(selectedRoomsListWidget->count()==0){ QMessageBox::warning(this, tr("FET information"), tr(...
false
false
false
false
false
0
fcgi_kill(ServerProcess *process, int sig) { FCGIDBG3("fcgi_kill(%ld, %d)", (long) process->pid, sig); process->state = FCGI_VICTIM_STATE; #ifdef WIN32 if (sig == SIGTERM) { SetEvent(process->terminationEvent); } else if (sig == SIGKILL) { TerminateProcess(...
false
false
false
false
false
0
remove_env(const char *str) { char **envp; envp = find_env(str); FREE(*envp); do *envp = *(envp + 1); while (*++envp); envsize--; }
false
false
false
false
false
0
mono_metadata_field_info_full (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva, MonoMarshalSpec **marshal_spec, gboolean alloc_from_image) { MonoTableInfo *tdef; locator_t loc; loc.idx = index + 1; if (meta->uncompressed_metadata) loc.idx = search_ptr_table (meta, MONO_TABLE_FIELD_POINT...
false
false
false
false
false
0
e_preferences_window_new (gpointer shell) { EPreferencesWindow *window; window = g_object_new (E_TYPE_PREFERENCES_WINDOW, NULL); /* ideally should be an object property */ window->priv->shell = shell; if (shell) g_object_add_weak_pointer (shell, &window->priv->shell); return GTK_WIDGET (window); }
false
false
false
false
false
0
check_correct_version(const string name, bool has_top, bool has_config, const vector<string>& triedLocations, ConfigCollection& coll) { if (has_config) { const string& val = coll.getStringValue(GLE_CONFIG_GLE, GLE_CONFIG_GLE_VERSION); if (!str_i_equals(val.c_str(), GLEVN)) { ostringstream out; out << "Error:...
false
false
false
false
false
0
AddLink( const wxString& link, uint8 category ) { wxString uri(link); if (link.compare(0, 7, wxT("magnet:")) == 0) { uri = CMagnetED2KConverter(link); if (uri.empty()) { AddLogLineC(CFormat(_("Cannot convert magnet link to eD2k: %s")) % link); return false; } } if (uri.compare(0, 7, wxT("ed2k://")) ==...
false
false
false
false
false
0
main(int argc, char * argv[]) { double start = get_seconds(); printf("start: %lgs\n",start); double lap = start; double now; do { now = get_seconds(); if((now-lap)>=1.0) { printf("%lgs - %lgs = %lgs\n",now,start,now-start); lap = now-((now-start)-floor(now-start)); } }while((no...
false
false
false
false
false
0
visitOperation(const OperationPtr& p) { DefinitionContextPtr dc = p->definitionContext(); assert(dc); TypePtr ret = p->returnType(); if(ret) { validateSequence(dc, p->line(), ret, p->getMetaData()); } ParamDeclList params = p->parameters(); for(ParamDeclList::iterator q = param...
false
false
false
false
false
0
autoload_name(name) char_u *name; { char_u *p; char_u *scriptname; /* Get the script file name: replace '#' with '/', append ".vim". */ scriptname = alloc((unsigned)(STRLEN(name) + 14)); if (scriptname == NULL) return FALSE; STRCPY(scriptname, "autoload/"); STRCAT(scriptname, name); ...
false
false
false
false
false
0
dir_t_extract_regular_files(dir_t *d) { dir_t * dd; int i; if (NULL == d) return(NULL); dd = dir_t_create(); memcpy(dd->dir, d->dir, FILENAME_MAX); for (i = 0 ; i < d->amount ; i++) { if (strstr(d->entry[i].name, "_rec")) { memcpy( (dd->entry + dd->amount), (d->entry + i), sizeof(entry_t)...
false
true
false
false
false
1
minimize_path(path) char *path; { char *cpath = path; char *opath = path; if (*opath == '/') *cpath++ = *opath++; else fatal("relative path encountered"); while (*opath) { while (*opath == '/' || (*opath == '.' && (*(opath + 1) == '/' || *(opath + 1) == '\0'))) opath++; ...
false
false
false
false
true
1
i40e_disable_vf_mappings(struct i40e_vf *vf) { struct i40e_pf *pf = vf->pf; struct i40e_hw *hw = &pf->hw; int i; /* disable qp mappings */ wr32(hw, I40E_VPLAN_MAPENA(vf->vf_id), 0); for (i = 0; i < I40E_MAX_VSI_QP; i++) wr32(hw, I40E_VPLAN_QTABLE(i, vf->vf_id), I40E_QUEUE_END_OF_LIST); i40e_flush(hw); ...
false
false
false
false
false
0
gimple_divmod_values_to_profile (gimple stmt, histogram_values *values) { tree lhs, divisor, op0, type; histogram_value hist; if (gimple_code (stmt) != GIMPLE_ASSIGN) return; lhs = gimple_assign_lhs (stmt); type = TREE_TYPE (lhs); if (!INTEGRAL_TYPE_P (type)) return; switch (gimple_assign_rhs_c...
false
false
false
false
false
0
fwrr_get_srv(struct server *s) { struct proxy *p = s->proxy; struct fwrr_group *grp = (s->flags & SRV_F_BACKUP) ? &p->lbprm.fwrr.bck : &p->lbprm.fwrr.act; if (s->lb_tree == grp->init) { fwrr_get_srv_init(s); } else if (s->lb_tree == grp->next) { fwrr_get_srv_next(s); } else if (s->lb_tree == NULL) { f...
false
false
false
false
false
0
add_revision_panel (GitgWindow *window, GType panel_type) { GitgRevisionPanel *panel; gchar *label; GtkWidget *label_widget; GtkWidget *page; g_return_if_fail (g_type_is_a (panel_type, GITG_TYPE_REVISION_PANEL)); panel = g_object_new (panel_type, NULL); gitg_revision_panel_initialize ...
false
false
false
false
false
0
handleRecord(const int groupcode, const dimeParam &param, dimeMemHandler * const memhandler) { switch(groupcode) { case 210: case 220: case 230: this->extrusionDir[(groupcode-210)/10] = param.double_data; return true; case 39: this->thickness = param.double_data; return true...
false
false
false
false
false
0
editarch(no) int no; { archive_t list; char *cp; int n; if (no < maxarchive) { list.ext = Xstrdup(archivelist[no].ext); list.flags = archivelist[no].flags; } else { if (!(cp = inputcuststr(EXTAR_K, 1, NULL, -1))) return(0); list.ext = getext(cp, &(list.flags)); Xfree(cp); if (!(list.ext[0]) || !(list...
false
false
false
false
false
0
evas_debug_generic(const char *str) { if (!_evas_debug_init) { _evas_debug_init_from_env(); } if ((_evas_debug_show == _EVAS_DEBUG_SHOW) || (_evas_debug_show == _EVAS_DEBUG_DEFAULT)) CRIT("%s", str); if (_evas_debug_abort) abort(); }
false
false
false
false
false
0
_wrap_svn_fs_change_txn_prop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; svn_fs_txn_t *arg1 = (svn_fs_txn_t *) 0 ; char *arg2 = (char *) 0 ; svn_string_t *arg3 = (svn_string_t *) 0 ; apr_pool_t *arg4 = (apr_pool_t *) 0 ; apr_pool_t *_global_pool = NULL ; PyObject *_global_py...
false
false
false
false
false
0
mx_dialog_new_frame_cb (ClutterTimeline *timeline, gint msecs, ClutterActor *self) { MxDialog *frame = MX_DIALOG (self); MxDialogPrivate *priv = frame->priv; ClutterActor *parent = clutter_actor_get_parent (self); gfloat opacity = clutter_alpha_get_...
false
false
false
false
false
0
sumWeights() const { return !extended() ? (weight_t)size() : std::max(extra_.ext->sumWeights, weight_t(0)); }
false
false
false
false
false
0
smart_socket_close(asocket *s) { D("SS(%d): closed\n", s->id); if(s->pkt_first){ put_apacket(s->pkt_first); } if(s->peer) { s->peer->peer = 0; s->peer->close(s->peer); s->peer = 0; } free(s); }
false
false
false
false
false
0
file_field_callback(Widget gw, XtPointer client_data, XtPointer call_data) { FileSelWidget w = (FileSelWidget)client_data; char *buffer = (char *)call_data; long n = ScrollableGetVSize(w->filesel.list); if (buffer) { long i; for (i = 0 ; i < n ; i++) { char *item = ScrListGetString(w-...
false
false
false
false
false
0
cdrom_mmc3_profile(struct cdrom_device_info *cdi) { struct packet_command cgc; char buffer[32]; int ret, mmc3_profile; init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); cgc.cmd[0] = GPCMD_GET_CONFIGURATION; cgc.cmd[1] = 0; cgc.cmd[2] = cgc.cmd[3] = 0; /* Starting Feature Number */ cgc.cmd[8] =...
true
true
false
false
false
1
match_esc(const char *mask, const char *name) { const unsigned char *m = (const unsigned char *) mask; const unsigned char *n = (const unsigned char *) name; const unsigned char *ma = NULL; const unsigned char *na = (const unsigned char *) name; assert(mask != NULL); assert(name != NULL); while (1) { ...
false
false
false
false
false
0
cmds_pasv(CONTEXT *ctx, char *arg) { u_int32_t addr; u_int16_t port; char str[1024], *p, *q; FILE *fp; int incr; if (ctx == NULL) /* Basic sanity check */ misc_die(FL, "cmds_pasv: ?ctx?"); arg = arg; /* Calm down picky compilers */ /* ** If we already have a listening socket, kill it */ if (ctx->cli_d...
false
false
false
false
false
0
_k_resolveSymLink(const QString &filename) { QString resolved = filename; QString tmp = QFile::symLinkTarget(filename); while (!tmp.isEmpty()) { resolved = tmp; tmp = QFile::symLinkTarget(resolved); } return resolved; }
false
false
false
false
false
0
read_buffer(const string & buffer) { xmlDocPtr doc; _filename = ""; if (_root) { delete _root; _root = 0; } doc = xmlParseMemory((char *) buffer.c_str(), buffer.length()); if (!doc) { return false; } _root = readnode(xmlDocGetRootElement(doc)); xmlFreeDoc(doc); return true; }
false
false
false
false
false
0
ql_process_chip_ae_intr(struct ql_adapter *qdev, struct ib_ae_iocb_rsp *ib_ae_rsp) { switch (ib_ae_rsp->event) { case MGMT_ERR_EVENT: netif_err(qdev, rx_err, qdev->ndev, "Management Processor Fatal Error.\n"); ql_queue_fw_error(qdev); return; case CAM_LOOKUP_ERR_EVENT: netdev_err(qdev->ndev, "M...
false
false
false
false
false
0
gda_attributes_manager_foreach (GdaAttributesManager *mgr, gpointer ptr, GdaAttributesManagerFunc func, gpointer data) { ObjAttrs *objattrs; g_return_if_fail (func); g_return_if_fail (ptr); gda_mutex_lock (mgr->mutex); objattrs = g_hash_table_lookup (mgr->obj_hash, ptr); if (objattrs) { FData fdata; ...
false
false
false
false
false
0
ncEqualPartial(char* str1, char* str2) { int i; int len1 = strlen(str1); int len2 = strlen(str2); if (len1 < len2) return false; for (i = 0; i < len2; i++) if ( toupper(str1[i]) != toupper(str2[i]) ) return false; return true; }
false
false
false
false
false
0
say_enumeration_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd) { if (!strncasecmp(language, "en", 2)) { /* English syntax */ return ast_say_enumeration_full_en(chan, num, ints, language, audiofd, ctrlfd); } else if (!strncasecmp...
false
false
false
false
false
0
moveResize(int x, int y, unsigned int width, unsigned int height) { if (width != m_window.width() || height != m_window.height()) { m_window.moveResize(x, y, width, height); if (m_num_visible_clients) rearrangeClients(); resizeSig().emit(); ...
false
false
false
false
false
0
smack_inode_alloc_security(struct inode *inode) { struct smack_known *skp = smk_of_current(); inode->i_security = new_inode_smack(skp); if (inode->i_security == NULL) return -ENOMEM; return 0; }
false
false
false
false
false
0
_mpd_apply_round_excess(mpd_t *dec, mpd_uint_t rnd, const mpd_context_t *ctx, uint32_t *status) { if (_mpd_rnd_incr(dec, rnd, ctx)) { mpd_uint_t carry = _mpd_baseincr(dec->data, dec->len); if (carry) { if (!mpd_qresize(dec, dec->len+1, status)) { r...
false
false
false
false
false
0
ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) { Value *Ptr, *Val; LocTy Loc, EltLoc; bool InBounds = EatIfPresent(lltok::kw_inbounds); if (ParseTypeAndValue(Ptr, Loc, PFS)) return true; if (!Ptr->getType()->isPointerTy()) return Error(Loc, "base of getelementptr must be a pointer"); Sm...
false
false
false
false
false
0
SetMediaSource(MediaSource msource) // Sets value of PCL::mediasource and associated counter msrccount { #if defined(DEBUG) && (DBG_MASK & DBG_LVL1) DBG1("Setting MediaSource to "); switch(msource) { case sourceTray1: DBG1("Tray1\n"); break; case sourceTray2: DBG1("Tray2\n"); break; case s...
false
false
false
false
false
0
removeFromIndex(Archive* arch) { // Delete indexes ResourceLocationIndex::iterator rit, ritend; ritend = this->resourceIndexCaseInsensitive.end(); for (rit = this->resourceIndexCaseInsensitive.begin(); rit != ritend;) { if (rit->second == arch) { ...
false
false
false
false
false
0
read_the_file() { const char *filename = m_filename.c_str(); ifstream f(filename); if (!f) return; string line_text; while (!f.eof()) { string line_str; getline(f,line_text); line_str = line_text; history.push_back(line_str); } m_file_entries = history.size(); m_current = m_file_entr...
false
false
false
false
false
0
new_line(size_t **line_starts, size_t **line_lengths, size_t *n_lines, size_t *cur_line, size_t start, size_t len) { if (*cur_line == *n_lines) { /* this number is not arbitrary: it's the height of a "standard" term */ (*n_lines) += 24; *line_starts = mem_realloc(*line_starts, *n_lines * sizeof **line_s...
false
false
false
false
false
0
optval_default(p, varp) struct vimoption *p; char_u *varp; { int dvi; if (varp == NULL) return TRUE; /* hidden option is always at default */ dvi = ((p->flags & P_VI_DEF) || p_cp) ? VI_DEFAULT : VIM_DEFAULT; if (p->flags & P_NUM) return (*(long *)varp == (long)(long_i)p->def_val[dvi]); ...
false
false
false
false
false
0
new_pixbuf_from_widget (GtkWidget *widget) { GtkWidget *window; GdkPixbuf *pixbuf; GtkRequisition requisition; GtkAllocation allocation; GdkPixmap *pixmap; GdkVisual *visual; gint icon_width; gint icon_height; icon_width = DEFAULT_ICON_WIDTH; if (!gtk_icon_size_lookup_for_settings (gtk_settings_ge...
false
false
false
false
false
0
AssembleNthVolume ( int n ) { this->FileNames.resize( 0 ); // int nFiles = this->AllFileNames.size(); UNUSED unsigned int nSlices = this->GetNumberOfSliceLocation(); for (unsigned int k = 0; k < nSlices; k++) { const char* name = GetNthFileName( 0, -1, -1, -1, 0, k, 0, n ); if (name == NULL) { ...
false
false
false
false
false
0
newSpace(int32 size) { static int32 oldSize = 0; /* must be static */ static char *oldSpace = NULL; /* must be static */ if (size >= oldSize) { if (oldSpace != NULL) HDfree(oldSpace); if ((oldSpace = (char *) HDmalloc((uint32) size)) == NULL) { ...
true
true
false
false
true
1
apply_ekiga_out_page (EkigaAssistant *assistant) { /* Some specific Opal stuff for the Ekiga.net account */ Opal::AccountPtr account = assistant->priv->bank->find_account ("sip.diamondcard.us"); bool new_account = !account; if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (assistant->priv->skip_ekiga_out))...
false
false
false
false
false
0
getNextLine(std::string& line) { //try and fix the stream if(isFinished()) stream->clear(); std::getline(*stream, line); //remove carriage returns if (line.size() > 0 && line[line.size()-1] == '\r') { line.resize(line.size() - 1); } if(stream->fail()) { return false; ...
false
false
false
false
false
0
get_const_charge_current(struct smb347_charger *smb) { int ret, intval; unsigned int v; if (!smb347_is_ps_online(smb)) return -ENODATA; ret = regmap_read(smb->regmap, STAT_B, &v); if (ret < 0) return ret; /* * The current value is composition of FCC and PCC values * and we can detect which table to use...
false
false
false
false
false
0
SetNumberOfContours(const int number) { int currentNumber = this->Contours->GetMaxId()+1; int n = ( number < 0 ? 0 : number); int i; double *oldValues = NULL; if ( n != currentNumber ) { this->Modified(); // Keep a copy of the old values if ( currentNumber > 0 ) { oldVa...
false
false
false
false
false
0
libbfio_handle_free( libbfio_handle_t **handle, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_free"; int is_open = 0; int result = 1; if( handle ...
false
false
false
false
false
0
build_zero_stag_recv(struct iwch_qp *qhp, union t3_wr *wqe, struct ib_recv_wr *wr) { int i; u32 pbl_addr; u32 pbl_offset; /* * The T3 HW requires the PBL in the HW recv descriptor to reference * a PBL entry. So we allocate the max needed PBL memory here and pass * it to the uP in the recv WR. The uP w...
false
false
false
false
false
0
pixbuf_flip_row (GdkPixbuf *pixbuf, guchar *ph) { guchar *p, *s; guchar tmp; gint count; p = ph; s = p + pixbuf->n_channels * (pixbuf->width - 1); while (p < s) { for (count = pixbuf->n_channels; count > 0; count--, p++, s++) { tmp = *p; *p = *s; *s = tmp; } s -= 2 * pixbuf->n_channels; } }
false
false
false
false
false
0
likely_spilled_retval_p (rtx insn) { rtx use = BB_END (this_basic_block); rtx reg, p; unsigned regno, nregs; /* We assume here that no machine mode needs more than 32 hard registers when the value overlaps with a register for which TARGET_FUNCTION_VALUE_REGNO_P is true. */ unsigned mask; struct l...
false
false
false
false
false
0
galleyHeight(FXWindow *begin,FXWindow*& end,FXint space,FXint& require,FXint& expand) const { register FXint galley,any,w,h; register FXWindow *child; register FXuint hints; require=expand=galley=any=0; for(child=end=begin; child; end=child,child=child->getNext()){ if(child->shown()){ // Get size ...
false
false
false
false
false
0