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
uwb_rsv_setup(struct uwb_rc *rc) { char name[16]; snprintf(name, sizeof(name), "%s_rsvd", dev_name(&rc->uwb_dev.dev)); rc->rsv_workq = create_singlethread_workqueue(name); if (rc->rsv_workq == NULL) return -ENOMEM; return 0; }
true
true
false
false
false
1
check_and_push(context_type *context, const void *ptr, int kind) { alloc_stack_type *p; if (ptr == 0) CCout_of_memory(context); if (context->alloc_stack_top < ALLOC_STACK_SIZE) p = &(context->alloc_stack[context->alloc_stack_top++]); else { /* Otherwise we have to malloc */ ...
false
false
false
false
false
0
scope_extract_back( const char* scope, /*!< Full scope to extract from */ /*@out@*/ char* back, /*!< Lowest level of hierarchy extracted */ /*@out@*/ char* rest /*!< Hierarchy left after extraction */ ) { PROFILE(SCOPE_EXTRACT_BACK); const char* ptr; /* Pointer to current chara...
false
true
false
false
false
1
RelativeErrorExponential( double x ) { // REFERENCE: SLATEC LIBRARY; CATEGORY B3 // dexprl // // CALCULATES THE RELATIVE ERROR EXPONENTIAL (DEXP(X)-1)/X. i.e. // EVALUATE EXPREL(X) = (EXP(X) - 1.0) / X. FOR SMALL ABS(X) THE // TAYLOR SERIES IS USED. IF X IS NEGATIVE THE REFLECTION FORMULA // E...
false
false
false
false
false
0
bamBgzfOpenfdWrite(int fd, char is_uncompressed) { FILE* file; AjPSeqBamBgzf fp; file = ajSysFuncFdopen(fd, "w"); if(file == 0) return 0; fp = malloc(sizeof(AjOSeqBamBgzf)); fp->file_descriptor = fd; fp->open_mode = 'w'; fp->owned_file = 0; fp->is_uncompressed = is_unc...
false
false
false
false
false
0
abituguru_detect_no_bank2_sensors(struct abituguru_data *data) { int i; if (fan_sensors > 0 && fan_sensors <= ABIT_UGURU_MAX_BANK2_SENSORS) { data->bank2_sensors = fan_sensors; ABIT_UGURU_DEBUG(2, "assuming %d fan sensors because of " "\"fan_sensors\" module param\n", (int)data->bank2_sensors); return; ...
false
false
false
false
false
0
UpdateName( const char *name ) { if( name ) { UIDs uids; bool b = uids.SetFromUID( name ); if( b ) { Name = name; size_t lenTemp = Name.size(); assert(lenTemp < (size_t)std::numeric_limits<uint16_t>::max); ItemLength = (uint16_t)lenTemp; assert( (size_t)ItemLength +...
false
false
false
false
false
0
Add(Key k,Key op,OneOperator *p0,OneOperator *p1, OneOperator *p2,OneOperator *p3,OneOperator *p4,OneOperator *p5,OneOperator *p6) { iterator i= m.find(k); if (i==m.end()) // new { Value poly0=Value(atype<Polymorphic*>(),new Polymorphic(),listofvar); i=m.insert(pair<const Key,Value>(...
false
false
false
false
false
0
id3v2AddAudioDuration(lame_global_flags * gfp) { if (gfp->num_samples != MAX_U_32_NUM) { char buffer[1024]; double const max_ulong = MAX_U_32_NUM; double ms = gfp->num_samples; unsigned long playlength_ms; ms *= 1000; ms /= gfp->in_samplerate; if (ms > ma...
true
true
false
false
false
1
getDisplay(int index) const { if(getImpl()->displayCache_.empty()) { ComputeDisplays(getImpl()->displayCache_, getImpl()->displays_, getImpl()->activeDisplays_, getImpl()->activeDisplaysEnvOverride_); ...
false
false
false
false
false
0
usbnet_change_mtu (struct net_device *net, int new_mtu) { struct usbnet *dev = netdev_priv(net); int ll_mtu = new_mtu + net->hard_header_len; int old_hard_mtu = dev->hard_mtu; int old_rx_urb_size = dev->rx_urb_size; if (new_mtu <= 0) return -EINVAL; // no second zero-length packet read wanted after mtu-size...
false
false
false
false
false
0
HTMLStartEnv(li, tagid, p) HTMLInfo li; HTMLTagID tagid; MLElement p; { char *str; HTMLTag tag; tag = HTMLTagIDToTag(tagid); if (p == NULL) { str = MPGet(li->mp, strlen(tag->name) + 3); strcpy(str, "<"); strcat(str, tag->name); strcat(str, ">"); p = MLCreateTag(li->hs, str, strlen(str)); ...
false
false
false
false
false
0
LSL_lateParadisoLibLoad() { char buffer[512]; int rc; sprintf(buffer, "Error unknown."); rc = LSL_loadPardisoLib(NULL, buffer, 512); if (rc!=0) { fprintf(stderr, "Error loading Pardiso dynamic library " PARDISOLIBNAME ": %s\nAbort...\n", buffer); exit(EXIT_FAILURE); } }
true
true
false
false
false
1
zwrite (fd, buf, nb) int fd; char *buf; size_t nb; { int n, i, nt; for (n = nb, nt = 0;;) { i = write (fd, buf, n); if (i > 0) { n -= i; if (n <= 0) return nb; buf += i; } else if (i == 0) { if (++nt > 3) return (nb - n); } else if (errno != EINT...
false
false
false
false
false
0
refill_callback(periodic_timer_t *timer, void *arg) { static struct timeval current_millisecond; struct timeval now; size_t bytes_written; size_t bytes_read; int milliseconds_elapsed = 0; int seconds_rolled_over = 0; const or_options_t *options = get_options(); (void)timer; (void)arg; tor_gettim...
false
false
false
false
false
0
image_task_completed_cb (GthTask *task, GError *error, gpointer user_data) { GthFileTool *base = user_data; GthImage *destination_image; cairo_surface_t *destination; GtkWidget *window; GtkWidget *viewer_page; if (error != NULL) { g_object_unref (task); return; } destina...
false
false
false
false
false
0
gst_audio_invert_transform_int (GstAudioInvert * filter, gint16 * data, guint num_samples) { gint i; gfloat dry = 1.0 - filter->degree; glong val; for (i = 0; i < num_samples; i++) { val = (*data) * dry + (-1 - (*data)) * filter->degree; *data++ = (gint16) CLAMP (val, G_MININT16, G_MAXINT16); } }
false
false
false
false
false
0
istgt_lu_dvd_scsi_report_key(ISTGT_LU_DVD *spec, CONN_Ptr conn, uint8_t *cdb, int keyclass, int agid, int keyformat, uint8_t *data) { uint8_t *cp; int hlen = 0, len = 0; if (keyclass == 0x00) { /* DVD CSS/CPPM or CPRM */ } else { return -1; } switch (keyformat) { case 0x08: /* Report Drive region settings ...
false
false
false
false
false
0
get_n_lshift(int m_val) { union uv3h_gr0_gam_gr_config_u m_gr_config; if (is_uv1_hub()) return m_val; if (is_uv2_hub()) return m_val == 40 ? 40 : 39; m_gr_config.v = uv_read_local_mmr(UV3H_GR0_GAM_GR_CONFIG); return m_gr_config.s3.m_skt; }
false
false
false
false
false
0
test_repo_message__message(void) { const char expected[] = "Test\n\nThis is a test of the emergency broadcast system\n"; ssize_t len; cl_git_pass(git_buf_joinpath(&_path, git_repository_path(_repo), "MERGE_MSG")); cl_git_mkfile(git_buf_cstr(&_path), expected); len = git_repository_message(NULL, 0, _repo); cl_as...
false
false
false
false
false
0
vfio_dev_whitelisted(struct device *dev, struct device_driver *drv) { int i; if (dev_is_pci(dev)) { struct pci_dev *pdev = to_pci_dev(dev); if (pdev->hdr_type != PCI_HEADER_TYPE_NORMAL) return true; } for (i = 0; i < ARRAY_SIZE(vfio_driver_whitelist); i++) { if (!strcmp(drv->name, vfio_driver_whitelist[...
false
false
false
false
false
0
fft_create_arrays(c, s, rev, n) REAL **c, **s; /* Sin and Cos arrays (to be returned) */ int n; /* Number of points */ int **rev; /* Array of reversed bits */ { register int i; int nu = ilog2(n); /* Compute temp array of sins and cosines */ *c = (R...
false
false
false
false
false
0
__ecereMethod_IDESettings_AddRecentProject(struct __ecereNameSpace__ecere__com__Instance * this, char * projectName) { struct IDESettings * __ecerePointer_IDESettings = (struct IDESettings *)(this ? (((char *)this) + __ecereClass_IDESettings->offset) : 0); int c; char * filePath = __ecereFunction___ecereNameSpace__ecer...
true
true
false
true
false
1
hash_alias_state_size(const qpol_iterator_t * iter) { type_alias_hash_state_t *hs = NULL; type_datum_t *tmp_datum; hashtab_node_t *tmp_node; uint32_t tmp_bucket = 0; size_t count = 0; if (iter == NULL || qpol_iterator_state(iter) == NULL) { errno = EINVAL; return 0; } hs = (type_alias_hash_state_t *) qpol...
false
false
false
false
false
0
find_live_mirror(struct btrfs_fs_info *fs_info, struct map_lookup *map, int first, int num, int optimal, int dev_replace_is_ongoing) { int i; int tolerance; struct btrfs_device *srcdev; if (dev_replace_is_ongoing && fs_info->dev_replace.cont_reading_from_srcdev_mode == BTRFS_DEV_REPLACE_IT...
false
false
false
false
false
0
create( const QString& name, const QVariantMap& params ) const { if( GetContext() == 0 ) { error( "NULL Context" ); return QVariant(); } if( name == "MainWindow" ) { MainWindow* wv = new MainWindow(); const bool NOT_OWNED_BY_JAVASCRIPT = false; QVariant obj = Get...
false
false
false
false
false
0
WordSelect() { int lengthDoc = LengthDocument(); int selStart; int selEnd; int line; int lineStart; int lineEnd; char *buffer; selStart = selEnd = SendEditor(SCI_GETCURRENTPOS); line = SendEditor(SCI_LINEFROMPOSITION, selStart); lineStart = SendEditor(SCI_POSITIONFROMLINE, line); lineEnd = SendEditor(SCI_GE...
false
false
false
false
false
0
_factory_filter (GstPluginFeature * feature, GstCaps ** subcaps) { GstElementFactory *factory; guint rank; const gchar *name; const GList *templates; GList *walk; gboolean is_renderer; GstCaps *templ_caps = NULL; gboolean have_video_sink = FALSE; /* we only care about element factories */ if (!GST_...
false
false
false
false
false
0
initauparse(void) { PyObject* m; if (PyType_Ready(&AuEventType) < 0) return; if (PyType_Ready(&AuParserType) < 0) return; m = Py_InitModule3("auparse", module_methods, auparse_doc); if (m == NULL) return; Py_INCREF(&AuParserType); PyModule_AddObject(m, "AuParser", (PyObject *)&AuP...
false
false
false
false
false
0
PopDoublePixel(QuantumInfo *quantum_info, const double pixel,unsigned char *pixels) { double *p; unsigned char quantum[8]; p=(double *) quantum; *p=(double) (pixel*quantum_info->state.inverse_scale+quantum_info->minimum); if (quantum_info->endian != LSBEndian) { *pixels++=quantum[7]; ...
false
false
false
false
true
1
ForwardDNAOccCount(const unsigned int* dna, const unsigned int index, const unsigned int character, const unsigned int* dnaDecodeTable) { static const unsigned int truncateRightMask[16] = { 0x00000000, 0xC0000000, 0xF0000000, 0xFC000000, 0xFF000000, 0xFFC00000, 0xFFF00000, 0xFFFC0000, ...
false
false
false
false
false
0
locateDataDir (void) { static char *dataDir = 0; static bool firstTime = true; if ( firstTime ) { firstTime = false; std::string dir (DATADIR); BrInitError error; if ( br_init (&error) == 0 && error != BR_INIT_ERROR_DISABLED ) { // Nothing to do, set ...
false
false
false
false
false
0
ipmi_lcd_set_single_line_text(struct ipmi_intf * intf, char * text) { uint8_t data[18]; int bytes_to_store = strlen(text); int bytes_stored = 0; int ii; int rc = 0; if (bytes_to_store > IPMI_DELL_LCD_STRING_LENGTH_MAX) { lprintf(LOG_ERR, "Out of range Max limit is 62 characters"); return (-1); } else { byt...
false
true
false
false
false
1
snd_timer_proc_init(void) { struct snd_info_entry *entry; entry = snd_info_create_module_entry(THIS_MODULE, "timers", NULL); if (entry != NULL) { entry->c.text.read = snd_timer_proc_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); entry = NULL; } } snd_timer_proc_entry = entry; }
false
false
false
false
false
0
session_upgrade(void) { if (session_args == NULL) return; execv(session_args[0], session_args); fprintf(stderr, "exec failed: %s: %s\n", session_args[0], g_strerror(errno)); }
false
false
false
false
false
0
create_unix_socket(const char *path) { struct sockaddr_un sunx; int fd; char line[MAXLINE +1]; if (path[0] == '\0') return -1; (void) unlink(path); memset(&sunx, 0, sizeof(sunx)); sunx.sun_family = AF_UNIX; (void) strncpy(sunx.sun_path, path, sizeof(sunx.sun_path)); fd = socket(AF_UNIX, SOCK_DGRAM, 0); i...
false
false
false
false
false
0
_nc_init_entry(TERMTYPE *const tp) /* initialize a terminal type data block */ { unsigned i; #if NO_LEAKS if (tp == 0 && stringbuf != 0) { FreeAndNull(stringbuf); return; } #endif if (stringbuf == 0) stringbuf = (char *) malloc(MAX_STRTAB); #if NCURSES_XNAMES tp->num_Booleans = BOOLCOUNT; ...
false
false
false
false
false
0
uip_tokenize_start (const sc_char *pattern) { static sc_bool initialized = FALSE; sc_int required; /* On first call only, verify the string lengths in the table. */ if (!initialized) { const sc_uip_token_entry_t *entry; /* Compare table lengths with string lengths. */ for (entry = UIP_TO...
false
false
false
false
false
0
removeFile(const FXString& filename){ FXchar key[20]; FXString name; FXint i=1,j=1; do{ sprintf(key,"FILE%d",i++); name=app->reg().readStringEntry(group.text(),key,NULL); app->reg().deleteEntry(group.text(),key); if(name.empty()) break; if(name!=filename){ sprintf(key,"FILE%d",j++); ...
false
false
false
false
false
0
draw() { if (damage()&FL_DAMAGE_ALL) draw_box(); draw(x()+Fl::box_dx(box()), y()+Fl::box_dy(box()), w()-Fl::box_dw(box()), h()-Fl::box_dh(box())); }
false
false
false
false
false
0
fli_is_tooltip_form( FL_FORM * form ) { return tip && tip->tooltipper == form; }
false
false
false
false
false
0
spew_file( int fd, const char *spew, int len, int *save_errno ) { int writeres; #define HEADER "# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.\n" char header[sizeof(HEADER "# CRC32 12345678\n")]; sprintf(header, HEADER "# CRC32 %08x\n", crc32(spew, len)); writeres = write_data(fd, header, sizeof(header)-1, ...
true
true
false
false
true
1
egg_spread_table_get_child_line (EggSpreadTable *table, GtkWidget *child, gint size) { EggSpreadTablePrivate *priv; gint *segments = NULL; gint i, child_count, child_idx = 0; GList *l; g_return_val_if_fail (EGG_IS_SPREAD_TABLE (tab...
false
false
false
false
false
0
getExecutionCount(const Function *F) { std::map<const Function*, double>::iterator J = FunctionInformation.find(F); if (J != FunctionInformation.end()) return J->second; // isDeclaration() is checked here and not at start of function to allow // functions without a body still to have a execution count....
false
false
false
false
false
0
updateAnimationn(int nFrame) { QString strElemetId; switch(m_direction) { case Granatier::Direction::NORTH: setSpriteKey(QString("bomb_blast_north_%1").arg(nFrame)); break; case Granatier::Direction::EAST: setSpriteKey(QString("bomb_blast_east_%1").arg(nFr...
false
false
false
false
false
0
af_access (path, name, type, mode) char *path, *name, *type; int mode; { char *uniqPath = af_uniqpath (af_entersym(path)); /* empty name argument */ if (!name || !(*name)) { if (type && *type) FAIL ("access", "cannot handle empty name and non-empty type", AF_EMISC, ERROR); name = "."; ...
false
false
true
false
true
1
pgd_fonts_update_progress (PgdFontsDemo *demo, gint n_pages, gint scanned) { gchar *str; str = g_strdup_printf ("Scanning fonts (%d%%)", MIN (scanned * 100 / n_pages, 100)); gtk_progress_bar_set_text (GTK_PROGRESS_BAR (demo->progress), str); gtk_progress_bar_set_fraction (GT...
false
false
false
false
false
0
_init_server (glibtop *server, const unsigned features) { char *command, *temp; /* Try to get server command, but don't override if already * set via glibtop_set_parameter () */ if (server->server_command == NULL) { const char *temp = getenv ("LIBGTOP_SERVER") ? getenv ("LIBGTOP_SERVER") : LIBGTOP_SERVER; ...
false
false
true
false
true
1
initialize_device_data(UPSINFO *ups) { struct driver_data *nid = (struct driver_data *)ups->driver_internal_data; char *cp; astrncpy(nid->device, ups->device, sizeof(nid->device)); astrncpy(ups->master_name, ups->device, sizeof(ups->master_name)); astrncpy(ups->upsclass.long_name, "Net Slave", sizeof(up...
false
false
false
false
false
0
spu_set_bus_mode(struct if_spi_card *card, u16 mode) { int err = 0; u16 rval; /* set bus mode */ err = spu_write_u16(card, IF_SPI_SPU_BUS_MODE_REG, mode); if (err) return err; /* Check that we were able to read back what we just wrote. */ err = spu_read_u16(card, IF_SPI_SPU_BUS_MODE_REG, &rval); if (err) re...
false
false
false
false
false
0
arvo_sysfs_set_actual_profile(struct device *dev, struct device_attribute *attr, char const *buf, size_t size) { struct arvo_device *arvo = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev->parent->parent)); struct arvo_actual_profil...
false
false
false
false
false
0
H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/) { H5HL_t *heap = NULL; /* Heap created */ H5HL_prfx_t *prfx = NULL; /* Heap prefix */ hsize_t total_size; /* Total heap size on disk */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NO...
false
false
false
false
false
0
check_arg (GPtrArray * files, const gchar * arg) { GDir *dir; if ((dir = g_dir_open (arg, 0, NULL))) { const gchar *entry; while ((entry = g_dir_read_name (dir))) { gchar *path; path = g_strconcat (arg, G_DIR_SEPARATOR_S, entry, NULL); check_arg (files, path); g_free (path); }...
false
false
false
false
false
0
thread_closure_free (ThreadClosure *closure) { /* The registry member is not referenced. */ g_main_context_unref (closure->main_context); g_main_loop_unref (closure->main_loop); g_cond_clear (&closure->main_loop_cond); g_mutex_clear (&closure->main_loop_mutex); /* The GError should be NULL at this point, * re...
false
false
false
false
false
0
QueryQuad(HashTable h, int p, int q, int r, int s) { struct hash hash; Hash hptr; SetupQuad(p, q, r, s, &hash); hptr = _QueryHash(h, &hash); if (hptr) return hptr->index; else return -1; }
false
false
false
false
false
0
x264_cabac_mvd( x264_t *h, x264_cabac_t *cb, int i_list, int idx, int width ) { ALIGNED_4( int16_t mvp[2] ); int mdx, mdy; /* Calculate mvd */ x264_mb_predict_mv( h, i_list, idx, width, mvp ); mdx = h->mb.cache.mv[i_list][x264_scan8[idx]][0] - mvp[0]; mdy = h->mb.cache.mv[i_list][x264_scan8[idx...
false
false
false
false
false
0
SetTextFormat(const char* text, ...) { va_list ap; va_start(ap, text); char temp[256]; if(text == NULL) { my_text = ""; return; } if(text[0] == 0) { my_text = ""; return; } vsprintf(temp, text, ap); SetText(temp); va_end(ap); }
false
false
false
false
false
0
logWarning(bool condition, const char *format, ...) { if(condition && logOpenFile()) { fputs("WARNING : ", gLogFP); va_list args; va_start(args, format); vfprintf(gLogFP, format, args); fputc('\n', gLogFP); va_end(args); fflush(gLogFP); } }
false
false
false
false
true
1
enet_socket_send (ENetSocket socket, const ENetAddress * address, const ENetBuffer * buffers, size_t bufferCount) { struct msghdr msgHdr; struct sockaddr_in sin; int sentLength; memset (& msgHdr, 0, sizeof (struct msghdr)); if (address != NULL)...
false
false
false
false
false
0
get_sb_info_list_in_closed_block(Block *first_block, List *module_info_list, acc_state acc_st) { Block *bpt; List *list = NULL; for (bpt = first_block; bpt != NULL; bpt = bpt->next) { if (bpt->kind == SB) { Block_info *b ...
false
false
false
false
false
0
getpageb(DBM *db, long int hash, bool update) { int hbit; long dbit; long hmask; /* * all important binary trie traversal */ dbit = 0; hbit = 0; while (dbit < db->maxbno && getdbit(db, dbit)) dbit = 2 * dbit + ((hash & (1 << hbit++)) ? 2 : 1); debug(("dbit: %ld...", dbit)); hmask = masks[hbit]; if ...
false
false
false
false
false
0
addFrameTextureName(const String& name) { setContentType(CONTENT_NAMED); mTextureLoadFailed = false; mFrames.push_back(name); // Add blank pointer, load on demand mFramePtrs.push_back(TexturePtr()); // Load immediately if Material loaded if (isLoaded()) ...
false
false
false
false
false
0
New_pscoast_Ctrl () { /* Allocate and initialize a new control structure */ int k; struct PSCOAST_CTRL *C; C = (struct PSCOAST_CTRL *) GMT_memory (VNULL, (size_t)1, sizeof (struct PSCOAST_CTRL), "New_pscoast_Ctrl"); /* Initialize values whose defaults are not 0/FALSE/NULL */ C->A.info.high = GMT_MAX_GSHHS_LEVEL...
false
false
false
false
false
0
fs_uae_state_dir_path() { static const char *path = NULL; if (path == NULL) { fs_log("fs_uae_state_dir:\n"); path = fs_config_get_const_string("state_dir"); if (path && path[0]) { fs_log("state_dir was explicitly set to: %s\n", path); char *expanded_path = fs_uae_...
false
false
false
false
false
0
AddMapping(wxSizer *sizer, XmlNodeMapping &mapping, bool differing) { // display differing text in red? Not sure how to do that... using italic // use a big bold font for the high priority items wxFont priority_font = GetFont(); priority_font.SetWeight( wxFONTWEIGHT_BOLD ); // italic for changed items w...
false
false
false
false
false
0
djnz_r4(void) { UINT8 i=M_RDMEM_OPCODE(); R4--; if (R4 != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; } else ADJUST_CYCLES }
false
false
false
false
false
0
dummy_driver_run_cycle (dummy_driver_t *driver) { jack_engine_t *engine = driver->engine; int wait_status; float delayed_usecs; jack_nframes_t nframes = dummy_driver_wait (driver, -1, &wait_status, &delayed_usecs); if (nframes == 0) { /* we detected an xrun and restarted: notify * clients about the ...
false
false
false
false
false
0
connect_event(GIOChannel *chan, GError *err, gpointer user_data) { struct network_adapter *na = user_data; if (err) { error("%s", err->message); setup_destroy(na); return; } g_io_channel_set_close_on_unref(chan, TRUE); na->setup->watch = g_io_add_watch_full(chan, G_PRIORITY_DEFAULT, G_IO_IN | G_IO_HUP...
false
false
false
false
false
0
rehash (Hash *t) { int nold = nhash(t); Node *vold = nodevector(t); int nnew = newsize(t); int i; nodevector(t) = hashnodecreate(nnew); nhash(t) = nnew; nuse(t) = 0; for (i=0; i<nold; i++) { Node *n = vold+i; if (ttype(val(n)) != LUA_T_NIL) { *luaH_present(t, ref(n)) = *n; /* copy old nod...
false
false
false
false
false
0
board_is_false_eyelike(struct board *board, coord_t coord, enum stone eye_color) { enum stone color_diag_libs[S_MAX] = {0, 0, 0, 0}; /* XXX: We attempt false eye detection but we will yield false * positives in case of http://senseis.xmp.net/?TwoHeadedDragon :-( */ foreach_diag_neighbor(board, coord) { color_d...
false
false
false
false
false
0
xmms_xform_get_url (xmms_xform_t *xform) { const gchar *url = NULL; xmms_xform_t *x; x = xform; while (!url && x) { url = xmms_xform_indata_get_str (x, XMMS_STREAM_TYPE_URL); x = x->prev; } return url; }
false
false
false
false
false
0
traverseSparkQueue (evac_fn evac, void *user, Capability *cap) { StgClosure **sparkp; SparkPool *pool; StgWord top,bottom, modMask; pool = cap->sparks; ASSERT_WSDEQUE_INVARIANTS(pool); top = pool->top; bottom = pool->bottom; sparkp = (StgClosurePtr*)pool->elements; modMask = p...
false
false
false
false
false
0
prune_cache_entries(void) { unsigned int i; long freed = 0; for (i = 0; i < drc_hashsize; i++) { struct nfsd_drc_bucket *b = &drc_hashtbl[i]; if (list_empty(&b->lru_head)) continue; spin_lock(&b->cache_lock); freed += prune_bucket(b); spin_unlock(&b->cache_lock); } return freed; }
false
false
false
false
false
0
ov772x_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *format) { struct v4l2_mbus_framefmt *mf = &format->format; const struct ov772x_color_format *cfmt; const struct ov772x_win_size *win; if (format->pad) return -EINVAL; ov772x_select_params(mf, &cfmt, &win);...
false
false
false
false
false
0
sge_scheduler_cleanup_event_client(sge_evc_class_t *evc) { DENTER(TOP_LAYER, "sge_scheduler_cleanup_event_client"); sge_mirror_shutdown(evc); DRETURN_VOID; }
false
false
false
false
false
0
ignoreError(const std::string &text) { RecMutex::Guard guard = Logger::lock(); BOOST_FOREACH(const std::string &entry, m_knownErrors) { if (text.find(entry) != text.npos) { return true; } } return false; }
false
false
false
false
false
0
unquote(char *unquoted, char *arg, char *end, char quotes[]) { char *p; int insq = 0; int indq = 0; p = arg; while (p < end) { if (*p == SQ) { if (insq) { insq = 0; p++; } else if (indq) { *unquoted++ = *p++; } else { insq = 1; p++; } } else if (*p == DQ) { if (...
false
false
false
false
false
0
amdgpu_gart_table_ram_alloc(struct amdgpu_device *adev) { void *ptr; ptr = pci_alloc_consistent(adev->pdev, adev->gart.table_size, &adev->gart.table_addr); if (ptr == NULL) { return -ENOMEM; } #ifdef CONFIG_X86 if (0) { set_memory_uc((unsigned long)ptr, adev->gart.table_size >> PAGE_SHIFT); }...
false
false
false
false
false
0
completion_get(command_ty *) { complete_ty *result; string_ty *project_name; project_ty *pp; int incomplete_change_number; arglex2_retable(0); arglex(); project_name = 0; incomplete_change_number = 0; while (arglex_token != arglex_token_eoln) { switch (ar...
false
false
false
false
false
0
rt2x00mac_config(struct ieee80211_hw *hw, u32 changed) { struct rt2x00_dev *rt2x00dev = hw->priv; struct ieee80211_conf *conf = &hw->conf; /* * mac80211 might be calling this function while we are trying * to remove the device or perhaps suspending it. */ if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags...
false
false
false
false
false
0
GeoIP_id_by_addr_gl(GeoIP * gi, const char *addr, GeoIPLookup * gl) { unsigned long ipnum; int ret; if (addr == NULL) { return 0; } if (gi->databaseType != GEOIP_COUNTRY_EDITION && gi->databaseType != GEOIP_LARGE_COUNTRY_EDITION && gi->databaseType != GEOIP_PROXY_EDITION && ...
false
false
false
false
false
0
exo_die_desktop_model_collect_readdir (ExoDieDesktopModel *desktop_model, const gchar *dir_path) { ExoDieDesktopItem *desktop_item; const gchar *name; GSList *items = NULL; gchar *path; GDir *dp; /* try to open the dire...
false
false
false
false
false
0
bt_detect(struct si_sm_data *bt) { /* * It's impossible for the BT status and interrupt registers to be * all 1's, (assuming a properly functioning, self-initialized BMC) * but that's what you get from reading a bogus address, so we * test that first. The calling routine uses negative logic. */ if ((BT_ST...
false
false
false
false
false
0
checkNestedLayers() { Poppler::Document *doc; doc = Poppler::Document::load("../../../test/unittestcases/NestedLayers.pdf"); QVERIFY( doc ); QVERIFY( doc->hasOptionalContent() ); Poppler::OptContentModel *optContent = doc->optionalContentModel(); QModelIndex index; index = optContent->ind...
false
false
false
false
false
0
can_continue_hex(const char* c) { switch (*c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': return c + 1; defau...
false
false
false
false
false
0
CreateAnother(void) const { ::itk::LightObject::Pointer smartPtr; Pointer copyPtr = Self::New(); copyPtr->SetNode(0, this->GetNode(0) ); copyPtr->SetNode(1, this->GetNode(1) ); copyPtr->SetMaterial( this->GetMaterial() ); copyPtr->SetGlobalNumber( this->GetGlobalNumber() ); smartPtr = static_cast<Pointe...
false
false
false
false
false
0
read_metadata_block_data_vorbis_comment_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_VorbisComment *block) { unsigned i; FLAC__Metadata_SimpleIteratorStatus status; const unsigned num_comments_len = FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN / 8; FLAC__byte buffer[4]; /*...
false
false
false
false
false
0
on_add_a_difference_activate (GtkMenuItem *menuitem, gpointer user_data) { int lp; for(lp=1 ; lp <= MAX_WINS; lp ++) if(sp->im_widget[lp] == NULL) { fileselection_hook=load_diff_from_file; fileselection1_for_image_num_g= lp; show_f...
false
false
false
false
false
0
e_cal_backend_http_get_object_list (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *sexp, GSList **objects, ...
false
false
false
false
false
0
c_fixts(struct Luser *lptr, struct NickInfo *nptr, int ac, char **av) { int tsdelta = 0; time_t now = 0; struct Channel *cptr = NULL; char dMsg[] = "Detected channel \002%s\002 with TS %d " "below TS_MAX_DELTA %d"; int acnt = 0; char **arv = NULL; char line[MAXLINE + 1]; if (...
true
true
false
false
true
1
marshall_REPLICS (sbpp, magic, fmd_entry, rep_entry, errcode) char **sbpp; int magic; struct Cns_file_metadata *fmd_entry; struct Cns_file_replica *rep_entry; int errcode; { int n; char *sbp; if (! sbpp) { n = strlen (fmd_entry->guid) + 1; n += LONGSIZE; n += HYPERSIZE; n += TIME_TSIZE; n += strlen (fmd_e...
false
false
false
false
false
0
Blur_ (MolComplexS *mol_complexSP, int mol_complexesN, RuntimeS *runtimeSP, ConfigS *configSP, GUIS *guiSP, NearestAtomS *nearest_atomSP, size_t pixelsN, unsigned int *refreshIP, char *stringP) { char *remainderP; char tokenA[SHORTSTRINGSIZE]; char *P; int n; int width, height; /* Set the blur flag to...
false
false
false
false
false
0
python_init (void) { const gchar *argv = g_get_prgname (); if (Py_IsInitialized ()) return; Py_InitializeEx (0); PySys_SetArgv (1, (char **) &argv); }
false
false
false
false
false
0
is_admin(user_t *user) { if (UF_ADMIN & user->flags) return true; return false; }
false
false
false
false
false
0
regmap_check_range_table(struct regmap *map, unsigned int reg, const struct regmap_access_table *table) { /* Check "no ranges" first */ if (regmap_reg_in_ranges(reg, table->no_ranges, table->n_no_ranges)) return false; /* In case zero "yes ranges" are supplied, any reg is OK */ if (!table->n_yes_ranges)...
false
false
false
false
false
0
free_process_list(job_elem_t *job_elem) { lnk_link_t *currp; /* free process list */ while((currp=job_elem->procs.next) != &job_elem->procs) { LNK_DELETE(currp); free(LNK_DATA(currp, proc_elem_t, link)); } }
false
false
false
false
true
1
adv7183_writeregs(struct v4l2_subdev *sd, const unsigned char *regs, unsigned int num) { unsigned char reg, data; unsigned int cnt = 0; if (num & 0x1) { v4l2_err(sd, "invalid regs array\n"); return -1; } while (cnt < num) { reg = *regs++; data = *regs++; cnt += 2; adv7183_write(sd, reg, data); } ...
false
false
false
false
false
0
ktest_equal_external_principal_identifier( krb5_external_principal_identifier *ref, krb5_external_principal_identifier *var) { int p = TRUE; if (ref == var) return TRUE; else if (ref == NULL || var == NULL) return FALSE; p = p && equal_str(subjectName); p = p && equal_str(issuerAndSerialNumb...
false
false
false
false
false
0
eb_finalize_appendix(EB_Appendix *appendix) { LOG(("in: eb_finalize_appendix(appendix=%d)", (int)appendix->code)); appendix->code = EB_BOOK_NONE; if (appendix->path != NULL) { free(appendix->path); appendix->path = NULL; } appendix->path_length = 0; appendix->disc_code = EB_DISC_INVALID; ...
false
false
false
false
false
0
fetch_refs_via_pack(struct transport *transport, int nr_heads, struct ref **to_fetch) { struct git_transport_data *data = transport->data; char **heads = xmalloc(nr_heads * sizeof(*heads)); char **origh = xmalloc(nr_heads * sizeof(*origh)); const struct ref *refs; char *dest = xstrdup(transport->url); s...
false
false
false
false
false
0