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 |
|---|---|---|---|---|---|---|
defaultMain(int argc,char * argv[])
{
bool final = true;
for (std::vector<svutTestCaseBuilder *>::iterator it = __fake_svut_test_cases_register__.begin(); it != __fake_svut_test_cases_register__.end() ; ++it)
{
svutTestCase * test = (*it)->build();
cout << "--------------";
cout.width(30);
cout.setf(ios::lef... | false | false | false | false | false | 0 |
wacom_allocate_input(struct wacom *wacom)
{
struct input_dev *input_dev;
struct hid_device *hdev = wacom->hdev;
struct wacom_wac *wacom_wac = &(wacom->wacom_wac);
input_dev = input_allocate_device();
if (!input_dev)
return NULL;
input_dev->name = wacom_wac->features.name;
input_dev->phys = hdev->phys;
input... | false | false | false | false | false | 0 |
map_internal_clock(struct mlx4_dev *dev)
{
struct mlx4_priv *priv = mlx4_priv(dev);
priv->clock_mapping =
ioremap(pci_resource_start(dev->persist->pdev,
priv->fw.clock_bar) +
priv->fw.clock_offset, MLX4_CLOCK_SIZE);
if (!priv->clock_mapping)
return -ENOMEM;
return 0;
} | false | false | false | false | false | 0 |
edd_populate_dir(struct edd_device * edev)
{
struct edd_attribute * attr;
int error = 0;
int i;
for (i = 0; (attr = edd_attrs[i]) && !error; i++) {
if (!attr->test ||
(attr->test && attr->test(edev)))
error = sysfs_create_file(&edev->kobj,&attr->attr);
}
if (!error) {
edd_create_symlink_to_pcidev(e... | false | false | false | false | false | 0 |
prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
gpointer data)
{
QuotePage *prefs_quote = (QuotePage *) _page;
GtkWidget *vbox;
GtkWidget *vbox2;
GtkWidget *notebook;
vbox = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox);
notebook = gtk_notebook_new();
gtk_widget_show(notebook)... | false | false | false | false | false | 0 |
getcode(enum HandlerTypes slot, char* func_name, int lineno)
{
if (handler_info[slot].tb_code == NULL) {
handler_info[slot].tb_code =
PyCode_NewEmpty(__FILE__, func_name, lineno);
}
return handler_info[slot].tb_code;
} | false | false | false | false | false | 0 |
podcast_store__reorder_cb(gpointer data) {
GtkWidget * dialog;
GtkWidget * label;
GtkWidget * list;
GtkWidget * viewport;
GtkListStore * store;
GtkCellRenderer * renderer;
GtkTreeViewColumn * column;
GtkTreeIter store_iter;
GtkTreeIter pod_iter;
GtkTreeIter list_iter;
int i, res;
dialog = gtk_dia... | false | false | false | false | false | 0 |
j2k_read_ppt(opj_j2k_t *j2k) {
int len, Z_ppt, i, j = 0;
opj_cp_t *cp = j2k->cp;
opj_tcp_t *tcp = cp->tcps + j2k->curtileno;
opj_cio_t *cio = j2k->cio;
len = cio_read(cio, 2);
Z_ppt = cio_read(cio, 1);
tcp->ppt = 1;
if (Z_ppt == 0) { /* First PPT marker */
tcp->ppt_data = (unsigned char *) opj_malloc((len ... | false | true | false | false | false | 1 |
get_feat_caps(u32 *bitmap, enum place_holder_in_cap_bitmap cap)
{
int arr_idx, bit_idx;
int ret = 0;
if (cap < 0 || cap > 127) {
wcn36xx_warn("error cap idx %d\n", cap);
return -EINVAL;
}
arr_idx = cap / 32;
bit_idx = cap % 32;
ret = (bitmap[arr_idx] & (1 << bit_idx)) ? 1 : 0;
return ret;
} | false | false | false | false | false | 0 |
GetTeamIndex(const TM_Team *team) const
{
unsigned int i;
for (i=0; i < teams.Size(); i++)
{
if (teams[i]==team)
return i;
}
return (unsigned int) -1;
} | false | false | false | false | false | 0 |
pcifront_try_disconnect(struct pcifront_device *pdev)
{
int err = 0;
enum xenbus_state prev_state;
prev_state = xenbus_read_driver_state(pdev->xdev->nodename);
if (prev_state >= XenbusStateClosing)
goto out;
if (prev_state == XenbusStateConnected) {
pcifront_free_roots(pdev);
pcifront_disconnect(pdev);
... | false | false | false | false | false | 0 |
load_data_load_next_folder (LoadData *load_data)
{
GthFolderTree *folder_tree;
GFile *folder_to_load = NULL;
folder_tree = GTH_FOLDER_TREE (load_data->browser->priv->folder_tree);
do {
GtkTreePath *path;
if (load_data->current == NULL)
load_data->current = load_data->list;
else
load_data->curr... | false | false | false | false | false | 0 |
inthash_dup_name(inthash hashtable, const char *name) {
return hashtable->custom.key.dup == NULL
? inthash_dup_name_internal(hashtable, name)
: hashtable->custom.key.dup(hashtable->custom.key.arg, name);
} | false | false | false | false | false | 0 |
writeMaterial(const video::SMaterial& material)
{
// simply use irrlichts built-in attribute serialization capabilities here:
io::IAttributes* attributes =
VideoDriver->createAttributesFromMaterial(material);
if (attributes)
{
attributes->write(Writer, false, L"material");
attributes->drop();
}
... | false | false | false | false | false | 0 |
pvTimerGetTimerID( const TimerHandle_t xTimer )
{
Timer_t * const pxTimer = ( Timer_t * ) xTimer;
void *pvReturn;
configASSERT( xTimer );
taskENTER_CRITICAL();
{
pvReturn = pxTimer->pvTimerID;
}
taskEXIT_CRITICAL();
return pvReturn;
} | false | false | false | true | false | 1 |
send(const void* message, size_type length, int flags) const
{
ssize_t ret = ::send(getFd(), message, length, flags);
if (ret < 0)
throw SystemError("send");
return static_cast<size_type>(ret);
} | false | false | false | false | false | 0 |
getType(const std::string& path)
{
FileIo fileIo(path);
return getType(fileIo);
} | false | false | false | false | false | 0 |
generateBinOp(Tree sig, int opcode, Tree arg1, Tree arg2)
{
return generateCacheCode(sig, subst("($0 $1 $2)", CS(arg1), gBinOpTable[opcode]->fName, CS(arg2)));
} | false | false | false | false | false | 0 |
freeDoc(struct document *doc)
{
int i;
if (doc) {
for (i=0; i<doc->numpages; i++) {
if (doc->pages[i].label) free(doc->pages[i].label);
}
for (i=0; i<doc->nummedia; i++) {
if (doc->media[i].name) free(doc->media[i].name);
}
if (doc->title) free(doc->title);
if (doc->date) free(doc->date);
if (... | false | false | false | false | false | 0 |
eventMouseButtonDown (const SDL_MouseButtonEvent *button)
{
if ( button->type == SDL_MOUSEBUTTONDOWN && button->button == SDL_BUTTON_LEFT ) {
itemMarked( this );
Update();
return true;
}
return false;
} | false | false | false | false | false | 0 |
DGNCreateSolidHeaderFromGroup( DGNHandle hDGN, int nType, int nSurfType,
int nBoundElems, int nNumElems,
DGNElemCore **papsElems )
{
int nTotalLength = 6;
int i, nLevel;
DGNElemCore *psCH;
DGNPoint sMin = {0.0,0.0,0.0}, s... | false | true | false | false | false | 1 |
LoadConstants (lua_State* L, Proto* tf, ZIO* Z, int swap)
{
int i,n;
tf->nkstr=n=LoadInt(L,Z,swap);
tf->kstr=luaM_newvector(L,n,TString*);
for (i=0; i<n; i++)
tf->kstr[i]=LoadString(L,Z,swap);
tf->nknum=n=LoadInt(L,Z,swap);
tf->knum=luaM_newvector(L,n,Number);
LoadVector(L,tf->knum,n,sizeof(*tf->knum),Z,swap);... | false | false | false | false | false | 0 |
qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter)
{
struct device *dev = &adapter->pdev->dev;
device_remove_bin_file(dev, &bin_attr_port_stats);
if (adapter->ahw->op_mode == QLCNIC_NON_PRIV_FUNC)
return;
device_remove_file(dev, &dev_attr_diag_mode);
device_remove_bin_file(dev, &bin_attr_crb);
device_... | false | false | false | false | false | 0 |
getsnac(GET_ARGS, struct snac *rc)
{
GET_CHECK_P(sizeof(struct snac))
GET_TYPE(struct snac)
rc->family = ntohs(rc->family);
rc->subtype = ntohs(rc->subtype);
rc->flags = ntohs(rc->flags);
rc->requestid = ntohl(rc->requestid);
return true;
} | false | false | false | false | false | 0 |
SetReadHandler(int32 start, int32 end, readfunc func)
{
int32 x;
if(!func)
func=ANull;
if(RWWrap)
for(x=end;x>=start;x--)
{
if(x>=0x8000)
AReadG[x-0x8000]=func;
else
ARead[x]=func;
}
else
for(x=end;x>=start;x--)
ARead[x]=func;
} | false | false | false | false | false | 0 |
ompfbe_get_oneway_sync_index(Sync_table *sync_head,int entry)
{
Sync_table *sypt = NULL;
int count = 0;
if (sync_head == NULL)
return 0;
for (sypt = sync_head; sypt; sypt=sypt->next) {
//if (sypt->oneway == TRUE) count++;
if (sypt->sync == TRUE || sypt->oneway) count++;
if (sypt->entry == entry) br... | false | false | false | false | false | 0 |
nfs4_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
{
dprintk("--> %s\n", __func__);
if (!nfs4_sequence_done(task, &hdr->res.seq_res))
return -EAGAIN;
if (nfs4_read_stateid_changed(task, &hdr->args))
return -EAGAIN;
return hdr->pgio_done_cb ? hdr->pgio_done_cb(task, hdr) :
nfs4_read_don... | false | false | false | false | false | 0 |
getmore(char * buf, int lng, struct keymap_sparse * ksp)
{
int ch;
for (;;) {
if (lng <= 0) {
lng = read_buf(buf);
if (lng == 0)
return EOF;
}
ch = buf[0] & (MAPSIZE - 1);
for (; ksp; ksp = ksp->ks_next)
if (ch == ksp->ks_char)
goto found;
doerror(Ew, 9008); /* {Undef key seq} *... | false | false | false | false | false | 0 |
get_bit(unsigned int bit_number)
{
unsigned int v = getReplaced()->get();
unsigned int mask = 1<<(bit_number & 7);
if( (break_mask & mask) && (v & mask) == (break_value&mask))
invokeAction();
return getReplaced()->get_bit(bit_number);
} | false | false | false | false | false | 0 |
cleanDelete()
{
delete m_notNumber;
delete m_number;
delete this;
} | false | false | false | false | false | 0 |
ipmi_pef_config_lan_alert_destination_section_get (ipmi_pef_config_state_data_t *state_data,
unsigned int num,
unsigned int config_flags,
int channel_index)
{
struct config_section *section = NULL;
char section_name_base[CONFIG_MAX_SECTION_NAME_LEN];
assert (state_data);
assert (num)... | false | false | false | false | false | 0 |
fwdgetnexttwobitencodingstoppos(GtEncseqReader *esr)
{
if (gt_encseq_has_specialranges(esr->encseq))
{
if (esr->encseq->sat == GT_ACCESS_TYPE_EQUALLENGTH)
{
return fwdgetnexttwobitencodingstopposViaequallength(esr->encseq,
esr->currentpos);
... | false | false | false | false | false | 0 |
gst_util_fraction_add (gint a_n, gint a_d, gint b_n, gint b_d, gint * res_n,
gint * res_d)
{
gint gcd;
g_return_val_if_fail (res_n != NULL, FALSE);
g_return_val_if_fail (res_d != NULL, FALSE);
g_return_val_if_fail (a_d != 0, FALSE);
g_return_val_if_fail (b_d != 0, FALSE);
gcd = gst_util_greatest_commo... | false | false | false | false | false | 0 |
checkout_submodule(
checkout_diff_data *data,
const git_diff_file *file)
{
/* Until submodules are supported, UPDATE_ONLY means do nothing here */
if ((data->opts->checkout_strategy & GIT_CHECKOUT_UPDATE_ONLY) != 0)
return 0;
if (git_futils_mkdir(
file->path, git_repository_workdir(data->repo),
data->opts... | false | false | false | false | false | 0 |
printk(char *msg, ...)
{
char buf[256];
int len;
va_list args;
va_start(args, msg);
len = vsnprintf(buf, sizeof(buf), msg, args);
va_end(args);
if (test_run)
fprintf(stderr, "%s", buf);
else
send_message(USERUI_MSG_PRINTK, buf, len + 1);
} | false | false | false | false | false | 0 |
try_to_free_mem_cgroup_pages(struct mem_cgroup *memcg,
unsigned long nr_pages,
gfp_t gfp_mask,
bool may_swap)
{
struct zonelist *zonelist;
unsigned long nr_reclaimed;
int nid;
struct scan_control sc = {
.nr_to_reclaim = max(nr_pages, SWAP_CLUSTER_MAX),
.gfp_mask = (gfp_mask & GFP_RECLAIM... | false | false | false | false | false | 0 |
__padata_add_cpu(struct padata_instance *pinst, int cpu)
{
struct parallel_data *pd;
if (cpumask_test_cpu(cpu, cpu_online_mask)) {
pd = padata_alloc_pd(pinst, pinst->cpumask.pcpu,
pinst->cpumask.cbcpu);
if (!pd)
return -ENOMEM;
padata_replace(pinst, pd);
if (padata_validate_cpumask(pinst, pinst... | false | false | false | false | false | 0 |
gst_aiff_mux_set_caps (GstAiffMux * aiffmux, GstCaps * caps)
{
GstCaps *outcaps;
GstAudioInfo info;
if (aiffmux->sent_header) {
GST_WARNING_OBJECT (aiffmux, "cannot change format mid-stream");
return FALSE;
}
GST_DEBUG_OBJECT (aiffmux, "got caps: %" GST_PTR_FORMAT, caps);
if (!gst_audio_info_from... | false | false | false | false | false | 0 |
mtx_transform_pg(polygon_node_t *polygon_node)
{
int i;
int clipped = 0;
float scale;
float d_sum = 0.0;
polygon_t *polygon = polygon_node->polygon;
for (i = polygon->npoints-1; i >= 0; i--)
{
real_point_t scrn_pt;
int_point_t *int_pt = polygon->int_points+i;
/* Tanslate and ro... | false | false | false | false | false | 0 |
ipro_AddBox(GF_Box *s, GF_Box *a)
{
GF_ItemProtectionBox *ptr = (GF_ItemProtectionBox *)s;
if (a->type == GF_ISOM_BOX_TYPE_SINF)
return gf_list_add(ptr->protection_information, a);
else
return gf_isom_box_add_default(s, a);
} | false | false | false | false | false | 0 |
parse_boolean_value(const char **string) {
size_t true_token_size = SIZEOF_TOKEN("true");
size_t false_token_size = SIZEOF_TOKEN("false");
if (strncmp("true", *string, true_token_size) == 0) {
*string += true_token_size;
return json_value_init_boolean(1);
} else if (strncmp("false", *str... | false | false | false | false | false | 0 |
ZMpvAxisAngleRep( const HepAxisAngle & aa, double array[] ) {
register double sinDelta = std::sin( aa.delta() );
register double cosDelta = std::cos( aa.delta() );
register double oneMinusCosDelta = 1.0 - cosDelta;
register double uX = aa.getAxis().getX();
register double uY = aa.getAxis().getY();
registe... | false | false | false | false | false | 0 |
transaction_xdata(const transaction_t& xact)
{
if (! xact.data)
xact.data = new transaction_xdata_t();
return *((transaction_xdata_t *) xact.data);
} | false | false | false | false | false | 0 |
e_cal_util_priority_to_string (gint priority)
{
const gchar *retval;
if (priority <= 0)
retval = "";
else if (priority <= 4)
retval = C_("Priority", "High");
else if (priority == 5)
retval = C_("Priority", "Normal");
else if (priority <= 9)
retval = C_("Priority", "Low");
else
retval = "";
return ret... | false | false | false | false | false | 0 |
operator=(const BitArray &right)
{
if ( &right != this ) { // avoid self assignment
delete [] Data; // prevents memory leak
Count = right.Count;
Data = new unsigned char[ (Count+7)>>3 ];
memcpy(Data, right.Data, (Count+7)>>3);
}
return *this; // enables cascaded assignments
}
} | false | false | false | false | false | 0 |
cmd_prompt (int interactive UNUSED, struct cmdarg **args)
{
cmdret *ret;
char *query, *output, *prefix;
if (args[0] == NULL)
output = get_input(MESSAGE_PROMPT_COMMAND, hist_PROMPT, trivial_completions);
else
{
prefix = strchr (ARG_STRING(0), ':');
if (prefix)
{
prefix++; ... | false | false | false | false | false | 0 |
sock_watch_cb(GIOChannel *source, GIOCondition condition,
gpointer data)
{
SockInfo *sock = (SockInfo *)data;
if ((condition & sock->condition) == 0)
return TRUE;
return sock->callback(sock, sock->condition, sock->data);
} | false | false | false | false | false | 0 |
HashSHA1DigestStr (t_pHashSHA1Digest pDigest, QString &Str)
{
Str.clear();
for (int i=0; i<HASH_SHA1_DIGEST_LENGTH; i++)
Str += QString ("%1") .arg ((int)(pDigest->Buff[i]), 2, 16, QChar('0'));
return NO_ERROR;
} | false | false | false | false | false | 0 |
StringAppendV(char* space, char** out,
const char* format, va_list ap) {
const int kBufsize = 1024;
// It's possible for methods that use a va_list to invalidate
// the data in it upon use. The fix is to make a copy
// of the structure before using it and use that copy ins... | false | false | false | false | false | 0 |
list_directory(char *path, int dashA)
{
char **ar;
DIR *ds;
struct dirent *d;
int n, p;
n = NUM_ENTRIES;
p = 0;
ar = (char **) MALLOC(n * sizeof(char *));
if(!(ds = opendir(path))) {
free(ar);
return NULL;
}
while( (d = readdir(ds)) ) {
if ( ( d->d_n... | false | false | false | false | false | 0 |
print_data(DDS & dds, bool print_rows = false)
{
cout << "The data:" << endl;
for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) {
BaseType *v = *i;
if (print_rows && (*i)->type() == dods_sequence_c)
dynamic_cast < Sequence * >(*i)->print_val_by_rows(cout);
el... | false | false | false | false | false | 0 |
ira_initiate_emit_data (void)
{
ira_allocno_t a;
ira_allocno_iterator ai;
ira_allocno_emit_data
= (ira_emit_data_t) ira_allocate (ira_allocnos_num
* sizeof (struct ira_emit_data));
memset (ira_allocno_emit_data, 0,
ira_allocnos_num * sizeof (struct ira_emit_data));
FOR_EACH_ALLOCNO (a, ai)
... | false | false | false | false | false | 0 |
fdevent_register(fdevent *fde)
{
if(fde->fd < 0) {
FATAL("bogus negative fd (%d)\n", fde->fd);
}
if(fde->fd >= fd_table_max) {
int oldmax = fd_table_max;
if(fde->fd > 32000) {
FATAL("bogus huuuuge fd (%d)\n", fde->fd);
}
if(fd_table_max == 0) {
... | false | false | false | false | false | 0 |
gfm_server_verify_type_not(struct peer *peer, int from_client, int skip)
{
gfarm_error_t e;
gfarm_uint32_t type;
static const char diag[] = "GFM_PROTO_VERIFY_TYPE_NOT";
/* XXX - NOT IMPLEMENTED */
gflog_error(GFARM_MSG_1000384, "%s: not implemented", diag);
e = gfm_server_get_request(peer, diag, "i", &type);
i... | false | false | false | false | false | 0 |
CERT_VerifyCertName(const CERTCertificate *cert, const char *hn)
{
char * cn;
SECStatus rv;
CERTOKDomainName *domainOK;
if (!hn || !strlen(hn)) {
PORT_SetError(SEC_ERROR_INVALID_ARGS);
return SECFailure;
}
/* if the name is one that the user has already approved, it's OK. */
for (... | false | false | false | false | false | 0 |
peer_proxy_negotiate_auth(char *principal_name, char *proxy)
{
int rc = 0;
OM_uint32 major_status, minor_status;
gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT;
gss_name_t server_name = GSS_C_NO_NAME;
gss_buffer_desc service = GSS_C_EMPTY_BUFFER;
gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER;
... | false | false | false | false | false | 0 |
HXPseek(accrec_t * access_rec, int32 offset, int origin)
{
int32 ret_value = SUCCEED;
CONSTR(FUNC, "HXPseek"); /* for HERROR */
/* Adjust offset according to origin.
there is no upper bound to posn */
if (origin == DF_CURRENT)
offset += access_rec->posn;
if (origin == DF_END)
... | false | false | false | false | false | 0 |
mb86a20s_layer_bitrate(struct dvb_frontend *fe, u32 layer,
u32 modulation, u32 forward_error_correction,
u32 guard_interval,
u32 segment)
{
struct mb86a20s_state *state = fe->demodulator_priv;
u32 rate;
int mod, fec, guard;
/*
* If modulation/fec/guard is not detected, the default is
* to ... | false | false | false | false | false | 0 |
Encrypt(const std::string & plaintext,
std::string * ciphertext) {
if (!key_is_set_) {
return false;
}
if (!languages_are_set_) {
return false;
}
mpz_class plaintext_rank;
plaintext_ranker_.Rank(plaintext, &plaintext_rank);
mpz_class C = 0;
ffx_.Encrypt(key_, plaintext_rank,... | false | false | false | false | false | 0 |
esl_random(ESL_RANDOMNESS *r)
{
uint32_t x = (r->type == eslRND_MERSENNE) ? mersenne_twister(r) : knuth(r);
return ((double) x / 4294967296.0); /* 2^32: normalizes to [0,1) */
} | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__com__SerialBuffer_ReadData(struct __ecereNameSpace__ecere__com__Instance * this, unsigned char * bytes, unsigned int numBytes)
{
struct __ecereNameSpace__ecere__com__SerialBuffer * __ecerePointer___ecereNameSpace__ecere__com__SerialBuffer = (struct __ecereNameSpace__ecere__com__Se... | false | true | false | false | true | 1 |
kex_method_strlen(LIBSSH2_COMMON_METHOD ** method)
{
size_t len = 0;
if (!method || !*method) {
return 0;
}
while (*method && (*method)->name) {
len += strlen((*method)->name) + 1;
method++;
}
return len - 1;
} | false | false | false | false | false | 0 |
sim_writemem(device_t dev_base, address_t addr,
const uint8_t *mem, address_t len)
{
struct sim_device *dev = (struct sim_device *)dev_base;
if (addr > MEM_SIZE || (addr + len) < addr ||
(addr + len) > MEM_SIZE) {
printc_err("sim: memory write out of range\n");
return -1;
}
memcpy(dev->memory + addr, ... | false | false | false | false | false | 0 |
send_get_tpu_info_3 (pixma_t * s)
{
mp810_t *mp = (mp810_t *) s->subdriver;
uint8_t *data;
int error;
data = pixma_newcmd (&mp->cb, cmd_get_tpu_info_3, 0, 0x34);
RET_IF_ERR(pixma_exec (s, &mp->cb));
memcpy (mp->tpu_data, data, 0x34);
return error;
} | false | false | false | false | false | 0 |
ib_create_ah_from_wc(struct ib_pd *pd, const struct ib_wc *wc,
const struct ib_grh *grh, u8 port_num)
{
struct ib_ah_attr ah_attr;
int ret;
ret = ib_init_ah_from_wc(pd->device, port_num, wc, grh, &ah_attr);
if (ret)
return ERR_PTR(ret);
return ib_create_ah(pd, &ah_attr);
} | false | false | false | false | false | 0 |
mptsas_expander_event_add(MPT_ADAPTER *ioc,
MpiEventDataSasExpanderStatusChange_t *expander_data)
{
struct mptsas_portinfo *port_info;
int i;
__le64 sas_address;
port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL);
if (!port_info)
BUG();
port_info->num_phys = (expander_data->NumPhys) ?
exp... | false | true | false | false | false | 1 |
clb_empty(uint8_t* maj_bits, int idx)
{
int byte_off, i, minor;
byte_off = idx * 8;
if (idx >= 8) byte_off += 2;
for (i = 0; i < 16; i++) {
for (minor = 20; minor < 31; minor++) {
if (!is_empty(&maj_bits[minor*130 + byte_off], 8))
return 0;
}
}
return 1;
} | false | false | false | false | false | 0 |
Month () const
{
if ((FlagsVAR & DBTimeStepMonth) != DBTimeStepMonth) return (DBDefaultMissingIntVal);
return (MonthsVAR - ((FlagsVAR & DBTimeStepYear) == DBTimeStepYear ? YearsAD () * 12 : 0) );
} | false | false | false | false | false | 0 |
del_obstacle_extensions(level *lvl, obstacle *obs)
{
int i;
struct obstacle_extension *ext;
for (i = 0; i < lvl->obstacle_extensions.size; i++) {
ext = &ACCESS_OBSTACLE_EXTENSION(lvl->obstacle_extensions, i);
if (ext->obs != obs)
continue;
dynarray_del(&lvl->obstacle_extensions, i, sizeof(struct obstacle... | false | false | false | false | false | 0 |
dns_cache_flushnode(dns_cache_t *cache, dns_name_t *name,
isc_boolean_t tree)
{
isc_result_t result;
dns_dbnode_t *node = NULL;
dns_db_t *db = NULL;
if (dns_name_equal(name, dns_rootname))
return (dns_cache_flush(cache));
LOCK(&cache->lock);
if (cache->db != NULL)
dns_db_attach(cache->db, &db);
UNLOC... | false | false | false | false | false | 0 |
pisblank(P *p)
{
P *q = pdup(p);
p_goto_bol(q);
while (joe_isblank(p->b->o.charmap,brc(q)))
pgetb(q);
if (piseol(q)) {
prm(q);
return 1;
} else {
prm(q);
return 0;
}
} | false | false | false | false | false | 0 |
name_guru_paste (NameGuruState *state, GtkTreeIter *iter)
{
char *name;
gboolean is_pastable;
gtk_tree_model_get (GTK_TREE_MODEL (state->model),
iter,
ITEM_PASTABLE, &is_pastable,
ITEM_NAME, &name,
-1);
if (!is_pastable)
return FALSE;
if (wbcg_edit_start (state->wbcg, FALSE,... | false | false | false | false | false | 0 |
ov2659_write_array(struct i2c_client *client,
const struct sensor_register *regs)
{
int i, ret = 0;
for (i = 0; ret == 0 && regs[i].addr; i++)
ret = ov2659_write(client, regs[i].addr, regs[i].value);
return ret;
} | false | false | false | false | false | 0 |
hi8435_write_event_config(struct iio_dev *idev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir, int state)
{
struct hi8435_priv *priv = iio_priv(idev);
priv->event_scan_mask &= ~BIT(chan->channel);
if (state)
priv->event_scan_mask |= BIT(chan->c... | false | false | false | false | false | 0 |
y(size_t i) const
{
// which point are we returning?
switch (i%4) {
case 0 : return -100; // bottom left
case 1 : return 5000; // top left - set to out of bound value
case 2 : return 5000; // top right - set to out of bound value
case 3 : return -100; // bottom right
}
return 0;
} | false | false | false | false | false | 0 |
js_set_fullscreen (JSContext *cx, uintN argc, jsval *vp)
{
int32 fs;
jsval *argv = JS_ARGV (cx, vp);
se_log_fncall_deprecated ("set_fullscreen");
se_argc_check_max (1, "set_fullscreen");
if (argc == 1)
{
se_arg_is_int_or_bool (0, "set_fullscreen");
JS_ValueToInt32 (cx, argv[0], &fs);
}
else
... | false | false | false | false | false | 0 |
init (void)
{
libgcc_handle = __libc_dlopen ("libgcc_s.so.1");
if (libgcc_handle == NULL)
return;
unwind_backtrace = __libc_dlsym (libgcc_handle, "_Unwind_Backtrace");
unwind_getip = __libc_dlsym (libgcc_handle, "_Unwind_GetIP");
if (unwind_getip == NULL)
unwind_backtrace = NULL;
unwind_getcfa = (... | false | false | false | false | false | 0 |
inet_can_answer_ping(void)
{
int elapsed;
/* Leaves don't send pongs */
if (!GNET_PROPERTY(is_firewalled))
return !settings_is_leaf();
if (!is_host_addr(listen_addr()) && !is_host_addr(listen_addr6()))
return FALSE; /* We don't know our local IP, we can't reply */
if (is_private_addr(listen_addr()) && is_p... | false | false | false | false | false | 0 |
init2(UText *input, UErrorCode &status) {
if (U_FAILURE(status)) {
fDeferredStatus = status;
return;
}
if (fPattern->fDataSize > (int32_t)(sizeof(fSmallData)/sizeof(fSmallData[0]))) {
fData = (int64_t *)uprv_malloc(fPattern->fDataSize * sizeof(int64_t));
if (fData == NULL) {... | false | false | false | false | false | 0 |
getReferences() {
IVector ret = MEGroup::getReferences();
for ( map<Ptr<MEBase>::ptr,Ptr<PowhegSplittingKernel>::ptr>::const_iterator mit =
theKernelMap.begin(); mit != theKernelMap.end(); ++mit ) {
ret.push_back(mit->first);
ret.push_back(mit->second);
}
return ret;
} | false | false | false | false | false | 0 |
tapeTakeArticle (Tape tape, Article article)
{
#if 0
QueueElem elem ;
#endif
int amt ;
const char *fname, *msgid ;
ASSERT (tape != NULL) ;
/* return immediately if spooling disabled - jgarzik */
if (tape->noBacklog)
{
delArticle (article) ;
return;
}
fname = artFileName (article) ;
... | false | false | false | true | false | 1 |
strtoichar (ichar_t *out, char *in, int outlen, int canonical)
{
register int len = 1; /* Length of next character */
outlen /= sizeof (ichar_t); /* Convert to an ichar_t count */
for ( ; --outlen > 0 && *in != '\0'; in += len)
{
if (l1_isstringch (in, len , canonical))
*out++ = SET_SIZE + m_l... | false | false | false | false | false | 0 |
rfftsr( const double * input ) const
{
int i;
for(i=0; i<len; i++) {
real_a[i] = input[i];
}
return rfftsr_wrapper(real_a);
} | false | false | false | false | false | 0 |
operator>>(QDataStream &in, QServiceFilter &sf)
{
const quint32 magicNumber = 0x78AFAFA;
qint32 mj, mn;
qint8 versionrule, caprule;
quint32 storedMagicNumber;
in >> storedMagicNumber;
if (storedMagicNumber != magicNumber) {
qWarning() << "Datastream doesn't provide serialized QServiceFi... | false | false | false | false | false | 0 |
capi20_put_message( unsigned ApplID, unsigned char *Msg ) {
if (capi20_isinstalled() != CapiNoError) {
return CapiRegNotInstalled;
}
if (!capi_validapplid(ApplID)) {
return CapiIllAppNr;
}
return psModule->psOperations->PutMessage(capi_applid2fd(ApplID), ApplID, Msg);
} | false | false | false | false | false | 0 |
append_domain(DBusMessageIter *iter, void *user_data)
{
struct connman_service *service = user_data;
if (is_connected(service) == FALSE &&
is_connecting(service) == FALSE)
return;
if (service->domains != NULL)
append_domainconfig(iter, user_data);
else if (service->domainname != NULL)
dbus_message_iter_... | false | false | false | false | false | 0 |
initialize(const QStringList &arguments, QString *errorMessage)
{
if (Utils::Log::warnPluginsCreation())
qWarning() << "CorePlugin::initialize";
return m_CoreImpl->initialize(arguments,errorMessage);
} | false | false | false | false | false | 0 |
free_equal_val_array(equal_val_array * uvals)
{
int i;
for (i = 0; i < uvals->count; i++) {
G_free(uvals->values[i]);
}
G_free(uvals->values);
G_free(uvals);
uvals = NULL;
return;
} | false | false | false | false | false | 0 |
storeTuple(s, f)
space1_t *s;
int f;
{
space1_t *ptr ;
/* check if tuple already there */
for (ptr = tsh.space ; ptr != NULL ; ptr = ptr->next)
{
if (!strcmp(ptr->name, s->name))
{ /* overwrite existing tuple */
free(ptr->tuple) ;
ptr->tuple = s->tuple ;
ptr->length = s->length ;
... | false | false | false | false | false | 0 |
gdl_dock_notebook_child_placement (GdlDockObject *object,
GdlDockObject *child,
GdlDockPlacement *placement)
{
GdlDockItem *item = GDL_DOCK_ITEM (object);
GdlDockPlacement pos = GDL_DOCK_NONE;
if (item->child) {
G... | false | false | false | false | false | 0 |
test_empty (void)
{
GkmSecret *secret;
const gchar *password;
gsize n_password;
secret = gkm_secret_new ((CK_UTF8CHAR_PTR)"", 0);
g_assert (GKM_IS_SECRET (secret));
password = gkm_secret_get_password (secret, &n_password);
g_assert_cmpstr (password, ==, "");
g_assert_cmpuint (n_password, ==, 0);
g_assert (!... | false | false | false | false | false | 0 |
ndmis_ep_close (struct ndm_session *sess,
struct ndmis_end_point *mine_ep, struct ndmis_end_point *peer_ep)
{
struct ndm_image_stream *is = &sess->plumb.image_stream;
char * save_name = mine_ep->name;
switch (mine_ep->connect_status) {
case NDMIS_CONN_IDLE:
return 0;
case NDMIS_CONN_BOTCHED:
case NDMIS_CO... | false | false | false | false | false | 0 |
http_client_init(Slapi_PBlock *pb)
{
int status = HTTP_SUCCESS;
LDAPDebug( LDAP_DEBUG_PLUGIN, "--> http_client_init -- BEGIN\n",0,0,0);
if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
SLAPI_PLUGIN_VERSION_01 ) != 0 ||
slapi_pblock_set(pb, SLAPI_PLUGIN_START_FN,
(void *) http_client_start )... | false | false | false | false | false | 0 |
print_box(BoxStruct* box) {
do_output(LOG_CAT_INFO, LOG_AREA_DFT, "print_box:");
for(int i = 0; i < NO_OF_DIMENSIONS; i++) {
do_output(LOG_CAT_INFO, LOG_AREA_DFT, "min = %.11f max = %.11f",
(double)box->min[i], (double)box->max[i]);
} /* END FOR i */
} | false | false | false | false | false | 0 |
crm_client_new(qb_ipcs_connection_t * c, uid_t uid_client, gid_t gid_client)
{
static uid_t uid_server = 0;
static gid_t gid_cluster = 0;
crm_client_t *client = NULL;
CRM_LOG_ASSERT(c);
if (c == NULL) {
return NULL;
}
if (gid_cluster == 0) {
uid_server = getuid();
... | false | false | false | false | false | 0 |
gen_extv (rtx operand0,
rtx operand1,
rtx operand2,
rtx operand3)
{
rtx _val = 0;
start_sequence ();
{
rtx operands[4];
operands[0] = operand0;
operands[1] = operand1;
operands[2] = operand2;
operands[3] = operand3;
#line 651 "/home/dcharvest/ubuntu64-builder/genericMake/build/toolchain/dl/... | false | false | false | false | false | 0 |
test_stash_save__does_not_keep_index_by_default(void)
{
/*
$ git stash
$ git show refs/stash:what
see you later
$ git show refs/stash:how
not so small and
$ git show refs/stash:who
funky world
$ git show refs/stash:when
fatal: Path 'when' exists on disk, but not in 'stash'.
$ git show refs/stash^2:what
goodbye
$ ... | false | false | false | false | false | 0 |
from_locale(char *buffer)
{
const char *point;
char *pos;
point = localeconv()->decimal_point;
if(*point == '.') {
/* No conversion needed */
return;
}
pos = strchr(buffer, *point);
if(pos)
*pos = '.';
} | false | false | false | false | false | 0 |
G__set_gisrc_file(const char *name)
{
gisrc = NULL;
if (name && *name)
gisrc = G_store(name);
return 0;
} | false | false | false | false | false | 0 |
handleConfigureRequest(XConfigureRequestEvent *e)
{
XWindowChanges wc;
gravitate(REMOVE_GRAVITY);
if (e->value_mask & CWX) x = e->x;
if (e->value_mask & CWY) y = e->y;
if (e->value_mask & CWWidth) width = e->width;
if (e->value_mask & CWHeight) height = e->height;
gravi... | 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.