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 |
|---|---|---|---|---|---|---|
cancelNewAttack(AttackFleet *fleet)
{
if (!m_newAttacks.removeAll(fleet))
{
if(!m_standingOrders.removeAll(fleet))
return;
}
else
fleet->source->fleet().absorb(fleet);
fleet->deleteLater();
} | false | false | false | false | false | 0 |
gretl_trunc (char *str, size_t n)
{
if (n < strlen(str)) {
str[n] = '\0';
}
return str;
} | false | false | false | false | false | 0 |
cpa(struct child *c)
{
int i, n;
double t0 = now();
srandom(kvtest_first_seed + c->childno);
for(i = 0; i < CPN; i++){
char key[512], val[512];
long x = random();
sprintf(key, "%ld", x);
sprintf(val, "%ld", x + 1);
aput(c, Str(key), Str(val));
}
n = i;
checkasync(c, 2);
double t1... | false | false | false | false | false | 0 |
getName() const
{
return haveC1Bytes? "windows-1255" : "ISO-8859-8-I";
} | false | false | false | false | false | 0 |
unsupportedTypedef(const Token *tok) const
{
if (!_settings->debugwarnings)
return;
std::ostringstream str;
const Token *tok1 = tok;
while (tok && tok->str() != ";")
{
if (tok != tok1)
str << " ";
str << tok->str();
tok = tok->next();
}
if (tok)
... | false | false | false | false | false | 0 |
inc_new_count(unsigned int length, int count, char *charset,
char *allchars, char *char1, char2_table char2, chars_table *chars)
{
int pos, ci;
int size;
int error;
log_event("- Expanding tables for length %d to character count %d",
length + 1, count + 1);
size = count + 2;
error = expand(char1, allchars... | false | false | false | false | false | 0 |
gnome_rr_config_new_current (GnomeRRScreen *screen, GError **error)
{
GnomeRRConfig *self = g_object_new (GNOME_TYPE_RR_CONFIG, "screen", screen, NULL);
if (gnome_rr_config_load_current (self, error))
return self;
else
{
g_object_unref (self);
return NULL;
}
} | false | false | false | false | false | 0 |
scripting_GetIntegerResult(int *i) {
if(lua_isnumber(L, -1)) {
*i = (int)lua_tonumber(L, -1);
lua_pop(L, 1); /* restore stack */
return 0;
} else {
showStack();
return 1;
}
} | false | false | false | false | false | 0 |
mod_clear_paths(void)
{
struct module_path *pathst;
dlink_node *ptr;
dlink_node *next_ptr;
DLINK_FOREACH_SAFE(ptr, next_ptr, mod_paths.head)
{
pathst = ptr->data;
dlinkDelete(&pathst->node, &mod_paths);
MyFree(pathst);
}
DLINK_FOREACH_SAFE(ptr, next_ptr, conf_modules.head)
{
pathst = ... | false | false | false | false | false | 0 |
cb_reset_conn_cpt( cb_backend_instance *cb ) {
if (cb->monitor_availability.cpt > 0) {
slapi_lock_mutex(cb->monitor_availability.cpt_lock);
cb->monitor_availability.cpt = 0 ;
if (cb->monitor_availability.farmserver_state == FARMSERVER_UNAVAILABLE) {
cb->monitor_availability.farmserver_state = FARMSERVER_A... | false | false | false | false | false | 0 |
update_offsets(unsigned long poly_add, uint32_t * poly_corr,
QS_t * qs_inf, poly_t * poly_inf)
{
unsigned long num_primes = qs_inf->num_primes;
uint32_t * soln1 = poly_inf->soln1;
uint32_t * soln2 = poly_inf->soln2;
prime_t * factor_base = qs_inf->factor_base;
unsigned long p, correc... | false | false | false | false | false | 0 |
socket_flush_if_writable(void)
{
int res;
/* Quick exit if nothing to do */
if (PqSendPointer == PqSendStart)
return 0;
/* No-op if reentrant call */
if (PqCommBusy)
return 0;
/* Temporarily put the socket into non-blocking mode */
socket_set_nonblocking(true);
PqCommBusy = true;
res = internal_flush... | false | false | false | false | false | 0 |
own_random(dst_work *work)
{
int dir = 0, b;
int bytes, n, cmd = 0, dig = 0;
/*
* now get the initial seed to put into the quick random function from
* the address of the work structure
*/
bytes = (int) getpid();
/*
* proceed while needed
*/
while (work->filled < work->needed) {
EREPORT(("own_random r %0... | false | false | false | false | false | 0 |
alloc_chrdev_region(dev_t *dev, unsigned baseminor, unsigned count,
const char *name)
{
struct char_device_struct *cd;
cd = __register_chrdev_region(0, baseminor, count, name);
if (IS_ERR(cd))
return PTR_ERR(cd);
*dev = MKDEV(cd->major, cd->baseminor);
return 0;
} | false | false | false | false | false | 0 |
saveSettings()
{
Prefs::setTileSet(theTiles.path());
Prefs::setLayout(theBoardLayout.path());
Prefs::setBackground(theBackground.path());
Prefs::setAngle(m_angle);
Prefs::self()->writeConfig();
} | false | false | false | false | false | 0 |
gameWalk(int op) {
Board *b=0;
ChessGame *cg=0;
int id;
global.debug("MainWindow","gameWalk");
id=notebook->getCurrentPageId();
if (id<=-2) // text panes
return;
if (id==-1)
b=global.BoardList.front();
else {
cg=global.getGame(id);
if (cg)
b=cg->getBoard();
}
if (!b)
r... | false | false | false | false | false | 0 |
chgroman(str, len, kbuf)
CONST char *str;
int len;
CONST u_short *kbuf;
{
romantable *tmp;
int n;
if ((n = searchroman(str, len)) < 0) {
n = maxromanlist;
tmp = (romantable *)realloc(romanlist,
(maxromanlist + 1) * sizeof(romantable));
if (!tmp) return(-1);
romanlist = tmp;
maxromanlist++;
}
else if ... | false | false | false | false | false | 0 |
ext_tree_mark_written(struct pnfs_block_layout *bl, sector_t start,
sector_t len)
{
struct rb_root *root = &bl->bl_ext_rw;
sector_t end = start + len;
struct pnfs_block_extent *be;
int err = 0;
spin_lock(&bl->bl_ext_lock);
/*
* First remove all COW extents or holes from written to range.
*/
err = __ext_tr... | false | false | false | false | false | 0 |
isofs_bread(struct inode *inode, sector_t block)
{
sector_t blknr = isofs_bmap(inode, block);
if (!blknr)
return NULL;
return sb_bread(inode->i_sb, blknr);
} | false | false | false | false | false | 0 |
ArgCountError(int m, int n)
{
char text[256];
const char *name = this->MethodName;
int nargs = this->N;
sprintf(text, "%.200s%s takes %s %d argument%s (%d given)",
(name ? name : "function"), (name ? "()" : ""),
((m == n) ? "exactly" : ((nargs < m) ? "at least" : "at most")),
((na... | false | false | false | false | false | 0 |
marshalReplyHeader(giopStream* g) {
char* hdr = (char*) g->pd_currentOutputBuffer +
g->pd_currentOutputBuffer->start;
hdr[7] = (char) GIOP::Reply;
GIOP_S& giop_s = *(GIOP_S*)g;
cdrStream& s = (cdrStream&) *g;
CORBA::ULong rc = GIOP::NO_EXCEPTION;
{
// calculate the request hea... | false | false | false | false | false | 0 |
Step(Threadq* runq, Threadq* nextq, int c, int flag, const char* p) {
nextq->clear();
for (Threadq::iterator i = runq->begin(); i != runq->end(); ++i) {
Thread* t = i->second;
if (t == NULL)
continue;
if (longest_) {
// Can skip any threads started after our current best match.
if (m... | false | false | false | false | false | 0 |
do_throw(cstack)
struct condstack *cstack;
{
int idx;
int inactivate_try = FALSE;
/*
* Cleanup and inactivate up to the next surrounding try conditional that
* is not in its finally clause. Normally, do not inactivate the try
* conditional itself, so that its ACTIVE flag can be tested... | false | false | false | false | false | 0 |
__read_targetid(__be32 *p, struct pnfs_osd_targetid* targetid)
{
u32 oti_type;
oti_type = be32_to_cpup(p++);
targetid->oti_type = oti_type;
switch (oti_type) {
case OBJ_TARGET_SCSI_NAME:
case OBJ_TARGET_SCSI_DEVICE_ID:
p = __read_u8_opaque(p, &targetid->oti_scsi_device_id);
}
return p;
} | false | false | false | false | false | 0 |
unw_print_grmask (char *cp, unsigned int mask)
{
int sep = 0;
int i;
for (i = 0; i < 4; ++i)
{
if (mask & 1)
{
if (sep)
*cp++ = ',';
*cp++ = 'r';
*cp++ = i + 4 + '0';
sep = 1;
}
mask >>= 1;
}
*cp = '\0';
} | false | false | false | false | false | 0 |
TerminateExecution(int thread_id) {
if (!i::V8::IsRunning()) return;
API_ENTRY_CHECK("V8::GetCurrentThreadId()");
// If the thread_id identifies the current thread just terminate
// execution right away. Otherwise, ask the thread manager to
// terminate the thread with the given id if any.
if (thread_id ==... | false | false | false | false | false | 0 |
Curl_readwrite_init(struct connectdata *conn)
{
struct SessionHandle *data = conn->data;
struct Curl_transfer_keeper *k = &conn->keep;
/* NB: the content encoding software depends on this initialization of
Curl_transfer_keeper. */
memset(k, 0, sizeof(struct Curl_transfer_keeper));
k->start = Curl_tvnow... | false | false | false | false | false | 0 |
netdev_rx_err ( struct net_device *netdev,
struct io_buffer *iobuf, int rc ) {
DBGC ( netdev, "NETDEV %s failed to receive %p: %s\n",
netdev->name, iobuf, strerror ( rc ) );
/* Discard packet */
free_iob ( iobuf );
/* Update statistics counter */
netdev_record_stat ( &netdev->rx_stats, rc );
} | false | false | false | false | false | 0 |
netok_clicked(G_GNUC_UNUSED GtkWidget *widget, G_GNUC_UNUSED gpointer data) {
int counter=0;
int connection=0;
if (netmode) return FALSE;
gtk_widget_hide(dialogbarbut[ISave-NumMainIcons]);
for (; counter < 3; counter++)
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(netlrad[counter]))) {
connect... | false | false | false | false | false | 0 |
Connect ()
{
#ifdef HAVE_LOAD_DEFAULTS
const char *host;
const char *user;
const char *passwd;
const char *socket;
///////
// Converting empty strings into NULL pointer
// This allows MySQL server to act as default
///////
if (! MySQLHost.length()) host=NULL;
else
host = MySQLHo... | false | false | false | false | false | 0 |
rtl8225se_rf_set_channel(struct ieee80211_hw *dev,
struct ieee80211_conf *conf)
{
int chan =
ieee80211_frequency_to_channel(conf->chandef.chan->center_freq);
rtl8225sez2_rf_set_tx_power(dev, chan);
rtl8187se_rf_writereg(dev, 0x7, rtl8225se_chan[chan - 1]);
if ((rtl8187se_rf_readreg(dev, 0x7) & 0x0F80) !=
... | false | false | false | false | false | 0 |
enable_multicast(unsigned short eth_nic_base)
{
unsigned char mcfilter[8];
int i;
memset(mcfilter, 0xFF, 8);
outb(4, eth_nic_base+D8390_P0_RCR);
outb(D8390_COMMAND_RD2 + D8390_COMMAND_PS1, eth_nic_base + D8390_P0_COMMAND);
for(i=0;i<8;i++)
{
outb(mcfilter[i], eth_nic_base + 8 + i);
if(inb(eth_nic_base + 8 ... | true | true | false | false | false | 1 |
dumpAMF(AMFObject *obj, char *ptr)
{
int i;
const char opt[] = "NBSO Z";
for (i = 0; i < obj->o_num; i++)
{
AMFObjectProperty *p = &obj->o_props[i];
if (p->p_type > 5)
continue;
ptr += sprintf(ptr, " -C ");
if (p->p_name.av_val)
*ptr++ = 'N';
*ptr++ = opt[p->p_type];
*pt... | false | true | false | false | false | 1 |
check_def_in_ance_block(Block *block_head, Operand *var, IntSet pre_node_set)
{
int i;
for (i = 0; i < block_head->ncfpre; i++) {
if (block_head->no > block_head->cfpre[i]->no) {
if (block_head->cfpre[i]->def_var_list != NULL
&& block_head->cfpre[i]->def_var_list->scalar_bv ... | false | false | false | false | false | 0 |
closeEvent(QCloseEvent *cl_event)
{
int i,
button_nr=0;
if(annotations_edited)
{
QMessageBox messagewindow;
messagewindow.setText("There are unsaved annotations,\n are you sure you want to quit?");
messagewindow.setIcon(QMessageBox::Question);
messagewindow.setStandardButtons(QMessageBox::... | false | false | false | false | false | 0 |
MetadataDownloaded()
{
xstring new_info_hash;
SHA1(md_download,new_info_hash);
if(info_hash && info_hash.ne(new_info_hash)) {
LogError(1,"downloaded metadata does not match info_hash, retrying");
StartMetadataDownload();
return;
}
SetMetadata(md_download);
md_download.unset();
} | false | false | false | false | false | 0 |
avoid_crc32(dundi_eid *avoid[])
{
/* Idea is that we're calculating a checksum which is independent of
the order that the EID's are listed in */
uint32_t acrc32 = 0;
int x;
for (x=0;avoid[x];x++) {
/* Order doesn't matter */
if (avoid[x+1]) {
acrc32 ^= crc32(0L, (unsigned char *)avoid[x], sizeof(dundi_ei... | false | false | false | false | false | 0 |
gck_builder_ref (GckBuilder *builder)
{
GckRealBuilder *real = (GckRealBuilder *)builder;
gboolean stack;
g_return_val_if_fail (builder != NULL, NULL);
stack = g_atomic_int_add (&real->refs, 1) == 0;
if G_UNLIKELY (stack) {
g_warning ("Never call gck_builder_ref() on a stack allocated GckBuilder structure");
... | false | false | false | false | false | 0 |
arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long addr)
{
struct insn insn;
u8 fix_ip_or_call = UPROBE_FIX_IP;
int ret;
ret = uprobe_init_insn(auprobe, &insn, is_64bit_mm(mm));
if (ret)
return ret;
ret = branch_setup_xol_ops(auprobe, &insn);
if (ret != -ENOSYS)
retur... | false | false | false | false | false | 0 |
classNameOfToplevel( int number )
{
if ( !qApp->isSessionRestored() )
return QString();
KConfig *config = kapp->sessionConfig();
if ( !config )
return QString();
QString s;
s.setNum( number );
s.prepend( QLatin1String("WindowProperties") );
KConfigGroup group( config, s );
... | false | false | false | false | false | 0 |
open_socket_out_wrapped(char *host, int port, const char *bind_addr,
int af_hint)
{
char *prog = getenv("RSYNC_CONNECT_PROG");
if (prog && strchr(prog, '%')) {
int hlen = strlen(host);
int len = strlen(prog) + 1;
char *f, *t;
for (f = prog; *f; f++) {
if (*f != '%')
continue;
/* Compute more... | true | true | false | false | true | 1 |
abraca_tool_bar_create_cover_image (AbracaToolBar* self) {
GtkImage* _tmp0_;
GtkImage* _tmp1_;
GtkEventBox* _tmp2_;
GtkEventBox* _tmp3_;
GtkEventBox* eventbox;
GtkImage* _tmp4_;
g_return_if_fail (self != NULL);
abraca_tool_bar_set_default_coverart (self);
_tmp0_ = self->priv->_coverart;
gtk_widget_set_has_too... | false | false | false | false | false | 0 |
binomial_random( int32_t nb_drawings, double prob )
{
int32_t nb_success;
// The binomial distribution is invariant under changing
// ProbSuccess to 1-ProbSuccess, if we also change the answer to
// NbTrials minus itself; we ll remember to do this below.
double p;
if ( prob <= 0.5 ) p = prob;
else p = ... | false | false | false | false | false | 0 |
get_struct_property(GWEN_XMLNODE *node,
const char *pname,
const char *defval) {
GWEN_XMLNODE *n;
if (GWEN_XMLNode_GetType(node)==GWEN_XMLNodeTypeTag)
if (strcasecmp(GWEN_XMLNode_GetData(node), "type")==0) {
return GWEN_XMLNode_GetProperty(n... | false | false | false | false | false | 0 |
initialize(const Locale& loc, UErrorCode& status) {
if (U_FAILURE(status)) {
return;
}
delete fLocale;
fLocale = loc.clone();
if (fPluralRules) {
delete fPluralRules;
}
fPluralRules = PluralRules::forLocale(loc, status);
setupCurrencyPluralPattern(loc, status);
} | false | false | false | false | false | 0 |
call_func_retnr(func, argc, argv, safe)
char_u *func;
int argc;
char_u **argv;
int safe; /* use the sandbox */
{
typval_T rettv;
long retval;
if (call_vim_function(func, argc, argv, safe, &rettv) == FAIL)
return -1;
retval = get_tv_number_chk(&rettv, NULL);
clear_tv(&... | false | false | false | false | false | 0 |
getFileNameList() const
{
QStringList list;
if(p->getFileInfoList(&list))
{
return list;
}
else
{
return QStringList();
}
} | false | false | false | false | false | 0 |
gar_alloc_cp(void)
{
struct cpoint *p;
p = calloc(1, sizeof(*p));
if (!p)
return NULL;
list_init(&p->l);
return p;
} | false | false | false | false | false | 0 |
cbf_count_getopt_options ( cbf_getopt_handle handle, unsigned int * options ) {
if ( !handle ) return CBF_ARGUMENT;
if ( options ) *options = handle->optstructs_size;
return 0;
} | false | false | false | false | false | 0 |
floatformat_i387_ext_is_valid (const struct floatformat *fmt, const void *from)
{
/* In the i387 double-extended format, if the exponent is all ones,
then the integer bit must be set. If the exponent is neither 0
nor ~0, the intbit must also be set. Only if the exponent is
zero can it be zero, and th... | false | false | false | false | false | 0 |
getMarkComponent(le_int32 markPosition) const
{
le_int32 component = 0;
le_int32 posn;
for (posn = position; posn != markPosition; posn += direction) {
if (glyphStorage[posn] == 0xFFFE) {
component += 1;
}
}
return component;
} | false | false | false | false | false | 0 |
select_item( const std::string& url )
{
const Gtk::TreeModel::Row row = get_row_from_url( url );
if( row ){
Gtk::TreePath path = GET_PATH( row );
m_treeview.get_selection()->unselect_all();
m_treeview.set_cursor( path );
}
} | false | false | false | false | false | 0 |
loadFromConfigFile(
const mrpt::utils::CConfigFileBase &iniFile,
const std::string §ion)
{
MRPT_LOAD_CONFIG_VAR(vocab_path,string, iniFile, section );
MRPT_LOAD_CONFIG_VAR(vocabName,string, iniFile, section );
MRPT_LOAD_CONFIG_VAR(p_obs_given_exists,double, iniFile, section );
MRPT_LOAD_CONFIG_VA... | false | false | false | false | false | 0 |
def_function(int datatype, long int size, char *size_text, Token *id, Token *args)
#else /* K&R style */
def_function(datatype,size,size_text,id,args)
#endif /* HAVE_STDC */
/* Installs function or subroutine name */
#if HAVE_STDC
/* in global table */
#else /* K&R style */
int d... | false | false | false | false | false | 0 |
gf_general_set_up_single_timing_test(int w, void *ra, void *rb, int size)
{
void *top;
gf_general_t g;
uint8_t *r8, *r8a;
uint16_t *r16;
uint32_t *r32;
uint64_t *r64;
int i;
top = (uint8_t *)rb+size;
/* If w is 8, 16, 32, 64 or 128, fill the regions with random bytes.
However, don't allow for z... | false | false | false | false | false | 0 |
render(render_guts_t* guts, int indentation) const {
return
this->_childNodes.front()->render(guts, indentation) + "::" +
this->_childNodes.back()->render(guts, indentation);
} | false | false | false | false | false | 0 |
FlmGetStats(
FLM_STATS * pFlmStats)
{
RCODE rc = FERR_OK;
// Get the statistics
if( RC_BAD( rc = flmStatCopy( pFlmStats, &gv_FlmSysData.Stats)))
{
goto Exit;
}
Exit:
return( rc);
} | false | false | false | false | false | 0 |
test(std::istream& in) const
{
if (read_binary_number_nocheck<unsigned long>(in) == binary_magic_number &&
read_binary_number_nocheck<unsigned long>(in) == format_version)
return true;
in.clear();
in.seekg(0, std::ios::beg);
return false;
} | false | false | false | false | false | 0 |
setParent(BasicBlock *P) {
if (getParent()) {
if (!P) LeakDetector::addGarbageObject(this);
} else {
if (P) LeakDetector::removeGarbageObject(this);
}
Parent = P;
} | false | false | false | false | false | 0 |
ruv_add_csn_inprogress (RUV *ruv, const CSN *csn)
{
RUVElement* replica;
char csn_str[CSN_STRSIZE];
int rc = RUV_SUCCESS;
int rid = csn_get_replicaid (csn);
PR_ASSERT (ruv && csn);
/* locate ruvElement */
slapi_rwlock_wrlock (ruv->lock);
if(is_cleaned_rid(rid)){
/* return succ... | true | true | false | false | false | 1 |
gfs2_aspace_writepage(struct page *page, struct writeback_control *wbc)
{
struct buffer_head *bh, *head;
int nr_underway = 0;
int write_op = REQ_META | REQ_PRIO |
(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE);
BUG_ON(!PageLocked(page));
BUG_ON(!page_has_buffers(page));
head = page_buffers(page);
bh = ... | false | false | false | false | false | 0 |
is_base_type (tree type)
{
switch (TREE_CODE (type))
{
case ERROR_MARK:
case VOID_TYPE:
case INTEGER_TYPE:
case REAL_TYPE:
case FIXED_POINT_TYPE:
case COMPLEX_TYPE:
case BOOLEAN_TYPE:
return 1;
case ARRAY_TYPE:
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_T... | false | false | false | false | false | 0 |
qtdemux_is_brand_3gp (GstQTDemux * qtdemux, gboolean major)
{
if (major) {
return ((qtdemux->major_brand & GST_MAKE_FOURCC (255, 255, 0, 0)) ==
GST_MAKE_FOURCC ('3', 'g', 0, 0));
} else if (qtdemux->comp_brands != NULL) {
GstMapInfo map;
guint8 *data;
gsize size;
gboolean res = FALSE;
... | false | false | false | false | false | 0 |
bquote1(LVAL expr)
{
LVAL val,list,last,new;
/* handle atoms */
if (atomp(expr))
val = expr;
/* handle (comma <expr>) */
else if (car(expr) == s_comma) {
if (atomp(cdr(expr)))
xlfail("bad comma expression");
val = xleval(car(cdr(expr)));
}
/* handle ((c... | false | false | false | false | false | 0 |
_mgt_dispatcher23a(struct rtw_adapter *padapter, struct mlme_handler *ptable,
struct recv_frame *precv_frame)
{
struct sk_buff *skb = precv_frame->pkt;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
if (ptable->func) {
/* receive the frames that ra(a1) is my address
or ra(a1) is bc addr... | false | false | false | false | false | 0 |
remove_volatile_obstacles(int level_num)
{
int i;
// We pass through all the obstacles, deleting those
// that are 'blood'.
//
for (i = 0; i < MAX_OBSTACLES_ON_MAP; i++) {
int obstacle_type = curShip.AllLevels[level_num]->obstacle_list[i].type;
if (obstacle_type == -1)
continue;
if (get_obstacle_spec(obs... | false | false | false | false | false | 0 |
WriteDependencies(
const std::set<std::string>& sources, const std::string& obj,
std::ostream&, std::ostream&)
{
// Make sure this is a scanning instance.
if(sources.empty() || sources.begin()->empty())
{
cmSystemTools::Error("Cannot scan dependencies without a source file.");
return false;
... | false | false | false | false | false | 0 |
pbx_checkcondition(const char *condition)
{
int res;
if (ast_strlen_zero(condition)) { /* NULL or empty strings are false */
return 0;
} else if (sscanf(condition, "%30d", &res) == 1) { /* Numbers are evaluated for truth */
return res;
} else { /* Strings a... | false | false | false | false | false | 0 |
headerbar_bitmap(unsigned bmap_id, unsigned alignment, void (*f)(void))
{
unsigned hb_index;
if ((bx_headerbar_entries+1) > BX_MAX_HEADERBAR_ENTRIES)
BX_PANIC(("x: too many headerbar entries, increase BX_MAX_HEADERBAR_ENTRIES"));
bx_headerbar_entries++;
hb_index = bx_headerbar_entries - 1;
bx_headerbar... | false | false | false | false | false | 0 |
emitMessage(void *arg, int msg_level) const
{
jpeg_common_struct *cinfo = (jpeg_common_struct *)arg;
// This is how we map the message levels:
// -1 - 0: Warning (could also be errors, but no way to find out)
// 1 : Debug
// Everything else: Trace (No point in splitting this further up)
OFLogger::LogLe... | false | false | false | false | false | 0 |
morekbd()
{
auto char s[BIGBUFSIZ * 2];
auto char *ps = s;
auto int n, chan;
if ((n = read(sockets[STDIN].descriptor, ps, BIGBUFSIZ)) > 0) {
ps += n;
*ps = 0;
switch (*s) {
case 'l' : print_msg(PRT_SHOWNUMBERS, "Recent caller's:\n");
addlist(-1, SETUP, 3);
break;
case 'h' :... | true | true | false | false | true | 1 |
find_last_not_of( const UTFString& str, size_type index /*= npos*/, size_type num /*= npos */ ) const
{
size_type i = 0;
const size_type len = length();
if ( index > len ) index = len - 1;
while ( i < num && ( index - i ) != npos ) {
size_type j = index - i;
... | false | false | false | false | false | 0 |
tray_icon2_preferences_construct(GtkWidget * container)
{
gchar *path = gmpc_get_full_glade_path("preferences-trayicon.ui");
tray_icon2_preferences_xml = gtk_builder_new();
gtk_builder_add_from_file(tray_icon2_preferences_xml, path, NULL);
q_free(path);
if (tray_icon2_preferences_xml)
{
... | false | false | false | false | false | 0 |
net80211_change_channel ( struct net80211_device *dev, int channel )
{
int i, oldchan = dev->channel;
assert ( dev->netdev->state & NETDEV_OPEN );
for ( i = 0; i < dev->nr_channels; i++ ) {
if ( dev->channels[i].channel_nr == channel ) {
dev->channel = i;
break;
}
}
if ( i == dev->nr_channels )
retu... | false | false | false | false | false | 0 |
joinpath(char *buffer, char *stuff)
{
size_t n, k;
if (stuff[0] == SEP)
n = 0;
else {
n = strlen(buffer);
if (n > 0 && buffer[n-1] != SEP && n < MAXPATHLEN)
buffer[n++] = SEP;
}
if (n > MAXPATHLEN)
Py_FatalError("buffer overflow in getpath.c's joinpath()")... | false | true | false | false | false | 1 |
registerResources(QTextDocument *document) const
{
if (!document) {
return;
}
QHashIterator<QString, ToolTipResource> it(d->resources);
while (it.hasNext()) {
it.next();
const ToolTipResource &r = it.value();
QTextDocument::ResourceType t = QTextDocument::ImageResource;
... | false | false | false | false | false | 0 |
TimerHandler(int n,int c,int count,double stepTime)
{
if( count == 0 )
{ /* Reset FM Timer */
timer_enable(Timer[n][c], 0);
}
else
{ /* Start FM Timer */
double timeSec = (double)count * stepTime;
double slack;
slack = timer_get_time() - lastfired[n][c];
/* hackish way to make bstars intro s... | false | false | false | false | false | 0 |
arggetc(arg_t *arg)
{
if(*arg->s == '\0') return(ARG_EOS);
if((!(arg->opts & ARG_NO_ESCAPE) && *arg->s == '\\') &&
!(arg->quote && *(arg->s + 1) != '"'))
{
if(*(++arg->s) == '\0') return(ARG_EOS);
return((int) *(arg->s++));
}
if(!(arg->opts & ARG_NO_QUOTE) && *arg->s == '"')
{
arg->s++;
arg->quot... | false | false | false | false | false | 0 |
traverse(CXMLElementVisitor& inoutVisitor){
//if there are children, visit them
if(inoutVisitor.startVisit(*this)){
if(mChildren.size()){
for(lCChildren::const_iterator i=mChildren.begin();
i!=mChildren.end();
i++){
(*i)->traverse(inoutVisitor);
}
}
inoutVisitor.endVisit(*this);
}
} | false | false | false | false | false | 0 |
SetUserViewTransform(vtkHomogeneousTransform *transform)
{
if (transform == this->UserViewTransform)
{
return;
}
if (this->UserViewTransform)
{
this->UserViewTransform->RemoveObserver(
this->UserViewTransformCallbackCommand);
this->UserViewTransform->Delete();
this->UserViewTransfo... | false | false | false | false | false | 0 |
MOA_Seed(uint32_t seed) {
int i;
uint32_t s = seed;
for (i = 0; i < 5; i++) {
s = s * 29943829 - 1;
MOA_X[i] = s;
}
for (i=0; i<19; i++) MOA_Random_32();
} | false | false | false | false | false | 0 |
ssd_get_ot_status(struct ssd_device *dev, int *status)
{
uint32_t off;
uint32_t val;
int i;
if (!dev || !status) {
return -EINVAL;
}
if (dev->protocol_info.ver >= SSD_PROTOCOL_V3_2_2) {
for (i=0; i<dev->hw_info.nr_ctrl; i++) {
off = SSD_READ_OT_REG0 + (i * SSD_CTRL_REG_ZONE_SZ);
val = ssd_reg32_read(d... | false | false | false | false | false | 0 |
knotu(int n,int c,int x[])
{
int nplusc,nplus2,i;
nplusc = n + c;
nplus2 = n + 2;
x[1] = 0;
for (i = 2; i <= nplusc; i++){
x[i] = i-1;
}
} | false | false | false | false | false | 0 |
addPredefinedGlobalIdent(const char *ident)
{
if (!global.params.versionids)
global.params.versionids = new Strings();
global.params.versionids->push((char *)ident);
} | false | false | false | false | false | 0 |
runOnFunction(Function &F) {
if (skipOptnoneFunction(F))
return false;
TTI = &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
// Traverse the dominator tree in the depth-first ord... | false | false | false | false | false | 0 |
apol_context_create_from_qpol_context(const apol_policy_t * p, const qpol_context_t * context)
{
apol_context_t *c = NULL;
const qpol_user_t *user;
const qpol_role_t *role;
const qpol_type_t *type;
const qpol_mls_range_t *range;
const char *user_name, *role_name, *type_name;
apol_mls_range_t *apol_range = NULL;
... | false | false | false | false | false | 0 |
getOpRegClass(const MachineInstr &MI,
unsigned OpNo) const {
const MachineRegisterInfo &MRI = MI.getParent()->getParent()->getRegInfo();
const MCInstrDesc &Desc = get(MI.getOpcode());
if (MI.isVariadic() || OpNo >= Desc.getNumOperands() ||
Desc.OpInfo[Op... | false | false | false | false | false | 0 |
lme2510_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
int num)
{
struct dvb_usb_device *d = i2c_get_adapdata(adap);
struct lme2510_state *st = d->priv;
static u8 obuf[64], ibuf[64];
int i, read, read_o;
u16 len;
u8 gate = st->i2c_gate;
mutex_lock(&d->i2c_mutex);
if (gate == 0)
gate = 5;
fo... | false | true | false | false | true | 1 |
iscsit_release_discovery_tpg(void)
{
struct iscsi_portal_group *tpg = iscsit_global->discovery_tpg;
if (!tpg)
return;
core_tpg_deregister(&tpg->tpg_se_tpg);
kfree(tpg);
iscsit_global->discovery_tpg = NULL;
} | false | false | false | false | false | 0 |
GetFeature( long nFeatureId )
{
if (!TouchLayer())
return NULL;
OGRFeature *poFeature = NULL;
poFeature = SHPReadOGRFeature( hSHP, hDBF, poFeatureDefn, nFeatureId, NULL,
osEncoding );
if( poFeature != NULL )
{
if( poFeature->GetGeometryRef() != N... | false | false | false | false | false | 0 |
me_unkline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
const char *user, *host;
/* user host */
if(!IsClient(source_p))
return 0;
user = parv[1];
host = parv[2];
if(!find_shared_conf(source_p->username, source_p->host,
source_p->servptr->name, SHARED_UNKLINE))
... | false | false | false | false | false | 0 |
evhttp_get_request(struct evhttp *http, int fd,
struct sockaddr *sa, socklen_t salen)
{
struct evhttp_connection *evcon;
evcon = evhttp_get_request_connection(http, fd, sa, salen);
if (evcon == NULL)
return;
/* the timeout can be used by the server to close idle connections */
if (http->timeout != -1)
ev... | false | false | false | false | false | 0 |
blogic_deladapter(struct blogic_adapter *adapter)
{
struct Scsi_Host *host = adapter->scsi_host;
scsi_remove_host(host);
/*
FlashPoint Host Adapters must first be released by the FlashPoint
SCCB Manager.
*/
if (blogic_flashpoint_type(adapter))
FlashPoint_ReleaseHostAdapter(adapter->cardhandle);
/*
... | false | false | false | false | false | 0 |
cisco_autorp_print(register const u_char *bp, register u_int len)
{
int type;
int numrps;
int hold;
TCHECK(bp[0]);
(void)printf(" auto-rp ");
type = bp[0];
switch (type) {
case 0x11:
(void)printf("candidate-advert");
break;
case 0x12:
(void)printf("mapping");
break;
default:
(void)printf("type-0x%0... | false | false | false | false | false | 0 |
GetScratchRegister(bool Is64Bit, const MachineFunction &MF) {
if (Is64Bit) {
return X86::R11;
} else {
CallingConv::ID CallingConvention = MF.getFunction()->getCallingConv();
bool IsNested = HasNestArgument(&MF);
if (CallingConvention == CallingConv::X86_FastCall) {
if (IsNested) {
re... | false | false | false | false | false | 0 |
s_alloc_state(gs_memory_t * mem, gs_memory_type_ptr_t stype,
client_name_t cname)
{
stream_state *st = gs_alloc_struct(mem, stream_state, stype, cname);
if_debug3m('s', mem, "[s]alloc_state %s(%s) = 0x%lx\n",
client_name_string(cname),
client_name_string(stype->sname... | false | false | false | false | false | 0 |
M_ReactToDamage (edict_t * targ, edict_t * attacker)
{
if (!(attacker->client) && !(attacker->svflags & SVF_MONSTER))
return;
if (attacker == targ || attacker == targ->enemy)
return;
// if we are a good guy monster and our attacker is a player
// or another good guy, do not get mad at them
if (targ->monsteri... | false | false | false | false | false | 0 |
sharedsv_scalar_store(pTHX_ SV *sv, SV *ssv)
{
dTHXc;
bool allowed = TRUE;
assert(PL_sharedsv_lock.owner == aTHX);
if (!PL_dirty && SvROK(ssv) && SvREFCNT(SvRV(ssv)) == 1) {
SV *sv = sv_newmortal();
sv_upgrade(sv, SVt_RV);
get_RV(sv, SvRV(ssv));
}
if (SvROK(sv)) {
... | false | false | false | false | false | 0 |
extstate_read(struct ast_channel *chan, const char *cmd, char *data,
char *buf, size_t len)
{
char *exten, *context;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "EXTENSION_STATE requires an extension\n");
return -1;
}
context = exten = data;
strsep(&context, "@");
if (ast_strlen_zero(context))
cont... | false | false | false | false | false | 0 |
btrfs_free_dev_extent(struct btrfs_trans_handle *trans,
struct btrfs_device *device,
u64 start, u64 *dev_extent_len)
{
int ret;
struct btrfs_path *path;
struct btrfs_root *root = device->dev_root;
struct btrfs_key key;
struct btrfs_key found_key;
struct extent_buffer *leaf = NULL;
struct btrfs_dev_exte... | 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.