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 |
|---|---|---|---|---|---|---|
main(int argc, char* argv[])
{
if (argc != 2) {
printf("uso: %s <input_file>. Try again!\n", argv[0]);
exit(-1);
}
yyin = fopen(argv[1], "r");
if (!yyin) {
printf("Uso: %s <input_file>. Could not find %s. Try again!\n",
argv[0], argv[1]);
exit(-1);
}
progname = argv[0];... | false | false | false | false | true | 1 |
new_bytes(struct ring_buffer *rbuf, gpointer user_data)
{
GAtHDLC *hdlc = user_data;
unsigned int len = ring_buffer_len(rbuf);
unsigned int wrap = ring_buffer_len_no_wrap(rbuf);
unsigned char *buf = ring_buffer_read_ptr(rbuf, 0);
unsigned int pos = 0;
hdlc_record(hdlc->record_fd, TRUE, buf, wrap);
hdlc->in_rea... | false | false | false | false | false | 0 |
vfp_esi_bytes(struct sess *sp, struct http_conn *htc, ssize_t bytes)
{
int i;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
AN(sp->wrk->vep);
if (sp->wrk->is_gzip && sp->wrk->do_gunzip)
i = vfp_esi_bytes_gu(sp, htc, bytes);
else if (sp->wrk->is_gunzip && sp->wrk->do_gzip)
i = vfp_esi_bytes_ug(sp, htc, bytes);
else if (... | false | false | false | true | false | 1 |
drawDealRowOrRedeal()
{
stop();
if ( isCardAnimationRunning() )
{
m_newCardsQueued = true;
return;
}
m_newCardsQueued = false;
newCards();
} | false | false | false | false | false | 0 |
Ingroupstate(long i)
{
/* the ingroup state for the i-th character */
boolean outstate;
if (noroot) {
outstate = Data[0]->vec[i - 1];
return (!outstate);
}
if (ancvar)
outstate = ancone[i - 1];
else
outstate = Data[outgrno - 1]->vec[i - 1];
return (!outstate);
} | false | false | false | false | false | 0 |
vsum(v)
vari *v;
{ int i;
double z;
z = 0.0;
for (i=0; i<vlength(v); i++) z += vitem(v,i);
return(z);
} | false | false | false | false | false | 0 |
lookup (int *nhits, T this, Shortoligomer_T masked) {
#ifdef DEBUG
char *aa, *nt;
#endif
if ((*nhits = this->counts[masked]) >= 1) {
#ifdef PMAP
debug(aa = aaindex_aa(masked,this->indexsize_aa);
printf("masked %s => %d entries: %u...%u\n",
aa,*nhits,this->positions[masked][0],this->positions[masked][*nhi... | false | false | false | false | false | 0 |
typedefHandler(Node *n) {
/* since this is a recurring issue, we are going to remember the
typedef pointer, if already it is not a pointer or reference, as
in
typedef void NT;
int func(NT *p);
see director_basic.i for example.
*/
SwigType *name = Getattr(n, "name");
SwigType *decl =... | false | false | false | false | false | 0 |
log_in_clicked (GtkWidget *button, gpointer user_data)
{
BishoPaneOauth *pane = BISHO_PANE_OAUTH (user_data);
BishoPaneOauthPrivate *priv = pane->priv;
ServiceInfo *info = BISHO_PANE (pane)->info;
GError *error = NULL;
if (oauth_proxy_request_token_async (OAUTH_PROXY (priv->proxy),
... | false | false | false | false | false | 0 |
i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
{
struct i40e_virtchnl_irq_map_info *irqmap_info =
(struct i40e_virtchnl_irq_map_info *)msg;
struct i40e_virtchnl_vector_map *map;
u16 vsi_id, vsi_queue_id, vector_id;
i40e_status aq_ret = 0;
unsigned long tempmap;
int i;
if (!test_bit(I40... | false | false | false | false | false | 0 |
field_list(DB_DATABASE * db, const char *table, char ***fields)
{
const char *query = "PRAGMA table_info('&1')";
int i, n;
Dataset *res;
if (do_query(db, "Unable to get fields: &1", &res, query, 1, table))
{
return -1;
}
result_set *r = (result_set *) res->getExecRes();
n = r->records.size();
if (fields... | false | false | false | false | false | 0 |
base_name(const char *file)
{
const char *cp1;
const char *cp2;
cp1 = strrchr(file, '/');
if (cp1)
++cp1;
else
cp1 = file;
cp2 = strrchr(cp1, '.');
if (!cp2)
cp2 = cp1 + strlen(cp1);
if (cp2 > cp1 + 6)
return str_n_from_c(cp1, 6);
return str_n_from_c(cp1, cp2 - cp1);
} | false | false | false | false | false | 0 |
loadFromConfigFile(
const mrpt::utils::CConfigFileBase &iniFile,
const std::string §ion)
{
MRPT_LOAD_CONFIG_VAR_CAST(likelihoodMethod, int, TLikelihoodMethod, iniFile, section);
enableLikelihoodCache = iniFile.read_bool(section,"enableLikelihoodCache",enableLikelihoodCache);
LF_stdHit ... | false | false | false | false | false | 0 |
deleteSubAndPurgeFile(const unsigned long num)
{
DcmDirectoryRecord *subDirRec = OFstatic_cast(DcmDirectoryRecord *, lowerLevelList->remove(num));
errorFlag = lowerLevelList->error();
if (subDirRec != NULL)
{
DcmDirectoryRecord *localSubRefMRDR = subDirRec->getReferencedMRDR();
if (loca... | false | false | false | false | false | 0 |
find_formats (void)
{
unsigned int i;
for (i = 0; i < NUM_RTX_CODE; i++)
{
const char **f;
if (special_format (defs[i].format))
continue;
for (f = formats; *f; f++)
if (! strcmp (*f, defs[i].format))
break;
if (*f == 0)
*f = defs[i].format;
}
} | false | false | false | false | false | 0 |
CmdBox(int code)
/******************************************************************************
purpose: converts the LaTeX \box-commands into an similar Rtf-style
******************************************************************************/
{
char BoxName[7][10] = { "hbox", "vbox", "mbox", "fbox", "parbox"... | false | false | false | false | false | 0 |
ShowFileDetailDialog(long index)
{
// Make list of part files in control
std::vector<CPartFile *> files;
int nrItems = GetItemCount();
files.reserve(nrItems);
for (int i = 0; i < nrItems; i++) {
// ADUNANZA BEGIN
// backport
#if 0
files.push_back(((FileCtrlItem_Struct*)GetItemData(i))->GetFile());
#else
files.... | false | false | false | false | false | 0 |
i40evf_allocate_virt_mem_d(struct i40e_hw *hw,
struct i40e_virt_mem *mem, u32 size)
{
if (!mem)
return I40E_ERR_PARAM;
mem->size = size;
mem->va = kzalloc(size, GFP_KERNEL);
if (mem->va)
return 0;
else
return I40E_ERR_NO_MEMORY;
} | false | false | false | false | false | 0 |
dBodySetFiniteRotationMode (dBodyID b, int mode)
{
dAASSERT (b);
b->flags &= ~(dxBodyFlagFiniteRotation | dxBodyFlagFiniteRotationAxis);
if (mode) {
b->flags |= dxBodyFlagFiniteRotation;
if (b->finite_rot_axis[0] != 0 || b->finite_rot_axis[1] != 0 ||
b->finite_rot_axis[2] != 0) {
b->flags |= dxBody... | false | false | false | false | false | 0 |
tick()
{
checkCollisions();
foreach( KBounceBall* ball, m_balls )
{
ball->goForward();
}
foreach( KBounceWall* wall, m_walls )
{
wall->goForward();
}
foreach( KBounceBall* ball, m_balls )
{
ball->update();
}
foreach( KBounceWall* wall, m_walls )
{
wall->update();
}
} | false | false | false | false | false | 0 |
getBuildingHeight( const BuildingType* type )
{
int miny = maxint;
int maxy = minint;
for ( int y = 0; y < 6; ++y )
for ( int x = 0; x < 4; ++x )
if ( type->fieldExists( BuildingType::LocalCoordinate( x, y ))) {
miny = min( miny, y );
maxy = max( maxy, y );
}
... | false | false | false | false | false | 0 |
funcname_signature_string(const char *funcname,
int nargs, const Oid *argtypes)
{
StringInfoData argbuf;
int i;
initStringInfo(&argbuf);
appendStringInfo(&argbuf, "%s(", funcname);
for (i = 0; i < nargs; i++)
{
if (i)
appendStringInfoString(&argbuf, ", ");
appendStringInfoString(&argbuf, forma... | false | false | false | false | true | 1 |
control_init(struct audio_device *dev, uint16_t uuid16)
{
struct control *control;
if (!g_dbus_register_interface(dev->conn, dev->path,
AUDIO_CONTROL_INTERFACE,
control_methods, control_signals, NULL,
dev, path_unregister))
return NULL;
DBG("Registered interface %s on path %s",
AUDIO_CONTROL_INT... | false | false | false | false | false | 0 |
audio_convert_get_func_index (AudioConvertCtx * ctx,
const GstAudioFormatInfo * fmt)
{
gint index = 0;
if (GST_AUDIO_FORMAT_INFO_IS_INTEGER (fmt)) {
index += (GST_AUDIO_FORMAT_INFO_WIDTH (fmt) / 8 - 1) * 4;
index += GST_AUDIO_FORMAT_INFO_IS_LITTLE_ENDIAN (fmt) ? 0 : 2;
index += GST_AUDIO_FORMAT_INF... | false | false | false | false | false | 0 |
setSelectedRowFrom(const char *pString_)
{
if (MSView::model()!=0&&pString_!=0)
{
unsigned index=list().indexOf(pString_);
if (index<list().length()) selectedRow(index);
comboBox()->replaceEditableText(selection());
selectEditableText();
}
} | false | false | false | false | false | 0 |
rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_attr, u32 *len_attr)
{
u8 *attr_ptr = NULL;
u8 *target_attr_ptr = NULL;
u8 wps_oui[4] = {0x00, 0x50, 0xF2, 0x04};
if (len_attr)
*len_attr = 0;
if ((wps_ie[0] != _VENDOR_SPECIFIC_IE_) ||
(memcmp(wps_ie + 2, wps_oui, 4)))
return attr... | false | false | false | false | false | 0 |
gamgi_gtk_direction_create_node (gamgi_bool node, gamgi_window *window)
{
GtkWidget *dialog = window->dialog0;
GtkWidget *entry_o1, *entry_o2, *entry_o3;
GtkWidget *label_o1, *label_o2, *label_o3, *label_o4;
GtkWidget *combo;
char token[GAMGI_ENGINE_TOKEN];
entry_o1 = (GtkWidget *) g_object_get_data (G_OBJECT (dialog)... | true | true | false | false | false | 1 |
LI34__BREAK_FORWARD_SEARCH_STACK__top(V270)
object V270;
{ VMB34 VMS34 VMV34
goto TTL;
TTL:;
{register object V271;
V271= Cnil;
V271= coerce_to_string((V270));
{register object V272;
register object V273;
V272= one_plus((((object)VV[73])->s.s_dbind));
base[0]= (V272);
vs_top=(vs_base=base+0)+1;
(void) (*Lnk... | false | false | false | false | false | 0 |
peekbytecode_(hscriptlet *r, int *level)
{
if (r->it == r->s->it_codes)
return empty_tc;
bytecode code = &r->s->codes[r->it];
r->level = code->level;
return code->tc;
} | false | false | false | false | false | 0 |
linear(Home home,
const IntVarArgs& x, IntRelType irt, IntVar y,
IntConLevel icl) {
if (home.failed()) return;
Region re(home);
Linear::Term<IntView>* t = re.alloc<Linear::Term<IntView> >(x.size()+1);
for (int i = x.size(); i--; ) {
t[i].a=1; t[i].x=x[i];
}
int min, max;
... | false | false | false | false | false | 0 |
Coalesce(wxString& s)
{
std::pair<tree::iterator, bool> r = tree_.insert(std::make_pair(s, backref_holder()));
tree::iterator& it = r.first;
if( !r.second )
{
s = it->first;
backref* bref = reinterpret_cast<backref*>(it->second.b_);
lru_.splice( lru_.end(), lru_, bref->it_ );
bref->it_ = --lru_.end();
}
e... | false | false | false | false | false | 0 |
counted_noun_ending_en(int num)
{
if (num == 1 || num == -1) {
return "";
} else {
return "s";
}
} | false | false | false | false | false | 0 |
getListOfPlatforms()
{
vector<string> vs;
for (map<string,Resources*>::iterator i1=platform_res.begin();
i1!=platform_res.end(); ++i1)
{
vs.push_back( (*i1).first );
}
return vs;
} | false | false | false | false | false | 0 |
smk_bu_credfile(const struct cred *cred, struct file *file,
int mode, int rc)
{
struct task_smack *tsp = cred->security;
struct smack_known *sskp = tsp->smk_task;
struct inode *inode = file->f_inode;
struct inode_smack *isp = inode->i_security;
char acc[SMK_NUM_ACCESS_TYPE + 1];
if (isp->smk_flags & SMK_INOD... | true | true | false | false | false | 1 |
up_date_jikouho ()
{
register int no_of_kouho, i;
int jishono, serial;
jishono = (bun.klist)[current_bun_no].jishono;
serial = (bun.klist)[current_bun_no].serial;
no_of_kouho = jl_zenkouho_suu (buf);
for (i = 0; i < no_of_kouho; i++)
{
if (jishono == buf->bun[current_bun_no]->dic_no && serial =... | false | false | false | false | false | 0 |
anjuta_bookmarks_remove (AnjutaBookmarks* bookmarks)
{
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
GtkTreeSelection* selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(priv->tree));
GList* selected = gtk_tree_selection_get_selected_rows (selection,
NULL);
GList* node;
GList*... | false | false | false | false | false | 0 |
alt_eval (CSPARSE *parse, CSTREE *node, CSTREE **next)
{
NEOERR *err = STATUS_OK;
CSARG val;
int eval_true = 1;
err = eval_expr(parse, &(node->arg1), &val);
if (err) return nerr_pass(err);
eval_true = arg_eval_bool(parse, &val);
if (eval_true)
{
if (val.op_type & (CS_TYPE_NUM | CS_TYPE_VAR_NUM))
... | false | false | false | false | false | 0 |
CDB___ham_c_destroy(dbc)
DBC *dbc;
{
HASH_CURSOR *hcp;
hcp = (HASH_CURSOR *)dbc->internal;
if (hcp->split_buf != NULL)
CDB___os_free(hcp->split_buf, dbc->dbp->pgsize);
CDB___os_free(hcp, sizeof(HASH_CURSOR));
return (0);
} | false | false | false | false | false | 0 |
StreamReadBufferAsBinary(std::istream & file, void *_buffer)
{
itkDebugMacro(<< "StreamingReadBufferAsBinary called");
char *buffer = static_cast< char * >( _buffer );
// Offset into file
std::streampos dataPos = this->GetDataPosition();
itkDebugStatement(
const std::streamsize sizeOfRegion = static_cast<... | false | false | false | false | false | 0 |
Iremove (int argc, lvar_t *argv) {
Tobj tblo, keyo;
if (argc == 2)
tblo = argv[1].o, keyo = argv[0].o;
else
tblo = root, keyo = argv[0].o;
if (T_ISTABLE (tblo) && (T_ISNUMBER (keyo) || T_ISSTRING (keyo)))
Tdelo (tblo, keyo);
return L_SUCCESS;
} | false | false | false | false | false | 0 |
strdup_escape(const char *str)
{
const char *input = str;
char *p, *ret;
int escapes;
if (!strlen(str))
return NULL;
escapes = 0;
while ((input = strpbrk(input, "\\\"")) != NULL) {
escapes++;
input++;
}
p = ret = malloc(strlen(str) + escapes + 1);
while (*str) {
if (*str == '\\' || *str == '\"')
... | false | false | false | false | false | 0 |
s_compare (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer /*userdata*/)
{
GtkTreePath *path;
gint depth, row1, row2, res;
gchar *style1, *style2;
path = gtk_tree_model_get_path(model, a);
depth = gtk_tree_path_get_depth(path);
if (depth == 1)
{
gtk_tree_model_get(model, a, 1, &row1, -1);
g... | false | false | false | false | false | 0 |
z_save( int argc, zword_t table, zword_t bytes, zword_t name )
{
char new_name[Z_FILENAME_MAX + Z_PATHNAME_MAX + 1];
char default_name[Z_FILENAME_MAX + Z_PATHNAME_MAX + 1];
FILE *afp;
#if defined BUFFER_FILES
char afpbuffer[BUFSIZ];
#endif
int status = 0;
if ( argc == 3 )
{
g... | false | false | false | false | false | 0 |
prt_get_cpl()
{
if (prt_use_number())
{
prt_number_width = PRINT_NUMBER_WIDTH * prt_char_width;
#ifdef FEAT_MBYTE
/* If we are outputting multi-byte characters then line numbers will be
* printed with half width characters
*/
if (prt_out_mbyte)
prt_number_width /= 2;
#endif
prt_left_margin += prt_n... | false | false | false | false | false | 0 |
s_pack_into(PyObject *self, PyObject *args)
{
PyStructObject *soself;
Py_buffer buffer;
Py_ssize_t offset;
/* Validate arguments. +1 is for the first arg as buffer. */
soself = (PyStructObject *)self;
assert(PyStruct_Check(self));
assert(soself->s_codes != NULL);
if (PyTuple_GET_SIZE(a... | false | false | false | false | true | 1 |
PanEndMode(void *data)
{
PanData pdata = (PanData)data;
if (pdata)
{
if (pdata->args)
DXDelete(pdata->args);
if (pdata->obj)
DXDelete(pdata->obj);
}
DXFree(data);
} | false | false | false | false | false | 0 |
next_name(const char *names, unsigned *len)
{
names += *len;
if (names[0] == ' ' || names[0] == '=' || names[0] == '\0')
return NULL;
return first_name(names + 1, len);
} | false | false | false | false | false | 0 |
freadHeaderPnm(FILE *fp,
PIX **ppix,
l_int32 *pwidth,
l_int32 *pheight,
l_int32 *pdepth,
l_int32 *ptype,
l_int32 *pbpc,
l_int32 *pcpp)
{
l_int32 w, h, d, type;
l_int32 maxval;
PROCNAME("freadHea... | false | false | false | false | false | 0 |
mmc_audio_read_subchannel (CdIo_t *p_cdio, cdio_subchannel_t *p_subchannel)
{
mmc_cdb_t cdb;
driver_return_code_t i_rc;
cdio_mmc_subchannel_t mmc_subchannel;
if (!p_cdio) return DRIVER_OP_UNINIT;
memset(&mmc_subchannel, 0, sizeof(mmc_subchannel));
mmc_subchannel.format = CDIO_CDROM_MSF;
memset(&cdb, ... | false | false | false | false | false | 0 |
_youtube_query_open_view (SwQueryIface *self,
const gchar *query,
GHashTable *params,
DBusGMethodInvocation *context)
{
SwServiceYoutubePrivate *priv = GET_PRIVATE (self);
SwItemView *item_view;
const gchar... | false | false | false | false | false | 0 |
jswrap_object_getOwnPropertyDescriptor(JsVar *parent, JsVar *name) {
if (!jswrap_object_hasOwnProperty(parent, name))
return 0;
JsVar *propName = jsvAsArrayIndex(name);
JsVar *varName = jspGetVarNamedField(parent, propName, true);
jsvUnLock(propName);
assert(varName); // we had it! (apparently)
if (!... | false | false | false | false | false | 0 |
L33()
{register object *base=vs_base;
register object *sup=base+VM33; VC33
vs_reserve(VM33);
check_arg(2);vs_top=sup;
{object V297=base[0]->c.c_cdr;
if(endp(V297))invalid_macro_call();
base[2]= (V297->c.c_car);
V297=V297->c.c_cdr;
if(endp(V297))invalid_macro_call();
base[3]= (V297->c.c_car);
V297=V297->c.c_cd... | false | false | false | false | false | 0 |
Initialise() {
//ScintillaBase::Initialise();
#if wxUSE_DRAG_AND_DROP
dropTarget = new wxSCIDropTarget;
dropTarget->SetScintilla(this);
sci->SetDropTarget(dropTarget);
/* C::B begin */
dragRectangle = false;
/* C::B end */
#endif // wxUSE_DRAG_AND_DROP
vs.extraFontFlag = true; // UseAntiAliasi... | false | false | false | false | false | 0 |
func_pbkdf2(Lex_state *e, int nargs, Arglist *arglist, Expr_result *result)
{
int pwdlen, saltlen;
unsigned int count, dklen;
unsigned char *pwd, *salt;
unsigned char *kdf2;
size_t len;
Arglist *x;
x = arglist;
len = x->result->value.val.bval.len;
if (len == 0) {
seterr_e(e, result, "Invalid passwor... | false | false | false | false | false | 0 |
repulsive(Param *param, double rsq, double &fforce,
int eflag, double &eng)
{
double r,tmp_fc,tmp_fc_d,tmp_exp;
// Tersoff repulsive portion
r = sqrt(rsq);
tmp_fc = ters_fc(r,param);
tmp_fc_d = ters_fc_d(r,param);
tmp_exp = exp(-param->lam1 * r);
double fforce_ters = param... | false | false | false | false | false | 0 |
print_rec(FILE *out, struct tree *start, const char *ppath,
int pr_hidden) {
int r;
char *path = NULL;
list_for_each(tree, start) {
if (TREE_HIDDEN(tree) && ! pr_hidden)
continue;
path = path_expand(tree, ppath);
if (path == NULL)
goto e... | false | false | false | false | false | 0 |
init_tstats_procfs(void)
{
struct proc_dir_entry *pe;
pe = proc_create("timer_stats", 0644, NULL, &tstats_fops);
if (!pe)
return -ENOMEM;
return 0;
} | false | false | false | false | false | 0 |
space_edit_invert_axis(GtkWidget * button, gpointer data) {
AmitkSpaceEdit * space_edit = data;
AmitkAxis i_axis;
AmitkPoint center;
/* first double check that we really want to do this */
if (!space_edit_prompt(space_edit, _("Do you really wish to invert?\nThis will flip left/right relationships")))
re... | false | false | false | false | false | 0 |
glfs_io_async_task (void *data)
{
struct glfs_io *gio = data;
ssize_t ret = 0;
switch (gio->op) {
case GF_FOP_WRITE:
ret = glfs_pwritev (gio->glfd, gio->iov, gio->count,
gio->offset, gio->flags);
break;
case GF_FOP_FTRUNCATE:
ret = glfs_ftruncate (gio->glfd, gio->offset);
break;
case GF_F... | false | false | false | false | false | 0 |
ReadFlagsFromString(const string& flagfilecontents,
const char* /*prog_name*/, // TODO(csilvers): nix this
bool errors_are_fatal) {
FlagRegistry* const registry = FlagRegistry::GlobalRegistry();
FlagSaverImpl saved_states(registry);
saved_states.SaveFromRegistry(... | false | false | false | false | false | 0 |
e_ews_connection_get_oal_detail_sync (EEwsConnection *cnc,
const gchar *oal_id,
const gchar *oal_element,
const gchar *old_etag,
GSList **elements,
gchar **etag,
... | false | false | false | false | false | 0 |
p12u_ucs2_ascii_conversion_function(PRBool toUnicode,
unsigned char* inBuf, unsigned int inBufLen,
unsigned char* outBuf, unsigned int maxOutBufLen,
unsigned int* outBufLen, PRBool swapBytes) {
SECItem it;
SECItem *dup = NULL;
PRBool ret;
it.data = inBuf;
it.len = inBufLen;
... | false | false | false | false | false | 0 |
__add_keyed_refs(struct btrfs_fs_info *fs_info,
struct btrfs_path *path, u64 bytenr,
int info_level, struct list_head *prefs, u64 inum)
{
struct btrfs_root *extent_root = fs_info->extent_root;
int ret;
int slot;
struct extent_buffer *leaf;
struct btrfs_key key;
while (1) {
ret = btrfs_next_item(e... | false | false | false | false | false | 0 |
init_missions()
{
#define MISSION(name, goal, diff, val, urgent, place, start, end, fail) \
id++; mission_types.push_back( \
mission_type(id, name, goal, diff, val, urgent, place, start, end, fail) )
#define ORIGINS(...) setvector(mission_types[id].origins, __VA_ARGS__)
#define ITEM(itid) mission_types[id].ite... | false | false | false | false | false | 0 |
nfs_entry_loc_fill (inode_table_t *itable, uuid_t pargfid, char *entry,
loc_t *loc, int how)
{
inode_t *parent = NULL;
inode_t *entryinode = NULL;
int ret = -3;
char *resolvedpath = NULL;
int pret = -3;
... | false | false | false | false | false | 0 |
serialize_uint8(FILE *fp, uint8_t* val, int is_storing)
{
if (is_storing) {
return (fwrite(val, sizeof(uint8_t), 1, fp) == 1) ? 0 : 1;
} else {
return (fread(val, sizeof(uint8_t), 1, fp) == 1) ? 0 : 1;
}
} | false | false | false | false | false | 0 |
is_redhat_agent(const char *agent)
{
int rc = 0;
struct stat prop;
char buffer[FILENAME_MAX + 1];
snprintf(buffer, FILENAME_MAX, "%s/%s", RH_STONITH_DIR, agent);
rc = stat(buffer, &prop);
if (rc >= 0 && S_ISREG(prop.st_mode)) {
return TRUE;
}
return FALSE;
} | true | true | false | false | false | 1 |
dblhashGrow(dblhash_ *h)
{
int i;
record_ *old_recs, *new_recs;
unsigned int old_recs_length;
Debug("Growing Hash %p", h);
ReturnErrIf(h->size_index == (sizes_count - 1));
old_recs_length = sizes[h->size_index];
old_recs = h->records;
new_recs = calloc(sizes[++h->size_index], sizeof(record_));
... | false | false | false | false | false | 0 |
iax2_start_transfer(unsigned short callno0, unsigned short callno1, int mediaonly)
{
int res;
struct iax_ie_data ied0;
struct iax_ie_data ied1;
unsigned int transferid = (unsigned int)ast_random();
if (IAX_CALLENCRYPTED(iaxs[callno0]) || IAX_CALLENCRYPTED(iaxs[callno1])) {
ast_debug(1, "transfers are not suppor... | false | false | false | false | false | 0 |
_bfd_elf_write_object_contents (bfd *abfd)
{
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
Elf_Internal_Shdr **i_shdrp;
bfd_boolean failed;
unsigned int count, num_sec;
if (! abfd->output_has_begun
&& ! _bfd_elf_compute_section_file_positions (abfd, NULL))
return FALSE;
i_shd... | false | false | false | false | false | 0 |
bd2802_show_adv_conf(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct bd2802_led *led = i2c_get_clientdata(to_i2c_client(dev));
ssize_t ret;
down_read(&led->rwsem);
if (led->adf_on)
ret = sprintf(buf, "on\n");
else
ret = sprintf(buf, "off\n");
up_read(&led->rwsem);
return ret;
} | false | false | false | false | false | 0 |
via_clock_init(struct via_clock *clock, int gfx_chip)
{
switch (gfx_chip) {
case UNICHROME_CLE266:
case UNICHROME_K400:
clock->set_primary_clock_state = dummy_set_clock_state;
clock->set_primary_clock_source = dummy_set_clock_source;
clock->set_primary_pll_state = dummy_set_pll_state;
clock->set_primary_pll ... | false | false | false | false | false | 0 |
rewrite()
{
if (HtURLRewriter::instance()->replace(_url) > 0)
parse(_url.get());
} | false | false | false | false | false | 0 |
getADFTypeFromDesc(VimosDescriptor *desc)
{
const char modName[] = "getADFTypeFromDesc";
VimosDescriptor *tDesc;
tDesc = findDescriptor(desc, "ESO INS ADF TYPE");
if (tDesc == NULL) {
cpl_msg_error(modName, "Cannot find descriptor %s", "ESO INS ADF TYPE");
return(VM_ADF_TYPE_UDF);
} else {
i... | false | false | false | false | false | 0 |
sys_linkat(struct tcb *tcp)
{
if (entering(tcp)) {
print_dirfd(tcp->u_arg[0]);
printpath(tcp, tcp->u_arg[1]);
tprintf(", ");
print_dirfd(tcp->u_arg[2]);
printpath(tcp, tcp->u_arg[3]);
tprintf(", %ld", tcp->u_arg[4]);
}
return 0;
} | false | false | false | false | false | 0 |
_F_mpz_promote(F_mpz_t f)
{
if (!COEFF_IS_MPZ(*f)) *f = _F_mpz_new_mpz(); // f is small so promote it first
// if f is large already, just return the pointer
return F_mpz_arr + COEFF_TO_OFF(*f);
} | false | false | false | false | false | 0 |
bf_deletelfn(bloomfilter_t *bf, char *lfn)
{
int i;
u_int h;
for (i = 0; i < bf->numhash; i++) {
h = bfhash(lfn, shifts[i]);
bfclearbit(bf, h);
}
bf->flags |= BF_NEEDUPDATE;
} | false | false | false | false | false | 0 |
brasero_track_data_get_file_num (BraseroTrackData *track,
guint64 *file_num)
{
BraseroTrackDataClass *klass;
g_return_val_if_fail (BRASERO_IS_TRACK_DATA (track), 0);
klass = BRASERO_TRACK_DATA_GET_CLASS (track);
if (file_num)
*file_num = klass->get_file_num (track);
return BRASERO_BURN_OK;
} | false | false | false | true | false | 1 |
move_value_simple(int move, const board_t * board, int trans_killer) {
int value;
ASSERT(move_is_ok(move));
ASSERT(board!=NULL);
ASSERT(trans_killer==MoveNone||move_is_ok(trans_killer));
if (false) {
} else if (move == trans_killer) { // transposition table killer
value = TransScore;
} els... | false | false | false | false | false | 0 |
get_scheme_name(dynalogin_scheme_t scheme)
{
int scheme_count;
for(scheme_count = 0; scheme_names[scheme_count] != NULL; scheme_count++)
if(scheme == scheme_count)
return scheme_names[scheme];
return NULL;
} | false | false | false | false | true | 1 |
Finalize()
{
uint32 length = 0;
HMAC_Final(&m_ctx, (uint8*)m_digest, &length);
MANGOS_ASSERT(length == SHA_DIGEST_LENGTH);
} | false | false | false | false | false | 0 |
ini_comment_print(struct ini_comment *ic, FILE *file)
{
int len;
int i;
struct simplebuffer *sb = NULL;
TRACE_FLOW_ENTRY();
if (!file) {
TRACE_ERROR_NUMBER("Invalid file argument", EINVAL);
return;
}
if (ic) {
len = ref_array_len(ic->ra);
for (i = 0; i < le... | false | false | false | false | false | 0 |
find_hoare_inexact (double *a, double p,
double xmin, double xmax,
double frac, int n,
int nl, int nh)
{
double tmp, high, low;
int i;
if (p < 0.5) {
high = find_hoare(a, n, nh);
tmp = xmin;
for (i=0; i<nh; i++) {
if (a[i] > tmp) {
tmp = a[i];
}
}
low = tmp;
} else {... | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "InputFieldType: " << this->InputFieldType << endl;
os << indent << "OutputType: " << this->OutputType << endl;
os << indent << "MatchAnyValues: " << (this->MatchAnyValues ? "true" : "false") << endl;
os << ind... | false | false | false | false | false | 0 |
remove(LoadInst *LI) {
uint64_t Size = AA.getTypeStoreSize(LI->getType());
const MDNode *TBAAInfo = LI->getMetadata(LLVMContext::MD_tbaa);
AliasSet *AS = findAliasSetForPointer(LI->getOperand(0), Size, TBAAInfo);
if (!AS) return false;
remove(*AS);
return true;
} | false | false | false | false | false | 0 |
createBack(SDL_Surface ** back_surface)
{
int x, y;
SDL_Rect pos;
SDL_Surface *img = images[img_back]->image;
if(!(*back_surface = SDL_CreateRGBSurface(SDL_HWSURFACE,
screen->w + img->w,
screen->h + img->h,
... | false | false | false | false | false | 0 |
caml_extunix_linkat(value v_olddirfd, value v_oldname, value v_newdirfd, value v_newname, value v_flags)
{
CAMLparam5(v_olddirfd, v_oldname, v_newdirfd, v_newname, v_flags);
int ret = 0;
int flags = caml_convert_flag_list(v_flags, at_flags_table);
flags &= AT_SYMLINK_FOLLOW; /* only allowed flag here */
ret ... | false | false | false | false | false | 0 |
RunProcess(
std::vector<const char*> args)
{
std::string buffer = "";
// Run the application
kwsysProcess* gp = kwsysProcess_New();
kwsysProcess_SetCommand(gp, &*args.begin());
kwsysProcess_SetOption(gp, kwsysProcess_Option_HideWindow, 1);
kwsysProcess_Execute(gp);
char* data = NULL;
int length;
... | false | false | false | false | false | 0 |
drmGetContextFlags(int fd, drm_context_t context,
drm_context_tFlagsPtr flags)
{
drm_ctx_t ctx;
memclear(ctx);
ctx.handle = context;
if (drmIoctl(fd, DRM_IOCTL_GET_CTX, &ctx))
return -errno;
*flags = 0;
if (ctx.flags & _DRM_CONTEXT_PRESERVED)
*flags |= DRM_CONTEXT_PRESE... | false | false | false | false | false | 0 |
default_development_directory(project_ty *pp)
{
//
// To cope with automounters, directories are stored as given,
// or are derived from the home directory in the passwd file.
// Within aegis, pathnames have their symbolic links resolved,
// and any comparison of paths is done on this "system idea"
... | false | false | false | false | false | 0 |
explode(int x, int y)
{
if(explo_time == 56)
manage.noise_out(1000);
else if(explo_time > 64)
return;
int d = 4096 - (64 - explo_time)*(64 - explo_time);
int i;
for(i = 0; i < 2; ++i)
{
int dx = (int)(pubrand.get(6)) - 32;
int dy = (int)(pubrand.get(6)) - 32;
int vx = dx * (4096 - d) >> 8;
int vy = d... | false | false | false | false | false | 0 |
__fscache_relinquish_cookie(struct fscache_cookie *cookie, bool retire)
{
fscache_stat(&fscache_n_relinquishes);
if (retire)
fscache_stat(&fscache_n_relinquishes_retire);
if (!cookie) {
fscache_stat(&fscache_n_relinquishes_null);
_leave(" [no cookie]");
return;
}
_enter("%p{%s,%p,%d},%d",
cookie,... | false | false | false | false | false | 0 |
isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) {
hex_decode_ctx_t ctx;
isc_textregion_t *tr;
isc_token_t token;
isc_boolean_t eol;
hex_decode_init(&ctx, length, target);
while (ctx.length != 0) {
unsigned int i;
if (length > 0)
eol = ISC_FALSE;
else
eol = ISC_TRUE;
RETERR(is... | false | false | false | false | false | 0 |
e_sexp_add_variable (ESExp *f,
gint scope,
gchar *name,
ESExpTerm *value)
{
struct _ESExpSymbol *s;
g_return_if_fail (IS_E_SEXP (f));
g_return_if_fail (name != NULL);
s = g_malloc0 (sizeof (*s));
s->name = g_strdup (name);
s->type = ESEXP_TERM_VAR;
... | false | false | false | false | false | 0 |
opt_med7(float *p)
{
PIX_SORT(p[0], p[5]) ; PIX_SORT(p[0], p[3]) ; PIX_SORT(p[1], p[6]) ;
PIX_SORT(p[2], p[4]) ; PIX_SORT(p[0], p[1]) ; PIX_SORT(p[3], p[5]) ;
PIX_SORT(p[2], p[6]) ; PIX_SORT(p[2], p[3]) ; PIX_SORT(p[3], p[6]) ;
PIX_SORT(p[4], p[5]) ; PIX_SORT(p[1], p[4]) ; PIX_SORT(p[1], p[3]) ;
PI... | false | false | false | false | false | 0 |
e132xs_mulu(void)
{
UINT32 op1, op2, low_order, high_order;
UINT64 double_word;
op1 = op2 = 0;
//PC or SR aren't denoted, else result is undefined
if( (S_CODE == PC_CODE && !S_BIT) || (S_CODE == SR_CODE && !S_BIT) || (D_CODE == PC_CODE && !D_BIT) || (D_CODE == SR_CODE && !D_BIT) )
{
verboselog( 1, "... | false | false | false | false | false | 0 |
reserve_partition(char *partition,
struct sync_folder_list *replica_folders,
struct sync_msgid_list *part_list)
{
const char *cmd = "RESERVE";
struct sync_msgid *msgid;
struct sync_folder *folder;
struct dlist *kl;
struct dlist *kin = NULL;
struct dlist *ki;
int r;
if (!... | false | false | false | false | false | 0 |
connman_dbus_property_changed_dict(const char *path,
const char *interface, const char *key,
connman_dbus_append_cb_t function, void *user_data)
{
DBusMessage *signal;
DBusMessageIter iter;
if (path == NULL)
return FALSE;
signal = dbus_message_new_signal(path, interface, "PropertyChanged");
if (signal =... | false | false | false | false | false | 0 |
ocopen(OCstate** statep, const char* url)
{
int stat = OC_NOERR;
OCstate * state = NULL;
OCURI* tmpurl;
CURL* curl = NULL; /* curl handle*/
if(!ocuriparse(url,&tmpurl)) {OCTHROWCHK(stat=OC_EBADURL); goto fail;}
stat = occurlopen(&curl);
if(stat != OC_NOERR) {OCTHROWCHK(stat); goto fail... | false | false | false | false | false | 0 |
hud_page_in()
{
// Go through all hud gauges to page them in
int i;
size_t j, num_gauges = 0;
for (i = 0; i < Num_ship_classes; i++) {
if(Ship_info[i].hud_enabled) {
if(Ship_info[i].hud_gauges.size() > 0) {
num_gauges = Ship_info[i].hud_gauges.size();
for(j = 0; j < num_gauges; j++) {
Ship_info[... | 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.