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 |
|---|---|---|---|---|---|---|
PyErr_WarnExplicit(PyObject *category, const char *text,
const char *filename_str, int lineno,
const char *module_str, PyObject *registry)
{
PyObject *message = PyUnicode_FromString(text);
PyObject *filename = PyUnicode_DecodeFSDefault(filename_str);
PyObject *module = ... | false | false | false | false | false | 0 |
fdomain_make_bus_idle( void )
{
outb(0, port_base + SCSI_Cntl);
outb(0, port_base + SCSI_Mode_Cntl);
if (chip == tmc18c50 || chip == tmc18c30)
outb(0x21 | PARITY_MASK, port_base + TMC_Cntl); /* Clear forced intr. */
else
outb(0x01 | PARITY_MASK, port_base + TMC_Cntl);
} | false | false | false | false | false | 0 |
sbc_ops(int op, char *path, char *capacity, char *media_type)
{
if (op == OP_NEW) {
if (!media_type) {
eprintf("Missing media type: DISK\n");
usage(1);
}
if (strncasecmp("disk", media_type, 4)) {
eprintf("Media type must be DISK for disk devices\n");
usage(1);
}
if (!capacity) {
eprintf("Missi... | false | false | false | false | false | 0 |
get_results(RESULTS& t, bool active_only) {
int retval;
SET_LOCALE sl;
char buf[256];
RPC rpc(this);
t.clear();
sprintf(buf, "<get_results>\n<active_only>%d</active_only>\n</get_results>\n",
active_only?1:0
);
retval = rpc.do_rpc(buf);
if (!retval) {
while (rpc.fin.... | false | false | false | false | false | 0 |
runprof(struct pma *pma, int *keys, int nkeys, int ntrials)
{
int i;
struct timespec start_time;
struct timespec end_time;
struct timespec diff_time;
fprintf(stderr, ".\n");
clock_gettime(CLOCK_MONOTONIC, &start_time);
for (i=0; i < ntrials; i++)
{
struct leaf *leaf;
i... | false | true | false | false | false | 1 |
ntb_file_create(struct ntb_file_env *env,
const char *filename)
{
struct ntb_file *f = ntb_file_new(env, filename);
set_random_iv(f);
f->file = fopen(filename, "wb");
if (f->file == NULL) {
ntb_log("Error opening %s: %s",
fi... | false | false | false | false | false | 0 |
dump_single_dep (gpointer key, G_GNUC_UNUSED gpointer value, gpointer sheet_)
{
DependencySingle *depsingle = key;
Sheet *sheet = sheet_;
GString *target = g_string_sized_new (10000);
gboolean first = TRUE;
g_string_append (target, " ");
g_string_append (target, cellpos_as_string (&depsingle->pos));
g_string... | false | false | false | false | false | 0 |
LibLocateHandle (
IN EFI_LOCATE_SEARCH_TYPE SearchType,
IN EFI_GUID *Protocol OPTIONAL,
IN VOID *SearchKey OPTIONAL,
IN OUT UINTN *NoHandles,
OUT EFI_HANDLE **Buffer
)
{
EFI_STATUS Status;
UIN... | false | false | false | false | false | 0 |
DrawStrokePolygon(Image *image,
const DrawInfo *draw_info,const PrimitiveInfo *primitive_info)
{
DrawInfo
*clone_info;
MagickBooleanType
closed_path,
status;
PrimitiveInfo
*stroke_polygon;
register const PrimitiveInfo
*p,
*q;
/*
Draw stroked polygon.
*/
if (image->debug !... | false | false | false | false | false | 0 |
getIcdCode(const QVariant &SID)
{
if (d->m_CachedCodes.keys().contains(SID.toInt())) {
return *d->m_CachedCodes[SID.toInt()];
}
if (!database().isOpen()) {
if (!database().open()) {
LOG_ERROR(tkTr(Trans::Constants::UNABLE_TO_OPEN_DATABASE_1_ERROR_2).arg(Constants::DB_NAME).arg(da... | false | false | false | false | false | 0 |
ck_barrier_combining_group_init(struct ck_barrier_combining *root,
struct ck_barrier_combining_group *tnode,
unsigned int nthr)
{
struct ck_barrier_combining_group *node;
struct ck_barrier_combining_queue queue;
queue.head = queue.tail = NULL;
tnode->k = nthr;
tnode->count = 0;
tnode->sense = 0;
tnode-... | false | false | false | false | false | 0 |
rsn_dec_class_init (RsnDecClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GST_DEBUG_CATEGORY_INIT (rsn_dec_debug, "rsndec",
0, "Resin DVD stream decoder");
rsn_dec_parent_class = (GstBinClass *) g_type_class_peek_parent (k... | false | false | false | false | false | 0 |
readDTRState(const std::string& dtr_log) {
std::list<std::string> lines;
// file may not exist if this is the first use of DTR
if (!Arc::FileRead(dtr_log, lines)) return;
if (!lines.empty()) {
logger.msg(Arc::WARNING, "Found unfinished DTR transfers. It is possible the "
"previous A-REX process di... | false | false | false | false | false | 0 |
GDALGetOverview( GDALRasterBandH hBand, int i )
{
VALIDATE_POINTER1( hBand, "GDALGetOverview", NULL );
GDALRasterBand *poBand = static_cast<GDALRasterBand*>(hBand);
return (GDALRasterBandH) poBand->GetOverview(i);
} | false | false | false | false | false | 0 |
wpt_addr(const char *args, const char **unused)
{
if (wpt_tmp->notes) {
wpt_tmp->notes = xstrappend(wpt_tmp->notes, as);
}
wpt_tmp->notes = xstrappend(wpt_tmp->notes, args);
} | false | false | false | false | false | 0 |
chap_authenticate(void *instance, REQUEST *request)
{
VALUE_PAIR *passwd_item, *chap;
uint8_t pass_str[MAX_STRING_LEN];
VALUE_PAIR *module_fmsg_vp;
char module_fmsg[MAX_STRING_LEN];
/* quiet the compiler */
instance = instance;
request = request;
if (!request->username) {
radlog_request(L_AUTH, 0, request, ... | true | true | false | false | false | 1 |
print_key_usage (FILE * outfile, unsigned int usage)
{
if (usage & GNUTLS_KEY_DIGITAL_SIGNATURE)
{
fprintf (outfile, "\tDigital signature.\n");
}
if (usage & GNUTLS_KEY_NON_REPUDIATION)
{
fprintf (outfile, "\tNon repudiation.\n");
}
if (usage & GNUTLS_KEY_KEY_ENCIPHERMENT)
{
... | false | false | false | false | false | 0 |
gst_subtitle_overlay_set_fps (GstSubtitleOverlay * self)
{
if (!self->parser || self->fps_d == 0)
return;
if (!_has_property_with_type (G_OBJECT (self->parser), "video-fps",
GST_TYPE_FRACTION))
return;
GST_DEBUG_OBJECT (self, "Updating video-fps property in parser");
g_object_set (self->pars... | false | false | false | false | false | 0 |
dbus_g_value_tuple_parse_variant (GVariant *variant,
const GVariantType *variant_type,
GValue *value)
{
gsize n = g_variant_type_n_items (variant_type);
GType *types;
gsize i;
GValueArray *va = g_value_array_new (n);
const GVariantType *inner_type;
types = g_new0 (GType, n);
for (i = 0, inner_ty... | false | false | false | false | false | 0 |
gtk_plot_canvas_export_ps_with_size (GtkPlotCanvas *canvas,
char *psname,
GtkPlotPageOrientation orient,
gboolean epsflag,
... | false | false | false | false | false | 0 |
write_index(const struct index_state *istate, int newfd)
{
git_SHA_CTX c;
struct cache_header hdr;
int i, err, removed, extended;
struct cache_entry **cache = istate->cache;
int entries = istate->cache_nr;
for (i = removed = extended = 0; i < entries; i++) {
if (cache[i]->ce_flags & CE_REMOVE)
removed++;
... | false | false | false | false | false | 0 |
raw_distance(const MixtureModel &m1, const MixtureModel &m2)
{
feature_t features[NUMGAUSS];
float w1[NUMGAUSS], w2[NUMGAUSS];
for (int i = 0; i < NUMGAUSS; ++i)
{
features[i] = i;
w1[i] = m1.gauss[i].weight;
w2[i] = m2.gauss[i].weight;
for (int j = 0; j < NUMGAUSS; ++j... | false | false | false | false | false | 0 |
BubbleSort(int (*compare)(void *data1, void *data2, void *appl), void *appl)
{
// Sort vector entries
for (int i = 0; i < NEntries(); i++) {
for (int j = i+1; j < NEntries(); j++) {
if ((*compare)(entries[j], entries[i], appl) < 0) {
Swap(i, j);
}
}
}
} | false | false | false | false | false | 0 |
tor_addr_hash(const tor_addr_t *addr)
{
switch (tor_addr_family(addr)) {
case AF_INET:
return tor_addr_to_ipv4h(addr);
case AF_UNSPEC:
return 0x4e4d5342;
case AF_INET6: {
const uint32_t *u = tor_addr_to_in6_addr32(addr);
return u[0] + u[1] + u[2] + u[3];
}
default:
tor_fragile_assert()... | false | false | false | false | false | 0 |
_print_horizontal_line(const unsigned int ncolumns, const unsigned int *widths,
unsigned short border, printTextRule pos,
const printTextFormat *format,
FILE *fout)
{
const printTextLineFormat *lformat = &format->lrule[pos];
unsigned int i,
j;
if (border == 1)
fputs(lformat->hrule, fou... | false | false | false | false | false | 0 |
appendData(const XMLString& arg)
{
XMLString oldData = _data;
_data.append(arg);
if (events()) dispatchCharacterDataModified(oldData, _data);
} | false | false | false | false | false | 0 |
globfree (pglob)
glob_t *pglob;
{
if (pglob->gl_pathv != NULL)
{
size_t i;
for (i = 0; i < pglob->gl_pathc; ++i)
free (pglob->gl_pathv[pglob->gl_offs + i]);
free (pglob->gl_pathv);
pglob->gl_pathv = NULL;
}
} | false | false | false | false | false | 0 |
net_con_ssl_accept(struct net_connection* con)
{
struct net_ssl_openssl* handle = get_handle(con);
ssize_t ret;
net_ssl_set_state(handle, tls_st_accepting);
ret = SSL_accept(handle->ssl);
LOG_PROTO("SSL_accept() ret=%d", ret);
if (ret > 0)
{
net_con_update(con, NET_EVENT_READ);
net_ssl_set_state(handle, tls... | false | false | false | false | false | 0 |
_blot_mask_sockets(const uint32_t maxtasks, const uint32_t task,
bitstr_t **masks, uint16_t blot,
bitstr_t *avail_map)
{
uint16_t i, j, size = 0;
if (!masks[task])
return;
size = bit_size(masks[task]);
for (i = 0; i < size; i++) {
if (bit_test(masks[task], i)) {
/* check if other bit... | false | false | false | false | false | 0 |
filter_wants(git_remote *remote)
{
git_remote_head **heads;
git_refspec tagspec, head;
int error = 0;
git_odb *odb;
size_t i, heads_len;
git_vector_clear(&remote->refs);
if ((error = git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true)) < 0)
return error;
/*
* The fetch refspec can be NULL, and what this ... | false | false | false | false | false | 0 |
cue_code_generator_new(CueMemPool *pool, FILE *stream)
{
CueCodeGenerator *cg = cue_mem_pool_alloc(pool, sizeof *cg);
if (cg == NULL) return NULL;
cg->pool = pool;
cg->output = stream;
cg->ns = cue_list_new(pool);
cg->indent = 0;
return cg;
} | false | false | false | false | false | 0 |
file_list_get_string_attribute (GList *file_list,
const char *attribute_name,
const char *inconsistent_value)
{
if (file_list_attributes_identical (file_list, attribute_name)) {
GList *l;
for (l = file_list; l != NULL; l = l->next) {
NautilusFile *file;
file = NAUTILUS_FILE (l->data);
if (... | false | false | false | false | false | 0 |
intervene()
{
int which = Is_astralevel(&u.uz) ? rnd(4) : rn2(6);
/* cases 0 and 5 don't apply on the Astral level */
switch (which) {
case 0:
case 1: You_feel("vaguely nervous.");
break;
case 2: if (!Blind)
You("notice a %s glow surrounding you.",
hcolor(NH_BLACK));
rndcurse();
... | false | false | false | false | false | 0 |
stmpe_devices_init(struct stmpe *stmpe)
{
struct stmpe_variant_info *variant = stmpe->variant;
unsigned int platform_blocks = stmpe->pdata->blocks;
int ret = -EINVAL;
int i, j;
for (i = 0; i < variant->num_blocks; i++) {
struct stmpe_variant_block *block = &variant->blocks[i];
if (!(platform_blocks & block->... | false | false | false | false | false | 0 |
elementForEndOfSyntax(ElementEntry *elms) {
while (!isEndOfArray(elms) && elms->code != EOS)
elms++;
if (isEndOfArray(elms)) /* No match for EOS! */
return NULL;
return elms;
} | false | false | false | false | false | 0 |
RePost()
{
// Create the fields to be passed to the form.
if (this->Form)
{
unpost_form(this->Form);
free_form(this->Form);
this->Form = 0;
}
delete[] this->Fields;
if (this->AdvancedMode)
{
this->NumberOfVisibleEntries = this->Entries->size();
}
else
{
// If normal mod... | false | false | false | false | false | 0 |
mpegts_parse_dispose (GObject * object)
{
MpegTSParse *parse = GST_MPEGTS_PARSE (object);
if (!parse->disposed) {
g_object_unref (parse->packetizer);
parse->disposed = TRUE;
}
if (G_OBJECT_CLASS (parent_class)->dispose)
G_OBJECT_CLASS (parent_class)->dispose (object);
} | false | false | false | false | false | 0 |
__bitmap_empty(const unsigned long *bitmap, int bits)
{
int k, lim = bits/BITS_PER_LONG;
for (k = 0; k < lim; ++k)
if (bitmap[k])
return 0;
if (bits % BITS_PER_LONG)
if (bitmap[k] & BITMAP_LAST_WORD_MASK(bits))
return 0;
return 1;
} | false | false | false | false | false | 0 |
addresults(struct result ***s, struct result *p, struct result *q)
{
unsigned short used;
int i;
struct result * r;
/* switch if needed */
if (p->val < q->val)
{
struct result *tmp;
tmp = p;
p = q;
q = tmp;
}
if (compatible(p,q,&used))
for (i=0; i<4; i++) /* for each operator */
if ((r = add(p,q,i)... | false | false | false | false | false | 0 |
dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints,
const char* name, IWTSPlugin* pPlugin)
{
DVCMAN* dvcman = ((DVCMAN_ENTRY_POINTS*)pEntryPoints)->dvcman;
if (dvcman->num_plugins < MAX_PLUGINS)
{
DEBUG_DVC("num_plugins %d", dvcman->num_plugins);
dvcman->plugin_names[dvcman->num_plugins] = name;
dvcm... | false | false | false | false | false | 0 |
au0828_stream_interrupt(struct au0828_dev *dev)
{
int ret = 0;
dev->stream_state = STREAM_INTERRUPT;
if (test_bit(DEV_DISCONNECTED, &dev->dev_state))
return -ENODEV;
else if (ret) {
set_bit(DEV_MISCONFIGURED, &dev->dev_state);
dprintk(1, "%s device is misconfigured!\n", __func__);
return ret;
}
return 0;... | false | false | false | false | false | 0 |
render() const
{
ByteVector flags(2, char(0)); // just blank for the moment
ByteVector v = d->frameID +
(d->version == 3
? ByteVector::fromUInt(d->frameSize)
: SynchData::fromUInt(d->frameSize)) +
flags;
return v;
} | false | false | false | false | false | 0 |
UnmuteOne(int dev)
{
/* Restore one channel from mutelevel array. */
if ((1 << dev) & devmask)
ErrorExitWarn(WriteLevel(dev, mutelevel[dev]), 'e');
} | false | false | false | false | false | 0 |
Scm_StringCiCmp(ScmString *x, ScmString *y)
{
int sizx, lenx, sizy, leny;
const char *px, *py;
const ScmStringBody *xb = SCM_STRING_BODY(x);
const ScmStringBody *yb = SCM_STRING_BODY(y);
if ((SCM_STRING_BODY_FLAGS(xb)^SCM_STRING_BODY_FLAGS(yb))&SCM_STRING_INCOMPLETE) {
Scm_Error("cannot com... | false | false | false | false | false | 0 |
query_free(query_t *query)
{
node_t *n = NULL, *nxt = NULL;
if (query == NULL) {
DBG_NULL;
return;
}
// Cleanup servers.
WALK_LIST_DELSAFE(n, nxt, query->servers) {
srv_info_free((srv_info_t *)n);
}
// Cleanup local address.
if (query->local != NULL) {
srv_info_free(query->local);
}
// Cleanup cry... | false | false | false | false | false | 0 |
executeLeia() {
ExprValue ret;
ret.type = TIPO_LITERAL;
// cin >> ret.value;
std::getline(cin, ret.value);
// ret.value.getline();
return ret;
} | false | false | false | false | false | 0 |
gimple_ic_transform (gimple_stmt_iterator *gsi)
{
gimple stmt = gsi_stmt (*gsi);
histogram_value histogram;
gcov_type val, count, all, bb_all;
gcov_type prob;
gimple modify;
struct cgraph_node *direct_call;
if (gimple_code (stmt) != GIMPLE_CALL)
return false;
if (gimple_call_fndecl (stmt) != NULL_... | false | false | false | false | false | 0 |
scaleMarkedCoefficientsToOne()
{
for(iterator i=begin();i!=end();i++)
i->scaleMarkedCoefficientToOne();
} | false | false | false | false | false | 0 |
FlattenString(Handle<String> string) {
CALL_HEAP_FUNCTION_VOID(string->GetIsolate(), string->TryFlatten());
} | false | false | false | false | false | 0 |
fli_init_valuator( FL_OBJECT * ob )
{
FLI_VALUATOR_SPEC *sp = ob->spec;
if ( ! sp )
ob->spec = sp = fl_calloc( 1, sizeof *sp );
sp->min = 0.0;
sp->max = 1.0;
sp->val = 0.5;
sp->prec = 2;
sp->step = 0.01;
sp->draw_type = COMPLETE_DRAW;
return sp;... | false | false | false | false | false | 0 |
GetTheme (string &name)
{
if (name == "Default" || name == _("Default") )
return m_DefaultTheme;
map <string, Theme*>::iterator i = m_Themes.find (name);
return (i != m_Themes.end ())? (*i).second: m_DefaultTheme;
} | false | false | false | false | false | 0 |
xmalloc_fgets_internal(FILE *file, const char *terminating_string, int chop_off, size_t *maxsz_p)
{
char *linebuf = NULL;
const int term_length = strlen(terminating_string);
int end_string_offset;
int linebufsz = 0;
int idx = 0;
int ch;
size_t maxsz = *maxsz_p;
while (1) {
ch = fgetc(file);
if (ch == EOF) ... | false | false | false | false | false | 0 |
shape_update()
{
Region **regions = domain->regions;
for (int ilist = 0; ilist < nregion; ilist++)
regions[list[ilist]]->shape_update();
} | false | false | false | false | false | 0 |
_openssl_dynlock_lock_cb(int mode, struct CRYPTO_dynlock_value *v,
const char *file, int line)
{
(void)file;
(void)line;
if (mode & CRYPTO_LOCK)
tor_mutex_acquire(v->lock);
else
tor_mutex_release(v->lock);
} | false | false | false | false | false | 0 |
extract_prefix_and_unescape_yaml(std::string &key, std::string &value, const std::string &line)
{
size_t where = line.find(":");
if (where != std::string::npos)
{
key.assign(line, 0, where);
// skip a space after the : if necessary
size_t val_start = where + 1;
if (val_start... | false | false | false | false | false | 0 |
_preempt_job_dequeue(void)
{
struct job_record *job_ptr;
uint32_t job_id, *tmp_id;
uint16_t preempt_mode;
xassert(preempt_job_list);
while ((tmp_id = list_pop(preempt_job_list))) {
int rc = SLURM_ERROR;
job_id = *tmp_id;
xfree(tmp_id);
if ((job_ptr = find_job_record(job_id)) == NULL) {
error("_preempt... | false | false | false | false | false | 0 |
evaluateDateTime(bool &ok, const QString ¶meterName, const QString &subParameterName)
{
if(!ok)
return QDateTime();
const SubParameter &subParameter = retreiveSubParameter(parameterName, subParameterName);
QString result;
if(subParameter.isCode())
{
... | false | false | false | false | false | 0 |
stripAcceleratorMarkers(const QString &label_) {
QString label = label_;
int p = 0;
forever {
p = label.indexOf('&', p);
if(p < 0 || p + 1 >= label.length())
break;
if(label.at(p + 1).isLetterOrNumber() || label.at(p + 1) == '&')
label.remove(p, 1);
++p;
}
return label;
} | false | false | false | false | false | 0 |
containsPageBreak(void) const
{
fp_Container * pCon = getLastContainer();
if(pCon && (pCon->getContainerType() ==FP_CONTAINER_LINE))
{
fp_Line * pLine = static_cast<fp_Line *>(pCon);
return pLine->containsForcedPageBreak();
}
return false;
} | false | false | false | false | false | 0 |
chooseDegrees(
const char *degreesChoice)
{
if (!myCanChooseDegrees)
{
ArLog::log(ArLog::Terse, "%s::chooseDegrees: Cannot choose degrees on this laser", myName.c_str());
return false;
}
double degreesChoiceDouble;
if (!internalCheckChoice("chooseDegrees", degreesChoice, &myDegreesChoices,
myD... | false | false | false | false | false | 0 |
bmc150_accel_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
int state)
{
struct bmc150_accel_data *data = iio_priv(indio_dev);
int ret;
if (state == data->ev_enable_state)
return 0;
mutex_loc... | false | false | false | false | false | 0 |
command_showsel(ParsingByteStream &)
{
int pagenum = 0;
GPList<DjVmDir::File> &lst = g().selected;
{ // extra nesting for windows
for (GPosition p=lst; p; ++p)
{
GP<DjVmDir::File> f = lst[p];
if (f->is_page())
fprintf(stdout,"%4d P ", ++pagenum);
else if (f->is_include())
... | false | false | false | false | false | 0 |
continuationRequest(mail::imap &imapAccount,
string message)
{
message=message.substr(1);
mail::decodebase64str challengeStr;
challengeStr.decode(message);
mail::encodebase64str responseStr;
responseStr.encode(myLoginInfo.uid + " ");
#if 0
cerr << "CHALLENGE: key=" << myLoginInfo.pwd
<< ", challen... | false | false | false | false | false | 0 |
gdata_youtube_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
GDataYouTubeQuery *self = GDATA_YOUTUBE_QUERY (object);
switch (property_id) {
case PROP_FORMAT:
gdata_youtube_query_set_format (self, g_value_get_enum (value));
break;
case PROP_LATITUDE:
sel... | false | false | false | false | false | 0 |
available( const MapCoordinate& pos, ContainerBase* subject, int num )
{
if ( runreplay.status == 1 || runreplay.status == 10 )
return true;
return false;
} | false | false | false | false | false | 0 |
SpRowMatGetRowVector(smatx* M, int row, double r[], int m){
int i,k1,k2;
const int *col=M->col;
const double *an=M->an;
/*
if (M->ncol != m) return 1;
if (row<0 || row>= M->nrow) return 2;
if (r==0) return 3;
*/
memset((void*)r,0,m*sizeof(double));
k1=M->nnz[row];
k2=M->nnz[row+1];
for (i=k1... | false | false | false | false | false | 0 |
Create(cmTarget* target,
cmGeneratorExpressionContext *context,
const GeneratorExpressionContent *content)
{
// The file used to link to the target (.so, .lib, .a).
if(!target->IsLinkable())
{
::reportError(context, content->GetOriginalExpres... | false | false | false | false | false | 0 |
hdhomerun_device_upgrade(struct hdhomerun_device_t *hd, FILE *upgrade_file)
{
if (!hd->cs) {
hdhomerun_debug_printf(hd->dbg, "hdhomerun_device_upgrade: device not set\n");
return -1;
}
hdhomerun_control_set(hd->cs, "/tuner0/lockkey", "force", NULL, NULL);
hdhomerun_control_set(hd->cs, "/tuner0/channel", "none"... | false | false | false | false | false | 0 |
get_microdesc_cache(void)
{
if (PREDICT_UNLIKELY(the_microdesc_cache==NULL)) {
microdesc_cache_t *cache = tor_malloc_zero(sizeof(microdesc_cache_t));
HT_INIT(microdesc_map, &cache->map);
cache->cache_fname = get_datadir_fname("cached-microdescs");
cache->journal_fname = get_datadir_fname("cached-micro... | false | false | false | false | false | 0 |
get_entry_font()
{
Gtk::Entry entry;
return entry.get_style()->get_font().to_string();
} | false | false | false | false | false | 0 |
pos(char c)
{
const char *p;
c = toupper((unsigned char)c);
for (p = hexchar; *p; p++)
if (*p == c)
return p - hexchar;
return -1;
} | false | false | false | false | false | 0 |
PM_SnapPosition (void)
{
int sign[3];
int i, j, bits;
int base[3];
// try all single bits first
static int jitterbits[8] = {0,4,1,2,3,5,6,7};
// snap velocity to eigths
for (i=0 ; i<3 ; i++)
pm->s.velocity[i] = (int)(pml.velocity[i]*8);
for (i=0 ; i<3 ; i++)
{
if (pml.origin[i] >= 0)
... | false | false | false | false | false | 0 |
ecalcomp_set_href (ECalComponent *comp,
const gchar *href)
{
icalcomponent *icomp;
icomp = e_cal_component_get_icalcomponent (comp);
g_return_if_fail (icomp != NULL);
icomp_x_prop_set (icomp, X_E_CALDAV "HREF", href);
} | false | false | false | false | false | 0 |
nas_remove_small_vocals(const char *str) {
#if defined(DUMP_NAME_CREATION)
const char *org_str = str;
#endif // DUMP_NAME_CREATION
char buf[GB_KEY_LEN_MAX+1];
int i;
int c;
for (i=0; i<GB_KEY_LEN_MAX; ) {
c = *str++;
if (!c) break;
if (strchr("aeiouy", c)==0) {
b... | false | false | false | false | false | 0 |
caml_alloc_dummy_float (value size)
{
mlsize_t wosize = Int_val(size) * Double_wosize;
if (wosize == 0) return Atom(0);
return caml_alloc (wosize, 0);
} | false | false | false | false | false | 0 |
loadFile( const QString& fileName )
{
QString absoluteFileName = QFileInfo(fileName).absoluteFilePath();
setFile( absoluteFileName );
reloadItem();
} | false | false | false | false | false | 0 |
cb_build_move_low (cb_tree x)
{
switch (CB_TREE_CATEGORY (x)) {
case CB_CATEGORY_NUMERIC:
case CB_CATEGORY_ALPHABETIC:
case CB_CATEGORY_ALPHANUMERIC:
if (cb_low == cb_norm_low) {
return cb_build_memset (x, 0);
} else {
return cb_build_move_call (cb_low, x);
}
default:
return cb_build_move_call (cb_lo... | false | false | false | false | false | 0 |
ftp_state_ul_setup(struct connectdata *conn,
bool sizechecked)
{
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->reqdata.proto.ftp;
struct SessionHandle *data = conn->data;
curl_off_t passed=0;
if((data->reqdata.resume_from && !sizechecked) ||
((data->reqdata... | false | false | false | false | false | 0 |
vmw_cotable_notify(struct vmw_resource *res, int id)
{
struct vmw_cotable *vcotbl = vmw_cotable(res);
if (id < 0 || id >= SVGA_COTABLE_MAX_IDS) {
DRM_ERROR("Illegal COTable id. Type is %u. Id is %d\n",
(unsigned) vcotbl->type, id);
return -EINVAL;
}
if (vcotbl->seen_entries < id) {
/* Trigger a call to... | false | false | false | false | false | 0 |
update_sort_and_group_config_dialog (ETableConfig *config,
gboolean is_sort)
{
ETableConfigSortWidgets *widgets;
gint count, i;
if (is_sort) {
count = e_table_sort_info_sorting_get_count (
config->temp_state->sort_info);
widgets = &config->sort[0];
} else {
count = e_t... | false | false | false | false | false | 0 |
derivativealphaS(Energy q, Energy lam, int nf) const
{
using Constants::pi;
double lx = log(sqr(q/lam));
double b0 = 11. - 2./3.*nf;
double b1 = 51. - 19./3.*nf;
double b2 = 2857. - 5033./9.*nf + 325./27.*sqr(nf);
if(_nloop==1)
return -4.*pi/(b0*sqr(lx));
else if(_nloop==2)
return -4.*pi/(b0*sqr(l... | false | false | false | false | false | 0 |
read(const char *fileName)
{
FILE *file = fopen(fileName, "rb");
if(file == 0) {
fprintf(stderr, "ERROR: File3Dg::read() - could not open \'%s\' for reading", fileName);
return false;
}
if(not read(file)) {
fprintf(stderr, "\twhile reading \'%s\'", fileName);
fclose(file);
return false;
}
fclose(file);
... | false | false | false | false | false | 0 |
clientsArePaused(void) {
if (server.clients_paused &&
server.clients_pause_end_time < server.mstime)
{
listNode *ln;
listIter li;
redisClient *c;
server.clients_paused = 0;
/* Put all the clients in the unblocked clients queue in order to
* force the re... | false | false | false | false | false | 0 |
decodeXmp(const TiffEntryBase* object)
{
// add Exif tag anyway
decodeStdTiffEntry(object);
byte const* pData = 0;
long size = 0;
getObjData(pData, size, 0x02bc, ifd0Id, object);
if (pData) {
std::string xmpPacket;
xmpPacket.assign(reinterpret... | false | false | false | false | false | 0 |
disable_quick_search_cb (GtkWidget * dialog,
gint response,
gpointer data)
{
GSearchWindow * gsearch = data;
gtk_widget_destroy (GTK_WIDGET (dialog));
if (response == GTK_RESPONSE_OK) {
g_settings_set_boolean (gsearch->gnome_search_tool_settings, "disable-quick-s... | false | false | false | false | false | 0 |
cpl_table_erase_invalid_rows(cpl_table *table)
{
cpl_size length = cpl_table_get_nrow(table);
cpl_size width = cpl_table_get_ncol(table);
cpl_size new_width;
cpl_size count = 0;
int any_valid;
int all_valid = 0;
if (table == 0x0)
return c... | false | false | false | false | false | 0 |
collect_blocks(GT_UNUSED void *key, void *value, void *data,
GT_UNUSED GtError *err)
{
NodeInfoElement *ni = (NodeInfoElement*) value;
GtDiagram *diagram = (GtDiagram*) data;
GtBlock *block = NULL;
GtStr *trackid_str;
unsigned long i = 0;
trackid_str = gt_str_new();
for (i = 0; i... | false | false | false | false | false | 0 |
ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len)
{
int copied = 0;
while (len > 0) {
char buf[128];
int this_len, retval;
this_len = (len > sizeof(buf)) ? sizeof(buf) : len;
if (copy_from_user(buf, src, this_len))
return -EFAULT;
retval = access_process_vm(tsk, ds... | false | false | false | false | false | 0 |
jit_info_table_purify_chunk (MonoJitInfoTableChunk *old)
{
MonoJitInfoTableChunk *new = jit_info_table_new_chunk ();
int i, j;
j = 0;
for (i = 0; i < old->num_elements; ++i) {
if (!IS_JIT_INFO_TOMBSTONE (old->data [i]))
new->data [j++] = old->data [i];
}
new->num_elements = j;
if (new->num_elements > 0)
... | false | false | false | false | false | 0 |
ParseNumber(TREE * tree)
{
long value;
int ch;
value = 0;
ch = *tree->cp++;
if (!isDigit(ch))
{
tree->cp--;
return BadToken(tree, "Number expected");
}
/*
* If the number doesn't begin with a zero, then it is decimal.
*/
if (ch != '0')
{
while (isDigit(ch))
{
value = value * 10 + ch - '0';
... | false | false | false | false | false | 0 |
log_start(char *program, int daemon, int level)
{
log_syslog = daemon;
log_debug_level = level;
strncpy(log_prefix, program, 256);
log_prefix[255] = '\0';
if (log_syslog)
openlog(log_prefix, 0, LOG_DAEMON);
} | false | false | false | false | false | 0 |
SetupSavePieceTableState(void)
{
//
// Fix up the insertion point stuff.
//
if (!isSelectionEmpty())
_clearSelection();
m_pDoc->beginUserAtomicGlob();
_saveAndNotifyPieceTableChange();
m_pDoc->disableListUpdates();
setScreenUpdateOnGeneralUpdate( false);
} | false | false | false | false | false | 0 |
ladish_app_supervisor_find_app_by_uuid(ladish_app_supervisor_handle supervisor_handle, const uuid_t uuid)
{
struct list_head * node_ptr;
struct ladish_app * app_ptr;
list_for_each(node_ptr, &supervisor_ptr->applist)
{
app_ptr = list_entry(node_ptr, struct ladish_app, siblings);
if (uuid_compare(app_ptr... | false | false | false | false | false | 0 |
AsObject() {
Object* obj;
{ MaybeObject* maybe_obj = Heap::AllocateFixedArray(3);
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
}
FixedArray* pair = FixedArray::cast(obj);
pair->set(0, shared_);
pair->set(1, source_);
pair->set(2, Smi::FromInt(strict_mode_));
return pair;
} | false | false | false | false | false | 0 |
fig_col_init(void)
{
int i;
for (i=0;i<544;i++) { fig_hash[i].colour = 0; fig_colour_map[i].alternate = 0; }
/* populate the first 8 primary colours */
/* Black */
fig_hash[0].colour = FIG_BLACK;
fig_colour_map[FIG_BLACK].r = 0;
fig_colour_map[FIG_BLACK].g = 0;
fig_colour_map[FIG_BLACK... | false | false | false | false | false | 0 |
cmp(int64_t *a, ssize_t sa, int64_t *b, ssize_t sb) {
if(a[1] < b[1]) return -1;
if(a[1] > b[1]) return 1;
if(a[0] < b[0]) return -1;
if(a[0] > b[0]) return 1;
if(sa < sb) return -1;
if(sa > sb) return 1;
return 0;
} | false | false | false | false | false | 0 |
deleteBasisDlg(GtkWidget *win,gpointer d)
{
gchar *format =_("Do you want to really delete \"%s\" basis for \"%s\" atom ?");
gchar *t =NULL;
gint atomNumber;
gint basisNumber;
GtkWidget* w = NULL;
GtkTreeIter node;
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(treeView));
DataMolproTree* data... | false | false | false | false | true | 1 |
local_hooke_init(mode,mi)
int mode; /* energy or gradient */
struct method_instance *mi;
{
int flag_var;
flag_var = lookup_global(HOOKE_FLAG_NAME);
if ( flag_var < 0 ) /* missing, so add */
{ flag_var = add_global(HOOKE_FLAG_NAME);
globals(flag_var)->value.real = 0.0; /* default */
globals(flag_var)->f... | false | false | false | false | false | 0 |
drm_atomic_helper_framebuffer_changed(struct drm_device *dev,
struct drm_atomic_state *old_state,
struct drm_crtc *crtc)
{
struct drm_plane *plane;
struct drm_plane_state *old_plane_state;
int i;
for_each_plane_in_state(old_state, plane, old_plane_state, i) {
if (plane->state->crtc != crtc &&
... | false | false | false | false | false | 0 |
ctor(QScriptContext *ctx, QScriptEngine *eng)
{
if (ctx->argumentCount() == 2)
{
int x = ctx->argument(0).toInt32();
int y = ctx->argument(1).toInt32();
return qScriptValueFromValue(eng, QPoint(x, y));
}
return qScriptValueFromValue(eng, QPoint());
} | 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.