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 |
|---|---|---|---|---|---|---|
align_mem(kstring_t *s)
{
if (s->l&7) {
uint64_t zero = 0;
int l = ((s->l + 7)>>3<<3) - s->l;
kputsn((char*)&zero, l, s);
}
} | false | false | false | false | false | 0 |
calculateLiSPSM(const Matrix4& lightSpace,
const PointListBody& bodyB, const PointListBody& bodyLVS,
const SceneManager& sm, const Camera& cam, const Light& light) const
{
// set up bodyB AAB in light space
AxisAlignedBox bodyBAAB_ls;
for (size_t i = 0; i < bodyB.getPointCou... | false | false | false | false | false | 0 |
git_config_bool_or_int(const char *name, const char *value, int *is_bool)
{
int v = git_config_maybe_bool_text(name, value);
if (0 <= v) {
*is_bool = 1;
return v;
}
*is_bool = 0;
return git_config_int(name, value);
} | false | false | false | false | false | 0 |
H5G__loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc,
H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id)
{
H5O_link_t lnk; /* Link for object to insert */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
/* Check args. */
... | false | false | false | false | false | 0 |
item_event(GtkWidget *button, gchar *data)
{
GtkTextIter iter_start, iter_end;
gchar *current_style_name;
if(board_paused)
return;
current_style_name = (char *)data;
selected_tag = get_tag_from_name(current_style_name);
set_default_tag(buffer, selected_tag);
gtk_text_buffer_get_iter_at_mark(buf... | false | false | false | false | false | 0 |
ReadAri (
TypSymbolSet follow,
Char mode )
{
UInt symbol;
/* <Term> */
ReadTerm( follow, mode );
/* { '+'|'-' <Term> } */
while ( IS_IN( Symbol... | false | false | false | false | false | 0 |
Elm0vBlist (
Obj list,
Int pos )
{
return ELM_BLIST( list, pos );
} | false | false | false | false | false | 0 |
image_loader_start_idle(ImageLoader *il)
{
gboolean ret;
if (!il) return FALSE;
if (!il->fd) return FALSE;
if (!image_loader_setup_source(il)) return FALSE;
ret = image_loader_begin(il);
if (ret && !il->done) il->idle_id = g_idle_add_full(il->idle_priority, image_loader_idle_cb, il, NULL);
return ret;
} | false | false | false | false | false | 0 |
io_add(struct io_data *io_data, char *buf)
{
size_t len, dif, tot;
len = strlen(buf);
dif = io_data->cur - io_data->ptr;
// send will always have enough space to add the JSON
tot = len + 1 + dif + sizeof(JSON_CLOSE) + sizeof(JSON_END);
if (tot > io_data->siz) {
size_t new = io_data->siz + (2 * SOCKBUFALLOCSIZ... | false | false | false | false | false | 0 |
GetSemiMinor( OGRErr * pnErr ) const
{
double dfInvFlattening, dfSemiMajor;
dfSemiMajor = GetSemiMajor( pnErr );
dfInvFlattening = GetInvFlattening( pnErr );
if( ABS(dfInvFlattening) < 0.000000000001 )
return dfSemiMajor;
else
return dfSemiMajor * (1.0 - 1.0/dfInvFlattening);... | false | false | false | false | false | 0 |
make_class_module( LIST * xname, LIST * bases, FRAME * frame )
{
OBJECT * name = class_module_name( list_front( xname ) );
OBJECT * * pp;
module_t * class_module = 0;
module_t * outer_module = frame->module;
int found;
LISTITER iter, end;
if ( !classes )
classes = hashinit... | false | false | false | false | false | 0 |
zfec_encode(size_t k, size_t n,
const std::string& prefix,
std::istream& in,
size_t in_len)
{
const size_t chunksize = 4096;
fecpp::fec_code fec(k, n);
std::vector<byte> buf(chunksize * k);
size_t pad_bytes = (in_len % k == 0) ? 0 : k - (in_len % k);
... | false | false | false | false | false | 0 |
write_tree_from_memory(struct merge_options *o)
{
struct tree *result = NULL;
if (unmerged_cache()) {
int i;
fprintf(stderr, "BUG: There are unmerged index entries:\n");
for (i = 0; i < active_nr; i++) {
struct cache_entry *ce = active_cache[i];
if (ce_stage(ce))
fprintf(stderr, "BUG: %d %.*s", ce_st... | false | false | false | false | false | 0 |
__posix_acl_chmod_masq(struct posix_acl *acl, umode_t mode)
{
struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL;
struct posix_acl_entry *pa, *pe;
/* assert(atomic_read(acl->a_refcount) == 1); */
FOREACH_ACL_ENTRY(pa, acl, pe) {
switch(pa->e_tag) {
case ACL_USER_OBJ:
pa->e_perm = (mode & S_IRWXU)... | false | false | false | false | false | 0 |
_priv_gst_element_state_changed (GstElement * element, GstState oldstate,
GstState newstate, GstState pending)
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
GstMessage *message;
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
"notifying about state-changed %s to %s (%s pending)",
gst_... | false | false | false | false | false | 0 |
builder_filter(void *null, entry_t **entry, credential_type_t *type,
void *dummy1, int *subtype)
{
if ((*entry)->final)
{
*type = (*entry)->type;
*subtype = (*entry)->subtype;
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
graph_parse_httpd(struct httpd_session_data *sd,const char* url)
{
char *graph_no = httpd_get_value(sd,"id");
int id = atoi(graph_no);
if(id > 0 && id <= sensor_max) {
// output graph
int len = 0;
const char* data = graph_output(sensor[id-1].graph,&len);
if(data)
httpd_send(sd,200,"image/png",len... | false | false | false | false | false | 0 |
uniform_normalization(v_info)
struct qinfo *v_info;
{
vertex_id v_id;
edge_id e_id,ee_id;
REAL ti,tj;
REAL dist=0.,energy=0.;
REAL power;
e_id = get_vertex_edge(v_info->id);
if ( !valid_id(e_id) ) return 0.0;
ti = get_edge_length(e_id);
ee_id = get_next_tail_edge(e_id); /* assuming exactly two edges ... | false | false | false | false | false | 0 |
unwrap(struct magic_set *ms, const char *fn)
{
char buf[MAXPATHLEN];
FILE *f;
int wid = 0, cwid;
int e = 0;
if (strcmp("-", fn) == 0) {
f = stdin;
wid = 1;
} else {
if ((f = fopen(fn, "r")) == NULL) {
(void)fprintf(stderr, "%s: Cannot open `%s' (%s).\n",
progname, fn, strerror(errno));
return ... | true | true | false | false | true | 1 |
storvsc_drv_init(void)
{
int ret;
/*
* Divide the ring buffer data size (which is 1 page less
* than the ring buffer size since that page is reserved for
* the ring buffer indices) by the max request size (which is
* vmbus_channel_packet_multipage_buffer + struct vstor_packet + u64)
*/
max_outstanding_req... | false | false | false | false | false | 0 |
ar_conf_get_keyval_with_default (const char *group, const char *key,
guint default_keyval)
{
GError *error = NULL;
guint value;
value = ar_conf_get_keyval (group, key, &error);
if (error) {
g_error_free (error);
value = default_keyval;
}
if (value == GDK_KEY_Void... | false | false | false | false | false | 0 |
TriSolve(float *M, float *x, float *Out, int D) {
int i, j;
float sum;
for(i=0; i<D; i++) {
sum = x[i];
for (j=i-1; j>=0; j--) sum -= M[i*D + j] * Out[j]; // j<i
// for (pM=M + i*D + i-1, pOut = Out + i-1; pOut>=Out; pM--, pOut--) sum -= *pM * *pOut;
Out[i] = sum / M[i*D + i];
}
} | false | false | false | false | false | 0 |
isValid() const
{
return d->pixelFormat != QVideoFrame::Format_Invalid && d->frameSize.isValid();
} | false | false | false | false | false | 0 |
default_unspec_may_trap_p (const_rtx x, unsigned flags)
{
int i;
if (GET_CODE (x) == UNSPEC_VOLATILE
/* Any floating arithmetic may trap. */
|| (SCALAR_FLOAT_MODE_P (GET_MODE (x))
&& flag_trapping_math))
return 1;
for (i = 0; i < XVECLEN (x, 0); ++i)
{
if (may_trap_p_1 (XVECEXP (x,... | false | false | false | false | false | 0 |
gtk_clutter_embed_unrealize (GtkWidget *widget)
{
GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (widget)->priv;
if (num_filter > 0)
{
num_filter--;
if (num_filter == 0)
gdk_window_remove_filter (NULL, gtk_clutter_filter_func, widget);
}
if (priv->stage != NULL)
clutter_actor_h... | false | false | false | false | false | 0 |
pvr2_dvb_adapter_init(struct pvr2_dvb_adapter *adap)
{
int ret;
ret = dvb_register_adapter(&adap->dvb_adap, "pvrusb2-dvb",
THIS_MODULE/*&hdw->usb_dev->owner*/,
&adap->channel.hdw->usb_dev->dev,
adapter_nr);
if (ret < 0) {
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"dvb_register_adapter failed: e... | false | false | false | false | false | 0 |
receive_command (Window root)
{
cmdret *cmd_ret;
char *result;
Atom type_ret;
int format_ret;
unsigned long nitems;
unsigned long bytes_after;
unsigned char *prop_return;
int offset;
/* Init offset to 0. In the case where there is more than one window
in the property, a partial read does not del... | false | false | false | false | false | 0 |
printRefMap(FILE** frs, int qcount, GList<GLocus>* rloci) {
if (rloci==NULL) return;
for (int l=0;l<rloci->Count(); l++) {
for (int r=0;r<rloci->Get(l)->mrnas.Count(); r++) {
GffObj& ref = *(rloci->Get(l)->mrnas[r]);
CTData* refdata = ((CTData*)ref.uptr);
GStr* clist = new GStr[qcount];
... | false | false | false | false | false | 0 |
parse_netprefix(int fd, char *line)
{
char *s;
if (!(s = strchr(line, '='))) {
IBWARN("bad assignment: missing '=' sign");
return -1;
}
if (!(s = parse_node_id(s + 1, NULL)))
return -1;
if (strlen(s) > NODEPREFIX) {
IBWARN("prefix %s too long!", s);
return -1;
}
strncpy(netprefix, s, NODEPREFIX);
... | false | true | false | false | false | 1 |
SetSessionAuthorization(Oid userid, bool is_superuser)
{
/* Must have authenticated already, else can't make permission check */
AssertState(OidIsValid(AuthenticatedUserId));
if (userid != AuthenticatedUserId &&
!AuthenticatedUserIsSuperuser)
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
err... | false | false | false | false | false | 0 |
TruncatedFinal(byte *mac, size_t size)
{
ThrowIfInvalidTruncatedSize(size);
if (m_counter)
ProcessBuf();
memcpy(mac, m_reg, size);
memset(m_reg, 0, AccessCipher().BlockSize());
} | false | false | false | false | false | 0 |
maxPrior()
{
long prior = LONG_MIN;
if ( isShift && shiftPrior > prior )
prior = shiftPrior;
for ( ReductionMap::Iter red = reductions; red.lte(); red++ ) {
if ( red->value > prior )
prior = red->value;
}
return prior;
} | false | false | false | false | false | 0 |
addCompositor(Viewport *vp, const String &compositor, int addPosition)
{
CompositorPtr comp = getByName(compositor);
if(comp.isNull())
return 0;
CompositorChain *chain = getCompositorChain(vp);
return chain->addCompositor(comp, addPosition==-1 ? CompositorChain::LAST : (size_t)addPosition);
} | false | false | false | false | false | 0 |
isr_txdmaok(SLMP_INFO * info)
{
unsigned char status_reg1 = read_reg(info, SR1);
write_reg(info, TXDMA + DIR, 0x00); /* disable Tx DMA IRQs */
write_reg(info, TXDMA + DSR, 0xc0); /* clear IRQs and disable DMA */
write_reg(info, TXDMA + DCMD, SWABORT); /* reset/init DMA channel */
if ( debug_level >= DEBUG_LEVEL_... | false | false | false | false | false | 0 |
hts_cache_free(t_dnscache *const root) {
if (root != NULL) {
t_dnscache *cache;
for(cache = root; cache != NULL; ) {
t_dnscache *const next = cache->n;
cache->n = NULL;
freet(cache);
cache = next;
}
}
} | true | true | false | false | false | 1 |
do_checkmailinglists(struct rfc822a *a,
struct rfc2045_mkreplyinfo *ri,
char *mlbuffer)
{
int i;
for (i=0; i<a->naddrs; i++)
{
char *p=rfc822_getaddr(a, i);
char *q;
if (!p)
return (NULL);
strcpy(mlbuffer, ri->mailinglists ? ri->mailinglists:"");
for (q=mlbuffer; (q=strtok(q, "\n \t")) !... | false | false | false | false | false | 0 |
xfl_bucket_alloc(const struct xfreelist *flb,
size_t size, bool core, size_t *allocated)
{
size_t len;
void *p;
len = xmalloc_round_blocksize(size);
if (len <= XMALLOC_MAXSIZE) {
p = xfl_freelist_alloc(flb, len, allocated);
if (p != NULL)
return p;
}
if (!core)
return NULL;
if G_LIKELY(xmalloc_vmm_... | false | false | false | false | false | 0 |
take_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
{
rb_ary_push(arg[0], enum_values_pack(argc, argv));
if (--arg[1] == 0) rb_iter_break();
return Qnil;
} | false | false | false | false | false | 0 |
configuration_save_default_session(void)
{
gchar *configfile = g_build_filename(app->configdir, "geany.conf", NULL);
gchar *data;
GKeyFile *config = g_key_file_new();
g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL);
if (cl_options.load_session)
configuration_save_session_files(config);
/... | false | false | false | false | false | 0 |
sigquit_handler(int sig __attribute__((unused)))
{
struct sigaction action;
/* Ignore SIGQUIT ourselves */
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
action.sa_handler = SIG_IGN;
if (sigaction(SIGQUIT, &action, (struct sigaction *) 0) < 0) {
syslog(LOG_ERR, "sigaction: %m");
}
... | false | false | false | false | false | 0 |
HandleEvent(TEvent &Event) {
switch (Event.What) {
case evKeyDown:
Key = Event.Key.Code;
if (!(Key & kfModifier)) // not ctrl,alt,shift, ....
EndExec(1);
Event.What = evNone;
break;
}
} | false | false | false | false | false | 0 |
voidInitLiteral(VarDeclaration *var)
{
Expression *elem = next->voidInitLiteral(var);
// For aggregate value types (structs, static arrays) we must
// create an a separate copy for each element.
bool mustCopy = (elem->op == TOKarrayliteral || elem->op == TOKstructliteral);
Expressions *elements = ... | false | false | false | false | false | 0 |
libodraw_array_clone(
libodraw_array_t **destination_array,
libodraw_array_t *source_array,
int (*entry_free_function)(
intptr_t **entry,
libcerror_error_t **error ),
int (*entry_clone_function)(
intptr_t **destination,
intptr_t *source,
li... | false | false | false | false | false | 0 |
LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG) const {
SDNode *Node = Op.getNode();
SDLoc dl(Node);
SmallVector<SDValue, 8> Ops;
unsigned NumOperands = Node->getNumOperands();
for (unsigned i = 0; i < NumOperands; ++i) {
SDValue SubOp = Node->getOperand(i);
EVT VVT = SubOp.getNode()->getValueType(... | false | false | false | false | false | 0 |
nfs3svc_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf)
{
nfsstat3 stat = NFS3ERR_SERVERFAULT;
struct iatt *prestat = NULL;
nfs3_ca... | false | false | false | false | false | 0 |
get_sguid(struct qib_ibport *ibp, unsigned index)
{
if (!index) {
struct qib_pportdata *ppd = ppd_from_ibp(ibp);
return ppd->guid;
}
return ibp->guids[index - 1];
} | false | false | false | false | false | 0 |
double_click(int x, int y, int b)
{
int c, f, i;
src_stack = 0;
if (!(stack_find(x, y, &src_stack, &src_n)))
return;
if (src_stack == hand) {
click(x, y, b);
return;
}
if (b > 1)
return;
c = stack_get_card(src_stack, stack_count_cards(src_stack)-1);
if (VALUE(c) == base_rank) {
for (i = 0; i < 4... | true | false | false | false | false | 1 |
spl_object_storage_attach(spl_SplObjectStorage *intern, zval *this, zval *obj, zval *inf TSRMLS_DC) /* {{{ */
{
spl_SplObjectStorageElement *pelement, element;
int hash_len;
char *hash = spl_object_storage_get_hash(intern, this, obj, &hash_len TSRMLS_CC);
if (!hash) {
return;
}
pelement = spl_object_storage_... | false | false | false | false | false | 0 |
int28pl(PG_FUNCTION_ARGS)
{
int16 arg1 = PG_GETARG_INT16(0);
int64 arg2 = PG_GETARG_INT64(1);
int64 result;
result = arg1 + arg2;
/*
* Overflow check. If the inputs are of different signs then their sum
* cannot overflow. If the inputs are of the same sign, their sum had
* better be that sign too.
*/... | false | false | false | false | false | 0 |
is_wm_key( DFBInputDeviceKeySymbol key_symbol )
{
switch (DFB_LOWER_CASE(key_symbol)) {
case DIKS_SMALL_X:
case DIKS_SMALL_S:
case DIKS_SMALL_C:
case DIKS_SMALL_E:
case DIKS_SMALL_A:
case DIKS_SMALL_W:
case DIKS_SMALL_D:
case DIKS_SMAL... | false | false | false | false | false | 0 |
nfs_page_group_covers_page(struct nfs_page *req)
{
struct nfs_page *tmp;
unsigned int pos = 0;
unsigned int len = nfs_page_length(req->wb_page);
nfs_page_group_lock(req, false);
do {
tmp = nfs_page_group_search_locked(req->wb_head, pos);
if (tmp) {
/* no way this should happen */
WARN_ON_ONCE(tmp->wb_p... | false | false | false | false | false | 0 |
pixCorrelationScoreShifted(PIX *pix1,
PIX *pix2,
l_int32 area1,
l_int32 area2,
l_int32 delx,
l_int32 dely,
l_int32 *tab,
... | false | false | false | false | false | 0 |
handle_rts(struct nl80211_state *state,
struct nl_cb *cb, struct nl_msg *msg,
int argc, char **argv)
{
unsigned int rts;
if (argc != 1)
return 1;
if (strcmp("off", argv[0]) == 0)
rts = -1;
else {
char *end;
if (!*argv[0])
return 1;
rts = strtoul(argv[0], &end, 10);
if (*end != '\0'... | false | false | false | false | false | 0 |
az6027_ci_init(struct dvb_usb_adapter *a)
{
struct dvb_usb_device *d = a->dev;
struct az6027_device_state *state = (struct az6027_device_state *)d->priv;
int ret;
deb_info("%s", __func__);
mutex_init(&state->ca_mutex);
state->ca.owner = THIS_MODULE;
state->ca.read_attribute_mem = az6027_ci_read_attribute_me... | false | false | false | false | false | 0 |
DTPUMatDiag2(void*M, double diag[], int m){
int row,ii;
dtpumat* ABA=(dtpumat*)M;
DSDPFunctionBegin;
for (row=0;row<m;row++){
ii=row*(row+1)/2+row;
ABA->val[ii] +=diag[row];
}
DSDPFunctionReturn(0);
} | false | false | false | false | false | 0 |
amdlibAppendPiston(amdlibPISTON *dstOpd,
amdlibPISTON *srcOpd,
amdlibERROR_MSG errMsg)
{
int dentry;
int sentry;
int band;
amdlibLogTrace("amdlibAppendPiston()");
/* Perform simple check */
if (dstOpd->nbBases != s... | false | false | false | false | false | 0 |
c_finish_goto_label (location_t loc, tree label)
{
tree decl = lookup_label_for_goto (loc, label);
if (!decl)
return NULL_TREE;
TREE_USED (decl) = 1;
{
tree t = build1 (GOTO_EXPR, void_type_node, decl);
SET_EXPR_LOCATION (t, loc);
return add_stmt (t);
}
} | false | false | false | false | false | 0 |
nilfs_segctor_thread(void *arg)
{
struct nilfs_sc_info *sci = (struct nilfs_sc_info *)arg;
struct the_nilfs *nilfs = sci->sc_super->s_fs_info;
int timeout = 0;
sci->sc_timer.data = (unsigned long)current;
sci->sc_timer.function = nilfs_construction_timeout;
/* start sync. */
sci->sc_task = current;
wake_up(&s... | false | false | false | false | false | 0 |
read_line(FILE *f)
{
/* static to remember if a previous call set EOF for given file */
static int c = 0;
static int lineCount = 0;
int buf_size = BUF_SIZE;
int i = 0;
char *line;
if(c==EOF) {
c=0;
lineCount=0;
return NULL;
}
line = (char*) calloc(buf_size, sizeof(char));
w... | false | true | false | false | true | 1 |
dsa_size_ok(int size) {
return (ISC_TF(size >= 512 && size <= 1024 && size % 64 == 0));
} | false | false | false | false | false | 0 |
addButtonForTabContent(Window* wnd)
{
// Create the button
TabButton* tb = createTabButton(makeButtonName(wnd));
// Copy font
tb->setFont(getFont());
// Set target window
tb->setTargetWindow(wnd);
// Instert into map
d_tabButtonVector.push_back(tb);
// add the button
getTabButton... | false | false | false | false | false | 0 |
mlx4_alloc_icm_coherent(struct device *dev, struct scatterlist *mem,
int order, gfp_t gfp_mask)
{
void *buf = dma_alloc_coherent(dev, PAGE_SIZE << order,
&sg_dma_address(mem), gfp_mask);
if (!buf)
return -ENOMEM;
if (offset_in_page(buf)) {
dma_free_coherent(dev, PAGE_SIZE << order,
buf,... | false | false | false | false | false | 0 |
HandleAreaTrigger(Player* source, uint32 trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
{ return; }
// uint32 SpellId = 0;
// uint64 buff_guid = 0;
switch (trigger)
{
case 3686: ... | false | false | false | false | false | 0 |
stackBelowItem(LayerItem &item, LayerItem *above) {
if (!m_manager.isUpdatable())
return;
// if there are no windows provided for above us,
// then we must restack the entire layer
// we can't do XRaiseWindow because a restack then causes OverrideRedirect
// windows to get pushed to the bot... | false | false | false | false | false | 0 |
ExecProcNode(PlanState *node)
{
TupleTableSlot *result;
CHECK_FOR_INTERRUPTS();
if (node->chgParam != NULL) /* something changed */
ExecReScan(node, NULL); /* let ReScan handle this */
if (node->instrument)
InstrStartNode(node->instrument);
switch (nodeTag(node))
{
/*
* control nodes
*/
case ... | false | false | false | false | false | 0 |
iodine(game *g, player *p, item *it, bool t)
{
p->add_disease(DI_IODINE, 1200, g);
if (!p->is_npc())
g->add_msg("You take an iodine tablet.");
} | false | false | false | false | false | 0 |
_picasa_web_service_get_refresh_token_ready_cb (SoupSession *session,
SoupMessage *msg,
gpointer user_data)
{
PicasaWebService *self = user_data;
GSimpleAsyncResult *result;
GError *error = NULL;
JsonNode *node;
result = _web_service_get_result (WEB_SERVICE (self));
if (p... | false | false | false | false | false | 0 |
UpdateAI(const uint32 uiDiff) override
{
// Return since we have no target
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
return;
}
// CurseOfBlood_Timer
if (m_uiCurseOfBloodTimer < uiDiff)
{
if (DoCastSpellIfCan... | false | false | false | false | false | 0 |
make_backsig (PKT_signature *sig, PKT_public_key *pk,
PKT_public_key *sub_pk, PKT_secret_key *sub_sk,
u32 timestamp)
{
PKT_signature *backsig;
int rc;
cache_public_key(sub_pk);
rc= make_keysig_packet (&backsig, pk, NULL, sub_pk, sub_sk, 0x19,
0, 0, timestamp, 0,... | false | false | false | false | false | 0 |
gen_split_2153 (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands)
{
rtx operand0;
rtx operand1;
rtx operand2;
rtx operand3;
rtx _val = 0;
start_sequence ();
#line 5792 "../../src/gcc/config/arm/arm.md"
{
unsigned HOST_WIDE_INT val = INTVAL (operands[1]) & 0xffffffffu;
unsigned HOST_WIDE_INT mask = 0... | false | false | false | false | false | 0 |
hfsplus_getxattr_finder_info(struct inode *inode,
void *value, size_t size)
{
ssize_t res = 0;
struct hfs_find_data fd;
u16 entry_type;
u16 folder_rec_len = sizeof(struct DInfo) + sizeof(struct DXInfo);
u16 file_rec_len = sizeof(struct FInfo) + sizeof(struct FXInfo);
u16 record_len = max(folder_rec_len, fil... | false | true | false | false | false | 1 |
hv_ringbuffer_write(struct vmbus_channel *channel,
struct kvec *kv_list, u32 kv_count, bool lock,
bool kick_q)
{
int i = 0;
u32 bytes_avail_towrite;
u32 totalbytes_towrite = 0;
u32 next_write_location;
u32 old_write;
u64 prev_indices = 0;
unsigned long flags = 0;
struct hv_ring_buffer_info *outring... | false | false | false | false | false | 0 |
parse_f_m(struct parser *p) {
unsigned int idx = parser_getuint(p, "index");
struct feature *f = parser_priv(p);
if (!f)
return PARSE_ERROR_MISSING_RECORD_HEADER;
f->mimic = idx;
return PARSE_ERROR_NONE;
} | false | false | false | false | false | 0 |
ipv6eq(struct sockaddr_in6 * a, struct sockaddr_in6 * b)
{
int i;
for (i = 0; i < 16; i++)
if (a->sin6_addr.s6_addr[i] != b->sin6_addr.s6_addr[i])
return false;
return true;
} | false | false | false | false | false | 0 |
my_iconv_open(const char *dst, const char *src)
{
const char *osrc, *odst;
iconv_t *cache;
iconv_t handle;
osrc = src;
odst = dst;
if (dst == SC_UNICODE)
dst = EXEC_big_endian ? "UCS-4BE" : "UCS-4LE";
else if (dst == SC_UTF8)
dst = "UTF-8";
else if (!dst || *dst == 0)
dst = "ASCII";
if (src == SC_... | false | false | false | false | false | 0 |
make_gobject(ScmClass *klass, GObject *gobj)
{
ScmGObject *g;
SCM_ASSERT(Scm_SubtypeP(klass, SCM_CLASS_GOBJECT)); /* in gauche-gtk.h */
g = SCM_ALLOCATE(ScmGObject, klass);
SCM_SET_CLASS(g, klass);
g->gobject = gobj;
#if DEBUG
Scm_Warn("%s: %u\n", __FUNCTION__, gobj);
#endif
g->data ... | false | false | false | false | false | 0 |
reduceToUMappings(UCMTable *table) {
UCMapping *mappings;
int32_t *map;
int32_t i, j, count;
int8_t flag;
mappings=table->mappings;
map=table->reverseMap;
count=table->mappingsLength;
/* leave the map alone for the initial mappings with desired flags */
for(i=j=0; i<count; ++i) {
... | false | false | false | false | false | 0 |
plugin_need_secrets_cb (DBusGProxy *proxy,
char *setting_name,
GError *error,
gpointer user_data)
{
NMVPNConnection *self = NM_VPN_CONNECTION (user_data);
NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
if (error) {
n... | false | false | false | false | false | 0 |
tp_tests_simple_connection_set_identifier (TpTestsSimpleConnection *self,
const gchar *identifier)
{
TpBaseConnection *conn = (TpBaseConnection *) self;
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn,
TP_HANDLE_TYPE_CONTACT);
TpHandle handle = tp_han... | false | false | false | false | false | 0 |
gf_rtp_send_packet(GF_RTPChannel *ch, GF_RTPHeader *rtp_hdr, char *pck, u32 pck_size, Bool fast_send)
{
GF_Err e;
u32 i, Start;
char *hdr = NULL;
GF_BitStream *bs;
if (!ch || !rtp_hdr
|| !ch->send_buffer
|| !pck
|| (rtp_hdr->CSRCCount && !rtp_hdr->CSRC)
|| (rtp_hdr->CSRCCount > 15)) return GF_BAD_PAR... | false | false | false | false | false | 0 |
cachemgrCheckPassword(cachemgrStateData * mgr)
{
char *pwd = cachemgrPasswdGet(Config.passwd_list, mgr->action);
action_table *a = cachemgrFindAction(mgr->action);
assert(a != NULL);
if (pwd == NULL)
return a->flags.pw_req;
if (strcmp(pwd, "disable") == 0)
return 1;
if (strcmp(pwd, "none") == ... | false | false | true | true | false | 1 |
all_sky_reweight(GList *ofrs, double alpha, double beta)
{
GList *sl;
struct o_frame *ofr;
sl = ofrs;
while(sl != NULL) {
ofr = O_FRAME(sl->data);
sl = g_list_next(sl);
if (ofr->nweight <= 0.0)
continue;
ofr->weight = ofr->nweight / (1.0 + pow(fabs(ofr->residual)/(P_DBL(AP_ALPHA)
/ sqrt(ofr->nwei... | false | false | false | false | false | 0 |
LigneSuiv(char *pbuf)
{
char *p,*f;
int n;
while(1)
{
if((f = fgets(pbuf,MAXL,pi)) != NULL)
{
n = strlen(pbuf);
p = pbuf;
if(*p == '#') continue ;
while(*p == ' ')
{
p++; n--;
}
if(n != 0) return 0;
}
else
return 1;
}
} | false | false | false | false | false | 0 |
_free_thread_status(struct thread_status *thread)
{
_lib_put(thread->dso_data);
if (thread->current_task)
dm_task_destroy(thread->current_task);
dm_free(thread->device.uuid);
dm_free(thread->device.name);
dm_free(thread);
} | false | false | false | false | false | 0 |
get_record_cb(sdp_list_t *recs, int err, gpointer user_data)
{
struct audio_device *dev = user_data;
struct gateway *gw = dev->gateway;
int ch;
sdp_list_t *protos, *classes;
uuid_t uuid;
GIOChannel *io;
GError *gerr = NULL;
if (err < 0) {
error("Unable to get service record: %s (%d)", strerror(-err),
-e... | false | true | false | false | false | 1 |
on_tableWidget_profiles_itemSelectionChanged()
{
QTableWidget *profilesWidget = this->ui->tableWidget_profiles;
if (profilesWidget->selectedItems().size() == 0) {
return; //nothing selected
}
QString pluginName;
int row = this->ui->listWidget_plugins->currentRow();
pluginName = this->ui->listWidget_plugins->it... | false | false | false | false | false | 0 |
is_quotable(const wchar_t *str)
{
switch (*str)
{
case 0:
return 1;
case L'\n':
case L'\t':
case L'\r':
case L'\b':
case L'\x1b':
return 0;
default:
return is_quotable(str+1);
}
return 0;
} | false | false | false | false | false | 0 |
sample_nearest_rect(struct gl_context *ctx,
const struct gl_sampler_object *samp,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
{
const struct gl_texture_image *img = tObj->Ima... | false | false | false | false | false | 0 |
e1000e_remove ( struct pci_device *pdev )
{
struct net_device *netdev = pci_get_drvdata ( pdev );
struct e1000_adapter *adapter = netdev_priv ( netdev );
DBGP ( "e1000e_remove\n" );
if ( adapter->hw.flash_address )
iounmap ( adapter->hw.flash_address );
if ( adapter->hw.hw_addr )
iounmap ( adapter->hw.hw_ad... | false | false | false | false | false | 0 |
clutter_gst_init_with_args (int *argc,
char ***argv,
const char *parameter_string,
GOptionEntry *entries,
const char *translation_domain,
GError ... | false | false | false | false | false | 0 |
uv_nmi_sync_exit(int master)
{
atomic_dec(&uv_nmi_cpus_in_nmi);
if (master) {
while (atomic_read(&uv_nmi_cpus_in_nmi) > 0)
cpu_relax();
atomic_set(&uv_nmi_slave_continue, SLAVE_CLEAR);
} else {
while (atomic_read(&uv_nmi_slave_continue))
cpu_relax();
}
} | false | false | false | false | false | 0 |
gst_matroska_read_common_get_length (GstMatroskaReadCommon * common)
{
GstFormat fmt = GST_FORMAT_BYTES;
gint64 end = -1;
if (!gst_pad_query_peer_duration (common->sinkpad, &fmt, &end) ||
fmt != GST_FORMAT_BYTES || end < 0)
GST_DEBUG_OBJECT (common, "no upstream length");
return end;
} | false | false | false | false | false | 0 |
paint(QPainter* painter, const QStyleOptionGraphicsItem* , QWidget* )
{
if (mPegCnt == 0)
{
return;
}
painter->setRenderHint(QPainter::Antialiasing, true);
if (mIsActive)
{
mPend.setAlpha(0xff);
mPenl.setAlpha(0xff);
mGrad0.setAlpha(0xff);
mGrad1.setAlph... | false | false | false | false | false | 0 |
get_range(/* Input */
int k,
int ssz,
int fsz,
/* Output */
int *fs,
int *fe,
int *ks)
{
if (ssz == 1) {(*fs)=0; (*fe)=fsz; (*ks)=0; return(1);}
(*fs) = 1 + (k-3)*sz2ksp(ssz);
(*fe) =... | false | false | false | false | false | 0 |
load_mem_( byte const* in, long size )
{
assert( offsetof (header_t,packed [4]) == header_size );
int offset = 0;
RETURN_ERR( check_header( in, size, &offset ) );
set_voice_count( 8 );
data = in + offset;
data_end = in + size;
loop_begin = 0;
if ( offset )
header_ = *(header_t const*) in;
else
memset... | false | false | false | false | false | 0 |
gigaset_handle_event(unsigned long data)
{
struct cardstate *cs = (struct cardstate *) data;
/* handle incoming data on control/common channel */
if (cs->inbuf->head != cs->inbuf->tail) {
gig_dbg(DEBUG_INTR, "processing new data");
cs->ops->handle_input(cs->inbuf);
}
process_events(cs);
} | false | false | false | false | false | 0 |
mpd_qnext_toward(mpd_t *result, const mpd_t *a, const mpd_t *b,
const mpd_context_t *ctx, uint32_t *status)
{
int c;
if (mpd_isnan(a) || mpd_isnan(b)) {
if (mpd_qcheck_nans(result, a, b, ctx, status))
return;
}
c = _mpd_cmp(a, b);
if (c == 0) {
mpd_qcop... | false | false | false | false | false | 0 |
x_wrap_open(gx_device * dev)
{
gx_device *tdev;
int rcode, code;
if ((code = get_dev_target(&tdev, dev)) < 0)
return code;
rcode = (*dev_proc(tdev, open_device)) (tdev);
if (rcode < 0)
return rcode;
tdev->is_open = true;
code = get_target_info(dev);
return (code < 0 ? co... | false | false | false | false | true | 1 |
scc_log(int regnum, word32 val, double dcycs)
{
int pos;
pos = g_scc_log_pos;
g_scc_log[pos].regnum = regnum;
g_scc_log[pos].val = val;
g_scc_log[pos].dcycs = dcycs;
pos++;
if(pos >= LEN_SCC_LOG) {
pos = 0;
}
g_scc_log_pos = pos;
} | false | false | false | false | false | 0 |
xc4000_get_frequency(struct dvb_frontend *fe, u32 *freq)
{
struct xc4000_priv *priv = fe->tuner_priv;
*freq = priv->freq_hz + priv->freq_offset;
if (debug) {
mutex_lock(&priv->lock);
if ((priv->cur_fw.type
& (BASE | FM | DTV6 | DTV7 | DTV78 | DTV8)) == BASE) {
u16 snr = 0;
if (xc4000_readreg(priv,... | 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.