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
fuse_opt_free_args(struct fuse_args *args) { if (args && args->argv && args->allocated) { int i; for (i = 0; i < args->argc; i++) free(args->argv[i]); free(args->argv); args->argv = NULL; args->allocated = 0; } }
false
false
false
false
false
0
rosGetValue( void ) { static wxString osValue; float f1; osValue.Empty( ); // Has the control been created? if( ! bIsCreated( ) ) return( osValue ); // Test the spin control value f1 = m_oSpnValue.fGetValue( ); if( f1 == -FLT_MAX ) return( osValue ); // Combine the spin control value with any...
false
false
false
false
false
0
getAsPose3DForcingOrigin(const TPoint3D &newOrigin,mrpt::poses::CPose3D &pose) { if (!contains(newOrigin)) throw std::logic_error("Base point is not in the plane."); double normal[3]; getUnitaryNormalVector(normal); CMatrixDouble AXIS; generateAxisBaseFromDirectionAndAxis(normal,2,AXIS); AXIS.set_unsafe(3,3,1); ...
false
false
false
false
false
0
gw_prioqueue_consume(gw_prioqueue_t *queue) { void *ret; gw_assert(queue != NULL); queue_lock(queue); while (queue->len == 1 && queue->producers > 0) { queue->mutex->owner = -1; pthread_cond_wait(&queue->nonempty, &queue->mutex->mutex); queue->mutex->owner = gwthread_self()...
false
false
false
false
false
0
afr_mkdir_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { afr_local_t *local = NULL; ...
false
false
false
false
false
0
bonobo_dock_item_float_window_button_changed (GtkWidget *widget, GdkEventButton *event, gpointer data) { BonoboDockItem *di; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); di = BONOBO_DOCK_ITEM (data); if (!BONOBO_DOCK_ITEM_NOT_LOCKED(di)) ...
false
false
false
false
false
0
dwarf_add_AT_string(Dwarf_P_Debug dbg, Dwarf_P_Die ownerdie, Dwarf_Half attr, char *string, Dwarf_Error * error) { Dwarf_P_Attribute new_attr; if (dbg == NULL) { _dwarf_p_error(NULL, error, DW_DLE_DBG_NULL); return ((Dwarf_P_Attribute) DW_DLV_BADADDR); } if (ownerdie == NULL) {...
false
true
false
false
false
1
tp_base_connection_inspect_handles (TpSvcConnection *iface, guint handle_type, const GArray *handles, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); TpBaseConnectionPri...
false
false
false
false
false
0
cycleColors(A colors_) { if ((colors_->t==It&&colors_->r<=1)||(colors_->t==Et&&colors_->n==0)) { removeAllCycles(); if (_cycleColors!=0) dc(_cycleColors); _cycleColors=(A)ic(colors_); } }
false
false
false
false
false
0
launch_gfmgui(void) { GladeXML *xml; GtkWidget *widget; // Load the GFM Dialog from gfm.glade xml = glade_xml_new(paths_build_glade("gfm.glade"), "gfm_dbox", NULL); // Glade File Error if (!xml) g_error("Failure GFM GUI (%s)!\n", __FILE__); // Connect The Symbols glade_xml_s...
false
false
false
false
false
0
__gf_rdma_ioq_churn_entry (gf_rdma_peer_t *peer, gf_rdma_ioq_t *entry) { int32_t ret = 0, quota = 0; gf_rdma_private_t *priv = NULL; gf_rdma_device_t *device = NULL; gf_rdma_options_t *options = NULL; gf_rdma_post_t *post = NULL; priv = peer->tr...
false
false
false
false
false
0
init_global_datetime_format(timestamp_type format_type, DATE_TIME_FORMAT *format) { /* Get command line option format->format.str is already set by my_getopt */ format->format.length= strlen(format->format.str); if (parse_date_time_format(format_type, format)) ...
false
false
false
false
false
0
tgaPixelRead(FILE *fio, RgbaImageT *imgP, int npixels, int size, int mapped) { int pcount; switch(size) { case 8: if(get_block(fio, (char*)imgP->ri, npixels)) { fprintf(stderr, "tgaPixelRead: read error\n"); return -1 ; } if(mapped) { for(pcount=0; pcount < npixels; ...
false
true
false
false
false
1
makeRevoked(sqlite3 *db, BIO *err, const char *serialNumber, const char* timestamp) { revoke_cert(db, timestamp, serialNumber); X509_REVOKED *r = X509_REVOKED_new(); BIGNUM *bn = NULL; ASN1_ENUMERATED *rtmp = NULL; if (!r) { BIO_printf(err, "Unable to create an " "X5...
false
false
false
false
true
1
GB_INFO(const char *key, void **value) { if (!strcasecmp(key, "DISPLAY")) { #ifdef GDK_WINDOWING_X11 #ifndef GAMBAS_DIRECTFB *value = (void *)gdk_x11_display_get_xdisplay(gdk_display_get_default()); #else // For DirectFB *value=0; stub("DIRECTFB/EXPORT GB_INFO"); #endif #else // Fo...
false
false
false
false
false
0
createMultiSet(const char *infoName, ArMapFileLineSet *multiSet, ArMapChangeDetails *changeDetails) { ArMapFileLineSetWriter origWriter(multiSet); ArMapInfoData *data = findData(infoName); if (data == NULL) { return; } // TODO Will need to k...
false
false
false
false
false
0
getSubstream(const char *name) { if (m_cdir.empty()) return 0; std::map<std::string, CentralDirectoryEntry>::const_iterator iter = m_cdir.lower_bound(name); if (iter == m_cdir.end()) return 0; if (m_cdir.key_comp()(name, iter->first)) { size_t name_length = strlen(name); if (iter->first.compar...
false
false
false
false
false
0
_format(int device_num, char fs_name, int blocksize){ /*Check for correct num of devices*/ int i; int error = 0; if (blocksize != 4 && blocksize != 8 && blocksize != 16){ return ERROR_INVALID_BLOCK_SIZE; } if(device_num < 0 || device_num >= MAX_DEVICE){ return ERROR_INVALID_DEV...
false
false
false
false
false
0
Vect__new_cats_struct() { struct line_cats *p; p = (struct line_cats *)G_malloc(sizeof(struct line_cats)); /* n_cats MUST be initialized to zero */ if (p) p->n_cats = 0; if (p) p->alloc_cats = 0; return p; }
false
false
false
false
false
0
calcRouteDist(void) { double (*dist)(const Point& a, const Point& b) = (_type == ConnType_PolyLine) ? euclideanDist : manhattanDist; _route_dist = 0; for (size_t i = 1; i < _route.size(); ++i) { _route_dist += dist(_route.at(i), _route.at(i - 1)); } }
false
false
false
false
false
0
check_rule(RULE *rp, GROUP *gp) { if((rp->ilen != count_items(rp->lhs)) || (rp->olen != count_items(rp->rhs))) fail(1,"fatal compiler error"); // Check and adjust the lhs of the rule rp->lhs = check_lhs(rp->lhs,rp->ilen,gp,rp->line); rp->ilen = count_items(rp->lhs); // must recalculate, as string may have been ...
false
false
false
false
false
0
gg_encoding_convert_cp1250_utf8(const char *src, int src_length, int dst_length) { int i, j, len; char *result = NULL; for (i = 0, len = 0; (src[i] != 0) && (i < src_length); i++) { uint16_t uc; if ((unsigned char) src[i] < 0x80) uc = (unsigned char) src[i]; else uc = table_cp1250[(unsigned char) src[i...
false
false
false
false
false
0
evalName(es) /* evaluate es :: [Char] and save */ Cell es; { /* in char array... return ptr to */ static char buffer[MAX_STRING+1]; /* string or 0, if error occurs */ char *bp = buffer; StackPtr saveSp = sp; eval(es); while (whnfHead==nameC...
false
false
false
false
false
0
FS_FOpenFileWrite( fsFile_t *file, const char *name ) { FILE *fp; gzFile zfp; char *modeStr, *ext; fsFileType_t type; uint32 mode; Com_sprintf( file->fullpath, sizeof( file->fullpath ), "%s/%s", fs_gamedir, name ); mode = file->mode & FS_MODE_MASK; switch( mode ) { case FS_MODE_APPEND: modeStr = "ab"; br...
false
false
true
false
true
1
exo_icon_view_accessible_clear_cache (ExoIconViewAccessiblePrivate *priv) { ExoIconViewItemAccessibleInfo *info; GList *items; items = priv->items; while (items) { info = (ExoIconViewItemAccessibleInfo *) items->data; g_object_unref (info->item); g_free (items->data); items = items-...
false
false
false
false
false
0
phy_config_interrupt(struct phy_device *phydev, u32 interrupts) { phydev->interrupts = interrupts; if (phydev->drv->config_intr) return phydev->drv->config_intr(phydev); return 0; }
false
false
false
false
false
0
closeTestMethod(const svUnitTest::svutTestCase& /*testCase*/, const svUnitTest::svutTestMethod& /*meth*/, const svUnitTest::svutStatusInfo& status) { string statusLower = status.getStatusName(); std::transform(statusLower.begin(), statusLower.end(), statusLower.begin(), ::tolower); *out << "\t\t\t<!--<status>" << st...
false
false
false
false
false
0
Fnot() { int val; val = nulltest(*argStkPtr); if(val > 0) return(false); else if(!val) return(true); else { error(notsym,err_bool,*argStkPtr); return(brkerr()); } }
false
false
false
false
false
0
gnc_split_register_save_num_cell (BasicCell * cell, gpointer save_data, gpointer user_data) { SRSaveData *sd = save_data; SplitRegister *reg = user_data; const char *value; g_return_if_fail (gnc_basic_cell_has_name (cell, NUM_CELL)); ...
false
false
false
false
false
0
static_scheduling(Block *block) { if (block->hmdf != NULL && block->hmdf->scheduling == SCHE_STATIC) { static_scheduling_inner(block); } if (block->kind == SB) { static_scheduling_next(block->sb_head->module->block_head); } else if (block->inner != NULL) { static_scheduling_next(...
false
false
false
false
false
0
ChildOutput(int fd, Pointer in) { char buffer[512]; int nbytes; nbytes = read(fd, buffer, 512); ExDebug("*1", "ChildOutput %d %d", fd, nbytes); if(nbytes <= 0) { /* EOF or terminate */ DXRegisterInputHandler (NULL, fd, NULL); close(fd); return(ERROR); } else ...
false
false
false
false
false
0
camel_header_address_set_members (struct _camel_header_address *h, struct _camel_header_address *group) { if (h) { if (h->type == CAMEL_HEADER_ADDRESS_GROUP || h->type == CAMEL_HEADER_ADDRESS_NONE) { h->type = CAMEL_HEADER_ADDRESS_GROUP; camel_header_address_list_clear (...
false
false
false
false
false
0
efreet_mime_glob_case_match(char *str, const char *glob) { const char *p; char *tglob, *tp; if (!str || !glob) return 0; if (glob[0] == 0) { if (str[0] == 0) return 1; return 0; } tglob = alloca(strlen(glob) + 1); for (tp = tglob, p = glob; *p; p++, tp++) *tp = tolower(*...
false
false
false
false
false
0
combineProcessRecords( Event& process, Event& process2) { // Find first event record size, excluding resonances. int nSize = process.size(); int nHard = 5; while (nHard < nSize && process[nHard].mother1() == 3) ++nHard; // Save resonance products temporarily elsewhere. vector<Particle> resProd; if (nSi...
false
false
false
false
false
0
GetSymbolRef(const MachineOperand& MO, const MCSymbol* Symbol, HexagonAsmPrinter& Printer) { MCContext &MC = Printer.OutContext; const MCExpr *ME; ME = MCSymbolRefExpr::create(Symbol, MCSymbolRefExpr::VK_None, MC); if (!MO.isJTI() && MO.getOffset()) ME = MCBinaryExpr::createA...
false
false
false
false
false
0
wacom_cmd_unpair_remote(struct wacom *wacom, unsigned char selector) { const size_t buf_size = 2; unsigned char *buf; int retval; buf = kzalloc(buf_size, GFP_KERNEL); if (!buf) return -ENOMEM; buf[0] = WAC_CMD_DELETE_PAIRING; buf[1] = selector; retval = wacom_set_report(wacom->hdev, HID_OUTPUT_REPORT, buf,...
false
false
false
false
false
0
argf_read(int argc, VALUE *argv, VALUE argf) { VALUE tmp, str, length; long len = 0; rb_scan_args(argc, argv, "02", &length, &str); if (!NIL_P(length)) { len = NUM2LONG(argv[0]); } if (!NIL_P(str)) { StringValue(str); rb_str_resize(str,0); argv[1] = Qnil; } retry: if (!next_argv(...
false
false
false
false
false
0
opt_prompt(o) struct loption *o; { if (o == NULL || (o->otype & (STRING|NUMBER)) == 0) return ("?"); return (o->odesc[0]); }
false
false
false
false
false
0
static_raw_x0y1z1 (int cell_x, int cell_y, int cell_z, int shell, static_polytope *polytope) { int n, n_x, n_y, n_z; n = polytope->n_cells; /************************************************** * find neighbours in cells along x0y1z1 vertices * **************************************************/ n_x = -shell + cell_...
false
false
false
false
false
0
viewGraph() { viewGraph(getDAGName(), "Scheduling-Units Graph for " + getDAGName()); }
false
false
false
false
false
0
str2int(const char *str, uint64 &u64, int defaultbase) { uint base = defaultbase; size_t len = strlen(str); if (!len) return false; bool n = false; if (defaultbase == 10) { if (ht_strnicmp("0x", str, 2) == 0) { str += 2; base = 16; len -= 2; if (!len) return false; } else { switch (tolower(str[l...
false
false
false
false
false
0
dispose_archive_page(struct ArchivePage* page) { debug_print("freeing ArchivePage\n"); if (page->path) g_free(page->path); page->path = NULL; if (page->name) g_free(page->name); page->name = NULL; g_free(page); }
false
false
false
false
false
0
smushamt() { int maxsmush,amt; int row,linebd,charbd; outchr ch1,ch2; if ((smushmode & (SM_SMUSH | SM_KERN)) == 0) { return 0; } maxsmush = currcharwidth; for (row=0;row<charheight;row++) { if (right2left) { for (charbd=STRLEN(currchar[row]); ch1=currchar[row][charbd],(charbd>0&&(...
true
true
false
false
false
1
ArgusCalloc (int nitems, int size) { void *retn = NULL; if (size) { ArgusCallocTotal++; retn = calloc (nitems, size); } #ifdef ARGUSDEBUG ArgusDebug (7, "ArgusCalloc (%d, %d) returning 0x%x\n", nitems, size, retn); #endif return (retn); }
false
false
false
false
false
0
us_reactor_handler_rawnet_readable( us_reactor_handler_t *self_ ) { bool r = false; us_reactor_handler_rawnet_t *self = (us_reactor_handler_rawnet_t *)self_; if ( self ) { us_packet_queue_t *q = self->m_incoming_packets; if ( us_packet_queue_can_write( q ) ) { us_pack...
false
false
false
false
false
0
eog_job_model_run (EogJob *job) { EogJobModel *job_model; GList *filtered_list; GList *error_list; /* initialization */ g_return_if_fail (EOG_IS_JOB_MODEL (job)); job_model = EOG_JOB_MODEL (g_object_ref (job)); filtered_list = NULL; error_list = NULL; filter_files (job_model->file_list, ...
false
false
false
false
false
0
method_unbind(obj) VALUE obj; { VALUE method; struct METHOD *orig, *data; Data_Get_Struct(obj, struct METHOD, orig); method = Data_Make_Struct(rb_cUnboundMethod, struct METHOD, bm_mark, free, data); data->klass = orig->klass; data->recv = Qundef; data->id = orig->id; data->body = or...
false
false
false
false
false
0
use_library(GVC_t *gvc, const char *name) { static int cnt = 0; if (name) { Lib = ALLOC(cnt + 2, Lib, const char *); Lib[cnt++] = name; Lib[cnt] = NULL; } gvc->common.lib = Lib; }
false
false
false
false
false
0
EmitCallingConv(Record *CC, raw_ostream &O) { ListInit *CCActions = CC->getValueAsListInit("Actions"); Counter = 0; O << "\n\nstatic bool " << CC->getName() << "(unsigned ValNo, MVT ValVT,\n" << std::string(CC->getName().size()+13, ' ') << "MVT LocVT, CCValAssign::LocInfo LocInfo,\n" << std::stri...
false
false
false
false
false
0
get_method_constrained (MonoImage *image, MonoMethod *method, MonoClass *constrained_class, MonoGenericContext *context) { MonoMethod *result; MonoClass *ic = NULL; MonoGenericContext *method_context = NULL; MonoMethodSignature *sig, *original_sig; mono_class_init (constrained_class); original_sig = sig = mono_m...
false
false
false
false
false
0
http_chunk_append_mem(server *srv, connection *con, const char * mem, size_t len) { chunkqueue *cq; if (!con) return -1; cq = con->write_queue; if (len == 0) { return 0; } chunkqueue_append_mem(cq, mem, len); return 0; }
false
false
false
false
false
0
set_volume_cb (GUPnPServiceProxy *rendering_control, GUPnPServiceProxyAction *action, gpointer user_data) { GError *error; error = NULL; if (!gupnp_service_proxy_end_action (rendering_control, actio...
false
false
false
false
false
0
DrucAsTransparenceEquivalent ( LayerInitial ) int LayerInitial; { int IndexTransp; LayerInitial = RDS_STATIC_LAYER[ LayerInitial ]; for ( IndexTransp = 0; IndexTransp < DRUC_MAX_TRANSPARENCES; IndexTransp ++ ) { if ( ( ( TabTransEquivalence [ Ind...
false
false
false
false
false
0
new_state(pTHX) { SV *warn_flag; struct state *st; Newxz(st, 1, struct state); st->go_yell = TRUE; if (NULL != (warn_flag = perl_get_sv("Devel::Size::warn", FALSE))) { st->dangle_whine = st->go_yell = SvIV(warn_flag) ? TRUE : FALSE; } if (NULL != (warn_flag = perl_get_sv("Devel::Size::dang...
false
false
false
false
false
0
logon(ajp_endpoint_t * ae, jk_logger_t *l) { jk_pool_t *p = &ae->pool; jk_msg_buf_t *msg; int rc; JK_TRACE_ENTER(l); msg = jk_b_new(p); jk_b_set_buffer_size(msg, DEF_BUFFER_SZ); if ((rc = handle_logon(ae, msg, l)) == JK_FALSE) ajp_close_endpoint(ae, l); JK_TRACE_EXIT(l); ...
false
false
false
false
false
0
chap_input(int unit, unsigned char *pkt, int pktlen) { struct chap_client_state *cs = &client; struct chap_server_state *ss = &server; unsigned char code, id; int len; if (pktlen < CHAP_HDRLEN) return; GETCHAR(code, pkt); GETCHAR(id, pkt); GETSHORT(len, pkt); if (len < CHAP_HDRLEN || len > pktlen) return;...
false
false
false
false
false
0
comb_sort(data array[], int len) { int gap = len; int swaps = 0; // 1 if a swap has occurred, 0 if none int i; // index used to scan the list data tmp; // temporary variable used to swap elements while (gap > 1 || swaps) { if (gap > 1) // update the gap value gap /= 1.247330950103979; swaps = 0; // reset th...
false
false
false
false
false
0
ch_util_get_dark_offsets (ChUtilPrivate *priv, gchar **values, GError **error) { gboolean ret; CdColorRGB value; /* get from HW */ ch_device_queue_get_dark_offsets (priv->device_queue, priv->device, &value); ret = ch_device_queue_process (priv->device_queue, CH_DEVICE_QUEUE_PROCESS_FLAGS_...
false
false
false
false
false
0
_nc_Position_Form_Cursor(FORM *form) { FIELD *field; WINDOW *formwin; if (!form) return (E_BAD_ARGUMENT); if (!form->w || !form->current) return (E_SYSTEM_ERROR); field = form->current; formwin = Get_Form_Window(form); wmove(form->w, form->currow, form->curcol); if (Has_Invisible_Parts(field...
false
false
false
false
false
0
GetDocProjectURL(wxInt32 item, wxString& strBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); if (pDoc) { project = pDoc->project(item); } if (project) { strBuffer = wxString(project->master_url, wxConvUTF8); } else { strBuffer...
false
false
false
false
false
0
sun4i_ts_irq_handle_input(struct sun4i_ts_data *ts, u32 reg_val) { u32 x, y; if (reg_val & FIFO_DATA_PENDING) { x = readl(ts->base + TP_DATA); y = readl(ts->base + TP_DATA); /* The 1st location reported after an up event is unreliable */ if (!ts->ignore_fifo_data) { input_report_abs(ts->input, ABS_X, x); ...
false
false
false
false
false
0
DISK_start (void) { int dr; for (int i = 0; i < 3; i++) fifo_inuse[i] = false; fifo_filled = 0; for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { drive *drv = &floppy[dr]; if (!(selected & (1 << dr))) { int tr = drv->cyl * 2 + side; trackid *ti = drv->trackdata + tr; if (dskdmaen == DSKDMA_WRITE) { ...
false
false
false
false
false
0
loadBuiltinDictionary() { DcmDictEntry* e = NULL; const DBI_SimpleEntry *b = simpleBuiltinDict; for (size_t i=0; i<simpleBuiltinDict_count; ++i) { b = simpleBuiltinDict + i; e = new DcmDictEntry(b->group, b->element, b->upperGroup, b->upperElement, b->evr, b->tagName,...
false
false
false
false
false
0
darken_pixbuf(GdkPixbuf * dest,guint factor) { guint i, j; guint height,width; gint has_alpha, dest_rowstride; guchar *target_pixels; guchar *pix_dest; has_alpha = gdk_pixbuf_get_has_alpha(dest); width = gdk_pixbuf_get_width(dest); height = gdk_pixbuf_get_height(dest); dest_rowstride = gdk_pixbuf_get_rowstrid...
false
false
false
false
false
0
ebnet_set_book_name(int file, const char *book_name) { EBNet_Socket_Entry *entry; entry = ebnet_find_socket_entry(file); if (entry == NULL) return -1; strncpy(entry->book_name, book_name, EBNET_MAX_BOOK_NAME_LENGTH + 1); *(entry->book_name + EBNET_MAX_BOOK_NAME_LENGTH) = '\0'; return 0; }
false
true
false
false
false
1
SetOEMPhaseIncr(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,i,j,temp,romptr=0; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) return; if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetNTSCJ | TVSetPALM | TVSetPA...
false
false
false
false
false
0
http_highport_test(void) { int i = -1; struct evhttp *myhttp = NULL; /* Try a few different ports */ for (i = 0; i < 50; ++i) { myhttp = evhttp_start("127.0.0.1", 65535 - i); if (myhttp != NULL) { test_ok = 1; evhttp_free(myhttp); return; } } tt_fail_msg("Couldn't get a high port"); }
false
false
false
false
false
0
sdsfromlonglong(long long value) { char buf[32], *p; unsigned long long v; v = (value < 0) ? -value : value; p = buf+31; /* point to the last character */ do { *p-- = '0'+(v%10); v /= 10; } while(v); if (value < 0) *p-- = '-'; p++; return sdsnewlen(p,32-(p-buf)); }
false
false
false
false
false
0
addGnatWave(int o, int duration, float density, bool mixed) { float freq = 1.0/density; float c = -FRAND*3.0; if(mixed) { EnemyWave straightArrow(EnemyStraight); straightArrow.setInOut(o+50, o+duration); straightArrow.setXRand(0.0); straightArrow.setPos(c, 10.0); straightArrow.setFrequency((int)(90*freq)...
false
false
false
false
false
0
fmpz_poly_limb_unpack_unsigned(fmpz_poly_t poly_fmpz, const mp_limb_t * array, const unsigned long length, const unsigned long limbs) { unsigned long size_m = poly_fmpz->limbs + 1; fmpz_t coeffs_m = poly_fmpz->coeffs; for (unsigned long i = 0, j = 0, k = 0; i < length; i+...
false
false
false
false
false
0
boxCheckIfOverlapIsBig(BOX *box, BOXA *boxa, l_float32 maxoverlap) { l_int32 i, n, bigoverlap; l_float32 fract; BOX *boxt; PROCNAME("boxCheckIfOverlapIsBig"); if (!box) return ERROR_INT("box not defined", procName, 1); if (!boxa) ...
false
false
false
false
false
0
attach_scanner (const char *devicename, Canon_Device ** devp) { CANON_Handle scan; Canon_Device *dev; SANE_Status status; DBG (3, "attach_scanner: %s\n", devicename); for (dev = first_dev; dev; dev = dev->next) { if (strcmp (dev->sane.name, devicename) == 0) { if (devp) *devp = dev; re...
false
false
false
false
false
0
load_module(const char *fname, const char *options) { #if 1 int r; size_t len = MAXINT(ssize_t); char *module_image; dbg1_error_msg("load_module('%s','%s')", fname, options); module_image = xmalloc_open_zipped_read_close(fname, &len); r = (!module_image || init_module(module_image, len, options ? options : "") !...
false
false
false
false
false
0
handleOnBulletType(int styleIndex) { QTextCursor cursor = textEdit->textCursor(); if (styleIndex != 0) { QTextListFormat::Style style = (QTextListFormat::Style)styleIndex; QTextList *currentList = cursor.currentList(); QTextListFormat listFmt; cursor.beginEditBlock(); i...
false
false
false
false
false
0
clearPath(string& path) { string::size_type p; while ((p = path.find("//")) != string::npos) path.erase(p, 1); if ((p = path.find_last_not_of("/")) != string::npos) path.erase(++p); }
false
false
false
false
false
0
list_enter (GtkWidget * widget, GdkEventKey * event, gpointer data) { gftp_window_data * wdata; wdata = data; if (!GFTP_IS_CONNECTED (wdata->request)) return (TRUE); if (event->type == GDK_KEY_PRESS && (event->keyval == GDK_KP_Delete || event->keyval == GDK_Delete)) { delete_dialog (...
false
false
false
false
false
0
cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len, byte ** ret_buf, size_t * ret_buflen) { cdk_error_t rc; off_t oldpos; unsigned int n; if (!ret_buf || !ret_buflen) { gnutls_assert (); return CDK_Inv_Value; } *ret_buf = NULL; *ret_buflen = 0; if (!s) ...
false
false
false
false
false
0
gst_rtp_mp2t_pay_flush (GstRTPMP2TPay * rtpmp2tpay) { guint avail, mtu; GstFlowReturn ret = GST_FLOW_OK; GstBuffer *outbuf; avail = gst_adapter_available (rtpmp2tpay->adapter); mtu = GST_RTP_BASE_PAYLOAD_MTU (rtpmp2tpay); while (avail > 0 && (ret == GST_FLOW_OK)) { guint towrite; guint payload_le...
false
false
false
false
false
0
clarity_widget_playlist_selected_cb(GtkPodApp *app, gpointer pl, gpointer data) { g_return_if_fail(CLARITY_IS_WIDGET(data)); ClarityWidget *cw = CLARITY_WIDGET(data); Playlist *playlist = (Playlist *) pl; if (!playlist) return; _init_clarity_with_playlist(cw, playlist); }
false
false
false
false
false
0
restore_pos(pTHX_ void *arg) { dVAR; regexp * const rex = (regexp *)arg; if (PL_reg_state.re_state_eval_setup_done) { if (PL_reg_oldsaved) { rex->subbeg = PL_reg_oldsaved; rex->sublen = PL_reg_oldsavedlen; rex->suboffset = PL_reg_oldsavedoffset; rex->subcoffset = PL_reg_oldsavedcoffset;...
false
false
false
false
false
0
Java_org_gdal_ogr_ogrJNI_new_1Geometry_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jint jarg1, jstring jarg2, jbyteArray jarg3, jstring jarg5) { jlong jresult = 0 ; OGRwkbGeometryType arg1 ; char *arg2 = (char *) 0 ; int arg3 ; unsigned char *arg4 = (unsigned char *) 0 ; char *arg5 = (char *) 0 ; OGRGeometrySha...
false
false
false
false
false
0
tua9001_get_if_frequency(struct dvb_frontend *fe, u32 *frequency) { struct tua9001_dev *dev = fe->tuner_priv; struct i2c_client *client = dev->client; dev_dbg(&client->dev, "\n"); *frequency = 0; /* Zero-IF */ return 0; }
false
false
false
false
false
0
set_nofork_info (TestResult *tr) { if (tr->msg == NULL) { tr->rtype = CK_PASS; tr->msg = pass_msg(); } else { tr->rtype = CK_FAILURE; } }
false
true
false
false
false
1
gamgi_mesa_translate_molecule_list (double *shift) { gamgi_layer *layer = NULL; gamgi_molecule *molecule; gamgi_dlist *dlist; double translate[3]; for (dlist = gamgi->molecules; dlist != NULL; dlist = dlist->next) { molecule = GAMGI_CAST_MOLECULE dlist->data; static_layer (GAMGI_CAST_OBJECT molecule, &layer, sh...
false
false
false
false
false
0
rev_same_tree_as_empty(struct rev_info *revs, struct tree *t1) { int retval; void *tree; unsigned long size; struct tree_desc empty, real; if (!t1) return 0; tree = read_object_with_reference(t1->object.sha1, tree_type, &size, NULL); if (!tree) return 0; init_tree_desc(&real, tree, size); init_tree_desc(...
false
false
false
false
false
0
cb_todos_show(GtkWidget *widget, gpointer data) { long ivalue; set_pref(PREF_DATEBOOK_TODO_SHOW, GTK_TOGGLE_BUTTON(show_todos_button)->active, NULL, TRUE); if (!(GTK_TOGGLE_BUTTON(show_todos_button)->active)) { set_pref(PREF_DATEBOOK_TODO_PANE, gtk_paned_get_position(GTK_PANED(todo_pane)), NULL, TRUE);...
false
false
false
false
false
0
find_aot_method_in_amodule (MonoAotModule *amodule, MonoMethod *method, guint32 hash_full) { guint32 table_size, entry_size, hash; guint32 *table, *entry; guint32 index; static guint32 n_extra_decodes; if (!amodule || amodule->out_of_date) return 0xffffff; table_size = amodule->extra_method_table [0]; hash =...
false
false
false
false
false
0
NotebookMenuItem(Gtk::RadioButtonGroup & group, const Note::Ptr & note, const Notebook::Ptr & notebook) : Gtk::RadioMenuItem(group, notebook ? notebook->get_name() : _("No notebook")) , m_note(note) , m_notebook(notebook) { signal_activate().connect(si...
false
false
false
false
false
0
remove_define(char *def_text) { char *pnt = def_text+6; char *s1; JRB node; s1=strtok(pnt, " \t\b"); if(!s1) { warn("** Warning: malformed `undef directive in file '%s' line %d, ignoring.\n", zzfilename, zzline); return; } if(!(node=jrb_find_str(define_tree, s1))) { warn("** Warning: Attempted `undef of undefi...
false
false
false
false
false
0
div_ceil(unsigned int a, unsigned int b) { if (!a) return 0; return ((a - 1) / b) + 1; }
false
false
false
false
false
0
operator()(const Polynomial &a, const Polynomial &b)const { if(a.terms.size()<b.terms.size())return true; if(b.terms.size()<a.terms.size())return false; TermMap::const_iterator i=a.terms.begin(); for(TermMap::const_iterator j=b.terms.begin();j!=b.terms.end();j++,i++) { if(LexicographicTermOrder()(i->...
false
false
false
false
false
0
checkNode(Absyn * node, Table * symtab) { switch (node->type) { case ABSYN_NAMETY: return checkNameTy(node, symtab); break; case ABSYN_ARRAYTY: return checkArrayTy(node, symtab); break; case ABSYN_TYPEDEC: // already done in 1st run break; case ABSYN_PROCDEC: return checkProcDec(node, symtab); brea...
false
false
false
false
false
0
runOnModule(Module &M) { CallGraph &CG = getAnalysis<CallGraph>(); bool Changed = doInitialization(CG); // Walk the callgraph in bottom-up SCC order. scc_iterator<CallGraph*> CGI = scc_begin(&CG); CallGraphSCC CurSCC(&CGI); while (!CGI.isAtEnd()) { // Copy the current SCC and increment past it so th...
false
false
false
false
false
0
simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { u32 *pal = info->pseudo_palette; u32 cr = red >> (16 - info->var.red.length); u32 cg = green >> (16 - info->var.green.length); u32 cb = blue >> (16 - info->var.blue.length); u32 value; if (regno >= ...
false
false
false
false
false
0
brasero_volume_file_from_path (const gchar *ptr, BraseroVolFile *parent) { GList *iter; gchar *next; gint len; /* first determine the name of the directory / file to look for */ if (!ptr || ptr [0] != '/' || !parent) return NULL; ptr ++; next = g_utf8_strchr (ptr, -1, G_DIR_SEPARATOR); if (!next) ...
false
false
false
false
false
0
parq_cleanup_banned(time_t now) { GList *dl; GSList *sl, *to_remove = NULL; for (dl = parq_banned_sources ; dl != NULL; dl = g_list_next(dl)) { struct parq_banned *banned = dl->data; if ( delta_time(now, banned->added) > PARQ_MAX_UL_RETRY_DELAY || delta_time(now, banned->expire) > 0 ) { to_remove = ...
false
false
false
false
false
0
read_file(const char *filename, void **ptr, size_t *size) { int fd, ret; struct stat st; fd = open(filename, O_RDONLY); if (fd == -1) errx(1, "couldn't open `%s'", filename); ret = fstat(fd, &st); if (ret) errx(1, "couldn't stat `%s'", filename); *size = st.st_size; *ptr = mmap(NULL, st.st_size, PROT_REA...
false
false
false
false
false
0
__proc_create(struct proc_dir_entry **parent, const char *name, umode_t mode, nlink_t nlink) { struct proc_dir_entry *ent = NULL; const char *fn; struct qstr qstr; if (xlate_proc_name(name, parent, &fn) != 0) goto out; qstr.name = fn; qstr.len = strlen(fn); if (qstr.len == 0 || qstr.len >...
false
false
false
false
false
0
rdbx_add_index(rdbx_t *rdbx, int delta) { if (delta > 0) { /* shift forward by delta */ index_advance(&rdbx->index, delta); bitvector_left_shift(&rdbx->bitmask, delta); bitvector_set_bit(&rdbx->bitmask, bitvector_get_length(&rdbx->bitmask) - 1); } else { /* delta is in window */ bitvector...
false
false
false
false
false
0
ijs_server_proc_set_param (IjsServerCtx *ctx) { const char *key, *value; int key_size, value_size; IjsJobId job_id; int param_size; int code; code = ijs_recv_int (&ctx->recv_chan, &job_id); if (code < 0) return code; if (!ctx->in_job || ctx->job_id != job_id) return ijs_server_nak (ctx, IJS_EJ...
false
false
false
false
false
0