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 |
|---|---|---|---|---|---|---|
alsa_card_mtpav_init(void)
{
int err;
if ((err = platform_driver_register(&snd_mtpav_driver)) < 0)
return err;
device = platform_device_register_simple(SND_MTPAV_DRIVER, -1, NULL, 0);
if (!IS_ERR(device)) {
if (platform_get_drvdata(device))
return 0;
platform_device_unregister(device);
err = -ENODEV;
... | false | false | false | false | false | 0 |
add_variable(const std::string& name, const CValue& value)
{
m_variables[name] = CVariable(name, value);
} | false | false | false | false | false | 0 |
rtl8821ae_phy_bb_config(struct ieee80211_hw *hw)
{
bool rtstatus = true;
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
struct rtl_phy *rtlphy = &rtlpriv->phy;
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
u8 regval;
u8 crystal_cap;
phy_init_bb_rf_register_defi... | false | false | false | false | false | 0 |
a3d_adc_open(struct gameport *gameport, int mode)
{
struct a3d *a3d = gameport->port_data;
if (mode != GAMEPORT_MODE_COOKED)
return -1;
gameport_start_polling(a3d->gameport);
return 0;
} | false | false | false | false | false | 0 |
start_redial_timeout(const Fax_item& fax_item) {
int seconds = std::atoi(prog_config.redial_interval.c_str()) * 60;
if (seconds > 60) {
guint* id = new guint;
#if GLIB_CHECK_VERSION(2,14,0)
*id = start_timeout_seconds(seconds,
Callback::make(*this, &EfaxController::redial_cb, fax_item, id));
#else
*... | false | false | false | false | false | 0 |
gx_device_retain(gx_device *dev, bool retained)
{
int delta = (int)retained - (int)dev->retained;
if (delta) {
dev->retained = retained; /* do first in case dev is freed */
rc_adjust_only(dev, delta, "gx_device_retain");
}
} | false | false | false | false | false | 0 |
DtsSetIFrameTrickMode(
HANDLE hDevice
)
{
BC_STATUS sts = BC_STS_SUCCESS;
DTS_LIB_CONTEXT *Ctx = NULL;
DTS_GET_CTX(hDevice,Ctx);
sts = DtsFWSetHostTrickMode(hDevice,1);
if(sts != BC_STS_SUCCESS)
{
DebugLog_Trace(LDIL_DBG,"DtsSetIFrameTrickMode: DtsFWSetHostTrickMode Failed\n");
return sts;
}
sts = ... | false | false | false | false | false | 0 |
lbtf_op_stop(struct ieee80211_hw *hw)
{
struct lbtf_private *priv = hw->priv;
unsigned long flags;
struct sk_buff *skb;
struct cmd_ctrl_node *cmdnode;
lbtf_deb_enter(LBTF_DEB_MACOPS);
/* Flush pending command nodes */
spin_lock_irqsave(&priv->driver_lock, flags);
list_for_each_entry(cmdnode, &priv->cmdpendin... | false | false | false | false | false | 0 |
_cmsWriteProfileSequence(cmsHPROFILE hProfile, const cmsSEQ* seq)
{
if (!cmsWriteTag(hProfile, cmsSigProfileSequenceDescTag, seq)) return FALSE;
if (cmsGetEncodedICCversion(hProfile) >= 0x4000000) {
if (!cmsWriteTag(hProfile, cmsSigProfileSequenceIdTag, seq)) return FALSE;
}
return TRUE;
... | false | false | false | false | false | 0 |
restoreStatus( const char filename[] )
{
std::ifstream inFile( filename, std::ios::in);
if (!checkFile ( inFile, filename, engineName(), "restoreStatus" )) {
std::cerr << " -- Engine state remains unchanged\n";
return;
}
if ( possibleKeywordInput ( inFile, "Uvec", theSeed ) ) {
std::vector<uns... | false | false | false | false | false | 0 |
setFormat(const gchar * pageLeftMargin,
const gchar * pageRightMargin,
AP_Dialog_Paragraph::tAlignState align,
const gchar * firstLineIndent,
AP_Dialog_Paragraph::tIndentState indent,
const gchar * leftIndent,
const gchar * rightIndent,
... | false | false | false | false | false | 0 |
hdb_check_db_format(krb5_context context, HDB *db)
{
krb5_data tag;
krb5_data version;
krb5_error_code ret, ret2;
unsigned ver;
int foo;
ret = db->hdb_lock(context, db, HDB_RLOCK);
if (ret)
return ret;
tag.data = (void *)(intptr_t)HDB_DB_FORMAT_ENTRY;
tag.length = strlen(tag.data)... | false | false | false | false | false | 0 |
xsaveline(struct image *img, int x1, int y1, int x2, int y2)
{
doclip(return (NULL));
if (y1 == y2) {
return (savehline(img, x1, y1, x2));
} else if (x1 == x2) {
if (y2 < y1) {
swap(y1, y2);
}
switch (img->bytesperpixel) {
#ifdef SBITMAPS
case 0:
return (savevline8(img, x1 / 8, y1, y2 - y1));... | false | false | false | false | false | 0 |
test_frequency() {
gettimeofday(&tv, NULL);
timeb = tv.tv_usec;
elp = timeb - timea;
if(elp < 0) elp = 1000000 - timea + timeb;
// printf("time elapsed = %d\n", elp);
timea = tv.tv_usec;
if(old != tv.tv_sec) {
printf("====> fps = %d\n", fps);
fps = 0;
old = tv.tv_sec;
}
fps++;
return(TRUE);
} | false | false | false | false | false | 0 |
dump_gma(const char *name, const u8 *r)
{
int i;
printf("%12s address: ", name);
for (i = 0; i < 3; i++) {
u16 a = *(u16 *)(r + i * 4);
printf(" %02X %02X", a & 0xff, (a >> 8) & 0xff);
}
printf("\n");
} | false | false | false | false | false | 0 |
CKYReader_CreateArray(const CKYReaderNameList readerNames,
unsigned long *returnReaderCount)
{
unsigned long i,j;
unsigned long readerCount;
SCARD_READERSTATE *readers;
CKYStatus ret;
readerCount=CKYReaderNameList_GetCount(readerNames);
if (readerCount == 0) {
return NULL;
}
read... | false | true | false | false | false | 1 |
rcut(List *r, Posn p1, Posn p2)
{
Posn p, x;
int i;
if(p1 == p2)
panic("rcut 0");
for(p=0,i=0; i<r->nused && p+L(i)<=p1; p+=L(i++))
;
if(i == r->nused)
panic("rcut 1");
if(p < p1){ /* chop this piece */
if(p+L(i) < p2){
x = p1-p;
p += L(i);
}else{
x = L(i)-(p2-p1);
p = p2;
}
if(T(i))
... | false | false | false | false | false | 0 |
udp_is_valid_gnet_split(gnutella_node_t *n, const gnutella_socket_t *s,
bool truncated, const void *header, const void *payload, size_t len)
{
const char *msg;
uint16 size; /**< Payload size, from the Gnutella message */
g_assert(s != NULL || n != NULL);
/*
* If we can't get a proper UDP node for this addres... | false | true | false | false | false | 1 |
mysql_kill(MYSQL *mysql,ulong pid)
{
uchar buff[4];
DBUG_ENTER("mysql_kill");
int4store(buff,pid);
DBUG_RETURN(simple_command(mysql,COM_PROCESS_KILL,buff,sizeof(buff),0));
} | false | false | false | false | false | 0 |
__pyx_pf_6Cython_8Compiler_7Visitor_9PrintTree___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
... | false | false | false | false | false | 0 |
LI1(V2)
register object V2;
{ VMB1 VMS1 VMV1
goto TTL;
TTL:;
if(!(((V2))==Cnil)){
goto T1;}
(void)((*(LnkLI49))(((object)VV[0]),small_fixnum(1),small_fixnum(0)));
goto T1;
T1:;
if((CMPcdr((V2)))==Cnil){
goto T4;}
V3 = CMPmake_fixnum((long)(length((V2))));
(void)((*(LnkLI50))(((object)VV[0]),small_fixnum(1),V... | false | false | false | false | false | 0 |
qlafx00_tm_iocb(srb_t *sp, struct tsk_mgmt_entry_fx00 *ptm_iocb)
{
struct srb_iocb *fxio = &sp->u.iocb_cmd;
scsi_qla_host_t *vha = sp->fcport->vha;
struct req_que *req = vha->req;
struct tsk_mgmt_entry_fx00 tm_iocb;
struct scsi_lun llun;
memset(&tm_iocb, 0, sizeof(struct tsk_mgmt_entry_fx00));
tm_iocb.entry_typ... | false | false | false | false | false | 0 |
fcoe_libfc_config(struct fc_lport *lport, struct fcoe_ctlr *fip,
const struct libfc_function_template *tt, int init_fcp)
{
/* Set the function pointers set by the LLDD */
memcpy(&lport->tt, tt, sizeof(*tt));
if (init_fcp && fc_fcp_init(lport))
return -ENOMEM;
fc_exch_init(lport);
fc_elsct_init(lport);
f... | false | true | false | false | false | 1 |
ga_match(char * const *groups, int n)
{
int i, j;
for (i = 0; i < ngroups; i++)
for (j = 0; j < n; j++)
if (match_pattern(groups_byname[i], groups[j]))
return 1;
return 0;
} | false | false | false | false | false | 0 |
session_close(Session *session)
{
cm_return_val_if_fail(session != NULL, -1);
#ifdef G_OS_UNIX
if (session->conn_id > 0) {
sock_connect_async_cancel(session->conn_id);
session->conn_id = 0;
debug_print("session (%p): connection cancelled\n", session);
}
#endif
session_set_timeout(session, 0);
if (session-... | false | false | false | false | false | 0 |
on_cvs_mesg_format (IAnjutaMessageView *view, const gchar *line,
AnjutaPlugin *plugin)
{
IAnjutaMessageViewType type;
GRegex *info, *err;
GError *error = NULL;
g_return_if_fail (line != NULL);
/* Compile the regexps for message types. */
info = g_regex_new (CVS_INFO_REGEXP, 0, 0, &error);
if (error != ... | false | false | false | false | false | 0 |
get_time_zone(std::string const &time_zone)
{
if(time_zone.empty()) {
return icu::TimeZone::createDefault();
}
else {
return icu::TimeZone::createTimeZone(time_zone.c_str());
}
} | false | false | false | false | false | 0 |
_valid_features(struct job_details *details_ptr,
struct config_record *config_ptr)
{
bitstr_t *result_bits = (bitstr_t *) NULL;
ListIterator feat_iter;
struct feature_record *job_feat_ptr;
struct features_record *feat_ptr;
int last_op = FEATURE_OP_AND, position = 0;
result_bits = bit_alloc(MAX_FEATURES);
i... | false | false | false | false | false | 0 |
SetAlphabet(int type)
{
int x;
#ifdef HMMER_THREADS
pthread_mutex_t alphabet_lock; /* alphabet is global; must protect to be threadsafe */
int rtn; /* return code from pthreads */
if ((rtn = pthread_mutex_init(&alphabet_lock, NULL)) != 0)
Die("pthread_mutex_init FAILED; %s\n", strerror(rtn... | false | true | false | false | false | 1 |
asn1PE_H245FECData (OOCTXT* pctxt, H245FECData* pvalue)
{
int stat = ASN_OK;
/* Encode choice index value */
stat = encodeConsUnsigned (pctxt, pvalue->t - 1, 0, 0);
if (stat != ASN_OK) return stat;
/* Encode root element data value */
switch (pvalue->t)
{
/* rfc2733 */
case 1:
... | false | false | false | false | false | 0 |
replace_vars_in_jointree(Node *jtnode,
pullup_replace_vars_context *context,
JoinExpr *lowest_outer_join)
{
if (jtnode == NULL)
return;
if (IsA(jtnode, RangeTblRef))
{
/* nothing to do here */
}
else if (IsA(jtnode, FromExpr))
{
FromExpr *f = (FromExpr *) jtnode;
ListCell *l;
foreach(... | false | false | false | false | false | 0 |
PILLog(PILLogLevel priority, const char * format, ...)
{
va_list args;
GLogLevelFlags flags;
switch(priority) {
case PIL_FATAL: flags = G_LOG_LEVEL_ERROR;
break;
case PIL_CRIT: flags = G_LOG_LEVEL_CRITICAL;
break;
default: /* FALL THROUGH... */
case PIL_WARN: flags = G_LOG_LEVEL_WARNING;
break;
... | true | true | false | false | false | 1 |
exo_toolbars_view_create_item_from_action (ExoToolbarsView *view,
const gchar *action_name,
const gchar *type,
gboolean is_separator,
... | false | false | false | false | false | 0 |
command_RESWAIT(command_t * self, worker_t * worker, char * data,
apr_pool_t *ptmp) {
apr_status_t status;
do {
status = command_RES(self, worker, "", ptmp);
if(status != APR_SUCCESS) {
return status;
}
status = command_WAIT(self, worker, "", ptmp);
if(status =... | false | false | false | false | false | 0 |
renameSelectedRowCbk(GtkTreeModel* model, GtkTreePath* path,
GtkTreeIter* iterator, gpointer data)
{
GtkWidget* dialog;
GtkWidget* nameField;
int rc;
char* itemName;
char* fullItemName;
GtkWidget* warningDialog;
gtk_tree_model_get(model, iterator, COLUMN_FILENA... | false | true | false | false | false | 1 |
iscsi_target_tx_thread(void *arg)
{
int ret = 0;
struct iscsi_conn *conn = arg;
bool conn_freed = false;
/*
* Allow ourselves to be interrupted by SIGINT so that a
* connection recovery / failure event can be triggered externally.
*/
allow_signal(SIGINT);
while (!kthread_should_stop()) {
/*
* Ensure ... | false | false | false | false | false | 0 |
file_command(MainInfo *min, DirPane *src, const gchar *action)
{
GSList *slist;
if((slist = dp_get_selection(src)) != NULL)
{
const gchar *cmd;
/* If only one row is selected, that might come from the focus, and then
** requires a somewhat special treatment.
*/
if(g_slist_next(slist) == NULL)
{
if((... | false | false | false | false | false | 0 |
test_dns_name_hash(char *test_name1, char *test_name2,
isc_boolean_t csh_match, isc_boolean_t cish_match) {
int rval;
int failures;
isc_boolean_t match;
unsigned int hash1;
unsigned int hash2;
dns_fixedname_t fixed1;
dns_fixedname_t fixed2;
dns_name_t *dns_name1;
dns_name_t *dns_name2;
isc_result_t result... | false | false | false | false | false | 0 |
reverse_word(word)
char *word;
{
char buffer[NDTP_MAX_LINE_LENGTH + 1];
unsigned char *p1, *p2;
strcpy(buffer, word);
p1 = (unsigned char *)word;
p2 = (unsigned char *)buffer + strlen(word);
*p2-- = '\0';
while (*p1 != '\0') {
if (*p1 == 0x8f) {
/*
* `*p1' is SS3.
* (... | false | false | false | false | false | 0 |
modperl_filter_new(ap_filter_t *f,
apr_bucket_brigade *bb,
modperl_filter_mode_e mode,
ap_input_mode_t input_mode,
apr_read_type_e block,
... | false | false | false | false | false | 0 |
boxof (stream_t* str, boxf* bp)
{
char tok[BUFSIZ];
skipWS(str);
if (strc(str) != '[') return 1;
stradv(str);
getNum(str, tok);
if (scanNum(tok,&bp->LL.x)) return 1;
getNum(str, tok);
if (scanNum(tok,&bp->LL.y)) return 1;
getNum(str, tok);
if (scanNum(tok,&bp->UR.x)) return 1;
getNum(str, tok);
if (scanNum... | true | true | false | false | false | 1 |
findSocket( GenericPlayer * player )
{
uint nbSockets = (uint) _theSockets.count();
for( uint i = 0; i < nbSockets; ++i ) {
if( _theSockets[ i ]->getPlayer() == player ) {
return _theSockets[ i ];
}
}
logEE( "AttalServer::findSocket Socket not found " );
logEE("findSocket player %p, player name %s", playe... | false | false | false | false | false | 0 |
vmw_framebuffer_pin(struct vmw_framebuffer *vfb)
{
struct vmw_private *dev_priv = vmw_priv(vfb->base.dev);
struct vmw_dma_buffer *buf;
int ret;
buf = vfb->dmabuf ? vmw_framebuffer_to_vfbd(&vfb->base)->buffer :
vmw_framebuffer_to_vfbs(&vfb->base)->surface->res.backup;
if (!buf)
return 0;
switch (dev_priv->... | false | false | false | false | false | 0 |
crypt_keyslot_change_by_passphrase(struct crypt_device *cd,
int keyslot_old,
int keyslot_new,
const char *passphrase,
size_t passphrase_size,
const char *new_passphrase,
size_t new_passphrase_size)
{
struct volume_key *vk = NULL;
int r = -EINVAL;
log_dbg("Changing passphrase from old keyslot %d to new %d.",
... | false | false | false | false | false | 0 |
generateCpp( FILE * fp)
{
CglKnapsackCover other;
fprintf(fp,"0#include \"CglKnapsackCover.hpp\"\n");
fprintf(fp,"3 CglKnapsackCover knapsackCover;\n");
if (maxInKnapsack_!=other.maxInKnapsack_)
fprintf(fp,"3 knapsackCover.setMaxInKnapsack(%d);\n",maxInKnapsack_);
else
fprintf(fp,"4 knapsackCover.... | false | false | false | false | false | 0 |
mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter,
struct cmd_ctrl_node *cmd_node)
{
struct host_cmd_ds_command *host_cmd = (void *)cmd_node->cmd_skb->data;
mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
atomic_dec(&adapter->cmd_pending);
mwifiex_dbg(adapter, CMD,
"cmd: FREE_CMD: cmd=%#x, ... | false | false | false | false | false | 0 |
check_specials (void)
{
mpfr_t x, y;
mpfr_init2 (x, 123L);
mpfr_init2 (y, 123L);
mpfr_set_nan (x);
mpfr_csch (y, x, MPFR_RNDN);
if (! mpfr_nan_p (y))
{
printf ("Error: csch(NaN) != NaN\n");
exit (1);
}
mpfr_set_inf (x, 1);
mpfr_csch (y, x, MPFR_RNDN);
if (! (mpfr_zero_p (y) && ... | false | false | false | false | false | 0 |
gdict_database_chooser_select_database (GdictDatabaseChooser *chooser,
const gchar *db_name)
{
GdictDatabaseChooserPrivate *priv;
SelectData data;
gboolean retval;
g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), FALSE);
g_return_val_if_fail (db_name... | false | false | false | false | false | 0 |
jpeg_write_tables (j_compress_ptr cinfo)
{
if (cinfo->global_state != CSTATE_START)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* (Re)initialize error mgr and destination modules */
(*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
(*cinfo->dest->init_destination) (cinfo);
/* Initialize t... | false | false | false | false | false | 0 |
gst_poll_new (gboolean controllable)
{
GstPoll *nset;
GST_DEBUG ("controllable : %d", controllable);
nset = g_slice_new0 (GstPoll);
g_mutex_init (&nset->lock);
#ifndef G_OS_WIN32
nset->mode = GST_POLL_MODE_AUTO;
nset->fds = g_array_new (FALSE, FALSE, sizeof (struct pollfd));
nset->active_fds = g_array_n... | false | false | false | false | false | 0 |
GetAuxSegments(w, n, ns, nc)
Widget w;
Cardinal *n, *ns, *nc;
{
CannaObject obj = (CannaObject)w;
iBuf *ib = obj->canna.ibuf;
Cardinal nseg, nchar;
if (n) {
*n = ib->ngseg;
}
if (ib->curgseg < ib->ngseg) {
nseg = ib->curgseg;
nchar = 0;
}
else {
nseg = 0;
nchar = ib->gllen[0];
}
... | false | false | false | false | false | 0 |
nlSparseMatrixSort( NLSparseMatrix* M) {
NLuint i ;
if(M->storage & NL_MATRIX_STORE_ROWS) {
for(i = 0; i<M->m; i++) {
nlRowColumnSort(&(M->row[i])) ;
}
}
if (M->storage & NL_MATRIX_STORE_COLUMNS) {
for(i = 0; i<M->n; i++) {
nlRowColumnSort(&(M->row[i])) ;... | false | false | false | false | false | 0 |
operator==(Activity& a)
{
if(this->teachersNames != a.teachersNames)
return false;
if(this->subjectName != a.subjectName)
return false;
if(this->activityTagsNames != a.activityTagsNames)
return false;
if(this->studentsNames != a.studentsNames)
return false;
//if(this->duration != a.duration)
// return ... | false | false | false | false | false | 0 |
toValue(Expression *expr)
{
if(expr)
return expr->evaluate();
return new Integer(0);
} | false | false | false | false | false | 0 |
RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
vtkUnstructuredGrid *input = vtkUnstructuredGrid::Sa... | false | false | false | false | false | 0 |
New_Font(void )
{
const gchar * buffer = gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(m_fontcombo))));
XAP_Draw_Symbol * iDrawSymbol = _getCurrentSymbolMap();
UT_return_if_fail(iDrawSymbol);
// need a fallback value here, as this can get called from one of the gtk
// callbacks when no font has been set... | false | false | false | false | false | 0 |
CPROCESS_create(int mode, void *cmd, char *name, CARRAY *env)
{
CPROCESS *process;
/*printf("** CPROCESS_create <<<< \n");*/
//if (!name || !*name)
// name = "Process";
process = OBJECT_new(CLASS_Process, name, OP ? (OBJECT *)OP : (OBJECT *)CP);
init_process(process);
run_process(process, mode, cmd, env);
... | false | false | false | false | false | 0 |
rd_edges(int32 *edge)
{
char s1[RECLEN];
byte etmp, e1;
*edge = etmp = NOEDGE;
__letendnum_state = TRUE;
for (;;)
{
strcpy(s1, "");
for (;;)
{
__get_vtok();
switch ((byte) __toktyp) {
case COMMA: case RSB: goto got_pair;
case ID: strcat(s1, __token); break;
case NUMBER: str... | true | true | false | false | false | 1 |
gnl_object_remove_ghost_pad (GnlObject * object, GstPad * ghost)
{
GnlPadPrivate *priv;
GST_DEBUG_OBJECT (object, "ghostpad %s:%s", GST_DEBUG_PAD_NAME (ghost));
priv = gst_pad_get_element_private (ghost);
gst_ghost_pad_set_target (GST_GHOST_PAD (ghost), NULL);
gst_element_remove_pad (GST_ELEMENT (object), g... | false | false | false | false | false | 0 |
decrypt2(guint8* dest, guint8* src, int length, int complength)
/* no complength checking atm */
{
guint8 numnodes, terminator;
guint8 *nodes;
gint16 c;
guint16 bitctr = 0, bytectr;
numnodes = src[0];
terminator = src[1];
bytectr = 2+ (numnodes << 1);
nodes = src+2;
while (((c = getc2(nodes, src, &bytec... | false | false | false | false | false | 0 |
slotCreate()
{
name = le_name->text();
if(profileExists(name)) {
QMessageBox::information(this, CAP(tr("New Profile")), tr("There is already an existing profile with this name. Please choose another."));
return;
}
if(!profileNew(name)) {
QMessageBox::information(this, CAP(tr("New Profile")), tr("Unable to ... | false | false | false | false | false | 0 |
traverse_sent(gm_apply*a, bool is_post, bool is_pre) {
// traverse only
get_cond()->traverse(a, is_post, is_pre);
if (!a->is_traverse_local_expr_only()) {
get_then()->traverse(a, is_post, is_pre);
if (get_else() != NULL) {
get_else()->traverse(a, is_post, is_pre);
}
}... | false | false | false | false | false | 0 |
listxattr (const char *path, char *list, size_t size)
{
pfs_name pname;
int result=-1;
if(resolve_name(path,&pname)) {
result = pname.service->listxattr(&pname,list,size);
}
return result;
} | false | false | false | false | false | 0 |
gnuplot_arc(FILE *file, const struct inst *inst)
{
double cx, cy, r;
double a, tmp;
int n, i;
cx = units_to_mm(inst->base.x);
cy = units_to_mm(inst->base.y);
r = units_to_mm(inst->u.arc.r);
a = inst->u.arc.a2-inst->u.arc.a1;
while (a <= 0)
a += 360;
while (a > 360)
a =- 360;
n = ceil(2*r*M_PI/360*a/ARC... | false | false | false | false | false | 0 |
printAsOperandImpl(const Value &V, raw_ostream &O, bool PrintType,
ModuleSlotTracker &MST) {
TypePrinting TypePrinter;
if (const Module *M = MST.getModule())
TypePrinter.incorporateTypes(*M);
if (PrintType) {
TypePrinter.print(V.getType(), O);
O << ' ';
}
WriteAsOpe... | false | false | false | false | false | 0 |
o2hb_check_node_heartbeating_no_sem(u8 node_num)
{
unsigned long testing_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
unsigned long flags;
spin_lock_irqsave(&o2hb_live_lock, flags);
o2hb_fill_node_map_from_callback(testing_map, sizeof(testing_map));
spin_unlock_irqrestore(&o2hb_live_lock, flags);
if (!test_bit(node_num, ... | false | false | false | false | false | 0 |
string_to_upper(string_t *str)
{
int i;
if(str->type == str_char)
{
for (i = 0; i < str->size; i++) str->str.cstr[i] = toupper((unsigned char)str->str.cstr[i]);
}
else if(str->type == str_unicode)
{
for (i = 0; i < str->size; i++) str->str.wstr[i] = toupperW(str->str.wstr[i]);
... | false | false | false | false | false | 0 |
addUniqueTracksModel( ProviderPtr provider, QAbstractItemModel *model )
{
bool first = m_uniqueTracksModels.isEmpty();
m_uniqueTracksModels.insert( provider, model );
uniqueFilterCombo->addItem( provider->icon(), provider->prettyName(),
QVariant::fromValue<ProviderPtr>( provi... | false | false | false | false | false | 0 |
SplitWind()
{
SetWind(div_wind(curwind, arg_or_default(2) - 1));
} | false | false | false | false | false | 0 |
via_gpio_dir_input(struct gpio_chip *chip, unsigned int nr)
{
struct viafb_gpio_cfg *cfg = container_of(chip,
struct viafb_gpio_cfg,
gpio_chip);
struct viafb_gpio *gpio;
unsigned long flags;
spin_lock_irqsave(&cfg->vdev->reg_lock, flags);
gpio = cfg->active_gpios[nr];
via_write_reg_mask(VIASR, gp... | false | false | false | false | false | 0 |
show(int a/*=0*/,int n/*=-1*/)
{
int all=(n<0 ? 1 : 0);
if(n<0){n=bitpos-a;}
int i;
if(all)
{
printf("BitStream::Show: ntags:%d size:%4d buffsize:%6d ::: ",tags.size(),size(),buffsize());
// for(i=0;i<tags.size();i++){printf("tag:%d:%s:pos:%d\n",i,tags[i],tagpos[i]);}
}
int t=find_t... | false | false | false | false | false | 0 |
action_unmount_cb(G_GNUC_UNUSED GtkAction *action, GigoloWindow *window)
{
GigoloWindowPrivate *priv = GIGOLO_WINDOW_GET_PRIVATE(window);
GtkTreeIter iter;
GigoloBookmark *bm;
get_selected_iter(window, &iter);
if (gtk_list_store_iter_is_valid(priv->store, &iter))
{
gpointer mnt;
GtkTreeModel *model = GTK_TRE... | false | false | false | false | false | 0 |
xtfpga_pcm_refill_fifo(struct xtfpga_i2s *i2s)
{
unsigned int_status;
unsigned i;
regmap_read(i2s->regmap, XTFPGA_I2S_INT_STATUS,
&int_status);
for (i = 0; i < 2; ++i) {
bool tx_active = xtfpga_pcm_push_tx(i2s);
regmap_write(i2s->regmap, XTFPGA_I2S_INT_STATUS,
XTFPGA_I2S_INT_VALID);
if (tx_ac... | false | false | false | false | false | 0 |
getPassInfo(StringRef Arg) const {
sys::SmartScopedLock<true> Guard(*Lock);
PassRegistryImpl *Impl = static_cast<PassRegistryImpl*>(getImpl());
PassRegistryImpl::StringMapType::const_iterator
I = Impl->PassInfoStringMap.find(Arg);
return I != Impl->PassInfoStringMap.end() ? I->second : 0;
} | false | false | false | false | false | 0 |
ippAddResolutions(ipp_t *ipp, /* I - IPP message */
ipp_tag_t group, /* I - IPP group */
const char *name, /* I - Name of attribute */
int num_values,/* I - Number of values */
ipp_res_t units, /* I - Units for resolution */
const int *xres, /* I - X resolutions */
const in... | false | false | false | false | false | 0 |
SetOpacity(int idx, double opacity)
{
int i;
int newLength;
double *newArray;
if (opacity < 0.0)
{
opacity = 0.0;
}
if (opacity > 1.0)
{
opacity = 1.0;
}
if (idx >= this->OpacityArrayLength)
{
newLength = idx + 1;
newArray = new double[newLength];
for (i = 0; i < th... | false | false | false | false | false | 0 |
Unlock()
{
if (pthread_equal(pthread_self(), fOwner)) {
fOwner = 0;
int res = pthread_mutex_unlock(&fMutex);
if (res == 0) {
return true;
} else {
jack_error("JackBasePosixMutex::Unlock res = %d", res);
return fa... | false | false | false | false | false | 0 |
spell_make_sugfile(spin, wfname)
spellinfo_T *spin;
char_u *wfname;
{
char_u fname[MAXPATHL];
int len;
slang_T *slang;
int free_slang = FALSE;
/*
* Read back the .spl file that was written. This fills the required
* info for soundfolding. This also uses less memory than the
... | false | false | false | false | false | 0 |
gst_rtsp_source_finalize (GSource * source)
{
GstRTSPWatch *watch = (GstRTSPWatch *) source;
build_reset (&watch->builder);
gst_rtsp_message_unset (&watch->message);
g_queue_foreach (watch->messages, (GFunc) gst_rtsp_rec_free, NULL);
g_queue_free (watch->messages);
watch->messages = NULL;
watch->message... | false | false | false | false | false | 0 |
untransformRelOptions(Datum options)
{
List *result = NIL;
ArrayType *array;
Datum *optiondatums;
int noptions;
int i;
/* Nothing to do if no options */
if (options == (Datum) 0)
return result;
array = DatumGetArrayTypeP(options);
Assert(ARR_ELEMTYPE(array) == TEXTOID);
deconstruct_array(arra... | false | false | false | false | false | 0 |
store_object(git_indexer_stream *idx)
{
int i, error;
khiter_t k;
git_oid oid;
struct entry *entry;
git_off_t entry_size;
struct git_pack_entry *pentry;
git_hash_ctx *ctx = &idx->hash_ctx;
git_off_t entry_start = idx->entry_start;
entry = git__calloc(1, sizeof(*entry));
GITERR_CHECK_ALLOC(entry);
pentry = ... | false | false | false | false | false | 0 |
addLayer(const char * const name, const int16 colnum,
const int16 flags)
{
void *temp = NULL;
if (!this->layerDict->find(name, temp)) {
// default layer has layer-num = 0, hence the + 1
dimeLayer *layer = new dimeLayer(name, this->layers.count()+1,
colnum, flags);
char *ptr;
layerDict-... | false | false | false | false | false | 0 |
sdram_offsets_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct solo_dev *solo_dev =
container_of(dev, struct solo_dev, dev);
char *out = buf;
out += sprintf(out, "DISP: 0x%08x @ 0x%08x\n",
SOLO_DISP_EXT_ADDR,
SOLO_DISP_EXT_SIZE);
out += sprintf(out, "EOSD... | false | false | false | false | false | 0 |
ClrAsnBit PARAMS((b1, bit),
AsnBits* b1 _AND_
unsigned long int bit)
{
unsigned long int octet;
unsigned long int octetsBit;
if (bit < b1->bitLen)
{
octet = bit/8;
octetsBit = 7 - (bit % 8);/* bit zero is first/most sig bit in octet */
b1->bits[octet] &= ~(1 << octetsBit);
... | false | false | false | false | false | 0 |
v_bignum_pow_mod(VBigDig *x, const VBigDig *y, const VBigDig *n)
{
VBigDig *tmp;
const VBigDig *mu;
int i, k;
/* printf("computing pow(");
v_bignum_print_hex(x);
printf("L,");
v_bignum_print_hex(y);
printf("L,");
v_bignum_print_hex(n);
printf("L)\n");
*/
tmp = bignum_alloc(2 * *x); /* Squaring needs twice ... | false | false | false | false | false | 0 |
pathb_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8],
u8 final_candidate, bool txonly)
{
u32 oldval_1, x, tx1_a, reg;
s32 y, tx1_c;
if (final_candidate == 0xFF) {
return;
} else if (iqkok) {
oldval_1 = (phy_query_bb_reg(adapt, rOFDM0_XBTxIQImbalance, bMaskDWord) >> 22) & 0x3FF;
x = result... | false | false | false | false | false | 0 |
nvkm_vm_map_pgt(struct nvkm_vm *vm, u32 pde, u32 type)
{
struct nvkm_mmu *mmu = vm->mmu;
struct nvkm_vm_pgt *vpgt = &vm->pgt[pde - vm->fpde];
struct nvkm_vm_pgd *vpgd;
int big = (type != mmu->func->spg_shift);
u32 pgt_size;
int ret;
pgt_size = (1 << (mmu->func->pgt_bits + 12)) >> type;
pgt_size *= 8;
ret = ... | false | false | false | false | false | 0 |
str_vinsert_unlocked(String *str, ssize_t index, const char *format, va_list args)
{
String *tmp, *ret;
if (!str)
return set_errnull(EINVAL);
if (index < 0)
index = str->length + index;
if (index < 0)
return set_errnull(EINVAL);
if (str->length - 1 < index)
return set_errnull(EINVAL);
if (!(tmp = str... | false | false | false | false | false | 0 |
tcm_qla2xxx_npiv_make_tpg(
struct se_wwn *wwn,
struct config_group *group,
const char *name)
{
struct tcm_qla2xxx_lport *lport = container_of(wwn,
struct tcm_qla2xxx_lport, lport_wwn);
struct tcm_qla2xxx_tpg *tpg;
unsigned long tpgt;
int ret;
if (strstr(name, "tpgt_") != name)
return ERR_PTR(-EINVAL);
if... | false | false | false | false | false | 0 |
gf_isom_set_rvc_config(GF_ISOFile *movie, u32 track, u32 sampleDescriptionIndex, u16 rvc_predefined, char *mime, char *data, u32 size)
{
GF_MPEGVisualSampleEntryBox *entry;
GF_Err e;
GF_TrackBox *trak;
e = CanAccessMovie(movie, GF_ISOM_OPEN_WRITE);
if (e) return e;
trak = gf_isom_get_track_from_file(movie, trac... | false | false | false | false | false | 0 |
usage(QTextStream& out, const QString& error)
{
QString s="";
s+=QString("Incorrect command line parameters (%1).").arg(error);
s+="\n\n";
s+=QString(
"Command line usage: \"fet --inputfile=x [--outputdir=d] [--timelimitseconds=y] [--htmllevel=z] [--language=t] [--printnotavailable=u] [--printbreak=b] "
"... | false | false | false | false | false | 0 |
pit_latch_status(struct kvm *kvm, int channel)
{
struct kvm_kpit_channel_state *c =
&kvm->arch.vpit->pit_state.channels[channel];
WARN_ON(!mutex_is_locked(&kvm->arch.vpit->pit_state.lock));
if (!c->status_latched) {
/* TODO: Return NULL COUNT (bit 6). */
c->status = ((pit_get_out(kvm, channel) << 7) |
(c... | false | false | false | false | false | 0 |
scale_loop_profile (struct loop *loop, int scale, gcov_type iteration_bound)
{
gcov_type iterations = expected_loop_iterations_unbounded (loop);
edge e;
edge_iterator ei;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, ";; Scaling loop %i with scale %f, "
"bounding iterations to %i f... | false | false | false | false | false | 0 |
DeadPHICycle(PHINode *PN,
SmallPtrSetImpl<PHINode*> &PotentiallyDeadPHIs) {
if (PN->use_empty()) return true;
if (!PN->hasOneUse()) return false;
// Remember this node, and if we find the cycle, return.
if (!PotentiallyDeadPHIs.insert(PN).second)
return true;
// Don't scan crazi... | false | false | false | false | false | 0 |
HEVC_RewriteESDescriptor(GF_MPEGVisualSampleEntryBox *hevc)
{
if (hevc->emul_esd) gf_odf_desc_del((GF_Descriptor *)hevc->emul_esd);
hevc->emul_esd = gf_odf_desc_esd_new(2);
hevc->emul_esd->decoderConfig->streamType = GF_STREAM_VISUAL;
hevc->emul_esd->decoderConfig->objectTypeIndication = GPAC_OTI_VIDEO_HEVC;
if (h... | false | false | false | false | false | 0 |
cs3_parse_sense_data(cs3_t * s)
{
SANE_Status status = SANE_STATUS_GOOD;
s->sense_code =
(s->sense_key << 24) + (s->sense_asc << 16) +
(s->sense_ascq << 8) + s->sense_info;
if (s->sense_key)
DBG(14, "sense code: %02lx-%02lx-%02lx-%02lx\n", s->sense_key,
s->sense_asc, s->sense_ascq, s->sense_info);
sw... | false | false | false | false | false | 0 |
compile(const lwo2::FORM::CLIP *clip)
{
for (iff::Chunk_list::const_iterator j=clip->attributes.begin(); j!=clip->attributes.end(); ++j) {
const lwo2::FORM::CLIP::STIL *stil = dynamic_cast<const lwo2::FORM::CLIP::STIL *>(*j);
if (stil) still_filename_ = stil->name.name;
}
} | false | false | false | false | false | 0 |
enabled_actions( ActionList& actions, const state_t& state ) const
{
for( ActionList::const_iterator ai = actions_.begin(); ai != actions_.end();
++ai )
if( (*ai)->enabled( state ) ) actions.push_back( *ai );
} | false | false | false | false | false | 0 |
allocacl(int n)
{
Acl *new_acl;
Size size;
if (n < 0)
elog(ERROR, "invalid size: %d", n);
size = ACL_N_SIZE(n);
new_acl = (Acl *) palloc0(size);
SET_VARSIZE(new_acl, size);
new_acl->ndim = 1;
new_acl->dataoffset = 0; /* we never put in any nulls */
new_acl->elemtype = ACLITEMOID;
ARR_LBOUND(new_acl)[0... | false | false | false | false | false | 0 |
surfmerge_remove_surf(GtkWidget *button _U_, gpointer data _U_)
{
GtkTreeIter iter, iter2;
GtkTreeModel *model;
GtkTreeSelection* tree_selection =
gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view_target));
gboolean list_empty = TRUE;
if (gtk_tree_selection_get_selected (tree_selection, &model, &iter)... | 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.