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 |
|---|---|---|---|---|---|---|
Run() {
if (!Start(fArgc, fArgv))
return 0;
for (doLoop = 1; doLoop;)
ProcessEvent();
Stop();
return 1;
} | false | false | false | false | false | 0 |
get_sb_tile_info(int tile_index)
{
unsigned char *rom = memory_region(REGION_USER1);
int tileno = rom[tile_index + bgmap * 1024];
SET_TILE_INFO(0, tileno, 0, 0)
} | false | false | false | false | false | 0 |
generate(gdouble *a, gdouble base, gdouble noise,
RandGenSet *rngset, gint id)
{
gdouble v = base;
if (base && noise)
v *= rand_gen_set_mult(rngset, id, noise);
*a = v;
} | false | false | false | false | false | 0 |
dpm_get_gfr_by_surl_uid(dbfd, bol, from_surl, uid, gfr_entry, lock, rec_addr, endlist, dblistptr)
struct dpm_dbfd *dbfd;
int bol;
char *from_surl;
uid_t uid;
struct dpm_get_filereq *gfr_entry;
int lock;
dpm_dbrec_addr *rec_addr;
int endlist;
DBLISTPTR *dblistptr;
{
char escaped_name[CA_MAXSFNLEN*2+1];
char func[24];... | false | false | false | false | false | 0 |
getLargeSlotValue(ArrayRef<UnwindCode> UC) {
if (UC.size() < 3)
return 0;
return UC[1].FrameOffset + (static_cast<uint32_t>(UC[2].FrameOffset) << 16);
} | false | false | false | false | false | 0 |
tdb_write(struct tdb_context *tdb, tdb_off_t off,
const void *buf, tdb_len_t len)
{
enum TDB_ERROR ecode;
if (tdb->flags & TDB_RDONLY) {
return tdb_logerr(tdb, TDB_ERR_RDONLY, TDB_LOG_USE_ERROR,
"Write to read-only database");
}
ecode = tdb->tdb2.io->oob(tdb, off + len, false);
if (ecode != TDB_SUCCE... | false | false | false | false | false | 0 |
GetPriorityClass (gpointer process)
{
#ifdef HAVE_GETPRIORITY
struct _WapiHandle_process *process_handle;
gboolean ok;
int ret;
pid_t pid;
if ((GPOINTER_TO_UINT (process) & _WAPI_PROCESS_UNHANDLED) == _WAPI_PROCESS_UNHANDLED) {
/* This is a pseudo handle */
pid = (pid_t)(GPOINTER_TO_UINT (process) & _WAPI_PR... | false | false | false | false | false | 0 |
ShowTransferRate()
{
float kBpsUp = theStats::GetUploadRate() / 1024.0;
float kBpsDown = theStats::GetDownloadRate() / 1024.0;
wxString buffer;
if( thePrefs::ShowOverhead() )
{
buffer = CFormat(_("Up: %.1f(%.1f) | Down: %.1f(%.1f)")) % kBpsUp % (theStats::GetUpOverheadRate() / 1024.0) % kBpsDown % (theStats::Get... | false | false | false | false | false | 0 |
HPDF_ReadFromStream (HPDF_Doc pdf,
HPDF_BYTE *buf,
HPDF_UINT32 *size)
{
HPDF_UINT isize = *size;
HPDF_STATUS ret;
if (!HPDF_HasDoc (pdf))
return HPDF_INVALID_DOCUMENT;
if (!HPDF_Stream_Validate (pdf->stream))
return HPDF_RaiseErr... | false | false | false | false | false | 0 |
main (int argc, char **argv)
{
rtx desc;
progname = "genoutput";
init_insn_for_nothing ();
if (!init_rtx_reader_args (argc, argv))
return (FATAL_EXIT_CODE);
output_prologue ();
next_index_number = 0;
/* Read the machine description. */
while (1)
{
int line_no;
desc = read_md_... | false | false | false | false | false | 0 |
mini_get_tls_offset (MonoTlsKey key)
{
int offset;
g_assert (MONO_ARCH_HAVE_TLS_GET);
switch (key) {
case TLS_KEY_THREAD:
offset = mono_thread_get_tls_offset ();
break;
case TLS_KEY_JIT_TLS:
offset = mono_get_jit_tls_offset ();
break;
case TLS_KEY_DOMAIN:
offset = mono_domain_get_tls_offset ();
break... | false | false | false | false | false | 0 |
ecore_file_app_installed(const char *exe)
{
Eina_List *l;
char *dir;
char buf[PATH_MAX];
if (!exe) return EINA_FALSE;
if (ecore_file_can_exec(exe)) return EINA_TRUE;
EINA_LIST_FOREACH(__ecore_file_path_bin, l, dir)
{
snprintf(buf, sizeof(buf), "%s/%s", dir, exe);
if (ecore_file... | true | true | false | false | false | 1 |
debugfs_create_file(const char *name, umode_t mode,
struct dentry *parent, void *data,
const struct file_operations *fops)
{
struct dentry *dentry;
struct inode *inode;
if (!(mode & S_IFMT))
mode |= S_IFREG;
BUG_ON(!S_ISREG(mode));
dentry = start_creating(name, parent);
if (IS_ERR(dentry))
ret... | false | false | false | false | false | 0 |
open (const ACE_Handler::Proxy_Ptr &handler_proxy,
ACE_HANDLE handle,
const void *completion_key,
ACE_Proactor *proactor)
{
ACE_TRACE ("ACE_POSIX_Asynch_Connect::open");
if (this->flg_open_)
return -1;
//int resu... | false | false | false | false | false | 0 |
read_tag_block(journal_t *journal,
journal_block_tag_t *tag)
{
unsigned long long block = be32_to_cpu(tag->t_blocknr);
if (jbd2_has_feature_64bit(journal))
block |= (u64)be32_to_cpu(tag->t_blocknr_high) << 32;
return block;
} | false | false | false | false | false | 0 |
create_source (TestState *state)
{
int dx, dy;
uint8_t *data = g_malloc (SOURCE_SIZE * SOURCE_SIZE * 4);
CoglTexture2D *tex;
/* Create a texture with a different coloured rectangle at each
corner */
for (dy = 0; dy < SOURCE_DIVISIONS_Y; dy++)
for (dx = 0; dx < SOURCE_DIVISIONS_X; dx++)
{
... | false | false | false | false | false | 0 |
e_rdue(Void)
{
if(f__curunit->url==1 || f__recpos==f__curunit->url)
return(0);
FSEEK(f__cf,(OFF_T)(f__curunit->url-f__recpos),SEEK_CUR);
if(FTELL(f__cf)%f__curunit->url)
err(f__elist->cierr,200,"syserr");
return(0);
} | false | false | false | false | false | 0 |
N_copy_gradient_3d(N_gradient_3d * source, N_gradient_3d * target)
{
G_debug(5, "N_copy_gradient_3d: copy N_gradient_3d");
if (!source || !target)
return 0;
target->NC = source->NC;
target->SC = source->SC;
target->WC = source->WC;
target->EC = source->EC;
target->TC = source->TC;
tar... | false | false | false | false | false | 0 |
visitUserOp1(Instruction &I) {
Assert1(0, "User-defined operators should not live outside of a pass!", &I);
} | false | false | false | false | false | 0 |
goo_canvas_util_ptr_array_find_index (GPtrArray *ptr_array,
gpointer data)
{
gint i;
for (i = 0; i < ptr_array->len; i++)
{
if (ptr_array->pdata[i] == data)
return i;
}
return -1;
} | false | false | false | false | false | 0 |
cob_decimal_set_packed (cob_decimal *d, cob_field *f)
{
unsigned char *p;
int digits;
int sign;
unsigned int val;
unsigned int valseen;
p = f->data;
/* Fixme */
digits = COB_FIELD_DIGITS (f);
sign = cob_packed_get_sign (f);
if (digits % 2 == 0) {
val = *p & 0x0f;
digits--;
p++;
} else {
val = 0;
... | false | false | false | false | false | 0 |
pnfs_generic_recover_commit_reqs(struct list_head *dst,
struct nfs_commit_info *cinfo)
{
struct pnfs_commit_bucket *b;
struct pnfs_layout_segment *freeme;
int i;
lockdep_assert_held(cinfo->lock);
restart:
for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) {
if (pnfs_generic_transfe... | false | false | false | false | false | 0 |
do_exp_cmd (char *args, GtkWidget *dialog)
{
double nexp;
char *endp;
nexp = strtod(args, &endp);
if (args == endp) {
err_printf("Bad exposure value: %s\n", args);
return OBS_CMD_ERROR;
}
named_spin_set(dialog, "img_exp_spin", nexp);
return OBS_NEXT_COMMAND;
} | false | false | false | false | false | 0 |
sound_extract(type8s * name, type32 * length, type16 * tempo)
{
type32 offset = 0;
type16s header_pos = -1;
if (header_pos < 0)
header_pos = find_name_in_sndheader(name);
if (header_pos < 0)
return 0;
*tempo = read_w(snd_hdr + header_pos + 8);
offset = read_l(snd_hdr + header_pos + 10);
*length... | false | false | false | false | false | 0 |
Curl_second_connect(struct connectdata *conn)
{
CURLcode status = CURLE_OK;
struct SessionHandle *data = conn->data;
struct connectdata *sec_conn = NULL; /* secondary connection */
bool backup_reuse_fresh = data->set.reuse_fresh;
char *backup_userpwd = data->set.userpwd;
if(data->change.url_alloc)
fr... | false | false | false | false | false | 0 |
download_cleanup(void)
{
encap_hashptr_t hp;
download_connection_t *dcp;
if (download_connections_h == NULL)
return;
encap_hashptr_reset(&hp);
while (encap_hash_next(download_connections_h, &hp) != 0)
{
dcp = (download_connection_t *)encap_hashptr_data(&hp);
dcp->dc_closefunc(dcp->dc_handle);
}
} | false | false | false | false | false | 0 |
f_mk_filename(casestring a_casestring, const string &suffix)
{
char const *basename;
if ((basename = strrchr( a_casestring->name, '/' )) == 0)
basename = a_casestring->name;
if (basename[0] == '/')
basename++;
else if (basename[0] == '"')
basename++;
size_t baselen = strlen(basename);
... | false | false | false | false | false | 0 |
bnx2x_8073_specific_func(struct bnx2x_phy *phy,
struct link_params *params,
u32 action)
{
struct bnx2x *bp = params->bp;
switch (action) {
case PHY_INIT:
/* Enable LASI */
bnx2x_cl45_write(bp, phy,
MDIO_PMA_DEVAD, MDIO_PMA_LASI_RXCTRL, (1<<2));
bnx2x_cl45_write(bp, phy,
MDIO_PMA_DEV... | false | false | false | false | false | 0 |
ss_incomingUDP(const QString &host, int port, const QHostAddress &addr, int sourcePort, const QByteArray &data)
{
if(port != 0 || port != 1)
return;
Q3PtrListIterator<S5BManager> it(d->manList);
for(S5BManager *m; (m = it.current()); ++it) {
if(m->srv_ownsHash(host)) {
m->srv_incomingUDP(port == 1 ? true : f... | false | false | false | false | false | 0 |
StandbyAcquireAccessExclusiveLock(TransactionId xid, Oid dbOid, Oid relOid)
{
xl_standby_lock *newlock;
LOCKTAG locktag;
/* Already processed? */
if (!TransactionIdIsValid(xid) ||
TransactionIdDidCommit(xid) ||
TransactionIdDidAbort(xid))
return;
elog(trace_recovery(DEBUG4),
"adding recovery lock: db %... | false | false | false | false | false | 0 |
strpack(Strpack *desc, const char *delimit)
{
int n;
Ds *ds;
Strpack *dp;
dp = desc;
ds = ds_init(NULL);
for (n = 0, dp = desc; dp->ptr != NULL; dp++, n++) {
char *el;
const char *sep;
sep = (n == 0) ? "" : delimit;
switch (dp->type) {
case STRNUM_STR:
el = *(char **) dp->ptr;
ds_asprintf(ds, "... | false | false | false | false | false | 0 |
dumpToTextStream_map_specific(mrpt::utils::CStream &out) const
{
out.printf("MAP TYPE = %s\n", mrpt::utils::TEnumType<CHeightGridMap2D_MRF::TMapRepresentation>::value2name(mapType).c_str() );
LOADABLEOPTS_DUMP_VAR(run_map_estimation_at_ctor , bool);
LOADABLEOPTS_DUMP_VAR(min_x ... | false | false | false | false | false | 0 |
show_info_level_1( definitionInfoT *info )
{
uint32_t i = 0, index = 0;
double resolution = info->timerResolution;
double fileSize = info->traceFileSize;
char* unitTimer;
char* unitFileSize;
/*formating the timerresolution*/
while( (resolution / 1000 >= 1.0) && (i < 4) )
{
resolution /= 1000;
i... | false | false | false | false | false | 0 |
get_city_dialog_production_full(char *buffer, size_t buffer_len,
struct universal target,
struct city *pcity)
{
int turns = city_turns_to_build(pcity, target, TRUE);
int cost = universal_build_shield_cost(&target);
switch (target.kind) {
case VUT_IMPROVEMENT:
fc_strlcpy(buffer, city_impro... | false | false | false | false | false | 0 |
IWriteODEPhysical(hsStream* S, plResManager* mgr) {
S->writeInt(fBounds);
if (fBounds == plSimDefs::kExplicitBounds) {
S->writeInt(fVerts.getSize());
for (size_t i=0; i<fVerts.getSize(); i++)
fVerts[i].write(S);
S->writeInt(fIndices.getSize() / 3);
for (size_t i=0; i... | false | false | false | false | false | 0 |
print_relation (FILE *f,
const gchar *from,
const gchar *to,
gboolean directed,
gboolean push_property)
{
if (directed) {
if (push_property) {
print_string (f, "%s -> %s [", from, to);
} else {
print_string (f, "%s -> %s;", from, ... | false | false | false | false | false | 0 |
Tokenize(const std::string& str, std::vector<std::string>& tokens, const std::string& delimiters)
{
if (tokens.size() > 0)
{
tokens.clear();
}
std::string::size_type lastPos = str.find_first_not_of(delimiters,0);
std::string::size_type pos = str.find_first_of(delimiters,lastPos);
while (std::strin... | false | false | false | false | false | 0 |
isl_set_size(__isl_keep isl_set *set)
{
int i;
int size = 0;
if (!set)
return -1;
for (i = 0; i < set->n; ++i)
size += isl_basic_set_size(set->p[i]);
return size;
} | false | false | false | false | true | 1 |
makeTMCLProperties() const
{
PropertyMap map;
if(fieldList().size() % 2 != 0){
// according to the ID3 spec, TMCL must contain an even number of entries
map.unsupportedData().append(frameID());
return map;
}
StringList l = fieldList();
for(StringList::ConstIterator it = l.begin(); it != l.end(); +... | false | false | false | false | false | 0 |
_cairo_image_surface_scale_nearest (cairo_surface_t *image,
int new_width,
int new_height)
{
cairo_surface_t *scaled;
int src_width;
int src_height;
guchar *p_src;
guchar *p_dest;
int src_rowstride;
int ... | false | true | false | false | false | 1 |
ioComplete(Queue * ioq, Queue * rq, Queue * wq){
if (ioq->hasHead() && ioq->getHead()->isComplete()) {
std::cout << "io head is complete" << std::endl;
ioq->getHead()->tick();
wq->total_number_of_ticks = wq->total_number_of_ticks - 1;
}
else {
std::cout << "io head is not complete" ... | false | false | false | false | false | 0 |
graph_alloc(isl_ctx *ctx, struct isl_sched_graph *graph,
int n_node, int n_edge)
{
int i;
graph->n = n_node;
graph->n_edge = n_edge;
graph->node = isl_calloc_array(ctx, struct isl_sched_node, graph->n);
graph->sorted = isl_calloc_array(ctx, int, graph->n);
graph->region = isl_alloc_array(ctx, struct isl_region,... | false | false | false | false | false | 0 |
objc_write_global_declarations (void)
{
mark_referenced_methods ();
/* A missing @end might not be detected by the parser. */
if (objc_implementation_context)
{
warning (0, "%<@end%> missing in implementation context");
finish_class (objc_implementation_context);
objc_ivar_chain = NULL_TRE... | false | false | false | false | false | 0 |
reset1Bit(unsigned int u1bit, unsigned int *pu)
{
unsigned int mask, n, i;
// find and zero the bit
mask = 0x00000001;
n = 0;
for(i=0; i<32; i++)
{ if(mask & (*pu))
{ if(n == u1bit)
{ *pu = ((*pu) & (~mask));
return;
}
n++;
}
mask = (mask << 1);
}
} | false | false | false | false | false | 0 |
GenerateValue(AsmCode& asm_code) const
{
child->GenerateValue(asm_code);
if (GetSymType() == top_type_int) GenerateForInt(asm_code);
else GenerateForReal(asm_code);
} | false | false | false | false | false | 0 |
processLocationFormatCommand( char command,
const SourceLine &sourceLine )
{
switch ( command )
{
case 'p':
m_stream << sourceLine.fileName();
return true;
case 'l':
m_stream << sourceLine.lineNumber();
return true;
case 'f':
m_stream ... | false | false | false | false | false | 0 |
sendnodecmdetchdoc(ESTMTDB *db, const char *myurl, const char *mylabel,
CBMAP *params){
ESTDOC *doc;
CBMAP *kwords;
const char *rp, *uri, *kbuf;
int id, ksiz;
id = (rp = cbmapget(params, "id", -1, NULL)) ? atoi(rp) : 0;
if(!(uri = cbmapget(params, "uri", -1, NULL))) uri = "";
... | false | false | false | false | false | 0 |
sol_response_acks_packet(struct ipmi_rs * rsp,
struct ipmi_v2_payload * payload)
{
return (is_sol_packet(rsp) &&
payload &&
(payload->payload_type == IPMI_PAYLOAD_TYPE_SOL) &&
(rsp->payload.... | false | false | false | false | true | 1 |
zxid_wsf_sign(zxid_conf* cf, int sign_flags, struct zx_wsse_Security_s* sec, struct zx_wsse_SecurityTokenReference_s* str, struct zx_e_Header_s* hdr, struct zx_e_Body_s* bdy)
{
X509* sign_cert;
EVP_PKEY* sign_pkey;
int n_refs;
struct zxsig_ref refs[ZXID_N_WSF_SIGNED_HEADERS];
if (sign_flags) {
n_re... | false | false | false | false | false | 0 |
gst_lfo_control_source_reset (GstLFOControlSource * self)
{
GstControlSource *csource = GST_CONTROL_SOURCE (self);
csource->get_value = NULL;
csource->get_value_array = NULL;
self->priv->type = self->priv->base = G_TYPE_INVALID;
if (G_IS_VALUE (&self->priv->minimum_value))
g_value_unset (&self->priv->m... | false | false | false | false | false | 0 |
ensGvsourceadaptorFetchAllbyGvsourceType(
EnsPGvsourceadaptor gvsa,
EnsEGvsourceType gvst,
AjPList gvss)
{
register ajuint i = 0U;
void **valarray = NULL;
if (!gvsa)
return ajFalse;
if (!gvst)
return ajFalse;
if (!gvsa->CacheByIdentifier)
gvsourceadaptorCacheI... | false | false | false | false | false | 0 |
BTDM_IsActionSCO(struct rtw_adapter *padapter)
{
struct hal_data_8723a *pHalData;
struct bt_30info *pBTInfo;
struct bt_mgnt *pBtMgnt;
struct bt_dgb *pBtDbg;
u8 bRet;
pHalData = GET_HAL_DATA(padapter);
pBTInfo = GET_BT_INFO(padapter);
pBtMgnt = &pBTInfo->BtMgnt;
pBtDbg = &pBTInfo->BtDbg;
bRet = false;
if (p... | false | false | false | false | false | 0 |
write(UDate start, VTZWriter& writer, UErrorCode& status) const {
if (U_FAILURE(status)) {
return;
}
InitialTimeZoneRule *initial = NULL;
UVector *transitionRules = NULL;
UVector customProps(uprv_deleteUObject, uhash_compareUnicodeString, status);
UnicodeString tzid;
// Extract rule... | false | false | false | false | false | 0 |
sockaddr_ipv6(union fc_sockaddr *addr)
{
#ifdef IPV6_SUPPORT
if (addr->saddr.sa_family == AF_INET6) {
return TRUE;
}
#endif /* IPv6 support */
return FALSE;
} | false | false | false | false | false | 0 |
attach_bjnp (SANE_String_Const devname, SANE_String_Const makemodel,
SANE_String_Const serial,
const struct pixma_config_t *const pixma_devices[])
{
scanner_info_t *si;
const pixma_config_t *cfg;
SANE_Status error;
si = (scanner_info_t *) calloc (1, sizeof (*si));
if (!si)
re... | false | true | false | false | false | 1 |
RaProcessSrvRecord (struct ArgusServiceRecord *srv)
{
struct ArgusRecord *argus = NULL;
struct ArgusRecord *arg2 = NULL;
struct RaHashTableHeader *rtblhdr = NULL;
unsigned int key = 0;
if (srv && ((argus = srv->argus) != NULL)) {
unsigned int probe = srv->argus->ahdr.argusid;
unsigned short ... | false | false | false | true | false | 1 |
evg_surface_clear_rgba(GF_SURFACE surf, GF_IRect rc, GF_Color col)
{
u8 *data;
u8 a, r, g, b;
u32 x, y, w, h, sy;
s32 st;
Bool use_memset;
EVGSurface *_this = (EVGSurface *)surf;
st = _this->pitch_y;
h = rc.height;
w = rc.width;
sy = rc.y;
a = GF_COL_A(col);
r = GF_COL_R(col);
g = GF_COL_G(col);
b = GF_... | false | false | false | false | false | 0 |
init(void)
{
int rc = 0;
/* Allocate the subsystem list */
subsystems = list_create((ListDelF)subsystem_fini);
if (subsystems == NULL)
rc = ENOMEM;
return rc;
} | false | false | false | false | false | 0 |
parse_rfc1123_time(const char *buf, time_t *t)
{
struct tm tm;
char month[4];
char weekday[4];
int i, m;
unsigned tm_mday, tm_year, tm_hour, tm_min, tm_sec;
if (strlen(buf) != RFC1123_TIME_LEN)
return -1;
memset(&tm, 0, sizeof(tm));
if (tor_sscanf(buf, "%3s, %2u %3s %u %2u:%2u:%2u GMT", weekday,
... | true | true | false | false | false | 1 |
maildir_filter_importmaildirfilter(const char *maildir)
{
const char *p=maildir_filter_config(maildir, "MAILDIRFILTER");
char *maildirfilter;
FILE *i, *o;
struct maildir_tmpcreate_info createInfo;
if (!p) return (-1);
if (!*p)
{
errno=ENOENT;
return (-1);
}
maildirfilter=maildir_filter_config_maildirfil... | true | true | false | false | true | 1 |
doquote9(BW *bw, int c, void *object, int *notify)
{
if (notify)
*notify = 1;
if ((c >= 0x40 && c <= 0x5F) || (c >= 'a' && c <= 'z'))
c &= 0x1F;
if (c == '?')
c = 127;
c |= 128;
utypebw_raw(bw, c, 1);
bw->cursor->xcol = piscol(bw->cursor);
return 0;
} | false | false | false | false | false | 0 |
acpi_db_convert_to_package(char *string, union acpi_object * object)
{
char *this;
char *next;
u32 i;
acpi_object_type type;
union acpi_object *elements;
acpi_status status;
elements =
ACPI_ALLOCATE_ZEROED(DB_DEFAULT_PKG_ELEMENTS *
sizeof(union acpi_object));
this = string;
for (i = 0; i < (DB_DEFA... | false | false | false | false | false | 0 |
findDirs( const char *type,
const QString& reldir ) const
{
QDir testdir;
QStringList list;
if (!QDir::isRelativePath(reldir))
{
testdir.setPath(reldir);
if (testdir.exists())
{
if (reldir.endsWith(QLatin1Char('/')))
... | false | false | false | false | false | 0 |
graph_reorder_parents(struct graph *graph)
{
struct graph_row *row = &graph->row;
struct graph_row *parents = &graph->parents;
int i;
if (parents->size == 1)
return;
for (i = 0; i < parents->size; i++) {
struct graph_column *column = &parents->columns[i];
size_t match = graph_find_column_by_id(row, column-... | false | false | false | false | false | 0 |
CreateSymbol( wxPlotSymbol_Type type, wxPlotPen_Type colour_type, int width, int height,
const wxPen *pen, const wxBrush *brush)
{
wxBitmap b(width, height);
wxMemoryDC mdc;
mdc.SelectObject(b);
mdc.SetPen(*wxWHITE_PEN);
mdc.SetBrush(*wxWHITE_BRUSH);
mdc.DrawR... | false | false | false | false | false | 0 |
crypto_secretbox_easy(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k)
{
if (mlen > SIZE_MAX - crypto_secretbox_MACBYTES) {
return -1;
}
return crypto_secretbox_detached(c + crypto_secretbox... | false | false | false | false | false | 0 |
irmo_connection_error(IrmoConnection *conn, char *s, ...)
{
va_list args;
if (conn->connection_error != NULL) {
free(conn->connection_error);
}
va_start(args, s);
conn->connection_error = irmo_vasprintf(s, args);
va_end(args);
} | false | false | false | false | false | 0 |
copy_pass_detail (pass_detail_t *detail)
{
pass_detail_t *new;
/* create a pass_t entry; FIXME: g_try_new in 2.8 */
new = g_new (pass_detail_t, 1);
new->time = detail->time;
new->pos.x = detail->pos.x;
new->pos.y = detail->pos.y;
new->pos.z = detail->pos.z;
new->pos.w = detail->pos.w;... | false | false | false | false | false | 0 |
proxy_settings_changed (EProxy *proxy,
EBookBackend *backend)
{
EBookBackendGooglePrivate *priv;
SoupURI *proxy_uri = NULL;
priv = E_BOOK_BACKEND_GOOGLE_GET_PRIVATE (backend);
if (!priv || !priv->service)
return;
/* use proxy if necessary */
if (e_proxy_require_proxy_for_uri (proxy, U... | false | false | false | false | false | 0 |
_field(Request& r, MethodParams& params) {
Value& o=params.as_no_junction(0, "first param must be object or class, not junction");
const String& name=params.as_string(1, "field name must be string");
if(HashStringValue* fields=o.get_fields())
if(Value* value=fields->get(name))
r.write_no_lang(*value);
} | false | false | false | false | false | 0 |
city_unit_present(const struct city *pcity,
struct universal target)
{
if (VUT_UTYPE == target.kind) {
struct unit_type *tvtype = target.value.utype;
unit_list_iterate(pcity->tile->units, punit) {
if (unit_type(punit) == tvtype)
return TRUE;
}
unit_list_iterate_end;
}
return FALSE... | false | false | false | false | false | 0 |
fill_cmd_set_lan_configuration_parameters_subnet_mask (uint8_t channel_number,
uint32_t subnet_mask,
fiid_obj_t obj_cmd_rq)
{
if (!IPMI_CHANNEL_NUMBER_VALID (channel_number)
|| !fiid_obj_valid (obj_cmd_... | false | false | false | false | false | 0 |
bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc,
struct bfi_ioc_image_hdr_s *smem_fwhdr)
{
struct bfi_ioc_image_hdr_s *drv_fwhdr;
enum bfi_ioc_img_ver_cmp_e smem_flash_cmp, drv_smem_cmp;
drv_fwhdr = (struct bfi_ioc_image_hdr_s *)
bfa_cb_image_get_chunk(bfa_ioc_asic_gen(ioc), 0);
/*
* If smem is incompatible or old,... | false | false | false | false | false | 0 |
mrg_prmloc(parminfo)
struct parminfo *parminfo;
{
struct sym_entry *sym;
int param_num;
for (sym = params; sym != NULL; sym = sym->u.param_info.next) {
param_num = sym->u.param_info.param_num;
if (sym->id_type & DrfPrm) {
parminfo[param_num].cur_loc |= sym->u.param_info.cur_loc;
... | false | false | false | false | false | 0 |
stol(tokenpt)
char *tokenpt;
{
register char *pt;
if ((pt = strchr(tokenpt, '.')) == (char *)NULL)
return (long)(SCALE_X * atol(tokenpt));
else {
#if 0
shift(pt);
return (long)(SCALE_X * atol(tokenpt) / 1000);
#endif
return (long)((double)SCALE_X * atof(tokenpt));
}
} | false | false | false | false | false | 0 |
SetSlots() {
#if 0
float maxUp = (float) (thePrefs::GetMaxUpload());
float kBpsUpPerClient = (float) thePrefs::GetSlotAllocation();
float kBpsUp = (float) (theStats::GetUploadRate() / 1024.0); // lo shift di 10 bit equivale a dividere per 1024 (piu' rapido)
int slots;
slots = (int)floor( m... | false | false | false | false | false | 0 |
L6__TYPECASE__assert()
{register object *base=vs_base;
register object *sup=base+VM6; VC6
vs_reserve(VM6);
check_arg(2);vs_top=sup;
{object V56=base[0]->c.c_cdr;
if(endp(V56))invalid_macro_call();
base[2]= (V56->c.c_car);
V56=V56->c.c_cdr;
base[3]= V56;}
{register object V57;
register object V58;
register ob... | false | false | false | false | false | 0 |
ssleay_rand_status(void)
{
CRYPTO_THREADID cur;
int ret;
int do_not_lock;
CRYPTO_THREADID_current(&cur);
/* check if we already have the lock
* (could happen if a RAND_poll() implementation calls RAND_status()) */
if (crypto_lock_rand)
{
CRYPTO_r_lock(CRYPTO_LOCK_RAND2);
do_not_lock = !CRYPTO_THREADID_c... | false | false | false | false | false | 0 |
SDgetdatasize(int32 sdsid, /* IN: dataset ID */
int32* comp_size, /* OUT: size of compressed data */
int32* orig_size) /* OUT: size of original data */
{
CONSTR(FUNC, "SDgetdatasize"); /* for HGOTO_ERROR */
NC *handle;
NC_var *var;
int32 *comp_size_tmp=NULL, *orig... | false | false | false | true | false | 1 |
sha1_safe_base64(char* out_buf, int len, const char* data)
{
char sha1[20];
if (len == -2)
len = strlen(data);
SHA1((unsigned char*)data, len, (unsigned char*)sha1);
return base64_fancy_raw(sha1, 20, out_buf, safe_basis_64, 1<<31, 0, 0, '.');
} | true | true | false | false | false | 1 |
alarm_timeout (int onoff) {
static struct sigaction oldaction;
if (onoff)
{
struct sigaction action;
action.sa_handler = &alarm_handler;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
sigaction(SIGALRM, &action, &oldaction); /* Install our signal handler */
timeout = 0... | false | false | false | false | false | 0 |
mod_descr(dico_handle_t hp)
{
struct dictdb *db = (struct dictdb *) hp;
char *ptr = find_db_entry(db, DICTORG_SHORT_ENTRY_NAME);
if (ptr) {
size_t len = dico_trim_nl(ptr);
if (len >= sizeof(DICTORG_SHORT_ENTRY_NAME)
&& memcmp(ptr, DICTORG_SHORT_ENTRY_NAME"\n",
sizeof(DICTORG_SHORT_ENTRY_NAME)... | false | false | false | false | false | 0 |
gst_base_parse_pull_range (GstBaseParse * parse, guint size,
GstBuffer ** buffer)
{
GstFlowReturn ret = GST_FLOW_OK;
g_return_val_if_fail (buffer != NULL, GST_FLOW_ERROR);
/* Caching here actually makes much less difference than one would expect.
* We do it mainly to avoid pulling buffers of 1 byte all t... | false | false | false | false | false | 0 |
moblin_get_token (GScanner *scanner,
guint expected)
{
guint token;
token = g_scanner_peek_next_token (scanner);
if (token != expected)
{
return expected;
}
else
{
g_scanner_get_next_token (scanner);
return G_TOKEN_NONE;
}
} | false | false | false | false | false | 0 |
make_instr_row(PFS_thread *thread, PFS_instr_class *klass,
PFS_single_stat_chain *stat)
{
pfs_lock lock;
m_row_exists= false;
/* Protect this reader against a thread termination */
thread->m_lock.begin_optimistic_lock(&lock);
m_row.m_thread_internal_id= thread->m_thread_internal_id;
m_ro... | false | false | false | false | false | 0 |
print_rational_divide( const Rational& n, const Rational& d, std::ostream& s )
{
//print_mpq( n.getNumerator().getInt(), d.getNumerator().getInt(), s );
if( n<0 )
s << "(~ " << -n << "/" << d << ")";
else
s << n << "/" << d;
} | false | false | false | false | false | 0 |
nfs3svc_symlink (rpcsvc_request_t *req)
{
char name[NFS_PATH_MAX];
struct nfs3_fh dirfh = {{0}, };
char target[NFS_PATH_MAX];
symlink3args args;
int ret = RPCSVC_ACTOR_ERROR;
if (!req)
... | false | false | false | false | false | 0 |
init (void)
{
if (__libc_key_create (&key, free_key_mem))
/* Creating the key failed. This means something really went
wrong. In any case use a static buffer which is better than
nothing. */
static_buf = local_buf;
} | false | false | false | false | false | 0 |
ReAlloc( char*& szBuffer, int& nBufferSize, int nRequiredSize )
{
if( nRequiredSize > nBufferSize )
{
char* newp;
int nNewSize = nRequiredSize + BUFFER_ALLOC_INCREMENT;
if( Alloc( newp, nNewSize ) == DKIM_SUCCESS )
{
if( szBuffer != NULL && nBufferSize > 0 )
{
memcpy( newp, szBuffer, nB... | false | false | false | false | false | 0 |
read_hex_pkt(char *filename)
{
uint8_t *wire;
size_t wiresize;
ldns_pkt *pkt = NULL;
ldns_status status = LDNS_STATUS_ERR;
wire = xmalloc(LDNS_MAX_PACKETLEN);
wiresize = packetbuffromfile(filename, wire);
if (wiresize > 0) {
status = ldns_wire2pkt(&pkt, wire, wiresize);
}
xfree(wire);
if (statu... | false | false | false | false | false | 0 |
CmdEndPrint(void)
{
player_t *player;
if (ACScript->activator && ACScript->activator->player)
{
player = ACScript->activator->player;
}
else
{
player = &players[consoleplayer];
}
P_SetMessage(player, PrintBuffer, true);
return SCRIPT_CONTINUE;
} | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
#if ADB_HOST
adb_sysdeps_init();
adb_trace_init();
D("Handling commandline()\n");
return adb_commandline(argc - 1, argv + 1);
#else
/* If adbd runs inside the emulator this will enable adb tracing via
* adb-debug qemud service in the emulator. */
adb_qemu_trace... | false | false | false | false | false | 0 |
FetchFileModificationTime(wxDateTime savedTime)
// ----------------------------------------------------------------------------
{
if (savedTime != time_t(0))
{ m_LastXmlModifiedTime = savedTime;
return;
}
if (::wxFileExists(GetConfig()->SettingsSnippetsXmlPath) )
{ wxFileName fname( GetC... | false | false | false | false | false | 0 |
checkMD5Match_mismatch(const size_t stillBuffered,
PartialMatch* x, Desc& desc) {
const PartialMatch* oldestMatch = matches->findLowestStartOffset();
uint64 rereadEnd = off - stillBuffered;
uint64 xStartOffset = x->startOffset();
if (x != oldestMatch || xStartOffset >= re... | false | false | false | false | false | 0 |
APar_EmbeddedFileTests(char* filepath, int frameType, AdjunctArgs* adjunct_payloads) {
if (frameType == ID3_ATTACHED_PICTURE_FRAME) {
//get cli imagetype
uint8_t total_image_types = (uint8_t)(sizeof(ImageTypeList)/sizeof(*ImageTypeList));
uint8_t img_typlen = strlen(adjunct_payloads->pictypeArg) + 1;
char* ... | false | false | false | false | false | 0 |
str_cat4(const char *str1, const char *str2, const char *str3, const char *str4)
{
char *str;
char *tmp;
size_t str1_len = 0;
size_t str2_len = 0;
size_t str3_len = 0;
size_t str4_len = 0;
if (str1)
str1_len = strlen(str1);
if (str2)
str2_len = strlen(str2);
... | false | false | false | false | false | 0 |
outputAllRetainerSet(FILE *prof_file)
{
nat i, j;
nat numSet;
RetainerSet *rs, **rsArray, *tmp;
// find out the number of retainer sets which have had a non-zero cost at
// least once during retainer profiling
numSet = 0;
for (i = 0; i < HASH_TABLE_SIZE; i++)
for (rs = hashTable[i]; rs != ... | false | false | false | false | false | 0 |
rtp_session_set_internal_ssrc (RTPSession * sess, guint32 ssrc)
{
RTP_SESSION_LOCK (sess);
if (ssrc != sess->source->ssrc) {
g_hash_table_steal (sess->ssrcs[sess->mask_idx],
GINT_TO_POINTER (sess->source->ssrc));
GST_DEBUG ("setting internal SSRC to %08x", ssrc);
/* After this call, any receive... | false | false | false | false | false | 0 |
flush_libz_buffer(deflate_ctx *ctx, deflate_filter_config *c,
struct apr_bucket_alloc_t *bucket_alloc,
int (*libz_func)(z_streamp, int), int flush,
int crc)
{
int zRC = Z_OK;
int done = 0;
unsigned int deflate_len;
ap... | false | false | false | false | false | 0 |
mcam_dma_contig_done(struct mcam_camera *cam, int frame)
{
struct mcam_vb_buffer *buf = cam->vb_bufs[frame];
if (!test_bit(CF_SINGLE_BUFFER, &cam->flags)) {
cam->frame_state.delivered++;
cam->vb_bufs[frame] = NULL;
mcam_buffer_done(cam, frame, &buf->vb_buf);
}
mcam_set_contig_buffer(cam, frame);
} | 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.