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 |
|---|---|---|---|---|---|---|
search_query_allowed(gnet_search_t sh)
{
search_ctrl_t *sch = search_find_by_handle(sh);
search_ctrl_check(sch);
/*
* We allow the query to be sent once more than our outdegree.
*
* This is because "sending" here means putting the message in
* the message queue, not physically sending. We might never g... | false | false | false | false | false | 0 |
seqid_store_get(SeqidStore *ss, unsigned long filenum,
unsigned long seqnum)
{
GtStr *seqid;
gt_assert(ss);
gt_assert(filenum < ss->num_of_files);
gt_assert(seqnum < ss->num_of_sequences[filenum]);
gt_assert(ss->store[filenum][seqnum]); /* is used */
seqid = ss->store[filenum][... | false | false | false | false | false | 0 |
Anon_Cvar_Set(cvar_t *nvar, const char *var_value)
{
if (nvar->string)
Z_Free (nvar->string);
nvar->string = CopyString (var_value);
nvar->value = atof (nvar->string);
nvar->default_value = atof (nvar->string);
nvar->integer = atoi (nvar->string);
} | false | false | false | false | false | 0 |
knh_Stmt_flag_(CTX ctx, kStmtExpr *stmt, kbytes_t name, kflag_t flag)
{
if(IS_Map(DP(stmt)->metaDictCaseMap)) {
Object *v = knh_DictMap_getNULL(ctx, DP(stmt)->metaDictCaseMap, name);
return (v != NULL) ? flag : 0;
}
return 0;
} | false | false | false | false | false | 0 |
go_plugin_service_file_saver_deactivate (GOPluginService *service, GOErrorInfo **ret_error)
{
GOPluginServiceFileSaver *service_file_saver = GO_PLUGIN_SERVICE_FILE_SAVER (service);
GHashTable *file_savers_hash;
GO_INIT_RET_ERROR_INFO (ret_error);
file_savers_hash = get_plugin_file_savers_hash (service->plugin);
g... | false | false | false | false | false | 0 |
conf_space_read(struct pci_dev *dev,
const struct config_field_entry *entry,
int offset, u32 *value)
{
int ret = 0;
const struct config_field *field = entry->field;
*value = 0;
switch (field->size) {
case 1:
if (field->u.b.read)
ret = field->u.b.read(dev, offset, (u8 *) value,
entry->... | false | true | false | false | true | 1 |
do_assert (buf, limit, op, keyword)
U_CHAR *buf, *limit;
FILE_BUF *op;
struct directive *keyword;
{
U_CHAR *bp; /* temp ptr into input buffer */
U_CHAR *symname; /* remember where symbol name starts */
int sym_length; /* and how long it is */
struct arglist *tokens = NULL;
if (pedantic && ... | false | false | false | false | false | 0 |
Jim_AioFilehandle(Jim_Interp *interp, Jim_Obj *command)
{
Jim_Cmd *cmdPtr = Jim_GetCommand(interp, command, JIM_ERRMSG);
if (cmdPtr && !cmdPtr->isproc && cmdPtr->u.native.cmdProc == JimAioSubCmdProc) {
return ((AioFile *) cmdPtr->u.native.privData)->fp;
}
Jim_SetResultFormatted(interp, "Not a f... | false | false | false | false | false | 0 |
leveleditor_move_input(SDL_Event * event)
{
moderately_finepoint a, b;
if (EVENT_RIGHT_PRESS(event) || EVENT_LEFT_PRESS(event)) {
// Start a movement
state.origin.x = event->button.x;
state.origin.y = event->button.y;
} else if (EVENT_RIGHT_RELEASE(event) || EVENT_LEFT_RELEASE(event)) {
// We are done
ret... | false | false | false | false | false | 0 |
crypt_alloc_tfms(struct crypt_config *cc, char *ciphermode)
{
unsigned i;
int err;
cc->tfms = kmalloc(cc->tfms_count * sizeof(struct crypto_ablkcipher *),
GFP_KERNEL);
if (!cc->tfms)
return -ENOMEM;
for (i = 0; i < cc->tfms_count; i++) {
cc->tfms[i] = crypto_alloc_ablkcipher(ciphermode, 0, 0);
if (IS... | false | false | false | false | false | 0 |
rb_local_defined(ID id)
{
rb_thread_t *th = GET_THREAD();
rb_iseq_t *iseq;
if (th->base_block && th->base_block->iseq) {
int i;
iseq = th->base_block->iseq->local_iseq;
for (i=0; i<iseq->local_table_size; i++) {
if (iseq->local_table[i] == id) {
return 1;
}
}
}
return 0;
} | false | false | false | false | false | 0 |
insert_pending_capture_proxies (void)
{
tree lam;
vec<tree, va_gc> *proxies;
unsigned i;
if (!current_function_decl || !LAMBDA_FUNCTION_P (current_function_decl))
return;
lam = CLASSTYPE_LAMBDA_EXPR (DECL_CONTEXT (current_function_decl));
proxies = LAMBDA_EXPR_PENDING_PROXIES (lam);
for (i = 0; i < ... | false | false | false | true | false | 1 |
e_name_selector_model_list_sections (ENameSelectorModel *name_selector_model)
{
GList *section_names = NULL;
gint i;
g_return_val_if_fail (E_IS_NAME_SELECTOR_MODEL (name_selector_model), NULL);
/* Do this backwards so we can use g_list_prepend () and get correct order */
for (i = name_selector_model->priv->sec... | false | false | false | false | false | 0 |
gui_button_x(gchar *text,
gpointer cb, gpointer arg,
GtkWidget *box)
{
GtkWidget *hbox, *button, *label, *image;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
/* create button */
button = gtk_button_new();
hbox = gtk_hbox_new(FALSE, 0);
gtk_container_add(GTK_C... | false | false | false | false | false | 0 |
v4lconvert_helper_read(struct v4lconvert_data *data, void *b,
size_t count)
{
unsigned char *buf = b;
size_t ret, r = 0;
while (r < count) {
ret = read(data->decompress_in_pipe[READ_END], buf + r, count - r);
if (ret == -1) {
if (errno == EINTR)
continue;
V4LCONVERT_ERR("reading from helper: %s\n",... | false | true | false | false | true | 1 |
xmlSecEncCtxCipherDataNodeRead(xmlSecEncCtxPtr encCtx, xmlNodePtr node) {
xmlNodePtr cur;
int ret;
xmlSecAssert2(encCtx != NULL, -1);
xmlSecAssert2(node != NULL, -1);
cur = xmlSecGetNextElementNode(node->children);
/* we either have CipherValue or CipherReference node */
xmlSecAssert2(en... | false | false | false | false | false | 0 |
CKYAPDU_InitFromData(CKYAPDU *apdu, const CKYByte *data, CKYSize len)
{
#ifdef DEBUG
assert(sizeof(CKYAPDU) == sizeof(CKYAPDUPublic));
#endif
ckyBuffer_initBuffer(&apdu->apduBuf);
if (len > CKYAPDU_MAX_DATA_LEN) {
return CKYDATATOOLONG;
}
return CKYBuffer_InitFromData(&apdu->apduBuf, data, len);
} | false | false | false | false | false | 0 |
GP_delete_site(int id)
{
int i, j, found = 0;
G_debug(3, "GP_delete_site(): id=%d", id);
if (GP_site_exists(id)) {
gp_delete_site(id);
for (i = 0; i < Next_site && !found; i++) {
if (Site_ID[i] == id) {
found = 1;
for (j = i; j < Next_site; j++) {
Site_ID[j] = Site_ID[j + 1];
}
}
... | false | false | false | false | false | 0 |
named_fifo_teardown_preunlink(void *p)
{
struct test_fifo_struct *fifo = (struct test_fifo_struct *)p;
int retval;
/* Unlink must fail, since fifo should have been renamed */
retval = !unlink(fifo->filename);
if (retval) fprintf(stderr, "unlink succeeded unexpectedly\n");
free(fifo->filename);... | false | false | false | false | false | 0 |
pysqlite_check_remaining_sql(const char* tail)
{
const char* pos = tail;
parse_remaining_sql_state state = NORMAL;
for (;;) {
switch (*pos) {
case 0:
return 0;
case '-':
if (state == NORMAL) {
state = LINECOMMENT_1;
... | false | false | false | false | false | 0 |
AlignmentView_display(AlignmentView *av,
Sequence *query, Sequence *target,
FILE *fp){
register gint pos = 0, pause, row = 0;
pause = av->outer_query->len-av->width;
while(pos < pause){
AlignmentView_display_row(av, row, pos, av->wi... | false | false | false | false | false | 0 |
disp_bell(void)
{
/* HERE change this to go along with beep */
#ifdef AUDIO
if (sndfile)
/* play the soundfile */
audio_beep();
else /* no sound file chosen then use system bell */
XBell(XtDisplay(main_gfx_w), (2*cool_vol)-100);
#else
XBell(XtDisplay(main_gfx_w), 0);
#endif
} | false | false | false | false | false | 0 |
load_encrypted_key (GBytes *data,
const gchar *dekinfo,
const gchar *password,
gssize n_password,
gcry_sexp_t *skey)
{
guchar *decrypted = NULL;
gsize n_decrypted = 0;
GBytes *bytes;
GkmDataResult ret;
gint length;
/* Decrypt, this w... | false | false | false | false | false | 0 |
iscsi_session_init_params(struct iscsi_session *session)
{
session->param_mask = ~0ULL;
if (!(session->t->caps & CAP_MULTI_R2T))
iscsi_session_clear_param(session, ISCSI_PARAM_MAX_R2T);
if (!(session->t->caps & CAP_HDRDGST))
iscsi_session_clear_param(session, ISCSI_PARAM_HDRDGST_EN);
if (!(session->t->caps & C... | false | false | false | false | false | 0 |
clone_prototype(void *mem_ctx, struct hash_table *ht) const
{
ir_function_signature *copy =
new(mem_ctx) ir_function_signature(this->return_type);
copy->is_defined = false;
copy->builtin_avail = this->builtin_avail;
copy->origin = this;
/* Clone the parameter list, but NOT the body.
*/
for... | false | false | false | false | false | 0 |
apply_to_pud_range(struct mm_struct *mm, pgd_t *pgd,
unsigned long addr, unsigned long end,
pte_fn_t fn, void *data)
{
pud_t *pud;
unsigned long next;
int err;
pud = pud_alloc(mm, pgd, addr);
if (!pud)
return -ENOMEM;
do {
next = pud_addr_end(addr, end);
err = apply_to_pmd_range(mm, pud, ... | false | false | false | false | false | 0 |
WriteGF_IPMPX_TrustSecurityMetadata(GF_BitStream *bs, GF_IPMPX_Data *_p)
{
u32 i, j, c1, c2;
GF_IPMPX_TrustSecurityMetadata *p = (GF_IPMPX_TrustSecurityMetadata *)_p;
c1 = gf_list_count(p->TrustedTools);
gf_bs_write_int(bs, c1, 16);
for (i=0;i<c1; i++) {
GF_IPMPX_TrustedTool *tt = (GF_IPMPX_TrustedTool *)gf_lis... | false | false | false | false | false | 0 |
btrfs_size_max_delta( Glib::ustring str )
{
Glib::ustring limit_str ;
//Create limit_str. E.g. str = "2.00GB" -> limit_str = "0.005GB"
for ( Glib::ustring::iterator p = str .begin() ; p != str .end() ; p ++ )
{
if ( isdigit( *p ) )
limit_str .append( "0" ) ;
else if ( *p == '.' )
limit_str .append( "." )... | false | false | false | false | false | 0 |
getImageMinMaxPixelValue(double &minValue, double& maxValue)
{
OFCondition result = EC_IllegalCall;
if (currentImage)
{
if (currentImage->getMinMaxValues(minValue, maxValue, 0)) result = EC_Normal;
}
return result;
} | false | false | false | false | false | 0 |
mx_widget_parent_set (ClutterActor *actor,
ClutterActor *old_parent)
{
ClutterActor *parent;
MxWidget *widget = (MxWidget *) actor;
MxWidgetPrivate *priv = widget->priv;
/* Make sure the disabled state cache remains valid */
if (!priv->is_disabled)
{
gboolean disabled;
... | false | false | false | false | false | 0 |
iSaveRleSgi(ILubyte *Data, ILuint w, ILuint h, ILuint numChannels,
ILuint bps)
{
//works only for sgi files with only 1 bpc
ILuint c, i, y, j;
ILubyte *ScanLine = NULL, *CompLine = NULL;
ILuint *StartTable = NULL, *LenTable = NULL;
ILuint TableOff, DataOff = 0;
ScanLine = (ILubyte*)ialloc(w);
CompLine = (ILu... | false | false | false | false | false | 0 |
Infobar_ProgressCreating(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
: Gtk::InfoBar(cobject),
m_progress(0),
m_label_message(0)
{
builder->get_widget("progressbar", m_progress);
builder->get_widget("label_message", m_label_message);
} | false | false | false | false | false | 0 |
attributes_list_remove(attributes_list_ty *alp, const char *name)
{
attributes_ty *ap = attributes_list_extract(alp, name);
if (ap)
attributes_type.free(ap);
} | false | false | false | false | false | 0 |
ide_port_init_devices(ide_hwif_t *hwif)
{
const struct ide_port_ops *port_ops = hwif->port_ops;
ide_drive_t *drive;
int i;
ide_port_for_each_dev(i, drive, hwif) {
drive->dn = i + hwif->channel * 2;
if (hwif->host_flags & IDE_HFLAG_IO_32BIT)
drive->io_32bit = 1;
if (hwif->host_flags & IDE_HFLAG_NO_IO_32BI... | false | false | false | true | true | 1 |
fso_framework_network_wext_interface_construct (GType object_type, const gchar* name, GError** error) {
FsoFrameworkNetworkWextInterface* self = NULL;
const gchar* _tmp0_ = NULL;
GError * _inner_error_ = NULL;
g_return_val_if_fail (name != NULL, NULL);
_tmp0_ = name;
self = (FsoFrameworkNetworkWextInterface*) fso... | false | false | false | false | false | 0 |
dnd_remote_file (gftp_window_data * wdata, GList ** trans_list, char *url)
{
gftp_request * current_ftpdata;
gftp_window_data * fromwdata;
gftp_transfer * tdata;
gftp_file * newfle;
GList * templist;
char *pos;
if (wdata == &window1)
fromwdata = &window2;
else if (wdata == &window2)
fromwdata =... | false | false | false | false | false | 0 |
translate_sub_tlist(List *tlist, int relid)
{
List *result = NIL;
ListCell *l;
foreach(l, tlist)
{
Var *var = (Var *) lfirst(l);
if (!var || !IsA(var, Var) ||
var->varno != relid)
return NIL; /* punt */
result = lappend_int(result, var->varattno);
}
return result;
} | false | false | false | false | false | 0 |
_gk_wrap_iov(OM_uint32 * minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
gss_qop_t qop_req,
int * conf_state,
gss_iov_buffer_desc *iov,
int iov_count)
{
const gsskrb5_ctx ctx = (const gsskrb5_ctx) context_handle;
krb5_context context;
GSSAPI_KRB5_INIT (&context)... | false | false | false | false | false | 0 |
describeTypes(const char *pattern, bool verbose, bool showSystem)
{
PQExpBufferData buf;
PGresult *res;
printQueryOpt myopt = pset.popt;
initPQExpBuffer(&buf);
printfPQExpBuffer(&buf,
"SELECT n.nspname as \"%s\",\n"
" pg_catalog.format_type(t.oid, NULL) AS \"%s\",\n",
gettext_noop("Schema... | false | false | false | false | false | 0 |
get_domain(request_rec *r, auth_tkt_dir_conf *conf)
{
/* Set the cookie domain to the first set of TKTAuthDomain,
X-Forwarded-Host, Host, or server hostname. Viljo Viitanen
pointed out that using the wildcard domain is a security hole
in the event that other servers on your domain are hostile. */
ch... | false | false | false | false | false | 0 |
CvtHex(IN HASH Bin, OUT HASHHEX Hex) {
unsigned short i;
for (i = 0; i < HASHLEN; i++) {
Hex[i*2] = int2hex((Bin[i] >> 4) & 0xf);
Hex[i*2+1] = int2hex(Bin[i] & 0xf);
}
Hex[HASHHEXLEN] = '\0';
} | false | false | false | false | false | 0 |
atk_registry_new (void)
{
GObject *object;
object = g_object_new (ATK_TYPE_REGISTRY, NULL);
g_return_val_if_fail (ATK_IS_REGISTRY (object), NULL);
return (AtkRegistry *) object;
} | false | false | false | false | false | 0 |
unity_protocol_scope_proxy_remote_on_category_order_changed (UnityProtocolScopeProxyRemote* self, const gchar* channel_id, guint32* new_order, int new_order_length1) {
const gchar* _tmp0_ = NULL;
guint32* _tmp1_ = NULL;
gint _tmp1__length1 = 0;
g_return_if_fail (self != NULL);
g_return_if_fail (channel_id != NULL)... | false | false | false | false | false | 0 |
fc_disc_restart(struct fc_disc *disc)
{
if (!disc->disc_callback)
return;
FC_DISC_DBG(disc, "Restarting discovery\n");
disc->requested = 1;
if (disc->pending)
return;
/*
* Advance disc_id. This is an arbitrary non-zero number that will
* match the value in the fc_rport_priv after discovery for all
* ... | false | false | false | false | false | 0 |
DeleteFace(vtkIdType f1)
{
// test whether the face was already deleted
if (this->IsFaceActive(f1)==0)
return;
vtkIdType NumberOfPoints,*Points,Loc;
Loc = this->Cells->GetCellLocation(f1);
vtkIdType i;
vtkIdType Edge;
this->Polys->GetCell(Loc,NumberOfPoints,Points);
for (i=0;i<NumberOfPoints;i++)
{
Edg... | false | false | false | false | false | 0 |
fix_cont_w ()
{
while (NULL != fixp->while1.cnext)
{
#if 0
struct cont1 *tmp = fixp->while1.cnext;
#endif
((struct OPERAND_1_ma *) (fixp->while1.cnext->adr))->adr =
fixp->while1.jmp;
fixp->while1.cnext = fixp->while1.cnext->next;
#if 0
free (tmp);
#endif
}
} | false | false | false | false | false | 0 |
hasTestNamed(std::string name) const
{
for( svutTestCasePtrList::const_iterator it=suites.begin(); it != suites.end() ; ++it)
{
if ((*it)->getName() == name)
return true;
}
return false;
} | false | false | false | false | false | 0 |
link_and_extension_sb_module_for_inlining( Block *first_layer_block, int *sb_ent,
Inline_information *inline_info,
Module_hmdf_information *module_hmdf_info_list )
{
Block *layer_block;
for( layer_block = first_layer_block; l... | false | false | false | false | false | 0 |
ike_auth_get(u_int16_t id)
{
size_t i;
for (i = 0; i < sizeof ike_auth / sizeof ike_auth[0]; i++)
if (id == ike_auth[i].id)
return &ike_auth[i];
return 0;
} | false | false | false | false | false | 0 |
netclear(void)
{
char *thisitem, *next;
char *good;
#define wewant(p) ((nfrontp > p) && ((*p&0xff) == IAC) && \
((*(p+1)&0xff) != EC) && ((*(p+1)&0xff) != EL))
#ifdef ENCRYPTION
thisitem = nclearto > netobuf ? nclearto : netobuf;
#else
thisitem = netobuf;
#endif
while ((next = nextitem(thisitem)) <= nb... | false | false | false | false | false | 0 |
generateSelectorData(UConverterSelector* result,
UPropsVectors *upvec,
const USet* excludedCodePoints,
const UConverterUnicodeSet whichSet,
UErrorCode* status) {
if (U_FAILURE(*status)) ... | false | false | false | false | false | 0 |
check_spec_requirements (nlspec *spec)
{
int err = 0;
if (spec->nparam < 1) {
gretl_errmsg_set(_("No parameters have been specified"));
err = 1;
} if (spec->ci == GMM) {
err = check_gmm_requirements(spec);
}
return err;
} | false | false | false | false | false | 0 |
pre_xfer(struct i2c_adapter *i2c_adap)
{
struct radeon_i2c_chan *i2c = i2c_get_adapdata(i2c_adap);
struct radeon_device *rdev = i2c->dev->dev_private;
struct radeon_i2c_bus_rec *rec = &i2c->rec;
uint32_t temp;
mutex_lock(&i2c->mutex);
/* RV410 appears to have a bug where the hw i2c in reset
* holds the i2c po... | false | false | false | false | false | 0 |
Init(WindowID wid) {
Release();
PLATFORM_ASSERT(wid);
#if GTK_CHECK_VERSION(3,0,0)
GdkWindow *drawable_ = gtk_widget_get_window(PWidget(wid));
#else
GdkDrawable *drawable_ = GDK_DRAWABLE(PWidget(wid)->window);
#endif
if (drawable_) {
context = gdk_cairo_create(drawable_);
PLATFORM_ASSERT(context);
} else {
... | false | false | false | false | false | 0 |
query_strip_oob_flag(gnutella_node_t *n, char *data)
{
uint16 flags;
flags = peek_be16(data) & ~QUERY_F_OOB_REPLY;
poke_be16(data, flags);
/* Strip "SO" since no OOB now */
n->msg_flags |= NODE_M_STRIP_GE_SO | NODE_M_EXT_CLEANUP;
gnet_stats_inc_general(GNR_OOB_QUERIES_STRIPPED);
if (GNET_PROPERTY(query_debug... | false | false | false | false | false | 0 |
mp3tunes_harmony_send_device_status(MP3tunesHarmony *harmony, GError **err) {
LmMessage *message_out;
/*LmMessageHandler *handler;*/
LmMessageNode* status_message;
GList *current = NULL;
mp3tunes_harmony_device_attribute_t *da;
char* name = NULL;
char* value = NULL;
/*handler = lm_mes... | false | false | false | false | false | 0 |
obj2str(flg,obj,buf)
int flg;
truc obj;
char *buf;
{
word4 u;
char *str;
u = truc2msf(obj);
switch(flg) {
case fSTACK:
str = "STACK";
break;
case fFUNDEF:
str = "FUNCTION";
break;
case fSTREAM:
u = (word4)STREAMfile(obj);
str = "STREAM";
... | false | false | false | false | false | 0 |
session_resolve_cname(dns_session_t *session, dns_msg_question_t *q, dns_cache_rrset_t *rrset, int nlevel)
{
dns_cache_t *cache;
dns_cache_rrset_t *rr_cname;
dns_msg_question_t q_cname;
if (nlevel > DNS_CNAME_NEST_MAX) {
plog(LOG_DEBUG, "%s: CNAME nested too deep", MODULE);
return;
... | false | false | false | false | false | 0 |
fill_inquiry_response(struct us_data *us, unsigned char *data,
unsigned int data_len)
{
if (data_len < 36) /* You lose. */
return;
memset(data+8, ' ', 28);
if (data[0]&0x20) { /* USB device currently not connected. Return
peripheral qualifier 001b ("...however, the
physical device is not curre... | false | false | false | false | false | 0 |
normalize_divs_in_context(
struct isl_basic_map *bmap, struct isl_basic_map *context)
{
int i;
unsigned total_context;
int div_eq;
div_eq = n_pure_div_eq(bmap);
if (div_eq == 0)
return bmap;
if (context->n_div > 0)
bmap = isl_basic_map_align_divs(bmap, context);
total_context = isl_basic_map_total_dim(co... | false | false | false | false | false | 0 |
fddretrievetuple(handler_list, deadhost)
handlerinfo_t *handler_list;
host_t *deadhost;
{
tsh_retrieve_it out;
handlerinfo_t *p_q;
int tsh_sock, tshop;
u_short tsh_port;
out.host = deadhost->hostid;
tshop = htons(TSH_OP_RETRIEVE);
p_q = handler_list;
while (p_q ... | false | false | false | false | false | 0 |
glatex_environment_insert_activated (G_GNUC_UNUSED GtkMenuItem *menuitem,
G_GNUC_UNUSED gpointer gdata)
{
gint env = GPOINTER_TO_INT(gdata);
if (glatex_environment_array[env].cat == ENVIRONMENT_CAT_LISTS)
glatex_insert_environment(glatex_environment_array[env].latex,
GLATEX_ENVIRONMENT_TYPE_LIST);
els... | false | false | false | false | false | 0 |
gth_backtrace_path_set_cutoffs_end(GthBacktracePath *bt, Cutoffs *cutoffs)
{
gt_assert(bt && cutoffs);
bt->cutoffs.end = *cutoffs;
} | false | false | false | false | false | 0 |
osst_flush_buffer(struct osst_tape * STp, struct osst_request ** aSRpnt, int seek_next)
{
struct st_partstat * STps;
int backspace = 0, result = 0;
#if DEBUG
char * name = tape_name(STp);
#endif
/*
* If there was a bus reset, block further access
* to this device.
*/
if( STp->pos_unknown)
return (-EIO)... | false | false | false | false | false | 0 |
request_new_get (NMConnection *connection,
gboolean filter_by_uid,
gulong uid_filter,
GHashTable *existing_secrets,
const char *setting_name,
NMSettingsGetSecretsFlags flags,
const char *hint,
NMAgentS... | false | false | false | false | false | 0 |
GetSubSampler(int num, int count) {
int x0, x1, y0, y1;
ComputeSubWindow(num, count, &x0, &x1, &y0, &y1);
if (x0 == x1 || y0 == y1) return NULL;
return new AdaptiveSampler(x0, x1, y0, y1, minSamples, maxSamples,
method == ADAPTIVE_CONTRAST_THRESHOLD ? "contrast" : "shapeid",
shutterOpen,... | false | false | false | false | false | 0 |
random_seed(RandomObject *self, PyObject *args)
{
PyObject *result = NULL; /* guilty until proved innocent */
PyObject *n = NULL;
unsigned long *key = NULL;
unsigned char *key_as_bytes = NULL;
size_t bits, keyused, i;
int res;
PyObject *arg = NULL;
if (!PyArg_UnpackTuple(args... | false | false | false | false | false | 0 |
firm_destroyed(int firmRecno, Unit* attackUnit)
{
Firm* firmPtr = firm_array[firmRecno];
err_when( firmPtr->nation_recno != nation_array.player_recno );
int destroyerNationRecno=0;
if( attackUnit )
destroyerNationRecno = attackUnit->nation_recno;
News* newsPtr = add_news( NEWS_FIRM_DESTROYED, NEWS_NORMAL, fi... | false | false | false | false | false | 0 |
iio_buffer_update_bytes_per_datum(struct iio_dev *indio_dev,
struct iio_buffer *buffer)
{
unsigned int bytes;
if (!buffer->access->set_bytes_per_datum)
return;
bytes = iio_compute_scan_bytes(indio_dev, buffer->scan_mask,
buffer->scan_timestamp);
buffer->access->set_bytes_per_datum(buffer, bytes);
} | false | false | false | false | false | 0 |
gnumeric_arg_parse (int argc, char **argv)
{
GOptionContext *ocontext;
int i;
gboolean funcdump = FALSE;
GError *error = NULL;
/* no need to init gtk when dumping function info */
for (i = 0 ; argv[i] ; i++)
if (0 == strncmp ("--dump-func", argv[i], 11)) {
funcdump = TRUE;
break;
}
ocontext = g_optio... | false | false | false | false | false | 0 |
hide_event_handler(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{
term_data *td;
int t;
t = term_window_from_widget(widget);
if (t > 0)
{
td = &data[t];
if ((td != NULL) && (td->win == widget))
set_term_menu(td->number, FALSE);
if ((td->drawing_area != NULL) && (td->surface != NULL))... | false | false | false | false | false | 0 |
read_xid (ByteBuffer *buffer, Message message, ElvinError *error)
{
uint32_t value = byte_buffer_read_int32 (buffer, error);
*(uint32_t *)message = value;
if (value == 0 && elvin_error_ok (error))
elvin_error_set (error, ELVIN_ERROR_PROTOCOL, "XID cannot be zero", value);
} | false | false | false | false | false | 0 |
close_temporary_tables()
{
TABLE *table,*next;
DBUG_ENTER("Relay_log_info::close_temporary_tables");
for (table=save_temporary_tables ; table ; table=next)
{
next=table->next;
/*
Don't ask for disk deletion. For now, anyway they will be deleted when
slave restarts, but it is a better intent... | false | false | false | false | false | 0 |
num_vals( void ) const
{
long prod = 1;
for (int d = 0; d < num_dims(); d++)
prod *= get_dim(d)->size();
return prod;
} | false | false | false | false | false | 0 |
main(int argc, char **argv) {
KDB *handle=0;
int command=0;
int ret=0;
if (loadToolsLib())
fprintf(stderr,"kdb: XML importing and editing disabled\n");
/* Parse the command line */
command=parseCommandLine(argc,argv);
/* Check if user only wants some help (kdb -h {command})*/
if (argHelp) helpCommand(com... | false | false | false | false | false | 0 |
synic_set_irq(struct kvm_vcpu_hv_synic *synic, u32 sint)
{
struct kvm_vcpu *vcpu = synic_to_vcpu(synic);
struct kvm_lapic_irq irq;
int ret, vector;
if (sint >= ARRAY_SIZE(synic->sint))
return -EINVAL;
vector = synic_get_sint_vector(synic_read_sint(synic, sint));
if (vector < 0)
return -ENOENT;
memset(&irq... | false | false | false | false | false | 0 |
tell_file_stats(int idx, char *hand)
{
struct userrec *u;
struct filesys_stats *fs;
float fr = (-1.0), kr = (-1.0);
u = get_user_by_handle(userlist, hand);
if (u == NULL)
return;
if (!(fs = get_user(&USERENTRY_FSTAT, u))) {
dprintf(idx, "No file statistics for %s.\n", hand);
} else {
dprintf(... | false | false | false | false | false | 0 |
dbcs_off2cells(off, max_off)
unsigned off;
unsigned max_off;
{
/* never check beyond end of the line */
if (off >= max_off)
return 1;
/* Number of cells is equal to number of bytes, except for euc-jp when
* the first byte is 0x8e. */
if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
... | false | false | false | false | false | 0 |
ath9k_check_auto_sleep(struct ath_softc *sc)
{
return sc->ps_enabled &&
(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP);
} | false | false | false | false | false | 0 |
simd_intrinsic_emit_unary (const SimdIntrinsc *intrinsic, MonoCompile *cfg, MonoMethod *cmethod, MonoInst **args)
{
MonoInst* ins;
int vreg;
vreg = get_simd_vreg (cfg, cmethod, args [0]);
MONO_INST_NEW (cfg, ins, intrinsic->opcode);
ins->klass = cmethod->klass;
ins->sreg1 = vreg;
ins->type = STACK_VTYPE;
ins... | false | false | false | false | false | 0 |
max8998_irq_thread(int irq, void *data)
{
struct max8998_dev *max8998 = data;
u8 irq_reg[MAX8998_NUM_IRQ_REGS];
int ret;
int i;
ret = max8998_bulk_read(max8998->i2c, MAX8998_REG_IRQ1,
MAX8998_NUM_IRQ_REGS, irq_reg);
if (ret < 0) {
dev_err(max8998->dev, "Failed to read interrupt register: %d\n",
ret);
... | false | false | false | false | false | 0 |
cfg_printf(const char *fmt, ...)
{
va_list ap;
int c;
int i;
va_start(ap, fmt);
(void)vsnprintf(g_cfg_printf_buf, CFG_PRINTF_BUFSIZE, fmt, ap);
va_end(ap);
for(i = 0; i < CFG_PRINTF_BUFSIZE; i++) {
c = g_cfg_printf_buf[i];
if(c == 0) {
return;
}
cfg_putchar(c);
}
} | false | false | false | false | true | 1 |
krb5_cccol_last_change_time(krb5_context context,
const char *type,
krb5_timestamp *mtime)
{
krb5_cccol_cursor cursor;
krb5_error_code ret;
krb5_ccache id;
krb5_timestamp t = 0;
*mtime = 0;
ret = krb5_cccol_cursor_new (context, &cursor);
if (ret)
return ret;
while (krb5... | false | false | false | false | false | 0 |
initStatement (statementInfo *const st, statementInfo *const parent)
{
st->parent = parent;
initMemberInfo (st);
reinitStatement (st, FALSE);
if (parent)
{
const tokenInfo *const src = activeToken (parent);
tokenInfo *const dst = activeToken (st);
copyToken (dst, src);
st->tokenIndex++;
}
} | false | false | false | false | false | 0 |
read_header(header_t *h)
{
int r;
int l;
uint32_t checksum;
memset(h, 0, sizeof(*h));
h->version_needed_to_extract = 0x0900; /* first lzop version */
h->level = 0;
init_chksum(&G.chksum_in);
h->version = f_read16();
if (h->version < 0x0900)
return 3;
h->lib_version = f_read16();
if (h->version >= 0x0940... | false | false | false | false | false | 0 |
lpuart_get_mctrl(struct uart_port *port)
{
unsigned int temp = 0;
unsigned char reg;
reg = readb(port->membase + UARTMODEM);
if (reg & UARTMODEM_TXCTSE)
temp |= TIOCM_CTS;
if (reg & UARTMODEM_RXRTSE)
temp |= TIOCM_RTS;
return temp;
} | false | false | false | false | false | 0 |
mon_bus_init(struct usb_bus *ubus)
{
struct mon_bus *mbus;
mbus = kzalloc(sizeof(struct mon_bus), GFP_KERNEL);
if (mbus == NULL)
goto err_alloc;
kref_init(&mbus->ref);
spin_lock_init(&mbus->lock);
INIT_LIST_HEAD(&mbus->r_list);
/*
* We don't need to take a reference to ubus, because we receive
* a notifi... | false | false | false | false | false | 0 |
__acpi_power_off(struct acpi_power_resource *resource)
{
acpi_status status;
status = acpi_evaluate_object(resource->device.handle, "_OFF",
NULL, NULL);
if (ACPI_FAILURE(status))
return -ENODEV;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned off\n",
resource->name));
return 0;
} | false | false | false | false | false | 0 |
write_out_new_ascii_header (const char *magic_string,
struct cpio_file_stat *file_hdr, int out_des)
{
char ascii_header[110];
char *p;
p = stpcpy (ascii_header, magic_string);
to_ascii_or_warn (p, file_hdr->c_ino, 8, LG_16,
file_hdr->c_name, _("inode number"));
p += 8;
to_ascii_or_warn (p, fil... | false | false | false | false | false | 0 |
elm_image_fill_outside_set(Evas_Object *obj,
Eina_Bool fill_outside)
{
ELM_IMAGE_CHECK(obj);
ELM_IMAGE_DATA_GET(obj, sd);
sd->fill_inside = !fill_outside;
ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
} | false | false | false | false | false | 0 |
ldap_back_initialize( BackendInfo *bi )
{
int rc;
bi->bi_flags =
#ifdef LDAP_DYNAMIC_OBJECTS
/* this is set because all the support a proxy has to provide
* is the capability to forward the refresh exop, and to
* pass thru entries that contain the dynamicObject class
* and the entryTtl attribute */
SLA... | false | false | false | false | false | 0 |
Hash_delattr(DOH *ho, DOH *k) {
HashNode *n, *prev;
int hv;
Hash *h = (Hash *) ObjData(ho);
if (!DohCheck(k))
k = find_key(k);
hv = Hashval(k) % h->hashsize;
n = h->hashtable[hv];
prev = 0;
while (n) {
if (Cmp(n->key, k) == 0) {
/* Found it, kill it */
if (prev) {
prev->next = n->... | false | false | false | false | false | 0 |
CacheFileData()
{
this->containsXMP = false;
this->psHint = FindPostScriptHint();
if ( this->psHint == kPSHint_MainFirst ) {
this->containsXMP = FindFirstPacket();
} else if ( this->psHint == kPSHint_MainLast ) {
this->containsXMP = FindLastPacket();
}
if ( this->containsXMP ) ReadXMPPacket ( this );
} | false | false | false | false | false | 0 |
gr_bitmap_rle_compress( grs_bitmap * bmp )
{
int y, d1, d;
int doffset;
ubyte *rle_data;
int large_rle = 0;
// first must check to see if this is large bitmap.
for (y=0; y<bmp->bm_h; y++ ) {
d1= gr_rle_getsize( bmp->bm_w, &bmp->bm_data[bmp->bm_w*y] );
if (d1 > 255) {
large_rle = 1;
break;
}
}
rle... | false | false | false | false | false | 0 |
decode(unsigned int tbi)
{
unsigned int tv = trace.get(tbi);
RegisterValue rv = RegisterValue(tv & 0xff,0);
TraceObject *wto;
if (tv & (1<<22))
wto = new WReadTraceObject(cpu, rv);
else
wto = new WWriteTraceObject(cpu, rv);
return wto;
} | false | false | false | false | false | 0 |
tm_source_file_set_tag_arglist(const char *tag_name, const char *arglist)
{
int count;
TMTag **tags, *tag;
if (NULL == arglist ||
NULL == tag_name ||
NULL == current_source_file ||
NULL == current_source_file->work_object.tags_array)
{
return;
}
tags = tm_tags_find(current_source_file->work_object.tags_... | false | false | false | false | false | 0 |
checkbar(pass)
/* check to see we have the right number of notes in the bar */
int pass;
{
char msg[80];
if (barchecking) {
/* only generate these errors once */
if (noteson && (partrepno == 0)) {
/* allow zero length bars for typesetting purposes */
if ((bar_num-barsize*(bar_denom) != 0) &&
... | false | false | false | false | false | 0 |
commit_list_insert_by_date(struct commit *item, struct commit_list **list)
{
struct commit_list **pp = list;
struct commit_list *p;
while ((p = *pp) != NULL) {
if (p->item->date < item->date) {
break;
}
pp = &p->next;
}
return commit_list_insert(item, pp);
} | false | false | false | false | false | 0 |
ext4_fname_crypto_free_buffer(struct ext4_str *crypto_str)
{
if (!crypto_str)
return;
kfree(crypto_str->name);
crypto_str->name = NULL;
} | false | false | false | false | false | 0 |
write_switches(struct fpga_bits* bits, struct fpga_model* model)
{
struct fpga_tile* tile;
int x, y, i;
RC_CHECK(model);
// We need to identify and take out each enabled switch, whether it
// leads to enabled bits or not. That way we can print unsupported
// switches at the end and keep our model alive and maint... | 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.