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 |
|---|---|---|---|---|---|---|
Xnam(int modifier, char *label, char *mnemo, char *oper)
{
if (!oper)
error("need an operand");
settitle(oper);
return 0;
} | false | false | false | false | false | 0 |
ungrabKeyboard(){
if(xid){
FXTRACE((150,"%s::ungrabKeyboard %p\n",getClassName(),this));
getApp()->keyboardGrabWindow=NULL;
#ifndef WIN32
XUngrabKeyboard(DISPLAY(getApp()),getApp()->event.time);
#else
#endif
}
} | false | false | false | false | false | 0 |
make_void (NODE_T * p, MOID_T * q)
{
switch (ATTRIBUTE (p)) {
case ASSIGNATION:
case IDENTITY_RELATION:
case GENERATOR:
case CAST:
case DENOTATION:
{
make_coercion (p, VOIDING, MODE (VOID));
return;
}
}
/* MORFs are an involved case */
switch (ATTRIBUTE (p)) {
case SELECTION:
cas... | false | false | false | false | false | 0 |
gf117_grctx_generate_attrib(struct gf100_grctx *info)
{
struct gf100_gr *gr = info->gr;
const struct gf100_grctx_func *grctx = gr->func->grctx;
const u32 alpha = grctx->alpha_nr;
const u32 beta = grctx->attrib_nr;
const u32 size = 0x20 * (grctx->attrib_nr_max + grctx->alpha_nr_max);
const u32 access = NV_MEM... | false | false | false | false | false | 0 |
process_transform2(unsigned char **cp, size_t *len) {
char *msg;
struct isakmp_transform2 *trans_hdr = (struct isakmp_transform2 *) *cp;
unsigned trans_type;
unsigned trans_id;
char *trans_type_str;
char *trans_id_str;
size_t size;
trans_type = trans_hdr->isat2_transtype;
trans_id = ntohs(tr... | false | false | false | false | false | 0 |
oceanic_veo250_device_open (dc_device_t **out, dc_context_t *context, const char *name)
{
if (out == NULL)
return DC_STATUS_INVALIDARGS;
// Allocate memory.
oceanic_veo250_device_t *device = (oceanic_veo250_device_t *) malloc (sizeof (oceanic_veo250_device_t));
if (device == NULL) {
ERROR (context, "Failed to ... | false | false | false | false | false | 0 |
patch_anim_datas(void)
{
static int datas_patched = 0;
int i;
if(datas_patched)
return;
for(i = 0; i <= GIOCATORE_DISPERAZIONE_OVEST; i++)
Animation[i].FrameLen *= 2;
for(i = 0; i <= ARBITRO_CARTELLINO; i++)
ArbAnim[i].FrameLen *= 2;
for(i = 0; i <= GL_FUORI_0; i++)
... | false | false | false | false | false | 0 |
sosemanuk_extract(sosemanuk_state *state, uint8_t *stream)
{
uint32_t f[4];
uint32_t s[4];
int i;
for(i = 0; i < 4; ++i)
{
f[i] = automaton_step(state);
s[i] = lfsr_step(state);
}
uint32_t *stream32 = (uint32_t*)stream;
sbox_apply(2, f, stream32);
for(i = 0; i < 4; ++i)
{
... | false | false | false | false | false | 0 |
alignment_traceback(struct matrix *m, int istart, int jstart, const char *a, const char *b )
{
struct alignment * aln = malloc(sizeof(*aln));
memset(aln,0,sizeof(*aln));
int max_traceback_length = m->width + m->height + 4;
aln->traceback = malloc(max_traceback_length*sizeof(*aln->traceback));
int i = istart;
in... | false | false | false | false | false | 0 |
decodeIORInterceptor(omniInterceptors::decodeIOR_T::info_T& iinfo)
{
const IIOP::ProfileBody& iiop = iinfo.iiop;
omniIOR& ior = iinfo.ior;
const IOP::MultipleComponentProfile& components = iiop.components;
CORBA::ULong index;
try {
for (index=0; index < components.length(); ++ind... | false | false | false | false | false | 0 |
tulip_init_ring(struct net_device *dev)
{
struct tulip_private *tp = netdev_priv(dev);
int i;
tp->susp_rx = 0;
tp->ttimer = 0;
tp->nir = 0;
for (i = 0; i < RX_RING_SIZE; i++) {
tp->rx_ring[i].status = 0x00000000;
tp->rx_ring[i].length = cpu_to_le32(PKT_BUF_SZ);
tp->rx_ring[i].buffer2 = cpu_to_le32(tp->rx_... | false | false | false | false | false | 0 |
RunDragonLore(ARegion *r, Unit *u)
{
int level = u->GetSkill(S_DRAGON_LORE);
int num = u->items.GetNum(I_DRAGON);
if (num >= level) {
u->Error("Mage may not summon more dragons.");
return 0;
}
int chance = level * level * 4;
if (getrandom(100) < chance) {
u->items.SetNum(I_DRAGON,num + 1);
u->Event("Sum... | false | false | false | false | false | 0 |
TopLineOfMain() const {
if (wMargin.GetID())
return 0;
else
return topLine;
} | false | false | false | false | false | 0 |
expandIEChain(LLVMContext& Context, Instruction *I,
Instruction *J, unsigned o, Value *&LOp,
unsigned numElemL,
Type *ArgTypeL, Type *ArgTypeH,
bool IBeforeJ, unsigned IdxOff) {
bo... | false | false | false | false | false | 0 |
gst_udp_set_loop (int sockfd, guint16 ss_family, gboolean loop)
{
int ret = -1;
int l = (loop == FALSE) ? 0 : 1;
switch (ss_family) {
case AF_INET:
{
ret = setsockopt (sockfd, IPPROTO_IP, IP_MULTICAST_LOOP, &l, sizeof (l));
if (ret < 0)
return ret;
break;
}
case AF_INET... | false | false | false | false | false | 0 |
list(int nlflag)
{
union node *n1, *n2, *n3;
int tok;
checkkwd = CHKNL | CHKKWD | CHKALIAS;
if (nlflag == 2 && peektoken())
return NULL;
n1 = NULL;
for (;;) {
n2 = andor();
tok = readtoken();
if (tok == TBACKGND) {
if (n2->type == NPIPE) {
n2->npipe.pipe_backgnd = 1;
} else {
if (n2->type !... | false | false | false | false | false | 0 |
bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
wwn_t fabric_name)
{
struct bfad_s *bfad = (struct bfad_s *)fabric->fcs->bfad;
char pwwn_ptr[BFA_STRING_32];
char fwwn_ptr[BFA_STRING_32];
bfa_trc(fabric->fcs, fabric_name);
if (fabric->fabric_name == 0) {
/*
* With BRCD switches, we ... | false | false | false | false | false | 0 |
pm_settingsChanged()
{
QString prev = currentItem();
buildComboBox();
int x = d->cb_proxy->findData(prev);
if(x == -1) {
d->cb_proxy->setCurrentItem(0);
} else {
d->cb_proxy->setCurrentItem(x);
}
} | false | false | false | false | false | 0 |
blk_rq_map_sg(struct request_queue *q, struct request *rq,
struct scatterlist *sglist)
{
struct scatterlist *sg = NULL;
int nsegs = 0;
if (rq->bio)
nsegs = __blk_bios_map_sg(q, rq->bio, sglist, &sg);
if (unlikely(rq->cmd_flags & REQ_COPY_USER) &&
(blk_rq_bytes(rq) & q->dma_pad_mask)) {
unsigned int p... | false | false | false | true | false | 1 |
print_cat_sens(FILE * fp, const qpol_cat_t * cat_datum, const apol_policy_t * policydb, const int expand)
{
int retval = -1;
const char *cat_name, *lvl_name;
apol_level_query_t *query = NULL;
apol_vector_t *v = NULL;
const qpol_level_t *lvl_datum = NULL;
qpol_policy_t *q = apol_policy_get_qpol(policydb);
size_t ... | false | false | false | false | false | 0 |
addValueParamProps(const std::string &type, Property::TypeEnum valueType, int dim)
{
static const Property::PropSpec invariantProps[] = {
{ kOfxParamPropIsAnimating, Property::eInt, 1, false, "0" },
{ kOfxParamPropIsAutoKeying,Property::eInt, 1, false, "0" },
{ kO... | false | false | false | false | false | 0 |
nodeIsBeforeNode(NodeImpl *n1, NodeImpl *n2) const
{
if (!n1 || !n2)
return true;
if (n1 == n2)
return true;
bool result = false;
int n1Depth = 0;
int n2Depth = 0;
// First we find the depths of the two nodes in the tree (n1Depth, n2Depth)
NodeImpl *n = n1;
while (n->p... | false | false | false | false | false | 0 |
TryFindModuleAndPackageDir(
const vector<CommandLineFlagInfo> all_flags,
string *module,
string *package_dir) {
module->clear();
package_dir->clear();
vector<string> suffixes;
// TODO(daven): There's some inherant ambiguity here - multiple directories
// could share the same trailing folder and f... | false | false | false | false | false | 0 |
rsvg_css_parse_angle (const char *str)
{
double degrees;
char *end_ptr;
degrees = g_ascii_strtod (str, &end_ptr);
/* todo: error condition - figure out how to best represent it */
if ((degrees == -HUGE_VAL || degrees == HUGE_VAL) && (ERANGE == errno))
return 0.0;
if (end_ptr) {
... | false | false | false | false | false | 0 |
EvaluatePDF(double x, const ParametersType & p) const
{
if ( p.GetSize() != 1 )
{
itkGenericExceptionMacro(
"Invalid number of parameters to describe distribution. Expected 1 parameter, but got "
<< p.size()
<< " parameters.");
}
return TDistribution::PDF( x, static_cast< SizeValueType... | false | false | false | false | false | 0 |
init_constructions(game *g)
{
for (int i = 0; i < g->constructions.size(); i++) {
for (int j = 0; j < g->constructions[i]->stages.size(); j++) {
g->constructions[i]->stages[j].time = 1; // Everything takes 1 minute
}
}
} | false | false | false | false | false | 0 |
operator()()
{
size_t scoresNum;
{
#ifdef WITH_THREADS
boost::mutex::scoped_lock lock(m_mutex);
#endif
scoresNum = m_scoresNum;
m_scoresNum++;
}
while(scoresNum < m_encodedScores.size())
{
std::string scores = m_encodedScores[scoresNum];
std::string compressedScores
= m_creator.... | false | false | false | false | false | 0 |
gnutls_session_ticket_key_generate (gnutls_datum_t * key)
{
int ret;
key->size = sizeof (struct gnutls_session_ticket_key_st);
key->data = gnutls_malloc (key->size);
if (!key->data)
{
gnutls_assert ();
return GNUTLS_E_MEMORY_ERROR;
}
ret = _gnutls_rnd (GNUTLS_RND_RANDOM, key->data, key->... | false | false | false | false | false | 0 |
xps_read_zip_entry(xps_document *doc, xps_entry *ent, unsigned char *outbuf)
{
z_stream stream;
unsigned char *inbuf;
int sig;
int version, general, method;
int namelength, extralength;
int code;
fz_context *ctx = doc->ctx;
fz_seek(doc->file, ent->offset, 0);
sig = getlong(doc->file);
if (sig != ZIP_LOCAL_F... | false | false | false | false | false | 0 |
read_density()
{
gchar buffer[BSIZE];
FILE* file = FOpen(adfFileName, "rb");
if(!file)
{
sprintf(buffer,_("Sorry, i can not open \"%s\" file"),adfFileName);
grid = free_grid(grid);
Message(buffer,_("Error"),TRUE);
return;
}
sprintf(buffer,"Density");
/* printf("str = %s\n",buffer);*/
get_grid_from_adf_... | false | false | false | false | false | 0 |
forgetFrame(XAP_Frame * pFrame)
{
UT_return_val_if_fail(pFrame,false);
// If this frame is the currently focussed frame write in NULL
// until another frame appears
if(pFrame == m_lastFocussedFrame )
{
m_lastFocussedFrame = static_cast<XAP_Frame *>(NULL);
}
if (pFrame->getViewNumber() > 0)
{
// locate ve... | false | false | false | false | false | 0 |
gst_base_transform_set_qos_enabled (GstBaseTransform * trans, gboolean enabled)
{
g_return_if_fail (GST_IS_BASE_TRANSFORM (trans));
GST_CAT_DEBUG_OBJECT (GST_CAT_QOS, trans, "enabled: %d", enabled);
GST_OBJECT_LOCK (trans);
trans->priv->qos_enabled = enabled;
GST_OBJECT_UNLOCK (trans);
} | false | false | false | false | false | 0 |
aarch64_final_eh_return_addr (void)
{
HOST_WIDE_INT original_frame_size, frame_size, offset, fp_offset;
aarch64_layout_frame ();
original_frame_size = get_frame_size () + cfun->machine->saved_varargs_size;
frame_size = (original_frame_size + cfun->machine->frame.saved_regs_size
+ crtl->outgoing_args_size);
... | false | false | false | false | false | 0 |
compute_tzname_max (size_t chars)
{
const char *p;
p = zone_names;
do
{
const char *start = p;
while (*p != '\0')
++p;
if ((size_t) (p - start) > __tzname_cur_max)
__tzname_cur_max = p - start;
}
while (++p < &zone_names[chars]);
} | false | false | false | false | false | 0 |
combineChannels(fipImage& red, fipImage& green, fipImage& blue) {
if(!_dib) {
int width = red.getWidth();
int height = red.getHeight();
_dib = FreeImage_Allocate(width, height, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
}
if(_dib) {
BOOL bResult = TRUE;
bResult &= FreeImage_Set... | false | false | false | false | false | 0 |
gen_bypass (rtx def)
{
decl_t decl;
char **out_patterns;
int out_length;
char **in_patterns;
int in_length;
int i, j;
out_patterns = get_str_vect (XSTR (def, 1), &out_length, ',', FALSE);
if (out_patterns == NULL)
fatal ("invalid string `%s' in define_bypass", XSTR (def, 1));
in_patterns = get_st... | false | false | false | false | false | 0 |
binder_buffer_lookup(struct binder_proc *proc,
uintptr_t user_ptr)
{
struct rb_node *n = proc->allocated_buffers.rb_node;
struct binder_buffer *buffer;
struct binder_buffer *kern_ptr;
kern_ptr = (struct binder_buffer *)(user_ptr - proc->user_buffer_offset
- offsetof(struct binder_buffer, data));
while ... | false | false | false | false | false | 0 |
readLimited()
{
if (!m_iBytesLeft)
return 0;
m_receiveBuf.resize(4096);
int bytesToReceive;
if (m_iBytesLeft > KIO::filesize_t(m_receiveBuf.size()))
bytesToReceive = m_receiveBuf.size();
else
bytesToReceive = m_iBytesLeft;
const int bytesReceived = readBuffered(m_receiveBuf.data(), bytesToR... | false | false | false | false | false | 0 |
InsertChild(Iterator loc, MetaData::Pointer entry)
{
if (!entry)
{
btkErrorMacro("Impossible to insert an empty entry");
return false;
}
if (this->FindChild(entry->GetLabel()) != this->End())
{
btkErrorMacro("Label '" + entry->GetLabel() + "' already exists in the entries' list")... | false | false | false | false | false | 0 |
add_anchor_to_module (GcrCertificate *certificate, const gchar *purpose)
{
GckBuilder builder = GCK_BUILDER_INIT;
gconstpointer data;
gsize n_data;
data = gcr_certificate_get_der_data (certificate, &n_data);
g_assert (data);
/* And add a pinned certificate for the signed certificate */
gck_builder_add_data (&b... | false | false | false | false | false | 0 |
rewriteDependentName()
{
std::string NewStr = "";
if (NeedTypenameKeyword)
NewStr += "typename ";
NewStr += TheTyName;
TheRewriter.ReplaceText(SourceRange(TheLocBegin, TheNameLocEnd), NewStr);
} | false | false | false | false | false | 0 |
snd_ctl_sync_vmaster(struct snd_kcontrol *kcontrol, bool hook_only)
{
struct link_master *master;
bool first_init = false;
if (!kcontrol)
return;
master = snd_kcontrol_chip(kcontrol);
if (!hook_only) {
int err = master_init(master);
if (err < 0)
return;
first_init = err;
err = sync_slaves(master, mas... | false | false | false | false | false | 0 |
niyanpai_scrollx_w(int vram, int offset, int data)
{
niyanpai_scrollx_tmp[vram][offset] = data;
if (offset)
{
niyanpai_scrollx[vram] = -((((niyanpai_scrollx_tmp[vram][0] + (niyanpai_scrollx_tmp[vram][1] << 8)) & 0x1ff) + 0x4e) << 1);
}
} | false | false | false | false | false | 0 |
analysis_tool_descriptive_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_descriptive_t *info = specs;
switch (selector) {
case TOOL_ENGINE_UPDATE_DESCRIPTOR:
return (dao_command_descriptor (dao, _... | false | false | false | false | false | 0 |
sq_free(ESL_SQ *sq)
{
int x; /* index for optional extra residue markups */
if (sq->name != NULL) free(sq->name);
if (sq->acc != NULL) free(sq->acc);
if (sq->desc != NULL) free(sq->desc);
if (sq->source != NULL) free(sq->source);
if (sq->seq != NULL) free(sq->seq);
if (sq->dsq... | false | false | false | false | false | 0 |
mlx5_init_mr_table(struct mlx5_core_dev *dev)
{
struct mlx5_mr_table *table = &dev->priv.mr_table;
memset(table, 0, sizeof(*table));
rwlock_init(&table->lock);
INIT_RADIX_TREE(&table->tree, GFP_ATOMIC);
} | false | false | false | false | false | 0 |
logger_destroy(struct logger *log)
{
if (!log)
return 0;
if (log->log_file) {
free(log->log_file);
log->log_file = NULL;
}
if (log->fd) {
fclose(log->fd);
log->fd = NULL;
}
free(log);
log = NULL;
return 0;
} | false | false | false | false | false | 0 |
gnc_commodity_set_quote_tz(gnc_commodity *cm, const char *tz)
{
CommodityPrivate* priv;
if (!cm) return;
ENTER ("(cm=%p, tz=%s)", cm, tz ? tz : "(null)");
priv = GET_PRIVATE(cm);
if (tz == priv->quote_tz)
{
LEAVE("Already correct TZ");
return;
}
gnc_commodity_begin_e... | false | false | false | false | false | 0 |
show_name_attributes (name, nodefs)
char *name;
int nodefs;
{
SHELL_VAR *var;
var = find_variable_internal (name, 1);
if (var && invisible_p (var) == 0)
{
show_var_attributes (var, READONLY_OR_EXPORT, nodefs);
return (0);
}
else
return (1);
} | false | false | false | false | false | 0 |
memAllocBuf(size_t net_size, size_t * gross_size)
{
mem_type type = memFindBufSizeType(net_size, gross_size);
if (type != MEM_NONE)
return memAllocate(type);
else {
memMeterInc(HugeBufCountMeter);
memMeterAdd(HugeBufVolumeMeter, *gross_size);
return xcalloc(1, net_size);
}
} | false | false | false | false | false | 0 |
blendNoise1d( double x,
unsigned int y,
unsigned int z,
unsigned int t ) {
double floorX = floor( x );
unsigned int floorIntX = (unsigned int)floorX;
if( floorX == x ) {
unsigned int precomputedMix = mixFour( floorIntX, y, z, t );
... | false | false | false | false | false | 0 |
read_mac_pt(int fd, struct slice all, struct slice *sp, int ns) {
struct mac_driver_desc *md;
struct mac_partition *part;
unsigned secsize;
char *data;
int blk, blocks_in_map;
int n = 0;
md = (struct mac_driver_desc *) getblock(fd, 0);
if (md == NULL)
return -1;
if (be16_to_cpu(md->signature)... | false | false | false | false | false | 0 |
firstButtonText() const
{
QString text;
// The first URL navigator button should get the name of the
// place instead of the directory name
if ((m_placesSelector != 0) && !m_showFullPath) {
const KUrl placeUrl = m_placesSelector->selectedPlaceUrl();
text = m_placesSelector->selectedPlac... | false | false | false | false | false | 0 |
AcpiDbDisplayArguments (
void)
{
ACPI_WALK_STATE *WalkState;
WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
if (!WalkState)
{
AcpiOsPrintf ("There is no method currently executing\n");
return;
}
AcpiDmDisplayArguments (WalkState);
} | false | false | false | false | false | 0 |
parseTemplateArgument()
{
//printf("parseTemplateArgument()\n");
Objects *tiargs = new Objects();
Type *ta;
switch (token.value)
{
case TOKidentifier:
ta = new TypeIdentifier(token.loc, token.ident);
goto LabelX;
case TOKvector:
ta = parseVector()... | false | false | false | false | false | 0 |
qos_event_setenvstatus_cmd(cmd_parms *cmd, void *dcfg, const char *rc, const char *var) {
apr_table_t *setenvstatus_t;
if(cmd->path) {
qos_dir_config *dconf = (qos_dir_config*)dcfg;
setenvstatus_t = dconf->setenvstatus_t;
} else {
qos_srv_config *sconf = (qos_srv_config*)ap_get_module_config(cmd->serv... | false | false | false | false | false | 0 |
test_checkout_conflict__path_filters(void)
{
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
char *paths[] = { "conflicting-1.txt", "conflicting-3.txt" };
git_strarray patharray = {0};
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, CONFLICTING_ANCESTOR_OID, 1, "conflicting-1.txt" },
... | false | false | false | false | false | 0 |
init_output(void)
{
const char *str;
int i;
tp = tbufputs;
init_tty();
/* Window size: clear defaults, then try:
* environment, ioctl TIOCGWINSZ, termcap, defaults.
*/
lines = ((str = getvar("LINES"))) ? atoi(str) : 0;
columns = ((str = getvar("COLUMNS"))) ? atoi(str) : 0;
if... | false | false | false | false | true | 1 |
prepare_http_connect(int sd, struct auth_s *credentials, const char *thost) {
rr_data_t data1, data2;
int rc = 0;
hlist_t tl;
if (!sd || !thost || !strlen(thost))
return 0;
data1 = new_rr_data();
data2 = new_rr_data();
data1->req = 1;
data1->method = strdup("CONNECT");
data1->url = strdup(thost);
data1->... | false | false | false | false | false | 0 |
InvertMatrix(double **A, double **AI, int size)
{
int *index, iScratch[10];
double *column, dScratch[10];
// Check on allocation of working vectors
//
if ( size <= 10 )
{
index = iScratch;
column = dScratch;
}
else
{
index = new int[size];
column = new double[size];
}
int... | false | false | false | false | false | 0 |
operator< (const DictInfoNode & r, const DictInfoNode & l)
{
const DictInfo & rhs = r.c_struct;
const DictInfo & lhs = l.c_struct;
int res = strcmp(rhs.code, lhs.code);
if (res < 0) return true;
if (res > 0) return false;
res = strcmp(rhs.variety,lhs.variety);
if (res < 0) return true;
... | false | false | false | false | false | 0 |
thumb_loader_set_callbacks(ThumbLoader *tl,
ThumbLoaderFunc func_done,
ThumbLoaderFunc func_error,
ThumbLoaderFunc func_progress,
gpointer data)
{
if (!tl) return;
if (tl->standard_loader)
{
thumb_loader_std_set_callbacks((ThumbLoaderStd *)tl,
(ThumbLoaderStdFunc) func_done,
... | false | false | false | false | false | 0 |
fc0012_writereg(struct fc0012_priv *priv, u8 reg, u8 val)
{
u8 buf[2] = {reg, val};
struct i2c_msg msg = {
.addr = priv->cfg->i2c_address, .flags = 0, .buf = buf, .len = 2
};
if (i2c_transfer(priv->i2c, &msg, 1) != 1) {
dev_err(&priv->i2c->dev,
"%s: I2C write reg failed, reg: %02x, val: %02x\n",
KBUILD_M... | false | false | false | false | false | 0 |
_handle_keyvalue_match(s_p_values_t *v,
const char *value, const char *line,
char **leftover)
{
/* debug3("key = %s, value = %s, line = \"%s\"", */
/* v->key, value, line); */
switch (v->type) {
case S_P_IGNORE:
/* do nothing */
break;
case S_P_STRING:
_handle_string(v, value, line, left... | false | false | false | false | false | 0 |
goo_canvas_item_get_transform_for_child (GooCanvasItem *item,
GooCanvasItem *child,
cairo_matrix_t *transform)
{
GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item);
if (child && iface->get_transform_for_child)
return iface->get_transform_for_child (item, child, transform);
/* We f... | false | false | false | false | false | 0 |
ib_link_state_changed ( struct ib_device *ibdev ) {
DBGC ( ibdev, "IBDEV %p link state is %s\n",
ibdev, ib_link_state_text ( ibdev ) );
/* Notify drivers of link state change */
ib_notify ( ibdev );
} | false | false | false | false | false | 0 |
direction() const
{
if(!obj || !obj->isText() ) return QChar::DirON;
RenderText *renderTxt = static_cast<RenderText *>( obj );
if ( pos >= renderTxt->stringLength() )
return QChar::DirON;
return renderTxt->text()[pos].direction();
} | false | false | false | false | false | 0 |
cloneAttrs(Value & src, Value & dst)
{
mkAttrs(dst);
foreach (Bindings::iterator, i, *src.attrs) {
Attr & a = (*dst.attrs)[i->first];
mkCopy(a.value, i->second.value);
a.pos = i->second.pos;
}
} | false | false | false | false | false | 0 |
DISWritePDU(DISTransceiver * xcvr, dis_pdu * pdu)
{
char buffer[2048], *p;
#ifdef HAVE_RECVMSG
struct msghdr msg;
struct iovec vec;
#endif
XDR xdr;
int i, result, len;
/*
* Fill-out any length fields internal to the PDU (other than the length
* field in the header.
*/
DISAddPDUSizes(pdu)... | true | true | false | false | false | 1 |
getStore(SDValue Chain, DebugLoc dl, SDValue Val,
SDValue Ptr, MachineMemOperand *MMO) {
EVT VT = Val.getValueType();
SDVTList VTs = getVTList(MVT::Other);
SDValue Undef = getUNDEF(Ptr.getValueType());
SDValue Ops[] = { Chain, Val, Ptr, Undef };
FoldingSetNodeID ID;
AddNodeIDN... | false | false | false | false | false | 0 |
drbd_md_set_sector_offsets(struct drbd_device *device,
struct drbd_backing_dev *bdev)
{
sector_t md_size_sect = 0;
unsigned int al_size_sect = bdev->md.al_size_4k * 8;
bdev->md.md_offset = drbd_md_ss(bdev);
switch (bdev->md.meta_dev_idx) {
default:
/* v07 style fixed size indexed meta data */
bdev... | false | true | false | false | false | 1 |
flagTaggedStates() {
if (U_FAILURE(*fStatus)) {
return;
}
UVector tagNodes(*fStatus);
RBBINode *tagNode;
int32_t i;
int32_t n;
if (U_FAILURE(*fStatus)) {
return;
}
fTree->findNodes(&tagNodes, RBBINode::tag, *fStatus);
if (U_FAILURE(*fStatus)) {
... | false | false | false | false | false | 0 |
make_word_flags (w, string)
WORD_DESC *w;
const char *string;
{
register int i;
size_t slen;
DECLARE_MBSTATE;
i = 0;
slen = strlen (string);
while (i < slen)
{
switch (string[i])
{
case '$':
w->flags |= W_HASDOLLAR;
break;
case '\\':
break; /* continue the loop */
case '\''... | false | false | false | false | false | 0 |
update_samplers(struct st_context *st)
{
const struct gl_context *ctx = st->ctx;
update_shader_samplers(st,
PIPE_SHADER_FRAGMENT,
&ctx->FragmentProgram._Current->Base,
ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
... | false | false | false | false | false | 0 |
readlinkat (fd, path, buf, len)
int fd;
const char *path;
char *buf;
size_t len;
{
int result;
#ifdef __NR_readlinkat
# ifndef __ASSUME_ATFCTS
if (__have_atfcts >= 0)
# endif
{
result = INLINE_SYSCALL (readlinkat, 4, fd, path, buf, len);
# ifndef __ASSUME_ATFCTS
if (result == -1... | false | false | false | false | false | 0 |
elm_datetime_field_limit_set(Evas_Object *obj,
Elm_Datetime_Field_Type fieldtype,
int min,
int max)
{
Datetime_Field *field;
ELM_DATETIME_CHECK(obj);
ELM_DATETIME_DATA_GET(obj, sd);
if (fieldtype >= ELM_DATETIME_AMPM) r... | false | false | false | false | false | 0 |
change_child_ptr(ldns_rbnode_t* child, ldns_rbnode_t* old, ldns_rbnode_t* new)
{
if(child == LDNS_RBTREE_NULL) return;
if(child->parent == old) child->parent = new;
} | false | false | false | false | false | 0 |
create(void const * const buf,const unsigned int size,
const EncodeType encodetype, const GUTF8String &encoding)
{
return encoding.length()
?create(buf,size,encodetype)
:create(buf,size,encoding);
} | false | false | false | false | false | 0 |
on_query_data_loaded (SoupSession *session,
SoupMessage *query,
gpointer user_data)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data);
GError *error = NULL;
char *contents;
GeocodePlace *ret;
GHashTable *attributes;
if (query->status_code != S... | false | false | false | false | false | 0 |
proc_mutex_mech(apr_proc_mutex_t *pmutex)
{
const char *mechname = apr_proc_mutex_name(pmutex);
if (!strcmp(mechname, "sysvsem")) {
return APR_LOCK_SYSVSEM;
}
else if (!strcmp(mechname, "flock")) {
return APR_LOCK_FLOCK;
}
return APR_LOCK_DEFAULT;
} | false | false | false | false | false | 0 |
log_wep(struct wstate *ws, struct ieee80211_frame* wh, int len)
{
int rd;
struct pcap_pkthdr pkh;
struct timeval tv;
unsigned char *body = (unsigned char*) (wh+1);
memset(&pkh, 0, sizeof(pkh));
pkh.caplen = pkh.len = len;
if (gettimeofday(&tv, NULL) == -1)
err(1, "gettimeofday()");
pkh.tv_sec = tv.tv_sec;
p... | false | false | false | false | false | 0 |
decide_eye(int pos)
{
int color;
struct eyevalue value;
int attack_point;
int defense_point;
int eyepos;
SGFTree tree;
reset_engine();
silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
color = black_eye[pos].color;
if (!IS_STONE(color)) {
gprintf("The eye at %1m is not of a single color.... | false | false | false | false | false | 0 |
statusbars_remove_unvisible(MAIN_WINDOW_REC *window)
{
GSList *tmp, *next;
for (tmp = window->statusbars; tmp != NULL; tmp = next) {
STATUSBAR_REC *bar = tmp->data;
next = tmp->next;
if (!STATUSBAR_IS_VISIBLE(bar->config, window))
statusbar_destroy(bar);
}
} | false | false | false | false | false | 0 |
hp100_get_stats(struct net_device *dev)
{
unsigned long flags;
int ioaddr = dev->base_addr;
struct hp100_private *lp = netdev_priv(dev);
#ifdef HP100_DEBUG_B
hp100_outw(0x4215, TRACE);
#endif
spin_lock_irqsave(&lp->lock, flags);
hp100_ints_off(); /* Useful ? Jean II */
hp100_update_stats(dev);
hp100_ints_on()... | false | false | false | false | false | 0 |
context_lex_detect_nonnegative_parameters(
struct isl_context *context, struct isl_tab *tab)
{
struct isl_context_lex *clex = (struct isl_context_lex *)context;
struct isl_tab_undo *snap;
if (!tab)
return NULL;
snap = isl_tab_snap(clex->tab);
if (isl_tab_push_basis(clex->tab) < 0)
goto error;
tab = tab_de... | false | false | false | false | false | 0 |
cmd_mode(char *arg)
{
lcase(arg);
if (!strcmp(arg, "reader")) {
prot_printf(nntp_out, "%u", (nntp_capa & MODE_READ) ? 200 : 201);
if (config_serverinfo || nntp_authstate) {
prot_printf(nntp_out, " %s", config_servername);
}
if (nntp_authstate || (config_serverinfo == IMAP_ENUM_SERVERINFO_ON)) {
p... | false | false | false | false | false | 0 |
texture_lo_ptr(const Al3DTag *tag)
{
const gchar *p = strstr(tag->key, "LoPtr");
if (!p || p == tag->key)
return NULL;
return gwy_strreplace(tag->key, "LoPtr", "", 1);
} | false | false | false | false | false | 0 |
initInstrument(int instr_type, int sample_rate) {
struct instr *in = (struct instr *) malloc(sizeof(struct instr));
Stk::setSampleRate(sample_rate);
switch(instr_type) {
case CLARINET:
in->instrObjPtr = new Clarinet(10.0);
break;
case SAXOFONY:
in->instrObjPtr = new Saxofony(10.0);
break;
... | false | false | false | false | false | 0 |
pwm_fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state)
{
struct pwm_fan_ctx *ctx = cdev->devdata;
int ret;
if (!ctx || (state > ctx->pwm_fan_max_state))
return -EINVAL;
if (state == ctx->pwm_fan_state)
return 0;
ret = __set_pwm(ctx, ctx->pwm_fan_cooling_levels[state]);
if (ret) {
... | false | false | false | false | false | 0 |
pattern_accum_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
const gs_imager_state *pis,
const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
gx_device_pattern_accum *con... | false | false | false | false | false | 0 |
searchForFace(const vector<CPolyhedron::TPolyhedronFace> &fs,uint32_t v1,uint32_t v2,uint32_t v3) {
for (vector<CPolyhedron::TPolyhedronFace>::const_iterator it=fs.begin();it!=fs.end();++it) {
const vector<uint32_t> &f=it->vertices;
size_t hmf=0;
for (vector<uint32_t>::const_iterator it2=f.begin();it2!=f.end();+... | false | false | false | false | false | 0 |
cd_device_dbus_emit_property_changed (CdDevice *device,
const gchar *property_name,
GVariant *property_value)
{
GVariantBuilder builder;
GVariantBuilder invalidated_builder;
/* not yet connected */
if (device->priv->connection == NULL)
return;
/* build the dict */
g_variant_builder_init (&... | false | false | false | false | false | 0 |
skip_top_folders (char * name)
{
static const char * home;
static int len;
if (! home)
{
home = g_get_home_dir ();
len = strlen (home);
if (len > 0 && home[len - 1] == G_DIR_SEPARATOR)
len --;
}
#ifdef _WIN32
if (! g_ascii_strncasecmp (name, home, len) && n... | false | false | false | false | false | 0 |
RunProgram(int mode, char *Command) {
char Cmd[1024];
strlcpy(Cmd, XShellCommand, sizeof(Cmd));
if (*Command == 0) // empty string = shell
strlcat(Cmd, " -ls &", sizeof(Cmd));
else {
strlcat(Cmd, " -e ", sizeof(Cmd));
strlcat(Cmd, Command, sizeof(Cmd));
if (mode == RUN... | false | false | false | false | false | 0 |
declare_global(lexid *name, decl *value)
{
ste *p = find(name);
// ste **pp = NULL;
#ifdef DEBUG_SYMTAB
printf("Declaring %s globally in scope %d, depth %d\n",
name->getname(),
scopes[globalscope],
globalscope);
#endif
if ( p != NULL && p->getscope() == globalscope )
{
Error.Error ("%s already ... | false | false | false | false | false | 0 |
pcm512x_suspend(struct device *dev)
{
struct pcm512x_priv *pcm512x = dev_get_drvdata(dev);
int ret;
ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER,
PCM512x_RQPD, PCM512x_RQPD);
if (ret != 0) {
dev_err(dev, "Failed to request power down: %d\n", ret);
return ret;
}
ret = regulator_bulk_disable(A... | false | false | false | false | false | 0 |
rbthash_table_init (int buckets, rbt_hasher_t hfunc,
rbt_data_destroyer_t dfunc,
unsigned long expected_entries,
struct mem_pool *entrypool)
{
rbthash_table_t *newtab = NULL;
int ret = -1;
if (!hfunc) {
... | false | false | false | false | false | 0 |
createSceneNodeImpl(const String& name)
{
return OGRE_NEW PCZSceneNode(this, name);
} | false | false | false | false | false | 0 |
ip_to_uint(const char* ip)
{
unsigned int IP[4]; /* 4 octets for IP address */
if ((sscanf(ip, "%u.%u.%u.%u", &IP[0], &IP[1], &IP[2], &IP[3]) == 4) && VALID_IP(IP))
return BUILD_IP(IP);
else
return 0;
} | false | false | false | false | false | 0 |
unquotestrdup(char *s)
{
char *t, *ret;
int quoting;
ret = s = strdup(s); /* return unquoted copy */
if(ret == nil)
return ret;
quoting = 0;
t = s; /* s is output string, t is input string */
while(*t!='\0' && (quoting || (*t!=' ' && *t!='\t'))){
if(*t != '\''){
*s++ = *t++;
continue;
}
/* *t is a... | 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.