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 |
|---|---|---|---|---|---|---|
GetHostByName( const char *name )
{
unsigned long result = 0;
struct hostent *h = gethostbyname( name );
if( h ){
struct in_addr a;
memcpy( &a, h->h_addr_list[0], h->h_length );
result = ntohl(a.s_addr);
}
return result;
} | false | false | false | false | false | 0 |
merge1(Topform c, int n)
{
Literals target = ith_literal(c->literals, n);
Literals prev = ith_literal(c->literals, n-1);
Literals lit = c->literals;
BOOL go = TRUE;
while (go) {
if (lit->sign == target->sign && term_ident(lit->atom, target->atom))
go = FALSE;
else
lit = lit->next;
}
i... | false | false | false | false | false | 0 |
buffer_tolong(t_buffer *buffer, size_t *len, int base)
{
long int result;
char *endptr;
t_buffer *workbuf;
workbuf = buffer;
if (buffer->msize == 0) {
/* Considering buffer->ptr has not been allocated */
workbuf = buffer_dup_class(buffer, &default_class);
if (workbuf == NULL) {
return 0;
}
}
result =... | false | false | false | false | false | 0 |
createRuleBasedBreakIterator( const UnicodeString &rules,
UParseError *parseError,
UErrorCode &status)
{
// status checked below
//
// Read the input rules, generate a parse tree, symbol table,
// and list of all Unic... | false | false | false | false | false | 0 |
us_midi_parser_create( us_allocator_t *allocator, int32_t max_sysex_size )
{
us_midi_parser_t *r = 0;
us_midi_parser_t *self = 0;
self = us_new( allocator, us_midi_parser_t );
if ( self )
{
self->destroy = us_midi_parser_destroy;
self->m_allocator = allocator;
us_midi_msg_ini... | false | false | false | false | false | 0 |
bdc_function_wake_fh(struct bdc *bdc, u8 intf)
{
u32 param0, param1;
u32 cmd_sc = 0;
param0 = param1 = 0;
dev_dbg(bdc->dev, "%s intf=%d\n", __func__, intf);
cmd_sc |= BDC_CMD_FH;
param0 |= TRA_PACKET;
param0 |= (bdc->dev_addr << 25);
param1 |= DEV_NOTF_TYPE;
param1 |= (FWK_SUBTYPE<<4);
dev_dbg(bdc->dev, "p... | false | false | false | false | false | 0 |
set_crypto_driver(cmd_parms * cmd, void *config, const char *arg)
{
session_crypto_conf *conf =
(session_crypto_conf *)ap_get_module_config(cmd->server->module_config,
&session_crypto_module);
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
if (err != NULL) {
return err;
... | false | false | false | false | false | 0 |
enh_desc_release_tx_desc(struct dma_desc *p, int mode)
{
int ter = p->des01.etx.end_ring;
memset(p, 0, offsetof(struct dma_desc, des2));
if (mode == STMMAC_CHAIN_MODE)
enh_desc_end_tx_desc_on_chain(p, ter);
else
enh_desc_end_tx_desc_on_ring(p, ter);
} | false | false | false | false | false | 0 |
glusterd_ac_reverse_probe_begin (glusterd_friend_sm_event_t *event, void *ctx)
{
int ret = 0;
glusterd_peerinfo_t *peerinfo = NULL;
glusterd_friend_sm_event_t *new_event = NULL;
glusterd_probe_ctx_t *new_ev_ctx = NULL;
GF_ASSERT (event);
GF_AS... | false | false | false | true | false | 1 |
overflowed_sec0 (void)
{
mpfr_t x, y;
int emax, i, inex, rnd, err = 0;
mpfr_exp_t old_emax;
old_emax = mpfr_get_emax ();
mpfr_init2 (x, 8);
mpfr_init2 (y, 8);
for (emax = -1; emax <= 0; emax++)
{
mpfr_set_ui_2exp (y, 1, emax, MPFR_RNDN);
mpfr_nextbelow (y);
set_emax (emax); /* 1 ... | false | false | false | false | false | 0 |
stream_buffer_flush (CamelStream *stream,
GCancellable *cancellable,
GError **error)
{
CamelStreamBufferPrivate *priv;
priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
if ((priv->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE) {
gsize len = priv->ptr - pri... | false | false | false | false | false | 0 |
rename_worklist_editor_callback(struct widget *pWidget)
{
if (Main.event.button.button == SDL_BUTTON_LEFT) {
if(pWidget->string16->text) {
char *pText = convert_to_chars(pWidget->string16->text);
fc_snprintf(pEditor->worklist_name, MAX_LEN_NAME, "%s", pText);
FC_FREE(pText);
} else {
/... | false | false | false | false | false | 0 |
SELECT_MASK(ide_drive_t *drive, int mask)
{
const struct ide_port_ops *port_ops = drive->hwif->port_ops;
if (port_ops && port_ops->maskproc)
port_ops->maskproc(drive, mask);
} | false | false | false | false | false | 0 |
strprintf(string &out,const char *format,...)
{
va_list args;
ssize_t size = 400;
std::ostringstream outstr;
while (true) {
va_start(args,format);
if (iovprintf(outstr, format, args, size) == true)
break;
va_end(args);
}
out = outstr.str();
} | false | false | false | false | false | 0 |
server_init (int *p_sfd, char*str_port) {
struct addrinfo hints;
struct addrinfo *result, *rp;
int s;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
hints.ai_flags = AI_PASSIVE; /* For wildcard... | false | false | false | false | false | 0 |
SV_UserinfoChanged (client_t *cl)
{
char *val;
int i;
// call prog code to allow overrides
ge->ClientUserinfoChanged (cl->edict, cl->userinfo, 0);
// name for C code
Q_strncpyz2( cl->name, Info_ValueForKey (cl->userinfo, "name"), sizeof(cl->name) );
// mask off high bit
for (i=0 ; i<sizeof(cl->nam... | false | false | false | false | true | 1 |
GetDataBlock( gifdata* gd, unsigned char* buf )
{
unsigned char count;
if ( !SDL_RWread(gd->src,&count,1,1) )
{
/* pm_message("error in getting DataBlock size" ); */
return -1;
}
gd->zerodatablock = count == 0;
if ( (count != 0) && !SDL_RWread(gd->src,buf,count,1) )
{
/* pm_message("error in reading Dat... | false | false | false | false | false | 0 |
ad9523_read(struct iio_dev *indio_dev, unsigned addr)
{
struct ad9523_state *st = iio_priv(indio_dev);
int ret;
/* We encode the register size 1..3 bytes into the register address.
* On transfer we get the size from the register datum, and make sure
* the result is properly aligned.
*/
struct spi_transfer t... | false | false | false | false | false | 0 |
setEmptyRootForms(const QList<Form::FormMain *> &emptyRootForms)
{
d->_emptyRootForms = emptyRootForms;
// extract the formuid
if (emptyRootForms.count()) {
d->_formUid = emptyRootForms.at(0)->uuid();
d->_modeUid = emptyRootForms.at(0)->modeUniqueName();
}
} | false | false | false | false | false | 0 |
GWEN_Memory_Table__Dump(GWEN_MEMORY_TABLE *mt) {
unsigned char *p;
unsigned char *end;
p=mt->data;
end=p+GWEN_MEMORY_TABLE_LEN;
while(p<end) {
unsigned short bsize;
unsigned short rsize;
bsize=GWEN_MEMORY_READSIZE(p);
rsize=bsize & GWEN_MEMORY_MASK_LEN;
fprintf(stderr,
"GWEN ... | false | false | false | false | false | 0 |
mem_stat_free_list(mark,list)
int mark,list;
{
u_int i,j;
int (*free_fn)();
if ( list < 0 || list >= MEM_CONNECT_MAX_LISTS
|| mem_connect[list].free_funcs == NULL )
return -1;
if (mark < 0) {
mem_stat_mark_curr = 0;
return -1;
}
else if (mark == 0) {
mem_stat_mark_cur... | false | false | false | false | false | 0 |
cmd_window_left(const char *data, SERVER_REC *server, void *item)
{
int refnum;
refnum = window_refnum_left(active_win->refnum, TRUE);
if (refnum != -1)
window_set_active(window_find_refnum(refnum));
} | false | false | false | false | false | 0 |
get_help(int help_pointer) /* Help procedure */
{
FILE *help_file;
int i, number, nlines;
Boolean found_help;
char temp[MAXLINE+1];
char *digits = "0123456789";
char *help_marker = ">>HELP<<";
#if MSDOS
char *help_file_name = "clustalv.hlp";
#else
char *help_file_name = "clustalv_help";
#endif
#if VMS... | false | false | false | false | true | 1 |
ocfs2_drop_inode_locks(struct inode *inode)
{
int status, err;
/* No need to call ocfs2_mark_lockres_freeing here -
* ocfs2_clear_inode has done it for us. */
err = ocfs2_drop_lock(OCFS2_SB(inode->i_sb),
&OCFS2_I(inode)->ip_open_lockres);
if (err < 0)
mlog_errno(err);
status = err;
err = ocfs2_dr... | false | false | false | false | false | 0 |
pvr2_v4l2_release(struct file *file)
{
struct pvr2_v4l2_fh *fhp = file->private_data;
struct pvr2_v4l2 *vp = fhp->pdi->v4lp;
struct pvr2_hdw *hdw = fhp->channel.mc_head->hdw;
pvr2_trace(PVR2_TRACE_OPEN_CLOSE,"pvr2_v4l2_release");
if (fhp->rhp) {
struct pvr2_stream *sp;
pvr2_hdw_set_streaming(hdw,0);
sp = p... | false | false | false | false | false | 0 |
addChildren (pANTLR3_BASE_TREE tree, pANTLR3_LIST kids)
{
ANTLR3_UINT32 i;
ANTLR3_UINT32 s;
s = kids->size(kids);
for (i = 0; i<s; i++)
{
tree->addChild(tree, (pANTLR3_BASE_TREE)(kids->get(kids, i+1)));
}
} | false | false | false | false | false | 0 |
eb_write_text_byte2(EB_Book *book, int byte1, int byte2)
{
EB_Error_Code error_code;
char stream[2];
LOG(("in: eb_write_text_byte2(book=%d, byte1=%d, byte2=%d)",
(int)book->code, byte1, byte2));
/*
* If the text buffer has enough space to write `byte1' and `byte2',
* save the bytes in `book... | true | true | false | false | false | 1 |
Nset_draw_cmd(Nv_data * data, Tcl_Interp * interp, /* Current interpreter. */
int argc, /* Number of arguments. */
char **argv /* Argument strings. */
)
{
int where;
if (argc != 2) {
return (TCL_ERROR);
}
if (!strcmp(argv[1], "front"))
where = GSD_FRONT;
else if (!strcmp(argv[1], "ba... | false | false | false | false | false | 0 |
userlist_click_cb (GtkWidget *widget, GdkEventButton *event, gpointer userdata)
{
char **nicks;
int i;
GtkTreeSelection *sel;
GtkTreePath *path;
if (!event)
return FALSE;
if (!(event->state & STATE_CTRL) &&
event->type == GDK_2BUTTON_PRESS && prefs.hex_gui_ulist_doubleclick[0])
{
nicks = userlist_selecti... | false | false | false | false | false | 0 |
pool_flush2(struct pool_head *pool)
{
void *temp, *next;
if (!pool)
return;
next = pool->free_list;
while (next) {
temp = next;
next = *(void **)temp;
pool->allocated--;
FREE(temp);
}
pool->free_list = next;
/* here, we should have pool->allocate == pool->used */
} | false | false | false | false | false | 0 |
SelectLoad(const Instruction *I) {
// FIXME: No atomic loads are supported.
if (cast<LoadInst>(I)->isAtomic())
return false;
// Verify we have a legal type before going any further.
MVT VT;
if (!isLoadTypeLegal(I->getType(), VT))
return false;
// See if we can handle this address.
Address Addr;
... | false | false | false | false | false | 0 |
HtmlCssStringToProperty(z, n)
CONST char *z;
int n;
{
CssToken sToken;
if (n<0) {
n = strlen(z);
}
sToken.z = z;
sToken.n = n;
return tokenToProperty(0, &sToken);
} | false | false | false | false | false | 0 |
rl_invoking_keyseqs_in_map (function, map)
rl_command_func_t *function;
Keymap map;
{
register int key;
char **result;
int result_index, result_size;
result = (char **)NULL;
result_index = result_size = 0;
for (key = 0; key < KEYMAP_SIZE; key++)
{
switch (map[key].type)
{
case ISMACR... | false | false | false | false | false | 0 |
certlist_to_file(char *filename, CertList *certlist)
{
CertList *cl;
BIO *bio_out = NULL;
int ret = -1;
if(filename && (bio_out=BIO_new_file(filename, "w")) != NULL){
ret = 0;
for(cl = certlist; cl; cl = cl->next){
if(cl->name && cl->name[0] && cl->x509_cert){
if(!((BIO_puts(bio_out... | false | false | false | false | false | 0 |
regnext( char* p )
{
const int offset = (((unsigned char*)p)[1] << 8) + ((unsigned char*)p)[2];
if (offset == 0)
return(NULL);
return((OP(p) == BACK) ? p-offset : p+offset);
} | false | false | false | false | false | 0 |
check_delete()
{
// Try remove from signals immidiately, if possible:
if (slot_ref_count == 0 && signal_ref_count > 0)
{
// Prevent recursive looping (and allows us to create a helper CL_Slot object):
slot_ref_count++;
std::list<CL_Signal *> signals = connected_signals;
connected_signals.clear(); // clear m... | false | false | false | false | false | 0 |
encap_prereq_parse(encapinfo_t *pkginfo, char *line)
{
ENCAP_PREREQ *ep;
char *tok, *nextp;
int i;
#ifdef DEBUG
printf("==> encap_prereq_parse(0x%lx, \"%s\")\n", pkginfo, line);
#endif
nextp = line;
do
tok = strsep(&nextp, " \t");
while (tok != NULL && *tok == '\0');
if (tok == NULL)
{
errno = EINVAL;
... | true | true | true | false | false | 1 |
aclParseDomainList(void *curlist)
{
char *t = NULL;
splayNode **Top = curlist;
while ((t = strtokFile())) {
Tolower(t);
t = xstrdup(t);
*Top = splay_insert(t, *Top, aclDomainCompare);
if (splayLastResult == 0)
safe_free(t);
}
} | false | false | false | false | false | 0 |
fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget,
u64 nodeid, u64 nlookup)
{
struct fuse_iqueue *fiq = &fc->iq;
forget->forget_one.nodeid = nodeid;
forget->forget_one.nlookup = nlookup;
spin_lock(&fiq->waitq.lock);
if (fiq->connected) {
fiq->forget_list_tail->next = forget;
fi... | false | false | false | false | false | 0 |
audit_find_parent(struct inode *inode)
{
struct audit_parent *parent = NULL;
struct fsnotify_mark *entry;
entry = fsnotify_find_inode_mark(audit_watch_group, inode);
if (entry)
parent = container_of(entry, struct audit_parent, mark);
return parent;
} | false | false | false | false | false | 0 |
brasero_medium_read_CD_TEXT_block_info (BraseroScsiCDTextData *cd_text,
int current,
int max,
gchar *buffer)
{
while ((current = _next_CD_TEXT_pack (cd_text, current, max)) != -1) {
off_t offset = 0;
if (cd_text->pack [current].type != BRASERO_SCSI_CD_TEXT_BLOCK_SIZE)
continue;
do {
memcpy... | false | true | false | false | false | 1 |
gst_midi_parse_do_play (GstMidiParse * midiparse)
{
GstFlowReturn res;
GList *walk;
guint64 pulse, next_pulse = G_MAXUINT64;
GstClockTime position, next_position;
guint64 tick;
pulse = midiparse->pulse;
position = midiparse->segment.position;
if (midiparse->segment_pending) {
gst_pad_push_event (m... | false | false | false | false | false | 0 |
nilfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
bool excl)
{
struct inode *inode;
struct nilfs_transaction_info ti;
int err;
err = nilfs_transaction_begin(dir->i_sb, &ti, 1);
if (err)
return err;
inode = nilfs_new_inode(dir, mode);
err = PTR_ERR(inode);
if (!IS_ERR(inode)) {
inode->... | false | false | false | false | false | 0 |
scheduled_destroy(const void *vid)
{
unsigned short callno = PTR_TO_CALLNO(vid);
ast_mutex_lock(&iaxsl[callno]);
if (iaxs[callno]) {
ast_debug(1, "Really destroying %d now...\n", callno);
iax2_destroy(callno);
}
ast_mutex_unlock(&iaxsl[callno]);
return 0;
} | false | false | false | false | false | 0 |
MochaCheckCtlBddQuantify( BddNode )
bddnode *BddNode;
{
bddnode *BddReached;
bddnode *BddAssume;
bddnode *BddAssumeNot;
btrtransfunc *BtrTransFunc;
bddassoc *BddAssoc;
bddnode *BddNew;
BtrTransFunc = MochaMochaFigure->BTR_TRANS_FUNC;
BddAssoc = MochaMochaFigure->BDD_ASSO... | false | false | false | false | false | 0 |
gen_load_a(offrel, offset, size)
enum e_offrel offrel;
u_int offset, size;
{
struct slist *s, *s2;
switch (offrel)
{
case OR_PACKET:
s = new_stmt(BPF_LD | BPF_ABS | size);
s->s.k = offset;
break;
case OR_LINK:
s = gen_load_llrel(of... | false | false | false | false | false | 0 |
callbackTimedOut(mail::callback &callback,
const char *errmsg)
{
callback.fail(errmsg ? errmsg:"Server timed out.");
} | false | false | false | false | false | 0 |
autofs_dev_ioctl_sbi(struct file *f)
{
struct autofs_sb_info *sbi = NULL;
struct inode *inode;
if (f) {
inode = file_inode(f);
sbi = autofs4_sbi(inode->i_sb);
}
return sbi;
} | false | false | false | false | false | 0 |
remove_file(struct patch *patch, int rmdir_empty)
{
if (update_index) {
if (remove_file_from_cache(patch->old_name) < 0)
die("unable to remove %s from index", patch->old_name);
cache_tree_invalidate_path(active_cache_tree, patch->old_name);
}
if (!cached) {
if (!unlink(patch->old_name) && rmdir_empty) {
... | false | false | false | false | false | 0 |
MR_dumpTreeF(FILE *f,int depth,Tree *tree,int across)
#else
void MR_dumpTreeF(f,depth,tree,across)
FILE *f;
Tree *tree;
int depth;
int across;
#endif
{
int newAcross=across;
if (tree == NULL ) return;
if (tree->down != NULL ) {
fprintf(output,"\n");
MR_outputIndent(depth);
fpr... | false | false | false | false | false | 0 |
setpath (lua_State *L, const char *fieldname, const char *envname,
const char *def) {
const char *path = getenv(envname);
if (path == NULL) /* no environment variable? */
lua_pushstring(L, def); /* use default */
else {
/* replace ";;" by ";AUXMARK;" and then AUXMARK b... | false | false | false | false | true | 1 |
destroy()
{
if(h_border_template_) delete h_border_template_;
if(v_border_template_) delete v_border_template_;
for(u_int8 i = 0; i< NB_BORDER_IMAGE; i++)
{delete border_[i];delete border_brightness_[i];}
init();
} | false | false | false | false | false | 0 |
calcWidth(bool) {
// Check that above threshold.
if (ps == 0.) return;
// H+- decay to fermions involves running masses.
if (id1Abs < 17 && (id1Abs < 7 || id1Abs > 10)) {
double mRun1 = particleDataPtr->mRun(id1Abs, mHat);
double mRun2 = particleDataPtr->mRun(id2Abs, mHat);
double mrRunDn = po... | false | false | false | false | false | 0 |
setDiskState(const PosChunkIdx& ci, int state)
{
int csi = chunkSetIdx(ci);
if (chunksets[csi] == NULL)
chunksets[csi] = new ChunkSet;
chunksets[csi]->setDiskState(ci, state);
} | false | false | false | false | false | 0 |
set_samples_per_second(SAMPLE_SPECS::sample_rate_t v)
{
ECA_AUDIO_FORMAT::set_samples_per_second(v);
ECA_AUDIO_POSITION::set_samples_per_second(v);
ECA_LOG_MSG(ECA_LOGGER::system_objects,
"set srate, aobj \"" +
name() + ":" + label() +
"\" to " +
kvu_numtostr(v) + ".");
} | false | false | false | false | false | 0 |
theft_mt_reset(struct theft_mt *mt, uint64_t seed)
{
mt->mt[0] = seed;
uint16_t mti = 0;
for (mti=1; mti<NN; mti++) {
mt->mt[mti] = (6364136223846793005ULL *
(mt->mt[mti-1] ^ (mt->mt[mti-1] >> 62)) + mti);
}
mt->mti = mti;
} | false | false | false | false | false | 0 |
hashtable_init( hashtable *ht, int size ) {
int i;
ht->size=0;
for (i=1; i<13; i++ ) {
if ( (1<<i) >= size ) {
ht->bitsize = i;
ht->size = 1<<i;
break;
}
}
size = ht->size;
ht->and_mask = ht->size - 1;
if (ht->size==0)
Error( "Hashtable has size of 0" );
ht->key = (char **)d_malloc( size * siz... | false | false | false | false | false | 0 |
ipAddressPrefixTable_row_prep(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx)
{
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_row_prep", "called\n"));
netsnmp_assert(NULL != rowreq_ctx);
/*
* TODO:390:o: Prepare row for request.
* If populating row data was delayed, this is the pl... | false | false | false | true | false | 1 |
history_do_write (filename, nelements, overwrite)
char *filename;
int nelements, overwrite;
{
register int i;
char *output = history_filename (filename);
int file, mode;
mode = overwrite ? O_WRONLY | O_CREAT | O_TRUNC : O_WRONLY | O_APPEND;
if ((file = open (output, mode, 0666)) == -1)
{
... | false | false | false | false | false | 0 |
authorization_reply(DBusPendingCall *call, void *user_data)
{
struct authorization_data *data = user_data;
DBusMessage *reply;
DBusMessageIter iter;
dbus_bool_t authorized = FALSE;
reply = dbus_pending_call_steal_reply(call);
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
goto done;
if (dbus_m... | false | false | false | false | false | 0 |
max98095_handle_eq_pdata(struct snd_soc_codec *codec)
{
struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
struct max98095_pdata *pdata = max98095->pdata;
struct max98095_eq_cfg *cfg;
unsigned int cfgcnt;
int i, j;
const char **t;
int ret;
struct snd_kcontrol_new controls[] = {
SOC_ENUM_EXT("... | false | false | false | false | false | 0 |
git_signature_dup(const git_signature *sig)
{
git_signature *new;
if (git_signature_new(&new, sig->name, sig->email, sig->when.time, sig->when.offset) < 0)
return NULL;
return new;
} | false | false | false | false | false | 0 |
png_get_iCCP(png_const_structp png_ptr, png_const_infop info_ptr,
png_charpp name, int *compression_type,
png_bytepp profile, png_uint_32 *proflen)
{
png_debug1(1, "in %s retrieval function", "iCCP");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)
&& name != NULL && c... | false | false | false | false | false | 0 |
StrategyInitialize(bool init)
{
bool found;
/*
* Initialize the shared buffer lookup hashtable.
*
* Since we can't tolerate running out of lookup table entries, we must be
* sure to specify an adequate table size here. The maximum steady-state
* usage is of course NBuffers entries, but BufferAlloc() trie... | false | false | false | false | false | 0 |
sha2_hash(const unsigned char data[], unsigned long len, sha2_ctx ctx[1])
{
switch(ctx->sha2_len)
{
case 32: sha256_hash(data, len, CTX_256(ctx)); return;
case 48: sha384_hash(data, len, CTX_384(ctx)); return;
case 64: sha512_hash(data, len, CTX_512(ctx)); return;
}
} | false | false | false | false | false | 0 |
hkl_pseudo_axis_engine_new(char const *name,
size_t n, ...)
{
va_list ap;
size_t i;
HklPseudoAxisEngine *self = NULL;
self = HKL_MALLOC(HklPseudoAxisEngine);
self->name = name;
/* create the pseudoAxes */
HKL_LIST_ALLOC(self->pseudoAxes, n);
va_start(ap, n);
for(i=0; i<n; ++i){
HklParameter paramet... | false | true | false | false | false | 1 |
Imacro_expand1(object exp_fun, object form)
{
return Ifuncall_n(sLAmacroexpand_hookA->s.s_dbind,
3,exp_fun,form,MACRO_EXPAND_ENV);
} | false | false | false | false | false | 0 |
remote_close(RemoteConnection *rc)
{
if (!rc) return;
if (rc->server)
{
remote_server_clients_close(rc);
g_source_remove(rc->channel_id);
unlink(rc->path);
}
if (rc->read_data)
g_free(rc->read_data);
close(rc->fd);
g_free(rc->path);
g_free(rc);
} | false | false | false | false | false | 0 |
test_object_raw_short__oid_shortener_stresstest_git_oid_shorten(void)
{
#define MAX_OIDS 1000
git_oid_shorten *os;
char *oids[MAX_OIDS];
char number_buffer[16];
git_oid oid;
size_t i, j;
int min_len = 0, found_collision;
os = git_oid_shorten_new(0);
cl_assert(os != NULL);
/*
* Insert in the shortener 100... | true | true | false | false | false | 1 |
xaccAccountGetTaxUSCopyNumber (const Account *acc)
{
gint64 copy_number;
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), 1);
copy_number = kvp_frame_get_gint64(acc->inst.kvp_data,
"tax-US/copy-number");
return (copy_number == 0) ? 1 : copy_number;
} | false | false | false | false | false | 0 |
gf_isom_is_omadrm_media(GF_ISOFile *the_file, u32 trackNumber, u32 sampleDescriptionIndex)
{
GF_TrackBox *trak;
GF_ProtectionInfoBox *sinf;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak) return 0;
sinf = gf_isom_get_sinf_entry(trak, sampleDescriptionIndex, GF_ISOM_OMADRM_SCHEME, NULL);
if... | false | false | false | false | false | 0 |
summary_unthread_for_exec_func(GtkCMCTree *ctree, GtkCMCTreeNode *node,
gpointer data)
{
MsgInfo *msginfo;
GtkCMCTreeNode *top_parent;
GtkCMCTreeNode *child;
GtkCMCTreeNode *sibling;
SummaryView * summaryview = (SummaryView *)data;
msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
if (!msginfo ||
(!MS... | false | false | false | false | false | 0 |
cosm_scif_remove(struct scif_peer_dev *spdev)
{
int rc;
dev_dbg(&spdev->dev, "%s %d: dnode %d\n",
__func__, __LINE__, spdev->dnode);
if (spdev->dnode)
return;
if (!IS_ERR_OR_NULL(client_thread)) {
rc = send_sig(SIGKILL, client_thread, 0);
if (rc) {
pr_err("%s %d send_sig rc %d\n",
__func__, ... | false | false | false | false | false | 0 |
PrintString(
void *theEnv,
char *logicalName,
char *str)
{
struct stringRouter *head;
head = FindStringRouter(theEnv,logicalName);
if (head == NULL)
{
SystemError(theEnv,"ROUTER",3);
EnvExitRouter(theEnv,EXIT_FAILURE);
}
if (head->readWriteType != WRITE_STRING) return(1);
... | false | true | false | false | false | 1 |
status_rate(lb_sub_worker_t *wr, status_worker_t *w,
jk_logger_t *l)
{
jk_uint32_t mask = 0;
int activation = wr->activation;
int state = wr->s->state;
jk_uint32_t good = w->good_mask;
jk_uint32_t bad = w->bad_mask;
int rv = 0;
switch (activation)
{
case JK_LB... | false | false | false | false | false | 0 |
_dbus_platform_condvar_new (void)
{
DBusCondVar *pcond;
pthread_condattr_t attr;
int result;
pcond = dbus_new (DBusCondVar, 1);
if (pcond == NULL)
return NULL;
pthread_condattr_init (&attr);
#ifdef HAVE_MONOTONIC_CLOCK
if (have_monotonic_clock)
pthread_condattr_setclock (&attr, CLOCK_MONOTONIC... | false | false | false | false | false | 0 |
IsPmiKey(char * key) {
char strh[5];
if (pmi_debug)
fprintf(stderr, "In: IsPmiKey \n");
strncpy(strh, key, 4);
strh[4]='\0';
if (!strcmp(strh, "PMI_") && (strlen(key) > 4)) {
return 1;
}
/* add code to test special key if needed */
return 0;
} | false | false | false | false | false | 0 |
vmbus_ongpadl_torndown(
struct vmbus_channel_message_header *hdr)
{
struct vmbus_channel_gpadl_torndown *gpadl_torndown;
struct vmbus_channel_msginfo *msginfo;
struct vmbus_channel_message_header *requestheader;
struct vmbus_channel_gpadl_teardown *gpadl_teardown;
unsigned long flags;
gpadl_torndown = (struct... | false | false | false | false | false | 0 |
bm_set_components_argb_32_screen(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte *bv, ubyte *av)
{
if ( *av == 0 ) {
*((unsigned int*)pixel) = (unsigned int)Gr_current_green->mask;
return;
}
*((unsigned int*)pixel) = (unsigned int)(( (int)*rv / Gr_current_red->scale ) << Gr_current_red->shift);
*((unsigned int*)pixe... | false | false | false | false | false | 0 |
conn_read_withlen(Connection *conn)
{
Octstr *result = NULL;
unsigned char lengthbuf[4];
long length = 0; /* for compiler please */
int try, retry;
lock_in(conn);
for (try = 1; try <= 2; try++) {
if (try > 1)
unlocked_read(conn);
do {
retry = 0;
... | false | false | false | false | false | 0 |
check_for_missing_tx_completions(struct ena_adapter *adapter)
{
struct ena_ring *tx_ring;
int i, budget, rc;
/* Make sure the driver doesn't turn the device in other process */
smp_rmb();
if (!test_bit(ENA_FLAG_DEV_UP, &adapter->flags))
return;
if (test_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags))
return;... | false | false | false | false | false | 0 |
create() const
{
return new DcmInputFileStream(filename_.c_str(), offset_);
} | false | false | false | false | false | 0 |
get_max_texture_size (GnomeRRScreen *screen)
{
if (_max_texture_size_cache != -1)
{
return _max_texture_size_cache;
} else {
/*
* Spawn a second process to check the GL texture limits
* We do this across a process boundary to ensure that crashes
* in the GL driver (which are unfortunately common) d... | true | true | false | false | true | 1 |
tr_reallochook (ptr, size, caller)
__ptr_t ptr;
size_t size;
const __ptr_t caller;
{
__ptr_t hdr;
if (ptr == mallwatch)
tr_break ();
Dl_info mem;
Dl_info *info = lock_and_info (caller, &mem);
__free_hook = tr_old_free_hook;
__malloc_hook = tr_old_malloc_hook;
__realloc_hook = tr_old_realloc_hook;
... | false | false | false | false | false | 0 |
genwqe_remove_pinnings(struct genwqe_file *cfile)
{
struct list_head *node, *next;
struct dma_mapping *dma_map;
struct genwqe_dev *cd = cfile->cd;
list_for_each_safe(node, next, &cfile->pin_list) {
dma_map = list_entry(node, struct dma_mapping, pin_list);
/*
* This is not a bug, because a killed processed ... | false | false | false | false | false | 0 |
pool_map(struct dm_target *ti, struct bio *bio)
{
int r;
struct pool_c *pt = ti->private;
struct pool *pool = pt->pool;
unsigned long flags;
/*
* As this is a singleton target, ti->begin is always zero.
*/
spin_lock_irqsave(&pool->lock, flags);
bio->bi_bdev = pt->data_dev->bdev;
r = DM_MAPIO_REMAPPED;
spi... | false | false | false | false | false | 0 |
inf_from_stream(fz_FILE * stream, datafilename_fn_t datafn)
{
struct inputfile *inf;
fc_assert_ret_val(NULL != stream, NULL);
inf = fc_malloc(sizeof(*inf));
init_zeros(inf);
inf->filename = NULL;
inf->fp = stream;
inf->datafn = datafn;
log_debug("inputfile: opened \"%s\" ok", inf_filename(inf));
... | false | false | false | false | false | 0 |
configure(Vector<String> &conf, ErrorHandler *errh)
{
String encap_type;
String use_encap_from;
_snaplen = 2000;
_extra_length = true;
#if CLICK_NS
bool per_node = false;
#endif
if (cp_va_kparse(conf, this, errh,
"FILENAME", cpkP+cpkM, cpFilename, &_filename,
"SNAPLEN", cpkP, cp... | false | false | false | false | false | 0 |
mce_device_create(unsigned int cpu)
{
struct device *dev;
int err;
int i, j;
if (!mce_available(&boot_cpu_data))
return -EIO;
dev = kzalloc(sizeof *dev, GFP_KERNEL);
if (!dev)
return -ENOMEM;
dev->id = cpu;
dev->bus = &mce_subsys;
dev->release = &mce_device_release;
err = device_register(dev);
if (er... | false | false | false | false | false | 0 |
adv_png_write_chunk(adv_fz* f, unsigned type, const unsigned char* data, unsigned size, unsigned* count)
{
unsigned char v[4];
unsigned crc;
be_uint32_write(v, size);
if (fzwrite(v, 4, 1, f) != 1) {
error_set("Error writing the chunk size");
return -1;
}
be_uint32_write(v, type);
if (fzwrite(v, 4, 1, f) !=... | true | true | false | false | false | 1 |
run_etc_imagery(char *pgm, char *group)
{
char buf[1024];
int stat;
/* Eventually this programs should live in $GIS/etc/imagery */
/* sprintf (buf, "%s/etc/imagery/%s %s", G_gisbase(), pgm, group); */
/* but for now they live in etc/ */
sprintf(buf, "%s/etc/%s %s", G_gisbase(), pgm, group);... | true | true | false | false | false | 1 |
log_access(const struct connection *conn, const char *path) {
const struct mg_connection *c = &conn->mg_conn;
FILE *fp = (path == NULL) ? NULL : fopen(path, "a+");
char date[64], user[100];
time_t now;
if (fp == NULL) return;
now = time(NULL);
strftime(date, sizeof(date), "%d/%b/%Y:%H:%M:%S %z", localti... | false | false | false | false | false | 0 |
slotGroupChatPresence(const XMPP::Jid& jid, const XMPP::Status& status)
{
kDebug() << jid.full() << status.status();
if (jid.full() == mPeerJid && !status.isAvailable())
{
emit connectionBroken();
}
} | false | false | false | false | false | 0 |
insertTemplateText ( const Cursor& insertPosition,
const QString &templateString,
const QMap<QString, QString> &initialValues,
TemplateScript* templateScript)
{
QMap<QString,QStrin... | false | false | false | false | false | 0 |
fxt_setupeventsbuffer(fxt_t fxt, struct fxt_evbuf *buffer, long size, int kind)
{
struct fxt_block_ondisk* buf=(struct fxt_block_ondisk*)buffer;
if (sizeof(struct fxt_evbuf) != sizeof(struct fxt_block_ondisk)) {
abort();
}
buf->size=size;
switch (kind) {
case FXT_TRACE_USER_RAW:
buf->type=FXT_BLOCK_TRACES_USE... | false | false | false | false | false | 0 |
savePrescription(const QString &fileName)
{
return drugsIo().savePrescription(drugModel(), d->getXmlExtraData(), fileName);
} | false | false | false | false | false | 0 |
PushDatagram(void)
{
if (datagramSizeSoFar>0)
{
packetsToSendThisUpdateDatagramBoundaries.Push(packetsToSendThisUpdate.Size(), _FILE_AND_LINE_ );
datagramsToSendThisUpdateIsPair.Push(false, _FILE_AND_LINE_ );
RakAssert(BITS_TO_BYTES(datagramSizeSoFar)<MAXIMUM_MTU_SIZE-UDP_HEADER_SIZE);
datagramSizesInB... | false | false | false | false | false | 0 |
p_get_max_rowpage(gint32 act_elems, gint32 cols, gint rows)
{
gint32 l_max_rowpage;
if(cols < 1)
{
l_max_rowpage = (MAX(act_elems, 1) -1);
}
else
{
l_max_rowpage = ((MAX(act_elems, 1) -1) / cols);
}
l_max_rowpage = 1 + (l_max_rowpage - (MAX(rows,1) -1));
return(MAX(l_max_rowpage,1));
} | false | false | false | false | false | 0 |
fso_framework_base_transport_real_setDelegates (FsoFrameworkTransport* base, FsoFrameworkTransportFunc readfunc, void* readfunc_target, FsoFrameworkTransportFunc hupfunc, void* hupfunc_target) {
FsoFrameworkBaseTransport * self;
FsoFrameworkTransportFunc _tmp0_ = NULL;
void* _tmp0__target = NULL;
FsoFrameworkTransp... | false | false | false | false | false | 0 |
open_file(char *keymapname)
{
int maplen=0, FOUND=0;
char omimfile[16];
char *result=NULL;
gchar *cmim;
char *getfilename = strrchr(keymapname, '/');
if (getfilename == NULL)
getfilename = keymapname;
else
getfilename++;
maplen=strlen(getfilename);
strncpy(omimfile,... | true | true | true | false | false | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.