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 |
|---|---|---|---|---|---|---|
elm_drop_target_del(Evas_Object *obj)
{
if (!_elm_cnp_init_count) _elm_cnp_init();
#ifdef HAVE_ELEMENTARY_X
if (_x11_elm_widget_xwin_get(obj))
return _x11_elm_drop_target_del(obj);
#endif
return _local_elm_drop_target_del(obj);
} | false | false | false | false | false | 0 |
destroy() {
if (FunctionMap.empty()) return;
// Reset all node's use counts to zero before deleting them to prevent an
// assertion from firing.
#ifndef NDEBUG
for (FunctionMapTy::iterator I = FunctionMap.begin(), E = FunctionMap.end();
I != E; ++I)
I->second->allReferencesDropped();
#endif
f... | false | false | false | false | false | 0 |
make_acpi_ec(void)
{
struct acpi_ec *ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
if (!ec)
return NULL;
ec->flags = 1 << EC_FLAGS_QUERY_PENDING;
mutex_init(&ec->mutex);
init_waitqueue_head(&ec->wait);
INIT_LIST_HEAD(&ec->list);
spin_lock_init(&ec->lock);
INIT_WORK(&ec->work, acpi_ec_event_handler);
ec-... | false | false | false | false | false | 0 |
which_pixbuf(int lp, enum what_display what)
{
GdkPixbuf **pb ;
g_assert(lp>0 && lp < MAX_WINS+2);
switch( what)
{
case PIXLOADED:
pb=&sp->im_loaded_pixbuf[lp];
break;
case PIXSUBIMAGE:
pb=&sp->im_subimage_pixbuf[lp];
break;
case PIXWARPED:
pb=&sp->im_warped_pi... | false | false | false | false | false | 0 |
suspend_task(package p)
{
vm the_vm = new_vm(current_task_id, var_ref(current_local), top_activ_stack + 1);
int i;
enum error e;
the_vm->max_stack_size = max_stack_size;
the_vm->top_activ_stack = top_activ_stack;
the_vm->root_activ_vector = root_activ_vector;
the_vm->func_id = 0; /* shouldn... | false | false | false | false | false | 0 |
file_cache_get(const char *path) {
struct file_info *f, *r = NULL;
pthread_mutex_lock(&files_mutex);
for (f = files; f; f = f->next) {
pthread_mutex_lock(&f->mutex);
if (!f->dead && f->filename && !strcmp(path, f->filename)) {
f->ref++;
r = f;
}... | false | false | false | false | false | 0 |
isReadable() const
{
return d->buffer != 0 && (d->buffer->mapMode() & QAbstractVideoBuffer::ReadOnly);
} | false | false | false | false | false | 0 |
pg_encoding_mbcliplen(int encoding, const char *mbstr,
int len, int limit)
{
mblen_converter mblen_fn;
int clen = 0;
int l;
/* optimization for single byte encoding */
if (pg_encoding_max_length(encoding) == 1)
return cliplen(mbstr, len, limit);
mblen_fn = pg_wchar_table[encoding].mblen;
while (l... | false | false | false | false | false | 0 |
uniform_vector_p (tree vec)
{
tree first, t;
unsigned i;
if (vec == NULL_TREE)
return NULL_TREE;
if (TREE_CODE (vec) == VECTOR_CST)
{
first = VECTOR_CST_ELT (vec, 0);
for (i = 1; i < VECTOR_CST_NELTS (vec); ++i)
if (!operand_equal_p (first, VECTOR_CST_ELT (vec, i), 0))
return NULL_TREE... | false | false | false | false | false | 0 |
ddjvu_document_search_pageno(ddjvu_document_t *document, const char *name)
{
G_TRY
{
DjVuDocument *doc = document->doc;
if (! (doc && doc->is_init_ok()))
return -1;
GP<DjVmDir> dir = doc->get_djvm_dir();
if (! dir)
return 0;
GP<DjVmDir::File> file;
if (! (file =... | false | false | false | false | false | 0 |
AssignFile(const std::string& filename) {
olock_.lock();
if(!filename_.empty()) ::unlink(filename_.c_str());
if(handle_ != -1) ::close(handle_);
filename_ = filename;
handle_ = -1;
if(!filename_.empty()) {
handle_ = ::open(filename_.c_str(),O_RDONLY);
if(parse_xml_) {
lock_.lock();
doc_.... | false | false | false | false | false | 0 |
gdict_window_cmd_file_close_window (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GdictWindow *window = user_data;
g_assert (GDICT_IS_WINDOW (window));
gdict_window_store_state (window);
/* if this was call... | false | false | false | false | false | 0 |
nextid(const char *sname)
{
if (!active)
return DB_UNEXPECTED_RESULT;
int id;
result_set res;
char sqlcmd[512];
sprintf(sqlcmd, "select nextid from %s where seq_name = '%s'",
sequence_table.c_str(), sname);
res.conn = getHandle(); //NG
if ((last_err =
my_sqlite3_exec(getHandle(), sqlcmd, &callback... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
int c;
int fn = NO_STATUS;
char *ptr;
int iterative = 0;
int pid = 0;
unsigned short port = 0;
#if defined(_WIN32) /*[*/
if (sockstart() < 0)
exit(1);
#endif /*]*/
/* Identify yourself. */
if ((me = strrchr(argv[0], '/')) != (char *)NULL)
me++;
else
me = argv[0];
/... | false | false | false | false | false | 0 |
product(vector<unsigned int> const &x)
{
if (x.empty())
return 0;
unsigned int y = x[0];
for (unsigned int i = 1; i < x.size(); ++i) {
y *= x[i];
}
return y;
} | false | false | false | false | false | 0 |
ConstructNullFunctionData(struct rtw_adapter *padapter, u8 *pframe,
u32 *pLength, u8 *StaAddr, u8 bQoS, u8 AC,
u8 bEosp, u8 bForcePowerSave)
{
struct ieee80211_hdr *pwlanhdr;
u32 pktlen;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network;
struct ... | false | true | false | false | false | 1 |
tilingPatternFillL1(GfxState *state, Catalog *cat, Object *str,
double *pmat, int paintType, int tilingType, Dict *resDict,
double *mat, double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep) {
PDFRectangle box;
Gfx *gfx;
// define a Type 3 font
wr... | false | false | false | false | false | 0 |
sprite_load_food() {
for (int f = 0; f < SPRITE_NUM_FOOD; f++) {
sprites[SPRITE_FOOD + f] = SDL_CreateRGBSurface(SDL_HWSURFACE | SDL_SRCALPHA, 16, 16,
32,0xFF000000,0x00FF0000,0x0000FF00,0x000000FF);
SDL_Rect srcrect = { f * 16, 256, 16... | false | false | false | false | false | 0 |
__ecereMethod_BuildTab_FindUniqueConfigName(struct __ecereNameSpace__ecere__com__Instance * this, char * baseName, unsigned int startWithNumber, char * output)
{
struct BuildTab * __ecerePointer_BuildTab = (struct BuildTab *)(this ? (((char *)this) + __ecereClass_BuildTab->offset) : 0);
int num = 0;
char tmp[1025];
if... | false | false | false | false | false | 0 |
set_inner(Widget gw, XEvent *event,
String *params, Cardinal *no_params)
{
ArtTreeWidget w = (ArtTreeWidget)gw;
int x, y;
ART_TREE_NODE *node;
if (!w->arttree.active || !get_event_xy(event, &x, &y))
return;
node = find_node_by_coordinates(w, w->arttree.root, x, y);
if (node) {
XtCa... | false | false | false | false | false | 0 |
utest_Get(ESL_BUFFER *bf, int nlines_expected)
{
const char msg[] = "utest_Get() failed";
char *p = NULL;
esl_pos_t n = 0;
int nlines = 0;
char line[8192];
int lpos = 0;
esl_pos_t i;
int status;
while ( (status = esl_buffer_Get(bf, &p, &n)) == eslOK)
... | true | true | false | false | false | 1 |
soundcore_open(struct inode *inode, struct file *file)
{
int chain;
int unit = iminor(inode);
struct sound_unit *s;
const struct file_operations *new_fops = NULL;
chain=unit&0x0F;
if(chain==4 || chain==5) /* dsp/audio/dsp16 */
{
unit&=0xF0;
unit|=3;
chain=3;
}
spin_lock(&sound_loader_lock);
s = __loo... | false | false | false | false | true | 1 |
get_header(FILE *file,mp3header *header)
{
unsigned char buffer[FRAME_HEADER_SIZE];
int fl;
if(fread(&buffer,FRAME_HEADER_SIZE,1,file)<1) {
header->sync=0;
return 0;
}
header->sync=(((int)buffer[0]<<4) | ((int)(buffer[1]&0xE0)>>4));
if(buffer[1] & 0x10) header->version=(buffer[1... | true | true | false | false | false | 1 |
aer_recover_work_func(struct work_struct *work)
{
struct aer_recover_entry entry;
struct pci_dev *pdev;
while (kfifo_get(&aer_recover_ring, &entry)) {
pdev = pci_get_domain_bus_and_slot(entry.domain, entry.bus,
entry.devfn);
if (!pdev) {
pr_err("AER recover: Can not find pci_dev for %04x:%02x:%02x:%... | false | false | false | false | false | 0 |
curses_print_status(void)
{
struct pool *pool = current_pool();
int linewidth = opt_widescreen ? 100 : 80;
wattron(statuswin, A_BOLD);
cg_mvwprintw(statuswin, 0, 0, " " PACKAGE " version " VERSION " - Started: %s", datestamp);
wattroff(statuswin, A_BOLD);
mvwhline(statuswin, 1, 0, '-', linewidth);
cg_mvwprintw(... | false | false | false | false | false | 0 |
xsh_table_resample_table(cpl_table* tinp,const char* cwinp, const char* cfinp,
cpl_table* tref,const char* cwref, const char* cfref)
{
cpl_table* tres=NULL;
double* pwinp=NULL;
double* pwref=NULL;
double* pfinp=NULL;
double* pfres=NULL;
int size_inp=0;
int size_ref=0;
double wmin=0;
double wmax=... | false | false | false | false | false | 0 |
s_zlibE_process(stream_state * st, stream_cursor_read * pr,
stream_cursor_write * pw, bool last)
{
stream_zlib_state *const ss = (stream_zlib_state *)st;
z_stream *zs = &ss->dynamic->zstate;
const byte *p = pr->ptr;
int status;
/* Detect no input or full output so that we don't get ... | false | false | false | false | false | 0 |
add_roots(void * start, void * end)
{
void *tmp;
if (start > end) {
tmp = start;
start = end;
end = tmp;
}
root_ranges[root_ranges_used].start = start;
root_ranges[root_ranges_used].end = end;
root_ranges_used++;
if (root_ranges_used >= ROOT_RANGES_LIMIT) {
f... | false | false | false | false | false | 0 |
rcu_cleanup_dead_rnp(struct rcu_node *rnp_leaf)
{
long mask;
struct rcu_node *rnp = rnp_leaf;
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU) ||
rnp->qsmaskinit || rcu_preempt_has_tasks(rnp))
return;
for (;;) {
mask = rnp->grpmask;
rnp = rnp->parent;
if (!rnp)
break;
raw_spin_lock(&rnp->lock); /* irqs alread... | false | false | false | false | false | 0 |
draw_objects_line(GtkWidget *widget, GabeditXYPlot *xyplot)
{
gint i;
for (i=0; i < xyplot->nObjectsLine; i++)
{
/*
if (
!(
(xyplot->objectsLine[i].x1i > xyplot->plotting_rect.x) &&
(xyplot->objectsLine[i].x1i < (xyplot->plotting_rect.x + xyplot->plotting_rect.width)) &&
(xyplot-... | false | false | false | false | false | 0 |
modehdlc(struct bchannel *bch, int protocol)
{
struct fritzcard *fc = bch->hw;
struct hdlc_hw *hdlc;
u8 mode;
hdlc = &fc->hdlc[(bch->nr - 1) & 1];
pr_debug("%s: hdlc %c protocol %x-->%x ch %d\n", fc->name,
'@' + bch->nr, bch->state, protocol, bch->nr);
hdlc->ctrl.ctrl = 0;
mode = (fc->type == AVM_FRITZ_PCIV2... | false | false | false | false | false | 0 |
packet_writeXX(packet_t *packet, const void *data, int len) {
if (sizeof(packet->data) - packet->offset <= len) {
fprintf(stderr, "packet too full\n");
return 0;
}
memcpy(&packet->data[packet->offset], data, len);
packet->offset += len;
return 1;
} | false | true | false | false | false | 1 |
IsValid(const char *uid_)
{
/*
9.1 UID ENCODING RULES
The DICOM UID encoding rules are defined as follows:
- Each component of a UID is a number and shall consist of one or more digits. The first digit of
each component shall not be zero unless the component is a single digit.
Note: Registration authorities... | false | false | false | false | false | 0 |
SetRenderer(RenderSystem *r) {
mRenderer = r;
// Destroy each widget of GUI of previously selected renderer
for(std::list<Widget>::iterator i=mRenderOptionWidgets.begin(); i!=mRenderOptionWidgets.end(); i++)
XtDestroyWidget(*i);
mRenderOptionWidgets.clear();
mConfigCallbackData.back();
... | false | false | false | false | false | 0 |
gkm_secret_object_mark_created (GkmSecretObject *self)
{
GTimeVal tv;
g_return_if_fail (GKM_IS_SECRET_OBJECT (self));
g_get_current_time (&tv);
gkm_secret_object_set_created (self, tv.tv_sec);
} | false | false | false | false | false | 0 |
strop_find(PyObject *self, PyObject *args)
{
char *s, *sub;
Py_ssize_t len, n, i = 0, last = PY_SSIZE_T_MAX;
WARN;
if (!PyArg_ParseTuple(args, "t#t#|nn:find", &s, &len, &sub, &n, &i, &last))
return NULL;
if (last > len)
last = len;
if (last < 0)
last += len;
if (las... | false | false | false | false | false | 0 |
uv_fs_symlink(uv_loop_t* loop,
uv_fs_t* req,
const char* path,
const char* new_path,
int flags,
uv_fs_cb cb) {
INIT(SYMLINK);
PATH2;
req->flags = flags;
POST;
} | false | false | false | false | false | 0 |
operator<<(STD_OSTREAM& stream, const UnicodeString& str)
{
if(str.length() > 0) {
char buffer[200];
UConverter *converter;
UErrorCode errorCode = U_ZERO_ERROR;
// use the default converter to convert chunks of text
converter = u_getDefaultConverter(&errorCode);
if(U... | false | false | false | false | false | 0 |
watpos(Screen *t,int x,int y)
{
W *w=t->topwin;
do
if(w->y>=0 && w->y<=y && w->y+w->h>y && w->x<=x && w->x+w->w>x)
return w;
while(w=w->link.next, w!=t->topwin);
return 0;
} | false | false | false | false | false | 0 |
psw_get_params(gx_device * dev, gs_param_list * plist)
{
gx_device_pswrite *const pdev = (gx_device_pswrite *)dev;
int code = gdev_psdf_get_params(dev, plist);
int ecode;
if (code < 0)
return code;
if ((ecode = param_write_float(plist, "LanguageLevel", &pdev->pswrite_common.LanguageLevel)) ... | false | false | false | false | false | 0 |
copy_file(const char *orig, const char *bkup)
{
char buf[buf_size];
int orig_fd;
int bkup_fd;
int flags = 0;
ssize_t count_write;
ssize_t count_read;
#ifdef G_OS_WIN32
flags = O_BINARY;
#endif
orig_fd = g_open(orig, O_RDONLY | flags, 0);
if (orig_fd == -1)
{
return FALS... | false | false | false | false | false | 0 |
_opt_verify(void)
{
bool verified = true;
if (opt.quiet && opt.verbose) {
error ("don't specify both --verbose (-v) and --quiet (-Q)");
verified = false;
}
/*
* set up standard IO filters
*/
if ((opt.input_filter_set || opt.output_filter_set ||
opt.error_filter_set) && opt.pty) {
error("don't spe... | false | false | false | false | false | 0 |
RequestDataObject(vtkInformation*,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
if (!inInfo)
{
return 0;
}
vtkDataSet *... | false | false | false | false | false | 0 |
blkid_partitions_do_subprobe(blkid_probe pr, blkid_partition parent,
const struct blkid_idinfo *id)
{
blkid_probe prc;
int rc = 1;
blkid_partlist ls;
blkid_loff_t sz, off;
DBG(DEBUG_LOWPROBE, printf(
"parts: ----> %s subprobe requested (parent=%p)\n",
id->name, parent));
if (!pr || !parent || !parent->siz... | false | false | false | false | false | 0 |
ata_sff_set_devctl(struct ata_port *ap, u8 ctl)
{
if (ap->ops->sff_set_devctl)
ap->ops->sff_set_devctl(ap, ctl);
else
iowrite8(ctl, ap->ioaddr.ctl_addr);
} | false | false | false | false | false | 0 |
tp_debug_message_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
TpDebugMessage *self = TP_DEBUG_MESSAGE (object);
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
case PROP_TIME:... | false | false | false | false | false | 0 |
LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, LZ_UInt32 symbol, LZ_UInt32 matchByte)
{
LZ_UInt32 offs = 0x100;
symbol |= 0x100;
do
{
matchByte <<= 1;
RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1);
symbol <<= 1;
offs &= ~(matchByte ^... | false | false | false | false | false | 0 |
WriteJobIDsToFile(const std::list<Job>& jobs, const std::string& filename, unsigned nTries, unsigned tryInterval) {
if (Glib::file_test(filename, Glib::FILE_TEST_IS_DIR)) return false;
FileLock lock(filename);
for (int tries = (int)nTries; tries > 0; --tries) {
if (lock.acquire()) {
std::ofst... | false | false | false | false | false | 0 |
write_to_stream(FILE *stream, chunk_t data)
{
size_t len, total = 0;
while (total < data.len)
{
len = fwrite(data.ptr + total, 1, data.len - total, stream);
if (len <= 0)
{
return FALSE;
}
total += len;
}
return TRUE;
} | false | false | false | false | false | 0 |
pxa2xx_spi_dma_transfer_complete(struct driver_data *drv_data,
bool error)
{
struct spi_message *msg = drv_data->cur_msg;
/*
* It is possible that one CPU is handling ROR interrupt and other
* just gets DMA completion. Calling pump_transfers() twice for the
* same transfer leads to problems thus we p... | false | false | false | false | false | 0 |
sa_setup_expirations(struct sa *sa)
{
struct timeval expiration;
u_int64_t seconds = sa->seconds;
/*
* Set the soft timeout to a random percentage between 85 & 95 of
* the negotiated lifetime to break strictly synchronized
* renegotiations. This works better when the randomization is on the
* order ... | false | false | false | false | false | 0 |
_icon_duplicate(Evas_Object *icon)
{
Evas_Object *ic;
const char *file;
const char *group;
if (!icon) return NULL;
elm_image_file_get(icon, &file, &group);
ic = elm_icon_add(icon);
elm_image_file_set(ic, file, group);
elm_image_resizable_set(ic, 1, 1);
return ic;
} | false | false | false | false | false | 0 |
explain_buffer_errno_readv_explanation(explain_string_buffer_t *sb, int errnum,
const char *syscall_name, int fildes, const struct iovec *data,
int data_size)
{
void *data2;
size_t data2_size;
int j;
/*
* http://www.opengroup.org/onlinepubs/009695399/functio... | false | false | false | false | false | 0 |
fnic_cleanup_io(struct fnic *fnic, int exclude_id)
{
int i;
struct fnic_io_req *io_req;
unsigned long flags = 0;
struct scsi_cmnd *sc;
spinlock_t *io_lock;
unsigned long start_time = 0;
struct fnic_stats *fnic_stats = &fnic->fnic_stats;
for (i = 0; i < fnic->fnic_max_tag_id; i++) {
if (i == exclude_id)
co... | false | false | false | false | false | 0 |
diff_filespec_load_driver(struct diff_filespec *one)
{
/* Use already-loaded driver */
if (one->driver)
return;
if (S_ISREG(one->mode))
one->driver = userdiff_find_by_path(one->path);
/* Fallback to default settings */
if (!one->driver)
one->driver = userdiff_find_by_name("default");
} | false | false | false | false | false | 0 |
CleanEdge(vtkIdType Edge)
{
if (this->CleanEdges==0)
return;
if (this->Poly1->GetValue(Edge)==-1)
{
this->DeleteEdge(Edge);
}
} | false | false | false | false | false | 0 |
all_sky_zz_median(GList *ofrs)
{
GList *sl;
struct o_frame *ofr;
int n = 0;
double * a;
double me;
sl = ofrs;
while(sl != NULL) {
ofr = O_FRAME(sl->data);
sl = g_list_next(sl);
if (ofr->nweight <= 0.0)
continue;
n++;
}
a = malloc(n * sizeof(double));
n = 0;
sl = ofrs;
while(sl != NULL) {
ofr =... | false | false | false | false | true | 1 |
real_update_location_menu_volumes (NautilusView *view)
{
GtkAction *action;
NautilusFile *file;
gboolean show_mount;
gboolean show_unmount;
gboolean show_eject;
gboolean show_start;
gboolean show_stop;
gboolean show_poll;
GDriveStartStopType start_stop_type;
g_assert (NAUTILUS_IS_VIEW (view));
g_assert (NAU... | false | false | false | false | false | 0 |
fc_ns_query_step ( struct fc_ns_query *query ) {
struct xfer_metadata meta;
struct fc_ns_gid_pn_request gid_pn;
int xchg_id;
int rc;
/* Create exchange */
if ( ( xchg_id = fc_xchg_originate ( &query->xchg, query->port,
&fc_gs_port_id,
FC_TYPE_CT ) ) < 0 ) {
rc = xchg_id;
DBGC ( query, "FC... | false | true | false | false | false | 1 |
mid3(double a, double b, double c) {
if ((a < b && a > c) || (a < c && a > b))
return a;
if ((b < a && b > c) || (b < c && b > a))
return b;
return c;
} | false | false | false | false | false | 0 |
inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock,
struct inotify_inode_mark *i_mark)
{
int ret;
idr_preload(GFP_KERNEL);
spin_lock(idr_lock);
ret = idr_alloc_cyclic(idr, i_mark, 1, 0, GFP_NOWAIT);
if (ret >= 0) {
/* we added the mark to the idr, take a reference */
i_mark->wd = ret;
fsnoti... | false | false | false | false | false | 0 |
gwy_graph_model_curve_notify(GwyGraphCurveModel *cmodel,
GParamSpec *pspec,
GwyGraphModel *gmodel)
{
gint i;
/* FIXME: This scales bad although for a reasonable number of curves it's
* quite fast. */
i = gwy_graph_model_get_curve_index(gmodel, ... | false | false | false | false | false | 0 |
iscsi_tx_step ( struct process *process ) {
struct iscsi_session *iscsi =
container_of ( process, struct iscsi_session, process );
struct iscsi_bhs_common *common = &iscsi->tx_bhs.common;
int ( * tx ) ( struct iscsi_session *iscsi );
enum iscsi_tx_state next_state;
size_t tx_len;
int rc;
/* Select fragment to... | false | false | false | false | false | 0 |
verify_correct_nesting(struct inlining_context *ctx)
{
struct subroutine *this;
int *coverage;
coverage = zalloc(ctx->code.code_length * sizeof(int));
if (!coverage)
return warn("out of memory"), -ENOMEM;
list_for_each_entry(this, &ctx->subroutine_list, subroutine_list_node) {
int color = coverage[this->star... | false | false | false | false | false | 0 |
git_diff__from_iterators(
git_diff **diff_ptr,
git_repository *repo,
git_iterator *old_iter,
git_iterator *new_iter,
const git_diff_options *opts)
{
int error = 0;
diff_in_progress info;
git_diff *diff;
*diff_ptr = NULL;
diff = diff_list_alloc(repo, old_iter, new_iter);
GITERR_CHECK_ALLOC(diff);
info.rep... | false | false | false | false | false | 0 |
gee_tree_map_value_collection_real_contains (GeeAbstractCollection* base, gconstpointer key) {
GeeTreeMapValueCollection * self;
gboolean result = FALSE;
GeeIterator* it = NULL;
GeeIterator* _tmp0_ = NULL;
self = (GeeTreeMapValueCollection*) base;
_tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*... | false | false | false | false | false | 0 |
mission_goal_fail_incomplete()
{
int i;
for (i = 0; i < Num_goals; i++ ) {
if ( Mission_goals[i].satisfied == GOAL_INCOMPLETE ) {
Mission_goals[i].satisfied = GOAL_FAILED;
mission_log_add_entry( LOG_GOAL_FAILED, Mission_goals[i].name, NULL, i );
}
}
// now for the events. Must set the formula to -1 and... | false | false | false | false | false | 0 |
RequestData(
vtkInformation *,
vtkInformationVector **,
vtkInformationVector *outputVector)
{
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// Return all data in the first piece ...
if(outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()) > 0)
{
return 1;
}
... | false | false | false | false | false | 0 |
availableRenderBackends()
{
QSet<Document::RenderBackend> ret;
#if defined(HAVE_SPLASH)
ret << Document::SplashBackend;
#endif
ret << Document::ArthurBackend;
return ret;
} | false | false | false | false | false | 0 |
e_cal_backend_sync_get_timezone (ECalBackendSync *backend,
EDataCal *cal,
GCancellable *cancellable,
const gchar *tzid,
gchar **tzobject,
GError **error)
{... | false | false | false | true | false | 1 |
HandleCancelAuraOpcode(WorldPacket& recvPacket)
{
uint32 spellId;
recvPacket >> spellId;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
if (!spellInfo)
return;
if (spellInfo->HasAttribute(SPELL_ATTR_CANT_CANCEL))
return;
if (IsPassiveSpell(spellInfo))
... | false | false | false | false | false | 0 |
wnck_window_timeout_cb (WnckWindow *window)
{
const gchar *game;
gint x, y;
gint width, height;
gchar *sql;
GError *error = NULL;
if (wnck_window_is_fullscreen (window))
goto exit;
game = wnck_window_get_game (window);
wnck_window_get_geo... | false | false | false | false | false | 0 |
supportedSOPClassUIDs(OFList<OFString>& suppSOPs)
{
suppSOPs.push_back(UID_MultiframeSingleBitSecondaryCaptureImageStorage);
suppSOPs.push_back(UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage);
suppSOPs.push_back(UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage);
suppSOPs.push_back(UID_Multiframe... | false | false | false | false | false | 0 |
releaseMemory() {
// Iterate through all the SCEVUnknown instances and call their
// destructors, so that they release their references to their values.
for (SCEVUnknown *U = FirstUnknown; U; U = U->Next)
U->~SCEVUnknown();
FirstUnknown = 0;
ValueExprMap.clear();
// Free any extra memory created for E... | false | false | false | false | false | 0 |
getCountUnlocked(network_address_type_t type)
{
RoutingMap::iterator it = routes_[type].begin();
uint16_t routes=0;
for(; it!=routes_[type].end(); ++it) {
routes++;
}
return routes;
} | false | false | false | false | false | 0 |
exelif(expptr p)
#endif
{
if (ctlstack->ctltype == CTLIF || ctlstack->ctltype == CTLIFX)
putif(p, 1); /* 1 ==> elseif */
else
execerr("elseif out of place", CNULL);
} | false | false | false | false | false | 0 |
usart_send_address(Usart *p_usart, uint32_t ul_addr)
{
if ((p_usart->US_MR & US_MR_PAR_MULTIDROP) != US_MR_PAR_MULTIDROP) {
return 1;
}
p_usart->US_CR = US_CR_SENDA;
if (usart_write(p_usart, ul_addr)) {
return 1;
} else {
return 0;
}
} | false | false | false | false | false | 0 |
pTnext( Event& event, double pTbegAll, double pTendAll) {
// Begin loop over all possible radiating dipole ends.
dipSel = 0;
iDipSel = -1;
double pT2sel = pTendAll * pTendAll;
for (int iDip = 0; iDip < int(dipEnd.size()); ++iDip) {
TimeDipoleEnd& dip = dipEnd[iDip];
// Check if global recoil shoul... | false | false | false | false | false | 0 |
isert_create_qp(struct isert_conn *isert_conn,
struct isert_comp *comp,
struct rdma_cm_id *cma_id)
{
struct isert_device *device = isert_conn->device;
struct ib_qp_init_attr attr;
int ret;
memset(&attr, 0, sizeof(struct ib_qp_init_attr));
attr.event_handler = isert_qp_event_callback;
attr.qp_context = isert_... | false | false | false | false | false | 0 |
cancel()
{
for (QuerySet::iterator Q=m_activeQueries.begin(); Q!=m_activeQueries.end();++Q)
delete *Q;
m_activeQueries.clear();
disconnect();
// revert to the last valid list if possible
if (!m_lastValidList.empty())
{
m_gameServers = m_lastValidList;
m_status = VALID... | false | false | false | false | false | 0 |
imx6ul_tsc_init(struct imx6ul_tsc *tsc)
{
int err;
err = imx6ul_adc_init(tsc);
if (err)
return err;
imx6ul_tsc_channel_config(tsc);
imx6ul_tsc_set(tsc);
return 0;
} | false | false | false | false | false | 0 |
zd_mac_preinit_hw(struct ieee80211_hw *hw)
{
int r;
u8 addr[ETH_ALEN];
struct zd_mac *mac = zd_hw_mac(hw);
r = zd_chip_read_mac_addr_fw(&mac->chip, addr);
if (r)
return r;
SET_IEEE80211_PERM_ADDR(hw, addr);
return 0;
} | false | false | false | false | false | 0 |
lpt_suspend_hw(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
if (HAS_PCH_LPT_LP(dev)) {
uint32_t val = I915_READ(SOUTH_DSPCLK_GATE_D);
val &= ~PCH_LP_PARTITION_LEVEL_DISABLE;
I915_WRITE(SOUTH_DSPCLK_GATE_D, val);
}
} | false | false | false | false | false | 0 |
popupAtPosition( QPointF position ) const
{
foreach ( QGraphicsItem * item, items( position ) )
{
if ( dynamic_cast<KGamePopupItem *>( item ) != 0 )
return true;
}
return false;
} | false | false | false | false | false | 0 |
_mesa_ShaderSource(GLhandleARB shaderObj, GLsizei count,
const GLcharARB * const * string, const GLint * length)
{
GET_CURRENT_CONTEXT(ctx);
GLint *offsets;
GLsizei i, totalLength;
GLcharARB *source;
GLuint checksum;
if (!shaderObj || string == NULL) {
_mesa_error(ctx, GL_... | false | true | false | false | true | 1 |
pch_uart_hal_set_break(struct eg20t_port *priv, int on)
{
unsigned int lcr;
lcr = ioread8(priv->membase + UART_LCR);
if (on)
lcr |= PCH_UART_LCR_SB;
else
lcr &= ~PCH_UART_LCR_SB;
iowrite8(lcr, priv->membase + UART_LCR);
} | false | false | false | false | false | 0 |
RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
{
int renderedSomething=0;
this->BuildAxis(viewport, false);
// Everything is built, just have to render
if (!this->AxisHasZeroLength)
{
if(this->DrawGridpolys)
{
renderedSomething += this->GridpolysActor->RenderTranslucentPol... | false | false | false | false | false | 0 |
gth_backtrace_path_referencecutoff_end(const GthBacktracePath *bt)
{
gt_assert(bt);
return bt->cutoffs.end.referencecutoff;
} | false | false | false | false | false | 0 |
result_timed_out(
TRANSITIONER_ITEM res_item, TRANSITIONER_ITEM& wu_item
) {
DB_HOST_APP_VERSION hav;
char query[512], clause[512];
int gavid = generalized_app_version_id(
res_item.res_app_version_id, wu_item.appid
);
int retval = hav_lookup(hav, res_item.res_hostid, gavid);
if (ret... | false | false | false | false | false | 0 |
mic_dp_show(struct seq_file *s, void *pos)
{
struct mic_device *mdev = s->private;
struct mic_device_desc *d;
struct mic_device_ctrl *dc;
struct mic_vqconfig *vqconfig;
__u32 *features;
__u8 *config;
struct mic_bootparam *bootparam = mdev->dp;
int i, j;
seq_printf(s, "Bootparam: magic 0x%x\n",
bootparam-... | false | false | false | false | false | 0 |
H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size)
{
H5FD_mem_t fs_type; /* Free space type (mapped from allocation type) */
haddr_t ret_value; /* Return value */
FUNC_ENTER_NOAPI(H5MF_alloc, HADDR_UNDEF)
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr, "%s: allo... | false | false | false | false | false | 0 |
vc1_coded_block_pred(MpegEncContext * s, int n, uint8_t **coded_block_ptr)
{
int xy, wrap, pred, a, b, c;
xy = s->block_index[n];
wrap = s->b8_stride;
/* B C
* A X
*/
a = s->coded_block[xy - 1 ];
b = s->coded_block[xy - 1 - wrap];
c = s->coded_block[xy - wrap];
if ... | false | false | false | false | false | 0 |
isAssociativeAndCommutative(const MachineInstr &Inst) const {
switch (Inst.getOpcode()) {
case X86::AND8rr:
case X86::AND16rr:
case X86::AND32rr:
case X86::AND64rr:
case X86::OR8rr:
case X86::OR16rr:
case X86::OR32rr:
case X86::OR64rr:
case X86::XOR8rr:
case X86::XOR16rr:
case X86::XOR32rr:
ca... | false | false | false | false | false | 0 |
PrepareBufferedEvent(jack_nframes_t time)
{
bool result = ! unbuffered_bytes;
if (! result) {
HandleBufferFailure(unbuffered_bytes, total_bytes);
} else {
PrepareEvent(time, total_bytes, input_buffer);
}
Clear();
if (status_byte >= 0xf0) {
expected_bytes = 0;
stat... | false | false | false | false | false | 0 |
on_activated()
{
if(!m_note) {
return;
}
NotebookManager::obj().move_note_to_notebook(m_note, m_notebook);
} | false | false | false | false | false | 0 |
torch_MemoryFile_storage(lua_State *L)
{
MemoryFile *file = luaT_checkudata(L, 1, torch_MemoryFile_id);
if(!file->storage)
luaL_error(L, "attempt to use a closed file");
THCharStorage_resize(file->storage, file->size+1, 1);
file->storage->refcount++;
luaT_pushudata(L, file->storage, torch_CharStorage_id);... | false | false | false | false | false | 0 |
mwifiex_get_tdls_link_status(struct mwifiex_private *priv, const u8 *mac)
{
struct mwifiex_sta_node *sta_ptr;
sta_ptr = mwifiex_get_sta_entry(priv, mac);
if (sta_ptr)
return sta_ptr->tdls_status;
return TDLS_NOT_SETUP;
} | false | false | false | false | false | 0 |
SFGuessScriptList(SplineFont1 *sf) {
uint32 scripts[32], script;
int i, scnt=0, j;
for ( i=0; i<sf->sf.glyphcnt; ++i ) if ( sf->sf.glyphs[i]!=NULL ) {
script = SCScriptFromUnicode(sf->sf.glyphs[i]);
if ( script!=0 && script!=DEFAULT_SCRIPT ) {
for ( j=scnt-1; j>=0 ; --j )
if ( scripts[j]==script )... | false | false | false | false | false | 0 |
drms_uA_update(struct regulator_dev *rdev)
{
struct regulator *sibling;
int current_uA = 0, output_uV, input_uV, err;
unsigned int mode;
lockdep_assert_held_once(&rdev->mutex);
/*
* first check to see if we can set modes at all, otherwise just
* tell the consumer everything is OK.
*/
err = regulator_check... | false | false | false | false | false | 0 |
sort_order_cmp(const void *p1, const void *p2)
{
HeapTuple v1 = *((const HeapTuple *) p1);
HeapTuple v2 = *((const HeapTuple *) p2);
Form_pg_enum en1 = (Form_pg_enum) GETSTRUCT(v1);
Form_pg_enum en2 = (Form_pg_enum) GETSTRUCT(v2);
if (en1->enumsortorder < en2->enumsortorder)
return -1;
else if (en1->enumsortor... | 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.