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 |
|---|---|---|---|---|---|---|
indent_lines (GtkSourceView *view, GtkTextIter *start, GtkTextIter *end)
{
GtkTextBuffer *buf;
gint start_line, end_line;
gchar *tab_buffer = NULL;
guint tabs = 0;
guint spaces = 0;
gint i;
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
start_line = gtk_text_iter_get_line (start);
end_line = gtk_text... | false | false | false | false | false | 0 |
JNI_IsSameObject(JNIEnv *env, jobject ref1, jobject ref2)
{
enter_vm_from_jni();
if (ref1 == ref2)
return JNI_TRUE;
return JNI_FALSE;
} | false | false | false | false | false | 0 |
parseIf() {
Node *node ;
Node *ifpart ;
if (properties & ALLOW_OMITTED_PARENS) {
node = single_expression() ;
} else {
needbrack (LBRACK) ;
node = single_expression() ;
needbrack (RBRACK) ;
}
if (node->op == ASSIGN) {
warning ("Assignment used as condition... | false | false | false | false | false | 0 |
interact(void)
{
/* In case we got here because a command output, stop the pager. */
stop_pager();
trace_event("Interacting.\n");
if (appres.secure || appres.no_prompt) {
char s[10];
printf("[Press <Enter>] ");
fflush(stdout);
if (fgets(s, sizeof(s), stdin) == NULL)
x3270_exit(1);
return;
}
#if... | false | false | false | false | false | 0 |
parse_gnucash_value(char * value, char * result)
{
int i,state=0,ctr=0,zeroes=0;
char numerator[128];
for (i = 0; i < strlen(value); i++) {
if (value[i]=='/') {
/* terminate the numerator string */
numerator[ctr]=0;
state++;
ctr = 0;
}
else {
if (state==0) {
/* u... | false | false | false | false | false | 0 |
internal_ok( const char *file, int line, int test, const char * test_txt,
const char *fmt, ...)
{
va_list ap;
++test_run;
if ( test ) {
++test_ok;
printf( "ok %d ", test_run);
va_start( ap, fmt );
vprintf( fmt, ap );
va_end( ap );
printf("\n");
} else {
printf( "not ok %d ", test_run);
va_start... | false | false | false | false | false | 0 |
ocfs2_prepare_downconvert(struct ocfs2_lock_res *lockres,
int new_level)
{
assert_spin_locked(&lockres->l_lock);
BUG_ON(lockres->l_blocking <= DLM_LOCK_NL);
if (lockres->l_level <= new_level) {
mlog(ML_ERROR, "lockres %s, lvl %d <= %d, blcklst %d, mask %d, "
"type %d, flags 0x%lx, hold %d %d, a... | false | false | false | false | false | 0 |
mopacInputFileWindow(gboolean newInputFile)
{
GtkWidget *button;
GtkWidget *hbox = NULL;
GtkWidget *hboxChargeMultiplicity = NULL;
GtkWidget* comboJobType = NULL;
GtkWidget *table = gtk_table_new(4,3,FALSE);
newFile = newInputFile;
initMopacMolecule();
setMopacMolecule();
if(mopacMolecule.numberOfAtoms <1... | false | false | false | false | false | 0 |
setBlankMailboxes(const fxStr& s)
{
for (u_int i = 0, n = jobs->length(); i < n; i++) {
SendFaxJob& job = (*jobs)[i];
if (job.getMailbox() == "")
job.setMailbox(s);
}
} | false | false | false | false | false | 0 |
printMULTI(uchar *serialized)
{
LWGEOM_INSPECTED *inspected = lwgeom_inspect(serialized);
LWLINE *line;
LWPOINT *point;
LWPOLY *poly;
int t;
lwnotice("MULTI* geometry (type = %i), with %i sub-geoms",lwgeom_getType((uchar)serialized[0]), inspected->ngeometries);
for (t=0;t<inspected->ngeometries;t++)
{
lwn... | false | false | false | false | false | 0 |
gck_builder_init_full (GckBuilder *builder,
GckBuilderFlags flags)
{
GckRealBuilder *real = (GckRealBuilder *)builder;
g_return_if_fail (builder != NULL);
memset (builder, 0, sizeof (GckBuilder));
real->secure = flags & GCK_BUILDER_SECURE_MEMORY;
} | false | false | false | false | false | 0 |
compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
sbitmap *antloc, sbitmap *later, sbitmap *laterin)
{
int num_edges, i;
edge e;
basic_block *worklist, *qin, *qout, *qend, bb;
unsigned int qlen;
edge_iterator ei;
num_edges = NUM_EDGES (edge_list);
/* Allocate a worklist array/queue. E... | false | false | false | false | false | 0 |
replaceITE(const Expr& e) {
TRACE("replaceITE","replaceITE(", e, ") { ");
Theorem res;
CDMap<Expr,Theorem>::iterator i=d_replaceITECache.find(e),
iend=d_replaceITECache.end();
if(i!=iend) {
TRACE("replaceITE", "replaceITE[cached] => ", (*i).second, " }");
return (*i).second;
}
if(e.isAbsLite... | false | false | false | false | false | 0 |
Bop_rgb18_toK_Aop( GenefxState *gfxs )
{
int w = gfxs->length;
u8 *D = gfxs->Aop[0];
u8 *S = gfxs->Bop[0];
u32 Dkey = gfxs->Dkey;
while (w--) {
if (Dkey == ((u32)(D[2]<<16 | D[1]<<8 | D[0]) & 0x3FFFF)) {
D[0] = S[0];
D[1] = S[1];... | false | false | false | false | false | 0 |
open()
{
QByteArray _mountpath = QFile::encodeName( m_mountPath ); //must be on stack during use
const char* mountpath = _mountpath.data();
m_itdb = itdb_new();
itdb_set_mountpoint( m_itdb, mountpath );
m_mpl = itdb_playlist_new( "iPod", false );
itdb_playlist_set_mpl( m_mpl );
GError* err... | false | false | false | false | false | 0 |
pipe_wait( DirectStream *stream,
unsigned int length,
struct timeval *tv )
{
fd_set s;
if (stream->cache_size >= length)
return DR_OK;
FD_ZERO( &s );
FD_SET( stream->fd, &s );
switch (select( stream->fd+1, &s, NULL, NULL, tv )) {
case ... | false | false | false | false | false | 0 |
multi_pxo_chat_is_private(char *txt)
{
char save;
// quick check
if( strlen(txt) > strlen( PMSG_FROM ) ){
// otherwise do a comparison
save = txt[strlen( PMSG_FROM )];
txt[strlen( PMSG_FROM )] = '\0';
if(!stricmp( txt, PMSG_FROM )){
txt[strlen( PMSG_FROM )] = save;
return &txt[strlen( PMSG_FROM )];
... | false | false | false | false | false | 0 |
XMapSubwindows(Display *display, Window w)
{
static int (*fptr)() = 0;
int value;
if (fptr == 0) {
DPRINTF ((stderr, "liballtraynomap: set error handler\n"));
void *dlh_xerr = NULL;
int (*fptr_xerr)() = 0;
dlh_xerr = dlopen ("libX11.so", RTLD_GLOBAL | RTLD_NOW);
if... | false | false | false | false | false | 0 |
adjustFile(FILE *fp, int curSize)
{
struct stat statBuf;
int fd = fileno(fp);
if ( fstat(fd, &statBuf) == -1 )
return(-1);
if ( statBuf.st_size < curSize ) /* file has shrunk! */
{
if ( fseek(fp, 0L, 0) == -1 ) /* get back to the beginning */
return(-1);
}
curSize = (int) sta... | false | false | false | false | false | 0 |
ath_isr(int irq, void *dev)
{
#define SCHED_INTR ( \
ATH9K_INT_FATAL | \
ATH9K_INT_BB_WATCHDOG | \
ATH9K_INT_RXORN | \
ATH9K_INT_RXEOL | \
ATH9K_INT_RX | \
ATH9K_INT_RXLP | \
ATH9K_INT_RXHP | \
ATH9K_INT_TX | \
ATH9K_INT_BMISS | \
ATH9K_INT_CST | \
ATH9K_INT_GTT | \
ATH9K_INT_T... | false | false | false | false | false | 0 |
auto_filler_arithmetic (gboolean singleton)
{
AutoFillerArithmetic *res = g_new (AutoFillerArithmetic, 1);
res->filler.status = AFS_INCOMPLETE;
res->filler.priority = 100;
res->filler.finalize = afa_finalize;
res->filler.teach_cell = afa_teach_cell;
res->filler.set_cell = afa_set_cell;
res->filler.hint = afa_hi... | false | false | false | false | false | 0 |
marker(UnpicklerObject *self)
{
PickleState *st = _Pickle_GetGlobalState();
if (self->num_marks < 1) {
PyErr_SetString(st->UnpicklingError, "could not find MARK");
return -1;
}
return self->marks[--self->num_marks];
} | false | false | false | false | false | 0 |
derefSize(QSize size)
{
assert(original);
if (size == this->size() || this->size().isEmpty()) return;
QPair<int, int> key = trSize(size);
PixmapPlane* plane = scaled.value(key);
--plane->refCount;
if (plane->refCount == 0)
{
delete plane;
scaled.remove(key);
}
} | false | false | false | false | false | 0 |
v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx,
struct vb2_v4l2_buffer *vbuf)
{
struct v4l2_m2m_buffer *b = container_of(vbuf,
struct v4l2_m2m_buffer, vb);
struct v4l2_m2m_queue_ctx *q_ctx;
unsigned long flags;
q_ctx = get_queue_ctx(m2m_ctx, vbuf->vb2_buf.vb2_queue->type);
if (!q_ctx)
return;
spin_lock... | false | false | false | false | false | 0 |
git_get_colorbool_config(const char *var, const char *value,
void *cb)
{
if (!strcmp(var, get_colorbool_slot)) {
get_colorbool_found =
git_config_colorbool(var, value, stdout_is_tty);
}
if (!strcmp(var, "diff.color")) {
get_diff_color_found =
git_config_colorbool(var, value, stdout_is_tty);
}
if (!strc... | false | false | false | false | false | 0 |
gearman_task_error(const gearman_task_st *task)
{
if (task == NULL)
{
return NULL;
}
if (task->result_rc == GEARMAN_UNKNOWN_STATE or task->result_rc == GEARMAN_SUCCESS)
{
return NULL;
}
return gearman_strerror(task->result_rc);
} | false | false | false | false | false | 0 |
inclinenumber(LexState *ls)
{
int old = ls->current;
lua_assert(currIsNewline(ls));
next(ls); /* skip `\n' or `\r' */
if (currIsNewline(ls) && ls->current != old)
next(ls); /* skip `\n\r' or `\r\n' */
if (++ls->linenumber >= LJ_MAX_LINE)
lj_lex_error(ls, ls->token, LJ_ERR_XLINES);
} | false | false | false | false | false | 0 |
ClipboardCopy()
{//===========================
int ix;
int nframes;
int count=0;
nframes = CountSelected();
if(nframes == 0) return;
if(clipboard_spect != NULL)
delete clipboard_spect;
if((clipboard_spect = new SpectSeq(nframes))==NULL) return;
for(ix=0; ix<numframes; ix++)
{
if(frames[ix]->selected... | false | false | false | false | false | 0 |
destroy_rtp(struct skinny_subchannel *sub)
{
if (sub->rtp) {
SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %d - Destroying RTP\n", sub->callid);
ast_rtp_instance_stop(sub->rtp);
ast_rtp_instance_destroy(sub->rtp);
sub->rtp = NULL;
}
if (sub->vrtp) {
SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %d - Destroying VRTP\n", sub->calli... | false | false | false | false | false | 0 |
graph_pallet(struct graph* g, int idx, unsigned int c)
{
if (g == NULL || c >= 256)
return;
if (g->pallet_count <= idx) {
memset(g->png_data + 0x29 + 3 * g->pallet_count,0,(idx - g->pallet_count) * 3);
g->pallet_count = idx + 1;
}
g->png_data[0x29 + idx * 3 ] = (unsigned char)((c >> 16) & 0xFF); // R
g->... | false | false | false | false | false | 0 |
connect_node_to_common_table (Module_table *current_mpt,
Common_table *new_cmt)
{
Var_table *vpt;
Array_table *apt;
Common_node *last = NULL;
int offset = 0;
for (vpt = current_mpt->var_head; vpt; vpt = vpt->next) {
if (vpt->node == NULL ||
... | false | false | false | false | false | 0 |
GetEncodedRMWOperation(AtomicRMWInst::BinOp Op) {
switch (Op) {
default: llvm_unreachable("Unknown RMW operation!");
case AtomicRMWInst::Xchg: return bitc::RMW_XCHG;
case AtomicRMWInst::Add: return bitc::RMW_ADD;
case AtomicRMWInst::Sub: return bitc::RMW_SUB;
case AtomicRMWInst::And: return bitc::RMW_AND;
... | false | false | false | false | false | 0 |
glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return 0;
}
if (chars == NULL || offset < 0 || count < 0 || ma... | false | false | false | false | false | 0 |
transpose(void) const
{
matrix3x3 returnValue;
for(unsigned int i=0; i<3; i++)
for(unsigned int j=0; j<3; j++)
returnValue.ele[i][j] = ele[j][i];
return(returnValue);
} | false | false | false | false | false | 0 |
drmaa_get_next_attr_value(drmaa_attr_values_t* values, char *value, size_t value_len)
{
dstring val;
if (value != NULL) {
sge_dstring_init(&val, value, value_len+1);
}
return japi_string_vector_get_next(values, value?&val:NULL);
} | false | false | false | false | false | 0 |
table_NAN (struct GMTMATH_INFO *info, double **stack[], GMT_LONG *constant, double *factor, GMT_LONG last, GMT_LONG col, GMT_LONG n_row)
/*OPERATOR: NAN 2 1 NaN if A == B, else A. */
{
GMT_LONG i, prev;
double a = 0.0, b = 0.0;
prev = last - 1;
if (constant[prev]) a = factor[prev];
if (constant[last]) b = factor... | false | false | false | false | false | 0 |
read_nres_amino(ESL_SQFILE *sqfp, ESL_SQ *sq, int len, uint64_t *nres)
{
int inx;
int off;
int size;
char *ptr;
ESL_SQNCBI_DATA *ncbi = &sqfp->data.ncbi;
if (ncbi->index >= ncbi->num_seq) return eslEOF;
/* if we don't know the sequence length, figure it out */
if (ncbi->seq_L == -1) nc... | false | false | false | false | false | 0 |
Bitstream_read ( Int bits )
{
Uint32_t ret;
ret = dword;
if ( (pos += bits) < BITS ) {
ret >>= BITS - pos;
} else {
pos -= BITS;
dword = InputBuff [InputCnt = (InputCnt+1) & IBUFMASK];
if ( pos > 0 ) {
ret <<= pos;
ret |= dword >> (BITS - pos)... | false | false | false | false | false | 0 |
makeurl(const char * fmt, ...) {
static char url[512];
const char * src = fmt;
char * ptr = NULL;
unsigned pos = 0;
va_list argv;
va_start(argv, fmt);
memset(url, 0, sizeof(url));
while(* src && pos < sizeof(url) - 1) {
if(* src != '%')
url[pos++] = * (src++);
else if(* (src + 1)) {
switch(* (++src... | false | false | false | false | false | 0 |
gnet_stats_count_dropped_nosize(
const gnutella_node_t *n, msg_drop_reason_t reason)
{
uint type;
gnet_stats_t *stats;
g_assert(UNSIGNED(reason) < MSG_DROP_REASON_COUNT);
type = stats_lut[gnutella_header_get_function(&n->header)];
stats = NODE_USES_UDP(n) ? &gnet_udp_stats : &gnet_tcp_stats;
/* Data part of m... | false | false | false | false | false | 0 |
qcsequenceadaptorFetchAllbyStatement(
EnsPBaseadaptor ba,
const AjPStr statement,
EnsPAssemblymapper am,
EnsPSlice slice,
AjPList qcss)
{
ajuint identifier = 0U;
ajuint databaseid = 0U;
ajuint version = 0U;
ajuint length = 0U;
ajuint cdsstart = 0U;
ajuint cdsend ... | false | false | false | false | false | 0 |
is_solution(int move, const board_t * board, const char bm[], const char am[]) {
char move_string[256];
bool correct;
ASSERT(move!=MoveNone);
ASSERT(bm!=NULL);
ASSERT(am!=NULL);
if (!move_is_legal(move,board)) {
board_disp(board);
move_disp(move,board);
printf("\n\n");
}
AS... | false | false | false | false | false | 0 |
zcurrentdash(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
push(2);
ref_assign(op - 1, &istate->dash_pattern_array);
make_real(op, gs_currentdash_offset(igs));
return 0;
} | false | false | false | false | false | 0 |
nego_attempt_tls(rdpNego* nego)
{
uint8 code;
nego->requested_protocols = PROTOCOL_TLS;
DEBUG_NEGO("Attempting TLS security");
nego_tcp_connect(nego);
nego_send_negotiation_request(nego);
nego_recv_response(nego);
if (nego->state != NEGO_STATE_FINAL)
{
nego_tcp_disconnect(nego);
if (nego->enabled_proto... | false | false | false | false | false | 0 |
main( int argc, char * argv[] )
{
int port = 1770, maxThreads = 10;
const char * serverType = "lf";
extern char *optarg ;
int c ;
while( ( c = getopt ( argc, argv, "p:t:s:v" )) != EOF ) {
switch ( c ) {
case 'p' :
port = atoi( optarg );
break;
case 't':
maxThreads = atoi( optarg );
break;... | false | false | false | false | false | 0 |
returnValueData(ParserControl *parm, parseUnion *stateUnion)
{
parseUnion lvalp ={0};
ct = localLex((parseUnion*)&stateUnion->xtokReturnValueData, parm);
if(ct == XTOK_VALUE) {
dontLex = 1;
value(parm, (parseUnion*)&stateUnion->xtokReturnValueData.value);
}
else if(ct == XTOK_VALUEREFERENCE) {
dontLex = 1;
... | false | false | false | false | false | 0 |
drm_kms_helper_poll_enable_locked(struct drm_device *dev)
{
bool poll = false;
struct drm_connector *connector;
WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll)
return;
drm_for_each_connector(connector, dev) {
if (connector->polled & (DRM_CONNEC... | false | false | false | false | false | 0 |
preserveOptionsEdit()
{
// If the user has chosen an item from the option combo list, don't overwrite the current text
// Therefore preserving the text in the edit as soon the user highlights an entry in the combo list
TempOptions = ComboBoxOptions->currentText();
} | false | false | false | false | false | 0 |
put(const Str &key, const Str &value) {
while (failing)
/* do nothing */;
q_[0].run_replace(tree->table(), key, value, *ti_);
if (ti_->logger()) // NB may block
ti_->logger()->record(logcmd_replace, q_[0].query_times(), key, value);
} | false | false | false | false | false | 0 |
changeEvent( QEvent *event )
{
switch( event->type() )
{
case QEvent::StyleChange:
case QEvent::FontChange:
layoutKnob( true );
break;
default:
break;
}
} | false | false | false | false | false | 0 |
__bam_set_flags(dbp, flagsp)
DB *dbp;
u_int32_t *flagsp;
{
BTREE *t;
u_int32_t flags;
t = dbp->bt_internal;
flags = *flagsp;
if (LF_ISSET(DB_DUP | DB_DUPSORT | DB_RECNUM | DB_REVSPLITOFF))
DB_ILLEGAL_AFTER_OPEN(dbp, "DB->set_flags");
/*
* The DB_DUP and DB_DUPSORT flags are shared by the Hash
* and Btr... | false | false | false | false | false | 0 |
Cudd_bddIsVarHardGroup(
DdManager *dd,
int index)
{
if (index >= dd->size || index < 0) return(-1);
if (dd->subtables[dd->perm[index]].varToBeGrouped == CUDD_LAZY_HARD_GROUP)
return(1);
return(0);
} | false | false | false | false | false | 0 |
cz_init_uvd_limit(struct amdgpu_device *adev)
{
struct cz_power_info *pi = cz_get_pi(adev);
struct amdgpu_uvd_clock_voltage_dependency_table *table =
&adev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table;
uint32_t clock = 0, level;
if (!table || !table->count) {
DRM_ERROR("Invalid Voltage Dependency table... | false | false | false | false | false | 0 |
OnSetPriorityAuto( wxCommandEvent& WXUNUSED(event) )
{
long index = GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
while( index != -1 ) {
// ADUNANZA BEGIN
// Back
#if 0
CKnownFile* file = (CKnownFile*)GetItemData( index );
#else
CKnownFile* file = reinterpret_cast<CKnownFile*>(GetItemData(index));
... | false | false | false | false | false | 0 |
vp_request_intx(struct virtio_device *vdev)
{
int err;
struct virtio_pci_device *vp_dev = to_vp_device(vdev);
err = request_irq(vp_dev->pci_dev->irq, vp_interrupt,
IRQF_SHARED, dev_name(&vdev->dev), vp_dev);
if (!err)
vp_dev->intx_enabled = 1;
return err;
} | false | false | false | false | false | 0 |
build_curseg(struct f2fs_sb_info *sbi)
{
struct curseg_info *array;
int i;
array = malloc(sizeof(*array) * NR_CURSEG_TYPE);
SM_I(sbi)->curseg_array = array;
for (i = 0; i < NR_CURSEG_TYPE; i++) {
array[i].sum_blk = malloc(PAGE_CACHE_SIZE);
if (!array[i].sum_blk)
return -ENOMEM;
array[i].segno = NULL_SE... | false | false | false | false | false | 0 |
modeNumber(bool & cc,tcPDPtr parent,
const tPDVector & children) const {
if(children.size()!=3) return -1;
int id(parent->id());
// check the pions
tPDVector::const_iterator pit = children.begin();
tPDVector::const_iterator pend = children.end();
int idtemp,npi0(0),npiplus(0),npiminus(0);
for(... | false | false | false | false | false | 0 |
str_find (void)
{
char *s = luaL_check_string(1);
char *p = luaL_check_string(2);
long init = (long)luaL_opt_number(3, 1) - 1;
luaL_arg_check(0 <= init && init <= strlen(s), 3, "out of range");
if (lua_getparam(4) != LUA_NOOBJECT ||
strpbrk(p, SPECIALS) == NULL) { /* no special caracters? */
char ... | false | false | false | false | false | 0 |
crc32_update(unsigned long crcword, const void *buf, size_t len)
{
const unsigned char *p = (const unsigned char *) buf;
while (len--) {
unsigned long newbyte = *p++;
newbyte ^= crcword & 0xFFL;
crcword = (crcword >> 8) ^ crc32_table[newbyte];
}
return crcword;
} | false | false | false | false | false | 0 |
python_connection(conn_rec *con)
{
PyObject *resultobject = NULL;
interpreterdata *idata;
connobject *conn_obj;
py_config * conf;
int result;
const char *interp_name = NULL;
hl_entry *hle = NULL;
/* get configuration */
conf = (py_config *) ap_get_module_config(con->base_server->mo... | false | false | false | false | false | 0 |
ath10k_pci_claim(struct ath10k *ar)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
struct pci_dev *pdev = ar_pci->pdev;
int ret;
pci_set_drvdata(pdev, ar);
ret = pci_enable_device(pdev);
if (ret) {
ath10k_err(ar, "failed to enable pci device: %d\n", ret);
return ret;
}
ret = pci_request_region(pdev, ... | false | false | false | false | false | 0 |
AlterTypeOwner(List *names, Oid newOwnerId)
{
TypeName *typename;
Oid typeOid;
Relation rel;
HeapTuple tup;
HeapTuple newtup;
Form_pg_type typTup;
AclResult aclresult;
rel = heap_open(TypeRelationId, RowExclusiveLock);
/* Make a TypeName so we can use standard type lookup machinery */
typename = makeTyp... | false | false | false | false | false | 0 |
str_only_space(const string& str) {
unsigned int len = str.length();
for (unsigned int i = 0; i < len; i++) {
if (str[i] != ' ') return false;
}
return true;
} | false | false | false | false | false | 0 |
xfs_highbit32(xfs_uint32_t v)
{
int i;
if (--v) {
for (i = 0; i < 31; i++, v >>= 1) {
if (v == 0)
return i;
}
}
return 0;
} | false | false | false | false | false | 0 |
Submit(const std::list<JobDescription>& jobdescs, const ExecutionTarget& et, EntityConsumer<Job>& jc, std::list<const JobDescription*>& notSubmitted) {
// TODO: this is multi step process. So having retries would be nice.
// Submission to EMI ES involves delegation. Delegation may happen through
// separa... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__ToolTip_Find(struct __ecereNameSpace__ecere__com__Instance * window)
{
struct __ecereNameSpace__ecere__com__Instance * w;
for(w = __ecereProp___ecereNameSpace__ecere__gui__Window_Get_firstSlave(window); w; w = __ecereProp___ecereNameSpace__ecere__gui__Window_Get_nextSlave(w))
{
i... | false | false | false | false | false | 0 |
rd_copy(rd_t* dest, int dest_offset, const rd_t* src, int src_offset, int N) {
int i;
for (i=0; i<N; i++) {
dest->ra [i + dest_offset] = src->ra [i + src_offset];
dest->dec[i + dest_offset] = src->dec[i + src_offset];
}
} | false | false | false | false | false | 0 |
wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int reg = mc->reg;
int ret;
u16 val;
ret = snd_soc_put_volsw(kcon... | false | false | false | false | false | 0 |
fors_header_write_int(cpl_propertylist *header, int value,
const char *name, const char *unit,
const char *comment)
{
char *header_name;
int i;
char *allComment;
allComment = cpl_malloc(81 * sizeof(char *));
if (unit)
snprintf(... | false | false | false | false | false | 0 |
sprint_char(char *buf, const u_char ch)
{
if (isprint(ch) || isspace(ch)) {
sprintf(buf, "%c", (int) ch);
} else {
sprintf(buf, ".");
}
} | false | false | false | false | false | 0 |
FindMaxRatioTag(double max_ratio_sum, rapidxml::xml_document<> *doc,
rapidxml::xml_node<> *node) {
if (doc == NULL || node == NULL) { return false; }
double ratio_sum = StrToDouble(node->last_attribute(kRatioSum)->value());
std::string str_mark = node->last_attribute(kMark)->value();
doubl... | false | false | false | false | false | 0 |
gdata_gd_organization_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
GDataGDOrganizationPrivate *priv = GDATA_GD_ORGANIZATION (object)->priv;
switch (property_id) {
case PROP_NAME:
g_value_set_string (value, priv->name);
break;
case PROP_TITLE:
g_value_set_string (... | false | false | false | false | false | 0 |
vtkMINCImageWriterConvertVTKTypeToMINCType(
int dataType,
int &mincsigned)
{
nc_type minctype = NC_BYTE;
// Get the vtk type of the data.
switch (dataType)
{
case VTK_CHAR:
case VTK_SIGNED_CHAR:
minctype = NC_BYTE;
mincsigned = 1;
break;
case VTK_UNSIGNED_CHAR:
minctyp... | false | false | false | false | false | 0 |
Roll() const
{
if (!ExplicitlyChanced.empty()) // First explicitly chanced entries are checked
{
float Roll = rand_chance_f();
for (uint32 i = 0; i < ExplicitlyChanced.size(); ++i) // check each explicitly chanced entry in the template and modify its chance based on qual... | false | false | false | false | false | 0 |
enableLanguages (const boolean state)
{
unsigned int i;
for (i = 0 ; i < LanguageCount ; ++i)
LanguageTable [i]->enabled = state;
} | false | false | false | false | false | 0 |
oc_enc_frag_sub_mmx(ogg_int16_t _residue[64],
const unsigned char *_src,const unsigned char *_ref,int _ystride){
int i;
__asm__ __volatile__("pxor %%mm7,%%mm7\n\t"::);
for(i=4;i-->0;){
__asm__ __volatile__(
/*mm0=[src]*/
"movq (%[src]),%%mm0\n\t"
/*mm1=[ref]*/
"movq (%[ref]),%%mm1\n\t... | false | false | false | false | false | 0 |
do_vlan(int argc, char **argv)
{
ll_init_map(&rth);
if (argc > 0) {
if (matches(*argv, "add") == 0)
return vlan_modify(RTM_SETLINK, argc-1, argv+1);
if (matches(*argv, "delete") == 0)
return vlan_modify(RTM_DELLINK, argc-1, argv+1);
if (matches(*argv, "show") == 0 ||
matches(*argv, "lst") == 0 ||
... | false | false | false | false | false | 0 |
save_files_dirs(const unsigned char *sha1,
const char *base, int baselen, const char *path,
unsigned int mode, int stage)
{
int len = strlen(path);
char *newpath = xmalloc(baselen + len + 1);
memcpy(newpath, base, baselen);
memcpy(newpath + baselen, path, len);
newpath[baselen + len] = '\0';
if (S_ISDIR(mode... | false | false | false | false | false | 0 |
pp_c_cv_qualifiers (c_pretty_printer *pp, int qualifiers, bool func_type)
{
const char *p = pp_last_position_in_text (pp);
bool previous = false;
if (!qualifiers)
return;
/* The C programming language does not have references, but it is much
simpler to handle those here rather than going through the ... | false | false | false | false | false | 0 |
make_log_entry( httpd_conn* hc, struct timeval* nowP )
{
char* ru;
char url[305];
char bytes[40];
if ( hc->hs->no_log )
return;
/* This is straight CERN Combined Log Format - the only tweak
** being that if we're using syslog() we leave out the date, because
** syslogd puts it in. Th... | true | true | false | false | false | 1 |
mpz_trailing_zeroes (gcry_mpi_t n)
{
unsigned int idx, cnt;
cnt = gcry_mpi_get_nbits (n);
for (idx = 0; idx < cnt; idx++)
{
if (gcry_mpi_test_bit (n, idx) == 0)
return idx;
}
return ULONG_MAX;
} | false | false | false | false | false | 0 |
ext2_app_device_list_dir_handler(struct ext2_dir_entry_2 *entry, void *data)
{
print_ntext(entry->name, entry->name_len);
if (entry->file_type == EXT2_FT_DIR)
{
print_char('/');
}
print_char('\n');
} | false | false | false | false | false | 0 |
adjustNetVec(HttpQueue *q, ssize written)
{
MprIOVec *iovec;
ssize len;
int i, j;
/*
Cleanup the IO vector
*/
if (written == q->ioCount) {
/*
Entire vector written. Just reset.
*/
q->ioIndex = 0;
q->ioCount = 0;
} else ... | false | false | false | false | false | 0 |
ScheduleEditOperation(char *filename,struct Attributes a,struct Promise *pp)
{ struct Bundle *bp;
void *vp;
struct FnCall *fp;
char *edit_bundle_name = NULL,lockname[CF_BUFSIZE];
struct Rlist *params;
int retval = false;
struct CfLock thislock;
snprintf(lockname,CF_BUFSIZE-1,"fileedit-%s",pp->promiser);
t... | false | false | false | false | false | 0 |
run(raw_ostream &OS) {
emitSourceFileHeader("DAG Instruction Selector for the " +
CGP.getTargetInfo().getName() + " target", OS);
OS << "// *** NOTE: This file is #included into the middle of the target\n"
<< "// *** instruction selector class. These functions are really "
<< "met... | false | false | false | false | false | 0 |
isLUKS(const char *type)
{
return (type && !strcmp(CRYPT_LUKS1, type));
} | false | false | false | false | false | 0 |
ya_search_template(const Module_table *module, const Array_table *atbl,
const int *dim_size, const int total_size,
const int level)
{
List *li;
for (li = _template_head; li != NULL; li = li->next) {
if (ya_use_same_template(li->data, module, atbl, dim_size,
... | false | false | false | false | false | 0 |
GdipGetHemfFromMetafile (GpMetafile *metafile, HENHMETAFILE *hEmf)
{
if (!metafile || !hEmf)
return InvalidParameter;
*hEmf = (HENHMETAFILE)metafile;
return Ok;
} | false | false | false | false | false | 0 |
get_msr_mce(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
{
u64 data;
u64 mcg_cap = vcpu->arch.mcg_cap;
unsigned bank_num = mcg_cap & 0xff;
switch (msr) {
case MSR_IA32_P5_MC_ADDR:
case MSR_IA32_P5_MC_TYPE:
data = 0;
break;
case MSR_IA32_MCG_CAP:
data = vcpu->arch.mcg_cap;
break;
case MSR_IA32_MCG_CTL:
... | false | false | false | false | false | 0 |
myri10ge_get_firmware_capabilities(struct myri10ge_priv *mgp)
{
struct myri10ge_cmd cmd;
int status;
/* probe for IPv6 TSO support */
mgp->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO;
status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE,
&cmd, 0);
if (status == 0) {
mgp->max_tso6 =... | false | false | false | false | false | 0 |
PieceSprite(const QString &id, ThemeManager* theme, int no, QGraphicsScene* canvas)
: Themeable(id, theme), PixmapSprite(no, canvas)
{
mMovementState = Idle;
mNotify = new SpriteNotify(this);
if (theme) theme->updateTheme(this);
} | false | false | false | false | false | 0 |
GetImage( unsigned short type ) const {
short rc = -1;
if ( uset ) {
const UnitType *ut = uset->GetUnitInfo(type % uset->NumTiles());
if ( ut ) {
if ( type < uset->NumTiles() ) rc = ut->Image();
else rc = ut->Image() + 9; /* player 2, facing southwards */
}
}
return rc;
} | false | false | false | false | false | 0 |
pstadium_gfxflag_w(int data)
{
static int pstadium_flipscreen_old = -1;
pstadium_flipx = (data & 0x01) ? 1 : 0;
pstadium_flipy = (data & 0x02) ? 1 : 0;
pstadium_flipscreen = (data & 0x04) ? 0 : 1;
pstadium_dispflag = (data & 0x10) ? 0 : 1;
if (pstadium_flipscreen != pstadium_flipscreen_old)
{
psta... | false | false | false | false | false | 0 |
afr_examine_dir_readdir_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
gf_dirent_t *entries, dict_t *xdata)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
afr_self_... | false | false | false | false | false | 0 |
smem_write(int driverhandle, void *buffer, long nbytes)
{
if (NULL == buffer) return(SHARED_NULPTR);
if (shared_check_locked_index(driverhandle)) return(SHARED_INVALID);
if (-1 != shared_lt[driverhandle].lkcnt) return(SHARED_INVALID); /* are we locked RW ? */
if (nbytes < 0) return(SHARED_BADARG);
if (... | true | true | false | false | false | 1 |
snd_at73c213_pcm_trigger(struct snd_pcm_substream *substream,
int cmd)
{
struct snd_at73c213 *chip = snd_pcm_substream_chip(substream);
int retval = 0;
spin_lock(&chip->lock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
ssc_writel(chip->ssc->regs, IER, SSC_BIT(IER_ENDTX));
ssc_writel(chip->ssc->regs,... | false | false | false | false | false | 0 |
stream_skip_bytes(mpg123_handle *fr,off_t len)
{
if(fr->rdat.flags & READER_SEEKABLE)
{
off_t ret = stream_lseek(fr, len, SEEK_CUR);
return (ret < 0) ? READER_ERROR : ret;
}
else if(len >= 0)
{
unsigned char buf[1024]; /* ThOr: Compaq cxx complained and it makes sense to me... or should one do a cast? What f... | false | false | false | false | false | 0 |
AllocateGraphics() {
if (!pixmapLine)
pixmapLine = Surface::Allocate(technology);
if (!pixmapSelMargin)
pixmapSelMargin = Surface::Allocate(technology);
if (!pixmapSelPattern)
pixmapSelPattern = Surface::Allocate(technology);
if (!pixmapSelPatternOffset1)
pixmapSelPatternOffset1 = Surface::Allocate(technolo... | false | false | false | false | false | 0 |
addr_policy_permits_tor_addr(const tor_addr_t *addr, uint16_t port,
smartlist_t *policy)
{
addr_policy_result_t p;
p = compare_tor_addr_to_addr_policy(addr, port, policy);
switch (p) {
case ADDR_POLICY_PROBABLY_ACCEPTED:
case ADDR_POLICY_ACCEPTED:
return 1;
case ADDR_... | false | false | false | false | false | 0 |
File_Prop_Date_2(WamWord date_time_word, WamWord path_name_word)
{
char *path_name;
struct stat file_info;
time_t *t;
path_name = Get_Path_Name(path_name_word);
Os_Test_Error(stat(path_name, &file_info));
switch (sys_var[0])
{
case 0:
t = &(file_info.st_ctime);
break;
case 1:
... | 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.