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 |
|---|---|---|---|---|---|---|
parse_string_array2 (VALUE value)
{
xmmsv_t *list;
list = xmmsv_new_list ();
if (!NIL_P (rb_check_array_type (value))) {
VALUE *ary = RARRAY_PTR (value);
int i, ary_len = RARRAY_LEN (value);
for (i = 0; i < ary_len; i++) {
xmmsv_t *elem;
elem = xmmsv_new_string (StringValuePtr (ary[i]));
xmmsv_li... | false | false | false | false | false | 0 |
auth_stratum(struct pool *pool)
{
json_t *val = NULL, *res_val, *err_val;
char s[RBUFSIZE], *sret = NULL;
json_error_t err;
bool ret = false;
sprintf(s, "{\"id\": %d, \"method\": \"mining.authorize\", \"params\": [\"%s\", \"%s\"]}",
swork_id++, pool->rpc_user, pool->rpc_pass);
if (!stratum_send(pool, s, strle... | false | false | false | false | false | 0 |
args_tuple(PyObject *object,
const char *errors)
{
PyObject *args;
args = PyTuple_New(1 + (errors != NULL));
if (args == NULL)
return NULL;
Py_INCREF(object);
PyTuple_SET_ITEM(args,0,object);
if (errors) {
PyObject *v;
v = PyUnicode_FromString(error... | false | false | false | false | true | 1 |
gst_rtsp_connection_accept (gint sock, GstRTSPConnection ** conn)
{
int fd;
union gst_sockaddr sa;
socklen_t slen = sizeof (sa);
gchar ip[INET6_ADDRSTRLEN];
guint16 port;
g_return_val_if_fail (sock >= 0, GST_RTSP_EINVAL);
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
memset (&sa, 0, slen);
#i... | false | false | false | false | false | 0 |
gtv_sr_selection_to_blank (GncTreeViewSplitReg *view)
{
GncTreeModelSplitReg *model;
GtkTreePath *bpath, *spath;
Split *bsplit;
/* give gtk+ a chance to handle pending events */
while (gtk_events_pending ())
gtk_main_iteration ();
/* Make sure we have expanded splits */
if (view->p... | false | false | false | false | false | 0 |
txv_text_append_with_color(GtkWidget *wid, const gchar *text, gsize length, const GdkColor *color)
{
TxvInfo *txi;
GtkTextIter start, end;
gchar tname[32];
gint pos;
GtkTextTagTable *ttab;
GtkTextTag *tag;
if(color == NULL)
{
txv_text_append(wid, text, length);
return;
}
if((wid == NULL) || ((txi = g_... | false | false | false | false | false | 0 |
ojc_to_str(ojcVal val, int indent) {
struct _Buf b;
buf_init(&b, 0);
fill_buf(&b, val, indent, 0);
if (OJC_OK != b.err) {
return 0;
}
*b.tail = '\0';
if (b.base == b.head) {
return strdup(b.head);
}
return b.head;
} | false | false | false | false | false | 0 |
parse(MYSQL_ROW& r) {
int i=0;
clear();
id = atoi(r[i++]);
strcpy2(name, r[i++]);
workunitid = atoi(r[i++]);
appid = atoi(r[i++]);
server_state = atoi(r[i++]);
hostid = atoi(r[i++]);
userid = atoi(r[i++]);
sent_time = atoi(r[i++]);
received_time = atoi(r[i++]);
validate_s... | false | false | false | false | false | 0 |
as3645a_set_output(struct as3645a *flash, bool strobe)
{
enum as_mode mode;
bool on;
switch (flash->led_mode) {
case V4L2_FLASH_LED_MODE_NONE:
on = flash->indicator_current != 0;
mode = AS_MODE_INDICATOR;
break;
case V4L2_FLASH_LED_MODE_TORCH:
on = true;
mode = AS_MODE_ASSIST;
break;
case V4L2_FLASH_... | false | false | false | false | false | 0 |
get_node_attribute_value_as_decimal_double(const xmlpp::Element* node, const Glib::ustring& strAttributeName)
{
double result = 0;
const Glib::ustring value_string = get_node_attribute_value(node, strAttributeName);
//Get number for string:
if(!value_string.empty())
{
std::stringstream thestream;
the... | false | false | false | false | false | 0 |
ide_tape_stall_queue(ide_drive_t *drive)
{
idetape_tape_t *tape = drive->driver_data;
ide_debug_log(IDE_DBG_FUNC, "cmd: 0x%x, dsc_poll_freq: %lu",
drive->hwif->rq->cmd[0], tape->dsc_poll_freq);
tape->postponed_rq = true;
ide_stall_queue(drive, tape->dsc_poll_freq);
} | false | false | false | false | false | 0 |
ldestroy(But *but) {
ButWin *win = but->win;
ButEnv *env = win->env;
Menu *m = but->iPacket;
But *sbut = m->parent;
int x, y;
int minX, minY;
minX = but->x;
minY = but->y;
x = sbut->x + sbut->w/2;
y = sbut->y + sbut->h/2;
while (win->parent != NULL) {
minX += win->xOff;
x += win->... | false | false | false | false | false | 0 |
es_skip (estream_t stream, size_t size)
{
int err;
if (stream->data_offset + size > stream->data_len)
{
_set_errno (EINVAL);
err = -1;
}
else
{
stream->data_offset += size;
err = 0;
}
return err;
} | false | false | false | false | false | 0 |
LookupInputChannel(word32 channelId) const
{
map<word32, unsigned int>::const_iterator it = m_inputChannelMap.find(channelId);
if (it == m_inputChannelMap.end())
return m_threshold;
else
return it->second;
} | false | false | false | false | false | 0 |
containsInvalidInstruction(MachineLoop *L,
bool IsInnerHWLoop) const {
const std::vector<MachineBasicBlock *> &Blocks = L->getBlocks();
DEBUG(dbgs() << "\nhw_loop head, BB#" << Blocks[0]->getNumber(););
for (unsigned i = 0, e = Blocks.size(); i != e; ++i) {
MachineBasicBlock *MBB = Blocks[i];
for (Mac... | false | false | false | false | false | 0 |
xpc_handle_notify_mq_msg_uv(struct xpc_partition *part,
struct xpc_notify_mq_msg_uv *msg)
{
struct xpc_partition_uv *part_uv = &part->sn.uv;
struct xpc_channel *ch;
struct xpc_channel_uv *ch_uv;
struct xpc_notify_mq_msg_uv *msg_slot;
unsigned long irq_flags;
int ch_number = msg->hdr.ch_number;
if (unlike... | false | false | false | false | false | 0 |
orderBy( qint64 value, bool descending )
{
d->orderByField = value;
d->orderDescending = descending;
switch( value )
{
case Meta::valYear:
case Meta::valDiscNr:
case Meta::valTrackNr:
case Meta::valScore:
case Meta::valRating:
case Meta::valPlaycount:
... | false | false | false | false | false | 0 |
inspect_find_recursive(GtkTreeIter *iter, gint i, const char *key)
{
do
{
gboolean flag = !key;
if (flag)
{
gint scid;
gtk_tree_model_get(model, iter, INSPECT_SCID, &scid, -1);
if (scid == i)
return TRUE;
}
else
{
char *var1;
size_t len;
gboolean match;
gtk_tree_model_get(model... | false | false | false | false | false | 0 |
getULong(Glib::ustring &str, unsigned long *val)
{
const char *begin = str.raw().c_str();
char *end;
unsigned long ival = strtoul(begin, &end, 10);
if (str == end)
return false;
*val = ival;
return true;
} | false | false | false | false | false | 0 |
_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter)
{
double width_d;
double scale_f_d = 1.0;
const double filter_width_d = DEFAULT_BOX_RADIUS;
int windows_size;
unsigned int u;
LineContribType *res;
if (scale_d < 1.0) {
width_d = filter_wid... | false | false | false | false | false | 0 |
Seeder_WordInfo_add_Seed(Seeder *seeder,
Seeder_WordInfo *word_info,
Seeder_Context *context,
Match_Score query_expect,
gint qpos){
register Seeder_Seed *seed;
g_as... | false | false | false | false | false | 0 |
drm_modeset_lock_crtc(struct drm_crtc *crtc,
struct drm_plane *plane)
{
struct drm_modeset_acquire_ctx *ctx;
int ret;
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (WARN_ON(!ctx))
return;
drm_modeset_acquire_init(ctx, 0);
retry:
ret = drm_modeset_lock(&crtc->mutex, ctx);
if (ret)
goto fail;
if (plan... | false | false | false | false | false | 0 |
updateLastModInfo()
{
helpers::FileInfo fi;
if (helpers::getFileInfo (&fi, propertyFilename) == 0)
lastFileInfo = fi;
} | false | false | false | false | false | 0 |
get_mountport(struct pmap *pm_mnt,
struct sockaddr_in *server_addr,
long unsigned prog,
long unsigned version,
long unsigned proto,
long unsigned port)
{
struct pmaplist *pmap;
server_addr->sin_port = PMAPPORT;
/* glibc 2.4 (still) has pmap_getmaps(struct sockaddr_in *).
* I understand it like "IPv6 for this i... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
AbstractCalendarModel *_t = static_cast<AbstractCalendarModel *>(_o);
switch (_id) {
case 0: _t->dataChanged((*reinterpret_cast<... | false | false | false | false | false | 0 |
spGetSize(
spMatrix eMatrix,
int External
)
{
MatrixPtr Matrix = (MatrixPtr)eMatrix;
/* Begin `spGetSize'. */
ASSERT_IS_SPARSE( Matrix );
#if TRANSLATE
if (External)
return Matrix->ExtSize;
else
return Matrix->Size;
#else
return Matrix->Size;
#endif
} | false | false | false | false | false | 0 |
write_code_fromdb_c(ARGUMENTS *args, GWEN_XMLNODE *node,
GWEN_SYNCIO *sio) {
const char *prefix;
const char *styp;
const char *fromDbName;
const char *fromDbAcc;
prefix=get_struct_property(node, "prefix", 0);
if (!prefix) {
DBG_ERROR(0, "No prefix in struct");
return -1;
}... | false | false | false | false | false | 0 |
numeric_uminus(PG_FUNCTION_ARGS)
{
Numeric num = PG_GETARG_NUMERIC(0);
Numeric res;
/*
* Handle NaN
*/
if (NUMERIC_IS_NAN(num))
PG_RETURN_NUMERIC(make_result(&const_nan));
/*
* Do it the easy way directly on the packed format
*/
res = (Numeric) palloc(VARSIZE(num));
memcpy(res, num, VARSIZE(num));
... | false | true | false | false | false | 1 |
automember_add_member_value(Slapi_Entry *member_e, const char *group_dn, char *grouping_attr,
char *grouping_value, PRFileDesc *ldif_fd)
{
Slapi_PBlock *mod_pb = slapi_pblock_new();
int result = LDAP_SUCCESS;
LDAPMod mod;
LDAPMod *mods[2];
char *vals[2];
char *member_... | false | false | false | false | false | 0 |
gst_pad_push_list (GstPad * pad, GstBufferList * list)
{
GstBuffer *buf;
GstPadPushCache *cache;
GstFlowReturn ret;
gpointer *cache_ptr;
GstPad *peer;
GstCaps *caps;
g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_PAD_IS_SRC (pad), GST_FLOW_ERROR);
g_return_val_if_f... | false | false | false | false | false | 0 |
ft_stroke_border_export( FT_StrokeBorder border,
FT_Outline* outline )
{
/* copy point locations */
FT_ARRAY_COPY( outline->points + outline->n_points,
border->points,
border->num_points );
/* copy tags */
{
FT_UInt count ... | false | true | false | false | true | 1 |
mt6397_set_buck_vosel_reg(struct platform_device *pdev)
{
struct mt6397_chip *mt6397 = dev_get_drvdata(pdev->dev.parent);
int i;
u32 regval;
for (i = 0; i < MT6397_MAX_REGULATOR; i++) {
if (mt6397_regulators[i].vselctrl_reg) {
if (regmap_read(mt6397->regmap,
mt6397_regulators[i].vselctrl_reg,
®val)... | false | false | false | false | false | 0 |
removeBranchesBelowThreshold(CallerNode* root)
{
int i;
int max;
if (!root)
return (0);
for (i = 0; i < root->noCallees; i++)
{
if (removeBranchesBelowThreshold(root->callees[i]))
{
free(root->callees[i]);
if (root->noCallees > 1)
{
root->callees[i] = root->callees[root->noCallees - 1];
roo... | false | false | false | false | false | 0 |
serializeList(const QList<QByteArray> &list)
{
QByteArray value = "";
if (!list.isEmpty()) {
QList<QByteArray>::ConstIterator it = list.constBegin();
const QList<QByteArray>::ConstIterator end = list.constEnd();
value = QByteArray(*it).replace('\\', "\\\\").replace(',', "\\,");
... | false | false | false | false | false | 0 |
auth_sasldb (
/* PARAMETERS */
#ifdef AUTH_SASLDB
const char *login, /* I: plaintext authenticator */
const char *password, /* I: plaintext password */
const char *service __attribute__((unused)),
const char *realm
#else
const char *login __attribute__((unused)),/* I: plaintext authenticator */
const ... | false | false | false | false | false | 0 |
qrihrm(real_t **a, int n, real_t val[], real_t **vr, real_t **vi,
real_t em[])
{
real_t *allocate_real_vector(int, int);
void free_real_vector(real_t *, int);
void hshhrmtri(real_t **, int, real_t [], real_t [], real_t [],
real_t [], real_t [], real_t []);
int qrisymtri(real_t **, int, real_t [], real_t [... | false | false | false | false | false | 0 |
_nrrdCopy(Nrrd *nout, const Nrrd *nin, int bitflag) {
static const char me[]="_nrrdCopy";
size_t size[NRRD_DIM_MAX];
if (!(nin && nout)) {
biffAddf(NRRD, "%s: got NULL pointer", me);
return 1;
}
if (nout == nin) {
/* its not the case that we have nothing to do- the semantics of
copying can... | false | true | false | false | false | 1 |
gcr_certificate_get_fingerprint_hex (GcrCertificate *self, GChecksumType type)
{
GChecksum *sum;
guchar *digest;
gsize n_digest;
gssize length;
gchar *hex;
g_return_val_if_fail (GCR_IS_CERTIFICATE (self), NULL);
sum = digest_certificate (self, type);
if (sum == NULL)
return NULL;
length = g_checksum_type_... | false | false | false | false | false | 0 |
collection_table_popup_print_cb(GtkWidget *widget, gpointer data)
{
CollectTable *ct = data;
FileData *fd;
fd = (ct->click_info) ? ct->click_info->fd : NULL;
print_window_new(fd, collection_table_selection_get_list(ct), collection_table_get_list(ct), ct->listview);
} | false | false | false | false | false | 0 |
flip_screen_x_set(int on)
{
if (on) on = ~0;
if (flip_screen_x != on)
{
set_vh_global_attribute(&flip_screen_x,on);
updateflip();
}
} | false | false | false | false | false | 0 |
mca_btl_sctp_set_socket_options(int sd)
{
int optval, flags;
struct sctp_event_subscribe evnts;
/* register io event here to see populated sndrcvinfo struct */
memset(&evnts, 0, sizeof(evnts));
evnts.sctp_data_io_event = 1;
if(setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &evnts, sizeof(evnts)) < ... | false | false | false | false | false | 0 |
routerGetPortType( struct sProfile *psProfile, const char *pnName ) {
const char *pnPortName;
int nIndex;
if ( pnName != NULL ) {
for ( nIndex = 0; nIndex < NAME_COUNT; nIndex++ ) {
pnPortName = routerGetPortName( psProfile, asPortNames[ nIndex ].pnName );
if ( strcmp( pnName, pnPortName ) == 0 ) {
retu... | false | false | false | false | false | 0 |
ce_write_entry(git_SHA_CTX *c, int fd, struct cache_entry *ce)
{
int size = ondisk_ce_size(ce);
struct ondisk_cache_entry *ondisk = xcalloc(1, size);
char *name;
int result;
ondisk->ctime.sec = htonl(ce->ce_ctime.sec);
ondisk->mtime.sec = htonl(ce->ce_mtime.sec);
ondisk->ctime.nsec = htonl(ce->ce_ctime.nsec);
... | false | true | false | false | false | 1 |
test_kvp_frame_get_frame_or_null_slash_trash( Fixture *fixture, gconstpointer pData )
{
g_test_message( "Test null checks" );
g_assert( p_kvp_frame_get_frame_or_null_slash_trash( NULL, "test" ) == NULL );
g_assert( p_kvp_frame_get_frame_or_null_slash_trash( fixture->frame, NULL ) == NULL );
g_test_mess... | false | false | false | false | false | 0 |
AppendFortranFormatFlags(std::string& flags, cmSourceFile& source)
{
const char* srcfmt = source.GetProperty("Fortran_FORMAT");
cmLocalGenerator::FortranFormat format =
this->LocalGenerator->GetFortranFormat(srcfmt);
if(format == cmLocalGenerator::FortranFormatNone)
{
const char* tgtfmt = this->Target... | false | false | false | false | false | 0 |
TcpReadFromProxy()
{
if(!_running) {
qDebug("SOCKS read but not running");
return;
}
QTcpSocket* socket = qobject_cast<QTcpSocket*>(sender());
if(!socket) {
qWarning("SOCKS Illegal call to ReadFromClient()");
return;
}
if(!CheckSession()) {
qDebug("SOCKS read bu... | false | false | false | false | false | 0 |
ndmda_send_notice (struct ndm_session *sess)
{
struct ndm_data_agent * da = &sess->data_acb;
if (!da->data_notify_pending)
return;
da->data_notify_pending = 0;
switch (da->data_state.state) {
case NDMP9_DATA_STATE_HALTED:
ndma_notify_data_halted (sess);
break;
default:
/* Hmm. Why are we here. Race? *... | false | false | false | false | false | 0 |
memstr(const void *haystack, const char *needle, size_t n)
{
const u_char *pos = haystack;
size_t l;
if (!haystack || !needle || (l = strlen(needle)) == 0)
{
return NULL;
}
for (; n >= l; ++pos, --n)
{
if (memeq(pos, needle, l))
{
return (void*)pos;
}
}
return NULL;
} | false | false | false | false | false | 0 |
boxGuiIds()
{
return QStringList()
<< "Frameless" << "Boxed"
<< "ovalbox" << "Ovalbox"
<< "Shadowbox" << "Shaded"
<< "Doublebox";
} | false | false | false | false | false | 0 |
gf_add_cmdline_options (glusterfs_graph_t *graph, cmd_args_t *cmd_args)
{
int ret = 0;
xlator_t *trav = NULL;
xlator_cmdline_option_t *cmd_option = NULL;
trav = graph->first;
while (trav) {
list_for_each_entry (cmd_option,
... | false | false | false | false | false | 0 |
_elm_layout_smart_box_remove_all(Evas_Object *obj,
const char *part,
Eina_Bool clear)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, EINA_FALSE);
ELM_LAYOUT_DATA_GET(obj, sd);
Elm_Layout_Sub_Object_Data *sub_d;
Eina_List *lst;
lst = eina_list_c... | false | false | false | false | false | 0 |
store_attrs(struct mthca_sqp *sqp, const struct ib_qp_attr *attr,
int attr_mask)
{
if (attr_mask & IB_QP_PKEY_INDEX)
sqp->pkey_index = attr->pkey_index;
if (attr_mask & IB_QP_QKEY)
sqp->qkey = attr->qkey;
if (attr_mask & IB_QP_SQ_PSN)
sqp->send_psn = attr->sq_psn;
} | false | false | false | false | false | 0 |
apple_input_mapped(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
struct apple_sc *asc = hid_get_drvdata(hdev);
if (asc->quirks & APPLE_MIGHTYMOUSE) {
if (usage->hid == HID_GD_Z)
hid_map_usage(hi, usage, bit, max, EV_REL, REL... | false | false | false | false | false | 0 |
accept_table_arg(struct Table *table, char *arg) {
if (table->name == NULL) {
table->name = strdup(arg);
if (table->name == NULL) {
perror("strdup");
return -1;
}
} else {
fprintf(stderr, "Unexpected table argument: %s\n", arg);
return -1;
}
... | false | false | false | false | false | 0 |
flushOutputBuffer()
{
if (outputBufCount_)
{
// flush from outputBufStart_ to end of data or end of buffer, whatever comes first
offile_off_t numBytes = (outputBufStart_ + outputBufCount_ > DCMZLIBOUTPUTFILTER_BUFSIZE) ?
(DCMZLIBOUTPUTFILTER_BUFSIZE - outputBufStart_) : outputBufCount_ ;
offile_o... | false | false | false | false | false | 0 |
efivarfs_ioc_getxflags(struct file *file, void __user *arg)
{
struct inode *inode = file->f_mapping->host;
unsigned int i_flags;
unsigned int flags = 0;
i_flags = inode->i_flags;
if (i_flags & S_IMMUTABLE)
flags |= FS_IMMUTABLE_FL;
if (copy_to_user(arg, &flags, sizeof(flags)))
return -EFAULT;
return 0;
} | false | false | false | false | false | 0 |
GetFirst(Iterator *itrav)
{
struct TreeMapIterator *trav = (struct TreeMapIterator *)itrav;
if (trav->timestamp != trav->bst_table->timestamp)
return NULL;
trav->bst_node = bt_first(trav->bst_table);
if (trav->bst_node)
return trav->bst_node->data;
return NULL;
} | false | false | false | false | false | 0 |
cpl_errorstate_set(cpl_errorstate self)
{
const size_t myself = (const size_t)self;
if (myself == 0) {
cpl_error_reset();
} else if (myself < estate.current) {
if (!cpl_error_is_readonly()) estate.current = myself;
}
} | false | false | false | false | false | 0 |
OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert)
{
if (!resp->certs && !(resp->certs = sk_X509_new_null()))
return 0;
if(!sk_X509_push(resp->certs, cert)) return 0;
CRYPTO_add(&cert->references, 1, CRYPTO_LOCK_X509);
return 1;
} | false | false | false | false | false | 0 |
test_must(void)
{
char *pc;
if(must) return 1;
pc=getenv("chroot"); if(pc && strcmp(pc,"must")==0) return 1;
else return 0;
} | false | false | true | false | true | 1 |
WidenVecRes_EXTRACT_SUBVECTOR(SDNode *N) {
EVT VT = N->getValueType(0);
EVT WidenVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
unsigned WidenNumElts = WidenVT.getVectorNumElements();
SDValue InOp = N->getOperand(0);
SDValue Idx = N->getOperand(1);
DebugLoc dl = N->getDebugLoc();
if (... | false | false | false | false | false | 0 |
pci_serr_error(unsigned char reason, struct pt_regs *regs)
{
/* check to see if anyone registered against these types of errors */
if (nmi_handle(NMI_SERR, regs))
return;
pr_emerg("NMI: PCI system error (SERR) for reason %02x on CPU %d.\n",
reason, smp_processor_id());
/*
* On some machines, PCI SERR line ... | false | false | false | false | false | 0 |
_sel_desk_cb(void *data)
{
E_Config_Dialog_Data *cfdata = data;
if (cfdata->seldest)
{
const char *s = e_widget_ilist_selected_value_get(cfdata->obj.deflist);
if (*(cfdata->seldest)) eina_stringshare_del(*(cfdata->seldest));
*(cfdata->seldest) = NULL;
if (s) *(cfdata->seldest)... | false | false | false | false | false | 0 |
AddTextureSampleWrapperInvocation(UniformParameterPtr textureSampler,UniformParameterPtr textureSamplerState,
GpuConstantType samplerType, Function* function, int groupOrder, int& internalCounter)
{
FunctionInvocation* curFuncInvocation = NULL;
ParameterPtr samplerWrapperParam = GetSamplerWrapperParam(te... | false | false | false | false | false | 0 |
alias_lookup_cb(const char *k, const char *v, void *cb)
{
if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) {
if (!v)
return config_error_nonbool(k);
alias_val = xstrdup(v);
return 0;
}
return 0;
} | false | false | false | false | false | 0 |
gnl_object_to_media_time (GnlObject * object, GstClockTime otime,
GstClockTime * mtime)
{
g_return_val_if_fail (mtime, FALSE);
GST_DEBUG_OBJECT (object, "ObjectTime : %" GST_TIME_FORMAT,
GST_TIME_ARGS (otime));
GST_DEBUG_OBJECT (object,
"Start/Stop:[%" GST_TIME_FORMAT " -- %" GST_TIME_FORMAT "] ... | false | false | false | false | false | 0 |
JPEG_ProcessData(GF_MediaDecoder *ifcg,
char *inBuffer, u32 inBufferLength,
u16 ES_ID,
char *outBuffer, u32 *outBufferLength,
u8 PaddingBits, u32 mmlevel)
{
#ifndef GPAC_DISABLE_AV_PARSERS
GF_Err e;
JPEGCTX();
e = gf_img_jpeg_dec(inBuffer, inBufferLength, &ctx->width, &ctx->height, &ctx->pixel_format, outB... | false | false | false | false | false | 0 |
powerclamp_adjust_controls(unsigned int target_ratio,
unsigned int guard, unsigned int win)
{
static u64 msr_last, tsc_last;
u64 msr_now, tsc_now;
u64 val64;
/* check result for the last window */
msr_now = pkg_state_counter();
tsc_now = rdtsc();
/* calculate pkg cstate vs tsc ratio */
if (!msr_last || !t... | false | false | false | false | false | 0 |
stdIn() const {
File* f = new File( GetContext() );
if( !f->Open( stdin, QFile::ReadOnly ) ) return QVariant();
return GetContext()->AddObjToJSContext( f );
} | false | false | false | false | false | 0 |
start_listener(slistener * l)
{
if (network_listen(l->nlistener)) {
oklog("LISTEN: #%d now listening on %s\n", l->oid, l->name);
return 1;
} else {
errlog("LISTEN: Can't start #%d listening on %s!\n", l->oid, l->name);
return 0;
}
} | false | false | false | false | false | 0 |
multi_team_set_captain(net_player *pl,int set)
{
// only the host should ever get here!
Assert(Net_player->flags & NETINFO_FLAG_AM_MASTER);
// set the player flags as being a captain and notify everyone else of this
if(set){
nprintf(("Network","MULTI TEAM : Server setting player %s team %d captain\n",pl->m_playe... | false | false | false | false | false | 0 |
GPS_Util_Put_Short(UC* s, const US v)
{
UC* p;
p = (UC*)&v;
if (!GPS_Little) {
*s++ = *(p+1);
*s = *p;
} else {
*s++ = *p;
*s = *(p+1);
}
return;
} | false | false | false | false | false | 0 |
load_pixbuf(IconInfo *ico, const gchar *name)
{
const gchar *fname;
IconGfx *ig;
ig = g_malloc(sizeof *ig);
g_strlcpy(ig->name, name, sizeof ig->name);
if(strcmp(name, ICON_NONE) == 0) /* Is it the special, reserved, blank icon? */
{
ig->pixbuf = ico->empty;
return ig;
}
if((fname = fut_locate(ico->path,... | false | false | false | false | false | 0 |
init_uni_dc_tab(void)
{
int level, uni_code, uni_len;
for(level=-256; level<256; level++){
int size, v, l;
/* find number of bits */
size = 0;
v = abs(level);
while (v) {
v >>= 1;
size++;
}
if (level < 0)
l= (-level) ^... | false | false | false | false | false | 0 |
_add_acl_pattern(struct mosquitto_db *db, const char *topic, int access)
{
struct _mosquitto_acl *acl, *acl_tail;
char *local_topic;
if(!db || !topic) return MOSQ_ERR_INVAL;
local_topic = _mosquitto_strdup(topic);
if(!local_topic){
return MOSQ_ERR_NOMEM;
}
acl = _mosquitto_malloc(sizeof(struct _mosquitto_ac... | false | false | false | false | false | 0 |
makePolyline(graph_t* g, edge_t * e)
{
Ppolyline_t spl, line = ED_path(e);
Ppoint_t p0, q0;
p0 = line.ps[0];
q0 = line.ps[line.pn - 1];
make_polyline (line, &spl);
if (Verbose > 1)
fprintf(stderr, "polyline %s %s\n", agnameof(agtail(e)), agnameof(aghead(e)));
clip_and_install(e, aghead(e),... | false | false | false | false | false | 0 |
update_option(const char *this, char *val, int flags)
{
struct opt_list *po;
SLIST_FOREACH(po, &otab, o_next) {
if (eq(po->o_name, this)) {
free(po->o_file);
po->o_file = val;
po->o_flags = flags;
return;
}
}
/*
* Option not found, but that's OK, we just ignore it since it
* may be for another ... | false | false | false | false | false | 0 |
git_repository_is_empty(git_repository *repo)
{
git_reference *head = NULL;
int is_empty = 0;
if (git_reference_lookup(&head, repo, GIT_HEAD_FILE) < 0)
return -1;
if (git_reference_type(head) == GIT_REF_SYMBOLIC)
is_empty =
(strcmp(git_reference_symbolic_target(head),
GIT_REFS_HEADS_DIR "master") == 0... | false | false | false | false | false | 0 |
in_conditional (NODE_T *p)
{
for (; p != NO_NODE; FORWARD (p))
{
if (IS (p, IF_PART) || IS (p, ELIF_IF_PART)) {
NODE_T *what = NO_NODE;
int pop_ind = ind;
put_sym (SUB (p), KEYWORD);
BLANK;
ind = col;
in_serial (NEXT_SUB (p), !ONE_LINER, &what);
ind = pop_ind;
put... | false | false | false | false | false | 0 |
get_probe(const char* description) {
int i;
for (i = 0; i < ARRAY_SIZE(builtins); i++) {
if (!strcmp(builtins[i].description, description)) {
return builtins[i].probe;
}
}
/* Special case of "regex" probe (we don't want to set it in builtins
* because builtins is also u... | false | false | false | false | false | 0 |
script_add_library(void* closurev, const char* name, size_t length)
{
Parser_closure* closure = static_cast<Parser_closure*>(closurev);
std::string name_string(name, length);
if (name_string[0] != 'l')
gold_error(_("library name must be prefixed with -l"));
Input_file_argument file(name_string.c_str()... | false | false | false | false | false | 0 |
get_pci_device_id(drm_intel_bufmgr_gem *bufmgr_gem)
{
char *devid_override;
int devid;
int ret;
drm_i915_getparam_t gp;
if (geteuid() == getuid()) {
devid_override = getenv("INTEL_DEVID_OVERRIDE");
if (devid_override) {
bufmgr_gem->no_exec = true;
return strtod(devid_override, NULL);
}
}
VG_CLEAR(d... | false | false | false | false | true | 1 |
get_col(const MAT *mat, unsigned int col, VEC *vec)
#endif
{
unsigned int i;
if ( mat==(MAT *)NULL )
error(E_NULL,"get_col");
if ( col >= mat->n )
error(E_RANGE,"get_col");
if ( vec==(VEC *)NULL || vec->dim<mat->m )
vec = v_resize(vec,mat->m);
for ( i=0; i<mat->m; i++ )
vec->v... | false | false | false | true | false | 1 |
cib_notify_send(xmlNode * xml)
{
struct iovec *iov;
struct cib_notification_s update;
ssize_t rc = crm_ipc_prepare(0, xml, &iov);
crm_trace("Notifying clients");
if (rc > 0) {
update.msg = xml;
update.iov = iov;
g_hash_table_foreach_remove(client_connections, cib_notify_se... | false | false | false | false | false | 0 |
say_last_char(struct vc_data *vc)
{
int len = get_line(vc);
u_char ch;
spk_parked |= 0x01;
if (len == 0) {
synth_printf("%s\n", spk_msg_get(MSG_BLANK));
return;
}
ch = buf[--len];
spk_pos -= (spk_x - len) * 2;
spk_x = len;
synth_printf("%d, ", ++len);
speak_char(ch);
} | false | false | false | false | false | 0 |
gt_BWTSeqCRLoad(const BWTSeq *bwtSeq,
const char *projectName,
short mapIntervalLog2)
{
unsigned long seqLen;
unsigned short bitsPerUlong;
BWTSeqContextRetriever *gt_newBWTSeqCR;
gt_assert(bwtSeq && projectName);
seqLen = BWTSeqLength(bwtSeq);
bitsPerUlong = requiredUlongBits(seqLe... | false | false | false | false | false | 0 |
notifyImageInfo(int _width, int _height)
{
if (!ImageManager::isAcceptableSize(_width, _height)) {
kWarning() << "ImageLoader somehow fed us an illegal size, killing it!";
loadError();
return;
}
width = _width;
height = _height;
owner->imageHasGeometry(this, width, height);... | false | false | false | false | false | 0 |
vnic_wq_get_ctrl(struct vnic_dev *vdev, struct vnic_wq *wq,
unsigned int index, enum vnic_res_type res_type)
{
wq->ctrl = svnic_dev_get_res(vdev, res_type, index);
if (!wq->ctrl)
return -EINVAL;
return 0;
} | false | false | false | false | false | 0 |
string_sum(register unsigned char *aar, unsigned int dim)
{register unsigned char *endar;
register unsigned int count = 0;
endar=aar+dim;
for ( ; aar< endar; aar++)
count += *aar;
return count;
} | false | false | false | false | false | 0 |
read_name_map (pfile, dirname)
cpp_reader *pfile;
const char *dirname;
{
struct file_name_map_list *map_list_ptr;
char *name;
FILE *f;
/* Check the cache of directories, and mappings in their remap file. */
for (map_list_ptr = CPP_OPTION (pfile, map_list); map_list_ptr;
map_list_ptr = map_l... | false | false | false | false | false | 0 |
_e_fm_op_idler_handle_error(int *mark, Eina_List **queue, Eina_List **node, E_Fm_Op_Task *task)
{
if (_e_fm_op_overwrite)
{
if (_e_fm_op_overwrite_response != E_FM_OP_NONE)
{
task->overwrite = _e_fm_op_overwrite_response;
_e_fm_op_work_error = 0;
_e_fm_op... | false | false | false | false | false | 0 |
pluto_dma_end(struct pluto *pluto, unsigned int nbpackets)
{
/* synchronize the DMA transfer with the CPU
* first so that we see updated contents. */
pci_dma_sync_single_for_cpu(pluto->pdev, pluto->dma_addr,
TS_DMA_BYTES, PCI_DMA_FROMDEVICE);
/* Workaround for broken hardware:
* [1] On startup NBPACKETS seem... | false | false | false | false | false | 0 |
tree_book_name(struct board *b)
{
static char buf[256];
if (b->handicap > 0) {
sprintf(buf, "ucttbook-%d-%02.01f-h%d.pachitree", b->size - 2, b->komi, b->handicap);
} else {
sprintf(buf, "ucttbook-%d-%02.01f.pachitree", b->size - 2, b->komi);
}
return buf;
} | false | false | false | false | false | 0 |
cpl_matrix_fill(cpl_matrix *matrix, double value)
{
cpl_size size;
double *m;
if (matrix == NULL)
return cpl_error_set_(CPL_ERROR_NULL_INPUT);
size = matrix->nr * matrix->nc;
m = matrix->m;
while (size--)
*m++ = value;
return CPL_ERROR_NONE;
} | false | false | false | false | false | 0 |
PortUnRegister(jack_port_id_t port_index)
{
CheckClient("PortUnRegister");
int res = fClient->PortUnRegister(port_index);
fOpenPortNumber--;
int i;
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
if (fPortList[i].idport == port_index) { ... | false | false | false | false | false | 0 |
script_parse_url(char *url, struct http_parser_url *parts) {
if (!http_parser_parse_url(url, strlen(url), 0, parts)) {
if (!(parts->field_set & (1 << UF_SCHEMA))) return 0;
if (!(parts->field_set & (1 << UF_HOST))) return 0;
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
esas2r_unmap_regions(struct esas2r_adapter *a)
{
if (a->regs)
iounmap((void __iomem *)a->regs);
a->regs = NULL;
pci_release_region(a->pcid, 2);
if (a->data_window)
iounmap((void __iomem *)a->data_window);
a->data_window = NULL;
pci_release_region(a->pcid, 0);
} | false | false | false | false | false | 0 |
decode(const UINT8*in, UINT32 inlen, UINT8*out, UINT32*outlen)
{
if(outlen==NULL)
return E_UNKNOWN;
if(in==NULL||inlen==0)
{
*outlen=0;
return E_SUCCESS;
}
EVP_ENCODE_CTX oCTX;
EVP_DecodeInit(&oCTX);
int len=0;
*outlen=0;
//ensure that in and out are disjunct - otherwise copy in
if(((out>=in)&&(in+inlen... | false | false | false | false | false | 0 |
getg(double w, double *g[2], int size)
{
long i, j, totsize, n, g_row;
float rsq, sigma, two_ssq, val, sum = 0.0;
totsize = size * size;
n = size / 2;
for (i = 0; i < totsize; i++) {
*(g[0] + i) = 0.0;
*(g[1] + i) = 0.0;
}
sigma = w / (2.0 * sqrt((double)2.0));
two_ssq = 2.0 * sigma ... | false | false | false | false | false | 0 |
ves_icall_System_Net_Sockets_Socket_Send_array_internal(SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *error)
{
int ret, count;
DWORD sent;
WSABUF *wsabufs;
DWORD sendflags = 0;
gboolean interrupted;
*error = 0;
wsabufs = mono_array_addr (buffers, WSABUF, 0);
count = mono_array_length (buffers);
... | 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.