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 |
|---|---|---|---|---|---|---|
omninet_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count)
{
struct usb_serial *serial = port->serial;
struct usb_serial_port *wport = serial->port[1];
struct omninet_data *od = usb_get_serial_port_data(port);
struct omninet_header *header = (struct omninet_header... | false | false | false | false | false | 0 |
reg_r(struct gspca_dev *gspca_dev, u16 reg)
{
struct usb_device *udev = gspca_dev->dev;
int ret;
if (gspca_dev->usb_err < 0)
return 0;
ret = usb_control_msg(udev,
usb_rcvctrlpipe(udev, 0),
0x01,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0x00, reg, gspca_dev->usb_buf, 1,... | false | false | false | false | false | 0 |
average_add(struct average *avg, s16 val)
{
avg->sum -= avg->entries[avg->pos];
avg->sum += val;
avg->entries[avg->pos++] = val;
if (unlikely(avg->pos == AVG_ENTRIES)) {
avg->init = 1;
avg->pos = 0;
}
} | false | false | false | false | false | 0 |
get_timeout_interval(void)
{
const char *svalue;
get_pref(PREF_TIME, NULL, &svalue);
if (strstr(svalue,"%S"))
return CLOCK_TICK;
else
return 60*CLOCK_TICK;
} | false | false | false | false | false | 0 |
fso_framework_bin_builder_uint32_convert (FsoFrameworkBinBuilder* self, guint32 val) {
guint32 result = 0U;
GDataStreamByteOrder _tmp0_ = 0;
g_return_val_if_fail (self != NULL, 0U);
_tmp0_ = self->priv->_endianess;
if (_tmp0_ == G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN) {
guint32 _tmp1_ = 0U;
guint32 _tmp2_ = 0U;
... | false | false | false | false | false | 0 |
ldrd_strd_offset_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (const_int_operand (op, mode)) && (
#line 170 "../../src/gcc/config/arm/predicates.md"
(TARGET_LDRD && offset_ok_for_ldrd_strd (INTVAL (op))));
} | false | false | false | false | false | 0 |
simplify(const Expr& e) {
//TODO: add to interactive interface
return simplifyThm(e).getRHS();
} | false | false | false | false | false | 0 |
mixer_set_sample_frequency(int ch, int freq)
{
struct mixer_channel_data *channel = &mixer_channel[ch];
assert( !channel->is_stream );
if (channel->is_playing) {
mixerlogerror(("Mixer:mixer_set_sample_frequency(%s,%d)\n",channel->name,freq));
mixer_update_channel(channel, sound_scalebufferpos(samples... | false | false | false | false | false | 0 |
notifyDisplaySizeChanged(const Size& size)
{
d_horzScaling = size.d_width / d_nativeHorzRes;
d_vertScaling = size.d_height / d_nativeVertRes;
if (d_autoScale)
updateFont();
} | false | false | false | false | false | 0 |
xmmsc_playlist_insert_args (xmmsc_connection_t *c, const char *playlist, int pos, const char *url, int numargs, const char **args)
{
xmmsc_result_t *res;
char *enc_url;
x_check_conn (c, NULL);
x_api_error_if (!url, "with a NULL url", NULL);
enc_url = _xmmsc_medialib_encode_url_old (url, numargs, args);
if (!enc... | false | false | false | false | false | 0 |
Do(OBBase* pOb, const char* OptionText, OpMap* pmap, OBConversion* pConv=NULL)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(!pmol)
return false;
if(pConv->IsFirstInput())
{
pConv->AddOption("writeconformers", OBConversion::GENOPTIONS);
rmsd_cutoff = 0.5;
energy_cutoff = 50.0;... | false | false | false | false | false | 0 |
ssl_ConfigSecureServer(sslSocket *ss, CERTCertificate *cert,
const CERTCertificateList *certChain,
ssl3KeyPair *keyPair, SSLKEAType kea)
{
CERTCertificateList *localCertChain = NULL;
sslServerCerts *sc = ss->serverCerts + kea;
/* load the server certificate */... | false | false | false | false | false | 0 |
sepdp_get_tag_file(const pdp_ctx_t* ctx, unsigned int index,
void *buf, unsigned int *len)
{
pdp_sepdp_tag_t **tag_ptr = (pdp_sepdp_tag_t **) buf;
pdp_sepdp_tag_t *tag = NULL;
static FILE* tagfile = NULL;
unsigned char *data = NULL;
unsigned int data_len = 0;
int status =... | false | false | false | false | true | 1 |
really_clear_connection(connecttab * c, struct timeval *tvP)
{
stats_bytes += c->hc->bytes_sent;
if (c->conn_state != CNST_PAUSING)
fdwatch_del_fd(c->hc->conn_fd);
httpd_close_conn(c->hc, tvP);
clear_throttles(c, tvP);
if (c->linger_timer != (Timer *) 0) {
tmr_cancel(c->linger_timer);
c->linger_timer = 0;
}... | false | false | false | false | false | 0 |
rend_client_report_intro_point_failure(extend_info_t *failed_intro,
const rend_data_t *rend_query,
unsigned int failure_type)
{
int i, r;
rend_cache_entry_t *ent;
connection_t *conn;
r = rend_cache_lookup_entry(rend_query->onion_addr... | false | false | false | false | false | 0 |
Vect_cidx_find_next(struct Map_info *Map, int field_index, int cat,
int type_mask, int start_index, int *type, int *id)
{
int *catp, cat_index;
struct Cat_index *ci;
G_debug(3,
"Vect_cidx_find_next() cat = %d, type_mask = %d, start_index = %d",
cat, type_mask, start_index);
check_statu... | false | false | false | false | false | 0 |
remove_file_source (FileSource *source, gboolean abort_transfers)
{
FileteaNode *self = FILETEA_NODE (source->node);
g_hash_table_remove (self->priv->sources_by_id, source->id);
if (abort_transfers)
{
/* @TODO */
}
} | false | false | false | false | false | 0 |
drxk_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{
struct drxk_state *state = fe->demodulator_priv;
u16 err;
dprintk(1, "\n");
if (state->m_drxk_state == DRXK_NO_DEV)
return -ENODEV;
if (state->m_drxk_state == DRXK_UNINITIALIZED)
return -EAGAIN;
dvbtqam_get_acc_pkt_err(state, &err);
*ucblocks = ... | false | false | false | false | false | 0 |
ipw_ethtool_set_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 * bytes)
{
struct ipw_priv *p = libipw_priv(dev);
int i;
if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE)
return -EINVAL;
mutex_lock(&p->mutex);
memcpy(&p->eeprom[eeprom->offset], bytes, eeprom->len);
for (i = 0; i ... | false | false | false | false | false | 0 |
StartRestoreBlob(ArchiveHandle *AH, Oid oid, bool drop)
{
bool old_blob_style = (AH->version < K_VERS_1_12);
Oid loOid;
AH->blobCount++;
/* Initialize the LO Buffer */
AH->lo_buf_used = 0;
ahlog(AH, 1, "restoring large object with OID %u\n", oid);
/* With an old archive we must do drop and create logic he... | false | false | false | false | false | 0 |
drawArcAsBezier(double alpha)
{
// Vector p0(1.0, 0.0);
Vector p1(1.0, BETA);
Vector p2(BETA, 1.0);
Vector p3(0.0, 1.0);
Vector q1(-BETA, 1.0);
Vector q2(-1.0, BETA);
Vector q3(-1.0, 0.0);
double begAngle = 0.0;
if (alpha > IpeHalfPi) {
curveTo(p1, p2, p3);
begAngle = IpeHalfPi;
}
if (alp... | false | false | false | false | false | 0 |
GetLoginName()
{
char* login_name;
if (!(login_name = getenv("LOGNAME"))
&& !(login_name = getlogin())
&& !(login_name = getenv("USER"))) {
struct passwd * passwd_entry = getpwuid(getuid());
if (!passwd_entry) passwd_entry = getpwuid(geteuid());
login_name = passwd_entry ? passwd_e... | false | false | false | false | false | 0 |
mps_route_wpt_w_unique_wrapper(const waypoint* wpt)
{
waypoint* wptfound = NULL;
/* Search for this waypoint in the ones already written */
wptfound = mps_find_wpt_q_by_name(&written_wpt_head, wpt->shortname);
if (wptfound == NULL)
/* so, not a real wpt, so must check route wpts already written as reals */... | false | false | false | false | false | 0 |
modem_hw_off(const char* pm_base_dir)
{
LOG(LOG_DEBUG, "Enter");
SYSCHECK(modem_hw_(pm_base_dir, "power_on", 0));
SYSCHECK(modem_hw_(pm_base_dir, "reset", 0));
LOG(LOG_DEBUG, "Leave");
return 0;
} | false | false | false | false | false | 0 |
getAllNames() const
{
OFVector<tstring> tmp;
{
thread::MutexGuard guard (mutex);
for(ObjectMap::const_iterator it=data.begin(); it!=data.end(); ++it)
tmp.push_back( (*it).first );
}
return tmp;
} | false | false | false | false | false | 0 |
slotSignFile()
{
if (!m_keysRead || m_gpgRunning) {
QTimer::singleShot(5, this, SLOT(slotSignFile()));
return;
}
QStringList secretKeys;
for (QMap<QString, KeyStruct>::Iterator it = m_keys.begin(); it != m_keys.end(); ++it) {
if (it.value().secret)
secretKeys.append(... | false | false | false | false | false | 0 |
job_container_init(void)
{
int retval = SLURM_SUCCESS;
char *plugin_type = "job_container";
char *container_plugin_type = NULL;
char *last = NULL, *job_container_plugin_list, *job_container = NULL;
if (init_run && (g_container_context_num >= 0))
return retval;
slurm_mutex_lock(&g_container_context_lock);
if... | false | false | false | false | false | 0 |
keep_voltages()
{
if (!_freezetime) {
for (int ii = 1; ii <= _total_nodes; ++ii) {
_vdc[ii] = _v0[ii];
}
_last_time = (_time0 > 0.) ? _time0 : 0.;
}else{untested();
}
} | false | false | false | false | false | 0 |
replaceNeighbour(rcRegion& reg, unsigned short oldId, unsigned short newId)
{
bool neiChanged = false;
for (int i = 0; i < reg.connections.size(); ++i)
{
if (reg.connections[i] == oldId)
{
reg.connections[i] = newId;
neiChanged = true;
}
}
for (int i =... | false | false | false | false | false | 0 |
xdrrec_putbytes(XDR *xdrs, caddr_t addr, u_int len)
{
register RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
register size_t current;
while (len > 0) {
current = (size_t) ((long)rstrm->out_boundry -
(long)rstrm->out_finger);
current = (len < current) ? len : current;
memmove(rstrm->out_finger, addr,... | false | false | false | false | false | 0 |
applyConfiguration()
{
Configuration& config = Persistent<Configuration>( "settings" );
QFont font = config.mainFont();
LOG(logDEBUG) << "CrawlerWidget::applyConfiguration";
// Whatever font we use, we should NOT use kerning
font.setKerning( false );
font.setFixedPitch( true );
#if QT_VERSION ... | false | false | false | false | false | 0 |
checkSizes (lua_State *L, global_State *g) {
if (g->gckind != KGC_EMERGENCY) {
l_mem olddebt = g->GCdebt;
luaZ_freebuffer(L, &g->buff); /* free concatenation buffer */
if (g->strt.nuse < g->strt.size / 4) /* string table too big? */
luaS_resize(L, g->strt.size / 2); /* shrink it a little */
g... | false | false | false | false | false | 0 |
CmdSoundSequence(void)
{
mobj_t *mobj;
mobj = NULL;
if (ACScript->line)
{
mobj = (mobj_t *) & ACScript->line->frontsector->soundorg;
}
SN_StartSequenceName(mobj, ACStrings[Pop()]);
return SCRIPT_CONTINUE;
} | false | false | false | false | false | 0 |
read_entry_data_values(int old_data_buffer_size, int new_data_buffer_size, int data_count,
int* data_sizes, int& read_count)
{
if (data_count == 0) {
read_count = 0;
return true;
}
// Default data value sizes (for logical and numeric data)
for (int i = 0; i < data_coun... | false | false | false | false | false | 0 |
ovSetRegion( CoreLayer *layer,
void *driver_data,
void *layer_data,
void *region_data,
CoreLayerRegionConfig *config,
CoreLayerRegionConfigFlags updated,
... | false | false | false | false | false | 0 |
createPPCMCCodeGenInfo(StringRef TT, Reloc::Model RM,
CodeModel::Model CM) {
MCCodeGenInfo *X = new MCCodeGenInfo();
if (RM == Reloc::Default) {
Triple T(TT);
if (T.isOSDarwin())
RM = Reloc::DynamicNoPIC;
else
RM = Reloc::Static;
}
X->InitMCC... | false | false | false | false | false | 0 |
ath3k_init(int fd, int speed, int init_speed, char *bdaddr,
struct termios *ti)
{
int r;
int err = 0;
struct timespec tm = { 0, 500000 };
unsigned char cmd[MAX_CMD_LEN], rsp[HCI_MAX_EVENT_SIZE];
unsigned char *ptr = cmd + 1;
hci_command_hdr *ch = (void *)ptr;
cmd[0] = HCI_COMMAND_PKT;
/* set both contro... | false | false | false | false | false | 0 |
ch_ai_hdy (init_data, detected, easter, year, hd_elems, fday, count)
Bool *init_data;
const Bool detected;
int easter;
const int year;
int *hd_elems;
const int fday;
const int count;
/*
Manages all specific holidays celebrated in Switzerland/Appenzell-Innerrhoden.
*/
{
if (!use_o... | false | false | false | false | false | 0 |
poly_basis_fn(ssize_t n, double x, double y)
{
/* Return the result for this polynomial term */
switch(n) {
case 0: return( 1.0 ); /* constant */
case 1: return( x );
case 2: return( y ); /* affine order = 1 terms = 3 */
case 3: return( x*y ); /* bilinear order = 1.5 te... | false | false | false | false | false | 0 |
tifm_sd_end_cmd(unsigned long data)
{
struct tifm_sd *host = (struct tifm_sd*)data;
struct tifm_dev *sock = host->dev;
struct mmc_host *mmc = tifm_get_drvdata(sock);
struct mmc_request *mrq;
struct mmc_data *r_data = NULL;
unsigned long flags;
spin_lock_irqsave(&sock->lock, flags);
del_timer(&host->timer);
m... | false | false | false | false | false | 0 |
ArSystemStatusRefreshThread(int refreshFrequency) :
myRefreshFrequency(refreshFrequency)
{
setThreadName("ArSystemStatusRefreshThread");
} | false | false | false | false | false | 0 |
is_terrain_alter_possible_in_range(const struct tile *target_tile,
enum req_range range,
bool survives,
enum terrain_alteration alteration)
{
... | false | false | false | false | false | 0 |
print_page (void)
{
int j;
int lines_left_on_page;
COLUMN *p;
/* Used as an accumulator (with | operator) of successive values of
pad_vertically. The trick is to set pad_vertically
to false before each run through the inner loop, then after that
loop, it tells us whether a line was actually pri... | false | false | false | false | false | 0 |
pdf_count_pages(const char *filename)
{
char gscommand[CMDLINE_MAX];
char output[31] = "";
int pagecount;
size_t bytes;
snprintf(gscommand, CMDLINE_MAX, "%s -dNODISPLAY -q -c "
"'/pdffile (%s) (r) file def pdfdict begin pdffile pdfopen begin "
"(PageCount: ) print pdfpagecount == flush ... | false | false | false | false | true | 1 |
peer_permit ( GHashTable *conf, peer *p ) {
g_assert( p != NULL );
if (p->status != PEER_ACCEPT) {
if (fw_perform( "PermitCmd", conf, p ) == 0) {
p->status = PEER_ACCEPT;
} else {
return -1;
}
}
peer_extend_timeout(conf, p);
return 0;
} | false | false | false | false | false | 0 |
gfarm_base_host_info_validate(void *vinfo)
{
struct gfarm_host_info *info = vinfo;
/* info->hostaliases may be NULL */
return (
info->hostname != NULL &&
info->architecture != NULL &&
info->ncpu != GFARM_HOST_INFO_NCPU_NOT_SET
);
} | false | false | false | false | false | 0 |
operator<( const QTreeWidgetItem & other ) const
{
const InstrItem* ii1 = this;
const InstrItem* ii2 = (InstrItem*) &other;
int col = treeWidget()->sortColumn();
if (col==1)
return (ii1->_pure < ii2->_pure);
if (col==2)
return (ii1->_pure2 < ii2->_pure2);
if (col==0) {
... | false | false | false | false | false | 0 |
ad5064_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val,
int *val2,
long m)
{
struct ad5064_state *st = iio_priv(indio_dev);
int scale_uv;
switch (m) {
case IIO_CHAN_INFO_RAW:
*val = st->dac_cache[chan->channel];
return IIO_VAL_INT;
case IIO_CHAN_INFO_SCAL... | false | false | false | false | false | 0 |
show_stat(struct res_db *db)
{
struct res_stat *rs;
int i;
/**/
printf("%d items\n", db->total);
for (i = 0; i < 2; i++) {
if (i == 0) {
printf("conversion result\n");
rs = &db->res;
} else {
printf("split result\n");
rs = &db->split;
}
printf("ok : %d\n", rs->ok);
... | false | false | false | false | false | 0 |
attachSharedObjectStaticInterface(as_object& o)
{
VM& vm = getVM(o);
const int flags = 0;
Global_as& gl = getGlobal(o);
o.init_member("getLocal", gl.createFunction(sharedobject_getLocal), flags);
o.init_member("getRemote",
gl.createFunction(sharedobject_getRemote), flags);
const i... | false | false | false | false | false | 0 |
efi_pstore_scan_sysfs_exit(struct efivar_entry *pos,
struct efivar_entry *next,
struct list_head *head, bool stop)
{
__efi_pstore_scan_sysfs_exit(pos, true);
if (stop)
__efi_pstore_scan_sysfs_exit(next, &next->list != head);
} | false | false | false | false | false | 0 |
run_target_start(struct ladish_command_change_app_state * cmd_ptr, ladish_app_supervisor_handle supervisor, ladish_app_handle app)
{
ASSERT(cmd_ptr->command.state == LADISH_COMMAND_STATE_PENDING);
ASSERT(cmd_ptr->initiate_stop == NULL);
if (!ladish_studio_is_started())
{
log_error("cannot start app because... | false | false | false | false | false | 0 |
score_knights(Color side)
{
int score = 0;
Square sq;
Bitboard knights = board->get_knights(side);
while (knights) {
sq = knights.firstbit();
knights.clearbit(sq);
/* Positional score */
score += knight_scores[sq];
#ifdef EVAL_KNIGHTMOBILITY
/* Simple mobility bonus */
Bitboard ka = board->knight_att... | false | false | false | false | false | 0 |
gdl_dock_master_foreach_toplevel (GdlDockMaster *master,
gboolean include_controller,
GFunc function,
gpointer user_data)
{
GList *l;
g_return_if_fail (master != NULL && function != NULL);... | false | false | false | false | false | 0 |
get_key_from_keytab(krb5_context context,
krb5_ap_req *ap_req,
krb5_const_principal server,
krb5_keytab keytab,
krb5_keyblock **out_key)
{
krb5_keytab_entry entry;
krb5_error_code ret;
int kvno;
krb5_keytab real_keytab;
if(keytab == NULL)
krb5_kt_default(context, &real_keyt... | false | false | false | false | false | 0 |
change_postfix(char *filename, char *affix1, char *affix2)
{
if (!strcmp(&filename[strlen(filename) - strlen(affix1)], affix1))
filename[strlen(filename) - strlen(affix1)] = '\0';
strcat(filename, affix2);
} | false | false | false | false | false | 0 |
PageHuge(struct page *page)
{
if (!PageCompound(page))
return 0;
page = compound_head(page);
return page[1].compound_dtor == HUGETLB_PAGE_DTOR;
} | false | false | false | false | false | 0 |
drawer_get_transform(int from_id, Transform T, int to_id)
{
DObject *obj;
Transform Tfrom, Tto, Ttoinv;
if(from_id == to_id || to_id == SELF) {
TmIdentity(T);
return;
}
if((obj = drawer_get_object(from_id)) == NULL) {
if(to_id == UNIVERSE) {
OOGLError(1, "drawer_get_transform: can't handle... | false | false | false | false | false | 0 |
hexstr2bin(char *hexstr, int len, uint8_t *buf, size_t offset, size_t buf_len)
{
char c;
int i;
uint8_t int8 = 0;
int sec = 0;
size_t bufpos = 0;
if (len % 2 != 0) {
return 0;
}
for (i=0; i<len; i++) {
c = hexstr[i];
/* case insensitive, skip spaces */
if (c != ' ') {
if (c >= '0' && c <= '9') {... | false | false | false | false | false | 0 |
do_static_branch (VerifyContext *ctx, int delta)
{
int target = ctx->ip_offset + delta;
if (target < 0 || target >= ctx->code_size) {
ADD_VERIFY_ERROR (ctx, g_strdup_printf ("branch target out of code at 0x%04x", ctx->ip_offset));
return;
}
switch (is_valid_branch_instruction (ctx->header, ctx->ip_offset, targ... | false | false | false | false | false | 0 |
run()
{
m_file_mutex.lock();
do {
File file = m_files.takeLast();
m_files.clear();
m_file_mutex.unlock();
CacheFile cache_file = { file, QImage() };
int index = m_cache.indexOf(cache_file);
if (index != -1) {
cache_file = m_cache.at(index);
} else {
cache_file.image = Theme::renderBac... | false | false | false | false | false | 0 |
sendsusp (void)
{
NET2ADD (IAC, SUSP);
printoption ("SENT", IAC, SUSP);
flushline = 1;
if (autoflush)
{
doflush ();
}
if (autosynch)
{
dosynch ();
}
} | false | false | false | false | false | 0 |
do_getlk(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_lk_in *arg = (struct fuse_lk_in *) inarg;
struct fuse_file_info fi;
struct flock flock;
memset(&fi, 0, sizeof(fi));
fi.fh = arg->fh;
fi.lock_owner = arg->owner;
convert_fuse_file_lock(&arg->lk, &flock);
if (req->f->op.getlk)
req->f... | false | false | false | false | false | 0 |
plugin_close_file_emit_signal (void)
{
int i = 0;
g_return_if_fail (plugin_list);
while ( plugin_list[i++].start_plugin_function ) {
if ( plugin_list[i - 1].close_file_plugin_signal && activate_plugin[i - 1] )
plugin_list[i - 1].close_file_plugin_signal ();
}
} | false | false | false | false | false | 0 |
get_expected_numevents(icalcomponent *c)
{
icalproperty *p;
const char* note = 0;
int num_events = 0;
if(c != 0){
for(p = icalcomponent_get_first_property(c,ICAL_X_PROPERTY);
p!= 0;
p = icalcomponent_get_next_property(c,ICAL_X_PROPERTY)){
if(strcmp(icalproper... | false | false | false | false | true | 1 |
ndmca_td_idle (struct ndm_session *sess)
{
int rc;
ndmca_test_phase (sess, "D-IDLE", "Data IDLE State Series");
rc = ndmca_test_check_data_state (sess, NDMP9_DATA_STATE_IDLE, 0);
if (rc) return rc;
rc = ndmca_test_data_abort (sess, NDMP9_ILLEGAL_STATE_ERR);
if (rc) return rc;
rc = ndmca_test_data_stop (ses... | false | false | false | false | false | 0 |
sha1(const QString &string)
{
QByteArray hashData = QCryptographicHash::hash(string.toUtf8(), QCryptographicHash::Sha1);
return hashData.toHex();
} | false | false | false | false | false | 0 |
WriteStringAttribute(const char* name, const char* value)
{
ostream& os = *(this->Stream);
os << " " << name << "=\"" << value << "\"";
os.flush();
if (os.fail())
{
this->SetErrorCode(vtkErrorCode::GetLastSystemError());
}
return (os? 1:0);
} | false | false | false | false | false | 0 |
set_status( const std::string& stat )
{
if( stat == m_status ) return;
m_status = stat;
#if GTKMM_CHECK_VERSION(2,5,0)
m_label_stat.set_text( stat );
m_tooltip.set_tip( m_label_stat_ebox, stat );
#else
m_statbar.push( stat );
#endif
} | false | false | false | false | false | 0 |
cgraph_rtl_info (tree decl)
{
struct cgraph_node *node;
if (TREE_CODE (decl) != FUNCTION_DECL)
abort ();
node = cgraph_node (decl);
if (decl != current_function_decl
&& !TREE_ASM_WRITTEN (node->decl))
return NULL;
return &node->rtl;
} | false | false | false | false | false | 0 |
_cx_string_rtrim(cx_string *self)
{
cxchar *tmp = NULL;
cxsize i = 0;
cx_assert(self != NULL);
tmp = self->data + self->sz - 1;
while (isspace((cxint)*tmp)) {
tmp--;
i++;
}
*++tmp = (cxchar) '\0';
self->sz -= i;
return self;
} | false | false | false | false | false | 0 |
criteria_test_nonempty (GnmValue const *x, GnmCriteria *crit)
{
return !VALUE_IS_EMPTY (x);
} | false | false | false | false | false | 0 |
errstr(PyObject *self, PyObject *args)
{
const char *errmsg;
int res;
if(!PyArg_ParseTuple(args, "i", &res))
return NULL;
errmsg = fko_errstr(res);
return Py_BuildValue("s", errmsg);
} | false | false | false | false | false | 0 |
deleteAll(void)
{
xxx_UT_DEBUGMSG(("fl_Squiggles::deleteAll()\n"));
// Remove any existing squiggles from the screen...
UT_sint32 iSquiggles = _getCount();
UT_sint32 j;
for (j = iSquiggles-1; j >= 0 ; j--)
{
_deleteNth(j);
}
return (0 == iSquiggles) ? false : true;
} | false | false | false | false | false | 0 |
mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn)
{
guint32 gchandle;
MonoDelegate *d;
if (ftn == NULL)
return NULL;
mono_marshal_lock ();
if (delegate_hash_table == NULL)
delegate_hash_table = delegate_hash_table_new ();
if (mono_gc_is_moving ()) {
gchandle = GPOINTER_TO_UINT (g_hash_table_lookup... | false | false | false | false | false | 0 |
make_channel(gint fd)
{
GIOChannel *channel;
GError *err = NULL;
channel = g_io_channel_unix_new(fd);
g_io_channel_set_close_on_unref(channel, TRUE);
g_io_channel_set_encoding(channel, NULL, &err);
if (err != NULL) {
g_printerr("%s\n", err->message);
g_error_free(err);
g... | false | false | false | false | false | 0 |
__efi_enter_virtual_mode(void)
{
int count = 0, pg_shift = 0;
void *new_memmap = NULL;
efi_status_t status;
efi.systab = NULL;
efi_merge_regions();
new_memmap = efi_map_regions(&count, &pg_shift);
if (!new_memmap) {
pr_err("Error reallocating memory, EFI runtime non-functional!\n");
clear_bit(EFI_RUNTIME_S... | false | false | false | false | false | 0 |
intelFinish(struct gl_context * ctx)
{
struct brw_context *brw = brw_context(ctx);
intel_glFlush(ctx);
if (brw->batch.last_bo)
drm_intel_bo_wait_rendering(brw->batch.last_bo);
} | false | false | false | false | false | 0 |
get_selection_vfunc_callback(AtkText* self, gint selection_num, gint* start_offset, gint* end_offset)
{
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
// Non-gtkmmproc-generated custom classes implicitly call the default
// Glib::... | false | false | false | false | false | 0 |
alt_size_entry_update_refval (AltSizeEntryField *gsef,
gdouble refval)
{
if (gsef->stop_recursion > 1)
return;
gsef->refval = refval;
switch (gsef->gse->update_policy)
{
case ALT_SIZE_ENTRY_UPDATE_NONE:
break;
case ALT_SIZE_ENTRY_UPDATE_SIZE:
... | false | false | false | false | false | 0 |
Realloc(int size)
{
if ( size == m_len ) {
return false;
}
if (size == 0) {
delete [] m_buff;
m_buff = 0;
m_len = 0;
return true;
}
uint8 *buff = new uint8[size];
if (m_len == 0) {
memset(buff, 0, size);
} else if ( size > m_len ) {
memset(buff + m_len, 0, size - m_len);
memcpy(buff, m_buff, m_le... | false | false | false | false | false | 0 |
get_ec_player_id( long unsigned int dpPlayerId )
{
if( dpPlayerId == BROADCAST_PID || dpPlayerId == 0)
return 0;
for( char ecPlayerId = 1; ecPlayerId <= MAX_PLAYER; ++ecPlayerId )
{
if( dpPlayerId == dp_id[ecPlayerId-1] )
return ecPlayerId;
}
return 0;
} | false | false | false | false | false | 0 |
find_next_wrap (GtkXText * xtext, textentry * ent, unsigned char *str,
int win_width, int indent)
{
unsigned char *last_space = str;
unsigned char *orig_str = str;
int str_width = indent;
int rcol = 0, bgcol = 0;
int hidden = FALSE;
int mbl;
int char_width;
int ret;
int limit_offset = 0;
/* single line... | false | false | false | false | false | 0 |
save( QTextStream * ts, int indent )
{
indentation( ts, indent );
*ts << "<bonus type=\"" << (uint)_type << "\">" << endl;
uint nbParam = _params.count();
for( uint i = 0; i < nbParam; i++ ) {
indentation( ts, indent+1 );
*ts << "<param>" << _params.at( i ) << "</param>" << endl;
}
indentation( ts, indent )... | false | false | false | false | false | 0 |
StartTransaction(void)
{
TransactionState s;
VirtualTransactionId vxid;
/*
* Let's just make sure the state stack is empty
*/
s = &TopTransactionStateData;
CurrentTransactionState = s;
/*
* check the current transaction state
*/
if (s->state != TRANS_DEFAULT)
elog(WARNING, "StartTransaction while in ... | false | false | false | false | false | 0 |
initFS( EncFS_Context *ctx, const shared_ptr<EncFS_Opts> &opts )
{
RootPtr rootInfo;
boost::shared_ptr<EncFSConfig> config(new EncFSConfig);
if(readConfig( opts->rootDir, config ) != Config_None)
{
if(opts->reverseEncryption)
{
if (config->blockMACBytes != 0 || config->blockMACRandBytes != 0
|... | false | false | false | false | false | 0 |
no_double_slashes(char *buf)
{
/*
* Clean slashes
*/
char *c = buf;
while(c[0])
{
if(c[0] == '/')
{
if(0 == c[1])
c[0] = 0;
else
while('/' == c[1])
strdel(c + 1, 1);
}
++c;
}
} | false | false | false | false | false | 0 |
load_gen(int size, SFBags *bagp, FILE *fd)
{
int i;
size /= 4;
bagp->gen = NEW(SFGenRec, size);
for (i = 0; i < size; i++) {
READW(bagp->gen[i].oper, fd);
READW(bagp->gen[i].amount, fd);
}
bagp->ngens = size;
} | false | false | false | false | false | 0 |
st_sensors_i2c_read_byte(struct st_sensor_transfer_buffer *tb,
struct device *dev, u8 reg_addr, u8 *res_byte)
{
int err;
err = i2c_smbus_read_byte_data(to_i2c_client(dev), reg_addr);
if (err < 0)
goto st_accel_i2c_read_byte_error;
*res_byte = err & 0xff;
st_accel_i2c_read_byte_error:
return err < 0 ? err ... | false | false | false | false | false | 0 |
gt_ltr_visitor_feature_node(GtNodeVisitor *nv, GtFeatureNode *fn,
GT_UNUSED GtError *err)
{
GtLTRVisitor *lv;
GtRange node_range;
GtArray *pdomarr = NULL;
const char *pfamname;
const char *fnt;
lv = gt_ltr_visitor_cast(nv);
gt_assert(lv);
gt_error_check(err);
fn... | false | false | false | false | false | 0 |
__ecereProp___ecereNameSpace__ecere__gui__controls__EditBox_Set_noCaret(struct __ecereNameSpace__ecere__com__Instance * this, unsigned int value)
{
struct __ecereNameSpace__ecere__gui__controls__EditBox * __ecerePointer___ecereNameSpace__ecere__gui__controls__EditBox = (struct __ecereNameSpace__ecere__gui__controls__Ed... | false | false | false | true | false | 1 |
container_add_actor (ClutterContainer *container,
ClutterActor *actor)
{
ClutterActor *parent;
parent = clutter_actor_get_parent (actor);
if (G_UNLIKELY (parent != NULL))
{
g_warning ("Attempting to add actor of type '%s' to a "
"container of type '%s', but the actor has "
... | false | false | false | true | false | 1 |
mhdriver_cached_expunge_folder(mailsession * session)
{
struct mailmh_folder * folder;
int res;
char filename_flags[PATH_MAX];
struct mail_cache_db * cache_db_flags;
MMAPString * mmapstr;
struct mh_cached_session_state_data * cached_data;
unsigned int i;
int r;
cached_data = get_cached_data(session);... | true | true | false | false | false | 1 |
_build_user_job_list(uint32_t user_id, char* job_name)
{
List job_queue;
ListIterator job_iterator;
struct job_record *job_ptr = NULL;
job_queue = list_create(NULL);
if (job_queue == NULL)
fatal("list_create memory allocation failure");
job_iterator = list_iterator_create(job_list);
if (job_iterator == NULL)
... | false | false | false | false | false | 0 |
disable_pots(struct w6692_ch *wch)
{
struct w6692_hw *card = wch->bch.hw;
if (!(card->fmask & pots))
return -ENODEV;
wch->b_mode &= ~(W_B_MODE_EPCM | W_B_MODE_BSW0);
WriteW6692B(wch, W_B_MODE, wch->b_mode);
WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT |
W_B_CMDR_XRST);
return 0;
} | false | false | false | false | false | 0 |
readByte() throw(GsmException)
{
if (_oldChar != -1)
{
int result = _oldChar;
_oldChar = -1;
return result;
}
unsigned char c;
int timeElapsed = 0;
struct timeval oneSecond;
bool readDone = false;
while (!readDone && timeElapsed < _timeoutVal)
{
if (interrupted())
throwModemExc... | false | false | false | false | false | 0 |
test_exact (void)
{
const char *val[] =
{ "@NaN@", "-@Inf@", "-2", "-1", "-0", "0", "1", "2", "@Inf@" };
int sv = sizeof (val) / sizeof (*val);
int i, j, k;
int rnd;
mpfr_t a, b, c, r1, r2;
mpfr_inits2 (8, a, b, c, r1, r2, (mpfr_ptr) 0);
for (i = 0; i < sv; i++)
for (j = 0; j < sv; j++)
fo... | false | false | false | false | false | 0 |
close_stdout (void)
{
if (close_stream (stdout) != 0)
{
char const *write_error = _("write error");
if (file_name)
error (0, errno, "%s: %s", quotearg_colon (file_name),
write_error);
else
error (0, errno, "%s", write_error);
_exit (exit_failure);
}
if (close_stream (std... | false | false | false | false | false | 0 |
objectNameGetter(ExecState *exec, JSObject*, const Identifier& name, const PropertySlot& slot)
{
HTMLDocument *thisObj = static_cast<HTMLDocument*>(slot.slotBase());
DOM::HTMLCollectionImpl objectLike(thisObj->impl(), DOM::HTMLCollectionImpl::DOC_APPLETS);
return getDOMNode(exec, objectLike.namedItem(name.domStri... | false | false | false | false | false | 0 |
ompit_var_type_to_datatype (mca_base_var_type_t type, MPI_Datatype *datatype)
{
switch (type) {
case MCA_BASE_VAR_TYPE_INT:
*datatype = MPI_INT;
break;
case MCA_BASE_VAR_TYPE_UNSIGNED_INT:
*datatype = MPI_UNSIGNED;
break;
case MCA_BASE_VAR_TYPE_UNSIGNED_LONG:
*dat... | 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.