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 |
|---|---|---|---|---|---|---|
ibft_fill_nic ( struct ibft_nic *nic,
struct ibft_strings *strings,
struct net_device *netdev ) {
struct ll_protocol *ll_protocol = netdev->ll_protocol;
struct in_addr netmask_addr = { 0 };
unsigned int netmask_count = 0;
int rc;
/* Fill in common header */
nic->header.structure_id = IBFT_STRUCTURE_I... | false | false | false | false | false | 0 |
_btn_cb_unload(void *data, void *data2 __UNUSED__)
{
E_Config_Dialog_Data *cfdata = data;
CFModule *cfm;
EINA_LIST_FREE(cfdata->selected.loaded, cfm)
{
if (!cfm->module)
cfm->module = e_module_find(cfm->short_name);
if (cfm->module)
{
e_module_disable(cfm... | false | false | false | false | false | 0 |
fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end)
{
char buf[128];
char *tmp = buf;
int buf_size = sizeof(buf);
int name_len, val_len;
char *s;
int ret = 1;
while (p < end) {
name_len = *p++;
if (name_len >= 128) {
name_len = ((name_len & 0x7f) << 24);
name_len |= (*p++ << 16);
... | true | true | false | false | false | 1 |
operator=(const Coating& coating)
{
int n;
// memory management
n = coating.NumberOfLayers();
if (n != NumberOfLayers()) delete[] temporary_thicknesses;
temporary_thicknesses = new Real[n];
if (number_of_materials != coating.number_of_materials)
{
n = coating.number_of_materials;
ChangeNum... | false | false | false | false | false | 0 |
decrementNbElem() {
m_nbElem--;
if (m_nbElem == 0) {
emit(allElementsEaten());
}
} | false | false | false | false | false | 0 |
EndPointCleanup(ConfClient *pCC)
{
VoipNode *pVoipNode = (VoipNode *) pCC->pVoipNode;
if(pVoipNode != NULL) {
delete pVoipNode;
}
} | false | false | false | false | false | 0 |
handle_error(u16 err, int line, char *filename)
{
if (err)
printk(KERN_WARNING
"in file %s, line %d: HPI error %d\n",
filename, line, err);
return err;
} | false | false | false | false | false | 0 |
demangle_prefix (dm, encode_return_type)
demangling_t dm;
int *encode_return_type;
{
int start = substitution_start (dm);
int nested = 0;
/* ENCODE_RETURN_TYPE is updated as we decend the nesting chain.
After <template-args>, it is set to non-zero; after everything
else it is set to zero. */... | false | false | false | false | false | 0 |
umad2sim_cleanup(void)
{
char path[1024];
unsigned i;
DEBUG("umad2sim_cleanup...\n");
for (i = 0; i < arrsize(devices); i++)
if (devices[i]) {
umad2sim_dev_delete(devices[i]);
devices[i] = NULL;
}
strncpy(path, umad2sim_sysfs_prefix, sizeof(path) - 1);
unlink_dir(path, sizeof(path));
} | false | false | false | false | false | 0 |
getMax() const
{
double r = 0;
for (int i = 0; i < length(); i++) {
if (abs(operator[](i))>r)
r = abs(operator[](i));
}
return r;
} | false | false | false | false | false | 0 |
R3Intersects(const R3Point& point, const R3Ray& ray, RNScalar *hit_t)
{
// Check if ray contains point
if (R3Contains(ray, point)) {
// Point lies on ray
if (hit_t) *hit_t = ray.T(point);
return R3_POINT_CLASS_ID;
}
else {
// Point is not on ray
return RN_NULL_CLASS_ID;
}
} | false | false | false | false | false | 0 |
particles(int icharge, unsigned int imode,int,int) {
if(abs(icharge)!=3) return tPDVector();
tPDVector output(4);
if(imode==1) {
output[0]=getParticleData(ParticleID::piplus);
output[1]=getParticleData(ParticleID::piplus);
output[2]=getParticleData(ParticleID::piminus);
}
else {
output[0]=getP... | false | false | false | false | false | 0 |
doinitrun() {
Baryon1MesonDecayerBase::doinitrun();
if(initialize()) {
_maxweight.clear();
for(unsigned int ix=0;ix<numberModes();++ix) {
if(mode(ix)) _maxweight.push_back(mode(ix)->maxWeight());
else _maxweight.push_back(1.);
}
}
} | false | false | false | false | false | 0 |
getDllName(StringRef &Result) const {
uintptr_t IntPtr = 0;
if (std::error_code EC =
OwningObject->getRvaPtr(ExportTable->NameRVA, IntPtr))
return EC;
Result = StringRef(reinterpret_cast<const char *>(IntPtr));
return std::error_code();
} | false | false | false | false | false | 0 |
draw_grill (Window win, int x)
{
int y = 0;
while (y < WINHEIGHT - 4)
{
y += 3;
draw_dot (win, x + 3, y);
draw_dot (win, x, y);
}
} | false | false | false | false | false | 0 |
attachStream( LogStream *pStream, unsigned int severity )
{
if (!pStream)
return false;
if (0 == severity) {
severity = Logger::Info | Logger::Err | Logger::Warn | Logger::Debugging;
}
for ( StreamIt it = m_StreamArray.begin();
it != m_StreamArray.end();
++it )
{
if ( (*it)->m_pStream == pStream )
{
... | false | false | false | false | false | 0 |
abi16_delete(struct nouveau_object *obj)
{
struct nouveau_drm *drm = nouveau_drm(obj);
if (obj->oclass == NOUVEAU_FIFO_CHANNEL_CLASS) {
struct drm_nouveau_channel_free req;
req.channel = obj->handle;
drmCommandWrite(drm->fd, DRM_NOUVEAU_CHANNEL_FREE,
&req, sizeof(req));
} else {
struct drm_nouveau_gpuobj... | false | false | false | false | false | 0 |
H5G__link_release_table(H5G_link_table_t *ltable)
{
size_t u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(ltable);
/* Release link info, if any */
if(ltable->nlinks > 0) {
/* ... | false | false | false | false | false | 0 |
hashcmp(const unsigned char hashA[INDEX_HASH_WIDTH], const unsigned char hashB[INDEX_HASH_WIDTH])
{
int i = 0;
for(i = 0; i < INDEX_HASH_WIDTH; i++)
{
if(hashA[i] > hashB[i])
return 1;
else if(hashA[i] < hashB[i])
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
mono_wait_handle_get_handle (MonoWaitHandle *handle)
{
static MonoClassField *f_os_handle;
static MonoClassField *f_safe_handle;
if (!f_os_handle && !f_safe_handle) {
f_os_handle = mono_class_get_field_from_name (mono_defaults.manualresetevent_class, "os_handle");
f_safe_handle = mono_class_get_field_from_name ... | false | false | false | false | true | 1 |
krb5_ktf_keytab_size(krb5_context kcontext, krb5_pointer arg, size_t *sizep)
{
krb5_error_code kret;
krb5_keytab keytab;
size_t required;
krb5_ktfile_data *ktdata;
kret = EINVAL;
if ((keytab = (krb5_keytab) arg)) {
/*
* Saving FILE: variants of krb5_... | false | false | false | false | false | 0 |
tp_connection_remove_from_group_async (TpConnection *self,
const gchar *group,
guint n_contacts,
TpContact * const *contacts,
GAsyncReadyCallback callback,
gpointer user_data)
{
contact_groups_generic_async (remove_from_group);
} | false | false | false | false | false | 0 |
wl18xx_probe(struct platform_device *pdev)
{
struct wl1271 *wl;
struct ieee80211_hw *hw;
int ret;
hw = wlcore_alloc_hw(sizeof(struct wl18xx_priv),
WL18XX_AGGR_BUFFER_SIZE,
sizeof(struct wl18xx_event_mailbox));
if (IS_ERR(hw)) {
wl1271_error("can't allocate hw");
ret = PTR_ERR(hw);
goto out;
... | false | false | false | false | false | 0 |
img_spfi_start_dma(struct spi_master *master,
struct spi_device *spi,
struct spi_transfer *xfer)
{
struct img_spfi *spfi = spi_master_get_devdata(spi->master);
struct dma_async_tx_descriptor *rxdesc = NULL, *txdesc = NULL;
struct dma_slave_config rxconf, txconf;
spfi->rx_dma_busy = false;
spfi->... | false | false | false | false | false | 0 |
prefs_filtering_action_open(GSList *action_list,
PrefsFilteringActionSignal *cb)
{
inc_lock();
if (!filtering_action.window) {
prefs_filtering_action_create();
} else {
#if !GTK_CHECK_VERSION(3, 0, 0)
/* update color label menu */
gtk_cmoption_menu_set_menu(GTK_CMOPTION_MENU(filtering_action.color_optmenu... | false | false | false | false | false | 0 |
mousePressedOnField( const MapCoordinate& pos, const SPoint& mousePos, bool cursorChanged, int button, int prio )
{
if ( prio > 1 )
return false;
if ( button == 1 ) {
execaction_ev( act_primaryAction );
return true;
} else
return false;
} | false | false | false | false | false | 0 |
calcNewWeights(int nK, double *adWeight, t_Master *ptMaster)
{
int k = 0, i = 0, j = 0, nM = ptMaster->nM;
double dMaxChange = 0.0;
int* anI = ptMaster->anI, *anCN = ptMaster->anCN, *anP = ptMaster->anP, *anN = ptMaster->anN;
double *adTau = ptMaster->adTau;
/*calc weights*/
for(i = 0; i < nK; i++){
do... | false | false | false | false | false | 0 |
Close()
{
if (m_poIndexTable)
delete m_poIndexTable; // Automatically closes.
m_poIndexTable = NULL;
if (m_poFeatureDefnRef && m_poFeatureDefnRef->Dereference() == 0)
delete m_poFeatureDefnRef;
m_poFeatureDefnRef = NULL;
if (m_poCurFeature)
delete m_poCurFeature;
m_poC... | false | false | false | false | false | 0 |
icp_a106_hbar(Driver *drvthis, int x, int y, int len, int promille, int options)
{
int total_pixels = ((long) 2 * len * LCD_DEFAULT_CELLWIDTH + 1 ) * promille / 2000;
int pos;
for (pos = 0; pos < len; pos ++) {
int pixels = total_pixels - LCD_DEFAULT_CELLWIDTH * pos;
if (pixels >= LCD_DEFAULT_CELLWIDTH... | false | false | false | false | false | 0 |
artifical_hotkey() {
if (artifical <= '9') {
current[0] = artifical++;
}
else {
int i;
for (i = 25; i >= 0; --i) {
if (!used[i]) {
current[0] = 'a'+i;
used[i] = true;
break;
}
if (!USED[i]) {
... | false | false | false | false | false | 0 |
reg_write(struct i2c_client *client, const u16 reg,
const u8 data)
{
struct rj54n1 *rj54n1 = to_rj54n1(client);
int ret;
/* set bank */
if (rj54n1->bank != reg >> 8) {
dev_dbg(&client->dev, "[0x%x] = 0x%x\n", 0xff, reg >> 8);
ret = i2c_smbus_write_byte_data(client, 0xff, reg >> 8);
if (ret < 0)
ret... | false | false | false | false | false | 0 |
compare(const char *str) const
{
if (!str)
return 1;
int asize = chars.size();
int diff = 0;
int index = 0;
while (index < asize)
{
int a = (int) chars[index];
int b = (int) str[index];
if (!b)
return a;
diff = a - b;
if (diff)
... | false | false | false | false | false | 0 |
gst_sdp_demux_handle_message (GstBin * bin, GstMessage * message)
{
GstSDPDemux *demux;
demux = GST_SDP_DEMUX (bin);
switch (GST_MESSAGE_TYPE (message)) {
case GST_MESSAGE_ELEMENT:
{
const GstStructure *s = gst_message_get_structure (message);
if (gst_structure_has_name (s, "GstUDPSrcTimeou... | false | false | false | false | false | 0 |
shell_parse_command(struct gnutella_shell *sh,
const char *line, const char **endptr,
int *argc_ptr, const char ***argv_ptr)
{
const char **argv = NULL;
unsigned argc = 0;
size_t n = 0;
bool ok = TRUE;
const char *start;
shell_check(sh);
g_assert(line);
g_assert(argv_ptr);
/*
* The limit of SHELL_MAX_ARG... | false | false | false | false | false | 0 |
a2j_log_init(bool use_logfile)
{
if (use_logfile)
{
return a2j_log_open();
}
return true;
} | false | false | false | false | false | 0 |
cq_free(cqueue_t *cq)
{
cevent_t *ev;
cevent_t *ev_next;
int i;
struct chash *ch;
cqueue_check(cq);
if (cq->cq_current != NULL) {
s_carp("%s(): %squeue \"%s\" still within cq_clock()", G_STRFUNC,
CSUBQUEUE_MAGIC == cq->cq_magic ? "sub" : "", cq->cq_name);
}
mutex_lock(&cq->cq_lock);
for (ch = cq->cq_h... | false | false | false | false | false | 0 |
parseDate(double ymd_)
{
static int mdays[]={31,28,31,30,31,30,31,31,30,31,30,31};
MSBoolean leapyr=MSFalse;
int yr=(int)(ymd_*0.0001);
double temp=(ymd_-yr*10000);
int mmx=(int)(temp*0.01);
int yday=0;
int dd=(int)((mmx>=1 && mmx <=12)?temp-(mmx*100):0);
if ((yr%4==0&&yr%100!=0)||yr%400==0) leapyr=M... | false | false | false | false | false | 0 |
Oct6100ApiAssertPlayoutStopParams(
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
IN tPOCT6100_BUFFER_PLAYOUT_STOP f_pBufferPlayoutStop,
OUT PUINT32 f_pulChannelIndex,
OUT PUINT16 f_pusEchoMemIndex )
{
tPOCT6100_API_CHANNEL pEchoChannel;
UINT32 ulEntryOpenCnt;
/* Check for error... | false | false | false | false | false | 0 |
atomctrl_get_mpll_reference_clock(struct pp_hwmgr *hwmgr)
{
ATOM_COMMON_TABLE_HEADER *fw_info;
uint32_t clock;
u8 frev, crev;
u16 size;
fw_info = (ATOM_COMMON_TABLE_HEADER *)
cgs_atom_get_data_table(hwmgr->device,
GetIndexIntoMasterTable(DATA, FirmwareInfo),
&size, &frev, &crev);
if (fw_info == NULL)
... | false | false | false | false | false | 0 |
png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
unsigned int truelen;
png_byte buf[6];
png_color_16 background;
png_debug(1, "in png_handle_bKGD");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_chunk_error(png_ptr, "missing IHDR");
else if ((png_ptr->mode & PNG_HA... | false | false | false | false | false | 0 |
openEvaluator()
{
if (evaluatorDialog == NULL)
{
evaluatorDialog = new EvaluatorDialog(this);
QRect size = QApplication::desktop()->screenGeometry(evaluatorDialog);
evaluatorDialog->resize(size.width()/3, size.height()/2);
}
evaluatorDialog->show();
} | false | false | false | false | false | 0 |
insert_learn_role(struct gr_learn_role_entry **role_list, const char *rolename, u_int16_t rolemode)
{
struct gr_learn_role_entry *tmp;
struct gr_learn_role_entry *newrole;
for_each_list_entry(tmp, *role_list) {
if (!strcmp(tmp->rolename, rolename)) {
tmp->rolemode |= rolemode;
return tmp;
}
}
newrole =... | false | false | false | false | false | 0 |
e1000_set_features(struct net_device *netdev,
netdev_features_t features)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
netdev_features_t changed = features ^ netdev->features;
if (changed & NETIF_F_HW_VLAN_CTAG_RX)
e1000_vlan_mode(netdev, features);
if (!(changed & (NETIF_F_RXCSUM | NETIF_F_RXALL)))
... | false | false | false | false | false | 0 |
bit_unfmt_hexmask(bitstr_t * bitmap, const char* str)
{
int bit_index = 0, len = strlen(str);
int rc = 0;
const char *curpos = str + len - 1;
int current;
bitoff_t bitsize = bit_size(bitmap);
bit_nclear(bitmap, 0, bitsize - 1);
if (strncmp(str, "0x", 2) == 0) { /* Bypass 0x */
str += 2;
len -= 2;
}
while... | false | false | false | false | false | 0 |
hitachi_old_detect(const GwyFileDetectInfo *fileinfo,
gboolean only_name)
{
guint xres, yres;
const guchar *p;
if (only_name)
return g_str_has_suffix(fileinfo->name_lowercase, EXTENSION) ? 10 : 0;
if (fileinfo->buffer_len < HEADER_SIZE_OLD
|| fileinfo->file_size < HE... | false | false | false | false | false | 0 |
display_leaf_slots(struct dtslot *slot, int8_t * stbl, int8_t nextindex, int *changed)
{
char cmd_line[512];
int i;
int field;
struct ldtentry *leaf;
char result = 'u'; /* default returned if no leaf->next */
int slot_number;
char *token;
int nfields = (type_jfs & JFS_DIR_INDEX) ? 5 : 4;
for (i = 0; i < nexti... | false | false | false | false | false | 0 |
read_symbol_or_number(ScmPort *port, ScmChar initial, ScmReadContext *ctx)
{
ScmString *s = SCM_STRING(read_word(port, initial, ctx, FALSE));
ScmObj num = Scm_StringToNumber(s, 10, TRUE);
if (num == SCM_FALSE)
return Scm_Intern(s);
else
return num;
} | false | false | false | false | false | 0 |
typedefHandler(Node *n) {
String *type = Getattr(n, "type");
Node *enum_node = type ? Getattr(seen_enums, type) : 0;
if (enum_node) {
String *name = Getattr(enum_node, "name");
Printf(f_mlbody, "let _ = Callback.register \"%s_marker\" (`%s)\n", Getattr(n, "name"), name);
}
return SWIG_... | false | false | false | false | false | 0 |
read_tabfile(ESL_GETOPTS *go, char *tabfile, ESL_KEYHASH *kh, ESL_DMATRIX *D)
{
ESL_FILEPARSER *efp = NULL;
int nline = 0;
int vfield = esl_opt_GetInteger(go, "-v");
int qfield = esl_opt_GetInteger(go, "-q");
int tfield = esl_opt_GetInteger(go, "-t... | false | false | false | false | false | 0 |
createFunctionPolyLineC(int edge_tag, ecif_ElementComponent_X& txc,
IdList& vertex_tags)
{
UserInterface* gui = (UserInterface*)model->getGui();
strstream strm, strm1, strm2;
int i,j;
Hdll hDLL = NULL; // Handle to DLL library
Hfunc hFunc = NULL; // Handle to dll function... | false | false | false | false | false | 0 |
gt683r_led_work(struct work_struct *work)
{
int i;
u8 leds = 0;
u8 mode;
struct gt683r_led *led = container_of(work, struct gt683r_led, work);
mutex_lock(&led->lock);
for (i = 0; i < GT683R_LED_COUNT; i++) {
if (led->brightnesses[i])
leds |= BIT(i);
}
if (gt683r_leds_set(led, leds))
goto fail;
if (l... | false | false | false | false | false | 0 |
starfire_remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct netdev_private *np = netdev_priv(dev);
BUG_ON(!dev);
unregister_netdev(dev);
if (np->queue_mem)
pci_free_consistent(pdev, np->queue_mem_size, np->queue_mem, np->queue_mem_dma);
/* XXX: add wakeup code -- requ... | false | false | false | false | false | 0 |
set_used_start( int used_start )
{
if ( used_start <= 0 )
USED_START = GRIPPER ;
else
USED_START = used_start + GRIPPER ;
} | false | false | false | false | false | 0 |
normalizeGeneralName(const NodePtr &nd, StringC &str)
{
NamedNodeListPtr nnl;
NodePtr root;
if (nd->getGroveRoot(root) == accessOK
&& root->getElements(nnl) == accessOK)
str.resize(nnl->normalize(str.begin(), str.size()));
} | false | false | false | false | false | 0 |
mark_for_xdamage(int x, int y, int w, int h) {
int tx1, ty1, tx2, ty2;
sraRegionPtr tmpregion;
if (! use_xdamage) {
return;
}
tx1 = nfix(x, dpy_x);
ty1 = nfix(y, dpy_y);
tx2 = nfix(x + w, dpy_x+1);
ty2 = nfix(y + h, dpy_y+1);
tmpregion = sraRgnCreateRect(tx1, ty1, tx2, ty2);
add_region_xdamage(tmpregion)... | false | false | false | false | false | 0 |
cyttsp_power_on(struct cyttsp *ts)
{
int error;
error = cyttsp_soft_reset(ts);
if (error)
return error;
error = cyttsp_load_bl_regs(ts);
if (error)
return error;
if (GET_BOOTLOADERMODE(ts->bl_data.bl_status) &&
IS_VALID_APP(ts->bl_data.bl_status)) {
error = cyttsp_exit_bl_mode(ts);
if (error)
r... | false | false | false | false | false | 0 |
accept_v1_handshake(env, conn, hostname)
ENV *env;
REPMGR_CONNECTION *conn;
char *hostname;
{
DB_REPMGR_V1_HANDSHAKE *handshake;
u_int32_t prio;
int electable;
handshake = conn->input.repmgr_msg.cntrl.data;
if (conn->input.repmgr_msg.cntrl.size != sizeof(*handshake) ||
handshake->version != 1) {
__db_er... | false | false | false | false | false | 0 |
hmc5843_wait_measurement(struct hmc5843_data *data)
{
int tries = 150;
unsigned int val;
int ret;
while (tries-- > 0) {
ret = regmap_read(data->regmap, HMC5843_STATUS_REG, &val);
if (ret < 0)
return ret;
if (val & HMC5843_DATA_READY)
break;
msleep(20);
}
if (tries < 0) {
dev_err(data->dev, "data... | false | false | false | false | false | 0 |
data(const int reference) const
{
if (reference >= ReferencesCount)
return QString();
switch (reference) {
case Link: return m_Link;
case PMID: return QString();
case ShortReferences:
{
return m_ShortRef;
}
case AbstractPlainText:
{
if (!m_Abstract.isEmpty()) ... | false | false | false | false | false | 0 |
Allocate() {
if (head_ == NULL) {
return Failure::RetryAfterGC(owner_);
}
ASSERT(!FLAG_always_compact); // We only use the freelists with mark-sweep.
FreeListNode* node = FreeListNode::FromAddress(head_);
head_ = node->next();
available_ -= object_size_;
return node;
} | false | false | false | false | false | 0 |
_DDc4hexN_f(float *f, const float *x, size_t len, const double *parm) {
float t;
size_t i;
AIR_UNUSED(parm);
for (i=0; i<len; i++) {
t = x[i];
t = AIR_ABS(t);
f[i] = AIR_CAST(float, _DDC4HEXIC(t));
}
} | false | false | false | false | false | 0 |
_layout_paragraph_render(Evas_Object_Textblock *o,
Evas_Object_Textblock_Paragraph *par)
{
if (par->rendered)
return;
par->rendered = EINA_TRUE;
#ifdef BIDI_SUPPORT
if (par->is_bidi)
{
_layout_update_bidi_props(o, par);
_layout_paragraph_reorder_lines(par);
/* Clear the ... | false | false | false | false | false | 0 |
addWptField(DBFHandle hDBF, g2scolumns * cols) {
DBFAddField(hDBF, "shapeID", FTInteger, 8, 0);
if (cols->ele)
DBFAddField(hDBF, "ele", FTDouble, 16, 4);
if (cols->time)
DBFAddField(hDBF, "time", FTString, TIMELENGTH, 0);
if (cols->magvar)
DBFAddField(hDBF, "magvar", FTDouble, 16, 4);
if (cols->geoidheight)
... | false | false | false | false | false | 0 |
Ipv6ToIpv4SocketSendTo(
PRFileDesc *fd, const void *buf, PRInt32 amount,
PRIntn flags, const PRNetAddr *addr, PRIntervalTime timeout)
{
PRNetAddr tmp_ipv4addr;
const PRNetAddr *tmp_addrp;
if (PR_AF_INET6 != addr->raw.family) {
PR_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR, 0);
return PR_FAILURE;
}
... | false | false | false | false | false | 0 |
bfa_sfp_speed(struct bfa_sfp_s *sfp, enum bfa_port_speed portspeed,
bfa_cb_sfp_t cbfn, void *cbarg)
{
WARN_ON(portspeed == BFA_PORT_SPEED_UNKNOWN);
if (!bfa_ioc_is_operational(sfp->ioc))
return BFA_STATUS_IOC_NON_OP;
/* For Mezz card, all speed is allowed */
if (bfa_mfg_is_mezz(sfp->ioc->attr->card_type))
r... | false | false | false | false | false | 0 |
check_header()
{
int method; /* method byte */
int flags; /* flags byte */
uInt len;
int c;
/* Assure two bytes in the buffer so we can peek ahead -- handle case
where first byte of header is at the end of the buffer after the last
gzip segment */
len = stream.avail_in;
if (len < 2... | false | false | false | false | false | 0 |
quicksort (float *tb, int *o, int n)
{
int i, j;
int b;
float x, y;
while (n > 1)
{
x = tb[n / 2];
for (i = 0, j = n - 1; i <= j; i++, j--)
{
while (tb[i] > x)
i++;
while (tb[j] < x)
j--;
if (i > j)
break;
y = tb[i... | false | false | false | false | false | 0 |
fm10k_update_hw_stats_pf(struct fm10k_hw *hw,
struct fm10k_hw_stats *stats)
{
u32 timeout, ur, ca, um, xec, vlan_drop, loopback_drop, nodesc_drop;
u32 id, id_prev;
/* Use Tx queue 0 as a canary to detect a reset */
id = fm10k_read_reg(hw, FM10K_TXQCTL(0));
/* Read Global Statistics */
do {
timeout = ... | false | false | false | false | false | 0 |
drm_mode_connector_attach_encoder(struct drm_connector *connector,
struct drm_encoder *encoder)
{
int i;
for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
if (connector->encoder_ids[i] == 0) {
connector->encoder_ids[i] = encoder->base.id;
return 0;
}
}
return -ENOMEM;
} | false | false | false | false | false | 0 |
gst_output_selector_switch_pad_negotiation_mode (GstOutputSelector * sel,
gint mode)
{
sel->pad_negotiation_mode = mode;
if (mode == GST_OUTPUT_SELECTOR_PAD_NEGOTIATION_MODE_ALL) {
gst_pad_set_getcaps_function (sel->sinkpad, gst_pad_proxy_getcaps);
gst_pad_set_setcaps_function (sel->sinkpad, gst_pad_pro... | false | false | false | false | false | 0 |
scm_valid_environment_extension_lengthp(scm_int_t formals_len,
scm_int_t actuals_len)
{
if (SCM_LISTLEN_ERRORP(formals_len))
return scm_false;
if (SCM_LISTLEN_DOTTEDP(formals_len)) {
formals_len = SCM_LISTLEN_DOTTED(formals_len);
if (SCM_LISTLEN_PR... | false | false | false | false | false | 0 |
bacon_video_widget_set_rate (BaconVideoWidget *bvw,
gfloat new_rate)
{
GstEvent *event;
gboolean retval = FALSE;
gint64 cur;
g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (bvw->priv->play), FALSE);
/* set upper and lower limit for rate *... | false | false | false | false | false | 0 |
cbf_mpint_load_acc(unsigned int * acc, size_t acsize,
void * source, size_t elsize,
int elsign, const char * border) {
size_t bits;
unsigned char * unsigned_char_data;
int iint, numints;
unsigned int sign;
unsigned int sextend;
bits = e... | false | false | false | false | false | 0 |
getIdxOfChildWindow(Window* wnd) const
{
for (size_t i = 0; i < getChildCount(); ++i)
{
if (getChildAtIdx(i) == wnd)
{
return i;
}
}
assert(0);
return 0;
} | false | false | false | false | false | 0 |
getAmPlatzen() const {
if (mPos.r == richtung_keins)
return false;
/* Wenn einer platzt, dann beide. */
CASSERT(mPos.r == richtung_einzel ||
mBlop[0].getAmPlatzen() == mBlop[1].getAmPlatzen());
return mBlop[0].getAmPlatzen();
} | false | false | false | false | false | 0 |
gst_encoding_profile_finalize (GstEncodingProfile * prof)
{
if (prof->name)
g_free (prof->name);
if (prof->format)
gst_caps_unref (prof->format);
if (prof->preset)
g_free (prof->preset);
if (prof->description)
g_free (prof->description);
if (prof->restriction)
gst_caps_unref (prof->restric... | false | false | false | false | false | 0 |
rectangle_copy (int xs, int ys, int xd, int yd,
int xc, int yc, a_pcx_image *source)
{
int src_width = source->width;
a_pixel *src = source->buffer + src_width * ys + xs;
a_pixel *dest = hedit_buffer + xc + yc * xbuf;
int j;
for (j = yd; j > 0; j--) {
memcpy (dest, src, xd);
src += src_width;
de... | false | false | false | false | false | 0 |
es8328_set_deemph(struct snd_soc_codec *codec)
{
struct es8328_priv *es8328 = snd_soc_codec_get_drvdata(codec);
int val, i, best;
/*
* If we're using deemphasis select the nearest available sample
* rate.
*/
if (es8328->deemph) {
best = 0;
for (i = 1; i < ARRAY_SIZE(deemph_settings); i++) {
if (abs(de... | false | false | false | false | false | 0 |
get_offset_from_address(Elf_Ehdr *hdr, unsigned long addr)
{
Elf_Shdr *x;
unsigned int i, num_sections;
x = (void *)hdr + hdr->e_shoff;
if (hdr->e_shnum == SHN_UNDEF)
num_sections = x[0].sh_size;
else
num_sections = hdr->e_shnum;
for (i = 1; i < num_sections; i++) {
unsigned long start = x[i].sh_addr;
u... | false | false | false | false | false | 0 |
find_command(char *name)
{
int i;
for ( i = 0; commands[i].name; i++ )
if ( strcmp(name, commands[i].name) == 0)
return (&commands[i]);
return ((command_t *)NULL);
} | false | false | false | false | false | 0 |
tile_to_canvas_pos(int *canvas_x, int *canvas_y, struct tile *ptile)
{
int center_map_x, center_map_y, dx, dy, tile_x, tile_y;
/*
* First we wrap the coordinates to hopefully be within the the mapview
* window. We do this by finding the position closest to the center
* of the window.
*/
/* TODO: Cac... | false | false | false | false | false | 0 |
updatesqldata (glong poi_id, double lat, double lon, gchar *name, gchar *typ, gchar *comment, gint src)
{
gchar q[200], lats[20], lons[20];
gchar *tname, *ttyp, *tcomment;
gint pt_id;
glong r;
if (!usesql)
return 0;
g_snprintf (lats, sizeof (lats), "%.6f", lat);
g_strdelimit (lats, ",", '.');
g_snprintf (lon... | false | false | false | false | false | 0 |
fat_short2lower_uni(struct nls_table *t, unsigned char *c,
int clen, wchar_t *uni)
{
int charlen;
wchar_t wc;
charlen = t->char2uni(c, clen, &wc);
if (charlen < 0) {
*uni = 0x003f; /* a question mark */
charlen = 1;
} else if (charlen <= 1) {
unsigned char nc = t->charset2lower[*c];
if (!nc)
nc ... | false | false | false | false | false | 0 |
init_bandpass (int len, int dec, double f1, double f2) {
double *fi = bp_FIR (len, 0, f1, f2);
init (len, dec, fi, fi);
delete [] fi;
} | false | false | false | false | false | 0 |
divide_internal_node(struct bt_t *btphdr)
{
register struct bt_t *btp;
int32 cnum;
struct bt_t *last_btp, *btp2, *btptmp;
/* case 1 (impossible) - all of tree past timing wheel */
/* internal node low time cannot be larger than wheel end */
if (btphdr->btltim > __whetime) __misc_terr(__FILE__, __LINE__);
cnum ... | false | false | false | false | false | 0 |
ResetPartInfo()
{
LSDynaMetaData* p = this->P;
p->PartNames.clear();
p->PartIds.clear();
p->PartMaterials.clear();
p->PartStatus.clear();
// Create simple part names as place holders
int mat = 1, realMat = 1;
int i;
int N;
char partLabel[64];
int arbitraryMaterials = p->Dict["NMMAT"];
#define VT... | false | false | false | false | false | 0 |
snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots)
{
IRRef retf = J->chain[IR_RETF]; /* Limits SLOAD restore elimination. */
BCReg s;
MSize n = 0;
for (s = 0; s < nslots; s++) {
TRef tr = J->slot[s];
IRRef ref = tref_ref(tr);
if (ref) {
SnapEntry sn = SNAP_TR(s, tr);
IRIns *ir =... | false | false | false | false | false | 0 |
b44_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct b44 *bp = netdev_priv(dev);
wol->supported = WAKE_MAGIC;
if (bp->flags & B44_FLAG_WOL_ENABLE)
wol->wolopts = WAKE_MAGIC;
else
wol->wolopts = 0;
memset(&wol->sopass, 0, sizeof(wol->sopass));
} | false | false | false | false | false | 0 |
namecmp(s1, s2)
ZCONST char *s1, *s2;
{
int d;
for (;;) {
d = (int)ToLower((uch)*s1)
- (int)ToLower((uch)*s2);
if (d || *s1 == 0 || *s2 == 0)
return d;
s1++;
s2++;
}
} | false | false | false | false | false | 0 |
scif_alloc_req(struct scif_dev *scifdev, struct scifmsg *msg)
{
int err;
struct scif_window *window = NULL;
int nr_pages = msg->payload[1];
window = scif_create_remote_window(scifdev, nr_pages);
if (!window) {
err = -ENOMEM;
goto error;
}
/* The peer's allocation request is granted */
msg->uop = SCIF_ALLO... | false | false | false | false | false | 0 |
nilfs_ioctl_move_inode_block(struct inode *inode,
struct nilfs_vdesc *vdesc,
struct list_head *buffers)
{
struct buffer_head *bh;
int ret;
if (vdesc->vd_flags == 0)
ret = nilfs_gccache_submit_read_data(
inode, vdesc->vd_offset, vdesc->vd_blocknr,
vdesc->vd_vblocknr, &bh);
else
ret = nilfs_gccac... | false | false | false | false | false | 0 |
orte_regex_extract_ppn(int num_nodes, char *regexp, int **ppn)
{
int *tmp;
char *begptr, *endptr, *orig;
int i, j, count, reps;
/* init null answer */
*ppn = NULL;
tmp = (int *) malloc(sizeof(int) * num_nodes);
if (NULL == tmp) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
... | false | false | false | false | false | 0 |
fini (xlator_t *this)
{
qr_private_t *priv = NULL;
if (this == NULL) {
goto out;
}
priv = this->private;
if (priv == NULL) {
goto out;
}
qr_inode_table_destroy (priv);
qr_conf_destroy (&priv->conf);
this->private... | false | false | false | false | false | 0 |
chunklen(const char *whence, int expect_colon)
{
char *str = (char *) whence;
int n = 0;
int quote = 0;
for (; *str; str++, n++) {
switch (*str) {
case '\\':
if( quote ) {
break;
} else {
quote = 1;
continue;
}
case '"':
if (quote)
break;
while (*str) {
str++;
n++;
... | false | false | false | false | false | 0 |
ipmi_lan_open(struct ipmi_intf * intf)
{
int rc;
struct ipmi_session *s;
if (intf == NULL || intf->session == NULL)
return -1;
s = intf->session;
if (s->port == 0)
s->port = IPMI_LAN_PORT;
if (s->privlvl == 0)
s->privlvl = IPMI_SESSION_PRIV_ADMIN;
if (s->timeout == 0)
s->timeout = IPMI_LAN_TIMEOUT;
if... | false | false | false | false | false | 0 |
setLevelValue( uint level, uint value )
{
if( level < MAX_LEVEL)
_level[level] = value;
} | false | false | false | false | false | 0 |
addFailure( const TestFailure &failure )
{
ExclusiveZone zone( m_syncObject );
for ( TestListeners::iterator it = m_listeners.begin();
it != m_listeners.end();
++it )
(*it)->addFailure( failure );
} | false | false | false | false | false | 0 |
data(const QModelIndex &index, int role) const
{
if (index.row() < 0 || index.row() >= rowCount())
return QVariant();
if (role >= RectangleModel::WidthRole && role < IdRole)
return RectangleModel::data(index, role);
switch (role) {
case IdRole:
return int(m_ids[index.row()]);
... | false | false | false | false | false | 0 |
getnam(fp)
FILE *fp;
/* Read a \n or \r delimited name from stdin into n, and return
n. If EOF, then return NULL. Also, if problem return NULL. */
{
char name[GETNAM_MAX + 1];
int c; /* last character read */
char *p; /* pointer into name area */
p = name;
while ((c = ... | false | false | false | false | false | 0 |
clear_all_register(Processor *c,unsigned int address)
{
if(!c || address<0 || address > c->register_memory_size())
return;
while(c->registers[address]->isa()==Register::BP_REGISTER) {
BreakpointRegister *nr = dynamic_cast<BreakpointRegister *>(c->registers[address]);
if(!nr)
return;
bp.c... | 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.