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 |
|---|---|---|---|---|---|---|
calc_dd_growth(const struct ubifs_info *c,
const struct ubifs_budget_req *req)
{
int dd_growth;
dd_growth = req->dirtied_page ? c->bi.page_budget : 0;
if (req->dirtied_ino)
dd_growth += c->bi.inode_budget << (req->dirtied_ino - 1);
if (req->mod_dent)
dd_growth += c->bi.dent_budget;
dd_growth += req->dir... | false | false | false | false | false | 0 |
cbtls_get_session(UNUSED SSL *s,
unsigned char *data, int len,
int *copy)
{
size_t size;
char buffer[2 * MAX_SESSION_SIZE + 1];
size = len;
if (size > MAX_SESSION_SIZE) size = MAX_SESSION_SIZE;
fr_bin2hex(data, buffer, size);
DEBUG2(" SSL: Client requested nonexistent cached session... | false | false | false | false | false | 0 |
usbGetStringDescriptor(u16 len) {
u8 strIndex = pInformation->USBwValue0;
if (strIndex > STR_DESC_LEN) {
return NULL;
} else {
return Standard_GetDescriptorData(len, &usbStringDescriptor[strIndex]);
}
} | false | false | false | false | false | 0 |
slotNameEdited(const QString& text)
{
kDebug() << text.trimmed();
bool found = false;
foreach (NewPlayerData* player, m_newGameSetup->players())
{
if (player->name() == text.trimmed())
{
found = true;
break;
}
}
if (found || text.trimmed().isEmpty())
{
QString message = i18n("N... | false | false | false | false | false | 0 |
setDefaultAtomsDlg()
{
if(atomsCanConnect)
{
gint i;
for(i=0;i<nAtomsCanConnect;i++)
if(atomsCanConnect[i]) g_free(atomsCanConnect[i]);
g_free(atomsCanConnect);
}
nAtomsCanConnect = 6;
atomsCanConnect = g_malloc(nAtomsCanConnect*sizeof(gchar*));
atomsCanConnect[0] = g_strdup("N");
atomsCanConnect[1] = g... | false | false | false | false | false | 0 |
gst_async_watch(GstBus *bus, GstMessage *message, gpointer data)
{
gstPlay *play = (gstPlay *)data;
if (play == NULL) return FALSE;
switch (GST_MESSAGE_TYPE (message)) {
// the pipeline state has changed
case GST_MESSAGE_STATE_CHANGED:
{
GstState new_state;
gst_message_parse_state_changed (message, ... | false | false | false | false | false | 0 |
sessionpty(struct ChanSess * chansess) {
unsigned int termlen;
unsigned char namebuf[65];
struct passwd * pw = NULL;
TRACE(("enter sessionpty"))
if (!svr_pubkey_allows_pty()) {
TRACE(("leave sessionpty : pty forbidden by public key option"))
return DROPBEAR_FAILURE;
}
chansess->term = buf_getstring(ses.p... | false | false | false | true | false | 1 |
gst_collect_pads_finalize (GObject * object)
{
GSList *collected;
GstCollectPads *pads = GST_COLLECT_PADS (object);
GST_DEBUG ("finalize");
g_cond_free (pads->cond);
g_mutex_free (pads->abidata.ABI.pad_lock);
/* Remove pads */
collected = pads->abidata.ABI.pad_list;
for (; collected; collected = g_sl... | false | false | false | false | false | 0 |
H5S_term_interface(void)
{
int n = 0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
if(H5_interface_initialize_g) {
if(H5I_nmembers(H5I_DATASPACE) > 0) {
(void)H5I_clear_type(H5I_DATASPACE, FALSE, FALSE);
n++; /*H5I*/
} /* end if */
else {
/* Destroy the dataspace object id group */... | false | false | false | false | false | 0 |
garbage_collect_ip_entries(void)
{
struct ip_entry *ptr;
struct ip_entry *last_ptr;
struct ip_entry *next_ptr;
int i;
for (i = 0; i < IP_HASH_SIZE; i++)
{
last_ptr = NULL;
for (ptr = ip_hash_table[i]; ptr; ptr = next_ptr)
{
next_ptr = ptr->next;
if (ptr->count == 0 &&
(C... | false | false | false | false | false | 0 |
Unicast_receive_socket(const char *bindhost, const char *listenport, int family, int sockbuflen ) {
struct addrinfo hints, *res, *ressave;
socklen_t optlen;
int error, p, sockfd;
if ( !listenport ) {
fprintf(stderr, "listen port required!\n");
LogError("listen port required!");
return -1;
}
... | false | false | false | false | false | 0 |
start_transfer()
{
if (!m_sspcon || !m_sspstat)
return;
// load the shift register
m_state = eACTIVE;
bits_transfered = 0;
unsigned int sspcon_val = m_sspcon->value.get();
unsigned int sspstat_val = m_sspstat->value.get();
if (verbose)
cout << "SSP: SPI Starting transfer. byte=0x" << hex << m_SS... | false | false | false | false | false | 0 |
ioport(JavaClass *java_class, Generator *generator, char *method_name, int port, int const_val)
{
CHECK_FUNC_CONST(setPinsAsInput,_I)
CHECK_FUNC_CONST(setPinsAsOutput,_I)
CHECK_FUNC_CONST(setPinsValue,_I)
CHECK_FUNC_CONST(setPinsHigh,_I)
CHECK_FUNC_CONST(setPinsLow,_I)
CHECK_FUNC_CONST(setPinAsOutput,_I)
... | false | false | false | false | false | 0 |
vm_vec_copy_normalize_quick_mag(vec3d *dest,vec3d *src)
{
// return vm_vec_copy_normalize(dest, src);
float m;
m = vm_vec_mag_quick(src);
Assert(m > 0.0f);
float im = 1.0f / m;
dest->xyz.x = src->xyz.x * im;
dest->xyz.y = src->xyz.y * im;
dest->xyz.z = src->xyz.z * im;
return m;
} | false | false | false | false | false | 0 |
snippets_browser_show_editor (SnippetsBrowser *snippets_browser)
{
SnippetsBrowserPrivate *priv = NULL;
GtkTreeSelection *selection = NULL;
GtkTreeViewColumn *col = NULL;
/* Assertions */
g_return_if_fail (ANJUTA_IS_SNIPPETS_BROWSER (snippets_browser));
priv = ANJUTA_SNIPPETS_BROWSER_GET_PRIVATE (snippets_brows... | false | false | false | false | false | 0 |
expr_free_freers()
{
struct expr_parse_free *f, *next=NULL;
for (f=freers; f; f=next) {
next = f->next;
free(f->dat);
free(f);
}
freers = NULL;
} | false | false | false | false | false | 0 |
findopt(OPT *desc, const char *optstr)
{
struct ao_opt *p; /* favourite pointer */
/*
* Check if current option matches.
*/
p = desc->ao_optcur;
if (p && (strcmp(p->aoo_string, optstr) == 0)) return(p);
/*
* Otherwise search for a match.
*/
for (p = desc->ao_opttop; p; p = p->aoo_next) {
if (strcmp(p->aoo... | false | false | false | false | false | 0 |
get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
} | false | false | false | false | false | 0 |
_transit_remove_dead_effects(Elm_Transit *transit)
{
Elm_Transit_Effect_Module *effect_module;
Eina_Inlist *ll;
EINA_INLIST_FOREACH_SAFE(transit->effect_list, ll, effect_module)
{
if (effect_module->deleted)
{
_transit_effect_del(transit, effect_module);
transi... | false | false | false | false | false | 0 |
Type_Screening_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag)
{
cmsScreening* sc = NULL;
cmsUInt32Number i;
sc = (cmsScreening*) _cmsMallocZero(self ->ContextID, sizeof(cmsScreening));
if (sc == NULL) return NULL;
*nItems = 0;
... | false | false | false | false | false | 0 |
config_item_cleanup(struct config_item *item)
{
struct config_item_type *t = item->ci_type;
struct config_group *s = item->ci_group;
struct config_item *parent = item->ci_parent;
pr_debug("config_item %s: cleaning up\n", config_item_name(item));
if (item->ci_name != item->ci_namebuf)
kfree(item->ci_name);
item... | false | false | false | false | false | 0 |
getEaster(int year)
{
int g, c, x, z, d, e, n, m;
g=year%19+1;
c=year/100+1;
x=3*c/4-12;
z=(8*c+5)/25-5;
d=5*year/4-x-10;
e=(11*g+20+z-x)%30;
if ((e==25 && g>11) || e==24) e++;
n=44-e;
if (n<21) n+=30;
n+=7-(d+n)%7;
if (n>31) {n-=31; m=4;} else m=3;
return date2julian(year,m,n);
} | false | false | false | false | false | 0 |
is_boolean_value(spif_charptr_t val_ptr)
{
if (!(val_ptr) || !(*val_ptr)) {
return FALSE;
}
return ((BOOL_OPT_ISTRUE(val_ptr) || BOOL_OPT_ISFALSE(val_ptr)) ? (TRUE) : (FALSE));
} | false | false | false | false | false | 0 |
gm_level_meter_free_colors (GArray *colors)
{
GdkColor *light = NULL;
GdkColor *dark = NULL;
unsigned i = 0;
for (i = 0; i < colors->len; i++) {
light = &(g_array_index (colors, GmLevelMeterColorEntry, i).color);
dark = &(g_array_index (colors, GmLevelMeterColorEntry, i).darkcolor);
gdk_colormap_... | false | false | false | false | false | 0 |
__assign_irq_vector(int irq, struct apic_chip_data *d,
const struct cpumask *mask)
{
/*
* NOTE! The local APIC isn't very good at handling
* multiple interrupts at the same interrupt level.
* As the interrupt level is determined by taking the
* vector number and shifting that right by 4, we
* want ... | false | false | false | false | false | 0 |
Reset()
{
nsUniversalDetector::Reset();
if (charset_) free(charset_);
charset_ = strdup("");
} | false | false | false | false | false | 0 |
find_breakpoint(int breaknum)
{
breakpoint *p;
LEsearch(breaklist, p, p->number == breaknum);
if(p)
return p;
infix_print_string("No breakpoint number ");
infix_print_number(breaknum);
infix_print_string(".\n");
return NULL;
} | false | false | false | false | false | 0 |
tdx_data_cancel(struct group_data *data, ARTNUM artnum)
{
static const struct index_entry empty;
off_t offset;
if (!data->writable)
return false;
if (data->base == 0 || artnum < data->base || artnum > data->high)
return false;
offset = (artnum - data->base) * sizeof(struct index_ent... | false | false | false | false | false | 0 |
activation_bytes(activation * ap)
{
int total = sizeof(activation);
Var *v;
int i;
/* The MOO Way [tm] is double-billing to avoid the possibility
* of not billing at all, so the size of the prog is counted here
* even though it will be shared unless the verb was reprogrammed.
*/
tota... | false | false | false | false | false | 0 |
getPosit(const string& call, int em)
{
Lock histLock(histMutex); // create a semaphore object
if ((pTail == NULL) || (pHead == NULL))
return NULL ; // Empty list
aprsString* posit = NULL;
if (ItemCount == 0) // if no data then...
return NULL... | false | false | false | false | false | 0 |
H2_DoAdvanceDemo(void)
{
players[consoleplayer].playerstate = PST_LIVE; // don't reborn
advancedemo = false;
usergame = false; // can't save/end game here
paused = false;
gameaction = ga_nothing;
demosequence = (demosequence + 1) % 7;
switch (demosequence)
{
case 0... | false | false | false | false | false | 0 |
gsd_housekeeping_manager_stop (GsdHousekeepingManager *manager)
{
GsdHousekeepingManagerPrivate *p = manager->priv;
g_debug ("Stopping housekeeping manager");
if (manager->priv->bus_cancellable != NULL) {
g_cancellable_cancel (manager->priv->bus_cancellable);
g_... | false | false | false | false | false | 0 |
doProcessFinished(QString const & cmd)
{
appendText(currentTime() + ": <" + cmd + "> done");
} | false | false | false | false | false | 0 |
xgene_enet_napi_add(struct xgene_enet_pdata *pdata)
{
struct napi_struct *napi;
int i;
for (i = 0; i < pdata->rxq_cnt; i++) {
napi = &pdata->rx_ring[i]->napi;
netif_napi_add(pdata->ndev, napi, xgene_enet_napi,
NAPI_POLL_WEIGHT);
}
for (i = 0; i < pdata->cq_cnt; i++) {
napi = &pdata->tx_ring[i]->c... | false | false | false | false | false | 0 |
append_text(const char*s1) {
int len = (s?strlen(s):0) + strlen(s1) + 1;
char *tmp = (char*) malloc(len);
strncpy(tmp, s?s:"", len);
strncat(tmp, s1, len - strlen(tmp));
if (s) {
free(s);
}
s = tmp;
} | false | false | false | false | false | 0 |
PyvtkSimulation_GetCollisions(PyObject *self, PyObject *args)
{
vtkPythonArgs ap(self, args, "GetCollisions");
vtkObjectBase *vp = ap.GetSelfPointer(self, args);
vtkSimulation *op = static_cast<vtkSimulation *>(vp);
vtkCollisionCollection *tempr;
PyObject *result = NULL;
if (op && ap.CheckArgCount(0))
... | false | false | false | false | false | 0 |
option_space_foreach (struct packet *packet, struct lease *lease,
struct client_state *client_state,
struct option_state *in_options,
struct option_state *cfg_options,
struct binding_scope **scope,
struct universe *u, void *stuff,
void (*func) (struct option_cache *,
struct pac... | false | false | false | false | false | 0 |
b43legacy_remove_dynamic_debug(struct b43legacy_wldev *dev)
{
struct b43legacy_dfsentry *e = dev->dfsentry;
int i;
for (i = 0; i < __B43legacy_NR_DYNDBG; i++)
debugfs_remove(e->dyn_debug_dentries[i]);
} | false | false | false | false | false | 0 |
CmpOpenFile(char *name, int *flag)
{
FILE *fp;
DecompRec *rec;
char str[256];
*flag = 0;
if (strcmp(name, "-") == 0) {
/* use standard input */
*flag = 2;
return stdin;
}
if ((rec = CmpSearchFile(name)) != NULL) {
if (strstr(rec->format, "%s") != NULL)
sprintf(str, rec->format, name);
else
sprin... | false | false | false | false | false | 0 |
gsl_sum_levin_utrunc_minmax (const double *array,
const size_t array_size,
const size_t min_terms,
const size_t max_terms,
gsl_sum_levin_utrunc_workspace * w,
double *sum_acce... | false | false | false | false | false | 0 |
dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
{
unsigned long dma_sync_wait_timeout = jiffies + msecs_to_jiffies(5000);
if (!tx)
return DMA_COMPLETE;
while (tx->cookie == -EBUSY) {
if (time_after_eq(jiffies, dma_sync_wait_timeout)) {
pr_err("%s timeout waiting for descriptor submission\n",
... | false | false | false | false | false | 0 |
UCS4toUTF8(unsigned long long ucs4) {
string utf;
if (ucs4 <= 0x7fULL) {
utf.push_back(ucs4);
} else if (ucs4 <= 0x7ffULL) {
utf.push_back(0xc0 | (ucs4 >> 6));
utf.push_back(0x80 | (ucs4 & 0x3f));
} else if (ucs4 <= 0xffffULL) {
utf.push_back(0xe0 | (ucs4 >> 12));
utf.push_back(0x80 | ((ucs4 >> 6... | false | false | false | false | false | 0 |
range_trans_free(void *elem)
{
if (elem != NULL) {
poldiff_range_trans_t *rt = (poldiff_range_trans_t *) elem;
free(rt->source);
free(rt->target);
free(rt->target_class);
range_destroy(&rt->range);
free(rt);
}
} | false | false | false | false | false | 0 |
AddRotamer(double *c)
{
int idx,size;
double angle,res=255.0/360.0;
vector3 v1,v2,v3,v4;
unsigned char *rot = new unsigned char [_vrotor.size()+1];
rot[0] = (char) 0;
vector<pair<OBAtom**,vector<int> > >::iterator i;
for (size=1,i = _vrotor.begin();i != _vrotor.end();++i,++size)
{
... | false | false | false | false | false | 0 |
encr_data(unsigned char data[], unsigned long d_len, fcrypt_ctx cx[1])
{
unsigned long i = 0, pos = cx->encr_pos;
while(i < d_len)
{
if(pos == BLOCK_SIZE)
{ unsigned int j = 0;
/* increment encryption nonce */
while(j < 8 && !++cx->nonce[j])
... | false | false | false | false | false | 0 |
push (const unsigned char *string, char punc, hash_table *table, pword *prev)
{
pword *pword = intern (string, table);
int terminal = 0;
if (!pword) return 0;
pword->count++;
if (!prev)
pword->start++;
else if (isupper(*string))
pword->cap++;
switch (punc)
{
case ',': pword->comma++; br... | false | false | false | false | false | 0 |
fltest(int fd, pid_t *pid)
{
struct flock lock;
memset(&lock, 0, sizeof lock);
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
if (fcntl(fd, F_GETLK, &lock) == -1)
return (-1);
if (lock.l_type == F_UNLCK)
return (0);
if (pid != NULL)
*pid = lock.l_pid;
return (1);
} | false | false | false | false | false | 0 |
bcma_modinit(void)
{
int err;
err = bus_register(&bcma_bus_type);
if (err)
return err;
err = bcma_host_soc_register_driver();
if (err) {
pr_err("SoC host initialization failed\n");
err = 0;
}
#ifdef CONFIG_BCMA_HOST_PCI
err = bcma_host_pci_init();
if (err) {
pr_err("PCI host initialization failed\n");... | false | false | false | false | false | 0 |
spawn_resp_pack(spawn_resp_t *resp, Buf buf)
{
int i;
pack32(resp->seq, buf);
pack32((uint32_t)resp->rc, buf);
pack16((uint16_t)resp->pmi_port, buf);
packstr(resp->jobid, buf);
pack32(resp->error_cnt, buf);
for (i = 0; i < resp->error_cnt; i ++) {
pack32((uint32_t)resp->error_codes[i], buf);
}
} | false | false | false | false | false | 0 |
check()
{
const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase();
// Check function scopes
const std::size_t functions = symbolDatabase->functionScopes.size();
for (std::size_t i = 0; i < functions; ++i) {
const Scope * scope = symbolDatabase->functionScopes[i];
// Empty... | false | false | false | false | false | 0 |
init_hostname(struct pine *ps)
{
char hostname[MAX_ADDRESS+1], domainname[MAX_ADDRESS+1];
getdomainnames(hostname, sizeof(hostname)-1,
domainname, sizeof(domainname)-1);
if(ps->hostname)
fs_give((void **)&ps->hostname);
ps->hostname = cpystr(hostname);
if(ps->localdomain)
fs_giv... | false | false | false | false | false | 0 |
clutter_alpha_set_closure_internal (ClutterAlpha *alpha,
GClosure *closure)
{
ClutterAlphaPrivate *priv = alpha->priv;
if (priv->notify != NULL)
priv->notify (priv->user_data);
else if (priv->closure != NULL)
g_closure_unref (priv->closure);
priv->func = NULL;
... | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdf5lib_H5_H5Pget
(JNIEnv *env, jclass clss, jint plid, jstring name)
{
char *cstr;
jboolean isCopy;
jint val;
jint retVal = -1;
if (name == NULL) {
h5nullArgument(env, "H5Pget: name is NULL");
return -1;
}
cstr = (char *)ENVPTR->GetStringUTFChars... | false | false | false | false | false | 0 |
dump (void)
{
int i;
printf ( "#define FC_NUM_CASE_FOLD %d\n", nfolds);
printf ( "#define FC_NUM_CASE_FOLD_CHARS %d\n", nfoldChars);
printf ( "#define FC_MAX_CASE_FOLD_CHARS %d\n", maxFoldChars);
printf ( "#define FC_MAX_CASE_FOLD_EXPAND %d\n", maxExpand);
printf ( "#define FC... | false | false | false | false | false | 0 |
countPath(parsedata * pdata) {
g2sstats *stats = pdata->prop->stats;
pathattr *pattr = pdata->pattr;
if (!strcmp(pdata->current->name, "trkseg")) {
stats->trkcount++;
stats->trklength += pattr->length;
stats->trkpoints += pattr->count;
} else {
stats->rtecount++;
stats->rtelength += pattr->length;
stats... | false | false | false | false | false | 0 |
Evaluate(const std::vector<std::string> &,
cmGeneratorExpressionContext *context,
const GeneratorExpressionContent *,
cmGeneratorExpressionDAGChecker *) const
{
context->HadContextSensitiveCondition = true;
return context->Config ? context->... | false | false | false | false | false | 0 |
opencontrolscript (char *name)
{
auto int pfd[2];
int comppid;
char *label;
*uncompto='\000'; /* for -v output on restore, verify */
if(controlscript == NULL )
{
/* ignore data */
warnarch("No -D option given, ignoring control file.",(off_t)0);
return open("/dev/null",O_WRONLY);
}
... | false | false | false | false | false | 0 |
CreateMachineInstr(const TargetInstrDesc &TID,
DebugLoc DL, bool NoImp) {
return new (InstructionRecycler.Allocate<MachineInstr>(Allocator))
MachineInstr(TID, DL, NoImp);
} | false | false | false | false | false | 0 |
do_8051_command(
struct hfi1_devdata *dd,
u32 type,
u64 in_data,
u64 *out_data)
{
u64 reg, completed;
int return_code;
unsigned long flags;
unsigned long timeout;
hfi1_cdbg(DC8051, "type %d, data 0x%012llx", type, in_data);
/*
* Alternative to holding the lock for a long time:
* - keep busy wait - have ... | false | false | false | false | false | 0 |
lightdm_user_list_get_user_by_name (LightDMUserList *user_list, const gchar *username)
{
GList *link;
g_return_val_if_fail (LIGHTDM_IS_USER_LIST (user_list), NULL);
g_return_val_if_fail (username != NULL, NULL);
initialize_user_list_if_needed (user_list);
for (link = GET_LIST_PRIVATE (user_list)-... | false | false | false | false | false | 0 |
upap_lowerdown(int unit)
{
upap_state *u = &upap[unit];
if (u->us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */
UNTIMEOUT(upap_timeout, (caddr_t) u); /* Cancel timeout */
if (u->us_serverstate == UPAPSS_LISTEN && u->us_reqtimeout > 0)
UNTIMEOUT(upap_reqtimeout, (caddr_t) u);
u->us_clientstat... | false | false | false | false | false | 0 |
OpGetState()
{
dac_getstate_it in ;
dac_getstate_ot out ;
process_t *p_p ;
/* obtain process name */
if (!readn(newsock, (char *)&in, sizeof(dac_getstate_it)))
return ;
out.status = htons(FAILURE) ; /* assume error */
out.error = htons(DAC_ER_NOPROCESS) ;
/* locate process and return st... | false | false | false | false | false | 0 |
fuse_fsyncdir (xlator_t *this, fuse_in_header_t *finh, void *msg)
{
struct fuse_fsync_in *fsi = msg;
fuse_state_t *state = NULL;
fd_t *fd = NULL;
fd = FH_TO_FD (fsi->fh);
GET_STATE (this, finh, state);
state->fd = fd;
fuse_resolve_fd_init (state, &stat... | false | false | false | false | false | 0 |
Crossfire_Region_InternalCompare(Crossfire_Region *left, Crossfire_Region *right) {
return (left->reg < right->reg ? -1 : (left->reg == right->reg ? 0 : 1));
} | false | false | false | false | false | 0 |
_ds_push_boundary (struct nt *stack, const char *boundary)
{
char *y;
if (boundary == NULL || boundary[0] == 0)
return EINVAL;
y = malloc (strlen (boundary) + 3);
if (y == NULL)
return EUNKNOWN;
sprintf (y, "--%s", boundary);
nt_add (stack, (char *) y);
free(y);
return 0;
} | false | true | false | false | false | 1 |
lam_ssi_rpi_base_alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
{
void *ret = malloc(size);
if (ret == 0)
return LAMERROR;
*((void **) baseptr) = ret;
return MPI_SUCCESS;
} | false | false | false | false | false | 0 |
ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int ref_to, int response, const void *data, int size)
{
Ecore_Ipc_Msg_Head msg;
int ret;
int *head, md = 0, d, s;
unsigned char dat[sizeof(Ecore_Ipc_Msg_Head)];
if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT))
{
E... | false | false | false | false | true | 1 |
GDALSerializeApproxTransformer( void *pTransformArg )
{
CPLXMLNode *psTree;
ApproxTransformInfo *psInfo = (ApproxTransformInfo *) pTransformArg;
psTree = CPLCreateXMLNode( NULL, CXT_Element, "ApproxTransformer" );
/* -------------------------------------------------------------------- */
/* Attach m... | false | false | false | false | false | 0 |
replaceMove(const Move& move, const QString& annotation, NagSet nags, bool bReplace)
{
int node;
node = m_moveNodes[m_currentNode].nextNode;
setModified(true);
if(node == NO_MOVE)
{
addMove(move, annotation, nags);
return true;
}
//replace node data with new move
m_moveN... | false | false | false | false | false | 0 |
anjuta_recent_chooser_menu_set_current_uri (GtkRecentChooser *chooser,
const gchar *uri,
GError **error)
{
AnjutaRecentChooserMenu *menu = ANJUTA_RECENT_CHOOSER_MENU (chooser);
GList *children, *l;
GtkWidget *menu_item = NULL;
gboolean found = FALSE;
children = gtk_container_ge... | false | false | false | false | false | 0 |
syshelpform(const char *sofar, const int hf)
{
unsigned ucnt, sfl = 0;
char **result, **rp;
if (sofar)
sfl = strlen(sofar);
/* There cannot be more form types than the number of users can there.... */
result = (char **) malloc((Nusers + 1) * sizeof(char *));
if (!result)
return result;
rp = result;
f... | false | true | false | false | false | 1 |
natural_list (cholmod_factor *L)
{
Int head, tail, n, j ;
Int *Lnext, *Lprev ;
Lnext = L->next ;
Lprev = L->prev ;
ASSERT (Lprev != NULL && Lnext != NULL) ;
n = L->n ;
head = n+1 ;
tail = n ;
Lnext [head] = 0 ;
Lprev [head] = EMPTY ;
Lnext [tail] = EMPTY ;
Lprev [tail] = ... | false | false | false | false | false | 0 |
StatusChanged(std::string PackageName,
unsigned int xStepsDone,
unsigned int xTotalSteps,
std::string message)
{
StepsDone = xStepsDone;
StepsTotal = xTotalSteps;
// build th... | false | false | false | false | false | 0 |
getDatumCopy(BuildAccumulator *accum, OffsetNumber attnum, Datum value)
{
Form_pg_attribute att = accum->ginstate->origTupdesc->attrs[attnum - 1];
Datum res;
if (att->attbyval)
res = value;
else
{
res = datumCopy(value, false, att->attlen);
accum->allocatedMemory += GetMemoryChunkSpace(DatumGetPointer(res)... | false | false | false | false | false | 0 |
ParseLV3MappingChannel(unsigned int iChannel, ASE::Mesh& mesh)
{
AI_ASE_PARSER_INIT();
unsigned int iNumTVertices = 0;
unsigned int iNumTFaces = 0;
while (true)
{
if ('*' == *filePtr)
{
++filePtr;
// Number of texture coordinates in the mesh
if (TokenMatch(filePtr,"MESH_NUMTVERTEX" ,15))
{
Pa... | false | false | false | false | false | 0 |
aglasterr()
{
long endpos;
long len;
char *buf;
if (!agerrout)
return 0;
fflush(agerrout);
endpos = ftell(agerrout);
len = endpos - aglast;
buf = (char*)malloc(len + 1);
fseek(agerrout, aglast, SEEK_SET);
fread(buf, sizeof(char), len, agerrout);
buf[len] = '\0';
fseek(a... | false | false | false | false | false | 0 |
handle_unit_type_upgrade(struct player *pplayer, Unit_type_id uti)
{
struct unit_type *to_unittype;
struct unit_type *from_unittype = utype_by_number(uti);
int number_of_upgraded_units = 0;
if (NULL == from_unittype) {
/* Probably died or bribed. */
log_verbose("handle_unit_type_upgrade() invalid unit ... | false | false | false | false | false | 0 |
m68k_execute (void)
{
#ifdef USE_JIT
m68k_execute_depth++;
#endif
#ifdef DEBUGGER
VOLATILE bool after_exception = false;
#endif
setjmpagain:
TRY(prb) {
for (;;) {
if (quit_program > 0) {
if (quit_program == 1) {
#if FLIGHT_RECORDER
dump_log();
#endif
break;
}
quit_program = 0;
m68... | false | false | false | false | false | 0 |
tp_heap_extract_first (TpHeap * heap)
{
g_return_val_if_fail (heap != NULL, NULL);
if (heap->data->len == 0)
return NULL;
return extract_element (heap, 1);
} | false | false | false | false | false | 0 |
handle_kill( pid_t pid, pid_state *state )
{
pid_t child=(pid_t)state->context_state[1];
if( verify_permission( pid, state ) ) {
dlog("handle_kill: %d is sending a kill to " PID_F "\n", pid, child );
ptlib_continue(PTRACE_KILL, child, 0);
ptlib_set_retval( pid, 0 );
} else {
... | false | false | false | false | false | 0 |
NewIterator()
{
if (!this->Valid) return NULL;
vtkUnstructuredGridBunykRayCastIterator *iterator
= vtkUnstructuredGridBunykRayCastIterator::New();
iterator->SetRayCastFunction(this);
return iterator;
} | false | false | false | false | false | 0 |
check_dow(pval *DOW)
{
char *dow;
char *c;
/* The following line is coincidence, really! */
int s, e;
dow = ast_strdupa(DOW->u1.str);
/* Check for all days */
if (ast_strlen_zero(dow) || !strcmp(dow, "*"))
return;
/* Get start and ending days */
c = strchr(dow, '-');
if (c) {
*c = '\0';
c++;
} else
... | false | false | false | false | false | 0 |
do_accept(struct tcb *tcp, int flags_arg)
{
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
return 0;
}
if (!tcp->u_arg[2])
tprintf("%#lx, NULL", tcp->u_arg[1]);
else {
int len;
if (tcp->u_arg[1] == 0 || syserror(tcp)
|| umove (tcp, tcp->u_arg[2], &len) < 0) {
tprintf("%#lx", tcp->u_arg[1])... | false | false | false | false | false | 0 |
ath6kl_htc_pipe_add_rxbuf_multiple(struct htc_target *target,
struct list_head *pkt_queue)
{
struct htc_packet *packet, *tmp_pkt, *first;
struct htc_endpoint *ep;
int status = 0;
if (list_empty(pkt_queue))
return -EINVAL;
first = list_first_entry(pkt_queue, struct htc_packet, list);
if (first->end... | false | false | false | false | false | 0 |
get_default_param_value_blobs (MonoMethod *method, char **blobs, guint32 *types)
{
guint32 param_index, i, lastp, crow = 0;
guint32 param_cols [MONO_PARAM_SIZE], const_cols [MONO_CONSTANT_SIZE];
gint32 idx;
MonoClass *klass = method->klass;
MonoImage *image = klass->image;
MonoMethodSignature *methodsig = mono_m... | false | false | false | false | false | 0 |
do_cmd_wiz_hack_ben(void)
{
int py = p_ptr->py;
int px = p_ptr->px;
int i, y, x;
for (i = 0; i < MONSTER_FLOW_DEPTH; ++i)
{
/* Update map */
for (y = Term->offset_y; y < Term->offset_y + SCREEN_HGT; y++)
{
for (x = Term->offset_x; x < Term->offset_x + SCREEN_WID; x++)
{
byte a = TERM_RED;
i... | false | false | false | false | false | 0 |
j2k_read_header(
opj_j2k_t *p_j2k,
struct opj_image ** p_image,
OPJ_INT32 * p_tile_x0,
OPJ_INT32 * p_tile_y0,
OPJ_UINT32 * p_tile_width,
OPJ_UINT32 * p_tile_height,
OPJ_UINT32 * p_nb_tiles_x,
... | false | false | false | false | false | 0 |
vAdd2FontInfoList(const font_block_type *pFontBlock)
{
font_mem_type *pListMember;
fail(pFontBlock == NULL);
NO_DBG_MSG("bAdd2FontInfoList");
if (pFontBlock->ulFileOffset == FC_INVALID) {
/*
* This offset is really past the end of the file,
* so don't waste any memory by storing it.
*/
return;
}
... | false | false | false | false | false | 0 |
xmms_strlist_len (char **data)
{
int i;
if (data == NULL)
abort ();
for (i = 0; data[i] != NULL; i++);
return i;
} | false | false | false | false | false | 0 |
gst_rtp_g729_pay_change_state (GstElement * element, GstStateChange transition)
{
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
/* handle upwards state changes here */
switch (transition) {
default:
break;
}
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
/* h... | false | false | false | false | false | 0 |
guc_l_pipe_to_stack_str(
char * in_str)
{
globus_list_t * list;
globus_list_t * r_list = NULL;
char * pipe_str;
char * del_choices = "#$^*!|%&()'{}";
char * ... | false | false | false | false | false | 0 |
openstdlibs (lua_State *l) {
const luaL_reg *lib = lualibs;
for (; lib->func; lib++) {
lib->func(l); /* open library */
lua_settop(l, 0); /* discard any results */
}
} | false | false | false | false | false | 0 |
mgmt_confirm_name(int index, bdaddr_t *bdaddr, uint8_t bdaddr_type,
gboolean name_known)
{
char buf[MGMT_HDR_SIZE + sizeof(struct mgmt_cp_confirm_name)];
struct mgmt_hdr *hdr = (void *) buf;
struct mgmt_cp_confirm_name *cp = (void *) &buf[sizeof(*hdr)];
char addr[18];
ba2str(bdaddr, addr);
DBG("hci%d bdad... | true | true | false | false | false | 1 |
qlcnic_sriov_vlan_operation(struct qlcnic_vf_info *vf, u16 vlan_id,
enum qlcnic_vlan_operations opcode)
{
struct qlcnic_adapter *adapter = vf->adapter;
struct qlcnic_sriov *sriov;
sriov = adapter->ahw->sriov;
if (!vf->sriov_vlans)
return;
spin_lock_bh(&vf->vlan_list_lock);
switch (opcode) {
case QLC_V... | false | false | false | false | false | 0 |
bpred_dir_config(
struct bpred_dir_t *pred_dir, /* branch direction predictor instance */
char name[], /* predictor name */
FILE *stream) /* output stream */
{
switch (pred_dir->class) {
case BPred2Level:
fprintf(stream,
"pred_dir: %s: 2-lvl: %d l1-sz, %d bits/ent, %s xor, %d l2-sz, direct-mappe... | false | false | false | false | false | 0 |
SetStatistics( double dfMin, double dfMax, double dfMean, double dfStdDev )
{
// avoid churn if nothing is changing.
if( dfMin == this->dfMin
&& dfMax == this->dfMax
&& dfMean == this->dfMean
&& dfStdDev == this->dfStdDev )
return CE_None;
this->dfMin = dfMin;
this->dfMa... | false | false | false | false | false | 0 |
dump_cselib_val (void **x, void *info)
{
cselib_val *v = (cselib_val *)*x;
FILE *out = (FILE *)info;
bool need_lf = true;
print_inline_rtx (out, v->val_rtx, 0);
if (v->locs)
{
struct elt_loc_list *l = v->locs;
if (need_lf)
{
fputc ('\n', out);
need_lf = false;
}
fputs (" locs:"... | false | false | false | false | false | 0 |
print_mpi_line (const char *label, gcry_mpi_t a)
{
unsigned char *buf, *p;
gcry_error_t err;
int writerr = 0;
if (with_labels && label)
printf ("%s = ", label);
err = gcry_mpi_aprint (GCRYMPI_FMT_HEX, &buf, NULL, a);
if (err)
die ("gcry_mpi_aprint failed: %s\n", gpg_strerror (err));
p = buf;
... | false | false | false | false | false | 0 |
act_closepath(int cmd)
{
Type1CharstringGenInterp::act_closepath(cmd);
Type1Charstring result;
Type1CharstringGenInterp::intermediate_output(result);
_sections.push_back(result.data_string());
_bounds.resize(_bounds.size() + 4);
int width_crap;
_boundser.output(_bounds.end() - 4, width_crap)... | false | false | false | false | false | 0 |
add_textbox(Fixed& fbox, RefPtr<Pixmap>& pm,
int xoffset, int yoffset, int lines,
int width, int height) {
Textbox* db = manage(new Textbox(width, height, lines));
fbox.put(*db, xoffset, yoffset);
int w, h;
db->get_size_request(w, h);
RefPtr<Style> s = db->get_style()->copy();
RefPtr<Pixm... | 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.