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
tex_emit_mm(struct gl_context *ctx, struct radeon_state_atom *atom) { r200ContextPtr r200 = R200_CONTEXT(ctx); BATCH_LOCALS(&r200->radeon); uint32_t dwords = atom->check(ctx, atom); int i = atom->idx; radeonTexObj *t = r200->state.texture.unit[i].texobj; if (!r200->state.texture.unit[i].unitneeded &&...
false
false
false
false
false
0
cap_ack(struct Client *sptr, const char *caplist) { const char *cl = caplist; struct capabilities *cap = NULL; int neg = 0; /* * Coming from the client, this generally indicates that the client * is using a new backwards-incompatible protocol feature. As such, * it does not require further response f...
false
false
false
false
false
0
BB_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v) { unsigned char x; /* 'B' == unsigned char, maps to PyArg_Parse's 'b' formatter */ if (!PyArg_Parse(v, "b;array item must be integer", &x)) return -1; if (i >= 0) ((char *)ap->ob_item)[i] = x; return 0; }
false
false
false
false
false
0
setMaxLabelCount(int32_t maxLabelCount, UErrorCode &status) { if (U_FAILURE(status)) { return *this; } if (maxLabelCount <= 0) { status = U_ILLEGAL_ARGUMENT_ERROR; return *this; } maxLabelCount_ = maxLabelCount; if (maxLabelCount < bucketList_->size()) { indexBuil...
false
false
false
false
false
0
sash(int row_,int col_) { MSSash *pSash; for (unsigned i=0;i<sashList().length();i++) { pSash=(MSSash *)_sashList(i); if (pSash->row()==row_&&pSash->column()==col_) return pSash; } return 0; }
false
false
false
false
false
0
server_register (const char *name, const char *version, const char *timestamp, const char *options, const char *tag, const char *date, const char *conflict) { int len; if (options == NULL) options = ""; TRACE (TRACE_FUNCTION, "server_register(%s, %s, %s, %s, %s, %s, %s)"...
false
true
false
false
false
1
mixer_sh_stop(void) { struct mixer_channel_data *channel; int i; osd_stop_audio_stream(); for (i = 0, channel = mixer_channel; i < MIXER_MAX_CHANNELS; i++, channel++) { if (channel->filter) filter_free(channel->filter); filter_state_free(channel->left); filter_state_free(channel->right); }...
false
false
false
false
false
0
Init() { int Ret = 0; do { if((Fd = open(DeviceName,SERIAL_OPEN_FLAGS)) < 0) { LOG_ERROR(("%s: Couldn't open \"%s\": %s",__FUNCTION__,DeviceName, Err2String(errno))); Ret = ERR_SERIAL_DEV_OPEN; break; } // Prime Bits in case someone does a bit set bef...
false
false
false
false
false
0
switch2text_mode(const char *tty_path) { int ret; int tty_fd; tty_fd = open(tty_path, 0); if (tty_fd < 0) { print_error("open tty device \"%s\" failed", tty_path); return -1; } ret = fswitch2text_mode(tty_fd); if (ret < 0) { error_msg("switch to text mode failed"); } close(tty_fd); return ret; }
false
false
false
false
false
0
tsi721_lcread(struct rio_mport *mport, int index, u32 offset, int len, u32 *data) { struct tsi721_device *priv = mport->priv; if (len != sizeof(u32)) return -EINVAL; /* only 32-bit access is supported */ *data = ioread32(priv->regs + offset); return 0; }
false
false
false
false
false
0
getpriority (enum __priority_which which, id_t who) { int res; res = INLINE_SYSCALL (getpriority, 2, (int) which, who); if (res >= 0) res = PZERO - res; return res; }
false
false
false
false
false
0
bValidate( void ) { double df1, df2, df3; CmdBase::bValidate( ); // Check the sweep start and stop values if( ! ConvertType::bStrToDFlt( m_osStart, &df1 ) ) SetErrMsg( wxT("Invalid sweep start value.") ); if( ! ConvertType::bStrToDFlt( m_osStop, &df2 ) ) SetErrMsg( wxT("Invalid sweep stop value.")...
false
false
false
false
false
0
invert_matrix_2d_no_rot( GLmatrix *mat ) { const GLfloat *in = mat->m; GLfloat *out = mat->inv; if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0) return GL_FALSE; memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); if (mat->flags & M...
false
true
false
false
false
1
schema_syntax_enum_callback(char **names, Slapi_PluginDesc *plugindesc, void *arg) { struct syntax_enum_wrapper *sew = (struct syntax_enum_wrapper *)arg; char *oid, *desc; int i; struct berval val; struct berval *vals[2] = {0, 0}; vals[0] = &val; oid = NULL; if ( names != NULL ) { for ( i = 0; names[i] !=...
false
true
false
false
false
1
makechild(tty, ppid) int tty; p_id_t ppid; { # ifdef DEBUG extern VOID (*__free_hook) __P_((VOID_P)); extern VOID_P (*__malloc_hook) __P_((ALLOC_T)); extern VOID_P (*__realloc_hook) __P_((VOID_P, ALLOC_T)); # endif sigmask_t mask, omask; p_id_t pid; int i, stop; Xsigfillset(mask); Xsigblock(omask, mask); if (...
false
false
false
false
false
0
DecodeHuffmanCW (Huffman h, /*!< pointer to huffman codebook table */ HANDLE_FDK_BITSTREAM hBs) /*!< Handle to Bitbuffer */ { SCHAR index = 0; int value, bit; while (index >= 0) { bit = FDKreadBits (hBs, 1); index = h[index][bit]; } value = index+64; /* Add offset */ ...
false
false
false
false
false
0
SendInitialReputations() { WorldPacket data(SMSG_INITIALIZE_FACTIONS, (4 + 64 * 5)); data << uint32(0x00000040); RepListID a = 0; for (FactionStateList::iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr) { // fill in absent fields for (; a != itr->first; ++a) ...
false
false
false
false
false
0
web_proxy_get_request_type(const char *req, size_t length) { switch (req[0]) { case 'C': if (length == 7 && text_lhcmp("ONNECT", req + 1) == 0) { return HTTP_REQ_CONNECT; } break; case 'D': if (length == 6 && text_lhcmp("ELETE", req + 1) == 0) { return HTTP_REQ_DELETE; } break; case 'G': ...
false
false
false
false
false
0
h98CheckType(line,wh,e,t) /* Check for Haskell 98 type */ Int line; String wh; Cell e; Type t; { #if !HASKELL_98_ONLY if (haskell98) { #endif Type ty = t; if (isPolyType(t)) t = monotypeOf(t); if (isQualType(t)) { Cell pi = h98Context(TRUE,fst(snd(t))); if (nonNull(pi)) { ERRMSG(line) "Il...
false
false
false
false
false
0
distanceFromLine(double cx, double cy, double ax, double ay, double bx, double by, double & dx, double & dy, double &distanceSegment, bool & atEndpoint) { // http://www.codeguru.com/forum/showthread.php?t=194400 // // find the distance from the point (cx,cy) to the line // determined by the points (ax,...
false
false
false
false
false
0
release(const Event& e) { switch (e.pointer_button()) { case Event::left: release_select(); break; case Event::middle: release_undefined(); break; case Event::right: release_undefined(); break; } // discard multiple clicks Event queued(e); while (queued.pending()) { queued.read...
false
false
false
false
false
0
Save() { if (s_statsNeedSave) { CFile f; if (f.Open(JoinPaths(theApp->ConfigDir, wxT("statistics.dat")), CFile::write)) { // ADUNANZA BEGIN #if 0 f.WriteUInt8(0); /* version */ #else // f.WriteUInt8(128); // per differenziarmi da aMule standard! f.WriteUInt8(129); // la 128 aveva le statistiche per fi...
false
false
false
false
false
0
ns_client_qnamereplace(ns_client_t *client, dns_name_t *name) { LOCK(&client->query.fetchlock); if (client->query.restarts > 0) { /* * client->query.qname was dynamically allocated. */ dns_message_puttempname(client->message, &client->query.qname); } client->query.qname = name; UNLOCK(&client->query...
false
false
false
false
false
0
gd_stack_realize (GtkWidget *widget) { GdStack *stack = GD_STACK (widget); GdStackPrivate *priv = stack->priv; GtkAllocation allocation; GdkWindowAttr attributes = { 0 }; GdkWindowAttributesType attributes_mask; GdStackChildInfo *info; GList *l; gtk_widget_set_realized (widget, TRUE); gtk_widget_get...
false
false
false
false
false
0
snd_pcm_tstamp(struct snd_pcm_substream *substream, int __user *_arg) { struct snd_pcm_runtime *runtime = substream->runtime; int arg; if (get_user(arg, _arg)) return -EFAULT; if (arg < 0 || arg > SNDRV_PCM_TSTAMP_TYPE_LAST) return -EINVAL; runtime->tstamp_type = arg; return 0; }
false
false
false
false
false
0
parser_memsize(const void *ptr) { struct parser_params *p = (struct parser_params*)ptr; struct local_vars *local; size_t size = sizeof(*p); if (!ptr) return 0; size += p->parser_toksiz; for (local = p->parser_lvtbl; local; local = local->prev) { size += sizeof(*local); if (local->vars) size +...
false
false
false
false
false
0
isc__mem_allocateunlocked(isc_mem_t *ctx0, size_t size) { isc__mem_t *ctx = (isc__mem_t *)ctx0; size_info *si; size += ALIGNMENT_SIZE; if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) size += ALIGNMENT_SIZE; if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) si = mem_getunlocked(ctx, size); else si = mem_get(c...
false
false
false
false
false
0
server_setxattr (rpcsvc_request_t *req) { server_state_t *state = NULL; dict_t *dict = NULL; call_frame_t *frame = NULL; gfs3_setxattr_req args = {{0,},}; int32_t ret ...
false
false
false
false
false
0
hfc4s8s_interrupt(int intno, void *dev_id) { hfc4s8s_hw *hw = dev_id; u_char b, ovr; volatile u_char *ovp; int idx; u_char old_ioreg; if (!hw || !(hw->mr.r_irq_ctrl & M_GLOB_IRQ_EN)) return IRQ_NONE; /* read current selected regsister */ old_ioreg = GetRegAddr(hw); /* Layer 1 State change */ hw->mr.r_irq...
false
false
false
false
false
0
gitg_cell_renderer_path_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GitgCellRendererPath *self = GITG_CELL_RENDERER_PATH (object); switch (prop_...
false
false
false
false
false
0
intel_runtime_pm_get_noresume(struct drm_i915_private *dev_priv) { struct drm_device *dev = dev_priv->dev; struct device *device = &dev->pdev->dev; if (!HAS_RUNTIME_PM(dev)) return; WARN(dev_priv->pm.suspended, "Getting nosync-ref while suspended.\n"); pm_runtime_get_noresume(device); }
false
false
false
false
false
0
slurm_conf_get_nodename(const char *node_hostname) { char *alias = NULL; int idx; names_ll_t *p; #ifdef HAVE_FRONT_END slurm_conf_frontend_t *front_end_ptr = NULL; slurm_conf_lock(); if (!front_end_list) { debug("front_end_list is NULL"); } else { front_end_ptr = list_find_first(front_end_list, list...
false
false
false
false
false
0
checkVariableRange(UChar32 ch) const { return !(ch >= curData->variablesBase && ch < variableLimit); }
false
false
false
false
false
0
slider_set_from_pointer(GtkWidget *widget, int state, gdouble x, gdouble y, gboolean drag, gint button, GdkEventButton *event) { gint slider_height; gtk_widget_style_get(widget, "slider-width", &slider_height, NULL); GdkRectangle image_rect, value_rect; get_width_height(widget, &image_rect); image_rect.height -= ...
false
false
false
false
false
0
grpParseEmbassy(AjPFile file, AjPStr* embassyname) { AjPStr line = NULL; AjPStr text = NULL; AjPStrTok tokenhandle; char white[] = " \t\n\r"; char whiteplus[] = " \t\n\r:="; AjPStr tmpstr = NULL; AjPStr token = NULL; AjPStr value = NULL; ajint done = 0; ajStrAssignC(emba...
false
false
false
false
false
0
g3d_object_radius(G3DObject *object) { guint32 i; gdouble max_radius = 0.0, r; G3DVector *v; for(i = 0; i < object->vertex_count; i ++) { v = &object->vertex_data[i * 3]; r = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; if(r > max_radius) max_radius = r; } return sqrt(max_radius); }
false
false
false
false
false
0
perf_ibs_start(struct perf_event *event, int flags) { struct hw_perf_event *hwc = &event->hw; struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu); struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); u64 period; if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED))) return; WARN_ON_ON...
false
false
false
false
false
0
_mono_debug_init_corlib (MonoDomain *domain) { if (!mono_debug_initialized) return; mono_symbol_table->corlib = mono_debug_open_image (mono_defaults.corlib, NULL, 0); }
false
false
false
false
false
0
gkm_store_get_attribute (GkmStore *self, GkmObject *object, CK_ATTRIBUTE_PTR attr) { CK_ATTRIBUTE at; Schema *schema; CK_RV rv; g_return_val_if_fail (GKM_IS_STORE (self), CKR_GENERAL_ERROR); g_return_val_if_fail (GKM_IS_OBJECT (object), CKR_GENERAL_ERROR); g_return_val_if_fail (attr, CKR_GENERAL_ERROR); g_asse...
false
false
false
true
false
1
print_package_info (const fnpkg *pkg, PRN *prn) { char vstr[8]; int i; if (pkg->minver > 0) { get_version_string(vstr, pkg->minver); } else { *vstr = '\0'; } pprintf(prn, "Package: %s\n", (*pkg->name)? pkg->name : "unknown"); pprintf(prn, "Author: %s\n", (pkg->author)? pkg->author : "unk...
true
true
false
false
false
1
egg_list_box_real_draw (GtkWidget* widget, cairo_t* cr) { EggListBox * list_box = EGG_LIST_BOX (widget); EggListBoxPrivate *priv = list_box->priv; GtkAllocation allocation = {0}; GtkStyleContext* context; GtkStateFlags state; ChildFlags flags[3], *found; gint flags_length; gint focus_pad; int i; gt...
false
false
false
false
false
0
stbl_GetSampleFragmentSize(GF_SampleFragmentBox *stsf, u32 sampleNumber, u32 FragmentIndex) { GF_StsfEntry *ent; u32 i, count; if (!stsf || !FragmentIndex) return 0; //check cache if (!stsf->r_currentEntry || (stsf->r_currentEntry->SampleNumber < sampleNumber)) { stsf->r_currentEntry = NULL; stsf->r_currentEn...
false
false
false
false
false
0
safe_acos (double x) { if (std::abs(x) <= 1.0) return std::acos(x); return ( (x>0) ? 0 : CLHEP::pi ); }
false
false
false
false
false
0
pdf_make_iccbased(gx_device_pdf *pdev, cos_array_t *pca, int ncomps, const gs_range *prange /*[4]*/, const gs_color_space *pcs_alt, cos_stream_t **ppcstrm, const gs_range_t **pprange /* if scaling is needed */) { cos_value_t v; int code; ...
false
false
false
false
false
0
completeinternal(com, len, argc, argvp) CONST char *com; int len, argc; char ***argvp; { int i; for (i = 0; i < FUNCLISTSIZ; i++) { if (strncommcmp(com, funclist[i].ident, len)) continue; argc = addcompletion(funclist[i].ident, NULL, argc, argvp); } return(argc); }
false
false
false
false
false
0
get_extra_field( OFT( ush) tag, OFT( char *) pExtra, OFT( unsigned) iExtraLen) #ifdef NO_PROTO ush tag; /* tag to look for */ char *pExtra; /* pointer to extra field in memory */ unsigned iExtraLen; /* length of extra field */ #endif /* def NO_P...
false
false
false
false
false
0
divide(int a, int b) { if (a < 0) return -( (-a + b/2)/b ); else return (a + b/2)/b; }
false
false
false
false
false
0
ftp_reply ( struct ftp_request *ftp ) { char status_major = ftp->status_text[0]; char separator = ftp->status_text[3]; DBGC ( ftp, "FTP %p received status %s\n", ftp, ftp->status_text ); /* Ignore malformed lines */ if ( separator != ' ' ) return; /* Ignore "intermediate" responses (1xx codes) */ if ( statu...
false
false
false
false
false
0
merge__dump_reuc(git_index *index) { size_t i; const git_index_reuc_entry *reuc; printf ("\nREUC:\n"); for (i = 0; i < git_index_reuc_entrycount(index); i++) { reuc = git_index_reuc_get_byindex(index, i); printf("%s ", reuc->path); printf("%o ", reuc->mode[0]); printf("%s\n", git_oid_allocfmt(&reuc->oid[0...
false
false
false
false
false
0
DoCodeComplete() { EditorManager* edMan = Manager::Get()->GetEditorManager(); cbEditor* ed = edMan->GetBuiltinActiveEditor(); if (!ed) return; if ( !IsProviderFor(ed) ) return; TRACE(_T("CodeCompletion::DoCodeComplete(): Enter")); cbStyledTextCtrl* control = ed->GetControl(); ...
false
false
false
false
false
0
mono_image_load_module_dynamic (MonoReflectionAssemblyBuilder *ab, MonoString *fileName) { char *name; MonoImage *image; MonoImageOpenStatus status; MonoDynamicAssembly *assembly; guint32 module_count; MonoImage **new_modules; gboolean *new_modules_loaded; name = mono_string_to_utf8 (fileName); image = mono...
false
true
false
true
false
1
on_set_bg_full( GtkColorButton* btn, gpointer user_data ) { MainWin* parent=(MainWin*)user_data; gtk_color_button_get_color(GTK_COLOR_BUTTON(btn), &pref.bg_full); if( parent->full_screen ) { gtk_widget_modify_bg( parent->evt_box, GTK_STATE_NORMAL, &pref.bg_full ); gtk_widget_queue_draw(p...
false
false
false
false
false
0
xmms_nulstripper_seek (xmms_xform_t *xform, gint64 bytes, xmms_xform_seek_mode_t whence, xmms_error_t *err) { xmms_nulstripper_data_t *data; int ret; g_return_val_if_fail (xform, 0); data = xmms_xform_private_data_get (xform); g_return_val_if_fail (data, 0); if (whence == XMMS_XFORM_SEEK...
false
false
false
false
false
0
atkin_q3_visit(char* chunk, llong lower, llong range, llong x, llong y0) { while (1) { llong q = (3 * x * x - y0 * y0) - lower; while (q >= range) { if (x <= y0) { return; } q -= y0 * 60 + 900; y0 += 30; ...
false
false
false
false
false
0
capsule_repr(PyObject *o) { PyCapsule *capsule = (PyCapsule *)o; const char *name; const char *quote; if (capsule->name) { quote = "\""; name = capsule->name; } else { quote = ""; name = "NULL"; } return PyUnicode_FromFormat("<capsule object %s%s%s at %p>", ...
false
false
false
false
false
0
_ZmodF_mul_best_fft_depth(unsigned long n, int squaring) { unsigned long* table = squaring ? ZmodF_sqr_fft_table : ZmodF_mul_fft_table; long depth = -1; unsigned long i; for (i = 0; table[i]; i++) if (n < table[i]) { depth = i + 3; break; } if (depth == -1) { // We've gone beyo...
false
false
false
false
true
1
Visvs(int32 vkey, /* IN: vgroup key */ int32 id /* IN: id of entry in vgroup */) { intn i; vginstance_t *v = NULL; VGROUP *vg = NULL; intn ret_value = FALSE; /* initialize to false */ CONSTR(FUNC, "VSisvs"); /* clear error stack */ HEclear(); /* check if ...
false
false
false
false
false
0
convert_2_s8_to_1_s8 (xmms_sample_converter_t *conv, void *tin, guint len, void *tout) { xmms_samples8_t *in = (xmms_samples8_t *)tin; xmms_samples8_t *out = (xmms_samples8_t *)tout; gint i, j; /* this code doesn't look optimized, but the compiler should fix that */ for (i = 0; i < len; i++) { guint32 temp[2]...
false
false
false
false
false
0
store_freq_step(struct dbs_data *dbs_data, const char *buf, size_t count) { struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; unsigned int input; int ret; ret = sscanf(buf, "%u", &input); if (ret != 1) return -EINVAL; if (input > 100) input = 100; /* * no need to test here if freq_step is zero as th...
false
false
false
false
false
0
HandleCastSpellOpcode(WorldPacket& recvPacket) { uint32 spellId; uint8 cast_count, unk_flags; recvPacket >> cast_count; recvPacket >> spellId; recvPacket >> unk_flags; // flags (if 0x02 - some additional data are received) // ignore for remote control state (for ...
false
false
false
false
false
0
qla4xxx_get_firmware_state(struct scsi_qla_host * ha) { uint32_t mbox_cmd[MBOX_REG_COUNT]; uint32_t mbox_sts[MBOX_REG_COUNT]; /* Get firmware version */ memset(&mbox_cmd, 0, sizeof(mbox_cmd)); memset(&mbox_sts, 0, sizeof(mbox_sts)); mbox_cmd[0] = MBOX_CMD_GET_FW_STATE; if (qla4xxx_mailbox_command(ha, MBOX_REG...
false
false
false
false
false
0
stickynote_change_properties (StickyNote *note) { GdkColor color; GdkColor font_color; char *color_str = NULL; gtk_entry_set_text(GTK_ENTRY(note->w_entry), gtk_label_get_text (GTK_LABEL (note->w_title))); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(note->w_def_color), note->color == NULL); if (note->c...
false
false
false
false
false
0
post_process() { std::list<ast_assign*>::iterator I; for (I = targets.begin(); I != targets.end(); I++) { ast_assign* a = *I; gm_make_it_belong_to_sentblock(a); gm_make_normal_assign(a); } }
false
false
false
false
false
0
mmio_trace_start(struct trace_array *tr) { pr_debug("in %s\n", __func__); mmio_reset_data(tr); }
false
false
false
false
false
0
ap_assistant_prepare (GtkAssistant *assistant, GtkWidget *page, gpointer user_data) { gint currentpage = gtk_assistant_get_current_page(assistant); switch (currentpage) { case 1: /* Current page is Menu page */ ap_assistant_menu_prepare(assistant, user_data); ...
false
false
false
false
false
0
_cupsSNMPCopyOID(int *dst, /* I - Destination OID */ const int *src, /* I - Source OID */ int dstsize) /* I - Number of integers in dst */ { int i; /* Looping var */ DEBUG_printf(("4_cupsSNMPCopyOID(dst=%p, src=%p, dstsize=%d)", dst, src, dstsize)); for (i = 0...
false
false
false
false
false
0
for_each_companion(struct pci_dev *pdev, struct usb_hcd *hcd, companion_fn fn) { struct pci_dev *companion; struct usb_hcd *companion_hcd; unsigned int slot = PCI_SLOT(pdev->devfn); /* * Iterate through other PCI functions in the same slot. * If the function's drvdata isn't set then it isn't bound to * ...
false
false
false
false
false
0
dpf_get_cell_data_func(DirPane *dp, gint column, gpointer *user) { DPFormat *fmt; DpCFmt *col_fmt; fmt = &dp->main->cfg.dp_format[dp->index]; if(column >= fmt->num_columns) return NULL; col_fmt = &fmt->format[column]; switch(col_fmt->content) { case DPC_ATIME: *user = col_fmt->extra.a_time.format; retu...
false
false
false
false
false
0
clearCutItemsCache() { KDirModel* dirModel = m_dirModel.data(); if (!dirModel) { return; } DataChangeObtainer obt(this); KFileItemList previews; // Reset the icons of all items that are stored in the cache // to use their default MIME type icon. foreach (const KUrl& url, m_cutIt...
false
false
false
false
false
0
cdata(B *b, unsigned char *dat, int siz) { P *q = pdup(b->eof); P *r = pdup(b->eof); long byte = q->byte; unsigned char bf[1024]; int x, y; for (x = y = 0; x != siz; ++x) { if (dat[x] == 13 || dat[x] == 0) { ; } else if (dat[x] == 8 || dat[x] == 127) { if (y) { --y; } else { pset(q, r); ...
false
false
false
false
false
0
handle_mpi_start_barrier() { FUNC_NAME; DECLARE_THREAD_ID_STR(thread_id, CUR_INDEX, CUR_THREAD_ID); MPI_CHANGE() pushState(CURRENT, "ST_Thread", thread_id, "STV_MPI_Barrier"); app_ptr comm_id = (app_ptr)GET_PARAM(CUR_EV, 1); struct ezt_mpi_comm *comm = ezt_find_communicator(CUR_INDEX, comm_id); int my_rank...
false
false
false
false
false
0
gsb_file_util_get_contents ( gchar *filename, gchar **file_content, gulong *length ) { gzFile file; struct stat stat_buf; gulong alloc_size; gulong orig_size; gchar *content; gulong iterator = 0; gulong bytes_read; gboolean eof = 0; gchar *os_filename; #ifdef _MSC_V...
false
false
false
false
false
0
operator<< (const cl_MI& x, sintC y) // assume 0 <= y < 2^(intCsize-1) { if (y == 0) return x; if (y == 1) // frequent case return x+x; var const cl_modint_ring& R = x.ring(); // Method: // Algorithm 1: divide (x.rep << y) by m. // asymptotical cost: O(y * log m). // Algorithm 2: x * expt(2 mod ...
false
false
false
false
false
0
__ia_warn(int32 id_num, char *s, ...) { va_list va, va2; if (id_num >= 1700) __arg_terr(__FILE__, __LINE__); /* can suppress any interactive error */ if (__em_suppr(id_num)) return; /* SJM 10/13/99 - ansii std says varargs not usable after vprintf called */ va_start(va, s); va_start(va2, s); __via_warn(id_num...
false
false
false
false
false
0
pixelize_32_inline (const a_pixel *s, int *d) { int y, x, o; for (y = 200 / 32; y; --y) { for (x = 320 / 32; x; --x) { a_pixel t1 = *s; int t; t = t1 | (t1 << 8) | (t1 << 16) | (t1 << 24); for (o = 32 * xbuf / 4; o >= 0; o -= xbuf / 4) { d[o + 0] = t; d[o + 1] = t; d[o + 2] = t; d[o ...
false
false
false
false
false
0
snd_rme9652_create_pcm(struct snd_card *card, struct snd_rme9652 *rme9652) { struct snd_pcm *pcm; int err; if ((err = snd_pcm_new(card, rme9652->card_name, 0, 1, 1, &pcm)) < 0) { return err; } rme9652->pcm = pcm; pcm->private_data = rme9652; strcpy(pcm->name, rme9652->card_name); ...
false
true
false
false
false
1
mcache_put( MCACHE *mp, /* IN: MCACHE cookie */ VOID *page, /* IN: page to put */ int32 flags /* IN: flags = 0, MCACHE_DIRTY */) { CONSTR(FUNC, "mcache_put"); /* for HERROR */ struct _lhqh *lhead = NULL; /* head of an entry in list hash chain */ L_ELEM *lp = NULL; BKT ...
false
false
false
false
false
0
linux_listxattrns (const char *path, char *buf, const size_t buflen, struct hv *flags) { ssize_t slen; ssize_t ret; /* * Get a buffer of nul-delimited "namespace.attribute"s, * then extract the namespaces into buf. */ slen = listxattr(path, buf, 0); if (slen >= 0) { char *sbuf; ...
false
false
false
false
false
0
layout_colors_update(void) { GList *work; work = layout_window_list; while (work) { gint i; LayoutWindow *lw = work->data; work = work->next; if (!lw->image) continue; for (i = 0; i < MAX_SPLIT_IMAGES; i++) { if (!lw->split_images[i]) continue; image_background_set_color_from_options(lw->sp...
false
false
false
false
false
0
wiimod_nunchuk_probe(const struct wiimod_ops *ops, struct wiimote_data *wdata) { int ret, i; wdata->extension.input = input_allocate_device(); if (!wdata->extension.input) return -ENOMEM; input_set_drvdata(wdata->extension.input, wdata); wdata->extension.input->open = wiimod_nunchuk_open; wdata->extension...
false
false
false
false
false
0
yahoo_xfrm( int table, int depth, int seed ) { struct yahoo_fn *xfrm; int i, j, z; unsigned int n = seed; unsigned char *arg; for( i = 0; i < depth; i++ ) { xfrm = &yahoo_fntable[table][n % 96]; switch( xfrm->type ) { case IDENT: return seed; case XOR: ...
false
false
false
false
false
0
make_ftrace(void) { struct trace_call *call; int missing_count = 0, skip_count = 0; int i; printf("# tracer: ftrace\n" "#\n" "# TASK-PID CPU# TIMESTAMP FUNCTION\n" "# | | | | |\n"); for (i = 0, call = call_list; i < call_count; i++, call++) { struct func_...
false
false
false
false
false
0
__mlx4_srq_alloc_icm(struct mlx4_dev *dev, int *srqn) { struct mlx4_srq_table *srq_table = &mlx4_priv(dev)->srq_table; int err; *srqn = mlx4_bitmap_alloc(&srq_table->bitmap); if (*srqn == -1) return -ENOMEM; err = mlx4_table_get(dev, &srq_table->table, *srqn, GFP_KERNEL); if (err) goto err_out; err = mlx...
false
false
false
false
false
0
ltc2978_read_word_data(struct i2c_client *client, int page, int reg) { const struct pmbus_driver_info *info = pmbus_get_driver_info(client); struct ltc2978_data *data = to_ltc2978_data(info); int ret; switch (reg) { case PMBUS_VIRT_READ_VIN_MIN: ret = ltc_get_min(data, client, page, LTC2978_MFR_VIN_MIN, &...
false
false
false
false
false
0
post_status(struct hv_dynmem_device *dm) { struct dm_status status; unsigned long now = jiffies; unsigned long last_post = last_post_time; if (pressure_report_delay > 0) { --pressure_report_delay; return; } if (!time_after(now, (last_post_time + HZ))) return; memset(&status, 0, sizeof(struct dm_status))...
false
false
false
false
false
0
appendLoopOnAppenders(const spi::InternalLoggingEvent& event) const { int count = 0; LOG4CPLUS_BEGIN_SYNCHRONIZE_ON_MUTEX( appender_list_mutex ) for(ListType::const_iterator it=appenderList.begin(); it!=appenderList.end(); ++it) { ++count; (*it)->...
false
false
false
false
false
0
osinfo_tree_create_from_location(const gchar *location, GCancellable *cancellable, GError **error) { CreateFromLocationData *data; OsinfoTree *ret; data = g_slice_new0(CreateFromLocationData); data->main_loop = g_...
false
false
false
false
false
0
notLaurent(Polynomial p) { if(!p.isZero()) { IntegerVector v=p.terms.begin()->first.exponent; for(TermMap::const_iterator i=p.terms.begin();i!=p.terms.end();i++) v=min(v,i->first.exponent); p*=Monomial(p.getRing(),-v); } return p; }
false
false
false
false
false
0
test_set_underflow (void) { mpfr_t x, zero, min; mpfr_ptr r[MPFR_RND_MAX]; int t[MPFR_RND_MAX] = { 1, -1, 1, -1, 1 }; /* RNDN, RNDZ, RNDU, RNDD, RNDA */ int i; int s; mpfr_inits (x, zero, min, (mpfr_ptr) 0); mpfr_set_ui (zero, 0, MPFR_RNDN); mpfr_set_ui (min, 0, MPFR_RNDN); mpfr_nextabove (min); r[...
false
false
false
false
false
0
pp_c_declarator (c_pretty_printer *pp, tree t) { switch (TREE_CODE (t)) { case INTEGER_TYPE: case REAL_TYPE: case FIXED_POINT_TYPE: case ENUMERAL_TYPE: case UNION_TYPE: case RECORD_TYPE: break; case VAR_DECL: case PARM_DECL: case FIELD_DECL: case ARRAY_TYPE: case...
false
false
false
false
false
0
menudisp(MENU *m) { int col; int x; int y; int *s = m->t->t->scrn + m->x + m->y * m->t->t->co; int *a = m->t->t->attr + m->x + m->y * m->t->t->co; struct utf8_sm sm; utf8_init(&sm); if (m->t->t->co != m->saved_co) mconfig(m); for (y = 0; y != m->h; ++y) { col = 0; for (x = 0; x != m->perline && y*m->p...
false
false
false
false
false
0
line_get_ascii_art(struct tt_line *ln, char *buf, size_t *bufsz) { const char *art; size_t len; if (!ln->parent) return buf; buf = line_get_ascii_art(ln->parent, buf, bufsz); if (!buf) return NULL; if (list_last_entry(&ln->ln_children, &ln->parent->ln_branch)) art = " "; else art = ln->table->symbols...
false
false
false
false
false
0
T1eexec(f) /* Initialization */ F_FILE *f; /* Stream descriptor */ { int i; int H; unsigned char *p; int testchar; unsigned char randomP[8]; r = 55665; /* initial key */ asc = 1; /* indicate ASCII form */ #ifdef DEBUG_DECRYPTION printf("T1eexec(1): first 20 bytes=%.20s, b_cnt=%d\n"...
false
false
false
false
true
1
ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid, u32 drv_info) { int ret; /* WMI CMD*/ ret = ath9k_wmi_connect(priv->htc, priv->wmi, &priv->wmi_cmd_ep); if (ret) goto err; /* Beacon */ ret = ath9k_htc_connect_svc(priv, WMI_BEACON_SVC, ath9k_htc_beaconep, &priv->beacon_ep); if (r...
false
false
false
false
false
0
print_match(const struct xt_statistic_info *info, char *prefix) { if (info->flags & XT_STATISTIC_INVERT) printf(" !"); switch (info->mode) { case XT_STATISTIC_MODE_RANDOM: printf( "%smode random %sprobability %f", prefix, prefix, 1.0 * info->u.random.probability / 0x80000000); break; case XT_STATIST...
false
false
false
false
false
0
CKYApplet_GetLifeCycleV2(CKYCardConnection *conn, CKYAppletRespGetLifeCycleV2 *ext, CKYISOStatus *apduRC) { CKYStatus status; status = CKYApplet_HandleAPDU(conn, CKYAppletFactory_GetLifeCycleV2, NULL,NULL, CKY_SIZE_GET_LIFE_CYCLE_V2, ckyAppletFill_GetLifeCycleV2, ext, apduRC); /* Get Li...
false
false
false
false
false
0
errMsg(int err_level, char* str1, char* str2, char* str3, char* str4) { ostrstream strm; strm.unsetf(ios:: skipws); strm << err_level << tclArgSeparator; if (str1 != NULL) strm << str1; if (str2 != NULL) strm << str2; if (str3 != NULL) strm << str3; if (str4 != NULL) strm << str4; strm << ends; sen...
false
false
false
false
false
0
init_uncompress( compress_filter_context_t *zfx, bz_stream *bzs ) { int rc; if((rc=BZ2_bzDecompressInit(bzs,0,opt.bz2_decompress_lowmem))!=BZ_OK) log_fatal("bz2lib problem: %d\n",rc); zfx->inbufsize = 2048; zfx->inbuf = xmalloc( zfx->inbufsize ); bzs->avail_in = 0; }
false
false
false
false
false
0
IReadBlock( int nBlockXOff, int nBlockYOff, void * pImage ) { int nPixelSize = GDALGetDataTypeSize(eDataType)/8; int nReadXSize, nReadYSize; if( (nBlockXOff+1) * nBlockXSize > GetXSize() ) nReadXSize = GetXSize() - nBlockXOff * nBlockXSize; else nRead...
false
false
false
false
false
0
train_unit(int skillId, int raceId, short destX, short destY, int& trainTownRecno, int actionId) { //----- locate the best town for training the unit -----// int i; Town *townPtr; int curDist, curRating, bestRating=0; int destRegionId = world.get_loc(destX, destY)->region_id; trainTownRecno = 0; for(i=...
false
false
false
false
false
0