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 |
|---|---|---|---|---|---|---|
paradoxical_subreg_p (const_rtx x)
{
if (GET_CODE (x) != SUBREG)
return false;
return (GET_MODE_PRECISION (GET_MODE (x))
> GET_MODE_PRECISION (GET_MODE (SUBREG_REG (x))));
} | false | false | false | false | false | 0 |
_nm_remote_settings_ensure_inited (NMRemoteSettings *self)
{
NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self);
GError *error = NULL;
if (!priv->inited) {
if (!g_initable_init (G_INITABLE (self), NULL, &error)) {
/* Don't warn when the call times out because the settings service can't
*... | false | false | false | false | false | 0 |
clutter_actor_real_hide (ClutterActor *self)
{
ClutterActorPrivate *priv = self->priv;
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
return;
CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_VISIBLE);
/* we notify on the "visible" flag in the clutter_actor_hide()
* wrapper so the entire hide signal emission comp... | false | false | false | false | false | 0 |
midway_serial_pic_reset_w(int state)
{
if (state)
{
serial.index = 0;
serial.status = 0;
serial.buffer = 0;
}
} | false | false | false | false | false | 0 |
set_timefilter_date_w(struct archive_match *a, int timetype,
const wchar_t *datestr)
{
struct archive_string as;
time_t t;
if (datestr == NULL || *datestr == L'\0') {
archive_set_error(&(a->archive), EINVAL, "date is empty");
return (ARCHIVE_FAILED);
}
archive_string_init(&as);
if (archive_string_append... | false | false | false | false | false | 0 |
gtk_enhanced_scale_get_slider_position( GtkEnhancedScale *enhanced_scale, gint *x, gint *y, gint i )
{
g_return_if_fail ( enhanced_scale != NULL );
g_return_if_fail ( GTK_IS_ENHANCED_SCALE ( enhanced_scale ) );
g_return_if_fail ( i >= 0 );
g_return_if_fail ( i < enhanced_scale->num_adjustments );
gdk_window_get_p... | false | false | false | false | false | 0 |
find_first_unset (gsize mask, gint nth_bit)
{
do {
nth_bit++;
if (!(mask & ((gsize)1 << nth_bit))) {
if (nth_bit == BITS_PER_CHUNK)
/* On 64 bit platforms, 1 << 64 == 1 */
return -1;
else
return nth_bit;
}
} while (nth_bit < BITS_PER_CHUNK);
return -1;
} | false | false | false | false | false | 0 |
groupColorSetting(ProfileContext::Type t,
QString name)
{
QString n = ProfileContext::typeName(t) + '-' + name;
return colorSetting(n);
} | false | false | false | false | false | 0 |
bfd_tell (bfd *abfd)
{
file_ptr ptr;
if (abfd->iovec)
{
bfd *parent_bfd = abfd;
ptr = abfd->iovec->btell (abfd);
while (parent_bfd->my_archive != NULL)
{
ptr -= parent_bfd->origin;
parent_bfd = parent_bfd->my_archive;
}
}
else
ptr = 0;
abfd->where = ptr;
return ptr;
} | false | false | false | false | false | 0 |
GMT_star (double x, double y, double z, double size[], struct GMT_FILL *fill, GMT_LONG outline)
{
/* Plots the star symbol */
if (project_info.three_D) { /* Must do polygon */
GMT_LONG i, k;
double xp[10], yp[10], S, s, c, s2;
S = size[0] * 0.5;
s2 = 0.38196601125 * S;
for (i = k = 0; i < 5; i++) {
sin... | false | false | false | false | false | 0 |
children(void)
{
MSWidgetVector vector;
MSNodeItem *hp=childListHead();
MSNodeItem *np=hp;
while ((np=np->next())!=hp) vector.append(((MSCollapsibleEntry *)np->data())->widget());
return vector;
} | false | false | false | false | false | 0 |
_pack_start_btn_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *rd;
if (!data) return;
rd = _radio_new(data);
if (!rd) return;
elm_box_pack_start(data, rd);
} | false | false | false | false | false | 0 |
CCubeSceneNode(f32 size, ISceneNode* parent, ISceneManager* mgr,
s32 id, const core::vector3df& position,
const core::vector3df& rotation, const core::vector3df& scale)
: IMeshSceneNode(parent, mgr, id, position, rotation, scale),
Mesh(0), Size(size)
{
#ifdef _DEBUG
setDebugName("CCubeSceneNode");
#end... | false | false | false | false | false | 0 |
str_byte_aref(VALUE str, VALUE indx)
{
long idx;
switch (TYPE(indx)) {
case T_FIXNUM:
idx = FIX2LONG(indx);
num_index:
str = str_byte_substr(str, idx, 1);
if (NIL_P(str) || RSTRING_LEN(str) == 0) return Qnil;
return str;
default:
/* check if indx is Range */
{
long beg, len = RSTR... | false | false | false | false | false | 0 |
setValue( const QColor & color )
{
_color = color;
QPalette palette;
palette.setColor(_colorButton->backgroundRole(), _color);
_colorButton->setPalette(palette);
} | false | false | false | false | false | 0 |
i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, void *a,
STACK_OF(CONF_VALUE) *ext_list)
{
POLICY_MAPPINGS *pmaps = a;
POLICY_MAPPING *pmap;
int i;
char obj_tmp1[80];
char obj_tmp2[80];
for(i = 0; i < sk_POLICY_MAPPING_num(pmaps); i++) {
pmap = sk_POLICY_MAPPING_value(pmaps, i);
i2t_ASN1_OBJECT(obj... | false | false | false | false | false | 0 |
mlx4_port_map_set(struct mlx4_dev *dev, struct mlx4_port_map *v2p)
{
u8 port1 = v2p->port1;
u8 port2 = v2p->port2;
struct mlx4_priv *priv = mlx4_priv(dev);
int err;
if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP))
return -ENOTSUPP;
mutex_lock(&priv->bond_mutex);
/* zero means keep current mapping fo... | false | false | false | false | false | 0 |
git_note_read(git_note **out, git_repository *repo,
const char *notes_ref, const git_oid *oid)
{
int error;
char *target = NULL;
git_tree *tree = NULL;
git_commit *commit = NULL;
target = git_oid_allocfmt(oid);
GITERR_CHECK_ALLOC(target);
if ((error = retrieve_note_tree_and_commit(&tree, &commit, repo, &no... | false | false | false | false | false | 0 |
headset_set_channel(struct headset *headset,
const sdp_record_t *record, uint16_t svc)
{
int ch;
sdp_list_t *protos;
if (sdp_get_access_protos(record, &protos) < 0) {
error("Unable to get access protos from headset record");
return -1;
}
ch = sdp_get_proto_port(protos, RFCOMM_UUID);
sdp_list_foreach(pr... | false | false | false | false | false | 0 |
ATL_cdotc_sub(const int N, const TYPE *X, const int incX,
const TYPE *Y, const int incY, TYPE *dotc)
{
int incx=incX, incy=incY;
if (N > 0)
{
/*
* Manipulate incX and inxY such that:
* - Both are positive
* - else if incX or incY has abs()=1, make it positive
* - if both ... | false | false | false | false | false | 0 |
handleLineUp(uint sysKeys)
{
size_t caratLine = getLineNumberFromIndex(d_caratPos);
if (caratLine > 0)
{
float caratPixelOffset = getFont()->getTextExtent(getText().substr(d_lines[caratLine].d_startIdx, d_caratPos - d_lines[caratLine].d_startIdx));
--caratLine;
size_t newLineIndex = getFont()->g... | false | false | false | false | false | 0 |
db_help_cmd(char *cmd, char *param1, char *param2, char *param3)
{
int i;
i = 0;
A_PRINTF("%s %s\n", ATH_DEBUGGER_VERSION_STR, ATH_COMMAND_LIST_STR);
while (command_table[i].cmd_func)
{
A_PRINTF("%s\t%s\n\r", command_table[i].cmd_str,
command_table[i].help_str);
i++;
}
return i;
} | false | false | false | false | false | 0 |
buf_grow(struct buffer *buf, size_t newsize)
{
void *tmp;
size_t sz;
if (newsize % BUF_STEP == 0)
sz = newsize;
else
sz = ((newsize / BUF_STEP) + 1) * BUF_STEP;
if (buf->size == sz)
return true;
tmp = realloc(buf->bytes, sz);
if (sz > 0 && tmp == NULL)
return false;
buf->bytes = tmp;
buf->size = sz;... | false | false | false | false | false | 0 |
BuildVectorFromScalar(SelectionDAG& DAG, EVT VecTy,
SmallVectorImpl<SDValue> &LdOps,
unsigned Start, unsigned End) {
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
SDLoc dl(LdOps[Start]);
EVT LdTy = LdOps[Start].getValueType();
... | false | false | false | false | false | 0 |
stuff_yank(bufname, p)
int bufname;
char_u *p;
{
char_u *lp;
char_u **pp;
yankbuffer = bufname;
/* check for read-only buffer */
if (yankbuffer != 0 && !is_yank_buffer(yankbuffer, TRUE))
return FAIL;
get_yank_buffer(TRUE);
if (yankappend && y_current->y_array != NULL)
{
pp = &(y_current->y_arra... | false | false | false | false | false | 0 |
term_getsize(void)
{
struct winsize ts;
if (ioctl(1,TIOCGWINSZ,&ts) || ts.ws_row<=0 || ts.ws_col<=0)
/* syserr("ioctl(TIOCGWINSZ)");*/
{ /* not a terminal or a broken one, let's quietly assume 80x25 */
LINES=25;
COLS=80;
return;
}
LINES=ts.ws_row;
COLS=ts.ws... | false | false | false | false | false | 0 |
connman_device_set_interface(struct connman_device *device,
const char *interface)
{
g_free(device->devname);
device->devname = g_strdup(interface);
g_free(device->interface);
device->interface = g_strdup(interface);
if (device->name == NULL) {
const char *str = type2description(device->type);
if (str ... | false | false | false | false | false | 0 |
verify_pack(const bench_tensor *sz, int s)
{
bench_tensor *x = tensor_copy(sz);
if (FINITE_RNK(x->rnk) && x->rnk > 0) {
int i;
x->dims[x->rnk - 1].is = s;
x->dims[x->rnk - 1].os = s;
for (i = x->rnk - 1; i > 0; --i) {
x->dims[i - 1].is = x->dims[i].is * x->dims[i].n;
x->dims[i - 1]... | false | false | false | false | false | 0 |
lam_port_is_open(int port)
{
port -= LAM_PORTLOW;
if (!((0 <= port) && (port < LAM_PORTMAX))) {
errno = EINVAL;
return(LAMERROR);
}
return(ports[port]);
} | false | false | false | false | false | 0 |
_dxf_ExLexError ()
{
int i;
char buffer[2048];
char *p;
yyText[yycharno] = '\0';
p = buffer;
for (i = 0; i < yycharno - 1; i++)
*p++ = '-';
*p = '\0';
DXUIMessage ("ERROR", "%s", yyText);
DXUIMessage ("ERROR", "%s%c", buffer, yycharno >= YYLMAX - 1 ? '>' : '^');
} | false | false | false | false | false | 0 |
bnx2_init_nic(struct bnx2 *bp)
{
int rc;
if ((rc = bnx2_reset_nic(bp, BNX2_DRV_MSG_CODE_RESET)) != 0)
return rc;
bnx2_init_phy(bp);
bnx2_set_link(bp);
return 0;
} | false | false | false | false | false | 0 |
Lsemicolon_reader()
{
object c;
object str= vs_base[0];
check_arg(2);
vs_popp;
do
{ read_char_to(c,str, goto L); }
while (char_code(c) != '\n');
L:
vs_popp;
vs_base[0] = Cnil;
/* no result */
} | false | false | false | false | false | 0 |
cmp_numerics(Numeric num1, Numeric num2)
{
int result;
/*
* We consider all NANs to be equal and larger than any non-NAN. This is
* somewhat arbitrary; the important thing is to have a consistent sort
* order.
*/
if (NUMERIC_IS_NAN(num1))
{
if (NUMERIC_IS_NAN(num2))
result = 0; /* NAN = NAN */
e... | false | false | false | false | false | 0 |
mimeGetTransferMode(const char *fn)
{
mimeEntry *m = mimeGetEntry(fn, 0);
return m ? m->transfer_mode : 'I';
} | false | false | false | false | false | 0 |
bind_dimension (int dimension,
int factor)
{
int d;
int d_next;
d = (dimension / factor) * factor;
d_next = d + factor;
if (dimension - d <= d_next - dimension)
dimension = d;
else
dimension = d_next;
return dimension;
} | false | false | false | false | false | 0 |
resize(uint previousSize, uint newSize)
{
m_maxChainSize = newSize;
for (DesktopChains::iterator it = m_chains.begin(); it != m_chains.end(); ++it) {
it.value().resize(previousSize, newSize);
}
} | false | false | false | false | false | 0 |
ocsp_check_delegated(X509 *x, int flags)
{
X509_check_purpose(x, -1, 0);
if ((x->ex_flags & EXFLAG_XKUSAGE) &&
(x->ex_xkusage & XKU_OCSP_SIGN))
return 1;
OCSPerr(OCSP_F_OCSP_CHECK_DELEGATED, OCSP_R_MISSING_OCSPSIGNING_USAGE);
return 0;
} | false | false | false | false | false | 0 |
ioat_cleanup_event(unsigned long data)
{
struct ioatdma_chan *ioat_chan = to_ioat_chan((void *)data);
ioat_cleanup(ioat_chan);
if (!test_bit(IOAT_RUN, &ioat_chan->state))
return;
writew(IOAT_CHANCTRL_RUN, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
} | false | false | false | false | false | 0 |
TrioLogarithm
TRIO_ARGS2((number, base),
trio_long_double_t number,
int base)
{
trio_long_double_t result;
if (number <= 0.0)
{
/* xlC crashes on log(0) */
result = (number == 0.0) ? trio_ninf() : trio_nan();
}
else
{
if (base == 10)
{
result = trio_log10(number);
}
... | false | false | false | false | false | 0 |
Long_To_Bignum (long i) {
int k, digits = sizeof(long)/2;
Object big;
unsigned long int n = i;
big = Make_Uninitialized_Bignum (digits);
if (i < 0) {
BIGNUM(big)->minusp = True;
n = -i;
}
for (k = 0; k < digits; k++, n >>= 16)
BIGNUM(big)->data[k] = n & 0xffff;
B... | false | false | false | false | false | 0 |
sst_soc_prepare(struct device *dev)
{
struct sst_data *drv = dev_get_drvdata(dev);
int i;
if (!drv->soc_card)
return 0;
/* suspend all pcms first */
snd_soc_suspend(drv->soc_card->dev);
snd_soc_poweroff(drv->soc_card->dev);
/* set the SSPs to idle */
for (i = 0; i < drv->soc_card->num_rtd; i++) {
struct ... | false | false | false | false | false | 0 |
plan_set_operations(PlannerInfo *root, double tuple_fraction,
List **sortClauses)
{
Query *parse = root->parse;
SetOperationStmt *topop = (SetOperationStmt *) parse->setOperations;
Node *node;
Query *leftmostQuery;
Assert(topop && IsA(topop, SetOperationStmt));
/* check for unsupported stuff */
A... | false | false | false | true | false | 1 |
MessageIsComplete (unsigned char *pData, size_t size)
{
unsigned short dataSize;
/* sanity check */
if (size < 8)
return 0;
/* :NOTE: we can't just cast to a short as data may not be aligned */
dataSize = (((unsigned short) pData[6]) << 8) | pData[7];
DBG (20, "MessageIsComplete: data size = %d\n", d... | false | false | false | false | false | 0 |
x(int reg, Expression *pExpr)
{
if(!GetActiveCPU())
return;
if(reg<0 || (reg >= (int)GetActiveCPU()->register_memory_size()) )
{
GetUserInterface().DisplayMessage("bad file register\n");
return;
}
Register *pReg = GetActiveCPU()->registers[reg];
RegisterValue rvCurrent(pReg->getRVN());... | false | false | false | false | false | 0 |
mca_sharedfp_lockedfile_component_file_query(mca_io_ompio_file_t *fh, int *priority) {
struct flock lock;
int fd, err;
/*char *filename;*/
char filename[256];
int rank;
bool has_file_lock_support=false;
*priority = mca_sharedfp_lockedfile_priority;
/*get the rank of this process*/
... | false | false | false | false | false | 0 |
count_devices(struct lib_context *lc, enum dev_type type)
{
return type == SET ? count_sets(lc, LC_RS(lc)) :
_count_devices(lc, type);
} | false | false | false | false | false | 0 |
IsVisited(int nav)
{
if (nav >= MAX_NAVPOINTS || nav < 0)
return 0;
if (Navs[nav].flags & NP_VISITED)
return 1;
return 0;
} | false | false | false | false | false | 0 |
update_terminal_extension( void **/*arg1*/, void **/*arg2*/, ED4_base *this_object )
{
if (this_object->is_terminal()){
if (this_object->is_spacer_terminal()){
if (this_object->parent->is_device_manager()) { // the rest is managed by reference links
;
// this... | false | false | false | false | false | 0 |
fossil_isspace(char c){
return c==' ' || (c<='\r' && c>='\t');
} | false | false | false | false | false | 0 |
generate_terrain_value (struct state *st, int v1, int v2, int v3, int v4, int w)
{
int sum, ret;
int rval;
if (!st->terrain_flag) return 0;
sum = v1 + v2 + v3 + v4;
rval = w*sum/st->smoothness;
if (rval == 0) rval = 2;
ret = (sum/4 -(rval/2) + RAND(rval));
if (ret < -400 || ret > 400) {
ret = sum/4;
}
... | false | false | false | false | false | 0 |
gee_hash_map_map_iterator_real_unset (GeeMapIterator* base) {
GeeHashMapMapIterator * self;
gint _tmp0_ = 0;
GeeHashMap* _tmp1_ = NULL;
gint _tmp2_ = 0;
GeeHashMapNode* _tmp3_ = NULL;
GeeHashMap* _tmp4_ = NULL;
GeeHashMapNode* _tmp5_ = NULL;
gconstpointer _tmp6_ = NULL;
GeeHashMap* _tmp7_ = NULL;
gint _tmp8_ ... | false | false | false | false | false | 0 |
RegisterOptions_Interfaces(const SmartPtr<RegisteredOptions>& roptions)
{
roptions->SetRegisteringCategory("Uncategorized");
IpoptApplication::RegisterOptions(roptions);
roptions->SetRegisteringCategory("Uncategorized");
TNLPAdapter::RegisterOptions(roptions);
roptions->SetRegisteringCategory("Unc... | false | false | false | false | false | 0 |
_panel_applet_factory_main_internal (const gchar *factory_id,
gboolean out_process,
GType applet_type,
PanelAppletFactoryCallback callback,
gpointer user_data)
{
PanelAppletFactory *factory;
GClosure *... | false | false | false | false | false | 0 |
G_lon_parts(double lon, /* lon in degrees to be split into parts */
int *d, int *m, /* degrees, minutes */
double *s, /* seconds */
char *h /* hemisphere */
)
{
while (lon > 180.0)
lon -= 360.0;
while (lon < -180.0)
lon += 360.0;
if (lon < 0) {
*h = 'W';
lon = -lon;
}
else
*h = 'E';... | false | false | false | false | false | 0 |
VisitCodeTarget(RelocInfo* rinfo) {
ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
VisitPointer(&target);
rinfo->set_target_address(
reinterpret_cast<Code*>(target)->instruction_start());
} | false | false | false | false | false | 0 |
dumpBits(raw_ostream &o, BitsInit &bits) {
unsigned index;
for (index = bits.getNumBits(); index > 0; index--) {
switch (bitFromBits(bits, index - 1)) {
case BIT_TRUE:
o << "1";
break;
case BIT_FALSE:
o << "0";
break;
case BIT_UNSET:
o << "_";
break;
default:... | false | false | false | false | false | 0 |
hasDefaultException(ExceptionGroup *eg)
#else
hasDefaultException(eg)
ExceptionGroup *eg;
#endif
{
ListNode *q;
for (q = eg->handlers->next; q!=NULL; q=q->next)
{
ExceptionHandler *eh = (ExceptionHandler *)q->elem;
if ( strcmp("default", eh->signalname)==0 ) {
return 1;
... | false | false | false | false | false | 0 |
do_binop(PyObject *v, PyObject *w, char *opname, char *ropname,
binaryfunc thisfunc)
{
PyObject *result = half_binop(v, w, opname, thisfunc, 0);
if (result == Py_NotImplemented) {
Py_DECREF(result);
result = half_binop(w, v, ropname, thisfunc, 1);
}
return result;
} | false | false | false | false | false | 0 |
test_repo_init__relative_gitdir(void)
{
git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT;
git_config *cfg;
const char *worktree_path;
git_buf dot_git_content = GIT_BUF_INIT;
opts.workdir_path = "../c_wd";
opts.flags =
GIT_REPOSITORY_INIT_MKPATH |
GIT_REPOSITORY_INIT_RELATIVE_GITLINK |
GI... | false | false | false | false | false | 0 |
on_watch_dragged_callback(GtkWidget *wgt, GdkDragContext *context, int x, int y,
GtkSelectionData *seldata, guint info, guint _time,
gpointer userdata)
{
/* string that is dragged */
gchar *expression = (gchar*)seldata->data;
GtkTreePath *path = NULL;
GtkTreeViewDropPosition pos;
GtkTreePath *empty_path;
Gtk... | false | false | false | false | false | 0 |
extenderRect(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
Q_ASSERT(extender);
QRect rect(option.rect);
rect.setTop(rect.bottom() + 1 - extender->sizeHint().height());
int indentation = 0;
if (QTreeView *tv = qobject_cast<QTreeView *>(parent())) {
... | false | false | false | false | false | 0 |
dev_string_attrs_are_visible(struct kobject *kobj,
struct attribute *a, int n)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct usb_device *udev = to_usb_device(dev);
if (a == &dev_attr_manufacturer.attr) {
if (udev->manufacturer == NULL)
return 0;
} else if (a == &dev_attr_product.att... | false | false | false | false | false | 0 |
qla2xxx_scan_start(struct Scsi_Host *shost)
{
scsi_qla_host_t *vha = shost_priv(shost);
if (vha->hw->flags.running_gold_fw)
return;
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
set_bit(RSCN_UPDATE, &vha->dpc_flags);
set_bit(NPIV_CONFIG_NEEDED, &vha->dpc_flags);
} | false | false | false | false | false | 0 |
ReadElement(string section, string entry, string filename)
{
if (section.length() == 0)
return string();
if (entry.length() == 0)
return string();
if (filename.length() == 0)
return string();
IniFile MyIniFile (filename);
return MyIniFile.GetKeyValue(section, entry);;
} | false | false | false | false | false | 0 |
hasBinding(Renderable* rend, String passName)
{
if (!rend->getUserObjectBindings().getUserAny(HLMS_KEY).isEmpty())
{
HlmsMatBindingMap* hlmsMatMap = rend->getUserObjectBindings().getUserAny(HLMS_KEY).get<HlmsMatBindingMap*>();
return hlmsMatMap->find(passName) != hlmsMatMap->end();
}
return false;
} | false | false | false | false | false | 0 |
pf_finalize_position(const struct pf_parameter *param,
struct pf_position *pos)
{
int move_rate = param->move_rate;
pos->turn *= param->fuel;
if (0 < move_rate) {
pos->turn += ((move_rate - pos->moves_left) / move_rate);
/* We add 1 because a fuel of 1 means "no" ... | false | false | false | false | false | 0 |
verbose(StringRef message) {
if (Flags&Verbose)
errs() << " " << message << "\n";
} | false | false | false | false | false | 0 |
operator() (Uni32 k, char unknown) const
{
const UniItem * i = data + (unsigned char)k * 4;
if (i->key == k) return i->value;
++i;
if (i->key == k) return i->value;
++i;
if (i->key == k) return i->value;
++i;
if (i->key == k) return i->value;
if (i->key == npos) return unknown;... | false | false | false | false | false | 0 |
PyFFGlyph_GlyphPen(PyObject *self, PyObject *args, PyObject *keywds) {
int replace = true;
PyObject *gp;
if ( !PyArg_ParseTupleAndKeywords(args, keywds, "|i", glyphpen_keywords,
&replace ))
return( NULL );
gp = PyFF_GlyphPenType.tp_alloc(&PyFF_GlyphPenType,0);
((PyFF_GlyphPen *) gp)->sc = ((Py... | false | false | false | false | false | 0 |
ProcessInformation(vtkInformation* info)
{
if (info->Has(IMMEDIATE_MODE_RENDERING()))
{
this->SetImmediateModeRendering(info->Get(IMMEDIATE_MODE_RENDERING()));
}
this->Superclass::ProcessInformation(info);
} | false | false | false | false | false | 0 |
ArrayString2TextCtrl(const wxArrayString& array, wxTextCtrl* control)
{
control->Clear();
int count = array.GetCount();
for (int i = 0; i < count; ++i)
{
if (!array[i].IsEmpty())
{
control->AppendText(array[i]);
control->AppendText(_T('\n'));
}
}
} | false | false | false | false | false | 0 |
download_info_change_all(fileinfo_t *old_fi, fileinfo_t *new_fi)
{
GSList *sources, *iter;
file_info_check(old_fi);
file_info_check(new_fi);
sources = file_info_get_sources(old_fi);
for (iter = sources; iter; iter = g_slist_next(iter)) {
struct download *d = iter->data;
bool is_running;
download_check(d);... | false | false | false | false | false | 0 |
e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
{
struct e1000_adapter *adapter = hw->back;
uint16_t cap_offset;
#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
if (!cap_offset)
return -E1000_E... | false | false | false | false | false | 0 |
Find_Roots(Display * dpy, Window root, unsigned int *num)
{
Atom type_ret;
int format_ret;
unsigned char *prop_ret;
unsigned long bytes_after, num_ret;
Atom atom;
*num = 0;
atom = XInternAtom(dpy, "_NET_VIRTUAL_ROOTS", False);
if (!atom)
return NULL;
type_ret = None;
pr... | false | false | false | false | false | 0 |
gst_buffer_extract (GstBuffer * buffer, gsize offset, gpointer dest, gsize size)
{
gsize i, len, left;
guint8 *ptr = dest;
g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
g_return_val_if_fail (dest != NULL, 0);
GST_CAT_LOG (GST_CAT_BUFFER,
"buffer %p, offset %" G_GSIZE_FORMAT ", size %" G_GSIZE_FORM... | false | true | false | false | false | 1 |
qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain, bool pinned)
{
u32 c = 0;
u32 pflag = pinned ? TTM_PL_FLAG_NO_EVICT : 0;
unsigned i;
qbo->placement.placement = qbo->placements;
qbo->placement.busy_placement = qbo->placements;
if (domain == QXL_GEM_DOMAIN_VRAM)
qbo->placements[c++].flags = TTM_PL_... | false | false | false | false | false | 0 |
add_obs (int n, DATASET *dset, PRN *prn)
{
int err = 0;
if (complex_subsampled()) {
pprintf(prn, _("The data set is currently sub-sampled.\n"));
err = E_DATA;
} else if (n <= 0) {
err = E_PARSE;
} else {
err = dataset_add_observations(dset, n, OPT_A);
if (!err) {
pprintf(prn, _("Dataset exten... | false | false | false | false | false | 0 |
gegl_tile_backend_file_try_lock (GeglTileBackendFile *self)
{
GeglBufferHeader new_header;
new_header = gegl_buffer_read_header (self->i, NULL)->header;
if (new_header.flags & GEGL_FLAG_LOCKED)
{
return FALSE;
}
self->header.flags += GEGL_FLAG_LOCKED;
gegl_tile_backend_file_write_header (self);
... | false | false | false | false | false | 0 |
buffer_deleted_text (ClutterTextBuffer *buffer,
guint position,
guint n_chars,
ClutterText *self)
{
ClutterTextPrivate *priv;
gint new_position;
gint new_selection_bound;
priv = self->priv;
if (priv->position >= 0 ... | false | false | false | false | false | 0 |
is_pipe(int fd)
{
struct stat st;
int pipe_mode=0;
if (fstat(fd, &st) == 0) {
if (S_ISFIFO(st.st_mode))
pipe_mode = 1;
}
return pipe_mode;
} | false | false | false | false | false | 0 |
bInitialize( void )
{
int i1;
// Check if the object has already been created
if( ! bIsCreated( ) ) return( FALSE );
bClear( );
if( ! m_osInitMsg.IsEmpty( ) )
{
// Center the default message horizontally
SetWindowStyle( GetWindowStyle( ) | wxTE_CENTRE );
// Display the requisite number of b... | false | false | false | false | false | 0 |
check_channels (const GstRTPChannelOrder * order,
const GstAudioChannelPosition * pos)
{
gint i;
gboolean res = TRUE;
for (i = 0; i < order->channels; i++) {
if (order->pos[i] != pos[i]) {
res = FALSE;
break;
}
}
return res;
} | false | false | false | false | false | 0 |
osc_rdma_get_post_send (ompi_osc_rdma_module_t *module, void *source, int count,
ompi_datatype_t *datatype, int peer, int tag)
{
struct osc_rdma_get_post_send_cb_data_t *data;
data = malloc (sizeof (*data));
if (OPAL_UNLIKELY(NULL == data)) {
return OMPI_ERR_OUT_O... | false | false | false | false | false | 0 |
serverworks_fixup_csb(struct pci_dev *pdev)
{
u8 btr;
/* Third Channel Test */
if (!(PCI_FUNC(pdev->devfn) & 1)) {
struct pci_dev * findev = NULL;
u32 reg4c = 0;
findev = pci_get_device(PCI_VENDOR_ID_SERVERWORKS,
PCI_DEVICE_ID_SERVERWORKS_CSB5, NULL);
if (findev) {
pci_read_config_dword(findev, 0x4C, ... | false | false | false | false | false | 0 |
init_video_stream(bgav_demuxer_context_t * ctx, bgav_stream_t * s,
uint8_t flags)
{
flv_priv_t * priv;
uint8_t header[1];
priv = ctx->priv;
s->flags |= STREAM_NEED_START_TIME;
switch(flags & 0xF)
{
case 2: /* H263 based */
s->fourcc = BGAV_MK_FOURCC('F', 'L',... | false | false | false | false | false | 0 |
mpfr_get_ld_2exp (long *expptr, mpfr_srcptr src, mpfr_rnd_t rnd_mode)
{
long double ret;
mpfr_exp_t exp;
mpfr_t tmp;
if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (src)))
return (long double) mpfr_get_d_2exp (expptr, src, rnd_mode);
tmp[0] = *src; /* Hack copy mpfr_t */
MPFR_SET_EXP (tmp, 0);
ret = mpf... | false | false | false | false | false | 0 |
special_rtx (idx)
int idx;
{
return (strcmp (defs[idx].enumname, "CONST_INT") == 0
|| strcmp (defs[idx].enumname, "REG") == 0
|| strcmp (defs[idx].enumname, "SUBREG") == 0
|| strcmp (defs[idx].enumname, "MEM") == 0
|| strcmp (defs[idx].enumname, "CONST_VECTOR") == 0);
} | false | false | false | false | false | 0 |
_set_token( id, tpname, tpvalue, tpsize )
int id, tpsize;
char *tpname;
char *tpvalue;
{
int sock;
u_short this_op = TSH_ADVANCED_OP_SET_TOKEN;
sng_map *link_pt;
tsh_put_it out;
tsh_put_ot in;
this_op = htons(this_op) ;
link_pt = handles[id];
if ((sock = g... | false | false | false | false | false | 0 |
GetSubChunk(uint32_t ChunkID) {
#if DEBUG
std::cout << "List::GetSubChunk(uint32_t)" << std::endl;
#endif // DEBUG
if (!pSubChunksMap) LoadSubChunks();
return (*pSubChunksMap)[ChunkID];
} | false | false | false | false | false | 0 |
gst_dtmf_src_send_event (GstElement * element, GstEvent * event)
{
GstDTMFSrc *dtmfsrc = GST_DTMF_SRC (element);
gboolean ret;
GST_LOG_OBJECT (dtmfsrc, "Received an %s event via send_event",
GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CUSTOM_BOTH:
case GST_EVEN... | false | false | false | false | false | 0 |
vv6410_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
{
int err;
u16 i2c_data;
struct sd *sd = (struct sd *) gspca_dev;
err = stv06xx_read_sensor(sd, VV6410_DATAFORMAT, &i2c_data);
if (err < 0)
return err;
if (val)
i2c_data |= VV6410_HFLIP;
else
i2c_data &= ~VV6410_HFLIP;
PDEBUG(D_CONF, "Set horizon... | false | false | false | false | false | 0 |
find_value(const char *s, struct s2i *table)
{
while(table->s && strcasecmp(table->s, s))
table++;
return table->val;
} | false | false | false | false | false | 0 |
set_impl(name, tbl, num_impl, pre)
struct token *name;
struct implement **tbl;
int num_impl;
char *pre;
{
register struct implement *ptr;
char *name_s;
unsigned hashval;
/*
* we only need the operation name and not the entire token.
*/
name_s = name->image;
free_t(name);
/*
* If th... | false | false | false | false | false | 0 |
makeBreadboardDipSvg(const QString & expectedFileName)
{
QString spacingString;
int pins = TextUtils::getPinsAndSpacing(expectedFileName, spacingString);
double spacing = TextUtils::convertToInches(spacingString) * 100;
int increment = 10;
QString repeatT("<rect id='connector%1terminal' x='[1.87]' y='1' f... | false | false | false | false | false | 0 |
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct parser_params *parser)
{
YYUSE (yyvaluep);
YYUSE (parser);
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yytype);
YY_IGNORE_MAYBE_UNINITIALIZED_END... | false | false | false | false | false | 0 |
readMapFile ()
{
char token [TOKENLEN];
mapcount = 0;
if (!file_open (dirs->getMaps ("maps.txt")))
return;
while (file_nextToken (token, TOKENLEN))
{
strcpy (mapfile [mapcount], token);
mapcount ++;
if (mapcount >= MAXMAPS) break;
}
file_close ();
} | false | false | false | false | false | 0 |
sort(int a[], int n)
{
int i, j, value;
for (i = 1; i < n; i++)
{
value = a[i];
for (j = i - 1; j >= 0 && a[j] > value; j--) {
a[j + 1] = a[j];
}
a[j + 1] = value;
}
} | false | false | false | false | false | 0 |
oauth_proxy_call_parse_token_reponse (OAuthProxyCall *call)
{
OAuthProxyPrivate *priv;
GHashTable *form;
/* TODO: sanity checks, error handling, probably return gboolean */
g_return_if_fail (OAUTH_IS_PROXY_CALL (call));
priv = PROXY_GET_PRIVATE (REST_PROXY_CALL (call)->priv->proxy);
g_assert (priv);
f... | false | false | false | false | false | 0 |
PerlCallbackServerCheckPass(sasl_conn_t *conn, void *context, const char *user,
const char *pass, unsigned passlen, struct propctx *propctx)
{
struct _perlcontext *cp = (struct _perlcontext *) context;
int rc = SASL_OK;
Size_t len;
char *c = NULL;
AV *args = newAV();
// Create the parameter array and fill it
... | false | false | false | false | false | 0 |
generic_enum_convert(int n, string_ty **table, size_t table_length)
{
if (n < 0 || n >= (int)table_length)
return rpt_value_integer::create(n);
assert(table[n]);
return rpt_value_enumeration::create(n, nstring(table[n]));
} | 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.