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 |
|---|---|---|---|---|---|---|
debug_cowdancer_2 (const char * s, const char*e)
{
if (getenv("COWDANCER_DEBUG"))
fprintf (stderr, "%s: DEBUG %s:%s\n", ilist_PRGNAME, s, e);
} | false | false | false | false | true | 1 |
zxid_cdc_read(zxid_conf* cf, zxid_cgi* cgi)
{
char* p;
char* cdc = 0;
char* cookie = getenv("HTTP_COOKIE");
char* host = getenv("HTTP_HOST");
if (cookie) {
D("CDC(%s) host(%s)", cookie, host);
cdc = strstr(cookie, "_saml_idp");
if (!cdc)
cdc = strstr(cookie, "_liberty_idp");
if (cdc) {
... | false | false | false | false | false | 0 |
automap_edge_follow(loc_node *location, int dir)
{
if(location->outgoing[dir] == NULL)
return NULL;
if(location->outgoing[dir]->dest[0] == location)
return location->outgoing[dir]->dest[1];
if(location->outgoing[dir]->dest[1] == location)
return location->outgoing[dir]->dest[0];
n_show_error(E... | false | false | false | false | false | 0 |
mtde_doc_num(TermDocEnum *tde)
{
CHECK_CURR_TDE("doc_num");
return MTDE(tde)->base + MTDE(tde)->curr_tde->doc_num(MTDE(tde)->curr_tde);
} | false | false | false | false | false | 0 |
cli_ppt_vba_read(int ifd, cli_ctx *ctx)
{
char *dir;
const char *ret;
/* Create a directory to store the extracted OLE2 objects */
dir = cli_gentemp(ctx ? ctx->engine->tmpdir : NULL);
if(dir == NULL)
return NULL;
if(mkdir(dir, 0700)) {
cli_errmsg("cli_ppt_vba_read: Can't create temporary directory %s\n", dir... | false | false | false | false | false | 0 |
init_stime(void)
{
register int32 i;
struct telhdr_t *telp;
/* initialize the simulation realloced event table */
/* because fibronacci growth start with small value */
/* notice for now fixed size timing wheel */
/* initialize timing wheel headers to no events but need place holder */
/* allocate timing wheel... | false | false | false | false | false | 0 |
valueMenu(QMenu *parent, int period)
{
QMenu *valueMenu = new QMenu(parent);
for(int i=1; i < _maxValue + 1; ++i) {
QAction *a = valueMenu->addAction(QString::number(i));
a->setData(period);
}
return valueMenu;
} | false | false | false | false | false | 0 |
pop_stmt_list (tree t)
{
tree u = cur_stmt_list, chain;
/* Pop statement lists until we reach the target level. The extra
nestings will be due to outstanding cleanups. */
while (1)
{
chain = TREE_CHAIN (u);
TREE_CHAIN (u) = NULL_TREE;
if (chain)
STATEMENT_LIST_HAS_LABEL (chain) |= S... | false | false | false | true | false | 1 |
read_profile(FILE *s, tentry **entry)
{
GString *tmp1 = g_string_new("");
GString *tmp2 = g_string_new("");
char *name;
tentry *e = 0;
int rc = read_profile_header(tmp1, tmp2, s, &name);
if (rc || !name) goto cleanup;
e = entry_new(name);
rc = read_attrval_body(tmp1, tmp2, s, e);
if (!rc) {
*entry = e;
e... | false | false | false | false | false | 0 |
asc7621_remove(struct i2c_client *client)
{
struct asc7621_data *data = i2c_get_clientdata(client);
int i;
hwmon_device_unregister(data->class_dev);
for (i = 0; i < ARRAY_SIZE(asc7621_params); i++) {
device_remove_file(&client->dev,
&(asc7621_params[i].sda.dev_attr));
}
return 0;
} | false | false | false | false | false | 0 |
setup_unlock_prompt (GkmWrapPrompt *self,
CK_ATTRIBUTE_PTR attrs,
CK_ULONG n_attrs,
gboolean first)
{
CK_ATTRIBUTE_PTR attr;
GcrPrompt *prompt;
const gchar *label = NULL;
CK_OBJECT_CLASS klass;
g_assert (GKM_IS_WRAP_PROMPT (self));
prompt = GCR_PROMP... | false | false | false | false | false | 0 |
next_random(random_t *rnd)
{
/* Galois LFSR parameter */
/* Taps at 32 31 29 1: */
enum { MASK = 0x8000000b };
/* Another example - taps at 32 31 30 10: */
/* MASK = 0x00400007 */
uint32_t t;
if (UNINITED_RANDOM_T(rnd)) {
/* Can use monotonic_ns() for better randomness but for now
* it is not used anywher... | false | false | false | false | false | 0 |
cc_of_send_pkt(uint64_t dp_id, uint8_t aux_id, void *of_msg,
size_t msg_len)
{
cc_ofchannel_info_t *chann_info;
adpoll_thread_mgr_t *tmgr = NULL;
int send_rwsock;
adpoll_send_msg_t *msg_p;
msg_p = (adpoll_send_msg_t *)SEND_MSG_BUF;
cc_ofchannel_key_t chann_id;
gpointer c... | false | false | false | false | false | 0 |
line6_version_request_async(struct usb_line6 *line6)
{
char *buffer;
int retval;
buffer = kmemdup(line6_request_version,
sizeof(line6_request_version), GFP_ATOMIC);
if (buffer == NULL)
return -ENOMEM;
retval = line6_send_raw_message_async(line6, buffer,
sizeof(line6_request_version));
kfree(buff... | false | false | false | false | false | 0 |
unregisterJob(KJob *job)
{
KUiServerJobTracker *kuiserverTracker = d->trackers[job].kuiserverTracker;
KWidgetJobTracker *widgetTracker = d->trackers[job].widgetTracker;
if (!(widgetTracker || kuiserverTracker)) {
kWarning() << "Tried to unregister a kio job that hasn't been registered.";
re... | false | false | false | false | false | 0 |
radeon_mn_get(struct radeon_device *rdev)
{
struct mm_struct *mm = current->mm;
struct radeon_mn *rmn;
int r;
down_write(&mm->mmap_sem);
mutex_lock(&rdev->mn_lock);
hash_for_each_possible(rdev->mn_hash, rmn, node, (unsigned long)mm)
if (rmn->mm == mm)
goto release_locks;
rmn = kzalloc(sizeof(*rmn), GFP_K... | false | false | false | false | false | 0 |
dag_depth(struct dag *d)
{
struct dag_node *n, *parent;
struct dag_file *f;
struct list *level_unsolved_nodes = list_create();
for(n = d->nodes; n != NULL; n = n->next) {
n->level = 0;
list_first_item(n->source_files);
while((f = list_next_item(n->source_files))) {
if((parent = f->target_of) != NULL) {
... | false | false | false | false | false | 0 |
par_selected_cb(GtkTreeView *tree, gpointer parwin)
{
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;
GtkWidget *combo;
GcxPar p;
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
gtk_tree_model_get (model, &iter... | false | false | false | false | false | 0 |
FallbackLoad() {
tstring t;
int w,h,c,i,j;
rgbptr data, p;
CImg *img;
string *s;
int cmap[256];
int rgb;
t.set(fallback_xpm[0]);
w=t.tokenvalue(" \t");
h=t.tokenvalue(" \t");
c=t.tokenvalue(" \t");
for(i=0;i<c;i++) {
t.set(fallback_xpm[i+1]);
t.token("\t");
t.token(" ");
s=... | false | false | false | false | false | 0 |
gst_alpha_color_class_init (GstAlphaColorClass * klass)
{
GstBaseTransformClass *gstbasetransform_class =
(GstBaseTransformClass *) klass;
gstbasetransform_class->transform_caps =
GST_DEBUG_FUNCPTR (gst_alpha_color_transform_caps);
gstbasetransform_class->set_caps =
GST_DEBUG_FUNCPTR (gst_alpha... | false | false | false | false | false | 0 |
ConstrainEl(void)
{
if (EyeEl <= -90) {
EyeEl = -89.99;
return 1;
} else if (EyeEl >= 90) {
EyeEl = 89.99;
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
g_dump(ScmPort *out, Leaf *leaf, int indent, void *data)
{
int i;
GLeaf *z = (GLeaf*)leaf;
for (i=0; i<2; i++) {
if (!SCM_UNBOUNDP(z->val[i])) {
Scm_Printf(out, "\n %*s%2d: %25.1S", indent, "", i, z->val[i]);
}
}
} | false | false | false | false | false | 0 |
sort_assemblies (gconstpointer a, gconstpointer b)
{
CoverageAssembly *assembly_a = *(CoverageAssembly **)a;
CoverageAssembly *assembly_b = *(CoverageAssembly **)b;
if (assembly_a->name == NULL && assembly_b->name == NULL)
return 0;
else if (assembly_a->name == NULL)
return -1;
else if (assembly_b->name == NU... | false | false | false | false | false | 0 |
SendOOBFromSpecifiedSocket(OutOfBandIdentifiers oob, SystemAddress sa, __UDPSOCKET__ socket)
{
RakNet::BitStream bs;
rakPeerInterface->WriteOutOfBandHeader(&bs);
bs.Write((unsigned char) oob);
// SocketLayer::SendTo_PC( socket, (const char*) bs.GetData(), bs.GetNumberOfBytesUsed(), sa, __FILE__, __LINE__ );
... | false | false | false | false | false | 0 |
H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*out*/)
{
H5FD_mpiposix_fapl_t *fa;
H5P_genplist_t *plist; /* Property list pointer */
int mpi_code; /* mpi return code */
herr_t ret_va... | false | false | false | false | false | 0 |
debug_tree_create (DebugTree *tree, GtkTreeView *view)
{
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkTreeModel * model = GTK_TREE_MODEL (gtk_tree_store_new
(N_COLUMNS,
G_TYPE_STRING,
G_TYPE_ST... | false | false | false | false | false | 0 |
_dxfMakeUnOp(int op, PTreeNode *arg)
{
PTreeNode *res;
if (arg == NULL) {
DXSetError (ERROR_INTERNAL, "_dxfMakeUnOp, insufficient arguments");
return(NULL);
}
res = _dxfMakeArg (op);
if (res == NULL) {
_dxfComputeFreeTree (arg);
return(NULL);
}
OPRL_INIT (res, arg);
arg->next = N... | false | false | false | false | false | 0 |
stp_dlsym(void *handle, /* Module */
const char *symbol, /* Symbol name */
const char *modulename) /* Module name */
{
int len; /* Length of string */
static char *full_symbol = NULL; /* Symbol to return */
char *module; ... | false | false | false | false | false | 0 |
VisitCallNew(CallNew* expr) {
// The constructor function is also used as the receiver argument to the
// JS construct call builtin.
VISIT_FOR_VALUE(expr->expression());
VisitExpressions(expr->arguments());
CHECK_BAILOUT;
HContext* context = new HContext;
AddInstruction(context);
// The constructor is... | false | false | false | false | false | 0 |
openUrl( const KUrl &url )
{
Q_D(ReadOnlyPart);
if ( !url.isValid() )
return false;
if (d->m_bAutoDetectedMime) {
d->m_arguments.setMimeType(QString());
d->m_bAutoDetectedMime = false;
}
OpenUrlArguments args = d->m_arguments;
if ( !closeUrl() )
return false;
... | false | false | false | false | false | 0 |
f_outmost_nl_preds_in_rewriterulesinfo
#ifdef KC_USE_PROTOTYPES
(rewriterulesinfo ri)
#else
(ri) rewriterulesinfo ri;
#endif
#line 793 "../gutil.k"
{
{
#line 794 "../gutil.k"
rewriterulesinfo kc_selvar_0_1 =
ri
;
#line 794 "../gutil.k"
/*SUPPRESS 622*/
assert_rewriterulesinfo(kc_selvar_0_1, "with_expression (1)"... | false | false | false | true | false | 1 |
unparse_name_fixed(krb5_context context,
krb5_const_principal principal,
char *name,
size_t len,
int flags)
{
size_t idx = 0;
size_t i;
int short_form = (flags & KRB5_PRINCIPAL_UNPARSE_SHORT) != 0;
int no_realm = (flags & KRB5_PRINCIPAL_UNPARSE_NO_REALM) != 0;
int display = (flag... | false | false | false | false | false | 0 |
HashIP(const IPAddress& ip) {
switch (ip.family()) {
case AF_INET: {
return ip.ipv4_address().s_addr;
}
case AF_INET6: {
in6_addr v6addr = ip.ipv6_address();
const uint32* v6_as_ints =
reinterpret_cast<const uint32*>(&v6addr.s6_addr);
return v6_as_ints[0] ^ v6_as_ints[1] ... | false | false | false | false | false | 0 |
mlx4_WRITE_MTT_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
struct mlx4_cmd_mailbox *inbox,
struct mlx4_cmd_mailbox *outbox,
struct mlx4_cmd_info *cmd)
{
struct mlx4_mtt mtt;
__be64 *page_list = inbox->buf;
u64 *pg_list = (u64 *)page_list;
int i;
struct res_mtt *rmtt = N... | false | false | false | false | false | 0 |
midgard_core_object_parameters_find(
MidgardConnection *mgd, const gchar *class_name,
const gchar *guid, guint n_params, const GParameter *parameters)
{
g_assert(mgd != NULL);
g_assert(class_name != NULL);
g_assert(guid != NULL);
if(!parameters)
return NULL;
if(parameters && n_params == 0) {
g_warning("... | false | false | false | false | false | 0 |
xlog_recover_efi_pass2(
struct xlog *log,
struct xlog_recover_item *item,
xfs_lsn_t lsn)
{
int error;
struct xfs_mount *mp = log->l_mp;
struct xfs_efi_log_item *efip;
struct xfs_efi_log_format *efi_formatp;
efi_formatp = item->ri_buf[0].i_addr;
efip = xfs_efi_init(mp, efi_formatp->efi_nextents);
er... | false | false | false | false | false | 0 |
pca9541_select_chan(struct i2c_adapter *adap, void *client, u32 chan)
{
struct pca9541 *data = i2c_get_clientdata(client);
int ret;
unsigned long timeout = jiffies + ARB2_TIMEOUT;
/* give up after this time */
data->arb_timeout = jiffies + ARB_TIMEOUT;
/* force bus ownership after this time */
do {
ret = p... | false | false | false | false | false | 0 |
IsStdoutBlocking(const Arguments& args) {
return IsBlocking(STDOUT_FILENO) ? True() : False();
} | false | false | false | false | false | 0 |
mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val)
{
ALIGNCHECK(mh);
if(mh == NULL) return MPG123_ERR;
if(band < 0 || band > 31){ mh->err = MPG123_BAD_BAND; return MPG123_ERR; }
switch(channel)
{
case MPG123_LEFT|MPG123_RIGHT:
mh->equalizer[0][band] = mh->equalizer[1][band] = DOU... | false | false | false | false | false | 0 |
_rect_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
Eina_List *l;
E_Zone *z;
if (ev->button != 1) return;
e_widget_radio_toggle_set(o_radio_all, 0);
EINA_LIST_FOREACH(scon->zones, l, z)
{
... | false | false | false | false | false | 0 |
nfsd_startup_net(int nrservs, struct net *net)
{
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
int ret;
if (nn->nfsd_net_up)
return 0;
ret = nfsd_startup_generic(nrservs);
if (ret)
return ret;
ret = nfsd_init_socks(net);
if (ret)
goto out_socks;
if (nfsd_needs_lockd() && !nn->lockd_up) {
ret =... | false | false | false | false | false | 0 |
ScalarScalarFormFactor(Energy2 q2,unsigned int mode,
int,int id1,
Energy, Energy,Complex & f0,
Complex & fp) const {
useMe();
double ratio(q2/sqr(_massV[mode]));
fp = _fplus0[mode]/(1.-ratio)/(1.-ratio*(_sigma1fp[mode]-_sigma2fp[mode]*ratio));
f0 = _f00[mode] /(1.-r... | false | false | false | false | false | 0 |
ReadGF_IPMPX_GetToolContext(GF_BitStream *bs, GF_IPMPX_Data *_p, u32 size)
{
Bool has_idex;
GF_IPMPX_GetToolContext*p = (GF_IPMPX_GetToolContext*)_p;
p->scope = gf_bs_read_int(bs, 3);
has_idex = gf_bs_read_int(bs, 1);
gf_bs_read_int(bs, 4);
if (has_idex) p->IPMP_DescriptorIDEx = gf_bs_read_int(bs, 16);
return G... | false | false | false | false | false | 0 |
ossl_x509_get_extensions(VALUE self)
{
X509 *x509;
int count, i;
X509_EXTENSION *ext;
VALUE ary;
GetX509(self, x509);
count = X509_get_ext_count(x509);
if (count < 0) {
return rb_ary_new();
}
ary = rb_ary_new2(count);
for (i=0; i<count; i++) {
ext = X509_get_ext(x509, i); /* N... | false | false | false | false | false | 0 |
on_notebook_tab_double_click(GtkWidget *widget, GdkEventButton *event,
AnjutaDocman* docman)
{
if (event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS)
{
if(!docman->maximized)
anjuta_shell_maximize_widget(docman->shell, "AnjutaDocumentManager", NULL);
else
anju... | false | false | false | false | false | 0 |
pt_recv_cont(pt_Continuation *op, PRInt16 revents)
{
/*
* Any number of bytes will complete the operation. It need
* not (and probably will not) satisfy the request. The only
* error we continue is EWOULDBLOCK|EAGAIN.
*/
#if defined(SOLARIS)
if (0 == op->arg4.flags)
op->result.code =... | false | false | false | false | false | 0 |
egg_recent_model_write (EggRecentModel *model, FILE *file, GList *list)
{
GString *string;
gchar *data;
EggRecentItem *item;
const GList *groups;
int i;
int ret;
string = g_string_new ("<?xml version=\"1.0\"?>\n");
string = g_string_append (string, "<" TAG_RECENT_FILES ">\n");
i=0;
while (list) {
gchar *... | false | false | false | false | true | 1 |
malloc_spin_lock(pthread_mutex_t *lock)
{
unsigned ret = 0;
if (__isthreaded) {
if (pthread_mutex_trylock(lock) != 0) {
unsigned i;
volatile unsigned j;
/* Exponentially back off. */
for (i = 1; i <= SPIN_LIMIT_2POW; i++) {
for (j = 0; j < (1U << i); j++) {
ret++;
CPU_SPINWAIT;
}
... | false | false | false | false | false | 0 |
init_media_player(GtkWidget *parent) {
GtkWidget *window;
GtkBuilder *builder;
gst_init_check(0, NULL, NULL);
srand(time(NULL));
player = g_new0(MediaPlayer, 1);
player->glade_path = g_build_filename(get_glade_dir(), "media_player.xml", NULL);
builder = gtkpod_builder_xml_new(player->glade_... | false | false | false | false | true | 1 |
OnApplicationClose(wxCloseEvent& event)
{
if (m_InitiatedShutdown)
return;
CodeBlocksEvent evt(cbEVT_APP_START_SHUTDOWN);
Manager::Get()->ProcessEvent(evt);
Manager::Yield();
m_InitiatedShutdown = true;
Manager::BlockYields(true);
ProjectManager* prjman = Manager::Get()->GetProjec... | false | false | false | false | false | 0 |
equal_char (char a, char b, bool case_sensitive)
{
if (case_sensitive)
return a == b;
return ACE_OS::ace_tolower (a) == ACE_OS::ace_tolower (b);
} | false | false | false | false | false | 0 |
visu_surfaces_resources_getFromName(const gchar *surf_name,
gboolean *nw)
{
VisuSurfacesResources *res;
g_return_val_if_fail(isosurfaces_resources, (VisuSurfacesResources*)0);
if (surf_name && surf_name[0])
res = g_hash_table_lookup(isosurfaces_reso... | false | false | false | false | false | 0 |
EvalAndApplySubtractGreen(VP8LEncoder* const enc,
int width, int height,
VP8LBitWriter* const bw) {
if (!enc->use_palette_) {
int i;
const uint32_t* const argb = enc->argb_;
double bit_cost_before, bit_cost_after;
VP8LHistogram*... | false | false | false | false | false | 0 |
align(Py_ssize_t size, char c, const formatdef *e)
{
Py_ssize_t extra;
if (e->format == c) {
if (e->alignment && size > 0) {
extra = (e->alignment - 1) - (size - 1) % (e->alignment);
if (extra > PY_SSIZE_T_MAX - size)
return -1;
size += extra;
... | false | false | false | false | false | 0 |
encoding_combo_store_sort_func(GtkTreeModel *model,
GtkTreeIter *a,
GtkTreeIter *b,
gpointer data)
{
gboolean a_has_child = gtk_tree_model_iter_has_child(model, a);
gboolean b_has_child = gtk_tree_model_iter_has_child(model, b);
gchar *a_string;
gchar *b_string;
gint cmp_res;... | false | false | false | false | false | 0 |
read_long_string(LexState*ls,SemInfo*seminfo,int sep){
int cont=0;
(void)(cont);
save_and_next(ls);
if(currIsNewline(ls))
inclinenumber(ls);
for(;;){
switch(ls->current){
case(-1):
luaX_lexerror(ls,(seminfo)?"unfinished long string":
"unfinished long comment",TK_EOS);
break;
case']':{
if(skip_sep(ls)==sep){
save_and_ne... | false | false | false | false | false | 0 |
local_update_display()
{
graph_timestamp = ++global_timestamp; /* new surface */
if ( go_display_flag )
{
if ( OOGL_flag ) UpdateOOGL();
else
display();
}
} | false | false | false | false | false | 0 |
bpf_prog_inc(struct bpf_prog *prog)
{
if (atomic_inc_return(&prog->aux->refcnt) > BPF_MAX_REFCNT) {
atomic_dec(&prog->aux->refcnt);
return ERR_PTR(-EBUSY);
}
return prog;
} | false | false | false | false | false | 0 |
nxt200x_agc_reset(struct nxt200x_state* state)
{
u8 buf;
dprintk("%s\n", __func__);
switch (state->demod_chip) {
case NXT2002:
buf = 0x08;
nxt200x_writebytes(state, 0x08, &buf, 1);
buf = 0x00;
nxt200x_writebytes(state, 0x08, &buf, 1);
break;
case NXT2004:
nxt200x_readreg_multibyte(state, 0x08,... | false | false | false | false | false | 0 |
usage( char *name )
{
fprintf( stderr,
"usage: %s options\n", name );
fprintf( stderr,
"\t-4\t\tIPv4 only\n"
"\t-6\t\tIPv6 only\n"
"\t-T {acl|add|auth|cat|dn|index|passwd|test}\n"
"\t\t\tRun in Tool mode\n"
"\t-c cookie\tSync cookie of consumer\n"
"\t-d level\tDebug level" "\n"
"\t-f filename\tConfigu... | true | true | false | false | true | 1 |
ci_get_std_voltage_value_sidd(struct radeon_device *rdev,
struct atom_voltage_table_entry *voltage_table,
u16 *std_voltage_hi_sidd, u16 *std_voltage_lo_sidd)
{
u16 v_index, idx;
bool voltage_found = false;
*std_voltage_hi_sidd = voltage_table->value * VOLTAGE_SCALE;
*std_voltage_lo_sidd = voltage_table-... | false | false | false | false | false | 0 |
safecat(char *buffer, size_t bufsize, size_t pos,
PNG_CONST char *cat)
{
while (pos < bufsize && cat != NULL && *cat != 0)
buffer[pos++] = *cat++;
if (pos >= bufsize)
pos = bufsize-1;
buffer[pos] = 0;
return pos;
} | false | false | false | false | false | 0 |
group_units(int groupNum)
{
err_when(groupNum<1 || groupNum>MAX_SELECT_GROUP_NUM);
Unit *unitPtr;
int playerNation;
if(!unit_array.selected_recno)
return; // invalid call
else
{
playerNation = nation_array.player_recno;
unitPtr = unit_array[unit_array.selected_recno];
if(unitPtr->nation_recno!=playerNat... | false | false | false | false | false | 0 |
TransmitOSDString(const cec_logical_address destination, cec_display_control duration, const char *strMessage, bool bIsReply)
{
bool bReturn(false);
if (!m_processor->GetDevice(destination)->IsUnsupportedFeature(CEC_OPCODE_SET_OSD_STRING))
{
LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): display OSD m... | false | false | false | false | false | 0 |
entropy_collect_randomness(SHA1Context *ctx)
{
#ifdef MINGW32
{
uint8 data[128];
if (0 == mingw_random_bytes(data, sizeof data)) {
g_warning("unable to generate random bytes: %m");
} else {
SHA1Input(ctx, data, sizeof data);
}
}
#else /* !MINGW32 */
{
filestat_t buf;
FILE *f = NULL;
bool is_pipe ... | false | false | false | false | true | 1 |
vmw_kms_stdu_surface_fifo_commit(struct vmw_kms_dirty *dirty)
{
struct vmw_stdu_dirty *sdirty =
container_of(dirty, struct vmw_stdu_dirty, base);
struct vmw_screen_target_display_unit *stdu =
container_of(dirty->unit, typeof(*stdu), base);
struct vmw_stdu_surface_copy *cmd = dirty->cmd;
struct vmw_stdu_update *... | false | false | false | false | false | 0 |
get_first_line(char *txt)
{
char *t = xstrdup(txt);
char *p = strchr(t, '\n');
if (p)
*p = '\0';
return t;
} | false | false | false | false | false | 0 |
parse_title (vString* const name, const char control_char)
{
char *text = vStringValue(name);
char *p = text;
int offset_start = 0;
boolean in_or_after_title = FALSE;
while (p != NULL && *p != '\0')
{
if (*p == control_char)
{
if (in_or_after_title)
break;
else
offset_start++;
}
else
in_... | false | false | false | false | false | 0 |
SetInteractive(int interact)
{
if (this->Interactor && this->Enabled)
{
if (this->Interactive == interact)
{
return;
}
if (interact)
{
vtkRenderWindowInteractor *i = this->Interactor;
if ( this->EventCallbackCommand )
{
i->AddObserver( vtkCommand::MouseM... | false | false | false | false | false | 0 |
GeneralizedSchur_Real(TMatrix S, TMatrix T, TMatrix Q, TMatrix Z, TMatrix A, TMatrix B,
TVector alpha_r, TVector alpha_i, TVector beta)
{
int n, err;
if (!S || !T || !A || !B)
{
dw_Error(NULL_ERR);
return 0;
}
n=RowM(A);
if ((ColM(A) != n) || (RowM(B) != n) || (ColM(B) != n)... | false | false | false | false | false | 0 |
getTypeByLetter(UChar ch) {
if (ch == 0x0048 /* H */) {
return HOUR;
} else if (ch == 0x006D /* m */) {
return MINUTE;
} else if (ch == 0x0073 /* s */) {
return SECOND;
}
return TEXT;
} | false | false | false | false | false | 0 |
attributes_set (Attributes *attributes, const char *name, Value *value)
{
Value *old_value = attributes_remove (attributes, name);
if (old_value)
value_destroy (old_value);
hashtable_insert (attributes->table, estrdup (name), value);
} | false | false | false | false | false | 0 |
copyin(char *src, char **space)
{
char *cp;
char *top;
top = cp = *space;
while ((*cp++ = *src++) != '\0')
;
*space = cp;
return (top);
} | false | false | false | false | false | 0 |
location_is_none_20 (ats_ptr_type arg0) {
/* local vardec */
ATSlocal (ats_bool_type, tmp61) ;
ATSlocal (ats_lint_type, tmp62) ;
__ats_lab_location_is_none_20:
tmp62 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_2, arg0), atslab_begpos_toff) ;
tmp61 = atspre_lt_lint_lint (tmp62, 0L) ;
return (tmp61) ;
} | false | false | false | false | false | 0 |
bna_msgq_rsp_handler(void *arg, struct bfi_msgq_mhdr *msghdr)
{
struct bna *bna = (struct bna *)arg;
struct bna_tx *tx;
struct bna_rx *rx;
switch (msghdr->msg_id) {
case BFI_ENET_I2H_RX_CFG_SET_RSP:
bna_rx_from_rid(bna, msghdr->enet_id, rx);
if (rx)
bna_bfi_rx_enet_start_rsp(rx, msghdr);
break;
case BF... | false | false | false | false | false | 0 |
OnPrintResolution (PrefsDlg *dlg)
{
int PrintIndex = gtk_combo_box_get_active (dlg->PrintResMenu);
switch (PrintIndex)
{
case 0:
PrintResolution = 300;
break;
case 1:
PrintResolution = 360;
break;
case 2:
PrintResolution = 600;
break;
case 3:
PrintResolution = 720;
break;
case 4:
PrintResoluti... | false | false | false | false | false | 0 |
test_ring (void)
{
UcaRingBuffer *buffer;
guint32 *data;
buffer = uca_ring_buffer_new (512, 2);
data = uca_ring_buffer_get_write_pointer (buffer);
data[0] = 0xBADF00D;
uca_ring_buffer_write_advance (buffer);
g_assert (uca_ring_buffer_available (buffer));
g_assert (uca_ring_buffer_get_... | false | false | false | false | false | 0 |
deinit_iconv(void *ptr, int *errptr)
{
int rc;
int converr;
struct libmail_u_convert_iconv *h=(struct libmail_u_convert_iconv *)ptr;
libmail_u_convert_handle_t next;
if (h->errflag == 0)
convert_flush(h);
if (h->bufcnt && h->errflag == 0)
h->converr=1;
if (h->errflag == 0)
convert_flush_iconv(h, NULL, N... | false | false | false | false | false | 0 |
InitialScaledStartValuesNegativeExponentNegativePower(
uint64_t significand, int exponent,
int estimated_power, bool need_boundary_deltas,
Bignum* numerator, Bignum* denominator,
Bignum* delta_minus, Bignum* delta_plus) {
// Instead of multiplying the denominator with 10^estimated_power we
// multip... | false | false | false | false | false | 0 |
__ast_callerid_generate(unsigned char *buf, const char *name, const char *number, int callwaiting, struct ast_format *codec)
{
if (ast_strlen_zero(name))
name = NULL;
if (ast_strlen_zero(number))
number = NULL;
return callerid_generate(buf, number, name, 0, callwaiting, codec);
} | false | false | false | false | false | 0 |
parse_user_option(const char *context, int num_params, char *params [])
{
user_option_t *user_option;
for (user_option = user_options; user_option; user_option = user_option->next) {
if ((!strcmp(user_option->name, params[0])) &&
(user_option->parser != NULL)) {
return (*user_option->parser)(cont... | false | false | false | false | false | 0 |
juli_ak4114_change(struct ak4114 *ak4114, unsigned char c0,
unsigned char c1)
{
struct snd_ice1712 *ice = ak4114->change_callback_private;
int rate;
if (ice->is_spdif_master(ice) && c1) {
/* only for SPDIF master mode, rate was changed */
rate = snd_ak4114_external_rate(ak4114);
/* dev_dbg(ice->card-... | false | false | false | false | false | 0 |
set_state_tablele(int mtg_id, State_tmp *spt, Group *gpt)
{
extern Mtg_table *mtg_head;
Mtg_table *mpt;
int i,j;
State_tmp *spt2;
if (mtg_head == NULL){
mtg_head = alloc_mtg_table();
mpt = mtg_head;
}else{
for(mpt = mtg_head; mpt->next != NULL; mpt = mpt->next)
;
mpt->next = a... | false | false | false | false | false | 0 |
hdmi_repoll_eld(struct work_struct *work)
{
struct hdmi_spec_per_pin *per_pin =
container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
if (per_pin->repoll_count++ > 6)
per_pin->repoll_count = 0;
if (hdmi_present_sense(per_pin, per_pin->repoll_count))
snd_hda_jack_report_sync(per_pin->codec);
} | false | false | false | false | false | 0 |
find_request(
const LargeFileAIO::Reqs& reqs,
uint64_t offset,
size_t len)
{
for(LargeFileAIO::Reqs::const_iterator i = reqs.begin(); i != reqs.end(); ++i)
{
if(static_cast<uint64_t>(i->first->aio_offset) == offset &&
i->first->aio_nbytes == len) {
return i->first;
}
}
return NULL;
} | false | false | false | false | false | 0 |
registerPCZoneFactory(PCZoneFactory* factory)
{
String name = factory->getFactoryTypeName();
mPCZoneFactories[name] = factory;
LogManager::getSingleton().logMessage("PCZone Factory Type '" + name + "' registered");
} | false | false | false | false | false | 0 |
ext4_free_branches(handle_t *handle, struct inode *inode,
struct buffer_head *parent_bh,
__le32 *first, __le32 *last, int depth)
{
ext4_fsblk_t nr;
__le32 *p;
if (ext4_handle_is_aborted(handle))
return;
if (depth--) {
struct buffer_head *bh;
int addr_per_block = EXT4_ADDR_PER_BLOCK(inode... | false | false | false | false | false | 0 |
iluBuildMipmaps()
{
iluCurImage = ilGetCurImage();
if (iluCurImage == NULL) {
ilSetError(ILU_ILLEGAL_OPERATION);
return IL_FALSE;
}
// Get rid of any existing mipmaps.
if (iluCurImage->Mipmaps) {
ilCloseImage(iluCurImage->Mipmaps);
iluCurImage->Mipmaps = NULL;
}
return iBuildMipmaps(iluCurImage, iluCur... | false | false | false | false | false | 0 |
xdr_readdirp3args (XDR *xdrs, readdirp3args *objp)
{
if (!xdr_nfs_fh3 (xdrs, &objp->dir))
return FALSE;
if (!xdr_cookie3 (xdrs, &objp->cookie))
return FALSE;
if (!xdr_cookieverf3 (xdrs, objp->cookieverf))
return FALSE;
if (!xdr_count3 (xdrs, &objp->dircount))
return FALSE;
if (!xdr_count3 (xdrs, &... | false | false | false | false | false | 0 |
editor_snippets_init(void)
{
gchar *sysconfigfile, *userconfigfile;
GKeyFile *sysconfig = g_key_file_new();
GKeyFile *userconfig = g_key_file_new();
snippet_offsets = g_queue_new();
sysconfigfile = g_build_filename(app->datadir, "snippets.conf", NULL);
userconfigfile = g_build_filename(app->configdir, "snippets... | false | false | false | false | false | 0 |
GetIVAndThrowIfInvalid(const NameValuePairs ¶ms, size_t &size)
{
ConstByteArrayParameter ivWithLength;
const byte *iv;
bool found = false;
try {found = params.GetValue(Name::IV(), ivWithLength);}
catch (const NameValuePairs::ValueTypeMismatch &) {}
if (found)
{
iv = ivWithLength.begin();
ThrowIfInvalid... | false | false | false | false | false | 0 |
prepInsns()
{
if (!x86_64_insns) {
x86_64_insns = ht_malloc(sizeof *x86_64_insns);
memcpy(x86_64_insns, x86_32_insns, sizeof x86_32_insns);
int i = 0;
while (x86_64_insn_patches[i].opc != -1) {
(*x86_64_insns)[x86_64_insn_patches[i].opc] = x86_64_insn_patches[i].insn;
i++;
}
}
x86_insns = x86_64_in... | false | false | false | false | false | 0 |
_appendScriptToLanguageTag(const char* localeID, char* appendAt, int32_t capacity, UBool strict, UErrorCode* status) {
char buf[ULOC_SCRIPT_CAPACITY];
UErrorCode tmpStatus = U_ZERO_ERROR;
int32_t len;
int32_t reslen = 0;
if (U_FAILURE(*status)) {
return 0;
}
len = uloc_getScript(lo... | true | true | false | false | false | 1 |
krb5_verify_checksum(krb5_context context, krb5_cksumtype ctype,
const krb5_checksum *cksum, krb5_const_pointer in,
size_t in_length, krb5_const_pointer seed,
size_t seed_length)
{
krb5_data input = make_data((void *) in, in_length);
krb5_keyblock k... | false | false | false | false | false | 0 |
cogland_surface_attach (struct wl_client *wayland_client,
struct wl_resource *wayland_surface_resource,
struct wl_resource *wayland_buffer_resource,
int32_t sx, int32_t sy)
{
CoglandSurface *surface =
wl_resource_get_user_data (wayland_surfac... | false | false | false | false | false | 0 |
dmp_defparams(FILE *f, struct mod_t *mdp)
{
register int32 i;
struct dfparam_t *dfpp;
struct itree_t *itp;
__pv_stlevel++;
for (dfpp = __dfphdr; dfpp != NULL; dfpp = dfpp->dfpnxt)
{
if (dfpp->in_mdp != mdp) continue;
__wrap_puts("defparam ", f);
if (dfpp->dfp_local) __wrap_puts(dfpp->gdfpnam, f);
el... | false | false | false | false | false | 0 |
parse_primitive_type_tag(struct line_parser *lp,
struct ftfil *ftfil)
{
struct ftfil_lookup_tag *ftflt;
struct ftchash_rec_fil_c32 ftch_recfc32, *ftch_recfc32p;
u_int32 hash, val;
ftflt = (struct ftfil_lookup_tag*)lp->cur_primitive->lookup;
bzero(&ftch_recfc32, sizeof ftch_recfc32);
if (isalpha((int)lp... | false | false | false | false | false | 0 |
user_set_state(struct hub_user* user, enum user_state state)
{
if ((user->state == state_cleanup && state != state_disconnected) || (user->state == state_disconnected))
{
return;
}
user->state = state;
} | false | false | false | false | false | 0 |
unmarshal_TAG_CODE_SETS(const IOP::TaggedComponent& c, omniIOR& ior)
{
OMNIORB_ASSERT(c.tag == IOP::TAG_CODE_SETS);
cdrEncapsulationStream e(c.component_data.get_buffer(),
c.component_data.length(),1);
CONV_FRAME::CodeSetComponentInfo info;
info <<= e;
// Pick a char code set convertor
omniCodeSet::... | false | false | false | false | false | 0 |
Hashmap_get_node(Hashmap *map, uint32_t hash, DArray *bucket, void *key)
{
int i = 0;
for(i = 0; i < DArray_end(bucket); i++) {
debug("TRY: %d", i);
HashmapNode *node = DArray_get(bucket, i);
if(node->hash == hash && map->compare(node->key, key) == 0) {
return i;
}
... | 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.