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 |
|---|---|---|---|---|---|---|
_nrrdBox1_f(float x, const double *parm) {
float S;
S = AIR_CAST(float, parm[0]);
x = AIR_ABS(x)/S;
return AIR_CAST(float, _BOX(x)/S);
} | false | false | false | false | false | 0 |
krb5_krbhst_next_as_string(krb5_context context,
krb5_krbhst_handle handle,
char *hostname,
size_t hostlen)
{
krb5_error_code ret;
krb5_krbhst_info *host;
ret = krb5_krbhst_next(context, handle, &host);
if(ret)
return ret;
return krb5_krbhst_format_string(context, host, hostname, ... | false | false | false | false | false | 0 |
homogenize()
{
if( m_elements[3] != 0 )
{
m_elements[0] /= m_elements[3];
m_elements[1] /= m_elements[3];
m_elements[2] /= m_elements[3];
m_elements[3] = 1;
}
} | false | false | false | false | false | 0 |
checkQueue()
{
if (s_renderQueue.isEmpty()) {
return;
}
if (QCoreApplication::closingDown()) {
s_renderQueue.clear();
return;
}
#ifndef PLASMA_NO_SOLID
const int numProcs = qMax(1, Solid::Device::listFromType(Solid::DeviceInterface::Processor).count());
#else
const int ... | false | false | false | false | false | 0 |
get_identity_sync (GoaOAuth2Provider *provider,
const gchar *access_token,
gchar **out_presentation_identity,
GCancellable *cancellable,
GError **error)
{
GError *identity_error;
RestProxy *proxy;
Rest... | false | false | false | false | false | 0 |
bStandardCommand_patch(void)
{
if (mDEV_REQ_REQ() == USB_SET_CONFIGURATION) {
A_USB_SET_CONFIG();
#if ENABLE_SWAP_DATA_MODE
/* SWAP FUNCTION should be enabled while DMA engine
* is not working, the best place to enable it
* is before we trigger the DMA */
MAGPIE_REG_USB_RX0_SWAP_DATA = 0x1;
MAGPIE_REG_U... | false | false | false | false | false | 0 |
getPointLights(){
std::vector<Vec3Df> pointLights;
Vec3Df vec1 = Vec3Df::crossProduct(normal, Vec3Df(normal[0]+1, normal[1]-1, normal[2]+2));
Vec3Df vec2 = Vec3Df::crossProduct(vec1, normal);
vec1.normalize();
vec1 *= radius;
vec2.normalize();
vec2 *= radius;
//pointLights.push_back(midPoint);
for(float i ... | false | false | false | false | false | 0 |
on_notify_autocompletion (GSettings* settings,
const gchar* key,
gpointer user_data)
{
Sourceview *sv;
sv = ANJUTA_SOURCEVIEW(user_data);
GtkSourceCompletion* completion = gtk_source_view_get_completion(GTK_SOURCE_VIEW(sv->priv->view));
if (g_settings_get_boolean (... | false | false | false | false | false | 0 |
alb_send_learning_packets(struct slave *slave, u8 mac_addr[],
bool strict_match)
{
struct bonding *bond = bond_get_bond_by_slave(slave);
struct net_device *upper;
struct list_head *iter;
struct bond_vlan_tag *tags;
/* send untagged */
alb_send_lp_vid(slave, mac_addr, 0, 0);
/* loop through all device... | false | false | false | false | false | 0 |
S_unwind_loop(pTHX_ const char * const opname)
{
dVAR;
I32 cxix;
if (PL_op->op_flags & OPf_SPECIAL) {
cxix = dopoptoloop(cxstack_ix);
if (cxix < 0)
/* diag_listed_as: Can't "last" outside a loop block */
Perl_croak(aTHX_ "Can't \"%s\" outside a loop block", opname);
}
else {
dSP;
STRLE... | false | false | false | false | false | 0 |
getNearestRefuellingPosition ( bool buildingRequired, bool refuel, bool repair )
{
findPath();
/*
int fuel = veh->getResource(maxint, 2, true);
int x1,y1,x2,y2;
x1 = max(veh->xpos - fuel / veh->typ->fuelConsumption, 0 );
y1 = max(veh->ypos - fuel / veh->typ->fuelConsumption, 0 );
x2 = min(veh->xpo... | false | false | false | false | false | 0 |
ssl_GetPeerInfo(sslSocket *ss)
{
PRFileDesc * osfd;
int rv;
PRNetAddr sin;
osfd = ss->fd->lower;
PORT_Memset(&sin, 0, sizeof(sin));
rv = osfd->methods->getpeername(osfd, &sin);
if (rv < 0) {
return SECFailure;
}
ss->TCPconnected = 1;
if (sin.i... | false | false | false | false | false | 0 |
gt_bsGetNonUniformInt32Array(
constBitString str, BitOffset offset, size_t numValues,
BitOffset numBitsTotal, unsigned numBitsList[], int32_t val[])
{
/* idea: read as much as possible from str in each iteration,
* accumulate if bitsLeft < numBits */
size_t j = 0;
BitOffset totalBitsLeft = numBitsTotal;
... | false | false | false | false | false | 0 |
slurm_free_update_node_msg(update_node_msg_t * msg)
{
if (msg) {
xfree(msg->features);
xfree(msg->gres);
xfree(msg->node_addr);
xfree(msg->node_hostname);
xfree(msg->node_names);
xfree(msg->reason);
xfree(msg);
}
} | false | false | false | false | false | 0 |
NextChar()
{
#if wxUSE_UNICODE
wxChar wbuf[2];
memset((void*)m_lastBytes, 0, 10);
for (size_t inlen = 0; inlen < 9; inlen++)
{
// actually read the next character
m_lastBytes[inlen] = m_input.GetC();
if (m_i... | false | false | false | false | false | 0 |
_update_pv_list(struct dm_pool *pvmem, struct dm_list *all_pvs, struct volume_group *vg)
{
struct pv_list *pvl, *pvl2;
dm_list_iterate_items(pvl, &vg->pvs) {
dm_list_iterate_items(pvl2, all_pvs) {
if (pvl->pv->dev == pvl2->pv->dev)
goto next_pv;
}
/*
* PV is not on list so add it.
*/
if (!(pvl2... | false | false | false | false | false | 0 |
draw(SDL_Surface *screen) {
SDL_Rect r;
r.x = lroundf(pos.getX());
r.y = lroundf(pos.getY());
r.w = sprite->w;
r.h = sprite->h;
SDL_BlitSurface( sprite, 0, screen, &r );
if ( bonus != BANNER_BONUS_NONE &&
1000 < timeLived && timeLived < 3000 ) {
r.x = SCREEN_WIDTH / 2 - spriteBonus->w / 2;
... | false | false | false | false | false | 0 |
AddSource( const string& sourceStr, boolean searchPaths )
{
string openStr = sourceStr;
// Check if Exists
gnBaseSource* source = HasSource( sourceStr, false );
if( source != 0 )
return source;
// Check if File Present and valid
gnBaseSource* newSource = MatchSourceClass( sourceStr )->Clone();
if(newSource == ... | false | false | false | false | false | 0 |
runOnFunction(Function &F) {
// NB! This *must* be reset before adding new AA results to the new
// AAResults object because in the legacy pass manager, each instance
// of these will refer to the *same* immutable analyses, registering and
// unregistering themselves with them. We need to carefully tear down th... | false | false | false | false | false | 0 |
apol_genfscon_query_destroy(apol_genfscon_query_t ** g)
{
if (*g != NULL) {
free((*g)->fs);
free((*g)->path);
apol_context_destroy(&((*g)->context));
free(*g);
*g = NULL;
}
} | false | false | false | false | false | 0 |
Rregerror ( int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
{
const char *msg;
size_t msg_size;
if (errcode < 0
|| errcode >= (int) (sizeof (re_error_msgid_idx)
/ sizeof (re_error_msgid_idx[0])))
/* Only error codes returned by the rest of the code should be passed
to t... | false | false | false | false | false | 0 |
icalcomponent_new_clone(icalcomponent* component)
{
struct icalcomponent_impl *old = (struct icalcomponent_impl*)component;
struct icalcomponent_impl *new;
icalproperty *p;
icalcomponent *c;
pvl_elem itr;
icalerror_check_arg_rz( (component!=0), "component");
new = icalcomponent_new_impl(ol... | false | false | false | false | false | 0 |
MPI_Start(MPI_Request *req)
{
FUNCTION_ENTRY;
MPI_Start_prolog((MPI_Fint*) req);
int ret = MPI_Start_core(req);
return ret;
} | false | false | false | false | false | 0 |
cmafec_preset_get_parameter(int index)
{
struct cma_preset *ppreset;
fc_assert_ret_val(index >= 0 && index < cmafec_preset_num(), NULL);
ppreset = preset_list_get(preset_list, index);
return &ppreset->parameter;
} | false | false | false | false | false | 0 |
f2fs_drop_nlink(struct inode *dir, struct inode *inode, struct page *page)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(dir);
down_write(&F2FS_I(inode)->i_sem);
if (S_ISDIR(inode->i_mode)) {
drop_nlink(dir);
if (page)
update_inode(dir, page);
else
update_inode_page(dir);
}
inode->i_ctime = CURRENT_TIME;
... | false | false | false | false | false | 0 |
AddInvertedQual(Query *parsetree, Node *qual)
{
BooleanTest *invqual;
if (qual == NULL)
return;
/* Need not copy input qual, because AddQual will... */
invqual = makeNode(BooleanTest);
invqual->arg = (Expr *) qual;
invqual->booltesttype = IS_NOT_TRUE;
invqual->location = -1;
AddQual(parsetree, (Node *) inv... | false | false | false | false | false | 0 |
_e2_toolbar_add_bookmarks (E2_OptionSet *set,
E2_ToolbarRuntime *rt, GtkTreeIter *iter, E2_Action *action, gint insertat)
{
do
{
gchar *name, *icon, *tip, *path;
_e2_toolbar_get_option_row (rt, set->ex.tree.model,
iter, &name, &icon, &tip, NULL, &path);
GtkWidget *button = _e2_toolbar_add_button (rt, insert... | false | false | false | false | false | 0 |
actionsFor( Meta::GenrePtr genre )
{
QList< QAction * > returnList;
foreach( GlobalCollectionGenreAction * genreAction, m_genreActions )
{
genreAction->setGenre( genre );
returnList.append( genreAction );
}
return returnList;
} | false | false | false | false | false | 0 |
v4lcontrol_vidioc_s_ctrl(struct v4lcontrol_data *data, void *arg)
{
int i;
struct v4l2_control *ctrl = arg;
for (i = 0; i < V4LCONTROL_COUNT; i++)
if ((data->controls & (1 << i)) &&
ctrl->id == fake_controls[i].id) {
if (ctrl->value > fake_controls[i].maximum ||
ctrl->value < fake_controls[i].minimum)... | false | false | false | false | false | 0 |
SocketBackend(StringInfo inBuf)
{
int qtype;
/*
* Get message type code from the frontend.
*/
qtype = pq_getbyte();
if (qtype == EOF) /* frontend disconnected */
{
ereport(COMMERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("unexpected EOF on client connection")));
return qtype;
}
/*
... | false | false | false | false | false | 0 |
_get_code_matrix()
{
IplImage *src=this->_img_binarized;
double cell_size=this->_get_cell_size();
if(cell_size<=0.0)
return(NULL);
CvRect roi=cvGetImageROI(src);
int version=(int)(((double)roi.width/cell_size-17.0)/4.0);
int w=4*version+17;
... | false | false | false | false | false | 0 |
GC_build_fl(struct hblk *h, size_t sz, GC_bool clear,
ptr_t list)
{
word *p, *prev;
word *last_object; /* points to last object in new hblk */
/* Do a few prefetches here, just because its cheap. */
/* If we were more serious about it, these should go inside ... | false | false | false | false | false | 0 |
rd_block(int32 btok, int32 endbtok)
{
int32 slcnt, sfnind;
struct st_t *stp, *hdstp;
slcnt = __lin_cnt;
sfnind = __cur_fnam_ind;
__get_vtok();
if (__toktyp == COLON)
{
if (__iact_state)
{
/* cannot catch this later because no declarations in interactive */
__pv_err_cnt++;
__ia_err(1431, "... | false | false | false | false | false | 0 |
treecount(Tree *tree) {
return tree == NULL
? 0
: tree->kind == nList
? treecount(tree->u[0].p) + treecount(tree->u[1].p)
: 1;
} | false | false | false | false | false | 0 |
Derivitive() const
{
wxCHECK_MSG( Ok(), wxPlotData(), wxT("Invalid wxPlotData") );
int count = M_PLOTDATA->m_count;
wxPlotData dst(count, false);
double *y_data = M_PLOTDATA->m_Ydata;
double *dst_y_data = dst.GetYData();
memcpy(dst.GetXData(), GetXData(), count*sizeof(double));
*dst_y_d... | false | false | false | true | false | 1 |
mprSearchPath(cchar *file, int flags, cchar *search, ...)
{
va_list args;
char *result, *path, *dir, *nextDir, *tok;
va_start(args, search);
mprLog(5, "mprSearchForFile: %s", file);
if ((result = checkPath(file, flags)) != 0) {
return result;
}
if ((flags & MPR_SEARCH_E... | false | false | false | false | false | 0 |
rmAllPoints(void)
{
dbgprintf("Removing all points from current pointfile\n");
// delete the points
while (!pointlist.empty()) {
mypoint &aPoint = pointlist.back();
// remove the last element from the list of things to draw
mainViewer->deletePoint(aPoint.x(), aPoint.y());
mai... | false | false | false | false | false | 0 |
ajDomImplementationCreateDocument(const AjPStr uri,
const AjPStr qualname,
AjPDomDocumentType doctype)
{
const char *p = NULL;
(void) uri; /* temporary use */
if(qualname)
p = ... | false | false | false | false | false | 0 |
do_it(CS& cmd, CARD_LIST* Scope)
{
if (cmd.more()) {
buildfile(cmd);
}else{
}
doit(Scope);
command("unfault", Scope);
}
} | false | false | false | false | false | 0 |
H5SL_less(H5SL_t *slist, const void *key)
{
H5SL_node_t *x; /* Current node to examine */
uint32_t hashval = 0; /* Hash value for key */
void *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
... | false | false | false | false | false | 0 |
mkv_write_ass_blocks(AVFormatContext *s, AVPacket *pkt)
{
MatroskaMuxContext *mkv = s->priv_data;
ByteIOContext *pb = s->pb;
int i, layer = 0, max_duration = 0, size, line_size, data_size = pkt->size;
uint8_t *start, *end, *data = pkt->data;
ebml_master blockgroup;
char buffer[2048];
while ... | false | false | false | false | true | 1 |
convert_from_big5_to_ucs2(const gchar * str,
gssize len, gsize* writelen)
{
wchar_t * wt = (wchar_t *)g_malloc((len + 1) * sizeof(wchar_t));
const unsigned char * ustr = (const unsigned char *)str;
gsize i = 0;
gsize j = 0;
for ( ; i < len; i++) {
if (ustr[i] < 0x80) {
/*... | false | false | false | false | false | 0 |
embPropNormalF(float matrix[], float missing)
{
ajuint i;
double count = 0.0;
double total = 0.0;
double sumsq = 0.0;
double sigma = 0.0;
double mean = 0.0;
const char* alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for(i=0;i<26;i++)
if(matrix[i] != missing)
{
count += 1.0;
... | false | false | false | false | false | 0 |
is_arcadia (const TCHAR *xpath, int cnt)
{
TCHAR path[MAX_DPATH], *p;
struct arcadiarom *rom = NULL;
int i;
_tcscpy (path, xpath);
p = path;
for (i = _tcslen (xpath) - 1; i > 0; i--) {
if (path[i] == '\\' || path[i] == '/') {
path[i++] = 0;
p = path + i;
break;
}
}
for (i = 0; roms[i].romid > 0; i... | false | false | false | false | false | 0 |
ParseDirectivePopSection(StringRef, SMLoc) {
if (!getStreamer().PopSection())
return TokError(".popsection without corresponding .pushsection");
return false;
} | false | false | false | false | false | 0 |
gnc_tree_model_split_reg_update_account_list (GncTreeModelSplitReg *model)
{
GncTreeModelSplitRegPrivate *priv;
Account *root;
Account *acc;
GtkTreeIter iter;
GList *accts, *accts_cpy, *ptr;
gboolean valid;
const gchar *name;
gchar *fname;
gint i;
priv = model->priv;
/* Cle... | false | false | false | false | false | 0 |
loop_bivs_check (struct loop *loop)
{
struct loop_ivs *ivs = LOOP_IVS (loop);
/* Temporary list pointers for traversing ivs->list. */
struct iv_class *bl;
struct iv_class **backbl;
for (backbl = &ivs->list; (bl = *backbl); backbl = &bl->next)
{
rtx src;
rtx note;
if (! bl->init_insn)
... | false | false | false | false | false | 0 |
connection_init(time_t now, connection_t *conn, int type, int socket_family)
{
static uint64_t n_connections_allocated = 1;
switch (type) {
case CONN_TYPE_OR:
conn->magic = OR_CONNECTION_MAGIC;
break;
case CONN_TYPE_EXIT:
conn->magic = EDGE_CONNECTION_MAGIC;
break;
case CONN_TYP... | false | false | false | false | false | 0 |
glusterd_op_stage_reset_volume (dict_t *dict, char **op_errstr)
{
int ret = 0;
char *volname = NULL;
gf_boolean_t exists = _gf_false;
char ... | true | true | true | false | false | 1 |
bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp)
{
struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
struct bfa_lps_s *lps;
WARN_ON(rsp->bfa_tag >= mod->num_lps);
lps = BFA_LPS_FROM_TAG(mod, rsp->bfa_tag);
lps->status = rsp->status;
switch (rsp->status) {
case BFA_STATUS_OK:
lps->fw_tag = rs... | false | false | false | false | false | 0 |
bcf_hrec_dup(bcf_hrec_t *hrec)
{
bcf_hrec_t *out = (bcf_hrec_t*) calloc(1,sizeof(bcf_hrec_t));
out->type = hrec->type;
if ( hrec->key ) out->key = strdup(hrec->key);
if ( hrec->value ) out->value = strdup(hrec->value);
out->nkeys = hrec->nkeys;
out->keys = (char**) malloc(sizeof(char*)*hrec->nke... | false | true | false | false | false | 1 |
BTWSRefresh(wxCommandEvent& /*event*/)
{
if ( m_MaxPlaytimeChk->GetValue() )
{
m_MaxPlaytimeSpn->Enable();
m_MinWorkChk->Enable();
m_MinWorkSpn->Enable(m_MinWorkChk->GetValue());
}
else
{
m_MaxPlaytimeSpn->Disable();
m_MinWorkChk->Disable();
m_MinWorkS... | false | false | false | false | false | 0 |
getReducedGradient(
double* columnReducedCosts,
double * duals,
const double * c) const
{
//assert (modelPtr_->solveType()==2);
// could do this faster with coding inside Clp
// save current costs
int numberColumns = modelPtr_->numberColumns();
double * save = new double [numberColumns];... | false | false | false | false | false | 0 |
sparse_array_set(struct sparse_array *sa, int idx, int val, void *ptr)
{
struct list_elm *e;
e = &sa->head;
while (e) {
if (e->index == idx) {
/* find same index and update */
e->value = val;
e->ptr = ptr;
return ;
}
/* search */
if (e->index < idx && (!e->next || idx < e->... | false | false | false | false | false | 0 |
torture_onoff_failures(void)
{
#ifdef CONFIG_HOTPLUG_CPU
return n_online_successes != n_online_attempts ||
n_offline_successes != n_offline_attempts;
#else /* #ifdef CONFIG_HOTPLUG_CPU */
return false;
#endif /* #else #ifdef CONFIG_HOTPLUG_CPU */
} | false | false | false | false | false | 0 |
insertConnectorLayer(const SvgIdLayer * svgIdLayer, qulonglong id)
{
QSqlQuery query;
query.prepare("INSERT INTO connectorLayers(view, layer, svgid, hybrid, terminalid, legid, connector_id) VALUES "
"(:view, :layer, :svgid, :hybrid, :terminalid, :legid, :connector_id)");
... | false | false | false | false | false | 0 |
do_check(THD *thd, set_var *var)
{
bool status;
mysql_mutex_assert_not_owner(&LOCK_global_system_variables);
mysql_mutex_lock(&LOCK_active_mi);
mysql_mutex_lock(&active_mi->rli.run_lock);
status= active_mi->rli.slave_running;
mysql_mutex_unlock(&active_mi->rli.run_lock);
mysql_mutex_unlock(&LOCK_activ... | false | false | false | false | false | 0 |
change_connid(mod_ctl_t *ctl, mod_ctl_buf_t *ctlb)
{
int32_t id = buf_to_int32(&ctlb->buf[1]);
int32_t newid = buf_to_int32(&ctlb->buf[5]);
conn_t *conn = conn_find_by_id(id);
if(conn->id >= 0)
rb_dlinkDelete(&conn->node, connid_hash(conn->id));
SetZipSSL(conn);
conn->id = newid;
} | false | false | false | false | false | 0 |
rest_param_new_string (const char *name,
RestMemoryUse use,
const char *string)
{
if (string == NULL) {
use = REST_MEMORY_STATIC;
string = "";
}
return rest_param_new_full (name,
use, string, strlen (string) + 1,
... | false | false | false | false | false | 0 |
gkm_gnome2_module_real_parse_argument (GkmModule *base, const gchar *name, const gchar *value)
{
GkmGnome2Module *self = GKM_GNOME2_MODULE (base);
if (g_str_equal (name, "directory")) {
g_free (self->directory);
self->directory = g_strdup (value);
}
} | false | false | false | false | false | 0 |
sqlite3IsNumber(const char *z, int *realnum){
int incr = 1;
if( *z=='-' || *z=='+' ) z += incr;
if( !th_isdigit(*(u8*)z) ){
return 0;
}
z += incr;
if( realnum ) *realnum = 0;
while( th_isdigit(*(u8*)z) ){ z += incr; }
if( *z=='.' ){
z += incr;
if( !th_isdigit(*(u8*)z) ) return 0;
while( ... | false | false | false | false | false | 0 |
gth_task_progress_finalize (GObject *base)
{
GthTaskProgress *self = (GthTaskProgress *) base;
if (self->pulse_event != 0)
g_source_remove (self->pulse_event);
if (self->task_progress != 0)
g_signal_handler_disconnect (self->task, self->task_progress);
if (self->task_completed != 0)
g_signal_handler_disconne... | false | false | false | false | false | 0 |
export_accessors (const char *var_name,
gboolean do_get,
int get_lineno,
gboolean do_set,
int set_lineno,
Type *type,
const char *gtktype,
int lineno)
{
Type *the_type;
if (type != NULL)
the_type = (Type *)node_copy ((Node *)type);
else
the_type = get_tree_type (gtktype, TRUE);
if... | false | false | false | false | false | 0 |
mei_txe_pci_iounmap(struct pci_dev *pdev, struct mei_txe_hw *hw)
{
int i;
for (i = SEC_BAR; i < NUM_OF_MEM_BARS; i++) {
if (hw->mem_addr[i]) {
pci_iounmap(pdev, hw->mem_addr[i]);
hw->mem_addr[i] = NULL;
}
}
} | false | false | false | false | false | 0 |
init_highlight(both, reset)
int both; /* include groups where 'bg' doesn't matter */
int reset; /* clear group first */
{
int i;
char **pp;
static int had_both = FALSE;
#ifdef FEAT_EVAL
char_u *p;
/*
* Try finding the color scheme file. Used when a color file was loaded
... | false | false | false | false | false | 0 |
e_table_subset_variable_clear (ETableSubsetVariable *etssv)
{
ETableModel *etm = E_TABLE_MODEL (etssv);
ETableSubset *etss = E_TABLE_SUBSET (etssv);
e_table_model_pre_change (etm);
etss->n_map = 0;
g_free (etss->map_table);
etss->map_table = (gint *) g_new (guint, 1);
etssv->n_vals_allocated = 1;
e_table_mode... | false | false | false | false | false | 0 |
checkcommand(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, bool isjson, char group)
{
struct api_data *root = NULL;
bool io_open;
char cmdbuf[100];
bool found, access;
int i;
if (param == NULL || *param == '\0') {
message(io_data, MSG_MISCHK, 0, NULL, isjson);
return;
}
found = false;... | false | false | false | false | false | 0 |
ftp_lite_data_channel_auth( struct ftp_lite_server *s, FILE *data )
{
OM_uint32 major, minor, flags=0;
int token;
if(!s->data_channel_authentication) return 1;
setbuf(data,0);
debug(D_FTP,"data channel authentication in progress...");
major = globus_gss_assist_init_sec_context( &minor, s->credential, &s->dat... | false | false | false | false | false | 0 |
undo_node(struct ibv_mem_node *node,
uintptr_t start, int inc)
{
struct ibv_mem_node *tmp = NULL;
/*
* This condition can be true only if we merged this
* node with the previous one, so we need to split them.
*/
if (start > node->start) {
tmp = split_range(node, start);
if (tmp) {
node->refcnt... | false | false | false | false | false | 0 |
on_polling_timout (gpointer user_data)
{
UDisksLinuxMDRaid *mdraid = UDISKS_LINUX_MDRAID (user_data);
UDisksLinuxMDRaidObject *object = NULL;
UDisksLinuxDevice *raid_device;
/* udisks_debug ("polling timeout"); */
object = udisks_daemon_util_dup_object (mdraid, NULL);
if (object == NULL)
goto out;
... | false | false | false | false | false | 0 |
pdf_push_namespace(gx_device_pdf *pdev)
{
int code = cos_array_add_object(pdev->Namespace_stack,
COS_OBJECT(pdev->local_named_objects));
cos_dict_t *pcd =
cos_dict_alloc(pdev, "pdf_push_namespace(local_named_objects)");
cos_array_t *pca =
cos_array_alloc(p... | false | false | false | false | false | 0 |
gf_proc_dump_xlator_info (xlator_t *top)
{
xlator_t *trav = NULL;
glusterfs_ctx_t *ctx = NULL;
char itable_key[1024] = {0,};
if (!top)
return;
ctx = glusterfs_ctx_get ();
trav = top;
while (trav) {
if (ctx->me... | false | false | false | false | false | 0 |
httpCloneHost(HttpHost *parent)
{
HttpHost *host;
Http *http;
http = MPR->httpService;
if ((host = mprAllocObj(HttpHost, manageHost)) == 0) {
return 0;
}
host->mutex = mprCreateLock();
/*
The dirs and routes are all copy-on-write.
Don't clone ip, port a... | false | false | false | false | false | 0 |
g_ptr_array_get_length (GPtrArray* self) {
gint result;
guint _tmp0_ = 0U;
g_return_val_if_fail (self != NULL, 0);
_tmp0_ = self->len;
result = (gint) _tmp0_;
return result;
} | false | false | false | false | false | 0 |
quotearg_alloc_mem (char const *arg, size_t argsize, size_t *size,
struct quoting_options const *o)
{
struct quoting_options const *p = o ? o : &default_quoting_options;
int e = errno;
/* Elide embedded null bytes if we can't return a size. */
int flags = p->flags | (size ? 0 : QA_ELIDE_NULL_BYTES);
si... | true | true | false | false | false | 1 |
skipToEndOfChar (void)
{
int c;
int count = 0, veraBase = '\0';
while ((c = fileGetc ()) != EOF)
{
++count;
if (c == BACKSLASH)
fileGetc (); /* throw away next character, too */
else if (c == SINGLE_QUOTE)
break;
else if (c == NEWLINE)
{
fileUngetc (c);
break;
}
else if (count == 1 &... | false | false | false | false | false | 0 |
scaleMaskYdXd(SplashImageMaskSource src, void *srcData,
int srcWidth, int srcHeight,
int scaledWidth, int scaledHeight,
SplashBitmap *dest) {
Guchar *lineBuf;
Guint *pixBuf;
Guint pix;
Guchar *destPtr;
int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep, xx, d, d0, d1;
int i, j;
// Bresenham... | false | false | false | false | false | 0 |
getUnprojectedPosition(const Vector2& pos) const
{
RenderingSurface* rs = &getTargetRenderingSurface();
// if window is not backed by RenderingWindow, return same pos.
if (!rs->isRenderingWindow())
return pos;
// get first target RenderingWindow
RenderingWindow* rw = static_cast<RenderingW... | false | false | false | false | false | 0 |
ShmemInitHash(const char *name, /* table string name for shmem index */
long init_size, /* initial table size */
long max_size, /* max size of the table */
HASHCTL *infoP, /* info about key and bucket size */
int hash_flags) /* info about infoP */
{
bool found;
void *location;
/*
* Hash ta... | false | false | false | false | false | 0 |
xmlSchemaGetPropNodeNs(xmlNodePtr node, const char *uri, const char *name)
{
xmlAttrPtr prop;
if ((node == NULL) || (name == NULL))
return(NULL);
prop = node->properties;
while (prop != NULL) {
if ((prop->ns != NULL) &&
xmlStrEqual(prop->name, BAD_CAST name) &&
... | false | false | false | false | false | 0 |
compute(const InternalParametersType & x,
InternalMeasureType *ff,
InternalDerivativeType *g)
{
// delegate the computation to the CostFunction
DerivativeType externalGradient;
ParametersType parameters( x.size() );
if ( this->m_ScalesInitialized )
{
const ScalesType & invS... | false | false | false | false | false | 0 |
ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
{
if(specs != (((void *)0)) && _class)
{
struct Specifier * spec;
for(spec = specs->first; spec; spec = spec->next)
{
if(spec->type == 0 && spec->specifier == THISCLASS)
{
spec->type = ... | false | false | false | false | false | 0 |
nfsproc3_readlink_3_svc(READLINK3args * argp,
struct svc_req * rqstp)
{
static READLINK3res result;
char *path;
static char buf[NFS_MAXPATHLEN];
int res;
PREP(path, argp->symlink);
res = backend_readlink(path, buf, NFS_MAXPATHLEN - 1);
if (res == -1)
result.status = readlink_err... | false | false | false | false | false | 0 |
PGTYPESinterval_to_asc(interval * span)
{
struct tm tt,
*tm = &tt;
fsec_t fsec;
char buf[MAXDATELEN + 1];
int DateStyle = 0;
if (interval2tm(*span, tm, &fsec) != 0)
{
errno = PGTYPES_INTVL_BAD_INTERVAL;
return NULL;
}
if (EncodeInterval(tm, fsec, DateStyle, buf) != 0)
{
errno = PGTYPES_INTVL_... | true | true | false | false | false | 1 |
shell_command_generator (const char *text, int state)
{
static int x, len;
/* If this is a new command to complete, reinitialize */
if (!state) {
x = 0;
len = strlen (text);
}
/* Search 'text' */
for (; func[x].function; x++)
if (!strncmp (func[x].command, text, len))
break;
if (func[x].function)
re... | false | false | false | false | false | 0 |
CSSFindProperty(css, selectors, name)
CSSContext css;
GList selectors;
char *name;
{
CSSProperty p;
GList slist, xlist;
CSSSelector h;
if ((h = GListGetHead(selectors)) != GListGetTail(selectors))
{
slist = GListCreate();
GListAddHead(slist, h);
}
else slist = NULL;
for (p = (CSSProperty)GList... | false | false | false | false | false | 0 |
start_board (GcomprisBoard *agcomprisBoard)
{
gchar **gnuchess_pathptr = gnuchess_path;
gchar *gnuchess_bin = g_strdup(getenv("GNUCHESS"));
do
{
if(gnuchess_bin != NULL)
{
}
else if(*gnuchess_pathptr[0] == '/')
{
gnuchess_bin = strdup(*gnuchess_pathptr);
}
else
{
/* Check in ou... | false | false | false | false | true | 1 |
de_tx_timeout (struct net_device *dev)
{
struct de_private *de = netdev_priv(dev);
const int irq = de->pdev->irq;
netdev_dbg(dev, "NIC status %08x mode %08x sia %08x desc %u/%u/%u\n",
dr32(MacStatus), dr32(MacMode), dr32(SIAStatus),
de->rx_tail, de->tx_head, de->tx_tail);
del_timer_sync(&de->media_timer... | false | false | false | false | false | 0 |
add_device(xmlNodePtr node, gpointer opaque)
{
struct GetDeviceData* data = (struct GetDeviceData*)opaque;
GVirConfigDomainDevice *device;
device = gvir_config_domain_device_new_from_tree(data->doc, node);
if (device != NULL)
data->devices = g_list_append(data->devices, device);
else
... | false | false | false | false | false | 0 |
computeModel(const Expr& e, std::vector<Expr>& v) {
Type t = getBaseType(e);
Expr tExpr = t.getExpr();
vector<Theorem> thms;
vector<unsigned> changed;
Theorem asst;
if(tExpr.getOpKind() == RECORD_TYPE)
asst = d_rules->expandRecord(e);
else if(tExpr.getOpKind() == TUPLE_TYPE)
asst = d_rules->expan... | false | false | false | false | false | 0 |
ide_get_lba_addr(struct ide_cmd *cmd, int lba48)
{
struct ide_taskfile *tf = &cmd->tf;
u32 high, low;
low = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal;
if (lba48) {
tf = &cmd->hob;
high = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal;
} else
high = tf->device & 0xf;
return ((u64)high << 24) | low;
} | false | false | false | false | false | 0 |
lpfc_sli4_xri_inrange(struct lpfc_hba *phba,
uint16_t xri)
{
uint16_t i;
for (i = 0; i < phba->sli4_hba.max_cfg_param.max_xri; i++) {
if (xri == phba->sli4_hba.xri_ids[i])
return i;
}
return NO_XRI;
} | false | false | false | false | false | 0 |
xlsx_xf_protect (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
int locked = TRUE;
int hidden = TRUE;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_bool (xin, attrs, "locked", &locked)) ;
else if (attr_bool (xin, attrs, "hidden", &hidden))... | false | false | false | false | false | 0 |
strlwc(const char * s)
{
static char l[ASCIILINESZ+1];
int i ;
if (s==NULL) return NULL ;
memset(l, 0, ASCIILINESZ+1);
i=0 ;
while (s[i] && i<ASCIILINESZ) {
l[i] = (char)tolower((int)s[i]);
i++ ;
}
l[ASCIILINESZ]=(char)0;
return l ;
} | true | true | false | false | false | 1 |
megaraid_io_detach(adapter_t *adapter)
{
struct Scsi_Host *host;
con_log(CL_DLEVEL1, (KERN_INFO "megaraid: io detach\n"));
host = adapter->host;
scsi_remove_host(host);
return;
} | false | false | false | false | false | 0 |
cli_event_int(cli_events_t *ctx, unsigned id, uint64_t arg)
{
struct cli_event *ev = get_event(ctx, id);
if (!ev)
return;
if (ev->type != ev_int) {
cli_event_error_str(ctx, "cli_event_int must be called with ev_int type");
return;
}
switch (ev->multiple) {
case multiple_last:
ev->u.v_int = ... | false | false | false | false | false | 0 |
wxSplit(const wxString& str, const wxChar sep, const wxChar escape)
{
if ( escape == wxT('\0') )
{
// simple case: we don't need to honour the escape character
return wxStringTokenize(str, sep, wxTOKEN_RET_EMPTY_ALL);
}
wxArrayString ret;
wxString curr;
wxChar prev = wxT('\0');
... | false | false | false | false | false | 0 |
_xlate_signal_name(const char *signal_name)
{
uint16_t sig_num;
char *end_ptr, *sig_names = NULL;
int i;
sig_num = (uint16_t) strtol(signal_name, &end_ptr, 10);
if ((*end_ptr == '\0') || (sig_num != 0))
return sig_num;
for (i=0; i<SIZE(sig_name_num); i++) {
if (strcasecmp(sig_name_num[i].name, signal_name) ... | false | false | false | false | false | 0 |
PyInit_math(void)
{
PyObject *m;
m = PyModule_Create(&mathmodule);
if (m == NULL)
goto finally;
PyModule_AddObject(m, "pi", PyFloat_FromDouble(Py_MATH_PI));
PyModule_AddObject(m, "e", PyFloat_FromDouble(Py_MATH_E));
finally:
return m;
} | false | false | false | false | false | 0 |
et_search_search (ETableSearch *search,
gchar *string,
ETableSearchFlags flags,
ETable *et)
{
gint cursor;
gint rows;
gint i;
ETableCol *col = current_search_col (et);
if (col == NULL)
return FALSE;
rows = e_table_model_row_count (et->model);
g_object_ge... | 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.