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 |
|---|---|---|---|---|---|---|
get_iface_string(struct usb_dev_handle *usb_handle, char **string, int id)
{
if (id) {
if ((*string = malloc(USB_MAX_STRING_SIZE)) == NULL)
return -ENOMEM;
*string[0] = '\0';
return usb_get_string_simple(usb_handle, id, *string, USB_MAX_STRING_SIZE);
}
return 0;
} | false | false | false | false | false | 0 |
updateToolTipWithKeySequence()
{
if (m_block)
return;
m_block = true;
if (!m_showShortcut || shortcut().isEmpty())
setToolTip(m_toolTip);
else
setToolTip(stringWithAppendedShortcut(m_toolTip, shortcut()));
m_block = false;
} | false | false | false | false | false | 0 |
removeMedia(int position)
{
if(!mMediaPlaylist->removeMedia(position))
{
throwError("RemoveMediaError", tr("Remove media failed : %1").arg(mMediaPlaylist->errorString()));
return thisObject();
}
return thisObject();
} | false | false | false | false | false | 0 |
SuspendHook(ScrollableWidget w)
{
if (!w->scrollable.suspended)
Redisplay((Widget)w, NULL, NULL);
} | false | false | false | false | false | 0 |
cpl_column_exp_double(cpl_column *column, double base)
{
cpl_size nullcount = cpl_column_count_invalid(column);
cpl_size length = cpl_column_get_size(column);
double *dp = cpl_column_get_data_double(column);
int *np = cpl_column_get_data_invalid(column);
cpl_size i;
if (... | false | false | false | true | false | 1 |
P_UnArchiveThinkers(void)
{
byte tclass;
thinker_t *currentthinker, *next;
mobj_t *mobj;
//
// remove all the current thinkers
//
currentthinker = thinkercap.next;
while (currentthinker != &thinkercap)
{
next = currentthinker->next;
if (currentthinker->function == P_... | false | false | false | false | false | 0 |
policy_is_reject_star(const smartlist_t *policy)
{
if (!policy) /*XXXX disallow NULL policies? */
return 1;
SMARTLIST_FOREACH(policy, addr_policy_t *, p, {
if (p->policy_type == ADDR_POLICY_ACCEPT)
return 0;
else if (p->policy_type == ADDR_POLICY_REJECT &&
p->prt_min <= 1 && p->prt_ma... | false | false | false | false | false | 0 |
e2_context_menu_show_menu_action (gpointer from, E2_ActionRuntime *art)
{
gint type = 0;
gchar *arg = (gchar *)art->data;
if (arg != NULL)
{
g_strstrip (arg);
if (g_str_equal (arg, _A(112))) //_(shift
type = 1;
else if (g_str_equal (arg, _A(105))) //_(ctrl
type = 2;
//CHECKME alt option here ?
}
e2_... | false | false | false | false | false | 0 |
bttextfastcmp_locale(Datum x, Datum y, SortSupport ssup)
{
text *arg1 = DatumGetTextPP(x);
text *arg2 = DatumGetTextPP(y);
TextSortSupport *tss = (TextSortSupport *) ssup->ssup_extra;
/* working state */
char *a1p,
*a2p;
int len1,
len2,
result;
a1p = VARDATA_ANY(arg1);
a2p = VARDATA_A... | false | false | false | false | false | 0 |
transformReturningList(ParseState *pstate, List *returningList)
{
List *rlist;
int save_next_resno;
bool save_hasAggs;
bool save_hasWindowFuncs;
int length_rtable;
if (returningList == NIL)
return NIL; /* nothing to do */
/*
* We need to assign resnos starting at one in the RETURNING list. Save... | false | false | false | false | false | 0 |
update_estimated_delay(BEST_APP_VERSION& bav, double dt) {
int pt = bav.host_usage.proc_type;
if (pt == PROC_TYPE_CPU) {
g_request->cpu_estimated_delay += dt*bav.host_usage.avg_ncpus/g_request->host.p_ncpus;
} else {
COPROC* cp = g_request->coprocs.type_to_coproc(pt);
cp->estimated_d... | false | false | false | false | false | 0 |
sd_read_long_data(struct realtek_pci_sdmmc *host,
struct mmc_request *mrq)
{
struct rtsx_pcr *pcr = host->pcr;
struct mmc_host *mmc = host->mmc;
struct mmc_card *card = mmc->card;
struct mmc_command *cmd = mrq->cmd;
struct mmc_data *data = mrq->data;
int uhs = mmc_card_uhs(card);
u8 cfg2 = 0;
int err;
int res... | false | false | false | false | false | 0 |
item_get_info_2_reply (GkrOperation *op, GkrSession *session, gpointer data)
{
item_get_info_args *args = data;
const char *path;
DBusMessage *req;
g_assert (!args->session);
args->session = gkr_session_ref (session);
req = dbus_message_new_method_call (gkr_service_name, args->path, ITEM_INTERFACE, "GetSecret")... | false | false | false | false | false | 0 |
clone() const
{
RuleBasedCollator* coll = new RuleBasedCollator(*this);
// There is a small chance that the internal ucol_safeClone() call fails.
if (coll != NULL && coll->ucollator == NULL) {
delete coll;
return NULL;
}
return coll;
} | false | false | false | false | false | 0 |
ensure_menu (GogChildButton *child_button)
{
if (child_button->menu == NULL) {
GtkWidget *widget;
Addition *addition;
GSList *iter;
char *label = NULL;
child_button->menu = GTK_MENU (gtk_menu_new ());
g_object_ref_sink (child_button->menu);
for (iter = child_button->additions ; iter != NULL ; iter = it... | false | false | false | false | false | 0 |
cph_mechanism_printer_add_with_ppd_file (CphIfaceMechanism *object,
GDBusMethodInvocation *context,
const char *name,
const char *uri,
... | false | false | false | false | false | 0 |
tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len,
u8 *buf)
{
int i, ret = 0;
for (i = 0; i < len; i += 4, offset += 4) {
u32 page_off, phy_addr, nvram_cmd;
__be32 data;
memcpy(&data, buf + i, 4);
tw32(NVRAM_WRDATA, be32_to_cpu(data));
page_off = offset % tp->nvram_pagesize;
phy_add... | false | true | false | false | false | 1 |
m88rs2000_writereg(struct m88rs2000_state *state,
u8 reg, u8 data)
{
int ret;
u8 buf[] = { reg, data };
struct i2c_msg msg = {
.addr = state->config->demod_addr,
.flags = 0,
.buf = buf,
.len = 2
};
ret = i2c_transfer(state->i2c, &msg, 1);
if (ret != 1)
deb_info("%s: writereg error (reg == 0x%02x, val... | false | false | false | false | false | 0 |
anim_render_all(int screen_id, float frametime)
{
anim_instance* A;
anim_instance* temp;
A = GET_FIRST(&anim_render_list);
while( A !=END_OF_LIST(&anim_render_list) ) {
temp = GET_NEXT(A);
if ( A->screen_id == screen_id ) {
if ( Anim_ignore_frametime ) {
frametime = 0.0f;
Anim_ignore_frametime=0;
... | false | false | false | false | false | 0 |
test_libver_macros2(void)
{
hid_t file;
hid_t grp;
htri_t status;
herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing macros for library version comparison with a file\n"));
/*
* Create a file.
*/
fi... | false | false | false | false | false | 0 |
nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_mem, struct ttm_mem_reg *new_mem)
{
u32 src_offset = old_mem->start << PAGE_SHIFT;
u32 dst_offset = new_mem->start << PAGE_SHIFT;
u32 page_count = new_mem->num_pages;
int ret;
ret = RING_SPACE(chan, 3);
if (... | false | false | false | false | false | 0 |
MakeWordFreqList()
{//====================
// Read text files from a specified directory and make a list of the most frequently occuring words.
struct wcount *whashtab[N_HASH_DICT];
wcount **w_list;
int ix;
int j;
int hash;
wcount *p;
FILE *f_out;
char buf[200];
char buf2[200];
wxString dir = wxDirSelector(_... | false | false | false | false | false | 0 |
ensExonNewIni(EnsPExonadaptor ea,
ajuint identifier,
EnsPFeature feature,
ajint sphase,
ajint ephase,
AjBool current,
AjBool constitutive,
AjPStr stableid,
... | false | false | false | false | false | 0 |
integrateV(OfxTime time1, OfxTime time2, va_list arg)
{
double *value = va_arg(arg, double*);
OfxStatus stat = integrate(time1, time2, *value);
# ifdef OFX_DEBUG_PARAMETERS
if (stat == kOfxStatOK) {
std::cout << ' ' << *value;
}
# endif
return stat;
... | false | false | false | false | false | 0 |
primitive_fputc(void)
{
FILE *file = unbox_alien();
F_FIXNUM ch = to_fixnum(dpop());
for(;;)
{
if(fputc(ch,file) == EOF)
{
io_error();
/* Still here? EINTR */
}
else
break;
}
} | false | false | false | false | false | 0 |
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
NMSettingVlan *setting = NM_SETTING_VLAN (object);
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE (setting);
switch (prop_id) {
case PROP_IFACE_NAME:
g_free (priv->iface_name);
priv->iface_name = g_v... | false | false | false | false | false | 0 |
createConstWindow(char* disp)
{
// can we only have one context?
if (s_singleContext)
return(GemMan::createWindow(disp));
WindowHints myHints;
myHints.title = const_cast<char*>(GemMan::m_title.c_str());
myHints.border = 1;
myHints.buffer = 1;
myHints.x_offset = 0;
myHints.y_offset = 0;
myHints... | false | false | false | false | false | 0 |
__ecereInstMeth_GlobalSettingsDialog_OnGlobalSettingChange__00000000(struct __ecereNameSpace__ecere__com__Instance * this, int globalSettingsChange)
{
struct GlobalSettingsDialog * __ecerePointer_GlobalSettingsDialog = (struct GlobalSettingsDialog *)(this ? (((char *)this) + __ecereClass_GlobalSettingsDialog->offset) :... | false | false | false | false | false | 0 |
readConfigRid(struct airo_info *ai, int lock)
{
int rc;
ConfigRid cfg;
if (ai->config.len)
return SUCCESS;
rc = PC4500_readrid(ai, RID_ACTUALCONFIG, &cfg, sizeof(cfg), lock);
if (rc != SUCCESS)
return rc;
ai->config = cfg;
return SUCCESS;
} | false | false | false | false | false | 0 |
dwc2_hsotg_program_zlp(struct dwc2_hsotg *hsotg,
struct dwc2_hsotg_ep *hs_ep)
{
u32 ctrl;
u8 index = hs_ep->index;
u32 epctl_reg = hs_ep->dir_in ? DIEPCTL(index) : DOEPCTL(index);
u32 epsiz_reg = hs_ep->dir_in ? DIEPTSIZ(index) : DOEPTSIZ(index);
if (hs_ep->dir_in)
dev_dbg(hsotg->dev, "Sending zero-length ... | false | false | false | false | false | 0 |
mpc860_scc_fetch_bd(struct mpc860_data *d,m_uint16_t bd_addr,
struct mpc860_scc_bd *bd)
{
if ((bd_addr < MPC860_DPRAM_OFFSET) || (bd_addr > MPC860_DPRAM_END))
return(-1);
bd->offset = bd_addr - MPC860_DPRAM_OFFSET;
/* Fetch control word */
bd->ctrl = dpram_r16(d,bd->of... | false | false | false | false | false | 0 |
GetFlags(char *flagsString, flagArray *flagArray, int count)
{
CK_ULONG flagsValue = strtol(flagsString, NULL, 0);
int i;
if ((flagsValue != 0) || (*flagsString == 0)) {
return flagsValue;
}
while (*flagsString) {
for (i=0; i < count; i++) {
if (strncmp(flagsString, flagArray[i].name, flagArray[i... | false | false | false | false | false | 0 |
canNotFindPkgName(pkgCacheFile &Cache,
std::string const &str) {
if (ShowError == true)
_error->Insert(ErrorType, _("Unable to locate package %s"), str.c_str());
return pkgCache::PkgIterator(Cache, 0);
} | false | false | false | false | false | 0 |
put_pfn(unsigned long pfn, int prot)
{
if (!is_invalid_reserved_pfn(pfn)) {
struct page *page = pfn_to_page(pfn);
if (prot & IOMMU_WRITE)
SetPageDirty(page);
put_page(page);
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
file_getbuffer(struct magic_set *ms)
{
char *pbuf, *op, *np;
size_t psize, len;
if (ms->event_flags & EVENT_HAD_ERR)
return NULL;
if (ms->flags & MAGIC_RAW)
return ms->o.buf;
if (ms->o.buf == NULL)
return NULL;
/* * 4 is for octal representation, + 1 is for NUL */
len = strlen(ms->o.buf);
if (len > (S... | false | false | false | false | false | 0 |
r(vector<double const *> const &par, RNG *rng) const
{
double ans = MU(par);
if (rng->uniform() < 0.5)
ans -= rexp(SCALE(par), rng);
else
ans += rexp(SCALE(par), rng);
return ans;
} | false | false | false | false | false | 0 |
default_flush_command(void)
{
const char *str = server_string_option("default_flush_command", ".flush");
return (str && str[0] != '\0') ? str_dup(str) : 0;
} | false | false | false | false | false | 0 |
sys_telnet_init(void)
{
signal(SIGINT, intr);
signal(SIGQUIT, intr2);
signal(SIGPIPE, deadpeer);
#ifdef SIGWINCH
signal(SIGWINCH, sendwin);
#endif
#ifdef SIGTSTP
signal(SIGTSTP, susp);
#endif
#ifdef SIGINFO
signal(SIGINFO, ayt);
#endif
setconnmode(0);
NetNonblockingIO(net, 1);
#if de... | false | false | false | false | false | 0 |
gigaset_if_freedriver(struct gigaset_driver *drv)
{
if (!drv->have_tty)
return;
drv->have_tty = 0;
tty_unregister_driver(drv->tty);
put_tty_driver(drv->tty);
} | false | false | false | false | false | 0 |
SimpleJobCollectionTest() {
QString sequence;
AppendCharacterJob jobA ( QChar( 'a' ), &sequence, this );
AppendCharacterJob jobB ( QChar( 'b' ), &sequence, this );
AppendCharacterJob jobC ( QChar( 'c' ), &sequence, this );
ThreadWeaver::JobCollection jobCollection( this );
jobCollection.addJob (... | false | false | false | false | false | 0 |
get_basis_funcs()
{
int nShells = this->noOfShells;
int count = 0;
for(int i = 0; i < nShells; i++) {
ShellSpecStruct* currShell = &this->shellList[i];
currShell->startIndexInMatrix = count;
count += currShell->noOfBasisFuncs;
}
this->noOfBasisFuncs = count;
this->basisFuncList = new BasisFuncSt... | false | false | false | false | false | 0 |
removeClient(WinClient &client) {
if (client.fbwindow() != this || numClients() == 0)
return false;
fbdbg<<"("<<__FUNCTION__<<")["<<this<<"]"<<endl;
// if it is our active client, deal with it...
if (m_client == &client) {
WinClient *next_client = screen().focusControl().lastFocusedW... | false | false | false | false | false | 0 |
ews_kerberos_change_password (const gchar *user,
const gchar *domain,
const gchar *old_password,
const gchar *new_password)
{
krb5_context ctx;
krb5_creds creds;
krb5_data res_code_string, res_string;
EwsKerberosResult result;... | false | false | false | false | false | 0 |
uv__setsockopt_maybe_char(uv_udp_t* handle, int option, int val) {
#if defined(__sun)
char arg = val;
#else
int arg = val;
#endif
if (val < 0 || val > 255)
return -EINVAL;
if (setsockopt(handle->io_watcher.fd, IPPROTO_IP, option, &arg, sizeof(arg)))
return -errno;
return 0;
} | false | false | false | false | false | 0 |
dds_init_sine(void)
{
int i;
double ofs = offset;
double amp = 0.5 * amplitude;
if(ofs < amp){
/* Probably a unipolar range. Bump up the offset. */
ofs = amp;
}
for(i=0;i<WAVEFORM_LEN;i++){
waveform[i]=rint(ofs+amp*cos(i*2*M_PI/WAVEFORM_LEN));
}
} | false | false | false | false | false | 0 |
compare_filename(const void* _x, const void* _y)
{
int ret = 0;
const sorting_track_t* x = (const sorting_track_t*)_x;
const sorting_track_t* y = (const sorting_track_t*)_y;
ret = compare_string(x->info->pathname, y->info->pathname);
if (ret == 0) {
return compare_string(x->info->filename, y->info->filename);
}... | false | false | false | false | false | 0 |
enter_goto_state(struct unit_list *punits)
{
fc_assert_ret(!goto_is_active());
/* Can't have selection rectangle and goto going on at the same time. */
cancel_selection_rectangle();
unit_list_iterate(punits, punit) {
struct goto_map *goto_map = goto_map_new();
goto_map->focus = punit;
fill_clien... | false | false | false | false | false | 0 |
get_moves(int *nmoves)
{
int i, n, alln, a = 0, numout = 0;
MOVE *mp, *mp0;
/* Fill in the Possible array. */
alln = n = get_possible_moves(&a, &numout);
if (debug)
{
print_layout();
fprintf( stderr, "moves %d\n", n );
for (int j = 0; j < n; j++) {
fprintf( stderr, " " );
... | false | false | false | false | false | 0 |
gzip_filter_read(struct archive_read_filter *self, const void **p)
{
struct private_data *state;
size_t decompressed;
ssize_t avail_in;
int ret;
state = (struct private_data *)self->data;
/* Empty our output buffer. */
state->stream.next_out = state->out_block;
state->stream.avail_out ... | false | false | false | false | false | 0 |
readFromStream(mrpt::utils::CStream &in,int version)
{
switch(version)
{
case 0:
case 1:
case 2:
{
readFromStreamRender(in);
// Read the memory block, save to a temp. "3dsfile" and load...
clear();
CMemoryChunk chunk;
in >> chunk;
if (chunk.getTotalBytesCount())
{
const string tmpFil ... | false | false | false | false | false | 0 |
lcl_translate_ship_name(char *name)
{
if (!strcmp(name, "GTDR Amazon Advanced")) {
strcpy(name, "GTDR Amazon VII");
}
} | false | false | false | false | false | 0 |
ath10k_wmi_op_gen_vdev_spectral_conf(struct ath10k *ar,
const struct wmi_vdev_spectral_conf_arg *arg)
{
struct wmi_vdev_spectral_conf_cmd *cmd;
struct sk_buff *skb;
skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
if (!skb)
return ERR_PTR(-ENOMEM);
cmd = (struct wmi_vdev_spectral_conf_cmd *)skb->data;
c... | false | false | false | false | false | 0 |
pdc_tasklet(unsigned long data)
{
struct pch_dma_chan *pd_chan = (struct pch_dma_chan *)data;
unsigned long flags;
if (!pdc_is_idle(pd_chan)) {
dev_err(chan2dev(&pd_chan->chan),
"BUG: handle non-idle channel in tasklet\n");
return;
}
spin_lock_irqsave(&pd_chan->lock, flags);
if (test_and_clear_bit(0, &pd... | false | false | false | false | false | 0 |
categoriseUniChar(UT_UCS4Char c) {
enum EUniCat cat=UNKNOWN;
// use linear search for the bottom (western part of the table, and bsearch for the
// rest
SCatRange * pUC = (SCatRange*)bsearch(&c, UniCharCats, G_N_ELEMENTS(UniCharCats), sizeof(SCatRange),
s_compare_unichar_cats);
if(pUC)
cat = pUC-... | false | false | false | false | false | 0 |
freeze(UParseError& parseError,UErrorCode& status) {
/* Construct the rule array and index table. We reorder the
* rules by sorting them into 256 bins. Each bin contains all
* rules matching the index value for that bin. A rule
* matches an index value if string whose first key character
* ha... | false | false | false | false | false | 0 |
box_homogeneous_bc (GfsBox * box, BcData * p)
{
FttDirection d;
for (d = 0; d < FTT_NEIGHBORS; d++)
if (GFS_IS_BOUNDARY (box->neighbor[d])) {
GfsBoundary * b = GFS_BOUNDARY (box->neighbor[d]);
GfsBc * bc = gfs_boundary_lookup_bc (b, p->v);
if (bc) {
b->v = p->v1;
bc->v = p->v1;
b->type =... | false | false | false | false | false | 0 |
cli_hashtab_store(const struct cli_hashtable *s,FILE* out)
{
size_t i;
for(i=0; i < s->capacity; i++) {
const struct cli_element* e = &s->htable[i];
if(e->key && e->key != DELETED_KEY) {
fprintf(out,"%ld %s\n",e->data,e->key);
}
}
return CL_SUCCESS;
} | false | false | false | false | false | 0 |
UpdateIfNeed()
{
// maybe disabled or updated recently
if (!m_UpdateInterval || m_NextUpdateTime > time(NULL))
{ return; }
m_NextUpdateTime = time(NULL) + m_UpdateInterval;
// Clears Realm list
m_realms.clear();
for (int i = 0; i < REALM_VERSION_COUNT; ++i)
m_realmsByVersion[i]... | false | false | false | false | false | 0 |
_PyLong_Format(PyObject *aa, int base)
{
register PyLongObject *a = (PyLongObject *)aa;
PyObject *v;
Py_ssize_t sz;
Py_ssize_t size_a;
Py_UCS1 *p;
int negative;
int bits;
assert(base == 2 || base == 8 || base == 10 || base == 16);
if (base == 10)
return long_to_decimal_strin... | false | false | false | false | true | 1 |
createGroup( const char* name, size_t size_hint ) const
{
// Group creation property list for size_hint
hid_t gcpl_id = 0;
// Set the local heap size hint
if(!(size_hint == (size_t)-1 || size_hint == 0)) {
// If the creation of the property list failed, throw an exception
if((gcpl_id = H5Pcr... | false | false | false | false | false | 0 |
go ( const Context& context )
{
if ( getState() != SetUp )
return ActionResult(22000);
if ( !avail( getContainer() ))
return ActionResult(22800);
const VehicleType* vt = NULL;
const ContainerBase::Production production = getContainer()->getProduction();
for ( ContainerBase::Production::c... | false | false | false | false | false | 0 |
ExecGrant_Attribute(InternalGrant *istmt, Oid relOid, const char *relname,
AttrNumber attnum, Oid ownerId, AclMode col_privileges,
Relation attRelation, const Acl *old_rel_acl)
{
HeapTuple attr_tuple;
Form_pg_attribute pg_attribute_tuple;
Acl *old_acl;
Acl *new_acl;
Acl *merged_acl;
Datum a... | false | false | false | false | false | 0 |
length_NTLMResponse(const NTLMResponse *data)
{
size_t ret = 0;
{
size_t Top_tag_oldret = ret;
ret = 0;
ret += 1;
ret += 1 + der_length_len (ret);
ret += 1 + der_length_len (ret);
ret += Top_tag_oldret;
}
{
size_t Top_tag_oldret = ret;
ret = 0;
ret += der_length_unsigned(&(data)->flags);
ret += 1 + der_length_len (ret)... | false | false | false | false | false | 0 |
git_log_parse_log (const gchar *output)
{
gint i = 0;
gchar **lines;
GString *long_log;
lines = g_strsplit (output, "\n", -1);
long_log = g_string_new ("");
while (lines[i]) {
gchar* converted = NULL;
if (g_utf8_validate (lines[i], -1, NULL)) {
converted = g_strdup (lines[i]);
}
if (!conver... | false | false | false | false | false | 0 |
H5D__get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache)
{
H5P_genplist_t *dx_plist; /* Data transfer property list */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* Check args */
HDassert(cache);
/* Get the dataset transfer property list */
if(NULL == (dx_p... | false | false | false | false | false | 0 |
istgt_lu_del_unit(ISTGT_Ptr istgt, ISTGT_LU_Ptr lu)
{
int i, j;
if (lu ==NULL)
return 0;
ISTGT_TRACELOG(ISTGT_TRACE_DEBUG, "del unit %d\n", lu->num);
MTX_LOCK(&istgt->mutex);
istgt->nlogical_unit--;
istgt->logical_unit[lu->num] = NULL;
MTX_UNLOCK(&istgt->mutex);
xfree(lu->name);
xfree(lu->alias);
xfree(l... | false | false | false | false | false | 0 |
bnx2x_get_q_logical_state(struct bnx2x *bp,
struct bnx2x_queue_sp_obj *obj)
{
switch (obj->state) {
case BNX2X_Q_STATE_ACTIVE:
case BNX2X_Q_STATE_MULTI_COS:
return BNX2X_Q_LOGICAL_STATE_ACTIVE;
case BNX2X_Q_STATE_RESET:
case BNX2X_Q_STATE_INITIALIZED:
case BNX2X_Q_STATE_MCOS_TERMINATED:
case BNX2X_Q_... | false | false | false | false | false | 0 |
tour1d_scramble(ggobid *gg)
{
int i, j;
displayd *dsp = gg->current_display;
GGobiData *d = dsp->d;
gint nc = d->ncols;
for (i=0; i<1; i++)
for (j=0; j<nc; j++)
dsp->t1d.Fa.vals[i][j] = dsp->t1d.Fz.vals[i][j] =
dsp->t1d.F.vals[i][j] = dsp->t1d.Ga.vals[i][j] =
dsp->t1d.Gz.vals[i][j... | false | false | false | false | false | 0 |
matchbalance (MatchState *ms, const char *s,
const char *p) {
if (*p == 0 || *(p+1) == 0)
log_err("unbalanced pattern");
if (*s != *p) return NULL;
else {
int b = *p;
int e = *(p+1);
int cont = 1;
while (++s < ms->src_end) {
if (*s == e) {
if (-... | false | false | false | false | false | 0 |
parse_names (EggToolbarsModel *model,
xmlNodePtr child)
{
while (child)
{
if (xmlStrEqual (child->name, (const xmlChar*) "available"))
{
parse_available_list (model, child->children);
}
child = child->next;
}
} | false | false | false | false | false | 0 |
save_diff_mesh_to_file(int lp, const char * file)
{
if(is_null(file)) return FALSE;
FILE *fP;
if((fP=fopen(file, "w"))==NULL) {
showerr(file, "could not open file '%s' for write: %s");
return FALSE;
}
MeshT * mesh = sp->im_mesh_diff[lp], *base_mesh = &(sp->im_mesh[lp]);
g_return_val_if_fail(mesh,... | false | false | false | false | true | 1 |
cp_parser_std_attribute_spec_seq (cp_parser *parser)
{
tree attr_specs = NULL;
while (true)
{
tree attr_spec = cp_parser_std_attribute_spec (parser);
if (attr_spec == NULL_TREE)
break;
if (attr_spec == error_mark_node)
return error_mark_node;
TREE_CHAIN (attr_spec) = attr_specs;
... | false | false | false | false | false | 0 |
e_border_pinned_set(E_Border *bd,
int set)
{
E_Layer layer;
if (bd)
{
bd->borderless = set;
bd->user_skip_winlist = set;
if (set)
layer = E_LAYER_BELOW;
else
layer = E_LAYER_NORMAL;
e_border_layer_set(bd, layer);
bd->c... | false | false | false | false | false | 0 |
fp2pow(p,D,uu,n)
unsigned p,D;
unsigned *uu;
unsigned n;
{
word4 x,x0,y,y0,X,Y;
if(n == 0) {
uu[0] = 1;
uu[1] = 0;
return;
}
x = uu[0]; y = uu[1];
X = 1; Y = 0;
while(n > 1) {
if(n & 1) {
x0 = X;
y0 = (Y*y) % p;
/*
... | false | false | false | false | false | 0 |
sw_service_photobucket_dispose (GObject *object)
{
SwServicePhotobucketPrivate *priv = ((SwServicePhotobucket*)object)->priv;
if (priv->proxy) {
g_object_unref (priv->proxy);
priv->proxy = NULL;
}
if (priv->silo_proxy) {
g_object_unref (priv->silo_proxy);
priv->silo_proxy = NULL;
}
G_OBJE... | false | false | false | false | false | 0 |
SPF_record_print(SPF_record_t *spf_record)
{
char *prt_buf = NULL;
size_t prt_len = 0;
int err;
if (spf_record == NULL) {
SPF_info("SPF header: <null record>");
SPF_info("Unknown");
return SPF_E_SUCCESS;
}
SPF_infof( "SPF header: version: %d mech %d/%u mod %d/%u len=%u",
spf_record... | false | false | false | false | false | 0 |
rhine_napipoll(struct napi_struct *napi, int budget)
{
struct rhine_private *rp = container_of(napi, struct rhine_private, napi);
struct net_device *dev = rp->dev;
void __iomem *ioaddr = rp->base;
u16 enable_mask = RHINE_EVENT & 0xffff;
int work_done = 0;
u32 status;
status = rhine_get_events(rp);
rhine_ack_ev... | false | false | false | false | false | 0 |
high_ver_name(name,path)
char name[], path[];
/* find the highest numbered version of file "name" in the given directory */
/* if no directory is given then the current directory is used. */
/* Also, if given path does not exist, then the procedure is exited */
/* modified 10/91 to do this <kob> */
... | false | false | false | false | false | 0 |
start_editor_from_file_full(const gchar *key, FileData *fd, EditorCallback cb, gpointer data)
{
GList *list;
EditorFlags error;
if (!fd) return FALSE;
list = g_list_append(NULL, fd);
error = start_editor_from_filelist_full(key, list, NULL, cb, data);
g_list_free(list);
return error;
} | false | false | false | false | false | 0 |
acceptXService(w, client_data, event, continuep)
Widget w;
XtPointer client_data;
XEvent *event;
Boolean *continuep;
{
IMConnection *conn;
TRACE(("IMProtocolWidget:acceptXService()\n"));
/*
* Check if the event is really a connection request.
*/
if (event->type != ClientMessage) return;
... | false | false | false | false | false | 0 |
genie_over_int (NODE_T * p)
{
A68_INT *i, *j;
POP_OPERAND_ADDRESSES (p, i, j, A68_INT);
PRELUDE_ERROR (VALUE (j) == 0, p, ERROR_DIVISION_BY_ZERO, MODE (INT));
VALUE (i) /= VALUE (j);
} | false | false | false | false | false | 0 |
removeStrategy(const String& name)
{
// Find strategy with specified name
StrategyMap::iterator it = mStrategies.find(name);
// If not found, return null
if (it == mStrategies.end())
return 0;
LodStrategy *strat = it->second;
// Otherwise, erase the str... | false | false | false | false | false | 0 |
H5F_sfile_add(H5F_file_t *shared)
{
H5F_sfile_node_t *new_shared; /* New shared file node */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5F_sfile_add)
/* Sanity check */
HDassert(shared);
/* Allocate new shared file node */
if (NULL == (new... | false | false | false | false | false | 0 |
eval_fname_sid(p)
char_u *p;
{
return (*p == 's' || TOUPPER_ASC(p[2]) == 'I');
} | false | false | false | false | false | 0 |
lookupSyntax(const PublicId &id)
{
PublicId::OwnerType ownerType;
if (!id.getOwnerType(ownerType) || ownerType != PublicId::ISO)
return 0;
StringC str;
if (!id.getOwner(str))
return 0;
if (str != sd().execToInternal("ISO 8879:1986")
&& str != sd().execToInternal("ISO 8879-1986"))
return 0;
... | false | false | false | false | false | 0 |
pixGenTextlineMask(PIX *pixs,
PIX **ppixvws,
l_int32 *ptlfound,
l_int32 debug)
{
l_int32 empty;
PIX *pixt1, *pixt2, *pixvws, *pixd;
PROCNAME("pixGenTextlineMask");
if (!pixs)
return (PIX *)ERROR_PTR("pixs not defined", procName,... | false | false | false | false | false | 0 |
main_show(void)
{
struct capicard *cards;
cards = load_config(configfilename);
if (cards == 0) {
fprintf(stderr,"ERROR: no cards configured in %s\n",
configfilename);
return -1;
}
show_config(cards);
return 0;
} | false | false | false | false | false | 0 |
gs_c_param_list_release(gs_c_param_list * plist)
{
gs_memory_t *mem = plist->memory;
gs_c_param *pparam;
while ((pparam = plist->head) != 0) {
gs_c_param *next = pparam->next;
switch (pparam->type) {
case gs_param_type_dict:
case gs_param_type_dict_int_keys:
... | false | true | false | false | false | 1 |
format_double(double v, char *buf, int n, int dp)
{
char fmt[15];
char temp[100];
int i, ncommas;
sprintf(fmt, "%%%d.%df", n, dp);
sprintf(temp, fmt, v);
strcpy(buf, temp);
G_insert_commas(temp);
ncommas = strlen(temp) - strlen(buf);
for (i = 0; i < ncommas && temp[i] == ' '; i++) {... | false | false | false | false | false | 0 |
RemoveObjectFromMap(PyObject *obj)
{
PyVTKObject *pobj = (PyVTKObject *)obj;
#ifdef VTKPYTHONDEBUG
vtkGenericWarningMacro("Deleting an object from map obj = "
<< pobj << " " << pobj->vtk_ptr);
#endif
if (vtkPythonMap)
{
vtkWeakPointerBase wptr;
// check for customized class... | false | false | false | false | false | 0 |
addfeature(f, p, n, d)
/* place feature in internal table */
int f, p, n, d;
{
feature[notes] = f;
pitch[notes] = p;
num[notes] = n;
denom[notes] = d;
if ((f == NOTE) || (f == REST) || (f == CHORDOFF)) {
reduce(&num[notes], &denom[notes]);
};
#ifdef DEBUG
if ((f == NOTE) || (f == REST)) {
fract = ... | false | false | false | false | false | 0 |
SaveAsImage (string const &filename, char const *mime_type, unsigned width, unsigned height) const
{
char *fname = go_mime_to_image_format (mime_type);
GOImageFormat format = go_image_get_format_from_name ((fname)? fname: filename.c_str ());
if (format == GO_IMAGE_FORMAT_UNKNOWN)
return;
GError *error = NULL;
Gs... | false | false | false | false | false | 0 |
ssl_write(con c) {
ERR_clear_error();
int r = SSL_write(c->s, c->data, c->len);
if (r <= 0) {
handle_ssl_error(c, r);
return 0;
}
c->start = 0;
c->len = 0;
if (c->other)
ev[c->other->idx].events |= POLLIN;
return 1;
} | false | false | false | false | false | 0 |
make_mondrian_colormap (Screen *screen, Visual *visual, Colormap cmap,
XColor *colors, int *ncolorsP,
Bool allocate_p,
Bool *writable_pP,
Bool verbose_p)
{
Display *dpy = DisplayOfScreen (screen);
Bool wanted_writable = (allocate_p && writable_pP && *writable_pP);
int ncolors = 8;
... | false | false | false | false | false | 0 |
unix_to_vms(unsigned int prot)
{
unsigned char bits = 0;
// DAP specifies that bit ON denies access.
if ((prot & 1) == 0) bits |= 0x04; // execute
if ((prot & 2) == 0) bits |= 0x0a; // write & delete
if ((prot & 4) == 0) bits |= 0x01; // read
return bits;
} | false | false | false | false | false | 0 |
newCoreMultiplexer(void * data, int count, void (*pop)(Multiplexer *), void (*seek)(Multiplexer *, const char *, int, int)) {
Multiplexer * new = (Multiplexer *) calloc (1, sizeof(Multiplexer));
new->count = count;
new->values = (double *) calloc(count, sizeof(double));
new->default_values = (double *) calloc(count... | false | false | false | false | false | 0 |
rdma_addr_find_dmac_by_grh(const union ib_gid *sgid, const union ib_gid *dgid,
u8 *dmac, u16 *vlan_id, int if_index)
{
int ret = 0;
struct rdma_dev_addr dev_addr;
struct resolve_cb_context ctx;
struct net_device *dev;
union {
struct sockaddr _sockaddr;
struct sockaddr_in _sockaddr_in;
struct ... | false | false | false | false | false | 0 |
InsertBlock(char *name, VPoint * o, VPoint * scale, VPoint * extrude, double r,
VPolygon **poly, int *ptop)
{
VObject **p;
int i, j, extrusion = 0;
PDEBUG(("looking for \"%s\"; offset %g, %g, %g; scale %g, %g, %g; extrude %g, %g, %g; rotate %g\n", name,
o->x, o->y, o->z, scale->x, scale->y, scale->z,... | false | false | false | false | false | 0 |
mGvEv()
{
needcpu(2);
++mcount;
Gv(&source);
getcomma();
Ev(&target);
yes_samesize();
buildregular();
} | false | false | false | false | false | 0 |
plc_fillin(plc_state_t *s, int16_t amp[], int len)
{
int i;
int pitch_overlap;
float old_step;
float new_step;
float old_weight;
float new_weight;
float gain;
int16_t *orig_amp;
int orig_len;
orig_amp = amp;
orig_len = len;
if (s->missing_samples == 0)
{
/* 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.