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 |
|---|---|---|---|---|---|---|
pymixer_free(struct pymixer *self)
{
int idx;
for (idx = 0; idx < self->hctl_count; idx++) {
snd_mixer_detach_hctl(self->mixer, self->hctl[idx*2]);
Py_DECREF((PyObject *)self->hctl[idx*2+1]);
}
if (self->hctl)
free(self->hctl);
self->hctl_count = 0;
self->hctl = NULL;
for (idx = 0; idx < self->helem_coun... | false | false | false | false | false | 0 |
fill_x11_info (SessionInfo *si)
{
guint xorg_pid;
gboolean can_connect;
gboolean res;
CkProcessStat *xorg_stat;
GError *error;
/* assume this is true then check it */
si->x11_display = ck_unix_pid_get_env (si->pid, "DISPLAY");
... | false | false | false | false | false | 0 |
gfs_pio_gets(GFS_File gf, char *s, size_t size)
{
gfarm_error_t e = gfs_pio_check_view_default(gf);
char *p = s;
int c;
gfarm_timerval_t t1, t2;
if (e != GFARM_ERR_NO_ERROR) {
gflog_debug(GFARM_MSG_1001329,
"gfs_pio_check_view_default() failed: %s",
gfarm_error_string(e));
return (e);
}
GFARM_TIMEVAL... | false | false | false | false | false | 0 |
setup_term_clip()
{
int z = 0;
char *strp = "";
Widget AppShell;
if (!x_connect_to_server())
return;
open_app_context();
if (app_context != NULL && xterm_Shell == (Widget)0)
{
int (*oldhandler)();
#if defined(HAVE_SETJMP_H)
int (*oldIOhandler)();
#endif
# if defined(HAVE_GETTIMEOFDAY) ... | false | false | false | false | false | 0 |
gpk_application_get_checkbox_enable (GpkApplicationPrivate *priv, PkBitfield state)
{
gboolean enable_installed = TRUE;
gboolean enable_available = TRUE;
if (priv->action == GPK_ACTION_INSTALL)
enable_installed = FALSE;
else if (priv->action == GPK_ACTION_REMOVE)
enable_available = FALSE;
if (pk_bitfield_con... | false | false | false | false | false | 0 |
FillRectangle(PRectangle rc, Surface &surfacePattern)
{
wxBrush br;
/* C::B begin */
SurfaceImpl *surface = static_cast<SurfaceImpl *>(&surfacePattern);
if (surface->bitmap)
br = wxBrush(*(surface->bitmap));
else // Something is wrong so display in red
br = wxBrush(*wxRED);
/* C::B en... | false | false | false | false | false | 0 |
NDFD_WxTable2_StdInten (int base, int intens)
{
switch (intens) {
case INT_D:
case INT_DD:
return base - 1;
case INT_P:
return base + 1;
default:
return base;
}
} | false | false | false | false | false | 0 |
s_mp_ispow2(const mp_int *v)
{
mp_digit d;
int extra = 0, ix;
ix = MP_USED(v) - 1;
d = MP_DIGIT(v, ix); /* most significant digit of v */
extra = s_mp_ispow2d(d);
if (extra < 0 || ix == 0)
return extra;
while (--ix >= 0) {
if (DIGIT(v, ix) != 0)
return -1; /* not a power of two */
... | false | false | false | false | false | 0 |
verify_checksum(krb5_context context,
const struct PAC_INFO_BUFFER *sig,
const krb5_data *data,
void *ptr, size_t len,
const krb5_keyblock *key)
{
krb5_storage *sp = NULL;
uint32_t type;
krb5_error_code ret;
Checksum cksum;
memset(&cksum, 0, sizeof(cksum));
sp = krb5_storage_from_mem((... | false | false | false | false | false | 0 |
eventFilter(QObject *object, QEvent *event)
{
switch (event->type())
{
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseButtonDblClick:
case QEvent::MouseMove:
case QEvent::KeyPress:
case QEvent::KeyRelease:
case QEvent::De... | false | false | false | false | false | 0 |
save_gabedit_orbitals(gchar* FileName)
{
FILE *file;
file = FOpen(FileName, "w");
if(file == NULL)
{
gchar buffer[BSIZE];
sprintf(buffer,_("Sorry, I can not create '%s' file\n"),FileName);
Message(buffer,_("Error"),TRUE);
return;
}
if(sphericalBasis)
fprintf(file,"[Gabedit Format] Sphe\n");
else
... | false | true | false | false | false | 1 |
syslogs_handle_priority ( unsigned int count __unused,
int params[] ) {
if ( params[0] >= 0 ) {
syslogs_severity = params[0];
} else {
syslogs_severity = SYSLOG_DEFAULT_SEVERITY;
}
} | false | false | false | false | false | 0 |
schedule_timer (ACE_Event_Handler *event_handler,
const void *arg,
const ACE_Time_Value &delay,
const ACE_Time_Value &interval)
{
ACE_TRACE ("ACE_Dev_Poll_Reactor::schedule_timer");
ACE_MT (ACE_GUARD_R... | false | false | false | false | false | 0 |
readbpb(devp, drv)
devstat *devp;
int drv;
{
bpb_t bpb;
CONST char *cp;
int i, n;
cp = NULL;
devp -> fd = -1;
for (i = 0; i < maxfdtype; i++) {
if (drv != (int)fdtype[i].drive) continue;
if (!cp || strcmp(cp, fdtype[i].name)) {
bpb.nfat = 0;
if ((devp -> fd) >= 0) VOID_C close(devp -> fd);
memset((c... | false | false | false | false | false | 0 |
pop_decl_scope ()
{
if (VARRAY_ACTIVE_SIZE (decl_scope_table) <= 0)
abort ();
VARRAY_POP (decl_scope_table);
} | false | false | false | false | false | 0 |
vorbis_book_decodevs_add(codebook *book,float *a,oggpack_buffer *b,int n){
if(book->used_entries>0){
int step=n/book->dim;
long *entry = alloca(sizeof(*entry)*step);
float **t = alloca(sizeof(*t)*step);
int i,j,o;
for (i = 0; i < step; i++) {
entry[i]=decode_packed_entry_number(book,b);... | false | false | false | false | false | 0 |
showmultieop(const char *eop_string, unsigned int eop_length,
bool proteineop, unsigned int indentlevel,
GtFile *outfp)
{
gth_indent(outfp, indentlevel);
if (proteineop) {
gt_file_xprintf(outfp, "<Protein_eop_type>");
gt_file_xprintf(outfp, "%s", eop_string)... | false | false | false | false | false | 0 |
is_answertarget_allowed(dns_view_t *view, dns_name_t *name,
dns_rdatatype_t type, dns_name_t *tname,
dns_name_t *domain)
{
isc_result_t result;
dns_rbtnode_t *node = NULL;
char qnamebuf[DNS_NAME_FORMATSIZE];
char tnamebuf[DNS_NAME_FORMATSIZE];
char classbuf[64];
char typebuf[64];
/* By default, we allow a... | true | true | false | false | false | 1 |
make_table(struct archive_read *a, struct huffman_code *code)
{
if (code->maxlength < code->minlength || code->maxlength > 10)
code->tablesize = 10;
else
code->tablesize = code->maxlength;
code->table =
(struct huffman_table_entry *)malloc(sizeof(*code->table)
* (1 << code->tablesize));
return... | false | false | false | false | false | 0 |
bcm_flush(struct hci_uart *hu)
{
struct bcm_data *bcm = hu->priv;
bt_dev_dbg(hu->hdev, "hu %p", hu);
skb_queue_purge(&bcm->txq);
return 0;
} | false | false | false | false | false | 0 |
m_can_handle_lost_msg(struct net_device *dev)
{
struct net_device_stats *stats = &dev->stats;
struct sk_buff *skb;
struct can_frame *frame;
netdev_err(dev, "msg lost in rxf0\n");
stats->rx_errors++;
stats->rx_over_errors++;
skb = alloc_can_err_skb(dev, &frame);
if (unlikely(!skb))
return 0;
frame->can_id... | false | false | false | false | false | 0 |
MakeOutput( ChewingOutput *pgo, ChewingData *pgdata )
{
int chi_i, chiSymbol_i, i ;
/* fill zero to chiSymbolBuf first */
memset( pgo->chiSymbolBuf, 0, sizeof( wch_t ) * MAX_PHONE_SEQ_LEN );
/* fill chiSymbolBuf */
for (
chi_i = chiSymbol_i = 0;
chiSymbol_i < pgdata->chiSymbolBufLen;
chiSymbol_i ++ ) {
... | true | true | false | false | false | 1 |
resetConnection (Connection cxn)
{
ASSERT (cxn != NULL) ;
bufferSetDataSize (cxn->respBuffer,0) ;
cxn->loggedNoCr = false ;
cxn->maxCheck = 1 ;
cxn->immedRecon = false ;
cxn->doesStreaming = false ; /* who knows, next time around maybe... */
cxn->quitWasIssued = false ;
cxn->needsChecks = true ;
cx... | false | false | false | false | false | 0 |
wil_fw_copy_crash_dump(struct wil6210_priv *wil, void *dest,
u32 size)
{
int i;
const struct fw_map *map;
void *data;
u32 host_min, dump_size, offset, len;
if (wil_fw_get_crash_dump_bounds(wil, &dump_size, &host_min)) {
wil_err(wil, "%s: fail to obtain crash dump size\n", __func__);
return -EINVAL;
}
... | false | false | false | false | false | 0 |
plugin_find_optname(char *optfuncname, char *str)
{
char buf[64];
int id;
PLUGIN_ENTRY *p;
FUNC_VOID func;
if ((id = plugin_get_id(optfuncname)) < 0) return -1;
for(p=global_plugin_list[id];p;p=p->next) {
func = (FUNC_VOID) p->func;
(*func)(buf, (int)64);
if (strmatch(buf, str)) {
return... | true | true | false | false | false | 1 |
gst_tcp_client_sink_start (GstTCPClientSink * this)
{
int ret;
gchar *ip;
if (GST_OBJECT_FLAG_IS_SET (this, GST_TCP_CLIENT_SINK_OPEN))
return TRUE;
/* reset caps_sent flag */
this->caps_sent = FALSE;
/* create sending client socket */
GST_DEBUG_OBJECT (this, "opening sending client socket to %s:%d"... | false | false | false | false | false | 0 |
cpp_include(const_String_or_char_ptr fn, int sysfile) {
String *s = sysfile ? Swig_include_sys(fn) : Swig_include(fn);
if (s && single_include) {
String *file = Getfile(s);
if (Getattr(included_files, file)) {
Delete(s);
return 0;
}
Setattr(included_files, file, file);
}
if (!s) {
... | false | false | false | false | false | 0 |
mtrr_calc_range_state(u64 chunk_size, u64 gran_size,
unsigned long x_remove_base,
unsigned long x_remove_size, int i)
{
static struct range range_new[RANGE_NUM];
unsigned long range_sums_new;
static int nr_range_new;
int num_reg;
/* Convert ranges to var ranges state: */
num_reg = x86_setup_var_m... | false | false | false | false | false | 0 |
clk_set_max_rate(struct clk *clk, unsigned long rate)
{
if (!clk)
return 0;
return clk_set_rate_range(clk, clk->min_rate, rate);
} | false | false | false | false | false | 0 |
check_move_entry__run_test(H5F_t * file_ptr,
int test_num,
struct move_entry_test_spec * spec_ptr)
{
/* const char * fcn_name = "check_move_entry__run_test"; */
H5C_t * cache_ptr = file_ptr->shared->cache;
static char msg[128];
unsigne... | false | false | false | false | false | 0 |
dbus_g_proxy_manager_get (DBusConnection *connection)
{
DBusGProxyManager *manager;
dbus_connection_allocate_data_slot (&g_proxy_manager_slot);
if (g_proxy_manager_slot < 0)
g_error ("out of memory");
g_static_mutex_lock (&connection_g_proxy_lock);
manager = dbus_connection_get_data (connection, g_... | false | false | false | false | false | 0 |
vis_load (PluginHandle * plugin)
{
GList * node = g_list_find_custom (loaded_vis_plugins, plugin,
(GCompareFunc) vis_find_cb);
if (node != NULL)
return;
AUDDBG ("Loading %s.\n", plugin_get_name (plugin));
VisPlugin * header = plugin_get_header (plugin);
g_return_if_fail (header != NULL... | false | false | false | false | false | 0 |
search_gui_get_local_file_url(GtkWidget *widget)
{
const struct result_data *data;
const char *pathname;
GtkTreeModel *model;
GtkTreeIter iter;
g_return_val_if_fail(widget, NULL);
if (!drag_get_iter(GTK_TREE_VIEW(widget), &model, &iter))
return NULL;
data = get_result_data(model, &iter);
if (!(ST_LOCAL &... | false | false | false | false | false | 0 |
gretl_matrix_vectorize_new (const gretl_matrix *m)
{
gretl_matrix *v;
int n;
if (gretl_is_null_matrix(m)) {
return NULL;
}
n = m->rows * m->cols;
v = gretl_matrix_alloc(n, 1);
if (v != NULL) {
memcpy(v->val, m->val, n * sizeof *m->val);
}
return v;
} | false | false | false | false | false | 0 |
setAlignment(Qt::Alignment alignment)
{
if (d_ptr->alignment != alignment) {
d_ptr->alignment = alignment;
emit alignmentChanged(d_ptr->alignment);
}
} | false | false | false | false | false | 0 |
__ift_getObjectPath ( CMPIInstance * instance,
CMPIStatus * rc )
{
int j;
struct native_instance * i = (struct native_instance *) instance;
CMPIObjectPath * cop = newCMPIObjectPath ( i->nameSpace,
i->classname,
rc );
if ( rc && rc->rc != CMPI_RC_OK )
return NULL;
j = prop... | false | false | false | false | false | 0 |
landmarks(const QLandmarkFilter &filter, int limit, int offset,
const QList<QLandmarkSortOrder> &sortOrders) const
{
Q_D(const QLandmarkManager);
if (!d->engine) {
return QList<QLandmark>();
}
d->errorCode = QLandmarkManager::NoError;
d->errorSt... | false | false | false | false | false | 0 |
gst_rtspsrc_loop_interleaved (GstRTSPSrc * src)
{
GstRTSPMessage message = { 0 };
GstRTSPResult res;
GstFlowReturn ret = GST_FLOW_OK;
GTimeVal tv_timeout;
while (TRUE) {
/* get the next timeout interval */
gst_rtsp_connection_next_timeout (src->conninfo.connection, &tv_timeout);
/* see if the ti... | false | false | false | false | false | 0 |
dofmt(Fmt *f, char *fmt)
{
Rune rune, *rt, *rs;
int r;
char *t, *s;
int n, nfmt;
nfmt = f->nfmt;
for(;;){
if(f->runes){
rt = (Rune*)f->to;
rs = (Rune*)f->stop;
while((r = *(uchar*)fmt) && r != '%'){
if(r < Runeself)
fmt++;
else{
fmt += chartorune(&rune, fmt);
r = rune;
}
... | false | false | false | false | false | 0 |
strings_array_realloc_with_length (char ***pS,
int oldn,
int newn,
int len)
{
char **S;
int i, j;
if (pS == NULL) {
/* huh? */
return NULL;
}
if (newn == oldn) {
/* no-op */
return *pS;
}
if (newn <= 0) {
strings_array_free(*pS, oldn);
*pS = NULL;
return NULL... | false | false | false | false | false | 0 |
imprt(planner *ego, scanner *sc)
{
char buf[MAXNAM + 1];
md5uint sig[4];
unsigned l, u, timelimit_impatience;
flags_t flags;
int reg_id;
unsigned slvndx;
hashtab *ht = &ego->htab_blessed;
hashtab old;
md5 m;
if (!sc->scan(sc,
"(" WISDOM_PREAMBLE " #x%M #x%M #x%M ... | true | true | false | false | false | 1 |
getStatesMarkedWith(string proposition, bool disjunctive) {
if(components.size() == 0) return manager.bddZero();
BDD result;
if(disjunctive) result = manager.bddZero();
else result = manager.bddOne();
for(unsigned int i = 0; i < components.size(); ++i) { //for each component...
if(disjunct... | false | false | false | false | false | 0 |
init_phys_status_page(struct intel_engine_cs *ring)
{
struct drm_i915_private *dev_priv = ring->dev->dev_private;
if (!dev_priv->status_page_dmah) {
dev_priv->status_page_dmah =
drm_pci_alloc(ring->dev, PAGE_SIZE, PAGE_SIZE);
if (!dev_priv->status_page_dmah)
return -ENOMEM;
}
ring->status_page.page_addr... | false | false | false | false | false | 0 |
wsgi_thread_info(int create, int request)
{
WSGIThreadInfo *thread_handle = NULL;
apr_threadkey_private_get((void**)&thread_handle, wsgi_thread_key);
if (!thread_handle && create) {
WSGIThreadInfo **entry = NULL;
if (!wsgi_thread_details) {
wsgi_thread_details = apr_array_make... | false | false | false | false | false | 0 |
do_shall_skip(Relay_log_info *rli)
{
enum_skip_reason reason= Log_event::do_shall_skip(rli);
switch (reason) {
case Log_event::EVENT_SKIP_NOT:
case Log_event::EVENT_SKIP_COUNT:
return Log_event::EVENT_SKIP_NOT;
case Log_event::EVENT_SKIP_IGNORE:
return Log_event::EVENT_SKIP_IGNORE;
}
DBUG_ASSERT... | false | false | false | false | false | 0 |
bzv_finput(fp,vec)
FILE *fp;
ZVEC *vec;
{
u_int i,dim;
int io_code;
/* get dimension */
skipjunk(fp);
if ((io_code=fscanf(fp," ComplexVector: dim:%u",&dim)) < 1 ||
dim>MAXDIM )
error(io_code==EOF ? 7 : 6,"bzv_finput");
/* allocate memory if necessary */
... | false | false | false | false | false | 0 |
clear( int entire_buffer )
{
offset_ = 0;
reader_accum_ = 0;
modified_ = 0;
if ( buffer_ )
{
long count = (entire_buffer ? buffer_size_ : samples_avail());
memset( buffer_, 0, (count + blip_buffer_extra_) * sizeof (buf_t_) );
}
} | false | false | false | false | false | 0 |
addClosureMapping(UChar32 src, UChar32 dest) {
uint32_t value;
if(beVerbose) {
printf("add closure mapping U+%04lx->U+%04lx\n",
(unsigned long)src, (unsigned long)dest);
}
value=upvec_getValue(pv, src, 0);
if(value&UCASE_EXCEPTION) {
Props *p=excProps+(value>>UGENCA... | false | false | false | false | false | 0 |
__lnstat_scan_fields(struct lnstat_file *lf, char *buf)
{
char *tok;
int i;
tok = strtok(buf, " \t\n");
for (i = 0; i < LNSTAT_MAX_FIELDS_PER_LINE; i++) {
lf->fields[i].file = lf;
strncpy(lf->fields[i].name, tok, LNSTAT_MAX_FIELD_NAME_LEN);
/* has to be null-terminate since we initialize to zero
* and fie... | false | true | false | false | true | 1 |
_get_host(char *path, struct cntrl_device *cntrl)
{
char *result = NULL;
if (cntrl->cntrl_type == CNTRL_TYPE_SCSI)
result = scsi_get_slot_path(path, cntrl->sysfs_path);
else if (cntrl->cntrl_type == CNTRL_TYPE_AHCI)
result = ahci_get_port_path(path);
else if (cntrl->cntrl_type == CNTRL_TYPE_DELLSSD)
result =... | false | false | false | false | false | 0 |
construct_solutions( void )
/*
FUNCTION: manage the solution construction phase
INPUT: none
OUTPUT: none
(SIDE)EFFECTS: when finished, all ants of the colony have constructed a solution
*/
{
long int k; /* counter variable */
long int step; /* coun... | false | false | false | false | false | 0 |
snd_emu10k1_efx_send_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
unsigned long flags;
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
struct snd_emu10k1_pcm_mixer *mix = &emu->ef... | false | false | false | false | false | 0 |
canDropModelPart(ModelPart * modelPart) {
if (!SketchWidget::canDropModelPart(modelPart)) return false;
switch (modelPart->itemType()) {
case ModelPart::Logo:
if (modelPart->moduleID().contains("schematic", Qt::CaseInsensitive)) return true;
case ModelPart::Jumper:
case ModelPart::CopperFill:
cas... | false | false | false | false | false | 0 |
cuddTimesInDeathRow(
DdManager *dd,
DdNode *f)
{
int count = 0;
#ifndef DD_NO_DEATH_ROW
int i;
for (i = 0; i < dd->deathRowDepth; i++) {
count += f == dd->deathRow[i];
}
#endif
return(count);
} | false | false | false | false | false | 0 |
_get_params_table_from_valist (const gchar *first_param,
va_list args)
{
GHashTable *table = NULL;
gchar *p = NULL;
gchar *v = NULL;
g_return_val_if_fail (first_param != NULL, NULL);
table = g_hash_table_new_full (g_str_hash, g_str_equal,
... | false | false | false | false | false | 0 |
mce_read_aux(struct mce *m, int i)
{
if (m->status & MCI_STATUS_MISCV)
m->misc = mce_rdmsrl(MSR_IA32_MCx_MISC(i));
if (m->status & MCI_STATUS_ADDRV) {
m->addr = mce_rdmsrl(MSR_IA32_MCx_ADDR(i));
/*
* Mask the reported address by the reported granularity.
*/
if (mca_cfg.ser && (m->status & MCI_STATUS_MI... | false | false | false | false | false | 0 |
tor_tls_server_info_callback(const SSL *ssl, int type, int val)
{
tor_tls_t *tls;
(void) val;
tor_tls_debug_state_callback(ssl, type, val);
if (type != SSL_CB_ACCEPT_LOOP)
return;
if (ssl->state != SSL3_ST_SW_SRVR_HELLO_A)
return;
tls = tor_tls_get_by_ssl(ssl);
if (tls) {
/* Check whether w... | false | false | false | false | false | 0 |
font(Type1Font* font, const Vector<PermString>& glyph_names)
{
HashMap<PermString, int> encodings(-1);
if (Type1Encoding *encoding = font->type1_encoding())
for (int i = 255; i >= 0; i--)
encodings.insert(encoding->elt(i), i);
// First, calculate font bounds, and from there, the transform.
Charst... | false | false | false | false | false | 0 |
row_removed_cb (ClutterModel *model,
ClutterModelIter *iter,
MxItemView *item_view)
{
GList *children;
GList *l;
ClutterActor *child;
if (item_view->priv->is_frozen)
return;
children = clutter_container_get_children (CLUTTER_CONTAINER (item_view));
l = g_list_... | false | false | false | false | false | 0 |
start(const QVideoSurfaceFormat &format)
{
m_frame = QVideoFrame();
m_imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
m_imageSize = format.frameSize();
m_scanLineDirection = format.scanLineDirection();
const QAbstractVideoBuffer::HandleType t = format.handleType();
... | false | false | false | false | false | 0 |
scenarios_cancel_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
ScenariosState *state)
{
GSList *cur;
WorkbookControl *wbc;
restore_old_values (state);
wbc = WORKBOOK_CONTROL (state->base.wbcg);
/* Remove report sheets created on this dialog session. */
for (cur = state->new_report_sheets; cur != NULL;
... | false | false | false | false | false | 0 |
ath5k_eeprom_init_modes(struct ath5k_hw *ah)
{
struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
u32 mode_offset[3];
unsigned int mode;
u32 offset;
int ret;
/*
* Get values for all modes
*/
mode_offset[AR5K_EEPROM_MODE_11A] = AR5K_EEPROM_MODES_11A(ah->ah_ee_version);
mode_offset[AR5K_EEPROM_M... | false | false | false | false | false | 0 |
ppp_receive_error(struct ppp *ppp)
{
++ppp->dev->stats.rx_errors;
if (ppp->vj)
slhc_toss(ppp->vj);
} | false | false | false | false | false | 0 |
layoutSave()
{
QString key = traceKey();
QString layoutPrefix = QString("Layout%1-MainView");
_multiView->saveLayout(layoutPrefix.arg(_layoutCurrent), key);
// save all layouts as defaults (ie. without any group name postfix)
for(int i=0;i<_layoutCount;i++) {
_multiView->restoreLayout(layoutPrefi... | false | false | false | false | false | 0 |
close_wedge_median(patch_fill_state_t *pfs, wedge_vertex_list_t *l,
const patch_color_t *c0, const patch_color_t *c1)
{
int code;
if (!l->last_side)
return 0;
code = fill_wedge_from_list(pfs, l, c1, c0);
if (code < 0)
return code;
release_wedge_vertex_list_interval(pfs, l->b... | false | false | false | false | false | 0 |
acruire_wqe(mca_btl_openib_endpoint_t *ep,
mca_btl_openib_send_frag_t *frag)
{
int qp = to_base_frag(frag)->base.order;
int prio = !(to_base_frag(frag)->base.des_flags & MCA_BTL_DES_FLAGS_PRIORITY);
if(qp_get_wqe(ep, qp) < 0) {
qp_put_wqe(ep, qp);
opal_list_append(&ep->qps[qp].no_wq... | false | false | false | false | false | 0 |
coloraging (guint32 * src, guint32 * dest, gint video_area, gint * c)
{
guint32 a, b;
gint i;
gint c_tmp = *c;
c_tmp -= (gint) (fastrand ()) >> 28;
if (c_tmp < 0)
c_tmp = 0;
if (c_tmp > 0x18)
c_tmp = 0x18;
for (i = 0; i < video_area; i++) {
a = *src++;
b = (a & 0xfcfcfc) >> 2;
*dest+... | false | false | false | false | false | 0 |
nameserver_probe_failed(struct nameserver *const ns) {
struct timeval timeout;
int i;
ASSERT_LOCKED(ns->base);
(void) evtimer_del(&ns->timeout_event);
if (ns->state == 1) {
/* This can happen if the nameserver acts in a way which makes us mark */
/* it as bad and then starts sending good replies. */
return;... | true | true | false | false | false | 1 |
DoBuildTarget(TiXmlElement* parentNode)
{
TiXmlElement* node = parentNode->FirstChildElement("Target");
if (!node)
return; // no options
while (node)
{
ProjectBuildTarget* target = nullptr;
wxString title = cbC2U(node->Attribute("title"));
if (!title.IsEmpty())
... | false | false | false | false | false | 0 |
_mv88e6xxx_wait(struct dsa_switch *ds, int reg, int offset,
u16 mask)
{
unsigned long timeout = jiffies + HZ / 10;
while (time_before(jiffies, timeout)) {
int ret;
ret = _mv88e6xxx_reg_read(ds, reg, offset);
if (ret < 0)
return ret;
if (!(ret & mask))
return 0;
usleep_range(1000, 2000);
}
r... | false | false | false | false | false | 0 |
filterMatches( Meta::TrackPtr track ) const
{
return !m_filter->filterMatches( track );
} | false | false | false | false | false | 0 |
skipDeleteItem(skipList list, skipItem item) {
if(list->threaded) {
item->next[item->level + 1] = list->deleted->next[1];
list->cached++;
list->deleted->next[1] = item;
}
else {
skipFreeItem(list, item);
}
return;
} | false | false | false | false | true | 1 |
pmcraid_start_bist(struct pmcraid_cmd *cmd)
{
struct pmcraid_instance *pinstance = cmd->drv_inst;
u32 doorbells, intrs;
/* proceed with bist and wait for 2 seconds */
iowrite32(DOORBELL_IOA_START_BIST,
pinstance->int_regs.host_ioa_interrupt_reg);
doorbells = ioread32(pinstance->int_regs.host_ioa_interrupt_reg);... | false | false | false | false | false | 0 |
expand_right_edge (JSAMPARRAY image_data, int num_rows,
JDIMENSION input_cols, JDIMENSION output_cols)
{
register JSAMPROW ptr;
register JSAMPLE pixval;
register int count;
int row;
int numcols = (int) (output_cols - input_cols);
if (numcols > 0) {
for (row = 0; row < num_rows; row++... | false | false | false | false | false | 0 |
parse_request_line (gchar * buffer, RTSPMessage * msg)
{
gchar versionstr[20];
gchar methodstr[20];
gchar urlstr[4096];
gchar *bptr;
RTSPMethod method;
bptr = buffer;
read_string (methodstr, sizeof (methodstr), &bptr);
method = rtsp_find_method (methodstr);
if (method == -1)
goto wrong_method;
... | false | false | false | false | false | 0 |
snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar const** error _U_)
{
#ifdef HAVE_LIBGCRYPT
gcry_error_t err;
gcry_cipher_hd_t hd = NULL;
guint8* cleartext;
guint8* des_key = p->user_assoc->user.privKey.data; /* first 8 bytes */
guint8* pre_iv = &(p->user_assoc->user.privKey.data[8])... | false | false | false | false | false | 0 |
float32_unordered(float32 a, float32 b, float_status_t &status)
{
float_class_t aClass = float32_class(a);
float_class_t bClass = float32_class(b);
if (aClass == float_NaN || bClass == float_NaN)
{
if (float32_is_signaling_nan(a) || float32_is_signaling_nan(b))
{
float_raise... | false | false | false | false | false | 0 |
destroy_gateway(void *data)
{
struct fax_gateway *gateway = data;
destroy_v21_sessions(gateway);
if (gateway->s) {
fax_session_release(gateway->s, gateway->token);
gateway->token = NULL;
ao2_lock(faxregistry.container);
ao2_unlink(faxregistry.container, gateway->s);
ao2_unlock(faxregistry.container);
... | false | false | false | false | false | 0 |
ConnectedComponentFilter(RNScalar isolevel, RNArea min_grid_area, RNArea max_grid_area,
RNScalar under_isolevel_value, RNScalar too_small_value, RNScalar too_large_value)
{
// Compute connected components
int *sizes = new int [ grid_size ];
int *components = new int [ grid_size ];
int ncomponents = Con... | false | false | false | false | false | 0 |
print_objname (diff_opt_t * options, hsize_t nfound)
{
return ((options->m_verbose || nfound) && !options->m_quiet) ? 1 : 0;
} | false | false | false | false | false | 0 |
mat_init(struct param p)
{
unsigned int i;
check_alloc(mat=(double**)malloc(sizeof(double*)*p.DIM));
for (i=0;i<p.DIM;i++)
check_alloc(mat[i]=(double*)malloc(sizeof(double)*p.DIM));
check_alloc(av=(double*)malloc(sizeof(double)*p.DIM));
isinitgetfields=1;
} | false | true | false | false | true | 1 |
prism2_bss_list_proc_show(struct seq_file *m, void *v)
{
local_info_t *local = m->private;
struct list_head *ptr = v;
struct hostap_bss_info *bss;
if (ptr == &local->bss_list) {
seq_printf(m, "#BSSID\tlast_update\tcount\tcapab_info\tSSID(txt)\t"
"SSID(hex)\tWPA IE\n");
return 0;
}
bss = list_entry(ptr... | false | false | false | false | false | 0 |
ssh_socket_get_status(ssh_socket s) {
int r = 0;
if (ssh_buffer_get_len(s->in_buffer) > 0) {
r |= SSH_READ_PENDING;
}
if (ssh_buffer_get_len(s->out_buffer) > 0) {
r |= SSH_WRITE_PENDING;
}
if (s->data_except) {
r |= SSH_CLOSED_ERROR;
}
return r;
} | false | false | false | false | false | 0 |
ompi_common_ofacm_base_get_cpc_index(ompi_common_ofacm_base_component_t *cpc)
{
int i;
for (i = 0; NULL != all[i]; ++i) {
if (all[i] == cpc) {
return i;
}
}
/* Not found */
return -1;
} | false | false | false | false | true | 1 |
hdrl_imagelist_dump_structure(
const hdrl_imagelist * himlist,
FILE * stream)
{
const char * msg = "Imagelist with %d image(s)\n";
const int msgmin = (int)strlen(msg) - 5;
int i;
cpl_ensure_code(himlist != NULL, CPL_ERROR_NULL_INPUT);
cpl_ensure_co... | false | false | false | false | true | 1 |
MultilineCensus(const char *label)
{
size_t
number_lines;
/*
Determine the number of lines within this label.
*/
if (label == (char *) NULL)
return(0);
for (number_lines=1; *label != '\0'; label++)
if (*label == '\n')
number_lines++;
return(number_lines);
} | false | false | false | false | false | 0 |
hr222_micro_boost(struct pcxhr_mgr *mgr, int level)
{
unsigned char boost_mask;
boost_mask = (unsigned char) (level << PCXHR_SELMIC_PREAMPLI_OFFSET);
if (boost_mask & (~PCXHR_SELMIC_PREAMPLI_MASK))
return; /* only values form 0 to 3 accepted */
mgr->xlx_selmic &= ~PCXHR_SELMIC_PREAMPLI_MASK;
mgr->xlx_selmic |= ... | false | false | false | false | false | 0 |
check_space_for_heads(int ax, int ay, SockList *sl, socket_struct *ns) {
int layer, got_one = 0, del_one = 0, oldlen, has_obj = 0;
uint16 coord;
coord = MAP2_COORD_ENCODE(ax, ay, 0);
oldlen = sl->len;
SockList_AddShort(sl, coord);
for (layer = 0; layer < MAP_LAYERS; layer++) {
const ob... | false | false | false | false | false | 0 |
mouse_back_button_changed (gpointer callback_data)
{
int new_back_button;
new_back_button = g_settings_get_int (nautilus_preferences, NAUTILUS_PREFERENCES_MOUSE_BACK_BUTTON);
/* Bounds checking */
if (new_back_button < 6 || new_back_button > UPPER_MOUSE_LIMIT)
return;
mouse_back_button = new_back_button;
} | false | false | false | false | false | 0 |
xml_attribute(JSContext *cx, uintN argc, jsval *vp)
{
JSObject *qn;
if (argc == 0) {
js_ReportMissingArg(cx, vp, 0);
return JS_FALSE;
}
qn = ToAttributeName(cx, vp[2]);
if (!qn)
return JS_FALSE;
vp[2] = OBJECT_TO_JSVAL(qn); /* local root */
return GetPropert... | false | false | false | false | false | 0 |
posix_acl_xattr_update (xlator_t *this, inode_t *inode, dict_t *xattr,
char *name, struct posix_acl *old)
{
struct posix_acl *acl = NULL;
data_t *data = NULL;
data = dict_get (xattr, name);
if (data) {
acl = posix_acl_from_xa... | false | false | false | false | false | 0 |
end_sami_element (void *ctx, const xmlChar * name)
{
GstSamiContext *sctx = (GstSamiContext *) ctx;
GST_LOG ("name:%s", name);
if (!xmlStrncmp ((const xmlChar *) "sync", name, 4)) {
sctx->in_sync = FALSE;
} else if ((!xmlStrncmp ((const xmlChar *) "body", name, 4)) ||
(!xmlStrncmp ((const xmlChar *)... | false | false | false | false | false | 0 |
slotTriggered(QAction* action)
{
int idx = selectableActionGroup()->actions().indexOf(action);
if (idx == 0)
m_part->setFontScaleFactor(100);
else
m_part->setFontScaleFactor(fastZoomSizes[fastZoomSizeCount/2 + (m_direction ? 1 : -1)*idx]);
setCurrentAction( 0L );
} | false | false | false | false | false | 0 |
uart_report_port(struct uart_driver *drv, struct uart_port *port)
{
char address[64];
switch (port->iotype) {
case UPIO_PORT:
snprintf(address, sizeof(address), "I/O 0x%lx", port->iobase);
break;
case UPIO_HUB6:
snprintf(address, sizeof(address),
"I/O 0x%lx offset 0x%x", port->iobase, port->hub6);
brea... | false | false | false | false | false | 0 |
assign_clause_id(Topform c)
{
int i;
if (c->id > 0) {
p_clause(c);
fatal_error("assign_clause_id, clause already has ID.");
}
c->id = next_clause_id();
i = c->id % CLAUSE_ID_TAB_SIZE;
Topform_id_tab[i] = insert_clause_into_plist(Topform_id_tab[i], c, TRUE);
c->official_id = 1;
} | false | false | false | false | false | 0 |
bump2normal(int w, int h, char * data, VMfloat strength)
/* data has to be rgb */
{
int xi, yi, i, xi_n, yi_n;
VMfloat sd, sd_xn, sd_yn, dzx, dzy, dx, dy;
unsigned char * udata;
VMfloat * ddata;
VMvect n;
udata = (unsigned char *)data;
ddata = malloc(sizeof(VMfloat)*w*h);
f... | false | false | false | false | true | 1 |
visu_box_setExtension(VisuBox *boxObj, float extension[3])
{
g_return_val_if_fail(VISU_IS_BOX(boxObj), FALSE);
if (extension[0] == boxObj->priv->extension[0] &&
extension[1] == boxObj->priv->extension[1] &&
extension[2] == boxObj->priv->extension[2])
return FALSE;
boxObj->priv->extension[0] = ex... | false | false | false | false | false | 0 |
verifyStudyRootQuery(IDB_Query * queryStructure, int queryLevel)
{
CONDITION cond = APP_NORMAL;
switch (queryLevel) {
case IDB_PATIENT_LEVEL:
cond = 0;
break;
case IDB_STUDY_LEVEL:
if (queryStructure->SeriesQFlag != 0)
cond = 0;
if (queryStructure->ImageQFlag != 0)
cond = 0;
break;
c... | false | false | false | false | false | 0 |
decode_field_reference (tree exp, HOST_WIDE_INT *pbitsize,
HOST_WIDE_INT *pbitpos, enum machine_mode *pmode,
int *punsignedp, int *pvolatilep,
tree *pmask, tree *pand_mask)
{
tree outer_type = 0;
tree and_mask = 0;
tree mask, inner, offset;
tree unsigned_type;
unsigned int precision;
/* All the op... | false | false | false | false | false | 0 |
enter( GenericLord * lord )
{
if( _lords.indexOf( lord ) == -1 ) {
_lords.append( lord );
}
} | 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.