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 |
|---|---|---|---|---|---|---|
iscsi_scsi_cmd_rx_start(struct iscsi_connection *conn)
{
struct iscsi_cmd *req = (struct iscsi_cmd *) &conn->req.bhs;
struct iscsi_task *task;
int ahs_len, imm_len, data_len, ext_len;
ahs_len = req->hlength * 4;
imm_len = roundup(ntoh24(req->dlength), conn->tp->data_padding);
data_len = roundup(ntohl(req->data_l... | false | false | false | false | false | 0 |
Copy_RegularExpression_Type(const void *argp)
{
#if (HAVE_REGEX_H_FUNCS | HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS)
const RegExp_Arg *ap = (const RegExp_Arg *)argp;
const RegExp_Arg *result = (const RegExp_Arg *)0;
if (ap)
{
*(ap->refCount) += 1;
result = ap;
}
return (void *)result;
#els... | false | false | false | false | false | 0 |
CollectActions(XMLNode actions,std::list<std::string>& actions_list) {
for(int n = 0;;++n) {
XMLNode action = actions.Child(n);
if(!action) break;
actions_list.push_back(action.Name());
};
} | false | false | false | false | false | 0 |
fl_utf8len1(char c)
{
if (!(c & 0x80)) return 1;
if (c & 0x40) {
if (c & 0x20) {
if (c & 0x10) {
if (c & 0x08) {
if (c & 0x04) {
return 6;
}
return 5;
}
return 4;
}
return 3;
}
return 2;
}
return 1;
} | false | false | false | false | false | 0 |
freeuser(struct userrec *u)
{
struct user_entry *ue, *ut;
struct chanuserrec *ch, *z;
if (u == NULL)
return;
ch = u->chanrec;
while (ch) {
z = ch;
ch = ch->next;
if (z->info != NULL)
nfree(z->info);
nfree(z);
}
u->chanrec = NULL;
for (ue = u->entries; ue; ue = ut) {
ut = ... | false | false | false | false | false | 0 |
gf_scene_restart_dynamic(GF_Scene *scene, u64 from_time)
{
u32 i;
GF_Clock *ck;
GF_List *to_restart;
GF_ObjectManager *odm;
GF_LOG(GF_LOG_INFO, GF_LOG_MEDIA, ("[Scene] Restarting from "LLD"\n", LLD_CAST from_time));
ck = scene->dyn_ck;
if (scene->scene_codec) ck = scene->scene_codec->ck;
if (!ck) return;
to... | false | false | false | false | false | 0 |
change_chainsetup_position(double seconds)
{
// --------
DBC_REQUIRE(is_selected());
// --------
// FIXME: check whether all audio devices support seeking,
// raise an error if not (note: see other similar FIXMEs)
if (connected_chainsetup() == selected_chainsetup() && is_engine_ready_for_commands(... | false | false | false | false | false | 0 |
_e_toolbar_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Down *ev;
E_Toolbar *tbar;
E_Menu *mn;
E_Zone *zone;
int x, y;
ev = event_info;
tbar = data;
if (ev->button != 3) return;
mn = e_menu_new();
e_menu_post_deactivate... | false | false | false | false | false | 0 |
gitg_command_set_arguments (GitgCommand *command,
...)
{
va_list ap;
gchar **arguments;
g_return_if_fail (GITG_IS_COMMAND (command));
va_start (ap, command);
arguments = collect_arguments (ap);
va_end (ap);
gitg_command_set_argumentsv (command, CONST_CONST (arguments));
g_strfree... | false | false | false | false | false | 0 |
ui_drawchoicemenu(uih_context * uih, void *data)
{
struct ui_choicedata *choice = (struct ui_choicedata *) data;
int i;
for (i = 0; i < choice->n; i++) {
xprint(uih->image, uih->font, choice->x + BORDERWIDTH,
choice->y + BORDERHEIGHT + i * xtextheight(uih->image, uih->font),
choice->texts[i... | false | false | false | false | false | 0 |
foldMaskAndShiftToExtract(SelectionDAG &DAG, SDValue N,
uint64_t Mask,
SDValue Shift, SDValue X,
X86ISelAddressMode &AM) {
if (Shift.getOpcode() != ISD::SRL ||
!isa<ConstantSDNode>(Shift.getOperand(... | false | false | false | false | false | 0 |
SendTo(const void *pv, size_t cb, const SocketAddress& addr) {
if (SOCK_DGRAM == type_) {
return SendUdp(pv, cb, addr);
} else {
if (CS_CONNECTED != state_) {
error_ = ENOTCONN;
return -1;
}
return SendTcp(pv, cb);
}
} | false | false | false | false | false | 0 |
gg_svg_insert_gradient_stop (struct gg_svg_gradient *gradient,
double offset, double red, double green,
double blue, double opacity)
{
/* inserting a Stop into a Gradient */
struct gg_svg_gradient_stop *stop =
gg_svg_alloc_gradient_stop (offset, red, green, blue, opacity);
if (gradient->first_s... | false | false | false | false | false | 0 |
CollectPositions(Code* code,
List<int>* code_positions,
List<int>* source_positions) {
AssertNoAllocation no_allocation;
int position = 0;
// Because the ICs we use for global variables access in the full
// code generator do no... | false | false | false | false | false | 0 |
setMuted( bool mute )
{
m_muted = mute;
setToolTip( m_muted ? i18n( "Muted" ) : i18n( "Volume: %1%", value() ) );
update();
} | false | false | false | false | false | 0 |
push()
{
if (getFlags()["no-save-model"].getBool() && d_modelStackPushed) {
d_modelStackPushed = false;
pop();
} else if (d_dump) {
d_translator->dump(d_em->newLeafExpr(PUSH), true);
}
d_se->push();
d_stackLevel->set(stackLevel()+1);
} | false | false | false | false | false | 0 |
nm_manager_get_ipw_rfkill_state (NMManager *self)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
GSList *iter;
RfKillState ipw_state = RFKILL_UNBLOCKED;
for (iter = priv->devices; iter; iter = g_slist_next (iter)) {
NMDevice *candidate = NM_DEVICE (iter->data);
RfKillState candidate_state;
if (nm... | false | false | false | false | false | 0 |
param_set_event_clearing(const char *val, struct kernel_param *kp)
{
int result = 0;
if (!strncmp(val, "status", sizeof("status") - 1)) {
ec_event_clearing = ACPI_EC_EVT_TIMING_STATUS;
pr_info("Assuming SCI_EVT clearing on EC_SC accesses\n");
} else if (!strncmp(val, "query", sizeof("query") - 1)) {
ec_event_... | false | false | false | false | false | 0 |
IssueAlways(const string& text)
{
++issueCount[text];
LOG_ERR_SAFE("WARNING ALWAYS: " << text << endl);
} | false | false | false | false | false | 0 |
print_pad_info (GstElement * element)
{
const GList *pads;
GstPad *pad;
n_print ("\n");
n_print ("Pads:\n");
if (!element->numpads) {
n_print (" none\n");
return;
}
pads = element->pads;
while (pads) {
gchar *name;
pad = GST_PAD (pads->data);
pads = g_list_next (pads);
n_pr... | false | false | false | false | false | 0 |
vcc_mk_expr(enum var_type fmt, const char *str, ...)
{
va_list ap;
struct expr *e;
e = vcc_new_expr();
e->fmt = fmt;
va_start(ap, str);
VSB_vprintf(e->vsb, str, ap);
va_end(ap);
AZ(VSB_finish(e->vsb));
return (e);
} | false | false | false | false | false | 0 |
Free(void* p)
{
b2Assert(m_entryCount > 0);
b2StackEntry* entry = m_entries + m_entryCount - 1;
b2Assert(p == entry->data);
if (entry->usedMalloc)
{
b2Free(p);
}
else
{
m_index -= entry->size;
}
m_allocation -= entry->size;
--m_entryCount;
p = NULL;
} | false | false | false | false | false | 0 |
bm_insert(bmp,QQ,qsign,AA,aux)
BMDATA *bmp;
word2 *QQ, *AA, *aux;
int qsign;
{
word2 *Q, *A, *vect, *prime;
word2 r;
unsigned p;
int qn, i, v, alen, baslen;
size_t bmrk;
bmrk = bmp->rank;
Q = bmp->Qarr + bmrk*(bmp->qinc);
qn = Q[-1] = QQ[-1];
cpyarr(QQ,qn,Q);
cpyarr(QQ,qn,aux);
... | false | false | false | false | false | 0 |
gl_mini_preview_finalize (GObject *object)
{
glMiniPreview *this = GL_MINI_PREVIEW (object);
gl_debug (DEBUG_MINI_PREVIEW, "START");
g_return_if_fail (object != NULL);
g_return_if_fail (GL_IS_MINI_PREVIEW (object));
if (this->priv->label)
{
g_object_unr... | false | false | false | false | false | 0 |
flow_loop_nodes_find (basic_block header, struct loop *loop)
{
vec<basic_block> stack = vNULL;
int num_nodes = 1;
edge latch;
edge_iterator latch_ei;
header->loop_father = loop;
FOR_EACH_EDGE (latch, latch_ei, loop->header->preds)
{
if (latch->src->loop_father == loop
|| !dominated_by_p (CDI_... | false | false | false | false | false | 0 |
si470x_get_register(struct si470x_device *radio, int regnr)
{
int retval;
radio->usb_buf[0] = REGISTER_REPORT(regnr);
retval = si470x_get_report(radio, radio->usb_buf, REGISTER_REPORT_SIZE);
if (retval >= 0)
radio->registers[regnr] = get_unaligned_be16(&radio->usb_buf[1]);
return (retval < 0) ? -EINVAL : 0;
... | false | false | false | false | false | 0 |
getttynam(tty)
const char *tty;
{
struct ttyent *t;
setttyent();
while ((t = getttyent()))
if (!strcmp(tty, t->ty_name))
break;
endttyent();
return (t);
} | false | false | false | false | false | 0 |
ak4104_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int format)
{
struct snd_soc_codec *codec = codec_dai->codec;
struct ak4104_private *ak4104 = snd_soc_codec_get_drvdata(codec);
int val = 0;
int ret;
/* set DAI format */
switch (format & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_RIGHT_... | false | false | false | false | false | 0 |
sample_text(struct pine *ps, struct variable *v)
{
char *ret = SAMP2;
char *pvalfg, *pvalbg;
pvalfg = PVAL(v, ew);
pvalbg = PVAL(v+1, ew);
if((v && v->name &&
srchstr(v->name, "-foreground-color") &&
pvalfg && pvalfg[0] && pvalbg && pvalbg[0]) ||
(v == &ps->vars[V_VIEW_HDR_COLORS] ... | false | false | false | false | false | 0 |
parse_reflog_param(const struct option *opt, const char *arg,
int unset)
{
char *ep;
const char **base = (const char **)opt->value;
if (!arg)
arg = "";
reflog = strtoul(arg, &ep, 10);
if (*ep == ',')
*base = ep + 1;
else if (*ep)
return error("unrecognized reflog param '%s'", arg);
else
*base = ... | false | false | false | false | false | 0 |
get_items_recursive()
{
type_list_items result;
for(type_list_items::const_iterator iter = m_list_items.begin(); iter != m_list_items.end(); ++iter)
{
const sharedptr<LayoutItem> item = *iter;
sharedptr<LayoutGroup> group = sharedptr<LayoutGroup>::cast_dynamic(item);
if(group)
{
const ... | false | false | false | false | false | 0 |
DIM_ServiceIrq(struct dim_channel *const *channels)
{
bool state_changed;
if (!g.dim_is_initialized) {
dim_on_error(DIM_ERR_DRIVER_NOT_INITIALIZED,
"DIM is not initialized");
return;
}
if (!channels) {
dim_on_error(DIM_ERR_DRIVER_NOT_INITIALIZED, "Bad channels");
return;
}
/*
* Use while-loop... | false | false | false | false | false | 0 |
test_disk(ext2_filsys fs, badblocks_list *bb_list)
{
FILE *f;
errcode_t retval;
char buf[1024];
sprintf(buf, "badblocks -b %d -X %s%s%s %llu", fs->blocksize,
quiet ? "" : "-s ", (cflag > 1) ? "-w " : "",
fs->device_name, ext2fs_blocks_count(fs->super)-1);
if (verbose)
printf(_("Running command: %s\n"), bu... | true | true | false | false | true | 1 |
which_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data)
{
gchar *text = "";
GncCombott *combott = GNC_COMBOTT (user_data);
GncCombottPrivate *priv = GNC_COMBOTT_GET_PRIVATE (combott);
if(!priv->active == 0)
{
gtk_tree_model_get... | false | false | false | false | false | 0 |
mei_txe_irq_thread_handler(int irq, void *dev_id)
{
struct mei_device *dev = (struct mei_device *) dev_id;
struct mei_txe_hw *hw = to_txe_hw(dev);
struct mei_cl_cb complete_list;
s32 slots;
int rets = 0;
dev_dbg(dev->dev, "irq thread: Interrupt Registers HHISR|HISR|SEC=%02X|%04X|%02X\n",
mei_txe_br_reg_read(hw... | false | false | false | false | false | 0 |
httpd_emu(void *arg)
{
HTTPClient *client;
Octstr *ip;
Octstr *url;
List *headers;
Octstr *body;
List *cgivars;
struct httpd_emu_arg *p;
EventQueue *eq;
p = arg;
eq = p->eq;
eq_add_producer(eq);
semaphore_up(p->sema);
for (;;) {
client = http_accept_request(p->port... | false | false | false | false | false | 0 |
search_name(List * list,char * name)
{
int i,j;
j = list->get_size();
for (i = 0;i < j;i++)
if (!strcmp((char*)(list->get_item(i)),name)) break;
return (i<j)? i:-1;
} | false | false | false | false | false | 0 |
mount_op_ask_password (GVfsRemoteVolumeMonitor *object,
const gchar *arg_dbus_name,
const gchar *arg_id,
const gchar *arg_message_to_show,
const gchar *arg_default_user,
const gchar *arg_default_domain,
... | false | false | false | false | false | 0 |
VFilter( const TwoDArray<unsigned char>& pic_data, TwoDArray<unsigned char>& out_data, const OneDArray<int>& filter, const int bits )
{
const int offset = (1<<(bits-1));
int sum, j, jout;
// Do the first bit
for (j=0, jout=0; j<filter.Last(); j+=2, jout++)
{
for (int i=0; i<pic_data.Lengt... | false | false | false | false | false | 0 |
check_help(struct isl_args *args, char *arg, char *prog, void *opt,
unsigned flags)
{
if (ISL_FL_ISSET(flags, ISL_ARG_SKIP_HELP))
return;
if (strcmp(arg, "--help") == 0)
print_help_and_exit(args->args, prog, opt);
} | false | false | false | false | false | 0 |
nautilus_canvas_container_accessible_add_selection (AtkSelection *accessible,
int i)
{
GtkWidget *widget;
NautilusCanvasContainer *container;
GList *l;
GList *selection;
NautilusCanvasIcon *icon;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
if (!widget) {
return FALSE;
}
... | false | false | false | false | false | 0 |
OpenSource() {
if (error) {
_MSG("packetsource drone (" + name + ") failed to initialize "
"drone framework and open connection, check previous errors "
"for why.", MSGFLAG_PRINTERROR);
return -1;
}
if (droneframe == NULL)
droneframe = new DroneClientFrame(globalreg);
droneframe->SetPacketsource((vo... | false | false | false | false | false | 0 |
DefruleWatchPrint(
void *theEnv,
char *logName,
int code,
struct expr *argExprs)
{
if (code)
return(ConstructPrintWatchAccess(theEnv,DefruleData(theEnv)->DefruleConstruct,logName,argExprs,
EnvGetDefruleWatchActivations,EnvSetDefruleWatchActivations));
else
... | false | false | false | false | false | 0 |
sound_release(struct inode *inode, struct file *file)
{
int dev = iminor(inode);
mutex_lock(&soundcard_mutex);
switch (dev & 0x0f) {
case SND_DEV_CTL:
module_put(mixer_devs[dev >> 4]->owner);
break;
case SND_DEV_SEQ:
case SND_DEV_SEQ2:
sequencer_release(dev, file);
break;
case SND_DEV_MIDIN:
MIDIb... | false | false | false | false | false | 0 |
readline(Biobuf *bp, char *buf)
{
int c;
char *p, *e;
p = buf;
e = p + MAXLINELEN-1;
do {
c = Bgetc(bp);
if (c < 0) {
if (p == buf)
return -1;
break;
}
if (c == '\n')
break;
*p++ = c;
} while (p < e);
*p = 0;
if (c != '\n' && c >= 0) {
do c = Bgetc(bp);
while (c >= 0 && c != '\n');
... | false | false | false | false | false | 0 |
maki_dcc_send_in_write (GIOChannel* source, GIOCondition condition, gpointer data)
{
gint val;
socklen_t len = sizeof(val);
makiDCCSend* dcc = data;
if (condition & (G_IO_HUP | G_IO_ERR))
{
goto error;
}
if (getsockopt(g_io_channel_unix_get_fd(source), SOL_SOCKET, SO_ERROR, &val, &len) == -1
|| val != 0... | false | false | false | false | false | 0 |
gnc_vendor_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GncVendor *vendor;
g_return_if_fail(GNC_IS_VENDOR(object));
vendor = GNC_VENDOR(object);
switch... | false | false | false | false | false | 0 |
getExtension(const string & file)
{
string returnString;
int pos = file.rfind('.', file.size() - 1); //search for '.' from the end
if (pos == string::npos || //no '.' is string
pos == (file.size() - 1) || // '.' is at end of string
pos == file.size() ) // '.' is at beginning of ... | false | false | false | false | false | 0 |
gconf_schema_set_default_value (GConfSchema* sc, const GConfValue* val)
{
if (REAL_SCHEMA (sc)->default_value != NULL)
gconf_value_free (REAL_SCHEMA (sc)->default_value);
REAL_SCHEMA (sc)->default_value = gconf_value_copy (val);
} | false | false | false | false | false | 0 |
G_fopen_new_misc(const char *dir, const char *element, const char *name)
{
int fd;
fd = G__open_misc(dir, element, name, G_mapset(), 1);
if (fd < 0)
return (FILE *) 0;
return fdopen(fd, "w");
} | false | false | false | false | false | 0 |
pv_list_extents_free(const struct dm_list *pvh)
{
struct pv_list *pvl;
struct pe_range *per;
uint32_t extents = 0;
struct pv_segment *pvseg;
dm_list_iterate_items(pvl, pvh) {
dm_list_iterate_items(per, pvl->pe_ranges) {
dm_list_iterate_items(pvseg, &pvl->pv->segments) {
if (!pvseg_is_allocated(pvseg))
... | false | false | false | false | false | 0 |
buildEditors(Script *script, QWidget *parent)
{
ParameterDefinition::buildEditors(script, parent);
setItems(actions);
if(mAllowWait)
{
mItems.first << "wait";
mItems.second << QObject::tr("Wait");
}
mActionEdit = new CodeComboBox(parent);
mActionEdit->addItems(mItems.second);
addEditor(mActi... | false | false | false | false | false | 0 |
PyObject_HasAttr(PyObject *v, PyObject *name)
{
PyObject *res = PyObject_GetAttr(v, name);
if (res != NULL) {
Py_DECREF(res);
return 1;
}
PyErr_Clear();
return 0;
} | false | false | false | false | false | 0 |
loadLayerProperties(QDataStream& xcf_io, Layer& layer)
{
while (true) {
PropType type;
QByteArray bytes;
if (!loadProperty(xcf_io, type, bytes)) {
kDebug(399) << "XCF: error loading layer properties";
return false;
}
QDataStream property(bytes);
switch (type) {
case PROP_END:
return true;
... | false | false | false | false | false | 0 |
verify_checksum(krb5_context context,
krb5_crypto crypto,
unsigned usage, /* not krb5_key_usage */
void *data,
size_t len,
Checksum *cksum)
{
krb5_error_code ret;
struct _krb5_key_data *dkey;
int keyed_checksum;
Checksum c;
struct _krb5_checksum_type *ct;
ct = _krb5_find_checksum(cksu... | false | false | false | false | false | 0 |
GS_get_norm_at_xy(int id, float x, float y, float *nv)
{
int offset, drow, dcol, vrow, vcol;
float pt[3];
geosurf *gs;
gs = gs_get_surf(id);
if (NULL == gs) {
return (-1);
}
if (gs->norm_needupdate) {
gs_calc_normals(gs);
}
pt[X] = x;
pt[Y] = y;
gsd_real2surf(gs, pt);
... | false | false | false | false | false | 0 |
AdDisplayTables (
char *Filename,
ACPI_TABLE_HEADER *Table)
{
if (!AcpiGbl_ParseOpRoot)
{
return (AE_NOT_EXIST);
}
if (!AcpiGbl_DbOpt_verbose)
{
AdCreateTableHeader (Filename, Table);
}
AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UI... | false | false | false | false | false | 0 |
ensCacheClear(EnsPCache cache)
{
CachePNode node = NULL;
if (!cache)
return ajFalse;
/* Remove Cache Node objects from the AJAX List. */
while (ajListPop(cache->List, (void **) &node))
{
/* Remove the same Cache Node object from the AJAX Table. */
(void) ajTableRemove(cac... | false | false | false | false | false | 0 |
ath10k_wmi_tlv_event_diag_data(struct ath10k *ar,
struct sk_buff *skb)
{
const void **tb;
const struct wmi_tlv_diag_data_ev *ev;
const struct wmi_tlv_diag_item *item;
const void *data;
int ret, num_items, len;
tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
if (IS_ERR(tb)) {
ret =... | false | false | false | false | false | 0 |
TestOneTriangleVsCylinder(
const dVector3 &v0,
const dVector3 &v1,
const dVector3 &v2,
const bool bDoubleSided)
{
// calculate triangle normal
dVector3Subtract( v2 , v1 , m_vE1);
dVector3 vTemp;
dVecto... | false | false | false | false | false | 0 |
ppm_decode_init(ppm_data_t *ppm_data, int fd, unpack_data_t *unpack_data, int *EscChar)
{
int max_order, Reset, MaxMB;
max_order = rar_get_char(fd, unpack_data);
rar_dbgmsg("ppm_decode_init max_order=%d\n", max_order);
Reset = (max_order & 0x20) ? 1 : 0;
rar_dbgmsg("ppm_decode_init Reset=%d\n", Reset);
if (Rese... | false | false | false | false | false | 0 |
vlv_trim_candidates_txn(backend *be, const IDList *candidates, const sort_spec* sort_control, const struct vlv_request *vlv_request_control, IDList** trimmedCandidates,struct vlv_response *vlv_response_control, back_txn *txn)
{
IDList* resultIdl= NULL;
int return_value= LDAP_SUCCESS;
PRUint32 si= 0; /* The ... | false | false | false | false | true | 1 |
adau1977_lookup_fs(unsigned int rate)
{
if (rate >= 8000 && rate <= 12000)
return ADAU1977_SAI_CTRL0_FS_8000_12000;
else if (rate >= 16000 && rate <= 24000)
return ADAU1977_SAI_CTRL0_FS_16000_24000;
else if (rate >= 32000 && rate <= 48000)
return ADAU1977_SAI_CTRL0_FS_32000_48000;
else if (rate >= 64000 && ra... | false | false | false | false | false | 0 |
map_dec_num_2_c_column(col_type *type, int precision, int scale)
{
type -> col_size = (SQLINTEGER)precision;
type -> decimal_digits = (SQLSMALLINT)scale;
if(precision >= 0 && precision <= 4 && scale == 0) {
type->len = sizeof(SQLINTEGER);
type->c = SQL_C_SLONG;
} else if(precision >= 5 && precision <... | false | false | false | false | false | 0 |
SetPosition( short x, short y ) {
Unit::SetPosition( x, y );
UCNode *n = static_cast<UCNode *>( uc_units.Head() );
while ( n ) {
n->uc_unit->SetPosition( x, y );
n = static_cast<UCNode *>( n->Next() );
}
} | false | false | false | false | false | 0 |
mca_coll_basic_neighbor_allgatherv(void *sbuf, int scount, struct ompi_datatype_t *sdtype,
void *rbuf, int rcounts[], int disps[], struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm, mca_coll_base_module_t *module)
{
if (OMP... | false | false | false | false | false | 0 |
set_tooltips_active(int active)
{
if (!tooltip)
tooltip =
gtk_tree_view_tooltip_new_for_treeview(GTK_TREE_VIEW
(contact_list));
if (active)
gtk_tree_view_tooltip_set_tip_columns(tooltip,
MAIN_VIEW_HAS_TIP,
MAIN_VIEW_ICON, MAIN_VIEW_LABEL, MAIN_VIEW_STATUS_TIP);
else
gtk_tree_view_tooltip_set_tip_c... | false | false | false | false | false | 0 |
gl843_init_regs_for_warmup (Genesys_Device * dev,
Genesys_Register_Set * reg,
int *channels, int *total_size)
{
int num_pixels;
SANE_Status status = SANE_STATUS_GOOD;
int dpihw;
int resolution;
int factor;
DBGSTART;
if (dev == NULL || reg == NULL || channels == NULL || total_size == NULL)
... | false | true | false | false | false | 1 |
p_connect_resize_handler(GapPlayerMainGlobalParams *gpp)
{
if(gpp->docking_container)
{
/* never connect resize handler when player is docked to a foreign container */
return;
}
if(gpp->resize_handler_id < 0)
{
gpp->resize_handler_id = g_signal_connect (G_OBJECT (gpp->resize_box), "size_allocate",... | false | false | false | false | false | 0 |
putframe ( int type, uchar *buf, int len, TFILE *f, int t )
{
int err=0 ;
buf [ 0 ] = 0xff ;
buf [ 1 ] = type & MORE_FR ? 0xc0 : 0xc8 ;
buf [ 2 ] = type & 0xff ;
if ( nframes++ && ! ( type & SUB_FR ) )
ckcmd ( f, &err, "+FTH=3" , TO_FT, CONNECT ) ;
if ( ! err ) {
if ( ! buf[len+2] ) {
ms... | false | false | false | false | false | 0 |
set_pattern(cmd_parms *cmd, void *cfg, const char *line)
{
char *from = NULL;
char *to = NULL;
char *flags = NULL;
char *ourline;
char delim;
subst_pattern_t *nscript;
int is_pattern = 0;
int ignore_case = 0;
int flatten = 1;
ap_regex_t *r = NULL;
if (apr_tolower(*line) != '... | false | false | false | false | false | 0 |
nautilus_file_get_icon_pixbuf (NautilusFile *file,
int size,
gboolean force_size,
int scale,
NautilusFileIconFlags flags)
{
NautilusIconInfo *info;
GdkPixbuf *pixbuf;
info = nautilus_file_get_icon (file, size, scale, flags);
if (force_size) {
pixbuf = nautilus_icon_info_g... | false | false | false | false | false | 0 |
zRender(Image &img){
int w = img.width();
int h = img.height();
zmin = std::numeric_limits<double>::infinity();
zmax = 0.0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
Point pixel(x+0.5, h-1-y+0.5, 0);
Ray ray(eye, (pixel-eye).normalized());
double dist = trace(ray, NUL... | false | false | false | false | false | 0 |
db_find_property(Objid oid, const char *name, Var * value)
{
static struct {
const char *name;
enum bi_prop prop;
int hash;
} ptable[] = {
{
"name", BP_NAME, 0
},
{
"owner", BP_OWNER, 0
},
{
"programmer", BP_PROGRAMMER, 0
},
{
"wizard", BP_WIZARD, 0
},
{
"r", BP_R, 0
},
{
... | false | false | false | false | false | 0 |
vec_scalar_subf(float z[], const float x[], float y, int n)
{
int i;
__m128 n1;
__m128 n2;
if ((i = n & ~3))
{
n2 = _mm_set1_ps(y);
for (i -= 4; i >= 0; i -= 4)
{
n1 = _mm_loadu_ps(x + i);
n1 = _mm_sub_ps(n1, n2);
_mm_storeu_ps(z + i, n... | false | false | false | false | false | 0 |
Mono_Posix_Syscall_readdir_r (void *dirp, struct Mono_Posix_Syscall__Dirent *entry, void **result)
{
struct dirent *_entry = malloc (sizeof (struct dirent) + MPH_PATH_MAX + 1);
int r;
r = readdir_r (dirp, _entry, (struct dirent**) result);
if (r == 0 && *result != NULL) {
copy_dirent (entry, _entry);
}
free ... | false | false | false | false | true | 1 |
color_correct(double gamma_correction)
{
// Trivial corrections
if (gamma_correction<=0.999 || gamma_correction>=1.001)
color_correct(gamma_correction, GPixel::WHITE);
} | false | false | false | false | false | 0 |
ario_playlist_preferences_new (void)
{
ARIO_LOG_FUNCTION_START;
ArioPlaylistPreferences *playlist_preferences;
GtkBuilder *builder;
GtkListStore *list_store;
GtkTreeIter iter;
GSList *playlist_modes;
ArioPlaylistMode *playlist_mode;
playlist_preferences =... | false | false | false | false | false | 0 |
mISDNipac_irq(struct ipac_hw *ipac, int maxloop)
{
int cnt = maxloop + 1;
u8 ista, istad;
struct isac_hw *isac = &ipac->isac;
if (ipac->type & IPAC_TYPE_IPACX) {
ista = ReadIPAC(ipac, ISACX_ISTA);
while (ista && --cnt) {
pr_debug("%s: ISTA %02x\n", ipac->name, ista);
if (ista & IPACX__ICA)
ipac_irq(... | false | false | false | false | false | 0 |
ConvertEncoding(char *pData, int len)
{
if (m_listingEncoding != listingEncoding::ebcdic)
return;
for (int i = 0; i < len; ++i)
{
pData[i] = ebcdic_table[static_cast<unsigned char>(pData[i])];
}
} | false | false | false | false | false | 0 |
fetch_ice_ptr(MAILSTREAM *stream, long unsigned int rawno)
{
PINELT_S **peltp;
MESSAGECACHE *mc;
if(!stream || rawno < 1L || rawno > stream->nmsgs)
return NULL;
if(!(mc = mail_elt(stream, rawno)))
return NULL;
/*
* any private elt data yet?
*/
if((*(peltp = (PINELT_S ... | false | false | false | false | false | 0 |
check_ternary_value (void)
{
mpfr_prec_t prec;
mpc_t z;
const long int s = -1;
mpc_init2 (z, 2);
for (prec=2; prec <= 1024; prec++) {
mpc_set_prec (z, prec);
mpc_set_ui (z, 3ul, MPC_RNDNN);
if (mpc_add_si (z, z, s, MPC_RNDDU)) {
printf ("Error in mpc_add_si: 3+(-1) should be ... | false | false | false | false | false | 0 |
Connect()
{
wxASSERT(m_pSocket);
delete [] m_pHost;
delete [] m_pPort;
const wxWX2MBbuf buf = m_pSocket->m_host.mb_str();
if (!buf)
{
m_pHost = 0;
m_pPort = 0;
return EINVAL;
}
m_pHost = new char[strlen(buf) + 1];
strcpy(m_pHost, buf);
// Connect method of CSocket ensures port is in rang... | false | false | false | false | false | 0 |
test_cached_stab_info(void)
{
hid_t file_id;
hid_t group_id;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing cached symbol table information\n"));
/* Create file */
file_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5... | false | false | false | false | false | 0 |
OS_Read(int fd, char * buf, size_t len)
{
if (shutdownNow) return -1;
return(read(fd, buf, len));
} | false | false | false | false | false | 0 |
snd_ali_detect_spdif_rate(struct snd_ali *codec)
{
u16 wval;
u16 count = 0;
u8 bval, R1 = 0, R2;
bval = inb(ALI_REG(codec, ALI_SPDIF_CTRL + 1));
bval |= 0x1F;
outb(bval, ALI_REG(codec, ALI_SPDIF_CTRL + 1));
while ((R1 < 0x0b || R1 > 0x0e) && R1 != 0x12 && count <= 50000) {
count ++;
snd_ali_delay(codec, ... | false | false | false | false | false | 0 |
showObjectPath( CMPIObjectPath * objectpath )
{
CMPIString * namespace = objectpath->ft->getNameSpace(objectpath, NULL);
CMPIString * classname = objectpath->ft->getClassName(objectpath, NULL);
int numkeys = objectpath->ft->getKeyCount(objectpath, NULL);
int i;
if (namespace && namespace->hdl) printf("n... | false | false | false | false | false | 0 |
msg_read_string( void )
{
static char buf[MAX_MSG_SIZE]; /* can't be bigger including trailing \0 */
char c;
int i = 0;
while ( 1 ) {
c = msg_read_int8();
buf[i++] = c;
if ( i == MAX_MSG_SIZE ) break; /* to be sure */
if ( c == 0 ) break;
}
buf[MAX_MSG_SIZE-1] = 0;
return buf;
} | false | false | false | false | false | 0 |
glktimeout(GLKDisplay *fd, int timeout)
{
struct termios t;
if (timeout < 0 || timeout > 255) {
errno = EINVAL; /* Invalid argument */
return(1); /* Failure */
}
if (tcgetattr(fd->fd, &t) < 0) {
return(1);
}
fd->timeout = timeout;
t.c_cc[VTIME] = timeout;
if (tcsetattr(fd... | false | false | false | false | false | 0 |
get_nearest_powerof2(u_int n)
{
u_int i;
--n;
for (i = 1; i < sizeof(u_int) * 8; i <<= 1)
{
n |= n >> i;
}
return ++n;
} | false | false | false | false | false | 0 |
set_wMainWindow_interactive( const bool indeed, const bool flush)
{
set_cursor_busy( not indeed, (GtkWidget*)wMainWindow);
//gtk_widget_set_sensitive( (GtkWidget*)wMainWindow, indeed);
gtk_widget_set_sensitive( (GtkWidget*)cMsmtMainToolbar, indeed);
gtk_widget_set_sensitive( (GtkWidget*... | false | false | false | false | false | 0 |
fintek_8250_rs485_config(struct uart_port *port,
struct serial_rs485 *rs485)
{
uint8_t config = 0;
struct fintek_8250 *pdata = port->private_data;
if (!pdata)
return -EINVAL;
if (rs485->flags & SER_RS485_ENABLED)
memset(rs485->padding, 0, sizeof(rs485->padding));
else
memset(rs485, 0, sizeof(*rs48... | false | false | false | false | false | 0 |
random_attack()
{
#define ATTACK_SCAN_RANGE 100
int xOffset, yOffset;
int xLoc, yLoc;
Location* locPtr;
int curXLoc = next_x_loc(), curYLoc = next_y_loc();
BYTE regionId = world.get_region_id(curXLoc, curYLoc);
int rc;
for( int i=2 ; i<ATTACK_SCAN_RANGE*ATTACK_SCAN_RANGE ; i++ )
{
misc.cal_move_... | false | false | false | false | false | 0 |
dsp_postexecute_update_pc(void)
{
/* When running a REP, PC must stay on the current instruction */
if (dsp_core->loop_rep) {
/* Is PC on the instruction to repeat ? */
if (pc_on_rep==0) {
--dsp_core->registers[DSP_REG_LC];
dsp_core->registers[DSP_REG_LC] &= BITMASK(16);
if (dsp_core->registers[DSP_RE... | false | false | false | false | false | 0 |
printArrayAttribute( const char* cmd ) {
INDEX idx;
ArrayInfo key;
ArrayInfo* foundArray;
char attribute[40];
if ( sscanf(cmd, "SoftRaid/%[^/]/%39s", key.ArrayName, attribute) == 2 ) {
if ( ( idx = search_ctnr( ArrayInfos, ArrayInfoEqual, &key ) ) == 0 ) {
foundArray = get_ctnr( ArrayInfos, idx );
if ( s... | true | true | false | false | false | 1 |
cert_enumerator_destroy(cert_enumerator_t *this)
{
relation_t *rel;
if (this->locked >= 0)
{
rel = &this->relations[this->locked];
rel->lock->unlock(rel->lock);
}
free(this);
} | false | false | false | false | false | 0 |
chooes_highway(DME_NODE *n, int s_r_length){
int i, k;
double buf1 = (buflib.lib[0].icap + buflib.lib[0].ocap);
double beta1 = wirelib.lib[0].c;
double beta2 = wirelib.lib[1].c;
double Lmax1 = LAMBADA_w1;
double Lmax2 = LAMBADA_w2;
double sink_cap=0;
// double cap_left = CapLimit - n->downstream_length*beta1 -... | false | false | false | false | false | 0 |
show_status(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct ipath_devdata *dd = dev_get_drvdata(dev);
ssize_t ret;
if (!dd->ipath_statusp) {
ret = -EINVAL;
goto bail;
}
ret = scnprintf(buf, PAGE_SIZE, "0x%llx\n",
(unsigned long long) *(dd->ipath_statusp));
bail:
return... | false | false | false | false | false | 0 |
encodedpassword2string ( int pwd ) const
{
string s;
if ( !pwd )
return s;
s = "A";
if ( pwd > 0 )
s+= "A";
else
s+= "B";
s += strrr ( abs (pwd) );
return s;
} | false | false | false | false | false | 0 |
getDetailedDescriptionWithConstraints(Rules& r)
{
QString s=this->getDetailedDescription();
s+="--------------------------------------------------\n";
s+=tr("Space constraints directly related to this room:");
s+="\n";
for(int i=0; i<r.spaceConstraintsList.size(); i++){
SpaceConstraint* c=r.spaceConstraintsList... | 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.