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 |
|---|---|---|---|---|---|---|
_tpl_action_chain_free (TplActionChain *self)
{
g_queue_foreach (self->chain, (GFunc) link_free, NULL);
g_queue_free (self->chain);
g_object_unref (self->simple);
g_slice_free (TplActionChain, self);
} | false | false | false | false | false | 0 |
ar5523_stop(struct ieee80211_hw *hw)
{
struct ar5523 *ar = hw->priv;
ar5523_dbg(ar, "stop called\n");
cancel_delayed_work_sync(&ar->stat_work);
mutex_lock(&ar->mutex);
clear_bit(AR5523_HW_UP, &ar->flags);
ar5523_set_ledsteady(ar, UATH_LED_LINK, UATH_LED_OFF);
ar5523_set_ledsteady(ar, UATH_LED_ACTIVITY, UATH_L... | false | false | false | false | false | 0 |
Perl_op_const_sv(pTHX_ const OP *o, CV *cv)
{
dVAR;
SV *sv = NULL;
if (PL_madskills)
return NULL;
if (!o)
return NULL;
if (o->op_type == OP_LINESEQ && cLISTOPo->op_first)
o = cLISTOPo->op_first->op_sibling;
for (; o; o = o->op_next) {
const OPCODE type = o->op_type;
if (sv && o->op_nex... | false | false | false | false | false | 0 |
polish()
{
m_categoryList.data()->setIcon( KIcon( "user-home" ) );
m_categoryList.data()->setMinimumSize( 100, 300 );
connect( m_breadcrumbWidget, SIGNAL(toHome()), this, SLOT(home()) );
// Keyboard shortcut for going back one level
KAction *action = new KAction( KIcon( "go-up" ), i18n( "Go Up in... | false | false | false | false | false | 0 |
opvp_fill_mask(
gx_device *dev,
const byte *data,
int data_x,
int raster,
gx_bitmap_id id,
int x,
int y,
int w,
int h,
const gx_drawing_color *pdcolor,
int depth,
gs_logical_operation_t lop,
const gx_clip_path *pcpath)
{
if (vector) {
#if GS_VERSION_MAJOR >= 8 ... | false | false | false | false | false | 0 |
cciss_find_cfgtables(ctlr_info_t *h)
{
u64 cfg_offset;
u32 cfg_base_addr;
u64 cfg_base_addr_index;
u32 trans_offset;
int rc;
rc = cciss_find_cfg_addrs(h->pdev, h->vaddr, &cfg_base_addr,
&cfg_base_addr_index, &cfg_offset);
if (rc)
return rc;
h->cfgtable = remap_pci_mem(pci_resource_start(h->pdev,
cfg_base... | false | false | false | false | false | 0 |
bgav_qt_glbl_read(qt_atom_header_t * h, bgav_input_context_t * ctx,
qt_glbl_t * ret)
{
ret->size = h->size - 8;
ret->data = malloc(ret->size);
if(bgav_input_read_data(ctx, ret->data, ret->size) < ret->size)
return 0;
return 1;
} | false | false | false | false | false | 0 |
count_addrs (void *P_data, struct sockaddr *a)
/*@*/
{
struct localaddr_data *data = P_data;
switch (a->sa_family) {
case AF_INET:
case AF_INET6:
#ifdef KRB5_USE_NS
case AF_XNS:
#endif
data->count++;
break;
default:
break;
}
return 0;
} | false | false | false | false | false | 0 |
rb_struct_ref4(VALUE obj) {return RSTRUCT_PTR(obj)[4];} | false | false | false | false | false | 0 |
prop_set_string(prop_set_t *ps, property_t prop, const char *val)
{
char *old;
gboolean differ = FALSE;
g_assert(ps != NULL);
if (!prop_in_range(ps, prop))
g_error("prop_get_gchar: unknown property %d", prop);
if (PROP(ps,prop).type != PROP_TYPE_STRING)
g_error("Type mismatch getting value for [%s] of type"
... | false | false | false | false | false | 0 |
devices(struct raid_dev *rd, void *context)
{
unsigned int r = JM_MEMBERS;
struct jm *jm = META(rd, jm);
while (r-- && !jm->member[r]);
return ++r;
} | false | false | false | false | false | 0 |
read_board(byte_board_info& b)
{
// Fixed by data file format
const std::size_t count = 16;
fill_buffer_if_required(count);
char buf[16];
for (int i = 0; i < 16; ++i)
buf[i] = read_unsigned_char_nocheck();
byte_board_type bb;
for (int i = 0; i < 8; ++i) {
for (int j = 0; j < 8; ++j) {
int pos = xy_to... | false | false | false | false | false | 0 |
CL_CheckForResend (void)
{
netadr_t adr;
// if the local server is running and we aren't
// then connect
if (cls.state == ca_disconnected && Com_ServerState() )
{
cls.state = ca_connecting;
strncpy (cls.servername, "localhost", sizeof(cls.servername)-1);
// we don't need a challenge on the localho... | false | true | false | false | false | 1 |
ReadDataArray(std::istream &is, std::vector<Data> &array)
{
if( !is )
return false;
bool bInEndpoint = false;
unsigned int nCurrent = 0;
size_t nLargestSize = 0x100;
while( is ) {
string line;
getline(is, line);
int endpoint;
if( bInEndpoint ) {
if( IsHexData(line) ) {
istringstream sline(line);
... | false | false | false | false | false | 0 |
s_mp_sub(mp_int *a, const mp_int *b) /* magnitude subtract */
{
mp_digit *pa, *pb, *limit;
#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
mp_sword w = 0;
#else
mp_digit d, diff, borrow = 0;
#endif
/*
Subtract and propagate borrow. Up to the precision of b, this
accounts for the digits... | false | false | false | false | false | 0 |
compositor_init_svg_audio(GF_Compositor *compositor, GF_Node *node, Bool slaved_timing)
{
SVG_audio_stack *stack;
GF_SAFEALLOC(stack, SVG_audio_stack)
gf_sc_audio_setup(&stack->input, compositor, node);
/*force first processing of xlink-href*/
gf_node_dirty_set(node, GF_SG_SVG_XLINK_HREF_DIRTY, 0);
if (!slaved... | false | false | false | false | false | 0 |
tp_dbus_check_valid_object_path (const gchar *path, GError **error)
{
const gchar *ptr;
g_return_val_if_fail (path != NULL, FALSE);
if (path[0] != '/')
{
g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_OBJECT_PATH,
"Invalid object path '%s': must start with '/'",
path);
... | false | false | false | false | false | 0 |
_gedit_file_browser_store_iter_expanded (GeditFileBrowserStore *model,
GtkTreeIter *iter)
{
FileBrowserNode *node;
g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model));
g_return_if_fail (iter != NULL);
g_return_if_fail (iter->user_data != NULL);
node = (FileBrowserNode *) (iter->user_data);
i... | false | false | false | false | false | 0 |
getFirstMine()
{
if ( _mineposition && _mineposition->mines.size() )
return &( * _mineposition->mines.begin() );
else
return NULL;
} | false | false | false | false | false | 0 |
mark_comments(void)
{
chunk_t *cur;
chunk_t *next;
bool prev_nl = true;
bool next_nl;
cur = chunk_get_head();
while (cur != NULL)
{
next = chunk_get_next(cur);
next_nl = (next == NULL) || chunk_is_newline(next);
if (chunk_is_comment(cur))
{
if (next_nl &... | false | false | false | false | false | 0 |
ck_call_function (const gchar *function, GError **error)
{
GVariant *r;
if (!ck_proxy)
{
ck_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
... | false | false | false | false | false | 0 |
nv_gotofile(cap)
cmdarg_T *cap;
{
char_u *ptr;
linenr_T lnum = -1;
if (text_locked())
{
clearopbeep(cap->oap);
text_locked_msg();
return;
}
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
{
clearop(cap->oap);
return;
}
#endif
ptr = grab_file_name(cap->count1, &lnum);
if (ptr... | false | false | false | false | false | 0 |
_applog(int prio, const char *str, bool force)
{
#ifdef HAVE_SYSLOG_H
if (use_syslog) {
syslog(LOG_LOCAL0 | prio, "%s", str);
}
#else
if (0) {}
#endif
else {
char datetime[64];
struct timeval tv = {0, 0};
struct tm *tm;
cgtime(&tv);
const time_t tmp_time = tv.tv_sec;
int ms = (int)(tv.tv_usec / 1000... | true | true | false | false | false | 1 |
gg_svg_parse_scale (const char **ptr)
{
/* parsing an SVG Scale definition */
const char *p = *ptr;
double sx;
double sy;
int err = 0;
if (!gg_svg_consume_float (&p, &sx))
err = 1;
gg_svg_consume_whitespace (&p);
if (!gg_svg_consume_float (&p, &sy))
sy = 0.0;
gg_svg_consume_whitespace ... | false | false | false | false | false | 0 |
free_font(const void *info)
{
ASSERT(info != NULL);
font_cache_del(info);
} | false | false | false | false | false | 0 |
decode_v410(bgav_stream_t * s, bgav_packet_t * p, gavl_video_frame_t * f)
{
int i, j;
uint8_t * src;
uint16_t *dst_y, *dst_u, *dst_v;
uint32_t src_i;
yuv_priv_t * priv;
priv = s->data.video.decoder->priv;
priv->frame->planes[0] = p->data;
for(i = 0; i < s->data.video.format.image_height; i++)
... | false | false | false | false | false | 0 |
mo_operwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(!IsOperOperwall(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "operwall");
return 0;
}
sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", parv[1]);
sendto_ser... | false | false | false | false | false | 0 |
tp_base_client_set_handler_bypass_approval (TpBaseClient *self,
gboolean bypass_approval)
{
TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self);
g_return_if_fail (TP_IS_BASE_CLIENT (self));
g_return_if_fail (!self->priv->registered);
g_return_if_fail (cls->handle_channels != NULL);
if (bypass_appro... | false | false | false | true | false | 1 |
finish_off_srcLine( srcLine *Line )
{
if( Line != (srcLine *)NULL ) {
/* When debugging lexer, it is helpful to have lines flushed early.
Normally, it is best to defer flushing lines to as late a stage
as possible so that errors uncovered late in processing can still
be printed next to the source line... | false | false | false | false | false | 0 |
init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h)
{
int ret;
spin_lock_init(&iommu->lock);
/* Add IOMMU to internal data structures */
list_add_tail(&iommu->list, &amd_iommu_list);
iommu->index = amd_iommus_present++;
if (unlikely(iommu->index >= MAX_IOMMUS)) {
WARN(1, "AMD-Vi: Syste... | false | false | false | false | false | 0 |
fetch_bitmap(hashp, ndx)
HTAB *hashp;
int32_t ndx;
{
if (ndx >= hashp->nmaps)
return (NULL);
if (!hashp->mapp[ndx])
hashp->mapp[ndx] = (u_int32_t *)__get_page(hashp,
hashp->hdr.bitmaps[ndx], A_BITMAP);
return (hashp->mapp[ndx]);
} | false | false | false | false | false | 0 |
dht_bootstrap(host_addr_t addr, uint16 port)
{
/*
* We can be called only until we have been fully bootstrapped, but we
* must not continue to attempt bootstrapping from other nodes if we
* are already in the process of looking up our own node ID.
*/
if (dht_is_bootstrapping())
return; /* Hopefully we'l... | false | false | false | false | false | 0 |
sinfo_new_remove_residual_offset( cpl_image * im2, cpl_image * res_image )
{
cpl_image * out_image ;
int i, j, npix ;
pixelvalue res_median ;
pixelvalue * column ;
int lx2=0;
int ly2=0;
int rlx=0;
int rly=0;
int olx=0;
int oly=0;
float* pi2data=NULL;
float* pirdata=NULL;
... | false | false | false | false | false | 0 |
StartTimer()
{
if( !m_last_timestamp ) m_last_timestamp = now;
} | false | false | false | false | false | 0 |
als_proc_event(struct hid_sensor_hub_device *hsdev,
unsigned usage_id,
void *priv)
{
struct iio_dev *indio_dev = platform_get_drvdata(priv);
struct als_state *als_state = iio_priv(indio_dev);
dev_dbg(&indio_dev->dev, "als_proc_event\n");
if (atomic_read(&als_state->common_attributes.data_ready))
hid_sens... | false | false | false | false | false | 0 |
GMT_cdf_read_grd_info (struct GRD_HEADER *header)
{
int ncid;
GMT_LONG err;
if (!strcmp (header->name,"=")) return (GMT_GRDIO_NC_NO_PIPE);
GMT_err_trap (nc_open (header->name, NC_NOWRITE, &ncid));
GMT_err_trap (GMT_cdf_grd_info (ncid, header, 'r'));
GMT_err_trap (nc_close (ncid));
return (GMT_NOERROR);
} | false | false | false | false | false | 0 |
save_response_to_cache (RBAudioscrobblerUser *user, const char *request_name, const char *data)
{
char *filename;
char *file_uri;
GError *error;
filename = calculate_cached_response_path (user, request_name);
file_uri = g_filename_to_uri (filename, NULL, NULL);
error = NULL;
if (rb_uri_create_parent_dirs (file... | false | false | false | false | false | 0 |
fverbf(FILE *stream, const char *format, ...)
{
va_list ap;
int rv = 0;
if (verbose) {
va_start(ap, format);
rv = vfprintf(stream, format, ap);
va_end(ap);
}
return rv;
} | false | false | false | false | true | 1 |
job_schedule(job_op op, const char *path, job_param n1, job_param n2, const char *s1, const char *s2)
{
struct job *j;
/* don't schedule new PUSH/PULL if one already exists */
if (op == JOB_PUSH || op == JOB_PULL)
{
if (job_exists(path, op))
return 0;
}
j = job_alloc();
... | false | false | false | false | false | 0 |
capi20_isinstalled( void ) {
struct sList *psList;
/* check if we are already opened */
if ( capi_fd >= 0 ) {
return CapiNoError;
}
/* Load and initialize modules */
#ifdef __WIN32__
InitModules( "lib/capi/" );
#else
InitModules( LIBDIR );
#endif
if ( psModuleList == NULL ) {
/* if no modules are loaded,... | false | false | false | false | false | 0 |
tree_iterator__reset(git_iterator *self)
{
tree_iterator *ti = (tree_iterator *)self;
while (ti->stack && ti->stack->next)
tree_iterator__pop_frame(ti);
if (ti->stack)
ti->stack->index =
git_tree__prefix_position(ti->stack->tree, ti->base.start);
git_buf_clear(&ti->path);
return tree_iterator__expand_tr... | false | false | false | false | false | 0 |
attempt_to_dock_on_host (GdlDockPlaceholder *ph, GdlDockObject *host,
GdlDockObject *requestor, GdlDockPlacement placement,
gpointer other_data)
{
GdlDockObject *parent;
GtkAllocation allocation;
gint host_width;
gint host_height;
gtk_widget_get_al... | false | false | false | false | false | 0 |
glade_widget_set_object (GladeWidget *gwidget, GObject *new_object, gboolean destroy)
{
GladeWidgetAdaptor *adaptor;
GObject *old_object;
g_return_if_fail (GLADE_IS_WIDGET (gwidget));
g_return_if_fail (new_object == NULL ||
g_type_is_a (G_OBJECT_TYPE (new_object),
gwidget->adaptor->typ... | false | false | false | false | false | 0 |
chksum_setkey(struct crypto_shash *tfm, const u8 *key,
unsigned int keylen)
{
struct chksum_ctx *mctx = crypto_shash_ctx(tfm);
if (keylen != sizeof(mctx->key)) {
crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -EINVAL;
}
mctx->key = le32_to_cpu(*(__le32 *)key);
return 0;
} | false | false | false | false | false | 0 |
fuse_lib_fallocate(fuse_req_t req, fuse_ino_t ino, int mode,
off_t offset, off_t length, struct fuse_file_info *fi)
{
struct fuse *f = req_fuse_prepare(req);
struct fuse_intr_data d;
char *path;
int err;
err = get_path_nullok(f, ino, &path);
if (!err) {
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_fal... | false | false | false | false | false | 0 |
chanopen(const char *name, int fd, int pri, int type, void (*func) (), void *ccbp) {
static char fnc[] = "chanopen";
struct chan *p;
p = (struct chan *) balloc(sizeof(*p));
(p->np = nodealloc())->d = (void *) p;
if (name == (char *) (0))
name = "<UNKNOWN>";
p->name = bstring(name);
if ((fd < 0) || (f... | false | false | false | false | false | 0 |
cancel_message(DBusConnection *conn,
DBusMessage *msg, void *data)
{
DBusMessage *reply;
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) {
fprintf(stderr, "Invalid arguments for passkey Confirm method");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
printf("Request canceled\n");
reply = dbus... | false | false | false | false | false | 0 |
write_header(void)
{
int i;
rbool simple;
file_head_rec filehead;
filehead.fileid=AGT_FILE_SIG;
filehead.ver_own=filehead.ext_own='R';
/* The following will be converted to 1-7 if advanced features aren't
being used. */
filehead.version=2;
filehead.extnum=2;
filehead.fallback_ext=2; /* 'R' ext... | false | false | false | false | false | 0 |
print_site_ad(const site_info& si,
std::ostream& os) {
os << si.known_counts[si.dgt.ref_gt];
for (unsigned b(0); b<N_BASE; ++b) {
if (b==si.dgt.ref_gt) continue;
if (DIGT::expect2(b,si.smod.max_gt)) {
os << ',' << si.known_counts[b];
}
}
} | false | false | false | false | false | 0 |
gdbmi_parser_parse_file(gdbmi_parser_ptr parser,
const char *mi_command_file, gdbmi_output_ptr * pt, int *parse_failed)
{
int pattern;
int mi_status;
if (!parser)
return -1;
if (!mi_command_file)
return -1;
if (!parse_failed)
return -1;
*pt = 0;
*parse_fai... | false | false | false | false | true | 1 |
AddLinkExtension(const char* e, LinkType type)
{
if(e && *e)
{
if(type == LinkStatic)
{
this->StaticLinkExtensions.push_back(e);
}
if(type == LinkShared)
{
this->SharedLinkExtensions.push_back(e);
}
this->LinkExtensions.push_back(e);
}
} | false | false | false | false | false | 0 |
pp_sw_init(void *handle)
{
struct pp_instance *pp_handle;
struct pp_hwmgr *hwmgr;
int ret = 0;
if (handle == NULL)
return -EINVAL;
pp_handle = (struct pp_instance *)handle;
hwmgr = pp_handle->hwmgr;
if (hwmgr == NULL || hwmgr->pptable_func == NULL ||
hwmgr->hwmgr_func == NULL ||
hwmgr->pptable_fu... | false | false | false | false | false | 0 |
build_encoding(private_pkcs7_attributes_t *this)
{
enumerator_t *enumerator;
attribute_t *attribute;
u_int len = 0, count, i = 0;
chunk_t *chunks;
u_char *pos;
count = this->attributes->get_count(this->attributes);
chunks = malloc(sizeof(chunk_t) * count);
enumerator = this->attributes->create_enumerator(this... | false | true | false | false | false | 1 |
cmCPackTGZ_Data_Close(void *client_data)
{
cmCPackTGZ_Data *mydata = (cmCPackTGZ_Data*)client_data;
if ( mydata->Compress )
{
cmCPackTGZ_Data_Write(client_data, 0, 0);
char buffer[8];
int n;
uLong x = mydata->CRC;
for (n = 0; n < 4; n++) {
buffer[n] = (int)(x & 0xff);
x >>= 8;
... | false | false | false | false | false | 0 |
setMoveDirection (int direction)
{
if (tooBusy())
return;
if (! cubeAligned) {
setStandardView(); // Make sure the cube is realigned.
}
// Triggered by LeftArrow or RightArrow key.
currentMoveDirection = (Rotation) direction;
cube->setBlinkingOff ();
moveFeedback = None;
Move * mov... | false | false | false | false | false | 0 |
CERT_DecodeAuthInfoAccessExtension(PLArenaPool *reqArena,
SECItem *encodedExtension)
{
CERTAuthInfoAccess **info = NULL;
SECStatus rv;
int i;
SECItem* newEncodedExtension;
if (!reqArena) {
PORT_SetError(SEC_ERROR_INVALID_ARGS);
return NULL;
}
newEncodedExtension ... | false | false | false | false | false | 0 |
mgr_8bit_map_color_rgb(gx_device *dev, gx_color_index color,
gx_color_value prgb[3])
{ static const gx_color_value ramp[8] =
{ 0, gx_max_color_value / 6, gx_max_color_value / 3,
gx_max_color_value / 2, 2 * (gx_max_color_value / 3),
5 * (gx_max_color_value / 6), gx_max_color_val... | false | false | false | false | false | 0 |
_mv88e6xxx_get_strings(struct dsa_switch *ds,
int nr_stats,
struct mv88e6xxx_hw_stat *stats,
int port, uint8_t *data)
{
int i;
for (i = 0; i < nr_stats; i++) {
memcpy(data + i * ETH_GSTRING_LEN,
stats[i].string, ETH_GSTRING_LEN);
}
} | false | true | false | false | false | 1 |
get_width(u32 mtr)
{
switch (GET_BITFIELD(mtr, 8, 9)) {
case 0:
return DEV_X4;
case 1:
return DEV_X8;
case 2:
return DEV_X16;
}
return DEV_UNKNOWN;
} | false | false | false | false | false | 0 |
api_cmd(UAContext *ua, const char *cmd)
{
if (ua->argc == 2) {
ua->api = atoi(ua->argk[1]);
} else {
ua->api = 1;
}
return true;
} | false | false | false | false | false | 0 |
job_create(void)
{
job_t *res = new job_t(acquire_job_id());
this->my_job_list.push_front(res);
job_set_flag(res,
JOB_CONTROL,
(job_control_mode==JOB_CONTROL_ALL) ||
((job_control_mode == JOB_CONTROL_INTERACTIVE) && (get_is_interactive())));
return res... | false | false | false | false | false | 0 |
document_del_layer(Document *doc, int i) {
if (i < 0 || i >= doc->layer_count) return;
/* FIXME: this doesn't realloc the layers array, so it does not
* reclaim memory allocated by document_add_layer. */
layer_destroy(doc->layers[i]);
for (; i < doc->layer_count - 1; i++)
doc->layers[i] = doc->la... | false | false | false | false | false | 0 |
opdb_find(const char *name)
{
int i;
for (i = 0; i < ARRAY_LEN(keys); i++) {
const struct opdb_key *key = &keys[i];
if (!strcasecmp(key->name, name))
return i;
}
return -1;
} | false | false | false | false | false | 0 |
setTempCaseMapLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode) {
/*
* We could call ucasemap_setLocale(), but here we really only care about
* the initial language subtag, we need not return the real string via
* ucasemap_getLocale(), and we don't care about only getting "x" from
... | false | false | false | false | false | 0 |
bnad_netdev_hwstats_fill(struct bnad *bnad, struct rtnl_link_stats64 *stats)
{
struct bfi_enet_stats_mac *mac_stats;
u32 bmap;
int i;
mac_stats = &bnad->stats.bna_stats->hw_stats.mac_stats;
stats->rx_errors =
mac_stats->rx_fcs_error + mac_stats->rx_alignment_error +
mac_stats->rx_frame_length_error + mac_stat... | false | false | false | false | false | 0 |
do_search(argc, argv)
int argc;
char ** argv;
{
int i;
int rtn = 0;
if (argc == 0)
{
#ifdef NT
if (dir_cnt)
{
char ** result;
int j;
int k;
char buf[MAXPATHL];
multi = TRUE;
for (k = 0; k < dir_cnt; k++)
{
strcpy(buf, dir_list[k]);
if (buf[strlen(buf) - 1] != '\... | false | false | false | false | false | 0 |
gsicc_get_spotnames(gcmmhprofile_t profile, gs_memory_t *memory)
{
int k;
gsicc_namelist_t *list;
gsicc_colorname_t *name;
gsicc_colorname_t **curr_entry;
int num_colors;
char *clr_name;
num_colors = gscms_get_numberclrtnames(profile);
if (num_colors == 0)
return(NULL);
/* A... | false | false | false | false | false | 0 |
Execute(ParticleGroup *group)
{
// This is important if dt is != 1.
pVector one(1,1,1);
pVector scale(one - ((one - damping) * dt));
for(int i = 0; i < group->p_count; i++)
{
Particle &m = group->list[i];
float vSqr = m.vel.length2();
if(vSqr >= vlowSqr && vSqr <= vhighSqr)
{
m.vel.x *= scale.x;
... | false | false | false | false | false | 0 |
qh_appendfacet(facetT *facet) {
facetT *tail= qh facet_tail;
if (tail == qh newfacet_list)
qh newfacet_list= facet;
if (tail == qh facet_next)
qh facet_next= facet;
facet->previous= tail->previous;
facet->next= tail;
if (tail->previous)
tail->previous->next= facet;
else
qh facet_list= fac... | false | false | false | false | false | 0 |
hdhomerun_device_tuner_lockkey_release(struct hdhomerun_device_t *hd)
{
if (hd->multicast_ip != 0) {
return 1;
}
if (!hd->cs) {
hdhomerun_debug_printf(hd->dbg, "hdhomerun_device_tuner_lockkey_release: device not set\n");
return -1;
}
if (hd->lockkey == 0) {
return 1;
}
char name[32];
hdhomerun_sprintf... | true | true | false | false | false | 1 |
addAlbum( ScriptableServiceAlbum * album )
{
int artistId = album->artistId();
if ( m_levels > 2 && !m_ssArtistIdMap.contains( artistId ) ) {
delete album;
return -1;
}
album->setAlbumArtist( ArtistPtr( m_ssArtistIdMap.value( artistId ) ) );
AlbumPtr albumPtr = AlbumPtr( album );
... | false | false | false | false | false | 0 |
inven_item_charges(int item)
{
object_type *o_ptr = &p_ptr->inventory[item];
/* Require staff/wand */
if ((o_ptr->tval != TV_STAFF) && (o_ptr->tval != TV_WAND)) return;
/* Require known item */
if (!object_is_known(o_ptr)) return;
/* Print a message */
msg("You have %d charge%s remaining.", o_ptr->pval[DEFAUL... | false | false | false | false | false | 0 |
write(vnl_vector<double> const& v, char const* variable_name)
{
vnl_matlab_write(out_, v.data_block(), v.size(), make_var_name(variable_name).c_str());
} | false | false | false | false | false | 0 |
delete_from_reschedule_unknown_list(sge_gdi_ctx_class_t *ctx, lListElem *host)
{
lList *rulp;
bool changed = false;
DENTER(TOP_LAYER, "delete_from_reschedule_unknown_list");
rulp = lGetList(host, EH_reschedule_unknown_list);
if (rulp) {
lListElem *this, *next;
next = lFirst(rulp);
... | false | false | false | false | false | 0 |
retrheaders(struct PCPdir *pd, struct PCP_retr *ri,
const char *filename)
{
FILE *fp=fopen(filename, "r");
struct rfc822hdr h;
int rc=0;
if (!fp)
return (errno == ENOENT ? 0:-1);
rfc822hdr_init(&h, 8192);
while (rfc822hdr_read(&h, fp, NULL, 0) == 0)
{
if ((rc= (*ri->callback_headers_func)(ri, h.h... | false | false | false | false | true | 1 |
_k_slotFontChanged(const QFont &font)
{
kDebug(129) << "KFontComboBox - slotFontChanged("
<< font.family() << ") settingFont=" << settingFont;
if (settingFont)
return;
q->setFont(font.family());
q->triggered(font.family());... | false | false | false | false | false | 0 |
object_get_test() {
char result[256];
ojcVal array;
ojcVal val;
struct _ojcErr err;
PathExp pe;
const char *json = "{\"zero\":0,\"one\":{\"1\":true,\"2\":null,\"3\":false},\"two\":12345}";
struct _PathExp data[] = {
{ "zero", "0" },
{ "one", "{\"1\":true,\"2\":null,\"3\":false}" },
{... | false | false | false | false | false | 0 |
vxge_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
{
struct vxgedev *vdev = netdev_priv(dev);
struct vxge_vpath *vpath;
int vp_id;
vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
/* Delete this vlan from the vid table */
for (vp_id = 0; vp_id < vdev->no_of_vpath; vp_id++) {
vp... | false | false | false | false | false | 0 |
rewrite_ac_type_qualifier
#ifdef KC_USE_PROTOTYPES
(ac_type_qualifier kc_p, rview kc_current_view)
#else
(kc_p, kc_current_view) ac_type_qualifier kc_p; rview kc_current_view;
#endif
{
/*SUPPRESS 622*/
assert_ac_type_qualifier( kc_p, "kc_p" );
switch((int)kc_current_view) {
default:
case (int)base_rview: {
switc... | false | false | false | true | false | 1 |
guc_disable_doorbell(struct intel_guc *guc,
struct i915_guc_client *client)
{
struct drm_i915_private *dev_priv = guc_to_i915(guc);
struct guc_doorbell_info *doorbell;
void *base;
int drbreg = GEN8_DRBREGL(client->doorbell_id);
int value;
base = kmap_atomic(i915_gem_object_get_page(client->client_obj, 0));
... | false | false | false | false | false | 0 |
_dxfSimplifiedVertexLocation(
SimpData *s,
u_short val0,
u_short val1,
u_short star_val,
Vertex *star_vert,
Face *star_face,
Plane *star_plane,
float *star_areas,
/* workspace needed for the householder transform: */
... | false | false | false | false | false | 0 |
find_found(FOUND_SET *found_set,uint table_offset,
int found_offset)
{
int i;
for (i=0 ; (uint) i < found_sets ; i++)
if (found_set[i].table_offset == table_offset &&
found_set[i].found_offset == found_offset)
return (short) (-i-2);
found_set[i].table_offset=table_offset;
foun... | false | false | false | false | false | 0 |
tolua_bnd_setpeer(lua_State* L) {
/* stack: userdata, table */
if (!lua_isuserdata(L, -2)) {
lua_pushstring(L, "Invalid argument #1 to setpeer: userdata expected.");
lua_error(L);
};
if (lua_isnil(L, -1)) {
lua_pop(L, 1);
lua_pushvalue(L, TOLUA_NOPEER);
};
lua_setfenv(L, -2);
return 0;
} | false | false | false | false | false | 0 |
reparent(YWindow *parent, int x, int y) {
if (flags & wfVisible) {
addIgnoreUnmap(handle());
}
removeWindow();
fParentWindow = parent;
insertWindow();
MSG(("----------- reparent %lX to %lX", handle(), parent->handle()));
XReparentWindow(xapp->display(),
handle(... | false | false | false | false | false | 0 |
os_tick_check(TICK *tick)
{
if(os_tick_is_active(tick))
{
tick->tick = os_tick_get_now();
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
test_context_engine_set_by_focus (void)
{
IBusEngineDesc *engine_desc;
IBusInputContext *context, *another_context;
if (!ibus_bus_get_use_global_engine (bus))
return;
context = ibus_bus_create_input_context (bus, "test");
ibus_input_context_set_capabilities (context, IBUS_CAP_FOCUS);
... | false | false | false | false | false | 0 |
gst_flv_demux_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstFlvDemux *demux;
gboolean ret = FALSE;
demux = GST_FLV_DEMUX (parent);
GST_DEBUG_OBJECT (demux, "handling event %s", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
if (demux->ra... | false | false | false | false | false | 0 |
EmitPolygonToLayer( OGRLayerH hOutLayer, int iPixValField,
RPolygon *poRPoly, double *padfGeoTransform )
{
OGRFeatureH hFeat;
OGRGeometryH hPolygon;
/* -------------------------------------------------------------------- */
/* Turn bits of lines into coherent rings. ... | false | false | false | false | false | 0 |
find_free_channel()
{
int i = 0;
// iterate through all of the channels
for (i = 0; i < allocated_sound_channels; i++) {
// if the channel is no longer playing, we can use it.
if (!Mix_Playing(i))
return i;
}
// allocate more sound channels
int requested_sound_channels = allocated_sound_channels + 100;... | false | false | false | false | false | 0 |
gf_odf_write_lang(GF_BitStream *bs, GF_Language *ld)
{
GF_Err e;
u32 size;
if (!ld) return GF_BAD_PARAM;
e = gf_odf_size_descriptor((GF_Descriptor *)ld, &size);
if (e) return e;
e = gf_odf_write_base_descriptor(bs, ld->tag, size);
if (e) return e;
gf_bs_write_int(bs, ld->langCode, 24);
return GF_OK;
} | false | false | false | false | false | 0 |
dns_skip_name ( const char *name ) {
while ( 1 ) {
if ( ! *name ) {
/* End of name */
return ( name + 1);
}
if ( *name & 0xc0 ) {
/* Start of a compressed name */
return ( name + 2 );
}
/* Uncompressed name portion */
name += *name + 1;
}
} | false | false | false | false | false | 0 |
previous_song() {
gboolean playing = is_playing() || is_paused();
if (playing) {
stop_song();
}
if (player->track_index > 0) {
player->track_index--;
} else {
player->track_index = g_list_length(player->tracks) - 1;
}
set_song_label(g_list_nth_data(player->tracks, ... | false | false | false | false | false | 0 |
mlx5e_close_tx_cqs(struct mlx5e_channel *c)
{
int tc;
for (tc = 0; tc < c->num_tc; tc++)
mlx5e_close_cq(&c->sq[tc].cq);
} | false | false | false | false | false | 0 |
sha1_feed_fstat(SHA1Context *ctx, int fd)
{
filestat_t buf;
if (-1 != fstat(fd, &buf)) {
SHA1Input(ctx, &buf, sizeof buf);
} else {
sha1_feed_ulong(ctx, fd);
sha1_feed_ulong(ctx, errno);
}
} | false | false | false | false | false | 0 |
Stdio_Desc_Of_Stream(int stm)
{
StmInf *pstm = stm_tbl[stm];
if (stm == stm_stdin) /* works also for stdin with linedit */
return stdin;
if (pstm->fct_getc == (StmFct) fgetc)
return (FILE *) (pstm->file);
return NULL;
} | false | false | false | false | false | 0 |
genwqe_err_resume(struct pci_dev *pci_dev)
{
int rc;
struct genwqe_dev *cd = dev_get_drvdata(&pci_dev->dev);
rc = genwqe_start(cd);
if (!rc) {
rc = genwqe_health_check_start(cd);
if (rc)
dev_err(&pci_dev->dev,
"err: cannot start health checking! (err=%d)\n",
rc);
} else {
dev_err(&pci_dev->dev,
... | false | false | false | false | false | 0 |
moveInfo(const ClpSimplex & rhs, bool justStatus)
{
objectiveValue_ = rhs.objectiveValue_;
numberIterations_ = rhs. numberIterations_;
problemStatus_ = rhs. problemStatus_;
secondaryStatus_ = rhs. secondaryStatus_;
if (numberRows_ == rhs.numberRows_ && numberColumns_ == rhs.numberColumns_ && !j... | false | false | false | false | false | 0 |
pvremove_check(struct cmd_context *cmd, const char *name)
{
struct physical_volume *pv;
/* FIXME Check partition type is LVM unless --force is given */
/* Is there a pv here already? */
/* If not, this is an error unless you used -f. */
if (!(pv = pv_read(cmd, name, 1, 0))) {
if (arg_count(cmd, force_ARG))
... | false | false | false | false | false | 0 |
spk_wait_for_xmitr(void)
{
int tmout = SPK_XMITR_TIMEOUT;
if ((synth->alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) {
pr_warn("%s: too many timeouts, deactivating speakup\n",
synth->long_name);
synth->alive = 0;
/* No synth any more, so nobody will restart TTYs, and we thus
* need to do it ourselves. No... | false | false | false | false | false | 0 |
cheese_preferences_dialog_initialize_values_from_settings (CheesePreferencesDialog* self) {
GtkAdjustment* _tmp0_ = NULL;
GSettings* _tmp1_ = NULL;
gdouble _tmp2_ = 0.0;
GtkAdjustment* _tmp3_ = NULL;
GSettings* _tmp4_ = NULL;
gdouble _tmp5_ = 0.0;
GtkAdjustment* _tmp6_ = NULL;
GSettings* _tmp7_ = NULL;
gdouble... | 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.