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 |
|---|---|---|---|---|---|---|
find_unique_abbrev(const unsigned char *sha1, int len)
{
int status, is_null;
static char hex[41];
is_null = is_null_sha1(sha1);
memcpy(hex, sha1_to_hex(sha1), 40);
if (len == 40 || !len)
return hex;
while (len < 40) {
unsigned char sha1_ret[20];
status = get_short_sha1(hex, len, sha1_ret, 1);
if (!statu... | false | false | false | false | false | 0 |
write()
{
return boost::shared_ptr<std::ostringstream>(new std::ostringstream, FinalizeWrite(m_data));
} | false | false | false | false | false | 0 |
ov518_i2c_w(struct sd *sd,
u8 reg,
u8 value)
{
struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
PDEBUG(D_USBO, "ov518_i2c_w %02x %02x", reg, value);
/* Select camera register */
reg_w(sd, R51x_I2C_SADDR_3, reg);
/* Write "value" to I2C data port of OV511 */
reg_w(sd, R51x_I2C_DATA, value);
/* Initia... | false | false | false | false | false | 0 |
test_attributes_find (void)
{
CK_ATTRIBUTE_PTR attr;
attr = gkm_attributes_find (attr_template, G_N_ELEMENTS (attr_template), CKA_LABEL);
g_assert (attr != NULL);
g_assert (attr->type == CKA_LABEL);
} | false | false | false | false | false | 0 |
test_fields_rw_single(tst_case *tc, void *data)
{
Store *store = open_ram_store();
char *bin_data = prepare_bin_data(BIN_DATA_LEN);
Document *doc = prepare_doc();
FieldInfos *fis = prepare_fis();
FieldsWriter *fw;
FieldsReader *fr;
DocField *df;
(void)data;
Aiequal(4, fis->size);
... | false | false | false | false | false | 0 |
tps65912_irq(int irq, void *irq_data)
{
struct tps65912 *tps65912 = irq_data;
u32 irq_sts;
u32 irq_mask;
u8 reg;
int i;
tps65912->read(tps65912, TPS65912_INT_STS, 1, ®);
irq_sts = reg;
tps65912->read(tps65912, TPS65912_INT_STS2, 1, ®);
irq_sts |= reg << 8;
tps65912->read(tps65912, TPS65912_INT_STS3, 1... | false | true | false | false | true | 1 |
sigmaKin() {
// Pick new flavour.
idNew = 1 + int( nQuarkNew * rndmPtr->flat() );
mNew = particleDataPtr->m0(idNew);
m2New = mNew*mNew;
// Calculate kinematics dependence.
sigS = 0.;
if (sH > 4. * m2New) sigS = (4./9.) * (tH2 + uH2) / sH2;
// Answer is proportional to number ... | false | false | false | false | false | 0 |
mmu_zap_unsync_children(struct kvm *kvm,
struct kvm_mmu_page *parent,
struct list_head *invalid_list)
{
int i, zapped = 0;
struct mmu_page_path parents;
struct kvm_mmu_pages pages;
if (parent->role.level == PT_PAGE_TABLE_LEVEL)
return 0;
kvm_mmu_pages_init(parent, &parents, &pages);
while (mmu_u... | false | false | false | false | false | 0 |
get_type_name (GType type, gboolean * is_pointer)
{
const gchar *type_name;
*is_pointer = FALSE;
type_name = g_type_name (type);
switch (type) {
case G_TYPE_NONE:
case G_TYPE_CHAR:
case G_TYPE_UCHAR:
case G_TYPE_BOOLEAN:
case G_TYPE_INT:
case G_TYPE_UINT:
case G_TYPE_LONG:
case G_TYPE_ULONG:
... | false | false | false | false | false | 0 |
e_mixer_update(E_Mixer_Instance *inst)
{
int r;
e_modapi_save(mixer_mod);
if ((!inst) || (!inst->conf))
return 0;
r = _mixer_sys_setup(inst);
if (r && _mixer_using_default)
e_mixer_system_callback_set(inst->sys, _mixer_system_cb_update, inst);
return r;
} | false | false | false | false | false | 0 |
gkm_wrap_prompt_done_set_pin (GkmWrapPrompt *self, CK_RV call_result)
{
CK_TOKEN_INFO tinfo;
SetPinPrompt *data;
g_assert (GKM_IS_WRAP_PROMPT (self));
g_assert (self->destroy_data == set_pin_prompt_free);
data = self->prompt_data;
/* Save auto auto unlock */
if (call_result == CKR_OK && auto_unlock_should_atta... | false | false | false | false | false | 0 |
_clone_handler(netsnmp_mib_handler *it)
{
netsnmp_mib_handler *dup;
if(NULL == it)
return NULL;
dup = netsnmp_create_handler(it->handler_name, it->access_method);
if(NULL != dup)
dup->flags = it->flags;
return dup;
} | false | false | false | false | false | 0 |
LowerCallResult(
SDValue Chain, SDValue InFlag, CallingConv::ID CallConv, bool IsVarArg,
const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc DL, SelectionDAG &DAG,
SmallVectorImpl<SDValue> &InVals) const {
MachineFunction &MF = DAG.getMachineFunction();
// Assign locations to each value returned by this c... | false | false | false | false | false | 0 |
fc_exch_reset(struct fc_exch *ep)
{
struct fc_seq *sp;
int rc = 1;
spin_lock_bh(&ep->ex_lock);
fc_exch_abort_locked(ep, 0);
ep->state |= FC_EX_RST_CLEANUP;
fc_exch_timer_cancel(ep);
if (ep->esb_stat & ESB_ST_REC_QUAL)
atomic_dec(&ep->ex_refcnt); /* drop hold for rec_qual */
ep->esb_stat &= ~ESB_ST_REC_QUAL;
... | false | false | false | false | false | 0 |
Gasp_Default(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
GGadget *gg = GWidgetGetControl(GGadgetGetWindow(g),CID_Gasp);
int rows;
struct matrix_data *gasp;
if ( !SFHasInstructions(d->sf)) {
... | false | false | false | false | false | 0 |
count_total_ips(struct gr_learn_ip_node *node)
{
unsigned long ips = 0;
struct gr_learn_ip_node *tmp;
if (node->leaves == NULL)
return 1;
for_each_list_entry(tmp, node->leaves)
ips += count_total_ips(tmp);
return ips;
} | false | false | false | false | false | 0 |
on_captured_event (ClutterActor *stage,
ClutterEvent *event,
ClutterClickAction *action)
{
ClutterClickActionPrivate *priv = action->priv;
ClutterActor *actor;
ClutterModifierType modifier_state;
gboolean has_button = TRUE;
actor = clutter_actor_meta_get_acto... | false | false | false | false | false | 0 |
gdev_pcl_map_color_rgb(gx_device *pdev, gx_color_index color,
gx_color_value prgb[3])
{
/* For the moment, we simply ignore any black correction */
switch (pdev->color_info.depth) {
case 1:
prgb[0] = prgb[1] = prgb[2] = -((gx_color_value)color ^ 1);
break;
case 8:
if (p... | false | false | false | false | false | 0 |
other_edge(edge_t * e)
{
elist_append(e, ND_other(agtail(e)));
} | false | false | false | false | false | 0 |
Java_magick_MagickImage_scaleImage
(JNIEnv *env, jobject self, jint cols, jint rows)
{
Image *image = NULL;
Image *scaledImage = NULL;
jobject returnedImage;
jfieldID magickImageHandleFid = NULL;
ExceptionInfo exception;
image = (Image*) getHandle(env, self, "magickImageHandle",
&... | false | false | false | false | false | 0 |
batch_job_submit_simple(struct batch_queue * q, const char *cmd, const char *extra_input_files, const char *extra_output_files)
{
if(!q->job_table)
q->job_table = itable_create(0);
if(q->type == BATCH_QUEUE_TYPE_LOCAL) {
return batch_job_submit_simple_local(q, cmd, extra_input_files, extra_output_files);
} else... | false | false | false | false | false | 0 |
on_treeView_customContextMenuRequested(const QPoint &pos)
{
QMenu *pop = new QMenu(this);
pop->addActions(ui->button->actions());
pop->exec(ui->widget->treeView()->mapToGlobal(pos));
delete pop;
} | false | false | false | false | false | 0 |
abraca_tool_bar_create_track_label (AbracaToolBar* self) {
const gchar* _tmp0_ = NULL;
GtkLabel* _tmp1_;
GtkLabel* _tmp2_;
GtkLabel* _tmp3_;
GtkLabel* _tmp4_;
GtkLabel* _tmp5_;
g_return_if_fail (self != NULL);
_tmp0_ = _ ("No Track");
_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
_tmp2_ = g_object_ref_sink (_t... | false | false | false | false | false | 0 |
VvhVpnAddTrans( Name )
char *Name;
{
if ( VvhProcess != (vpnproc_list *)0 )
{
return( addvpnproctrans( VvhVpnFigure, VvhProcess, Name ) );
}
return( addvpnfunctrans( VvhVpnFigure, VvhFunction, Name ) );
} | false | false | false | false | false | 0 |
_wi_array_remove_item(wi_array_t *array, _wi_array_item_t *item) {
_WI_ARRAY_RELEASE(array, item->data);
item->data = NULL;
item->link = array->item_free_list;
array->item_free_list = item;
} | false | false | false | true | false | 1 |
prism2_ioctl_giwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra)
{
struct hostap_interface *iface;
local_info_t *local;
iface = netdev_priv(dev);
local = iface->local;
ap_addr->sa_family = ARPHRD_ETHER;
switch (iface->type) {
case HOSTAP_INTERFAC... | false | true | false | false | false | 1 |
transaction_list_show_toggle_mark ( gboolean show )
{
gint line_p, col_p;
GtkTreeIter iter;
gint i;
CustomList *custom_list;
if ( show )
/* remet le gtk_tree_view en mode normal */
gtk_tree_view_set_fixed_height_mode ( GTK_TREE_VIEW (
gsb_transactions_list_ge... | false | false | false | false | false | 0 |
operator==(const QMediaContent &other) const
{
return (d.constData() == 0 && other.d.constData() == 0) ||
(d.constData() != 0 && other.d.constData() != 0 &&
*d.constData() == *other.d.constData());
} | false | false | false | false | false | 0 |
freenewer()
{
/* Free memory allocated by allocnewer() */
/* spp must be the same as when allocnewer was called */
long i;
if (newerwhere) {
free(newerwhere);
free(newerhowmany);
free(newerfactor);
for (i = 0; i < spp; i++)
free(charorder[i]);
free(charorder);
}
} | false | false | false | false | false | 0 |
seek_position(SAMPLE_SPECS::sample_pos_t pos)
{
if (supports_seeking() != true &&
pos != 0) {
ECA_LOG_MSG(ECA_LOGGER::info,
"WARNING: seeking not supported by audio objects of type \"" +
name() + "\".");
return position_in_samples();
}
return pos;
} | false | false | false | false | false | 0 |
game_update_stats( int id, GameStats *stats )
{
Paddle *paddle;
if ( id < 0 || id >= cur_game->paddle_count ) return;
/* this should be called before game_finalize() as the
* stats will be cleared there */
paddle = cur_game->paddles[id];
stats->total_score += paddle->score;
if ( stats->total_score < 0 ) ... | false | false | false | false | false | 0 |
free_cnode(struct super_block *sb,
struct reiserfs_journal_cnode *cn)
{
struct reiserfs_journal *journal = SB_JOURNAL(sb);
reiserfs_check_lock_depth(sb, "free_cnode");
journal->j_cnode_used--;
journal->j_cnode_free++;
/* memset(cn, 0, sizeof(struct reiserfs_journal_cnode)) ; */
cn->next = journal->j_cn... | false | false | false | false | false | 0 |
lexSkipLookaheadWord() {
if (lexBuf.strsLen <= lexBuf.len) {
lexBuf.len -= lexBuf.strsLen;
lexBuf.getPtr = (lexBuf.getPtr + lexBuf.strsLen) % MAX_LEX_LOOKAHEAD;
}
} | false | false | false | false | false | 0 |
OnBarRefresh ( wxCommandEvent& WXUNUSED( event ) )
{
if ( m_refresh_timer->IsRunning () ) {
m_refresh_timer->Stop ();
m_ftp_update_timer->Stop ();
m_toolbar->DeleteTool ( ID_BAR_REFRESH );
m_toolbar->InsertTool ( 0, ID_BAR_REFRESH, wxT( "Refresh" ),
m_toolBarBitmaps[ 4 ], wxNullBitmap... | false | false | false | false | false | 0 |
find_matching_predicate_in_rest_chains (use_pred_info_t pred,
vec<use_pred_info_t> *preds,
size_t num_pred_chains)
{
size_t i, j, n;
/* trival case */
if (num_pred_chains == 1)
return true;
for (i = 1; i < num_pred_chains; i+... | false | false | false | false | false | 0 |
isl_basic_map_remove_divs(
__isl_take isl_basic_map *bmap)
{
if (!bmap)
return NULL;
bmap = isl_basic_map_eliminate_vars(bmap,
isl_space_dim(bmap->dim, isl_dim_all), bmap->n_div);
if (!bmap)
return NULL;
bmap->n_div = 0;
return isl_basic_map_finalize(bmap);
} | false | false | false | false | false | 0 |
deljob(const Hashspq *jp)
{
struct spr_req oreq;
if (nodelete)
return;
oreq.spr_mtype = MT_SCHED;
oreq.spr_un.o.spr_pid = getpid();
oreq.spr_un.o.spr_act = SO_AB;
oreq.spr_un.o.spr_netid = 0;
oreq.spr_un.o.spr_jpslot = jp - Job_seg.jlist;
oreq.spr_un.o.spr_jobno = jp->j.spq_job;
oreq.spr_un.o.spr_arg1 = 0;
... | false | false | false | false | false | 0 |
setBaudRate(BaudRate r, FlowControl i, FlowControl o)
{
iFlow = i;
oFlow = o;
rate = r;
if (server.setBaudRate(r,i,o)) {
if (conf.baudRateDelay)
pause(conf.baudRateDelay);
return (true);
} else
return (false);
} | false | false | false | false | false | 0 |
on_file_save()
{
if(m_filename != "")
{
ConfigLoader::export_config(m_pConfig, m_filename, true, true);
}
else
{
//display save as dialog (and set m_filename after!)
Gtk::FileChooserDialog* dialog = NULL;
Gtk::CheckButton* export_disableds = NULL;
Gtk::CheckButton* export_comments = N... | false | false | false | false | false | 0 |
decompress(int compression, int input, int output)
{
char *command[2];
/*
* Note that it is not possible to handle 'pack' or 'compress'
* formats because appending data does not work with them.
*/
switch (compression & FP_MASK) {
case FP_GZIPPED: command[0] = "gzip"; command[1] = "-cd"; break;
case FP_BZIP2... | true | true | true | false | false | 1 |
icc_new_ph(struct IsdnCardState *cs)
{
switch (cs->dc.icc.ph_state) {
case (ICC_IND_EI1):
ph_command(cs, ICC_CMD_DI);
l1_msg(cs, HW_RESET | INDICATION, NULL);
break;
case (ICC_IND_DC):
l1_msg(cs, HW_DEACTIVATE | CONFIRM, NULL);
break;
case (ICC_IND_DR):
l1_msg(cs, HW_DEACTIVATE | INDICATION, NULL);
br... | false | false | false | false | false | 0 |
_scsih_refresh_expander_links(struct MPT3SAS_ADAPTER *ioc,
struct _sas_node *sas_expander, u16 handle)
{
Mpi2ExpanderPage1_t expander_pg1;
Mpi2ConfigReply_t mpi_reply;
int i;
for (i = 0 ; i < sas_expander->num_phys ; i++) {
if ((mpt3sas_config_get_expander_pg1(ioc, &mpi_reply,
&expander_pg1, i, handle))) ... | false | false | false | false | false | 0 |
s_trunc(VALUE s, VALUE *fr)
{
VALUE rs;
if (wholenum_p(s)) {
rs = to_integer(s);
*fr = INT2FIX(0);
}
else {
rs = f_idiv(s, INT2FIX(1));
*fr = f_mod(s, INT2FIX(1));
*fr = f_quo(*fr, INT2FIX(86400));
}
return rs;
} | false | false | false | false | false | 0 |
fuse_resolve_and_resume (fuse_state_t *state, fuse_resume_fn_t fn)
{
xlator_t *inode_xl = NULL;
xlator_t *active_xl = NULL;
fuse_gfid_set (state);
state->resume_fn = fn;
active_xl = fuse_active_subvol (state->this);
inode_xl = fuse_state_subvol (state);
if (!in... | false | false | false | true | false | 1 |
add_type( const std::string& name )
{
Type type = last_type() + 1;
names_.push_back( name );
types_.insert( std::make_pair( name, type ) );
if( type > 1 )
subtype_.push_back( new std::vector<bool>( 2*(type - 1), false ) );
return( type );
} | false | false | false | false | false | 0 |
getline_RGB (guint8 * dest, const GstBlendVideoFormatInfo * src, guint xoff,
int j)
{
int i;
const guint8 *srcline = GET_LINE (src, 0, j) + xoff * 3;
for (i = 0; i < src->width; i++) {
dest[i * 4 + 0] = 0xff;
dest[i * 4 + 1] = srcline[i * 3 + 0];
dest[i * 4 + 2] = srcline[i * 3 + 1];
dest[i *... | false | false | false | false | false | 0 |
replaceAllSynonyms ( void )
{
// replace synonyms in role's domain
for ( RoleMaster::iterator r = ORM.begin(), r_end = ORM.end(); r < r_end; ++r )
if ( !(*r)->isSynonym() )
replaceSynonymsFromTree ( (*r)->getTDomain() );
for ( RoleMaster::iterator dr = DRM.begin(), dr_end = DRM.end(); dr < dr_end; ++dr )
if (... | false | false | false | false | false | 0 |
curses_backlight (Driver *drvthis, int on)
{
PrivateData *p = drvthis->private_data;
if (p->curses_backlight_state == on)
return;
// no backlight: pairs 2, 3
// backlight: pairs 4, 5
p->curses_backlight_state = on;
if (on) {
p->current_color_pair = 4;
p->current_border_pair = 5;
}
else {
p->curre... | false | false | false | false | false | 0 |
gupnp_root_device_dispose (GObject *object)
{
GUPnPRootDevice *device;
GObjectClass *object_class;
device = GUPNP_ROOT_DEVICE (object);
if (device->priv->group) {
g_object_unref (device->priv->group);
device->priv->group = NULL;
}
/* Cal... | false | false | false | false | false | 0 |
plugin_register(PLUGIN_OBJECT *plugin)
{
plugin_check_enable(plugin);
Plugin_list = g_list_append(Plugin_list, (gpointer) plugin);
if (plugin->info->init_function) {
plugin->info->init_function(NULL, plugin->handle);
}
} | false | false | false | false | false | 0 |
cache_render_byte_zi(struct map_cache *cache, struct image_channel *channel,
int zoom, int fx, int fy, int fw, int fh)
{
struct ccd_frame *fr = channel->fr;
int fjump = fr->w - fw;
int cjump;
int x, y, z;
unsigned char *fdat;
int lndx;
int div = floor((channel->hcut - channel->lcut));
int flr = floor(chan... | false | false | false | false | false | 0 |
convert_backup(const SlotProgress& slot_progress, const std::string& base_directory, const Glib::ustring& username, const Glib::ustring& password, const Glib::ustring& database_name)
{
/* TODO:
if(m_network_shared && !running)
{
std::cerr << G_STRFUNC << ": The self-hosted database is not running." << std::endl... | false | false | false | false | false | 0 |
unregisterStaticDeleter(K3StaticDeleterBase *obj)
{
if (staticDeleterPrivate.isDestroyed()) {
return;
}
staticDeleterPrivate->staticDeleters.removeAll(obj);
} | false | false | false | false | false | 0 |
prop_find_child (sc_prop_noderef_t parent, sc_int type, sc_vartype_t name)
{
/* See if this node has any children. */
if (parent->child_list)
{
sc_int index_;
sc_prop_noderef_t child;
/* Do the lookup based on name type. */
switch (type)
{
case PROP_KEY_INTEGER:
... | false | false | false | false | true | 1 |
new_item (const char *str)
{
struct item *k = xmalloc (sizeof *k);
k->str = (str ? xstrdup (str): NULL);
k->left = k->right = NULL;
k->balance = 0;
/* T1. Initialize (COUNT[k] <- 0 and TOP[k] <- ^). */
k->count = 0;
k->qlink = NULL;
k->top = NULL;
return k;
} | false | false | false | false | false | 0 |
ListFilesRecursive(const UserConfig& uc, const URL& dir, std::list<std::string>& files, const std::string& prefix) {
std::list<FileInfo> outputfiles;
DataHandle handle(dir, uc);
if (!handle) {
logger.msg(INFO, "Unable to list files at %s", dir.str());
return false;
}
if(!handle->List(ou... | false | false | false | false | false | 0 |
jfs_truncate(struct inode *ip)
{
jfs_info("jfs_truncate: size = 0x%lx", (ulong) ip->i_size);
nobh_truncate_page(ip->i_mapping, ip->i_size, jfs_get_block);
IWRITE_LOCK(ip, RDWRLOCK_NORMAL);
jfs_truncate_nolock(ip, ip->i_size);
IWRITE_UNLOCK(ip);
} | false | false | false | false | false | 0 |
AssociateAlphaRegion(Image *image)
{
register PixelPacket
*q;
register long
x;
register double
alpha,
value;
long
number_pixels;
number_pixels=(long) GetPixelCacheArea(image);
q=AccessMutablePixels(image);
for (x = number_pixels; x > 0; --x)
{
alpha=((double) MaxRGB-q->o... | false | false | false | false | false | 0 |
SeqNext(SeqScanState *node)
{
HeapTuple tuple;
HeapScanDesc scandesc;
EState *estate;
ScanDirection direction;
TupleTableSlot *slot;
/*
* get information from the estate and scan state
*/
scandesc = node->ss_currentScanDesc;
estate = node->ps.state;
direction = estate->es_direction;
slot = node->ss_Sc... | false | false | false | false | false | 0 |
AfterTriggerEndXact(bool isCommit)
{
/*
* Forget everything we know about AFTER triggers.
*
* Since all the info is in TopTransactionContext or children thereof, we
* don't really need to do anything to reclaim memory. However, the
* pending-events list could be large, and so it's useful to discard it as
... | false | false | false | false | false | 0 |
blk_tracer_print_header(struct seq_file *m)
{
if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
return;
seq_puts(m, "# DEV CPU TIMESTAMP PID ACT FLG\n"
"# | | | | | |\n");
} | false | false | false | false | false | 0 |
main_hall_pause()
{
if (Main_hall_paused) {
return;
}
Main_hall_paused = 1;
audiostream_pause(Main_hall_music_handle);
main_hall_stop_ambient();
} | false | false | false | false | false | 0 |
drawbot(void)
{
char tchar = 0;
int len;
int maxlen;
if ((gdata.background == 2) || gdata.noscreen)
{
return;
}
len = strlen(gdata.console_input_line);
maxlen = gdata.termcols - (gdata.user_nick ? 17+strlen(gdata.user_nick) : 17);
if (maxlen < 0)
{
maxlen = 0;
}
... | false | false | false | false | false | 0 |
dump_tcp_check(void *data)
{
tcp_checker_t *tcp_chk = CHECKER_DATA(data);
log_message(LOG_INFO, " Keepalive method = TCP_CHECK");
log_message(LOG_INFO, " Connection port = %d", ntohs(inet_sockaddrport(&tcp_chk->dst)));
if (tcp_chk->bindto.ss_family)
log_message(LOG_INFO, " Bind to = %s", inet_sockaddrtos(&... | false | false | false | false | false | 0 |
carl9170_debugfs_erp_write(struct ar9170 *ar, const char *buf,
size_t count)
{
int res, val;
if (count < 1)
return -EINVAL;
res = sscanf(buf, "%d", &val);
if (res != 1)
return -EINVAL;
if (!((val > CARL9170_ERP_INVALID) &&
(val < __CARL9170_ERP_NUM)))
return -EINVAL;
ar->erp_mode = val;
r... | false | false | false | false | false | 0 |
write_action (p, test, depth, uncond, success, subroutine_type)
struct decision *p;
struct decision_test *test;
int depth, uncond;
struct decision *success;
enum routine_type subroutine_type;
{
const char *indent;
int want_close = 0;
if (uncond)
indent = " ";
else if (test->type =... | false | false | false | false | false | 0 |
unmakemask (int mask, char *smask) {
int i = 0;
if (mask & LUA_MASKCALL) smask[i++] = 'c';
if (mask & LUA_MASKRET) smask[i++] = 'r';
if (mask & LUA_MASKLINE) smask[i++] = 'l';
smask[i] = '\0';
return smask;
} | false | false | false | false | false | 0 |
kvm_hv_msr_get_crash_data(struct kvm_vcpu *vcpu,
u32 index, u64 *pdata)
{
struct kvm_hv *hv = &vcpu->kvm->arch.hyperv;
if (WARN_ON_ONCE(index >= ARRAY_SIZE(hv->hv_crash_param)))
return -EINVAL;
*pdata = hv->hv_crash_param[index];
return 0;
} | false | false | false | false | false | 0 |
sock_buff_flush_callback(struct pending_flush *flush)
{
struct sock_buff *sb = (struct sock_buff *)flush;
if (!sock_buff_flush(sb))
return;
if (fifo_buffer_empty(sb->output))
event_del(&sb->send_event);
} | false | false | false | false | false | 0 |
tx_max(struct dw_spi *dws)
{
u32 tx_left, tx_room, rxtx_gap;
tx_left = (dws->tx_end - dws->tx) / dws->n_bytes;
tx_room = dws->fifo_len - dw_readl(dws, DW_SPI_TXFLR);
/*
* Another concern is about the tx/rx mismatch, we
* though to use (dws->fifo_len - rxflr - txflr) as
* one maximum value for tx, but it doe... | false | false | false | false | false | 0 |
mqc_renormd(opj_mqc_t *const mqc) {
do {
if (mqc->ct == 0) {
mqc_bytein(mqc);
}
mqc->a <<= 1;
mqc->c <<= 1;
mqc->ct--;
} while (mqc->a < 0x8000);
} | false | false | false | false | false | 0 |
DoWriteSubset(XButtonEvent *evt, LocalWin *wi, Cursor cur)
{
BBox *b;
register double lx, ly, ux, uy;
register Value *v;
register struct data_set *p;
register int pt;
register char *newline = "";
FILE *f;
if ((b = RubberBox(evt, wi, cur)) == 0)
return;
if ((f = fopen("xgraph.tmp", "w")) == 0) {
perror("x... | false | false | false | false | false | 0 |
ak4104_probe(struct snd_soc_codec *codec)
{
struct ak4104_private *ak4104 = snd_soc_codec_get_drvdata(codec);
int ret;
ret = regulator_enable(ak4104->regulator);
if (ret < 0) {
dev_err(codec->dev, "Unable to enable regulator: %d\n", ret);
return ret;
}
/* set power-up and non-reset bits */
ret = regmap_upd... | false | false | false | false | false | 0 |
getTrueNN() // compute true nearest neighbors
{
if (stats > SILENT) {
cout << "(Computing true nearest neighbors for validation. This may take time.)\n";
}
// deallocate existing storage
if (true_nn_idx != NULL) delete [] true_nn_idx;
if (true_dists != NULL) delete [] true_dists;
if (min_pt... | false | false | false | false | false | 0 |
append_shebang_args(char* scriptname)
{
/* Open script file */
FILE* fd = fopen (scriptname,"r");
if (fd != NULL) {
/* Read first line in script file */
static char linebuf[LINEBUFSZ];
char* ptr = fgets(linebuf, LINEBUFSZ, fd);
if (ptr != NULL) {
/* Try to find args on second or third line */
... | true | true | false | false | true | 1 |
heapreplace(PyObject *self, PyObject *args)
{
PyObject *heap, *item, *returnitem;
if (!PyArg_UnpackTuple(args, "heapreplace", 2, 2, &heap, &item))
return NULL;
if (!PyList_Check(heap)) {
PyErr_SetString(PyExc_TypeError, "heap argument must be a list");
return NULL;
}
if (P... | false | false | false | false | false | 0 |
gst_asf_mux_send_packet (GstAsfMux * asfmux, GstBuffer * buf)
{
g_assert (GST_BUFFER_SIZE (buf) == asfmux->packet_size);
asfmux->total_data_packets++;
GST_LOG_OBJECT (asfmux,
"Pushing a packet of size %u and timestamp %" G_GUINT64_FORMAT,
GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
GST_LOG_O... | false | false | false | false | false | 0 |
do_read(int fd, void *buffer, size_t size) {
size_t sofar = 0;
ssize_t n;
char *ptr = buffer;
while(sofar < size) {
n = read(fd, ptr + sofar, size - sofar);
if(n > 0)
sofar += n;
else if(n == 0)
return -1; /* eof */
else
fatal("read error: %s", strerror(... | false | true | false | false | true | 1 |
mtree_entry_create_virtual_dir(struct archive_write *a, const char *pathname,
struct mtree_entry **m_entry)
{
struct archive_entry *entry;
struct mtree_entry *file;
int r;
entry = archive_entry_new();
if (entry == NULL) {
*m_entry = NULL;
archive_set_error(&a->archive, ENOMEM,
"Can't allocate memory... | false | false | false | false | false | 0 |
xfs_reserve_blocks(
xfs_mount_t *mp,
__uint64_t *inval,
xfs_fsop_resblks_t *outval)
{
__int64_t lcounter, delta, fdblks_delta;
__uint64_t request;
/* If inval is null, report current values and return */
if (inval == (__uint64_t *)NULL) {
if (!outval)
return -EINVAL;
outva... | false | false | false | false | false | 0 |
sanei_hp_device_simulate_set (const char *devname, HpScl scl, int flag)
{HpDeviceInfo *info;
int inqid;
info = sanei_hp_device_info_get ( devname );
if (!info) return SANE_STATUS_INVAL;
inqid = SCL_INQ_ID(scl)-HP_SCL_INQID_MIN;
info->simulate.sclsimulate[inqid] = flag;
DBG(3, "hp_device_simulate_set: %d set t... | false | false | false | false | false | 0 |
keyIsInactive (const Key *key)
{
char *name = 0;
if (!key) return -1;
name = strrchr (keyName(key), '/');
if (!name) return -1;
/* the slash can't be a trailing slash
but there might be no name at all! */
if (name[1] == '.') return 1;
else return 0;
} | false | false | false | false | false | 0 |
glerr(int err, const char *file, const char *func, int line, const char *op)
{
const char *errmsg;
char buf[32];
switch (err)
{
case GL_INVALID_ENUM:
errmsg = "GL_INVALID_ENUM";
break;
case GL_INVALID_VALUE:
errmsg = "GL_INVALID_VALUE";
break;
case GL_INVALI... | true | true | false | false | false | 1 |
tree_model_filter_hide_show_offline (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
gboolean result = FALSE;
RosterViewGtk *self = NULL;
gint column_type;
self = ROSTER_VIEW_GTK (data);
gtk_tree_model_get (model, iter,
COLUMN_TYPE, &column_type,
-1);
switch (co... | false | false | false | false | false | 0 |
newTurn()
{
TRACE("FightEngine::newTurn");
_currentUnit = 0;
// initialize values (movement)
for( int i = 0; i < MAX_UNIT; i++ ) {
if( _attackLord->getUnit( i ) ) {
_attackLord->getUnit( i )->setMaxMove();
}
if( _defendLord->getUnit( i ) ) {
_defendLord->getUnit( i )->setMaxMove();
}
}
// setup ... | false | false | false | false | false | 0 |
gid_from_string (char *name, gid_t *gidp)
{
struct group grp, *result;
char buffer[PW_BUF_SIZE], *p = NULL;
long l;
if (!name)
return -1;
/*
* Check for valid group name first.
*/
if ((_getgrnam_r (name, &grp, buffer, PW_BUF_SIZE, &result) == 0)
&& result != NULL) {
*gidp = result->gr_gid;
retur... | false | false | false | false | false | 0 |
cx8802_restart_queue(struct cx8802_dev *dev,
struct cx88_dmaqueue *q)
{
struct cx88_buffer *buf;
dprintk( 1, "cx8802_restart_queue\n" );
if (list_empty(&q->active))
return 0;
buf = list_entry(q->active.next, struct cx88_buffer, list);
dprintk(2,"restart_queue [%p/%d]: restart dma\n",
buf, buf->vb.vb2_... | false | false | false | false | false | 0 |
pixmap_load_from_file_real (char *file)
{
GdkPixbuf *img;
GdkPixmap *pixmap;
img = gdk_pixbuf_new_from_file (file, 0);
if (!img)
return NULL;
gdk_pixbuf_render_pixmap_and_mask (img, &pixmap, NULL, 128);
g_object_unref (img);
return pixmap;
} | false | false | false | false | false | 0 |
_nrrdMeasureMax(void *ans, int ansType,
const void *line, int lineType, size_t len,
double axmin, double axmax) {
double val, M, (*lup)(const void*, size_t);
size_t ii;
AIR_UNUSED(axmin);
AIR_UNUSED(axmax);
lup = nrrdDLookup[lineType];
if (nrrdTypeIsIntegral[lineType]) {
... | false | false | false | false | false | 0 |
help_keypress(wint_t ch, bool code)
{
(void)code;
// TODO: Scrolling...
switch (ch) {
case KEY_LEFT:
case KEY_RIGHT:
case KEY_ESC:
case 'D' - '@':
ui_show(UI_SET_BROWSER);
return 0;
default:
return ch;
}
} | false | false | false | false | false | 0 |
UpdateArray(ButtonArray *array,int x,int y,int w, int h, int tw)
{
Button *temp;
if (x != -1)
array->x = x;
if (y != -1)
array->y = y;
if (w != -1)
array->w = w;
if (h != -1)
array->h = h;
if (tw != -1)
array->tw = tw;
for(temp=array->head; temp!=NULL; temp=temp->next)
... | false | false | false | false | false | 0 |
enc28j60_restart_work_handler(struct work_struct *work)
{
struct enc28j60_net *priv =
container_of(work, struct enc28j60_net, restart_work);
struct net_device *ndev = priv->netdev;
int ret;
rtnl_lock();
if (netif_running(ndev)) {
enc28j60_net_close(ndev);
ret = enc28j60_net_open(ndev);
if (unlikely(ret))... | false | false | false | false | false | 0 |
gda_sql_select_from_free (GdaSqlSelectFrom *from)
{
if (!from) return;
if (from->targets) {
g_slist_foreach (from->targets, (GFunc) gda_sql_select_target_free, NULL);
g_slist_free (from->targets);
}
if (from->joins) {
g_slist_foreach (from->joins, (GFunc) gda_sql_select_join_free, NULL);
g_slist_free (from... | false | false | false | false | false | 0 |
set_fragment (int fd, size_t fragsize, unsigned int fragcount)
{
int fragsize_2p;
int fragments;
fragsize_2p = (int) (log(fragsize) / log(2.0) + 0.5);
fragments = ((fragcount << 16) | (fragsize_2p & 0xffff));
if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fragments) < 0)
{
jack_error("OSS: failed to set fragment size:... | false | false | false | false | false | 0 |
ACL_ListGetFirst(ACLListHandle_t *acl_list, ACLListEnum_t *acl_enum)
{
ACLWrapper_t *wrapper;
ACLHandle_t *acl = 0;
*acl_enum = 0;
if (acl_list) {
wrapper = acl_list->acl_list_head;
*acl_enum = (ACLListEnum_t)wrapper;
if (wrapper) {
acl = wrapper->acl;
}
... | false | false | false | false | false | 0 |
testlib_test_assert_near_relative(const std::string& msg, std::complex<double> expr, std::complex<double> target, double tol)
{
std::cout << msg << " should be " << target << ", is " << expr << ", " << std::flush;
double max = std::abs(target); if (std::abs(expr) > max) max = std::abs(expr);
if (max==0.0 || targe... | false | false | false | false | false | 0 |
_pcomm_make_fd_list( list_t *list, int **fd_list, size_t *length ) {
pcomm_result_t result = PCOMM_SUCCESS;
pcomm_fd_t *fd_context = NULL;
size_t list_len = 0;
int *fds = NULL;
if ( !list ) {
result = PCOMM_NULL_LIST;
} else if ( !fd_list ) {
result = PCOMM_NULL_FD;
} else {... | false | false | false | false | false | 0 |
module_load_full(const char *path, const char *rootmodule,
const char *submodule, int start, int end,
char **prefixes)
{
MODULE_REC *module;
int status, try_prefixes;
if (!g_module_supported())
return FALSE;
module = module_find(rootmodule);
if (module != NULL && (strcmp(submodule, rootmod... | false | false | false | false | false | 0 |
unschedule_pop_up_location_context_menu (NautilusView *view)
{
if (view->details->location_popup_directory_as_file != NULL) {
g_assert (NAUTILUS_IS_FILE (view->details->location_popup_directory_as_file));
nautilus_file_cancel_call_when_ready (view->details->location_popup_directory_as_file,
location_po... | false | false | false | false | false | 0 |
GetOBJL()
{
if( iCurrentClass >= 0 )
return atoi(papszClassesInfo[iCurrentClass]);
else
return -1;
} | 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.