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 |
|---|---|---|---|---|---|---|
load_hba(void)
{
FILE *file;
List *hba_lines = NIL;
List *hba_line_nums = NIL;
List *hba_raw_lines = NIL;
ListCell *line,
*line_num,
*raw_line;
List *new_parsed_lines = NIL;
bool ok = true;
MemoryContext linecxt;
MemoryContext oldcxt;
MemoryContext hbacxt;
file = AllocateFile(H... | false | false | false | false | false | 0 |
get_model_Buffer ()
{
long index;
index = ERROR_INDEX;
switch (LV_Function) {
case DPGEN_ROM2:
case DPGEN_ROM4:
index = LV_iLeafCell;
break;
}
if (index == ERROR_INDEX) return ("bug_buff");
__DBG(
fprintf (stderr,
"index := %ld, name := %s\n",
index,
... | false | false | false | false | false | 0 |
Java_com_tresys_setools_seaudit_seauditJNI_tm_1t_1tm_1mon_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
tm_t *arg1 = (tm_t *) 0 ;
int arg2 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(tm_t **)&jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->tm_mon = arg2;
} | false | false | false | false | false | 0 |
sync_write_file_contents(const char *filename, const lcdf::String &contents,
mode_t mode)
{
int fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, mode);
if (fd == -1)
return -1;
ssize_t x = safe_write(fd, contents.data(), contents.length());
if (x != contents.length... | false | false | false | false | false | 0 |
ib_uverbs_destroy_cq(struct ib_uverbs_file *file,
struct ib_device *ib_dev,
const char __user *buf, int in_len,
int out_len)
{
struct ib_uverbs_destroy_cq cmd;
struct ib_uverbs_destroy_cq_resp resp;
struct ib_uobject *uobj;
struct ib_cq *cq;
struct ib_ucq_object ... | false | false | false | false | false | 0 |
getEnv(const fdInfoType *info,const char *name)
{
register int len=strlen(name);
register char **env;
register int i;
/* first look at the method specific environment */
for (i=info->conn->method->env.num-1,env=info->conn->method->env.list;i>= 0; i--,env++) {
if (strncmp(name,*env,len)==0 && env[0... | false | false | false | false | false | 0 |
lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
{
struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
if (!(ndlp->nlp_flag & NLP_RPI_REGISTERED)) {
ndlp->nlp_flag &= ~NLP_NPR_ADISC;
return 0;
}
if (!(vport->fc_flag & FC_PT2PT)) {
/* Check config parameter use-adisc or FCP-2 */
... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
int sock;
int ret;
struct afp_volume volume;
thisbin=argv[0];
uid=((unsigned int) geteuid());
volume.server=NULL;
if (strstr(argv[0],"mount_afp")) {
if (handle_mount_afp(argc,argv)<0)
return -1;
}
else if (prepare_buffer(argc,argv)<0)
return -1;
if ((sock=daemon_conne... | false | false | false | false | false | 0 |
add_c_test (const char *expr, int value)
{
struct c_test *test;
if (expr[0] == 0)
return;
test = XNEW (struct c_test);
test->expr = expr;
test->value = value;
*(htab_find_slot (condition_table, test, INSERT)) = test;
} | false | false | false | false | false | 0 |
rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
{
struct hw_mode_spec *spec = &rt2x00dev->spec;
struct channel_info *info;
char *tx_power;
unsigned int i;
/*
* Initialize all hw fields.
*/
ieee80211_hw_set(rt2x00dev->hw, PS_NULLFUNC_STACK);
ieee80211_hw_set(rt2x00dev->hw, SUPPORTS_PS);
ieee80211_hw_s... | false | false | false | false | false | 0 |
push_state(struct stack* stack,struct rtf_state* state)
{
int toplevel;
size_t defelements;
stack->elements++;
if( compare_state(state,&base_state)) {
state->default_elements++;
return 0;/* this is default state, don't push it, we'll know when we pop it that it was the default one,
we store in the state ... | false | false | false | false | false | 0 |
setNodeName(const QString& nodename)
{
// don't touch those values if we're working!
if (!isRunning())
{
d->input.node = nodename;
d->status = Idle;
d->results.setAddress(nodename, d->input.service);
}
} | false | false | false | false | false | 0 |
tkCloseWindow(void)
{
if (xDisplay) {
cursorNum = 0;
ExposeFunc = 0;
ReshapeFunc = 0;
IdleFunc = 0;
DisplayFunc = 0;
KeyDownFunc = 0;
MouseDownFunc = 0;
MouseUpFunc = 0;
MouseMoveFunc = 0;
glFlush();
glFinish();
if (TK_HAS_OVERLAY(w.type)) {
XDestroyWindow(xDisplay, w.wOverlay);
glXDestroyC... | false | false | false | false | false | 0 |
GMT_shore_get_next_entry (struct GMT_SHORE *c, GMT_LONG dir, GMT_LONG side, GMT_LONG id)
{
/* Finds the next entry point on the given side that is further away
* in the <dir> direction than previous point. It removes the info
* regarding the new entry from the GSHHS_SIDE structure */
GMT_LONG k, pos, n;
if... | false | false | false | false | false | 0 |
c_pdf14trans_is_friendly(const gs_composite_t * composite_action, byte cmd0, byte cmd1)
{
gs_pdf14trans_t *pct0 = (gs_pdf14trans_t *)composite_action;
int op0 = pct0->params.pdf14_op;
if (op0 == PDF14_PUSH_DEVICE || op0 == PDF14_END_TRANS_GROUP) {
/* Halftone commands are always passed to the targe... | false | false | false | false | false | 0 |
blkid_probe_chain_reset_values(blkid_probe pr, struct blkid_chain *chn)
{
struct list_head *p, *pnext;
if (!pr || list_empty(&pr->values))
return;
DBG(LOWPROBE, ul_debug("reseting %s values", chn->driver->name));
list_for_each_safe(p, pnext, &pr->values) {
struct blkid_prval *v = list_entry(p,
struct ... | false | false | false | false | false | 0 |
autofs4_del_active(struct dentry *dentry)
{
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
struct autofs_info *ino = autofs4_dentry_ino(dentry);
if (ino) {
spin_lock(&sbi->lookup_lock);
ino->active_count--;
if (!ino->active_count) {
if (!list_empty(&ino->active))
list_del_init(&ino->active);
... | false | false | false | false | false | 0 |
be_openssl_eventcb(struct bufferevent *bev_base, short what, void *ctx)
{
struct bufferevent_openssl *bev_ssl = ctx;
int event = 0;
if (what & BEV_EVENT_EOF) {
if (bev_ssl->allow_dirty_shutdown)
event = BEV_EVENT_EOF;
else
event = BEV_EVENT_ERROR;
} else if (what & BEV_EVENT_TIMEOUT) {
/* We sure didn'... | false | false | false | false | false | 0 |
monster_dist_att(int dir, object *ob, object *enemy, object *part, rv_vector *rv) {
if (monster_can_hit(part, enemy, rv))
return dir;
if (rv->distance < 10)
return absdir(dir+4);
else if (rv->distance > 18)
return dir;
return 0;
} | false | false | false | false | false | 0 |
vfsub_kern_path(const char *name, unsigned int flags, struct path *path)
{
int err;
err = kern_path(name, flags, path);
if (!err && d_is_positive(path->dentry))
vfsub_update_h_iattr(path, /*did*/NULL); /*ignore*/
return err;
} | false | false | false | false | false | 0 |
Pred (OverlayComp* child) {
Iterator i;
OverlayComp* parent = (OverlayComp*) child->GetParent();
if (parent) {
parent->SetComp(child, i);
parent->Prev(i);
return (OverlayComp*) parent->GetComp(i);
} else
return nil;
} | false | false | false | false | false | 0 |
fep_signal_handler(int signal, siginfo_t* siginfo, void* uap) {
if (factor_vm::fatal_erroring_p)
return;
factor_vm* vm = current_vm_p();
if (vm) {
vm->safepoint.enqueue_fep(vm);
enqueue_signal(vm, signal);
} else
fatal_error("Foreign thread received signal", signal);
} | false | false | false | false | false | 0 |
OnMenuSelected( wxCommandEvent& evt )
{
unsigned int col = evt.GetId() - MP_LISTCOL_1;
if (col >= m_column_sizes.size()) {
m_column_sizes.resize(col + 1, 0);
}
if (GetColumnWidth(col) > COL_SIZE_MIN) {
m_column_sizes[col] = GetColumnWidth(col);
SetColumnWidth(col, 0);
} else {
int oldsize = m_column_size... | false | false | false | false | false | 0 |
wasp_trace_ip( wasp_instruction ip ){
wasp_prim_fn p = ip->prim->impl;
int ap = 0, rx = 0;
if( p == wasp_instr_call ){
ap = 1;
}else if( p == wasp_instr_tail ){
ap = 1;
}else if( p == wasp_instr_retn ){
rx = 1;
}else return;
int i = 0; wasp_callframe cp =... | false | false | false | false | false | 0 |
file_push(scheme *sc, const char *fname) {
FILE *fin=fopen(fname,"r");
if(fin!=0) {
sc->file_i++;
sc->load_stack[sc->file_i].kind=port_file|port_input;
sc->load_stack[sc->file_i].rep.stdio.file=fin;
sc->load_stack[sc->file_i].rep.stdio.closeit=1;
sc->nesting_stack[sc->file_i]=0;
sc->loadport... | false | false | false | false | false | 0 |
calc_a1hash(const char *username, const char *realm, const char *password, char *a1hash)
{
#define A1PPASS_LEN MYSQL_LU + 1 + MYSQL_LR + 1 + MYSQL_LP + 1 /* user:realm:password\0 */
char buf[A1PPASS_LEN];
unsigned char md5digest[MD5_DIGEST_LENGTH];
int i;
snprintf(buf, A1PPASS_LEN, "%.*s:%.*s:%.*s", MY... | true | true | false | false | true | 1 |
camel_store_summary_disconnect_folder_summary (CamelStoreSummary *summary,
CamelFolderSummary *folder_summary)
{
g_return_val_if_fail (CAMEL_IS_STORE_SUMMARY (summary), FALSE);
g_return_val_if_fail (CAMEL_IS_FOLDER_SUMMARY (folder_summary), FALSE);
g_rec_mutex_lock (&s... | false | false | false | false | false | 0 |
iconify_client(client_t *c)
{
client_t *p;
do_iconify(c);
for (p = head; p; p = p->next)
if (p->trans == c->win) do_iconify(p);
} | false | false | false | false | false | 0 |
CreateBattleGround(BattleGroundTypeId bgTypeId, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char const* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team... | false | false | false | false | false | 0 |
parse_date_words(std::istream& in, std::string& word,
datetime_t * begin, datetime_t * end)
{
std::string type;
bool mon_spec = false;
char buf[32];
if (word == "this" || word == "last" || word == "next") {
type = word;
if (! in.eof())
read_lower_word(in, word);
else
word = "m... | false | false | false | false | false | 0 |
ct_update_contrails(ship *shipp)
{
// if trails aren't enabled, return
if (!ct_display_contrails()) {
return;
}
vec3d v1;
int idx;
ship_info *sip;
object *objp;
// get object and ship info
Assert(shipp != NULL);
Assert(shipp->objnum >= 0);
Assert(shipp->ship_info_index >= 0);
objp = &Objects[shipp->objn... | false | false | false | false | false | 0 |
da_cat_get_fullname(Category *cat)
{
Category *parent;
if( cat->parent == 0)
return g_strdup(cat->name);
else
{
parent = da_cat_get(cat->parent);
if( parent )
{
return g_strdup_printf("%s:%s", parent->name, cat->name);
}
}
return NULL;
} | false | false | false | false | false | 0 |
test_network_remotes__add(void)
{
git_remote_free(_remote);
cl_git_pass(git_remote_add(&_remote, _repo, "addtest", "http://github.com/libgit2/libgit2"));
git_remote_free(_remote);
cl_git_pass(git_remote_load(&_remote, _repo, "addtest"));
_refspec = git_remote_fetchspec(_remote);
cl_assert(!strcmp(git_refspec_src... | false | false | false | false | false | 0 |
lookup_creator_os(const char *name)
{
static const char *const creators[] =
{"linux", "hurd", "2", "freebsd", NULL};
char *endptr;
int i;
// numerical value ?
i = strtol(name, &endptr, 0);
if(name[0] && *endptr == '\0')
return i;
// symbolic name ?
for(i=0; creators[i]; i++)
if(strcasecmp(creators... | false | false | false | false | false | 0 |
search_bar_find (ESearchBar *search_bar,
gboolean search_forward)
{
EWebView *web_view;
GtkWidget *widget;
gboolean case_sensitive;
gboolean wrapped = FALSE;
gboolean success;
gchar *text;
guint matches;
web_view = e_search_bar_get_web_view (search_bar);
case_sensitive = e_search_bar_get_case... | false | false | false | false | false | 0 |
brasero_layout_item_set_active (BraseroLayout *layout,
BraseroLayoutItem *item)
{
GtkTreeModel *model;
GtkTreeIter iter;
model = gtk_combo_box_get_model (GTK_COMBO_BOX (layout->priv->combo));
if (!gtk_tree_model_get_iter_first (model, &iter))
return;
do {
BraseroLayoutItem *tree_item;
gtk_tree_model_g... | false | false | false | false | false | 0 |
contacts_menu_button_real_button_press_event (GtkWidget* base, GdkEventButton* event) {
ContactsMenuButton * self;
gboolean result = FALSE;
GtkWidget* ewidget = NULL;
GtkWidget* _tmp0_ = NULL;
GtkWidget* _tmp1_ = NULL;
gboolean _tmp2_ = FALSE;
GtkWidget* _tmp3_ = NULL;
gboolean _tmp5_ = FALSE;
GtkMenu* _tmp6_ ... | false | false | false | false | false | 0 |
ion_heap_shrink_scan(struct shrinker *shrinker,
struct shrink_control *sc)
{
struct ion_heap *heap = container_of(shrinker, struct ion_heap,
shrinker);
int freed = 0;
int to_scan = sc->nr_to_scan;
if (to_scan == 0)
return 0;
/*
* shrink the free list first, no point in zeroing the memory if w... | false | false | false | false | false | 0 |
Scale(const gdImagePtr src, const unsigned int src_width, const unsigned int src_height, const gdImagePtr dst, const unsigned int new_width, const unsigned int new_height)
{
gdImagePtr tmp_im;
tmp_im = gdImageCreateTrueColor(new_width, src_height);
if (tmp_im == NULL) {
return NULL;
}
_gdScaleHoriz(src, src_wid... | false | false | false | false | false | 0 |
getSymbolAddressInProcess(const std::string &Name) {
// This implementation assumes that the host program is the target.
// Clients generating code for a remote target should implement their own
// memory manager.
#if defined(__linux__) && defined(__GLIBC__)
//===------------------------------------------------... | false | false | false | false | false | 0 |
unity_internal_utils_async_once_leave (UnityInternalUtilsAsyncOnce* self, gconstpointer _result_) {
UnityInternalUtilsAsyncOnceOperationState _tmp0_ = 0;
gconstpointer _tmp1_ = NULL;
gpointer _tmp2_ = NULL;
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->state;
if (_tmp0_ != UNITY_INTERNAL_UTILS_ASYNC_ONCE_... | false | false | false | false | false | 0 |
da_get_lex(darts_t *da, long index, da_lex_t *lex_data, int *key_len)
{
int num, i;
char *base = (char *)lex_map(da) + index;
*key_len = ((short *)base)[0];
num = ((short *)base)[1];
base += sizeof(short) * 2;
for (i = 0; i < num; i++) {
memcpy((void*)(lex_data + i),
(void*)base, size... | false | false | false | false | false | 0 |
message_read_nstring(struct protstream *strm, char **str, int copy)
{
static struct buf buf = BUF_INITIALIZER;
int c;
c = getnstring(strm, NULL, &buf);
if (str) {
if (!strcmp(buf.s, "NIL")) *str = NULL;
else if (copy) *str = xstrdup(buf.s);
else *str = buf.s;
}
return c;
} | false | false | false | false | false | 0 |
soc_compr_pointer(struct snd_compr_stream *cstream,
struct snd_compr_tstamp *tstamp)
{
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_soc_platform *platform = rtd->platform;
mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
if (platform->driver->compr_ops && platform->driver->compr_op... | false | false | false | false | false | 0 |
clutter_gst_player_set_seek_flags_impl (ClutterGstPlayer *player,
ClutterGstSeekFlags flags)
{
ClutterGstPlayerPrivate *priv;
priv = PLAYER_GET_PRIVATE (player);
if (flags == CLUTTER_GST_SEEK_FLAG_NONE)
priv->seek_flags = GST_SEEK_FLAG_KEY_UNIT;
else if (flags &... | false | false | false | false | false | 0 |
rc_setup_context_seq(regcomp_ctx *ctx, ScmObj seq)
{
ScmObj sp, sp2, obj, head = SCM_NIL, tail = SCM_NIL;
SCM_FOR_EACH(sp, seq) {
obj = rc_setup_context(ctx, SCM_CAR(sp));
if (!SCM_EQ(obj, SCM_CAR(sp))) break;
}
if (SCM_NULLP(sp)) return seq;
/* we need to copy the spine */
SCM_F... | false | false | false | false | false | 0 |
delete_nested_acc_block_for_blocks(Block *head, int acc_id)
{
Block *bpt;
for (bpt = head; bpt != NULL; bpt = bpt->next) {
if (block_is_accelerator_task(bpt, acc_id)
&& (is_inner_of_acc_block(bpt)
|| module_is_called_from_acc_block(bpt->module))) {
#ifdef DEBUG_HETERO_HMDF
... | false | false | false | false | false | 0 |
isert_snd_completion(struct iser_tx_desc *tx_desc,
struct isert_conn *isert_conn)
{
struct ib_device *ib_dev = isert_conn->cm_id->device;
struct isert_cmd *isert_cmd = tx_desc->isert_cmd;
struct isert_rdma_wr *wr;
if (!isert_cmd) {
isert_unmap_tx_desc(tx_desc, ib_dev);
return;
}
wr = &isert_cmd->rdma... | false | false | false | false | false | 0 |
RemoveTypes(DropStmt *drop)
{
ObjectAddresses *objects;
ListCell *cell;
/*
* First we identify all the types, then we delete them in a single
* performMultipleDeletions() call. This is to avoid unwanted DROP
* RESTRICT errors if one of the types depends on another.
*/
objects = new_object_addresses();
... | false | false | false | false | false | 0 |
update_item(int tag, int loc, char *name, int weight, int face, int flags,
int anim, int animspeed, uint32 nrof, int type) {
item *ip = locate_item(tag), *env = locate_item(loc);
/* Need to do some special handling if this is the player that is
* being updated.
*/
if (player->tag... | false | false | false | false | false | 0 |
add_affiliate(GHashTable *hash, jid userid, xmlnode details)
{
xmlnode old;
xmlnode store;
xmlnode node;
char ujid[2048];
if(userid == NULL)
{
return -1;
}
snprintf(ujid, sizeof(ujid), "%s@%s", userid->user, userid->server);
old = g_hash_table_lookup(hash, ujid);
/* User not previously regist... | true | true | false | false | false | 1 |
ex_copy(nodeType *p2, nodeType *p1)
{
long ngp, ngp1, ngp2, i;
long nlev;
if ( cdoVerbose )
printf("\tcopy %s\n", p1->u.var.nm);
ngp1 = gridInqSize(p1->gridID);
ngp2 = gridInqSize(p2->gridID);
if ( ngp1 != ngp2 )
cdoAbort("Number of grid points differ. ngp1 = %d, ngp2 = %d", ngp1, ngp2);
ngp =... | false | false | false | false | false | 0 |
setupScanTable()
{
s_initialized = true;
for (int i=0; i<128; ++i) {
switch (i) {
case '\n':
s_scan_table[i] = &MILexer::scanNewline;
break;
case '"':
s_scan_table[i] = &MILexer::scanStringLiteral;
break;
default:
if ... | false | false | false | false | false | 0 |
dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings)
{
unsigned long flags;
unsigned short usDspBaseIO = pSettings->usDspBaseIO;
DSP_BOOT_DOMAIN rBootDomain;
DSP_HBRIDGE_CONTROL rHBridgeControl;
PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Run entry\n");
/* Transition the core to a running state */
rBootDomain.Rese... | false | false | false | false | false | 0 |
uvd_v4_2_ring_test_ib(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
struct fence *fence = NULL;
int r;
r = amdgpu_asic_set_uvd_clocks(adev, 53300, 40000);
if (r) {
DRM_ERROR("amdgpu: failed to raise UVD clocks (%d).\n", r);
return r;
}
r = amdgpu_uvd_get_create_msg(ring, 1, NULL);
i... | false | false | false | false | false | 0 |
elem_write_route(selem_none_t *s, int dir, selem_ctl_type_t type)
{
snd_ctl_elem_value_t *ctl;
unsigned int idx;
int err;
selem_ctl_t *c = &s->ctls[type];
snd_ctl_elem_value_alloca(&ctl);
if ((err = snd_hctl_elem_read(c->elem, ctl)) < 0)
return err;
for (idx = 0; idx < c->values * c->values; idx++)
snd_ctl_e... | false | false | false | false | false | 0 |
glade_property_class_make_string_from_flags (GladePropertyClass * klass,
guint fvals, gboolean displayables)
{
GFlagsClass *fclass;
GFlagsValue *fvalue;
GString *string;
gchar *retval;
g_return_val_if_fail ((fclass =
g_type_class_ref (klas... | false | false | false | false | false | 0 |
symbol_db_util_get_file_db_path (SymbolDBEngine *dbe, const gchar* full_local_file_path)
{
SymbolDBEnginePriv *priv;
g_return_val_if_fail (dbe != NULL, NULL);
g_return_val_if_fail (full_local_file_path != NULL, NULL);
priv = dbe->priv;
g_return_val_if_fail (priv->project_directory != NULL, NULL);
if (priv->d... | false | false | false | false | false | 0 |
thumb_expand_movmemqi (rtx *operands)
{
rtx out = copy_to_mode_reg (SImode, XEXP (operands[0], 0));
rtx in = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
HOST_WIDE_INT len = INTVAL (operands[2]);
HOST_WIDE_INT offset = 0;
while (len >= 12)
{
emit_insn (gen_movmem12b (out, in, out, in));
... | false | false | false | false | false | 0 |
CreateLocalDir(const wxString &local_file)
{
wxString file;
CLocalPath local_path(local_file, &file);
if (local_path.empty() || !local_path.HasParent())
return;
// Only go back as far as needed. On comparison, wxWidgets'
// wxFileName::Mkdir always starts at the root.
std::list<wxString> segments;
while (!loc... | false | false | false | false | false | 0 |
EnableMenu(bool enable)
{
#if wxUSE_TOOLTIPS
wxString tip(_("(Use context menu to change format.)"));
if (enable)
SetToolTip(tip);
else {
wxToolTip *tt = GetToolTip();
if (tt && tt->GetTip() == tip)
SetToolTip(NULL);
}
#endif
mMenuEnabled = enable;
mButtonWidth = enable ? 9 ... | false | false | false | false | false | 0 |
prevent_capture_one_move(int *moves, int str1)
{
int r, res = 0;
int liberties, libs[MAXLIBS];
int adj, adjs[MAXCHAIN];
liberties = findlib(str1, MAXLIBS, libs);
if (liberties == 1) {
add_array(moves, libs[0]);
res = WIN;
adj = chainlinks2(str1, adjs, 1);
for (r = 0; r < adj; r++) {
f... | false | false | false | false | false | 0 |
alx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{
struct alx_priv *alx = netdev_priv(netdev);
struct alx_hw *hw = &alx->hw;
ecmd->supported = SUPPORTED_Autoneg |
SUPPORTED_TP |
SUPPORTED_Pause |
SUPPORTED_Asym_Pause;
if (alx_hw_giga(hw))
ecmd->supported |= SUPPORTED_1000baseT... | false | false | false | false | false | 0 |
include_blocks(Block *layer_block,
IntSet block_set,
int type)
{
Block *bpt, *head, *tail, *prev, *next, *new;
int no = min_IntSet(block_set);
head = cutoff_inner_block_by_no(layer_block, no);
prev = head->prev;
head->prev = NULL;
head->next = NULL;
tail = hea... | false | false | false | false | false | 0 |
send_conf(struct gigaset_capi_ctr *iif,
struct gigaset_capi_appl *ap,
struct sk_buff *skb,
u16 info)
{
struct cardstate *cs = iif->ctr.driverdata;
/*
* _CONF replies always only have NCCI and Info parameters
* so they'll fit into the _REQ message skb
*/
capi_cmsg_answer(&iif->acmsg);
... | false | false | false | false | false | 0 |
matchhash(int value, int_hash *hash_table)
{
if (hash_table) {
while (hash_table->desc) {
if (hash_table->value==value) return hash_table->desc;
hash_table++;
}
}
return NULL;
} | false | false | false | false | false | 0 |
tiny_aux (int stop, mpfr_exp_t e)
{
mpfr_t x, y, z;
int r, s, spm, inex, err = 0;
int expected_dir[2][5] = { { 1, -1, 1, -1, 1 }, { 1, 1, 1, -1, -1 } };
mpfr_exp_t saved_emax;
saved_emax = mpfr_get_emax ();
mpfr_init2 (x, 32);
mpfr_inits2 (8, y, z, (mpfr_ptr) 0);
mpfr_set_ui_2exp (x, 1, e, MPFR_RNDN)... | false | false | false | false | false | 0 |
netsnmp_ds_shutdown(void)
{
netsnmp_ds_read_config *drsp;
int i, j;
for (drsp = netsnmp_ds_configs; drsp; drsp = netsnmp_ds_configs) {
netsnmp_ds_configs = drsp->next;
if (drsp->ftype && drsp->token) {
unregister_config_handler(drsp->ftype, drsp->token);
}
... | false | false | false | false | false | 0 |
trx_rollback_active(
/*================*/
trx_t* trx) /*!< in/out: transaction */
{
mem_heap_t* heap;
que_fork_t* fork;
que_thr_t* thr;
roll_node_t* roll_node;
dict_table_t* table;
ib_int64_t rows_to_undo;
const char* unit = "";
ibool dictionary_locked = FALSE;
heap = mem_heap_create(512);
fork = que_for... | false | false | false | false | false | 0 |
tcpsock(const char * ip, unsigned short port) {
static const int one = 1;
struct sockaddr_in host;
struct hostent * hostent;
if(!ip || !port)
return 0;
if(-1 == (stcpsck = socket(AF_INET, SOCK_STREAM, PF_UNSPEC))) {
fputs("Failed to create socket.\n", stderr);
return 0;
}
if(!(hostent = gethostbyname(ip... | false | false | false | false | false | 0 |
createMenu()
{
copyAction_ = new QAction( tr("&Copy"), this );
// No text as this action title depends on the type of selection
connect( copyAction_, SIGNAL(triggered()), this, SLOT(copy()) );
// For '#' and '*', shortcuts doesn't seem to work but
// at least it displays them in the menu, we manual... | false | false | false | false | false | 0 |
main(int argc, char **argv){
DBFHandle dbf_file = NULL;
int width, decimals, i, r;
char title[12];
char fmt[12];
// Check that there is one argument, the input filename
if (argc!=2) {
fprintf(stderr, "Usage: dbf2tsv dbf-file\n");
return EXIT_FAILURE;
}
// Open the DBF file.
... | false | false | false | false | false | 0 |
float_bus(double dcycs)
{
word32 val;
int lines_since_vbl;
int line, eff_line, line24;
int all_stat;
int byte_offset;
int hires, page2;
int addr;
lines_since_vbl = get_lines_since_vbl(dcycs);
/* For floating bus, model hires style: Visible lines 0-191 are simply the */
/* data being displayed at that time. L... | false | false | false | false | false | 0 |
full_read_ssl(SSL * ssl, unsigned char *buf, int min, int len)
{
int total;
int thistime;
for (total = 0; total < min;) {
thistime = ssl_timeout_read(ssl, buf + total, len - total);
if (thistime < 0) {
if (total >= min) {
/* error, but we read *some*. return what we've read
* so far and next ... | false | false | false | false | false | 0 |
onWallPostClicked()
{
if (this->controller() && this->controller()->viewport() && d->mPostDialog) {
this->controller()->viewport()->addWidgetToView(d->mPostDialog);
d->mPostDialog->setPos(this->mapToScene(d->mWallPostButton->pos()));
}
} | false | false | false | false | false | 0 |
x_queue_push_head (x_queue_t *queue, void *data)
{
x_return_if_fail (queue);
queue->head = x_list_prepend (queue->head, data);
if (!queue->tail)
queue->tail = queue->head;
queue->length++;
} | false | false | false | false | false | 0 |
zScoreCoding (const zFeatureFactory* fac, zSfeature *e) {
int frame = 0;
int length;
score_t coding_score;
/* convert exon frame to cds[frame] - I know, it looks weird */
/* plus, the funky precomputation encoding scheme is undocumented */
switch (e->frame) {
case 0: frame = 2; break;
case 1: frame = ... | false | false | false | false | false | 0 |
fluid_iir_filter_apply(fluid_iir_filter_t* iir_filter,
fluid_real_t *dsp_buf, int count)
{
/* IIR filter sample history */
fluid_real_t dsp_hist1 = iir_filter->hist1;
fluid_real_t dsp_hist2 = iir_filter->hist2;
/* IIR filter coefficients */
fluid_real_t dsp_a1 = iir_filter->a1;
fluid_real_... | false | false | false | false | false | 0 |
stack_authorizer(
void *pTop,
int type,
const char *zArg1,
const char *zArg2,
const char *zArg3,
const char *zArg4
){
int code = SQLITE_OK;
int nTop;
for(nTop = (int)pTop; nTop>=0; nTop--){
int rc = pAuthStack[nTop](NULL,type,zArg1,zArg2,zArg3,zArg4);
/*
** We run through the authorizers o... | false | false | false | false | false | 0 |
output1hold (int f, char *s, ...)
{ static char text [1024];
unsigned long si;
va_list v;
if (f==0) text[0]=0;
text_mode();
va_start(v,s);
vsprintf(text+strlen(text),s,v);
if (f<=0) return;
si=strlen(text);
if (si<f)
{ memmove(text+(f-si),text,si+1);
memset(text,' ',f-si);
}
if (outputbuffer)
{ output(te... | false | false | false | false | false | 0 |
parse(int argc, char* argv[]) {
if (char* a = argument(argc,argv)) {
for (Value* v = fst; v != NULL; v = v->next)
if (!strcmp(a,v->opt)) {
cur = v->val;
return 2;
}
std::cerr << "Wrong argument \"" << a
<< "\" for option \"" << opt << "... | false | false | false | false | false | 0 |
lkdtm_module_init(void)
{
int ret = -EINVAL;
int n_debugfs_entries = 1; /* Assume only the direct entry */
int i;
/* Register debugfs interface */
lkdtm_debugfs_root = debugfs_create_dir("provoke-crash", NULL);
if (!lkdtm_debugfs_root) {
pr_err("creating root dir failed\n");
return -ENODEV;
}
#ifdef CONFIG... | false | false | false | false | false | 0 |
extras_hide()
{
ListEntry *entry = game->extras->head->next;
Extra *ex;
while ( entry != game->extras->tail ) {
ex = entry->item;
entry = entry->next;
stk_surface_blit( offscreen,
(int)ex->x, (int)ex->y,
BRICK_WIDTH + shadow_size, BRICK_HEIGHT + shadow... | false | false | false | false | false | 0 |
fn_strends(fs_query *q, fs_value arg1, fs_value arg2)
{
if (!fs_is_plain_or_string(arg1) || !fs_is_plain_or_string(arg2)) {
return fs_value_error(FS_ERROR_INVALID_TYPE, NULL);
}
arg1 = fs_value_fill_lexical(q, arg1);
arg2 = fs_value_fill_lexical(q, arg2);
const int a1l = strlen(arg1.lex);
... | false | false | false | false | false | 0 |
completion_get(command_ty *)
{
string_ty *project_name;
project_ty *pp;
int incomplete_user_name;
complete_ty *result;
incomplete_user_name = 0;
project_name = 0;
arglex2_retable(0);
arglex();
while (arglex_token != arglex_token_eoln)
{
switch (arglex... | false | false | false | false | false | 0 |
gst_mpdparser_get_segment_base (GstPeriodNode * Period,
GstAdaptationSetNode * AdaptationSet,
GstRepresentationNode * Representation)
{
GstSegmentBaseType *SegmentBase = NULL;
if (Representation && Representation->SegmentBase
&& Representation->SegmentBase->Initialization) {
SegmentBase = Represe... | false | false | false | false | false | 0 |
e_alert_load_tables (void)
{
GDir *dir;
const gchar *d;
gchar *base;
struct _e_alert_table *table;
gint i;
if (alert_table != NULL)
return;
alert_table = g_hash_table_new (g_str_hash, g_str_equal);
/* setup system alert types */
table = g_malloc0 (sizeof (*table));
table->domain = "builtin";
table->aler... | false | false | false | false | false | 0 |
amdgpu_mode_dumb_create(struct drm_file *file_priv,
struct drm_device *dev,
struct drm_mode_create_dumb *args)
{
struct amdgpu_device *adev = dev->dev_private;
struct drm_gem_object *gobj;
uint32_t handle;
int r;
args->pitch = amdgpu_align_pitch(adev, args->width, args->bpp, 0) * ((args->bpp + 1) / ... | false | false | false | false | false | 0 |
clocks_timer_main_panel_count (ClocksTimerMainPanel* self) {
gboolean result = FALSE;
gdouble e = 0.0;
GTimer* _tmp0_ = NULL;
gdouble _tmp1_ = 0.0;
gdouble _tmp2_ = 0.0;
gdouble _tmp3_ = 0.0;
gdouble _tmp5_ = 0.0;
g_return_val_if_fail (self != NULL, FALSE);
_tmp0_ = self->priv->timer;
_tmp1_ = g_timer_elapsed... | false | false | false | false | false | 0 |
fopen_wrapper_test()
{
try
{
std::cout << "before fopen" << std::endl;
FILE* f = QUtil::safe_fopen("/this/file/does/not/exist", "r");
std::cout << "after fopen" << std::endl;
(void) fclose(f);
}
catch (std::runtime_error& s)
{
std::cout << "exception: " << s.what() << std::endl;
}
} | false | false | false | false | false | 0 |
RememberAtariMouseCursorPosition()
{
if (getARADATA()->isAtariMouseDriver()) {
atari_mouse_xpos = getARADATA()->getAtariMouseX();
atari_mouse_ypos = getARADATA()->getAtariMouseY();
D(bug("Atari mouse cursor pointer left at [%d, %d]", atari_mouse_xpos, atari_mouse_ypos));
}
} | false | false | false | false | false | 0 |
e2_toolbar_toggle_button_get_state (gchar *action_name)
{
gchar *hashkey = g_strconcat (action_name, ".", action_name, NULL);
E2_ToggleData *data = g_hash_table_lookup (toggles_hash, hashkey);
g_free (hashkey);
return ((data != NULL) ? data->current_state : FALSE);
} | false | false | false | false | false | 0 |
style_sheet_texinfo_print_signature (FILE * stream,
struct style_sheet * sheet)
{
fprintf (stream,
"@deftp {Style Sheet} {%s} (@file{%s.ssh})\n",
sheet->name, sheet->key);
/* Report details (version numbers, ancestors...) only if
* verbose mode for sheets */
if (!IS_EMPTY(sheet->author)
... | false | false | false | false | false | 0 |
h_strjoinv(const char *separator, char **str_array)
{
const char *sep = separator;
char *result;
g_assert(str_array != NULL);
if (NULL == sep)
sep = "";
if (str_array[0] != NULL) {
size_t seplen = strlen(sep);
size_t i, len, pos;
len = size_saturate_add(1, strlen(str_array[0]));
for (i = 1; str_array... | false | false | false | false | false | 0 |
EncodeItemSectionOfThisLevel(struct auto_string *shipstr, level *Lev)
{
int i;
autostr_append(shipstr, "%s\n", ITEMS_SECTION_BEGIN_STRING);
// Now we write out the bulk of items infos
//
for (i = 0; i < MAX_ITEMS_PER_LEVEL; i++) {
if (Lev->ItemList[i].type == (-1))
continue;
WriteOutOneItem(shipstr, &(Le... | false | false | false | false | false | 0 |
GetInventoryItemAt(int x, int y)
{
int i;
int item_width;
int item_height;
for (i = 0; i < MAX_ITEMS_IN_INVENTORY - 1; i++) {
if (Me.Inventory[i].type == (-1))
continue;
for (item_height = 0; item_height < ItemMap[Me.Inventory[i].type].inv_size.y; item_height++) {
for (item_width = 0; item_width < ItemM... | false | false | false | false | false | 0 |
sample_2d_linear(struct gl_context *ctx,
const struct gl_sampler_object *samp,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
GLfloat rgba[])
{
const struct swrast_texture_image *swImg = swrast_texture_image_const(img);
const GLin... | false | false | false | false | false | 0 |
read(ByteStream & str_in)
{
DEBUG_MSG("DjVmDoc::read(): reading the BUNDLED doc contents from the stream\n");
DEBUG_MAKE_INDENT(3);
GP<DataPool> pool=DataPool::create();
char buffer[1024];
int length;
while((length=str_in.read(buffer, 1024)))
pool->add_data(buffer, length);
pool->set_eof();
... | false | false | false | false | false | 0 |
contacts_held_handles (TpConnection *connection,
TpHandleType handle_type,
guint n_handles,
const TpHandle *handles,
const GError *error,
gpointer user_data,
GObject *weak_object)
{
... | false | false | false | false | false | 0 |
PrintCPU(
lListElem *ep,
lListElem *jat,
lList *eleml,
int nm
) {
String str;
lListElem *up = NULL;
char buf[1024];
u_long32 running;
DENTER(GUI_LAYER, "PrintCPU");
if (job_is_zombie_job(ep)) {
str = XtNewString("NA");
} else {
if (eleml && !jat) {
lListElem *first_elem =... | 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.