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 |
|---|---|---|---|---|---|---|
tower_release (struct inode *inode, struct file *file)
{
struct lego_usb_tower *dev;
int retval = 0;
dev = file->private_data;
if (dev == NULL) {
retval = -ENODEV;
goto exit_nolock;
}
mutex_lock(&open_disc_mutex);
if (mutex_lock_interruptible(&dev->lock)) {
retval = -ERESTARTSYS;
goto exit;
}
... | false | false | false | false | false | 0 |
init_node(const Position &pos, SearchStack ss[], int ply, int threadID) {
assert(ply >= 0 && ply < PLY_MAX);
assert(threadID >= 0 && threadID < ActiveThreads);
Threads[threadID].nodes++;
if(threadID == 0) {
NodesSincePoll++;
if(NodesSincePoll >= NodesBetweenPolls) {
poll();
... | false | false | false | false | false | 0 |
fs_nice_stream_transmitter_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
FsNiceStreamTransmitter *self = FS_NICE_STREAM_TRANSMITTER (object);
switch (... | false | false | false | false | false | 0 |
cell_renderer_bifurcation_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec) {
CellRendererBifurcation *self = CELL_RENDERER_BIFURCATION(object);
switch (prop_id) {
case PROP_ROW_ID:
g_value_set_ulong(value, self->row_id);
break;
c... | false | false | false | false | false | 0 |
gsd_set_clipplane(int num, int able)
{
/* OGLXXX see man page for glClipPlane equation */
if (able) {
glEnable(GL_CLIP_PLANE0 + (num));
}
else {
glDisable(GL_CLIP_PLANE0 + (num));
}
return;
} | false | false | false | false | false | 0 |
ms_unrxline(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
if (parc != 3 || EmptyString(parv[2]))
return;
sendto_match_servs(source_p, parv[1], CAP_CLUSTER,
"UNRXLINE %s %s",
parv[1], parv[2]);
if (!IsClient(source_p) || !matc... | false | false | false | false | false | 0 |
gaa_parser (int argc, char **argv)
{
if (gaa (argc, argv, &info) != -1)
{
fprintf (stderr,
"Error in the arguments. Use the --help or -h parameters to get more information.\n");
exit (1);
}
disable_client_cert = info.disable_client_cert;
require_cert = info.require_cert;
debu... | false | false | false | false | false | 0 |
run_fwd_callbacks(struct sip_msg *req, char *buf, int len,
struct socket_info* send_sock, int proto, union sockaddr_union *to)
{
struct fwd_callback *cbp;
str buffer;
buffer.len = len;
buffer.s = buf;
for ( cbp=fwdcb_hl ; cbp ; cbp=cbp->next ) {
LM_DBG("FWD callback entered\n");
cbp->callback( req, &buffe... | false | false | false | false | false | 0 |
ib_sa_path_rec_get(struct ib_sa_client *client,
struct ib_device *device, u8 port_num,
struct ib_sa_path_rec *rec,
ib_sa_comp_mask comp_mask,
int timeout_ms, gfp_t gfp_mask,
void (*callback)(int status,
struct ib_sa_path_rec *resp,
void *context),
void *co... | false | false | false | false | false | 0 |
readToken (tokenInfo *const token)
{
int c;
token->type = TOKEN_UNDEFINED;
token->keyword = KEYWORD_NONE;
vStringClear (token->string);
getNextChar:
do
{
c = fileGetc ();
token->lineNumber = getSourceLineNumber ();
token->filePosition = getInputFilePosition ();
}
while (c == '\t' || c == ' ' || ... | false | false | false | false | false | 0 |
init( WId window )
{
d->window = window;
d->hideTimer = new QTimer( this );
setWindowFlags( POPUP_FLAGS );
setFrameStyle( QFrame::Box| QFrame::Plain );
setLineWidth( 2 );
if( d->popupStyle == Boxed )
{
setFrameStyle( QFrame::Box| QFrame::Plain );
setLineWidth( 2 );
}
... | false | false | false | false | false | 0 |
handle_new_lsr(struct edgeport_port *edge_port, int lsr_data,
__u8 lsr, __u8 data)
{
struct async_icount *icount;
__u8 new_lsr = (__u8)(lsr & (__u8)(LSR_OVER_ERR | LSR_PAR_ERR |
LSR_FRM_ERR | LSR_BREAK));
dev_dbg(&edge_port->port->dev, "%s - %02x\n", __func__, new_lsr);
edge_port->shadow_lsr = lsr;
... | false | false | false | false | false | 0 |
doNoZeroes(string* output) {
if (hasNoZeroes() && output->rfind('.') != string::npos) {
int nbzero = 0;
int length = output->length();
int pos = length-1;
while (pos >= 0 && output->at(pos) == '0') {
pos--; nbzero++;
}
// also eat '.', e.g., if number was 3.0 (not for 3.10)
if (pos >= 0 && output->at(... | false | false | false | false | false | 0 |
_dxfPartitionNeighbors(Object o)
{
int i;
Field f;
Array c=NULL;
Class class;
class = DXGetObjectClass(o);
if (class == CLASS_GROUP)
class = DXGetGroupClass((Group)o);
if (class == CLASS_FIELD)
return OK;
if (class != CLASS_COMPOSITEFIELD)
{
DXSetError(ERROR_DATA_INVALID,... | false | false | false | false | false | 0 |
TransactionIdDidCommit(TransactionId transactionId)
{
XidStatus xidstatus;
xidstatus = TransactionLogFetch(transactionId);
/*
* If it's marked committed, it's committed.
*/
if (xidstatus == TRANSACTION_STATUS_COMMITTED)
return true;
/*
* If it's marked subcommitted, we have to check the parent recursive... | false | false | false | false | false | 0 |
input_print_modalias_bits(char *buf, int size,
char name, unsigned long *bm,
unsigned int min_bit, unsigned int max_bit)
{
int len = 0, i;
len += snprintf(buf, max(size, 0), "%c", name);
for (i = min_bit; i < max_bit; i++)
if (bm[BIT_WORD(i)] & BIT_MASK(i))
len += snprintf(buf + len, max(size... | false | false | false | false | false | 0 |
debug_send_command(gint tf, const char *command)
{
if (gdb_state == ACTIVE)
{
gsize previous_len = commands->len;
const char *s;
for (s = command; *s && !isspace(*s); s++);
g_string_append_len(commands, command, s - command);
if (tf && thread_id)
{
g_string_append_printf(commands, " --thread %s", thr... | false | false | false | false | false | 0 |
set_exception(const CORBA::Any& value)
{
CORBA::TypeCode_var tc = value.type();
while( tc->kind() == CORBA::tk_alias )
tc = tc->content_type();
if( tc->kind() != CORBA::tk_except )
OMNIORB_THROW(BAD_PARAM,
BAD_PARAM_NotAnException,
CORBA::COMPLETED_NO);
switch( pd_state ) {
case SR_GOT_PARAM... | false | false | false | false | false | 0 |
cgroup_writeback_init(void)
{
isw_wq = alloc_workqueue("inode_switch_wbs", 0, 0);
if (!isw_wq)
return -ENOMEM;
return 0;
} | false | false | false | false | false | 0 |
goRight()
{
char symbol = ControlSym::SYM_NONE;
if (!m_model->isLeft()) {
if (m_model->rules()->actionMoveDir(Dir::DIR_RIGHT)) {
symbol = m_symbols.getRight();
}
}
else {
m_model->rules()->actionTurnSide();
symbol = m_symbols.getRight();
}
return symbo... | false | false | false | false | false | 0 |
on_popup_table_browse (GtkMenuItem * menuitem,
gpointer user_data)
{
GSQL_TRACE_FUNC;
GSQLSession *session = NULL;
GSQLContent *content = NULL;
GSQLEditor *editor;
GtkWidget *source;
GSQLWorkspace *workspace;
GSQLNavigation *navigation;
GtkTreeIter *iter = NULL;
gchar *name, *realname, *ow... | false | false | false | false | false | 0 |
_iodbcdm_conv_var_A2W(STMT_t *pstmt, int i, SQLCHAR *pData, int pDataLength)
{
VAR_t *var;
size_t size = 0;
int count_alloc = 0;
if (i > STMT_VARS_MAX - 1)
return NULL;
var = &pstmt->vars[i];
pstmt->vars_inserted = 1;
if (pData == NULL)
{
MEM_FREE(var->data);
var->data = NULL;
... | false | false | false | false | false | 0 |
eap_method_phase2_update_secrets_helper (EAPMethod *method,
NMConnection *connection,
const char *combo_name,
guint32 column)
{
GtkWidget *combo;
GtkTreeIter iter;
GtkTreeModel *model;
g_retur... | false | false | false | false | false | 0 |
relax_section_symbols (bfd *abfd, asection *sec)
{
xtensa_relax_info *relax_info;
unsigned int sec_shndx;
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Sym *isymbuf;
unsigned i, num_syms, num_locals;
relax_info = get_xtensa_relax_info (sec);
BFD_ASSERT (relax_info);
if (!relax_info->is_relaxable_literal... | false | false | false | false | false | 0 |
fso_framework_base_netlink_notifier_construct (GType object_type) {
FsoFrameworkBaseNetlinkNotifier * self = NULL;
gchar* _tmp0_ = NULL;
GHashFunc _tmp1_ = NULL;
GEqualFunc _tmp2_ = NULL;
GHashTable* _tmp3_ = NULL;
struct nl_sock* _tmp4_ = NULL;
struct nl_sock* _tmp5_ = NULL;
struct nl_sock* _tmp6_ = NULL;
str... | false | false | false | false | false | 0 |
sha_to_pyhex(const unsigned char *sha)
{
char hexsha[41];
int i;
for (i = 0; i < 20; i++) {
hexsha[i*2] = bytehex((sha[i] & 0xF0) >> 4);
hexsha[i*2+1] = bytehex(sha[i] & 0x0F);
}
return PyString_FromStringAndSize(hexsha, 40);
} | false | false | false | false | false | 0 |
r_DECODE_FLEX(jxr_image_t image, struct rbitstream*str,
unsigned tx, unsigned mx,
int ch, unsigned block, unsigned k,
unsigned flexbits)
{
/* NOTE: The model_bits shift was already applied, when the HP
value was first parsed. */
i... | false | false | false | false | false | 0 |
crc32c_intel_le_hw_byte(uint32_t crc, unsigned char const *data,
unsigned long length)
{
while (length--) {
__asm__ __volatile__(
".byte 0xf2, 0xf, 0x38, 0xf0, 0xf1"
:"=S"(crc)
:"0"(crc), "c"(*data)
);
data++;
}
return crc;
} | false | false | false | false | false | 0 |
motion_event_cb (ClutterActor *stage,
ClutterMotionEvent *event,
ChamplainMarker *marker)
{
ChamplainMarkerPrivate *priv = marker->priv;
gfloat x, y;
if (event->type != CLUTTER_MOTION)
return FALSE;
if (clutter_actor_transform_stage_point (CLUTTER_ACTOR (marker),
event->x,
even... | false | false | false | false | false | 0 |
get_auditfail_action(auditfail_t *failmode)
{
clear_config();
if (load_libaudit_config(CONFIG_FILE)) {
*failmode = config.failure_action;
return 1;
}
*failmode = config.failure_action;
return 0;
} | false | false | false | false | false | 0 |
_parse(struct plugin *plugin, struct lms_context *ctxt, const struct lms_file_info *finfo, void *match)
{
struct lms_image_info info = { };
int fd, r;
fd = open(finfo->path, O_RDONLY);
if (fd < 0) {
perror("open");
return -1;
}
if (_png_data_get(fd, &info) != 0) {
r = -... | false | false | false | false | false | 0 |
gui_print_group( struct group *grp, int print_parent, int print_banner )
{
struct tcp_connection *conn_p;
uint16_t policy = group_get_policy( grp );
if ( print_banner && (print_parent || group_get_size( grp ) > 0) ) {
attron( A_UNDERLINE );
if ( policy & POLIC... | false | false | false | false | false | 0 |
path() const
{
return !m_kfileitem.isNull() ? m_kfileitem.url().path() : QString();
} | false | false | false | false | false | 0 |
Index(unsigned int index) const
{
if(!IsValid()) return(0);
TDictionary::const_iterator it=ns->Dictionary.find(entry);
if(it==ns->Dictionary.end()) return(0);
if(it->second.size()<=index) return(0);
return(it->second[index]);
} | false | false | false | false | false | 0 |
ui_series_init(GtkWindow * window, GtkWidget * window_vbox) {
ui_series_t * ui_series;
/* alloc space for the data structure for passing ui info */
if ((ui_series = g_try_new(ui_series_t,1)) == NULL) {
g_warning(_("couldn't allocate memory space for ui_series_t"));
return NULL;
}
ui_series->referenc... | false | false | false | false | false | 0 |
append_to_cdata(gxml_data * xd, const char * cdata, int len)
{
int offset;
if( !xd || !cdata || len <= 0 ) {
fprintf(stderr,"** A2CD, bad params (%p,%p,%d)\n",
(void *)xd,(void *)cdata, len);
return 1;
}
if( !*xd->cdata ) {
offset = 0;
xd->clen = len + 1; ... | false | true | false | false | false | 1 |
RequireTransactionChain(bool isTopLevel, const char *stmtType)
{
/*
* xact block already started?
*/
if (IsTransactionBlock())
return;
/*
* subtransaction?
*/
if (IsSubTransaction())
return;
/*
* inside a function call?
*/
if (!isTopLevel)
return;
ereport(ERROR,
(errcode(ERRCODE_NO_ACTIVE... | false | false | false | false | false | 0 |
split_delProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
ComplexObject *cpx;
jsid asId;
cpx = split_get_private(cx, obj);
if (!cpx)
return JS_TRUE;
if (!cpx->isInner && cpx->inner) {
/* Make sure to define this property on the inner object. */
if (!JS_ValueToId... | false | false | false | false | false | 0 |
filter_coef(FLOAT x)
{
if (x > 1.0)
return 0.0;
if (x <= 0.0)
return 1.0;
return cos(PI / 2 * x);
} | false | false | false | false | false | 0 |
TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value)
{
enum TIFFReadDirEntryErr err;
if (direntry->tdir_count!=1)
return(TIFFReadDirEntryErrCount);
switch (direntry->tdir_type)
{
case TIFF_BYTE:
{
uint8 m;
TIFFReadDirEntryCheckedByte(tif,direntry,&m);
*va... | false | false | false | false | false | 0 |
sharedAllocateBuffer( CoreSurfacePool *pool,
void *pool_data,
void *pool_local,
CoreSurfaceBuffer *buffer,
CoreSurfaceAllocation *allocation,
void *a... | false | false | false | false | false | 0 |
print_quality_revcomp (FILE *fp, char *quality, int querylength,
int hardclip_low, int hardclip_high, int shift) {
int i;
int c;
if (quality == NULL) {
putc('*',fp);
} else {
for (i = querylength - 1 - hardclip_high; i >= hardclip_low; --i) {
if ((c = quality[i] + shift) <= 32) {
fprint... | false | false | false | false | false | 0 |
_key_schedule(krb5_context context,
struct _krb5_key_data *key)
{
krb5_error_code ret;
struct _krb5_encryption_type *et = _krb5_find_enctype(key->key->keytype);
struct _krb5_key_type *kt;
if (et == NULL) {
return unsupported_enctype (context,
key->key->keyt... | false | false | false | false | false | 0 |
__dirty(struct dm_cache_metadata *cmd, dm_cblock_t cblock, bool dirty)
{
int r;
unsigned flags;
dm_oblock_t oblock;
__le64 value;
r = dm_array_get_value(&cmd->info, cmd->root, from_cblock(cblock), &value);
if (r)
return r;
unpack_value(value, &oblock, &flags);
if (((flags & M_DIRTY) && dirty) || (!(flags &... | false | false | false | false | false | 0 |
odm_PTTryState_8188E(struct odm_ra_info *pRaInfo)
{
pRaInfo->PTTryState = 0;
switch (pRaInfo->PTModeSS) {
case 3:
if (pRaInfo->DecisionRate >= 0x19)
pRaInfo->PTTryState = 1;
break;
case 2:
if (pRaInfo->DecisionRate >= 0x11)
pRaInfo->PTTryState = 1;
break;
case 1:
if (pRaInfo->DecisionRate >= 0x0a)
... | false | false | false | false | false | 0 |
ReadString(size_t nb, size_t nbChar, std::string* values)
{
for (size_t i = 0 ; i < nb ; ++i)
values[i] = this->ReadString(nbChar);
} | false | false | false | false | false | 0 |
sg_get_cpu_stats_diff_int(sg_cpu_stats *tgt, const sg_cpu_stats *now, const sg_cpu_stats *last){
if( NULL == tgt ) {
RETURN_WITH_SET_ERROR("cpu", SG_ERROR_INVALID_ARGUMENT, "sg_get_cpu_stats_diff_int(tgt)");
}
if( now ) {
*tgt = *now;
if( last ) {
tgt->user -= last->user;
tgt->kernel -= last->kernel;
... | false | false | false | false | false | 0 |
meta_back_db_init(
Backend *be,
ConfigReply *cr)
{
metainfo_t *mi;
int i;
BackendInfo *bi;
bi = backend_info( "ldap" );
if ( !bi || !bi->bi_extra ) {
Debug( LDAP_DEBUG_ANY,
"meta_back_db_init: needs back-ldap\n",
0, 0, 0 );
return 1;
}
mi = ch_calloc( 1, sizeof( metainfo_t ) );
if ( mi == NULL )... | false | false | false | false | false | 0 |
on_temporary_account_created_for_identity (GoaIdentityService *self,
GAsyncResult *result,
GoaIdentity *identity)
{
GoaObject *object;
const char *principal;
GError *error;
principal = goa_identity_get_id... | false | false | false | false | false | 0 |
transaction_cancel_load(CdlTransaction transaction, CdlLoadable loadable)
{
CYG_REPORT_FUNCNAME("CdlLoadable::transaction_cancel_load");
CYG_REPORT_FUNCARG2XV(transaction, loadable);
CYG_PRECONDITION_CLASSC(transaction);
CYG_PRECONDITION_CLASSC(loadable);
CdlToplevel toplevel = transaction->get_top... | false | false | false | false | false | 0 |
glade_fixed_event (GladeWidget *gwidget_fixed,
GdkEvent *event)
{
GladeFixed *fixed = GLADE_FIXED (gwidget_fixed);
GladeWidgetAdaptor *adaptor;
GtkWidget *event_widget;
gboolean handled = FALSE;
adaptor = glade_palette_get_current_item (glade_app_get_palette ());
/* Get the e... | false | false | false | false | false | 0 |
get_target_port_group(int fd)
{
unsigned char buf[128];
struct vpd83_data * vpd83;
struct vpd83_dscr * dscr;
int rc;
memset(buf, 0, sizeof(buf));
rc = do_inquiry(fd, 1, 0x83, buf, sizeof(buf));
if (!rc) {
vpd83 = (struct vpd83_data *) buf;
rc = -RTPG_NO_TPG_IDENTIFIER;
FOR_EACH_VPD83_DSCR(vpd83, dscr)... | false | false | false | false | false | 0 |
util__sparse_25sparse_vector_iter(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj sv_scm;
SparseVector* sv;
ScmObj SCM_SUBRARGS[1];
int SCM_i;
SCM_ENTER_SUBR("%sparse-vector-iter");
for (SCM_i=0; SCM_i<1; SCM_i++) {
SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
}
sv_scm = SCM_SUBRARGS[0];
if (!SP... | false | false | false | false | false | 0 |
afr_blocking_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, dict_t *xdata)
{
AFR_TRACE_INODELK_OUT (frame, this, AFR_INODELK_TRANSACTION,
AFR_LOCK_OP, NULL, op_ret,
op_errno... | false | false | false | false | false | 0 |
output_delimiter(const char c)
{
static char buffer[2] = { '\0', '\0' };
const char *ret;
switch (c) {
case '\n':
ret = "<NEWLINE>";
break;
default:
buffer[0] = c;
ret = buffer;
break;
}
return ret;
} | false | false | false | false | false | 0 |
gst_dvbsub_overlay_getcaps (GstDVBSubOverlay * render, GstPad * pad,
GstCaps * filter)
{
GstPad *otherpad;
GstCaps *caps, *templ;
if (pad == render->srcpad)
otherpad = render->video_sinkpad;
else
otherpad = render->srcpad;
templ = gst_pad_get_pad_template_caps (otherpad);
/* we can do what th... | false | false | false | false | false | 0 |
NET_EndSecureDemo(sha1_digest_t demo_hash)
{
net_packet_t *request, *response;
net_addr_t *master_addr;
char *signature;
master_addr = NET_Query_ResolveMaster(query_context);
// Construct end request and send to master server.
request = NET_NewPacket(10);
NET_WriteInt16(request, NET_MASTE... | false | false | false | false | false | 0 |
fcgi_hash_clean(fcgi_hash *h)
{
memset(h->hash_table, 0, sizeof(h->hash_table));
h->list = NULL;
/* delete all bucket blocks except the first one */
while (h->buckets->next) {
fcgi_hash_buckets *q = h->buckets;
h->buckets = h->buckets->next;
free(q);
}
h->buckets->idx = 0;
/* delete all data segments exce... | false | false | false | false | false | 0 |
mthca_query_port(struct ib_device *ibdev,
u8 port, struct ib_port_attr *props)
{
struct ib_smp *in_mad = NULL;
struct ib_smp *out_mad = NULL;
int err = -ENOMEM;
in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);
out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL);
if (!in_mad || !out_mad)
goto out;
memset(pro... | false | false | false | false | false | 0 |
CDB___qam_c_del(dbc, flags)
DBC *dbc;
u_int32_t flags;
{
QUEUE_CURSOR *cp;
DB *dbp;
db_recno_t total;
int ret;
dbp = dbc->dbp;
cp = dbc->internal;
PANIC_CHECK(dbp->dbenv);
/* Check for invalid flags. */
if ((ret = CDB___db_cdelchk(dbp, flags,
F_ISSET(dbp, DB_AM_RDONLY), cp->recno != RECNO_OOB)) != 0)... | false | false | false | false | false | 0 |
GetCurrentSchema()
{
/* -------------------------------------------- */
/* Get the current schema */
/* -------------------------------------------- */
PGresult *hResult = OGRPG_PQexec(hPGConn,"SELECT current_schema()");
if ( hResult && PQntuples(hResult) == 1 && !PQgetisnul... | false | false | false | false | false | 0 |
mtcp_no (void)
{
Thread *thread;
if (getenv("MTCP_NO_CHECKPOINT"))
return 0;
thread = getcurrenthread ();
again:
switch (mtcp_state_value(&thread -> state)) {
case ST_RUNDISABLED: {
return (0);
}
case ST_RUNENABLED: {
if (!mtcp_state_set (&(thread -> state), ST_RUNDISABLED, ST_RUN... | false | false | false | false | true | 1 |
get_mapping_page_size(void *p)
{
FILE *f;
char line[MAPS_BUF_SZ];
char *tmp;
unsigned long addr = (unsigned long)p;
f = fopen("/proc/self/smaps", "r");
if (!f) {
ERROR("Unable to open /proc/self/smaps\n");
return 0;
}
while ((tmp = fgets(line, MAPS_BUF_SZ, f))) {
unsigned long start, end, dummy;
char ... | false | false | false | false | false | 0 |
stPinchThreadSet_getAdjacencyComponentsP2(stHash *endsToAdjacencyComponents, stList *adjacencyComponent, stPinchEnd *end) {
stList *stack = stList_construct();
stList_append(adjacencyComponent, end);
stHash_insert(endsToAdjacencyComponents, end, adjacencyComponent);
stList_append(stack, end);
while ... | false | false | false | false | false | 0 |
svc_export_lookup(struct svc_export *exp)
{
struct cache_head *ch;
int hash = svc_export_hash(exp);
ch = sunrpc_cache_lookup(exp->cd, &exp->h, hash);
if (ch)
return container_of(ch, struct svc_export, h);
else
return NULL;
} | false | false | false | false | false | 0 |
nfs4_gc_state_owners(struct nfs_server *server)
{
struct nfs_client *clp = server->nfs_client;
struct nfs4_state_owner *sp, *tmp;
unsigned long time_min, time_max;
LIST_HEAD(doomed);
spin_lock(&clp->cl_lock);
time_max = jiffies;
time_min = (long)time_max - (long)clp->cl_lease_time;
list_for_each_entry_safe(sp,... | false | false | false | false | false | 0 |
FlocaleGetFftFont(
Display *dpy, char *fontname, char *encoding, char *module)
{
FftFontType *fftf = NULL;
FlocaleFont *flf = NULL;
char *fn, *hints = NULL;
hints = GetQuotedString(fontname, &fn, "/", NULL, NULL, NULL);
if (fn == NULL)
{
fn = fft_fallback_font;
}
else if (*fn == '\0')
{
free(fn);
fn = ... | false | false | false | false | false | 0 |
ossl_spki_initialize(int argc, VALUE *argv, VALUE self)
{
NETSCAPE_SPKI *spki;
VALUE buffer;
const unsigned char *p;
if (rb_scan_args(argc, argv, "01", &buffer) == 0) {
return self;
}
StringValue(buffer);
if (!(spki = NETSCAPE_SPKI_b64_decode(RSTRING_PTR(buffer), -1))) {
p = (unsigned cha... | false | false | false | false | false | 0 |
ajListstrFreeData(AjPList* Plist)
{
AjPList list = NULL;
AjPListNode next = NULL;
AjPListNode* rest = NULL;
if(!Plist)
return;
if(!*Plist)
return;
#ifdef AJ_SAVESTATS
listDelCnt++;
#endif
list = *Plist;
rest = &list->First;
if(list->Count)
{
/* free... | false | false | false | false | false | 0 |
qmonPopupTicketOverview(Widget w, XtPointer cld, XtPointer cad)
{
lList *alp = NULL;
DENTER(GUI_LAYER, "qmonPopupTicketOverview");
/* set busy cursor */
XmtDisplayBusyCursor(w);
if (!qmon_tov) {
qmon_tov = qmonCreateTicketOverview(AppShell);
/*
** set the close button callback
... | false | false | false | false | false | 0 |
drawUTF8(const char* str, GLERectangle* box) throw(ParserError) {
TeXObjectInfo info;
string utf8 = str;
decode_utf8_basic(utf8);
return draw(utf8.c_str(), info, 1, box);
} | false | false | false | false | false | 0 |
dmap_connection_build_message (DMAPConnection * connection,
const char *path,
gboolean need_hash,
gdouble version,
gint req_id, gboolean send_close)
{
SoupMessage *message = NULL;
SoupURI *base_uri = NULL;
SoupURI *uri = NULL;
char *uri_str = NULL;
g_object_get (connection,... | false | false | false | false | false | 0 |
parse_options (int argc,
char **argv)
{
GHashTable *options;
int i;
options = g_hash_table_new (g_str_hash, g_str_equal);
for (i = 2; i < argc; i += 2) {
g_hash_table_insert (options, argv[i], argv[i + 1]);
}
return options;
} | false | false | false | false | false | 0 |
kmo_arithmetic_1D_scalar(
kmclipm_vector *op1,
double op2,
kmclipm_vector *op1_noise,
const char *op)
{
cpl_error_code ret_error = CPL_ERROR_NONE;
kmclipm_vector *op1_copy = NULL;
K... | false | false | false | false | false | 0 |
on_set_enabled_list(GList *breaks, gboolean enabled)
{
GList *iter = breaks;
while (iter)
{
breakpoint *bp = (breakpoint*)iter->data;
if (bp->enabled ^ enabled)
{
bp->enabled = enabled;
/* remove old and set new marker */
markers_remove_breakpoint(bp);
markers_add_breakpoint(bp);
/* s... | false | false | false | false | false | 0 |
update_network(struct wlan_bssid_ex *dst,
struct wlan_bssid_ex *src,
struct _adapter *padapter)
{
u32 last_evm = 0, tmpVal;
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) &&
is_same_network(&(padapter->mlmepriv.cur_network.network), src)) {
if (padapter->recvpriv.signal_qual_data.total_num++ >... | false | false | false | false | false | 0 |
iter_get_basic_args(DBusMessageIter *iter,
int first_arg_type, ...)
{
int type;
va_list ap;
va_start(ap, first_arg_type);
for (type = first_arg_type; type != DBUS_TYPE_INVALID;
type = va_arg(ap, int)) {
void *value = va_arg(ap, void *);
int real_type = dbus_message_iter_get_arg_type(iter);
if (real... | false | false | false | false | false | 0 |
rb_define_const(klass, name, val)
VALUE klass;
const char *name;
VALUE val;
{
ID id = rb_intern(name);
if (!rb_is_const_id(id)) {
rb_warn("rb_define_const: invalide name `%s' for constant", name);
}
if (klass == rb_cObject) {
rb_secure(4);
}
rb_const_set(klass, id, val);
} | false | false | false | false | false | 0 |
lookup_extension(const std::string &extension) const
{
const_iterator i;
unsigned int j;
for(i = begin(); i != end(); i++)
for(j = 0; (*i)->get_extension(j); j++)
if(!stricmp(extension.c_str(), (*i)->get_extension(j)))
return *i;
return 0;
} | false | false | false | false | false | 0 |
unpermute()
{
// now we have to un-permute x and w
int j;
ALLOCA (dReal,tmp,n*sizeof(dReal));
#ifdef dUSE_MALLOC_FOR_ALLOCA
if (tmp == NULL) {
dMemoryFlag = d_MEMORY_OUT_OF_MEMORY;
return;
}
#endif
memcpy (tmp,x,n*sizeof(dReal));
for (j=0; j<n; j++) x[p[j]] = tmp[j];
memcpy (tmp,w,n*size... | false | false | false | false | false | 0 |
teleok(int x, int y, bool trapok)
{
if (!trapok && t_at(x, y)) return false;
if (!goodpos(x, y, &youmonst, 0)) return false;
if (!tele_jump_ok(u.ux, u.uy, x, y)) return false;
if (!in_out_region(x, y)) return false;
return true;
} | false | false | false | false | false | 0 |
storeSelf(char* buf) {
SPtr<TIPv6Addr> addr;
buf = writeUint16(buf, OptType);
buf = writeUint16(buf, getSize()-4);
AddrLst.first();
while(addr=AddrLst.get())
buf=addr->storeSelf(buf);
return buf;
} | false | false | false | false | false | 0 |
mac_address_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path)
{
const char *setting_name = nm_setting_get_name (setting);
char *tmp_string = NULL, *p;
gint *tmp_list;
GByteArray *array = NULL;
gsize length;
int i, type;
p = tmp_string = g_key_file_get_string (keyfile, set... | false | false | false | false | false | 0 |
ipmi_cxoem_main(struct ipmi_intf *intf, int argc, char **argv)
{
int rc = 0;
if (argc == 0 || strncmp(argv[0], "help", 4) == 0) {
ipmi_cxoem_usage();
return 0;
} else if (!strncmp(argv[0], "fw", 2)) {
rc = cx_fw_main(intf, argc - 1, &argv[1]);
} else if (!strncmp(argv[0], "fabric", 6)) {
rc = cx_fabric_mai... | false | false | false | false | false | 0 |
alias_set(imushort* alias_table, imushort region1, imushort region2)
{
if (region1 == region2)
return;
imushort min = region1<region2? region1: region2;
alias_getmin(alias_table, region1, min);
alias_getmin(alias_table, region2, min);
if (region1 != min && alias_table[region1] != min)
alias_setmin(... | false | false | false | false | false | 0 |
nvkm_vm_map(struct nvkm_vma *vma, struct nvkm_mem *node)
{
if (node->sg)
nvkm_vm_map_sg_table(vma, 0, node->size << 12, node);
else
if (node->pages)
nvkm_vm_map_sg(vma, 0, node->size << 12, node);
else
nvkm_vm_map_at(vma, 0, node);
} | false | false | false | false | false | 0 |
get_libc_errno_ptr(void)
{
/* NOTE: errno might be a macro which calls a function
(e.g. __errno_location() (GNU), _Errno() (AIX))
to get a per-thread value of errno */
#if defined(HAVE_DECL___ERRNO_LOCATION) && HAVE_DECL___ERRNO_LOCATION
static int* (*libc_errno)(void) = NULL;
const char* libc_errno_sym... | false | false | false | false | false | 0 |
gdk_pixbuf__qtif_image_load (FILE *f, GError **error)
{
guint count;
if(f == NULL)
{
g_set_error_literal (error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_BAD_OPTION,
_("Input file descriptor is NULL."));
return NULL;
}
for(count =... | false | false | false | false | false | 0 |
clearDeletionList()
{
if (DeletionList.empty())
return;
for (u32 i=0; i<DeletionList.size(); ++i)
{
DeletionList[i]->remove();
DeletionList[i]->drop();
}
DeletionList.clear();
} | false | false | false | false | false | 0 |
empty()
{
return mLogs[cHercIndex]->document()->isEmpty() && mLogs[cOsIndex]->document()->isEmpty();
} | false | false | false | false | false | 0 |
drv_HD_brightness(int brightness)
{
char cmd;
if (!(Capabilities & CAP_BRIGHTNESS))
return -1;
if (brightness < 0)
brightness = 0;
if (brightness > 3)
brightness = 3;
cmd = '0' + brightness;
drv_HD_command(allControllers, 0x38, T_EXEC); /* enable function */
drv_HD_data(allControllers... | false | false | false | false | false | 0 |
inf_text_buffer_text_erased(InfTextBuffer* buffer,
guint pos,
InfTextChunk* chunk,
InfUser* user)
{
g_return_if_fail(INF_TEXT_IS_BUFFER(buffer));
g_return_if_fail(chunk != NULL);
g_return_if_fail(user == NULL || INF_IS_USER(user))... | false | false | false | false | false | 0 |
verify_curve_param(const stp_vars_t *v, const char *parameter,
stp_parameter_t *desc, int quiet)
{
stp_parameter_verify_t answer = 1;
stp_dprintf(STP_DBG_VARS, v, " Verifying curve %s\n", parameter);
if (desc->bounds.curve &&
(desc->is_mandatory ||
stp_check_curve_parameter(v, parameter, STP_... | false | false | false | false | false | 0 |
LUKS_check_device_size(struct crypt_device *ctx, size_t keyLength)
{
struct device *device = crypt_metadata_device(ctx);
uint64_t dev_sectors, hdr_sectors;
if (!keyLength)
return -EINVAL;
if(device_size(device, &dev_sectors)) {
log_dbg("Cannot get device size for device %s.", device_path(device));
return -E... | false | false | false | false | false | 0 |
__ecereMethod_Breakpoint_Reset(struct Breakpoint * this)
{
this->inserted = 0x0;
(__ecereNameSpace__ecere__com__eSystem_Delete(this->address), this->address = 0);
if(this->bp)
__ecereMethod_GdbDataBreakpoint_Free(this->bp);
((this->bp ? (__ecereClass_GdbDataBreakpoint->Destructor ? __ecereClass_GdbDataBreakpoint->Destr... | false | false | false | false | false | 0 |
handshake(Json& request, threadinfo& ti) {
always_assert(request.is_a() && request.size() >= 2
&& request[1].is_i() && request[1].as_i() == Cmd_Handshake
&& (request.size() == 2 || request[2].is_o()));
if (request.size() >= 2
&& request[2]["maxkeylen"].is_i()
... | false | false | false | false | false | 0 |
init_pci_cap_msi_perm(struct perm_bits *perm, int len, u16 flags)
{
if (alloc_perm_bits(perm, len))
return -ENOMEM;
perm->readfn = vfio_msi_config_read;
perm->writefn = vfio_msi_config_write;
p_setb(perm, PCI_CAP_LIST_NEXT, (u8)ALL_VIRT, NO_WRITE);
/*
* The upper byte of the control register is reserved,
... | false | false | false | false | false | 0 |
cdfDefRgrid(stream_t *streamptr, int gridID)
{
char axisname[7] = "rgridX";
int index, iz = 0;
int gridID0, gridtype0, gridindex;
int dimID = UNDEFID;
int ngrids;
int fileID;
int dimlen, dimlen0;
int vlistID;
int lwarn = TRUE;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
ngrids =... | true | true | false | false | false | 1 |
readStringDescFromTable(VimosTable *tab, const char *name,
char *val, char *comment)
{
char modName[] = "readStringDescFromTable";
if (tab == NULL) {
strcpy(val, "");
if (comment)
strcpy(comment, "");
cpl_msg_debug(modName, "NULL input table");
... | false | false | false | false | false | 0 |
gst_h264_parse_process_sei (GstH264Parse * h264parse, GstH264NalUnit * nalu)
{
GstH264SEIMessage sei;
GstH264NalParser *nalparser = h264parse->nalparser;
GstH264ParserResult pres;
GArray *messages;
guint i;
pres = gst_h264_parser_parse_sei (nalparser, nalu, &messages);
if (pres != GST_H264_PARSER_OK)
... | 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.