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 |
|---|---|---|---|---|---|---|
read_atlas_header(const char *buf, char *path)
{
int width, height;
if (!sscanf(buf, "* %s size %d %d", path, &width, &height))
return 1;
return 0;
} | false | true | false | false | true | 1 |
gtk_plot_axis_set_ticks_limits (GtkPlotAxis *axis,
gdouble begin, gdouble end)
{
if(end < begin) return;
axis->ticks.begin = begin;
axis->ticks.end = end;
axis->ticks.set_limits = TRUE;
gtk_plot_axis_ticks_recalc(axis);
gtk_signal_emit (GTK_OBJECT(axis), axis_signals[AXIS_CHANG... | false | false | false | false | false | 0 |
SetOwner( Player *player ) {
if ( player != u_player ) {
if ( !IsDummy() ) {
if ( u_player ) u_player->Units( -1 );
player->Units( 1 );
}
u_player = player;
}
} | false | false | false | false | false | 0 |
HandleUnacceptTradeOpcode(WorldPacket& /*recvPacket*/)
{
TradeData* my_trade = _player->m_trade;
if (!my_trade)
return;
my_trade->SetAccepted(false, true);
} | false | false | false | false | false | 0 |
Pathfind(const char *path, const char *name, char *mode)
{
static char file[PATH_MAX];
char _path[PATH_MAX];
int _mode = 0;
char *ptr = _path;
if (name == NULL)
return NULL;
if (mode != NULL)
while (*mode)
{
switch(*mode++)
{
case 'x': _mode |= X_OK;
break;
case 'w': _mode |= ... | false | false | false | false | false | 0 |
do_move(gboolean keyboard, gint keydist)
{
gint resist;
if (keyboard) resist = keydist - 1; /* resist for one key press */
else resist = config_resist_win;
resist_move_windows(moveresize_client, resist, &cur_x, &cur_y);
if (!keyboard) resist = config_resist_edge;
resist_move_monitors(moveresize... | false | false | false | false | false | 0 |
ssh_poll_new(socket_t fd, short events, ssh_poll_callback cb,
void *userdata) {
ssh_poll_handle p;
p = malloc(sizeof(struct ssh_poll_handle_struct));
if (p == NULL) {
return NULL;
}
ZERO_STRUCTP(p);
p->x.fd = fd;
p->events = events;
p->cb = cb;
p->cb_data = userdata;
... | false | false | false | false | false | 0 |
AddStreamer(streamer_type str, void *arg, int preferred_pos)
{
int c;
subscriber *i;
pthread_mutex_lock(&queue_mutex);
switch (preferred_pos) {
case POS_BEGIN:
case POS_MIDDLE:
for (c = 0; c < MAX_SUB; c++) {
i = &subs[c];
if (!i->active) { // found an empty slot
i->ID = follow_id++;
i->s... | false | false | false | false | false | 0 |
eet_node_string_escape(const char *str)
{
char *s, *sp;
const char *strp;
int sz = 0;
for (strp = str; *strp; strp++)
{
if (*strp == '\"')
sz += 2;
else if (*strp == '\\')
sz += 2;
else if (*strp == '\n')
sz += 2;
else
sz += 1;
... | false | false | false | false | false | 0 |
QRinput_encodeModeStructure(QRinput_List *entry)
{
int ret;
entry->bstream = BitStream_new();
if(entry->bstream == NULL) return -1;
ret = BitStream_appendNum(entry->bstream, 4, 0x03);
if(ret < 0) goto ABORT;
ret = BitStream_appendNum(entry->bstream, 4, entry->data[1] - 1);
if(ret < 0) goto ABORT;
ret = BitStr... | false | false | false | false | false | 0 |
on_library_pkcs11_ready (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
GcrImportButton *self = GCR_IMPORT_BUTTON (user_data);
GList *queued, *l;
self->pv->ready = TRUE;
/* Process the parsed items that have been seen */
queued = self->pv->queued;
... | false | false | false | false | false | 0 |
NewError(const char* maker, const char* type,
Vector< Handle<Object> > args) {
v8::HandleScope scope; // Instantiate a closeable HandleScope for EscapeFrom.
Handle<FixedArray> array = Factory::NewFixedArray(args.length());
for (int i = 0; i < args.length(); i++) {
array->set(i, *args[i]);
}
Handle<JS... | false | false | false | false | false | 0 |
__env_get_encrypt_flags(dbenv, flagsp)
DB_ENV *dbenv;
u_int32_t *flagsp;
{
#ifdef HAVE_CRYPTO
DB_CIPHER *db_cipher;
#endif
ENV *env;
env = dbenv->env;
#ifdef HAVE_CRYPTO
db_cipher = env->crypto_handle;
if (db_cipher != NULL && db_cipher->alg == CIPHER_AES)
*flagsp = DB_ENCRYPT_AES;
else
*flagsp = 0;
retu... | false | false | false | false | false | 0 |
handleOneArgStr(const Expr *Arg, std::string &Str)
{
Str = "0";
const Type *ArgT = Arg->getType().getTypePtr();
if (!ArgT->isUnionType() && !ArgT->isStructureType())
return;
RewriteHelper->getTmpTransName(NamePostfix, Str);
NamePostfix++;
std::string TmpVarStr = Str;
Arg->getType().getAsStringIntern... | false | false | false | false | false | 0 |
Preset(int Carriers, int Intlv, int *Pattern, int Margin, int Integ)
{ int i,p;
if(!PowerOf2(Carriers)) goto Error;
DataCarriers=Carriers; ScanLen=2*Margin+1; ScanSize=DataCarriers+2*Margin;
LowPass2Coeff(Integ,W1,W2,W5);
DecodeLen=Integ/2; DecodeSize=DecodeLen*ScanLen;
if(ReallocArray(&DecodePipe,DecodeSiz... | false | false | false | false | false | 0 |
pblock_set_dn( void *value, struct berval *dn, struct berval *ndn, void *memctx )
{
struct berval bv;
if ( !BER_BVISNULL( dn )) {
slap_sl_free( dn->bv_val, memctx );
BER_BVZERO( dn );
}
if ( !BER_BVISNULL( ndn )) {
slap_sl_free( ndn->bv_val, memctx );
BER_BVZERO( ndn );
}
bv.bv_val = (char *)value;
bv.... | false | false | false | false | false | 0 |
InsertMsgToGroupInfoItem(GroupInfo *grpinf, MsgPara *para)
{
GtkTextIter iter;
GSList *tlist;
gchar *data;
tlist = para->dtlist;
while (tlist) {
data = ((ChipData *)tlist->data)->data;
switch (((ChipData *)tlist->data)->type) {
cas... | false | false | false | false | false | 0 |
iterate_on_cached_line(
struct gnutella_node *n, struct cache_line *cl, uint8 ttl,
GSList *start, GSList *end, bool strict)
{
int hops = cl->hops;
GSList *sl;
sl = start;
for (; sl && sl != end && n->pong_missing; sl = g_slist_next(sl)) {
struct cached_pong *cp = sl->data;
cl->cursor = sl;
/*
* We nev... | false | false | false | false | false | 0 |
configparser_get_variable(config_t *ctx, const buffer *key) {
data_unset *du;
data_config *dc;
#if 0
fprintf(stderr, "get var %s\n", key->ptr);
#endif
for (dc = ctx->current; dc; dc = dc->parent) {
#if 0
fprintf(stderr, "get var on block: %s\n", dc->key->ptr);
array_print(dc->value, 0);
#endif
if (... | false | false | false | false | false | 0 |
ReadScan(void* pvout)
{
std::auto_ptr<DecoderStrategy> qcodec = JlsCodecFactory<DecoderStrategy>().GetCodec(_info, _info.custom);
_cbyteOffset += qcodec->DecodeScan(pvout, _rect, _pdata + _cbyteOffset, _cbyteLength - _cbyteOffset, _bCompare);
} | false | false | false | false | false | 0 |
gnu_add_sparse_entry(struct archive_read *a, struct tar *tar,
int64_t offset, int64_t remaining)
{
struct sparse_block *p;
p = (struct sparse_block *)malloc(sizeof(*p));
if (p == NULL) {
archive_set_error(&a->archive, ENOMEM, "Out of memory");
return (ARCHIVE_FATAL);
}
memset(p, 0, sizeof(*p));
if (tar->... | false | false | false | false | false | 0 |
db__send_char(int d)
{
int stat = DB_OK;
char c = (char)d;
if (!db__send(&c, sizeof(c)))
stat = DB_PROTOCOL_ERR;
if (stat == DB_PROTOCOL_ERR)
db_protocol_error();
return stat;
} | false | false | false | false | false | 0 |
gtk_plot_canvas_pixmap_new (GdkPixmap *_pixmap, GdkBitmap *mask)
{
GtkPlotCanvasPixmap *pixmap;
pixmap = gtk_type_new (gtk_plot_canvas_pixmap_get_type ());
pixmap->pixmap = _pixmap;
pixmap->mask = mask;
if(_pixmap) gdk_pixmap_r... | false | false | false | false | false | 0 |
quirk_plx_pci9050(struct pci_dev *dev)
{
unsigned int bar;
/* Fixed in revision 2 (PCI 9052). */
if (dev->revision >= 2)
return;
for (bar = 0; bar <= 1; bar++)
if (pci_resource_len(dev, bar) == 0x80 &&
(pci_resource_start(dev, bar) & 0x80)) {
struct resource *r = &dev->resource[bar];
dev_info(&dev-... | false | false | false | false | false | 0 |
GetInput(int idx)
{
if (this->GetNumberOfInputConnections(0) <= idx)
{
return 0;
}
return vtkImageData::SafeDownCast(
this->GetExecutive()->GetInputData(0, idx));
} | false | false | false | false | false | 0 |
match_main (G, scount, srk, use_all)
graph *G;
stats *scount;
srkstuff *srk;
int use_all;
#endif
{
if (!G->unmatched_count)
return 0;
if (use_all == 2) {
if (match_main_tree (G, scount, srk)) {
fprintf (stderr, "match_main_tree failed\n");
return 1;
}
} els... | false | false | false | false | false | 0 |
dbmetaprint(KCDB* db, int32_t verbose) {
char* status, *rp;
if (verbose) {
status = kcdbstatus(db);
if (status) {
rp = status;
while (*rp != '\0') {
if (*rp == '\t') {
printf(": ");
} else {
putchar(*rp);
}
rp++;
}
kcfree(status);
... | false | false | false | false | false | 0 |
strio_readbyte(VALUE self)
{
VALUE c = rb_funcall2(self, rb_intern("getbyte"), 0, 0);
if (NIL_P(c)) rb_eof_error();
return c;
} | false | false | false | false | false | 0 |
GetFieldHandles()
{
static FieldHandle<TimeZone>::ListT fhv;
if( fhv.size() )
return fhv;
#undef CONTAINER_OBJECT_NAME
#define CONTAINER_OBJECT_NAME fhv
#undef RECORD_CLASS_NAME
#define RECORD_CLASS_NAME TimeZone
FHP(RecType, _("Record Type Code"));
FHP(RecordId, _("Unique Record ID"));
FHD(Name, _("TimeZon... | false | false | false | false | false | 0 |
static_initialize()
{
if (name_enders[(uint8_t)'('])
return;
name_enders[(uint8_t)' '] = name_enders[(uint8_t)'\t']
= name_enders[(uint8_t)'\r'] = name_enders[(uint8_t)'\f']
= name_enders[(uint8_t)'\v'] = name_enders[(uint8_t)'\n']
= name_enders[(uint8_t)'\0'] = name_enders[(uint8_t)'[']
= name_enders[(uin... | false | false | false | false | false | 0 |
isl_hash_mem(uint32_t hash, const void *p, size_t len)
{
int i;
const char *s = p;
for (i = 0; i < len; ++i)
isl_hash_byte(hash, s[i]);
return hash;
} | false | false | false | false | false | 0 |
gitg_repository_relative (GitgRepository *repository,
GFile *file)
{
g_return_val_if_fail (GITG_IS_REPOSITORY (repository), NULL);
g_return_val_if_fail (repository->priv->work_tree != NULL, NULL);
return g_file_get_relative_path (repository->priv->work_tree, file);
} | false | false | false | false | false | 0 |
printDebugInfo(const Particle & p,
const ParticleVector & children,
double wgt) const {
generator()->log() << "Input masses "
<< p.mass()/GeV << " -> "
<< children[0]->mass()/GeV << " "
<< children[1]->mass()/GeV << '\n';
generator()->log() << "Momenta\n";
generator()->l... | false | false | false | false | false | 0 |
NewWritableFile(const std::string& fname,
WritableFile** result) {
Status s;
FILE* f = fopen(fname.c_str(), "w");
if (f == NULL) {
*result = NULL;
s = IOError(fname, errno);
} else {
*result = new PosixWritableFile(fname, f);
}
return s;
} | false | false | false | false | true | 1 |
RemoveScalarVariables()
{
int i;
for (i = 0; i < this->NumberOfScalarVariables; i++)
{
delete [] this->ScalarVariableNames[i];
this->ScalarVariableNames[i] = NULL;
}
if (this->NumberOfScalarVariables > 0)
{
delete [] this->ScalarVariableNames;
this->ScalarVariableNames = NULL;
del... | false | false | false | false | false | 0 |
matrix_text_write (NODE *l, NODE *m, NODE *r, parser *p)
{
NODE *ret = NULL;
if (starting(p)) {
const char *s = m->v.str;
int export = 0;
if (!null_or_empty(r)) {
export = (r->v.xval != 0);
}
ret = aux_scalar_node(p);
if (ret == NULL) {
return NULL;
}
ret->v.xval = gretl_matrix_write_as_... | false | false | false | false | false | 0 |
DS_LASAuthMethodEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
char *attr_pattern, int *cachable, void **LAS_cookie,
PList_t subject, PList_t resource, PList_t auth_info,
PList_t global_auth)
{
char *attr;
char *ptr;
int len;
int matched;
int rc;
char *s = NULL;
lasInfo lasinfo;
i... | false | false | false | false | false | 0 |
compare_pa_edge_list(Pa_edge *edge_list1, Pa_edge *edge_list2)
{
Pa_edge *e1, *e2;
if (get_num_of_edge(edge_list1) != get_num_of_edge(edge_list2)) {
return FALSE;
}
for (e1 = edge_list1; e1 != NULL; e1 = e1->next) {
for (e2 = edge_list2; e2 != NULL; e2 = e2->next) {
if (com... | false | false | false | false | false | 0 |
simplify_associative_operation (enum rtx_code code, enum machine_mode mode,
rtx op0, rtx op1)
{
rtx tem;
/* Linearize the operator to the left. */
if (GET_CODE (op1) == code)
{
/* "(a op b) op (c op d)" becomes "((a op b) op c) op d)". */
if (GET_CODE (op0) == code)
{
tem = simplify_gen... | false | false | false | false | false | 0 |
ext4_dec_count(handle_t *handle, struct inode *inode)
{
if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
drop_nlink(inode);
} | false | false | false | false | false | 0 |
migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
int node)
{
pg_data_t *pgdat = NODE_DATA(node);
int isolated;
int nr_remaining;
LIST_HEAD(migratepages);
/*
* Don't migrate file pages that are mapped in multiple processes
* with execute permissions as they are probably shared librar... | false | false | false | false | false | 0 |
entropy_get(unsigned char *buf, int num) {
isc_result_t result;
if (num < 0)
return (-1);
result = dst__entropy_getdata(buf, (unsigned int) num, ISC_FALSE);
return (result == ISC_R_SUCCESS ? 1 : -1);
} | false | false | false | false | false | 0 |
MakeCaseRfmLabel(Node switch_node, int branch_no, RfmStm stm)
{
RfmLabel prev;
RfmLabel label;
RfmLabel new;
if ((switch_node == NULL) || (branch_no <= 0)) {
return(NULL);
}
prev = NULL;
for (label = RFM_ModuleCurrent->label_list;
label != NULL;
label = label->next... | false | false | false | false | false | 0 |
text_test_name (CutStreamParserPrivate *priv, GMarkupParseContext *context,
const gchar *text, gsize text_len, GError **error)
{
CutTest *target;
target = target_test_object(priv, PEEK_NTH_STATE(priv, 1));
if (target) {
cut_test_set_name(target, text);
} else {
set_parse... | false | false | false | false | false | 0 |
clear_ptr()
{
memset(&splash, 0, sizeof(splash));
//### begin alex 23/10 ###//
selected_unit_id = 0;
menu_mode = 0;
//#### end alex 23/10 ####//
// ###### patch begin Gilbert 21/1 ######//
// must do this step before clear_ptr(), attack_info_array is reset there
if( !attack_info_array )
memset(&ship_attack... | false | false | false | false | false | 0 |
ArgusUpdateState (struct ArgusFlowStruct *flowstr, unsigned char state)
{
int retn = 1;
struct ArgusFlow *flow;
ArgusInProtocol = 1;
ArgusUpdateMACState(flowstr, &state);
flow = &flowstr->flow;
switch (ArgusThisNetworkFlowType & 0xFFFF) {
case ETHERTYPE_IP: {
if ((flow->ip_flow.ip_p ... | false | false | false | false | false | 0 |
dlz_lookup(const char *zone, const char *name, void *dbdata,
dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods,
dns_clientinfo_t *clientinfo)
{
isc_result_t result;
struct dlz_example_data *state = (struct dlz_example_data *)dbdata;
isc_boolean_t found = ISC_FALSE;
isc_sockaddr_t *src;
char full_n... | false | false | false | false | false | 0 |
intelDestroyContext(__DRIcontext * driContextPriv)
{
struct brw_context *brw =
(struct brw_context *) driContextPriv->driverPrivate;
struct gl_context *ctx = &brw->ctx;
assert(brw); /* should never be null */
if (!brw)
return;
/* Dump a final BMP in case the application doesn't call SwapBuf... | false | false | false | false | false | 0 |
hpi_dsp_code_read_word(struct dsp_code *dsp_code, u32 *pword)
{
if (dsp_code->word_count + 1 > dsp_code->block_length)
return HPI_ERROR_DSP_FILE_FORMAT;
*pword = ((u32 *)(dsp_code->pvt->firmware->data))[dsp_code->
word_count];
dsp_code->word_count++;
return 0;
} | false | false | false | false | false | 0 |
mod_gdi(
u_long32 target,
u_long32 cmd,
lList **lpp,
lCondition *cp,
lEnumeration *enp
) {
/* Note: I think that sge_gdi should be generalized to reduce the list
for you, when an enumeration is supplied on a sge_gdi(SGE_GDI_MOD),
but for now, I'll do it here. */
lList *ans;
lList *lp = NULL;
i... | false | false | false | false | false | 0 |
block34_data_unref (void * _userdata_) {
Block34Data* _data34_;
_data34_ = (Block34Data*) _userdata_;
if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
GmpcBrowsersNowplaying * self;
self = _data34_->_data27_->self;
_g_object_unref0 (_data34_->sl);
_g_object_unref0 (_data34_->alib);
block27_data_un... | false | false | false | false | false | 0 |
glob_match(const String &str, const String &pattern)
{
const char *send = str.end();
const char *pend = pattern.end();
// quick common-case check for suffix matches
while (pattern.begin() < pend && str.begin() < send
&& pend[-1] != '*' && pend[-1] != '?' && pend[-1] != ']'
&& (pattern.begin() +... | false | false | false | false | false | 0 |
pvn_is_integer(U8 *p, STRLEN len)
{
U8 *e = p + len;
if(len == 0 || len > 9) return 0;
if(*p == '0') return len == 1;
for(; p != e; p++) {
if(!char_is_decdigit(*p)) return 0;
}
return 1;
} | false | false | false | false | false | 0 |
norm_dir(
const char * dirname, /* Directory path to normalize */
int framework /* Setting a framework directory*/
)
/*
* Normalize include directory path.
* Handle -isysroot option for GCC, including framework directory for SYS_MAC.
*/
{
char * norm_name;
#if COMPILER == G... | false | false | false | false | false | 0 |
onCmdMerge(FXObject*,FXSelector,void*){
if(0<=sellower && 0<=selupper){
mergeSegments(sellower,selupper,TRUE);
selectSegments(sellower,sellower,TRUE);
}
return 1;
} | false | false | false | false | false | 0 |
printflat (const void *node, VISIT value, int level)
{
if (value == leaf || value == postorder)
{
struct known_symbol *s = *(struct known_symbol **) node;
cumu_ticks += s->ticks;
printf ("%6.2f%10.2f%9.2f%9" PRIdMAX "%9.2f %s\n",
total_ticks ? (100.0 * s->ticks) / total_ticks ... | false | false | false | false | false | 0 |
_init_hostname(struct cmd_context *cmd)
{
struct utsname uts;
if (uname(&uts)) {
log_sys_error("uname", "_init_hostname");
return 0;
}
if (!(cmd->hostname = dm_pool_strdup(cmd->libmem, uts.nodename))) {
log_error("_init_hostname: dm_pool_strdup failed");
return 0;
}
if (!(cmd->kernel_vsn = dm_pool_strd... | false | false | false | false | false | 0 |
_rtl8723be_llt_table_init(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
unsigned short i;
u8 txpktbuf_bndy;
u8 maxPage;
bool status;
maxPage = 255;
txpktbuf_bndy = 245;
rtl_write_dword(rtlpriv, REG_TRXFF_BNDY,
(0x27FF0000 | txpktbuf_bndy));
rtl_write_byte(rtlpriv, REG_TDECTRL + 1, tx... | false | false | false | false | false | 0 |
ffpktp(fitsfile *fptr, /* I - FITS file pointer */
const char *filename, /* I - name of template file */
int *status) /* IO - error status */
/*
read keywords from template file and append to the FITS file
*/
{
FILE *diskfile;
char card[FLEN_CARD], templa... | false | false | false | false | false | 0 |
read_file(std::string filepath, char * lBuffer)
{
size_t lTotalBytesRead = 0;
FILE * lFilePtr = fopen(filepath.c_str(), "rb");
if(lFilePtr == 0) {
perror(strerror(errno));
return -1;
}
while (!feof(lFilePtr)) {
int lNumBytesRead = fread(lBuffer, 1, MAX_FILE_SIZE_BYTES, lFile... | false | false | false | false | true | 1 |
FindLineBreaks(const unichar_t *question, GTextInfo linebreaks[GLINE_MAX+1]) {
int lb, i;
const unichar_t *pt, *last;
/* Find good places to break the question into bits */
last = pt = question;
linebreaks[0].text = (unichar_t *) question;
lb=0;
while ( *pt!='\0' && lb<GLINE_MAX-1 ) {
last... | false | false | false | false | false | 0 |
lpfc_create_vport_work_array(struct lpfc_hba *phba)
{
struct lpfc_vport *port_iterator;
struct lpfc_vport **vports;
int index = 0;
vports = kzalloc((phba->max_vports + 1) * sizeof(struct lpfc_vport *),
GFP_KERNEL);
if (vports == NULL)
return NULL;
spin_lock_irq(&phba->hbalock);
list_for_each_entry(port_ite... | false | false | false | false | false | 0 |
__get_segment_type_6(struct page *page, enum page_type p_type)
{
if (p_type == DATA) {
struct inode *inode = page->mapping->host;
if (S_ISDIR(inode->i_mode))
return CURSEG_HOT_DATA;
else if (is_cold_data(page) || file_is_cold(inode))
return CURSEG_COLD_DATA;
else
return CURSEG_WARM_DATA;
} else {
... | false | false | false | false | false | 0 |
setWallColor(const QColor& color)
{
m_wallPen = QPen(color.darker(), 3);
foreach (Kolf::Wall* wall, m_walls)
applyWallStyle(wall);
} | false | false | false | false | false | 0 |
w1Alloc(struct w1_vect* v){
struct _w1Node* wp = v->writePtr;
if(!v->_pool){
wp->next = calloc(sizeof(struct _w1Node),1);
if(!wp->next){
goto fail0;
}
wp->next->memory.raw = malloc(v->elSize*NODE_SIZE);
if(!wp->next->memory.raw){
goto fail1;
}
}
else{
//already have memory ready for this node!... | false | false | false | false | false | 0 |
parse_item(CS& cmd, CARD* c)
{
// See Stroustrup 15.4.5
// If you can think of a better way, tell me.
// It must be in the LANGUAGE class, not CARD.
if (dynamic_cast<MODEL_SUBCKT*>(c)) {
return parse_module(cmd, prechecked_cast<MODEL_SUBCKT*>(c));
}else if (dynamic_cast<COMPONENT*>(c)) {
return parse... | false | false | false | false | false | 0 |
gst_jpeg_dec_init (GstJpegDec * dec)
{
GST_DEBUG ("initializing");
/* create the sink and src pads */
dec->sinkpad =
gst_pad_new_from_static_template (&gst_jpeg_dec_sink_pad_template,
"sink");
gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
gst_pad_set_setcaps_function (dec->sinkpad,
... | false | false | false | false | false | 0 |
PreCalculateScores()
{
//Figure out which features need to be precalculated
const vector<const StatelessFeatureFunction*>& sfs =
m_system->GetStatelessFeatureFunctions();
vector<const StatelessFeatureFunction*> precomputedFeatures;
for (unsigned i = 0; i < sfs.size(); ++i) {
if (sfs[i]->ComputeValueInT... | false | false | false | false | false | 0 |
addrbook_set_path(AddressBookFile *book, const gchar *value)
{
cm_return_if_fail(book != NULL);
book->path = mgu_replace_string(book->path, value);
addrcache_set_dirty(book->addressCache, TRUE);
} | false | false | false | false | false | 0 |
FilterExists(char *name)
{ struct Filter *ptr;
for (ptr=VFILTERLIST; ptr != NULL; ptr=ptr->next)
{
if (strcmp(ptr->alias,name) == 0)
{
return true;
}
}
return false;
} | false | false | false | false | false | 0 |
VvhVbhDuplicateExpr( Expr )
vexexpr *Expr;
{
vexexpr *ExprDup;
chain_list *ScanOper;
chain_list *DupOper;
chain_list **PrevOper;
ExprDup = dupvexnode( Expr );
if ( ! IsVexNodeAtom( Expr ) )
{
PrevOper = &ExprDup->OPERAND;
for ( ScanOper = Expr->OPERAND;
ScanOper != (chain_li... | false | false | false | false | false | 0 |
my_strnncoll_utf32(CHARSET_INFO *cs,
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
my_wc_t UNINIT_VAR(s_wc),UNINIT_VAR(t_wc);
const uchar *se= s + slen;
const uchar *te= t + tlen;
MY_UNICASE_INFO **uni_plane= cs->casei... | false | false | false | false | true | 1 |
Str2Uid(char *uidbuff,char *usercopy,struct Promise *pp)
{ struct Item *ip, *tmplist;
struct passwd *pw;
int offset,uid = -2,tmp = -2;
char *machine,*user,*domain;
if (uidbuff[0] == '+') /* NIS group - have to do this in a roundabout */
{ /* way because calling getpwnam s... | false | true | false | false | false | 1 |
file_stat(Jim_Interp *interp, Jim_Obj *filename, struct stat *sb)
{
const char *path = Jim_String(filename);
if (stat(path, sb) == -1) {
Jim_SetResultFormatted(interp, "could not read \"%#s\": %s", filename, strerror(errno));
return JIM_ERR;
}
return JIM_OK;
} | false | false | false | false | false | 0 |
ExecBSDeleteTriggers(EState *estate, ResultRelInfo *relinfo)
{
TriggerDesc *trigdesc;
int ntrigs;
int *tgindx;
int i;
TriggerData LocTriggerData;
trigdesc = relinfo->ri_TrigDesc;
if (trigdesc == NULL)
return;
ntrigs = trigdesc->n_before_statement[TRIGGER_EVENT_DELETE];
tgindx = trigdesc->tg_before... | false | false | false | false | false | 0 |
build(uint * sequence, size_t len) {
return new SequenceGMRChunk(sequence, len, bsb, pmb);
} | false | false | false | false | false | 0 |
iscsit_process_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
struct iscsi_text *hdr)
{
unsigned char *text_in = cmd->text_in_ptr, *text_ptr;
int cmdsn_ret;
if (!text_in) {
cmd->targ_xfer_tag = be32_to_cpu(hdr->ttt);
if (cmd->targ_xfer_tag == 0xFFFFFFFF) {
pr_err("Unable to locate text_in buffer... | false | false | false | false | false | 0 |
ReadStructure()
{
while( mReader->read())
{
// beginning of elements
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
if( IsElement( "asset"))
ReadAssetInfo();
else if( IsElement( "library_animations"))
ReadAnimationLibrary();
else if( IsElement( "library_controllers"))
ReadController... | false | false | false | false | false | 0 |
kDisposeScript(state_t *s, int funct_nr, int argc, reg_t *argv)
{
int script = argv[0].offset;
/* Work around QfG1 graveyard bug */
if (argv[0].segment) return s->r_acc;
if (sm_script_is_loaded(&(s->seg_manager), script, SCRIPT_ID))
{
int id = sm_seg_get(&(s->seg_manager), script);
if (s-... | false | false | false | false | false | 0 |
pgm_display_generic_mask(PROGRAMMER * pgm, const char * p, unsigned int show)
{
if(show & (1<<PPI_AVR_VCC))
fprintf(stderr, "%s VCC = %s\n", p, pins_to_str(&pgm->pin[PPI_AVR_VCC]));
if(show & (1<<PPI_AVR_BUFF))
fprintf(stderr, "%s BUFF = %s\n", p, pins_to_str(&pgm->pin[PPI_AVR_BUFF]));
if(show &... | false | false | false | false | false | 0 |
toXMLSessions(const string& inUser,
bool isPrivate)const{
mMutexSessionManager.lock();
string lReturnValue;
CXMLHelper lHelper;
lHelper.setName("ssessionlist");
if(isPrivate){
lHelper.addAttribute("user",inUser);
}
lReturnValue+=lHelper.toString();
const list<CSession>& lList=mUserToS... | false | false | false | false | false | 0 |
layout_selection_list(LayoutWindow *lw)
{
if (!layout_valid(&lw)) return NULL;
if (layout_image_get_collection(lw, NULL))
{
FileData *fd;
fd = layout_image_get_fd(lw);
if (fd) return g_list_append(NULL, file_data_ref(fd));
return NULL;
}
if (lw->vf) return vf_selection_get_list(lw->vf);
return NULL;... | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Input: (" << this->Input << ")\n";
os << indent << "InverseFlag: " << this->GetInverseFlag() << "\n";
os << indent << "NumberOfConcatenatedTransforms: " <<
this->GetNumberOfConcatenatedTransforms() << "\n";
... | false | false | false | false | false | 0 |
SetInverseVideo(int iv)
{
if (this->InverseVideo == iv)
{
return;
}
this->InverseVideo = iv;
if (this->Table->GetNumberOfTuples() < 1)
{
return;
}
unsigned char *rgba, *rgba2;
unsigned char tmp[4];
int i;
int n = this->NumberOfColors-1;
for (i = 0; i < this->NumberOfColors/2;... | false | false | false | false | false | 0 |
sparql_connection_ready_cb (GObject *object,
GAsyncResult *res,
gpointer user_data)
{
GError *error = NULL;
GomMiner *self = user_data;
self->priv->connection = tracker_sparql_connection_get_finish (res, &error);
if (error != NULL)
{
gom_miner_... | false | false | false | false | false | 0 |
computeVisibleLength(void)
{
unsigned offset=highlightThickness()+shadowThickness();
int w=width()-(2*offset+xMargin());
unsigned len=0;
int tw=0;
const char *pString=string();
for (unsigned pos=scrollIndex();pos<length();pos++)
{
tw+=charWidth(pString[pos]);
if (tw<=w) len++;
else break;... | false | false | false | false | false | 0 |
__hmac_sha1(GChecksum *checksum, const void *key, size_t key_len,
const void *data, size_t data_len, void *output)
{
unsigned char ipad[64];
unsigned char opad[64];
unsigned char digest[SHA1_MAC_LEN];
size_t length;
int i;
/* if key is longer than 64 bytes reset it to key=SHA1(key) */
if (key_len > 64) {
g... | true | true | false | false | false | 1 |
xtables_load_ko(const char *modprobe, bool quiet)
{
static bool loaded = false;
static int ret = -1;
if (!loaded) {
ret = xtables_insmod(afinfo->kmod, modprobe, quiet);
loaded = (ret == 0);
}
return ret;
} | false | false | false | false | false | 0 |
InsertPreCalculatedScores
(const TranslationOption& translationOption, ScoreComponentCollection* scoreBreakdown)
const
{
if (m_precalculatedScores.size()) {
boost::unordered_map<TranslationOption,ScoreComponentCollection>::const_iterator scoreIter =
m_precalculatedScores.find(translationOption);
... | false | false | false | false | false | 0 |
acl_eval_std(struct acl_list acl_list, int index, u_int32 ip)
{
int x;
#ifdef DEBUG
extern int debug;
char fmt_buf[32], fmt_buf2[32], fmt_buf3[32], fmt_buf4[32];
#endif /* DEUBG */
for (x = 0; x < acl_list.acl_ip_std[index].num_lines; ++x) {
#ifdef DEBUG
if (debug > 5) {
fmt_ipv4(fmt_buf, acl_list.a... | false | false | false | false | false | 0 |
mono_profiler_install_allocation (MonoProfileAllocFunc callback)
{
mono_gc_enable_alloc_events ();
if (!prof_list)
return;
prof_list->allocation_cb = callback;
} | false | false | false | false | false | 0 |
evd_connection_manage_read_condition (EvdConnection *self)
{
if (self->priv->tls_handshaking)
evd_connection_tls_handshake (self);
else
evd_buffered_input_stream_thaw (self->priv->buf_input_stream,
evd_socket_get_priority (self->priv->socket));
} | false | false | false | false | false | 0 |
__memp_set_cache_max(dbenv, max_gbytes, max_bytes)
DB_ENV *dbenv;
u_int32_t max_gbytes, max_bytes;
{
ENV *env;
env = dbenv->env;
ENV_ILLEGAL_AFTER_OPEN(env, "DB_ENV->set_cache_max");
dbenv->mp_max_gbytes = max_gbytes;
dbenv->mp_max_bytes = max_bytes;
return (0);
} | false | false | false | false | false | 0 |
extract_how(s48_call_t call, s48_ref_t sch_how)
{
long how_val = s48_extract_long_2(call, sch_how);
switch (how_val)
{
#ifdef _WIN32
case 0:
return SD_RECEIVE;
case 1:
return SD_SEND;
case 2:
return SD_BOTH;
#else
case 0:
return SHUT_RD;
case 1:
return SHUT_WR;
... | false | false | false | false | false | 0 |
Warning(const char *format, ...) {
if (PbrtOptions.quiet) return;
va_list args;
va_start(args, format);
processError(format, args, "Warning", PBRT_ERROR_CONTINUE);
va_end(args);
} | false | false | false | false | false | 0 |
_MW_InitialRecv(PRCList *io_ready)
{
PRRecvWait *desc = (PRRecvWait*)io_ready;
if ((NULL == desc->buffer.start)
|| (0 == desc->buffer.length))
desc->bytesRecv = 0;
else
{
desc->bytesRecv = (desc->fd->methods->recv)(
desc->fd, desc->buffer.start,
desc->buffer.l... | false | false | false | false | false | 0 |
gtktreeview_gtk_tree_view_row_expanded(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj tree_view_scm;
GtkTreeView* tree_view;
ScmObj path_scm;
GtkTreePath* path;
ScmObj SCM_SUBRARGS[2];
int SCM_i;
SCM_ENTER_SUBR("gtk-tree-view-row-expanded");
for (SCM_i=0; SCM_i<2; SCM_i++) {
SCM_SUBRARGS[SCM_... | false | false | false | false | false | 0 |
eraseRestoreInfo(int Id, SlotIndex index,
unsigned vr, BitVector &RestoreMBBs,
DenseMap<unsigned,std::vector<SRInfo> > &RestoreIdxes) {
if (!RestoreMBBs[Id])
return;
std::vector<SRInfo> &Restores = RestoreIdxes[Id];
for (unsigned i = 0, e = Restores.size(); i !=... | false | false | false | false | false | 0 |
os_banner_disp(void *banner_handle, const char *txt, size_t len)
{
osbanid_t banner = banner_handle;
if (!banner || !banner->valid || !banner->win)
return;
contentid_t update = banner_contents_init();
if (!update)
return;
update->banner = banner;
if (!(banner->conten... | false | false | false | false | false | 0 |
cl_com_dup_endpoint(cl_com_endpoint_t* endpoint) {
if (endpoint == NULL || endpoint->comp_host == NULL || endpoint->comp_name == NULL) {
return NULL;
}
return cl_com_create_endpoint(endpoint->comp_host, endpoint->comp_name, endpoint->comp_id, &endpoint->addr);
} | 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.