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 |
|---|---|---|---|---|---|---|
AslCommonError (
UINT8 Level,
UINT8 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
UINT32 Column,
char *Filename,
char ... | false | false | false | false | false | 0 |
dltype_to_lhs(int dltype)
{
int lhs;
switch(dltype) {
case DLT_EN10MB:
#ifdef DLT_IEEE802
case DLT_IEEE802:
#endif
lhs = 14;
break;
case DLT_SLIP:
case DLT_SLIP_BSDOS:
lhs = 16;
break;
case DLT_PPP:
case DLT_NULL:
#ifdef DLT_PPP_SERIAL
case DLT_PPP_SERIAL:
#endif
#ifdef DLT_LOOP
case DLT_LOOP:
#endif... | false | false | false | false | false | 0 |
test_parse_with_library (void)
{
GError *error = NULL;
GckUriData *uri_data = NULL;
uri_data = gck_uri_parse ("pkcs11:library-description=The%20Library;library-manufacturer=Me",
GCK_URI_FOR_MODULE, &error);
g_assert (uri_data);
g_assert (uri_data->module_info);
g_assert_cmpstr (uri_da... | false | false | false | false | false | 0 |
getService(void)
{
UBool needsInit;
UMTX_CHECK(NULL, (UBool)(gService == NULL), needsInit);
if (needsInit) {
ICULocaleService *tService = new ICUBreakIteratorService();
umtx_lock(NULL);
if (gService == NULL) {
gService = tService;
tService = NULL;
... | false | false | false | false | false | 0 |
addhistory (void)
{
uae_u32 pc = m68k_getpc ();
// if (!notinrom())
// return;
history[lasthist] = regs;
history[lasthist].pc = m68k_getpc ();
if (++lasthist == MAX_HIST)
lasthist = 0;
if (lasthist == firsthist) {
if (++firsthist == MAX_HIST) firsthist = 0;
}
} | false | false | false | false | false | 0 |
Configure()
{
cmLocalGenerator* previousLg =
this->GetGlobalGenerator()->GetCurrentLocalGenerator();
this->GetGlobalGenerator()->SetCurrentLocalGenerator(this);
// make sure the CMakeFiles dir is there
std::string filesDir = this->Makefile->GetStartOutputDirectory();
filesDir += cmak... | false | false | false | false | false | 0 |
match_job(
lList **job_list,
lList *owner_list,
lList *queue_list,
lList *complex_list,
lList *exec_host_list,
lList *request_list
) {
lListElem *jep;
lListElem *dep;
lListElem *jatep;
int show;
DENTER(GUI_LAYER, "match_job");
jep = lFirst(*job_list);
while (jep) {
/*
** first of al... | false | false | false | false | false | 0 |
options_trial_assign(config_line_t *list, int use_defaults,
int clear_first, char **msg)
{
int r;
or_options_t *trial_options = options_dup(&options_format, get_options());
if ((r=config_assign(&options_format, trial_options,
list, use_defaults, clear_first, msg)) < 0)... | false | false | false | false | false | 0 |
checkIndex()
{
if (index() < 0)
{
lock();
setIndex(0);
unlock();
}
} | false | false | false | false | false | 0 |
write_inner(const wchar_t *data, size_t len)
{
trace(("wide_output_head::write(this = %08lX, date = %08lX, "
"len = %ld)\n{\n", (long)this, (long)data, (long)len));
while (how_many_lines > 0 && len > 0)
{
wchar_t wc = *data++;
--len;
deeper->put_wc(wc);
prev_was_newl... | false | false | false | false | false | 0 |
create_one_file(char *path, unsigned mode, const char *buf, unsigned long size)
{
if (cached)
return;
if (!try_create_file(path, mode, buf, size))
return;
if (errno == ENOENT) {
if (safe_create_leading_directories(path))
return;
if (!try_create_file(path, mode, buf, size))
return;
}
if (errno == EE... | false | false | false | false | false | 0 |
bird_print(FILE *fp,
struct term *t)
{
struct rel *r;
if (t == NULL)
fprintf(fp, "(nil)");
else if (!is_symbol(t, "a", 2)) {
/* t is not of the form a(_,_), so print in prefix */
if (t->type == NAME) /* name */
fprintf(fp, "%s", sn_to_str(t->sym_num));
else if (t->type == VARIA... | false | false | false | false | false | 0 |
allocate()
{
allocated = 1;
int n = atom->ndihedraltypes;
memory->create(a1,n+1,"dihedral:a1");
memory->create(a2,n+1,"dihedral:a2");
memory->create(a3,n+1,"dihedral:a3");
memory->create(a4,n+1,"dihedral:a4");
memory->create(a5,n+1,"dihedral:a5");
memory->create(setflag,n+1,"dihedral:setflag");
for ... | false | false | false | false | false | 0 |
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_SERVICE_Context *service = cls;
struct GNUNET_SERVER_Handle *server = service->server;
service->shutdown_task = GNUNET_SCHEDULER_NO_TASK;
if (0 != (service->options & GNUNET_SERVICE_OPTION_SOFT_SHUTDOWN))
GNUNET_SERVER... | false | false | false | false | false | 0 |
findNextInstanceOfString(const std::vector<int>* seqsSelected, int firstSeq,
Viewer viewerSearched)
{
int size = seqsSelected->size();
bool found = false;
for(int i = searchBeginSeq; i < (size + firstSeq - 1); i++)
{
if((*seqsSelected)[i - fi... | false | false | false | false | false | 0 |
deleteSubAndPurgeFile(DcmDirectoryRecord *dirRec)
{
DcmDirectoryRecord *subDirRec = OFstatic_cast(DcmDirectoryRecord *, lowerLevelList->remove(dirRec));
errorFlag = lowerLevelList->error();
if (subDirRec != NULL)
{
DcmDirectoryRecord *localSubRefMRDR = subDirRec->getReferencedMRDR();
if... | false | false | false | false | false | 0 |
addWidget(QGraphicsItem *widget)
{
if (!widget) {
return;
}
if (widget == d->mChildItem)
return;
if (d->mChildItem != 0) {
d->mChildItem->setParentItem(0);
delete d->mChildItem;
}
if (widget) {
widget->setParentItem(this);
d->mChildItem = widget;
}
} | false | false | false | false | false | 0 |
jsm_tty_start_tx(struct uart_port *port)
{
struct jsm_channel *channel =
container_of(port, struct jsm_channel, uart_port);
jsm_dbg(IOCTL, &channel->ch_bd->pci_dev, "start\n");
channel->ch_flags &= ~(CH_STOP);
jsm_tty_write(port);
jsm_dbg(IOCTL, &channel->ch_bd->pci_dev, "finish\n");
} | false | false | false | false | false | 0 |
on_textChanged( const QString& text )
{
if ( hasAcceptableInput() ) {
double value = text.toDouble();
if ( value >= m_minimum && value <= m_maximum )
internalSetValue( value );
}
} | false | false | false | false | false | 0 |
ReadGeometryFromMAPFile(TABMAPFile *poMapFile,
TABMAPObjHdr *poObjHdr,
GBool /*bCoordBlockDataOnly=FALSE*/,
TABMAPCoordBlock ** /*ppoCoordBlock=NULL*/)
{
TABMAPObjectBlock *poObj... | false | false | false | false | false | 0 |
clear_gigantic_page(struct page *page,
unsigned long addr,
unsigned int pages_per_huge_page)
{
int i;
struct page *p = page;
might_sleep();
for (i = 0; i < pages_per_huge_page;
i++, p = mem_map_next(p, page, i)) {
cond_resched();
clear_user_highpage(p, addr + i * PAGE_SIZE);
}
} | false | false | false | false | false | 0 |
initialize_cut_list(int max_cut /* maximum number of cuts in the list */)
{
cut_list *cuts;
cuts = reinterpret_cast<cut_list *> (calloc(1,sizeof(cut_list)));
if ( cuts == NULL ) alloc_error(const_cast<char*>("cuts"));
cuts->cnum = 0;
cuts->list = reinterpret_cast<cut **> (calloc(max_cut,sizeof(cut *)));
r... | false | false | false | false | false | 0 |
print_element_features (const gchar * element_name)
{
GstPluginFeature *feature;
/* FIXME implement other pretty print function for these */
feature = gst_default_registry_find_feature (element_name,
GST_TYPE_INDEX_FACTORY);
if (feature) {
n_print ("%s: an index\n", element_name);
return 0;
}
... | false | false | false | false | false | 0 |
mail_config_security_page_cert_selected (ECertSelector *selector,
const gchar *key,
GtkEntry *entry)
{
if (key != NULL)
gtk_entry_set_text (entry, key);
gtk_widget_destroy (GTK_WIDGET (selector));
} | false | false | false | false | false | 0 |
gather_mem_refs_in_loops (void)
{
gimple_stmt_iterator bsi;
basic_block bb;
struct loop *loop;
loop_iterator li;
bitmap lrefs, alrefs, alrefso;
FOR_EACH_BB (bb)
{
loop = bb->loop_father;
if (loop == current_loops->tree_root)
continue;
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); ... | false | false | false | false | false | 0 |
picolcd_check_version(struct hid_device *hdev)
{
struct picolcd_data *data = hid_get_drvdata(hdev);
struct picolcd_pending *verinfo;
int ret = 0;
if (!data)
return -ENODEV;
verinfo = picolcd_send_and_wait(hdev, REPORT_VERSION, NULL, 0);
if (!verinfo) {
hid_err(hdev, "no version response from PicoLCD\n");
... | false | false | false | false | false | 0 |
write_entries(git_index *index, git_filebuf *file)
{
int error = 0;
size_t i;
git_vector case_sorted, *entries;
git_index_entry *entry;
if (git_mutex_lock(&index->lock) < 0) {
giterr_set(GITERR_OS, "Failed to lock index");
return -1;
}
/* If index->entries is sorted case-insensitively, then we need
* to ... | false | false | false | false | false | 0 |
ParseField(const unsigned char *begin,
const unsigned char *end)
{
const RecordStateTableField *field = (const RecordStateTableField *) begin;
// advance and check size
begin += sizeof(RecordStateTableField);
if( begin > end ) // if begin==end, we are ok
return begin;
State state;
state.Index = btohs... | false | false | false | false | false | 0 |
zgc_zalloc(zone_t *zone)
{
struct zone_gc *zg = zone->zn_gc;
unsigned i;
struct subzinfo *szi;
char **blk;
g_assert(spinlock_is_held(&zone->lock));
zstats.allocations_gc++;
/*
* Lookup for free blocks in each subzone, scanning them from the first
* one known to have free blocks and moving up. By attempti... | false | false | false | false | false | 0 |
add_node(struct ubifs_info *c, void *buf, int *lnum, int *offs,
void *node)
{
struct ubifs_ch *ch = node;
int len = le32_to_cpu(ch->len), remains = c->leb_size - *offs;
if (len > remains) {
int sz = ALIGN(*offs, c->min_io_size), err;
ubifs_pad(c, buf + *offs, sz - *offs);
err = ubifs_leb_change(c, *lnu... | false | true | false | false | false | 1 |
z2alu (int z) throw (except_done)
{
MLayer::iterator itLayer, endLayer;
endLayer = ALU2Z.end ();
for (itLayer = ALU2Z.begin(); itLayer != endLayer; itLayer++) {
if (isALU(itLayer->first) && (itLayer->second == z))
return (itLayer->first);
}
cerr << herr ("CEnv::z2alu ():\n");
cerr << " Z inde... | false | false | false | false | false | 0 |
acdAttrTestValue(const AcdPAcd thys,const char *attrib)
{
AcdPAttr attr;
AjPStr *attrstr;
AcdPAttr defattr = acdAttrDef;
AjPStr *defstr;
ajint i;
attrstr = thys->AttrStr;
defstr = thys->DefStr;
if(acdIsQtype(thys))
attr = acdType[thys->Type].Attr;
else
attr = acdKeywords[thys... | false | false | false | false | false | 0 |
append_operand_real_arg(IntSet du_v_set,
IntSet du_a_set,
IntSet du_t_set,
IntSet loop_set,
Operand **a_head,
Operand *a_tail,
Operand *op)
{
Operand *arg_tail = a_tail;
... | false | false | false | false | false | 0 |
dofcc()
{
register char *bufptr;
char byte;
char delimiter;
register char *reglineptr;
bufptr = databuf.fcbuf;
reglineptr = symname;
if ((delimiter = *reglineptr) != EOLCHAR)
++reglineptr;
while (TRUE)
{
if ((byte = *reglineptr) == EOLCHAR)
{
symname = reglineptr;
error... | false | false | false | false | false | 0 |
findJobInMemmory(const char* jobid)
{
if (curJob->jobid == jobid) // fast check
return (curJob);
Job** jpp = (Job**) jobs.find(jobid);
if (jpp)
return (*jpp);
return (jobid == defJob.jobid ? &defJob : (Job*) NULL);
} | false | false | false | false | false | 0 |
barchart_calculation(GtkChart *chart)
{
gint blkw;
DB( g_print("\n[gtkchart] bar calculation\n") );
//if expand : we compute available space
//chart->barw = MAX(32, (chart->graph_width)/chart->entries);
//chart->barw = 32; // usr setted or defaut to BARW
blkw = chart->barw + 3;
if( chart->dual )
blkw = (ch... | false | false | false | false | false | 0 |
ReadLine(unsigned int line_number, char *buf, unsigned int nBytes)
{
if(!fptr)
return 0;
fseek(fptr,
line_seek[line_number],
SEEK_SET);
return fgets(buf, nBytes, fptr);
} | false | false | false | false | false | 0 |
__setplane_internal(struct drm_plane *plane,
struct drm_crtc *crtc,
struct drm_framebuffer *fb,
int32_t crtc_x, int32_t crtc_y,
uint32_t crtc_w, uint32_t crtc_h,
/* src_{x,y,w,h} values are 16.16 fixed point */
uint32_t src_x, uint32_t src_y,
uint32_... | false | false | false | false | false | 0 |
patternRow4Pixels2(unsigned short *pFrame,
unsigned char pat0,
unsigned short *p)
{
unsigned char mask=0x03;
unsigned char shift=0;
unsigned short pel;
/* ORIGINAL VERSION IS BUGGY
int skip=1;
while (mask != 0)
{
pel = p[(mask &... | false | false | false | false | false | 0 |
AddKeyToKeyRing(KeyRing *kr, unsigned char key)
{
if (((kr->head + 1) % KEYRINGSIZE) != (kr->tail % KEYRINGSIZE)) {
kr->contents[kr->head % KEYRINGSIZE] = key;
kr->head = (kr->head + 1) % KEYRINGSIZE;
return 1;
}
/* KeyRing overflow: do not accept extra key */
return 0;
} | false | false | false | false | false | 0 |
test_blame_buffer__add_lines_at_end(void)
{
const char *buffer = "\
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n\
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n\
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n\... | false | false | false | false | false | 0 |
ArcPath(opvp_arcmode_t kind, opvp_arcdir_t dir,
opvp_fix_t bbx0, opvp_fix_t bby0, opvp_fix_t bbx1,
opvp_fix_t bby1, opvp_fix_t x0, opvp_fix_t y0, opvp_fix_t x1, opvp_fix_t y1)
{
if (!supportArcPath) {
*opvpErrorNo_0_2 = OPVP_NOTSUPPORTED_0_2;
return -1;
}
/* opvp_arcmode_t is compatible with int */
... | false | false | false | false | false | 0 |
makeCacheCleanerCommand(const HTTPProtocol::CacheTag &cacheTag,
CacheCleanerCommandCode cmd)
{
QByteArray ret = cacheTag.serialize();
QDataStream stream(&ret, QIODevice::WriteOnly);
stream.setVersion(QDataStream::Qt_4_5);
stream.skipRawData(BinaryCacheFileHeade... | false | false | false | false | false | 0 |
drawHSeparator(Window window_,int x_,int y_,int width_,int height_)
{
if (height_>1)
{
int halfHeight=height_/2;
XBFillRectangle(display(),window_,bottomShadowGC(),x_,y_,width_,halfHeight);
XFillRectangle(display(),window_,topShadowGC(),x_,y_+halfHeight,width_,halfHeight);
}
} | false | false | false | false | false | 0 |
image_notify_cb(FileData *fd, NotifyType type, gpointer data)
{
ImageWindow *imd = data;
if (!imd || !image_get_pixbuf(imd) ||
/* imd->il || */ /* loading in progress - do not check - it should start from the beginning anyway */
!imd->image_fd || /* nothing to reload */
imd->state == IMAGE_STATE_NONE ... | false | false | false | false | false | 0 |
newenv(unsigned char **old, unsigned char *s)
{
unsigned char **new;
int x, y, z;
for (x = 0; old[x]; ++x) ;
new = (unsigned char **) joe_malloc((x + 2) * sizeof(unsigned char *));
for (x = 0, y = 0; old[x]; ++x) {
for (z = 0; s[z] != '='; ++z)
if (s[z] != old[x][z])
break;
if (s[z] == '=') {
if (s... | false | false | false | false | false | 0 |
set_vw_size(struct camera_data *cam, int size)
{
int retval = 0;
cam->params.vp_params.video_size = size;
switch (size) {
case VIDEOSIZE_VGA:
DBG("Setting size to VGA\n");
cam->params.roi.width = STV_IMAGE_VGA_COLS;
cam->params.roi.height = STV_IMAGE_VGA_ROWS;
cam->width = STV_IMAGE_VGA_COLS;
cam->heigh... | false | false | false | false | false | 0 |
genSubBlk( Junction *q )
#else
genSubBlk( q )
Junction *q;
#endif
{
int max_k;
set f;
int need_right_curly;
int lastAltEmpty; /* MR23 */
set savetkref;
savetkref = tokensRefdInBlock;
require(q->ntype == nJunction, "genSubBlk: not junction");
require(q->jtype == aSubBlk, "genSubBlk: not subblock");
OutLine... | false | false | false | false | false | 0 |
Get(uint32_t index) {
ON_BAILOUT("v8::Object::Get()", return Local<v8::Value>());
ENTER_V8;
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
EXCEPTION_PREAMBLE();
i::Handle<i::Object> result = i::GetElement(self, index);
has_pending_exception = result.is_null();
EXCEPTION_BAILOUT_CHECK(Local<Value>(... | false | false | false | false | false | 0 |
get_title(void)
{
int fd[2];
ssize_t rd;
const char *wid;
char *p1, *p2, title[128];
pid_t pid;
struct sigaction act;
if ( (wid = getenv("WINDOWID")) == 0)
return 0;
if (pipe(fd) < 0 || (pid = fork()) < 0)
return 0;
if (pid == 0) {
/* this is the child process */
close(fd[0]); /* close read end */
... | false | false | false | false | false | 0 |
linespec(unsigned lineIndex, LineSpecInput lineSpec)
{
//* Store but no process
if (lineIndex<=0) {
throw out_of_range("Line index must be a positive integer");
}
this->lineSpecInput.push_back({lineIndex, lineSpec});
} | false | false | false | false | false | 0 |
bucheron (noeudPtr s)
{
if (s->path != NULL)
delete [] s->path;
if (s->l1)
bucheron (s->l1);
if (s->l2)
bucheron (s->l2);
if (s->l3)
bucheron (s->l3);
if (s->l4)
bucheron (s->l4);
delete s;
s = NULL;
} | false | false | false | false | false | 0 |
data_query_resource(dns_cache_rrset_t *rrset, data_config_t *conf, dns_msg_question_t *q, dns_tls_t *tls)
{
int i, hashval, index, count = 0;
dns_msg_resource_t res;
data_hash_t *hash;
data_record_t *record, *p;
if (conf->conf_hashsize == 0)
return -1;
hashval = data_hash_index(q->mq_n... | false | false | false | false | false | 0 |
search_stats_gui_sort_save(void)
{
#if GTK_CHECK_VERSION(2,6,0)
GtkTreeSortable *sortable;
GtkSortType order;
int column;
sortable = GTK_TREE_SORTABLE(store_search_stats);
if (gtk_tree_sortable_get_sort_column_id(sortable, &column, &order)) {
search_stats_sort_column = column;
search_stats_sort_order = order;... | false | false | false | false | false | 0 |
tryall_dlopen (lt_dlhandle *phandle, const char *filename,
lt_dladvise advise, const lt_dlvtable *vtable)
{
lt_dlhandle handle = handles;
const char * saved_error = 0;
int errors = 0;
#ifdef LT_DEBUG_LOADERS
fprintf (stderr, "tryall_dlopen (%s, %s)\n",
filename ? filename : "(null)",
vtable ... | false | false | false | false | false | 0 |
GB_Error(const char *error, ...)
{
va_list args;
char *arg[4];
int i;
if (!error)
{
EXEC_set_native_error(FALSE);
return;
}
va_start(args, error);
for (i = 0; i < 4; i++)
arg[i] = va_arg(args, char *);
ERROR_define(error, arg);
EXEC_set_native_error(TRUE);
} | true | true | false | false | false | 1 |
write_exif_rational_tag_from_taglist (GstExifWriter * writer,
const GstTagList * taglist, const GstExifTagMatch * exiftag)
{
const GValue *value;
gdouble num = 0;
gint tag_size = gst_tag_list_get_tag_size (taglist, exiftag->gst_tag);
if (tag_size != 1) {
GST_WARNING ("Only the first item in the taglist... | false | false | false | false | false | 0 |
generate2(int genMethod, int grainFactor, int randomSeed)
{
int i,k;
iparmx = grainFactor * 8;
srand(randomSeed);
recur_level = 0;
if ( genMethod == 0) // use original method
{
sub_divide(0,0,max_x,max_y);
}
else // use new method
{
recur1 = i = k = 1;
wh... | false | false | false | false | false | 0 |
check_result()
{
const char* mess= "Result content mismatch\n";
DBUG_ENTER("check_result");
DBUG_ASSERT(result_file_name);
DBUG_PRINT("enter", ("result_file_name: %s", result_file_name));
switch (compare_files(log_file.file_name(), result_file_name)) {
case RESULT_OK:
break; /* ok */
case RESULT_LEN... | false | false | false | false | false | 0 |
player_win(LettersItem *item)
{
gc_sound_play_ogg ("sounds/flip.wav", NULL);
g_assert(gcomprisBoard!=NULL);
gcomprisBoard->sublevel++;
gc_score_set(gcomprisBoard->sublevel);
g_ptr_array_remove(items,item);
g_ptr_array_add(items2del,item);
g_object_set (item->rootitem, "visibility", GOO_CANVAS_ITEM_IN... | false | false | false | false | false | 0 |
cterm_process_network(char *buf, int len)
{
int offset = 0;
while (offset < len)
{
DEBUG_CTERM("got msg: %d, len=%d\n",
buf[offset], len);
switch (buf[offset])
{
case CTERM_MSG_INITIATE:
offset += cterm_process_initiate(buf+offset, len-offset);
break;
case CTERM_MSG_START_READ:
offset += cte... | false | false | false | false | false | 0 |
doSize() const
{
if (cfg() == 0 || !decoded()) return TiffEntryBase::doSize();
if (elements_.empty()) return 0;
// Remaining assumptions:
// - array elements don't "overlap"
// - no duplicate tags in the array
uint32_t idx = 0;
uint32_t sz = cfg()->tagStep()... | false | false | false | false | false | 0 |
get_mortalspace(LONGLONG n, int datatype) {
LONGLONG datalen;
SV *work;
work = sv_2mortal(newSVpv("", 0));
datalen = sizeof_datatype(datatype) * n;
SvGROW(work,datalen);
/*
* One could imagine allocating some space with this routine,
* passing the pointer off to cfitsio, ending up with an error
*... | false | false | false | false | false | 0 |
gfire_p2p_natcheck_timeout(gpointer p_data)
{
gfire_p2p_natcheck *nat = (gfire_p2p_natcheck*)p_data;
// Check whether the server really timed out...
if(++nat->retries == 5)
{
purple_debug_error("gfire", "P2P: NAT Check: Server %d timed out...check failed!\n", nat->server + 1);
purple_input_remove(nat->prpl_inpa... | false | false | false | false | false | 0 |
apply2files(func, vargs, arg)
void (*func)_((const char *, void *));
VALUE vargs;
void *arg;
{
long i;
VALUE path;
struct RArray *args = RARRAY(vargs);
for (i=0; i<args->len; i++) {
path = args->ptr[i];
SafeStringValue(path);
(*func)(StringValueCStr(path), arg);
}
return args->l... | false | false | false | false | false | 0 |
del_assertion(void *va)
{
struct assert *a = va;
size_t i;
for (i = 0; i < a->nbval; i ++) del_token_fifo(a->val + i);
if (a->nbval) freemem(a->val);
freemem(a);
} | false | false | false | false | false | 0 |
in(word_t addr)
{
byte_t ret = 0xff;
switch (addr & 7)
{
case 0:
case 1:
case 2:
case 3:
_addr = (_addr & 0xffff) | ((addr & 3) << 16);
ret = _ram[_addr];
_addr = (_addr & 0xff00) | (((_addr & 0xff) + 1) & 0xff);
break;
default:
break;
}
return ret;
} | false | false | false | false | false | 0 |
atspi_editable_text_copy_text (AtspiEditableText *obj,
gint start_pos,
gint end_pos,
GError **error)
{
dbus_int32_t d_start_pos = start_pos, d_end_pos = end_pos;
g_return_val_if_fail (obj != NULL, FALSE);
_atspi_dbus_ca... | false | false | false | false | false | 0 |
in_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat) {
do {
int ch;
int w = get_utf8(z->p, z->c, z->l, & ch);
unless (w) return -1;
if (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return w;
z->c += w;
} while (repeat);
return 0;
} | false | false | false | false | false | 0 |
graphics_drawinfo_setsprite(Graphics_drawinfo *gd,SDL_Surface *sprite) {
if (sprite == gd->sprite) {
gd->flags &= ~(Graphics_SPRITECHANGED);
} else {
gd->flags |= Graphics_SPRITECHANGED;
}
gd->sprite = sprite;
} | false | false | false | false | false | 0 |
delipair_big(DBM *db, char *pag, int i)
{
unsigned short *ino = (unsigned short *) pag;
unsigned end = (i > 1) ? offset(ino[i - 1]) : DBM_PBLKSIZ;
unsigned koff = offset(ino[i]);
unsigned voff = offset(ino[i+1]);
bool status = TRUE;
g_assert(0x1 == (i & 0x1)); /* Odd position in page */
/* Free space used by ... | false | false | false | false | false | 0 |
store(longlong nr, bool unsigned_val)
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
my_decimal decimal_value;
int err;
if ((err= int2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
nr, unsigned_val, &decimal_value)))
{
if (check_overflow(err))
set_value_on_overflow(&decimal_value, de... | false | false | false | false | false | 0 |
spherematch_match2(PyObject* self, PyObject* args) {
int i, N;
long p1, p2;
struct dualtree_results2 dtresults;
kdtree_t *kd1, *kd2;
double rad;
PyObject* indlist;
anbool notself;
anbool permute;
// So that ParseTuple("b") with a C "anbool" works
assert(sizeof(anbool) == sizeof(unsigned ch... | false | false | false | false | false | 0 |
SSL_X509_INFO_load_file(apr_pool_t *ptemp,
STACK_OF(X509_INFO) *sk,
const char *filename)
{
BIO *in;
if (!(in = BIO_new(BIO_s_file()))) {
return FALSE;
}
if (BIO_read_filename(in, filename) <= 0) {
BIO_free(in);
return F... | false | false | false | false | false | 0 |
nouveau_fence_update(struct nouveau_channel *chan, struct nouveau_fence_chan *fctx)
{
struct nouveau_fence *fence;
int drop = 0;
u32 seq = fctx->read(chan);
while (!list_empty(&fctx->pending)) {
fence = list_entry(fctx->pending.next, typeof(*fence), head);
if ((int)(seq - fence->base.seqno) < 0)
break;
... | false | false | false | false | false | 0 |
MoveFoldTop() { /*FOLD00*/
int f = FindNearFold(VToR(CP.Row));
if (f <= 0)
return 0;
if (FF[f].line == VToR(CP.Row))
return 1;
return SetPosR(CP.Col, FF[f].line, tmLeft);
} | false | false | false | false | false | 0 |
process_pmgr_scatter (mvapich_state_t *st, int *rootp,
int *sizep, void **bufp, int rank)
{
if (recv_common_value (st, rootp, rank) < 0)
return (-1);
if (recv_common_value (st, sizep, rank) < 0)
return (-1);
if (rank != *rootp)
return (0);
if (*bufp == NULL)
*bufp = xmalloc (*sizep * st->nprocs);
mvapic... | false | false | false | false | false | 0 |
copia(const struct addrinfo *src, struct addrinfo &dst)
{
if (src->ai_family == PF_INET) {
dst.ai_family = src->ai_family;
dst.ai_addrlen = sizeof(struct sockaddr_in);
dst.ai_addr = (struct sockaddr *) malloc(sizeof(struct sockaddr_in));
((struct sockaddr_in *) dst.ai_addr)->sin_family = AF_INET;
((s... | false | false | false | false | true | 1 |
UpdateKeyCfg(void)
{
extern struct Button keycfg_bottoni[];
int i;
for (i = 0; i < 20; i++)
{
/* Uppercase conversion for ETW font */
const char *tmp = SDL_GetKeyName(query[i]);
int j = 0;
while(*tmp)
{
keys_names[i][j] = toupper(*tmp);
tm... | false | false | false | false | false | 0 |
SWIG_Python_FixMethods(PyMethodDef *methods,
swig_const_info *const_table,
swig_type_info **types,
swig_type_info **types_initial) {
size_t i;
for (i = 0; methods[i].ml_name; ++i) {
const char *c = methods[i].ml_doc;
if (c && (c = strstr(c, "swig_ptr: "))) {
int j;
swig_c... | false | false | false | false | false | 0 |
SanityCheckClosed(subsec_t *sub)
{
seg_t *cur, *next;
int total=0, gaps=0;
for (cur=sub->seg_list; cur; cur=cur->next)
{
next = cur->next ? cur->next : sub->seg_list;
if (cur->end->x != next->start->x || cur->end->y != next->start->y)
gaps++;
total++;
}
if (gaps > 0)
{
PrintMiniW... | false | false | false | false | false | 0 |
hsw_pte_encode(dma_addr_t addr,
enum i915_cache_level level,
bool valid, u32 unused)
{
gen6_pte_t pte = valid ? GEN6_PTE_VALID : 0;
pte |= HSW_PTE_ADDR_ENCODE(addr);
if (level != I915_CACHE_NONE)
pte |= HSW_WB_LLC_AGE3;
return pte;
} | false | false | false | false | false | 0 |
find_method_in_class (MonoClass *klass, const char *name, const char *qname, const char *fqname,
MonoMethodSignature *sig, MonoClass *from_class, MonoError *error)
{
int i;
/* Search directly in the metadata to avoid calling setup_methods () */
mono_error_init (error);
/* FIXME: !from_class->generic_clas... | false | false | false | false | false | 0 |
btrfs_bio_counter_sub(struct btrfs_fs_info *fs_info, s64 amount)
{
percpu_counter_sub(&fs_info->bio_counter, amount);
if (waitqueue_active(&fs_info->replace_wait))
wake_up(&fs_info->replace_wait);
} | false | false | false | false | false | 0 |
vrrp_complete_init(void)
{
list l;
element e;
vrrp_t *vrrp;
vrrp_sgroup_t *sgroup;
/* Complete VRRP instance initialization */
l = vrrp_data->vrrp;
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
vrrp = ELEMENT_DATA(e);
if (!vrrp_complete_instance(vrrp))
return 0;
}
/* Build synchronization group index *... | false | false | false | false | false | 0 |
G_SetClientFrame (edict_t *ent)
{
gclient_t *client;
qboolean duck, run;
if (ent->s.modelindex != 255)
return; // not in the player model
client = ent->client;
if (client->ps.pmove.pm_flags & PMF_DUCKED)
duck = true;
else
duck = false;
if (xyspeed)
run = true;
else
run = false;
// check for stan... | false | false | false | false | false | 0 |
load_option_file(const char *path)
{
struct io io = {};
/* It's OK that the file doesn't exist. */
if (!io_open(&io, "%s", path))
return;
config_lineno = 0;
config_errors = FALSE;
if (io_load(&io, " \t", read_option) == ERR ||
config_errors == TRUE)
warn("Errors while loading %s.", path);
} | false | false | false | false | false | 0 |
sim_ctl_get_portinfo(Client * cl, struct sim_ctl * ctl)
{
Port *p;
uint8_t port_num = ctl->data[0];
if (port_num == 0 || port_num > cl->port->node->numports)
p = cl->port;
else if (cl->port->node->type == SWITCH_NODE)
p = node_get_port(cl->port->node, port_num);
else
p = node_get_port(cl->port->node, port_nu... | false | false | false | false | false | 0 |
hdp_free_application(struct hdp_application *app)
{
if (app->dbus_watcher > 0)
g_dbus_remove_watch(app->conn, app->dbus_watcher);
if (app->conn != NULL)
dbus_connection_unref(app->conn);
g_free(app->oname);
g_free(app->description);
g_free(app->path);
g_free(app);
} | false | false | false | false | false | 0 |
extractChildren(tPPtr p, set<PPtr> & all) {
if (p->children().empty()) return;
for (PVector::const_iterator child = p->children().begin();
child != p->children().end(); ++child) {
all.insert(*child);
extractChildren(*child, all);
}
}
} | false | false | false | false | false | 0 |
GetOffersFor(PluginType type)
{
PluginsArray arr;
// special case for MIME plugins
// we 'll add the default MIME handler, last in the returned array
cbPlugin* dflt = nullptr;
for (unsigned int i = 0; i < m_Plugins.GetCount(); ++i)
{
cbPlugin* plug = m_Plugins[i]->plugin;
if (p... | false | false | false | false | false | 0 |
sparseset_equal_p (sparseset a, sparseset b)
{
SPARSESET_ELT_TYPE e;
if (a == b)
return true;
if (sparseset_cardinality (a) != sparseset_cardinality (b))
return false;
EXECUTE_IF_SET_IN_SPARSESET (a, e)
if (!sparseset_bit_p (b, e))
return false;
return true;
} | false | false | false | false | false | 0 |
ehset_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
int ret = -EINVAL;
struct usb_device *dev = interface_to_usbdev(intf);
struct usb_device *hub_udev = dev->parent;
struct usb_device_descriptor *buf;
u8 portnum = dev->portnum;
u16 test_pid = le16_to_cpu(dev->descriptor.idProduct);
... | false | false | false | false | false | 0 |
simple_operation2(struct double_stack *stack, char op)
{
int ret;
double operand1, operand2, result;
ret = double_stack_pop(stack, &operand2);
if (ret < 0)
{
error_msg("double_stack_pop");
return ret;
}
ret = double_stack_pop(stack, &operand1);
if (ret < 0)
{
error_msg("double_stack_pop");
return ret... | false | false | false | false | false | 0 |
count_2352_bytes(cdrom_drive *d){
long i;
for(i=2351;i>=0;i--)
if(d->private_data->sg_buffer[i]!=(unsigned char)'\177')
return(((i+3)>>2)<<2);
return(0);
} | false | false | false | false | false | 0 |
gs_make_null_device(gx_device_null *dev_null, gx_device *dev,
gs_memory_t * mem)
{
gx_device_init((gx_device *)dev_null, (const gx_device *)&gs_null_device,
mem, true);
gx_device_set_target((gx_device_forward *)dev_null, dev);
if (dev) {
/* The gx_device_copy_c... | false | false | false | false | false | 0 |
atStart() const
{
if (m_current.isEmpty())
return true;
return m_current.offset() == 0 &&
m_current.node()->previousLeafNode() == 0;
} | false | false | false | false | false | 0 |
nxt_stop_sound(nxt_t *nxt) {
nxt_pack_start(nxt,0x0C);
test(nxt_con_send(nxt));
test(nxt_con_recv(nxt,3));
test(nxt_unpack_start(nxt,0x0C));
return nxt_unpack_error(nxt)==0?NXT_SUCC:NXT_FAIL;
} | false | false | false | false | false | 0 |
_rl_internal_char_cleanup ()
{
#if defined (VI_MODE)
/* In vi mode, when you exit insert mode, the cursor moves back
over the previous character. We explicitly check for that here. */
if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap)
rl_vi_check ();
#endif /* VI_MODE */
if (rl_num_cha... | false | false | false | false | false | 0 |
type_passed_as (Parameter *arg)
{
tree arg_type = arg->type->toCtype();
if (arg_reference_p (arg))
arg_type = build_reference_type (arg_type);
else if (arg->storageClass & STClazy)
{
TypeFunction *tf = new TypeFunction (NULL, arg->type, false, LINKd);
TypeDelegate *t = new TypeDelegate (tf);
... | false | false | false | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.