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 |
|---|---|---|---|---|---|---|
init_key(uint8_t key[34], const string& key_file)
{
if ( key_file.empty() )
read_key(key, "/dev/random");
else
{
if ( file_exists(key_file.c_str()) )
read_key(key, key_file.c_str());
else
{
printf("Generating key...");
read_key(key, "/dev/random");
write_key(key, key_file.c_str());
printf("... | false | false | false | false | false | 0 |
write(const char *data, unsigned int size)
{
int n;
/*
printf("WRITE(%3d): ", size);
for (int i = 0; i < size; i++)
printf("0x%x %c", data[i], data[i]);
printf("\n");
*/
if (myPort >= 0)
{
n = ::write(myPort, data, size);
if (n == -1)
{
if (errno == EAGAIN) /* try it again, fo... | false | false | false | false | false | 0 |
storeCleanupDoubleCheck(StoreEntry * e)
{
SwapDir *SD = &Config.cacheSwap.swapDirs[e->swap_dirn];
if (SD->dblcheck)
return (SD->dblcheck(SD, e));
return 0;
} | false | false | false | false | false | 0 |
AddFeatures(
const Word* leftWord, const Word* rightWord, const FactorList& factors, const string& side,
ScoreComponentCollection* scores) const {
for (size_t i = 0; i < factors.size(); ++i) {
ostringstream name;
name << side << ":";
name << factors[i];
name << ":";
if (leftWord) {
... | false | false | false | false | false | 0 |
set_txidle(MGSLPC_INFO * info, int idle_mode)
{
unsigned long flags;
if (debug_level >= DEBUG_LEVEL_INFO)
printk("set_txidle(%s,%d)\n", info->device_name, idle_mode);
spin_lock_irqsave(&info->lock, flags);
info->idle_mode = idle_mode;
tx_set_idle(info);
spin_unlock_irqrestore(&info->lock, flags);
return 0;
} | false | false | false | false | false | 0 |
avail_expr_eq (const void *p1, const void *p2)
{
gimple stmt1 = ((const struct expr_hash_elt *)p1)->stmt;
const struct hashable_expr *expr1 = &((const struct expr_hash_elt *)p1)->expr;
const struct expr_hash_elt *stamp1 = ((const struct expr_hash_elt *)p1)->stamp;
gimple stmt2 = ((const struct expr_hash_elt *)p... | false | false | false | false | false | 0 |
bcm_sysport_suspend(struct device *d)
{
struct net_device *dev = dev_get_drvdata(d);
struct bcm_sysport_priv *priv = netdev_priv(dev);
unsigned int i;
int ret = 0;
u32 reg;
if (!netif_running(dev))
return 0;
bcm_sysport_netif_stop(dev);
phy_suspend(priv->phydev);
netif_device_detach(dev);
/* Disable Un... | false | false | false | false | false | 0 |
push_byte(int8_t b)
{
int16_t n = b;
uint16_t value = (n & 0xffff);
CHECK_STACK();
fprintf(out, " li r%d, 0x%02x\n", REG_STACK(reg), value);
reg++;
return 0;
} | false | false | false | false | false | 0 |
CalcConUI(Const_table *lCon, Const_table *rCon, qr_operator ope,
int invertl, int invertr)
{
unsigned int l=0, r=0;
l = const_table_unsigned_value(lCon);
r = const_table_unsigned_value(rCon);
switch(ope){
case OPE_ADD:
if(!(invertl) && !(invertr)) return l + r;
if(!(invertl) && invertr) return... | false | false | false | false | false | 0 |
gst_rtsp_media_seek (GstRTSPMedia * media, GstRTSPTimeRange * range)
{
GstSeekFlags flags;
gboolean res;
gint64 start, stop;
GstSeekType start_type, stop_type;
g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE);
g_return_val_if_fail (range != NULL, FALSE);
if (range->unit != GST_RTSP_RANGE_NPT)
... | false | false | false | false | false | 0 |
ReadPersistent(const int fd, void *buf, const size_t count) {
CHECK_GE(fd, 0);
char *buf0 = reinterpret_cast<char *>(buf);
ssize_t num_bytes = 0;
while (num_bytes < count) {
ssize_t len;
NO_INTR(len = read(fd, buf0 + num_bytes, count - num_bytes));
if (len < 0) { // There was an error other than EI... | false | false | false | false | false | 0 |
ensureParameterArrayAllocated(Parameter *currentArray) {
if (currentArray == NULL)
currentArray = allocateParameterArray(MAXENTITY);
else
clearParameterArray(currentArray);
return currentArray;
} | false | false | false | false | false | 0 |
H5Zregister(const void *cls)
{
const H5Z_class2_t *cls_real = (const H5Z_class2_t *) cls; /* "Real" class pointer */
H5Z_class2_t cls_new; /* Translated class struct */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "*x", cls... | false | false | false | false | false | 0 |
knh_write_mline(CTX ctx, kOutputStream *w, kmethodn_t mn, kline_t uline)
{
kuri_t uri = ULINE_uri(uline);
kuintptr_t line = ULINE_line(uline);
if(uline != 0 && uri != URI_unknown && line != 0) {
if(mn == MN_) {
knh_write_cline(ctx, w, FILENAME__(uri), line);
}
else {
knh_putc(ctx, w, '(');
knh_write_m... | false | false | false | false | false | 0 |
setIdColAcol() {
// Set flavours.
setId( id1, id2, id3Sav, id4Sav);
// Set color flow (random for now)
double R = rndmPtr->flat();
if (R < 0.5) setColAcol( 1, 2, 2, 3, 1, 0, 0, 3);
else setColAcol( 1, 2, 3, 1, 3, 0, 0, 2);
} | false | false | false | false | false | 0 |
tree_view_button_press_event (GtkTreeView *view,
GdkEventButton *event,
GgdDoctypeSelector *selector)
{
gboolean handled = FALSE;
/* Ignore double-clicks and triple-clicks */
if (event->button == 3 && event->type == GDK_BUTTON_PRESS) {
... | false | false | false | false | false | 0 |
CheckMissileImpact(mobj_t * mobj)
{
int i;
if (!numspechit || !(mobj->flags & MF_MISSILE) || !mobj->target)
{
return;
}
if (!mobj->target->player)
{
return;
}
for (i = numspechit - 1; i >= 0; i--)
{
P_ShootSpecialLine(mobj->target, spechit[i]);
}
} | false | false | false | false | false | 0 |
ferode_1_29(l_uint32 *datad,
l_int32 w,
l_int32 h,
l_int32 wpld,
l_uint32 *datas,
l_int32 wpls)
{
l_int32 i;
register l_int32 j, pwpls;
register l_uint32 *sptr, *dptr;
l_int32 wpls2, wpls3;
wpls2 = 2 * wpls;
w... | false | false | false | false | false | 0 |
dump_type (tree t, int flags)
{
if (t == NULL_TREE)
return;
if (TYPE_PTRMEMFUNC_P (t))
goto offset_type;
switch (TREE_CODE (t))
{
case UNKNOWN_TYPE:
pp_identifier (cxx_pp, "<unknown type>");
break;
case TREE_LIST:
/* A list of function parms. */
dump_parameters (t, ... | false | false | false | false | false | 0 |
mailimap_date_day_fixed_send(mailstream * fd, int day)
{
int r;
if (day < 10) {
r = mailimap_space_send(fd);
if (r != MAILIMAP_NO_ERROR)
return r;
r = mailimap_number_send(fd, day);
if (r != MAILIMAP_NO_ERROR)
return r;
return MAILIMAP_NO_ERROR;
}
else
return mailimap_numb... | false | false | false | false | false | 0 |
lzma_upack_esi_54(struct lzmastate *p, uint32_t old_eax, uint32_t *old_ecx, char **old_edx, uint32_t *retval, char *bs, uint32_t bl)
{
uint32_t ret, loc_eax = old_eax;
*old_ecx = ((*old_ecx)&0xffffff00)|8;
ret = lzma_upack_esi_00 (p, *old_edx, bs, bl);
*old_edx = ((*old_edx) + 4);
loc_eax = (loc_eax&0xffffff00)|1... | false | false | false | false | false | 0 |
dce_v8_0_audio_init(struct amdgpu_device *adev)
{
int i;
if (!amdgpu_audio)
return 0;
adev->mode_info.audio.enabled = true;
if (adev->asic_type == CHIP_KAVERI) /* KV: 4 streams, 7 endpoints */
adev->mode_info.audio.num_pins = 7;
else if ((adev->asic_type == CHIP_KABINI) ||
(adev->asic_type == CHIP_MULLIN... | false | false | false | false | false | 0 |
gtkaml_namespace_visitor_get_using_directives (GtkamlNamespaceVisitor* self) {
ValaList* result = NULL;
ValaList* _tmp0_;
ValaList* _tmp1_;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->using_directives;
_tmp1_ = _vala_iterable_ref0 (_tmp0_);
result = _tmp1_;
return result;
} | false | false | false | false | false | 0 |
query_1_0_0(lam_ssi_t *coll, MPI_Comm comm, int *priority)
{
const lam_ssi_coll_actions_1_0_0_t *actions100;
lam_ssi_coll_1_0_0_t *coll100 = (lam_ssi_coll_1_0_0_t *) coll;
actions100 = coll100->lsc_query(comm, priority);
if (actions100 != NULL)
convert_actions_1_0_0_to_1_1_0(actions100, &actions110);
r... | false | false | false | false | false | 0 |
_upload_file (SwServiceSmugmug *self,
MediaType upload_type,
const gchar *filename,
GHashTable *extra_fields,
RestProxyCallUploadCallback upload_cb,
GError **error)
{
SwServiceSmugmugPrivate *priv = self->priv;
RestProxyCall *call = NULL;
RestP... | false | false | false | false | false | 0 |
plOptUsage(void)
{
if (usage == NULL)
fprintf(stderr, "\nUsage:\n %s [options]\n", program);
else
fputs(usage, stderr);
Syntax();
fprintf(stderr, "\n\nType %s -h for a full description.\n\n",
program);
} | false | false | false | false | false | 0 |
bogons_load(FILE *f)
{
char line[1024];
uint32 ip, netmask;
int linenum = 0;
int bits;
iprange_err_t error;
filestat_t buf;
bogons_db = iprange_new();
if (-1 == fstat(fileno(f), &buf)) {
g_warning("cannot stat %s: %m", bogons_file);
} else {
bogons_mtime = buf.st_mtime;
}
while (fgets(line, sizeof line... | false | false | false | false | false | 0 |
vlan_free_res(struct mlx4_dev *dev, int slave, int op, int cmd,
u64 in_param, u64 *out_param, int port)
{
struct mlx4_priv *priv = mlx4_priv(dev);
struct mlx4_slave_state *slave_state = priv->mfunc.master.slave_state;
int err = 0;
port = mlx4_slave_convert_port(
dev, slave, port);
if (port < 0)
retur... | false | false | false | false | false | 0 |
GetRecord(const char *table)
{
vtkSQLQuery *query = this->GetQueryInstance();
vtkStdString text("PRAGMA table_info ('");
text += table;
text += "')";
query->SetQuery(text.c_str() );
bool status = query->Execute();
if (!status)
{
vtkErrorMacro(<< "GetRecord(" << table << "): Database returned erro... | false | false | false | false | false | 0 |
gnm_xml_prep_style_parser (GsfXMLIn *xin,
xmlChar const **attrs,
GnmXmlStyleHandler handler,
gpointer user)
{
static GsfXMLInNode dtd[] = {
GSF_XML_IN_NODE (STYLE_STYLE, STYLE_STYLE, GNM, "Style", GSF_XML_NO_CONTENT, &xml_sax_style_start, NULL),
/* Nodes added below. */
GSF_XML_IN_NODE_END
};... | false | false | false | false | false | 0 |
get_adc_configmask(unsigned int reg)
{
if (mValidCfgBits <= 0xf) // use config bit table
{
return (m_configuration_bits[(reg >> mCfgBitShift) & mValidCfgBits]);
}
else // register directly gives Analog ports (18f1220)
{
return (~(reg >> mCfgBitShift) & mValidCfgBits);
}
} | false | false | false | false | false | 0 |
pio_handler_set(Pio *p_pio, uint32_t ul_id, uint32_t ul_mask,
uint32_t ul_attr, void (*p_handler) (uint32_t, uint32_t))
{
struct s_interrupt_source *pSource;
if (gs_ul_nb_sources >= MAX_INTERRUPT_SOURCES)
return 1;
/* Define new source */
pSource = &(gs_interrupt_sources[gs_ul_nb_sources]);
pSource->id = ul_... | false | false | false | false | false | 0 |
LM93_INTERVAL_TO_REG(long interval)
{
int i;
for (i = 0; i < 9; i++)
if (interval <= lm93_interval_map[i])
break;
/* can fall through with i==9 */
return (u8)i;
} | false | false | false | false | false | 0 |
set_syserr(n, name)
int n;
const char *name;
{
VALUE error;
if (!st_lookup(syserr_tbl, n, &error)) {
error = rb_define_class_under(rb_mErrno, name, rb_eSystemCallError);
rb_define_const(error, "Errno", INT2NUM(n));
st_add_direct(syserr_tbl, n, error);
}
else {
rb_define_const(rb_mErrno, nam... | false | false | false | false | false | 0 |
style_shape_get (struct style *style, gchar *name)
{
START_FUNC
GSList *item=style->shapes;
struct shape *ret=NULL;
if (name) {
while (item && strcmp(((struct shape *)item->data)->name, name)) item=g_slist_next(item);
if (item) ret=(struct shape *)item->data;
else {
flo_warn(_("Shape %s doesn't exist for s... | false | false | false | false | false | 0 |
fd_ref (fd_t *fd)
{
fd_t *refed_fd = NULL;
if (!fd) {
gf_log_callingfn ("fd", GF_LOG_ERROR, "null fd");
return NULL;
}
LOCK (&fd->inode->lock);
refed_fd = __fd_ref (fd);
UNLOCK (&fd->inode->lock);
return refed_fd;
} | false | false | false | false | false | 0 |
AxesOrder(int *filter, int *axes, int nDim)
{
int flags[MAX_DIMENSION];
int max, i, j;
memset(flags, 1, nDim*sizeof(int));
for (i = 0; i < nDim; i++)
{
max = -1;
for (j = 0; j < nDim; j++)
if (flags[j] && max < filter[j])
{
axes[i] = j;
max = filter[j];
}
flags[axes[i]... | false | false | false | false | false | 0 |
cyrusdb_convert(const char *fromfname, const char *tofname,
struct cyrusdb_backend *frombackend,
struct cyrusdb_backend *tobackend)
{
struct db *fromdb, *todb;
struct convert_rock cr;
struct txn *fromtid = NULL;
int r;
/* open both databases (create todb) */
r = (frombackend->open... | true | true | false | false | true | 1 |
wstrcmp(s1, s2)
wchar *s1, *s2;
{
while (*s1 && *s1 == *s2)
s1++, s2++;
return (int)(*s1 - *s2);
} | false | false | false | false | false | 0 |
tracker_property_get_table_name (TrackerProperty *property)
{
TrackerPropertyPrivate *priv;
g_return_val_if_fail (TRACKER_IS_PROPERTY (property), NULL);
priv = GET_PRIV (property);
if (!priv->table_name) {
if (tracker_property_get_multiple_values (property)) {
priv->table_name = g_strdup_printf ("%s_%s",
... | false | false | false | false | false | 0 |
OnConnect(talk_base::AsyncPacketSocket* socket) {
ASSERT(socket == socket_);
LOG_J(LS_VERBOSE, this) << "Connection established to "
<< socket->GetRemoteAddress().ToString();
set_connected(true);
} | false | false | false | false | false | 0 |
libewf_sector_range_get(
libewf_sector_range_t *sector_range,
uint64_t *start_sector,
uint64_t *number_of_sectors,
libcerror_error_t **error )
{
static char *function = "libewf_sector_range_get";
if( sector_range == NULL )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
... | false | false | false | false | false | 0 |
__qla4_8xxx_minidump_process_rdmem(struct scsi_qla_host *ha,
struct qla8xxx_minidump_entry_hdr *entry_hdr,
uint32_t **d_ptr)
{
uint32_t r_addr, r_value, r_data;
uint32_t i, j, loop_cnt;
struct qla8xxx_minidump_entry_rdmem *m_hdr;
unsigned long flags;
uint32_t *data_ptr = *d_ptr;
DEBUG2(ql4_printk(KERN_IN... | false | false | false | false | false | 0 |
create_edge_and_update_destination_phis (struct redirection_data *rd,
basic_block bb)
{
edge e = make_edge (bb, rd->outgoing_edge->dest, EDGE_FALLTHRU);
rescan_loop_exit (e, true, false);
e->probability = REG_BR_PROB_BASE;
e->count = bb->count;
if (rd->outgoing_edge->aux)
{
e->aux = XNEWVEC ... | false | false | false | false | false | 0 |
build_tools_set_enabled (BuildTools* self, gint tool_num, gboolean enabled) {
gint _tmp0_ = 0;
gboolean _tmp1_ = FALSE;
BuildTool tool = {0};
GeeLinkedList* _tmp2_ = NULL;
gint _tmp3_ = 0;
gpointer _tmp4_ = NULL;
BuildTool* _tmp5_ = NULL;
BuildTool _tmp6_ = {0};
BuildTool _tmp7_ = {0};
BuildTool _tmp8_ = {0};... | false | false | false | false | false | 0 |
Description()
{
//Adds the SMARTS string to the description
static string txt;
txt = _descr;
txt += "\n\t SMARTS: ";
txt += _smarts;
txt += "\nSmartsDescriptor is definable";
return txt.c_str();
} | false | false | false | false | false | 0 |
job_signal_status (job)
int job;
{
register PROCESS *p;
WAIT s;
p = jobs[job]->pipe;
do
{
s = p->status;
if (WIFSIGNALED(s) || WIFSTOPPED(s))
break;
p = p->next;
}
while (p != jobs[job]->pipe);
return s;
} | false | false | false | false | false | 0 |
internet_address_cat (CamelAddress *dest,
CamelAddress *source)
{
gint i;
g_assert (CAMEL_IS_INTERNET_ADDRESS (source));
for (i = 0; i < source->addresses->len; i++) {
struct _address *addr = g_ptr_array_index (source->addresses, i);
camel_internet_address_add ((CamelInternetAddress *) de... | false | false | false | false | false | 0 |
ng_ratio_fixup(int *width, int *height, int *xoff, int *yoff)
{
int h = *height;
int w = *width;
if (0 == ng_ratio_x || 0 == ng_ratio_y)
return;
if (w * ng_ratio_y < h * ng_ratio_x) {
*height = *width * ng_ratio_y / ng_ratio_x;
if (yoff)
*yoff += (h-*height)/2;
} else if (w * ng_ratio_y > ... | false | false | false | false | false | 0 |
setflags( int argc, char **argv, char *version )
/*----------------------------------------------------------------------------*/
/******************************************************************************/
/* Name: setflags */
/* Function: read flags f... | false | false | false | false | false | 0 |
dime_quien_soy( void )
{
int tmp;
tmp = ((cliente.random<<1 ) ^ (cliente.random>>1)) % rnombres;
if(tmp < 0)
tmp=-tmp;
strncpy( cliente.mi_nombre, robot_nombres[tmp].nombre, sizeof(cliente.mi_nombre) );
cliente.ai = robot_nombres[tmp].ai;
} | false | false | false | false | false | 0 |
dpms_show(struct device *device,
struct device_attribute *attr,
char *buf)
{
struct drm_connector *connector = to_drm_connector(device);
int dpms;
dpms = READ_ONCE(connector->dpms);
return snprintf(buf, PAGE_SIZE, "%s\n",
drm_get_dpms_name(dpms));
} | false | false | false | false | false | 0 |
HpmfwupgValidateImageIntegrity(struct HpmfwupgUpgradeCtx *pFwupgCtx)
{
struct HpmfwupgImageHeader *pImageHeader = (struct HpmfwupgImageHeader*)pFwupgCtx->pImageData;
md5_state_t ctx;
static unsigned char md[HPMFWUPG_MD5_SIGNATURE_LENGTH];
unsigned char *pMd5Sig = pFwupgCtx->pImageData
+ (pFwupgCtx->imageSize - HP... | true | true | false | false | false | 1 |
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int p1, blkn;
BITREAD_STATE_VARS;
/* Process restart marker if needed; may have to suspend */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
if (! ... | false | false | false | false | false | 0 |
gst_buffer_memcmp (GstBuffer * buffer, gsize offset, gconstpointer mem,
gsize size)
{
gsize i, len;
const guint8 *ptr = mem;
gint res = 0;
g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
g_return_val_if_fail (mem != NULL, 0);
GST_CAT_LOG (GST_CAT_BUFFER,
"buffer %p, offset %" G_GSIZE_FORMAT ",... | false | false | false | false | false | 0 |
seckey_ExtractPublicKey(const CERTSubjectPublicKeyInfo *spki)
{
SECKEYPublicKey *pubk;
SECItem os, newOs, newParms;
SECStatus rv;
PLArenaPool *arena;
SECOidTag tag;
arena = PORT_NewArena (DER_DEFAULT_CHUNKSIZE);
if (arena == NULL)
return NULL;
pubk = (SECKEYPublicKey *) PORT_ArenaZAll... | false | false | false | false | false | 0 |
sheet_style_foreach (Sheet const *sheet, GFunc func, gpointer user_data)
{
GSList *styles;
g_return_if_fail (IS_SHEET (sheet));
g_return_if_fail (sheet->style_data != NULL);
styles = sh_all_styles (sheet->style_data->style_hash);
styles = g_slist_sort (styles, (GCompareFunc)gnm_style_cmp);
g_slist_foreach (styl... | false | false | false | false | false | 0 |
numaGetHistogramStats(NUMA *nahisto,
l_float32 startx,
l_float32 deltax,
l_float32 *pxmean,
l_float32 *pxmedian,
l_float32 *pxmode,
l_float32 *pxvariance)
{
PROCNAME("num... | false | false | false | false | false | 0 |
Init(const char* name, Interactor* i) {
if (name != nil) {
SetInstance(name);
}
enabled_ = true;
parent_ = nil;
state_ = new ControlState;
state_->Attach(this);
input = new Sensor;
input->Catch(EnterEvent);
input->Catch(LeaveEvent);
input->Catch(DownEvent);
input->Catch(UpEv... | false | false | false | false | false | 0 |
test_config_write__delete_value_at_specific_level(void)
{
git_config *cfg, *cfg_specific;
int32_t i;
cl_git_pass(git_config_open_ondisk(&cfg, "config15"));
cl_git_pass(git_config_get_int32(&i, cfg, "core.dummy2"));
cl_assert(i == 7);
git_config_free(cfg);
cl_git_pass(git_config_new(&cfg));
cl_git_pass(git_con... | false | false | false | false | false | 0 |
swf_bifs_action(SWFReader *read, SWFAction *act)
{
GF_List *dst;
MFURL url;
SFURL sfurl;
Bool bval;
GF_Node *n;
Double time;
dst = read->bifs_au->commands;
if (read->btn) {
if (act->button_mask & GF_SWF_COND_OVERUP_TO_OVERDOWN) dst = read->btn_active;
else if (act->button_mask & GF_SWF_COND_IDLE_TO_OVERUP)... | false | true | false | false | true | 1 |
updatepidfile(void)
{
int fd;
char buf[42];
if (SNCHECK(snprintf(buf, sizeof buf, "%lu\n",
(unsigned long) getpid()), sizeof buf)) {
return;
}
if (unlink(pid_file) != 0 && errno != ENOENT) {
return;
}
if ((fd = open(pid_file, O_CREAT | O_WRONLY | O_T... | true | true | false | false | true | 1 |
draw(GeometryBuffer& buffer,
const Vector2& position,
const ColourRect* mod_colours,
const Rect* clip_rect) const
{
Vector2 draw_pos(position);
for (size_t i = 0; i < d_renderedString->getLineCount(); ++i)
{
... | false | false | false | false | false | 0 |
adi_init_input(struct adi *adi, struct adi_port *port, int half)
{
struct input_dev *input_dev;
char buf[ADI_MAX_NAME_LENGTH];
int i, t;
adi->dev = input_dev = input_allocate_device();
if (!input_dev)
return -ENOMEM;
t = adi->id < ADI_ID_MAX ? adi->id : ADI_ID_MAX;
snprintf(buf, ADI_MAX_PHYS_LENGTH, adi_nam... | true | true | false | false | true | 1 |
sanitize_path(struct request *r)
{
char *p, *q, c;
enum {
sp_normal,
sp_slash,
sp_slashdot,
sp_slashdotdot
} s;
if (debug)
log_d("sanitize_path: old path: %s", r->path);
p = q = r->path;
s = sp_normal;
do {
c = *p++;
switch (s) {
case sp_normal:
if (c == '/')
s = sp_slash;
break;
cas... | false | false | false | false | false | 0 |
skipUWhiteSpace(const UnicodeString& text, int32_t pos) {
while (pos < text.length()) {
UChar32 c = text.char32At(pos);
if (!u_isUWhiteSpace(c)) {
break;
}
pos += U16_LENGTH(c);
}
return pos;
} | false | false | false | false | false | 0 |
MouseInMail(int x, int y)
{
int maill = win_width - stwin_width + clock_width + 2;
int mailr = win_width - (do_check_mail ? 0 : 3);
return (x>=maill && x<mailr && y>1 && y<RowHeight-2);
} | false | false | false | false | false | 0 |
cselib_record_autoinc_cb (rtx mem ATTRIBUTE_UNUSED, rtx op ATTRIBUTE_UNUSED,
rtx dest, rtx src, rtx srcoff, void *arg)
{
struct cselib_record_autoinc_data *data;
data = (struct cselib_record_autoinc_data *)arg;
data->sets[data->n_sets].dest = dest;
if (srcoff)
data->sets[data->n_sets].src = gen_rtx_P... | false | false | false | false | false | 0 |
fcsSetBackupActiveFlag(
HFDB hDb,
FLMBOOL bBackupActive)
{
FDB * pDb = (FDB *)hDb;
RCODE rc = FERR_OK;
flmAssert( IsInCSMode( hDb));
fdbInitCS( pDb);
CS_CONTEXT * pCSContext = pDb->pCSContext;
FCL_WIRE Wire( pCSContext, pDb);
if( !pCSContext->bConnectionGood)
{
rc = RC_SET( FERR_BAD_SERVER_C... | false | false | false | false | false | 0 |
e1000_setup_link_82543(struct e1000_hw *hw)
{
u32 ctrl_ext;
s32 ret_val;
u16 data;
DEBUGFUNC("e1000_setup_link_82543");
/*
* Take the 4 bits from NVM word 0xF that determine the initial
* polarity value for the SW controlled pins, and setup the
* Extended Device Control reg with that info.
* This is nee... | false | false | false | false | false | 0 |
load(void)
{
ACodeHeader tmphdr;
Aword crc = 0;
char err[100];
readTemporaryHeader(&tmphdr);
checkVersion(&tmphdr);
/* Allocate and load memory */
if (littleEndian())
reverseHdr(&tmphdr);
if (tmphdr.size <= sizeof(ACodeHeader)/sizeof(Aword))
syserr("Malformed game... | false | false | false | false | true | 1 |
ztype0_adjust_FDepVector(gs_font_type0 * pfont)
{
gs_memory_t *mem = pfont->memory;
/* HACK: We know the font was allocated by the interpreter. */
gs_ref_memory_t *imem = (gs_ref_memory_t *)mem;
gs_font **pdep = pfont->data.FDepVector;
ref newdep;
uint fdep_size = pfont->data.fdep_size;
ref ... | false | false | false | false | false | 0 |
status_touch(void)
{
unsigned i;
for (i = 0; i < SSZ; i++) {
status_line[i].changed = True;
(void) memset(status_line[i].d2b, 0,
status_line[i].len * sizeof(XChar2b));
}
status_changed = True;
} | false | false | false | false | false | 0 |
Perl_filter_read(pTHX_ int idx, SV *buf_sv, int maxlen)
{
dVAR;
filter_t funcp;
SV *datasv = NULL;
/* This API is bad. It should have been using unsigned int for maxlen.
Not sure if we want to change the API, but if not we should sanity
check the value here. */
unsigned int correct_le... | false | false | false | false | false | 0 |
_gss_import_export_name(OM_uint32 *minor_status,
const gss_buffer_t input_name_buffer,
gss_name_t *output_name)
{
OM_uint32 major_status;
unsigned char *p = input_name_buffer->value;
size_t len = input_name_buffer->length;
size_t t;
gss_OID_desc mech_oid;
gssapi_mech_interface m;
struct _gss_name *name;
... | false | false | false | false | false | 0 |
skl_get_queue_index(struct skl_module_pin *mpin,
struct skl_module_inst_id id, int max)
{
int i;
for (i = 0; i < max; i++) {
if (mpin[i].id.module_id == id.module_id &&
mpin[i].id.instance_id == id.instance_id)
return i;
}
return -EINVAL;
} | false | false | false | false | false | 0 |
cb_sheet_label_drag_end (GtkWidget *widget, GdkDragContext *context,
WBCGtk *wbcg)
{
GtkWidget *arrow;
g_return_if_fail (IS_WORKBOOK_CONTROL (wbcg));
/* Destroy the arrow. */
arrow = g_object_get_data (G_OBJECT (widget), "arrow");
gtk_widget_destroy (arrow);
g_object_unref (arrow);
g_object_set_data (G_OBJ... | false | false | false | false | false | 0 |
event(QEvent *e)
{
if (e->type() == static_cast<QEvent::Type>(DOMCFResizeEvent)) {
dispatchWindowEvent(EventImpl::RESIZE_EVENT, false, false);
e->accept();
return true;
}
return QObject::event(e);
} | false | false | false | false | false | 0 |
InitPass1()
{
mMax=0.0;
// Integer format tracks require headroom to avoid clipping
// when saved between passes (bug 619)
if (mbNormalize) // don't need to calculate this if only doing one pass.
{
// Up to (gain + 6dB) headroom required for treble boost (experimental).
mPreGain = (dB_treb... | false | false | false | false | false | 0 |
urbs_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
struct dummy_hcd *dum_hcd = hcd_to_dummy_hcd(hcd);
struct urbp *urbp;
size_t size = 0;
unsigned long flags;
spin_lock_irqsave(&dum_hcd->dum->lock, flags);
list_for_each_entry(urbp, &dum_h... | false | false | false | false | false | 0 |
acpi_sbs_init(void)
{
int result = 0;
if (acpi_disabled)
return -ENODEV;
result = acpi_bus_register_driver(&acpi_sbs_driver);
if (result < 0)
return -ENODEV;
return 0;
} | false | false | false | false | false | 0 |
clutter_pan_action_get_interpolated_coords (ClutterPanAction *self,
gfloat *interpolated_x,
gfloat *interpolated_y)
{
ClutterPanActionPrivate *priv;
g_return_if_fail (CLUTTER_IS_PAN_ACTION (self));
priv =... | false | false | false | false | false | 0 |
refresh_choice(struct choice *c)
{
int w=c->w+BUT_BUTSPACE;
int h=dri.dri_Font->ascent+dri.dri_Font->descent+BUT_VSPACE;
XSetForeground(dpy, gc, dri.dri_Pens[TEXTPEN]);
XDrawString(dpy, c->win, gc, BUT_BUTSPACE/2,
dri.dri_Font->ascent+BUT_VSPACE/2, c->text, c->l);
XSetForeground(dpy, gc, dri.dri_Pens[(... | false | false | false | false | false | 0 |
PyEval_GetLocals(void)
{
PyFrameObject *current_frame = PyEval_GetFrame();
if (current_frame == NULL)
return NULL;
PyFrame_FastToLocals(current_frame);
return current_frame->f_locals;
} | false | false | false | false | false | 0 |
e_int_config_mime_edit_done(void *data)
{
E_Config_Dialog_Data *cfdata;
cfdata = data;
if (!cfdata) return;
if (cfdata->edit_dlg)
cfdata->edit_dlg = NULL;
_tlist_cb_change(cfdata);
} | false | false | false | false | false | 0 |
DeleteItem(unsigned char *data, int len) {
int pos = 0, tag;
while (pos < len) {
item *op;
tag = GetInt_String(data+pos); pos += 4;
op = locate_item(tag);
if (op != NULL) {
remove_item(op);
} else {
LOG(LOG_WARNING, "common::DeleteItem", "Cannot ... | false | false | false | false | false | 0 |
CheckNewConnection( void ) const
{
tASSERT( IsOpen() );
int available=-1;
// see if the playback has anything to say
//if ( tRecorder::Playback( recordingSectionConnect, available ) )
// return this;
// always return this when recoring or playback are running
if ( tRecorder::IsRunning(... | false | false | false | false | false | 0 |
notrootedtorooted()
{
node *newbase, *temp;
/* root halfway along leftmost branch of unrooted tree */
/* create a new triad for the new base */
maketemptriad(&newbase,nonodes+1);
/* Take left branch and make it the left branch of newbase */
newbase->next->back = root->next->back;
newbase->next->next->ba... | false | false | false | false | false | 0 |
thread_hash_init(void)
{
int thr_ret;
thr_ret = pthread_key_create (&thread_hash_key, NULL);
g_assert (thr_ret == 0);
thr_ret = pthread_key_create (&thread_attached_key,
thread_attached_exit);
g_assert (thr_ret == 0);
} | false | false | false | false | false | 0 |
nGetMcr2( AT_RANK *nEqArray, AT_RANK n )
{
AT_RANK n1, n2, mcr; /* recursive version is much shorter. */
INCHI_HEAPCHK
n1=nEqArray[(int)n];
if ( n == n1 ) {
return n;
}
/* 1st pass: find mcr */
while ( n1 != (n2=nEqArray[(int)n1])) {
n1 = n2;
}
/* 2nd pass: copy mc... | false | false | false | false | false | 0 |
ll_get_or_alloc_list(wp)
win_T *wp;
{
if (IS_LL_WINDOW(wp))
/* For a location list window, use the referenced location list */
return wp->w_llist_ref;
/*
* For a non-location list window, w_llist_ref should not point to a
* location list.
*/
ll_free_all(&wp->w_llist_ref);
if (wp... | false | false | false | false | false | 0 |
setToAllocation(void)
{
setWidth(m_MyAllocation.width);
if(fp_VerticalContainer::getHeight() != m_MyAllocation.height)
{
//
// clear and delete broken tables before their height changes.
// Doing this clear at this point makes a table flicker when changing
// height but it does remove the last the pixel dirt... | false | false | false | false | false | 0 |
s_T_kill(KILL_NODE *node, ARTICLE *articles, SUBJECT *subj)
{
long n = 0;
while (subj) {
ARTICLE *thr = subj->thread;
int has_unread = THREAD_HAS_UNREAD(subj);
do {
if (has_unread &&
regexec(node->expr_re, subj->subject, 0, NULL, 0) == 0) {
n += mark_thread_read(subj->thread, False, True);
has_u... | false | false | false | false | false | 0 |
expose(XEvent *e) {
Monitor *m;
XExposeEvent *ev = &e->xexpose;
if(ev->count == 0 && (m = wintomon(ev->window)))
drawbar(m);
} | false | false | false | false | false | 0 |
test_links(hid_t fapl)
{
hid_t file; /* File ID */
char obj_name[NAMELEN]; /* Names of the object in group */
ssize_t name_len; /* Length of object's name */
hid_t gid, gid1;
H5G_info_t ginfo; /* Buffer for querying object's info */
hsize_t i;
herr_t ret; /* G... | true | true | true | false | true | 1 |
e_gadcon_popup_new(E_Gadcon_Client *gcc)
{
E_Gadcon_Popup *pop;
Evas_Object *o;
E_Zone *zone;
pop = E_OBJECT_ALLOC(E_Gadcon_Popup, E_GADCON_POPUP_TYPE, _e_gadcon_popup_free);
if (!pop) return NULL;
zone = e_gadcon_client_zone_get(gcc);
pop->win = e_popup_new(zone, 0, 0, 0, 0);
e_popup_layer_set... | false | false | false | false | false | 0 |
gnutls_pkcs11_reinit (void)
{
int rv;
rv = p11_kit_initialize_registered ();
if (rv != CKR_OK)
{
gnutls_assert ();
_gnutls_debug_log ("Cannot initialize registered module: %s\n",
p11_kit_strerror (rv));
return GNUTLS_E_INTERNAL_ERROR;
}
return 0;
} | false | false | false | false | false | 0 |
nfs_page_group_lock(struct nfs_page *req, bool nonblock)
{
struct nfs_page *head = req->wb_head;
WARN_ON_ONCE(head != head->wb_head);
if (!test_and_set_bit(PG_HEADLOCK, &head->wb_flags))
return 0;
if (!nonblock)
return wait_on_bit_lock(&head->wb_flags, PG_HEADLOCK,
TASK_UNINTERRUPTIBLE);
return -EAGAIN... | false | false | false | false | false | 0 |
load_di( const std::string &path, NodeRef dst ) {
// construct list of paths to search
std::string found_path = path;
if (!file_exists(found_path)) {
// in this case, try additional
// paths with the NITRO_DI_PATH var
char *env = getenv ( "NITRO_DI_PATH" );
if (env) {
... | false | false | false | false | false | 0 |
hash_keyval( char const * key, int const size )
{
unsigned int const magic = 2147059363;
unsigned int hash = 0;
unsigned int i;
for ( i = 0; i < size / sizeof( unsigned int ); ++i )
{
unsigned int val;
memcpy( &val, key, sizeof( unsigned int ) );
hash = hash * magic + val;
... | 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.