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 |
|---|---|---|---|---|---|---|
do_shutdown()
{
if (shutdown) return;
netsession->remove_udp_map(this);
shutdown = true;
wakeup_trigger.set_flag();
thread.wait();
} | false | false | false | false | false | 0 |
card_event_handler(struct work_struct *work)
{
struct rsxx_cardinfo *card;
unsigned int state;
unsigned long flags;
int st;
card = container_of(work, struct rsxx_cardinfo, event_work);
if (unlikely(card->halt))
return;
/*
* Enable the interrupt now to avoid any weird race conditions where a
* state chan... | false | false | false | false | false | 0 |
items() const
{
KCompletionMatchesWrapper list; // unsorted
bool addWeight = (d->myOrder == Weighted);
extractStringsFromNode( d->myTreeRoot, QString(), &list, addWeight );
return list.list();
} | false | false | false | false | false | 0 |
tp_call_channel_set_ringing_async (TpCallChannel *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
GSimpleAsyncResult *result;
g_return_if_fail (TP_IS_CALL_CHANNEL (self));
result = g_simple_async_result_new (G_OBJECT (self), callback,
user_data, tp_call_channel_set_ringing_async);
tp_... | false | false | false | false | false | 0 |
xenvif_tx_dealloc_action(struct xenvif_queue *queue)
{
struct gnttab_unmap_grant_ref *gop;
pending_ring_idx_t dc, dp;
u16 pending_idx, pending_idx_release[MAX_PENDING_REQS];
unsigned int i = 0;
dc = queue->dealloc_cons;
gop = queue->tx_unmap_ops;
/* Free up any grants we have finished using */
do {
dp = que... | false | false | false | false | false | 0 |
evaluate(string_ty *path_unres, string_ty *path,
string_ty *path_res, struct stat *st) const
{
//
// evaluate the argument
//
trace(("not::evaluate()\n"));
rpt_value::pointer v1 = get_arg()->evaluate(path_unres, path, path_res, st);
if (v1->is_an_error())
return v1;
//
// coerce th... | false | false | false | false | false | 0 |
replace_return_with_assignment(ir_instruction *ir, void *data)
{
void *ctx = ralloc_parent(ir);
ir_dereference *orig_deref = (ir_dereference *) data;
ir_return *ret = ir->as_return();
if (ret) {
if (ret->value) {
ir_rvalue *lhs = orig_deref->clone(ctx, NULL);
ret->replace_with(new(ctx) ir_assignm... | false | false | false | false | false | 0 |
kcryptd_queue_crypt(struct dm_crypt_io *io)
{
struct crypt_config *cc = io->cc;
INIT_WORK(&io->work, kcryptd_crypt);
queue_work(cc->crypt_queue, &io->work);
} | false | false | false | false | false | 0 |
runOnFunction(Function &F) {
if (&F == MsanCtorFunction)
return false;
MemorySanitizerVisitor Visitor(F, *this);
// Clear out readonly/readnone attributes.
AttrBuilder B;
B.addAttribute(Attribute::ReadOnly)
.addAttribute(Attribute::ReadNone);
F.removeAttributes(AttributeSet::FunctionIndex,
... | false | false | false | false | false | 0 |
iser_unreg_mem_fmr(struct iscsi_iser_task *iser_task,
enum iser_data_dir cmd_dir)
{
struct iser_mem_reg *reg = &iser_task->rdma_reg[cmd_dir];
int ret;
if (!reg->mem_h)
return;
iser_dbg("PHYSICAL Mem.Unregister mem_h %p\n", reg->mem_h);
ret = ib_fmr_pool_unmap((struct ib_pool_fmr *)reg->mem_h);
if (ret)
... | false | false | false | false | false | 0 |
ssh_userauth_kbdint_init(ssh_session session,
const char *username,
const char *submethods)
{
ssh_string str;
int rc;
if (session->pending_call_state == SSH_PENDING_CALL_AUTH_KBDINT_INIT)
goto pending;
if (session->pending_c... | false | false | false | false | false | 0 |
start_monitoring_file_list (NautilusDirectory *directory)
{
DirectoryLoadState *state;
if (!directory->details->file_list_monitored) {
g_assert (!directory->details->directory_load_in_progress);
directory->details->file_list_monitored = TRUE;
nautilus_file_list_ref (directory->details->file_list);
}
if (di... | false | false | false | false | false | 0 |
pathname_ok(const string &path, bool strict)
{
if (path.length() > 255)
return false;
Regex name("[-0-9A-z_./]+");
if (!strict)
name = "[:print:]+";
string::size_type len = path.length();
int result = name.match(path.c_str(), len);
// Protect against casting too big an uint to ... | false | false | false | false | false | 0 |
e_book_backend_ews_open (EBookBackend *backend,
EDataBook *book,
guint opid,
GCancellable *cancellable,
gboolean only_if_exists)
{
EBookBackendEws *cbews;
ESource *source;
GError *error = NULL;
cbews = E_BOOK_BACKEN... | false | false | false | false | false | 0 |
ext4_get_policy(struct inode *inode, struct ext4_encryption_policy *policy)
{
struct ext4_encryption_context ctx;
int res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION,
EXT4_XATTR_NAME_ENCRYPTION_CONTEXT,
&ctx, sizeof(ctx));
if (res != sizeof(ctx))
return -ENOENT;
if (ctx.format != EXT4_ENCRYPTIO... | false | true | false | false | false | 1 |
conn_new(Repl_Agmt *agmt)
{
Repl_Connection *rpc;
rpc = (Repl_Connection *)slapi_ch_malloc(sizeof(repl_connection));
if ((rpc->lock = PR_NewLock()) == NULL)
{
goto loser;
}
rpc->hostname = agmt_get_hostname(agmt);
rpc->port = agmt_get_port(agmt);
rpc->binddn = agmt_get_binddn(agmt);
rpc->bindmethod = agmt_g... | false | false | false | false | false | 0 |
fun_enumerate(JSContext *cx, JSObject *obj)
{
jsid prototypeId;
JSObject *pobj;
JSProperty *prop;
prototypeId = ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom);
if (!obj->lookupProperty(cx, prototypeId, &pobj, &prop))
return JS_FALSE;
if (prop)
pobj->dropProperty(cx, pro... | false | false | false | false | false | 0 |
request_handler (Glib::IOCondition ioc)
{
/* check the request pipe */
if (ioc & ~IO_IN) {
_main_loop->quit ();
}
if (ioc & IO_IN) {
request_channel.drain ();
/* there may been an error. we'd rather handle requests first,
and then get IO_HUP or IO_ERR on the next loop.
*/
/* handle requests */
... | false | false | false | false | false | 0 |
operator/(const double& lhs, const ap::complex& rhs)
{
ap::complex result;
double e;
double f;
if( fabs(rhs.y)<fabs(rhs.x) )
{
e = rhs.y/rhs.x;
f = rhs.x+rhs.y*e;
result.x = lhs/f;
result.y = -lhs*e/f;
}
else
{
e = rhs.x/rhs.y;
f = rhs.y+rh... | false | false | false | false | false | 0 |
gfs2instr(const char *s1, const char *s2)
{
COLORS_HIGHLIGHT;
move(line,0);
printw(s1);
COLORS_NORMAL;
move(line,17);
printw(s2);
line++;
} | false | false | false | false | false | 0 |
free_peers(struct peer *peer)
{
struct peer *next;
while(peer) {
next = peer->next;
if ( peer->name )
free(peer->name);
if ( peer->acls )
free_acl(peer->acls);
IF_FREE(peer->my_auth);
if ( peer->peer_access )
free_acl_access(peer->peer_access);
free(peer);
peer = next;
}
} | false | false | false | false | false | 0 |
eet_node_hash_new(const char *name,
const char *key,
Eet_Node *node)
{
Eina_List *nodes;
Eet_Node *n;
if (!node)
return NULL;
n = _eet_node_new(name, EET_G_HASH);
if (!n)
return NULL;
n->key = eina_stringshare_add(key);
nodes = eina_list_append(NUL... | false | false | false | false | false | 0 |
gst_matroska_demux_move_to_entry (GstMatroskaDemux * demux,
GstMatroskaIndex * entry, gboolean reset)
{
gint i;
GST_OBJECT_LOCK (demux);
/* seek (relative to matroska segment) */
/* position might be invalid; will error when streaming resumes ... */
demux->common.offset = entry->pos + demux->common.ebml... | false | false | false | false | false | 0 |
setPlayerNumber( uint nb )
{
while( ! _players.isEmpty() ) {
delete _players.takeFirst();
}
for( uint i = 0; i < nb; i++ ) {
/// XXX: theMap = 0...
_players.append( new GenericPlayer( 0 ) );
}
} | false | false | false | false | false | 0 |
qt202x_phy_poll(struct efx_nic *efx)
{
bool was_up = efx->link_state.up;
efx->link_state.up = qt202x_link_ok(efx);
efx->link_state.speed = 10000;
efx->link_state.fd = true;
efx->link_state.fc = efx->wanted_fc;
if (efx->phy_type == PHY_TYPE_QT2025C)
qt2025c_bug17190_workaround(efx);
return efx->link_state.up... | false | false | false | false | false | 0 |
gamgi_phys_cell_parallelepiped_index (gamgi_cell *cell, int *index)
{
double base[9], inverse[9];
double v1[3], v2[3], v3[3];
double position[3];
int range[6];
int i, j, k;
int offset;
/**************
* start data *
**************/
gamgi_math_cell_vectors (cell->v1, cell->v2, cell->v3,
cell->v12, cell->v13, cell-... | false | false | false | false | false | 0 |
rt61pci_stop_queue(struct data_queue *queue)
{
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
u32 reg;
switch (queue->qid) {
case QID_AC_VO:
rt2x00mmio_register_read(rt2x00dev, TX_CNTL_CSR, ®);
rt2x00_set_field32(®, TX_CNTL_CSR_ABORT_TX_AC0, 1);
rt2x00mmio_register_write(rt2x00dev, TX_CNTL_CSR, reg);... | false | false | false | false | false | 0 |
DeleteDccClient(struct DccUser *dccptr)
{
if (dccptr == dccnext)
dccnext = dccptr->next;
UnlinkDccClient(dccptr);
close(dccptr->socket);
dccptr->socket = NOSOCKET;
if (dccptr->nick)
MyFree(dccptr->nick);
if (dccptr->username)
MyFree(dccptr->username);
if (dccptr->hostname)
MyFree(dccptr->hostname);
... | false | false | false | false | false | 0 |
rxclass_rule_getall(struct cmd_context *ctx)
{
struct ethtool_rxnfc *nfccmd;
__u32 *rule_locs;
int err, i;
__u32 count;
/* determine rule count */
err = rxclass_get_dev_info(ctx, &count, NULL);
if (err < 0)
return err;
fprintf(stdout, "Total %d rules\n\n", count);
/* alloc memory for request of location l... | false | false | false | false | false | 0 |
OGG_CanHandleStream(GF_BaseDecoder *dec, u32 StreamType, GF_ESD *esd, u8 PL)
{
/*video decs*/
if (StreamType == GF_STREAM_VISUAL) {
char *dsi;
/*media type query*/
if (!esd) return GF_CODEC_STREAM_TYPE_SUPPORTED;
dsi = esd->decoderConfig->decoderSpecificInfo ? esd->decoderConfig->decoderSpecificInfo->data : N... | false | false | false | false | false | 0 |
_tabs_cb_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Wheel *ev = event_info;
Tab_View *v = data;
if (ev->z > 0)
{
_plugin_next(v);
v->view->update(v->view);
}
else if (ev->z < 0)
{
_plugin_prev(v);
v-... | false | false | false | false | false | 0 |
allocate (int row,int col) {
unsigned int newrow,newcol;
if (row>=lastrow) {
newrow=(row/16+1)*16;
rowptr=realloc(rowptr,newrow*sizeof(struct rowdescr));
if (rowptr == NULL) {
perror("allocating sheet ");
exit(1);
}
memset(rowptr+lastrow,0,(newrow-lastrow)*sizeof(struct rowdescr));
lastrow=newrow;
... | false | false | false | false | true | 1 |
applyUniversalNR ( DlCompletionTree* Node,
const DlCompletionTreeArc* arcSample,
const DepSet& dep_, unsigned int flags )
{
// check whether a flag is set
if ( flags == 0 )
return false;
const TRole* R = arcSample->getRole();
DepSet dep = dep_ + arcSample->getDep();
for ( DlCompletion... | false | false | false | false | false | 0 |
setName(const QString& name)
{
if (m_name != name) {
QStringList files = QDir(Session::path(), "*.session").entryList(QDir::Files);
files.prepend("");
foreach (const QString& file, files) {
Session session(file);
if (session.theme() == m_name) {
session.setTheme(name);
}
}
QFile::remove(filePat... | false | false | false | false | false | 0 |
add_keyfile_plugin (NMSettings *self)
{
NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
GObject *keyfile_plugin;
keyfile_plugin = nm_settings_keyfile_plugin_new (priv->config_file);
g_assert (keyfile_plugin);
add_plugin (self, NM_SYSTEM_CONFIG_INTERFACE (keyfile_plugin));
} | false | false | false | false | false | 0 |
CalculateCommonVoteMask(uint32 max_enchanting_skill)
{
m_commonVoteMask = ROLL_VOTE_MASK_ALL;
ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(itemid);
if (itemProto->Flags2 & ITEM_FLAG2_NEED_ROLL_DISABLED)
m_commonVoteMask = RollVoteMask(m_commonVoteMask & ~ROLL_VOTE_MASK_NEED);
... | false | false | false | false | false | 0 |
decode_frame_pcm(bgav_stream_t * s)
{
pcm_t * priv;
priv = s->data.audio.decoder->priv;
if(!priv->p && !get_packet(s))
return 0;
/* Decode stuff */
priv->decode_func(s);
gavl_audio_frame_copy_ptrs(&s->data.audio.format, s->data.audio.frame, priv->frame);
if(!priv->bytes_in_packet)
... | false | false | false | false | false | 0 |
record_plan_function_dependency(PlannerInfo *root, Oid funcid)
{
/*
* For performance reasons, we don't bother to track built-in functions;
* we just assume they'll never change (or at least not in ways that'd
* invalidate plans using them). For this purpose we can consider a
* built-in function to be one wit... | false | false | false | false | false | 0 |
add_cmdsocket(struct cmdsocket *cmdsocket)
{
cmdsocket->prev = socketlist;
cmdsocket->next = socketlist->next;
if(socketlist->next != NULL) {
socketlist->next->prev = cmdsocket;
}
socketlist->next = cmdsocket;
} | false | false | false | false | false | 0 |
SetProperty_Bool ( XMP_StringPtr schemaNS,
XMP_StringPtr propName,
bool propValue,
XMP_OptionBits options )
{
XMP_Assert ( (schemaNS != 0) && (propName != 0) ); // Enforced by wrapper.
XMP_VarString valueStr;
XMPUtils::ConvertFromBool ( propValue, &valueStr );
SetProperty ( schemaNS, pro... | false | false | false | false | false | 0 |
getdrive(path)
CONST char *path;
{
int i, drive;
if (!(drive = __dospath(path))) {
doserrno = ENOENT;
return(-1);
}
if (lastdrive < 0) {
for (i = 0; i < 'Z' - 'A' + 1; i++) curdir[i] = NULL;
lastdrive = drive;
}
return(drive);
} | false | false | false | false | false | 0 |
transformOfType(CreateStmtContext *cxt, TypeName *ofTypename)
{
HeapTuple tuple;
TupleDesc tupdesc;
int i;
Oid ofTypeId;
AssertArg(ofTypename);
tuple = typenameType(NULL, ofTypename, NULL);
check_of_type(tuple);
ofTypeId = HeapTupleGetOid(tuple);
ofTypename->typeOid = ofTypeId; /* cached for later */
... | false | false | false | false | false | 0 |
pcomm_init( pcomm_context_t *context )
{
pcomm_result_t result = PCOMM_SUCCESS;
if ( !context ) {
result = PCOMM_NULL_CONTEXT;
}
else if ( list_init( &context->read_fds ) ||
list_init( &context->write_fds ) ||
list_init( &context->error_fds ) ) {
result = ... | false | false | false | false | false | 0 |
file_can_show(FmFolderModel* model, FmFileInfo* file)
{
if(!model->show_hidden && fm_file_info_is_hidden(file))
return FALSE;
if(model->filters)
{
GSList* l;
for(l = model->filters; l; l=l->next)
{
FmFolderModelFilterItem* item = (FmFolderModelFilterItem*)l->data;... | false | false | false | false | false | 0 |
gnac_ui_file_chooser_key_press_event_cb(GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
if (gnac_ui_utils_event_is_return_key(event)) {
gnac_ui_file_chooser_response_cb(GTK_DIALOG(widget),
GTK_RESPONSE_NONE,... | false | false | false | false | false | 0 |
ajp14_unmarshal_log_ok(jk_msg_buf_t *msg,
jk_login_service_t *s, jk_logger_t *l)
{
unsigned long nego;
char *sname;
JK_TRACE_ENTER(l);
nego = jk_b_get_long(msg);
if (nego == 0xFFFFFFFF) {
jk_log(l, JK_LOG_ERROR,
"can't get negociated data");
... | false | false | false | false | false | 0 |
clk_register_clkdev(struct clk *clk, const char *con_id,
const char *dev_fmt, ...)
{
struct clk_lookup *cl;
va_list ap;
if (IS_ERR(clk))
return PTR_ERR(clk);
va_start(ap, dev_fmt);
cl = vclkdev_create(__clk_get_hw(clk), con_id, dev_fmt, ap);
va_end(ap);
return cl ? 0 : -ENOMEM;
} | false | false | false | false | false | 0 |
print_owner_ttl(struct query_node *qun, adns_answer *answer) {
if (qun->pqfr.show_owner) print_withspace(owner_show(qun,answer));
print_ttl(qun,answer);
} | false | false | false | false | false | 0 |
loadStaticPlugins(QHash<QString, QGeoPositionInfoSourceFactory *> &plugins)
{
#if !defined QT_NO_DEBUG
const bool showDebug = qgetenv("QT_DEBUG_PLUGINS").toInt() > 0;
#endif
QObjectList staticPlugins = QPluginLoader::staticInstances();
for (int i = 0; i < staticPlugins.count(); ++i) {
QGeoPositionI... | false | false | false | false | false | 0 |
pkix_List_Remove(
PKIX_List *list,
PKIX_PL_Object *object,
void *plContext)
{
PKIX_PL_Object *current = NULL;
PKIX_UInt32 numEntries = 0;
PKIX_UInt32 index = 0;
PKIX_Boolean match = PKIX_FALSE;
PKIX_ENTER(LIST, "pkix_List_Remove");
PKIX_NULLCHECK_... | false | false | false | false | false | 0 |
stack_regs_mentioned_p (const_rtx pat)
{
const char *fmt;
int i;
if (STACK_REG_P (pat))
return 1;
fmt = GET_RTX_FORMAT (GET_CODE (pat));
for (i = GET_RTX_LENGTH (GET_CODE (pat)) - 1; i >= 0; i--)
{
if (fmt[i] == 'E')
{
int j;
for (j = XVECLEN (pat, i) - 1; j >= 0; j--)
if (stack_r... | false | false | false | false | false | 0 |
max77693_muic_set_path(struct max77693_muic_info *info,
u8 val, bool attached)
{
int ret = 0;
unsigned int ctrl1, ctrl2 = 0;
if (attached)
ctrl1 = val;
else
ctrl1 = MAX77693_CONTROL1_SW_OPEN;
ret = regmap_update_bits(info->max77693->regmap_muic,
MAX77693_MUIC_REG_CTRL1, COMP_SW_MASK, ctrl1);
if (ret < ... | false | false | false | false | false | 0 |
draw_sprites1(struct mame_bitmap *bitmap, const struct rectangle *cliprect, int priority)
{
int offs,x,y,sprite,sprite2,colour,extra,fx,fy;
for (offs = 0;offs < 0x800;offs += 8)
{
y=buffered_spriteram[offs+1]+(buffered_spriteram[offs]<<8);
if ((y&0x8000) == 0) continue;
fx=buffered_spriteram[o... | false | false | false | false | false | 0 |
ath10k_build_dump_file(struct ath10k *ar)
{
struct ath10k_fw_crash_data *crash_data = ar->debug.fw_crash_data;
struct ath10k_dump_file_data *dump_data;
struct ath10k_tlv_dump_data *dump_tlv;
int hdr_len = sizeof(*dump_data);
unsigned int len, sofar = 0;
unsigned char *buf;
len = hdr_len;
len += sizeof(*dump_tl... | false | false | false | false | false | 0 |
DB_SubstString(const char *pattern, int len_pattern, DB_SUBST_CALLBACK add)
{
int i;
unsigned char last_c, c;
int n;
char quote[20] = {0};
c = 0;
len_pattern--;
for (i = 0; i < len_pattern; i++)
{
last_c = c;
c = pattern[i];
if (c == '&')
{
c = pattern[++i];
if (c == '&')
continue;
i... | false | false | false | false | false | 0 |
wrap_int(int x, int a, int b) {
if (x < a){
return b - (a - x) % (b - a);
}else if (x >= b){
return a + (x - b) % (b - a);
}
return x;
} | false | false | false | false | false | 0 |
ScriptGetEvalFromScriptPosition(Object* object, void*) {
HandleScope scope;
Handle<Script> script(Script::cast(JSValue::cast(object)->value()));
// If this is not a script compiled through eval there is no eval position.
int compilation_type = Smi::cast(script->compilation_type())->value();
if (compilation_t... | false | false | false | false | false | 0 |
simplify_and_const_int_1 (enum machine_mode mode, rtx varop,
unsigned HOST_WIDE_INT constop)
{
unsigned HOST_WIDE_INT nonzero;
unsigned HOST_WIDE_INT orig_constop;
rtx orig_varop;
int i;
orig_varop = varop;
orig_constop = constop;
if (GET_CODE (varop) == CLOBBER)
return NULL_RTX;
/* Simplify ... | false | false | false | false | false | 0 |
bitmap_set_bit (head, bit)
bitmap head;
int bit;
{
bitmap_element *ptr = bitmap_find_bit (head, bit);
unsigned word_num = bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;
unsigned bit_num = bit % BITMAP_WORD_BITS;
BITMAP_WORD bit_val = ((BITMAP_WORD) 1) << bit_num;
if (ptr == 0)
{
ptr = bi... | false | false | false | false | false | 0 |
c_solvesim (double *a, int n, double *rs, int m, double *res)
/**** solvesim
solve simultanuously a linear system.
****/
{ complex **x,**b,*h;
complex sum,t;
int i,k,l,j;
ram=newram;
luflag=0; c_lu(a,n,n); if (error) return;
/* initialize x and b */
x=(complex **)ram;
increase(ram,(long)n*sizeof(complex *));
... | false | false | false | false | false | 0 |
gst_pes_filter_flush (GstPESFilter * filter)
{
g_return_if_fail (filter != NULL);
if (filter->adapter) {
gst_adapter_clear (filter->adapter);
if (filter->adapter_offset)
*filter->adapter_offset = G_MAXUINT64;
}
filter->state = STATE_HEADER_PARSE;
} | false | false | false | false | false | 0 |
ncp_tcp_write_space(struct sock *sk)
{
struct ncp_server *server = sk->sk_user_data;
/* We do not need any locking: we first set tx.creq, and then we do sendmsg,
not vice versa... */
server->write_space(sk);
if (server->tx.creq)
schedule_work(&server->tx.tq);
} | false | false | false | false | false | 0 |
list_lru_from_memcg_idx(struct list_lru_node *nlru, int idx)
{
/*
* The lock protects the array of per cgroup lists from relocation
* (see memcg_update_list_lru_node).
*/
lockdep_assert_held(&nlru->lock);
if (nlru->memcg_lrus && idx >= 0)
return nlru->memcg_lrus->lru[idx];
return &nlru->lru;
} | false | false | false | false | false | 0 |
cd_sensor_register_object (CdSensor *sensor,
GDBusConnection *connection,
GDBusInterfaceInfo *info,
GError **error)
{
GError *error_local = NULL;
gboolean ret = FALSE;
static const GDBusInterfaceVTable interface_vtable = {
cd_sensor_dbus_method_call,
cd_sensor_dbus_get_property,
NULL
};
s... | false | false | false | false | false | 0 |
p_conditional_delace_drawable(GapStbFetchData *gfd, gint32 drawable_id)
{
gint32 l_deinterlace;
gdouble l_threshold;
if(gfd->frn_type == GAP_FRN_MOVIE)
{
/* deinterlace for cliptype movie is already handled by the API at fetching.
*/
return;
}
/* split delace value: integer part is deinterla... | false | false | false | false | false | 0 |
gdata_mock_server_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
GDataMockServer *self = GDATA_MOCK_SERVER (object);
switch (property_id) {
case PROP_TRACE_DIRECTORY:
gdata_mock_server_set_trace_directory (self, g_value_get_object (value));
break;
case PROP_ENAB... | false | false | false | false | false | 0 |
SIBackendInit(SISeg *segP)
{
int index;
ProcState *stateP = NULL;
/* Look for a free entry in the procState array */
for (index = 0; index < segP->lastBackend; index++)
{
if (segP->procState[index].nextMsgNum < 0) /* inactive slot? */
{
stateP = &segP->procState[index];
break;
}
}
if (stateP ==... | false | false | false | false | false | 0 |
DefVarDeflate( int nVarId, int bChunkingArg )
{
#ifdef NETCDF_HAS_NC4
if ( nCompress == NCDF_COMPRESS_DEFLATE ) {
// must set chunk size to avoid huge performace hit (set bChunkingArg=TRUE)
// perhaps another solution it to change the chunk cache?
// htt... | false | false | false | false | true | 1 |
MakeSmallCapGlyphSlot(SplineFont *sf,SplineChar *cap_sc,
uint32 script,struct lookup_subtable **c2sc,struct lookup_subtable **smcp,
FontViewBase *fv, struct genericchange *genchange) {
SplineChar *sc_sc, *lc_sc;
char buffer[300];
PST *pst;
int enc;
int script_index;
lc_sc = MakeSmallCapName(b... | false | false | false | false | false | 0 |
X509_reject_clear(X509 *x)
{
if(x->aux && x->aux->reject) {
sk_ASN1_OBJECT_pop_free(x->aux->reject, ASN1_OBJECT_free);
x->aux->reject = NULL;
}
} | false | false | false | false | false | 0 |
create_tcs_context()
{
struct tcs_context *ret = (struct tcs_context *)calloc(1, sizeof(struct tcs_context));
if (ret != NULL) {
ret->handle = getNextHandle();
COND_INIT(ret->cond);
}
return ret;
} | false | false | false | false | false | 0 |
myantssimilaritymaxlabel(std::vector<float> labelvec, std::vector<float> similarityvec, bool opt)
{
typedef std::vector<float>::size_type vec_sz;
vec_sz size = labelvec.size();
if( size == 0 )
{
return 0;
}
unsigned int max = 0;
float maxsim = -1.e9;
float totalsim = 0;
for( un... | false | false | false | false | false | 0 |
_copy_line_advance(const char **s, STRING *line)
{
NEOERR *err;
int x = 0;
const char *st = *s;
const char *nl;
nl = strchr(st, '\n');
if (nl == NULL)
{
x = strlen(st);
err = string_appendn(line, st, x);
if (err) return nerr_pass(err);
*s = st + x;
}
else
{
x = nl - st;
err ... | false | false | false | false | false | 0 |
znode_alloc (struct znode *parent, const TCHAR *name)
{
TCHAR fullpath[MAX_DPATH];
TCHAR tmpname[MAX_DPATH];
struct znode *zn = xcalloc (struct znode, 1);
struct znode *zn2;
_tcscpy (tmpname, name);
zn2 = parent->child;
while (zn2) {
if (!_tcscmp (zn2->name, tmpname)) {
TCHAR *ext = _tcsrchr (tmpname, '.')... | false | false | false | false | true | 1 |
_2BUSChangePSC (reader* globalData, uchar socket,
uchar* password, int len, uchar* outBuffer, int *outBufLen) {
int retVal = ASE_OK;
if (len != 2 * _2BUS_PSC_SIZE) {
AddSW1SW2(MEM_CARD_INVALID_PARAMETER, outBuffer, outBufLen, 0);
return retVal;
}
retVal = _2... | false | false | false | false | false | 0 |
use_global_hostiles_txt_changed(property_t unused_prop)
{
(void) unused_prop;
if (GNET_PROPERTY(use_global_hostiles_txt) && !hostile_db[HOSTILE_GLOBAL]) {
hostiles_retrieve(HOSTILE_GLOBAL);
}
return FALSE;
} | false | false | false | false | false | 0 |
terminal_profile_get_property_string (TerminalProfile *profile,
const char *prop_name)
{
const GValue *value;
value = get_prop_value_from_prop_name (profile, prop_name);
g_return_val_if_fail (value != NULL && G_VALUE_HOLDS_STRING (value), NULL);
if (!value || !G_VALUE_HOLD... | false | false | false | false | false | 0 |
copyScanKeys(GinScanKey keys, uint32 nkeys)
{
GinScanKey newkeys;
uint32 i,
j;
newkeys = (GinScanKey) palloc(sizeof(GinScanKeyData) * nkeys);
memcpy(newkeys, keys, sizeof(GinScanKeyData) * nkeys);
for (i = 0; i < nkeys; i++)
{
newkeys[i].scanEntry = (GinScanEntry) palloc(sizeof(GinScanEntryData) * keys[i... | false | false | false | false | false | 0 |
CopyProjectsToStateBuffer(PROJECTS& p, CC_STATE& state) {
int retval = 0;
unsigned int i;
PROJECT* state_project = NULL;
// flag for delete
for (i=0; i<state.projects.size(); i++) {
state_project = state.projects[i];
state_project->flag_for_delete = true;
}
for (i=0; i<p.pr... | false | false | false | false | false | 0 |
ipheth_open(struct net_device *net)
{
struct ipheth_device *dev = netdev_priv(net);
struct usb_device *udev = dev->udev;
int retval = 0;
usb_set_interface(udev, IPHETH_INTFNUM, IPHETH_ALT_INTFNUM);
retval = ipheth_carrier_set(dev);
if (retval)
return retval;
retval = ipheth_rx_submit(dev, GFP_KERNEL);
if (... | false | false | false | false | false | 0 |
vt_equate_reg_base_value (const_rtx reg1, const_rtx reg2)
{
(*reg_base_value)[REGNO (reg1)] = REG_BASE_VALUE (reg2);
} | false | false | false | false | false | 0 |
moveBonus(){
if(the_bonus!=NULL){
//for(i=0; i<bonuses.size(); i++){
the_bonus->move(xpos,ypos);
blit(the_bonus->frame(), the_bonus->x(), the_bonus->y());
the_bonus->decLife();
if(the_bonus->lifeforce == 0){
//vector<Bonus*>::iterator itRemove = bonuses.begin() + i;
//bonuses.erase(itRemove);
... | false | false | false | false | false | 0 |
wc_set_font_name(wtype, fontname)
int wtype;
char *fontname;
{
char **fn = (char **)0;
if (!fontname) return;
switch(wtype) {
case NHW_MAP:
fn = &iflags.wc_font_map;
break;
case NHW_MESSAGE:
fn = &iflags.wc_font_message;
break;
case NHW_TEXT:
fn = &iflags.wc_font_text;
br... | false | false | false | false | false | 0 |
parse_range(const char *portstring, void *lower, void *upper,
int bits, uint32_t min, uint32_t max)
{
char *buffer;
char *cp, *end;
uint32_t low_nr, upp_nr;
int ret = 0;
buffer = strdup(portstring);
if ((cp = strchr(buffer, ':')) == NULL) {
low_nr = strtoul(buffer, &end, 10);
if (*end || low_nr < min || l... | false | false | false | false | false | 0 |
write_entry(struct exfat* ef, struct exfat_node* dir,
const le16_t* name, cluster_t cluster, off_t offset, uint16_t attrib)
{
struct exfat_node* node;
struct exfat_entry_meta1 meta1;
struct exfat_entry_meta2 meta2;
const size_t name_length = utf16_length(name);
const int name_entries = DIV_ROUND_UP(name_length, ... | false | true | false | false | false | 1 |
vfsub_lookup_one_len(const char *name, struct dentry *parent,
int len)
{
struct path path = {
.mnt = NULL
};
/* VFS checks it too, but by WARN_ON_ONCE() */
IMustLock(d_inode(parent));
path.dentry = lookup_one_len(name, parent, len);
if (IS_ERR(path.dentry))
goto out;
if (d_is_positive(path.dentry))... | false | false | false | false | false | 0 |
smk_write_rules_list(struct file *file, const char __user *buf,
size_t count, loff_t *ppos,
struct list_head *rule_list,
struct mutex *rule_lock, int format)
{
struct smack_parsed_rule rule;
char *data;
int rc;
int trunc = 0;
int tokens;
ssize_t cnt = 0;
/*
* No partial writes.
* Enough data ... | false | false | false | false | false | 0 |
put_param_int(gs_param_list *plist, gs_param_name pname, int *pvalue, int minval, int maxval, int ecode)
{ int code, value;
switch ( code = param_read_int(plist, pname, &value) )
{
default:
return code;
case 1:
return ecode;
case 0:
... | false | false | false | false | false | 0 |
selectOutputSlot()
{
QString s = QFileDialog::getOpenFileName(this,"Browse for output tape file",lineEdit->text());
lineEdit->setText(s);
} | false | false | false | false | false | 0 |
fini ( void )
{
int rc = SLURM_SUCCESS;
#ifdef HAVE_XCPU
rc = _fini_status_pthread();
#endif
slurm_mutex_lock(&cr_mutex);
_free_cr(cr_ptr);
cr_ptr = NULL;
slurm_mutex_unlock(&cr_mutex);
return rc;
} | false | false | false | false | false | 0 |
CheckHeap(){
for(int i=blocks.Len()-1;i>0;i--){
memblock *current=blocks(i);
memblock *low=blocks(Lower(i));
if (Lower(UpperL(i))!=i || Lower(UpperR(i))!=i)
tERR_ERROR_INT("Error in lower/upper " << i << "!");
if (low->value>current->value)
tERR_ERROR_INT("He... | false | false | false | false | false | 0 |
part_close (part_t *part)
{
dbg_printf ("part_close()");
dbg_level_up ();
if (part) {
blkio_close (part->blkio);
if (part->partinfo)
free (part->partinfo);
free (part);
}
dbg_level_down ();
dbg_printf ("ret=NULL");
return NULL;
} | false | false | false | false | false | 0 |
xinvert ( short *p, int nr )
{
int i ;
if ( ! *p ) {
for ( i=0 ; i<nr-1 ; i++ ) { /* remove */
p[i] = p[i+1] ;
}
nr-- ;
} else {
for ( i=nr ; i>0 ; i-- ) { /* insert */
p[i] = p[i-1] ;
}
p[0] = 0 ;
nr++ ;
}
return nr ;
} | false | false | false | false | true | 1 |
IsTopHorz(const long64 XPos)
{
TEdge* e = m_SortedEdges;
while( e )
{
if( ( XPos >= std::min(e->xcurr, e->xtop) ) &&
( XPos <= std::max(e->xcurr, e->xtop) ) ) return false;
e = e->nextInSEL;
}
return true;
} | false | false | false | false | false | 0 |
populate_model (GtkTreeModel * store, GList * docs)
{
GtkTreeIter iter;
while (docs != NULL)
{
GtrPo *po;
GFile *location;
gchar *name;
po = GTR_PO (docs->data);
location = gtr_po_get_location (po);
name = g_file_get_path (location);
g_object_unref (location);
... | false | false | false | false | false | 0 |
mapInstanceToElement(SVGElementInstance* instance, SVGElement* element)
{
ASSERT(instance);
ASSERT(element);
if (m_elementInstances.contains(element))
m_elementInstances.get(element)->add(instance);
else {
HashSet<SVGElementInstance*>* set = new HashSet<SVGElementInstance*>();
s... | false | false | false | false | false | 0 |
s5p_mfc_stop_streaming(struct vb2_queue *q)
{
unsigned long flags;
struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv);
struct s5p_mfc_dev *dev = ctx->dev;
if ((ctx->state == MFCINST_FINISHING ||
ctx->state == MFCINST_RUNNING) &&
dev->curr_ctx == ctx->num && dev->hw_lock) {
ctx->state = MFCINST_ABORT;
s5p_mfc... | false | false | false | false | false | 0 |
uvd_v6_0_sw_init(void *handle)
{
struct amdgpu_ring *ring;
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
/* UVD TRAP */
r = amdgpu_irq_add_id(adev, 124, &adev->uvd.irq);
if (r)
return r;
r = amdgpu_uvd_sw_init(adev);
if (r)
return r;
r = amdgpu_uvd_resume(adev);
if (r)
return r;... | false | true | false | false | false | 1 |
vmw_stream_unref_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct vmw_private *dev_priv = vmw_priv(dev);
struct vmw_resource *res;
struct vmw_user_stream *stream;
struct drm_vmw_stream_arg *arg = (struct drm_vmw_stream_arg *)data;
struct ttm_object_file *tfile = vmw_fpriv(file_p... | false | false | false | false | false | 0 |
parse_ip_port(const char *addr, sock_addr *saddr)
{
char *s, *p;
unsigned port;
char *endp = NULL;
int ret;
s = strdup(addr);
if (!s) {
fprintf(stderr, "Failed strdup()\n");
return -1;
}
p = rindex(s, ':');
if (!p) {
fprintf(stderr, "This addr: %s does not contain a port number\n", s);
free(s);
ret... | 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.