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 |
|---|---|---|---|---|---|---|
wave_get_remaining_time(uint32_t sample, uint32_t* time)
{
double a_time=0;
if (!time || !pa_stream)
{
SHOW("event get_remaining_time> %s\n","audio device not available");
return -1;
}
if (sample > myReadPosition)
{
// TBD: take in account time suplied by portaudio V18 API
... | false | false | false | false | false | 0 |
pygoo_canvas_bounds_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "x1", "y1", "x2", "y2", NULL };
PyGooCanvasBounds *self;
GooCanvasBounds bounds = {0,};
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|dddd:goocanvas.Bound... | false | false | false | false | false | 0 |
srp_login_rsp ( struct srp_device *srpdev,
const void *data, size_t len ) {
const struct srp_login_rsp *login_rsp = data;
/* Sanity check */
if ( len < sizeof ( *login_rsp ) ) {
DBGC ( srpdev, "SRP %p LOGIN_RSP too short (%zd bytes)\n",
srpdev, len );
return -EINVAL;
}
DBGC ( srpdev, "SRP %p ta... | false | false | false | false | false | 0 |
determine_transcripttypes(GtFeatureNode *fn, void *data,
GT_UNUSED GtError *err)
{
SaveExonAndCDSInfo *info = (SaveExonAndCDSInfo*) data;
GT_UNUSED int had_err;
gt_error_check(err);
gt_assert(fn && info);
/* reset exon_features and cds_features */
gt_array_reset(info->ex... | false | false | false | false | false | 0 |
evas_common_font_source_load_complete(RGBA_Font_Source *fs)
{
int error;
FTLOCK();
error = FT_New_Face(evas_ft_lib, fs->file, 0, &(fs->ft.face));
if (error)
{
FTUNLOCK();
fs->ft.face = NULL;
return error;
}
error = FT_Select_Charmap(fs->ft.face, ft_encoding_unicode);
if (error)
... | false | false | false | false | false | 0 |
seq_print_waiting_for_AL(struct seq_file *m, struct drbd_resource *resource, unsigned long now)
{
struct drbd_device *device;
unsigned int i;
seq_puts(m, "minor\tvnr\tage\t#waiting\n");
rcu_read_lock();
idr_for_each_entry(&resource->devices, device, i) {
unsigned long jif;
struct drbd_request *req;
int n = ... | false | false | false | false | false | 0 |
check_sol_packet_for_new_data(
struct ipmi_intf * intf,
struct ipmi_rs *rsp)
{
static uint8_t last_received_sequence_number = 0;
static uint8_t last_received_byte_count = 0;
int new_data_size = 0;
if (rsp &&
(rsp->session.authtype == IPMI_SESSION_AUTHTY... | false | false | false | false | false | 0 |
updateDisplaySegment(dispobj, dsp)
Widget dispobj;
DisplaySegment *dsp;
{
DisplayFragment *dfp = dsp->fragments;
int from;
int x;
while (dfp != NULL) {
if (dsp->redrawpos < dfp->from + dfp->nchars) {
from = (dsp->redrawpos > dfp->from) ? dsp->redrawpos : dfp->from;
x = dfp->region.x;
if... | false | false | false | false | false | 0 |
equal(const GAGenome & c) const {
if(this == &c) return 1;
const GA1DBinaryStringGenome* b = DYN_CAST(const GA1DBinaryStringGenome*,&c);
int eq = 0;
if(b) {
eq = ((nx != b->nx) ? 0 : GABinaryString::equal(*b,0,0,nx));
}
return eq;
} | false | false | false | false | false | 0 |
cvm_module_results(void)
{
int i;
if (postq) {
if (!sql_query_build(postq, &q)) return CVME_GENERAL | CVME_FATAL;
if ((i = sql_post_query(&q)) != 0) return i;
}
/* Credentials accepted */
cvm_fact_username = sql_get_field(1);
cvm_fact_userid = strtol(sql_get_field(2), 0, 10);
cvm_fact_groupid ... | false | false | false | false | false | 0 |
luL(enum usage_level ul, const char *command)
{
int is_my_command = (command && 0 == strcmp(command, "L"));
if (ul == usage_all || !command || is_my_command)
FPS "%-15s List all certs, or print out a single named cert\n",
"-L");
if (ul == usage_selected && !is_my_command)
return;
FPS... | false | false | false | false | false | 0 |
fujitsu_init(void)
{
int ret, result, max_brightness;
if (acpi_disabled)
return -ENODEV;
fujitsu = kzalloc(sizeof(struct fujitsu_t), GFP_KERNEL);
if (!fujitsu)
return -ENOMEM;
fujitsu->keycode1 = KEY_PROG1;
fujitsu->keycode2 = KEY_PROG2;
fujitsu->keycode3 = KEY_PROG3;
fujitsu->keycode4 = KEY_PROG4;
dmi_c... | false | false | false | false | false | 0 |
gst_1394_clock_get_internal_time (GstClock * clock)
{
Gst1394Clock *_1394clock;
GstClockTime result;
guint32 cycle_timer;
guint64 local_time;
_1394clock = GST_1394_CLOCK_CAST (clock);
if (_1394clock->handle != NULL) {
GST_OBJECT_LOCK (clock);
raw1394_read_cycle_timer (_1394clock->handle, &cycle_ti... | false | false | false | false | false | 0 |
splitstring(s, sep, handler)
char* s;
char sep;
void (*handler)();
/* this routine splits the string into fields using semi-colon */
/* and calls handler for each sub-string */
{
char* out;
char* p;
int fieldcoming;
p = s;
fieldcoming = 1;
while (fieldcoming) {
out = p;
while ... | false | false | false | false | false | 0 |
play_game ()
{
fprintf (fp, "A: play_game\n");
extern int board[BOARD_SIZE];
init_game ();
while (game_over () == FALSE && strncmp ("quit", str_buff, 4) != 0) {
struct move mv;
mv.start_pos = 0;
mv.end_pos = 0;
/* Get user's move then parse it from coordinate notati... | false | false | false | false | false | 0 |
on_synchronizedViewCB_toggled()
{
bool in_sync = synchronizedViewCB->isChecked();
restorePB->setEnabled(!in_sync);
applyPB->setEnabled(!in_sync);
okPB->setEnabled(!in_sync);
if (!in_sync)
closePB->setText(qt_("&Cancel"));
else
closePB->setText(qt_("&Close"));
} | false | false | false | false | false | 0 |
camel_pop3_engine_command_new (CamelPOP3Engine *pe,
guint32 flags,
CamelPOP3CommandFunc func,
gpointer data,
GCancellable *cancellable,
GError **error,
... | false | false | false | false | false | 0 |
save_none(Picklerobject *self, PyObject *args)
{
static char none = NONE;
if (self->write_func(self, &none, 1) < 0)
return -1;
return 0;
} | false | false | false | false | false | 0 |
__free_telhdr_tevs(register struct telhdr_t *telp)
{
register i_tev_ndx tevpi, tevp2i;
for (tevpi = telp->te_hdri; tevpi != -1;)
{
tevp2i = __tevtab[tevpi].tenxti;
__free_1tev(tevpi);
tevpi = tevp2i;
}
/* this is needed for timing wheel since, telp not freed */
telp->te_hdri = telp->te_endi = -1;
tel... | false | false | false | false | false | 0 |
xmlrpc_atoi(xmlrpc_env *env, char *str, size_t stringLength,
xmlrpc_int32 min, xmlrpc_int32 max)
{
long i;
char *end;
XMLRPC_ASSERT_ENV_OK(env);
XMLRPC_ASSERT_PTR_OK(str);
/* Suppress compiler warnings. */
i = 0;
/* Check for leading white space. */
if (isspace((int)(str[0... | false | false | false | true | false | 1 |
cciss_cleanup(void)
{
int i;
pci_unregister_driver(&cciss_pci_driver);
/* double check that all controller entrys have been removed */
for (i = 0; i < MAX_CTLR; i++) {
if (hba[i] != NULL) {
dev_warn(&hba[i]->pdev->dev,
"had to remove controller\n");
cciss_remove_one(hba[i]->pdev);
}
}
kthread_stop(... | false | false | false | false | false | 0 |
seq_header(struct seq_file *m)
{
seq_puts(m, "lock_stat version 0.4\n");
if (unlikely(!debug_locks))
seq_printf(m, "*WARNING* lock debugging disabled!! - possibly due to a lockdep warning\n");
seq_line(m, '-', 0, 40 + 1 + 12 * (14 + 1));
seq_printf(m, "%40s %14s %14s %14s %14s %14s %14s %14s %14s %14s %14s "
... | false | false | false | false | false | 0 |
processAutomaton ( const DLVertex& cur )
{
const RAStateTransitions& RST = cur.getRole()->getAutomaton()[cur.getState()];
// for every transition starting from a given state,
// add the role that is accepted by a transition
for ( RAStateTransitions::const_iterator i = RST.begin(), i_end = RST.end(); i < i_end; ++i... | false | false | false | false | false | 0 |
session_is_running(node_rec_t *rec)
{
int nr_found = 0;
if (session_find_by_rec(rec))
return 1;
if (iscsi_sysfs_for_each_session(rec, &nr_found, iscsi_match_session))
return 1;
return 0;
} | false | false | false | false | false | 0 |
squashfs_image(const void *buf, unsigned long long *blocks)
{
const struct squashfs_super_block *sb =
(const struct squashfs_super_block *)buf;
if (sb->s_magic == SQUASHFS_MAGIC
|| sb->s_magic == SQUASHFS_MAGIC_SWAP
|| sb->s_magic == SQUASHFS_MAGIC_LZMA
|| sb->s_magic == SQUASHFS_MAGIC_LZMA_SWAP) {
... | false | false | false | false | false | 0 |
convert_to_16_native_endian_swap_sign( struct xmms_convert_buffers* buf, void **data, int length )
{
uint8_t *input = *data;
uint16_t *output;
int i;
*data = convert_get_buffer( &buf->format_buffer, length * 2 );
output = *data;
for ( i = 0; i < length; i++ )
*output++ = ( *input++ << 8 ... | false | false | false | false | false | 0 |
InitiateMenu(const char *background_name)
{
// Here comes the standard initializer for all the menus and submenus
// of the big escape menu. This prepares the screen, so that we can
// write on it further down.
//
SDL_SetClipRect(Screen, NULL);
if (!strcmp(background_name, "--GAME_BACKGROUND--")) { // Show gam... | false | false | false | false | false | 0 |
p_save_old_frame(GapAnimInfo *ainfo_ptr, GapVinVideoInfo *vin_ptr)
{
/* SAVE of old image image if it has unsaved changes
* (or if Unconditional frame save is forced by gimprc setting)
*/
if(gap_lib_gap_check_save_needed(ainfo_ptr->image_id))
{
if(gap_debug)
{
printf("p_save_old_frame Save re... | false | false | false | false | false | 0 |
iLoadIwiInternal(void)
{
IWIHEAD Header;
ILuint NumMips = 0;
ILboolean HasMipmaps = IL_TRUE;
ILenum Format;
ILubyte Bpp;
if (iCurImage == NULL) {
ilSetError(IL_ILLEGAL_OPERATION);
return IL_FALSE;
}
// Read the header and check it.
if (!iGetIwiHead(&Header))
return IL_FALSE;
if (!iCheckIwi(&Header... | false | false | false | false | false | 0 |
test_test (p_test, pz_test_file)
tTestDesc *p_test;
char* pz_test_file;
{
tSCC cmd_fmt[] =
"file=%s\n\
if ( test %s ) > /dev/null 2>&1\n\
then echo TRUE\n\
else echo FALSE\n\
fi";
char *pz_res;
int res;
static char cmd_buf[4096];
sprintf (cmd_buf, cmd_fmt, pz_test_file, p_test->pz_test_text)... | false | false | false | false | true | 1 |
match_left_bracket(char bracket)
{
int i;
if (strchr(flines[cur_fline + max_displayed_line], bracket) == NULL) {
print_statusline("No bracket in bottom line");
return;
}
bracket = opp_bracket(bracket);
for (i = cur_fline + max_displayed_line; i >= 0; i--) {
if (strchr(flines[i], bracket) != NULL) {
buff... | false | false | false | false | false | 0 |
streamer_write_string (struct output_block *ob,
struct lto_output_stream *index_stream,
const char *string, bool persistent)
{
if (string)
streamer_write_string_with_length (ob, index_stream, string,
strlen (string) + 1,
persistent);
else
streamer_write_char_stream (i... | false | false | false | false | false | 0 |
gnm_expr_entry_set_scg (GnmExprEntry *gee, SheetControlGUI *scg)
{
g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
g_return_if_fail (scg == NULL || IS_SHEET_CONTROL_GUI (scg));
if ((gee->flags & GNM_EE_SINGLE_RANGE) || scg != gee->scg)
gee_rangesel_reset (gee);
gee_detach_scg (gee);
gee->scg = scg;
if (scg) {
g... | false | false | false | true | false | 1 |
rk3x_i2c_handle_write(struct rk3x_i2c *i2c, unsigned int ipd)
{
if (!(ipd & REG_INT_MBTF)) {
rk3x_i2c_stop(i2c, -EIO);
dev_err(i2c->dev, "unexpected irq in WRITE: 0x%x\n", ipd);
rk3x_i2c_clean_ipd(i2c);
return;
}
/* ack interrupt */
i2c_writel(i2c, REG_INT_MBTF, REG_IPD);
/* are we finished? */
if (i2c-... | false | false | false | false | false | 0 |
xlator_fini_rec (xlator_t *xl)
{
xlator_list_t *trav = NULL;
xlator_t *old_THIS = NULL;
GF_VALIDATE_OR_GOTO ("xlator", xl, out);
trav = xl->children;
while (trav) {
if (!trav->xlator->init_succeeded) {
break;
}
... | false | false | false | false | false | 0 |
cogl_object_get_user_data (CoglObject *object, CoglUserDataKey *key)
{
int count;
int i;
count = MIN (object->n_user_data_entries,
COGL_OBJECT_N_PRE_ALLOCATED_USER_DATA_ENTRIES);
for (i = 0; i < count; i++)
{
CoglUserDataEntry *entry = &object->user_data_entry[i];
if (entry->key... | false | false | false | false | false | 0 |
enet_protocol_check_timeouts (ENetHost * host, ENetPeer * peer, ENetEvent * event)
{
ENetOutgoingCommand * outgoingCommand;
ENetListIterator currentCommand;
currentCommand = enet_list_begin (& peer -> sentReliableCommands);
while (currentCommand != enet_list_end (& peer -> sentReliableCommands))
{... | false | false | false | false | false | 0 |
generateTrailerPdf(L_PDF_DATA *lpd)
{
l_int32 i, n, size, linestart;
L_DNA *daloc, *dasize;
/* Let nobj be the number of numbered objects. These numbered
* objects are indexed by their pdf number in arrays naloc[]
* and nasize[]. The 0th object is the 9 byte header. Then
* the... | false | false | false | false | false | 0 |
test_stash_drop__dropping_an_entry_rewrites_reflog_history(void)
{
git_reference *stash;
git_reflog *reflog;
const git_reflog_entry *entry;
git_oid oid;
size_t count;
push_three_states();
cl_git_pass(git_reference_lookup(&stash, repo, "refs/stash"));
cl_git_pass(git_reflog_read(&reflog, stash));
entry = gi... | false | false | false | false | false | 0 |
decode_psp_coordinates(double * lat, double * lon, const char lonbyte)
{
/* This is some sort of 1/2 Polar, 1/2 Cartesian coordinate mess in */
/* the pin file. I really shouldn't have to do this. Zones 02 and 03 */
/* work properly. The other zones are assumptions based on 02 and 03 */
if ((lonbyte == 0x0... | false | false | false | false | false | 0 |
dash_guid(char **str)
{
if (strlen(*str) == NTUNIQUEID_LENGTH) {
char *p = NULL;
/* Add extra room for the dashes */
*str = slapi_ch_realloc(*str, AD_GUID_LENGTH + 1);
/* GUID needs to be in 8-4-4-4-12 format */
p = *str + 23;
memmove(p + 1, *str + 20, 12);
*p = '-';
p = *str + 18;
memmove(p + 1, *s... | false | false | false | false | false | 0 |
Bnet_bddArrayDump(
DdManager * dd /* DD manager */,
BnetNetwork * network /* network whose BDDs should be dumped */,
char * dfile /* file name */,
DdNode ** outputs /* BDDs to be dumped */,
char ** onames /* names of the BDDs to be dumped */,
int noutputs /* number of BDDs to be dumped */,
int dumpFmt /... | false | false | true | false | true | 1 |
command_setcolourbalance(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
if (sd->params.colourBalance.balanceMode == 1) {
int ret;
ret = do_command(gspca_dev, CPIA_COMMAND_SetColourBalance,
1,
sd->params.colourBalance.redGain,
sd->params.colourBalance.greenGain,
sd->p... | false | false | false | false | false | 0 |
jffs2_thread_should_wake(struct jffs2_sb_info *c)
{
int ret = 0;
uint32_t dirty;
int nr_very_dirty = 0;
struct jffs2_eraseblock *jeb;
if (!list_empty(&c->erase_complete_list) ||
!list_empty(&c->erase_pending_list))
return 1;
if (c->unchecked_size) {
jffs2_dbg(1, "jffs2_thread_should_wake(): unchecked_s... | false | false | false | false | false | 0 |
maze_markov_state_build(
struct maze *m,
unsigned int x,
unsigned int y,
struct maze_markov_state_list **expect
)
{
struct maze_markov_state *ret;
if ((ret = maze_markov_state_list_lookup(*expect,x,y)))
;
else if ((!MAZE_IS_VALID_POSITION(m,x,y)) || (!MAZE_GET_SQUARE(m,x,y)))
ret = 0;
else
{
/* neighbo... | false | false | false | false | false | 0 |
scanAndAdd(FWObject *dst,FWObject *source)
{
if (dst==NULL)
{
dst=treeRoot;
walkTree(dstMap,treeRoot);
walkTree(srcMap, source);
}
for (FWObject::iterator i=dst->begin(); i!=dst->end(); i++)
{
FWObject *o1=*i;
if (FWReference::cast(o1)!=NULL)
{
... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__gui__controls__ListBox_GetCell(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance ** row, struct __ecereNameSpace__ecere__com__Instance ** field)
{
struct __ecereNameSpace__ecere__gui__controls__ListBox * __ecerePointer___ecereNameS... | false | false | false | false | false | 0 |
recycle_rx_buf(struct adapter *adap, struct sge_fl *q,
unsigned int idx)
{
struct rx_desc *from = &q->desc[idx];
struct rx_desc *to = &q->desc[q->pidx];
q->sdesc[q->pidx] = q->sdesc[idx];
to->addr_lo = from->addr_lo; /* already big endian */
to->addr_hi = from->addr_hi; /* likewise */
dma_wmb();
to->len_g... | false | false | false | false | false | 0 |
GetRowBottom(int row) const
{
if (row == -1)
return GetColLabelHeight();
return GetSheetRefData()->m_rowEdges.GetMax(row);
} | false | false | false | false | false | 0 |
parseHeaders(FILE* fd, u_int& lineno)
{
fxStackBuffer buf;
fxStr field; // current header field
while (getLine(fd, buf)) {
lineno++;
if (buf.getLength() == 0)
break;
/*
* Collect field name in a canonical format.
* If the line begins with whitespace, then
* it's the continuation of a previo... | false | false | false | false | false | 0 |
sata_link_resume(struct ata_link *link, const unsigned long *params,
unsigned long deadline)
{
int tries = ATA_LINK_RESUME_TRIES;
u32 scontrol, serror;
int rc;
if ((rc = sata_scr_read(link, SCR_CONTROL, &scontrol)))
return rc;
/*
* Writes to SControl sometimes get ignored under certain
* controllers... | false | false | false | false | false | 0 |
CancelDBBackends(Oid databaseid, ProcSignalReason sigmode, bool conflictPending)
{
ProcArrayStruct *arrayP = procArray;
int index;
pid_t pid = 0;
/* tell all backends to die */
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
for (index = 0; index < arrayP->numProcs; index++)
{
int pgprocno = arrayP->pgprocn... | false | false | false | false | false | 0 |
AppendAction(actionType at, int position, const char *data, int lengthData,
bool &startSequence, char *persistantChanges, bool mayCoalesce) {
/* CHANGEBAR end */
EnsureUndoRoom();
//Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, lengthData, currentAction);
//Platform::DebugPrintf("^ %d action %d %d\... | false | false | false | false | false | 0 |
search_constant_real(real __data)
{ int i;
int j;
struct ConstantTable* ptr;
for (i=0; i<constant_number; i++)
{ j = offset[i];
if (j != -1)
{ ptr = &constant_table[j];
if ((ptr->user_allocated == FALSE && ptr->type == TYPE_REAL
&& ptr->val.r =... | false | false | false | false | false | 0 |
toString() const
{
QString ret(m_color + '+');
ret += QString::number(m_score) + " (" + QString::number(m_lowerBound) + " - " + QString::number(m_upperBound) + ')';
return ret;
} | false | false | false | false | false | 0 |
onEnter(FXObject* sender,FXSelector sel,void* ptr){
FXLabel::onEnter(sender,sel,ptr);
if(isEnabled() && (flags&FLAG_PRESSED)) setCheck(TRUE);
return 1;
} | false | false | false | false | false | 0 |
Includes (Connector* c) {
for (CNet* nw = First(); nw != End(); nw = nw->Next()) {
CCnxn* cnxn = nw->Cnxn();
if (cnxn->_lbConn == c || cnxn->_rtConn == c) {
return true;
}
}
return false;
} | false | false | false | false | false | 0 |
gtk_video_unrealize (GtkWidget *widget)
{
GtkVideo *this;
gtk_video_private_t *priv;
g_return_if_fail(widget != NULL);
g_return_if_fail(GTK_IS_VIDEO(widget));
this = (GtkVideo *) widget;
priv = this->priv;
if (priv->screen_blanker_timeout)
{
g_source_remove (priv->screen_blanker_timeou... | false | false | false | false | false | 0 |
e100_enable_irq(struct nic *nic)
{
unsigned long flags;
spin_lock_irqsave(&nic->cmd_lock, flags);
iowrite8(irq_mask_none, &nic->csr->scb.cmd_hi);
e100_write_flush(nic);
spin_unlock_irqrestore(&nic->cmd_lock, flags);
} | false | false | false | false | false | 0 |
printCPUxClock( const char* cmd )
{
int id;
if ( Dirty )
processCpuInfo();
sscanf( cmd + 7, "%d", &id );
output( "%f\n", Clocks[ id ] );
} | false | false | false | false | false | 0 |
almost_sorted_array(data array[], int len, int n, int d) {
int i, j, k;
data tmp;
for (i = 0; i < len; i++)
array[i] = i;
for (i = 0; i < n; i++) {
j = rand() % (len-d);
k = j + (rand() % d);
tmp = array[j];
array[j] = array[k];
array[k] = tmp;
}
} | false | false | false | false | false | 0 |
wiimote_modules_unload(struct wiimote_data *wdata)
{
const __u8 *mods, *iter;
const struct wiimod_ops *ops;
unsigned long flags;
mods = wiimote_devtype_mods[wdata->state.devtype];
spin_lock_irqsave(&wdata->state.lock, flags);
wdata->state.devtype = WIIMOTE_DEV_UNKNOWN;
spin_unlock_irqrestore(&wdata->state.lock... | false | false | false | false | false | 0 |
Next() // get new uniform random number
{
seed1 = 171 * seed1 % 30269;
seed2 = 172 * seed2 % 30307;
seed3 = 170 * seed3 % 30323;
double x = seed1 / 30269.0 + seed2 / 30307.0 + seed3 / 30323.0;
if (x < 1) return x;
else if (x < 2) return x - 1;
else return x - 2;
} | false | false | false | false | false | 0 |
cmp_digest (const unsigned char *digest, size_t digestlen,
int algo, int gigs, int bytes)
{
int idx;
unsigned char *tv_digest;
size_t tv_digestlen = 0;
for (idx=0; testvectors[idx].algo; idx++)
{
if (testvectors[idx].algo == algo
&& testvectors[idx].gigs == gigs
&& tes... | false | false | false | false | false | 0 |
rfc1035_send_udp(int fd, const struct sockaddr *sin, int sin_len,
const char *query, unsigned query_len)
{
if (sox_sendto(fd, (const char *)query, query_len, 0,
sin, sin_len) == query_len)
return (0);
return (-1);
} | false | false | false | false | false | 0 |
anypaper_command_load (AnypaperParameters *parameters)
{
int e=6;
g_print("%s", background_color);
e=option_command();
if (e != 6) parameters->style = e;
if (remaining_args != 0)
{
if (g_file_test(remaining_args[0], G_FILE_TEST_EXISTS)) parameters->file = g_strdup_printf("%s", remaining_args[0]);
else g_print... | false | false | false | false | false | 0 |
pd_get_the_gene_names(bytestring &bs, bytestring &checksum){
GBS_strstruct *names = GBS_stropen(1024);
GBS_strstruct *checksums = GBS_stropen(1024);
GB_ERROR error = 0;
GB_begin_transaction(GLOBAL_gb_main);
const char *use = GENOM_ALIGNMENT; // gene pt server is always build on 'ali_g... | false | false | false | false | false | 0 |
recvEOMBegin(Status& eresult)
{
/*
* We must raise the transmission carrier to mimic the state following ATA.
*/
if (!useV34) {
pause(conf.t2Timer); // T.30 Fig 5.2B requires T2 to elapse
if (!(atCmd(thCmd, AT_NOTHING) && atResponse(rbuf, 0) == AT_CONNECT)) {
eresult = Status(101, "Failure to r... | false | false | false | false | false | 0 |
i8042_probe(struct platform_device *dev)
{
int error;
i8042_platform_device = dev;
if (i8042_reset == I8042_RESET_ALWAYS) {
error = i8042_controller_selftest();
if (error)
return error;
}
error = i8042_controller_init();
if (error)
return error;
#ifdef CONFIG_X86
if (i8042_dritek)
i8042_dritek_ena... | false | false | false | false | false | 0 |
PROCscan()
{
register PROCESS *pp;
register int i;
for (pp = PROCtable, i = PROCtablesize; --i >= 0; pp++)
if (pp->State == PSdead) {
if (pp->Site >= 0)
SITEprocdied(&Sites[pp->Site], pp - PROCtable, pp);
pp->State = PSfree;
}
PROCneedscan = FALSE;
} | false | false | false | false | false | 0 |
Head()
{
ASSERT(m_ListHead);
ModeSet* pNew = new ModeSet(HeadPrintMode());
return pNew;
} | false | false | false | false | false | 0 |
STREAM_handle(STREAM *stream)
{
if (!stream->type)
THROW(E_CLOSED);
if (stream->type->handle)
return (*stream->type->handle)(stream);
else
return (-1);
} | false | false | false | false | false | 0 |
gl_merge_vcard_finalize (GObject *object)
{
glMergeVCard *merge_vcard = GL_MERGE_VCARD (object);
gl_debug (DEBUG_MERGE, "START");
g_return_if_fail (object && GL_IS_MERGE_VCARD (object));
g_free (merge_vcard->priv);
G_OBJECT_CLASS (gl_merge_vcard_parent_class)->finalize (objec... | false | false | false | false | false | 0 |
PR_CExitMonitor(void *address)
{
MonitorCacheEntry **pp, *p;
PRStatus status = PR_SUCCESS;
_PR_LOCK_MCACHE();
pp = LookupMonitorCacheEntry(address);
if (pp != NULL) {
p = *pp;
if (--p->cacheEntryCount == 0) {
/*
** Nobody is using the system monitor. Put it o... | false | false | false | false | false | 0 |
Do()
{
for (Ports::iterator it = _ports.begin(); it != _ports.end(); ++it)
{
Port& port = (*it);
AudioInPort* in = port.mPort;
const CLAM::Audio& so=in->GetAudio();
CLAM_DEBUG_ASSERT(port.mFloatBuffer, "No float buffer");
CLAM_DEBUG_ASSERT(!port.mDoubleBuffer, "There should not be double buffer");
CLAM_D... | false | false | false | false | false | 0 |
gsl_fit_wlinear (const double *x, const size_t xstride,
const double *w, const size_t wstride,
const double *y, const size_t ystride,
const size_t n,
double *c0, double *c1,
double *cov_00, double *cov_01, double *cov_11,
... | false | false | false | false | false | 0 |
gnome_canvas_widget_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
GnomeCanvasWidget *witem;
g_return_if_fail (object != NULL);
g_return_if_fail (GNOME_IS_CANVAS_WIDGET (object))... | false | false | false | false | false | 0 |
plant_death(int scanDensity)
{
int yBase = misc.random(scanDensity);
int xBase = misc.random(scanDensity);
for( int y = yBase; y < max_y_loc; y += scanDensity)
{
for( int x = xBase; x < max_x_loc; x += scanDensity)
{
Location *locPtr = get_loc(x,y);
if( locPtr->is_plant() )
{
char neighbour =0;
... | false | false | false | false | false | 0 |
retrieve_oid_from_reflog(git_oid *oid, git_reference *ref, size_t identifier)
{
git_reflog *reflog;
size_t numentries;
const git_reflog_entry *entry;
bool search_by_pos = (identifier <= 100000000);
if (git_reflog_read(&reflog, git_reference_owner(ref), git_reference_name(ref)) < 0)
return -1;
numentries = git... | false | false | false | false | false | 0 |
f_useoccurrviewname(ID id)
{{
ID kc_selvar_0_1 = phylum_cast<ID>(id);
if ((kc_selvar_0_1->prod_sel() == sel_Id)) {
const uniqID uid = phylum_cast<const impl_ID_Id*>(kc_selvar_0_1)->uniqID_1;
{
IDtype kc_selvar_1_1 = phylum_cast<IDtype>( uid->type );
if ((kc_selvar_1_1->prod_sel() == sel_ITUserRView)) {
... | false | false | false | false | false | 0 |
FillExtensionToLanguageMap(const char* l,
cmMakefile* mf)
{
std::string extensionsVar = std::string("CMAKE_") +
std::string(l) + std::string("_SOURCE_FILE_EXTENSIONS");
std::string exts = mf->GetSafeDefinition(extensionsVar.c_str());
std::vector<std::string> ... | false | false | false | false | false | 0 |
start_monitoring_file_list (NemoDirectory *directory)
{
DirectoryLoadState *state;
if (!directory->details->file_list_monitored) {
g_assert (!directory->details->directory_load_in_progress);
directory->details->file_list_monitored = TRUE;
nemo_file_list_ref (directory->details->file_list);
}
if (directory-... | false | false | false | false | false | 0 |
ProcessSettings(RegisteredPlugins::iterator it)
{
cbDebuggerPlugin *plugin = it->first;
PluginData &data = it->second;
ConfigManager *config = Manager::Get()->GetConfigManager(wxT("debugger_common"));
wxString path = wxT("/sets/") + plugin->GetSettingsName();
wxArrayString configs = config->Enumerat... | false | false | false | false | false | 0 |
removeElementGivenHash(
Hash *pH, /* The pH containing "elem" */
HashElem* elem, /* The element to be removed from the pH */
int h /* Hash value for the element */
){
if( elem->prev ){
elem->prev->next = elem->next;
}else{
pH->first = elem->next;
}
if( elem->next ){
elem... | false | false | false | false | false | 0 |
check_cid(MPI_Comm * c1, MPI_Comm * c2)
{
return (!(((*c1)->c_contextid == (*c2)->c_contextid)
|| ((*c1)->c_contextid == -((*c2)->c_contextid + 1))));
} | false | false | false | false | false | 0 |
ario_audioscrobbler_save_queue (ArioAudioscrobbler *audioscrobbler)
{
ARIO_LOG_FUNCTION_START
char *pathname;
gboolean ret;
GString *string = g_string_new (NULL);
GList *list;
if (!audioscrobbler->priv->queue_changed) {
return TRUE;
}
pat... | false | false | false | false | false | 0 |
parse_memmap_entry(const char *entry, struct memory_range *range)
{
char filename[PATH_MAX];
char *type;
/*
* entry/start
*/
snprintf(filename, PATH_MAX, "%s/%s", entry, "start");
filename[PATH_MAX-1] = 0;
range->start = parse_numeric_sysfs(filename);
if (range->start == ULLONG_MAX)
return -1;
/*
* e... | false | false | false | false | false | 0 |
_adb_connect(const char *service)
{
char tmp[5];
int len;
int fd;
D("_adb_connect: %s\n", service);
len = strlen(service);
if((len < 1) || (len > 1024)) {
strcpy(__adb_error, "service name too long");
return -1;
}
snprintf(tmp, sizeof tmp, "%04x", len);
if (__adb_se... | false | false | false | false | false | 0 |
nes_net_event(struct notifier_block *notifier,
unsigned long event, void *ptr)
{
struct neighbour *neigh = ptr;
struct nes_device *nesdev;
struct net_device *netdev;
struct nes_vnic *nesvnic;
switch (event) {
case NETEVENT_NEIGH_UPDATE:
list_for_each_entry(nesdev, &nes_dev_list, list) {
/* nes_debug(NE... | false | false | false | false | false | 0 |
dump_TAG_ORB_TYPE(const IOP::TaggedComponent& c)
{
OMNIORB_ASSERT(c.tag == IOP::TAG_ORB_TYPE);
cdrEncapsulationStream e(c.component_data.get_buffer(),
c.component_data.length(),1);
CORBA::ULong orb_type;
orb_type <<= e;
CORBA::String_var outstr;
CORBA::ULong len = sizeof("TAG_ORB_TYPE") + 1;
if (or... | false | false | false | false | false | 0 |
get_blob (GITypelib *typelib,
guint32 offset,
GError **error)
{
if (typelib->len < offset + sizeof (CommonBlob))
{
g_set_error (error,
G_TYPELIB_ERROR,
G_TYPELIB_ERROR_INVALID,
"The buffer is too short");
return FALSE;
}
return (CommonBlob *)&typelib->data[offset];
} | false | false | false | false | false | 0 |
ProcessBirdLore(Unit *u,AString *o, OrdersCheck *pCheck )
{
AString *token = o->gettoken();
if (!token) {
u->Error("CAST: Missing arguments.");
return;
}
if (*token == "eagle") {
CastIntOrder *order = new CastIntOrder;
order->spell = S_BIRD_LORE;
order->level = 3;
... | false | false | false | false | false | 0 |
get_module_info_list(Module_table *module_head)
{
Module_table **ma;
List *module_info_list;
List *list = NULL;
int nma, i, total_acc;
ma = get_sorted_module_array(module_head, &nma);
total_acc = (acc_stasche_head != NULL) ?
acc_stasche_head->acc_num : 0;
for (i = nma - 1; i >= 0;... | false | false | false | false | false | 0 |
luaL_traceback (lua_State *L, lua_State *L1,
const char *msg, int level) {
lua_Debug ar;
int top = lua_gettop(L);
int numlevels = countlevels(L1);
int mark = (numlevels > LEVELS1 + LEVELS2) ? LEVELS1 : 0;
if (msg) lua_pushfstring(L, "%s\n", msg);
lua_pushliteral(L, "stack tra... | false | false | false | false | false | 0 |
IsValidRequest(size_t idx,size_t off,size_t len) const
{
return ( idx < BTCONTENT.GetNPieces() &&
len &&
(off + len) <= BTCONTENT.GetPieceLength(idx) &&
len <= cfg_max_slice_size ) ?
1 : 0;
} | false | false | false | false | false | 0 |
fi_tigertree_check(fileinfo_t *fi)
{
if (fi->tigertree.leaves) {
unsigned depth;
struct tth root;
if (NULL == fi->tth) {
g_warning("Trailer contains tigertree but no root hash");
goto discard;
}
depth = tt_depth(fi->tigertree.num_leaves);
if (
fi->file_size_known &&
fi->tigertree.num_leaves ... | false | false | false | false | false | 0 |
poolalloc(size_t length)
{
if(poolindex == -1) { /* initialize*/
memset((void*)pool,0,sizeof(pool));
poolindex = 0;
}
if(poolindex == POOLMAX) poolindex=0;
if(length == 0) length = POOL_DEFAULT;
if(pool[poolindex] != NULL) efree(pool[poolindex]);
pool[poolindex] = (char*)emalloc(length);
r... | false | false | false | false | false | 0 |
_rtl8821ae_iqk_tx_fill_iqc(struct ieee80211_hw *hw,
enum radio_path path, u32 tx_x, u32 tx_y)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
switch (path) {
case RF90_PATH_A:
/* [31] = 1 --> Page C1 */
rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1);
rtl_write_dword(rtlpriv, 0xc90, 0x00000080);
rtl_write_dword... | false | false | false | false | false | 0 |
be_cmd_set_vxlan_port(struct be_adapter *adapter, __be16 port)
{
struct be_port_res_desc port_desc;
memset(&port_desc, 0, sizeof(port_desc));
port_desc.hdr.desc_type = PORT_RESOURCE_DESC_TYPE_V1;
port_desc.hdr.desc_len = RESOURCE_DESC_SIZE_V1;
port_desc.flags = (1 << IMM_SHIFT) | (1 << NOSV_SHIFT);
port_desc.lin... | false | false | false | false | false | 0 |
search_widget_scroll_event (GtkWidget *widget,
GdkEventScroll *event,
GeditViewFrame *frame)
{
if (frame->priv->search_mode == GOTO_LINE)
{
return GDK_EVENT_PROPAGATE;
}
if (event->state & GDK_CONTROL_MASK)
{
if (event->direction == GDK_SCROLL_UP)
... | 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.