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 |
|---|---|---|---|---|---|---|
checkCandidates() {
if (_checked) return;
for (Candidates::reverse_iterator i=_candidates.rbegin(),
e=_candidates.rend(); i!=e; ++i) {
DisplayObject* ch = *i;
InteractiveObject* te = ch->topmostMouseEntity(_pp.x, _pp.y);
if (te) {
... | false | false | false | false | false | 0 |
user_change_language_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
gpointer data)
{
const gchar *fallback_language = user_get_fa... | false | false | false | false | true | 1 |
c_overprint_equal(const gs_composite_t * pct0, const gs_composite_t * pct1)
{
if (pct0->type == pct1->type) {
const gs_overprint_params_t * pparams0;
const gs_overprint_params_t * pparams1;
pparams0 = &((const gs_overprint_t *)(pct0))->params;
pparams1 = &((const gs_overprint_... | false | false | false | false | false | 0 |
CPLDecToDMS( double dfAngle, const char * pszAxis,
int nPrecision )
{
VALIDATE_POINTER1( pszAxis, "CPLDecToDMS", "" );
int nDegrees, nMinutes;
double dfSeconds, dfABSAngle, dfEpsilon;
char szFormat[30];
const char *pszHemisphere;
static CPL_THREADL... | false | false | false | false | false | 0 |
camlidl_mpfr_mpfr__set_str(
value _v_ROP,
value _v_STR,
value _v_BASE,
value _v_RND)
{
mpfr_ptr ROP; /*in*/
char *STR; /*in*/
int BASE; /*in*/
mpfr_rnd_t RND; /*in*/
struct camlidl_ctx_struct _ctxs = { CAMLIDL_TRANSIENT, NULL };
camlidl_ctx _ctx = &_ctxs;
camlidl_ml2c_mpfr_mpfr_ptr(_v_ROP, &ROP, _ctx)... | false | false | false | false | false | 0 |
pdfapp_postblit(pdfapp_t *app)
{
clock_t time;
float seconds;
int llama;
app->transitions_enabled = 1;
if (!app->in_transit)
return;
time = clock();
seconds = (float)(time - app->start_time) / CLOCKS_PER_SEC;
llama = seconds * 256 / app->transition.duration;
if (llama >= 256)
{
/* Completed. */
app->in... | false | false | false | false | false | 0 |
check_odm_deactivate(SFURL *url, GF_ObjectManager *odm, GF_Node *n)
{
GF_FieldInfo info;
if (!is_odm_url(url, odm) || !n) return 0;
if (url->url) gf_free(url->url);
url->url = NULL;
url->OD_ID = 0;
gf_node_get_field_by_name(n, "url", &info);
gf_sg_vrml_mf_reset(info.far_ptr, GF_SG_VRML_MFURL);
gf_node_get_fie... | false | false | false | false | false | 0 |
key_recorder(int ch)
{
tape[recorded++ % TAPELEN] = ch;
if(length < TAPELEN)
length++;
return(ch);
} | false | false | false | false | false | 0 |
DLRemTail(Dllist *l)
{
/* remove and return the tail */
Dlelem *result = l->dll_tail;
if (result == NULL)
return result;
if (result->dle_prev)
result->dle_prev->dle_next = NULL;
l->dll_tail = result->dle_prev;
if (result == l->dll_head) /* if the tail is also the head */
l->dll_head = NULL;
result-... | false | false | false | false | false | 0 |
n_tty_receive_buf_raw(struct tty_struct *tty, const unsigned char *cp,
char *fp, int count)
{
struct n_tty_data *ldata = tty->disc_data;
char flag = TTY_NORMAL;
while (count--) {
if (fp)
flag = *fp++;
if (likely(flag == TTY_NORMAL))
put_tty_queue(*cp++, ldata);
else
n_tty_receive_char_flagged... | false | false | false | false | false | 0 |
sortcmpnodata(const void *a,const void *b)
{
cmpcount++;
if (*(Sorttype*)a < *((Sorttype*)b))
{
return -1;
}
if (*(Sorttype*)a > *(Sorttype*)b)
{
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
operator()(const TreeMapItem* i1, const TreeMapItem* i2) const
{
TreeMapItem* p = i1->parent();
// should not happen
if (!p) return false;
bool ascending;
bool result;
int textNo = p->sorting(&ascending);
if (textNo < 0)
result = i1->value() < i2->value();
else
result = i1->text(textNo) < i2->tex... | false | false | false | false | false | 0 |
ath6kl_set_sdio_pm_caps(struct ath6kl *ar)
{
struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
struct sdio_func *func = ar_sdio->func;
mmc_pm_flag_t flags;
int ret;
flags = sdio_get_host_pm_caps(func);
ath6kl_dbg(ATH6KL_DBG_SUSPEND, "sdio suspend pm_caps 0x%x\n", flags);
if (!(flags & MMC_PM_WAKE_SDIO_IRQ) ... | false | false | false | false | false | 0 |
parm_in_range(int parmno, long value)
{
int i;
i = parm_index(parmno);
if (i < 0)
return -1;
return (value >= parameters[i].minval && value <= parameters[i].maxval);
} | false | false | false | false | false | 0 |
vect_PointList_set(int sel, Geom *geom, va_list *args) {
Vect *v = (Vect *)geom;
HPoint3 *plist;
(void)va_arg(*args, int);
plist = va_arg(*args, HPoint3 *);
memcpy(v->p, plist, v->nvert * sizeof(HPoint3));
return((void *)v);
} | false | false | false | false | false | 0 |
album_filter(const string &album)
{
return string_normalize(rex.replace(string_tolower(album),
"(lp|ep|cmd|promo|demo|maxi)$", "", Regexx::global));
} | false | false | false | false | false | 0 |
pool_find_page(struct dma_pool *pool, dma_addr_t dma)
{
struct dma_page *page;
list_for_each_entry(page, &pool->page_list, page_list) {
if (dma < page->dma)
continue;
if ((dma - page->dma) < pool->allocation)
return page;
}
return NULL;
} | false | false | false | false | false | 0 |
cpufreq_governor_userspace(struct cpufreq_policy *policy,
unsigned int event)
{
unsigned int *setspeed = policy->governor_data;
unsigned int cpu = policy->cpu;
int rc = 0;
if (event == CPUFREQ_GOV_POLICY_INIT)
return cpufreq_userspace_policy_init(policy);
if (!setspeed)
return -EINVAL;
switch (event... | false | false | false | false | false | 0 |
SetColorTable( GDALColorTable *poTableIn )
{
PamInitialize();
if( psPam )
{
if( psPam->poColorTable != NULL )
{
delete psPam->poColorTable;
psPam->poColorTable = NULL;
}
if( poTableIn )
{
psPam->poColorTable = poTableIn->... | false | false | false | false | false | 0 |
gst_mpegts_demux_flush (GstMpegTSDemux * demux, gboolean discard)
{
gint i;
GstMpegTSStream *PCR_stream;
GstMpegTSStream *PMT_stream;
GST_DEBUG_OBJECT (demux, "flushing MPEG TS demuxer (discard %d)", discard);
/* Start by flushing internal buffers */
gst_mpegts_demux_pes_buffer_flush (demux, discard);
... | false | false | false | false | false | 0 |
nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page)
{
int i, eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
int eccsteps = chip->ecc.steps;
uint8_t *p = buf;
uint8_t *ecc_calc = chip->buffers->ecccalc;
uint8_t *ecc_code = chip->buffers->eccco... | false | false | false | false | false | 0 |
set_server_root(cmd_parms *cmd, void *dummy,
const char *arg)
{
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
if (err != NULL) {
return err;
}
if ((apr_filepath_merge((char**)&ap_server_root, NULL, arg,
APR_FILEPATH_TRU... | false | false | false | false | false | 0 |
swapLogically(diag_iter it)
{
diag_iter itp = it;
++itp;
if ((*it).isReal() && !(*itp).isReal()) {
// first is real, second is complex
double* d1 = (*it).alpha.a1;
double* d2 = (*itp).alpha.a1;
double* d3 = (*itp).alpha.a2;
// swap
DiagonalBlock new_it((*it).jbar, d1, d2);
*it = new_it;
DiagonalBloc... | false | false | false | false | false | 0 |
main(int argc, char** argv)
{
int soa_numzones;
int soa_checksum;
umask(022);
main_argc = argc;
main_argv = argv;
parse_options();
if (options.is_daemon) {
if (options.is_daemon==1 && fork())
exit(0);
/* lowest priority */
nice(19);
}
set_datadir();
for (;;) {
int ldaperr = -1;
if (!connect()) {... | false | false | false | false | true | 1 |
ParseDataObjectMaterial( Material* pMaterial)
{
std::string matName;
readHeadOfDataObject( &matName);
if( matName.empty())
matName = std::string( "material") + boost::lexical_cast<std::string>( mLineNumber);
pMaterial->mName = matName;
pMaterial->mIsReference = false;
// read material values
pMaterial->mDiffu... | false | false | false | false | false | 0 |
styleChanged()
{
QByteArray loadAddress =
QByteArray::number(mMainPanel->getLoadAddress(),16); // preserve
mMainPanel->close();
delete mMainPanel;
if (Preferences::getInstance().theme() == Preferences::Classic)
mMainPanel = new MainPanelClassic(this);
else
mMainPanel = new MainPanelModern(this);
mMainPanel... | false | false | false | false | false | 0 |
interface_scan_result(const char *error,
DBusMessageIter *iter, void *user_data)
{
struct interface_scan_data *data = user_data;
int err = 0;
if (error != NULL) {
SUPPLICANT_DBG("error %s", error);
err = -EIO;
}
/* A non ready interface cannot send/receive anything */
if (data->interface->ready == FALSE... | false | false | false | false | false | 0 |
need_dentry_mark(struct f2fs_sb_info *sbi, nid_t nid)
{
struct f2fs_nm_info *nm_i = NM_I(sbi);
struct nat_entry *e;
bool need = false;
down_read(&nm_i->nat_tree_lock);
e = __lookup_nat_cache(nm_i, nid);
if (e) {
if (!get_nat_flag(e, IS_CHECKPOINTED) &&
!get_nat_flag(e, HAS_FSYNCED_INODE))
need = true;
... | false | false | false | false | false | 0 |
ippAddRange(ipp_t *ipp, /* I - IPP message */
ipp_tag_t group, /* I - IPP group */
const char *name, /* I - Name of attribute */
int lower, /* I - Lower value */
int upper) /* I - Upper value */
{
ipp_attribute_t *attr; /* New attribute */
DEBUG_printf(("ippAdd... | false | false | false | false | false | 0 |
GetMyIP_Win32( SystemAddress addresses[MAXIMUM_NUMBER_OF_INTERNAL_IDS] )
{
int idx=0;
idx=0;
char ac[ 80 ];
if ( gethostname( ac, sizeof( ac ) ) == -1 )
{
#if defined(_WIN32) && !defined(WINDOWS_PHONE_8)
DWORD dwIOError = GetLastError();
LPVOID messageBuffer;
FormatMessage( FORMAT_MESSAGE_ALLOCATE... | false | false | false | false | false | 0 |
IsoRingsAllShowLists(GLuint myList)
{
if(SurfShow == GABEDIT_SURFSHOW_NO) return;
if (glIsList(myList) == GL_TRUE) glCallList(myList);
} | false | false | false | false | false | 0 |
empty_wind_spiral_act(tenm_object *my, const tenm_object *player)
{
int i;
int theta;
double x;
double y;
/* sanity check */
if (my == NULL)
return 0;
if (player == NULL)
return 0;
(my->count[1])++;
if (my->count[1] > 72)
{
for (i = 0; i < 72; i++)
{
theta = my->count[2] + ... | false | false | false | false | false | 0 |
_dbus_message_property_method_call(E_DBus_Connection *conn, const char *method_name, const char *destination, const char *path, const char *interface, const char *property)
{
DBusMessage *msg;
if (!conn)
{
ERR("E-dbus Error: no connection for call of %s", method_name);
return NULL;
}
msg = ... | false | false | false | false | false | 0 |
otf_get_ttc_start(OTF_FILE *otf,int use_ttc) // {{{
{
char buf[4];
if (!otf->numTTC) { // >0 if TTC...
return 0;
}
int pos=0;
if ( (use_ttc<0)||(use_ttc>=otf->numTTC)||
(!otf_read(otf,buf,pos+12+4*use_ttc,4)) ) {
fprintf(stderr,"Bad TTC subfont number\n");
return -1;
}
return get_ULON... | false | false | false | false | true | 1 |
spif_socket_dup(spif_socket_t self)
{
spif_socket_t tmp;
ASSERT_RVAL(!SPIF_SOCKET_ISNULL(self), SPIF_NULL_TYPE(socket));
tmp = spif_socket_new();
if (self->fd >= 0) {
tmp->fd = dup(self->fd);
}
tmp->fam = self->fam;
tmp->type = self->type;
tmp->proto = self->proto;
tmp->len ... | false | true | false | false | false | 1 |
sip_uri_cmp(const char *input1, const char *input2)
{
char *uri1;
char *uri2;
char *uri_scheme1;
char *uri_scheme2;
char *host1;
char *host2;
char *params1;
char *params2;
char *headers1;
char *headers2;
/* XXX It would be really nice if we could just use parse_uri_full() here
* to separate the components... | false | false | false | false | false | 0 |
au_wbr_mfs_wmark(substring_t *arg, char *str,
struct au_opt_wbr_create *create)
{
int err;
unsigned long long ull;
err = 0;
if (!au_match_ull(arg, &ull))
create->mfsrr_watermark = ull;
else {
pr_err("bad integer in %s\n", str);
err = -EINVAL;
}
return err;
} | false | false | false | false | false | 0 |
parse_element_end(void *user_data, const xmlChar *element_name,
const xmlChar *prefix, const xmlChar *namespace)
{
XmppStream *stream;
gchar *xml_string;
stream = (XmppStream *)user_data;
if (xmlStrcmp(element_name, BAD_CAST "stream") == 0) {
hybrid_debug_info("xmpp", "g... | false | false | false | false | false | 0 |
sort_basis_by_sym(OneBasis* Basis,gint nbasis,TypeBasisBySym BasisBySym[MAXSYM])
{
gint i;
gint j;
gint maxsym = 0;
for(i=0;i<MAXSYM;i++)
{
BasisBySym[i].Nbasis = 0;
BasisBySym[i].Basis = NULL;
}
for(j=0;j<nbasis;j++)
{
if(Basis[j].numsym>maxsym)
maxsym = Basis[j].numsym;
i = Basis[j].numsym-1;
Bas... | false | false | false | false | false | 0 |
verify_registered_algorithms(crypto_factory_t *factory)
{
private_crypto_factory_t *this = (private_crypto_factory_t*)factory;
enumerator_t *enumerator;
entry_t *entry;
u_int failures = 0;
#define TEST_ALGORITHMS(test, ...) do { \
enumerator = this->test##s->create_enumerator(this->test##s); \
while (enumerator-... | false | false | false | false | false | 0 |
hdb_write_master_key(krb5_context context, const char *filename,
hdb_master_key mkey)
{
krb5_error_code ret;
hdb_master_key p;
krb5_keytab kt;
if(filename == NULL)
filename = HDB_DB_DIR "/m-key";
ret = krb5_kt_resolve(context, filename, &kt);
if(ret)
return ret;
for(p = mkey; p; ... | false | false | false | false | false | 0 |
networkmanager_stop()
{
gchar *upscript_path;
upscript_path = g_strdup_printf("%s/10-gadmin-openvpn-client", NETWORKMANAGER_DISPATCH_DIR);
/* Handle networkmanager if its installed */
if( ! file_exists(upscript_path) )
{
g_free(upscript_path);
return;
}
unlink(upscript_path);
... | false | false | false | false | false | 0 |
CopyRAW(uint64_t iCount, uint64_t iSourcePos, uint64_t iTargetPos,
unsigned char* pBuffer, uint64_t iBufferSize) {
uint64_t iBytesRead = 0;
do {
SeekPos(iSourcePos+iBytesRead);
uint64_t iBytesJustRead = ReadRAW(pBuffer,min(iBufferSize,iCount-iBytesRead));
SeekPos(iTargetPos+... | false | false | false | false | false | 0 |
main (argc, argv)
int argc;
char **argv;
{
rtx desc;
progname = "genconfig";
if (argc <= 1)
fatal ("no input file name");
if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
return (FATAL_EXIT_CODE);
puts ("/* Generated automatically by the program `genconfig'");
puts (" from ... | false | false | false | false | false | 0 |
GossipHello_npc_innkeeper(Player* pPlayer, Creature* pCreature)
{
pPlayer->PrepareGossipMenu(pCreature, pPlayer->GetDefaultGossipMenuForSource(pCreature));
if (IsHolidayActive(HOLIDAY_HALLOWS_END) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED, EFFECT_INDEX_0))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_C... | false | false | false | false | false | 0 |
sheet_object_write_image (SheetObject const *so, char const *format, double resolution,
GsfOutput *output, GError **err)
{
g_return_if_fail (IS_SHEET_OBJECT_IMAGEABLE (so));
SHEET_OBJECT_IMAGEABLE_CLASS (so)->write_image (so, format, resolution,
output, err);
} | false | false | false | false | false | 0 |
rsn_audiomunge_chain (GstPad * pad, GstBuffer * buf)
{
RsnAudioMunge *munge = RSN_AUDIOMUNGE (GST_OBJECT_PARENT (pad));
if (!munge->have_audio) {
GST_INFO_OBJECT (munge,
"First audio after flush has TS %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
}
munge->have_audio = T... | false | false | false | false | false | 0 |
champlain_view_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
DEBUG_LOG ()
ChamplainView *view = CHAMPLAIN_VIEW (object);
ChamplainViewPrivate *priv = view->priv;
switch (prop_id)
{
case PROP_LONGITUDE:
g_value_set_double (value,
CLAMP (pr... | false | false | false | false | false | 0 |
determine_charset(char *charset_hint TSRMLS_DC)
{
int i;
enum entity_charset charset = cs_utf_8;
int len = 0;
const zend_encoding *zenc;
/* Default is now UTF-8 */
if (charset_hint == NULL)
return cs_utf_8;
if ((len = strlen(charset_hint)) != 0) {
goto det_charset;
}
zenc = zend_multibyte_get_internal_e... | false | false | false | false | false | 0 |
simplify_using_condition (rtx cond, rtx *expr, regset altered)
{
rtx rev, reve, exp = *expr;
/* If some register gets altered later, we do not really speak about its
value at the time of comparison. */
if (altered
&& for_each_rtx (&cond, altered_reg_used, altered))
return;
if (GET_CODE (cond) ... | false | false | false | false | false | 0 |
qspi_transfer_msg(struct ti_qspi *qspi, struct spi_transfer *t,
int count)
{
int ret;
if (t->tx_buf) {
ret = qspi_write_msg(qspi, t, count);
if (ret) {
dev_dbg(qspi->dev, "Error while writing\n");
return ret;
}
}
if (t->rx_buf) {
ret = qspi_read_msg(qspi, t, count);
if (ret) {
dev_dbg(q... | false | false | false | false | false | 0 |
check_register_usage(
struct sanity_check_ctx *ctx,
scan_register *reg,
const char *name,
boolean indirect_access )
{
if (!check_file_name( ctx, reg->file )) {
FREE(reg);
return FALSE;
}
if (indirect_access) {
/* Note that 'index' is an offset relative to the value of the
... | false | false | false | false | false | 0 |
bootstrap2branchlen(GBDATA *gb_main) { // copy bootstraps to branchlengths
if (is_leaf) {
set_branchlength(0.1);
}
else {
if (remark_branch && father) {
int bootstrap = atoi(remark_branch);
double len = bootstrap/100.0;
set_branchlength(len);
... | false | false | false | false | false | 0 |
operator== (const t_path& lhs, const t_path& rhs) {
if (lhs.size() != rhs.size())
return false;
t_path_cit lhs_it = lhs.begin();
t_path_cit rhs_it = rhs.begin();
for (; lhs_it != lhs.end(); ++lhs_it, ++rhs_it) {
if (*lhs_it != *rhs_it)
return false;
}
return true;
} | false | false | false | false | false | 0 |
parse_processing_instruction (void)
{
const ACEXML_Char *pitarget = this->parse_name ();
ACEXML_Char *instruction = 0;
if (!ACE_OS::strcasecmp (ACE_TEXT ("xml"), pitarget))
{
// Invalid PITarget name.
this->fatal_error(ACE_TEXT ("PI can't have 'xml' in PITarget"));
}
int state = 0;
ACEX... | false | false | false | false | false | 0 |
init_module(void)
{
int rc;
/* Get our definition */
_gmodule = gmodule_get();
if(!_gmodule) return -ENODEV;
/* Register ourselves */
#ifdef GMODULE_CONFIG_DEVFS_FS
devfs_handle = devfs_register(NULL,
_gmodule->name,
DEVFS_FL_NONE,
_gmodule->major,
_gmodule->minor... | false | false | false | false | false | 0 |
cpl_matrix_solve_chol(const cpl_matrix * self,
cpl_matrix * rhs)
{
const cpl_size n = cpl_matrix_get_ncol(self);
const cpl_size nrhs = cpl_matrix_get_ncol(rhs);
cpl_size i, j, k;
const double * aread;
const double * bread;
double * bwrite;
cpl_ensure... | false | false | false | false | false | 0 |
doQuery( const QString &userFilter )
{
QString memberBase( "cn=maintainer,cn=internal," + Connection::self()->baseDn() );
QString memberFilter( "(objectClass=kolabGroupOfNames)" );
QLdapResponse memberResponse = Connection::self()->search( memberBase, QLdap::Sub, memberFilter );
if ( !memberResponse.entries().... | false | false | false | false | false | 0 |
stab_context (void)
{
int i;
fprintf (stderr, _("Last stabs entries before error:\n"));
fprintf (stderr, "n_type n_desc n_value string\n");
i = saved_stabs_index;
do
{
struct saved_stab *stabp;
stabp = saved_stabs + i;
if (stabp->string != NULL)
{
const char *s;
s = bfd_get_s... | false | false | false | false | false | 0 |
do_version_lookup(dns_sdblookup_t *lookup) {
if (ns_g_server->version_set) {
if (ns_g_server->version == NULL)
return (ISC_R_SUCCESS);
else
return (put_txt(lookup, ns_g_server->version));
} else {
return (put_txt(lookup, ns_g_version));
}
} | false | false | false | false | false | 0 |
radeon_uvd_free_handles(struct radeon_device *rdev, struct drm_file *filp)
{
int i, r;
for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) {
uint32_t handle = atomic_read(&rdev->uvd.handles[i]);
if (handle != 0 && rdev->uvd.filp[i] == filp) {
struct radeon_fence *fence;
radeon_uvd_note_usage(rdev);
r = radeon... | false | false | false | false | false | 0 |
load_array(char ***array, const char *filename, const char *topic)
{
int ret;
if (OPAL_SUCCESS != (ret = open_file(filename, topic))) {
return ret;
}
ret = find_topic(filename, topic);
if (OPAL_SUCCESS == ret) {
ret = read_topic(array);
}
fclose(opal_show_help_yyin);
... | false | false | false | false | false | 0 |
read_option(char *opt, size_t optlen, char *value, size_t valuelen)
{
int status = OK;
config_lineno++;
config_msg = "Internal error";
/* Check for comment markers, since read_properties() will
* only ensure opt and value are split at first " \t". */
optlen = strcspn(opt, "#");
if (optlen == 0)
return OK;
... | false | false | false | false | false | 0 |
hex(int ch1, int ch2) {
if ( ch1>='0' && ch1<='9' )
ch1 -= '0';
else if ( ch1>='a' )
ch1 -= 'a'-10;
else
ch1 -= 'A'-10;
if ( ch2>='0' && ch2<='9' )
ch2 -= '0';
else if ( ch2>='a' )
ch2 -= 'a'-10;
else
ch2 -= 'A'-10;
return( (ch1<<4)|ch2 );
} | false | false | false | false | false | 0 |
configureToolbars()
{
K_D(KXmlGuiWindow);
KConfigGroup cg(KGlobal::config(), QString());
saveMainWindowSettings(cg);
if (!d->toolBarEditor) {
d->toolBarEditor = new KEditToolBar(guiFactory(), this);
d->toolBarEditor->setAttribute(Qt::WA_DeleteOnClose);
connect(d->toolBarEditor, SIGNAL(... | false | false | false | false | false | 0 |
import_structure_from_file(AW_window *, AW_CL cl_db) {
GB_ERROR error = 0;
SEC_db_interface *db = (SEC_db_interface*)cl_db;
SEC_root *root = db->secroot();
if (!root->has_xString()) {
error = "Please select a species in EDIT4";
}
else {
char *filename... | false | false | false | false | false | 0 |
ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
struct ocfs2_dinode *tl_copy)
{
int status = 0;
int i;
unsigned int clusters, num_recs, start_cluster;
u64 start_blk;
handle_t *handle;
struct inode *tl_inode = osb->osb_tl_inode;
struct ocfs2_truncate_log *tl;
if (OCFS2_I(tl_inode)->ip_blkno ... | false | false | false | false | false | 0 |
miner_files_force_recheck_idle (gpointer user_data)
{
TrackerMinerFiles *miner_files = user_data;
TrackerIndexingTree *indexing_tree;
GList *roots, *l;
miner_files_update_filters (miner_files);
indexing_tree = tracker_miner_fs_get_indexing_tree (TRACKER_MINER_FS (miner_files));
roots = tracker_indexing_tree_lis... | false | false | false | false | false | 0 |
MD5Final(unsigned char output[16], struct MD5Context *s)
{
int i;
unsigned pad;
unsigned char c[64];
uint32 lenhi, lenlo;
if (s->blkused >= 56)
pad = 56 + 64 - s->blkused;
else
pad = 56 - s->blkused;
lenhi = (s->lenhi << 3) | (s->lenlo >> (32 - 3));
lenlo = (s->lenlo << 3);
mems... | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
okshell::Initializer initer{};
if (initer.uninitialized())
{
initer.init();
initer.welcome();
return 0;
}
vector<string> args;
for (int i = 0; i < argc; ++i)
args.push_back(argv[i]);
okshell::OkShell oks{};
int ret = oks.run(a... | false | false | false | false | false | 0 |
displaunch(no)
int no;
{
int len, width;
if (no >= maxlaunch) {
cputspace(MAXCUSTVAL);
return(0);
}
if (!launchlist[no].format) {
width = MAXCUSTVAL;
cputstr(width, launchlist[no].comm);
}
else {
width = (MAXCUSTVAL - 1 - 6) / 2;
cputstr(width, launchlist[no].comm);
putsep();
width = MAXCUSTVAL -... | false | false | false | false | false | 0 |
ap_str2_alnum(const char *src, char *dest) {
for ( ; *src; src++, dest++)
{
if (!apr_isprint(*src))
*dest = 'x';
else if (!apr_isalnum(*src))
*dest = '_';
else
*dest = (char)*src;
}
*dest = '\0';
return APR_SUCCESS;
} | false | false | false | false | false | 0 |
__connman_service_connect(struct connman_service *service)
{
int err;
DBG("service %p state %s", service, state2string(service->state));
if (is_connected(service) == TRUE)
return -EISCONN;
if (is_connecting(service) == TRUE)
return -EALREADY;
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
ca... | false | false | false | false | false | 0 |
update_row(SDL_Surface *target, int row)
{
SDL_Rect r;
unsigned long int mask = dirty_mask[1 - drawto][row];
r.y = row*DIRTY_TILE_SIZE;
if ((row + 1)*DIRTY_TILE_SIZE <= target->h)
{
r.h = DIRTY_TILE_SIZE;
}
else
{
r.h = DIRTY_TILE_SIZE - ((row + 1)*DIRTY_TILE_SIZE - target->h);
}
... | false | false | false | false | false | 0 |
_osd_req_list_objects(struct osd_request *or,
__be16 action, const struct osd_obj_id *obj, osd_id initial_id,
struct osd_obj_id_list *list, unsigned nelem)
{
struct request_queue *q = osd_request_queue(or->osd_dev);
u64 len = nelem * sizeof(osd_id) + sizeof(*list);
struct bio *bio;
_osd_req_encode_common(or, act... | false | false | false | false | false | 0 |
ddsche_make_gettask_module_name(char *buf, Hmdf_context *hcx)
{
if( opt_mpi_task_code){
if(hcx->hmdf->pe_num == 1){
ompfbe_mpi_task_make_gettask_module_name_1pe(buf);
}else{
ompfbe_mpi_task_make_gettask_module_name(buf, hcx->pe_number);
}
}else{
sprintf(buf, "DD_GETTASK_MTG%d_CL%d_PC%d_PE%d",
hc... | false | true | false | false | false | 1 |
skd_reserved_isr(int irq, void *skd_host_data)
{
struct skd_device *skdev = skd_host_data;
unsigned long flags;
spin_lock_irqsave(&skdev->lock, flags);
pr_debug("%s:%s:%d MSIX = 0x%x\n",
skdev->name, __func__, __LINE__,
SKD_READL(skdev, FIT_INT_STATUS_HOST));
pr_err("(%s): MSIX reserved irq %d = 0x%x\n", sk... | false | false | false | false | false | 0 |
intel_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
{
struct intel_dp *intel_dp = container_of(aux, struct intel_dp, aux);
uint8_t txbuf[20], rxbuf[20];
size_t txsize, rxsize;
int ret;
txbuf[0] = (msg->request << 4) |
((msg->address >> 16) & 0xf);
txbuf[1] = (msg->address >> 8) & 0xff;
t... | false | true | false | false | false | 1 |
g_mount_info_from_dbus (GVariant *value)
{
GMountInfo *info;
GMountSpec *mount_spec;
gboolean user_visible;
const gchar *display_name;
const gchar *stable_name;
const gchar *x_content_types;
const gchar *icon_str;
const gchar *symbolic_icon_str;
const gchar *prefered_filename_encoding;
const gchar *... | false | false | false | false | false | 0 |
exerper(void)
{
if (!(moves % 10))
{
/* Hunger Checks */
int hs = (u.uhunger > 1000) ? SATIATED :
(u.uhunger > 150) ? NOT_HUNGRY :
(u.uhunger > 50) ? HUNGRY :
(u.uhunger > 0) ? WEAK : FAINTING;
#ifdef DEBUG
pline("exerper: Hunger checks");
#endif
... | false | false | false | false | false | 0 |
test_repo_setters__setting_a_workdir_turns_a_bare_repository_into_a_standard_one(void)
{
cl_assert(git_repository_is_bare(repo) == 1);
cl_assert(git_repository_workdir(repo) == NULL);
cl_git_pass(git_repository_set_workdir(repo, "./new_workdir"));
cl_assert(git_repository_workdir(repo) != NULL);
cl_assert(git_re... | false | false | false | false | false | 0 |
gst_iterator_fold (GstIterator * it, GstIteratorFoldFunction func,
GValue * ret, gpointer user_data)
{
GValue item = { 0, };
GstIteratorResult result;
while (1) {
result = gst_iterator_next (it, &item);
switch (result) {
case GST_ITERATOR_OK:
if (!func (&item, ret, user_data))
... | false | false | false | false | false | 0 |
L73()
{register object *base=vs_base;
register object *sup=base+VM73; VC73
vs_check;
bds_check;
{object V273;
object V274;
V273=(base[0]);
V274=(base[1]);
vs_top=sup;
goto TTL;
TTL:;
{object V275;
{register object x= ((object)VV[107]),V276= (V273);
while(V276!=Cnil)
if(eql(x,V276->c.c_car->c.c_car) &&V276-... | false | false | false | false | false | 0 |
ntru_gen_blind_poly(uint8_t *seed, uint16_t seed_len, NtruEncParams *params, NtruPrivPoly *r) {
NtruIGFState s;
ntru_IGF_init(seed, seed_len, params, &s);
#ifndef NTRU_AVOID_HAMMING_WT_PATENT
if (params->prod_flag) {
r->prod.N = s.N;
ntru_gen_tern_poly(&s, params->df1, &r->prod.f1);
... | false | false | false | false | false | 0 |
YCrCB_to_Grey_1x2(struct jdec_private *priv)
{
const unsigned char *y;
unsigned char *p;
unsigned int i;
p = priv->plane[0];
y = priv->Y;
for (i = 0; i < 16; i++) {
memcpy(p, y, 8);
y += 8;
p += priv->width;
}
} | false | false | false | false | false | 0 |
on_sel_playlists_changed (GtkTreeSelection *select, GbemolPlaylist* pls)
{
GtkTreeIter iter;
GtkTreeViewColumn* column;
GtkTreeModel* model;
gchar *str;
GList* songs = NULL;
column = gtk_tree_view_get_column (pls->priv->tv_songs, COLUMN_SONGS_POS);
if (gbemol_playlist_current_is_selected (pls))
{
gtk... | false | false | false | false | false | 0 |
disasm14E (_14bit_e_processor *cpu, unsigned int addr, unsigned int inst)
{
instruction *pi;
pi = 0;
for(int i =0; i<NUM_OP_16EXT && !pi; i++)
if((op_16ext[i].inst_mask & inst) == op_16ext[i].opcode)
pi = op_16ext[i].inst_constructor(cpu, inst, addr);
for(int i =0; i<NUM_OP_16CXX && !pi; i++)... | false | false | false | false | false | 0 |
wiimod_rumble_remove(const struct wiimod_ops *ops,
struct wiimote_data *wdata)
{
unsigned long flags;
cancel_work_sync(&wdata->rumble_worker);
spin_lock_irqsave(&wdata->state.lock, flags);
wiiproto_req_rumble(wdata, 0);
spin_unlock_irqrestore(&wdata->state.lock, flags);
} | false | false | false | false | false | 0 |
init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
// cut3rebo = 3 SR distances
cut3rebo = 3.0 * r_2;
// cutmax = furthest distance from an owned atom
// at which another atom will feel force, i.e. the ghost cutoff
// for SR term in potential:
// ... | false | false | false | false | false | 0 |
InfpSubstituteString(PINFCACHE Inf,
PCWSTR text,
PWSTR buffer,
unsigned int size)
{
const WCHAR *start, *subst, *p;
unsigned int len, total = 0;
int inside = 0;
if (!buffer) size = MAX_INF_STRING_LENGTH + 1;
for (p = start = text; *p; p... | false | false | false | false | true | 1 |
_create_environment (struct jobcomp_info *job)
{
char **env;
char *tz;
env = xmalloc (1 * sizeof (*env));
env[0] = NULL;
_env_append_fmt (&env, "JOBID", "%u", job->jobid);
_env_append_fmt (&env, "UID", "%u", job->uid);
_env_append_fmt (&env, "GID", "%u", job->gid);
_env_append_fmt (&env, "START", "%ld"... | false | false | false | false | false | 0 |
set_cond_stmt_execution_predicate (struct ipa_node_params *info,
struct inline_summary *summary,
basic_block bb)
{
gimple last;
tree op;
int index;
enum tree_code code, inverted_code;
edge e;
edge_iterator ei;
gimple set_stmt;
tree op2;
tree parm;
tree base;
last = las... | false | false | false | false | false | 0 |
inv_oper(chain_list* abl, int negativ)
{
chain_list* chain;
if (ABL_ATOM(abl)) {
if (ABL_ATOM_VALUE(abl)==getablatomzero()) {
if (negativ) ABL_CAR_L(abl)=getablatomone();
}
else if (ABL_ATOM_VALUE(abl)==getablatomone()) {
if (negativ) ABL_CAR_L(abl)=getablatomzero();
... | false | false | false | false | false | 0 |
gotnick()
/*
* NICK change
*
* from: <from_nuh>
* msg: :<newnick>
*
* Nick change. Is global for all channels...
* 1) Update on each channel we're on
* 2) If it was the bot, update our current nick
*/
{
chanrec *chan;
membrec *m = NULL;
userrec *u = NULL;
banlrec *bl;
acctrec *a = NULL;
time_t now = ti... | false | false | false | false | false | 0 |
deep_lookup(std::string Name)const
{
if (OPT::case_insensitive) {
notstd::to_lower(&Name);
}else{
}
PARAMETER<double> & rv = _pl[Name];
if (rv.has_hard_value()) {
// found a value, return it
return rv;
}else if (_try_again) {
// didn't find one, look in enclosing scope
return _try_again-... | false | false | false | false | false | 0 |
dbus_message_get_auto_start (DBusMessage *message)
{
_dbus_return_val_if_fail (message != NULL, FALSE);
return !_dbus_header_get_flag (&message->header,
DBUS_HEADER_FLAG_NO_AUTO_START);
} | false | false | false | false | false | 0 |
dfb_screen_core_join( CoreDFB *core,
DFBScreenCore *data,
DFBScreenCoreShared *shared )
{
int i;
D_DEBUG_AT( Core_Screen, "dfb_screen_core_join( %p, %p, %p )\n", core, data, shared );
D_ASSERT( data != NULL );
D_MAGIC_ASSERT( shared, DF... | false | false | false | false | false | 0 |
soap_serve_ns5__ping(struct soap *soap)
{ struct ns5__ping soap_tmp_ns5__ping;
struct ns5__pingResponse _param_4;
soap_default_ns5__pingResponse(soap, &_param_4);
soap_default_ns5__ping(soap, &soap_tmp_ns5__ping);
if (!soap_get_ns5__ping(soap, &soap_tmp_ns5__ping, "ns5:ping", NULL))
return soap->error;
if (soap_... | false | false | false | false | false | 0 |
anjuta_token_new_static (AnjutaTokenType type, const char *value)
{
return anjuta_token_new_static_len (type, value, value == NULL ? 0 : strlen (value));
} | false | false | false | false | false | 0 |
bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport,
struct fchs_s *fchs, u16 len)
{
struct bfa_fcs_lport_s *port = rport->port;
struct fc_els_cmd_s *els_cmd;
bfa_trc(rport->fcs, fchs->s_id);
bfa_trc(rport->fcs, fchs->d_id);
bfa_trc(rport->fcs, fchs->type);
if (fchs->type != FC_TYPE_ELS)
return;
els_cmd ... | 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.