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 |
|---|---|---|---|---|---|---|
Buf_Destroy(Buffer *buf, Boolean freeData)
{
if (freeData)
free(buf->buf);
free(buf);
} | false | false | false | false | false | 0 |
http_add_inbuf(struct evbuffer *buffer, ad_http_t *http,
size_t maxsize) {
if (maxsize == 0 || evbuffer_get_length(buffer) == 0) {
return 0;
}
return evbuffer_remove_buffer(buffer, http->request.inbuf, maxsize);
} | false | false | false | false | false | 0 |
__fetch_parameter_objects(
MidgardConnection *mgd, const gchar *class_name,
const gchar *guid, guint n_params, const GParameter *parameters)
{
MidgardQueryBuilder *builder =
midgard_query_builder_new(mgd, class_name);
/* Error is set in builder constructor */
if(!builder)
return FALSE;
GValue gval = {0,... | false | false | false | false | false | 0 |
main(int argc,char **argv)
{
pthread_t threads[NTHR];
int i, j;
printf("Creating %d threads\n",NTHR);
for(i = 0;i<NTHR;i++)
{
struct thr_arg_s thr_arg;
int result;
thr_arg.thr_num=i;
result = pthread_create(&threads[i],NULL,run_test_in_thread,
(void *)&thr_arg);
if(result!=0)
{
fprintf(stderr... | false | false | false | false | false | 0 |
display_dispose_check (GdmXdmcpDisplayFactory *factory,
const char *hostname,
int display_num)
{
RemoveHostData *data;
GdmDisplayStore *store;
if (hostname == NULL) {
return;
}
store ... | false | false | false | false | false | 0 |
NRand(float sigma = 1.0f)
{
#define ONE_OVER_SIGMA_EXP (1.0f / 0.7975f)
if(sigma == 0) return 0;
float y;
do
{
y = -logf(drand48());
}
while(drand48() > expf(-fsqr(y - 1.0f)*0.5f));
if(rand() & 0x1)
return y * sigma * ONE_OVER_SIGMA_EXP;
else
return -y * sigma * ONE_OVER_SIGMA_EXP;
} | false | false | false | false | false | 0 |
rest_of_handle_loop2 (tree decl, rtx insns)
{
struct loops *loops;
timevar_push (TV_LOOP);
open_dump_file (DFI_loop2, decl);
if (rtl_dump_file)
dump_flow_info (rtl_dump_file);
loops = loop_optimizer_init (rtl_dump_file);
if (loops)
{
/* The optimizations: */
if (flag_unswitch_loops)
... | false | false | false | false | false | 0 |
on_cell_layout_button_clicked(const Gtk::TreeModel::Path& path, int model_column_index)
{
if(!m_refListStore)
return;
Gtk::TreeModel::iterator iter = m_refListStore->get_iter(path);
if(iter)
{
sharedptr<const LayoutItem> layout_item = m_column_items[model_column_index];
sharedptr<const LayoutItem_B... | false | false | false | false | false | 0 |
logfile_timer_cb(bool&) {
logfile_count++;
if (logfile_count >= LOGFILE_MARK_COUNT) {
logfile_count = 0;
struct std::tm* time_p;
std::time_t time_count;
std::time(&time_count);
time_p = std::localtime(&time_count);
const char date_description_format[] = "%H%M %Z %d %b %Y";
con... | false | false | false | false | false | 0 |
mnt_copy_mtab_fs(const struct libmnt_fs *fs)
{
struct libmnt_fs *n = mnt_new_fs();
if (!n)
return NULL;
if (cpy_str_at_offset(n, fs, offsetof(struct libmnt_fs, source)))
goto err;
if (cpy_str_at_offset(n, fs, offsetof(struct libmnt_fs, target)))
goto err;
if (cpy_str_at_offset(n, fs, offsetof(struct libmnt... | false | false | false | false | false | 0 |
rb_file_s_dirname(klass, fname)
VALUE klass, fname;
{
char *name, *root, *p;
VALUE dirname;
name = StringValueCStr(fname);
root = skiproot(name);
#ifdef DOSISH_UNC
if (root > name + 1 && isdirsep(*name))
root = skipprefix(name = root - 2);
#else
if (root > name + 1)
name = root - 1;
#endi... | false | false | false | false | false | 0 |
scm_lookup_environment(ScmObj var, ScmObj env)
{
ScmObj frame;
ScmRef ref;
#if SCM_USE_HYGIENIC_MACRO
scm_int_t depth, id_depth;
ScmObj env_save;
#endif /* SCM_USE_HYGIENIC_MACRO */
DECLARE_INTERNAL_FUNCTION("scm_lookup_environment");
SCM_ASSERT(IDENTIFIERP(var));
SCM_ASSERT(VALID_ENVP(env)... | false | false | false | false | false | 0 |
invoke_gsyncd (int argc, char **argv)
{
char config_file[PATH_MAX] = {0,};
size_t gluster_workdir_len = 0;
runner_t runner = {0,};
int i = 0;
int j = 0;
char *nargv[argc + 4];
if (restricted) {
... | false | false | false | false | false | 0 |
ComputeCallNormal(int argc,
Code::Kind kind,
Code::ExtraICState extra_ic_state,
String* name,
JSObject* receiver) {
Object* code;
{ MaybeObject* may... | false | false | false | false | false | 0 |
cmd_spinq(int dev_id, int argc, char **argv)
{
uint8_t lap[3] = { 0x33, 0x8b, 0x9e };
struct hci_request rq;
periodic_inquiry_cp cp;
int opt, dd;
for_each_opt(opt, spinq_options, NULL) {
switch (opt) {
default:
printf("%s", spinq_help);
return;
}
}
helper_arg(0, 0, &argc, &argv, spinq_help);
if (d... | false | true | false | false | false | 1 |
fm10k_ptp_unregister(struct fm10k_intfc *interface)
{
struct ptp_clock *ptp_clock = interface->ptp_clock;
struct device *dev = &interface->pdev->dev;
if (!ptp_clock)
return;
interface->ptp_clock = NULL;
ptp_clock_unregister(ptp_clock);
dev_info(dev, "removed PHC %s\n", interface->ptp_caps.name);
} | false | false | false | false | false | 0 |
ajCodClear(AjPCod thys)
{
ajint i;
ajStrAssignClear(&thys->Name);
ajStrAssignClear(&thys->Species);
ajStrAssignClear(&thys->Division);
ajStrAssignClear(&thys->Release);
ajStrAssignClear(&thys->Desc);
thys->CdsCount = 0;
thys->CodonCount = 0;
thys->GeneticCode = 0;
for(i=0;i<AJ... | false | false | false | false | false | 0 |
doesLeaderFollowThis(MSShell *leader_)
{
MSBoolean r=MSFalse;
if (leader_!=0)
{
for (unsigned i=0;i<_groupList.numberOfFollowers()&&r==MSFalse;i++)
{
if (_groupList(i)->_pShell==leader_) r=MSTrue;
else r=_groupList(i)->_pShell->doesLeaderFollowThis(leader_);
}
}
return r;
} | false | false | false | false | false | 0 |
device_remove_attrs(struct bus_type *bus, struct device *dev)
{
int i;
if (bus->dev_attrs) {
for (i = 0; bus->dev_attrs[i].attr.name; i++)
device_remove_file(dev, &bus->dev_attrs[i]);
}
} | false | false | false | false | false | 0 |
base64_decode (const char *in, size_t inlen,
char *out, size_t *outlen)
{
size_t outleft = *outlen;
while (inlen >= 2)
{
if (!isbase64 (in[0]) || !isbase64 (in[1]))
break;
if (outleft)
{
*out++ = ((b64[to_uchar (in[0])] << 2)
| (b64[to_uchar (in[1])] >> 4));
outleft--;
}
... | false | false | false | false | false | 0 |
doCommand()
{
QModelIndex parent = findIndex(m_rowNumbers);
if (!m_treeString.isEmpty())
{
QList<int> depths = getDepths(m_treeString);
int size = 0;
qCount(depths, 0, size);
Q_ASSERT(size != 0);
m_endRow = m_startRow + size - 1;
}
m_model->beginInsertRows(parent, m_startRow, m_endRow);
... | false | false | false | false | false | 0 |
log_child(apr_pool_t *p, const char *progname,
apr_file_t **fpin, apr_cmdtype_e cmdtype,
int dummy_stderr)
{
/* Child process code for 'ErrorLog "|..."';
* may want a common framework for this, since I expect it will
* be common for other foo-loggers to want this ... | false | false | false | false | false | 0 |
_IO_old_file_write (f, data, n)
_IO_FILE *f;
const void *data;
_IO_ssize_t n;
{
_IO_ssize_t to_do = n;
while (to_do > 0)
{
_IO_ssize_t count = write (f->_fileno, data, to_do);
if (count == EOF)
{
f->_flags |= _IO_ERR_SEEN;
break;
}
to_do -= count;
data = (void *) (... | false | false | false | false | false | 0 |
DeletePropertyPostInterceptor(String* name,
DeleteMode mode) {
// Check local property, ignore interceptor.
LookupResult result;
LocalLookupRealNamedProperty(name, &result);
if (!result.IsProperty()) return Heap::true_value();
// Normalize object if needed... | false | false | false | false | false | 0 |
gst_base_video_decoder_prepare_finish_frame (GstBaseVideoDecoder *
base_video_decoder, GstVideoFrame * frame)
{
GList *l, *events = NULL;
#ifndef GST_DISABLE_GST_DEBUG
GST_LOG_OBJECT (base_video_decoder, "n %d in %d out %d",
g_list_length (GST_BASE_VIDEO_CODEC (base_video_decoder)->frames),
gst_ada... | false | false | false | false | false | 0 |
bMapRead(int vol, /* index in vopen array */
int32_t page_number, /* block map page offset to read */
void *page_buffer)
{ /* where to put the page read */
int bmr_rc = 0;
/*
* read in the map page
*/
bmr_rc = ujfs_rw_diskblocks(vopen[vol].fp,
vopen[vol].bmap_wsp[page_number].
pa... | false | false | false | false | false | 0 |
getMin(int id)
{
string r_return;
return (r_return = Utils::Xml::get_property(getElementById(id), "min")) != "" ? atoi(r_return.c_str()) : 0;
} | false | false | false | false | false | 0 |
bfa_itnim_sm_fwcreate_qfull(struct bfa_itnim_s *itnim,
enum bfa_itnim_event event)
{
bfa_trc(itnim->bfa, itnim->rport->rport_tag);
bfa_trc(itnim->bfa, event);
switch (event) {
case BFA_ITNIM_SM_QRESUME:
bfa_sm_set_state(itnim, bfa_itnim_sm_fwcreate);
bfa_itnim_send_fwcreate(itnim);
break;
case BFA_ITNIM... | false | false | false | false | false | 0 |
mtnic_alloc_cmdif(struct mtnic *mtnic)
{
u32 bar = mtnic_pci_dev.dev.bar[0];
mtnic->hcr = ioremap(bar + MTNIC_HCR_BASE, MTNIC_HCR_SIZE);
if ( !mtnic->hcr ) {
DBG("Couldn't map command register\n");
return -EADDRINUSE;
}
mtnic_alloc_aligned(PAGE_SIZE, (void *)&mtnic->cmd.buf, &mtnic->cmd.mapping, PAGE_SIZE);
... | false | false | false | false | false | 0 |
brcms_c_down(struct brcms_c_info *wlc)
{
uint callbacks = 0;
int i;
bool dev_gone = false;
brcms_dbg_info(wlc->hw->d11core, "wl%d\n", wlc->pub->unit);
/* check if we are already in the going down path */
if (wlc->going_down) {
brcms_err(wlc->hw->d11core,
"wl%d: %s: Driver going down so return\n",
w... | false | false | false | false | false | 0 |
pcnet32_poll(struct nic *nic __unused, int retrieve)
{
/* return true if there's an ethernet packet ready to read */
/* nic->packet should contain data on return */
/* nic->packetlen should contain length of data */
signed char status;
int entry;
entry = lp->cur_rx & RX_RING_MOD_MASK;
status = (le16_to_cpu(pcn... | false | true | false | false | false | 1 |
unread(char *buf, size_t size)
{
// implement LIFO (stack) semantics
const int newSize = m_unreadBuf.size() + size;
m_unreadBuf.resize(newSize);
for (size_t i = 0; i < size; i++) {
m_unreadBuf.data()[newSize - i - 1] = buf[i];
}
if (size) {
//hey, we still have data, closed conne... | false | false | false | false | false | 0 |
expend(std::string& expendval) {
int i=0;
while (i<nbvariables) {
std::string var = variables[i].name;
std::string val = variables[i].val.s;
int begining = expendval.find_first_of(variables[i].name);
if (begining >= 0) {
bool replace = true;
if (begining > 0) {
replace = !isalnum(expend... | false | false | false | false | false | 0 |
portman_data_avail(struct portman *pm, int channel)
{
int command = INT_EN;
switch (channel) {
case 0:
command |= RXDATA0;
break;
case 1:
command |= RXDATA1;
break;
}
/* Write hardware (assumme STROBE=0) */
portman_write_command(pm, command);
/* Check multiplexed RxAvail signal */
if ((portman_read_sta... | false | false | false | false | false | 0 |
fs_log_string(const char *str) {
if (!g_initialized) {
initialize();
}
fs_mutex_lock(g_mutex);
if (g_fs_log_stdout) {
printf("%s", str);
}
if (g_log_file) {
fprintf(g_log_file, "%s", str);
}
fs_mutex_unlock(g_mutex);
} | false | false | false | false | false | 0 |
zInitSFVec (zSFVec *vec, int limit) {
vec->size = 0;
vec->limit = limit;
if (vec->limit > 0) vec->elem = zMalloc(limit * sizeof(zSfeature), "zInitSFVec");
else vec->elem = NULL;
} | false | false | false | false | false | 0 |
main(int argc, char **argv) {
int num, i, aux;
char command;
struct node *root = NULL, *auxNode;
FILE *fd, *fout;
char namefout[1000];
root = newNode(0);
if((fd = fopen(argv[1], "r")) == NULL) {
printf("error: couldn't open file");
return ERROR;
}
while(!feof(fd)) ... | false | false | false | false | true | 1 |
get_and_dump_all_records(bind_handle_t h, uint16_t attr_id,
void (*dump_func) (void *))
{
struct sa_query_result result;
int ret = get_all_records(h, attr_id, &result);
if (ret)
return ret;
dump_results(&result, dump_func);
sa_free_result_mad(&result);
return ret;
} | false | false | false | false | false | 0 |
channel_got_query(IRC_CHANNEL_REC *chanrec, int query_type)
{
SERVER_QUERY_REC *rec;
g_return_if_fail(chanrec != NULL);
rec = chanrec->server->chanqueries;
if (query_type != rec->current_query_type)
return; /* shouldn't happen */
/* got the query for channel.. */
rec->current_queries =
... | false | false | false | false | false | 0 |
xconf_dup(xconf *xc)
{
xconf *ret, *son;
GSList *s;
if (!xc)
return NULL;
ret = xconf_new(xc->name, xc->value);
for (s = xc->sons; s; s = g_slist_next(s))
{
son = s->data;
xconf_append(ret, xconf_dup(son));
}
return ret;
} | false | false | false | false | false | 0 |
registerNotebookPage(XAP_Dialog_Id dialog, const XAP_NotebookDialog::Page * page)
{
// check that widget is unique for dialog
std::pair<NotebookPagesIter, NotebookPagesIter> bounds = s_mapNotebookPages.equal_range(dialog);
while (bounds.first != bounds.second)
{
if (bounds.first->second == page)
{
UT_ASSERT_... | false | false | false | false | false | 0 |
handle_message(xmlNode * msg, enum crmd_fsa_cause cause)
{
const char *type = NULL;
CRM_CHECK(msg != NULL, return I_NULL);
type = crm_element_value(msg, F_CRM_MSG_TYPE);
if (crm_str_eq(type, XML_ATTR_REQUEST, TRUE)) {
return handle_request(msg, cause);
} else if (crm_str_eq(type, XML_ATTR... | false | false | false | false | false | 0 |
PyvtkvmtkPolyDataBranchSections_ComputeBranchSectionShape(PyObject *, PyObject *args)
{
vtkPythonArgs ap(args, "ComputeBranchSectionShape");
vtkPolyData *temp0 = NULL;
double temp1[3];
double save1[3];
const int size1 = 3;
double temp2[2];
double save2[2];
const int size2 = 2;
PyObject *result = NULL... | false | false | false | false | false | 0 |
findWindow(int flags) {
YFrameWindow *p = this;
if (flags & fwfNext)
goto next;
do {
if ((flags & fwfMinimized) && !p->isMinimized())
goto next;
if ((flags & fwfUnminimized) && p->isMinimized())
goto next;
if ((flags & fwfVisible) && !p->visible())
... | false | false | false | false | false | 0 |
checkout_fast_forward(unsigned char *head, unsigned char *remote)
{
struct tree *trees[MAX_UNPACK_TREES];
struct unpack_trees_options opts;
struct tree_desc t[MAX_UNPACK_TREES];
int i, fd, nr_trees = 0;
struct dir_struct dir;
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
refresh_cache(REFR... | false | false | false | false | false | 0 |
_vl_sift_smooth (VlSiftFilt * self,
vl_sift_pix * outputImage,
vl_sift_pix * tempImage,
vl_sift_pix const * inputImage,
vl_size width,
vl_size height,
double sigma)
{
/* prepare Gaussian filter */
if (self->gaussFi... | false | true | false | false | false | 1 |
average_tool_update_sensitivity_cb (G_GNUC_UNUSED GtkWidget *dummy,
AverageToolState *state)
{
int interval, err, offset;
GSList *input_range;
moving_average_type_t type;
input_range = gnm_expr_entry_parse_as_list (
GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
if (input_r... | false | false | false | false | false | 0 |
df_rd_init_solution (bitmap all_blocks)
{
unsigned int bb_index;
bitmap_iterator bi;
EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi)
{
struct df_rd_bb_info *bb_info = df_rd_get_bb_info (bb_index);
bitmap_copy (&bb_info->out, &bb_info->gen);
bitmap_clear (&bb_info->in);
}
} | false | false | false | false | false | 0 |
isacsx_rme_irq(struct isac_hw *isac)
{
int count;
u8 val;
val = ReadISAC(isac, ISACX_RSTAD);
if ((val & (ISACX_RSTAD_VFR |
ISACX_RSTAD_RDO |
ISACX_RSTAD_CRC |
ISACX_RSTAD_RAB))
!= (ISACX_RSTAD_VFR | ISACX_RSTAD_CRC)) {
pr_debug("%s: RSTAD %#x, dropped\n", isac->name, val);
#ifdef ERROR_STA... | false | false | false | false | false | 0 |
handleATOM(Instruction *atom)
{
SVSemantic sv;
switch (atom->src(0).getFile()) {
case FILE_MEMORY_LOCAL:
sv = SV_LBASE;
break;
case FILE_MEMORY_SHARED:
sv = SV_SBASE;
break;
default:
assert(atom->src(0).getFile() == FILE_MEMORY_GLOBAL);
return true;
}
Value *bas... | false | false | false | false | false | 0 |
nemo_column_chooser_set_settings (NemoColumnChooser *chooser,
char **visible_columns,
char **column_order)
{
g_return_if_fail (NEMO_IS_COLUMN_CHOOSER (chooser));
g_return_if_fail (visible_columns != NULL);
g_return_if_fail (column_order != NULL);
set_visible_columns (chooser, visible_columns);
... | false | false | false | false | false | 0 |
labellen(const unsigned char *lp)
{
int bitlen;
unsigned char l = *lp;
if ((l & NS_CMPRSFLGS) == NS_CMPRSFLGS)
{
/* should be avoided by the caller */
return(-1);
}
if ((l & NS_CMPRSFLGS) == NS_TYPE_ELT)
{
if (l == DNS_LABELTYPE_BITSTRING)
{
if ((bitl... | false | false | false | false | false | 0 |
obuf_putc(obuf* out, char ch)
{
iobuf* io;
io = &out->io;
if (iobuf_bad(io)) return 0;
out->count = 0;
io->buffer[out->bufpos++] = ch;
if (out->bufpos >= io->buflen) io->buflen = out->bufpos;
if (io->buflen >= io->bufsize && !obuf_flush(out)) return 0;
out->count = 1;
return 1;
} | false | false | false | false | false | 0 |
me2() const {
tcPDPtr ina (mePartonData()[0]), inb (mePartonData()[1]);
tcPDPtr outa(mePartonData()[2]), outb(mePartonData()[3]);
for(unsigned int ix=0;ix<4;++ix) {
spin_[ix].clear();
sbar_[ix].clear();
for(unsigned int ih=0;ih<2;++ih) {
spin_[ix].push_back(SpinorWaveFunction (rescaledMomenta(... | false | false | false | false | false | 0 |
DefaultButton2Clicked()
{
int i;
for(i=0; i<5; i++)
{
((QCheckBox *)(colorBarTable->cellWidget(i, 0)))->setCheckState(Qt::Checked);
((QLineEdit *)(colorBarTable->cellWidget(i, 3)))->clear();
}
((QDoubleSpinBox *)(colorBarTable->cellWidget(0, 1)))->setValue(4.0);
((SpecialButton *)(colorBarTable->c... | false | false | false | false | false | 0 |
pause_proxy(struct proxy *p)
{
struct listener *l;
if (!(p->cap & PR_CAP_FE) || p->state == PR_STERROR ||
p->state == PR_STSTOPPED || p->state == PR_STPAUSED)
return 1;
Warning("Pausing %s %s.\n", proxy_cap_str(p->cap), p->id);
send_log(p, LOG_WARNING, "Pausing %s %s.\n", proxy_cap_str(p->cap), p->id);
l... | false | false | false | false | false | 0 |
sfc_get_word(uaecptr addr)
{
int super = (regs.sfc & 4) != 0;
int data = (regs.sfc & 3) != 2;
uae_u16 res;
if (likely(!is_unaligned(addr, 2)))
return mmu_get_user_word(addr, super, data, sz_word);
res = (uae_u16)mmu_get_user_byte(addr, super, data, sz_word) << 8;
SAVE_EXCEPTION;
TRY(prb) {
res |= mmu_get_u... | false | false | false | false | false | 0 |
_ReadByte(ArchiveHandle *AH)
{
lclContext *ctx = (lclContext *) AH->formatData;
size_t res;
unsigned char c;
res = tarRead(&c, 1, ctx->FH);
if (res != 1)
die_horribly(AH, modulename, "unexpected end of file\n");
ctx->filePos += 1;
return c;
} | false | false | false | false | false | 0 |
mouseReleaseEvent(QMouseEvent* event)
{
setCursor(QCursor(Qt::ArrowCursor));
int button = event->button() + event->modifiers();
Square s = squareAt(event->pos());
m_clickUsed = false;
if(!(event->button() & Qt::LeftButton))
{
Square from = squareAt(m_dragStart);
if(s == from)
... | false | false | false | false | false | 0 |
show_header( const File_header header )
{
const char * const prefix[8] =
{ "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi" };
enum { factor = 1024 };
const char * p = "";
const char * np = " ";
unsigned num = Fh_get_dictionary_size( header ), i;
bool exact = ( num % factor == 0 );
for( i = 0; i < 8... | false | false | false | false | false | 0 |
gst_mpeg4vparse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
{
GstMpeg4VParse *mp4vparse = GST_MPEG4VIDEO_PARSE (parse);
GstBuffer *buffer = frame->buffer;
gboolean push_codec = FALSE;
GstEvent *event = NULL;
if ((event = check_pending_key_unit_event (mp4vparse->force_key_unit_event,
... | false | false | false | false | false | 0 |
char_bitmap(Display* d, const Font* font, long c) {
if (_char_bitmaps == nil) {
_char_bitmaps = new CharBitmapTable(1024);
}
const Bitmap* b;
if (!_char_bitmaps->find(b, font, c)) {
b = new Bitmap(font, c, font->rep(d)->scale_);
_char_bitmaps->insert(font, c, b);
}
return b;
} | false | false | false | true | false | 1 |
HalSetBrateCfg(struct adapter *adapt, u8 *brates, u16 *rate_cfg)
{
u8 i, is_brate, brate;
for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) {
is_brate = brates[i] & IEEE80211_BASIC_RATE_MASK;
brate = brates[i] & 0x7f;
if (is_brate) {
switch (brate) {
case IEEE80211_CCK_RATE_1MB:
*rate_cfg |= RATE_1M... | false | false | false | false | false | 0 |
gru_retry_exception(void *cb)
{
struct gru_control_block_status *gen = (void *)cb;
struct control_block_extended_exc_detail excdet;
int retry = EXCEPTION_RETRY_LIMIT;
while (1) {
if (gru_wait_idle_or_exception(gen) == CBS_IDLE)
return CBS_IDLE;
if (gru_get_cb_message_queue_substatus(cb))
return CBS_EXCE... | false | false | false | false | false | 0 |
suffixcmp(const char *str, int slen, const char *suffix)
{
size_t len = slen >= 0 ? slen : strlen(str);
size_t suffixlen = strlen(suffix);
return suffixlen < len ? strcmp(str + len - suffixlen, suffix) : -1;
} | false | false | false | false | false | 0 |
get_dm_object(player *pl, const char **params, int *from) {
int item_tag, item_position;
object *ob;
if (!pl)
return NULL;
if (**params == '\0') {
if (from)
*from = STACK_FROM_TOP;
/* No parameter => get stack item */
return dm_stack_peek(pl);
}
/* ... | false | false | false | false | false | 0 |
setRequest(DUL_ASSOCIATIONKEY ** association,
DUL_PRESENTATIONCONTEXT * ctx, MSG_N_SET_REQ ** request,
CTNBOOLEAN * sendBack)
{
MSG_N_SET_RESP
setResponse;
CONDITION
cond = SRV_NORMAL;
/* clear the contents of the response message */
memset((void *) &setResponse, 0, sizeof(MSG_N_SET_RESP));
... | false | false | false | false | false | 0 |
do_hashcom()
{
char * p = linebuf;
int flg = -1;
while(isspace(*p)) p++;
if( *p == '#' ) p++;
while(isspace(*p)) p++;
if(strncmp(p, "ifdef", 5) == 0)
{
do_ifdef(p+5, 'D');
}
else
if(strncmp(p, "ifndef", 6) == 0)
{
do_ifdef(p+6, 'U');
}
else
if(strncmp(p, "if", 2) ... | false | false | false | false | false | 0 |
setType( const int type )
{
if( type < (int)DataTheme.tiles.count() ) {
_type = type;
setCoeff( DataTheme.tiles.getCoeffAt( type ) );
} else {
setCoeff( DataTheme.tiles.getCoeffAt( 0 ) );
_type = 0;
}
} | false | false | false | false | false | 0 |
expire_header(dns_rbtdb_t *rbtdb, rdatasetheader_t *header,
isc_boolean_t tree_locked, expire_t reason)
{
set_ttl(rbtdb, header, 0);
mark_stale_header(rbtdb, header);
/*
* Caller must hold the node (write) lock.
*/
if (dns_rbtnode_refcurrent(header->node) == 0) {
/*
* If no one else is using the n... | false | false | false | false | false | 0 |
apply2(ast_sent* s)
{
reaching_context_t* C = get_context_for(s);
set_curr_context(C);
if ((s->get_nodetype() != AST_FOREACH) &&
(s->get_nodetype() != AST_BFS))
{
// insert modification into context
// (kill so... | false | false | false | false | false | 0 |
ixgbevf_is_non_eop(struct ixgbevf_ring *rx_ring,
union ixgbe_adv_rx_desc *rx_desc)
{
u32 ntc = rx_ring->next_to_clean + 1;
/* fetch, update, and store next to clean */
ntc = (ntc < rx_ring->count) ? ntc : 0;
rx_ring->next_to_clean = ntc;
prefetch(IXGBEVF_RX_DESC(rx_ring, ntc));
if (likely(ixgbevf_tes... | false | false | false | false | false | 0 |
threaded_job_successful_func (UDisksThreadedJob *job,
GCancellable *cancellable,
gpointer user_data,
GError **error)
{
g_assert (g_thread_self () != main_thread);
return TRUE;
} | false | false | false | false | false | 0 |
operator()(const dbg::source_pos &a, const dbg::source_pos &b)
const
{
if (a.file == b.file)
{
if (a.func == b.func)
{
return a.line < b.line;
}
else
{
retu... | false | false | false | false | false | 0 |
GetVariableWatch() const
{
if ( this->GetCMakeInstance() &&
this->GetCMakeInstance()->GetVariableWatch() )
{
return this->GetCMakeInstance()->GetVariableWatch();
}
return 0;
} | false | false | false | false | false | 0 |
cx_fabric_get_param(cx_fabric_arg_t * arg_type_list,
char *arg)
{
int i;
errno = 0;
i = 0;
while (arg_type_list[i].keyword != NULL) {
if (!strncasecmp(arg, arg_type_list[i].keyword,
strlen(arg_type_list[i].keyword))) {
return ((cx_fabric_param_t *) arg_type_list[i].data);
}
i++;
}
retur... | false | false | false | false | false | 0 |
set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
struct gnttab_map_grant_ref *kmap_ops,
struct page **pages, unsigned int count)
{
int i, ret = 0;
pte_t *pte;
if (xen_feature(XENFEAT_auto_translated_physmap))
return 0;
if (kmap_ops) {
ret = HYPERVISOR_grant_table_op(GNTTABOP_map_gra... | false | false | false | false | false | 0 |
DeleteShape( ShapeId id )
{
int shape_index = IndexFromShapeId( id );
if( shape_index == -1 )
ThrowPCIDSKException( "Attempt to call DeleteShape() on non-existing shape '%d'.",
(int) id );
/* ==================================================================== */
/* ... | false | false | false | false | false | 0 |
pic_buff(gint32 frame_id, gint32 pic_id, guint8 * buff) {
if(!engine->active_frame[frame_id]) return;
if(!frame[frame_id]->active_pic[pic_id]) return;
if(engine->minimize_memory)
pic_set_buff(frame_id, pic_id, buff);
else
pic_fill_buff(frame_id, pic_id, buff);
} | false | false | false | false | false | 0 |
_wrap_svn_repos_svnserve_conf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
svn_repos_t *arg1 = (svn_repos_t *) 0 ;
apr_pool_t *arg2 = (apr_pool_t *) 0 ;
apr_pool_t *_global_pool = NULL ;
PyObject *_global_py_pool = NULL ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
char *re... | false | false | false | false | false | 0 |
invalidate_from_clobbers (rtx x)
{
if (GET_CODE (x) == CLOBBER)
{
rtx ref = XEXP (x, 0);
if (ref)
{
if (GET_CODE (ref) == REG || GET_CODE (ref) == SUBREG
|| GET_CODE (ref) == MEM)
invalidate (ref, VOIDmode);
else if (GET_CODE (ref) == STRICT_LOW_PART
|| GET_CODE (ref) == ZERO_E... | false | false | false | false | false | 0 |
move_connection (NMRemoteSettings *self,
NMRemoteConnection *remote,
GHashTable *from,
GHashTable *to)
{
const char *path = nm_connection_get_path (NM_CONNECTION (remote));
g_hash_table_insert (to, g_strdup (path), g_object_ref (remote));
if (from)
g_hash_table_r... | false | false | false | false | false | 0 |
__add_preferred_console(char *name, int idx, char *options,
char *brl_options)
{
struct console_cmdline *c;
int i;
/*
* See if this tty is not yet registered, and
* if we have a slot free.
*/
for (i = 0, c = console_cmdline;
i < MAX_CMDLINECONSOLES && c->name[0];
i++, c++) {
if (strcmp(c... | false | false | false | false | false | 0 |
Ns_Pause(int id)
{
Tcl_HashEntry *hPtr;
Event *ePtr;
int paused;
paused = 0;
Ns_MutexLock(&lock);
if (!shutdownPending) {
hPtr = Tcl_FindHashEntry(&eventsTable, (char *) id);
if (hPtr != NULL) {
ePtr = Tcl_GetHashValue(hPtr);
if (!(ePtr->flags & NS_SCHED_PAUSE... | false | false | false | false | false | 0 |
sci_controller_completion_queue_has_entries(struct isci_host *ihost)
{
u32 get_value = ihost->completion_queue_get;
u32 get_index = get_value & SMU_COMPLETION_QUEUE_GET_POINTER_MASK;
if (NORMALIZE_GET_POINTER_CYCLE_BIT(get_value) ==
COMPLETION_QUEUE_CYCLE_BIT(ihost->completion_queue[get_index]))
return true;... | false | false | false | false | false | 0 |
__dlm_put_mle(struct dlm_master_list_entry *mle)
{
struct dlm_ctxt *dlm;
dlm = mle->dlm;
assert_spin_locked(&dlm->spinlock);
assert_spin_locked(&dlm->master_lock);
if (!atomic_read(&mle->mle_refs.refcount)) {
/* this may or may not crash, but who cares.
* it's a BUG. */
mlog(ML_ERROR, "bad mle: %p\n", mle)... | false | false | false | false | false | 0 |
table_primary_key(DB_DATABASE *db, const char *table, char ***primary)
{
const char *query =
"show index from `&1`";
MYSQL_RES *res;
MYSQL_ROW row;
int i;
if (do_query(db, "Unable to get primary key: &1", &res, query, 1, table))
return TRUE;
GB.NewArray(primary, sizeof(char *), 0);
for (i = 0; i < mysql_... | false | false | false | false | false | 0 |
graph_init() {
g_graph_background = g_get_fill_clear();
ndata = 0; nfd = 0; g_nbar = 0;
xx[GLE_AXIS_X0].off = true;
xx[GLE_AXIS_Y0].off = true;
xx[GLE_AXIS_T].off = true;
graph_freebars();
graph_free();
} | false | false | false | false | false | 0 |
note_add_store (rtx loc, const_rtx expr ATTRIBUTE_UNUSED, void *data)
{
rtx insn;
note_add_store_info *info = (note_add_store_info *) data;
int r, n;
if (!REG_P (loc))
return;
/* If this register is referenced by the current or an earlier insn,
that's OK. E.g. this applies to the register that is ... | false | false | false | false | false | 0 |
getc_commentless()
{
while (index_ < line_.length())
{
int c = xgetc();
if (!in_comment_)
{
/* scanning for start of comment */
if (c == '/')
{
c = xgetc();
if (c == '*')
{
in_comment_ = TRUE;
comment_.truncate();
}
else if (c == '/') /* // C++ style... | false | false | false | false | false | 0 |
SelectAddrMode5(SDValue N,
SDValue &Base, SDValue &Offset) {
if (!CurDAG->isBaseWithConstantOffset(N)) {
Base = N;
if (N.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(N)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->ge... | false | false | false | false | false | 0 |
ipoib_alloc_rx_skb(struct net_device *dev, int id)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
struct sk_buff *skb;
int buf_size;
u64 *mapping;
buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu);
skb = dev_alloc_skb(buf_size + IPOIB_HARD_LEN);
if (unlikely(!skb))
return NULL;
/*
* the IP header will be... | false | false | false | false | false | 0 |
CL_GetEntitySoundOrigin (int ent, vec3_t org)
{
centity_t *old;
if (ent < 0 || ent >= MAX_EDICTS)
Com_Error (ERR_DROP, "CL_GetEntitySoundOrigin: bad ent");
old = &cl_entities[ent];
VectorCopy (old->lerp_origin, org);
// FIXME: bmodel issues...
} | false | false | false | false | false | 0 |
on_check_column_toggled (GtkCellRendererToggle *cell, gchar *path, GcrCollectionModel *model)
{
GtkTreeIter iter;
g_assert (path != NULL);
if (gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (model), &iter, path))
gcr_collection_model_toggle_selected (model, &iter);
} | false | false | false | false | false | 0 |
_clean_program(CLPI_PROG_INFO *p)
{
int ii;
for (ii = 0; ii < p->num_prog; ii++) {
if (p->progs[ii].streams != NULL) {
X_FREE(p->progs[ii].streams);
}
}
X_FREE(p->progs);
} | false | false | false | false | false | 0 |
optional(int argc, char *argv[], int argi)
{
argi++;
if (argi >= argc)
return NULL;
if (argv[argi] == NULL)
return NULL;
if (argv[argi][0] == '-')
return NULL;
return strdup(argv[argi]);
} | false | false | false | false | false | 0 |
listAllItems(RevisionMap_t &revisions)
{
ReadDir dirContent(m_basedir);
std::string varname = StringPrintf("SYNCEVOLUTION_FILE_SOURCE_DELAY_LISTALL_%s", getDisplayName().c_str());
const char *delay = getenv(varname.c_str());
if (delay) {
int seconds = atoi(delay);
SE_LOG_DEBUG(getDispla... | false | false | false | false | true | 1 |
find(const QLanguageItem * other )
{
for ( int i = 0 ; i < mAddedItems.size() ; i++ )
{
QLanguageItem * languageItem = mAddedItems[i];
if ( other->isEqualTo( languageItem ) )
return languageItem;
}
return 0;
} | false | false | false | false | false | 0 |
ir_parse_ioapic_hpet_scope(struct acpi_dmar_header *header,
struct intel_iommu *iommu)
{
int ret = 0;
struct acpi_dmar_hardware_unit *drhd;
struct acpi_dmar_device_scope *scope;
void *start, *end;
drhd = (struct acpi_dmar_hardware_unit *)header;
start = (void *)(drhd + 1);
end = ((void *)drhd) + heade... | false | false | false | false | false | 0 |
goto_tag(GeanyDocument *doc, gboolean definition)
{
gchar *text = get_current_word_or_sel(doc, FALSE);
if (text)
symbols_goto_tag(text, definition);
else
utils_beep();
g_free(text);
} | 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.