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 |
|---|---|---|---|---|---|---|
my_unlock(CURL *handle, curl_lock_data data, void *useptr )
{
const char *what;
struct userdata *user = (struct userdata *)useptr;
int locknum;
(void)handle;
switch ( data ) {
case CURL_LOCK_DATA_SHARE:
what = "share";
locknum = 0;
break;
case CURL_LOCK_DATA_DNS:
what = "dns";
... | false | false | false | false | false | 0 |
bnad_debugfs_open_drvinfo(struct inode *inode, struct file *file)
{
struct bnad *bnad = inode->i_private;
struct bnad_debug_info *drv_info;
int rc;
drv_info = kzalloc(sizeof(struct bnad_debug_info), GFP_KERNEL);
if (!drv_info)
return -ENOMEM;
drv_info->buffer_len = sizeof(struct bnad_drvinfo);
drv_info->deb... | false | false | false | false | false | 0 |
call(VM &vm, const Location &loc,
const Insn *next)
{
if (!shuffle(vm, loc))
return 0;
ApplyInsn insn(vm.nActualArgs, loc, (Insn *)next);
return insn.execute(vm);
} | false | false | false | false | false | 0 |
soltri(real_t sub[], real_t diag[], real_t super[], int n, real_t b[])
{
int i;
real_t r;
r = b[1] /= diag[1];
for (i=2; i<=n; i++) r=b[i]=(b[i]-sub[i-1]*r)/diag[i];
for (i=n-1; i>=1; i--) r = b[i] -= super[i]*r;
} | false | false | false | false | false | 0 |
Payload(SOAPEnvelope* new_payload) {
SOAPEnvelope* p = payload_;
payload_=new_payload?new_payload->New():NULL;
if(p) delete p;
} | false | false | false | false | false | 0 |
EnterEvadeMode() override
{
// Do not stop casting at these points
if (m_uiPoint == 15 || m_uiPoint == 32)
{
m_creature->SetLootRecipient(NULL);
m_creature->DeleteThreatList();
m_creature->CombatStop(false);
Reset();
// Remove runn... | false | false | false | false | false | 0 |
str() {
stringstream ss;
ss << "call i32 @" << CFG_NamedMember::str() << "(";
for (vector<CFG_Member*>::iterator it = params.begin(); it != params.end(); ++it) {
ss << "i32 " << (*it)->str() << ",";
}
string out = ss.str();
if (params.size() > 0) {
out = out.substr(0, out.size()-1);
}
... | false | false | false | false | false | 0 |
apply_filter (GUPnPDIDLLiteWriter *writer,
const char *filter,
gboolean tags_only)
{
char **tokens;
GList *allowed = NULL;
unsigned short i;
xmlNode *node;
g_return_if_fail (GUPNP_IS_DIDL_LITE_WRITER (writer));
g_return_if... | false | false | false | false | false | 0 |
http_auth_www_authenticate_parse(char *challenge, char **errmsg)
{
char *p, *q, *start;
Http_auth_www_authenticate *wwwa;
Kwv *kwv;
static Kwv_conf conf = {
"=", NULL, NULL, KWV_CONF_DEFAULT, ",", 10, NULL, NULL
};
wwwa = ALLOC(Http_auth_www_authenticate);
wwwa->www_authenticate = strdup(challenge);
... | false | false | false | false | false | 0 |
ldapsvr_retrieve_item_person(ItemPerson *person, GHashTable *array) {
GList *node, *attr;
cm_return_val_if_fail(person != NULL, FALSE);
switch (person->status) {
case NONE: return FALSE;
case ADD_ENTRY: g_hash_table_insert(array, "status", "new"); break;
case UPDATE_ENTRY: g_hash_table_insert(array, "status",... | false | false | false | false | false | 0 |
newpoly()
{
int num;
if (Polybuf == NULL) {
Polybuf = (struct plist *)malloc(100*sizeof(struct plist));
if (Polybuf == NULL) {
CDStatusInt = CDMALLOCFAILED;
MallocFailed();
}
Newpoly = Polybuf;
Numpolys = 100;
return;
}
Newpoly++... | false | false | false | false | false | 0 |
flickcurl_favorites_remove(flickcurl* fc, const char* photo_id)
{
xmlDocPtr doc = NULL;
xmlXPathContextPtr xpathCtx = NULL;
flickcurl_init_params(fc, 1);
if(!photo_id)
return 1;
flickcurl_add_param(fc, "photo_id", photo_id);
flickcurl_end_params(fc);
if(flickcurl_prepare(fc, "flickr.favorites.... | false | false | false | false | false | 0 |
Perl_runops_debug(pTHX)
{
dVAR;
if (!PL_op) {
Perl_ck_warner_d(aTHX_ packWARN(WARN_DEBUGGING), "NULL OP IN RUN");
return 0;
}
DEBUG_l(Perl_deb(aTHX_ "Entering new RUNOPS level\n"));
do {
if (PL_debug) {
if (PL_watchaddr && (*PL_watchaddr != PL_watchok))
PerlIO_printf(Perl_debug_log,
... | false | false | false | false | false | 0 |
_gst_memory_copy (GstMemory * mem)
{
GST_CAT_DEBUG (GST_CAT_MEMORY, "copy memory %p", mem);
return gst_memory_copy (mem, 0, -1);
} | false | false | false | false | false | 0 |
ssl3_ValidateNextProtoNego(const unsigned char* data, unsigned int length)
{
unsigned int offset = 0;
while (offset < length) {
unsigned int newOffset = offset + 1 + (unsigned int) data[offset];
/* Reject embedded nulls to protect against buggy applications that
* store protocol identifiers in null-termina... | false | false | false | false | false | 0 |
invalidate()
{
HashSet<SVGStyledElement*>::const_iterator it = m_clients.begin();
const HashSet<SVGStyledElement*>::const_iterator end = m_clients.end();
for (; it != end; ++it) {
SVGStyledElement* cur = *it;
if (cur->renderer())
cur->renderer()->setNeedsLayout(true);
... | false | false | false | false | false | 0 |
_simple_output_compact_record (ipmi_sensors_state_data_t *state_data,
const void *sdr_record,
unsigned int sdr_record_len,
uint16_t record_id,
uint8_t sensor_number,
... | false | false | false | false | false | 0 |
BuildPlanes()
{
if (this->InnerBoundingPlanes->GetMTime() > this->GetMTime() &&
this->InnerBoundingPlanes->GetMTime() > this->BoundingPlanes->GetMTime())
{
return;
}
// Need to build planes.. Bring them all in front by MinimumDistance.
// Find the Inner bounding planes.
this->InnerBoundingPl... | false | false | false | false | false | 0 |
Compare(const FFState& o) const {
const LanguageModelChartState &other =
dynamic_cast<const LanguageModelChartState &>( o );
// prefix
if (m_hypo.GetCurrSourceRange().GetStartPos() > 0) // not for "<s> ..."
{
int ret = GetPrefix().Compare(other.GetPrefix());
if (ret != 0)
retu... | false | false | false | false | false | 0 |
list_create_element(data, bytes)
char *data;
int bytes;
{
LIST_ELEMENT *new;
/* Allocate storage for the new node and its data. Return NULL if
* unable to allocate.
*/
new = (LIST_ELEMENT *) malloc(sizeof(LIST_ELEMENT));
if (new == NULL) {
return(NULL);
}
/* Allocate storage for the d... | false | false | false | false | false | 0 |
FuncSizeScreen (
Obj self,
Obj args )
{
Obj size; /* argument and result list */
Obj elm; /* one entry from size */
UInt len; /* length of lines... | false | false | false | false | false | 0 |
script_run(char *script)
{
Tcl_Interp *interpreter;
int result;
int rcdelete;
log(L_DEBUG, "Initializing tcl script \"%s\"...\n", script);
breaklist_init();
result = FALSE;
if ((interpreter = Tcl_CreateInterp()))
{
if (Tcl_Init(interpreter) == TCL_OK)
{
if (init_tcl_functions(interpreter))
... | false | false | false | false | false | 0 |
lower_catch (struct leh_state *state, gimple tp)
{
eh_region try_region = NULL;
struct leh_state this_state = *state;
gimple_stmt_iterator gsi;
tree out_label;
gimple_seq new_seq, cleanup;
gimple x;
location_t try_catch_loc = gimple_location (tp);
if (flag_exceptions)
{
try_region = gen_eh_re... | false | false | false | false | false | 0 |
mono_runtime_resource_limit (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit)
{
if (resource_type >= MONO_RESOURCE_COUNT || resource_type < 0)
return 0;
if (soft_limit > hard_limit)
return 0;
resource_limits [resource_type * 2] = soft_limit;
resource_limits [resource_type * 2 + 1] = hard_limit;
r... | false | false | false | false | false | 0 |
btrfs_init_compress(void)
{
int i;
for (i = 0; i < BTRFS_COMPRESS_TYPES; i++) {
INIT_LIST_HEAD(&btrfs_comp_ws[i].idle_ws);
spin_lock_init(&btrfs_comp_ws[i].ws_lock);
atomic_set(&btrfs_comp_ws[i].alloc_ws, 0);
init_waitqueue_head(&btrfs_comp_ws[i].ws_wait);
}
} | false | false | false | false | false | 0 |
print_error_for_call_failure (tree fn, vec<tree, va_gc> *args, bool any_viable_p,
struct z_candidate *candidates)
{
tree name = DECL_NAME (OVL_CURRENT (fn));
location_t loc = location_of (name);
if (!any_viable_p)
error_at (loc, "no matching function for call to %<%D(%A)%>",
name, build_tree_... | false | false | false | false | false | 0 |
CollectSideEffectsOnPathsToDominatedBlock(
HBasicBlock* dominator, HBasicBlock* dominated) {
int side_effects = 0;
for (int i = 0; i < dominated->predecessors()->length(); ++i) {
HBasicBlock* block = dominated->predecessors()->at(i);
if (dominator->block_id() < block->block_id() &&
block->block_... | false | false | false | false | false | 0 |
increment(bool forward)
{
int length = get_length();
int time = get_time();
if (time == 0 || length == 0)
{
g_debug("%s 0.2%%", forward ? "Incrementing" : "Decrementing");
set_percentage(get_percentage() + (forward ? 0.002 : -0.002));
}
else
{
g_debug("%s 10 seconds", forward ? "Incrementing" : "Decrement... | false | false | false | false | false | 0 |
read_bam(void *data, bam1_t *b) // read level filters better go here to avoid pileup
{
aux_t *aux = (aux_t*)data; // data in fact is a pointer to an auxiliary structure
int ret = aux->iter? bam_iter_read(aux->fp, aux->iter, b) : bam_read1(aux->fp, b);
if (!(b->core.flag&BAM_FUNMAP)) {
if ((int)b->core.qual < aux->... | false | false | false | false | false | 0 |
m68k_disasm_ea (void *f, uaecptr addr, uaecptr *nextpc, int cnt, uae_u32 *seaddr, uae_u32 *deaddr)
{
TCHAR *buf;
buf = xmalloc (TCHAR, (MAX_LINEWIDTH + 1) * cnt);
if (!buf)
return;
m68k_disasm_2 (buf, (MAX_LINEWIDTH + 1) * cnt, addr, nextpc, cnt, seaddr, deaddr, 1);
f_out (f, _T("%s"), buf);
xfree (buf);
} | false | true | false | false | false | 1 |
collect_scanf_realnum(double *dret, FILE *f, int32 c, int32 width,
int32 fch)
{
register char *wchp;
double d1;
int32 got_dot, got_e, signc, unit, errnum;
char *endp;
/* collect the string */
wchp = __numtoken;
if (c == '-' || c == '+')
{ signc = c; if (width > 0) --width; c = scanf_getc(f); }
else signc =... | false | false | false | false | false | 0 |
write(hsStream* S, plResManager* mgr) {
plNetMessage::write(S, mgr);
plNetMsgStreamHelper helper;
unsigned char* buf = new unsigned char[fStream.size()];
fStream.copyTo(buf, fStream.size());
helper.setStream(buf, fStream.size());
helper.setCompressionType(fCompressionType);
// TODO: Compres... | false | false | false | false | false | 0 |
FilterExecRegexMatch(char *filename,char *crit)
{ regex_t rx;
regmatch_t pmatch;
char buffer[CF_BUFSIZE],expr[CF_BUFSIZE],line[CF_BUFSIZE],ebuff[CF_EXPANDSIZE],*sp;
FILE *pp;
AddMacroValue(CONTEXTID,"this",filename);
ExpandVarstring(crit,ebuff,NULL);
DeleteMacro(CONTEXTID,"this");
memset(buffer,0,CF_BUFSIZE)... | false | false | false | false | false | 0 |
fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
{
struct fc_lport *lport = fc_disc_lport(disc);
struct fc_rport_priv *rdata;
FC_DISC_DBG(disc, "Discovery complete\n");
disc->pending = 0;
if (disc->requested) {
fc_disc_restart(disc);
return;
}
/*
* Go through all remote ports. If they were ... | false | false | false | false | false | 0 |
sockaddr_in6_hash(void *data)
{
struct sockaddr_in6 *addr = data;
unsigned int i;
unsigned int result = 0;
// Hash the address:
for (i=0; i<16; ++i) {
result = (result << 5) + result + addr->sin6_addr.s6_addr[i];
}
// Include the port number in ... | false | false | false | false | false | 0 |
print_sflow_counter_basevg(const u_char *pointer, u_int len) {
const struct sflow_100basevg_counter_t *sflow_100basevg_counter;
if (len < sizeof(struct sflow_100basevg_counter_t))
return 1;
sflow_100basevg_counter = (const struct sflow_100basevg_counter_t *)pointer;
printf("\n\t in high prio fr... | false | false | false | false | false | 0 |
count_strings(const char *strings, unsigned int len)
{
unsigned int num;
const char *p;
for (p = strings, num = 0; p < strings + len; p += strlen(p) + 1)
num++;
return num;
} | false | false | false | false | false | 0 |
open (const char* pathname0)
{
pathname = strdup(pathname0);
BX_DEBUG(("sparse_image_t.open"));
fd = ::open(pathname, O_RDWR
#ifdef O_BINARY
| O_BINARY
#endif
);
if (fd < 0)
{
return -1; // open failed
}
BX_DEBUG(("sparse_image: open image %s", pathname));
read_header();
struct stat stat... | false | false | false | false | false | 0 |
make_pfb_segment_header( char *ptr, int type, unsigned long size)
{
ptr[0]=(char) 0x80;
ptr[1]=type;
if (type==3)
return( 2);
ptr[2]=(char)(size & 0xFF);
ptr[3]=(char)((size>>8) & 0xFF);
ptr[4]=(char)((size>>16) & 0xFF);
ptr[5]=(char)((size>>24) & 0xFF);
return( 6);
} | true | true | false | false | false | 1 |
layoutChars(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
float x, float y, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return 0;
}
if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset ... | false | false | false | false | false | 0 |
lock(const QString &reason)
{
if (d->broken || d->locked) return false;
d->locked = true;
d->lockReason = reason;
return true;
} | false | false | false | false | false | 0 |
qrt_patch_unref(struct routing_patch *rp)
{
g_assert(ROUTING_PATCH_MAGIC == rp->magic);
g_assert(rp->refcnt > 0);
if (--rp->refcnt == 0)
qrt_patch_free(rp);
} | false | false | false | false | false | 0 |
ParseKey(ParsedInternalKey* ikey) {
if (!ParseInternalKey(iter_->key(), ikey)) {
status_ = Status::Corruption("corrupted internal key in DBIter");
return false;
} else {
return true;
}
} | false | false | false | false | false | 0 |
L9()
{register object *base=vs_base;
register object *sup=base+VM9; VC9
vs_check;
{object V28;
V28=(base[0]);
vs_top=sup;
goto TTL;
TTL:;
if(((V28))==Cnil){
goto T65;}
base[1]= CMPcdr((V28));
vs_top=(vs_base=base+1)+1;
return;
goto T65;
T65:;
{frame_ptr fr;
fr=frs_sch_catch(((object)VV[0]));
if(fr==NULL)... | false | false | false | false | false | 0 |
VBR_new_prepare(lame_internal_flags * gfc,
const FLOAT pe[2][2], const III_psy_ratio ratio[2][2],
FLOAT l3_xmin[2][2][SFBMAX], int frameBits[16], int max_bits[2][2],
int* max_resv)
{
SessionConfig_t const *const cfg = &gfc->cfg;
EncResult_t *const eov = &gfc->ov_e... | false | false | false | false | true | 1 |
gnc_split_register_save_date_cell (BasicCell * cell,
gpointer save_data,
gpointer user_data)
{
SRSaveData *sd = save_data;
const char *value;
GDate gdate;
g_return_if_fail (gnc_basic_cell_has_name (cell, DATE_CELL));
value = gnc... | false | false | false | false | false | 0 |
output_literal(FILE *fp, long memno, Constp cp)
#endif
{
struct Literal *litp, *lastlit;
lastlit = litpool + nliterals;
for (litp = litpool; litp < lastlit; litp++) {
if (litp -> litnum == memno)
break;
} /* for litp */
if (litp >= lastlit)
out_const (fp, cp);
else {
nice_printf (fp, ... | false | false | false | false | false | 0 |
vbrpsy_skip_masking_l(lame_internal_flags * gfc, int chn)
{
int b;
for (b = 0; b < gfc->npart_l; b++) {
gfc->nb_2[chn][b] = gfc->nb_1[chn][b];
gfc->nb_1[chn][b] = 0;
}
} | false | false | false | false | false | 0 |
get_random_bytes(const int count)
{
char *buf;
int fd;
buf = NOFAIL(malloc(count));
fd = open(RANDOM_DEVICE, O_RDONLY);
if (fd < 0) {
perror("open(" RANDOM_DEVICE ")");
exit(2);
}
if (read(fd, buf, count) != count) {
if (count < 0)
perror("read(" RANDOM_DEVICE ")");
else
fprin... | false | false | false | false | false | 0 |
EmitCFIAdjustCfaOffset(int64_t Adjustment) {
MCStreamer::EmitCFIAdjustCfaOffset(Adjustment);
if (!UseCFI)
return;
OS << "\t.cfi_adjust_cfa_offset " << Adjustment;
EmitEOL();
} | false | false | false | false | false | 0 |
__make_NULL ( struct native_array * a,
int from, int to, int release )
{
for ( ; from <= to; from++ ) {
a->data[from].state = CMPI_nullValue;
if ( release ) {
native_release_CMPIValue ( a->type, &a->data[from].value );
}
}
} | false | false | false | false | false | 0 |
ubifs_calc_dark(const struct ubifs_info *c, int spc)
{
ubifs_assert(!(spc & 7));
if (spc < c->dark_wm)
return spc;
/*
* If we have slightly more space then the dark space watermark, we can
* anyway safely assume it we'll be able to write a node of the
* smallest size there.
*/
if (spc - c->dark_wm < MIN... | false | false | false | false | false | 0 |
ges_container_get_children (GESContainer * container, gboolean recursive)
{
GList *children = NULL;
g_return_val_if_fail (GES_IS_CONTAINER (container), NULL);
if (!recursive)
return g_list_copy_deep (container->children, (GCopyFunc) gst_object_ref,
NULL);
_get_children_recursively (container, &ch... | false | false | false | false | false | 0 |
filter_channel(MLPDecodeContext *m, unsigned int substr,
unsigned int channel)
{
SubStream *s = &m->substream[substr];
int32_t filter_state_buffer[NUM_FILTERS][MAX_BLOCKSIZE + MAX_FILTER_ORDER];
FilterParams *fp[NUM_FILTERS] = { &m->channel_params[channel].filter_params[FIR],
... | false | true | false | false | false | 1 |
bond_set_allmulti(struct bonding *bond, int inc)
{
struct list_head *iter;
int err = 0;
if (bond_uses_primary(bond)) {
struct slave *curr_active = rtnl_dereference(bond->curr_active_slave);
if (curr_active)
err = dev_set_allmulti(curr_active->dev, inc);
} else {
struct slave *slave;
bond_for_each_slav... | false | false | false | false | false | 0 |
ShallowCopy(vtkProp *prop)
{
vtkSphereHandleRepresentation *rep =
vtkSphereHandleRepresentation::SafeDownCast(prop);
if ( rep )
{
this->SetTranslationMode(rep->GetTranslationMode());
this->SetProperty(rep->GetProperty());
this->SetSelectedProperty(rep->GetSelectedProperty());
this->SetHotSp... | false | false | false | false | false | 0 |
_clutter_stage_get_update_time (ClutterStage *stage)
{
ClutterStageWindow *stage_window;
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return 0;
stage_window = _clutter_stage_get_window (stage);
if (stage_window == NULL)
return 0;
return _clutter_stage_window_get_update_time (stage_window);
} | false | false | false | false | false | 0 |
isPrimalObjectiveLimitReached() const
{
double limit = 0.0;
modelPtr_->getDblParam(ClpPrimalObjectiveLimit, limit);
if (fabs(limit) > 1e30) {
// was not ever set
return false;
}
const double obj = modelPtr_->objectiveValue();
int maxmin = static_cast<int> (modelPtr_->optimizationDirection());
... | false | false | false | false | false | 0 |
init_log_file(const char *log_file, int append)
{
const char *open_mode = append ? "a" : "w";
if (!(_log_file = fopen(log_file, open_mode))) {
log_sys_error("fopen", log_file);
return;
}
_log_to_file = 1;
} | false | false | false | false | true | 1 |
initialize()
{
// create filter
_filter = new FTspectrumModifier("Pitch", "scale", 0, FTspectrumModifier::SEMITONE_MODIFIER, SCALE_SPECMOD, _fftN/2, 1.0);
_filter->setRange(0.5, 2.0);
_filter->setBypassed(true); // by default
_filterlist.push_back (_filter);
gLastPhase = new float [FT_MAX_FFT_SIZE];
gSumPhas... | false | false | false | false | false | 0 |
airErfc(double x) {
double ax, y, b;
ax = AIR_ABS(x);
if (ax < 0.9820789566638689) {
b = (0.9999999999995380997 + ax*(-1.0198241793287349401 +
ax*(0.37030717279808919457 + ax*(-0.15987839763633308864 +
ax*(0.12416682580357861661 + (-0.04829622197742573233 +
0.0066094852952188890901*ax... | false | false | false | false | false | 0 |
cmsPipelineCat(cmsPipeline* l1, const cmsPipeline* l2)
{
cmsStage* mpe, *NewMPE;
// If both LUTS does not have elements, we need to inherit
// the number of channels
if (l1 ->Elements == NULL && l2 ->Elements == NULL) {
l1 ->InputChannels = l2 ->InputChannels;
l1 ->OutputChannels = l2... | false | false | false | false | false | 0 |
SPF_dns_null_free( SPF_dns_server_t *spf_dns_server )
{
SPF_ASSERT_NOTNULL(spf_dns_server);
free(spf_dns_server);
} | false | false | false | false | false | 0 |
Sort()
{
if ( ! this->tree.qualifiers.empty() ) {
sort ( this->tree.qualifiers.begin(), this->tree.qualifiers.end(), CompareNodeNames );
SortWithinOffspring ( this->tree.qualifiers );
}
if ( ! this->tree.children.empty() ) {
// The schema prefixes are the node's value, the name is the URI, so we sort schemas... | false | false | false | false | false | 0 |
root_nfs_data(char *cmdline)
{
char mand_options[sizeof("nolock,addr=") + INET_ADDRSTRLEN + 1];
int len, retval = -1;
char *tmp = NULL;
const size_t tmplen = sizeof(nfs_export_path);
tmp = kzalloc(tmplen, GFP_KERNEL);
if (tmp == NULL)
goto out_nomem;
strcpy(tmp, NFS_ROOT);
if (root_server_path[0] != '\0') {... | false | false | false | false | false | 0 |
snd_es1968_ac97_wait_poll(struct es1968 *chip)
{
int timeout = 100000;
while (timeout-- > 0) {
if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1))
return 0;
}
dev_dbg(chip->card->dev, "ac97 timeout\n");
return 1; /* timeout */
} | false | false | false | false | false | 0 |
check_num_args (int current, int total)
{
if (current >= total)
{
user_message(TRUE, "%s: Not enough arguments\n", program_name);
exit(ERRLEV_ARGS);
}
} | false | false | false | false | false | 0 |
print(raw_ostream &OS) const {
switch (Kind) {
case Immediate:
getImm()->print(OS);
break;
case Register:
OS << "<register R";
OS << getMBlazeRegisterNumbering(getReg()) << ">";
break;
case Token:
OS << "'" << getToken() << "'";
break;
case Memory: {
OS << "<memory R";
OS <... | false | false | false | false | false | 0 |
read_data (int sock, void *ptr, size_t size)
{
int len;
/* wait for data */
if (sleep_for_data (sock)) {
return -1;
}
len = recv (sock, ptr, size, 0);
if (len == -1 && errno == EAGAIN) {
return 0;
}
return len;
} | false | false | false | false | false | 0 |
recalculate_usage (SeahorseObject *self)
{
const gchar *desc;
if (!self->pv->description_explicit) {
switch (self->pv->usage) {
case SEAHORSE_USAGE_SYMMETRIC_KEY:
desc = _("Symmetric Key");
break;
case SEAHORSE_USAGE_PUBLIC_KEY:
desc = _("Public Key");
break;
case SEAHORSE_USAGE_PRIVATE_KEY:
... | false | false | false | false | false | 0 |
s_wrpkt_prepare(Ssh ssh, struct Packet *pkt, int *offset_p)
{
int pad, biglen, i, pktoffs;
unsigned long crc;
#ifdef __SC__
/*
* XXX various versions of SC (including 8.8.4) screw up the
* register allocation in this function and use the same register
* (D6) for len and as a temporary, with p... | false | true | false | false | false | 1 |
tuner_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *f)
{
struct tuner *t = to_tuner(sd);
if (set_mode(t, f->type) == 0)
set_freq(t, f->frequency);
return 0;
} | false | false | false | false | false | 0 |
recalc_num_pvals(artifact_type *a_ptr)
{
int i;
a_ptr->num_pvals = 0;
for (i = 0; i < MAX_PVALS; i++)
if (a_ptr->pval[i] != 0) a_ptr->num_pvals++;
file_putf(log_file, "a_ptr->num_pvals is now %d.\n", a_ptr->num_pvals);
} | false | false | false | false | false | 0 |
xmlSecOpenSSLX509CrlDerRead(xmlSecByte* buf, xmlSecSize size) {
X509_CRL *crl = NULL;
BIO *mem = NULL;
int ret;
xmlSecAssert2(buf != NULL, NULL);
xmlSecAssert2(size > 0, NULL);
mem = BIO_new(BIO_s_mem());
if(mem == NULL) {
xmlSecError(XMLSEC_ERRORS_HERE,
NULL,
... | false | false | false | false | false | 0 |
token_foreach (char *str, char sep,
int (*callback) (char *str, void *ud), void *ud)
{
char t, *start = str;
while (1)
{
if (*str == sep || *str == 0)
{
t = *str;
*str = 0;
if (callback (start, ud) < 1)
{
*str = t;
return FALSE;
}
*str = t;
if (*str == 0)
break;
str++;
... | false | false | false | false | false | 0 |
sw_call_list_remove (SwCallList *list, RestProxyCall *call)
{
GList *l;
l = g_list_find (list->l, call);
if (l)
{
g_object_weak_unref (G_OBJECT (call), call_weak_notify, list);
list->l = g_list_delete_link (list->l, l);
}
} | false | false | false | false | false | 0 |
resolve_args (tree args)
{
tree t;
for (t = args; t; t = TREE_CHAIN (t))
{
tree arg = TREE_VALUE (t);
if (error_operand_p (arg))
return error_mark_node;
else if (VOID_TYPE_P (TREE_TYPE (arg)))
{
error ("invalid use of void expression");
return error_mark_node;
}
arg = con... | false | false | false | true | false | 1 |
readPatterns(FILE* fp, REArray*& pats, fxBoolArray*& accept)
{
if (pats)
pats->resize(0);
else
pats = new REArray;
if (accept)
accept->resize(0);
else
accept = new fxBoolArray;
char line[256];
while (fgets(line, sizeof (line)-1, fp)) {
char* cp = strchr(line, '#');
if (cp || (cp = strchr(... | false | false | false | false | true | 1 |
json_wiki_get_by_name_or_symname(char const * zPageName,
char const * zSymname,
char contentFormat ){
if(!zSymname || !*zSymname){
return json_get_wiki_page_by_name(zPageName, contentFormat);
}else{
int... | false | false | false | false | false | 0 |
render(float frametime)
{
if(Player_obj->type == OBJ_OBSERVER) {
return;
}
Assert(Player_obj->type == OBJ_SHIP);
Assert(Player_obj->instance >= 0 && Player_obj->instance < MAX_SHIPS);
ship_weapon *sw = &Ships[Player_obj->instance].weapons;
// don't bother displaying anything if we have no secondaries
if ( s... | false | false | false | false | false | 0 |
SetValue(InitState init_state) {
ASSERT(cgen_->HasValidEntryRegisters());
ASSERT(!is_illegal());
MacroAssembler* masm = cgen_->masm();
switch (type_) {
case SLOT: {
Comment cmnt(masm, "[ Store to Slot");
Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
ASSERT(slot != NU... | false | false | false | false | false | 0 |
ParseRecordedUnits(struct Aoc *chanp, u_char *p, u_char *end, int *recordedUnits)
{
int typeOfUnit;
INIT;
XSEQUENCE_1(ParseRecordedUnitsChoice, ASN1_NOT_TAGGED, ASN1_NOT_TAGGED, recordedUnits);
XSEQUENCE_OPT_1(ParseTypeOfUnit, ASN1_TAG_INTEGER, ASN1_NOT_TAGGED, &typeOfUnit);
return p - beg;
} | false | false | false | false | false | 0 |
gen_strmov (rtx operand0,
rtx operand1,
rtx operand2,
rtx operand3)
{
rtx operand4;
rtx operand5;
rtx operand6;
rtx _val = 0;
start_sequence ();
{
rtx operands[7];
operands[0] = operand0;
operands[1] = operand1;
operands[2] = operand2;
operands[3] = operand3;
#line 15647 "../../src/gc... | false | false | false | false | false | 0 |
selectionChanged(bool selected)
{
// hide shape editing controls
if (!selected && isShapeEditing())
setShapeEditing(false);
} | false | false | false | false | false | 0 |
sys_recvmmsg(struct tcb *tcp)
{
static char str[128];
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
if (verbose(tcp)) {
sprint_timespec(str, tcp, tcp->u_arg[4]);
tcp->auxstr = strdup(str);
} else {
tprintf("%#lx, %ld, ", tcp->u_arg[1], tcp->u_arg[2]);
printflags(msg_flags, tcp->u_arg[3], "M... | true | true | false | false | false | 1 |
ai_near_full_strength(object *objp)
{
return (get_hull_pct(objp) > 0.9f) || (get_shield_pct(objp) > 0.8f);
} | false | false | false | false | false | 0 |
set_buffersize(long int samples)
{
if (samples != buffersize()) {
long old_bsize = buffersize();
AUDIO_IO_PROXY::set_buffersize(samples);
child()->set_buffersize(static_cast<long int>(std::floor(samples * (1.0f / psfactor_rep))));
ECA_LOG_MSG(ECA_LOGGER::user_objects,
"setting bsize from " +
kvu... | false | false | false | false | false | 0 |
decode_qp(char *dest, char *src, long len, int *soft, int underscore)
{
long src_pos, dest_pos;
int hex_no;
if (soft)
*soft = False;
src_pos = dest_pos = 0;
while (len > 0) {
if (src[src_pos] == '=') {
if (len >= 2 && (hex_no = get_hex(src + src_pos + 1)) >= 0) {
dest[dest_pos++] = hex_n... | true | true | false | false | false | 1 |
lk_karmaLan_update_file_details(int rio, uint32_t file_id,
char *properties)
{
char * packet; /* unused *tmp; */
int len,rlen;
rlen=strlen(properties);
len=rlen;
++len;
while(len%4) ++len;
packet=malloc(sizeof(uint32_t)+len);
file_id=lk_htorl(file... | false | false | false | false | false | 0 |
parseMessages(const string& messages) {
if (messages.find(MESSAGE_FEEL_MORE_CONFIDENT, 0) != string::npos) {
World::queueAction(new action::Enhance(this));
}
} | false | false | false | false | false | 0 |
ball_corner_check( Ball *ball,
Target *target_left_tang, Target *target_right_tang, Target *target )
{
/* balls moving ... */
if ( ball->vel.y > 0 ) {
if ( ball->vel.x < 0 ) {
/* ... down left */
if ( target == target_right_tang )
if ( target->side == SIDE_TOP )
target->side = CORNER_UPPER_RIGHT;... | false | false | false | false | false | 0 |
var_from_index(struct isl_tab *tab, int i)
{
if (i >= 0)
return &tab->var[i];
else
return &tab->con[~i];
} | false | false | false | false | false | 0 |
pnfs_generic_scan_ds_commit_list(struct pnfs_commit_bucket *bucket,
struct nfs_commit_info *cinfo,
int max)
{
struct list_head *src = &bucket->written;
struct list_head *dst = &bucket->committing;
int ret;
lockdep_assert_held(cinfo->lock);
ret = pnfs_generic_transfer_commit_list(src, dst, cinfo, max);
... | false | false | false | false | false | 0 |
envstr_set(struct str* env, const char* var, const char* val, int overwrite)
{
const char* found;
if ((found = envstr_find(env, var, strlen(var))) != 0) {
if (!overwrite)
return 1;
str_spliceb(env, found - env->s, strlen(found) + 1, 0, 0);
}
return str_cats(env, var)
&& str_catc(env, '=')
... | false | false | false | false | false | 0 |
CountCodeReductionForAlloca(Value *V) {
if (!V->getType()->isPointerTy()) return 0; // Not a pointer
unsigned Reduction = 0;
for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E;++UI){
Instruction *I = cast<Instruction>(*UI);
if (isa<LoadInst>(I) || isa<StoreInst>(I))
Reduction +... | false | false | false | false | false | 0 |
gfs_boundary_mpi_init (GfsBoundaryMpi * boundary)
{
boundary->process = -1;
boundary->id = -1;
#ifdef HAVE_MPI
boundary->nrequest = 0;
boundary->comm = MPI_COMM_WORLD;
#ifdef DEBUG
if (mpi_debug == NULL) {
int rank;
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
gchar * fname = g_strdup_printf ("mpi-%d",... | false | false | false | false | false | 0 |
mpd_validate_lconv(mpd_spec_t *spec)
{
size_t n;
#if CHAR_MAX == SCHAR_MAX
const char *cp = spec->grouping;
while (*cp != '\0') {
if (*cp++ < 0) {
return -1;
}
}
#endif
n = strlen(spec->dot);
if (n == 0 || n > 4) {
return -1;
}
if (strlen(spec->sep) > ... | false | false | false | false | false | 0 |
mate_score(int dist) {
ASSERT(dist!=0);
if (false) {
} else if (dist > 0) {
return +option_get_int("MateScore") - (+dist) * 2 + 1;
} else if (dist < 0) {
return -option_get_int("MateScore") + (-dist) * 2;
}
return 0;
}
} | false | false | false | false | false | 0 |
OnSemanticStylesheetsSet_cb (GtkWidget *widget, GdkEvent *event, combo_box_t *box)
{
UT_UNUSED(widget);
UT_UNUSED(event);
const char *t = getStylesheetName(box->ssList, gtk_combo_box_get_active_id(GTK_COMBO_BOX(box->combo_box)));
std::string ssName = t ? t : box->defaultStylesheet;
UT_DEBUGMSG(("O... | false | false | false | false | false | 0 |
make_tree_vector_copy (const vec<tree, va_gc> *orig)
{
vec<tree, va_gc> *ret;
unsigned int ix;
tree t;
ret = make_tree_vector ();
vec_safe_reserve (ret, vec_safe_length (orig));
FOR_EACH_VEC_SAFE_ELT (orig, ix, t)
ret->quick_push (t);
return ret;
} | 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.