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 |
|---|---|---|---|---|---|---|
_dump_v6stats( const char *name, oid *oid_buf, size_t buf_len,
struct stat_table *stable )
{
netsnmp_variable_list *var, *vp;
struct stat_table *sp;
long *stats;
oid stat;
unsigned int max_stat = 0;
int active = 0;
var = NULL;
for (sp=stable; sp->entry; sp++) {... | false | false | false | false | false | 0 |
fcast_get_limit (const char *s, DATASET *dset)
{
double x;
int t, err = 0;
if (gretl_is_scalar(s)) {
x = gretl_scalar_get_value(s, NULL);
} else {
x = generate_scalar(s, dset, &err);
}
if (x < 1 || x > dset->n) {
gretl_error_clear();
gretl_errmsg_set(_("Observation number out of bounds"));... | false | false | false | false | false | 0 |
set_ticks_dialog(GtkWidget* xyplot)
{
GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
GtkWidget* hbox = NULL;
GtkWidget* parentWindow = NULL;
gtk_window_set_title (GTK_WINDOW (window), _("Set ticks"));
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_window_set_modal (GTK_WINDOW (window... | false | false | false | false | false | 0 |
read_write_ped_non_loop(long currentPedigreeId, long *nextPedigreeId,
FILE *outputFile)
{
long PersonInfo; /* individual's information */
int PersonInfoIndex; /* id of individual */
char *rest;
long line[LINEN];
rest = (char *) malloc(pedLineLength * sizeof(char));... | false | true | false | false | false | 1 |
attrToFeedback(fba, attr)
FeedbackAttributes *fba;
int attr;
{
int idx;
if (attr == ICAttrNormalString) return 0;
if (!(attr & ICAttrConverted)) {
/* Not yet converted */
idx = FEEDBACK_NOCONV;
} else if (attr & ICAttrCurrentSegment) {
/* it's converted and the current segment */
idx = FEEDBACK_CU... | false | false | false | false | false | 0 |
set_local_gline(struct Client *source_p, const char *user, const char *host, const char *reason)
{
char buffer[IRCD_BUFSIZE];
struct ConfItem *aconf;
const char *current_date;
char *my_reason;
char *oper_reason;
current_date = smalldate(rb_current_time());
my_reason = LOCAL_COPY(reason);
aconf = make_conf();... | true | true | false | false | false | 1 |
httpd_check_status(void)
{
if (bb_status == BB_SHUTDOWN || bb_status == BB_DEAD)
return octstr_create("Avalanche has already started, too late to "
"save the sheeps");
return NULL;
} | false | false | false | false | false | 0 |
eti_realize (GnomeCanvasItem *item)
{
ETableItem *eti = E_TABLE_ITEM (item);
if (GNOME_CANVAS_ITEM_CLASS (e_table_item_parent_class)->realize)
(*GNOME_CANVAS_ITEM_CLASS (e_table_item_parent_class)->realize)(item);
eti->rows = e_table_model_row_count (eti->table_model);
g_signal_connect (
item->canvas, "scrol... | false | false | false | false | false | 0 |
get_current_time(struct date_time *dt)
{
struct tm tm;
time_t now;
now = time(NULL);
(void)gmtime_r(&now, &tm);
Dmsg6(200, "m=%d d=%d y=%d h=%d m=%d s=%d\n", tm.tm_mon+1, tm.tm_mday, tm.tm_year+1900,
tm.tm_hour, tm.tm_min, tm.tm_sec);
tm_encode(dt, &tm);
#ifdef DEBUG
Dmsg2(200, "jday=%f jmin... | false | false | false | false | false | 0 |
unit_restore_hitpoints(struct unit *punit)
{
bool was_lower;
int save_hp;
struct unit_class *class = unit_class(punit);
struct city *pcity = tile_city(unit_tile(punit));
was_lower = (punit->hp < unit_type(punit)->hp);
save_hp = punit->hp;
if (!punit->moved) {
punit->hp += hp_gain_coord(punit);
}
... | false | false | false | false | false | 0 |
tagsFirst (tagFile *const file, tagEntry *const entry)
{
tagResult result = TagFailure;
if (file != NULL && file->initialized)
{
gotoFirstLogicalTag (file);
result = readNext (file, entry);
}
return result;
} | false | false | false | false | false | 0 |
confirm(void)
{
/* Read values from dialog */
for(int disk = 0; disk < PARTS; disk++) {
strncpy(gui_options.disks[disk].partID, part_id[disk], sizeof(gui_options.disks[disk].partID));
gui_options.disks[disk].present = getSelected(PARTS_PRESENT[disk]);
gui_options.disks[disk].readonly = getSelected(PARTS_READONL... | false | false | false | false | false | 0 |
cavan_font_comp(struct cavan_font *font, byte *buff, size_t size)
{
byte *buff_bak, *buff_end;
const byte *body, *body_end;
if (font == NULL)
{
pr_red_info("font == NULL");
return -EINVAL;
}
body = font->body;
#if 0
body_end = body + font->stride;
#else
body_end = body + font->width * font->height;
#endi... | false | false | false | false | false | 0 |
hardMatrixElementCorrection(bool hard) {
// set the initial enhancement factors for the soft correction
_initialenhance = 1.;
_finalenhance = 1.;
// if hard matrix element switched off return
if(!MECOn()) return;
// see if we can get the correction from the matrix element
// or decayer
if(hard) {
... | false | false | false | false | false | 0 |
write_struct_info (const gchar *namespace,
GIStructInfo *info,
Xml *file)
{
const gchar *name;
const gchar *type_name;
const gchar *type_init;
gboolean deprecated;
gboolean is_gtype_struct;
gboolean foreign;
gint i;
gint size;
int n_elts;
name = g_base_info_get_name ((GIBaseInfo... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
ImportProgressDialog *_t = static_cast<ImportProgressDialog *>(_o);
switch (_id) {
case 0: _t->onImporterFinished(); break;
... | false | false | false | false | false | 0 |
match_ref(int offset, register USPTR eptr, int length, match_data *md,
unsigned long int ims)
{
USPTR p = md->start_subject + md->offset_vector[offset];
#ifdef PCRE_DEBUG
if (eptr >= md->end_subject)
printf("matching subject <null>");
else
{
printf("matching subject ");
pchars(eptr, length, TRUE, md);
}
pr... | false | false | false | false | false | 0 |
auto_unlock_lookup_object (CK_ATTRIBUTE_PTR attrs, CK_ULONG n_attrs)
{
CK_OBJECT_CLASS klass;
gchar *value;
gchar *password;
if (!gkm_attributes_find_ulong (attrs, n_attrs, CKA_CLASS, &klass))
return NULL;
if (klass == CKO_G_COLLECTION)
return auto_unlock_lookup_keyring (attrs, n_attrs);
value = auto_unloc... | false | false | false | false | false | 0 |
MapIdToTextProperty(unsigned long id,
vtkTextProperty *tprop)
{
if (!tprop)
{
vtkErrorMacro(<< "Wrong parameters, one of them is NULL");
return;
}
// The first was set to avoid id = 0
int bits = 1;
// The font family is in 4 bits
// (2 would be enou... | false | false | false | false | false | 0 |
on_cell_TreeView_pseudoAxis_value_edited(Glib::ustring const & spath,
Glib::ustring const & newText)
{
double value;
HklPseudoAxis *pseudo;
Gtk::TreePath path(spath);
Gtk::TreeModel::iterator iter = _pseudoAxis_ListStore->get_iter(path);
Gtk::ListStore::Row row = *(iter);
sscanf(newText.c_str(), "... | false | false | false | false | false | 0 |
WriteXMLAction(std::ostream& fxml)
{
fxml << "\t\t<!-- Meta-information about the build action -->\n";
fxml << "\t\t<Action>\n";
// TargetName
if(!this->OptionTargetName.empty())
{
fxml << "\t\t\t<TargetName>"
<< cmXMLSafe(this->OptionTargetName)
<< "</TargetName>\n";
}
// Lang... | false | false | false | false | false | 0 |
get_current_prompt_level ()
{
return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1);
} | false | false | false | false | false | 0 |
msb_read_oob(struct msb_data *msb, u16 pba, u16 page,
struct ms_extra_data_register *extra)
{
int error;
BUG_ON(!extra);
msb->regs.param.block_address = cpu_to_be16(pba);
msb->regs.param.page_address = page;
msb->regs.param.cp = MEMSTICK_CP_EXTRA;
if (pba > msb->block_count) {
pr_err("BUG: attempt to read be... | false | false | false | false | false | 0 |
nvs_read ( struct nvs_device *nvs, unsigned int address,
void *data, size_t len ) {
size_t frag_len;
int rc;
/* We don't even attempt to handle buffer lengths that aren't
* an integral number of words.
*/
assert ( ( len & ( ( 1 << nvs->word_len_log2 ) - 1 ) ) == 0 );
while ( len ) {
/* Calculate l... | false | true | false | false | true | 1 |
slurm_cred_destroy(slurm_cred_t *cred)
{
if (cred == NULL)
return;
xassert(cred->magic == CRED_MAGIC);
slurm_mutex_lock(&cred->mutex);
#ifndef HAVE_BG
FREE_NULL_BITMAP(cred->job_core_bitmap);
FREE_NULL_BITMAP(cred->step_core_bitmap);
xfree(cred->cores_per_socket);
xfree(cred->job_hostlist);
xfree(cred->sock... | false | false | false | false | false | 0 |
readNextToken(const char *c, int& pos, DcmTagKey& key, Uint32& idx)
{
OFString aString;
int lpos = pos;
int spos = 0;
if (c[lpos]=='\0') return -1; // EOF
if (c[lpos]=='.')
{
++pos;
return 3; // period
}
// look for item index between []
if (c[lpos]=='[')
{
spos = ++lpos;
while ((c[l... | false | false | false | false | false | 0 |
gclue_ipclient_finalize (GObject *gipclient)
{
GClueIpclient *ipclient = (GClueIpclient *) gipclient;
g_clear_object (&ipclient->priv->soup_session);
g_free (ipclient->priv->ip);
G_OBJECT_CLASS (gclue_ipclient_parent_class)->finalize (gipclient);
} | false | false | false | false | false | 0 |
wi_dictionary_data_for_key(wi_dictionary_t *dictionary, void *key) {
_wi_dictionary_bucket_t *bucket;
wi_uinteger_t index;
index = _WI_DICTIONARY_KEY_HASH(dictionary, key) % dictionary->buckets_count;
bucket = _wi_dictionary_bucket_for_key(dictionary, key, index);
if(bucket)
return bucket->data;
return... | false | false | false | false | false | 0 |
glue_ctr_crypt_128bit(const struct common_glue_ctx *gctx,
struct blkcipher_desc *desc, struct scatterlist *dst,
struct scatterlist *src, unsigned int nbytes)
{
const unsigned int bsize = 128 / 8;
bool fpu_enabled = false;
struct blkcipher_walk walk;
int err;
blkcipher_walk_init(&walk, dst, src, nbytes);... | false | false | false | false | false | 0 |
logOps()
{
struct {
u_short op ;
u_long peer ;
long tloc ;
} rec ;
static int ops_cnt = OPS_MAX ;
FILE *fp ;
char ops_file_name[PATH_LEN+LOGIN_LEN],
ops_old_file_name[PATH_LEN+LOGIN_LEN];
rec.op = this_op ;
rec.peer = peer ;
time(&rec.tloc) ;
sprintf(ops_file_name,... | false | false | false | false | false | 0 |
tb_drom_parse_entries(struct tb_switch *sw)
{
struct tb_drom_header *header = (void *) sw->drom;
u16 pos = sizeof(*header);
u16 drom_size = header->data_len + TB_DROM_DATA_START;
while (pos < drom_size) {
struct tb_drom_entry_header *entry = (void *) (sw->drom + pos);
if (pos + 1 == drom_size || pos + entry->l... | false | false | false | false | false | 0 |
hash(char *s, int n)
{
int h = 0, i = 1;
while(*s) h+=*s++*i++;
h%=n;
return h<0?h+n:h;
} | false | false | false | false | false | 0 |
ast_for_except_clause(struct compiling *c, const node *exc, node *body)
{
/* except_clause: 'except' [test ['as' test]] */
REQ(exc, except_clause);
REQ(body, suite);
if (NCH(exc) == 1) {
asdl_seq *suite_seq = ast_for_suite(c, body);
if (!suite_seq)
return NULL;
retu... | false | false | false | false | false | 0 |
da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val)
{
switch (val) {
case 1800:
return DA7219_MICBIAS_1_8V;
case 2000:
return DA7219_MICBIAS_2_0V;
case 2200:
return DA7219_MICBIAS_2_2V;
case 2400:
return DA7219_MICBIAS_2_4V;
case 2600:
return DA7219_MICBIAS_2_6V;
default:
dev_warn(codec->dev,... | false | false | false | false | false | 0 |
usesConstantBus(const MachineRegisterInfo &MRI,
const MachineOperand &MO,
unsigned OpSize) const {
// Literal constants use the constant bus.
if (isLiteralConstant(MO, OpSize))
return true;
if (!MO.isReg() || !MO.isUse())
return false;
... | false | false | false | false | false | 0 |
fresh(term *head, list<term *> rem) {
if(DEBUG) cout << "BUG: match::fresh(): new match created" << endl;
return new match(rule);
} | false | false | false | false | false | 0 |
free_icalcomponent (ECalComponent *comp,
gboolean free)
{
ECalComponentPrivate *priv;
priv = comp->priv;
if (!priv->icalcomp)
return;
/* Free the mappings */
priv->uid = NULL;
priv->status = NULL;
g_slist_foreach (priv->attachment_list, (GFunc) free_attachment, NULL);
g_slist_free (p... | false | false | false | false | false | 0 |
thumb_16bit_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
case PLUS:
case MINUS:
case AND:
case IOR:
case XOR:
return true;
default:
break;
}
return false;
} | false | false | false | false | false | 0 |
corr_hum(long gridsize, double *q, double q_min)
{
long i;
for ( i = 0; i < gridsize; ++i )
{
if ( q[i] < q_min ) q[i] = q_min;
}
} | false | false | false | false | false | 0 |
add_aux_server_list(const char *saddr, turn_server_addrs_list_t *list)
{
if(saddr && list) {
ioa_addr addr;
if(make_ioa_addr_from_full_string((const u08bits*)saddr, 0, &addr)!=0) {
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "Wrong full address format: %s\n",saddr);
} else {
list->addrs = (ioa_addr*)turn_realloc(... | false | false | false | false | false | 0 |
hash_scan_next(hscan_t *scan)
{
hnode_t *next = scan->next; /* 1 */
hash_t *hash = scan->table;
hash_val_t chain = scan->chain + 1;
hash_val_t nchains = hash->nchains;
assert (hash_val_t_bit != 0); /* 2 */
if (next) { /* 3 */
if (next->next) { /* 4 */
scan->next = next->... | false | false | false | false | false | 0 |
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__Button_NotifyClicked__00000007(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * button, int x, int y, unsigned int mods)
{
struct CompilersTab * __ecerePointer_CompilersTab = (struct CompilersTab *)(this ? (((ch... | false | false | false | false | false | 0 |
UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
return;
}
switch (m_uiPhase)
{
case PHASE_FAKE_DEATH:
if (m_uiResurrectTimer < uiDiff)
{
... | false | false | false | false | false | 0 |
newID()
{
if(count_ == INT64_MAX) {
count_ = 0;
}
return ++count_;
}
} | false | false | false | false | false | 0 |
dialog_doc_metadata_init_file_page (DialogDocMetaData *state)
{
g_return_if_fail (state->metadata != NULL);
/* Set up the labels */
dialog_doc_metadata_set_label (state, state->file_name, NULL, TRUE);
dialog_doc_metadata_set_label (state, state->location, NULL, TRUE);
dialog_doc_metadata_set_label (state, state->... | false | false | false | false | false | 0 |
drv_RB_outw(const unsigned int data)
{
static unsigned int port = 0;
/* IOCS0 port number can read from PCI Configuration Space Function 0 (F0) */
/* at index 74h as 16 bit value (see [GEODE] 5.3.1 pg.151 and pg.176 Table 5-29 */
if (port == 0) {
/* get IO permission, here you can't use ioperm command... | false | false | false | false | false | 0 |
httpCreateInheritedAuth(HttpAuth *parent)
{
HttpAuth *auth;
auth = mprAllocObj(HttpAuth, manageAuth);
if (parent) {
if (parent->allow) {
auth->allow = mprCloneHash(parent->allow);
}
if (parent->deny) {
auth->deny = mprCloneHash(parent->deny);
}
... | false | false | false | false | false | 0 |
nes_store_idx_data(struct device_driver *ddp,
const char *buf, size_t count)
{
char *p = (char *)buf;
u32 val;
u32 i = 0;
struct nes_device *nesdev;
if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') {
val = simple_strtoul(p, &p, 16);
list_for_each_entry(nesdev, &nes_dev_list, list) {
if (i == ... | false | false | false | false | false | 0 |
permcat(PermString a, PermString b)
{
if (!a || !b)
return a ? a : b;
unsigned al = a.length();
unsigned bl = b.length();
char *s = new char[al + bl];
memcpy(s, a.c_str(), al);
memcpy(s + al, b.c_str(), bl);
PermString p(s, al + bl);
delete[] s;
return p;
} | false | false | false | false | false | 0 |
kwsalloc (char const *trans)
{
struct kwset *kwset;
kwset = (struct kwset *) malloc (sizeof (struct kwset));
if (!kwset)
return NULL;
obstack_init (&kwset->obstack);
kwset->words = 0;
kwset->trie
= (struct trie *) obstack_alloc (&kwset->obstack, sizeof (struct trie));
if (!kwset->trie)
{
... | false | false | false | false | false | 0 |
prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum)
{
struct arcnet_local *lp = netdev_priv(dev);
struct arc_hardware *hard = &pkt->hard;
int ofs;
arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
lp->next_tx, lp->cur_tx, bufnum);
/* hard header is not included in... | false | false | false | false | false | 0 |
checkEscapeVIQR(UkKeyEvent & ev)
{
if (m_current < 0)
return 0;
WordInfo & entry = m_buffer[m_current];
int escape = 0;
if (entry.form == vnw_v || entry.form == vnw_cv) {
switch (ev.keyCode) {
case '^':
escape = (entry.vnSym == vnl_a || entry.vnSym == vnl_o || entry.v... | false | false | false | false | false | 0 |
oc_qii_state_advance(oc_qii_state *_qd,
const oc_qii_state *_qs,int _qii){
ptrdiff_t bits;
int qi01;
int qi01_count;
int qi12;
int qi12_count;
bits=_qs->bits;
qi01=_qii+1>>1;
qi01_count=_qs->qi01_count;
if(qi01==_qs->qi01){
if(qi01_count>=4129){
bits++;
qi01_co... | false | false | false | false | false | 0 |
rsvg_handle_get_pixbuf_sub (RsvgHandle * handle, const char *id)
{
RsvgDimensionData dimensions;
GdkPixbuf *output = NULL;
cairo_surface_t *surface;
cairo_t *cr;
g_return_val_if_fail (handle != NULL, NULL);
if (!handle->priv->finished)
return NULL;
rsvg_handle_get_dimensions (hand... | false | false | false | false | false | 0 |
_bmsgFind(const char *key) {
static const char me[]="[biff] _bmsgFind";
biffMsg *msg;
unsigned int ii;
if (!key) {
fprintf(stderr, "%s: PANIC got NULL key", me);
return NULL; /* exit(1); */
}
msg = NULL;
if (_bmsgNum) {
for (ii=0; ii<_bmsgNum; ii++) {
if (!strcmp(_bmsg[ii]->key, key)) {... | false | false | false | false | false | 0 |
icmFileMem_seek(
icmFile *pp,
unsigned int offset
) {
icmFileMem *p = (icmFileMem *)pp;
unsigned char *np;
np = p->start + offset;
if (np < p->start || np >= p->end)
return 1;
p->cur = np;
return 0;
} | false | false | false | false | false | 0 |
splicetrie_size (unsigned int *triestart) {
int size;
unsigned int leaf;
int nleaves;
int offseta, offsetc, offsetg, offsett;
if (single_leaf_p(leaf = triestart[0])) {
return 1;
} else if (multiple_leaf_p(leaf)) {
nleaves = (int) (-leaf);
return nleaves;
} else {
#ifdef USE_2BYTE_RELOFFSETS... | false | false | false | false | false | 0 |
grab_local_todo_block (gen_workspace *ws)
{
bdescr *bd;
bd = ws->todo_overflow;
if (bd != NULL)
{
ws->todo_overflow = bd->link;
bd->link = NULL;
ws->n_todo_overflow--;
return bd;
}
bd = popWSDeque(ws->todo_q);
if (bd != NULL)
{
ASSERT(bd->link == NULL);
retur... | false | false | false | false | false | 0 |
shrink() {
world.clear() ;
vector<ndd> oseq = seq ;
seq.clear() ;
cache.clear() ;
nodeseq = 0 ;
curndd = recreate(oseq, curndd, neighborhood_size) ;
cerr << "Shrunk from " << oseq.size() << " to " << seq.size() << endl ;
shrinksize = (int)(seq.size() * 2) ;
} | false | false | false | false | false | 0 |
textfeature(int type, char *s)
/* called while parsing abc - stores an item which requires an */
/* associared string */
{
atext[ntexts] = addstring(s);
addfeature(type, ntexts, 0, 0);
ntexts = ntexts + 1;
if (ntexts >= maxtexts) {
maxtexts = textextend(maxtexts, &atext);
};
} | false | false | false | false | false | 0 |
gst_gdp_pay_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstGDPPay *this;
#if 0
GstCaps *caps;
#endif
GstBuffer *outbuffer;
GstFlowReturn ret;
this = GST_GDP_PAY (parent);
/* we should have received a new_segment before, otherwise it's a bug.
* fake one in that case */
if (!this->ne... | false | false | false | false | false | 0 |
build_cache(ARTICLE **arts, long n_arts)
{
char message[128], *msg_end;
MimeArg args[N_ARGS + 1];
char type[128], subtype[128];
char *headers[2];
char command[256];
char *reply = "", *c, *p;
long i, j;
strcpy(message, "Building message/partial cache... ");
msg_end = message + strle... | false | false | false | false | true | 1 |
png_write_PLTE(png_structp png_ptr, png_const_colorp palette,
png_uint_32 num_pal)
{
png_uint_32 i;
png_const_colorp pal_ptr;
png_byte buf[3];
png_debug(1, "in png_write_PLTE");
if ((
#ifdef PNG_MNG_FEATURES_SUPPORTED
!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
#endif
... | false | false | false | false | false | 0 |
rev_list_view_button_press (GtkWidget *widget,
GdkEventButton *event)
{
GiggleRevListViewPriv *priv;
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreePath *path;
GtkTreeIter iter;
GiggleRevision *revision;
if (gdk_event_triggers_context_menu ((G... | false | false | false | false | false | 0 |
Scm_SocketAccept(ScmSocket *sock)
{
Socket newfd;
struct sockaddr_storage addrbuf;
socklen_t addrlen = sizeof(addrbuf);
ScmSocket *newsock;
ScmClass *addrClass = Scm_ClassOf(SCM_OBJ(sock->address));
CLOSE_CHECK(sock->fd, "accept from", sock);
SCM_SYSCALL(newfd, accept(sock->fd, (struct sock... | false | false | false | false | false | 0 |
index_lookup(IndexReader *map,const char *term) {
int hits;
struct LookupStruct ls;
RegionList *l;
SGREPDATA(map);
/* Initialize LookupStruct */
ls.sgrep=sgrep;
ls.map=map;
ls.stop_words=0;
if (sgrep->progress_output) {
SgrepString *s=new_string(sgrep,max_term_len);
string_cat_es... | false | false | false | false | false | 0 |
getGraphicLayerRecommendedDisplayValueRGB(size_t idx, Uint16& r, Uint16& g, Uint16& b)
{
DVPSGraphicLayer *layer = getGraphicLayer(idx);
if (layer) return layer->getGLRecommendedDisplayValueRGB(r, g, b); else return EC_IllegalCall;
} | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdf5lib_H5_H5Literate_1by_1name
(JNIEnv *env, jclass clss, jint grp_id, jstring name, jint idx_type, jint order,
jlong idx, jobject callback_op, jobject op_data, jint access_id)
{
jboolean isCopy;
char *lName;
hsize_t start_idx = (hsize_t)... | false | false | false | false | false | 0 |
rotate (float angle) // degrees, I assume
{
float cos_angle = static_cast<float>(cos ((static_cast<double>(angle) * UT_PI) / 180.0));
float sin_angle = static_cast<float>(sin ((static_cast<double>(angle) * UT_PI) / 180.0));
UT_SVGMatrix rotation(cos_angle, sin_angle, -sin_angle, cos_angle, 0, 0);
return multi... | false | false | false | false | false | 0 |
save_24 (SDL_RWops *dst, int width, int height,
int pitch, Uint8* buffer)
{
int x, y, c;
Uint8 *line;
line = (Uint8 *) malloc (width);
for (y = 0; y < height; ++y) {
for (c = 2; c >= 0; --c) {
for (x = 0; x < width; ++x) {
line[x] = buffer[(3*x) + c];
}
writeline (dst, line, widt... | false | false | false | false | false | 0 |
get_new_reconnect_ivl ()
{
#if defined ZMQ_HAVE_WINDOWS
int pid = (int) GetCurrentProcessId ();
#else
int pid = (int) getpid ();
#endif
// The new interval is the current interval + random value.
int this_interval = current_reconnect_ivl +
((pid * 13) % options.reconnect_ivl);
// Only ch... | false | false | false | false | false | 0 |
snd_ac97_ad18xx_update_pcm_bits(struct snd_ac97 *ac97, int codec, unsigned short mask, unsigned short value)
{
int change;
unsigned short old, new, cfg;
mutex_lock(&ac97->page_mutex);
old = ac97->spec.ad18xx.pcmreg[codec];
new = (old & ~mask) | (value & mask);
change = old != new;
if (change) {
mutex_lock(&ac... | false | false | false | false | false | 0 |
AnswerLocalOnlyQuestionWithResourceRecord(mDNS *const m, DNSQuestion *q, AuthRecord *rr, mDNSBool AddRecord)
{
// Indicate that we've given at least one positive answer for this record, so we should be prepared to send a goodbye for it
if (AddRecord) rr->AnnounceCount = InitialAnnounceCount - 1;
m->mDNS_reentrancy+... | false | false | false | false | false | 0 |
usbhsf_rx_irq_ctrl(struct usbhs_pipe *pipe, int enable)
{
usbhsf_irq_ready_ctrl(pipe, enable);
} | false | false | false | false | false | 0 |
doinit() {
// call the base class
HwMEBase::doinit();
// get the vedrtex pointers from the SM object
tcHwSMPtr hwsm= dynamic_ptr_cast<tcHwSMPtr>(standardModel());
// do the initialisation
if(hwsm) {
_qqgvertex = hwsm->vertexFFG();
_gggvertex = hwsm->vertexGGG();
_ggggvertex = hwsm->vertexGGGG()... | false | false | false | false | false | 0 |
propfind_calcompset(const xmlChar *name, xmlNsPtr ns,
struct propfind_ctx *fctx,
xmlNodePtr resp __attribute__((unused)),
struct propstat propstat[],
void *rock __attribute__((unused)))
{
const char *prop_annot = ANNOT_NS "CALDAV:supported-calendar-component-set";
struct ... | false | false | false | false | false | 0 |
insert_date_time_common (WBCGtk *wbcg, gboolean do_date, gboolean do_time)
{
if (wbcg_edit_start (wbcg, FALSE, FALSE)) {
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
SheetView *sv = wb_control_cur_sheet_view (wbc);
Sheet *sheet = sv_sheet (sv);
GnmCell const *cell = sheet_cell_fetch (sheet,
sv->edit_... | false | false | false | false | false | 0 |
print_ada_methods (pretty_printer *buffer, tree node,
int (*cpp_check)(tree, cpp_operation), int spc)
{
tree tmp = TYPE_METHODS (node);
int res = 1;
if (tmp)
{
pp_semicolon (buffer);
for (; tmp; tmp = TREE_CHAIN (tmp))
{
if (res)
{
pp_newline (buffer);
pp_newline (buf... | false | false | false | false | false | 0 |
nv_bck_word(cap)
cmdarg_T *cap;
{
cap->oap->motion_type = MCHAR;
cap->oap->inclusive = FALSE;
curwin->w_set_curswant = TRUE;
if (bck_word(cap->count1, cap->arg, FALSE) == FAIL)
clearopbeep(cap->oap);
#ifdef FEAT_FOLDING
else if ((fdo_flags & FDO_HOR) && KeyTyped && cap->oap->op_type == OP_NOP)
... | false | false | false | false | false | 0 |
delRow(row_type row)
{
if (nrows() == 1)
return;
cells_type::iterator it = cells_.begin() + row * ncols();
cells_.erase(it, it + ncols());
vector<CellInfo>::iterator jt = cellinfo_.begin() + row * ncols();
cellinfo_.erase(jt, jt + ncols());
rowinfo_.erase(rowinfo_.begin() + row);
} | false | false | false | false | false | 0 |
e_cal_get_attachments_for_comp (ECal *ecal,
const gchar *uid,
const gchar *rid,
GSList **list,
GError **error)
{
g_return_val_if_fail (E_IS_CAL (ecal), FALSE);
g_return_val_if_fail (uid != N... | false | false | false | false | false | 0 |
set_hpage_sizes(const char *env)
{
char *pos;
long size;
char *key;
char keys[5] = { "R\0" "W\0" "\0" };
/* For each key in R,W */
for (key = keys; *key != '\0'; key += 2) {
pos = strcasestr(env, key);
if (!pos)
continue;
if (*(++pos) == '=') {
size = parse_page_size(pos + 1);
if (size == -1)
... | false | false | false | false | false | 0 |
compose_register_draft(MsgInfo *info)
{
gchar *filepath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
DRAFTED_AT_EXIT, NULL);
FILE *fp = g_fopen(filepath, "ab");
if (fp) {
fprintf(fp, "%s\t%d\n", folder_item_get_identifier(info->folder),
info->msgnum);
fclose(fp);
}
g_free(filepath);
} | false | false | false | false | false | 0 |
select(double rnd) {
// No need to choose if no paths have been constructed.
if ( goodBranches.empty() && badBranches.empty() ) return this;
// Choose amongst paths allowed by projections.
double sum = 0.;
map<double, History*> selectFrom;
if ( !goodBranches.empty() ) {
selectFrom = goodBranches;
... | false | false | false | false | false | 0 |
glade_property_dup_impl (GladeProperty * template_prop, GladeWidget * widget)
{
GladeProperty *property;
property = g_object_new (GLADE_TYPE_PROPERTY,
"class", template_prop->priv->klass,
"i18n-translatable", template_prop->priv->i18n_translatable,
"i18n... | false | false | false | false | false | 0 |
VerifyAll(const QVector<QSharedPointer<AsymmetricKey> > &keys,
const QVector<QVector<QByteArray> > &onion, QBitArray &bad) const
{
if(keys.count() != onion.count() - 1) {
qWarning() << "Incorrect key to onion layers ratio: " << keys.count() <<
":" << onion.count();
return false;
}
... | false | false | false | false | false | 0 |
gtk_widget_set_text_color(GtkWidget *widget, GdkColor *color)
{
//GtkStyle *wstyle;
GtkRcStyle *rcstyle;
GtkStateType state = GTK_STATE_NORMAL;
GtkRcFlags component = GTK_RC_TEXT;
//int i;
rcstyle = gtk_widget_get_modifier_style(widget);
//for (i=0; i<5; i++)
// TRACE("%d %3d.%3d.%3d.%... | false | false | false | false | false | 0 |
_movepv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
const char *name;
if (!(name = lv_move_pv_dup(mem, lv)))
dm_report... | false | false | false | false | false | 0 |
v4l_stop( IDirectFBVideoProvider_V4L_data *data, bool detach )
{
CoreSurface *destination;
D_DEBUG( "DirectFB/Video4Linux: %s...\n", __FUNCTION__ );
pthread_mutex_lock( &data->lock );
if (!data->running) {
pthread_mutex_unlock( &data->lock );
return DFB_OK;
}
if (da... | false | false | false | false | false | 0 |
sccb_reg_read(struct gspca_dev *gspca_dev, u16 reg)
{
ov534_reg_write(gspca_dev, OV534_REG_SUBADDR, reg);
ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_2);
if (!sccb_check_status(gspca_dev))
pr_err("sccb_reg_read failed 1\n");
ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_READ_2);
if... | false | false | false | false | false | 0 |
egtb_block_getsize (tbkey_t key, index_t idx)
{
index_t blocksz = (index_t) dtm_cache.entries_per_block;
index_t maxindex = egkey[key].maxindex;
index_t block, offset, x;
assert (dtm_cache.entries_per_block <= MAXINDEX_T);
assert (0 <= idx && idx < maxindex);
assert (key < MAX_EGKEYS);
block = idx / blocksz;... | false | false | false | false | false | 0 |
e_ews_attachment_info_get_uri (EEwsAttachmentInfo *info)
{
g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (info->type == E_EWS_ATTACHMENT_INFO_TYPE_URI, NULL);
return info->data.uri;
} | false | false | false | false | false | 0 |
Pixel_figure_preview_xorback(word x_pos,word y_pos,__attribute__((unused)) byte color)
{
if ( (x_pos>=Limit_left) &&
(x_pos<=Limit_right) &&
(y_pos>=Limit_top) &&
(y_pos<=Limit_bottom) )
Pixel_preview(x_pos,y_pos,~Screen_backup[x_pos+y_pos*Main_image_width]);
} | false | false | false | false | false | 0 |
InitDict(struct psdict *dict,char *line) {
while ( *line!='/' && *line!='\0' ) ++line;
while ( !isspace(*line) && *line!='\0' ) ++line;
dict->cnt += strtol(line,NULL,10);
if ( dict->next>0 ) { int i; /* Shouldn't happen, but did in a bad file */
dict->keys = realloc(dict->keys,dict->cnt*sizeof(char *)... | false | false | false | false | false | 0 |
get_best_line(unsigned int depth, char c) const
{
std::ostringstream ss;
Board board = tree.get_rootboard();
Move mov = tree[0]->get_best();
ss << board.get_moveno() << ". ";
if (board.get_side() == BLACK) {
ss << "... ";
}
ss << mov.san(board);
if (c == '+') {
ss << "!!";
} else if (c == '-') {
ss ... | false | false | false | false | false | 0 |
cmd_http_txreq(CMD_ARGS)
{
struct http *hp;
const char *req = "GET";
const char *url = "/";
const char *proto = "HTTP/1.1";
const char *body = NULL;
(void)cmd;
(void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
ONLY_CLIENT(hp, av);
assert(!strcmp(av[0], "txreq"));
av++;
VSB_clear(hp->vsb);
for(; *av != N... | false | false | false | false | false | 0 |
imap_fetch_envelope(mailmessage * msg_info,
struct mailimf_fields ** result)
{
int r;
struct mailimap_set * set;
struct mailimap_fetch_att * fetch_att;
struct mailimap_fetch_type * fetch_type;
clist * fetch_result;
struct mailimap_msg_att * msg_att;
int res;
struct mailimf_fields * fields;
s... | false | false | false | false | false | 0 |
__bond_opt_set(struct bonding *bond,
unsigned int option, struct bond_opt_value *val)
{
const struct bond_opt_value *retval = NULL;
const struct bond_option *opt;
int ret = -ENOENT;
ASSERT_RTNL();
opt = bond_opt_get(option);
if (WARN_ON(!val) || WARN_ON(!opt))
goto out;
ret = bond_opt_check_deps(bond, o... | false | false | false | false | false | 0 |
mx_focus_manager_focused_mapped_cb (ClutterActor *focused,
GParamSpec *pspec,
MxFocusManager *manager)
{
MxFocusManagerPrivate *priv = manager->priv;
if (CLUTTER_ACTOR_IS_MAPPED (focused))
return;
/* We can't refocus straight away... | false | false | false | false | false | 0 |
read_message_file(MessageFile *MessageFileptr)
{
struct stat sb;
struct tm *local_tm;
/* used to clear out old MessageFile entries */
MessageFileLine *mptr = 0;
MessageFileLine *next_mptr = 0;
/* used to add new MessageFile entries */
MessageFileLine *newMessageLine = 0;
MessageFileLine *currentMessag... | 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.