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
Scm_PortFileNo(ScmPort *port) { if (SCM_PORT_TYPE(port) == SCM_PORT_FILE) { if (port->src.buf.filenum) return port->src.buf.filenum(port); else return -1; } else { /* TODO: proc port */ return -1; } }
false
false
false
false
false
0
calc_sequence(struct params *fd, int tailsect) { int sec_id, cur_sector, i; fd->sequence = SafeNewArray(fd->dsect,struct fparm2); cur_sector = fd->dsect-1; /* construct the sequence while working backwards. cur_sector * points to the place where the next sector will be placed. * We place it, then move circul...
false
false
false
false
false
0
total_length (const ACE_Message_Block* begin, const ACE_Message_Block* end) { size_t l = 0; // Compute the total size. for (const ACE_Message_Block *i = begin; i != end; i = i->cont ()) l += i->length (); return l; }
false
false
false
false
false
0
SendTradeStatus(TradeStatus status) { WorldPacket data; switch (status) { case TRADE_STATUS_BEGIN_TRADE: data.Initialize(SMSG_TRADE_STATUS, 4 + 8); data << uint32(status); data << uint64(0); break; case TRADE_STATUS_OPEN_WINDOW: da...
false
false
false
false
false
0
get_element(string name) { const char* routine = "XmlElement::get_element"; for (unsigned int i = 0; i < elements->size(); i++) if (elements->at(i)->name == name) return elements->at(i); stringstream S; S << "Element " << name << " does not exist in " << this->name; L_ERROR(LOG_XML,S.str()); return NULL; }
false
false
false
false
false
0
S_clear_yystack(pTHX_ const yy_parser *parser) { yy_stack_frame *ps = parser->ps; int i = 0; if (!parser->stack) return; YYDPRINTF ((Perl_debug_log, "clearing the parse stack\n")); for (i=0; i< parser->yylen; i++) { SvREFCNT_dec(ps[-i].compcv); } ps -= parser->yylen; /* now fr...
false
false
false
false
false
0
got_connection_managers (GObject *source, GAsyncResult *result, gpointer user_data) { ExampleData *data = user_data; GList *cms; GError *error = NULL; cms = tp_list_connection_managers_finish (result, &error); if (error != NULL) { g_warning ("%s", error->message); g_clear_error (&erro...
false
false
false
false
false
0
NewIC() { static CARD16 icid = 0; IC *rec; if (free_list != NULL) { rec = free_list; free_list = free_list->next; } else { rec = (IC *)malloc(sizeof(IC)); } bzero(rec, sizeof(IC)); rec->cs.input_style = InputStyleOverSpot; rec->id = ++icid; rec->next = ic_list; ic_list = re...
false
false
false
false
false
0
gtop_proc_signal (PyObject *self, PyObject *args) { glibtop_proc_signal buf; PyObject *d; guint pid; if (!PyArg_ParseTuple (args, "I", &pid)) return NULL; glibtop_get_proc_signal (&buf, pid); d = PyDict_New (); my_dict_add_and_decref (d, "signal", build_128bit_long(buf.signal)...
false
false
false
false
false
0
rc_destroy(rc_handle *rh) { rc_map2id_free(rh); rc_dict_free(rh); rc_config_free(rh); if (rh->this_host_bind_ipaddr != NULL) free(rh->this_host_bind_ipaddr); free(rh); }
false
false
false
false
false
0
glade_gtk_button_read_widget (GladeWidgetAdaptor *adaptor, GladeWidget *widget, GladeXmlNode *node) { gboolean use_stock; gchar *label = NULL; if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project)))) return; /* First chain up ...
false
false
false
false
false
0
ocfs2_try_to_write_inline_data(struct address_space *mapping, struct inode *inode, loff_t pos, unsigned len, struct page *mmap_page, struct ocfs2_write_ctxt *wc) { int ret, written = 0; loff_t end = pos + len; struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_dinode *di = NULL; trace...
false
false
false
false
false
0
add_kbnode( KBNODE root, KBNODE node ) { KBNODE n1; for(n1=root; n1->next; n1 = n1->next) ; n1->next = node; }
false
false
false
false
false
0
e2_dialog_response_decode_cb (GtkDialog *dialog, gint response, DialogButtons *dialog_result) { switch (response) { case GTK_RESPONSE_OK: case GTK_RESPONSE_YES: case GTK_RESPONSE_APPLY: *dialog_result = OK; break; case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_NO: *dialog_result = CANCEL; break; ...
false
false
false
false
false
0
project_become_undo(project_ty *pp) { trace(("project_become_undo(cp)\n{\n")); pp->get_user()->become_end(); trace(("}\n")); }
false
false
false
false
false
0
kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags) { struct kernfs_node *kn; if (flags & LOOKUP_RCU) return -ECHILD; /* Always perform fresh lookup for negatives */ if (d_really_is_negative(dentry)) goto out_bad_unlocked; kn = dentry->d_fsdata; mutex_lock(&kernfs_mutex); /* The kernfs node ...
false
false
false
false
false
0
abort_task(int exit_status, const char* msg) { if (task_state() == PROCESS_EXECUTING || task_state() == PROCESS_SUSPENDED) { request_abort(); } else { set_task_state(PROCESS_ABORTED, "abort_task"); } result->exit_status = exit_status; gstate.report_result_error(*result, msg); res...
false
false
false
false
false
0
threeBodyMEIntegrator(const DecayMode & dm) const { // workout which mode we are doing int imode(-1); // ids of the particles int id0(dm.parent()->id()),idf[2],ids(0); unsigned int nf(0); ParticleMSet::const_iterator pit = dm.products().begin(); for( ;pit!=dm.products().end();++pit) { if((**pit).iSpin...
false
false
false
false
true
1
DoubleClicked (Event& e) { if (e.eventType != DownEvent) { return false; } const int distThresh = 4; int time = abs(int(e.timestamp - lasttime)); int dist = abs(e.x - lastx) + abs(e.y - lasty); return time < clickDelay && dist < distThresh; }
false
false
false
false
false
0
do_admin_init(JCR *jcr) { free_rstorage(jcr); if (!allow_duplicate_job(jcr)) { return false; } return true; }
false
false
false
false
false
0
getrange(gamut *s, double *min, double *max) { if (min != NULL) { min[0] = s->mn[0]; min[1] = s->mn[1]; min[2] = s->mn[2]; } if (max != NULL) { max[0] = s->mx[0]; max[1] = s->mx[1]; max[2] = s->mx[2]; } }
false
false
false
false
false
0
float4_numeric(PG_FUNCTION_ARGS) { float4 val = PG_GETARG_FLOAT4(0); Numeric res; NumericVar result; char buf[FLT_DIG + 100]; if (isnan(val)) PG_RETURN_NUMERIC(make_result(&const_nan)); sprintf(buf, "%.*g", FLT_DIG, val); init_var(&result); /* Assume we need not worry about leading/trailing spaces */ ...
true
true
false
false
false
1
seedMT(uint32 seed) { /* * We initialize state[0..(N-1)] via the generator * * x_new = (69069 * x_old) mod 2^32 * * from Line 15 of Table 1, p. 106, Sec. 3.3.4 of Knuth's * _The Art of Computer Programming_, Volume 2, 3rd ed. * * Notes (SJC): I do not know what the initial state requirements...
false
false
false
false
false
0
rxdesc_get_next(struct pos_oc3_data *d,m_uint32_t rxd_addr, struct rx_desc *rxd) { m_uint32_t nrxd_addr; if (rxd->rdes[0] & POS_OC3_RXDESC_WRAP) nrxd_addr = d->rx_start; else nrxd_addr = rxd_addr + sizeof(struct rx_desc); return(nrxd_addr); }
false
false
false
false
false
0
add_or_sub_years_to_date(struct tm *date, int n) { date->tm_year += n; if (date->tm_year>137) { date->tm_year = 137; } if (date->tm_year<3) { date->tm_year = 3; } /* Leap day/year */ if ((date->tm_mon==1) && (date->tm_mday==29)) { if (!((date->tm_year%4 == 0) && !(((d...
false
false
false
false
false
0
ClientAuthorized(client, proto_n, auth_proto, string_n, auth_string) ClientPtr client; char *auth_proto, *auth_string; unsigned short proto_n, string_n; { OsCommPtr priv; union { struct sockaddr sa; #ifdef UNIXCONN struct sockaddr_un un; #endif /* UNIXCONN */ #ifdef TCPC...
false
false
false
false
false
0
main (int argc, char *argv[]) { gchar **filenames = NULL; guint num, i; GError *err = NULL; GOptionContext *ctx; GOptionEntry options[] = { GST_TOOLS_GOPTION_VERSION, {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL}, {NULL} }; #ifdef ENABLE_NLS bindtextdomain (GETTEXT...
false
false
false
false
false
0
shmem_get_inode(struct super_block *sb, const struct inode *dir, umode_t mode, dev_t dev, unsigned long flags) { struct inode *inode; struct shmem_inode_info *info; struct shmem_sb_info *sbinfo = SHMEM_SB(sb); int ino; if (shmem_reserve_inode(sb)) return NULL; inode = new_inode(sb); if (inode) { i...
false
false
false
false
false
0
tp_properties_mixin_emit_flags (GObject *obj, const TpIntset *props) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); GPtrArray *prop_arr; GValue prop_list = { 0, }; TpIntsetFastIter iter; guint len = tp_...
false
false
false
false
false
0
mysasl_server_init(char *name, sasl_conn_t **imsp_saslconn_p, const char **errstr) { int result; char remoteip[60], localip[60]; result = sasl_server_new(name, /* service name */ NULL, /* hostname */ NULL, /* user realm */ NULL, /* local ip */ NULL, /* remote ...
true
true
false
false
false
1
see_rec(alists_t * alists, const board_t * board, int colour, int to, int piece_value) { int from, piece; int value; ASSERT(alists!=NULL); ASSERT(board!=NULL); ASSERT(COLOUR_IS_OK(colour)); ASSERT(SQUARE_IS_OK(to)); ASSERT(piece_value>0); // find the least valuable attacker from = alist_p...
false
false
false
false
false
0
checkInterfaceDirs(const std::string &prepro, cmTarget *target) { const char* installDir = target->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); const char* topSourceDir = target->GetMakefile()->GetHomeDirectory(); const char* topBinaryDir = target->GetMakefile()->Get...
false
false
false
false
false
0
AuEvent_get_milli(AuEvent *self, void *closure) { if (self->milli == NULL) { if ((self->milli = PyInt_FromLong(self->event.milli)) == NULL) return NULL; } Py_INCREF(self->milli); return self->milli; }
false
false
false
false
false
0
bam_calend(const bam1_core_t *c, const uint32_t *cigar) { int k, end = c->pos; for (k = 0; k < c->n_cigar; ++k) { int op = bam_cigar_op(cigar[k]); int len = bam_cigar_oplen(cigar[k]); if (op == BAM_CBACK) { // move backward int l, u, v; if (k == c->n_cigar - 1) break; // skip trailing 'B' for (l = k -...
false
false
false
false
false
0
pxa2xx_spi_dma_setup(struct driver_data *drv_data) { struct pxa2xx_spi_master *pdata = drv_data->master_info; struct device *dev = &drv_data->pdev->dev; dma_cap_mask_t mask; dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); drv_data->dummy = devm_kzalloc(dev, SZ_2K, GFP_KERNEL); if (!drv_data->dummy) return ...
false
false
false
false
false
0
clutter_actor_get_height (ClutterActor *self) { ClutterActorPrivate *priv; g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); priv = self->priv; if (priv->needs_allocation) { gfloat natural_height = 0; if (priv->request_mode == CLUTTER_REQUEST_HEIGHT_FOR_WIDTH) { gfloat nat...
false
false
false
false
false
0
pio2_gpio_dir_out(struct gpio_chip *chip, unsigned offset, int value) { int data; struct pio2_card *card = gpio_to_pio2_card(chip); if ((card->bank[PIO2_CHANNEL_BANK[offset]].config == INPUT) | (card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) { dev_err(&card->vdev->dev, "Channel directionality not co...
false
false
false
false
false
0
preset_multiple_registers(int slave, int start_addr, int reg_count, int *data, int fd) { int byte_count, i, packet_size = 6; int status; unsigned char packet[PRESET_QUERY_SIZE]; if (reg_count > MAX_WRITE_REGS) { reg_count = MAX_WRITE_REGS; #ifdef DEBUG fprintf(stderr, "Trying to write to too many ...
false
false
false
false
false
0
show_file(const char *filename, const char *title, int r, int c) { do { cprint_init(); if (title) { cprint("--title"); cprint("%s", title); } cprint("--textbox"); cprint("%s", filename); cprint("%d", r ? r : rows); cprint("%d", c ? c : cols); } while (exec_conf() < 0); }
false
false
false
false
false
0
fnt_font_done( FNT_Font* font, FT_Stream stream ) { if ( font->fnt_frame ) RELEASE_Frame( font->fnt_frame ); font->fnt_size = 0; font->fnt_frame = 0; }
false
false
false
false
false
0
val_int() { longlong value; int error; if (args[0]->cast_to_int_type() != STRING_RESULT || args[0]->result_as_longlong()) { value= args[0]->val_int(); null_value= args[0]->null_value; return value; } value= val_int_from_str(&error); if (value < 0 && error == 0) { push_warning(cu...
false
false
false
false
false
0
vxml_fatal_error_uc(vxml_parser_t *vp, vxml_error_t error, uint32 uc) { if (vp->flags & VXML_F_FATAL_ERROR) return; if (vxml_debugging(0)) { uint32 s32[2]; char s8[5]; s32[0] = uc; s32[1] = 0; if (utf32_to_utf8(s32, s8, sizeof s8) >= sizeof s8) g_strlcpy(s8, "????", sizeof s8); g_warning("VXML %s...
true
true
false
false
false
1
charcmp(char a, char b) { return a == b ? 0 : UNSIGNED(a) < UNSIGNED(b) ? -1 : +1; }
false
false
false
false
false
0
init005 (int arg) { int count = 5; int res; while (count > 0) { registerWrite (0x0A, arg); Outb (DATA, 0xFF); res = registerRead (0x0A); /* failed ? */ if (res != arg) return 1; /* ror arg */ res = arg & 0x01; arg = arg / 2; if (res == 1) arg = arg | ...
false
false
false
false
false
0
gst_bus_create_watch (GstBus * bus) { GstBusSource *source; g_return_val_if_fail (GST_IS_BUS (bus), NULL); g_return_val_if_fail (bus->priv->poll != NULL, NULL); source = (GstBusSource *) g_source_new (&gst_bus_source_funcs, sizeof (GstBusSource)); g_source_set_name ((GSource *) source, "GStreamer mes...
false
false
false
false
false
0
parse_pwidstr (const char *pwidstr, int new_mode, int *r_sigg, int *r_pwid) { const char *desc; if (!pwidstr) desc = NULL; else if (!strcmp (pwidstr, "PW1.CH")) { *r_sigg = 0; *r_pwid = 0x00; /* TRANSLATORS: Do not translate the "|*|" prefixes but keep them verbatim at the star...
false
false
false
false
false
0
NumberOfDigits( double mins, double maxs, double logBase ) { int ndig1p = 1; if( fabs(mins) > 0.0 )ndig1p = static_cast<int>(log10(fabs(mins)))+1; if( mins < 0.0 )++ndig1p; int ndig1b = static_cast<int>(log10(logBase))+1; int ndig1 = ndig1p + ndig1b; int ndig2p = 1; if( fabs(maxs) > 0.0 )ndig2p = static_...
false
false
false
false
false
0
__digest_string(const unsigned char *digest, char *strbuf) { static const char digit[] = "0123456789abcdef"; char *ptr; int i; for (i = 0, ptr = strbuf; i < CHUNK_DIGEST_LEN; i ++) { *ptr++ = digit[digest[i] & 0xf]; *ptr++ = digit[(digest[i] >> 4) & 0xf]; } *ptr = 0; return strbuf; }
false
false
false
false
false
0
sdb_model_ensure_node_children (SymbolDBModel *model, SymbolDBModelNode *node, gboolean emit_has_child, gboolean fake_child) { SymbolDBModelPriv *priv; gboolean old_has_child; g_return_if_fail (node->n_children == 0); ...
false
false
false
false
false
0
ocfs2_osb_debug_open(struct inode *inode, struct file *file) { struct ocfs2_super *osb = inode->i_private; char *buf = NULL; buf = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!buf) goto bail; i_size_write(inode, ocfs2_osb_dump(osb, buf, PAGE_SIZE)); file->private_data = buf; return 0; bail: return -ENOMEM; }
false
false
false
false
false
0
traceCap_(Capability *cap, char *msg, ...) { va_list ap; va_start(ap,msg); #ifdef DEBUG if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) { traceCap_stderr(cap, msg, ap); } else #endif { postCapMsg(cap, msg, ap); } va_end(ap); }
false
false
false
false
false
0
proposal_substructure_create_from_proposals_v1( linked_list_t *proposals, u_int32_t lifetime, u_int64_t lifebytes, auth_method_t auth, ipsec_mode_t mode, encap_t udp) { private_proposal_substructure_t *this = NULL; enumerator_t *enumerator; proposal_t *proposal; int number = 0; enumerator = proposals->creat...
false
false
false
false
false
0
rad_coa_recv(REQUEST *request) { int rcode = RLM_MODULE_OK; int ack, nak; VALUE_PAIR *vp; /* * Get the correct response */ switch (request->packet->code) { case PW_COA_REQUEST: ack = PW_COA_ACK; nak = PW_COA_NAK; break; case PW_DISCONNECT_REQUEST: ack = PW_DISCONNECT_ACK; nak = PW_DISCONNECT_NAK;...
false
false
false
false
false
0
FindSymmetricCandidateMatches_FLANN(const FeatureSet &left, const FeatureSet &right, Matches *matches) { // -- // TODO(pmoulon) template on feature type. // -- if (left.features.size() == 0) { return; } int descriptorSize = left.features[0].descriptor...
false
false
false
false
false
0
simplePrimTintegral(const DistributionSpecStruct& prim1, const DistributionSpecStruct& prim2, int coord, ergo_real threshold) { const int maxDistrsInTempList = 888; DistributionSpecStruct tempList[maxDistrsInTempList]; int i, k, nNewPrims; ergo_real sum; DistributionSpecStruct list1[2]; Di...
false
false
false
false
false
0
reexecuteBegin(const Request& request) { log_debug("reexecuteBegin"); _stream.clear(); _stream.buffer().discard(); _socket.beginConnect(_addrInfo); _reconnectOnError = false; }
false
false
false
false
false
0
separate_git_dir(const char *git_dir) { struct stat st; FILE *fp; if (!stat(git_link, &st)) { const char *src; if (S_ISREG(st.st_mode)) src = read_gitfile_gently(git_link); else if (S_ISDIR(st.st_mode)) src = git_link; else die("unable to handle file type %d", st.st_mode); if (rename(src, git_d...
false
false
false
false
false
0
igb_update_itr(struct igb_q_vector *q_vector, struct igb_ring_container *ring_container) { unsigned int packets = ring_container->total_packets; unsigned int bytes = ring_container->total_bytes; u8 itrval = ring_container->itr; /* no packets, exit with status unchanged */ if (packets == 0) return; switc...
false
false
false
false
false
0
lf_power_of_2(int t) { if (t == (t&1)) return true; return lf_power_of_2(t >> 1); }
false
false
false
false
false
0
expandtilde(buf) char *buf; { char hbuf[MAXPFADLEN+2]; char *home; int n; home = getenv("HOME"); if(home != NULL) { n = strncopy(hbuf,home,MAXPFADLEN); if(issepdir(hbuf[n-1])) n--; strncopy(hbuf+n,buf+1,MAXPFADLEN-n); strncopy(buf,hbuf,MAXPFADLEN); } ...
false
false
false
false
false
0
gtk_plot_real_set_pc(GtkPlot *plot, GtkPlotPC *pc) { if(plot->pc) gtk_object_unref(GTK_OBJECT(plot->pc)); if(!pc){ plot->pc = GTK_PLOT_PC(gtk_plot_gdk_new(GTK_WIDGET(plot))); gtk_object_ref(GTK_OBJECT(plot->pc)); gtk_object_sink(GTK_OBJECT(plot->pc)); } else { plot->pc = pc; gtk_object_re...
false
false
false
false
false
0
applyUserAgent( QHttpRequestHeader& header ) { // NEVER CHANGE THIS STRING! // martin says we can append stuff if we like, just never change the first bit QString s = userAgent(); //"Last.fm Client " + The::settings().version(); #ifdef WIN32 s += " (Windows)"; #elif defined (Q_WS_MAC) s += " (O...
false
false
false
false
false
0
kim_suspend(struct platform_device *pdev, pm_message_t state) { struct ti_st_plat_data *pdata = pdev->dev.platform_data; if (pdata->suspend) return pdata->suspend(pdev, state); return 0; }
false
false
false
false
false
0
TouchSocketLockFiles(void) { ListCell *l; foreach(l, lock_files) { char *socketLockFile = (char *) lfirst(l); /* No need to touch the data directory lock file, we trust */ if (strcmp(socketLockFile, DIRECTORY_LOCK_FILE) == 0) continue; /* * utime() is POSIX standard, utimes() is a common altern...
true
true
true
false
true
1
parsepopup(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; aim_tlvlist_t *tl; int ret = 0; char *msg, *url; fu16_t width, height, delay; tl = aim_readtlvchain(bs); msg = aim_gettlv_str(tl, 0x0001, 1); url = aim_gettlv_str(tl, 0x000...
false
false
false
false
false
0
tcl_func_get_funit_list( ClientData d, /*!< Not used */ Tcl_Interp* tcl, /*!< Pointer to the Tcl interpreter */ int argc, /*!< Number of arguments in the argv list */ const char* argv[] /*!< Array of arguments passed to this function */ ) { PROFILE(TCL_FUNC_GET_FUNIT_LIST); int retval = ...
true
true
false
false
false
1
bam_merge(int argc, char *argv[]) { int c, is_by_qname = 0, flag = 0, ret = 0; char *fn_headers = NULL, *reg = 0; while ((c = getopt(argc, argv, "h:nruR:")) >= 0) { switch (c) { case 'r': flag |= MERGE_RG; break; case 'h': fn_headers = strdup(optarg); break; case 'n': is_by_qname = 1; break; case 'u': fla...
false
true
false
false
true
1
print_indent(register int indent) { int myrank; MPI_Comm_rank(pio_comm_g, &myrank); if (myrank == 0) { indent *= TAB_SPACE; for (; indent > 0; --indent) fputc(' ', output); } }
false
false
false
false
false
0
outreset(void) { if (to_pipe) { untested(); pclose(to_pipe); to_pipe = NULL; }else{ } xclose(&fn); IO::formaat = 0; IO::incipher = false; IO::mstdout.reset(); }
false
false
false
false
false
0
qacsch(NUMBER *q, NUMBER *epsilon) { NUMBER *tmp, *res; tmp = qinv(q); res = qasinh(tmp, epsilon); qfree(tmp); return res; }
false
false
false
false
false
0
gst_oss4_source_open (GstAudioSrc * asrc, gboolean silent_errors) { GstOss4Source *oss; gchar *device; int mode; oss = GST_OSS4_SOURCE (asrc); if (oss->device) device = g_strdup (oss->device); else device = gst_oss4_audio_find_device (GST_OBJECT_CAST (oss)); /* desperate times, desperate measur...
false
false
false
false
true
1
nlm_encode_testres(__be32 *p, struct nlm_res *resp) { s32 start, len; if (!(p = nlm_encode_cookie(p, &resp->cookie))) return NULL; *p++ = resp->status; if (resp->status == nlm_lck_denied) { struct file_lock *fl = &resp->lock.fl; *p++ = (fl->fl_type == F_RDLCK)? xdr_zero : xdr_one; *p++ = htonl(resp->loc...
false
false
false
false
false
0
sm_c2s_action(sess_t dest, char *action, char *target) { nad_t nad; int rns, sns; nad = nad_new(); rns = nad_add_namespace(nad, uri_COMPONENT, NULL); nad_append_elem(nad, rns, "route", 0); nad_append_attr(nad, -1, "to", dest->c2s); nad_append_attr(nad, -1, "from", dest->user->sm->id); ...
false
false
false
false
false
0
sqstd_rex_expect(SQRex *exp, SQInteger n){ if((*exp->_p) != n) sqstd_rex_error(exp, _SC("expected paren")); exp->_p++; }
false
false
false
false
false
0
spool_type_search_default_rule(const lListElem *spool_type) { lList *lp; lListElem *ep; lListElem *rule = NULL; lp = lGetList(spool_type, SPT_rules); for_each (ep, lp) { if (lGetBool(ep, SPTR_default)) { rule = (lListElem *)lGetRef(ep, SPTR_rule); break; } } return...
false
false
false
false
false
0
drawtracks (void) { gint t=0; // if (!maploaded) // return; if (!local_config.showtrack) return; if (current.importactive) return; t = 2 * (tracknr >> 1) - 1; /* t=tracknr; */ if (t < 1) return; gdk_gc_set_line_attributes (kontext_map, 4, 0, 0, 0); if (local_config.showshadow) { ...
false
false
false
false
false
0
setConstraintModel( ConstraintModel* cm ) { if ( !d->constraintModel.isNull() ) { disconnect( d->constraintModel ); } d->constraintModel = cm; connect( cm, SIGNAL(constraintAdded(Constraint)), this, SLOT(slotConstraintAdded(Constraint)) ); connect( cm, SIGNAL(constraintRemoved(Constraint)),...
false
false
false
false
false
0
hasBasePointer(const MachineFunction &MF) const { const MachineFrameInfo *MFI = MF.getFrameInfo(); if (!EnableBasePointer) return false; // When we need stack realignment, we can't address the stack from the frame // pointer. When we have dynamic allocas or stack-adjusting inline asm, we // can't...
false
false
false
false
false
0
hx509_private_key_init(hx509_private_key *key, hx509_private_key_ops *ops, void *keydata) { *key = calloc(1, sizeof(**key)); if (*key == NULL) return ENOMEM; (*key)->ref = 1; (*key)->ops = ops; (*key)->private_key.keydata = keydata; return 0; }
false
false
false
false
false
0
xlib_rgb_gray_to_stage (unsigned char *buf, int rowstride, int width, int height) { int x, y; unsigned char *pi_start, *po_start; unsigned char *pi, *po; unsigned char gray; pi_start = buf; po_start = xlib_rgb_ensure_stage (); for (y = 0; y < height; y++) { pi = pi_start; po = po_start; ...
false
false
false
false
false
0
unity_deprecated_scope_base_set_active_sources_internal (UnityDeprecatedScopeBase* self, gchar** active_sources_, int active_sources__length1) { UnityOptionsFilter* _tmp0_ = NULL; GList* _tmp1_ = NULL; gchar** _tmp8_ = NULL; gint _tmp8__length1 = 0; g_return_if_fail (self != NULL); _tmp0_ = self->priv->_sources; ...
false
false
false
false
false
0
getRelevantLoop(const SCEV *S) { // Test whether we've already computed the most relevant loop for this SCEV. std::pair<DenseMap<const SCEV *, const Loop *>::iterator, bool> Pair = RelevantLoops.insert(std::make_pair(S, nullptr)); if (!Pair.second) return Pair.first->second; if (isa<SCEVConstant>(S)) ...
false
false
false
false
false
0
evg_user_fill_const(s32 y, s32 count, EVG_Span *spans, EVGSurface *surf) { u32 col_no_a; s32 i; col_no_a = surf->fill_col; for (i=0; i<count; i++) { if (spans[i].coverage != 0xFF) { u32 a = mul255(0xFF, spans[i].coverage); surf->raster_fill_run_alpha(surf->raster_cbk, spans[i].x, y, spans[i].len, col_no_a...
false
false
false
false
false
0
wp_getc (FILE *fp) { int n; clearerr (fp); n = getc (fp); if (n == EOF && ferror(fp)) wp_func_warning(); return n; }
false
true
false
false
true
1
usnic_pvar_enum_read(const struct mca_base_pvar_t *pvar, void *value, void *bound_obj) { size_t i; int *array = (int *) value; for (i = 0; i < mca_btl_usnic_component.num_modules; ++i) { array[i] = i; } return OMPI_SUCCESS; }
false
false
false
false
false
0
selectNext( GtkTreeView* tv ) { GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (tv)); UT_return_if_fail (model != NULL); GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv)); GtkTreeIter iter; // try to select next gboolean haveSelected = gtk_tree_selection_get_selected (...
false
false
false
false
false
0
handle_proxy_line(const char *line, managed_proxy_t *mp) { log_debug(LD_GENERAL, "Got a line from managed proxy: %s", line); if (strlen(line) < SMALLEST_MANAGED_LINE_SIZE) { log_warn(LD_GENERAL, "Managed proxy configuration line is too small. " "Discarding"); goto err; } if (!strcmpstart(...
false
false
false
false
false
0
one (int i, mpz_t multiplicand, mpz_t multiplier) { mpz_t product, ref_product; mpz_init (product); mpz_init (ref_product); /* Test plain multiplication comparing results against reference code. */ mpz_mul (product, multiplier, multiplicand); refmpz_mul (ref_product, multiplier, multiplicand); if (mpz_...
false
false
false
false
false
0
klp_disable_patch(struct klp_patch *patch) { int ret; mutex_lock(&klp_mutex); if (!klp_is_patch_registered(patch)) { ret = -EINVAL; goto err; } if (patch->state == KLP_DISABLED) { ret = -EINVAL; goto err; } ret = __klp_disable_patch(patch); err: mutex_unlock(&klp_mutex); return ret; }
false
false
false
false
false
0
find(Kind kind, Attribute sym) const { if (!sym.isSymbolic()) return sym; Map::const_iterator it = iMap.find(sym.index() | (kind << SHIFT)); if (it != iMap.end()) { return it->second; } else return Attribute::UNDEFINED(); }
false
false
false
false
false
0
rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi) { struct rt2x00_led *led = &rt2x00dev->led_qual; unsigned int brightness; if ((led->type != LED_TYPE_QUALITY) || !(led->flags & LED_REGISTERED)) return; /* * Led handling requires a positive value for the rssi, * to do that correctly we need to ...
false
false
false
false
false
0
OnMouseEvent(wxMouseEvent &event) { if (event.LeftDown() || event.RightDown()) Close(true); }
false
false
false
false
false
0
HandleMidiData(unsigned char* bytes, unsigned numBytes) { for (unsigned i=0; i<numBytes; i++) { const unsigned char byte = bytes[i]; if (byte & 0x80) { // then byte is a status byte if (byte < 0xf0) { // dont deal with system messages status = byte; channel = (byte & 0x0f); data = 0xff; } ...
false
false
false
false
false
0
mailimap_section_new_header(void) { struct mailimap_section_msgtext * msgtext; struct mailimap_section * section; msgtext = mailimap_section_msgtext_new(MAILIMAP_SECTION_MSGTEXT_HEADER, NULL); if (msgtext == NULL) return NULL; section = mailimap_section_new_msgtext(msgtext); if (section == NULL)...
false
false
false
false
false
0
sqcurve_energy(v_id,side) vertex_id *v_id; /* vertex list for facet */ REAL (*side)[MAXCOORD]; /* side vectors */ { REAL t1t1,t1t2,t2t2; REAL det; struct v_curve_t *vc[FACET_VERTS]; int i,j; REAL area; t1t1 = SDIM_dot(side[0],side[0]); t1t2 = SDIM_dot(side[0],side[1]); t2t2 = SDIM_dot(side[1],side[1...
false
false
false
false
false
0
_IO_obstack_overflow (_IO_FILE *fp, int c) { struct obstack *obstack = ((struct _IO_obstack_file *) fp)->obstack; int size; /* Make room for another character. This might as well allocate a new chunk a memory and moves the old contents over. */ assert (c != EOF); obstack_1grow (obstack, c); /* Setu...
false
false
false
false
false
0
Initialize() { if (this->Array) { for (int i=0; i<this->NumberOfRows; i++) { this->Array[i]->Delete(); } delete[] this->Array; this->Array = NULL; } this->NumberOfRows = 0; }
false
false
false
false
false
0
stonith_dump_pending_callbacks(stonith_t * stonith) { stonith_private_t *private = stonith->private; if (private->stonith_op_callback_table == NULL) { return; } return g_hash_table_foreach(private->stonith_op_callback_table, stonith_dump_pending_op, NULL); }
false
false
false
false
false
0
parse_u_long32(lList **ppcmdline, const char *opt, lList **ppal, u_long32 *value) { bool ret = false; lListElem *ep = NULL; DENTER(TOP_LAYER, "parse_u_long32"); ep = lGetElemStr(*ppcmdline, SPA_switch, opt); if(ep != NULL) { *value = lGetUlong(ep, SPA_argval_lUlongT); lRemoveElem(*ppcmdli...
false
false
false
false
false
0
gsb_fyear_get_fyear_from_combobox ( GtkWidget *combo_box, const GDate *date ) { gint fyear_number = 0; GtkTreeIter iter; if ( !fyear_model_filter ) gsb_fyear_create_combobox_store ( ); if ( gtk_combo_box_get_active_iter ( GTK_COMBO_BOX (combo_box), &iter ) ) { ...
false
false
false
false
false
0