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 |
|---|---|---|---|---|---|---|
gt_disable_warnings(bool disable)
{
fprintf(stderr, "disable warnings\n");
if (disable)
old_handler = g_log_set_default_handler(disabled_handler, NULL);
else
g_log_set_default_handler(old_handler, NULL);
fprintf(stderr, "enable warnings\n");
} | false | false | false | false | false | 0 |
Press() {
if (subject != nil) {
subject->SetValue(value);
} else {
Refresh();
}
} | false | false | false | false | false | 0 |
IDirectFBSurface_Window_Release( IDirectFBSurface *thiz )
{
DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Window)
D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz );
if (--data->base.ref == 0)
IDirectFBSurface_Window_Destruct( thiz );
return DFB_OK;
} | false | false | false | false | false | 0 |
msock_word_out2(WORD_ID w, RecogProcess *r)
{
int j;
static char buf[MAX_HMMNAME_LEN];
WORD_INFO *winfo;
winfo = r->lm->winfo;
if (out2_word) {
module_send(module_sd, " WORD=\"%s\"", winfo->woutput[w]);
}
if (out2_lm) {
module_send(module_sd, " CLASSID=\"%s\"", winfo->wname[w]);
}
if (out2_p... | false | false | false | false | false | 0 |
BasicUIReadDir(char *filename, int *isdir)
{
struct dirent *entry;
char fullfilename[FILENAME_MAX];
struct stat st;
entry = readdir(dp);
if (entry == NULL) {
closedir(dp);
dp = NULL;
return FALSE;
}
strcpy(filename, entry->d_name);
Util_catpath(fullfilename, dir_path, entry->d_name);
stat(fullfilename, &... | false | false | false | false | false | 0 |
textNeedsXmlEscaping(const std::string& data, bool isCdata)
{
if(isCdata)
return (std::string::npos != data.find_first_of("&<>"));
else
return (std::string::npos != data.find_first_of("&<>'\""));
} | false | false | false | false | false | 0 |
mca_mpool_base_tree_delete(mca_mpool_base_tree_item_t* item) {
int rc;
OPAL_THREAD_LOCK(&tree_lock);
rc = ompi_rb_tree_delete(&mca_mpool_base_tree, item->key);
OPAL_THREAD_UNLOCK(&tree_lock);
return rc;
} | false | false | false | false | false | 0 |
print_version (char *program_name, const char *version,
int no_header, bool version_only)
{
if (no_header == 0) {
report( stdout,
"%s version %s\nCopyright (c) 2003, 2004, 2005, 2007, 2008, 2011 R. Bernstein\n",
program_name, version);
report( stdout,
_("This is free soft... | false | false | false | false | false | 0 |
validate_amr_codecs (CodecCap *codec_cap)
{
/* we assume we have just one structure per caps as it should be */
GstStructure *media_struct = gst_caps_get_structure (codec_cap->caps, 0);
const gchar *name = gst_structure_get_name (media_struct);
GstStructure *rtp_struct;
const gchar *encoding_name;
rtp_stru... | false | false | false | false | false | 0 |
valpina_(unsigned char * grib, fortint* ioffset, fortint* iindex) {
/*
// A GRIB product starts at 'grib' and contains missing/non-missing values
// as described by a bitmap which is at position 'offset' in the GRIB.
//
// 'index' is the position of a point (missing/non-missing) in the field.
// If index = 0, the s... | false | false | false | false | false | 0 |
_scsih_set_fwfault_debug(const char *val, struct kernel_param *kp)
{
int ret = param_set_int(val, kp);
struct MPT3SAS_ADAPTER *ioc;
if (ret)
return ret;
/* global ioc spinlock to protect controller list on list operations */
pr_info("setting fwfault_debug(%d)\n", mpt3sas_fwfault_debug);
spin_lock(&gioc_lock);... | false | false | false | false | false | 0 |
Rt_AllocCommand(clientData, interp, objc, objv)
ClientData clientData;
Tcl_Interp *interp;
int objc;
Tcl_Obj * const objv[];
{
int i;
Tcl_Obj *pRet;
pRet = Tcl_NewObj();
for (i = 0; aResNames[i]; i++) {
Tcl_Obj *pName = Tcl_NewStringObj(aResNames[i],-1);
Tcl_ListObjAppendElemen... | false | false | false | false | false | 0 |
fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
buffer_append_string_buffer(b, host->id);
if (proc) {
buffer_append_string_len(b, CONST_STR_LEN("."));
buffer_append_long(b, proc->id);
}
} | false | false | false | false | false | 0 |
InverseTransform(const R2Affine& affine)
{
// Transform affine transformation
if (affine.mirror) mirror = !mirror;
matrix = matrix * affine.InverseMatrix();
} | false | false | false | false | false | 0 |
gl_mini_preview_set_draw_arrow (glMiniPreview *this,
gboolean draw_arrow_flag)
{
if ( draw_arrow_flag != this->priv->draw_arrow_flag )
{
this->priv->draw_arrow_flag = draw_arrow_flag;
redraw (this);
}
} | false | false | false | false | false | 0 |
gl_file_save_as (glLabel *label,
glWindow *window)
{
GtkWidget *chooser;
GtkFileFilter *filter;
gboolean saved_flag = FALSE;
gchar *name, *title;
gl_debug (DEBUG_FILE, "START");
g_return_val_if_fail (label && GL_IS_LABEL(label), FALSE);
g_return_val_if_fail (window && GL_IS_... | false | false | false | false | false | 0 |
move_waypoints(level *EditLevel, int x, int y)
{
waypoint *wpts = EditLevel->waypoints.arr;
int i;
for (i = 0; i < EditLevel->waypoints.size; i++) {
// Move the waypoint
wpts[i].x += x;
wpts[i].y += y;
if (!pos_inside_level(wpts[i].x, wpts[i].y, EditLevel)) {
// When the waypoint is outside of the map, ... | false | false | false | false | false | 0 |
changeHideShowState()
{
if ( mayBeHide() ){
undock();
return;
}
if ( mayBeShow() ){
if ( manager->main->inherits("K3DockMainWindow") ){
((K3DockMainWindow*)manager->main)->makeDockVisible(this);
} else {
makeDockVisible();
}
}
} | false | false | false | false | false | 0 |
pos2type(__isl_keep isl_space *dim, unsigned *pos)
{
enum isl_dim_type type;
unsigned n_in = isl_space_dim(dim, isl_dim_in);
unsigned n_out = isl_space_dim(dim, isl_dim_out);
unsigned nparam = isl_space_dim(dim, isl_dim_param);
if (*pos < 1 + nparam) {
type = isl_dim_param;
*pos -= 1;
} else if (*pos < 1 + n... | false | false | false | false | false | 0 |
sizeofCalculation()
{
if (!_settings->_checkCodingStyle)
return;
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
{
if (Token::simpleMatch(tok, "sizeof ("))
{
unsigned int parlevel = 0;
for (const Token *tok2 = tok->tokAt(2); tok2; tok2 = ... | false | false | false | false | false | 0 |
radeon_enable_vblank(struct drm_device *dev, unsigned int pipe)
{
drm_radeon_private_t *dev_priv = dev->dev_private;
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600) {
switch (pipe) {
case 0:
r500_vbl_irq_set_state(dev, R500_D1MODE_INT_MASK, 1);
break;
case 1:
r500_vbl_irq_set_state(dev, R500... | false | false | false | false | false | 0 |
connectFailureMessage(PGconn *conn, int errorno)
{
char sebuf[256];
#ifdef HAVE_UNIX_SOCKETS
if (IS_AF_UNIX(conn->raddr.addr.ss_family))
{
char service[NI_MAXHOST];
pg_getnameinfo_all(&conn->raddr.addr, conn->raddr.salen,
NULL, 0,
service, sizeof(service),
NI_NUMERICSERV);
printf... | false | false | false | false | false | 0 |
usbSendControlMsg(USBDevice *dev, USBEndpoint ep,
uint8_t bRequest, uint8_t bmRequestType,
uint16_t wValue, uint16_t wIndex, uint16_t wLength,
void *data, int timeout)
{
int error;
struct usbdevfs_ctrltransfer ctrl;
error = usbOpen(dev, 1);
if (error < 0)
return error;
#if LINU... | false | false | false | false | false | 0 |
urf_session_checker_bus_proxy_signal_cb (GDBusProxy *proxy,
gchar *sender_name,
gchar *signal_name,
GVariant *parameters,
gpointer user_data)
{
UrfSessionC... | false | false | false | false | false | 0 |
ci_hdrc_imx_suspend(struct device *dev)
{
int ret;
struct ci_hdrc_imx_data *data = dev_get_drvdata(dev);
if (data->in_lpm)
/* The core's suspend doesn't run */
return 0;
if (device_may_wakeup(dev)) {
ret = imx_usbmisc_set_wakeup(data->usbmisc_data, true);
if (ret) {
dev_err(dev, "usbmisc set_wakeup fa... | false | false | false | false | false | 0 |
config_postread()
{
if (config_windows_save && config_windows_layout) {
char **targets = array_make(config_windows_layout, "|", 0, 0, 0);
int i;
for (i = 1; targets[i]; i++) {
char *tmp;
if (!xstrcmp(targets[i], "\"-\""))
continue;
if (xstrcmp(targets[i], "") && (tmp = xstrrchr(targets[i], '/')))... | false | false | false | false | false | 0 |
_equalGrantStmt(GrantStmt *a, GrantStmt *b)
{
COMPARE_SCALAR_FIELD(is_grant);
COMPARE_SCALAR_FIELD(objtype);
COMPARE_NODE_FIELD(objects);
COMPARE_NODE_FIELD(privileges);
COMPARE_NODE_FIELD(grantees);
COMPARE_SCALAR_FIELD(grant_option);
COMPARE_SCALAR_FIELD(behavior);
return true;
} | false | false | false | false | false | 0 |
_PR_MapOptionName(
PRSockOption optname, PRInt32 *level, PRInt32 *name)
{
static PRInt32 socketOptions[PR_SockOpt_Last] =
{
0, SO_LINGER, SO_REUSEADDR, SO_KEEPALIVE, SO_RCVBUF, SO_SNDBUF,
IP_TTL, IP_TOS, IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP,
IP_MULTICAST_IF, IP_MULTICAST_TTL, IP_MUL... | false | false | false | false | false | 0 |
frag_rel_pos(int a1,int b1,int a2,int b2)
{
int ret;
ret=FALSE;
if(a1-b1==a2-b2) {
if(a2<a1)
ret=TRUE;
}
else {
if(a2+ktup-1<a1 && b2+ktup-1<b1)
ret=TRUE;
}
return ret;
} | false | false | false | false | false | 0 |
point_double(curve_point *cp)
{
int i;
uint32_t temp;
bignum256 lambda, xr, yr;
if (point_is_infinity(cp)) {
return;
}
if (bn_is_zero(&(cp->y))) {
point_set_infinity(cp);
return;
}
// lambda = 3/2 x^2 / y
lambda = cp->y;
bn_inverse(&lambda, &prime256k1);
bn_multiply(&cp->x, &lambda, &prime256k1);
bn... | false | false | false | false | false | 0 |
A_CheckTargetVisible2(mobj_t* actor)
{
if(!actor->target || actor->target->health <= 0 ||
!P_CheckSight(actor, actor->target))
{
P_SetMobjState(actor, actor->info->seestate);
}
} | false | false | false | false | false | 0 |
reschedule_retry(struct r1bio *r1_bio)
{
unsigned long flags;
struct mddev *mddev = r1_bio->mddev;
struct r1conf *conf = mddev->private;
spin_lock_irqsave(&conf->device_lock, flags);
list_add(&r1_bio->retry_list, &conf->retry_list);
conf->nr_queued ++;
spin_unlock_irqrestore(&conf->device_lock, flags);
wake_u... | false | false | false | false | false | 0 |
NChelp(cp)
register CHANNEL *cp;
{
static char LINE1[] = "For more information, contact \"";
static char LINE2[] = "\" at this machine.";
register NCDISPATCH *dp;
WCHANappend(cp, NNTP_HELP_FOLLOWS,STRLEN(NNTP_HELP_FOLLOWS));
WCHANappend(cp, NCterm,STRLEN(NCterm));
for (dp = NCcommands; dp... | false | false | false | false | false | 0 |
GetModeLine(int& w, int& h)
{
// method to detect screen resolution in pixels
// e.g. when user switches resolution with Ctrl Alt '+'
if (!dpy)
return;
// this could be called either under SDL or
// within SDL context - thus open/close new connectins
// for this query - not very efficient but safe
// an... | false | false | false | false | false | 0 |
dcmchk(
const char* ifname,
E_FileReadMode readMode,
E_TransferSyntax xfer,
OFBool showFullData,
OFBool loadAllDataInMemory,
int& dderrors)
{
DcmFileFormat *ds = new DcmFileFormat();
OFCondition cond = ds->loadFile(ifname, xfer, EGL_noChange, DCM_MaxReadLength, readMode);
if (! cond.good())
... | false | false | false | false | false | 0 |
modestack_mode_simple_real(const char *source, channel_t *channel, int dir, int flags)
{
struct modestackdata *md;
if (flags == 0)
return;
md = modestack_init(source, channel);
modestack_add_simple(md, dir, flags);
if (!md->event)
md->event = event_add_once("flush_cmode_callback", modestack_flush_callback, md... | false | false | false | false | false | 0 |
modperl_constants_group_lookup_modperl(const char *name)
{
switch (*name) {
case 'c':
if(strEQ("common", name))
return MP_constants_modperl_common;
break;
};
Perl_croak_nocontext("unknown modperl:: group `%s'", name);
return NULL;
} | false | false | false | false | false | 0 |
Cudd_SymmProfile(
DdManager * table,
int lower,
int upper)
{
int i,x,gbot;
int TotalSymm = 0;
int TotalSymmGroups = 0;
for (i = lower; i <= upper; i++) {
if (table->subtables[i].next != (unsigned) i) {
x = i;
(void) fprintf(table->out,"Group:");
do {
(void) fprintf(table->out,... | false | false | false | false | false | 0 |
posix_read(PyObject *self, PyObject *args)
{
int fd, size;
Py_ssize_t n;
PyObject *buffer;
if (!PyArg_ParseTuple(args, "ii:read", &fd, &size))
return NULL;
if (size < 0) {
errno = EINVAL;
return posix_error();
}
buffer = PyBytes_FromStringAndSize((char *)NULL, size);
... | false | false | false | false | false | 0 |
hs1siv_subkeygen(hs1siv_ctx_t *ctx, void *user_key, unsigned key_bytes)
{
unsigned char chacha_key[32];
unsigned char iv[12] = {0};
unsigned i=0;
/* Copy user_key as many times as needed to fill 32 byte chacha key */
while (i < 32) {
unsigned nbytes = 32-i;
if (nbytes > key_bytes) n... | true | true | false | false | false | 1 |
gpk_dbus_task_finished_cb (GpkDbusTask *task, GpkDbus *dbus)
{
/* one context has returned */
if (dbus->priv->refcount > 0)
dbus->priv->refcount--;
/* reset time */
g_timer_reset (dbus->priv->timer);
g_object_unref (task);
} | false | false | false | false | false | 0 |
get_xpath_object_relative(const char *xpath, xmlNode * xml_obj, int error_level)
{
int len = 0;
xmlNode *result = NULL;
char *xpath_full = NULL;
char *xpath_prefix = NULL;
if (xml_obj == NULL || xpath == NULL) {
return NULL;
}
xpath_prefix = (char *)xmlGetNodePath(xml_obj);
len... | false | true | false | false | false | 1 |
get_tfcell(struct tfrec_t *tfrp)
{
struct t_tfcell *tfcp;
struct systsk_t *stbp;
struct sysfunc_t *sfbp;
if (tfrp->tf_func)
{
sfbp = tfrp->tfu.callx->lu.x->lu.sy->el.esyftbp;
tfcp = &(__shadow_veriusertfs[sfbp->syfnum - BASE_VERIUSERTFS]);
return(tfcp);
}
stbp = tfrp->tfu.tfstp->st.stkc.tsksyx->lu.s... | false | false | false | false | false | 0 |
_e2_task_run_processQ (E2_TaskRuntime *rt)
{
pthread_attr_t attr;
pthread_attr_init (&attr);
pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
pthread_mutex_lock (&task_mutex);
gboolean not_running = (athreadID == 0);
pthread_mutex_unlock (&task_mutex);
if (not_running)
{
//NOTE in some systems th... | false | false | false | false | false | 0 |
mmc_pwrseq_simple_alloc(struct mmc_host *host,
struct device *dev)
{
struct mmc_pwrseq_simple *pwrseq;
int ret = 0;
pwrseq = kzalloc(sizeof(*pwrseq), GFP_KERNEL);
if (!pwrseq)
return ERR_PTR(-ENOMEM);
pwrseq->ext_clk = clk_get(dev, "ext_clock");
if (IS_ERR(pwrseq->ext_clk) &&
PTR_ERR(pwrseq->ext_... | false | false | false | false | false | 0 |
horizontalLine(int x, int y, int n, char_type c)
{
for (int i = 0; i < n && i + x < xmax_; ++i)
at(x + i, y) = c;
} | false | false | false | false | false | 0 |
xml_class_init(as_object& where, const ObjectURI& uri)
{
Global_as& gl = getGlobal(where);
as_object* cl = gl.createClass(&xml_new, 0);
as_function* ctor = getMember(gl, NSV::CLASS_XMLNODE).to_function();
if (ctor) {
// XML.prototype is an XMLNode(1, "");
fn_call::Args args;
ar... | false | false | false | false | false | 0 |
tryAgain()
{
int const ms = m_retry_timer.interval();
m_retry_timer.setInterval( ms + 500 );
if (ms == 0)
// special case, don't use timer method as at very least that
// causes when event loop iteration, which is relatively slow
// when user is pissed at slow last.fm software
... | false | false | false | false | false | 0 |
popup_scheduled_view_mode_menu ( GtkWidget * button )
{
GtkWidget *menu, *item;
gchar * names[] = { _("Unique view"), _("Week view"), _("Month view"),
_("Two months view"), _("Quarter view"),
_("Year view"), _("Custom view"), NULL, };
int i;
menu = gtk_menu_new ();
for ( i = 0 ; names[... | false | false | false | false | false | 0 |
enque_PCB_to_blocked_on_receiveQ(PCB *to_enque)
{
to_enque->status = BLOCKED_ON_RECEIVE;
if (ptr_blocked_on_receiveQ->head == NULL){
ptr_blocked_on_receiveQ->head = to_enque;
}
else{
to_enque->next = ptr_blocked_on_receiveQ->head;
ptr_blocked_on_receiveQ->head = to_enque;
}
} | false | false | false | false | false | 0 |
telex_validate(
struct berval *val
)
{
int rc = 0; /* assume the value is valid */
const char *start = NULL;
const char *end = NULL;
const char *p = NULL;
const char *p2 = NULL;
int num_dollars = 0;
/* Per RFC4517:
*
* telex-number = actual-number DOLLAR country-code
* DOLLAR answer... | false | false | false | false | false | 0 |
atcommand_users(const int fd, struct map_session_data* sd, AtCommandType command, const char* message)
{
struct map_session_data *pl_sd;
int i, count = 0;
int *users;
users = (int *)aCalloc(map_num, sizeof(int));
for (i = 0; i < fd_max; i++) {
if (session[i] && (pl_sd = (struct map_session_data *)session[i]->s... | false | false | false | false | false | 0 |
mte_set_field(TermEnum *te, int field_num)
{
MultiTermEnum *mte = MTE(te);
int i;
const int size = mte->size;
te->field_num = field_num;
mte->tew_queue->size = 0;
for (i = 0; i < size; i++) {
TermEnumWrapper *tew = &(mte->tews[i]);
TermEnum *sub_te = tew->te;
int fnum = m... | false | false | false | false | false | 0 |
lms_db_audio_add(lms_db_audio_t *lda, struct lms_audio_info *info)
{
int64_t album_id, genre_id, artist_id;
int ret_album, ret_genre, ret_artist;
const struct lms_dlna_audio_profile *dlna;
if (!lda)
return -1;
if (!info)
return -2;
if (info->id < 1)
return -3;
if (i... | false | false | false | false | false | 0 |
esl_getopts_Reuse(ESL_GETOPTS *g)
{
int i;
/* Restore defaults for all options */
for (i = 0; i < g->nopts; i++)
{
if (g->valloc[i] > 0) { free(g->val[i]); }
g->val[i] = g->opt[i].defval;
g->setby[i] = eslARG_SETBY_DEFAULT;
g->valloc[i] = 0;
}
if (g->spoof != NULL) fr... | false | false | false | false | false | 0 |
boxes_vnc_display_real_connect_it (BoxesDisplay* base, GError** error) {
BoxesVncDisplay * self;
gboolean _tmp0_ = FALSE;
VncDisplay* _tmp1_ = NULL;
const gchar* _tmp2_ = NULL;
const gchar* _tmp3_ = NULL;
VncDisplay* _tmp4_ = NULL;
const gchar* _tmp5_ = NULL;
const gchar* _tmp6_ = NULL;
VncDisplay* _tmp7_ = NU... | false | false | false | false | false | 0 |
do_prl(int argc, char **argv)
{
struct ip_tunnel_prl p;
int count = 0;
int devname = 0;
int cmd = 0;
char medium[IFNAMSIZ];
memset(&p, 0, sizeof(p));
memset(&medium, 0, sizeof(medium));
while (argc > 0) {
if (strcmp(*argv, "prl-default") == 0) {
NEXT_ARG();
cmd = SIOCADDPRL;
p.addr = get_addr32(*ar... | false | false | false | false | false | 0 |
change_temp_var_qr(Module_table *mpt,
Quadruple *qr_head,
Temp_table **tpt,
int entry,
int *flg)
{
Quadruple *qpt;
int i;
qpt = qr_head;
while (qpt != NULL) {
for (i = 0; i < 4; i++)
change_temp_var_operand(mpt, qpt->op[i], tpt, entry, flg);
qpt = qpt->... | false | false | false | false | false | 0 |
InferRange() {
if (right()->IsConstant()) {
HConstant* c = HConstant::cast(right());
if (c->HasInteger32Value()) {
int shift_count = c->Integer32Value() & 0x1f;
if (left()->range()->CanBeNegative()) {
// Only compute bounds if the result always fits into an int32.
return (shift_cou... | false | false | false | false | false | 0 |
base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
int err = 0, id;
struct mISDNdevice *dev;
struct mISDNversion ver;
switch (cmd) {
case IMGETVERSION:
ver.major = MISDN_MAJOR_VERSION;
ver.minor = MISDN_MINOR_VERSION;
ver.release = MISDN_RELEASE;
if (copy_to_user((void __user *)... | false | true | false | false | false | 1 |
map_id_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
GVfsAfpConnection *conn = G_VFS_AFP_CONNECTION (source_object);
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data);
GVfsAfpReply *reply;
GError *err = NULL;
AfpResultCode res_code;
MapIDData *map_data;
reply = g_vfs... | false | false | false | false | false | 0 |
gdict_defbox_select_all (GdictDefbox *defbox)
{
GdictDefboxPrivate *priv;
GtkTextBuffer *buffer;
GtkTextIter start, end;
g_return_if_fail (GDICT_IS_DEFBOX (defbox));
priv = defbox->priv;
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->text_view));
gtk_text_buffer_get_bounds (buffer, &star... | false | false | false | false | false | 0 |
eni_init_one(struct pci_dev *pci_dev,
const struct pci_device_id *ent)
{
struct atm_dev *dev;
struct eni_dev *eni_dev;
struct eni_zero *zero;
int rc;
rc = pci_enable_device(pci_dev);
if (rc < 0)
goto out;
rc = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32));
if (rc < 0)
goto out;
rc = -ENO... | false | false | false | false | false | 0 |
fp_find_record(string_ty *path_a)
{
fp_record_ty *p;
string_ty *path_r;
/*
* Most of the time, we have already polled this one before,
* so do a quick lookup and see.
*/
trace(("fp_find_record(path = \"%s\")\n{\n", path_a->str_text));
path_r = os_relative_if_possible(path_a)... | false | false | false | false | false | 0 |
amd79c901_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
{
int i;
u16 status;
for (i = 0; i < 2; i++)
status = sis900_mdio_read(phy_addr, MII_STATUS);
if (status & MII_STAT_CAN_AUTO) {
/* 10BASE-T PHY */
for (i = 0; i < 2; i++)
st... | false | false | false | false | false | 0 |
backtrace_free_locked (struct backtrace_state *state, void *addr, size_t size)
{
/* Just leak small blocks. We don't have to be perfect. */
if (size >= sizeof (struct backtrace_freelist_struct))
{
struct backtrace_freelist_struct *p;
p = (struct backtrace_freelist_struct *) addr;
p->next = ... | false | false | false | false | false | 0 |
parse_socks_client(const uint8_t *data, size_t datalen,
int state, char **reason,
ssize_t *drain_out)
{
unsigned int addrlen;
*drain_out = 0;
if (datalen < 2)
return 0;
switch (state) {
case PROXY_SOCKS4_WANT_CONNECT_OK:
/* Wait for the complete response */
... | false | false | false | false | false | 0 |
uv_exepath(char* buffer, size_t* size) {
ssize_t n;
if (buffer == NULL || size == NULL)
return -EINVAL;
n = readlink("/proc/self/exe", buffer, *size - 1);
if (n == -1)
return -errno;
buffer[n] = '\0';
*size = n;
return 0;
} | false | false | false | false | false | 0 |
staticRegion() const
{
QRegion ret = QRegion();
// position:fixed objects
if (m_positionedObjects) {
RenderObject* obj;
QListIterator<RenderObject*> it(*m_positionedObjects);
while (it.hasNext()) {
obj = it.next();
if (obj->style()->position() == PFIXED && obj->la... | false | false | false | false | false | 0 |
handle_exec(struct ast_channel *chan, AGI *agi, int argc, const char * const argv[])
{
int res, workaround;
struct ast_app *app_to_exec;
if (argc < 2)
return RESULT_SHOWUSAGE;
ast_verb(3, "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argc >= 3 ? argv[2] : "");
if ((app_to_exec = pbx_finda... | false | false | false | false | false | 0 |
glusterd_sort_and_redirect (const char *src_filepath, int dest_fd)
{
int ret = -1;
int line_count = 0;
int counter = 0;
char **lines = NULL;
if (!src_filepath || dest_fd < 0)
goto out;
line... | false | false | false | false | false | 0 |
quote_fold(long int linenum, char *line, LT_INS_S **ins, void *local)
{
char *p;
if(*line == '>'){
for(p = line; *p; p++){
if(isspace((unsigned char) *p)){
if(*(p+1) == '>')
ins = gf_line_test_new_ins(ins, p, "", -1);
}
else if(*p != '>')
break;
}
}
return(0);
} | false | false | false | false | false | 0 |
searchStabalizer(IntegerVector const &v, IntegerVector const &toBeFixed)
{
IntegerVector tempPerm=SymmetryGroup::identity(v.size());
IntegerVector ret(v.size());
IntegerVector building(v.size());
IntegerVector optimal=v;//the identity is always in the trie
bool isImproving=true;
theTree.searchStabalizer(v,... | false | false | false | false | false | 0 |
ip_hton(const char *src, int af, fr_ipaddr_t *dst)
{
int rcode;
struct addrinfo hints, *ai = NULL, *res = NULL;
memset(&hints, 0, sizeof(hints));
hints.ai_family = af;
if ((rcode = getaddrinfo(src, NULL, &hints, &res)) != 0) {
fr_strerror_printf("ip_hton: %s", gai_strerror(rcode));
return -1;
}
for (ai = ... | false | false | false | false | false | 0 |
uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
int pnodeid;
int uv_apic;
if (strncmp(oem_id, "SGI", 3) != 0)
return 0;
/*
* Determine UV arch type.
* SGI: UV100/1000
* SGI2: UV2000/3000
* SGI3: UV300 (truncated to 4 chars because of different varieties)
*/
uv_hub_info->hub_revision ... | false | false | false | false | false | 0 |
sspm_is_mime_header(char *line)
{
char *name = sspm_property_name(line);
int i;
if(name == 0){
return 0;
}
for(i = 0; mime_headers[i] != 0; i++){
if(strcasecmp(name, mime_headers[i]) == 0)
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
set_option(char *string)
{
struct Option *at_opt = NULL;
struct Option *opt = NULL;
int got_one;
size_t key_len;
char the_key[KEYLENGTH];
char *ptr;
for (ptr = the_key; *string != '='; ptr++, string++)
*ptr = *string;
*ptr = '\0';
string++;
/* Find option with best keyword mat... | false | false | false | false | false | 0 |
wordchunky_proc_data(Microtek2_Scanner *ms)
{
SANE_Status status;
uint8_t *from;
uint32_t line;
DBG(30, "wordchunky_proc_data: ms=%p\n", (void *) ms);
from = ms->buf.src_buf;
for ( line = 0; line < (uint32_t) ms->src_lines_to_read; line++ )
{
status = wordchunky_copy_pixels(from... | false | false | false | false | false | 0 |
setup_next_source (GstPlayBin * playbin, GstState target)
{
GstSourceGroup *new_group, *old_group;
GST_DEBUG_OBJECT (playbin, "setup sources");
/* see if there is a next group */
GST_PLAY_BIN_LOCK (playbin);
new_group = playbin->next_group;
if (!new_group || !new_group->valid)
goto no_next_group;
/... | false | false | false | false | false | 0 |
ziplistCompare(unsigned char *p, unsigned char *sstr, unsigned int slen) {
zlentry entry;
unsigned char sencoding;
long long zval, sval;
if (p[0] == ZIP_END) return 0;
entry = zipEntry(p);
if (ZIP_IS_STR(entry.encoding)) {
/* Raw compare */
if (entry.len == slen) {
r... | false | false | false | false | false | 0 |
map_mdmap_leave(struct block_list *bl, va_list ap)
{
struct map_session_data* sd;
nullpo_retr(0, bl);
nullpo_retr(0, sd = (struct map_session_data *)bl);
pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, 3);
return 1;
} | false | false | false | false | false | 0 |
mio_file_get_fp (MIO *mio)
{
FILE *fp = NULL;
if (mio->type == MIO_TYPE_FILE) {
fp = mio->impl.file.fp;
}
return fp;
} | false | false | false | false | false | 0 |
decrypt_ms32_tx(int addr_xor,int data_xor)
{
int i;
unsigned char *source_data;
int source_size;
unsigned char *result_data;
source_data = memory_region ( REGION_GFX4 );
source_size = memory_region_length( REGION_GFX4 );
result_data = malloc(source_size);
if (!result_data) return;
addr_... | false | true | false | false | false | 1 |
ssd_check_hw(struct ssd_device *dev)
{
uint32_t test_data = 0x55AA5AA5;
uint32_t read_data;
ssd_reg32_write(dev->ctrlp + SSD_BRIDGE_TEST_REG, test_data);
read_data = ssd_reg32_read(dev->ctrlp + SSD_BRIDGE_TEST_REG);
if (read_data != ~(test_data)) {
//hio_warn("%s: check bridge error: %#x\n", dev->name, read_dat... | false | false | false | false | false | 0 |
set_money_format (GnmValue *v, const char *fmttxt)
{
gnm_float f = value_get_as_float (v);
if (fmttxt) {
GOFormat *fmt = go_format_new_from_XL (fmttxt);
value_set_fmt (v, fmt);
go_format_unref (fmt);
} else
value_set_fmt (v, go_format_default_money ());
if (f != gnm_floor (f)) {
int i;
for (i = 0; i <... | false | false | false | false | false | 0 |
print (ostream &out, const char *inner, bool prefix) const {
if (is_qualified ()) {
print_qual (out);
out << " ";
}
out << _name;
if (inner)
out << " " << inner;
} | false | false | false | false | false | 0 |
power_guess(gint n_dat,
const gdouble *x,
const gdouble *y,
gdouble *param,
gboolean *fres)
{
gint i;
gdouble q, la, lb, c1, c2;
param[0] = 0.0;
param[1] = 0.0;
param[2] = 1.0;
if (n_dat < 4 || x[0] <= 0.0) {
*fres = FALSE;
return... | false | false | false | false | false | 0 |
zsjobid_to_file (zid, pzsystem, pbgrade)
const char *zid;
char **pzsystem;
char *pbgrade;
{
#if ! SPOOLDIR_TAYLOR
size_t clen;
const char *zend;
char *zsys;
char abname[CSEQLEN + 11];
char *zret;
clen = strlen (zid);
if (clen <= CSEQLEN)
{
ulog (LOG_ERROR, "%s: Bad job id", zid);... | false | false | false | false | false | 0 |
my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t wc,
uchar *s,
uchar *e __attribute__((unused)))
{
if (s >= e)
return MY_CS_TOOSMALL;
if (wc < 256)
{
s[0]= (char) wc;
return 1;
}
return MY_CS_ILUNI;
} | false | false | false | false | false | 0 |
readineofok(buf, count)
char *buf;
unsigned count;
{
int ch;
while (count--)
{
if ((ch = readchar()) < 0)
return TRUE;
*buf++ = ch;
}
return FALSE;
} | false | false | false | false | false | 0 |
acl_fetch_sport(struct proxy *px, struct session *l4, void *l7, int dir,
struct acl_expr *expr, struct acl_test *test)
{
if (l4->cli_addr.ss_family == AF_INET)
test->i = ntohs(((struct sockaddr_in *)&l4->cli_addr)->sin_port);
else
test->i = ntohs(((struct sockaddr_in6 *)(&l4->cli_addr))->sin6_port... | false | false | false | false | false | 0 |
get_mscorlib_aot_module (void)
{
MonoImage *image;
MonoAotModule *amodule;
image = mono_defaults.corlib;
if (image)
amodule = (MonoAotModule *)image->aot_module;
else
amodule = mscorlib_aot_module;
g_assert (amodule);
return amodule;
} | false | false | false | false | false | 0 |
AddTask(cbThreadedTask *task, bool autodelete)
{
if (!task)
return;
wxMutexLocker lock(m_Mutex);
m_tasksQueue.push_back(cbThreadedTaskElement(task, autodelete));
m_taskAdded = true;
if (!m_batching && m_workingThreads < m_concurrentThreads)
AwakeNeeded();
} | false | false | false | false | false | 0 |
val_str(String* str)
{
DBUG_ASSERT(fixed == 1);
uchar buf[8], *p;
ulonglong n = (ulonglong) args[0]->val_int();
char num[4];
/*
We do not know if args[0] is NULL until we have called
some val function on it if args[0] is not a constant!
Also return null if n > 255.255.255.255
*/
if ((null_va... | false | false | false | false | false | 0 |
writeCONTROL_REG(reg8 control)
{
reg8 gate_next = control & 0x01;
// The rate counter is never reset, thus there will be a delay before the
// envelope counter starts counting up (attack) or down (release).
// Gate bit on: Start attack, decay, sustain.
if (!gate && gate_next) {
state = ATTACK;
updat... | false | false | false | false | false | 0 |
ghes_estatus_cache_alloc(
struct acpi_hest_generic *generic,
struct acpi_hest_generic_status *estatus)
{
int alloced;
u32 len, cache_len;
struct ghes_estatus_cache *cache;
struct acpi_hest_generic_status *cache_estatus;
alloced = atomic_add_return(1, &ghes_estatus_cache_alloced);
if (alloced > GHES_ESTATUS_CAC... | false | false | false | false | false | 0 |
create_iv (tree base, tree step, tree var, struct loop *loop,
gimple_stmt_iterator *incr_pos, bool after,
tree *var_before, tree *var_after)
{
gimple stmt;
tree initial, step1;
gimple_seq stmts;
tree vb, va;
enum tree_code incr_op = PLUS_EXPR;
edge pe = loop_preheader_edge (loop);
if (!var)
{... | false | false | false | false | false | 0 |
CifFreeSymbol()
{
symbol_list *Scan;
symbol_list *Del;
int Index;
for ( Index = 0; Index < CIF_MAX_SYMBOL_HEAD; Index++ )
{
if ( ! CifFirstSymbol )
{
Scan = HEAD_SYMBOL[ Index ];
while ( Scan != (symbol_list *)NULL )
{
Del = Scan;
S... | false | false | false | false | false | 0 |
db_set_verb_owner(db_verb_handle vh, Objid owner)
{
handle *h = (handle *) vh.ptr;
if (h)
h->verbdef->owner = owner;
else
panic("DB_SET_VERB_OWNER: Null handle!");
} | false | false | false | false | false | 0 |
ipr_request_other_msi_irqs(struct ipr_ioa_cfg *ioa_cfg)
{
int i, rc;
for (i = 1; i < ioa_cfg->nvectors; i++) {
rc = request_irq(ioa_cfg->vectors_info[i].vec,
ipr_isr_mhrrq,
0,
ioa_cfg->vectors_info[i].desc,
&ioa_cfg->hrrq[i]);
if (rc) {
while (--i >= 0)
free_irq(ioa_cfg->vectors_info[i].vec,
... | 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.