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
grddead(struct monst *grd) { bool dispose = clear_fcorr(grd, true); if (!dispose) { /* see comment by newpos in gd_move() */ remove_monster(grd->mx, grd->my); newsym(grd->mx, grd->my); place_monster(grd, 0, 0); EGD(grd)->ogx = grd->mx; EGD(grd)->ogy = grd->my...
false
false
false
false
false
0
membase_reg_insn(enum insn_type insn_type, struct var_info *src_base_reg, long src_disp, struct var_info *dest_reg) { struct insn *insn = alloc_insn(insn_type); if (insn) { init_membase_operand(insn, &insn->src, src_base_reg, src_disp); init_reg_operand(insn, &insn->dest, dest_reg); } return insn; }
false
false
false
false
false
0
getBlackCode() { const CCITTCode *p; Guint code; if (bufLen == 0) { buf = str->getChar() & 0xff; bufLen = 8; ++nBytesRead; } while (1) { if (bufLen >= 10 && ((buf >> (bufLen - 6)) & 0x3f) == 0) { if (bufLen <= 13) { code = buf << (13 - bufLen); } else { code = buf >> (bufLen - 1...
false
false
false
false
false
0
form() const { if (!impl || !impl->isGenericFormElement()) return 0; return static_cast<HTMLGenericFormElementImpl*>(impl)->form(); ElementImpl* f = static_cast<HTMLGenericFormElementImpl*>( impl )->form(); if( f && f->implicitNode() ) return 0; return f; }
false
false
false
false
false
0
HandleLocalCommandCheat(UINT32 type, UINT32 address, UINT32 data, UINT32 extendData, char * name, char * description) { switch(EXTRACT_FIELD(type, LocationType)) { case kLocation_Custom: switch(EXTRACT_FIELD(type, LocationParameter)) { case kCustomLocation_AssignActivationKey: { if(addre...
false
false
false
false
false
0
GRSTgaclCredCmpAuri(GRSTgaclCred *cred1, GRSTgaclCred *cred2) /* GRSTgaclCredCmp - compare two credentials for exact match in AURI values (this means a string match, not just any-user=DN etc) */ { if ((cred1 == NULL) && (cred2 == NULL)) return 0; if (cred1 == NULL) return -1; if (cre...
false
false
false
false
false
0
bacon_video_widget_gst_get_toplevel (GtkWidget *widget) { GtkWidget *parent; parent = gtk_widget_get_toplevel (GTK_WIDGET (widget)); if (parent == NULL) return 0; if (GTK_IS_PLUG (parent)) return bacon_video_widget_gtk_plug_get_toplevel (GTK_PLUG (parent)); else return GDK_WINDOW_XID(gtk_widget_get_window ...
false
false
false
false
false
0
read_long_string (char *yytext, int buffsize) { int cont = 0; int tokensize = 2; /* '[[' already stored */ while (1) { if (buffsize-tokensize <= 2) /* may read more than 1 char in one cicle */ yytext = luaI_buffer(buffsize *= 2); switch (current) { case EOZ: save(0); ret...
false
false
false
false
false
0
on_button5_clicked (GtkButton *button, gpointer user_data) { int zoom_old; float factor; int width_center, height_center; GtkWidget *range; if(global_zoom>2) { range = lookup_widget(window1, "vscale1"); width_center = map_drawable->...
false
false
false
false
false
0
dump_cavan_usb_descriptor(const char *buff, struct cavan_usb_descriptor *desc, size_t length) { struct usb_device_descriptor *dev_desc; struct usb_config_descriptor *cfg_desc, *cfg_desc_end; const char *end_buff; if (length < USB_DT_DEVICE_SIZE + USB_DT_CONFIG_SIZE) { pr_red_info("length is invalid"); return ...
false
true
false
false
false
1
VasyParsePackage( FileName ) char *FileName; { if ( IsVasyDebugLevel0() ) { VasyPrintf( stdout, "--> VasyParsePackage %s\n\n", FileName ); } if ( FileName == (char *)0 ) return; getvbpkg( FileName, VPN_IN ); if ( IsVasyDebugLevel0() ) { VasyPrintf( stdout, "<-- VasyParsePackage %s\n\n", File...
false
false
false
false
false
0
adjusted_promote_threshold(struct mq_policy *mq, bool discarded_oblock, int data_dir) { if (data_dir == READ) return promote_threshold(mq) + mq->read_promote_adjustment; if (discarded_oblock && (any_free_cblocks(mq) || any_clean_cblocks(mq))) { /* * We don't need to do any copying at all, so give this...
false
false
false
false
false
0
Iis_fixnum(object f) { if (type_of(f)==t_fixnum) { return f;} else { FEerror("Not a fixnum ~s",1,f); return f; } }
false
false
false
false
false
0
camel_imapx_stream_grow (CamelIMAPXStream *is, guint len, guchar **bufptr, guchar **tokptr) { guchar *oldtok = is->priv->tokenbuf; guchar *oldbuf = is->priv->buf; do { is->priv->bufsize <<= 1; } while (is->priv->bufsize <= len); io (is-...
false
false
false
false
false
0
cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h, const cdf_stream_t *sst) { cdf_summary_info_header_t si; cdf_property_info_t *info; size_t count; int m; if (cdf_unpack_summary_info(sst, h, &si, &info, &count) == -1) return -1; if (...
false
false
false
false
false
0
getDiscoInfo_success(const XMPP::Jid& jid, const QString& node, const XMPP::DiscoItem& item) { //qDebug() << QString("caps.cpp: Disco response from %1, node=%2").arg(QString(jid.full()).replace('%',"%%")).arg(node); // Update features bool ok = false; CapsSpec cs(getCapsSpecForNode(jid, node, ok)); if (!ok) { re...
false
false
false
false
false
0
GDrawGetBiTextPtBeforePos(GWindow gw,const unichar_t *text, int32 cnt, FontMods *mods, int32 maxwidth, unichar_t **end) { struct tf_arg arg; int width, ret; memset(&arg,'\0',sizeof(arg)); arg.maxwidth = maxwidth; if (( ret = GDrawIsAllLeftToRight(text,cnt))==1 ) width = _GDraw_DoText(gw,0,0,(unich...
false
false
false
false
false
0
query_variable(char *varname) /** Get the current value of an environmental variable */ { struct vardefn *var; for (var=vardefns; var!=NULL; var=var->next) { if (strcmp(varname, var->varname) == 0) return var->value; } return NULL; }
false
false
false
false
false
0
set_max_size(unsigned long size) { lock_cache_interface(); try { unsigned long new_size = size < MIN_CACHE_TOTAL_SIZE ? MIN_CACHE_TOTAL_SIZE * MEGA : (size > ULONG_MAX ? ULONG_MAX : size * MEGA); unsigned long old_size = d_total_...
false
false
false
false
false
0
ns558_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *did) { int ioport, iolen; struct ns558 *ns558; struct gameport *port; if (!pnp_port_valid(dev, 0)) { printk(KERN_WARNING "ns558: No i/o ports on a gameport? Weird\n"); return -ENODEV; } ioport = pnp_port_start(dev, 0); iolen = pnp_port_len(de...
false
false
false
false
false
0
Ns_ConnConstructHeaders(Ns_Conn *conn, Ns_DString *dsPtr) { Conn *connPtr = (Conn *) conn; int i, status; char *reason; char *value, *keep; char *key; /* * Construct the HTTP response status line. */ status = Ns_ConnGetStatus(conn); reason = "Unknown Reason"; for (i = 0...
false
false
false
false
false
0
get_toggle_pointer(struct r8a66597_device *dev, int urb_pipe) { if (!dev) return NULL; return usb_pipein(urb_pipe) ? &dev->ep_in_toggle : &dev->ep_out_toggle; }
false
false
false
false
false
0
getListener(int eventId) const { DOM::EventListener *listener = m_impl->getHTMLEventListener(eventId); JSEventListener *jsListener = static_cast<JSEventListener*>(listener); if ( jsListener && jsListener->listenerObj() ) return jsListener->listenerObj(); else return jsNull(); }
false
false
false
false
false
0
ModifyWeaponAttack(char *weap, int wclass, int attackType, int numAtt) { WeaponType *pw = FindWeapon(weap); if (pw == NULL) return; if(wclass < 0 || wclass > (NUM_WEAPON_CLASSES - 1)) return; if(attackType < 0 || attackType > (NUM_ATTACK_TYPES - 1)) return; pw->weapClass = wclass; pw->attackType = attackType; ...
false
false
false
false
false
0
evaluate_oneline(struct parse_state *ps, char *delimiter, struct column_info **test, int *ncolumns) { int nc=0; char *p; int d; float f; while (FileTok(ps,delimiter,NO_NEWLINE,&p) && p) { if (nc > MAX_COLUMNS-1){ DXSetError(ERROR_DATA_INVALID,"only 200 columns supported"); nc--; goto...
false
false
false
false
false
0
command(const char *fmt, ...) { va_list ap; int r; #ifdef USE_SSL char outputbuf[2048]; /* allow for a 2k command string */ #endif /* USE_SSL */ if (debug) { printf("---> "); va_start(ap, fmt); if (strncmp("PASS ", fmt, 5) == 0) printf("PASS XXXX"); else vprintf(fmt, ap); va_end(ap);...
true
true
true
false
true
1
mwifiex_set_mac_address(struct net_device *dev, void *addr) { struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); struct sockaddr *hw_addr = addr; int ret; memcpy(priv->curr_addr, hw_addr->sa_data, ETH_ALEN); /* Send request to firmware */ ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_MAC_ADDRESS, ...
false
false
false
false
false
0
eventFilter(QObject *watched, QEvent *event) { if (watched != area) return false; if (event->type() == QEvent::Resize) { QRect ar = area->rect().adjusted(+20,+20,-20,-20); foreach(Client *client, clients) if (client->subWindow && ! ar.intersects(client->subWindow->frameGeome...
false
false
false
false
false
0
updateNow() { #if defined(ADBLOCKSUBSCRIPTION_DEBUG) qDebug() << "AdBlockSubscription::" << __FUNCTION__ << location(); #endif if (m_downloading) { #if defined(ADBLOCKSUBSCRIPTION_DEBUG) qDebug() << "AdBlockSubscription::" << __FUNCTION__ << "already downloading, stopping"; #endif return; } ...
false
false
false
false
false
0
Bioskey() { fd_set readfds; struct timeval timeout; FD_ZERO(&readfds); FD_SET(fileno(stdin), &readfds); /* Set to timeout immediately */ timeout.tv_sec = 0; timeout.tv_usec = 0; select(16, &readfds, 0, 0, &timeout); return (FD_ISSET(fileno(stdin), &readfds)); }
false
false
false
false
false
0
s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value) { BIGNUM *bn = NULL; ASN1_INTEGER *aint; int isneg, ishex; int ret; if (!value) { X509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_INVALID_NULL_VALUE); return 0; } bn = BN_new(); if (value[0] == '-') { value++; isneg = 1; } else isneg = 0; if (valu...
false
false
false
false
false
0
destroy_children(GtkWidget *widget) { WidgetChildren *children = (WidgetChildren *)g_object_get_data(G_OBJECT(widget),"Children"); gint i; for(i=children->nchildren-1;i>=0;i--) { if(children->children[i]) { destroy_button_windows(children->children[i]); children->destroychildren[i](children->children[...
false
false
false
false
false
0
open_log(const char *filename) { logFile = fbopen(filename, "a"); if (logFile == NULL) { #ifdef USE_SYSLOG syslog(LOG_ERR, "Unable to open log file: %s: %s", filename, strerror(errno)); #endif return (0); } return (1); }
false
false
false
false
false
0
gdpy_entry_getdividend(struct gdpy_entry_t* self, void* closure) { PyObject* obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_RECIP_ENTRY) { if (self->E->scalar[0]) obj = PyString_FromString(self->E->scalar[0]); else if (self->E->comp_scal) obj = gdpy_from_compl...
false
false
false
false
false
0
OpenFDPassSock() { #ifdef SYS_LINUX char sockpath[32]; // Child creates it, since child probably has more privs if (ipc_pid != 0) { printf("debug - %d - child creating ipc fdfd\n", getpid()); snprintf(sockpath, 32, "/tmp/kisfdsock_%d", ipc_pid); // Unlink if it exists unlink(sockpath); unixsock.sun_fam...
false
false
false
false
false
0
gpk_application_remove_packages_cb (PkTask *task, GAsyncResult *res, GpkApplicationPrivate *priv) { PkResults *results; GError *error = NULL; PkError *error_code = NULL; GtkWindow *window; guint idle_id; /* get the results */ results = pk_task_generic_finish (task, res, &error); if (results == NULL) { g_warn...
false
false
false
false
false
0
celt_isset(const struct ast_format_attr *fattr, va_list ap) { enum celt_attr_keys key; const struct celt_attr *attr = (struct celt_attr *) fattr; for (key = va_arg(ap, int); key != AST_FORMAT_ATTR_END; key = va_arg(ap, int)) { switch (key) { case CELT_ATTR_KEY_SAMP_RATE: if (attr->samplerate != (va_arg(...
false
false
false
false
false
0
radeon_irq_kms_init(struct radeon_device *rdev) { int r = 0; spin_lock_init(&rdev->irq.lock); r = drm_vblank_init(rdev->ddev, rdev->num_crtc); if (r) { return r; } /* enable msi */ rdev->msi_enabled = 0; if (radeon_msi_ok(rdev)) { int ret = pci_enable_msi(rdev->pdev); if (!ret) { rdev->msi_enabled = ...
false
false
false
false
false
0
user_copyquotaroot(char *oldname, char *newname) { int r = 0; struct quota q; q.root = oldname; r = quota_read(&q, NULL, 0); if (!r) mboxlist_setquota(newname, q.limit, 0); return r; }
false
false
false
false
false
0
use_skill(int skill_id) { int i = 0; int next; int prev = last_used_skills[0]; if(last_used_skills[0] == skill_id) return; do { next = last_used_skills[i+1]; last_used_skills[i+1] = prev; prev = next; ++i; } while(next != skill_id && next >= 0); last_used_skills[0] ...
false
false
false
false
false
0
XmtSymbolSetTypedValue(Widget w, XmtSymbol s, String type, XtArgVal value, Cardinal size) #else Boolean XmtSymbolSetTypedValue(w, s, type, value, size) Widget w; XmtSymbol s; String type; XtArgVal value; Cardinal size; #endif { XrmQuark typeq = XrmStringToQuark(type); XrmValue from, to; XtArgVal c...
false
false
false
false
false
0
allocate_to_segment(String_list** phdrs_list, bool* orphan) { // Update phdrs_list even if we don't have an output section. It // might be used by the following sections. if (this->phdrs_ != NULL) *phdrs_list = this->phdrs_; if (this->output_section_ == NULL) return NULL; if ((this->outpu...
false
false
false
false
false
0
GetErrMessage( const char * nodeMsg, string & message ) throw( MissingException ) { string errMessage, tmp; stripText( nodeMsg, tmp ); if ( tmp.empty() ) throw new MissingException( "<errormsg>" ); stripPercent( tmp, errMessage ); tmp.clear(); /* Check for e...
false
false
false
false
false
0
_parse_value_as_uint (const char *value, guint *uintval) { char *end_of_valid_uint; gulong ulong_value; guint uint_value; errno = 0; ulong_value = strtoul (value, &end_of_valid_uint, 10); if (*value == '\0' || *end_of_valid_uint != '\0') { ...
false
false
false
false
false
0
gst_value_move (GValue * dest, GValue * src) { g_assert (G_IS_VALUE (src)); g_assert (dest != NULL); *dest = *src; memset (src, 0, sizeof (GValue)); }
false
false
false
false
false
0
unity_protocol_scope_proxy_new_from_metadata (UnityProtocolScopeRegistryScopeMetadata* metadata, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { UnityProtocolScopeProxyNewFromMetadataData* _data_; UnityProtocolScopeRegistryScopeMetadata* _tmp0_ = NULL; UnityProtocolScopeRegistrySco...
false
false
false
false
false
0
dump(const Counter &C, llvm::raw_ostream &OS) const { switch (C.getKind()) { case Counter::Zero: OS << '0'; return; case Counter::CounterValueReference: OS << '#' << C.getCounterID(); break; case Counter::Expression: { if (C.getExpressionID() >= Expressions.s...
false
false
false
false
false
0
remove_node_from_expr_list (node, listp) rtx node; rtx *listp; { rtx temp = *listp; rtx prev = NULL_RTX; while (temp) { if (node == XEXP (temp, 0)) { /* Splice the node out of the list. */ if (prev) XEXP (prev, 1) = XEXP (temp, 1); else *listp = XEXP (temp, 1); return...
false
false
false
false
false
0
test_status_worktree__status_file_without_index_or_workdir(void) { git_repository *repo; unsigned int status = 0; git_index *index; cl_git_pass(p_mkdir("wd", 0777)); cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git"))); cl_git_pass(git_repository_set_workdir(repo, "wd")); cl_git_pass(git_index_...
false
false
false
false
false
0
mach64DoBlitScaleOld( Mach64DriverData *mdrv, Mach64DeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect, bool filter ) { volatile u8 *mmio = mdrv->...
false
false
false
false
false
0
mantis_stream_control(struct mantis_pci *mantis, enum mantis_stream_control stream_ctl) { u32 reg; reg = mmread(MANTIS_CONTROL); switch (stream_ctl) { case STREAM_TO_HIF: dprintk(MANTIS_DEBUG, 1, "Set stream to HIF"); reg &= 0xff - MANTIS_BYPASS; mmwrite(reg, MANTIS_CONTROL); reg |= MANTIS_BYPASS; mmwrit...
false
false
false
false
false
0
get_nb_static_sinks (GnlOperation * oper) { GstIterator *sinkpads; gboolean done = FALSE; guint nbsinks = 0; GValue item = { 0, }; sinkpads = gst_element_iterate_sink_pads (oper->element); while (!done) { switch (gst_iterator_next (sinkpads, &item)) { case GST_ITERATOR_OK:{ nbsinks++; ...
false
false
false
false
false
0
zwritehexstring_at(i_ctx_t *i_ctx_p, os_ptr op, uint odd) { register stream *s; register byte ch; register const byte *p; register const char *const hex_digits = "0123456789abcdef"; register uint len; int status; #define MAX_HEX 128 byte buf[MAX_HEX]; check_write_file(s, op - 1); c...
false
false
false
false
false
0
translate_chip(enum radeon_family rf) { switch (rf) { #define TRANSLATE_CHIP(c) case CHIP_##c: return HW_CHIP_##c TRANSLATE_CHIP(R600); TRANSLATE_CHIP(RV610); TRANSLATE_CHIP(RV630); TRANSLATE_CHIP(RV670); TRANSLATE_CHIP(RV620); TRANSLATE_CHIP(RV635); TRANSLATE_CHIP(RS780); TRANSLATE_CHIP(RS880); TRA...
false
false
false
false
false
0
e_mail_config_welcome_page_set_text (EMailConfigWelcomePage *page, const gchar *text) { g_return_if_fail (E_IS_MAIL_CONFIG_WELCOME_PAGE (page)); if (g_strcmp0 (page->priv->text, (text != NULL) ? text : "") == 0) return; g_free (page->priv->text); page->priv->text = g_strdup ...
false
false
false
false
false
0
lookChar() { int c1, c2, x; if (buf != EOF) return buf; if (eof) { buf = EOF; return EOF; } do { c1 = str->getChar(); } while (isspace(c1)); if (c1 == '>') { eof = gTrue; buf = EOF; return buf; } do { c2 = str->getChar(); } while (isspace(c2)); if (c2 == '>') { ...
false
false
false
false
false
0
yenta_probe_cb_irq(struct yenta_socket *socket) { u8 reg = 0; if (!socket->cb_irq) return -1; socket->probe_status = 0; if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED, "yenta", socket)) { dev_warn(&socket->dev->dev, "request_irq() in yenta_probe_cb_irq() failed!\n"); return -1; } /...
false
false
false
false
false
0
LookupSymbol(value, sym) unsigned long value; struct symbol *sym; { auto int lp; auto char *last; auto char *name; struct symbol ksym, msym; if (!sym_array) return((char *) 0); last = sym_array[0].name; ksym.offset = 0; ksym.size = 0; if ( value < sym_array[0].value ) return((char *) 0); for(...
false
false
false
false
false
0
ctx_progress_start_func (GPContext __unused__ *context, float target, const char *str, void *data) { GPParams *p = data; unsigned int id, len; static unsigned char initialized = 0; if (!initialized) { memset (progress_states, 0, sizeof (progress_states)...
false
false
false
false
false
0
write_checked_body(const Classifier_Program &c, StringAccum &source) { source << " const unsigned *ip_data = (const unsigned *)p->ip_header();\n\ const unsigned *transp_data = (const unsigned *)p->transport_header();\n\ int l = p->length() + " << IPCLASSIFIER_TRANSP_FAKE_OFFSET << " - p->transport_header_offset(...
false
false
false
false
false
0
close (void) { if (this->inbound_) this->inbound_->close(); if (this->outbound_) this->outbound_->close(); this->closed_ = true; return ACE::HTBP::Session::remove_session (this); }
false
false
false
false
false
0
clear_conflicts(CdlNode node, CdlProperty prop, bool (*pFn)(CdlConflict)) { CYG_REPORT_FUNCNAME("CdlTransaction::clear_conflicts"); CYG_REPORT_FUNCARG4XV(this, node, prop, pFn); CYG_PRECONDITION_THISC(); CYG_PRECONDITION_CLASSC(node); std::list<CdlConflict>::iterator conf_i; CdlTransaction curr...
false
false
false
false
false
0
ast_error(const node *n, const char *errstr) { PyObject *u = Py_BuildValue("zii", errstr, LINENO(n), n->n_col_offset); if (!u) return 0; PyErr_SetObject(PyExc_SyntaxError, u); Py_DECREF(u); return 0; }
false
false
false
false
false
0
jsvUnRefRef(JsVarRef ref) { JsVar *v; assert(ref); v = jsvLock(ref); assert(!jsvIsStringExt(v)); jsvUnRef(v); jsvUnLock(v); return 0; }
false
false
false
false
false
0
del(int k) { if (lastPrint < 0) { lastPrint = displ[printPtr - 1] -= k; } else { lastPrint = displ[printPtr++] = - (k); } }
false
false
false
false
false
0
test_get_self (ETestServerFixture *fixture, gconstpointer user_data) { EBookClient *client; EContact *contact; GError *error = NULL; if (!e_book_client_get_self (fixture->registry, &contact, &client, &error)) g_error ("failed to get self contact: %s", error->message); if (!client) g_er...
false
false
false
false
false
0
vfs_stats_display ( VFSStats *p) { /* Displays all values of the data structure */ gint i = 0; #ifdef GW_DEBUG_DATA_COMPONENT g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); #endif if ( p != NULL ) { g_print ( "\nName : %s\n", p->name); g_print ( "Dir : %s\n", p->dir); g_...
false
false
false
false
false
0
PathExtrusion_GetNode(GF_Node *node, PathExtrusion *path_ext) { GF_FieldInfo field; memset(path_ext, 0, sizeof(PathExtrusion)); if (gf_node_get_field(node, 0, &field) != GF_OK) return 0; if (field.fieldType != GF_SG_VRML_SFNODE) return 0; path_ext->geometry = * (GF_Node **) field.far_ptr; if (gf_node_get_field(no...
false
false
false
false
false
0
xsh_polynomial_convert_to_table(const polynomial *p) { cpl_table *t = NULL; /* Result */ int degree; int i, j, row; /* Check input */ assure( p != NULL, CPL_ERROR_NULL_INPUT, "Null polynomial"); assure( xsh_polynomial_get_dimension(p) == 2, CPL_ERROR_ILLEGAL_INPUT, "Polynomial must be ...
false
false
false
false
false
0
xfs_da3_node_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; struct xfs_da_intnode *hdr = bp->b_addr; struct xfs_da3_icnode_hdr ichdr; const struct xfs_dir_ops *ops; ops = xfs_dir_get_ops(mp, NULL); ops->node_hdr_from_disk(&ichdr, hdr); if (xfs_sb_version_hascrc(&mp->m_sb)) { ...
false
false
false
false
false
0
hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) { struct hwsim_new_radio_params param = { 0 }; const char *hwname = NULL; int ret; param.reg_strict = info->attrs[HWSIM_ATTR_REG_STRICT_REG]; param.p2p_device = info->attrs[HWSIM_ATTR_SUPPORT_P2P_DEVICE]; param.channels = channels; param.destroy_on...
false
false
false
false
false
0
staticmemberfunctionHandler(Node *n) { String *symname = Getattr(n, "sym:name"); Language::staticmemberfunctionHandler(n); if (Getattr(n, "sym:nextSibling")) { return SWIG_OK; } if (shadow) { if (!classic && !Getattr(n, "feature:python:callback") && have_addtofunc(n)) { int kw = (chec...
false
false
false
false
false
0
rightneighbor(int x) { /* * Move right. This might wrap around, stepping to the leftmost node at * the next level. */ x++; /* * Check if we stepped to the leftmost node at next level, and correct if * so. The leftmost nodes at each level are numbered x = 2^level - 1, so * check if (x + 1) is a power of ...
false
false
false
false
false
0
select(int tag) { if((tag >= 10) && (tag <= 20)) { scorefile.profile()->skill = menu->selected()->tag - 10; gsm.change(&st_game); } }
false
false
false
false
false
0
del_comm_client(Comm_client *client) { Network_listener *l; Network_connection *c; Comm_client_player *p; while ((l = list_pop(client->listeners)) != NULL) { del_network_listener(l); } while ((c = list_pop(client->connections)) != NULL) { del_network_connection(c); } while ((p = list_pop(client...
false
false
false
false
false
0
php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC) { unsigned int length; int c1, c2; if ((c1 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI; if ((c2 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI; length = (((unsigned char) c1) <<...
false
false
false
false
false
0
draw_grid_right() { int i; GtkWidget *widget; i = gtk_notebook_current_page( GTK_NOTEBOOK( notebook_right ) ); i = usuario.pages[ i ]; widget = drawing_right[ i ]; if( ! widget ) return; /* draw the grid */ if( usuario.view_grid ) { for(i=0;i<10;i++) { gdk_draw_line (widget->window, widget->style-...
false
false
false
false
false
0
check_insn_for_bivs (struct loop *loop, rtx p, int not_every_iteration, int maybe_multiple) { struct loop_ivs *ivs = LOOP_IVS (loop); rtx set; rtx dest_reg; rtx inc_val; rtx mult_val; rtx *location; if (GET_CODE (p) == INSN && (set = single_set (p)) && GET_CODE (SET_DEST (set)) == REG)...
false
false
false
false
false
0
SCPI_ParamIsNumber(scpi_parameter_t * parameter, scpi_bool_t suffixAllowed) { switch (parameter->type) { case SCPI_TOKEN_HEXNUM: case SCPI_TOKEN_OCTNUM: case SCPI_TOKEN_BINNUM: case SCPI_TOKEN_DECIMAL_NUMERIC_PROGRAM_DATA: return TRUE; case SCPI_TOKEN_DECIMAL_NUME...
false
false
false
false
false
0
tmg_cal_add_one_day (GtkSatModule *mod) { guint year, month, day; gint hr, min, sec, msec; struct tm tim,utim; gdouble jd; /* calculate the new time as in tmg_time_set */ gtk_calendar_get_date (GTK_CALENDAR (mod->tmgCal), &year, &month, &day); hr = gtk_spin_button_get_value_as_int (GTK_SP...
false
false
false
false
false
0
idbm_discovery_set_param(void *data, discovery_rec_t *rec) { struct list_head *params = data; struct user_param *param; recinfo_t *info; int rc = 0; info = idbm_recinfo_alloc(MAX_KEYS); if (!info) return ISCSI_ERR_NOMEM; idbm_recinfo_discovery((discovery_rec_t *)rec, info); list_for_each_entry(param, param...
false
false
false
false
false
0
bcdCheck(int n, int max, const char *msg, const char *unit, int extent1, int extent2) { if (((n>>4)&0xf)>10 || (n&0xf)>10 || (((n>>4)&0xf)*10+(n&0xf))>=max) { printf("Error: Bad %s %s (extent=%d/%d, %s=%02x)\n",msg,unit,extent1,extent2,unit,n&0xff); return -1; } else return 0; }
false
false
false
false
false
0
read_items(int count, item_t *items, FILE *f) { for (int i = 0; i < count; ++i) { item_t *t = &(items[i]); if (fscanf(f, "%[^|]| %10f %10f\n", t->label, &(t->coord.x), &(t->coord.y))) continue; ...
false
false
false
false
false
0
slotUpdateNowPlayingWithCurrentTrack() { EngineController *engine = Amarok::Components::engineController(); if( !engine ) return; Meta::TrackPtr track = engine->currentTrack(); // null track is okay if( tracksVirtuallyEqual( track, m_lastSubmittedNowPlayingTrack ) ) { debug() << __P...
false
false
false
false
false
0
getkey(FILE * stream) { Cell result; unsigned char c; setvbuf(stream, NULL, _IONBF, 0); if(!terminal_prepped && stream == stdin) prep_terminal(); result = fread(&c, sizeof(c), 1, stream); return result==0 ? (errno == EINTR ? 12 : 4) : c; }
false
false
false
false
true
1
opal_setlimit(int resource, char *value) { struct rlimit rlim, rlim_set; rlim_t maxlim; rlim.rlim_cur = 0; if (0 == strcmp(value, "max")) { maxlim = -1; } else if (0 == strncmp(value, "unlimited", strlen(value))) { maxlim = RLIM_INFINITY; } else { maxlim = strto...
false
false
false
false
false
0
antlr3RewriteRuleTOKENStreamNewAE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description) { pANTLR3_REWRITE_RULE_TOKEN_STREAM stream; // First job is to create the memory we need. // stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); if (stream == NULL) {...
false
false
false
false
false
0
GPS_D101_Get(GPS_PWay* way, UC* s) { UC* p; int32 i; p=s; (*way)->prot = 101; for (i=0; i<6; ++i) { (*way)->ident[i] = *p++; } (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p)); p+=sizeof(int32); (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p)); p+=sizeof(int32); p+=sizeof(in...
false
false
false
false
false
0
rc_swizzle_to_writemask(unsigned int swz) { unsigned int mask = 0; unsigned int i; for(i = 0; i < 4; i++) { mask |= 1 << GET_SWZ(swz, i); } mask &= RC_MASK_XYZW; return mask; }
false
false
false
false
false
0
isFreeToInvert(Value *V) { // ~(~(X)) -> X. if (BinaryOperator::isNot(V)) return true; // Constants can be considered to be not'ed values. if (isa<ConstantInt>(V)) return true; // Compares can be inverted if they have a single use. if (CmpInst *CI = dyn_cast<CmpInst>(V)) return CI->hasOneU...
false
false
false
false
false
0
oadd(long t1, long t2) { long t; t = t1 + t2; if ((t2 > 0 && t <= t1) || (t2 < 0 && t >= t1)) { error(_("time overflow")); (void) exit(EXIT_FAILURE); } return t; }
false
false
false
false
false
0
cselib_process_insn (rtx insn) { int i; rtx x; cselib_current_insn = insn; /* Forget everything at a CODE_LABEL, a volatile insn, or a setjmp. */ if ((LABEL_P (insn) || (CALL_P (insn) && find_reg_note (insn, REG_SETJMP, NULL)) || (NONJUMP_INSN_P (insn) && volatile_insn_p (PATTERN (ins...
false
false
false
false
false
0
invertSelection() { for ( KFileItem item = firstFileItem(); !item.isNull(); item = nextItem( item ) ) setSelected( item, !isSelected( item ) ); }
false
false
false
false
false
0
alloc_data_packet(int data_size, unsigned char dest_addr, unsigned char protocol) { struct ipw_tx_packet *packet = kzalloc( sizeof(struct ipw_tx_packet) + data_size, GFP_ATOMIC); if (!packet) return NULL; INIT_LIST_HEAD(&packet->queue); packet->dest_addr = dest_addr; packet->protocol = protocol; ...
false
false
false
false
false
0
xtree_get_parent(xtree_t* tree, xtree_node_t* node) { if (!node || !tree || !tree->root) return NULL; return node->parent; }
false
false
false
false
false
0
sheet_object_new_view (SheetObject *so, SheetObjectViewContainer *container) { SheetObjectView *view; g_return_val_if_fail (IS_SHEET_OBJECT (so), NULL); g_return_val_if_fail (NULL != container, NULL); view = sheet_object_get_view (so, container); if (view != NULL) return NULL; view = SO_CLASS (so)->new_view ...
false
false
false
false
false
0
getIndirectIndexBegin(const MachineFunction &MF) const { const MachineRegisterInfo &MRI = MF.getRegInfo(); const MachineFrameInfo *MFI = MF.getFrameInfo(); int Offset = -1; if (MFI->getNumObjects() == 0) { return -1; } if (MRI.livein_empty()) { return 0; } const TargetRegisterClass *IndirectR...
false
false
false
false
false
0
xcalloc(size_t nmemb, size_t size) { return CheckResult(calloc(nmemb, size), "xcalloc", nmemb != 0 && size != 0); }
false
false
false
false
false
0
caml_round_heap_chunk_size (asize_t request) { asize_t result = request; if (result < caml_major_heap_increment){ result = caml_major_heap_increment; } result = clip_heap_chunk_size (result); if (result < request){ caml_raise_out_of_memory (); return 0; /* not reached */ } return result; }
false
false
false
false
false
0
qla2x00_get_link_speed_str(struct qla_hw_data *ha, uint16_t speed) { static const char *const link_speeds[] = { "1", "2", "?", "4", "8", "16", "32", "10" }; #define QLA_LAST_SPEED 7 if (IS_QLA2100(ha) || IS_QLA2200(ha)) return link_speeds[0]; else if (speed == 0x13) return link_speeds[QLA_LAST_SPEED]; else ...
false
false
false
false
false
0