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 |
|---|---|---|---|---|---|---|
actualize_speed_screen(IfaceInfo *iface, unsigned int interval, int index)
{
char speed[20]; /* buffer to store the formated speed string */
double rc_speed;
double tr_speed;
if ((iface_count == 1) && ( lcd_hgt >= 4)) { /* single interface mode */
if (iface->status == up) {
/* Calculate Download speed */... | true | true | false | false | false | 1 |
ColorSpaceDirectionToString(ColorSpaceDirection dir)
{
if(dir == COLORSPACE_DIR_TO_REFERENCE) return "to_reference";
else if(dir == COLORSPACE_DIR_FROM_REFERENCE) return "from_reference";
return "unknown";
} | false | false | false | false | false | 0 |
CanonicalizePath(const std::string& path) {
#ifdef DETECTED_OS_WINDOWS
wchar_t resolved[MAX_PATH_LENGTH];
wchar_t wide[MAX_PATH_LENGTH];
mbstowcs(wide, path.c_str(), MAX_PATH_LENGTH);
if(PathCanonicalize(resolved, wide) == FALSE)
#else
char resolved[MAX_PATH_LENGTH];
if(realpath(path.c_str(), re... | false | false | false | false | false | 0 |
write_protect_page(struct vm_area_struct *vma, struct page *page,
pte_t *orig_pte)
{
struct mm_struct *mm = vma->vm_mm;
unsigned long addr;
pte_t *ptep;
spinlock_t *ptl;
int swapped;
int err = -EFAULT;
unsigned long mmun_start; /* For mmu_notifiers */
unsigned long mmun_end; /* For mmu_notifiers */
... | false | false | false | false | false | 0 |
AdaptVersion( nVersion & version )
{
if ( sn_GetNetState() != nSERVER )
return;
// iterate over all watchers
nStrongWatcherList & watchers = sn_GetStrongWatchers();
for ( nStrongWatcherList::iterator iter = watchers.begin(); iter != watchers.end(); ++iter )
{
nConfItemVersionWatcher... | false | false | false | false | false | 0 |
property(e)
XPropertyEvent *e;
{
Atom a;
int delete;
Client *c;
/* we don't set curtime as nothing here uses it */
a = e->atom;
delete = (e->state == PropertyDelete);
c = getclient(e->window, 0);
if (c == 0)
return;
switch (a) {
case XA_WM_ICON_NAME:
if (c->iconname != 0)
XFree((char*) c->iconname);
... | false | false | false | false | false | 0 |
collecttoken(char *end)
{
String *s = newstring();
int c;
while((c=nextc())==' ' || c=='\t')
Straddc(s, getch()); /* blanks significant for getname() */
while((c=getch())>0 && utfrune(end, c)==0)
Straddc(s, c);
Straddc(s, 0);
if(c != '\n')
atnl();
return s;
} | false | false | false | false | false | 0 |
cpl_error_set_message_macro_(const char * function,
cpl_error_code code,
const char * file, unsigned line,
const char * text, va_list arglist)
{
/* Check copied from cpl_error_set_mess... | false | false | false | false | false | 0 |
odm_RATxRPTTimerSetting(
struct odm_dm_struct *dm_odm,
u16 minRptTime
)
{
ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, (" =====>odm_RATxRPTTimerSetting()\n"));
if (dm_odm->CurrminRptTime != minRptTime) {
ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
(" CurrminRptTime = 0x%04... | false | false | false | false | false | 0 |
custom_message_filter_func (GeditFileBrowserWidget *widget,
GeditFileBrowserStore *store,
GtkTreeIter *iter,
FilterData *data)
{
WindowData *wdata = get_window_data (data->window);
GFile *location;
guint flags = 0;
gboolean filter = FALSE;
GtkTreePath *path;
gtk_tree_... | false | false | false | false | false | 0 |
timerEvent(QTimerEvent *timerEvent)
{
if (timerEvent->timerId() == transferTimerId) {
abort();
killTimer(transferTimerId);
transferTimerId = 0;
}
} | false | false | false | false | false | 0 |
multipart_remove_at (GMimeMultipart *multipart, int index)
{
GMimeObject *part;
if ((guint) index >= multipart->children->len)
return NULL;
part = multipart->children->pdata[index];
g_ptr_array_remove_index (multipart->children, index);
return part;
} | false | false | false | false | false | 0 |
pcf8583_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
struct i2c_client *client = to_i2c_client(dev);
unsigned char ctrl, year[2];
struct rtc_mem mem = {
.loc = CMOS_YEAR,
.nr = sizeof(year),
.data = year
};
int real_year, year_offset, err;
/*
* Ensure that the RTC is running.
*/
pcf8583_ge... | false | false | false | false | false | 0 |
pcl3_close_device(gx_device *device)
{
pcl3_Device *dev = (pcl3_Device *)device;
/* HP recommends that a driver should send the Printer Reset command at the
end of each print job in order to leave the printer in its default state.
This is a matter of courtesy for the next print job which could otherwi... | false | false | false | false | false | 0 |
libmpq__decompress_bzip2(uint8_t *in_buf, uint32_t in_size, uint8_t *out_buf, uint32_t out_size) {
/* some common variables. */
int32_t result = 0;
int32_t tb = 0;
bz_stream strm;
/* initialize the bzlib decompression. */
strm.bzalloc = NULL;
strm.bzfree = NULL;
/* initialize the structure. */
if ((res... | false | false | false | false | false | 0 |
XS_echo(pTHX_ CV *perlcv)
{
int i;
char *word;
STRLEN len;
FETCHWORLDVARS;
dXSARGS;
FETCHWORLD;
for (i = 1; i < items; ++i) {
word = SvPV(ST(i), len);
if (world && world->gui->txtView) {
ansitextview_append_echoed_string(world->gui, word, len);
} else {
printf(word);
}... | false | false | false | false | false | 0 |
ck_seat_has_device (CkSeat *seat,
GValueArray *device,
gboolean *result,
GError *error)
{
g_return_val_if_fail (CK_IS_SEAT (seat), FALSE);
return TRUE;
} | false | false | false | false | false | 0 |
__ecereMethod_ToolBox_AddControl(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Class * _class)
{
struct ToolBox * __ecerePointer_ToolBox = (struct ToolBox *)(this ? (((char *)this) + __ecereClass_ToolBox->offset) : 0);
struct __ecereNameSpace__ecere__com__Instance * control ... | false | true | false | false | false | 1 |
rl_vi_delete_to (count, key)
int count, key;
{
int c;
if (_rl_uppercase_p (key))
rl_stuff_char ('$');
else if (vi_redoing)
rl_stuff_char (_rl_vi_last_motion);
if (rl_vi_domove (key, &c))
{
rl_ding ();
return -1;
}
/* These are the motion commands that do not require adjusti... | false | false | false | false | false | 0 |
reset ( void )
{
GdkCursor *cursor;
cursor = create_eraser_cursor(m_priv->eraser_type);
if(!cursor)
{
printf("Debug eraser reset\n");
cursor = gdk_cursor_new ( GDK_CROSSHAIR );
g_assert(cursor);
}
gdk_window_set_cursor ( m_priv->cv->drawing, cursor );
gdk_cursor_unref( cursor );
m_priv->is_draw = FAL... | false | false | false | false | false | 0 |
directorClassName(Node *n) {
String *dirclassname;
const char *attrib = "director:classname";
if (!(dirclassname = Getattr(n, attrib))) {
String *classname = Getattr(n, "sym:name");
dirclassname = NewStringf("SwigDirector_%s", classname);
Setattr(n, attrib, dirclassname);
}
retu... | false | false | false | false | false | 0 |
lookup_conversion_operator (tree class_type, tree type)
{
int tpl_slot = -1;
if (TYPE_HAS_CONVERSION (class_type))
{
int i;
tree fn;
vec<tree, va_gc> *methods = CLASSTYPE_METHOD_VEC (class_type);
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
vec_safe_iterate (methods, i, &fn); ++i)
{
... | false | false | false | false | false | 0 |
ListSortCommand(Jim_Obj **lhsObj, Jim_Obj **rhsObj)
{
Jim_Obj *compare_script;
int rc;
jim_wide ret = 0;
compare_script = Jim_DuplicateObj(sort_info->interp, sort_info->command);
Jim_ListAppendElement(sort_info->interp, compare_script, *lhsObj);
Jim_ListAppendElement(sort_info->interp, co... | false | false | false | false | false | 0 |
check_colon(struct dsa *dsa)
{ if (skip_spaces(dsa, 0)) return 1;
if (dsa->c != ':')
{ xprintf("%s:%d: missing colon after `%s'\n", dsa->fname,
dsa->seqn, dsa->token);
return 1;
}
if (get_char(dsa)) return 1;
return 0;
} | false | false | true | false | true | 1 |
clar_test_run()
{
if (_clar.argc > 1)
clar_parse_args(_clar.argc, _clar.argv);
if (!_clar.suites_ran) {
size_t i;
for (i = 0; i < _clar_suite_count; ++i)
clar_run_suite(&_clar_suites[i], NULL);
}
return _clar.total_errors;
} | false | false | false | false | false | 0 |
confused_book(spellbook)
struct obj *spellbook;
{
boolean gone = FALSE;
if (!rn2(3) && spellbook->otyp != SPE_BOOK_OF_THE_DEAD) {
spellbook->in_use = TRUE; /* in case called from learn */
pline(
"Being confused you have difficulties in controlling your actions.");
display_nhwindow(WIN_MESSAGE, FALSE)... | false | false | false | false | false | 0 |
insert_hap_cand(const pos_t pos,
const unsigned sample_no,
const bool is_tier1,
const bam_seq_base& read_seq,
const uint8_t* qual,
const unsigned offset) {
if (! is_pos_reportable(pos)) return;
_stageman.validate_new_pos_value(pos... | false | false | false | false | false | 0 |
urlToString(const KUrl &url)
{
if (url.isLocalFile())
{
#if 1
return url.url(/*0 , KGlobal::locale()->fileEncodingMib()*/);
#else
// According to the XDND spec, file:/ URLs for DND must have
// the hostname part. But in really it just breaks many apps,
// so it's disabled for now... | false | false | false | false | false | 0 |
receive_response_data_check(int conn_num, void *data, int idata_size)
{
int err;
int op, data_size;
if ((err = receive_response(conn_num, &op, &data_size)) < 0)
return err;
if (op == FNC_ERR)
return LD10K1_ERR_PROTOCOL;
if (data_size != idata_size)
return LD10K1_ERR_PROTOCOL;
if ((err = receive_msg_d... | false | false | false | false | false | 0 |
xfs_attr_refillstate(xfs_da_state_t *state)
{
xfs_da_state_path_t *path;
xfs_da_state_blk_t *blk;
int level, error;
trace_xfs_attr_refillstate(state->args);
/*
* Roll down the "path" in the state structure, storing the on-disk
* block number for those buffers in the "path".
*/
path = &state->path;
ASSERT... | false | false | false | false | false | 0 |
ssb_sdio_writeb(struct ssb_bus *bus, unsigned int addr, u8 val)
{
int error = 0;
sdio_writeb(bus->host_sdio, val, addr, &error);
if (unlikely(error)) {
dev_dbg(ssb_sdio_dev(bus), "%08X <- %02x, error %d\n",
addr, val, error);
}
return error;
} | false | false | false | false | false | 0 |
exo_icon_view_item_accessible_image_get_image_position (AtkImage *image,
gint *x,
gint *y,
AtkCoordType coord_type)
{
ExoIconViewItem... | false | false | false | false | false | 0 |
openAbstractFile3(AbstractFile* file, const unsigned int* key, const unsigned int* iv, int layers) {
uint32_t signatureBE;
uint32_t signatureLE;
if(!file)
return NULL;
file->seek(file, 0);
file->read(file, &signatureBE, sizeof(signatureBE));
signatureLE = signatureBE;
FLIPENDIAN(signatureBE);
FLIPENDIANLE(... | false | false | false | false | false | 0 |
Export(WebPRescaler* const rescaler, WEBP_CSP_MODE colorspace,
int rgba_stride, uint8_t* const rgba) {
uint32_t* const src = (uint32_t*)rescaler->dst;
const int dst_width = rescaler->dst_width;
int num_lines_out = 0;
while (WebPRescalerHasPendingOutput(rescaler)) {
uint8_t* const dst = rgb... | false | false | false | false | false | 0 |
wti_nps_reset_req(StonithPlugin * s, int request, const char * host)
{
int rc = 0;
int lorc = 0;
struct pluginDevice* nps;
if (Debug) {
LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);
}
ERRIFNOTCONFIGED(s,S_OOPS);
nps = (struct pluginDevice*) s;
if ((rc = NPSRobustLogin(nps)) != S_OK) {
LOG(PIL_CRIT... | false | false | false | false | false | 0 |
add_cell_to_lmlist(struct fcell *cell, struct bmaster *mp)
{
LMLIST *new;
size_t flen, dlen;
if(mp && cell && cell->fname && cell->fname[0]){
if((new=(LMLIST *)malloc(sizeof(*new))) == NULL ||
(new->fname=malloc(sizeof(char)*((flen=strlen(cell->fname))+1))) == NULL ||
(new->dir=malloc(sizeof(char)... | false | false | false | false | false | 0 |
close(int fd) {
/* Apparently POSIX says that if close() returns EINTR the
* file descriptor will be left in an undefined state, so
* when coding for POSIX we can't just loop on EINTR or we
* could run into race conditions with other threads.
* http://www.daemonology.net/blog/2011-12-17-POSIX-close-is-broken.h... | false | false | false | false | false | 0 |
L1()
{register object *base=vs_base;
register object *sup=base+VM1; VC1
vs_reserve(VM1);
{register object V1;
check_arg(1);
V1=(base[0]);
vs_top=sup;
goto TTL;
TTL:;
{object V2;
V2= Cnil;
{register object V3;
if(type_of((V1))==t_cons||((V1))==Cnil){
goto T3;}
V3= Cnil;
goto T2;
goto T3;
T3:;
{register o... | false | false | false | false | false | 0 |
Expect(int n) {
if (la->kind==n) Get(); else { SynErr(n); }
} | false | false | false | false | false | 0 |
randomizeGen(
const Unsigned genListLength, /* The length of the list genList. */
const Permutation *const genList[], /* The list of (generating) perms. */
const Unsigned count1, /* The minimum word length, as above. */
const Unsigned count2, /* The maximum word length, a... | false | false | false | false | false | 0 |
OTF_File_iofsl_seek( OTF_File* file, uint64_t pos ) {
int ret = 0;
#ifdef HAVE_ZLIB
int sync;
uint64_t read;
#endif /* HAVE_ZLIB */
OTF_File_iofsl *iofsl;
size_t size_sum;
off_t real_pos;
iofsl = file->iofsl;
if ( OTF_FILEMODE_WRITE == file->mode ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:... | false | false | false | false | false | 0 |
aisleriot_window_state_event (GtkWidget *widget,
GdkEventWindowState *event)
{
AisleriotWindow *window = AISLERIOT_WINDOW (widget);
AisleriotWindowPrivate *priv = window->priv;
if (event->changed_mask & (GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_MAXIMIZED)) {
gboolean is_fu... | false | false | false | false | false | 0 |
escreen_init(char **argv)
{
int ns_err;
_ns_efuns *efuns;
buttonbar_t *bbar;
spif_uchar_t old_pause = (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_PAUSE) ? (1) : (0));
if (TermWin.screen_mode == NS_MODE_NONE) {
return run_command(argv);
}
efuns = escreen_reg_funcs();
/* Creat... | false | false | false | false | false | 0 |
mei_hbm_start_req(struct mei_device *dev)
{
struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
struct hbm_host_version_request *start_req;
const size_t len = sizeof(struct hbm_host_version_request);
int ret;
mei_hbm_reset(dev);
mei_hbm_hdr(mei_hdr, len);
/* host start message */
start_req = (struct hbm_host_ver... | false | false | false | false | false | 0 |
merge (Keyword_List *list1, Keyword_List *list2, Keyword_Comparison less)
{
Keyword_List *result;
Keyword_List **resultp = &result;
for (;;)
{
if (!list1)
{
*resultp = list2;
break;
}
if (!list2)
{
*resultp = list1;
break;
}
... | false | false | false | false | false | 0 |
skip(const KUrl & sourceUrl, bool isDir)
{
KUrl dir = sourceUrl;
if (!isDir) {
// Skipping a file: make sure not to delete the parent dir (#208418)
dir.setPath(dir.directory());
}
while (dirsToRemove.removeAll(dir) > 0) {
// Do not rely on rmdir() on the parent directories aborti... | false | false | false | false | false | 0 |
png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr)
{
if (info_ptr == NULL) /* reduce code size; check here not in the caller */
return;
info_ptr->colorspace = png_ptr->colorspace;
png_colorspace_sync_info(png_ptr, info_ptr);
} | false | false | false | false | false | 0 |
addListener(LogListener* listener)
{
OGRE_LOCK_AUTO_MUTEX;
if (std::find(mListeners.begin(), mListeners.end(), listener) == mListeners.end())
mListeners.push_back(listener);
} | false | false | false | false | false | 0 |
init_reg_map (struct inline_remap *map, int maxregnum)
{
int i;
for (i = maxregnum - 1; i > LAST_VIRTUAL_REGISTER; i--)
map->reg_map[i] = regno_reg_rtx[i];
/* Just clear the rest of the entries. */
for (i = LAST_VIRTUAL_REGISTER; i >= 0; i--)
map->reg_map[i] = 0;
map->reg_map[VIRTUAL_STACK_VARS_REG... | false | false | false | false | false | 0 |
odbc_col_attributes(SV *sth, int colno, int desctype)
{
D_imp_sth(sth);
RETCODE rc;
SV *retsv = NULL;
unsigned char str_attr[512];
SWORD str_attr_len = 0;
SQLLEN num_attr = 0;
memset(str_attr, '\0', sizeof(str_attr));
if ( !DBIc_ACTIVE(imp_sth) ) {
dbd_error(sth, DBDODBC_INTERN... | false | false | false | false | false | 0 |
gf_proc_dump_mempool_info (glusterfs_ctx_t *ctx)
{
struct mem_pool *pool = NULL;
gf_proc_dump_add_section ("mempool");
list_for_each_entry (pool, &ctx->mempool_list, global_list) {
gf_proc_dump_write ("-----", "-----");
gf_proc_dump_write ("pool-name", "%s", poo... | false | false | false | false | false | 0 |
InterruptRead(int reader_index, int timeout /* in ms */)
{
int ret, actual_length;
int return_value = IFD_SUCCESS;
unsigned char buffer[8];
struct libusb_transfer *transfer;
int completed = 0;
/* Multislot reader: redirect to Multi_InterrupRead */
if (usbDevice[reader_index].multislot_extension != NULL)
retur... | true | true | false | false | false | 1 |
delete_path(UniqueStringList* list) {
if (list != nil) {
for (ListItr(UniqueStringList) i(*list); i.more(); i.next()) {
UniqueString* s = i.cur();
delete s;
}
delete list;
}
} | false | false | false | false | false | 0 |
IsActiveDeviceType(const cec_device_type type)
{
CECDEVICEVEC activeDevices;
if (m_processor)
m_processor->GetDevices()->GetActive(activeDevices);
CCECDeviceMap::FilterType(type, activeDevices);
return !activeDevices.empty();
} | false | false | false | false | false | 0 |
SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v)
{
BIGNUM *kv = NULL, *gb = NULL;
BIGNUM *B = NULL, *k = NULL;
BN_CTX *bn_ctx;
if (b == NULL || N == NULL || g == NULL || v == NULL ||
(bn_ctx = BN_CTX_new()) == NULL)
return NULL;
if ( (kv = BN_new()) == NULL ||
(gb = BN_new()) == NULL ||
(B = BN_... | false | false | false | false | false | 0 |
inic_host_intr(struct ata_port *ap)
{
void __iomem *port_base = inic_port_base(ap);
struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag);
u8 irq_stat;
u16 idma_stat;
/* read and clear IRQ status */
irq_stat = readb(port_base + PORT_IRQ_STAT);
writeb(irq_stat, port_base + PORT_IRQ_STAT);
idma_st... | false | false | false | false | false | 0 |
lpfc_sli_free_hbq(struct lpfc_hba *phba, struct hbq_dmabuf *hbq_buffer)
{
uint32_t hbqno;
if (hbq_buffer) {
hbqno = hbq_buffer->tag >> 16;
if (lpfc_sli_hbq_to_firmware(phba, hbqno, hbq_buffer))
(phba->hbqs[hbqno].hbq_free_buffer)(phba, hbq_buffer);
}
} | false | false | false | false | false | 0 |
get_scr_cfg_addr(struct ata_link *link, unsigned int sc_reg)
{
struct ata_port *ap = link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
unsigned int addr = SIS_SCR_BASE + (4 * sc_reg);
u8 pmr;
if (ap->port_no) {
switch (pdev->device) {
case 0x0180:
case 0x0181:
pci_read_config_byte(pdev, SIS_PM... | false | false | false | false | false | 0 |
cleanup(void) {
Arg a = {.ui = ~0};
Layout foo = { "", NULL };
Monitor *m;
view(&a);
selmon->lt[selmon->sellt] = &foo;
for(m = mons; m; m = m->next)
while(m->stack)
unmanage(m->stack, False);
if(dc.font.set)
XFreeFontSet(dpy, dc.font.set);
else
XFreeFont(dpy, dc.font.xfont);
XUngrabKey(dpy, AnyKey, A... | false | false | false | false | true | 1 |
do_x86cpu_entry(const char *filename, void *symval,
char *alias)
{
DEF_FIELD(symval, x86_cpu_id, feature);
DEF_FIELD(symval, x86_cpu_id, family);
DEF_FIELD(symval, x86_cpu_id, model);
DEF_FIELD(symval, x86_cpu_id, vendor);
strcpy(alias, "cpu:type:x86,");
ADD(alias, "ven", vendor != X86_VENDOR_ANY, vendor);... | false | true | false | false | false | 1 |
bch_bset_fix_lookup_table(struct btree_keys *b,
struct bset_tree *t,
struct bkey *k)
{
unsigned shift = bkey_u64s(k);
unsigned j = bkey_to_cacheline(t, k);
/* We're getting called from btree_split() or btree_gc, just bail out */
if (!t->size)
return;
/* k is the key we just inserted; we nee... | false | false | false | false | false | 0 |
wm8750_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
{
u16 pwr_reg = snd_soc_read(codec, WM8750_PWR1) & 0xfe3e;
switch (level) {
case SND_SOC_BIAS_ON:
/* set vmid to 50k and unmute dac */
snd_soc_write(codec, WM8750_PWR1, pwr_reg | 0x00c0);
break;
case SND_SOC_BIAS_PREPARE:
... | false | false | false | false | false | 0 |
__update_gt_cputime(atomic64_t *cputime, u64 sum_cputime)
{
u64 curr_cputime;
retry:
curr_cputime = atomic64_read(cputime);
if (sum_cputime > curr_cputime) {
if (atomic64_cmpxchg(cputime, curr_cputime, sum_cputime) != curr_cputime)
goto retry;
}
} | false | false | false | false | false | 0 |
callbackFullscreen (Component *comp, int key)
{
if (wantfullscreen) wantfullscreen = 0;
else wantfullscreen = 1;
if (wantfullscreen) ((Label *) optmenu [0]->components [18])->setText ("YES");
else ((Label *) optmenu [0]->components [18])->setText ("NO");
} | false | false | false | false | false | 0 |
keyRelease(const XEvent *)
{
if (_delayTimer!=0)
{
_delayTimer->stop();
_delayTimer=0;
}
stopRepeatTimer();
} | false | false | false | false | false | 0 |
i40e_unmap_and_free_tx_resource(struct i40e_ring *ring,
struct i40e_tx_buffer *tx_buffer)
{
if (tx_buffer->skb) {
dev_kfree_skb_any(tx_buffer->skb);
if (dma_unmap_len(tx_buffer, len))
dma_unmap_single(ring->dev,
dma_unmap_addr(tx_buffer, dma),
dma_unmap_len(tx_buffer, len),
DMA_TO_DEV... | false | false | false | false | false | 0 |
m88e1149_config_init(struct phy_device *phydev)
{
int err;
/* Change address */
err = phy_write(phydev, MII_MARVELL_PHY_PAGE, 0x0002);
if (err < 0)
return err;
/* Enable 1000 Mbit */
err = phy_write(phydev, 0x15, 0x1048);
if (err < 0)
return err;
err = marvell_of_reg_init(phydev);
if (err < 0)
return ... | false | false | false | false | false | 0 |
e_mail_config_service_notebook_add_page (EMailConfigServiceNotebook *notebook,
EMailConfigServiceBackend *backend,
GtkWidget *child)
{
g_return_val_if_fail (E_IS_MAIL_CONFIG_SERVICE_NOTEBOOK (notebook), -1);
g_return_val_if_fail (E_IS_M... | false | false | false | false | false | 0 |
destroy_by_function (FMTreeModel *model, FilePredicate f)
{
TreeNode *node;
for (node = model->details->root_node; node != NULL; node = node->next) {
destroy_children_by_function (model, node, f);
}
} | false | false | false | false | false | 0 |
determine_partition_type_for_id (const gchar *table_type,
const gchar *id_type)
{
const gchar *ret = NULL;
guint n;
for (n = 0; n < G_N_ELEMENTS (partition_types_by_id); n++)
{
if (g_strcmp0 (partition_types_by_id[n].table_type, table_type) == 0 &&
g_strcmp0 (... | false | false | false | false | false | 0 |
HandlePlayerEnterZone(Player* player, bool isMainZone)
{
OutdoorPvP::HandlePlayerEnterZone(player, isMainZone);
// remove the buff from the player first because there are some issues at relog
player->RemoveAurasDueToSpell(SPELL_AUCHINDOUN_BLESSING);
// Handle the buffs
if (player->GetTeam() == m_z... | false | false | false | false | false | 0 |
get_space(size_t need)
{
need += TPS(out_used);
if (need > TPS(out_size)) {
TPS(out_size) = need * 2;
TPS(out_buff) = typeRealloc(char, TPS(out_size), TPS(out_buff));
if (TPS(out_buff) == 0)
_nc_err_abort(MSG_NO_MEMORY);
}
} | false | false | false | false | false | 0 |
xgbe_exit(struct xgbe_prv_data *pdata)
{
unsigned int count = 2000;
DBGPR("-->xgbe_exit\n");
/* Issue a software reset */
XGMAC_IOWRITE_BITS(pdata, DMA_MR, SWR, 1);
usleep_range(10, 15);
/* Poll Until Poll Condition */
while (--count && XGMAC_IOREAD_BITS(pdata, DMA_MR, SWR))
usleep_range(500, 600);
if (!c... | false | false | false | false | false | 0 |
getAttrProp(const PP_AttrProp ** ppAP, PP_RevisionAttr ** pRevisions,
bool bShowRevisions, UT_uint32 iRevisionId, bool &bHiddenRevision) const
{
UT_return_val_if_fail(m_pDoc, false);
return m_pDoc->getAttrProp(m_apIndex, ppAP, pRevisions, bShowRevisions, iRevisionId, bHiddenRevision);
} | false | false | false | false | false | 0 |
setLodLevels(const LodValueList& lodValues)
{
// Square the distances for the internal list
LodValueList::const_iterator i, iend;
iend = lodValues.end();
// First, clear and add single zero entry
mLodValues.clear();
mUserLodValues.clear();
mUserLodValues.push_... | false | false | false | false | false | 0 |
read_jp2box(FILE *inptr,unsigned long offset)
{
static struct jp2box box;
struct jp2box *newbox = NULL;
if(inptr)
{
box.boxoffset = offset;
box.lbox = read_ulong(inptr,TIFF_MOTOROLA,offset);
if(!feof(inptr) && !(ferror(inptr)))
{
box.tbox = read_ulong(inptr,... | false | false | false | false | false | 0 |
setPlaneVolume ()
{
if (game == GAME_PLAY)
{
int lev = (int) ((float) 128 * fplayer->thrust / fplayer->maxthrust) - 32;
sound->stop (SOUND_PLANE1);
sound->engine = (int) (fplayer->thrust / fplayer->maxthrust * 20) - 10;
sound->setVolume (SOUND_PLANE1, lev);
sound->playLoop (SOUND_PLANE1);
}
... | false | false | false | false | false | 0 |
generateIota (Tree sig, Tree n)
{
int size;
if (!isSigInt(n, &size)) { fprintf(stderr, "error in generateIota\n"); exit(1); }
//cout << "iota !" << endl;
return subst(" t \\bmod{$0} ", docT(size));
} | false | false | false | false | false | 0 |
dm1105_dmx_buffer(struct work_struct *work)
{
struct dm1105_dev *dev = container_of(work, struct dm1105_dev, work);
unsigned int nbpackets;
u32 oldwrp = dev->wrp;
u32 nextwrp = dev->nextwrp;
if (!((dev->ts_buf[oldwrp] == 0x47) &&
(dev->ts_buf[oldwrp + 188] == 0x47) &&
(dev->ts_buf[oldwrp + 188 * 2] == 0x47)... | false | true | false | false | false | 1 |
check_for_items_to_pickup(level *item_lvl, int item_index)
{
gps item_vpos;
if (item_lvl == NULL || item_index == -1)
return FALSE;
update_virtual_position(&item_vpos, &item_lvl->ItemList[item_index].pos, Me.pos.z);
if ((calc_distance(Me.pos.x, Me.pos.y, item_vpos.x, item_vpos.y) < ITEM_TAKE_DIST)
&& DirectL... | false | false | false | false | false | 0 |
trans_clear(void) {
entry_t clear_entry[1];
entry_t * entry;
uint32 index;
trans_set_date(0);
clear_entry->lock = 0;
clear_entry->move = MoveNone;
clear_entry->date = Trans->date;
clear_entry->move_depth = DepthNone;
clear_entry->min_depth = DepthNone;
clear_entry->max_depth = DepthNone... | false | false | false | false | false | 0 |
h_resample(uint8_t *dst, int dst_width, const uint8_t *src,
int src_width, int src_start, int src_incr,
int16_t *filters)
{
int n, src_end;
if (src_start < 0) {
n = (0 - src_start + src_incr - 1) / src_incr;
h_resample_slow(dst, n, src, src_width, s... | false | false | false | false | false | 0 |
ole_open(FILE *stream) {
oleEntry *e=(oleEntry *)stream;
if ( e->type != oleStream)
return -2;
e->ole_offset=0;
e->file_offset= ftell(e->file);
return 0;
} | false | false | false | false | false | 0 |
goToNextBlock(TeeMultiplexerData * data) {
BlockData * ptr = data->dataBlocks;
static int i = 0;
i++;
pthread_mutex_lock(&data->continue_mutex);
// Received kill signal
if (data->count < 0)
return true;
// Check that there is work left
data->count--;
if (data->count == 0 && !data->done)
pthread_cond_wai... | false | false | false | false | false | 0 |
addWord(int step) {
Word* result = 0;
switch (step) {
case 0:
result = addRandomWord(Qt::Horizontal);
m_current += QPoint(wordLength() - 1, 0);
break;
case 1:
result = addRandomWord(Qt::Vertical);
m_current += QPoint(0, wordLength());
break;
default:
break;
}
return result;
} | false | false | false | false | false | 0 |
gf_rdma_create_cq (rpc_transport_t *this)
{
gf_rdma_private_t *priv = NULL;
gf_rdma_options_t *options = NULL;
gf_rdma_device_t *device = NULL;
uint64_t send_cqe = 0;
int32_t ret = 0;
struct ibv_dev... | false | false | false | false | false | 0 |
mtcp_writefile (int fd, void const *buff, size_t size)
{
char const *bf;
ssize_t rc;
size_t sz, wt;
static char zeroes[MTCP_PAGE_SIZE] = { 0 };
//checkpointsize += size;
bf = buff;
sz = size;
while (sz > 0) {
for (wt = sz; wt > 0; wt /= 2) {
rc = mtcp_sys_write (fd, bf, wt);
if ((rc >=... | true | true | false | false | false | 1 |
get_scrambled_bit(v22bis_state_t *s)
{
int bit;
if ((bit = s->tx.current_get_bit(s->user_data)) == PUTBIT_END_OF_DATA)
{
/* Fill out this symbol with ones, and prepare to send
the rest of the shutdown sequence. */
s->tx.current_get_bit = fake_get_bit;
s->tx.shutdown = 1;
... | false | false | false | false | false | 0 |
do_port_ax25(struct interface *i)
{
struct ifreq ifr;
int proto = (Testing)?ETH_P_ALL:ETH_P_AX25;
if ((i->dev = ax25_config_get_dev(i->port)) == NULL) {
fprintf(stderr, "aprsdigi: invalid ax25 port name - %s\n", i->port);
exit(1);
}
i->devname = strdup(i->port);
i->rsa_size = i->tsa_size = sizeof(s... | false | true | false | false | false | 1 |
backsql_entryID_dup( backsql_entryID *src, void *ctx )
{
backsql_entryID *dst;
if ( src == NULL ) return NULL;
dst = slap_sl_calloc( 1, sizeof( backsql_entryID ), ctx );
ber_dupbv_x( &dst->eid_ndn, &src->eid_ndn, ctx );
if ( src->eid_dn.bv_val == src->eid_ndn.bv_val ) {
dst->eid_dn = dst->eid_ndn;
} else {
... | false | false | false | false | false | 0 |
stopCPUGuard()
{
if (s_disableCPUGuard) return;
stopTimeoutCheck();
} | false | false | false | false | false | 0 |
getTrustedCertDirs(OFList<OFString>& trustedDirs /*out*/) const
{
OFListConstIterator(OFString) it = m_trustedCertDirs.begin();
while (it != m_trustedCertDirs.end())
{
trustedDirs.push_back(*it);
it++;
}
} | false | false | false | false | false | 0 |
cache_init(struct device *dev, int block_size_shift)
{
struct cache *prev, *cur;
char *data = dev->cache_data;
struct cache *head, *cache;
int i;
dev->cache_block_size = 1 << block_size_shift;
if (dev->cache_size < dev->cache_block_size + 2*sizeof(struct cache)) {
dev->cache_head = NULL;
ret... | false | false | false | false | false | 0 |
Execute() {
if (!_alpha_set) {
char* newalpha = StrEditDialog::post
(GetEditor()->GetWindow(),
"Enter alpha value", "0.5");
if (newalpha)
_alpha = atof(newalpha);
else
_alpha = 1.0;
_alpha_set = true;
}
OverlayEditor* ed = (OverlayEditor*)GetEditor();
OverlaySelection... | false | false | false | false | false | 0 |
arm_get_reg(int regnum)
{
switch( regnum )
{
case ARM32_R0: return arm.sArmRegister[ 0];
case ARM32_R1: return arm.sArmRegister[ 1];
case ARM32_R2: return arm.sArmRegister[ 2];
case ARM32_R3: return arm.sArmRegister[ 3];
case ARM32_R4: return arm.sArmRegister[ 4];
case ARM32_R5: return arm.sArmRegister... | false | false | false | false | false | 0 |
vfio_msi_disable(struct vfio_pci_device *vdev, bool msix)
{
struct pci_dev *pdev = vdev->pdev;
int i;
vfio_msi_set_block(vdev, 0, vdev->num_ctx, NULL, msix);
for (i = 0; i < vdev->num_ctx; i++) {
vfio_virqfd_disable(&vdev->ctx[i].unmask);
vfio_virqfd_disable(&vdev->ctx[i].mask);
}
if (msix) {
pci_disable... | false | false | false | false | false | 0 |
owl_escape_value(int pos)
{
/* FIXME: Should have a more robust mechanism to avoid
* escaping inwards. Returning a negative value is just a kludge.
*/
int k;
ASSERT_ON_BOARD1(pos);
if (current_owl_data->goal[pos])
return -10;
if (board[pos] == EMPTY)
for (k = 0; k < 8; k++)
if (ON_BOARD(... | false | false | false | false | false | 0 |
check_reply_server(krb5_context context, krb5_flags kdcoptions,
krb5_creds *in_cred, krb5_kdc_rep *dec_rep)
{
if (!krb5_principal_compare(context, dec_rep->ticket->server,
dec_rep->enc_part2->server))
return KRB5_KDCREP_MODIFIED;
/* Reply is self-cons... | false | false | false | false | false | 0 |
gpk_log_treeview_clicked_cb (GtkTreeSelection *selection, gpointer data)
{
GtkTreeModel *model;
GtkTreeIter iter;
gchar *id;
/* This will only work in single or browse selection mode! */
if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
g_free (transaction_id);
gtk_tree_model_get (model, &iter... | false | false | false | false | false | 0 |
setCode(const OFString &codeValue,
const OFString &codingSchemeDesignator,
const OFString &codeMeaning)
{
return setCode(codeValue, codingSchemeDesignator, "", codeMeaning);
} | 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.