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
gt_spmlist_parse_unit_test(GtError *err) { int had_err = 0; gt_error_check(err); had_err = parse_plusminus_unit_test(err); if (!had_err) had_err = parse_line_unit_test(err); return had_err; }
false
false
false
false
false
0
func_1(char *str, int len) { int i; char tmp; i = -1; while (++i < len / 2) { tmp = str[i]; str[i] = str[len - i - 1]; str[len - i - 1] = tmp; } }
false
false
false
false
false
0
ctrl_hup_sighandler(int sig) { int fd; gothup = 1; printlog(LOG_ERROR, "Configuration changed, restarting...\n"); /* Reopen the log file */ checklog("/var/log/iaxmodem/iaxmodem"); fd = open("/var/log/iaxmodem/iaxmodem", O_WRONLY | O_APPEND | O_CREAT | O_LARGEFILE, logmode); if (fd < 0) { ...
false
false
false
false
true
1
get_entry_point( int ep_name, caddr_t *ep_addr ) { int rc = 0; if(sep!=NULL) { switch ( ep_name ) { case ENTRY_POINT_PS_WAKEUP_ALL: *ep_addr = sep->sep_ps_wakeup_all; break; case ENTRY_POINT_PS_SERVICE: *ep_addr = sep->sep_ps_service; break; ...
false
false
false
false
false
0
onChgEntry(FXObject*,FXSelector,void*){ register FXdouble value=FXDoubleVal(textField->getText()); if(value<range[0]) value=range[0]; if(value>range[1]) value=range[1]; if(value!=pos){ pos=value; if(target) target->tryHandle(this,FXSEL(SEL_CHANGED,message),(void*)&pos); } return 1; }
false
false
false
false
false
0
isInUse() const { Q_D(const StorageDrive); Predicate p(DeviceInterface::StorageAccess); QList<Device> devices = Device::listFromQuery(p, d->devicePrivate()->udi()); bool inUse = false; foreach (const Device &dev, devices) { if (dev.is<Solid::StorageAccess>()) { const Solid::Stor...
false
false
false
false
false
0
ClampSingleCredit( REAL & credit ) { credit = credit > se_lagCreditSingle ? se_lagCreditSingle : credit; credit = credit > se_lagCreditVarianceCache ? se_lagCreditVarianceCache : credit; }
false
false
false
false
false
0
zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC) /* {{{ */ { long fetch_class_op_number; zend_op *opline; if (class_name->op_type == IS_CONST && Z_TYPE(class_name->u.constant) == IS_STRING && Z_STRLEN(class_name->u.constant) == 0) { /* Usage of namespace as class name not in namespace */ ...
false
false
false
false
false
0
u32_writer(struct driver_data *drv_data) { if (pxa2xx_spi_txfifo_full(drv_data) || (drv_data->tx == drv_data->tx_end)) return 0; pxa2xx_spi_write(drv_data, SSDR, *(u32 *)(drv_data->tx)); drv_data->tx += 4; return 1; }
false
false
false
false
false
0
parseModifiers(s, modp, chkmodp) String s; long *modp; /* RETURN: modifiers which must be set */ long *chkmodp; /* RETURN: modifiers to be checked */ { String p; int i; int c; static struct _moddesc_ { String modname; /* modifier name */ long modmask; /* modifier mask */ } mods[] = { { "Shift...
false
false
false
false
false
0
jedi_table_init() { int step, nib; for (step = 0; step < 49; step++) { for (nib = 0; nib < 16; nib++) { int value = (2 * (nib & 0x07) + 1) * step_size[step] / 8; jedi_table[step * 16 + nib] = ((nib & 0x08) != 0) ? -value : value; } } }
false
false
false
false
false
0
qh_tracemerging (const char *string) { realT cpu; time_t timedata; struct tm *tp; if (qh REPORTfreq && (zzval_(Ztotmerge) > qh mergereport+qh REPORTfreq/2)) { qh mergereport= zzval_(Ztotmerge); time (&timedata); tp= localtime (&timedata); cpu= clock(); cpu /= qh_SECticks; zinc_(Zdistio)...
false
false
false
false
false
0
test_index_reuc__write(void) { git_oid ancestor_oid, our_oid, their_oid; const git_index_reuc_entry *reuc; git_index_clear(repo_index); /* Write out of order to ensure sorting is correct */ git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID); git_oid_fromstr(&our_oid, TWO_OUR_OID); git_oid_fromstr(&their_oid, TWO...
false
false
false
true
false
1
Ins_WS( INS_ARG ) { if ( BOUNDS( args[0], CUR.storeSize ) ) { CUR.error = TT_Err_Invalid_Reference; return; } CUR.storage[args[0]] = args[1]; }
false
false
false
false
false
0
checkIfStm2( Absyn *node, Table **fileTable, Table *localTable, Class *actClass, Table *classTable, Table *globalTable, boolean breakAllowed, Type *returnType, int pass) { Absyn *test = node->u.ifStm1.test; Absyn *thenPart = node->u.ifStm2...
false
false
false
false
false
0
anno_db_gfflike_create_indexes_sqlite(GtRDBSqlite *db, GtError *err) { int had_err = 0; GtRDBStmt *stmt; gt_assert(db); stmt = gt_rdb_prepare((GtRDB*) db, "CREATE INDEX IF NOT EXISTS feature_all " "ON features (id, start, end, seqid, source, type)", ...
false
false
false
false
false
0
ReadPoints(void *buffer) { // Get gifti image pointer m_GiftiImage = gifti_read_image(this->GetFileName(), true); // Whter reading is successful if ( m_GiftiImage == ITK_NULLPTR ) { itkExceptionMacro(<< this->GetFileName() << " is not recognized as a GIFTI file"); } // Number of data array con...
false
false
false
false
false
0
outputline(void) { char linnum[10]; register int i; lastoffset = 0; if (linenumber==0) return; /* special pour les include.. */ if (lineprefix) { sprintf(linnum," "); i=5-macrolevel; if ( i<0 ) i=0; if ( i>4 ) i=4; linnum[i] = lineprefix; } else sprintf( linnum,"%5d",linenumber ); p...
false
false
false
false
false
0
read_initial_file_list(vector<string>& files) { char buf[256]; FILE* f = fopen("initial_file_list", "r"); if (!f) return; while (fgets(buf, sizeof(buf), f)) { strip_whitespace(buf); files.push_back(string(buf)); } fclose(f); }
false
false
false
false
false
0
pbm_getln(FILE *f, char *b) { int i; char c; // Read the next significant line (non-comment) from f into buffer b do { // Read the next line i = 0; do { fscanf (f, "%c", &c); b[i++] = c; if (c == '\n') b[i] = '\0'; } while (c != '\n'); } while (b[0]=='\n'...
false
false
false
false
false
0
construct(const char *new_name) { gcycles = &get_cycles(); I2CMaster *pI2CMaster = new I2CMaster(new_name); pI2CMaster->create_iopin_map(); return pI2CMaster; }
false
false
false
false
false
0
command_line(int argc,char **argv) { std::string command = ""; for(int i=0;i<argc;i++){ if(i>0) command += " "; command += argv[i]; } return command; }
false
false
false
false
false
0
do_servo() { #ifndef __NO_SERVO__ int i, j, rc; double residual, integral, derivative, output, saturation; rc = pthread_rwlock_rdlock(&params_rwlock); handle_errmsg("pthread_rwlock_rdlock()\n", rc); for (i = 0; i < num_servo; i++) { do_servo_filter(i); residual = param...
false
false
false
false
false
0
mx_path_bar_button_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { MxPathBarButtonPrivate *priv = MX_PATH_BAR_BUTTON (object)->priv; switch (property_id) ...
false
false
false
false
false
0
operator=(const char* c) { const char* s2 = c; n = 0; while (*s2++ != 0) ++n; char* old_S = S; S = new char [n+1]; if (!S) Throw(Bad_alloc()); char* s1 = S; s2 = c; unsigned int i = n+1; while (i--) *s1++ = *s2++; delete [] old_S; }
false
false
false
false
false
0
passwd_callback(char *buf, int num, int encrypting #ifdef HAVE_USERDATA_IN_PWD_CALLBACK /* This was introduced in 0.9.4, we can set this using SSL_CTX_set_default_passwd_cb_userdata() */ , void *global_pass...
false
true
false
false
false
1
rcFilterLedgeSpans(rcContext* ctx, const int walkableHeight, const int walkableClimb, rcHeightfield& solid) { rcAssert(ctx); ctx->startTimer(RC_TIMER_FILTER_BORDER); const int w = solid.width; const int h = solid.height; const int MAX_HEIGHT = 0xffff; // Mark b...
false
false
false
false
true
1
scan_for_rsdp(uintptr_t addr, uint32_t length) { rsdp_t *rp; uintptr_t end = addr + length; while ((uintptr_t)addr < end) { rp = (rsdp_t*)addr; if (*(unsigned int *)addr == RSDPSignature && checksum((unsigned char*)addr, rp->length) == 0) { return rp; } addr += 4; } retur...
false
false
false
false
false
0
btt_fini(struct btt *btt) { if (btt) { btt_blk_cleanup(btt); free_arenas(btt); debugfs_remove_recursive(btt->debugfs_dir); kfree(btt); } }
false
false
false
false
false
0
wm_window_at( CoreWindowStack *stack, void *wm_data, void *stack_data, int x, int y, CoreWindow **ret_window ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSE...
false
false
false
false
false
0
DetachPlugin( PluginInterface2 *plugin ) { if (plugin==0) return; unsigned int index; bool isNotThreadsafe = plugin->UsesReliabilityLayer(); if (isNotThreadsafe) { index = pluginListNTS.GetIndexOf(plugin); if (index!=MAX_UNSIGNED_LONG) { // Unordered list so delete from end for speed ...
false
false
false
false
false
0
bpx_finput(FILE *fp,PERM *px) #endif { unsigned int i,j,size,entry,ok; int io_code; /* get size of permutation */ skipjunk(fp); if ((io_code=fscanf(fp," Permutation: size:%u",&size)) < 1 || size>MAXDIM ) error(io_code==EOF ? 7 : 6,"bpx_finput"); /* allocate mem...
false
false
false
false
false
0
operation_emit_status_cb (StatusNode *node) { StatusNode *head_node; gboolean emit_status; LOCK (); node->source_id = 0; /* Check if we've been preempted by another StatusNode, * or if we've been cancelled and popped off the stack. */ head_node = g_queue_peek_head (&node->operation->priv->status_stack); emi...
false
false
false
false
false
0
e2_fs_get_perm_string (mode_t mode) { //inspiration here from David Jensen gunichar thisperms[11]; //once-only, get a local copy of processed strings, to eliminate repeated [de]allocations if (realperms[0] == 0) { //NOTE for translators - this string has single-letters indicating // read write execute permiss...
false
false
false
false
false
0
can_follow_write_pte(pte_t pte, unsigned int flags) { return pte_write(pte) || ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte)); }
false
false
false
false
false
0
integral_init4v( uint16_t *sum8, uint16_t *sum4, int stride ) { for( int x = 0; x < stride-8; x++ ) sum4[x] = sum8[x+4*stride] - sum8[x]; for( int x = 0; x < stride-8; x++ ) sum8[x] = sum8[x+8*stride] + sum8[x+8*stride+4] - sum8[x] - sum8[x+4]; }
false
false
false
false
false
0
handleRootKeyDown(const CEGUI::EventArgs& args) { using namespace CEGUI; const KeyEventArgs& keyArgs = static_cast<const KeyEventArgs&>(args); switch (keyArgs.scancode) { case Key::F12: d_console->toggleVisibility(); break; default: return false; } return true...
false
false
false
false
false
0
sanitize_gasmix(gasmix_t *mix) { unsigned int o2, he; o2 = mix->o2.permille; he = mix->he.permille; /* Regular air: leave empty */ if (!he) { if (!o2) return; /* 20.9% or 21% O2 is just air */ if (o2 >= 209 && o2 <= 210) { mix->o2.permille = 0; return; } } /* Sane mix? */ if (o2 <= 1000 && h...
false
false
false
false
false
0
handleBackspace(void) { if (!isReadOnly()) { String tmp(getText()); if (getSelectionLength() != 0) { tmp.erase(getSelectionStartIndex(), getSelectionLength()); if (isStringValid(tmp)) { // erase selection using mode that does not modi...
false
false
false
false
false
0
complex_from_string (complex_t *dst, char const *src, char *imunit) { gnm_float x, y; char *end; int sign; EAT_SPACES (src); HANDLE_SIGN (src, sign); /* Case: "i", "+i", "-i", ... */ if (*src == 'i' || *src == 'j') { x = 1; } else { x = gnm_strto (src, &end); if (src == end || errno == ERANGE) retur...
false
false
false
false
false
0
show(K a) { printAtDepth(0,a,0,0,0,0); if(a && a->t!=6)O("\n"); if(!a)oerr(); R a; }
false
false
false
false
false
0
e_desk_prev(E_Zone *zone) { int x, y; E_OBJECT_CHECK(zone); E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); if ((zone->desk_x_count < 2) && (zone->desk_y_count < 2)) return; x = zone->desk_x_current; y = zone->desk_y_current; x--; if (x < 0) { x = zone->desk_x_count - 1; y-...
false
false
false
false
false
0
ssd_do_swlog(struct ssd_device *dev) { struct ssd_log_entry le; int ret = 0; memset(&le, 0, sizeof(struct ssd_log_entry)); while (!sfifo_get(&dev->log_fifo, &le)) { ret = ssd_save_swlog(dev, le.event, le.data.val); if (ret) { break; } } return ret; }
false
false
false
false
false
0
setName(StringRef Name) { if (Name == getName()) return; StringMap<StructType *> &SymbolTable = getContext().pImpl->NamedStructTypes; typedef StringMap<StructType *>::MapEntryTy EntryTy; // If this struct already had a name, remove its symbol table entry. Don't // delete the data yet because it may be part ...
false
false
false
false
false
0
scaleCopies(int iPart, const Event& refEvent, double rho) { // Check if any parton recently rescaled is found unchanged: // Same charge, colours in mother->state if ( mother ) { for( int i=0; i < mother->state.size(); ++i) { if ( ( mother->state[i].id() == refEvent[iPart].id() && mot...
false
false
false
false
false
0
gkm_session_C_DeriveKey (GkmSession* self, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { GkmObject *base = NULL; GkmObject *derived = NULL; CK_RV rv; g_return_val_if_fail (GKM_IS_SESSIO...
false
false
false
false
false
0
nfs3_alloc_createdata(void) { struct nfs3_createdata *data; data = kzalloc(sizeof(*data), GFP_KERNEL); if (data != NULL) { data->msg.rpc_argp = &data->arg; data->msg.rpc_resp = &data->res; data->res.fh = &data->fh; data->res.fattr = &data->fattr; data->res.dir_attr = &data->dir_attr; nfs_fattr_init(data...
false
false
false
false
false
0
validate_for(node *tree) { int nch = NCH(tree); int res = (validate_ntype(tree, for_stmt) && ((nch == 6) || (nch == 9)) && validate_name(CHILD(tree, 0), "for") && validate_exprlist(CHILD(tree, 1)) && validate_name(CHILD(tree, 2), "in") &...
false
false
false
false
false
0
queued_subexp_p (rtx x) { enum rtx_code code = GET_CODE (x); switch (code) { case QUEUED: return 1; case MEM: return queued_subexp_p (XEXP (x, 0)); case MULT: case PLUS: case MINUS: return (queued_subexp_p (XEXP (x, 0)) || queued_subexp_p (XEXP (x, 1))); default:...
false
false
false
false
false
0
tracer_alloc_buffers(void) { int ring_buf_size; int ret = -ENOMEM; /* * Make sure we don't accidently add more trace options * than we have bits for. */ BUILD_BUG_ON(TRACE_ITER_LAST_BIT > TRACE_FLAGS_MAX_SIZE); if (!alloc_cpumask_var(&tracing_buffer_mask, GFP_KERNEL)) goto out; if (!alloc_cpumask_var(&...
false
false
false
false
false
0
checkout_conflicts_load(checkout_data *data, git_iterator *workdir, git_vector *pathspec) { git_index_conflict_iterator *iterator = NULL; git_index *index; const git_index_entry *ancestor, *ours, *theirs; checkout_conflictdata *conflict; int error = 0; /* Only write conficts from sources that have them: indexes....
false
false
false
false
false
0
subst (const string& model, const string& a0, const string& a1, const string& a2) { vector<string> args(10); args[0] = a0; args[1] = a1; args[2] = a2; return substitution (model, args); }
false
false
false
false
false
0
dev_close_2 (TrapContext *context) { uae_u32 request = m68k_areg (regs, 1); struct priv_devstruct *pdev = getpdevstruct (request); struct devstruct *dev; if (!pdev) return 0; dev = getdevstruct (pdev->unit); if (log_scsi) write_log (_T("%s:%d close, req=%08X\n"), getdevname (pdev->type), pdev->unit, request)...
false
false
false
false
false
0
_writePoint_GCIO ( FILE* h, const char* quotes, char delim, double x, double y, double z, GCDim dim, ...
false
false
false
false
false
0
proc_started() { emit q->debug("Process started"); // Note: we don't close these here anymore. instead we // do it just after calling proc->start(). // close these, we don't need them /*pipeAux.readEnd().close(); pipeCommand.readEnd().close(); pipeStatus.writeEnd().close();*/ // do the pre* stuff ...
false
false
false
false
false
0
updateForeground(unsigned long) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A a = (model()!=0)?((AplusModel*)model())->a():0; AColorFunction *fgFunc=AplusModel::getFgFunc(v); if (fgFunc!=0) foreground(fgFunc->invoke(v,a)); }
false
false
false
false
false
0
xmlGzfileOpen_real (const char *filename) { const char *path = NULL; gzFile fd; if (!strcmp(filename, "-")) { fd = gzdopen(dup(0), "rb"); return((void *) fd); } if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) #if defined (_WIN32) || defined (__DJGPP__) && ...
false
false
false
false
false
0
visitZExtInst(ZExtInst &I) { // Get the source and destination types Type *SrcTy = I.getOperand(0)->getType(); Type *DestTy = I.getType(); // Get the size of the types in bits, we'll need this later Assert1(SrcTy->isIntOrIntVectorTy(), "ZExt only operates on integer", &I); Assert1(DestTy->isIntOrIntVectorT...
false
false
false
false
false
0
text_search_range_forward(Text *txt, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags) { char *buf = malloc(len + 1); if (!buf) return REG_NOMATCH; len = text_bytes_get(txt, pos, len, buf); buf[len] = '\0'; regmatch_t match[nmatch]; int ret = regexec(&r->regex, buf, nmatch, match...
false
false
false
false
false
0
DrawTitles_ (RuntimeS *runtimeSP, GUIS *guiSP) { int titles_drawnN = 0; int titleI; char *curr_titleP; int curr_title_length; int screen_x, screen_y; /* Prepare the text color: */ XSetForeground (guiSP->displaySP, guiSP->theGCA[0], guiSP->main_winS.fg_colorID); /* Scan the set of titles: */ for (titleI = 0; ti...
false
false
false
false
false
0
elf_link_output_sym (struct elf_final_link_info *flinfo, const char *name, Elf_Internal_Sym *elfsym, asection *input_sec, struct elf_link_hash_entry *h) { bfd_byte *dest; Elf_External_Sym_Shndx *destshndx; int (*output_symbol_hook) (struct bfd_link_info *, const char *, Elf_Interna...
false
false
false
false
false
0
instance() throw () { if (! _instance) _instance = new Logger(); return _instance; }
false
false
false
false
false
0
ConfigDisplay(void) { txt_window_t *window; txt_table_t *modes_table; txt_separator_t *modes_separator; txt_table_t *bpp_table; txt_window_action_t *advanced_button; txt_checkbox_t *fs_checkbox; int i; int num_columns; int num_rows; int window_y; // What color depths are sup...
false
false
false
false
false
0
qstat_stdout_queue_suspend_alarm(qstat_handler_t* handler, const char* qname, const char* reason, lList **alpp) { DENTER(TOP_LAYER, "qstat_stdout_queue_suspend_alarm"); printf("\t"); printf(reason); printf("\n"); DEXIT; return 0; }
false
false
false
false
false
0
unqlite_kv_cursor_seek(unqlite_kv_cursor *pCursor,const void *pKey,int nKeyLen,int iPos) { int rc = UNQLITE_OK; #ifdef UNTRUST if( pCursor == 0 ){ return UNQLITE_CORRUPT; } #endif if( nKeyLen < 0 ){ /* Assume a null terminated string and compute it's length */ nKeyLen = SyStrlen((const char *)pKey); } if( !...
false
false
false
false
false
0
ShmemAlloc(Size size) { Size newStart; Size newFree; void *newSpace; /* use volatile pointer to prevent code rearrangement */ volatile PGShmemHeader *shmemseghdr = ShmemSegHdr; /* * ensure all space is adequately aligned. */ size = MAXALIGN(size); Assert(shmemseghdr != NULL); SpinLockAcquire(Shmem...
false
false
false
false
false
0
cddb_disc_set_genre(cddb_disc_t *disc, const char *genre) { if (disc) { FREE_NOT_NULL(disc->genre); disc->genre = strdup(genre); } }
false
false
false
false
false
0
csio_scan_done(struct csio_lnode *ln, unsigned long ticks, unsigned long time, unsigned long max_scan_ticks, unsigned long delta_scan_ticks) { int rv = 0; if (time >= max_scan_ticks) return 1; if (!ln->tgt_scan_tick) ln->tgt_scan_tick = ticks; if (((ticks - ln->tgt_scan_tick) >= delta_scan_ticks)) { if...
false
false
false
false
false
0
Java_ncsa_hdf_hdflib_HDFLibrary_SDgetcal ( JNIEnv *env, jclass clss, jint sdsid, jdoubleArray argv, /* OUT: Cal, Cal_err, Offset, Offset_err */ jintArray nt) /* OUT: NT */ { int32 retVal; jdouble *theArgs; jint *theNT; jboolean bb; theArgs = ENVPTR->GetDoubleArrayElements(ENVPAR argv,&bb); t...
false
false
false
false
false
0
Create( const char * pszName, int nXSize, int nYSize, int nBands, GDALDataType eType, char ** papszOptions ) { VRTDataset *poDS = NULL; int iBand = 0; (void) papszOptions; if( EQUALN(pszName,"<VRTDataset",11) ) { GDALDataset *poDS = OpenXML( ...
false
false
false
false
false
0
OnEditAutoComplete(cb_unused wxCommandEvent& event) { cbEditor* editor = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor(); cbStyledTextCtrl* control = editor->GetControl(); const AutoCompleteMap& acm = *GetCurrentACMap(editor); int curPos = control->GetCurrentPos(); int startPos = cont...
false
false
false
false
false
0
asus_hwmon_agfn_fan_speed_read(struct asus_wmi *asus, int fan, int *speed) { struct fan_args args = { .agfn.len = sizeof(args), .agfn.mfun = ASUS_FAN_MFUN, .agfn.sfun = ASUS_FAN_SFUN_READ, .fan = fan, .speed = 0, }; struct acpi_buffer input = { (acpi_size) sizeof(args), &args }; int status; if (f...
false
false
false
false
false
0
fotg210_hcd_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct usb_hcd *hcd; struct resource *res; int irq; int retval = -ENODEV; struct fotg210_hcd *fotg210; if (usb_disabled()) return -ENODEV; pdev->dev.power.power_state = PMSG_ON; res = platform_get_resource(pdev, IORESOURCE_...
false
false
false
false
false
0
jacobi_aux (uintV a, uintV b) { var int v = 1; for (;;) { // (a/b) * v is invariant. if (b == 1) // b=1 implies (a/b) = 1. return v; if (a == 0) // b>1 and a=0 imply (a/b) = 0. return 0; if (a > (b >> 1)) { // a > b/2, so (a/b) = (-1/b) * ((b-a)/b), // and (-1/b) = -1 if b==3 mod 4. a = b...
false
false
false
false
false
0
inlineBlockWrappedOpcode(MethodBlock *mb, Instruction *pc) { PrepareInfo *prepare_info = pc->operand.pntr; OpcodeInfo *info; int i; Thread *self = threadSelf(); rewriteLock(self); for(i = 0; i < HANDLERS; i++) if(pc->handler == handler_entry_points[i][OPC_INLINE_REWRITER]) ...
false
false
false
false
false
0
__Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "Cython/Plex/Scanners.py":156 * self.next_char() * if self.cur_char is None or self.cur_char is EOF: * return (u'', None) ...
false
false
false
false
false
0
asJulianNumber(MSMonth month_,MSDay day_,MSYear year_) { unsigned long c,ya; if (year_<=99) year_+=year_<=MS_PIVOT_YEAR?2000:1900; if (dayWithinMonth(month_,day_,year_)==MSFalse) return MSJulian(0); if (month_>2) month_-=3; else { month_+=9; year_--; } c=year_/100; ya=year_-100*c; return ((146097*c)>>2...
false
false
false
false
false
0
SparseMatrix_has_diagonal(SparseMatrix A){ int i, j, m = A->m, *ia = A->ia, *ja = A->ja; for (i = 0; i < m; i++){ for (j = ia[i]; j < ia[i+1]; j++){ if (i == ja[j]) return TRUE; } } return FALSE; }
false
false
false
false
false
0
nautilus_view_restore_default_zoom_level (NautilusView *view) { g_return_if_fail (NAUTILUS_IS_VIEW (view)); if (!nautilus_view_supports_zooming (view)) { return; } NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->restore_default_zoom_level (view); }
false
false
false
false
false
0
remove_unnecessary_send_recv_of_all_dtu_trans(Scheduling_info *sche, Scheduling_info *top_sche) { proc_kind proc; int pc_no, pc_num; int no_in_pc; Sche_task ****tmp, ****sche_task_array; Sche_task ***array_dtu; sche_task_array = scheduling_info_get_...
false
false
false
false
false
0
tg3_4g_tso_overflow_test(struct tg3 *tp, dma_addr_t mapping, u32 len, u32 mss) { if (tg3_asic_rev(tp) == ASIC_REV_5762 && mss) { u32 base = (u32) mapping & 0xffffffff; return ((base + len + (mss & 0x3fff)) < base); } return 0; }
false
false
false
false
false
0
_ldapfull_user_exists(authreg_t ar, char *username, char *realm) { char *dn; if (_ldapfull_find_user_dn((moddata_t) ar->private, username, realm, &dn)) { ldap_memfree(dn); return 1; } return 0; }
false
false
false
false
false
0
gst_buffer_unmap (GstBuffer * buffer, GstMapInfo * info) { g_return_if_fail (GST_IS_BUFFER (buffer)); g_return_if_fail (info != NULL); /* we need to check for NULL, it is possible that we tried to map a buffer * without memory and we should be able to unmap that fine */ if (G_LIKELY (info->memory)) { gs...
false
false
false
false
false
0
wait_phy_eeprom_ready(struct usbnet *dev, int phy) { int i; for (i = 0; i < SR_SHARE_TIMEOUT; i++) { u8 tmp = 0; int ret; udelay(1); ret = sr_read_reg(dev, SR_EPCR, &tmp); if (ret < 0) return ret; /* ready */ if (!(tmp & EPCR_ERRE)) return 0; } netdev_err(dev->net, "%s write timed out!\n", p...
false
false
false
false
false
0
finish(HashType ht, Ctx & ctx, unsigned char * hash) { if (ht == htMD5) MD5_Final(hash, &ctx.md5); else if (ht == htSHA1) SHA1_Final(hash, &ctx.sha1); else if (ht == htSHA256) SHA256_Final(hash, &ctx.sha256); }
false
false
false
false
false
0
vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, int __user *argp) { struct vhost_vring_state s = { .index = idx, .num = vq->user_be }; if (copy_to_user(argp, &s, sizeof(s))) return -EFAULT; return 0; }
false
false
false
false
false
0
at76_set_card_command(struct usb_device *udev, u8 cmd, void *buf, int buf_size) { int ret; struct at76_command *cmd_buf = kmalloc(sizeof(struct at76_command) + buf_size, GFP_KERNEL); if (!cmd_buf) return -ENOMEM; cmd_buf->cmd = cmd; cmd_buf->reserved = 0; cmd_buf->size = cpu_to_le16(buf_size)...
false
false
false
false
false
0
read_device (const char *str) { char *p; size_t size; uintmax_t n; size_t status; n = size = strtoumax (str, &p, 10); if (*p) { rmt_error_message (EINVAL, N_("Invalid byte count")); return; } if (n != size || errno == ERANGE) { rmt_error_message (EINVAL, N_("Byte count ...
false
false
false
false
false
0
safe_append(struct outgoing *o, time_t now, char *s) { FILE *f; struct utimbuf tbuf = { .actime = now, .modtime = now + o->retrytime }; ast_debug(1, "Outgoing %s/%s: %s\n", o->tech, o->dest, s); if ((f = fopen(o->fn, "a"))) { fprintf(f, "\n%s: %ld %d (%ld)\n", s, (long)ast_mainpid, o->retries, (long) now); fc...
false
false
false
false
true
1
create_playlist_liststore() { GtkListStore *liststore; GtkTreeViewColumn *column; GtkCellRenderer *rend; GtkWidget *tv; if(glurp->gui_playlist) return; liststore = gtk_list_store_new( NUM_PL, G_TYPE_INT, G_TYPE_STRING, /* title */ G_TYPE_STRING, /* time */ G_TYPE_...
false
false
false
false
false
0
blogic_diskparam(struct scsi_device *sdev, struct block_device *dev, sector_t capacity, int *params) { struct blogic_adapter *adapter = (struct blogic_adapter *) sdev->host->hostdata; struct bios_diskparam *diskparam = (struct bios_diskparam *) params; unsigned char *buf; if (adapter->ext_trans_enable && cap...
false
false
false
false
false
0
movesAvailable() const { Sea::Player opp = Sea::opponent(m_player); for (int i = 0; i < m_sea->size().x; i++) for (int j = 0; j < m_sea->size().y; j++) { if ((j - i - m_offset) % m_gap == 0 && m_sea->at(opp, Coord(i,j)).free()) { return true; ...
false
false
false
false
false
0
recogMapIndexToIndex(L_RECOG *recog1, L_RECOG *recog2) { char *charstr; l_int32 index1, index2, n1; l_int32 *lut; PROCNAME("recogMapIndexToIndex"); if (!recog1 || !recog2) return (l_int32 *)ERROR_PTR("recog1 and recog2 not both defined", ...
false
false
false
false
false
0
ges_track_element_split_bindings (GESTrackElement * element, GESTrackElement * new_element, guint64 position) { GParamSpec **specs; guint n, n_specs; GstControlBinding *binding; GstTimedValueControlSource *source, *new_source; specs = ges_track_element_list_children_properties (GES_TRACK_ELEMENT (e...
false
false
false
false
false
0
initialise() { if (!ifAddresses.empty()) return; #if defined(__vxWorks__) vxworks_get_ifinfo(ifAddresses); #elif defined(HAVE_IFADDRS_H) ifaddrs_get_ifinfo(ifAddresses); #elif defined(UnixArchitecture) unix_get_ifinfo(ifAddresses); #elif defined(NTArchitecture) win32_get_ifinfo(ifAddresses); #endif if (...
false
false
false
false
false
0
resolve(string& str) const { if (str.find(mFmt) == string::npos) return; string::size_type p; string var0(1, mFmt); string var1(1, mFmt); var0 += mVar; var1 += "{" + mVar + "}"; for (p = 0; (p = str.find(var0, p)) != string::npos; ) str.replace(p, var0.size(), mVal); for (p = 0; (p = str.find(var1, p))...
false
false
false
false
false
0
__lambda28_ (Desktop* self) { guint _tmp0_ = 0U; _tmp0_ = self->priv->idle_rebuild_id; if (_tmp0_ == ((guint) 0)) { guint _tmp1_ = 0U; _tmp1_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda29__gsource_func, g_object_ref (self), g_object_unref); self->priv->idle_rebuild_id = _tmp1_; } }
false
false
false
false
false
0
execute(void) { struct _Address Destination; unsigned long Result, SValue, DValue; SUBQ_Instr Instr; Memory_RetrWordFromPC(&Instr.Code); /* Instr.Data is the immedate data, 1-7 represents 1-7, 0 represents 8 */ TRACE("Source: (Retrieving from instruction word) = 0x%02x where (0=8)\n", Instr.Bits.Data); SVal...
false
false
false
false
false
0
mfs_load_timer_field(MfsErlDrvData* dataP, char* text) { mfs_ensure_term_spec(dataP, 2); /* OTP-4236 */ if (text == NULL) { ASSIGN_TERM_SPEC(dataP, ERL_DRV_ATOM); ASSIGN_TERM_SPEC(dataP, mfs_asn1_NOVALUE); } else { ASSIGN_TERM_SPEC(dataP, ERL_DRV_INT); ASSIGN_TERM_SPEC(dataP, ((text[0] - '0') *...
false
false
false
false
false
0
handle_write_stream ( const ACE_Asynch_Write_Stream::Result &result) { ACE_MT (ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_)); this->bio_out_flag_ &= ~BF_AIO; ACE_Message_Block & mb = result.message_block (); size_t bytes_req = result.bytes_to_write (); size_t bytes_trn = result.bytes_transferred ()...
false
false
false
false
false
0