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 |
|---|---|---|---|---|---|---|
isInside(Inset const * p) const
{
for (size_t i = 0; i != depth(); ++i)
if (&operator[](i).inset() == p)
return true;
return false;
} | false | false | false | false | false | 0 |
rx_get_data_ind(rxdrv_t *rx)
{
rx_check(rx);
g_assert(rx->upper == NULL); /* Called on topmost driver */
g_assert(0 == (rx->flags & RX_F_FROM));
return rx->data.ind;
} | false | false | false | false | false | 0 |
verify(const Poco::Crypto::X509Certificate& certificate, const std::string& hostName)
{
std::string commonName;
std::set<std::string> dnsNames;
certificate.extractNames(commonName, dnsNames);
bool ok = (dnsNames.find(hostName) != dnsNames.end());
char buffer[NAME_BUFFER_SIZE];
X509_NAME* subj = 0;
if (!ok && ... | false | false | false | false | false | 0 |
CDB___db_xa_commit(xid, rmid, flags)
XID *xid;
int rmid;
long flags;
{
DB_ENV *env;
TXN_DETAIL *td;
size_t off;
if (LF_ISSET(TMASYNC))
return (XAER_ASYNC);
#undef OK_FLAGS
#define OK_FLAGS (TMNOFLAGS | TMNOWAIT | TMONEPHASE)
if (LF_ISSET(~OK_FLAGS))
return (XAER_INVAL);
/*
* We need to know if we've ev... | false | false | false | false | false | 0 |
GetInflectionPoints(double *inflectionPoints)
{
vtkIdType i;
for (i=0; i < this->GetNumberOfInflectionPoints(); i++)
{
inflectionPoints[i] = this->InflectionPoints->GetValue(i);
}
} | false | false | false | false | false | 0 |
deinterlace_probe(struct platform_device *pdev)
{
struct deinterlace_dev *pcdev;
struct video_device *vfd;
dma_cap_mask_t mask;
int ret = 0;
pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev), GFP_KERNEL);
if (!pcdev)
return -ENOMEM;
spin_lock_init(&pcdev->irqlock);
dma_cap_zero(mask);
dma_cap_set(DMA_INTERL... | false | false | false | false | false | 0 |
SwitchMode( unsigned short newmode ) {
Mission *m = Gam->GetMission();
if ( newmode == CW_MODE_PRODUCTION ) { // only buildings, current
// mode must be CW_MODE_NORMAL
// create production list
Building *b = static_cast<Building *>(c);
un... | false | false | false | false | false | 0 |
dirname(QString path) {
QString tempString;
int size = path.size();
tempString = path;
//cout << "tempString is\n" << tempString.toStdString() << "\n";
for (int i = size - 1; i > 0; i--) {
if (tempString[i] == QDir::separator()) {
tempString.chop(size - i);
break;
... | false | false | false | false | false | 0 |
sigint_allow(void)
{
struct sigaction handler;
sigset_t sigs;
/*
* Do not overwrite the backed-up handler data -
* just increase nesting count.
*/
if (_handler_installed) {
_handler_installed++;
return;
}
/* Grab old sigaction for SIGINT: shall not fail. */
sigaction(SIGINT, NULL, &handler);
handler... | false | false | false | false | false | 0 |
access_oid(oid * it, size_t * len, const char *groupName,
const char *prefix, int model, int level)
{
int i;
int itIndex = ACCESS_OID_LEN;
*len = itIndex + 4 + +strlen(groupName);
it[itIndex++] = strlen(groupName);
for (i = 0; i < (int) strlen(groupName); i++)
... | false | false | false | false | false | 0 |
compile_vpi_lookup(vpiHandle *handle, char*label)
{
if (strcmp(label, "$time") == 0) {
*handle = vpip_sim_time(vpip_peek_current_scope(), false);
free(label);
return;
}
if (strcmp(label, "$stime") == 0) {
*handle = vpip_sim_time(vpip_peek_current_scope(), true);
free(label);
... | false | false | false | false | false | 0 |
fprint_all_stats(FILE *fp, char *stats_level)
{
update_stats();
print_separator(fp, "STATISTICS", TRUE);
fprint_prover_stats(fp, Stats, stats_level);
fprint_prover_clocks(fp, Clocks);
if (str_ident(stats_level, "all")) {
print_memory_stats(fp);
selector_report();
/* p_sos_dist(); */
}
prin... | false | false | false | false | false | 0 |
vmEEProps(_TCHAR * eeFile, _TCHAR ** msg) {
if (processEEProps(eeFile) != 0) {
*msg = _tcsdup(eeFile);
return -1;
}
if (eeLibrary != NULL) {
jniLib = findVMLibrary(eeLibrary);
if (jniLib != NULL)
return LAUNCH_JNI;
}
if (eeConsole != NULL && (debug || needConsole || consoleLauncher) ) {
javaVM = fi... | false | false | false | false | false | 0 |
QuickSort( Link *l, Link *r, int size, LLCompareFunc cmp )
{
Link *i, *j;
void *p, *t;
int lp, rp;
/* determine pivot */
lp = size / 2;
for( i=l; --lp > 0; i=i->next );
p = i->pObj;
/* initialize vars */
i = l; j = r;
lp = 0; rp = size-1;
/* sort */
for(;;) {
while( cmp( i->pObj, p ) < 0 ... | false | false | false | false | false | 0 |
reset_indexed_pic() {
if (_picbuf) {
for (int i=0; i<_picnum; i++)
delete _picbuf[i];
delete _picbuf;
_picbuf = nil;
}
} | false | false | false | false | false | 0 |
rtsx_usb_ms_drv_remove(struct platform_device *pdev)
{
struct rtsx_usb_ms *host = platform_get_drvdata(pdev);
struct memstick_host *msh;
int err;
msh = host->msh;
host->eject = true;
cancel_work_sync(&host->handle_req);
mutex_lock(&host->host_mutex);
if (host->req) {
dev_dbg(&(pdev->dev),
"%s: Controller... | false | false | false | false | false | 0 |
item_cursor_realize (GocItem *item)
{
GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
parent_class->realize (item);
ic_reload_style (ic);
if (ic->style == GNM_ITEM_CURSOR_ANTED) {
g_return_if_fail (ic->animation_timer == 0);
ic->animation_timer = g_timeout_add (
150, (GSourceFunc) cb_item_cursor_animation,
... | false | false | false | false | false | 0 |
IDirectFB_Construct( IDirectFB *thiz, CoreDFB *core )
{
DFBResult ret;
DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFB)
D_DEBUG_AT( IDFB, "%s( %p, %p )\n", __FUNCTION__, thiz, core );
data->ref = 1;
data->core = core;
data->level = DFSCL_NORMAL;
if (dfb_layer_num() < 1) {
... | false | false | false | false | false | 0 |
sess_auth_rawntlmssp_negotiate(struct sess_data *sess_data)
{
int rc;
struct smb_hdr *smb_buf;
SESSION_SETUP_ANDX *pSMB;
struct cifs_ses *ses = sess_data->ses;
__u16 bytes_remaining;
char *bcc_ptr;
u16 blob_len;
cifs_dbg(FYI, "rawntlmssp session setup negotiate phase\n");
/*
* if memory allocation is succe... | false | false | false | false | false | 0 |
clusterLockConfig(char *filename) {
/* flock() does not exist on Solaris
* and a fcntl-based solution won't help, as we constantly re-open that file,
* which will release _all_ locks anyway
*/
#if !defined(__sun)
/* To lock it, we need to open the file in a way it is created if
* it does not exist, otherwis... | false | false | false | false | false | 0 |
Find(RedBlackTree *Tree, void *query_key, void *ExtraArgs)
{
RedBlackTreeNode *node = Tree->root,*tmp_node;
CompareInfo ci;
int cmpval;
if (node->left == NULL)
return NULL;
tmp_node = node;
ci.ContainerLeft = Tree;
ci.ContainerRight = NULL;
ci.ExtraArgs = ExtraArgs;
while (t... | false | false | false | false | false | 0 |
get_domain (pl_inode_t *pl_inode, const char *volume)
{
pl_dom_list_t *dom = NULL;
GF_VALIDATE_OR_GOTO (POSIX_LOCKS, pl_inode, out);
GF_VALIDATE_OR_GOTO (POSIX_LOCKS, volume, out);
pthread_mutex_lock (&pl_inode->mutex);
{
list_for_each_entry (dom, &pl_inode->dom... | false | false | false | false | false | 0 |
print_kyocera_makervalue(struct ifd_entry *entry_ptr,int make,int model,
char *prefix)
{
int noteversion = 0;
noteversion = getnoteversion();
if(entry_ptr && (PRINT_VALUE))
{
switch(noteversion)
{
case 1:
print_kyocera1_makervalue(entry_p... | false | false | false | false | false | 0 |
term_telltc(EditLine *el, int argc __attribute__((__unused__)),
const Char **argv __attribute__((__unused__)))
{
const struct termcapstr *t;
char **ts;
(void) fprintf(el->el_outfile, "\n\tYour terminal has the\n");
(void) fprintf(el->el_outfile, "\tfollowing characteristics:\n\n");
(void) fprintf(el->el_outfi... | false | false | false | false | false | 0 |
view_get_lines_height(TEXT_BUFFER_VIEW_REC *view,
LINE_REC *line, int subline,
LINE_REC *skip_line)
{
int height, linecount;
height = -subline;
while (line != NULL && height < view->height) {
if (line != skip_line) {
linecount = view_get_linecount(view, line);
height +=... | false | false | false | false | false | 0 |
getPrev(void) const
{
UT_return_val_if_fail(m_pMyNode,NULL);
pf_Fragments::Iterator it(&(m_pPieceTable->getFragments()),m_pMyNode);
it--;
return it.value();
} | false | false | false | false | false | 0 |
TransferCheck(int act)
{
if(act==225 || act==226) // data connection is still open or ABOR worked.
{
copy_done=true;
conn->CloseAbortedDataConnection();
if(!conn->received_150 && state!=DATA_OPEN_STATE)
goto simulate_eof;
}
if(act==211)
{
// permature STAT?
conn->stat_tim... | false | false | false | false | false | 0 |
lp_divcapture (lua_State *L) {
switch (lua_type(L, 2)) {
case LUA_TFUNCTION: return capture_aux(L, Cfunction, 2);
case LUA_TTABLE: return capture_aux(L, Cquery, 2);
case LUA_TSTRING: return capture_aux(L, Cstring, 2);
case LUA_TNUMBER: {
int n = lua_tointeger(L, 2);
TTree *tree = newroot1s... | false | false | false | false | false | 0 |
remove_jcr_from_tsd(JCR *jcr)
{
JCR *tjcr = get_jcr_from_tsd();
if (tjcr == jcr) {
set_jcr_in_tsd(INVALID_JCR);
}
} | false | false | false | false | false | 0 |
panel_applet_menu_cmd_remove (GtkAction *action,
PanelApplet *applet)
{
GError *error = NULL;
if (!applet->priv->connection)
return;
g_dbus_connection_emit_signal (applet->priv->connection,
NULL,
applet->priv->object_path,
PANEL_APPLET_INTERFACE,
"RemoveFrom... | false | false | false | false | false | 0 |
gst_value_is_subset_int_range_int_range (const GValue * value1,
const GValue * value2)
{
gint gcd;
g_return_val_if_fail (GST_VALUE_HOLDS_INT_RANGE (value1), FALSE);
g_return_val_if_fail (GST_VALUE_HOLDS_INT_RANGE (value2), FALSE);
if (INT_RANGE_MIN (value1) * INT_RANGE_STEP (value1) <
INT_RANGE_MIN ... | false | false | false | false | false | 0 |
initBoundaries()
{
int index = 0;
while (true) {
BodyElement* be = getBoundary(index++);
if (be==NULL) break;
//-Check status
beStatus be_stat = be->getStatus();
}
} | false | false | false | false | false | 0 |
cd_profile_set_property_finish (CdProfile *profile,
GAsyncResult *res,
GError **error)
{
GSimpleAsyncResult *simple;
g_return_val_if_fail (CD_IS_PROFILE (profile), FALSE);
g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
simple =... | false | false | false | false | false | 0 |
clutter_input_device_get_key (ClutterInputDevice *device,
guint index_,
guint *keyval,
ClutterModifierType *modifiers)
{
ClutterKeyInfo *key_info;
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (d... | false | false | false | false | false | 0 |
encode_otherinfo(krb5_context context,
const AlgorithmIdentifier *ai,
krb5_const_principal client,
krb5_const_principal server,
krb5_enctype enctype,
const krb5_data *as_req,
const krb5_data *pk_as_rep,
const Ticket *ticket,
krb5_data *other)
{
PkinitSP80056AOtherInfo otherinfo;
PkinitSu... | true | true | false | false | false | 1 |
get_uid(const char *user_name, int *out_gid)
{
char *endptr;
struct passwd *pw;
if(!user_name) return 0;
if (isdigit(user_name[0]) == 0) {
pw = getpwnam(user_name);
if (pw != NULL) {
if (out_gid)
if(*out_gid == 0)
*out_gid = pw->pw_gid;
return pw->pw... | false | false | false | false | false | 0 |
gmsg_dump(FILE *out, const void *data, uint32 size)
{
g_assert(size >= GTA_HEADER_SIZE);
dump_hex(out, gmsg_infostr_full(data, size),
(char *) data + GTA_HEADER_SIZE, size - GTA_HEADER_SIZE);
} | false | false | false | false | false | 0 |
show_mouse()
{
SHOW_ALL_NL;
if (mouse_setting.on) {
fprintf(stderr, "\tmouse is on\n");
if (mouse_setting.annotate_zoom_box) {
fprintf(stderr, "\tzoom coordinates will be drawn\n");
} else {
fprintf(stderr, "\tno zoom coordinates will be drawn\n");
}
if (mouse_setting.polardistance) {
fprint... | false | false | false | false | false | 0 |
TIFFCheckDirOffset(TIFF* tif, uint64 diroff)
{
uint16 n;
if (diroff == 0) /* no more directories */
return 0;
for (n = 0; n < tif->tif_dirnumber && tif->tif_dirlist; n++) {
if (tif->tif_dirlist[n] == diroff)
return 0;
}
tif->tif_dirnumber++;
if (tif->tif_dirnumber > tif->tif_dirlistsi... | false | false | false | false | false | 0 |
unlock_rename(struct dentry *p1, struct dentry *p2)
{
mutex_unlock(&p1->d_inode->i_mutex);
if (p1 != p2) {
mutex_unlock(&p2->d_inode->i_mutex);
mutex_unlock(&p1->d_inode->i_sb->s_vfs_rename_mutex);
}
} | false | false | false | false | false | 0 |
gamma_se(){ //Equation (?) AGLB2013
double gamma = 0;
if (mynode->s != 0 && mynode->time.Myr > mynode->T_SE)
gamma += (nu*mynode->t_rhp.nbody)/mynode->time.nbody\
*(mynode->mm_se.nbody/mynode->mm.nbody);
return gamma;
} | false | false | false | false | false | 0 |
secoid_HashDynamicOiddata(const SECOidData * oid)
{
PLHashEntry *entry;
if (!dynOidHash) {
dynOidHash = PL_NewHashTable(0, SECITEM_Hash, SECITEM_HashCompare,
PL_CompareValues, NULL, NULL);
if ( !dynOidHash ) {
return SECFailure;
}
}
entry = PL_HashTableAdd( dynOidHash, &oid->oid, (vo... | false | false | false | false | false | 0 |
hb_ot_tag_to_language (hb_tag_t tag)
{
unsigned int i;
unsigned char buf[8] = "ot:";
for (i = 0; i < ARRAY_LENGTH (ot_languages); i++)
if (ot_languages[i].tag == tag)
return hb_language_from_string (ot_languages[i].language);
buf[3] = tag >> 24;
buf[4] = (tag >> 16) & 0xFF;
buf[5] = (tag >> 8) &... | false | false | false | false | false | 0 |
e1000_has_link(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
bool link_active = false;
/* get_link_status is set on LSC (link status) interrupt or rx
* sequence error interrupt (except on intel ce4100).
* get_link_status will stay false until the
* e1000_check_for_link establishes link ... | false | false | false | false | false | 0 |
pqSaveParameterStatus(PGconn *conn, const char *name, const char *value)
{
pgParameterStatus *pstatus;
pgParameterStatus *prev;
if (conn->Pfdebug)
fprintf(conn->Pfdebug, "pqSaveParameterStatus: '%s' = '%s'\n",
name, value);
/*
* Forget any old information about the parameter
*/
for (pstatus = conn->pst... | false | true | true | false | false | 1 |
ucbuf_getc(UCHARBUF* buf,UErrorCode* error){
if(error==NULL || U_FAILURE(*error)){
return FALSE;
}
if(buf->currentPos>=buf->bufLimit){
if(buf->remaining==0){
return U_EOF;
}
buf=ucbuf_fillucbuf(buf,error);
if(U_FAILURE(*error)){
return U_EOF;
... | false | false | false | false | false | 0 |
insert_tree_into_hash_rek(AP_tree * node) {
node->gr.gc = 0;
if (node->is_leaf) {
GBS_write_hash(hash_2_ap_tree, node->name, (long) node);
} else {
insert_tree_into_hash_rek(node->leftson);
insert_tree_into_hash_rek(node->rightson);
}
} | false | false | false | false | false | 0 |
gst_rtsp_options_from_text (const gchar * options)
{
GstRTSPMethod methods;
gchar **ostr;
gint i;
/* The string is like:
* OPTIONS, DESCRIBE, ANNOUNCE, PLAY, SETUP, ...
*/
ostr = g_strsplit (options, ",", 0);
methods = 0;
for (i = 0; ostr[i]; i++) {
gchar *stripped;
GstRTSPMethod method;
... | false | false | false | false | false | 0 |
test_iochannel (void)
{
GIOChannel *gio_r, *gio_w ;
GString *buffer;
char *filename;
char *srcdir = getenv ("srcdir");
gint rlength = 0;
glong wlength = 0;
gsize length_out;
const gchar encoding[] = "EUC-JP";
GIOStatus status;
GIOFlags flags;
GError *error = NULL;
if (!srcdir)
srcdir = ".";... | false | false | false | false | true | 1 |
borg_defend_aux_hero( int p1 )
{
int fail_allowed = 15;
/* already hero */
if (borg_hero)
return (0);
/* Cant when screwed */
if (borg_skill[BI_ISBLIND] || borg_skill[BI_ISCONFUSED] || borg_skill[BI_ISFORGET]) return (0);
if ( !borg_spell_okay_fail(7, 0, fail_allowed ) &&
-1 == ... | false | false | false | false | false | 0 |
DecodeString(char *retStr, int maxLen)
{
char *b = rxBuffer->getBuffer();
if(ascii2uint(&b,2) == eGPSIM_TYPE_STRING) {
int length = ascii2uint(&b,2);
maxLen--; // reserve space for a terminating 0.
length = (maxLen < length) ? maxLen : length;
strncpy(retStr, b, length);
retStr[length] =... | false | false | false | false | false | 0 |
ext2fs_get_rec_len(ext2_filsys fs,
struct ext2_dir_entry *dirent,
unsigned int *rec_len)
{
unsigned int len = dirent->rec_len;
if (fs->blocksize < 65536)
*rec_len = len;
else if (len == EXT4_MAX_REC_LEN || len == 0)
*rec_len = fs->blocksize;
else
*rec_len = (len & 65532) | ((len & 3) << 16);... | false | false | false | false | false | 0 |
cib_ipc_servers_init(qb_ipcs_service_t **ipcs_ro,
qb_ipcs_service_t **ipcs_rw,
qb_ipcs_service_t **ipcs_shm,
struct qb_ipcs_service_handlers *ro_cb,
struct qb_ipcs_service_handlers *rw_cb)
{
*ipcs_ro = mainloop_add_ipc_server(cib_channel_ro, QB_IPC_NATIVE, ro_cb);
*ipcs_rw = main... | false | false | false | false | false | 0 |
getpwent_r(struct passwd *res, char *buf, size_t buflen,
struct passwd **res_sig) {
size_t i,j,n;
unsigned long l;
if (!__ps.buffirst) setpwent();
if (!__ps.buffirst) goto error;
if (__ps.cur>=__ps.buflen) goto error;
again:
n=0;
for (i=0; i<7; ++i) {
j=__parse_1(&__ps,':');
if (__ps.buffi... | false | true | false | false | false | 1 |
slapi_attr_get_oid_copy( const Slapi_Attr *a, char **oidp )
{
struct asyntaxinfo *asi = attr_syntax_get_by_name(a->a_type);
if (asi) {
*oidp = slapi_ch_strdup( asi->asi_oid );
attr_syntax_return(asi);
return( 0 );
} else {
*oidp = NULL;
return( -1 );
}
} | false | false | false | false | false | 0 |
make_texture (void)
{
guchar *tex_data, *p;
CoglTexture *tex;
tex_data = g_malloc (TEXTURE_SIZE * TEXTURE_SIZE * 4);
for (p = tex_data + TEXTURE_SIZE * TEXTURE_SIZE * 4; p > tex_data;)
{
*(--p) = 255;
*(--p) = 0;
*(--p) = 0;
*(--p) = 255;
}
tex = test_utils_texture_new_from_... | false | false | false | false | false | 0 |
dom_node_namespace_uri_read(dom_object *obj, zval **retval TSRMLS_DC)
{
xmlNode *nodep;
char *str = NULL;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
return FAILURE;
}
switch (nodep->type) {
case XML_ELEMENT_NODE:
case XML_ATTRIBUTE_NODE:
... | false | false | false | false | false | 0 |
deinit()
{
if( init_flag )
{
mem_del(unit_info_array);
mem_del(attack_info_array);
res_large_icon.deinit();
res_general_icon.deinit();
res_king_icon.deinit();
res_small_icon.deinit();
// ######## begin Gilbert 17/10 ##########//
res_general_small_icon.deinit();
res_king_small_icon.deinit();
// ##... | false | false | false | false | false | 0 |
on_uevent (GUdevClient *client, gchar *action, GUdevDevice *device, gpointer user_data)
{
GMtpVolumeMonitor *monitor = G_MTP_VOLUME_MONITOR (user_data);
g_debug ("on_uevent: action=%s, device=%s", action, g_udev_device_get_device_file(device));
/* filter out uninteresting events */
if (!g_udev_device_has_prop... | false | false | false | false | false | 0 |
xmlGetChildText(xmlNodePtr el, xmlChar *el_name)
{
xmlNodePtr child, val;
for (child = el->children; child != NULL; child = child->next) {
if (xmlStreq(child->name, el_name)) {
if ((val = child->children) == NULL
|| val->type != XML_TEXT_NODE || val->next != NULL
|| val->content == NULL)
return(NULL)... | false | false | false | false | false | 0 |
addEntity( EntitiesLayer *entities,
const string& tagset,
const vector<Word*>& words,
const vector<double>& confs,
const string& NER ){
double c = 1;
for ( size_t i=0; i < confs.size(); ++i )
c *= confs[i];
KWargs args;
args["class"] = NER;
args["confidence"] = toStri... | false | false | false | false | false | 0 |
convert(const std::string & file_in, const std::string & codec_in,
const std::string & file_out, const std::string & codec_out)
{
std::cout << "Convert " << codec_in << " to " << codec_out << std::endl;
std::fstream in, out;
in.open( file_in.c_str(), std::ios::in );
if (!in.is_open()) {
... | false | false | false | false | false | 0 |
ComputeWorldPosition( vtkRenderer *ren,
double displayPos[2],
double worldPos[3],
double worldOrient[9] )
{
double fp[4];
ren->GetActiveCamera()->GetFocalPoint(... | false | false | false | false | false | 0 |
d_def_14_(fortint * outputArray, unsigned char * gribSection1) {
/*
// Decodes ECMWF local definition 14 (from byte 41 onwards) from
// gribSection1 into integer array values in outputArray.
//
// inputArray[0] corresponds to KSEC1(37) in the description at
// http://www.ecmwf.int/publications/manuals/libraries/gribex/... | false | false | false | false | false | 0 |
bitmap_set_replace_value (bitmap_set_t set, unsigned int lookfor,
const pre_expr expr)
{
bitmap_set_t exprset;
unsigned int i;
bitmap_iterator bi;
if (value_id_constant_p (lookfor))
return;
if (!bitmap_set_contains_value (set, lookfor))
return;
/* The number of expressions having a given val... | false | false | false | false | false | 0 |
funcnames_to_indices(const char *name_list, size_t **indices, int full) {
size_t i = 0;
const char *name_start;
if( ( indices == NULL ) || ( *indices != NULL ) )
return 0;
*indices = calloc( lengthof(statgrab_test_funcs), sizeof(indices[0]) );
if( *indices == NULL )
return 0;
for( name_start = name_list; *n... | false | false | false | false | true | 1 |
AddMemo(struct MemoInfo *mptr, struct Memo *memoptr)
{
/*
* Add memoptr onto the end of mptr->memos because we want
* the most recent memos last for the LIST command
*/
memoptr->next = NULL;
if (!mptr->memos)
{
mptr->memos = mptr->lastmemo = memoptr;
mptr->prev = NULL;
}
else
{
mptr->lastmemo->next... | false | false | false | false | false | 0 |
timekeeping_max_deferment(void)
{
struct timekeeper *tk = &tk_core.timekeeper;
unsigned long seq;
u64 ret;
do {
seq = read_seqcount_begin(&tk_core.seq);
ret = tk->tkr_mono.clock->max_idle_ns;
} while (read_seqcount_retry(&tk_core.seq, seq));
return ret;
} | false | false | false | false | false | 0 |
GetChannelGroupList(bool bRadio)
{
MutexLock lock(&m_cmdlock);
MsgPacket vrp(XVDR_CHANNELGROUP_LIST);
vrp.put_U8(bRadio);
MsgPacket* vresp = ReadResult(&vrp);
if (vresp == NULL || vresp->eop())
{
delete vresp;
return false;
}
while (!vresp->eop())
{
ChannelGroup group(vresp);
m_clie... | false | false | false | false | false | 0 |
DBFClose(DBFHandle psDBF)
{
if( psDBF == NULL )
return;
/* -------------------------------------------------------------------- */
/* Write out header if not already written. */
/* -------------------------------------------------------------------- */
if( psDBF->bNoHeader )... | false | false | false | false | false | 0 |
display_file (char *filename)
{
bfd_boolean retval = TRUE;
bfd *file;
char **matching;
if (get_file_size (filename) < 1)
return FALSE;
file = bfd_openr (filename, target ? target : plugin_target);
if (file == NULL)
{
bfd_nonfatal (filename);
return FALSE;
}
/* If printing line n... | false | false | false | false | false | 0 |
main(int argc, char** argv)
{
int port = 0;
const char *configFile = 0;
for (int i=1; i < argc; i++) {
if (!strcmp(argv[i], "-port")) {
if (argc < i+1) usage();
port = atoi(argv[++i]);
}
else if (!strcmp(argv[i], "-config")) {
if (argc < i+1) usage();
configFile... | false | false | false | false | false | 0 |
__dump_posixlks (pl_inode_t *pl_inode)
{
posix_lock_t *lock = NULL;
int count = 0;
char key[GF_DUMP_MAX_BUF_LEN];
char tmp[256];
list_for_each_entry (lock, &pl_inode->ext_list, list) {
SET_FLOCK_PID (&lock->user_flock, lock);
... | true | true | false | false | false | 1 |
signal_handler (int signal)
{
#ifdef DEBUG
printf ("signal_handler\n");
#endif
switch (signal)
{
case SIGHUP:
do_update = 1;
break;
case SIGINT:
case SIGTERM:
quit ();
break;
case SIGCHLD:
wait (NULL);
break;
}
} | false | false | false | false | false | 0 |
AT_SetCallNotification(gn_data *data, struct gn_statemachine *state)
{
at_driver_instance *drvinst = AT_DRVINST(state);
gn_error err;
if (!drvinst->call_notification && !data->call_notification)
return GN_ERR_NONE;
if (!drvinst->call_notification) {
if (sm_message_send(9, GN_OP_SetCallNotification, "AT+CRC=1\... | false | false | false | false | false | 0 |
acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state)
{
union acpi_generic_state *scope_info;
ACPI_FUNCTION_NAME(ds_scope_stack_clear);
while (walk_state->scope_info) {
/* Pop a scope off the stack */
scope_info = walk_state->scope_info;
walk_state->scope_info = scope_info->scope.next;
ACPI_DEBU... | false | false | false | false | false | 0 |
gx_concretize_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs_in,
frac * pconc, const gs_imager_state * pis, gx_device *dev)
{
int code;
gs_color_space *pcs_icc;
gs_client_color scale_pc;
gs_color_space *pcs = (gs_color_space *) pcs_in;
if_debug4m('c', pis->memo... | false | false | false | false | false | 0 |
refreshLine(int fd, char *prompt, char *buf, size_t len, size_t pos, size_t cols) {
char seq[64];
size_t plen = strlen(prompt);
while((plen+pos) >= cols) {
buf++;
len--;
pos--;
}
while (plen+len > cols) {
len--;
}
/* Cursor to left edge */
snprintf(s... | false | false | false | false | false | 0 |
strvec_from_word_list (list, alloc, starting_index, ip)
WORD_LIST *list;
int alloc, starting_index, *ip;
{
int count;
char **array;
count = list_length (list);
array = (char **)xmalloc ((1 + count + starting_index) * sizeof (char *));
for (count = 0; count < starting_index; count++)
array[coun... | false | false | false | false | false | 0 |
_e2pcr_read_file (VPATH *localpath, gpointer *filebuffer,
/*size_t*/ gulong filebuffersize)
{
if (filebuffersize > 0)
{
E2_ERR_DECLARE
/*ssize_t*/ gulong nread;
if (!e2_fs_get_file_contents (localpath, filebuffer, &nread,
FALSE E2_ERR_PTR()) || nread < filebuffersize)
{
printd (DEBUG, "cannot read whol... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
int error_count = 0;
MdfConsoleEngine engine(argc, argv, OFFIS_CONSOLE_APPLICATION);
error_count = engine.startProvidingService();
if (error_count == 1)
OFLOG_ERROR(dcmodifyLogger, "There was 1 error");
else if (error_count > 1)
OFLOG_ERROR(dcmodifyLogger, "There were " ... | false | false | false | false | false | 0 |
get_x509_subject_email(X509 *x)
{
char *result = NULL;
STACK_OF(OPENSSL_STRING) *emails = X509_get1_email(x);
if (sk_OPENSSL_STRING_num(emails) > 0) {
/* take the first one on the stack */
result = cpystr(sk_OPENSSL_STRING_value(emails, 0));
}
X509_email_free(emails);
return result;
} | false | false | false | false | false | 0 |
glob1(Char *pattern, Char *pattern_last, glob_t *pglob, struct glob_lim *limitp,
int recursion)
{
Char pathbuf[MAXPATHLEN];
/* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */
if (*pattern == EOS) {
return 0;
}
return glob2(pathbuf, pathbuf + MAXPATHLEN - 1,
p... | false | false | false | false | false | 0 |
BIO_read(BIO *b, void *out, int outl)
{
int i;
long (*cb)(BIO *,int,const char *,int,long,long);
if ((b == NULL) || (b->method == NULL) || (b->method->bread == NULL))
{
BIOerr(BIO_F_BIO_READ,BIO_R_UNSUPPORTED_METHOD);
return(-2);
}
cb=b->callback;
if ((cb != NULL) &&
((i=(int)cb(b,BIO_CB_READ,out,outl... | false | false | false | false | false | 0 |
lock_check_trx_id_sanity(
/*=====================*/
trx_id_t trx_id, /*!< in: trx id */
const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */
const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */
ibool has_kernel_mutex)/*!< in: TRUE if the caller owns the
kernel mutex */... | false | false | false | false | false | 0 |
amdmsCreateBadPixelMap(amdmsFITS *outfile, amdmsFITS_FLAGS flags, amdmsDATA *bpm)
{
int nPixels = bpm->nx*bpm->ny;
int nGoodPixels = nPixels;
int nBadPixels = 0;
int iPixel;
for (iPixel = 0; iPixel < nPixels; iPixel++) {
if (bpm->data[iPixel] == amdmsBAD_PIXEL) {
nGoodPixels--;
... | false | false | false | false | false | 0 |
ad7923_get_range(struct ad7923_state *st)
{
int vref;
vref = regulator_get_voltage(st->reg);
if (vref < 0)
return vref;
vref /= 1000;
if (!(st->settings & AD7923_RANGE))
vref *= 2;
return vref;
} | false | false | false | false | false | 0 |
gftp_get_transfer_action (gftp_request * request, gftp_file * fle)
{
intptr_t overwrite_default;
gftp_lookup_request_option (request, "overwrite_default", &overwrite_default);
/* FIXME - add code to compare the file times and make a decision based
on that. Also if overwrite_default is enabled and the file ... | false | false | false | false | false | 0 |
math3d_lib_quatf_ref(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj q_scm;
ScmQuatf* q;
ScmObj i_scm;
int i;
ScmObj fallback_scm;
ScmObj fallback;
ScmObj SCM_SUBRARGS[4];
int SCM_i;
SCM_ENTER_SUBR("quatf-ref");
if (SCM_ARGCNT >= 4
&& !SCM_NULLP(SCM_ARGREF(SCM_ARGCNT-1)))
Scm_Error("... | false | false | false | false | false | 0 |
set_text(std::string& str) {
_text_view.get_buffer()->set_text(str);
} | false | false | false | false | false | 0 |
btrfs_record_unlink_dir(struct btrfs_trans_handle *trans,
struct inode *dir, struct inode *inode,
int for_rename)
{
/*
* when we're logging a file, if it hasn't been renamed
* or unlinked, and its inode is fully committed on disk,
* we don't have to worry about walking up the directory chain
* ... | false | false | false | false | false | 0 |
gf_sg_route_unqueue(GF_SceneGraph *sg, GF_Route *r)
{
/*get the top level scene*/
while (sg->parent_scene) sg = sg->parent_scene;
/*remove route from queue list*/
gf_list_del_item(sg->routes_to_activate, r);
} | false | false | false | false | false | 0 |
NextPutMultiple(const byte *inString, size_t length)
{
m_messageAccumulator->Update(inString, length);
if (m_flags & PUT_MESSAGE)
AttachedTransformation()->Put(inString, length);
} | false | false | false | false | false | 0 |
sub_expected_children(double val)
{
double result;
if (expected_children - val > 0)
result = (double)MULTROULETTEFACTOR * val;
else
result = (double)MULTROULETTEFACTOR * expected_children;
expected_children -= val;
if (expected_children < 0)
expected_children = 0;
ret... | false | false | false | false | false | 0 |
HandlerOfCookie(
const Char * cookie )
{
Int i,top,bottom,middle;
Int res;
if (HandlerSortingStatus != 2)
{
for (i = 0; i < NHandlerFuncs; i++)
{
if (strcmp(cookie, HandlerFuncs[i].cookie) == 0)
return HandlerFuncs[i].hdlr;
}
return (ObjFunc)0L;
}
... | false | false | false | false | false | 0 |
mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
unsigned long flags;
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgslpc_set_termios %s\n", __FILE__, __LINE__,
tty->driver->name);
/* just return if nothing has changed */
... | false | false | false | false | false | 0 |
dvb_dmx_swfilter_raw(struct dvb_demux *demux, const u8 *buf, size_t count)
{
unsigned long flags;
spin_lock_irqsave(&demux->lock, flags);
demux->feed->cb.ts(buf, count, NULL, 0, &demux->feed->feed.ts);
spin_unlock_irqrestore(&demux->lock, flags);
} | false | false | false | false | false | 0 |
db_mod_detach()
{
struct db_api_module *mod = db_api_first;
int aflag = 0;
while ( mod ) {
if ( mod->db_api_detach ) (mod->db_api_detach)(&aflag);
mod = (struct db_api_module*)((struct general_module*)mod)->next;
}
return(0);
} | false | false | false | false | false | 0 |
is_in_row(const struct fpga_model* model, int y,
int* row_num, int* row_pos)
{
int dist_to_center;
if (row_num) *row_num = -1;
if (row_pos) *row_pos = -1;
if (y < TOP_IO_TILES) return; // handles y==-1
// normalize y to beginning of rows
y -= TOP_IO_TILES;
// calculate distance to center and check
// that y ... | false | false | false | false | false | 0 |
traceFormatUserMsg(Capability *cap, char *msg, ...)
{
va_list ap;
va_start(ap,msg);
/* Note: normally we don't check the TRACE_* flags here as they're checked
by the wrappers in Trace.h. But traceUserMsg is special since it has no
wrapper (it's called from cmm code), so we check TRACE_user he... | 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.