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 |
|---|---|---|---|---|---|---|
permutations_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
permutationsobject *po;
Py_ssize_t n;
Py_ssize_t r;
PyObject *robj = Py_None;
PyObject *pool = NULL;
PyObject *iterable = NULL;
Py_ssize_t *indices = NULL;
Py_ssize_t *cycles = NULL;
Py_ssize_t i;
static char ... | false | false | false | false | false | 0 |
BD_DecProtoDelete(GF_BifsDecoder * codec, GF_BitStream *bs)
{
u32 ID, flag, count;
GF_Proto *proto;
flag = gf_bs_read_int(bs, 1);
if (flag) {
flag = gf_bs_read_int(bs, 1);
while (flag) {
ID = gf_bs_read_int(bs, codec->info->config.ProtoIDBits);
proto = gf_sg_find_proto(codec->current_graph, ID, NULL);
... | false | false | false | false | false | 0 |
blk_insert_flush(struct request *rq)
{
struct request_queue *q = rq->q;
unsigned int fflags = q->flush_flags; /* may change, cache */
unsigned int policy = blk_flush_policy(fflags, rq);
struct blk_flush_queue *fq = blk_get_flush_queue(q, rq->mq_ctx);
/*
* @policy now records what operations need to be done. Ad... | false | false | false | false | false | 0 |
rocker_dma_ring_bufs_free(const struct rocker *rocker,
const struct rocker_dma_ring_info *info,
int direction)
{
struct pci_dev *pdev = rocker->pdev;
int i;
for (i = 0; i < info->size; i++) {
const struct rocker_desc_info *desc_info = &info->desc_info[i];
struct rocker_desc *desc = &info->de... | false | false | false | false | false | 0 |
limnPolyDataPrimitiveArea(Nrrd *nout, limnPolyData *pld) {
static const char me[]="limnPolyDataPrimitiveArea";
unsigned int primIdx, baseVertIdx;
unsigned int triNum, triIdx, *indx, ii;
float vert[3][3], edgeA[3], edgeB[3], cross[3];
double *area;
if (!(nout && pld)) {
biffAddf(LIMN, "%s: got NULL poin... | false | false | false | false | false | 0 |
str_sscanf(var) VARIABLE *var;
{
char *fmt = var_to_string(NEXT(var));
char *str = var_to_string(var);
VARIABLE *res;
int i, got;
got = sscanf(str, fmt,
&str_p[0], &str_p[1], &str_p[2], &str_p[3], &str_p[4], &str_p[5],
&str_p[6], &str_p[7], &str_p[8], &str_p[9], &str_p[10], &str_p[11],... | false | false | false | false | false | 0 |
EvalElmPosObj (
Expr expr )
{
Obj elm; /* element, result */
Obj list; /* list, left operand */
Obj pos; /* position, right operand */
Int p; ... | false | false | false | false | false | 0 |
major_alloc_heap (mword nursery_size, mword nursery_align, int the_nursery_bits)
{
char *start;
if (nursery_align)
start = sgen_alloc_os_memory_aligned (nursery_size, nursery_align, SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE, "nursery");
else
start = sgen_alloc_os_memory (nursery_size, SGEN_ALLOC_HEAP | SGEN_ALLOC_AC... | false | false | false | false | false | 0 |
static_elements_m (GtkTextBuffer *buffer,
GtkTextIter *iter, gamgi_symmetry *symmetry)
{
int n, n_m = symmetry->n_m;
gamgi_element **m = symmetry->m;
gamgi_gtk_dialog_text_insert (buffer, iter, "size_normal", "color_link", "\nMirror planes: ");
gamgi_gtk_dialog_text_insert (buffer, iter, "size_normal", "color_text", "... | false | false | false | false | false | 0 |
zxid_mk_ent(zxid_conf* cf, struct zx_md_EntityDescriptor_s* ed)
{
zxid_entity* ent = ZX_ZALLOC(cf->ctx, zxid_entity);
ent->ed = ed;
if (!ed->entityID)
goto bad_md;
ent->eid = zx_str_to_c(cf->ctx, &ed->entityID->g);
sha1_safe_base64(ent->sha1_name, ed->entityID->g.len, ent->eid);
ent->sha1_name[27] = 0;
... | false | false | false | false | false | 0 |
square_set_from_array (const Square sq_array[],
const int sq_count)
{
g_assert(sq_count >= 0);
SquareSet squares = 0;
for (int i = 0; i < sq_count; i++) {
const Square sq = sq_array[i];
g_assert(square_belongs_to_enum_set(sq));
squares |= (SquareSet) 1 << sq;
}
return square... | false | false | false | false | false | 0 |
dountrap(void) /* disarm a trap */
{
if (near_capacity() >= HVY_ENCUMBER)
{
pline("You're too strained to do that.");
return 0;
}
if ((nohands(youmonst.data) && !webmaker(youmonst.data)) || !youmonst.data->mmove)
{
pline("And just how do you expect to do that?");
retu... | false | false | false | false | false | 0 |
callback(gearman_job_st* job, void *context_arg)
{
if (gearman_job_is_map(job))
{
gearman_job_build_reducer(job, NULL);
}
gearman_return_t error= _function(job, context_arg);
switch (error)
{
case GEARMAN_SHUTDOWN:
job->error_code= GEARMAN_SUCCESS;
return GEARMAN_FUNCTION_SHUTDOWN;
case GE... | false | false | false | false | false | 0 |
compileInits(Interpreter &interp,
const Environment &env,
size_t initIndex,
int stackPos,
const InsnPtr &next)
{
if (initIndex >= inits_.size())
return next;
return optimizeCompile(inits_[initIndex], interp, env, stackPos,
compileInits(interp, env, initIndex +... | false | false | false | false | false | 0 |
lowpass (double n, double m, double wc)
{
double alpha = m/2;
double dist;
dist = n - alpha;
if (dist == 0)
return wc / M_PI;
return sin (wc * dist) / (M_PI * dist);
} | false | false | false | false | false | 0 |
manager_set_default_adapter(int id)
{
struct btd_adapter *adapter;
const gchar *path;
default_adapter_id = id;
adapter = manager_find_adapter_by_id(id);
if (!adapter)
return;
path = adapter_get_path(adapter);
g_dbus_emit_signal(connection, "/",
MANAGER_INTERFACE,
"DefaultAdapterChanged",
DBUS_TYPE... | false | false | false | false | false | 0 |
perm_state_get_cur(const qpol_iterator_t * iter)
{
const policydb_t *db = NULL;
class_datum_t *obj_class = NULL;
common_datum_t *comm = NULL;
perm_state_t *ps = NULL;
unsigned int perm_max = 0;
char *tmp = NULL;
if (iter == NULL || (db = qpol_iterator_policy(iter)) == NULL ||
(ps = (perm_state_t *) qpol_it... | false | false | false | false | false | 0 |
httpRequestBodyHandler(char *buf, ssize_t size, void *data)
{
HttpStateData *httpState = (HttpStateData *) data;
httpState->body_buf = NULL;
if (size > 0) {
if (httpState->reply_hdr_state >= 2 && !httpState->flags.abuse_detected) {
httpState->flags.abuse_detected = 1;
debug(11, 1) ("httpRequestBo... | false | false | false | false | false | 0 |
get_volume_for_uuid(GVolumeMonitor *mon, const char *uuid)
{
GUDisksVolumeMonitor* umon = G_UDISKS_VOLUME_MONITOR(mon);
GList* l;
for(l = umon->volumes; l; l=l->next)
{
GUDisksVolume* vol = G_UDISKS_VOLUME(l->data);
if(g_strcmp0(vol->dev->uuid, uuid) == 0)
return (GVolume*)g_... | false | false | false | false | false | 0 |
checkCatchExceptionByValue()
{
if (!_settings->_checkCodingStyle)
return;
const char catchPattern[] = "} catch (";
const Token *tok = Token::findmatch(_tokenizer->tokens(), catchPattern);
const Token *endTok = tok ? tok->tokAt(2)->link() : NULL;
while (tok && endTok)
{
// Find ... | false | false | false | false | false | 0 |
run_diff(const char *cmd, const char *filename)
{
int r;
r = system(cmd);
if (!WIFEXITED(r) || WEXITSTATUS(r) > 1)
{
fprintf(stderr, _("diff command failed with status %d: %s\n"), r, cmd);
exit_nicely(2);
}
#ifdef WIN32
/*
* On WIN32, if the 'diff' command cannot be found, system() returns 1,
* but pr... | false | false | false | false | false | 0 |
jack_client_new_aux(const char* client_name, jack_options_t options, jack_status_t* status)
{
jack_varargs_t va; /* variable arguments */
jack_status_t my_status;
JackClient* client;
if (client_name == NULL) {
jack_error("jack_client_new called with a NULL client_name");
return... | false | false | false | false | false | 0 |
save_ppm(gchar* fileName)
{
FILE *file;
int i;
int j;
int k;
int width;
int height;
GLubyte *rgbbuf;
static gchar message[1024];
if ((!fileName) || (strcmp(fileName,"") == 0))
{
sprintf(message,_("Sorry\n No selected file"));
return message;
}
file = FOpen(fileName,"wb");
if (!file)
... | false | false | false | false | false | 0 |
get_pixbuf_from_icon(SexyIconEntry *entry, SexyIconEntryPosition icon_pos)
{
GdkPixbuf *pixbuf = NULL;
gchar *stock_id;
SexyIconInfo *icon_info = &entry->priv->icons[icon_pos];
GtkIconSize size;
switch (gtk_image_get_storage_type(GTK_IMAGE(icon_info->icon)))
{
case GTK_IMAGE_PIXBUF:
pixbuf = gtk_image_get_p... | false | false | false | false | false | 0 |
li_check_if_current_path(LayoutWindow *lw, const gchar *path)
{
gchar *dirname;
gboolean ret;
if (!path || !layout_valid(&lw) || !lw->dir_fd) return FALSE;
dirname = g_path_get_dirname(path);
ret = (strcmp(lw->dir_fd->path, dirname) == 0);
g_free(dirname);
return ret;
} | false | false | false | false | false | 0 |
guestfs_session_internal_test_rstruct(GuestfsSession *session, const gchar *val, GError **err)
{
guestfs_h *g = session->priv->g;
if (g == NULL) {
g_set_error(err, GUESTFS_ERROR, 0,
"attempt to call %s after the session has been closed",
"internal_test_rstruct");
return NULL;... | false | true | false | false | false | 1 |
bnx2x_q_init(struct bnx2x *bp,
struct bnx2x_queue_state_params *params)
{
struct bnx2x_queue_sp_obj *o = params->q_obj;
struct bnx2x_queue_init_params *init = ¶ms->params.init;
u16 hc_usec;
u8 cos;
/* Tx HC configuration */
if (test_bit(BNX2X_Q_TYPE_HAS_TX, &o->type) &&
test_bit(BNX2X_Q_FLG_HC... | false | false | false | false | false | 0 |
select_config(struct a2dp_sep *sep, uint8_t *capabilities,
size_t length, struct a2dp_setup *setup,
a2dp_endpoint_select_t cb, void *user_data)
{
struct media_endpoint *endpoint = user_data;
struct a2dp_select_data *data;
data = g_new0(struct a2dp_select_data, 1);
data->setup = setup;
data->cb = cb;
if ... | false | false | false | false | false | 0 |
io_overwrites_block(struct pool *pool, struct bio *bio)
{
return (bio_data_dir(bio) == WRITE) &&
io_overlaps_block(pool, bio);
} | false | false | false | false | false | 0 |
claim_destroy_channels_cb (TpChannelDispatchOperation *self,
const GError *error,
gpointer user_data,
GObject *weak_object)
{
GSimpleAsyncResult *result = user_data;
guint i;
for (i = 0; i < self->priv->channels->len; i++)
{
TpChannel *channel = g_ptr_array_index (self->priv->channels, i);
... | false | false | false | false | false | 0 |
tagcompare(const char *s1, const char *s2, int n){
int c=0;
while(c < n){
if(toupper(s1[c]) != toupper(s2[c]))
return !0;
c++;
}
return 0;
} | false | true | false | false | false | 1 |
wind_up_acquisition(void)
{
/* Now process measurements */
process_measurements();
Free(sources);
finalise_io();
if (saved_after_hook) {
(saved_after_hook)(saved_after_hook_anything);
}
} | false | false | false | false | false | 0 |
get_kpkt_len(void)
{
size_t pkt_len = sizeof(struct autofs_v5_packet);
struct utsname un;
int kern_vers;
kern_vers = linux_version_code();
if (kern_vers >= KERNEL_VERSION(3, 3, 0))
return pkt_len;
uname(&un);
if (pkt_len % 8) {
if (strcmp(un.machine, "alpha") == 0 ||
strcmp(un.machine, "ia64") == 0 ... | false | false | false | false | false | 0 |
H5Pset_fapl_stdio(hid_t fapl_id)
{
static const char *func = "H5FDset_fapl_stdio"; /*for error reporting*/
/*NO TRACE*/
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
if(0 == H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file a... | false | false | false | false | false | 0 |
resetLayersInfo()
{
inLayers = false;
succCount = predCount = 0;
for (int i=0; i<radix; i++)
succ[i] = pred[i] = NULL;
} | false | false | false | false | false | 0 |
crypt_get_data_offset(struct crypt_device *cd)
{
if (isPLAIN(cd->type))
return cd->u.plain.hdr.offset;
if (isLUKS(cd->type))
return cd->u.luks1.hdr.payloadOffset;
if (isLOOPAES(cd->type))
return cd->u.loopaes.hdr.offset;
if (isTCRYPT(cd->type))
return TCRYPT_get_data_offset(cd, &cd->u.tcrypt.hdr, &cd->u.... | false | false | false | false | false | 0 |
meth_bind(lua_State *L)
{
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{master}", 1);
const char *address = luaL_checkstring(L, 2);
const char *port = luaL_checkstring(L, 3);
const char *err;
struct addrinfo bindhints;
memset(&bindhints, 0, sizeof(bindhints));
bindhints.ai_socktype = SOCK... | false | false | false | false | false | 0 |
suspend_stratum(struct pool *pool)
{
clear_sockbuf(pool);
applog(LOG_INFO, "Closing socket for stratum pool %d", pool->pool_no);
mutex_lock(&pool->stratum_lock);
pool->stratum_active = pool->stratum_notify = false;
if (pool->stratum_curl) {
#if CURL_HAS_KEEPALIVE
curl_easy_cleanup(pool->stratum_curl);
#else
/... | false | false | false | false | false | 0 |
remove_kmmio_fault_pages(struct rcu_head *head)
{
struct kmmio_delayed_release *dr =
container_of(head, struct kmmio_delayed_release, rcu);
struct kmmio_fault_page *f = dr->release_list;
struct kmmio_fault_page **prevp = &dr->release_list;
unsigned long flags;
spin_lock_irqsave(&kmmio_lock, flags);
while (f) {... | false | false | false | false | false | 0 |
imProcessFFT(const imImage* src_image, imImage* dst_image)
{
if (src_image->data_type != IM_CFLOAT)
imConvertDataType(src_image, dst_image, 0, 0, 0, 0);
else
imImageCopy(src_image, dst_image);
imProcessFFTraw(dst_image, 0, 1, 0); // forward, centered, unnormalized
} | false | false | false | false | false | 0 |
is_format_color_renderable(const struct gl_context *ctx, mesa_format format, GLenum internalFormat)
{
const GLenum baseFormat =
_mesa_get_format_base_format(format);
GLboolean valid;
valid = _mesa_is_legal_color_format(ctx, baseFormat);
if (!valid || _mesa_is_desktop_gl(ctx)) {
return valid;
... | false | false | false | false | false | 0 |
flickcurl_auth_getFrob(flickcurl* fc)
{
char *frob = NULL;
xmlDocPtr doc = NULL;
xmlXPathContextPtr xpathCtx = NULL;
flickcurl_init_params(fc, 0);
flickcurl_end_params(fc);
flickcurl_set_sign(fc);
if(flickcurl_prepare(fc, "flickr.auth.getFrob"))
goto tidy;
doc = flickcurl_invoke(fc);
if(... | false | false | false | false | false | 0 |
CDataType_in_dll(PyObject *type, PyObject *args)
{
PyObject *dll;
char *name;
PyObject *obj;
void *handle;
void *address;
if (!PyArg_ParseTuple(args, "Os:in_dll", &dll, &name))
return NULL;
obj = PyObject_GetAttrString(dll, "_handle");
if (!obj)
return NULL;
if (!Py... | false | false | false | false | false | 0 |
vfs_file_get_contents (const char * filename, void * * buf, int64_t * size)
{
* buf = NULL;
* size = 0;
VFSFile *fd;
gsize filled_size = 0, buf_size = 4096;
unsigned char * ptr;
if ((fd = vfs_fopen(filename, "rb")) == NULL)
return;
if ((* size = vfs_fsize (fd)) >= 0)
{
... | false | false | false | false | false | 0 |
path_distance(int x0,int y0,int x1,int y1)
{
int dx,dy;
dx = abs(x0 - x1);
dy = abs(y0 - y1);
return (dx > dy) ? dx : dy;
} | false | false | false | false | false | 0 |
gui_url_event_after (GtkWidget *textview, GdkEvent *ev, GSList *links_list) {
GtkTextIter start, end, iter;
GtkTextBuffer *buffer;
GdkEventButton *event;
gint x, y;
GSList *tags = NULL, *tagp = NULL;
GtkTextTag *tag;
gchar *link;
size_t slink;
if (ev->type != GDK_BUTTON_RELEASE) {
return FALSE;
}
... | false | false | false | false | false | 0 |
e_shelf_toggle(E_Shelf *es, int show)
{
E_OBJECT_CHECK(es);
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
es->toggle = show;
if (es->autohide_timer) ecore_timer_del(es->autohide_timer);
es->autohide_timer = NULL;
if (es->locked) return;
es->interrupted = -1;
es->urgent_show = 0;
if ((show) && (es->... | false | false | false | false | false | 0 |
GetVertexNeighbor( BN_STRUCT* pBNS, Vertex v, int neigh, EdgeIndex *iedge )
{
/* neigh = 0 => the neighbor is s or t except case when v is s or t. */
/* v= FIRST_INDX or FIRST_INDX+1: v is s or t respectively */
int i, neighbor;
if ( (i = v - 2) >= 0 ) {
/* neighbor of x or y */
if ( nei... | false | false | false | false | false | 0 |
p_get_admin_ptr(void)
{
if (global_pca_ptr == NULL)
{
GapPlayerCacheAdmin *admin_ptr;
global_pca_ptr = g_new(GapPlayerCacheAdmin, 1);
admin_ptr = global_pca_ptr;
admin_ptr->start_elem = NULL;
admin_ptr->end_elem = NULL;
admin_ptr->summary_bytesize = 0;
admin_ptr->configured_max_bytesize... | false | false | false | false | false | 0 |
encode_value_list_scroll(SQLSMALLINT num_of_columns,
SQLSMALLINT Orientation,
SQLINTEGER OffSet, int N,
db_state *state)
{
int i, j, msg_len;
SQLRETURN result;
db_result_msg list_result;
db_result_msg msg;
msg = encode_empty_message();
for (j = 0; j < N; j... | false | false | false | false | false | 0 |
move_mapcanvas(GtkWidget *w, GdkEventMotion *ev, gpointer data)
{
if (gui_gtk2_mouse_over_map_focus && !GTK_WIDGET_HAS_FOCUS(map_canvas)) {
gtk_widget_grab_focus(map_canvas);
}
if (editor_is_active()) {
return handle_edit_mouse_move(ev);
}
cur_x = ev->x;
cur_y = ev->y;
update_line(ev->x, ev->y);... | false | false | false | false | false | 0 |
divider(char *edge)
{
int n;
fprintf(stdout, "%s", edge);
n = page_width - 2;
while (--n >= 0)
fprintf(stdout, "-");
fprintf(stdout, "%s", edge);
newline();
return 0;
} | false | false | false | false | false | 0 |
setScreenFocusedWindow(WinClient &win_client) {
// raise newly focused window to the top of the focused list
// don't change the order if we're cycling or shutting down
if (!isCycling() && !m_screen.isShuttingdown() && !s_reverting) {
m_focused_list.moveToFront(win_client);
if (win_client... | false | false | false | false | false | 0 |
OnListRightClick(wxListEvent& event)
{
wxListCtrl* list = GetVisibleListCtrl();
if (!list)
return;
wxMenu* menu = new wxMenu;
ListItemData* data = reinterpret_cast<ListItemData*>(event.GetData());
if (data && data->plugin)
{
menu->Append(idEditWizardScript, _("Edit this script")... | false | false | false | false | false | 0 |
gsidca_instances_added_cb(GncSxInstanceModel *model, SchedXaction *sx_added, gpointer user_data)
{
GncSxInstanceDenseCalAdapter *adapter = GNC_SX_INSTANCE_DENSE_CAL_ADAPTER(user_data);
g_debug("instance added\n");
if (xaccSchedXactionGetEnabled(sx_added))
{
g_signal_emit_by_name(adapter, "added"... | false | false | false | false | false | 0 |
free_action_list(action_list_t *a)
{
while (a) {
action_list_t *b = a->next;
if(a->a == ACTION_VACATION) {
if(a->u.vac.send.subj) free(a->u.vac.send.subj);
if(a->u.vac.send.addr) free(a->u.vac.send.addr);
if(a->u.vac.send.fromaddr) free(a->u.vac.send.fromaddr);
}
free(a);
a = b;
}
} | false | false | false | false | false | 0 |
grl_related_keys_set (GrlRelatedKeys *relkeys,
GrlKeyID key,
const GValue *value)
{
GValue *copy = NULL;
GrlRegistry *registry;
g_return_if_fail (GRL_IS_RELATED_KEYS (relkeys));
g_return_if_fail (key);
if (!value) {
return;
}
/* Dup value */
if (G_VALUE... | false | false | false | false | false | 0 |
handle_comment(void)
{
int c;
int start_lineno = lineno;
int level = 1;
int seen_star = 0;
int seen_slash = 0;
while((c = input()) != EOF) {
if(c == '/') {
if(seen_star) {
if(--level == 0)
return;
seen_star = 0;
continue;
}
seen_slash = 1;
continue;
} else if(c ... | true | true | false | false | false | 1 |
cmp_max(const uchar *a_ptr, const uchar *b_ptr,
uint max_len)
{
uint a_length, b_length;
int diff;
if (length_bytes == 1)
{
a_length= (uint) *a_ptr;
b_length= (uint) *b_ptr;
}
else
{
a_length= uint2korr(a_ptr);
b_length= uint2korr(b_ptr);
}
set_if_smaller(... | false | false | false | false | false | 0 |
sgen_pointer_queue_pop (SgenPointerQueue *queue)
{
g_assert (queue->next_slot);
return queue->data [--queue->next_slot];
} | false | false | false | false | false | 0 |
contact_set_subscription_states (TpContact *self,
TpSubscriptionState subscribe,
TpSubscriptionState publish,
const gchar *publish_request)
{
if (publish_request == NULL)
publish_request = "";
DEBUG ("contact#%u state changed: subscribe=%c publish=%c '%s'",
self->priv->handle,
_tp_base_... | false | false | false | false | false | 0 |
ocfs2_bmap(struct address_space *mapping, sector_t block)
{
sector_t status;
u64 p_blkno = 0;
int err = 0;
struct inode *inode = mapping->host;
trace_ocfs2_bmap((unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)block);
/* We don't need to lock journal system files, since they aren't
* acce... | false | false | false | false | false | 0 |
pci_generic_config_write(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 val)
{
void __iomem *addr;
addr = bus->ops->map_bus(bus, devfn, where);
if (!addr)
return PCIBIOS_DEVICE_NOT_FOUND;
if (size == 1)
writeb(val, addr);
else if (size == 2)
writew(val, addr);
else
writel(val,... | false | false | false | false | false | 0 |
_ecore_timer_set(Ecore_Timer *timer,
double at,
double in,
Ecore_Task_Cb func,
void *data)
{
Ecore_Timer *t2;
timers_added = 1;
timer->at = at;
timer->in = in;
timer->func = func;
timer->data = data;
timer->... | false | false | false | false | false | 0 |
discard_fd_dst_block(Block *b, Stasche_lm_dt *sld, Lm *lm)
{
const int mt_num = sld->mt_num;
int i;
for (i = 1; i <= mt_num; i++) {
if (cmp_ya_templ) {
discard_fd_dst_block_block_template(b, sld->block[i], sld, lm);
} else {
discard_fd_dst_block_block(b, sld->block[i... | false | false | false | false | false | 0 |
action_image_set_as_background_saved_cb (EAttachment *attachment,
GAsyncResult *result,
EAttachmentHandler *handler)
{
GDesktopBackgroundStyle style;
EAttachmentView *view;
GSettings *settings;
GtkWidget *dialog;
GFile *file;
gpoint... | false | false | false | false | false | 0 |
acpi_db_set_method_data(char *type_arg, char *index_arg, char *value_arg)
{
char type;
u32 index;
u32 value;
struct acpi_walk_state *walk_state;
union acpi_operand_object *obj_desc;
acpi_status status;
struct acpi_namespace_node *node;
/* Validate type_arg */
acpi_ut_strupr(type_arg);
type = type_arg[0];
i... | false | false | false | false | false | 0 |
Perl_sv_setiv(pTHX_ SV *const sv, const IV i)
{
dVAR;
PERL_ARGS_ASSERT_SV_SETIV;
SV_CHECK_THINKFIRST_COW_DROP(sv);
switch (SvTYPE(sv)) {
case SVt_NULL:
case SVt_NV:
sv_upgrade(sv, SVt_IV);
break;
case SVt_PV:
sv_upgrade(sv, SVt_PVIV);
break;
case SVt_PVGV:
if (!isGV_with_GP(sv))
... | false | false | false | false | false | 0 |
gedit_message_bus_lookup (GeditMessageBus *bus,
const gchar *object_path,
const gchar *method)
{
MessageIdentifier *identifier;
GType *message_type;
g_return_val_if_fail (GEDIT_IS_MESSAGE_BUS (bus), G_TYPE_INVALID);
g_return_val_if_fail (object_path != NULL, ... | false | false | false | false | false | 0 |
init_device(AW_device *device) {
device->reset();
device->shift(AW::Vector(shift_x_to_fit, shift_y_to_fit));
device->zoom(this->trans_to_fit);
} | false | false | false | false | false | 0 |
btrescan(PG_FUNCTION_ARGS)
{
IndexScanDesc scan = (IndexScanDesc) PG_GETARG_POINTER(0);
ScanKey scankey = (ScanKey) PG_GETARG_POINTER(1);
BTScanOpaque so;
so = (BTScanOpaque) scan->opaque;
if (so == NULL) /* if called from btbeginscan */
{
so = (BTScanOpaque) palloc(sizeof(BTScanOpaqueData));
so->currPo... | false | false | false | false | false | 0 |
convert_ha_message(xmlNode * parent, HA_Message * msg, const char *field)
{
int lpc = 0;
xmlNode *child = NULL;
const char *tag = NULL;
CRM_CHECK(msg != NULL, crm_err("Empty message for %s", field);
return parent);
tag = cl_get_string(msg, F_XML_TAGNAME);
if (tag == NULL) {
... | false | false | false | false | false | 0 |
OnProjectFileActivated(wxTreeEvent& event)
{
wxTreeItemId id = event.GetItem();
FileTreeData* ftd = (FileTreeData*)m_pTree->GetItemData(id);
ProjectManager *prjManager = Manager::Get()->GetProjectManager();
if (ftd && ftd->GetKind() == FileTreeData::ftdkProject)
{
if (ftd->GetProject() != p... | false | false | false | false | false | 0 |
fldrank(field_t field)
{
double res = 0;
// Using first value as reference (observation)
double *array = &(field.ptr[1]);
double val = array[-1];
const double missval = field.missval;
int nmiss = field.nmiss;
const size_t len = field.size-1;
size_t j;
if ( nmiss ) return(missval)... | false | false | false | false | false | 0 |
open(const char *fileName)
{
m_file = fopen(fileName, "rb");
if (m_file == NULL)
return 0;
setvbuf(m_file, m_buf, _IOFBF, m_bufSize);
m_own = 0;
m_readAhead = 0;
m_lastIsAhead = 0;
return 1;
} | false | false | false | false | false | 0 |
st_sensors_set_dataready_irq(struct iio_dev *indio_dev, bool enable)
{
int err;
u8 drdy_mask;
struct st_sensor_data *sdata = iio_priv(indio_dev);
if (!sdata->sensor_settings->drdy_irq.addr)
return 0;
/* Enable/Disable the interrupt generator 1. */
if (sdata->sensor_settings->drdy_irq.ig1.en_addr > 0) {
err ... | false | false | false | false | false | 0 |
setManagerBinaryPath(const QString &absPath)
{
if (!QDir(absPath).exists())
return false;
d->m_ManagerPath = QDir::cleanPath(absPath);
return true;
} | false | false | false | false | false | 0 |
context_match(const cst_val *PATTERN, const cst_val *STRING,
const cst_val *sets)
{
int r,s,t;
/* printf("PATTERN: "); val_print(stdout, PATTERN); printf("\n"); */
/* printf("STRING: "); val_print(stdout, STRING); printf("\n"); */
if (!PATTERN)
r = TRUE;
else if (!STRING)
r = FALSE;
else if ... | false | false | false | false | false | 0 |
xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt,
int metaType)
{
if (vctxt->nbAttrInfos == 0)
return (NULL);
{
int i;
xmlSchemaAttrInfoPtr iattr;
for (i = 0; i < vctxt->nbAttrInfos; i++) {
iattr = vctxt->attrInfos[i];
... | false | false | false | false | false | 0 |
vector_copy(Vector *from, Vector *to) {
VectorIterator fit, toit;
if (!to || !from) {
if (MATR_DEBUG_MODE) {
fprintf(stderr, "vector_copy: null arguments.\n");
}
return;
}
if (to->type == SPARSE_ARRAY) {
//this is constant time
//and prevents us having to move the array
//around ... | false | false | false | false | false | 0 |
aim_session_init(aim_session_t *sess, fu32_t flags,
int debuglevel)
{
if (!sess)
return;
memset(sess, 0, sizeof(aim_session_t));
aim_connrst(sess);
sess->queue_outgoing = NULL;
sess->queue_incoming = NULL;
aim_initsnachash(sess);
sess->msgcookies = NULL;
sess->icq_info = NULL;
sess->oft_info = NULL;
sess... | false | false | false | false | false | 0 |
dBodyGetRelPointVel (dBodyID b, dReal px, dReal py, dReal pz,
dVector3 result)
{
dAASSERT (b);
dVector3 prel,p;
prel[0] = px;
prel[1] = py;
prel[2] = pz;
prel[3] = 0;
dMULTIPLY0_331 (p,b->posr.R,prel);
result[0] = b->lvel[0];
result[1] = b->lvel[1];
result[2] = b->lvel[2];
dCROSS (result,+=,b... | false | false | false | false | false | 0 |
isValidAssumeForContext(Value *V, const Query &Q) {
Instruction *Inv = cast<Instruction>(V);
// There are two restrictions on the use of an assume:
// 1. The assume must dominate the context (or the control flow must
// reach the assume whenever it reaches the context).
// 2. The context must not be in... | false | false | false | false | false | 0 |
fftInit(long M){
// malloc and init cosine and bit reversed tables for a given size fft, ifft, rfft, rifft
/* INPUTS */
/* M = log2 of fft size (ex M=10 for 1024 point fft) */
/* OUTPUTS */
/* private cosine and bit reversed tables */
int theError = 1;
/*** I did NOT test cases with M>27 ***/
if ((M >= 0) && (M < 8*si... | false | false | false | false | false | 0 |
ReformModuleSymList(void)
{
RfmFunc func;
FuncDict func_dict;
SymbolDict sym_dict;
func = RFM_ModuleCurrent->func;
func_dict = func->func_dict;
for (sym_dict = func_dict->static_sym;
sym_dict != NULL;
sym_dict = sym_dict->next) {
if (sym_dict->type_attr1 == ATTR1... | false | false | false | false | false | 0 |
set_power_limit(struct powercap_zone *power_zone, int id,
u64 power_limit)
{
struct rapl_domain *rd;
struct rapl_package *rp;
int ret = 0;
get_online_cpus();
rd = power_zone_to_rapl_domain(power_zone);
rp = find_package_by_id(rd->package_id);
if (!rp) {
ret = -ENODEV;
goto set_exit;
}
if (rd->state & ... | false | false | false | false | false | 0 |
if_get_by_vmac_base_ifindex(const int ifindex)
{
interface_t *ifp;
element e;
if (LIST_ISEMPTY(if_queue) || !ifindex)
return NULL;
for (e = LIST_HEAD(if_queue); e; ELEMENT_NEXT(e)) {
ifp = ELEMENT_DATA(e);
if (ifp->vmac && ifp->base_ifindex == ifindex)
return ifp;
}
return NULL;
} | false | false | false | false | false | 0 |
_initWireBoundingBox()
{
mRenderOp.vertexData = OGRE_NEW VertexData();
mRenderOp.indexData = 0;
mRenderOp.vertexData->vertexCount = 24;
mRenderOp.vertexData->vertexStart = 0;
mRenderOp.operationType = RenderOperation::OT_LINE_LIST;
mRenderOp.useIndexes = false;
... | false | false | false | false | false | 0 |
got_match(void *context, void *data)
{
struct query_context *qctx = context;
const shared_file_t *sf = data;
shared_file_check(sf);
/*
* Don't insert duplicates (possible when matching both by SHA1 and name).
*/
if (!shared_file_already_found(qctx, sf)) {
/*
* If there is a media type filtering, ignore... | false | false | false | false | false | 0 |
read_input_file_float(const char *input_file, int dim, float *in_matrix)
{
FILE *f = fopen(input_file, "r");
if(f != 0)
{
int i, j;
for(i = 0; i < dim; i++)
{
for(j = 0; j < dim; j++)
{
INDEX(in_matrix, dim, i, j) = scan_float(f);
}
if(j < FLOATS_PER_ROW)
{
char foo[10*FLOATS_PER_RO... | false | false | false | false | false | 0 |
soup_proxy_resolver_gnome_init (SoupProxyResolverGNOME *resolver_gnome)
{
GProxyResolver *gproxyresolver;
GIOExtensionPoint *ep;
GIOExtension *ext;
GType type;
/* FIXME: there is no way to force _g_io_modules_ensure_loaded()
* to be run other than by requesting some extension that we
* don't necessarily want.... | false | false | false | false | false | 0 |
cand_general(obj, small, type)
CcWnnObject obj;
int small;
int type;
{
if (jcNext(JCBUF(obj), small, type) < 0) beep(obj);
ccContextClear(CCBUF(obj));
HINT(obj) = True;
} | false | false | false | false | false | 0 |
AddCheatFromFirstResult(SearchInfo * search)
{
int i;
for(i = 0; i < search->regionListLength; i++)
{
SearchRegion * region = &search->regionList[i];
if(region->numResults)
{
UINT32 traverse;
for(traverse = 0; traverse < region->length; traverse++)
{
UINT32 address = region->addre... | false | false | false | false | false | 0 |
ConsumeReadData(size_t size) {
CritScope cs(&crit_);
ASSERT(size <= data_length_);
const bool was_writable = data_length_ < buffer_length_;
read_position_ = (read_position_ + size) % buffer_length_;
data_length_ -= size;
if (!was_writable && size > 0) {
PostEvent(owner_, SE_WRITE, 0);
}
} | false | false | false | false | false | 0 |
bluetooth_chooser_button_clicked (GtkButton *widget)
{
BluetoothChooserButton *button = BLUETOOTH_CHOOSER_BUTTON (widget);
GtkWidget *parent;
if (button->dialog != NULL) {
gtk_window_present (GTK_WINDOW (button->dialog));
return;
}
parent = gtk_widget_get_toplevel (GTK_WIDGET (button));
//FIXME title
butto... | false | false | false | false | false | 0 |
slotApplicationDisconnected(const QString& wallet, const QString& application) {
#ifdef HAVE_KSECRETSSERVICE
if (walletLauncher->m_useKSecretsService) {
// TODO: implement this
Q_ASSERT(0);
}
else {
#endif
if (d->handle >= 0
&& d->name == wallet
&& application... | false | false | false | false | false | 0 |
Connect(int socketdescriptor, const char* hostName, int port)
{
#ifndef VTK_SOCKET_FAKE_API
if (socketdescriptor < 0)
{
vtkErrorMacro("Invalid descriptor.");
return -1;
}
struct hostent* hp;
hp = gethostbyname(hostName);
if (!hp)
{
unsigned long addr = inet_addr(hostName);
hp = geth... | false | false | false | false | false | 0 |
wm8350_dcdc25_set_suspend_enable(struct regulator_dev *rdev)
{
struct wm8350 *wm8350 = rdev_get_drvdata(rdev);
int dcdc = rdev_get_id(rdev);
u16 val;
switch (dcdc) {
case WM8350_DCDC_2:
val = wm8350_reg_read(wm8350, WM8350_DCDC2_CONTROL)
& ~WM8350_DC2_HIB_MODE_MASK;
wm8350_reg_write(wm8350, WM8350_DCDC2... | false | false | false | false | false | 0 |
paintEvent( QPaintEvent* /*e*/ )
{
QStylePainter painter( this );
QStyleOptionToolButton option;
initStyleOption( &option );
option.features &= ~QStyleOptionToolButton::HasMenu;
painter.drawComplexControl( QStyle::CC_ToolButton, option );
} | false | false | false | false | false | 0 |
au_exists(arg)
char_u *arg;
{
char_u *arg_save;
char_u *pattern = NULL;
char_u *event_name;
char_u *p;
event_T event;
AutoPat *ap;
buf_T *buflocal_buf = NULL;
int group;
int retval = FALSE;
/* Make a copy so that we can change the '#' chars to a NUL. */
arg_save = vim_... | 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.