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 |
|---|---|---|---|---|---|---|
copy_ipcs(unsigned long flags,
struct user_namespace *user_ns, struct ipc_namespace *ns)
{
if (!(flags & CLONE_NEWIPC))
return get_ipc_ns(ns);
return create_ipc_ns(user_ns, ns);
} | false | false | false | false | false | 0 |
test_underflow2 (void)
{
mpfr_t x, y, z, r;
int b, i, inex, same, err = 0;
mpfr_inits2 (32, x, y, z, r, (mpfr_ptr) 0);
mpfr_set_si_2exp (z, -1, mpfr_get_emin (), MPFR_RNDN); /* z = -2^emin */
mpfr_set_si_2exp (x, 1, mpfr_get_emin (), MPFR_RNDN); /* x = 2^emin */
for (b = 0; b <= 1; b++)
{
fo... | false | false | false | false | false | 0 |
_advanced_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
Config_Entry *ce;
#define CHECK(X) \
if (cfdata->X != qa_config->X) return 1
CHECK(dont_bug_me);
CHECK(first_run);
EINA_INLIST_FOREACH(cfdata->entries, ce)
if (ce->id) return 1;
EINA_INLIST_FOREACH(cfdata->... | false | false | false | false | false | 0 |
fzopen(const char* file, const char* mode)
{
adv_fz* f = fzalloc();
if (!f)
return 0;
f->type = fz_file;
f->f = fopen_lock(file, mode);
if (!f->f) {
free(f);
return 0;
}
return f;
} | false | false | false | false | false | 0 |
delete_secrets (NMSecretAgent *agent,
NMConnection *connection,
const char *connection_path,
NMSecretAgentDeleteSecretsFunc callback,
gpointer callback_data)
{
AppletAgentPrivate *priv = APPLET_AGENT_GET_PRIVATE (agent);
Request *r;
NMSettingConnection ... | false | false | false | false | false | 0 |
inmacro(opt, s)
char_u *opt;
register char_u *s;
{
register char_u *macro;
for (macro = opt; macro[0]; ++macro)
{
if (macro[0] == s[0] && (((s[1] == NUL || s[1] == ' ')
&& (macro[1] == NUL || macro[1] == ' ')) || macro[1] == s[1]))
break;
++macro;
if (macro[0] == NUL)
break;
}... | false | false | false | false | false | 0 |
selectInstance(const char *studyUID, const char *seriesUID, const char *instanceUID)
{
if (studyUID && seriesUID && instanceUID)
{
if (createIndexCache())
{
if (idxCache.isElem(studyUID))
{
DVStudyCache::ItemStruct *study = idxCache.getItem();
... | false | false | false | false | false | 0 |
mt7601u_phy_init(struct mt7601u_dev *dev)
{
int ret;
dev->rf_pa_mode[0] = mt7601u_rr(dev, MT_RF_PA_MODE_CFG0);
dev->rf_pa_mode[1] = mt7601u_rr(dev, MT_RF_PA_MODE_CFG1);
ret = mt7601u_rf_wr(dev, 0, 12, dev->ee->rf_freq_off);
if (ret)
return ret;
ret = mt7601u_write_reg_pairs(dev, 0, rf_central,
ARRAY... | false | false | false | false | false | 0 |
git_reflog_rename(git_reference *ref, const char *new_name)
{
int error;
git_buf old_path = GIT_BUF_INIT;
git_buf new_path = GIT_BUF_INIT;
if (!git_buf_join_n(&old_path, '/', 3, ref->owner->path_repository,
GIT_REFLOG_DIR, ref->name) &&
!git_buf_join_n(&new_path, '/', 3, ref->owner->path_repository,
GIT_RE... | false | false | false | false | false | 0 |
outmixer_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
u32 reg_shift = kcontrol->private_value & 0xfff;
int ret = 0;
u16 reg;
switch (reg_shift) {
case WM8991_SPEAKER_MIXER | (WM8991_LDSPK_BIT << 8):
reg = snd... | false | false | false | false | false | 0 |
_is_renderer (GstElementFactory * factory)
{
const gchar *klass, *name;
klass = gst_element_factory_get_klass (factory);
name = gst_plugin_feature_get_name (GST_PLUGIN_FEATURE_CAST (factory));
if (strstr (klass, "Overlay/Subtitle") != NULL ||
strstr (klass, "Overlay/SubPicture") != NULL)
return TRUE... | false | false | false | false | false | 0 |
update_turn_done_button(bool do_restore)
{
static bool flip = FALSE;
if (!get_turn_done_button_state()) {
return;
}
if ((do_restore && flip) || !do_restore) {
GdkColor *fore = >k_widget_get_style(turn_done_button)->bg[GTK_STATE_NORMAL];
GdkColor *back = >k_widget_get_style(turn_done_button)->l... | false | false | false | false | false | 0 |
dlm_move_reco_locks_to_list(struct dlm_ctxt *dlm,
struct list_head *list,
u8 dead_node)
{
struct dlm_lock_resource *res, *next;
struct dlm_lock *lock;
spin_lock(&dlm->spinlock);
list_for_each_entry_safe(res, next, &dlm->reco.resources, recovering) {
/* always prune any $RECOVERY entries for dead... | false | false | false | false | false | 0 |
on_pe(lame_internal_flags * gfc, const FLOAT pe[][2], int targ_bits[2], int mean_bits, int gr, int cbr)
{
SessionConfig_t const *const cfg = &gfc->cfg;
int extra_bits = 0, tbits, bits;
int add_bits[2] = {0, 0};
int max_bits; /* maximum allowed bits for this granule */
int ch;
... | false | false | false | false | true | 1 |
SetBankRightsAndSlots(uint32 rankId, uint8 TabId, uint32 right, uint32 nbSlots, bool db)
{
if (rankId >= m_Ranks.size() || TabId >= GetPurchasedTabs())
{
// TODO remove next line, It is there just to repair existing bug in deleting guild rank
CharacterDatabase.PExecute("DELETE FROM guild_bank_ri... | false | false | false | false | false | 0 |
bru_set_selection(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_selection *sel)
{
struct vsp1_bru *bru = to_bru(subdev);
struct v4l2_mbus_framefmt *format;
struct v4l2_rect *compose;
if (sel->pad == BRU_PAD_SOURCE)
return -EINVAL;
if (sel->target != V4L2_SEL... | false | false | false | false | false | 0 |
gth_image_selector_button_press (GthImageViewerTool *base,
GdkEventButton *event)
{
GthImageSelector *self = GTH_IMAGE_SELECTOR (base);
gboolean retval = FALSE;
int x, y;
if (event->button != 1)
return FALSE;
if (! point_in_rectangle (event->x, event->y, self->priv->viewer->imag... | false | false | false | false | false | 0 |
ario_cover_provider_get_covers (ArioCoverProvider *cover_provider,
const char *artist,
const char *album,
const char *file,
GArray **file_size,
GSList **file_co... | false | false | false | true | false | 1 |
addVectorTriangleSaveField(const string& filename,
const string& fieldname,
const string& meshname,
const string& savetype,
int t_0,int t_end,int dt)
{
console.Debug() << "CLatticeMaster::addVectorTriangleSaveField\n";
CMPILCmdBuffer cmd_buffer(m_global_comm,m_global_rank);
CMPIBarrier ... | false | false | false | false | false | 0 |
isProfitable(MachineFunction &MF,
ContextVector &CallSeqVector) {
// This transformation is always a win when we do not expect to have
// a reserved call frame. Under other circumstances, it may be either
// a win or a loss, and requires a heuristic.
bool CannotReserveFrame = MF.getFrameInfo()->hasVarSizedOb... | false | false | false | false | false | 0 |
I_ResetScaleTables(byte *palette)
{
if (stretch_tables[0] != NULL)
{
Z_Free(stretch_tables[0]);
Z_Free(stretch_tables[1]);
printf("I_ResetScaleTables: Regenerating lookup tables..\n");
stretch_tables[0] = GenerateStretchTable(palette, 20);
stretch_tables[1] = GenerateStr... | false | false | false | false | false | 0 |
dce3_2_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
u8 *sadb, int sad_count)
{
struct radeon_device *rdev = encoder->dev->dev_private;
u32 tmp;
/* program the speaker allocation */
tmp = RREG32_ENDPOINT(0, AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER);
tmp &= ~(DP_CONNECTION | SPEAKER_ALLOCATION_M... | false | false | false | false | false | 0 |
stmmac_is_jumbo_frm(int len, int enh_desc)
{
unsigned int ret = 0;
if ((enh_desc && (len > BUF_SIZE_8KiB)) ||
(!enh_desc && (len > BUF_SIZE_2KiB))) {
ret = 1;
}
return ret;
} | false | false | false | false | false | 0 |
clusterGenNodeDescription(clusterNode *node) {
int j, start;
sds ci;
/* Node coordinates */
ci = sdscatprintf(sdsempty(),"%.40s %s:%d ",
node->name,
node->ip,
node->port);
/* Flags */
ci = representRedisNodeFlags(ci, node->flags);
/* Slave of... or just "-" */
... | false | false | false | false | false | 0 |
lib_hbar_static (Driver *drvthis, int x, int y, int len, int promille, int options, int cellwidth, int cc_offset)
{
int total_pixels = ((long) 2 * len * cellwidth + 1 ) * promille / 2000;
int pos;
for (pos = 0; pos < len; pos ++ ) {
int pixels = total_pixels - cellwidth * pos;
if ( pixels >= cellwidth ) {
... | false | false | false | false | false | 0 |
zrleOutStreamNew(void)
{
zrleOutStream *os;
os = malloc(sizeof(zrleOutStream));
if (os == NULL)
return NULL;
if (!zrleBufferAlloc(&os->in, ZRLE_IN_BUFFER_SIZE)) {
free(os);
return NULL;
}
if (!zrleBufferAlloc(&os->out, ZRLE_OUT_BUFFER_SIZE)) {
zrleBufferFree(&os->in);
free(os);
re... | false | false | false | false | false | 0 |
gnac_ui_file_chooser_response_cb(GtkDialog *dialog,
gint response,
gpointer user_data)
{
switch (response) {
/* Add button */
case GTK_RESPONSE_NONE: {
GSList *files = NULL;
GSList *paths = gtk_file_chooser_get_uris(GTK_FILE... | false | false | false | false | false | 0 |
IsValid(const char *uid_)
{
/*
9.1 UID ENCODING RULES
The DICOM UID encoding rules are defined as follows:
- Each component of a UID is a number and shall consist of one or more digits. The first digit of
each component shall not be zero unless the component is a single digit.
Note: Registration authorities... | false | false | false | false | false | 0 |
utf8froma(char* dst, unsigned dstlen,
const char* src, unsigned srclen) {
const char* p = src;
const char* e = src+srclen;
unsigned count = 0;
if (dstlen) for (;;) {
unsigned char ucs;
if (p >= e) {dst[count] = 0; return count;}
ucs = *(unsigned char*)p++;
if (ucs < 0x8... | false | false | false | false | false | 0 |
GetSectionStringValue(size_t section_num,
const std::string& key,
std::string* result) {
if (section_num >= sections_.size()) {
return false;
}
ConfigParser::SimpleMap::iterator iter = sections_[section_num].find(key);
if (iter ... | false | false | false | false | false | 0 |
__gf_rdma_ioq_churn_reply (gf_rdma_peer_t *peer, gf_rdma_ioq_t *entry,
gf_rdma_post_t *post)
{
gf_rdma_reply_info_t *reply_info = NULL;
int32_t ret = -1;
gf_rdma_chunktype_t type = gf_rdma_noch;
if ((peer == NULL) || (entry == NULL... | false | false | false | false | false | 0 |
fix_digest_buffer(char **buffer, int *offset, int *max, char c)
{
buffer_print(*buffer, *max, *offset, "%c", c);
} | false | false | false | false | false | 0 |
dlmc_node_info(char *name, int nodeid, struct dlmc_node *node)
{
struct dlmc_header h, *rh;
char reply[sizeof(struct dlmc_header) + sizeof(struct dlmc_node)];
int fd, rv;
init_header(&h, DLMC_CMD_NODE_INFO, name, 0);
h.data = nodeid;
memset(reply, 0, sizeof(reply));
fd = do_connect(DLMC_QUERY_SOCK_PATH);
if ... | true | true | false | false | false | 1 |
computeVertexFreq ( BipolarPointer p )
{
DLVertex& v = (*this)[p];
bool pos = isPositive(p);
if ( v.isVisited(pos) ) // avoid cycles
return;
v.incFreqValue(pos); // increment frequence of current vertex
v.setVisited(pos);
if ( v.omitStat(pos) ) // negation of primitive concept-like
return;
// increment f... | false | false | false | false | false | 0 |
split_button_string(char_u *button_string, int *n_buttons)
{
char **array;
char_u *p;
unsigned int count = 1;
for (p = button_string; *p != NUL; ++p)
if (*p == DLG_BUTTON_SEP)
++count;
array = (char **)alloc((count + 1) * sizeof(char *));
count = 0;
if (array != NULL)
... | false | false | false | false | false | 0 |
ebb_print_insn (const_rtx insn, int aligned ATTRIBUTE_UNUSED)
{
static char tmp[80];
/* '+' before insn means it is a new cycle start. */
if (GET_MODE (insn) == TImode)
sprintf (tmp, "+ %4d", INSN_UID (insn));
else
sprintf (tmp, " %4d", INSN_UID (insn));
return tmp;
} | false | false | false | false | false | 0 |
Fetch(FetchItem *Itm)
{
URI Get = Itm->Uri;
std::string File = Get.Path;
// Stat the file and send a start message
struct stat Buf;
if (stat(File.c_str(),&Buf) != 0)
return _error->Errno("stat",_("Failed to stat"));
// Forumulate a result and send a start message
FetchResult Res;
Res.Siz... | false | false | false | false | false | 0 |
Make(LFSCProof* pf1, LFSCProof* pf2, int op1, int op2){
if( pf2->isTrivial() )
return pf1;
else if( pf1->isTrivial() ){
Rational r = Rational( -1 );
return LFSCLraMulC::Make( pf2, r, op2 );
}else
return new LFSCLraSub( pf1, pf2, op1, op2 );
} | false | false | false | false | false | 0 |
CanReadFile(const char *FileNameToRead)
{
char tmpStr[64];
//this->SetFileName(FileNameToRead);
std::ifstream f(FileNameToRead, std::ios::binary | std::ios::in);
if ( !f.is_open() )
{
return false;
}
// This is a weak heuristic but should only be true for GE4 files
//
// Get the Plane from th... | false | false | false | false | false | 0 |
read(hsStream* S, unsigned int type) {
hsKeyFrame::read(S, type);
if (fType == kBezPoint3KeyFrame) {
fInTan.read(S);
fOutTan.read(S);
}
fValue.read(S);
} | false | false | false | false | false | 0 |
parse_transport_padding(Octstr *mime_content, long pos)
{
while (islwspchar(octstr_get_char(mime_content, pos)))
++pos;
return pos;
} | false | false | false | false | false | 0 |
sprint_status(char *s, int status, int sigonly)
{
int col;
int st;
col = 0;
if (!WIFEXITED(status)) {
#if JOBS
if (WIFSTOPPED(status))
st = WSTOPSIG(status);
else
#endif
st = WTERMSIG(status);
if (sigonly) {
if (st == SIGINT || st == SIGPIPE)
goto out;
#if JOBS
if (WIFSTOPPED(status))
got... | false | false | false | false | false | 0 |
camel_index_names (CamelIndex *idx)
{
CamelIndexClass *class;
g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL);
class = CAMEL_INDEX_GET_CLASS (idx);
g_return_val_if_fail (class->names != NULL, NULL);
if ((idx->state & CAMEL_INDEX_DELETED) == 0)
return class->names (idx);
else
return NULL;
} | false | false | false | true | false | 1 |
gsql_conf_nitify_add (gchar *path, GSQLConfNotifyFunc func, gpointer userdata)
{
GSQL_TRACE_FUNC;
GError *error = NULL;
g_return_if_fail (G_IS_OBJECT (userdata));
HOOKUP_OBJECT_NO_REF(userdata, func, "fhandler");
gconf_client_notify_add (gconf_client,
path,
gsql_conf_notify_handler,
... | false | false | false | false | false | 0 |
skk_util_get_katakana_char (gunichar uc) {
gunichar result = 0U;
GeeMap* _tmp0_;
gunichar _tmp1_;
gboolean _tmp2_ = FALSE;
gunichar _tmp6_;
_tmp0_ = skk_util__KatakanaTable;
_tmp1_ = uc;
_tmp2_ = gee_map_has_key (_tmp0_, GINT_TO_POINTER (_tmp1_));
if (_tmp2_) {
GeeMap* _tmp3_;
gunichar _tmp4_;
gpointer _... | false | false | false | false | false | 0 |
editors_output (const char *fullname, const char *p)
{
cvs_output (fullname, 0);
while (1)
{
cvs_output ("\t", 1);
while (*p != '>' && *p != '\0')
cvs_output (p++, 1);
if (*p == '\0')
{
/* Only happens if attribute is misformed. */
cvs_ou... | false | false | false | false | false | 0 |
pidff_erase_effect(struct input_dev *dev, int effect_id)
{
struct pidff_device *pidff = dev->ff->private;
int pid_id = pidff->pid_id[effect_id];
hid_dbg(pidff->hid, "starting to erase %d/%d\n",
effect_id, pidff->pid_id[effect_id]);
/* Wait for the queue to clear. We do not want a full fifo to
prevent the eff... | false | false | false | false | false | 0 |
set_widget_sensitivity( FileAccessWindow* faw, gboolean is_file_based_uri )
{
if (is_file_based_uri)
{
gtk_widget_show(faw->frame_file);
gtk_widget_hide(faw->frame_database);
gtk_file_chooser_set_current_folder(faw->fileChooser, faw->starting_dir);
}
else
{
gtk_widget... | false | false | false | false | false | 0 |
test_spawned_job_cancelled_at_start (void)
{
UDisksSpawnedJob *job;
GCancellable *cancellable;
cancellable = g_cancellable_new ();
g_cancellable_cancel (cancellable);
job = udisks_spawned_job_new ("/bin/true", NULL, getuid (), geteuid (), NULL, cancellable);
_g_assert_signal_received (job, "completed", G_C... | false | false | false | false | false | 0 |
slater_second(FunSecondFuncDrv *ds, real factor, const FunDensProp* dp)
{
const real PREF = POW(6.0/M_PI, 1.0/3.0);
if (dp->rhoa>SLATER_THRESHOLD) {
ds->df1000 += -PREF*POW(dp->rhoa, 1.0/3.0)*factor;
ds->df2000 += -PREF*POW(dp->rhoa, -2.0/3.0)/3*factor;
}
if (dp->rhob>SLATER_THRESHOLD) {
ds->df0100... | false | false | false | false | false | 0 |
mark(Tree root)
{
fRootTree = root;
fPropKey = tree(unique("OCCURENCES"));
if (isList(root)) {
while (isList(root)) {
//incOcc(kSamp, 1, hd(root));
incOcc(nil, kSamp, 0, 0, hd(root));
root = tl(root);
}
//cerr << "END OF LIST IS " << *root << endl;
} else {
//incOcc(kSamp, 1, root);
incOcc(nil, ... | false | false | false | false | false | 0 |
ho_recognize_font_1_bet (const double *array_in)
{
double return_value = 0.0;
if (TOP_HBAR)
return_value += 0.1;
if (BOTTOM_HBAR)
return_value += 0.1;
if (RIGHT_VBAR)
return_value += 0.1;
if (MID_LEFT_NOTCH)
return_value += 0.1;
if (MID_LEFT > 0.9)
return_value += 0.1;
if (WIDTH_BY_HE... | false | false | false | false | false | 0 |
set_source_common(u8 index, u8 offset, u8 iga)
{
u8 value, mask = 1 << offset;
switch (iga) {
case IGA1:
value = 0x00;
break;
case IGA2:
value = mask;
break;
default:
printk(KERN_WARNING "viafb: Unsupported source: %d\n", iga);
return;
}
via_write_reg_mask(VIACR, index, value, mask);
} | false | false | false | false | false | 0 |
trace_define_field(struct trace_event_call *call, const char *type,
const char *name, int offset, int size, int is_signed,
int filter_type)
{
struct list_head *head;
if (WARN_ON(!call->class))
return 0;
head = trace_get_fields(call);
return __trace_define_field(head, type, name, offset, size,
... | false | false | false | false | false | 0 |
unregister_agent(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct audio_device *device = data;
struct gateway *gw = device->gateway;
const char *path;
if (!gw->agent)
goto done;
if (strcmp(gw->agent->name, dbus_message_get_sender(msg)) != 0)
return btd_error_not_authorized(msg);
if (!dbus_m... | false | false | false | false | false | 0 |
matshift(MATRIX *m, long n)
{
register VALUE *val, *vres;
VALUE temp;
long index;
MATRIX *res; /* resulting matrix */
if (n == 0)
return matcopy(m);
temp.v_type = V_NUM;
temp.v_subtype = V_NOSUBTYPE;
temp.v_num = itoq(n);
res = matalloc(m->m_size);
*res = *m;
val = m->m_table;
vres = res->m_table;
for ... | false | false | false | false | false | 0 |
dsnchooser_cancel_clicked (GtkWidget *widget, TDSNCHOOSER *choose_t)
{
if (choose_t)
{
choose_t->udsnlist = choose_t->sdsnlist = NULL;
choose_t->uadd = choose_t->uremove = choose_t->utest =
choose_t->uconfigure = NULL;
choose_t->sadd = choose_t->sremove = choose_t->stest =
choose_t->sconfi... | false | false | false | false | false | 0 |
toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
buf->writestring("pragma (");
buf->writestring(ident->toChars());
if (args && args->dim)
{
buf->writestring(", ");
argsToCBuffer(buf, args, hgs);
}
buf->writeByte(')');
if (body)
{
buf->writenl();
buf->writeByt... | false | false | false | false | false | 0 |
make_sequence_buffer(ADT_SEARCH
*ptr_adt_search, ADT_EDIT *ptr_adt_edit) {
//-------------------------------------------------start sequencebuffer
char *seq_anfang, *seq_copy_loop;
char *seq_buffer_start, *seq_buffer_loop; //buffer
long *seq_index... | false | false | false | true | false | 1 |
cluster_change_resv(void)
{
display_data_t *display_data = display_data_resv;
while (display_data++) {
if (display_data->id == -1)
break;
if (cluster_flags & CLUSTER_FLAG_BG) {
switch(display_data->id) {
case SORTID_NODELIST:
display_data->name = "MidplaneList";
break;
default:
break;
}... | false | false | false | false | false | 0 |
get_commit_info(struct commit *commit,
struct commit_info *ret,
int detailed)
{
int len;
const char *subject;
char *reencoded, *message;
static char author_name[1024];
static char author_mail[1024];
static char committer_name[1024];
static char committer_mail[1024];
static char summary_buf[1024];
... | true | true | false | false | false | 1 |
print_layer_block_cost(Block *block)
{
Block *bpt;
if (block->pre_head != NULL && block->pre_head->stm_head != NULL) {
fprintf(stderr,
"Cost of Blocks in Block %d (Module %s, Line No:%d, InnerCP = %f)",
block->no,
block->module->name,
bloc... | false | false | false | false | false | 0 |
orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts, char ***env)
{
int ret;
char *str;
close(opts->p_stdin[1]);
close(opts->p_stdout[0]);
close(opts->p_stderr[0]);
close(opts->p_internal[0]);
if (opts->usepty) {
/* disable echo */
struct termios term_attrs;
if ... | false | false | false | false | false | 0 |
superstring_moves(int str, struct reading_moves *moves,
int liberty_cap, int does_attack)
{
int ss_liberties;
int ss_libs[MAX_LIBERTIES + 4];
int color = board[str];
int other = OTHER_COLOR(color);
int k;
find_superstring_liberties(str, &ss_liberties, ss_libs, liberty_cap);
if (ss_liberties <= 5... | false | false | false | false | false | 0 |
canWriteEntry(const QByteArray& group, const char* key, bool isDefault) const
{
if (bFileImmutable ||
entryMap.getEntryOption(group, key, KEntryMap::SearchLocalized, KEntryMap::EntryImmutable))
return isDefault;
return true;
} | false | false | false | false | false | 0 |
sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num)
{
struct sdp_transaction *t;
sdp_pdu_hdr_t *reqhdr;
uint8_t *pdata;
int cstate_len, seqlen = 0;
if (!session || !session->priv)
return -1;
t = session->priv;
/* clean possible allocated buffer */
free(t->rsp_co... | false | false | false | false | false | 0 |
ClearOldMousePosition() {
if(!my_mouse_position.my_width) {
return;
}
if(GetBulkMode() || my_mouse_backingstore==NULL || my_mouse_mode != SOFTWARE ) {
return;
}
SDL_BlitSurface(my_mouse_backingstore, NULL, GetScreen(), &my_mouse_position);
return;
} | false | false | false | false | false | 0 |
Add_checkpoint_file(int ChkType,
char *filename)
{
int index;
int nbytes;
/* Can only call this function if steering lib initialised */
if (!ReG_SteeringInit) return REG_FAILURE;
if (ChkType == REG_IODEF_HANDLE_NOTSET) return REG_SUCCESS;
index = IOdef_index_from_handle(&ChkTypes_table, ChkType);
... | false | false | false | false | false | 0 |
ctf_declaration_enum_visit(FILE *fd, int depth,
const char *name,
struct ctf_node *container_type,
struct bt_list_head *enumerator_list,
int has_body,
struct declaration_scope *declaration_scope,
struct ctf_trace *trace)
{
struct bt_declaration *declaration;
struct declaration_enum *enum_declaration... | false | false | false | false | false | 0 |
findDelay(QVector<double> &wattsArray, QVector<double> &hrArray, int rideTimeSecs)
{
int delay = 0;
double maxr = 0;
if (rideTimeSecs>= 60) {
for (int a = 10; a <=60; ++a) {
QVector<double> delayHr(rideTimeSecs);
for (int j = a; j<rideTimeSecs; ++j) {
dela... | false | false | false | false | false | 0 |
embBtreeSetFields(EmbPBtreeEntry entry, AjPStr const *fields)
{
ajuint nfields;
EmbPBtreeField field = NULL;
nfields = 0;
if(!entry->fields)
entry->fields = ajListNew();
while(fields[nfields])
{
if(ajStrMatchCaseC(fields[nfields], "id"))
entry->do_id = ajTrue;
else
{
... | false | false | false | false | false | 0 |
tree_open(struct view *view, enum open_flags flags)
{
static const char *tree_argv[] = {
"git", "ls-tree", "%(commit)", "%(directory)", NULL
};
if (view->lines == 0 && opt_prefix[0]) {
char *pos = opt_prefix;
while (pos && *pos) {
char *end = strchr(pos, '/');
if (end)
*end = 0;
push_tree_stack... | false | false | false | false | false | 0 |
write_f(char *p, char *ebuf, const knh_ldata2_t *d)
{
if(ebuf - p < 32) return NULL;
kuintptr_t uvalue = (kuintptr_t)d->ivalue;
if(d->ivalue < 0) {
p[0] = '-'; p++;
}
kuintptr_t u = uvalue / 1000, r = uvalue % 1000;
if(u != 0) {
p = write_d(p, ebuf, u);
}
else {
p[0] = '0'; p++;
}
p[0] = '.'; p++;
u = ... | false | false | false | false | false | 0 |
notify(Sea::Player player, const Coord& c, const HitInfo& info)
{
if (player == m_player) {
Strategy* new_strategy = m_strategy->notify(c, info);
if (new_strategy) {
m_strategy = std::auto_ptr<Strategy>(new_strategy);
}
}
} | false | false | false | false | false | 0 |
even_better_compress_rll (ET_Rll *dst, const ET_SrcPixel *src,
int src_width, int dst_width)
{
int rll_idx;
int i;
int count;
ET_SrcPixel last_val;
int whole = dst_width / src_width;
int frac = dst_width % src_width;
int rem;
rll_idx = 0;
last_val = src[0];
count = whole;
... | false | false | false | false | false | 0 |
gst_siren_dec_sink_event (GstPad * pad, GstEvent * event)
{
GstSirenDec *dec;
gboolean res;
dec = GST_SIREN_DEC (GST_PAD_PARENT (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
gst_adapter_clear (dec->adapter);
res = gst_pad_push_event (dec->srcpad, event);
break;
case G... | false | false | false | false | false | 0 |
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
if (cfdata->gui.fsel)
e_object_del(E_OBJECT(cfdata->gui.fsel));
E_FREE(cfdata->file);
E_FREE(cfdata->location);
E_FREE(cfdata->size);
E_FREE(cfdata->blocks);
E_FREE(cfdata->mod_date);
E_FREE(cfdata->acc_date);
E_FRE... | false | false | false | false | false | 0 |
DoFoldAll(int fold)
{
cbAssert(m_pControl);
if (m_SplitType != stNoSplit)
cbAssert(m_pControl2);
cbStyledTextCtrl* ctrl = GetControl();
ctrl->Colourise(0, -1); // the *most* important part!
int count = ctrl->GetLineCount();
for (int i = 0; i <= count; ++i)
DoFoldLine(i, fold);
} | false | false | false | false | false | 0 |
nbt_parse(const void* mem, size_t len)
{
errno = NBT_OK;
const char** memory = (const char**)&mem;
size_t* length = &len;
/*
* this needs to stay up here since it's referenced by the parse_error
* block.
*/
char* name = NULL;
uint8_t type;
READ_GENERIC(&type, sizeof type, m... | true | true | false | false | false | 1 |
awe_search_file_name(char *fresult, int maxlen, char *fname, char *pathlist, char **ext)
{
char *tok;
char *path;
if (strlen(fname) >= maxlen)
return 0;
/* search the current path at first */
strcpy(fresult, fname);
if (file_exists(fresult, ext))
return 1;
/* then search along path list */
if (fname[0] !=... | false | false | false | false | false | 0 |
r300_emit_clear(drm_radeon_private_t *dev_priv,
drm_radeon_kcmd_buffer_t *cmdbuf)
{
RING_LOCALS;
if (8 * 4 > drm_buffer_unprocessed(cmdbuf->buffer))
return -EINVAL;
BEGIN_RING(10);
OUT_RING(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8));
OUT_RING(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING |
(1 << R300_PRIM_N... | false | false | false | false | false | 0 |
reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char val)
{
ak4114->write(ak4114->private_data, reg, val);
if (reg <= AK4114_REG_INT1_MASK)
ak4114->regmap[reg] = val;
else if (reg >= AK4114_REG_TXCSB0 && reg <= AK4114_REG_TXCSB4)
ak4114->txcsb[reg-AK4114_REG_TXCSB0] = val;
} | false | false | false | false | false | 0 |
get_component_status(struct device *cdev,
struct device_attribute *attr,char *buf)
{
struct enclosure_device *edev = to_enclosure_device(cdev->parent);
struct enclosure_component *ecomp = to_enclosure_component(cdev);
if (edev->cb->get_status)
edev->cb->get_status(edev, ecomp);
return snprintf(buf, 40, "... | false | false | false | false | false | 0 |
fixup_pack_header_footer(int pack_fd,
unsigned char *new_pack_sha1,
const char *pack_name,
uint32_t object_count,
unsigned char *partial_pack_sha1,
off_t partial_pack_offset)
{
int aligned_sz, buf_sz = 8 * 1024;
git_SHA_CTX old_sha1_ctx, new_sha1_ctx;
struct pack_header hdr;
char *buf;
git_SHA... | true | true | false | false | false | 1 |
HandleDisconnectSlot()
{
if(Stopped()) {
return;
}
Connection *con = qobject_cast<Connection *>(sender());
const Id &remote_id = con->GetRemoteId();
HandleDisconnect(remote_id);
} | false | false | false | false | false | 0 |
__open_device(struct dm_pool_metadata *pmd,
dm_thin_id dev, int create,
struct dm_thin_device **td)
{
int r, changed = 0;
struct dm_thin_device *td2;
uint64_t key = dev;
struct disk_device_details details_le;
/*
* If the device is already open, return it.
*/
list_for_each_entry(td2, &pmd->thin_device... | false | false | false | false | false | 0 |
print_args(String *str, uint from, enum_query_type query_type)
{
for (uint i=from ; i < arg_count ; i++)
{
if (i != from)
str->append(',');
args[i]->print(str, query_type);
}
} | false | false | false | false | false | 0 |
check_capture (lua_State *L, int l, struct Capture *cap) {
l -= '1';
if (!(0 <= l && l < cap->level && cap->capture[l].len != -1))
lua_error(L, "invalid capture index");
return l;
} | false | false | false | false | false | 0 |
cmor_has_cur_dataset_attribute(char *name) {
int i,n;
char msg[CMOR_MAX_STRING];
extern cmor_dataset_def cmor_current_dataset;
cmor_add_traceback("cmor_has_cur_dataset_attribute");
cmor_is_setup();
if ((int)strlen(name)>CMOR_MAX_STRING) {
snprintf(msg,CMOR_MAX_STRING,"CMOR Dataset: attribute name (%s) l... | false | false | false | false | false | 0 |
ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
word32 y, z;
Block::Get(inBlock)(y)(z);
#ifdef __SUNPRO_CC
// workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21
size_t sum = m_limit;
while ((sum&0xffffffff) != 0)
#else
word32 sum = m_limit;
wh... | false | false | false | false | false | 0 |
elm_transit_repeat_times_set(Elm_Transit *transit, int repeat)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
transit->repeat.count = repeat;
transit->repeat.current = 0;
} | false | false | false | false | false | 0 |
ExpireBans(time_t unixtime)
{
int ii;
struct ChanInfo *cptr;
struct ChannelBan *bptr;
struct Channel *chptr;
char bans[MAXLINE + 1];
int jj = 1;
/* If ban expire time is 0 seconds, don't remove the ban. */
if (!BanExpire)
return;
for (ii = 0; ii < CHANLIST_MAX; ++ii)
{
for (cptr = chanlist[ii]; cptr; cp... | true | true | false | false | false | 1 |
bim_open(struct pio_bim_file_t *bim_file, const char *path)
{
int status;
FILE *bim_fp;
bzero( bim_file, sizeof( *bim_file ) );
bim_fp = fopen( path, "r" );
if( bim_fp == NULL )
{
return PIO_ERROR;
}
bim_file->fp = bim_fp;
utarray_new( bim_file->locus, &LOCUS_ICD );
stat... | false | false | false | false | false | 0 |
setIdColAcol() {
// Outgoing = incoming flavours.
setId( id1, id2, id1, id2);
// Two colour flow topologies. Swap if first is gluon, or when antiquark.
double sigRand = sigSum * rndmPtr->flat();
if (sigRand < sigTS) setColAcol( 1, 0, 2, 1, 3, 0, 2, 3);
else setColAcol( 1, 0, 2, 3, 2, 0, 1,... | false | false | false | false | false | 0 |
move_tree_2_ssr(AP_tree *node){
AWT_species_set *ss;
if (node->is_leaf){
this->add(node->name);
ss = new AWT_species_set(node,this,node->name);
// ssr->add(ss);
}else{
AWT_species_set *ls = this->move_tree_2_ssr(node->leftson);
AWT_species_set *rs = this->move_tr... | false | false | false | false | false | 0 |
lastmodified(uh, s)
int uh;
CONST char *s;
{
struct tm tm;
time_t t;
int i, tz;
for (i = 0; i < DATELISTSIZ; i++)
if (Xstrptime(s, datelist[i], &tm, &tz) >= 0) break;
if (i >= DATELISTSIZ || (t = Xtimegm(&tm)) == (time_t)-1)
return(seterrno(EINVAL));
(urlhostlist[uh].http) -> mtim = t + tz * 60;
(urlhostlis... | false | false | false | false | false | 0 |
DrawProxyBackground(ProxyWindow *proxy)
{
int cset;
if (proxy == NULL || proxy->proxy == None)
{
return;
}
cset = (proxy==selectProxy) ? cset_select :
((proxy->flags.is_iconified) ? cset_iconified : cset_normal);
XSetForeground(dpy,fg_gc,Colorset[cset].fg);
XSetBackground(dpy,fg_gc,Colorset[cset].bg);
SetW... | false | false | false | false | false | 0 |
avahi_string_list_copy(const AvahiStringList *l) {
AvahiStringList *r = NULL;
for (; l; l = l->next)
if (!(r = avahi_string_list_add_arbitrary(r, l->text, l->size))) {
avahi_string_list_free(r);
return NULL;
}
return avahi_string_list_reverse(r);
} | false | false | false | false | false | 0 |
copy_all_headers(const qfits_header* src, qfits_header* dest, char* targetkey,
anbool append) {
int i, N;
char key[FITS_LINESZ+1];
char val[FITS_LINESZ+1];
char com[FITS_LINESZ+1];
char lin[FITS_LINESZ+1];
N = qfits_header_n(src);
for (i=0; i<N; i++) {
if (qfits_header_getitem(s... | true | true | false | false | false | 1 |
PyCArrayType_paramfunc(CDataObject *self)
{
PyCArgObject *p = PyCArgObject_new();
if (p == NULL)
return NULL;
p->tag = 'P';
p->pffi_type = &ffi_type_pointer;
p->value.p = (char *)self->b_ptr;
Py_INCREF(self);
p->obj = (PyObject *)self;
return p;
} | 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.