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 |
|---|---|---|---|---|---|---|
set_render_type(scheme *sc, pointer args)
{
pointer car_el;
int r;
dprintf("--> entering project.c:%s()\n", __FUNCTION__);
if (!sc->vptr->is_pair(args)){
GERB_MESSAGE("set-render-type!: Too few arguments\n");
return sc->F;
}
car_el = sc->vptr->pair_car(args);
r = sc->vptr->ivalue (car_... | false | false | false | false | false | 0 |
__readahead (int fd, off64_t offset, size_t count)
{
return INLINE_SYSCALL (readahead, 4, fd,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)),
count);
} | false | false | false | false | false | 0 |
xgbe_print_pkt(struct net_device *netdev, struct sk_buff *skb, bool tx_rx)
{
struct ethhdr *eth = (struct ethhdr *)skb->data;
unsigned char *buf = skb->data;
unsigned char buffer[128];
unsigned int i, j;
netdev_dbg(netdev, "\n************** SKB dump ****************\n");
netdev_dbg(netdev, "%s packet of %d byte... | false | false | false | false | false | 0 |
megasas_make_sgl64(struct megasas_instance *instance, struct scsi_cmnd *scp,
union megasas_sgl *mfi_sgl)
{
int i;
int sge_count;
struct scatterlist *os_sgl;
sge_count = scsi_dma_map(scp);
BUG_ON(sge_count < 0);
if (sge_count) {
scsi_for_each_sg(scp, os_sgl, sge_count, i) {
mfi_sgl->sge64[i].length = c... | false | false | false | false | false | 0 |
loadFromSettings()
{
this->ui->lineEdit_dataDir->setText(this->settings->getDataDir());
this->ui->lineEdit_accountData->setText(this->settings->getAccountDataFilename());
this->ui->lineEdit_history->setText(this->settings->getHistoryFilename());
this->ui->lineEdit_recipients->setText(this->settings->getRecipientsFi... | false | false | false | false | false | 0 |
di_compress_tree_cb(AW_window *aww){
GB_transaction dummy(GLOBAL_gb_main);
char *treename = aww->get_root()->awar(AWAR_DIST_TREE_COMP_NAME)->read_string();
GB_ERROR error = 0;
GBT_TREE *tree = GBT_read_tree(GLOBAL_gb_main,treename,sizeof(GBT_TREE));
if (!tree) error = "Please select a valid tree fir... | false | false | false | false | false | 0 |
connman_provider_indicate_error(struct connman_provider *provider,
enum connman_provider_error error)
{
enum connman_service_error service_error;
switch (error) {
case CONNMAN_PROVIDER_ERROR_LOGIN_FAILED:
service_error = CONNMAN_SERVICE_ERROR_LOGIN_FAILED;
break;
case CONNMAN_PROVIDER_ERROR_AUTH_FAILED:
... | false | false | false | false | false | 0 |
gsb_form_scheduler_get_scheduler_part ( gint scheduled_number )
{
if (!scheduled_number)
return FALSE;
/* needn't to fill the account number because set while creating the scheduled transaction */
gsb_data_scheduled_set_account_number (scheduled_number,
gsb_form_scheduler_get_account ());
gsb_... | false | false | false | false | false | 0 |
initializeEngine(QDeclarativeEngine *engine, const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.kwin.decorations.plastik"));
engine->addImageProvider(QLatin1String("plastik"), new KWin::PlastikButtonProvider());
QDeclarativeExtensionPlugin::initializeEngine(engine, uri);
} | false | false | false | false | false | 0 |
output_commit_title(struct merge_options *o, struct commit *commit)
{
int i;
flush_output(o);
for (i = o->call_depth; i--;)
fputs(" ", stdout);
if (commit->util)
printf("virtual %s\n", (char *)commit->util);
else {
printf("%s ", find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));
if (parse_commit(co... | false | false | false | false | false | 0 |
check_seqnum(struct vfs101_dev *vdev)
{
if ((byte(0, vdev->seqnum) == vdev->buffer[0]) &&
(byte(1, vdev->seqnum) == vdev->buffer[1]))
return 0;
else
return 1;
} | false | false | false | false | false | 0 |
close() {
if (!is_open()) return;
if (z != 0) z->end();
// Deallocate memory
delete[] buf;
buf = 0;
stream = 0;
/* Only report errors *after* marking the stream as closed, to avoid
another exception being thrown when the Zibstream object goes out of
scope and ~Zibstream calls close() again. *... | false | false | false | false | false | 0 |
ca_refresh_model_callback ()
{
GtkTreeStore * new_model = NULL;
GtkTreeView * treeview = NULL;
GtkCellRenderer * renderer = NULL;
GtkTreeViewColumn * column = NULL;
guint columns_number;
/* Models have these columns:
- Id
- Is CA
- Serial
... | false | false | false | false | false | 0 |
finish_edge(InstrCt *ct, uint8 command) {
int i;
optimize_edge(ct);
if (ct->edge.othercnt==0)
return;
ct->pt=instructpoints(ct->pt, ct->edge.othercnt, ct->edge.others, command);
for(i=0; i<ct->edge.othercnt; i++)
ct->touched[ct->edge.others[i]] |= (ct->xdir?tf_x:tf_y);
free(ct->edge.others);... | false | false | false | false | false | 0 |
init_mv_penalty_and_fcode(MpegEncContext *s)
{
int f_code;
int mv;
for(f_code=1; f_code<=MAX_FCODE; f_code++){
for(mv=-MAX_MV; mv<=MAX_MV; mv++){
int len;
if(mv==0) len= mvtab[0][1];
else{
int val, bit_size, range, code;
bit_size... | false | false | false | false | false | 0 |
console_setup(char *str)
{
char buf[sizeof(console_cmdline[0].name) + 4]; /* 4 for "ttyS" */
char *s, *options, *brl_options = NULL;
int idx;
if (_braille_console_setup(&str, &brl_options))
return 1;
/*
* Decode str into name, index, options.
*/
if (str[0] >= '0' && str[0] <= '9') {
strcpy(buf, "ttyS");... | false | false | false | false | false | 0 |
dofinish() {
useMe();
AnalysisHandler::dofinish();
// output the histograms
string fname = generator()->filename() + string("-") + name() + string(".top");
ofstream output(fname.c_str());
using namespace HistogramOptions;
double chisq,minfrac=0.05;
unsigned int npoint;
_fragBxE->chiSquared(chisq,npoin... | false | false | false | false | false | 0 |
rexecutor_many_threads(int n, fftw_real *in,
fftw_real *out,
fftw_plan_node *p,
int istride,
int ostride,
int howmany, int idist, int odist,
int nthreads)
{
if (nthreads > howmany)
nthreads = howmany;
switch (p->type) {
case FFTW_REAL2HC:
{
int s;
... | false | false | false | false | false | 0 |
zrealloc(void *ptr, size_t size, size_t elt, size_t osize)
{
void *p = realloc(ptr, size * elt);
if (p == NULL && size) {
fprintf(stderr, "out of memory\n");
return p;
}
if (osize < size)
memset((char *) p + (osize * elt), '\0', (size - osize) * elt);
return p;
} | false | false | false | false | false | 0 |
_wi_string_append_bytes(wi_string_t *string, const void *buffer, wi_uinteger_t length) {
_WI_STRING_GROW(string, length);
memmove(string->string + string->length, buffer, length);
string->length += length;
string->string[string->length] = '\0';
} | false | false | false | false | false | 0 |
set_phases(GtArray *cds_features)
{
GtPhase phase = GT_PHASE_ZERO;
GtFeatureNode *cds_feature;
unsigned long i, length;
gt_assert(cds_features && gt_array_size(cds_features));
for (i = 0; i < gt_array_size(cds_features); i++) {
cds_feature = *(GtFeatureNode**) gt_array_get(cds_features, i);
gt_feature... | false | false | false | false | false | 0 |
add_str(const unsigned char *p)
{
static size_t str_pos=0,str_size=0;
size_t len;
int i;
i=calc_hash(p);
if(str_hash[i]==0){
str_hash[i]=str_num;
} else {
i=str_hash[i];
for(;;){
if(strcmpi(str_buf+str_data[i].str,p)==0){
return i;
}
if(str_data[i].next==0)
break;
i=str_data[i].next;
... | false | false | false | false | false | 0 |
get_comment (GitgCommitView *view)
{
GtkTextBuffer *buffer;
GtkTextIter start;
GtkTextIter end;
buffer = gtk_text_view_get_buffer (view->priv->comment_view);
gtk_text_buffer_get_bounds (buffer, &start, &end);
gchar *text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gchar *ptr;
for (ptr = text; *... | false | false | false | false | false | 0 |
cb_engineering_toggle (GtkWidget *w, GOFormatSel *gfs)
{
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)))
gfs->format.details.exponent_step = 3;
else
gfs->format.details.exponent_step = 1;
draw_format_preview (gfs, TRUE);
} | false | false | false | false | false | 0 |
GetFeature( long nFeatureId )
{
if( !bPreserveSrcFID )
return OGRLayer::GetFeature(nFeatureId);
for(int i=0;i<nSrcLayers;i++)
{
iCurLayer = i;
ConfigureActiveLayer();
OGRFeature* poSrcFeature = papoSrcLayers[i]->GetFeature(nFeatureId);
if( poSrcFeature != NULL )
... | false | false | false | false | false | 0 |
tgamma(x)
double x;
{
struct Double u;
if (x >= 6) {
if(x > 171.63)
return (x / zero);
u = large_gam(x);
return(__exp__D(u.a, u.b));
} else if (x >= 1.0 + LEFT + x0)
return (small_gam(x));
else if (x > 1.e-17)
return (smaller_gam(x));
else if (x > -1.e-17) {
if (x != 0.0)
u.a = one - tiny; /* r... | false | false | false | false | false | 0 |
HandleModOffhandDamagePercent(bool apply, bool Real)
{
// spells required only Real aura add/remove
if (!Real)
return;
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "AURA MOD OFFHAND DAMAGE");
GetTarget()->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(m_modifier.m_amount), apply);
} | false | false | false | false | false | 0 |
target_is_a_replica_root(Slapi_PBlock *pb, const Slapi_DN **root)
{
Slapi_DN *sdn = NULL;
PRBool return_value = PR_FALSE;
Object *repl_obj;
slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn);
if (NULL == sdn) {
return return_value;
}
repl_obj = replica_get_replica_from_dn(sdn);
if (NULL != repl_obj)
{
Replica *... | false | false | false | false | false | 0 |
rank_perform_weighted_selection(
/*@out@*/ comp_cdd_cov** comp_cdds, /*!< Reference to partially sorted list of compressed CDD coverage structures to sort */
unsigned int comp_cdd_num, /*!< Number of compressed CDD coverage structures in the comp_cdds array */
uint16* ranke... | false | false | false | false | false | 0 |
_parse_box_range(char *str, struct _range *ranges,
int len, int *count, int dims)
{
int start[dims], end[dims],
pos[dims];
char coord[dims+1];
char coord2[dims+1];
int i, a;
if(dims <= 1)
fatal("Unsupported dimensions count %d", dims);
if ((str[dims] != 'x') ||
(str[(dims * 2) + 1] != '\0'))
... | true | true | false | false | false | 1 |
setRow(int r, const Vector4& v) {
for (int c = 0; c < 4; ++c) {
elt[r][c] = v[c];
}
} | false | false | false | false | false | 0 |
removeZeroeth(std::string instring) {
string result=instring;
int n;
n=indexOf(result,",0");
while (n>=0) {
result=result.substr(0,n+1)+result.substr(n+2);
n=indexOf(result,",0");
};
return result;
} | false | false | false | false | false | 0 |
gdip_get_display_dpi ()
{
static float dpis = 0;
Display* display;
if (dpis == 0) {
#if __APPLE__
float h_dpi, v_dpi;
gdip_get_display_dpi_carbon (&h_dpi, &v_dpi);
dpis = h_dpi;
return dpis;
#else
char *val;
display = XOpenDisplay (0);
/* If the display is openable lets try to read dpi from it; othe... | false | false | false | false | false | 0 |
stp_list_get_item_by_name_internal(const stp_list_t *list, const char *name)
{
stp_list_item_t *node = list->start;
while (node && strcmp(name, list->namefunc(node->data)))
{
node = node->next;
}
return node;
} | false | false | false | false | false | 0 |
gwy_grain_value_resolve_expression(const gchar *expression,
guint *vars,
GError **error)
{
static gchar **names = NULL;
if (!expression)
return FALSE;
if (!expr)
expr = gwy_expr_new();
if (!gwy_expr_compile(expr, ex... | false | false | false | false | false | 0 |
svm_set_segment(struct kvm_vcpu *vcpu,
struct kvm_segment *var, int seg)
{
struct vcpu_svm *svm = to_svm(vcpu);
struct vmcb_seg *s = svm_seg(vcpu, seg);
s->base = var->base;
s->limit = var->limit;
s->selector = var->selector;
if (var->unusable)
s->attrib = 0;
else {
s->attrib = (var->type & SVM_SELEC... | false | false | false | false | false | 0 |
ldapqry_search( LdapQuery *qry ) {
gint retVal;
cm_return_val_if_fail( qry != NULL, -1 );
cm_return_val_if_fail( qry->control != NULL, -1 );
ldapqry_touch( qry );
qry->completed = FALSE;
/* Setup pointer to thread specific area */
pthread_setspecific( _queryThreadKey_, qry );
pthread_detach( pthread_self() ... | false | false | false | false | false | 0 |
DrawOutline(Drawable d, int w, int h)
{
if (NoBorder)
return;
/* top */
XDrawLine( dpy, d, HiInnerGC, 0, 0, w-1, 0);
/*
XDrawLine( dpy, d, HiInnerGC, 0, 1, w-1, 1);
*/
/* bottom */
XFillRectangle(dpy, d, NormalGC, 0,h-2,w-1,h-1);
/* left */
XDrawLine( dpy, d, HiInnerGC, 0, 1, 0, h-1);
/*
... | false | false | false | false | false | 0 |
ElementOfArea_4node(double *X,double *Y,double *Z,double u,double v)
{
double detA, Auu, Auv, Avv;
double dXdU,dXdV, dYdU,dYdV, dZdU,dZdV;
int i;
dXdU = dNdU_Fvalue_4node(X,u,v);
dYdU = dNdU_Fvalue_4node(Y,u,v);
dZdU = dNdU_Fvalue_4node(Z,u,v);
dXdV = dNdV_Fvalue_4node(X,u,v);
dYdV = ... | false | false | false | false | false | 0 |
output_dead_lock_vect_name (FILE *f, automaton_t automaton)
{
if (automaton->corresponding_automaton_decl == NULL)
fprintf (f, "dead_lock_%d", automaton->automaton_order_num);
else
fprintf (f, "%s_dead_lock", automaton->corresponding_automaton_decl->name);
} | false | false | false | false | false | 0 |
genmii_setup_aneg(struct mii_phy *phy, u32 advertise)
{
u16 ctl, adv;
phy->autoneg = 1;
phy->speed = SPEED_10;
phy->duplex = DUPLEX_HALF;
phy->pause = 0;
phy->advertising = advertise;
/* Setup standard advertise */
adv = sungem_phy_read(phy, MII_ADVERTISE);
adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
if (... | false | false | false | false | false | 0 |
semantics (ErrorStream &err, PointCutContext &context) {
check_arg_types (err, "args", PCE_NAME);
// recursively do a semantic analysis of child nodes
int saved_arg = context.get_arg ();
for (int i = 0; i < args (); i++) {
context.set_arg (i);
if (arg (i))
arg (i)->semantics (err, context);
}
... | false | false | false | false | false | 0 |
search_gui_parse_text_query(const gchar *text, struct query *query)
{
const gchar *p, *start, *next;
gchar *dst;
g_assert(text);
g_assert(query);
g_assert(NULL == query->text);
query->text = g_strdup(text);
dst = query->text;
start = text;
for (p = text; *p != '\0'; p = next) {
const gchar *endptr;
gint... | false | false | false | false | true | 1 |
bye_msg(const char *type)
{
const char *a=getenv("AUTHENTICATED");
char buf[NUMBUFSIZE];
const char *tls=getenv("IMAP_TLS");
libmail_str_time_t(time(NULL)-start_time, buf);
if (tls && atoi(tls))
tls=", starttls=1";
else
tls="";
if (a && *a)
fprintf(stderr, "%s, user=%s, "
"ip=[%s], headers=%lu, body=... | false | false | false | false | false | 0 |
pwd_put_values2 (SRP_PWD_ENTRY * entry, char *str)
{
char *p;
int len;
opaque *tmp;
int ret;
p = strrchr (str, ':'); /* we have g */
if (p == NULL)
{
gnutls_assert ();
return GNUTLS_E_SRP_PWD_PARSING_ERROR;
}
*p = '\0';
p++;
/* read the generator */
len = strlen (p);
i... | false | false | false | false | false | 0 |
state_set_exception (state *s, type *t, int max_stack)
{
int i;
s->stackdepth = 1;
s->stacktop = 1;
s->stack[0] = *t;
for (i = s->stacktop; i < max_stack; ++i)
init_type_from_tag (&s->stack[i], unsuitable_type);
} | false | false | false | false | false | 0 |
getUnsigned(bool doBump)
{
if (doBump) bump();
return (unsigned long) (mSeed & ULONG_MAX);
} | false | false | false | false | false | 0 |
reinit_and_retry(struct cardstate *cs, int channel)
{
int i;
if (--cs->retry_count <= 0)
return -EFAULT;
for (i = 0; i < cs->channels; ++i)
if (cs->bcs[i].at_state.cid > 0)
return -EBUSY;
if (channel < 0)
dev_warn(cs->dev,
"Could not enter cid mode. Reinit device and try again.\n");
else {
dev_wa... | false | false | false | false | false | 0 |
WriteXMPPrefix()
{
// Write the contiguous object header and the 4 byte length of the XMP packet.
LFA_FileRef fileRef = this->parent->fileRef;
XMP_Uns32 packetSize = (XMP_Uns32)this->xmpPacket.size();
InDesignContigObjMarker header;
memcpy ( header.fGUID, kINDDContigObjHeaderGUID, sizeof(header.fGUID) ); // AUD... | false | false | false | false | false | 0 |
rt2x00usb_kick_queue(struct data_queue *queue)
{
switch (queue->qid) {
case QID_AC_VO:
case QID_AC_VI:
case QID_AC_BE:
case QID_AC_BK:
if (!rt2x00queue_empty(queue))
rt2x00queue_for_each_entry(queue,
Q_INDEX_DONE,
Q_INDEX,
NULL,
rt2x00usb_kick_tx_entry);
break;
case QID_... | false | false | false | false | false | 0 |
test_refs_branches_upstream__cannot_retrieve_a_remote_upstream_reference_from_a_non_branch(void)
{
cl_git_pass(git_reference_lookup(&branch, repo, "refs/tags/e90810b"));
cl_git_fail(git_branch_upstream(&upstream, branch));
} | false | false | false | false | false | 0 |
test_destroy_assertion_on_token (Test *test, gconstpointer unused)
{
CK_X_ASSERTION_TYPE atype = CKT_X_PINNED_CERTIFICATE;
CK_OBJECT_HANDLE results[8];
CK_BBOOL token = CK_TRUE;
CK_ULONG n_objects = 0;
CK_RV rv;
CK_ATTRIBUTE attrs[] = {
{ CKA_X_ASSERTION_TYPE, &atype, sizeof (atype) },
{ CKA_TOKEN, &token, s... | false | false | false | false | false | 0 |
ppc32_set_sdr1(cpu_ppc_t *cpu,m_uint32_t sdr1)
{
struct vdevice *dev;
m_uint64_t pt_addr;
cpu->sdr1 = sdr1;
pt_addr = sdr1 & PPC32_SDR1_HTABORG_MASK;
pt_addr |= ((m_uint64_t)(sdr1 & PPC32_SDR1_HTABEXT_MASK) << 20);
if (!(dev = dev_lookup(cpu->vm,pt_addr,TRUE))) {
fprintf(stderr,"ppc32_set_sdr... | false | false | false | false | false | 0 |
RunConfigurationScript
(const std::string& total_script_arg, bool pscope)
{
#ifdef CMAKE_BUILD_WITH_CMAKE
cmSystemTools::SaveRestoreEnvironment sre;
#endif
int result;
this->ScriptStartTime =
cmSystemTools::GetTime();
// read in the script
if (pscope)
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_O... | false | false | false | false | false | 0 |
e_util_container_desk_count_get(E_Container *con)
{
Eina_List *zl;
E_Zone *zone;
int count = 0;
E_OBJECT_CHECK_RETURN(con, 0);
E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, 0);
EINA_LIST_FOREACH(con->zones, zl, zone)
{
int x, y;
int cx = 0, cy = 0;
e_zone_desk_count_... | false | false | false | false | false | 0 |
add_control(string n, bool act, int ar) {
control f = bigraph::control_from_string(n);
bigraph::activity_map[f] = act;
bigraph::arity_map[f] = ar;
return f;
} | false | false | false | false | false | 0 |
skein_mac_init(struct skein_ctx *ctx, const u8 *key, size_t key_len,
size_t hash_bit_len)
{
int ret = SKEIN_FAIL;
u64 *x = NULL;
size_t x_len = 0;
u64 tree_info = SKEIN_CFG_TREE_INFO_SEQUENTIAL;
skein_assert_ret(ctx, SKEIN_FAIL);
x = ctx->m.s256.x;
x_len = ctx->skein_size / 8;
skein_assert_ret(hash_bit_... | false | false | false | false | false | 0 |
PyDict_SetItem(PyObject *op, PyObject *key, PyObject *value)
{
PyDictObject *mp;
Py_hash_t hash;
if (!PyDict_Check(op)) {
PyErr_BadInternalCall();
return -1;
}
assert(key);
assert(value);
mp = (PyDictObject *)op;
if (!PyUnicode_CheckExact(key) ||
(hash = ((PyASCII... | false | false | false | false | false | 0 |
proc_always_(class Design*des)
{
do_expr expr_pat(des, top_->scope());
top_->statement()->match_proc(&expr_pat);
} | false | false | false | false | false | 0 |
clearUnits()
{
for( int i = 0; i < MAX_UNIT; i++ ) {
if( _units[i] ) {
delete _units[i];
_units[i] = NULL;
}
}
} | false | false | false | false | false | 0 |
mca_sharedfp_individual_sort_timestamps(double **ts, MPI_Offset **off, int totalnodes)
{
int i = 0;
int j = 0;
int flag = 1;
double tempts = 0.0;
OMPI_MPI_OFFSET_TYPE tempoffset = 0;
for (i= 1; (i <= totalnodes)&&(flag) ; i++) {
flag = 0;
for (j = 0; j < (totalnodes - 1); j++... | false | false | false | false | false | 0 |
manageUpload(Upload *up, int flags)
{
if (flags & MPR_MANAGE_MARK) {
mprMark(up->currentFile);
mprMark(up->file);
mprMark(up->boundary);
mprMark(up->clientFilename);
mprMark(up->tmpPath);
mprMark(up->id);
}
} | false | false | false | false | false | 0 |
e_map_finalize (GObject *object)
{
EMap *view;
EMapPrivate *priv;
g_return_if_fail (object != NULL);
g_return_if_fail (E_IS_MAP (object));
view = E_MAP (object);
priv = view->priv;
while (priv->tweens)
e_map_tween_destroy (view, priv->tweens->data);
e_map_stop_tweening (view);
... | false | false | false | false | false | 0 |
gib_list_num(gib_list * root, gib_list * l)
{
int i = 0;
while (root)
{
if (root == l)
return (i);
i++;
root = root->next;
}
return (-1);
} | false | false | false | false | false | 0 |
drawAAPixel(SplashPipe *pipe, int x, int y) {
#if splashAASize == 4
static int bitCount4[16] = { 0, 1, 1, 2, 1, 2, 2, 3,
1, 2, 2, 3, 2, 3, 3, 4 };
int w;
#else
int xx, yy;
#endif
SplashColorPtr p;
int x0, x1, t;
if (x < 0 || x >= bitmap->width ||
y < state->clip->getYMinI() || y > state->cl... | false | false | false | false | false | 0 |
init(const ScoreMatrixRow *scoreMatrix,
int numNormalLetters,
double lambda,
const double *letterProbs2,
bool isPhred,
int qualityOffset,
... | false | false | false | false | false | 0 |
real_floor (REAL_VALUE_TYPE *r, enum machine_mode mode,
const REAL_VALUE_TYPE *x)
{
do_fix_trunc (r, x);
if (! real_identical (r, x) && r->sign)
do_add (r, r, &dconstm1, 0);
if (mode != VOIDmode)
real_convert (r, mode, r);
} | false | false | false | false | false | 0 |
findFirstTrackOffset()
{
if (firstTrackpointOffset == 0)
{
firstTrackpointOffset = findFirstTrackpointOffset();
if (firstTrackpointOffset == 0)
return 0;
}
/* First track offset is the first trackpoint offset plus number of
trackpoints time size of a trackpoint*/
r... | false | false | false | false | false | 0 |
ldl_invalidstatement( char *statementp )
{
const int TRUE = 1;
const int FALSE = 0;
/* comments aren't valid statements */
if (statementp[0] == '#') return TRUE;
/* empty lines aren't valid statements */
if (statementp[0] == ' ' ||
statementp[0] == '\t' ||
statementp[0] == '\n') return TRUE;
/* ext... | false | false | false | false | false | 0 |
call_in_arg_thread(lua_State *L)
{
int narg = lua_gettop(L);
// object
QObject *obj = luaQ_toqobject(L, 1);
if (! obj)
luaL_typerror(L, 1, "qobject");
// function
lua_pushvalue(L, lua_upvalueindex(1));
Q_ASSERT(lua_isfunction(L, -1));
lua_insert(L, 1);
// call
luaQ_call(L, narg, LUA_MULTRET, ob... | false | false | false | false | false | 0 |
IterativeRequestUpdateExtent(
vtkInformation* input, vtkInformation* output)
{
int *wholeExtent =
input->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
vtkFloatArray* KernelArray = NULL;
switch ( this->GetIteration() )
{
case 0:
KernelArray = this->GetXKernel();
break;
case... | false | false | false | false | false | 0 |
interest_remove_action (UnityWebappsActionManager *manager,
gint interest_id,
UnityWebappsActionInfo *info)
{
GList *action_infos;
action_infos = g_hash_table_lookup (manager->priv->infos_by_interest_id,
GINT_TO_POINTER (interest_id));
action_infos = g_list_remove (action_infos, info);
... | false | false | false | false | false | 0 |
handleChanged() {
DecimalFormatInternal &data = internalData(fReserved);
if(data.fFastFormatStatus == kFastpathUNKNOWN || data.fFastParseStatus == kFastpathUNKNOWN) {
return; // still constructing. Wait.
}
data.fFastParseStatus = data.fFastFormatStatus = kFastpathNO;
#if UCONFIG_HAVE_PARSEALLINPUT
if(f... | false | false | false | false | false | 0 |
scan_async(struct oxu_hcd *oxu)
{
struct ehci_qh *qh;
enum ehci_timer_action action = TIMER_IO_WATCHDOG;
if (!++(oxu->stamp))
oxu->stamp++;
timer_action_done(oxu, TIMER_ASYNC_SHRINK);
rescan:
qh = oxu->async->qh_next.qh;
if (likely(qh != NULL)) {
do {
/* clean any finished work for this qh */
if (!list... | false | false | false | false | false | 0 |
test_store_replace (Test *test,
gconstpointer used)
{
const gchar *collection_path = "/org/freedesktop/secrets/collection/english";
SecretValue *value = secret_value_new ("apassword", -1, "text/plain");
GHashTable *attributes;
GError *error = NULL;
gchar **paths;
gboolean ret;
attributes = s... | false | false | false | false | false | 0 |
cp_parser_block_declaration (cp_parser *parser,
bool statement_p)
{
cp_token *token1;
int saved_pedantic;
/* Check for the `__extension__' keyword. */
if (cp_parser_extension_opt (parser, &saved_pedantic))
{
/* Parse the qualified declaration. */
cp_parser_block_declaration (pars... | false | false | false | false | false | 0 |
goTime_describeStr(const GoTime *time, Str *out) {
Str tmp;
switch(time->type) {
case(goTime_none):
str_copyChar(out, '-');
break;
case(goTime_absolute):
goTime_str(time->main, out);
break;
case(goTime_canadian):
str_init(&tmp);
goTime_str(time->main, out);
goTime_str(time->by,... | false | false | false | false | false | 0 |
nm_utils_wep_key_valid (const char *key, NMWepKeyType wep_type)
{
int keylen, i;
if (!key)
return FALSE;
keylen = strlen (key);
if ( wep_type == NM_WEP_KEY_TYPE_KEY
|| wep_type == NM_WEP_KEY_TYPE_UNKNOWN) {
if (keylen == 10 || keylen == 26) {
/* Hex key */
for (i = 0; i < keylen; i++) {
if (!... | false | false | false | false | false | 0 |
skipGap() { /* skip over gap in string literal */
do /* (simplified in Haskell 1.1) */
if (c0=='\n')
newlineSkip();
else
skip();
while (isLatin1(c0) && isIn(c0,SPACE));
if (c0!='\\') {
ERRMSG(row) "Missing `\\' terminating string literal gap"
EEND... | false | false | false | false | false | 0 |
compute_divs(struct isl_basic_map *bmap)
{
struct isl_basic_set *bset;
struct isl_set *set;
struct isl_map *map;
isl_space *dim, *orig_dim = NULL;
unsigned nparam;
unsigned n_in;
unsigned n_out;
bmap = isl_basic_map_cow(bmap);
if (!bmap)
return NULL;
nparam = isl_basic_map_dim(bmap, isl_dim_param);
n_... | false | false | false | false | false | 0 |
main_window_show_cur_account(MainWindow *mainwin)
{
gchar *buf;
gchar *ac_name;
ac_name = g_strdup(cur_account
? (cur_account->account_name
? cur_account->account_name : _("Untitled"))
: _("none"));
if (cur_account)
buf = g_strdup_printf("%s - %s", ac_name, PROG_VERSION_FRIENDLY);
else
b... | false | false | false | false | false | 0 |
operator< (length arg1, length arg2)
{
return (arg1.to("pt").magnitude()) < (arg2.to("pt").magnitude());
} | false | false | false | false | false | 0 |
qof_query_printSorts (QofQuerySort *s[], const gint numSorts, GList * output)
{
QofQueryParamList *gsl, *n = NULL;
gint curSort;
GString *gs = g_string_new ("Sort Parameters: ");
for (curSort = 0; curSort < numSorts; curSort++)
{
gboolean increasing;
if (!s[curSort])
{
... | false | false | false | false | false | 0 |
zend_html_putc(char c)
{
switch (c) {
case '\n':
ZEND_PUTS("<br />");
break;
case '<':
ZEND_PUTS("<");
break;
case '>':
ZEND_PUTS(">");
break;
case '&':
ZEND_PUTS("&");
break;
case ' ':
ZEND_PUTS(" ");
break;
case '\t':
ZEND_PUTS(" ");
... | false | false | false | false | false | 0 |
instance_getiter(PyInstanceObject *self)
{
PyObject *func;
if (iterstr == NULL) {
iterstr = PyString_InternFromString("__iter__");
if (iterstr == NULL)
return NULL;
}
if (getitemstr == NULL) {
getitemstr = PyString_InternFromString("__getitem__");
if (getitem... | false | false | false | false | false | 0 |
ijs_recv_block (IjsRecvChan *ch, char *buf, int buf_size)
{
int size = ch->buf_size - ch->buf_idx;
if (size > buf_size)
return IJS_ERANGE;
memcpy (buf, ch->buf + ch->buf_idx, size);
ch->buf_idx = ch->buf_size;
return size;
} | false | false | false | false | false | 0 |
bh1770_lux_raw_to_adjusted(struct bh1770_chip *chip, u16 raw)
{
u32 lux;
lux = ((u32)raw * chip->lux_corr) / BH1770_LUX_CORR_SCALE;
return min(lux, (u32)BH1770_LUX_RANGE);
} | false | false | false | false | false | 0 |
sdma_v3_0_ring_emit_ib(struct amdgpu_ring *ring,
struct amdgpu_ib *ib)
{
u32 vmid = (ib->vm ? ib->vm->ids[ring->idx].id : 0) & 0xf;
u32 next_rptr = ring->wptr + 5;
while ((next_rptr & 7) != 2)
next_rptr++;
next_rptr += 6;
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_WRITE) |
SDMA_PKT_HEADER_S... | false | false | false | false | false | 0 |
mnote_fuji_tag_get_description (MnoteFujiTag t)
{
unsigned int i;
for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
if (table[i].tag == t) {
if (!*table[i].description)
return "";
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
return _(table[i].description);
}
return NULL;
} | false | false | false | false | false | 0 |
goc_group_new (GocGroup *parent)
{
GocGroup *group;
g_return_val_if_fail (GOC_IS_GROUP (parent), NULL);
group = GOC_GROUP (g_object_new (GOC_TYPE_GROUP, NULL));
g_return_val_if_fail (group != NULL, NULL);
goc_group_add_child (parent, GOC_ITEM (group));
return group;
} | false | false | false | false | false | 0 |
GetChar(const BasicSearchTree* tree) const
{
if (!m_Depth)
return 0;
const wxString& the_label = GetActualLabel(tree);
return the_label[m_LabelStart];
} | false | false | false | false | false | 0 |
dpExtension(size_t maxScore, size_t minScore, size_t divisor) {
return (maxScore > minScore) ? (maxScore - minScore) / divisor : 0;
} | false | false | false | false | false | 0 |
draw_smallest_enclosing_disc(
float x,
float y,
const CL_Color &color,
CL_GraphicContext *gc)
{
// Get a graphics context
if (gc == 0) gc = CL_Display::get_current_window()->get_gc();
// Draw the smallest enclosing disc
CL_Pointf center = impl->minimum_enclosing_disc.position;
float radius = float(impl->m... | false | false | false | false | false | 0 |
searchdistancemode_cb (GtkToggleButton *button, gpointer user_data)
{
if (gtk_toggle_button_get_active(button))
{
criteria.posflag = 0; /* search near current position */
}
else
{
criteria.posflag = 1; /* search near destination */
}
} | false | false | false | false | false | 0 |
mwifiex_cmd_sdio_rx_aggr_cfg(struct host_cmd_ds_command *cmd,
u16 cmd_action, void *data_buf)
{
struct host_cmd_sdio_sp_rx_aggr_cfg *cfg =
&cmd->params.sdio_rx_aggr_cfg;
cmd->command = cpu_to_le16(HostCmd_CMD_SDIO_SP_RX_AGGR_CFG);
cmd->size =
cpu_to_le16(sizeof(struct host_cmd_sdio_sp_rx_aggr_cfg) +
... | false | false | false | false | false | 0 |
ietadm_request_listen(void)
{
int fd, err;
struct sockaddr_un addr;
fd = socket(AF_LOCAL, SOCK_STREAM, 0);
if (fd < 0)
return fd;
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_LOCAL;
memcpy((char *) &addr.sun_path + 1, IETADM_NAMESPACE, strlen(IETADM_NAMESPACE));
if ((err = bind(fd, (struct sockaddr... | false | false | false | false | false | 0 |
ca_context_change_props_full(ca_context *c, ca_proplist *p) {
int ret;
ca_proplist *merged;
ca_return_val_if_fail(!ca_detect_fork(), CA_ERROR_FORKED);
ca_return_val_if_fail(c, CA_ERROR_INVALID);
ca_return_val_if_fail(p, CA_ERROR_INVALID);
ca_mutex_lock(c->mutex);
... | false | false | false | false | false | 0 |
selectPlugin(QTreeWidgetItem *current)
{
if (!current)
emit currentPluginChanged(0);
else if (current->data(0, Qt::UserRole).canConvert<PluginSpec*>())
emit currentPluginChanged(current->data(0, Qt::UserRole).value<PluginSpec *>());
else
emit currentPluginChanged(0);
} | false | false | false | false | false | 0 |
ax25_validate(const char *call)
{
char s[7];
int n;
for (n = 0; n < 6; n++) {
s[n] = (call[n] >> 1) & 0x7F;
}
s[6] = '\0';
if (strspn(s, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ ") == 6)
return TRUE;
return FALSE;
} | false | false | false | false | false | 0 |
numaCreate(l_int32 n)
{
NUMA *na;
PROCNAME("numaCreate");
if (n <= 0)
n = INITIAL_PTR_ARRAYSIZE;
if ((na = (NUMA *)CALLOC(1, sizeof(NUMA))) == NULL)
return (NUMA *)ERROR_PTR("na not made", procName, NULL);
if ((na->array = (l_float32 *)CALLOC(n, sizeof(l_float32))) == NULL)
... | 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.