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 |
|---|---|---|---|---|---|---|
set_properties()
{
// begin wxGlade: DirectoryParamsPanel::set_properties
m_pTxtSearchDirPath->SetToolTip(_("Directory to search in files"));
m_pBtnSelectDir->SetToolTip(_("Browse for directory to search in"));
m_pChkSearchDirRecursively->SetToolTip(_("Search in directory files recursively"));
m_pCh... | false | false | false | false | false | 0 |
down()
{
macroModeClose();
DocIterator save = *this;
FuncRequest cmd(selection() ? LFUN_DOWN_SELECT : LFUN_DOWN, docstring());
this->dispatch(cmd);
if (disp_.dispatched())
return true;
setCursor(save);
autocorrect() = false;
return false;
} | false | false | false | false | false | 0 |
init_end_repeat(struct nvbios_init *init)
{
trace("END_REPEAT\n");
init->offset += 1;
if (init->repeat) {
init->repend = init->offset;
init->offset = 0;
}
} | false | false | false | false | false | 0 |
drivers_unload_all(void)
{
Driver *driver;
debug(RPT_DEBUG, "%s()", __FUNCTION__);
while ((driver = LL_Pop(loaded_drivers)) != NULL) {
driver_unload(driver);
}
return 0;
} | false | false | false | false | false | 0 |
send_invoke_get(Connection *boxc, Client *client) {
Octstr *pdu;
gw_assert(client != NULL);
gw_assert(client->wtp_invoked == 0);
gw_assert(client->wsp_connected == 1);
pdu = wtp_invoke_create(2);
set_tid(pdu, client->wtp_tid);
add_wsp_get(pdu);
send_pdu(pdu, boxc, client);
octstr_destroy(pdu);
client->wtp... | false | false | false | false | false | 0 |
update_job_stats() {
int i, n=0;
double sum=0, sum_sqr=0;
for (i=0; i<ssp->max_wu_results; i++) {
WU_RESULT& wu_result = ssp->wu_results[i];
if (wu_result.state != WR_STATE_PRESENT) continue;
n++;
double e = wu_result.workunit.rsc_fpops_est;
sum += e;
sum_sqr... | false | false | false | false | false | 0 |
vxge_reset_all_vpaths(struct vxgedev *vdev)
{
enum vxge_hw_status status = VXGE_HW_OK;
struct __vxge_hw_virtualpath *vpath;
vxge_trace();
vpath = vdev->vpath.vpathh;
if (vpath) {
if ((status = vxge_hw_vpath_reset(vpath)) == VXGE_HW_OK) {
if (is_vxge_card_up(vdev) &&
(status = vxge_hw_vpath_recover_from... | false | false | false | false | false | 0 |
PyCurses_Start_Color(PyObject *self)
{
int code;
PyObject *c, *cp;
PyCursesInitialised;
code = start_color();
if (code != ERR) {
initialisedcolors = TRUE;
c = PyLong_FromLong((long) COLORS);
PyDict_SetItemString(ModDict, "COLORS", c);
Py_DECREF(c);
cp = PyLo... | false | false | false | false | false | 0 |
v5dCreateFile(const char *filename, v5dstruct * v)
{
mode_t mask;
int fd;
mask = 0666;
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, mask);
if (fd == -1) {
printf("Error in v5dCreateFile: open failed\n");
v->FileDesc = -1;
v->Mode = 0;
return 0;
}
else {
/* ok */
v->FileDesc = fd;... | false | false | false | false | false | 0 |
G3d_allocTilesType(G3D_Map * map, int nofTiles, int type)
{
void *tiles;
tiles = G3d_malloc(map->tileSize * G3d_length(type) * nofTiles);
if (tiles == NULL) {
G3d_error("G3d_allocTilesType: error in G3d_malloc");
return NULL;
}
return tiles;
} | false | false | false | false | false | 0 |
WXMPMeta_Erase_1 ( XMPMetaRef xmpRef,
WXMP_Result * wResult )
{
XMP_ENTER_WRAPPER ( "WXMPMeta_Erase_1" )
XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef );
meta->Erase();
XMP_EXIT_WRAPPER
} | false | false | false | true | false | 1 |
overwrite(c, n)
char c;
int n;
{
register int i;
for (i = 0; i < n; i++) {
/* Delete one *column* forward (except that we don't
* notice that control characters take two columns).
*/
if (!eolp() && (linebuf[curchar] != '\t' || tabstop == 0
|| TABDIST(calc_pos(linebuf, curchar)) == 1))
{
del_char(F... | false | false | false | false | false | 0 |
interpret(InterState *istate, CtfeGoal goal)
{ Expressions *expsx = NULL;
#if LOG
printf("%s StructLiteralExp::interpret() %s\n", loc.toChars(), toChars());
#endif
if (ownedByCtfe)
return copyLiteral(this);
size_t elemdim = elements ? elements->dim : 0;
for (size_t i = 0; i < sd->fields.dim... | false | false | false | false | false | 0 |
setup_xirc2ps_cs(char *str)
{
/* if_port, full_duplex, do_sound, lockup_hack
*/
int ints[10] = { -1 };
str = get_options(str, 9, ints);
#define MAYBE_SET(X,Y) if (ints[0] >= Y && ints[Y] != -1) { X = ints[Y]; }
MAYBE_SET(if_port, 3);
MAYBE_SET(full_duplex, 4);
MAYBE_SET(do_sound, 5);
MAYBE_SET(lockup_hack, 6... | false | false | false | false | false | 0 |
interpolate(double t, vector<double>& A, vector<double>& B, vector<double>& Res) {
int n = min(A.size(), B.size()) ;
Res.resize(n) ;
for (int i=0; i<n; i++)
Res[n] = A[n]*t + B[n]*(1-t) ;
} | false | false | false | false | false | 0 |
__set_phy_supported(struct phy_device *phydev, u32 max_speed)
{
/* The default values for phydev->supported are provided by the PHY
* driver "features" member, we want to reset to sane defaults first
* before supporting higher speeds.
*/
phydev->supported &= PHY_DEFAULT_FEATURES;
switch (max_speed) {
default... | false | false | false | false | false | 0 |
gal_view_generate_string (GalViewCollection *collection,
GalView *view,
gint which)
{
gchar *ret_val;
gchar *pointer;
if (which == 1)
ret_val = g_strdup (gal_view_get_title (view));
else
ret_val = g_strdup_printf ("%s_%d", gal_view_get_title (view), which);
... | false | false | false | false | false | 0 |
PyDict_GetItemWithError(PyObject *op, PyObject *key)
{
Py_hash_t hash;
PyDictObject*mp = (PyDictObject *)op;
PyDictKeyEntry *ep;
PyObject **value_addr;
if (!PyDict_Check(op)) {
PyErr_BadInternalCall();
return NULL;
}
if (!PyUnicode_CheckExact(key) ||
(hash = ((PyASCI... | false | false | false | false | false | 0 |
netdev_redirect ( struct settings *settings ) {
struct net_device *netdev;
/* Redirect to most recently opened network device */
netdev = last_opened_netdev();
if ( netdev ) {
return netdev_settings ( netdev );
} else {
return settings;
}
} | false | false | false | false | false | 0 |
featEmbossQryReuse(AjPQuery qry)
{
FeatPEmbossQry qryd;
qryd = qry->QryData;
if(!qry || !qryd)
return ajFalse;
if(!qry->ResultsList)
{
ajDebug("featEmbossQryReuse: query data all finished\n");
return ajFalse;
}
else
{
ajDebug("featEmbossQryReuse: reus... | false | false | false | false | false | 0 |
on_clicked ()
{
static bool recursing = false;
if (!recursing)
{
recursing = true;
Gtk::TreeViewColumn::on_clicked ();
sort_action->set_active (true);
recursing = false;
}
} | false | false | false | false | false | 0 |
movie_pause( void )
{
if( !movie_paused && !movie_recording ) return;
if( movie_recording ) {
movie_recording = 0;
movie_paused = 1;
ui_menu_activate( UI_MENU_ITEM_FILE_MOVIE_PAUSE, 0 );
} else {
movie_recording = 1;
movie_paused = 1;
ui_menu_activate( UI_MENU_ITEM_FILE_MOVIE_PAUSE, 1 );
... | false | false | false | false | false | 0 |
main(int argc, char * argv[]) {
//at least 1 option is required
if ( argc < 2 )
return usage();
if ( strcmp(argv[1], "index") == 0 )
return index( argc-1, argv+1 );
else if ( strcmp(argv[1], "align") == 0 )
return align( argc-1, argv+1 );
else if ( strcmp(argv[1], "search") ... | false | false | false | false | false | 0 |
lrs_set_row(lrs_dic *P, lrs_dat *Q, long row, long num[], long den[], long ineq)
/* convert to lrs_mp then call lrs_set_row */
{
lrs_mp_vector Num, Den;
long m,d;
long j;
m = P->m;
d = P->d;
Num=lrs_alloc_mp_vector(d+1);
Den=lrs_alloc_mp_vector(d+1);
for (j=0;j<=d;j++)
{
itomp(num[j],Num[j]);
ito... | false | false | false | false | false | 0 |
__exif_tag_capturing_contrast_sharpness_from_exif_value (gint value,
const gchar * tag_name)
{
switch (value) {
case 0:
return "normal";
case 1:
return "soft";
case 2:
return "hard";
default:
GST_WARNING ("Invalid %s type: %d", tag_name, value);
return NULL;
}
} | false | false | false | false | false | 0 |
detail_accounting(void *instance, REQUEST *request)
{
#ifdef WITH_DETAIL
if (request->listener->type == RAD_LISTEN_DETAIL &&
strcmp(((struct detail_instance *)instance)->detailfile,
((listen_detail_t *)request->listener->data)->filename) == 0) {
RDEBUG("Suppressing writes to detail file as the reque... | false | false | false | false | false | 0 |
classtype_mangled_name (tree t)
{
if (CLASSTYPE_TEMPLATE_INFO (t)
/* Specializations have already had their names set up in
lookup_template_class. */
&& !CLASSTYPE_TEMPLATE_SPECIALIZATION (t))
{
tree tmpl = most_general_template (CLASSTYPE_TI_TEMPLATE (t));
/* For non-primary templates... | false | false | false | false | false | 0 |
symlink(const QString &target, const KUrl &dest,
JobFlags flags)
{
kDebug() << target << ", " << dest;
KUrl new_dest;
if ( d->internalRewriteUrl(dest, new_dest) )
{
KIO::SimpleJob *job = KIO::symlink(target, new_dest, flags & HideProgressInfo);
d->conne... | false | false | false | false | false | 0 |
ajStrCutEnd(AjPStr* Pstr, size_t len)
{
AjPStr thys;
if(!*Pstr)
*Pstr = ajStrNewResLenC("", 1, 0);
else if((*Pstr)->Use > 1)
ajStrGetuniqueStr(Pstr);
thys = *Pstr;
if(!len)
return ajTrue;
if(len > thys->Len)
thys->Len = 0;
else
thys->Len -= len;
thys->Ptr[thys->Le... | false | false | false | false | false | 0 |
parse_controls(snd_use_case_mgr_t *uc_mgr, snd_config_t *cfg)
{
int err;
if (!list_empty(&uc_mgr->default_list)) {
uc_error("Default list is not empty");
return -EINVAL;
}
err = parse_sequence(uc_mgr, &uc_mgr->default_list, cfg);
if (err < 0) {
uc_error("Unable to parse SectionDefaults");
return err;
}
... | false | false | false | false | false | 0 |
gnc_html_history_forward(gnc_html_history * hist)
{
if (!hist || !(hist->current_node))
{
return NULL;
}
if (hist->current_node->next)
{
hist->current_node = hist->current_node->next;
}
return hist->current_node->data;
} | false | false | false | false | false | 0 |
stv0299_set_FEC(struct stv0299_state *state, enum fe_code_rate fec)
{
dprintk ("%s\n", __func__);
switch (fec) {
case FEC_AUTO:
{
return stv0299_writeregI (state, 0x31, 0x1f);
}
case FEC_1_2:
{
return stv0299_writeregI (state, 0x31, 0x01);
}
case FEC_2_3:
{
return stv0299_writeregI (state, 0x31, 0x02);... | false | false | false | false | false | 0 |
fill_font_families_combo (GucharmapMiniFontSelection *fontsel)
{
GtkComboBox *combo = GTK_COMBO_BOX (fontsel->family);
PangoFontFamily **families;
int n_families, i;
fontsel->family_store = gtk_list_store_new (1, G_TYPE_STRING);
pango_context_list_families (
gtk_widget_get_pango_context (GTK_WIDGE... | false | false | false | false | false | 0 |
datetime_alloc(PyTypeObject *type, Py_ssize_t aware)
{
PyObject *self;
self = (PyObject *)
PyObject_MALLOC(aware ?
sizeof(PyDateTime_DateTime) :
sizeof(_PyDateTime_BaseDateTime));
if (self == NULL)
return (PyObject *)PyErr_NoMemory();
(void)PyObje... | false | false | false | false | false | 0 |
vidioc_g_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
if (reg->reg > pci_resource_len(dev->pci, 0) - 4)
return -EINVAL;
reg->val = saa7146_read(dev, reg->reg);
reg->size = 4;
return 0;
} | false | false | false | false | false | 0 |
UpdateAllStats()
{
UpdateMaxHealth();
UpdateAttackPowerAndDamage();
for (int i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
return true;
} | false | false | false | false | false | 0 |
closeUrl()
{
Q_D(ReadOnlyPart);
abortLoad(); //just in case
d->m_arguments = KParts::OpenUrlArguments();
if ( d->m_bTemp )
{
QFile::remove( d->m_file );
d->m_bTemp = false;
}
// It always succeeds for a read-only part,
// but the return value exists for reimplementatio... | false | false | false | false | false | 0 |
unref() const {
Resource* r = (Resource*)this;
if (r->refcount_ != 0) {
r->refcount_ -= 1;
}
if (r->refcount_ == 0) {
r->cleanup();
delete r;
}
} | false | false | false | false | false | 0 |
amdgpu_ttm_tt_has_userptr(struct ttm_tt *ttm)
{
struct amdgpu_ttm_tt *gtt = (void *)ttm;
if (gtt == NULL)
return false;
return !!gtt->userptr;
} | false | false | false | false | false | 0 |
vmci_qp_broker_exit(void)
{
struct qp_entry *entry;
struct qp_broker_entry *be;
mutex_lock(&qp_broker_list.mutex);
while ((entry = qp_list_get_head(&qp_broker_list))) {
be = (struct qp_broker_entry *)entry;
qp_list_remove_entry(&qp_broker_list, entry);
kfree(be);
}
mutex_unlock(&qp_broker_list.mutex);
} | false | false | false | false | false | 0 |
drag_data_received_callback (GtkWidget *widget,
GdkDragContext *context,
int x,
int y,
GtkSelectionData *data,
guint info,
guint32 time,
gpointer callback_data)
{
char **names;
NemoApplication *application;
int name_cou... | false | false | false | false | false | 0 |
CallbackEventInternal(const char* prefix, const char* name,
Address entry_point) {
if (!log_->IsEnabled() || !FLAG_log_code) return;
LogMessageBuilder msg(this);
msg.Append("%s,%s,",
kLogEventsNames[CODE_CREATION_EVENT],
kLogEventsNames[CALLBACK_TAG]);
... | false | false | false | false | false | 0 |
st21nfca_se_wt_timeout(unsigned long data)
{
/*
* No answer from the secure element
* within the defined timeout.
* Let's send a reset request as recovery procedure.
* According to the situation, we first try to send a software reset
* to the secure element. If the next command is still not
* answering in ... | false | false | false | false | false | 0 |
cm_time(time_t *dest)
{
long t;
if (getenv("CM_FORCE_TIME") != NULL) {
t = atol(getenv("CM_FORCE_TIME"));
if (dest != NULL) {
*dest = t;
}
return t;
} else {
return time(dest);
}
} | false | false | false | false | false | 0 |
get_point_count(const stp_curve_t *curve)
{
size_t count = get_real_point_count(curve);
if (curve->wrap_mode == STP_CURVE_WRAP_AROUND)
count -= 1;
return count;
} | false | false | false | false | false | 0 |
pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* connection, PyObject* sql)
{
const char* tail;
int rc;
const char* sql_cstr;
Py_ssize_t sql_cstr_len;
self->st = NULL;
self->in_use = 0;
sql_cstr = _PyUnicode_AsStringAndSize(sql, &sql_cstr_len);
if (sql_cstr == N... | false | false | false | false | false | 0 |
getcc()
{
if (ungotp == NULL)
/*
* Normal case: no ungotten chars, so get one from the user.
*/
return (getchr());
if (ungotp > ungot)
/*
* Return the next ungotten char.
*/
return (*--ungotp);
/*
* We have just run out of ungotten chars.
*/
ungotp = NULL;
if (len_cmdbuf() == 0 || !empty_... | false | false | false | false | false | 0 |
func_list(Lex_state *e, int nargs, Arglist *arglist, Expr_result *result)
{
Arglist *x;
Value v;
init_value(&v, T_LIST, sizeof(Value));
x = arglist;
while (x != NULL) {
dsvec_add_ptr(v.val.listval.list, &x->result->value);
x = x->next;
}
result->value.token = T_LIST;
result->value = v;
return(0)... | false | false | false | false | false | 0 |
intel_sdvo_compute_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config)
{
struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
struct drm_display_mode *mode = &pipe_config->base.mode;
DRM_DEBUG_KMS("forcing bpc... | false | false | false | false | false | 0 |
can_decompose_p (rtx x)
{
if (REG_P (x))
{
unsigned int regno = REGNO (x);
if (HARD_REGISTER_NUM_P (regno))
{
unsigned int byte, num_bytes;
num_bytes = GET_MODE_SIZE (GET_MODE (x));
for (byte = 0; byte < num_bytes; byte += UNITS_PER_WORD)
if (simplify_subreg_regno (regno, GET_MODE (x)... | false | false | false | false | false | 0 |
qede_sync_free_irqs(struct qede_dev *edev)
{
int i;
for (i = 0; i < edev->int_info.used_cnt; i++) {
if (edev->int_info.msix_cnt) {
synchronize_irq(edev->int_info.msix[i].vector);
free_irq(edev->int_info.msix[i].vector,
&edev->fp_array[i]);
} else {
edev->ops->common->simd_handler_clean(edev->cdev, ... | false | false | false | false | false | 0 |
FreeINCHI( inchi_Output *out )
{
if ( out->szInChI ) {
inchi_free( out->szInChI );
}
if ( out->szLog ) {
inchi_free( out->szLog );
}
if ( out->szMessage ) {
inchi_free( out->szMessage );
}
memset( out, 0, sizeof(*out) );
} | false | false | false | false | false | 0 |
update(FXint x,FXint y,FXint w,FXint h) const {
if(xid){
// We toss out rectangles outside the visible area
if(x>=width || y>=height || x+w<=0 || y+h<=0) return;
// Intersect with the window
if(x<0){w+=x;x=0;}
if(y<0){h+=y;y=0;}
if(x+w>width){w=width-x;}
if(y+h>height){h=height-y;}
... | false | false | false | false | false | 0 |
cvt_alloc_chpos(len)
int len;
{
int i;
int *chpos = (int *) ecalloc(sizeof(int), len);
/* Initialize all entries to an invalid position. */
for (i = 0; i < len; i++)
chpos[i] = -1;
return (chpos);
} | false | false | false | false | false | 0 |
trf_begin(void)
{
if (trf_level==0){
trf_sp = (struct trf_struct **)calloc(sizeof(struct trf_struct *),TRF_HASH_SIZE);
}
trf_level ++;
return 0;
} | false | false | false | false | false | 0 |
CreateRingBuffer(ALsizei frame_size, ALsizei length)
{
RingBuffer *ring = calloc(1, sizeof(*ring) + ((length+1) * frame_size));
if(ring)
{
ring->mem = (ALubyte*)(ring+1);
ring->frame_size = frame_size;
ring->length = length+1;
ring->read_pos = 0;
ring->write_pos = 0;... | false | false | false | false | false | 0 |
snd_azf3328_irq_log_unknown_type(struct snd_azf3328 *chip, u8 which)
{
dev_dbg(chip->card->dev,
"unknown IRQ type (%x) occurred, please report!\n",
which);
} | false | false | false | false | false | 0 |
L11()
{register object *base=vs_base;
register object *sup=base+VM11; VC11
vs_check;
{object V52;
V52=(base[0]);
vs_top=sup;
goto TTL;
TTL:;
{object V53;
V53= Cnil;
V53= (((object)VV[13])->s.s_dbind);
(((object)VV[13])->s.s_dbind)= Ct;
base[1]= ((object)VV[14]);
base[2]= small_fixnum(20);
vs_top=(vs_base=b... | false | false | false | false | false | 0 |
warn(const int row)
{
// row == -1 -> warn all rows
int i;
int j;
if (row == -1) {
for (i=0; i < rowCount(); ++i)
qWarning() << toXml(i);
// for(j=0; j < columnCount(); ++j) {
// qWarning() << record().fieldName(j) << index(i, j).data() ;
... | false | false | false | false | false | 0 |
ProcessBody(SocketEvent evt)
{
if (evt.code == SC_READ)
{
int ret = ReadHttpData();
if (ret < 0) return ret;
}
return ParseBody();
} | false | false | false | false | false | 0 |
GetDFA(MatchKind kind) {
DFA*volatile* pdfa;
if (kind == kFirstMatch || kind == kManyMatch) {
pdfa = &dfa_first_;
} else {
kind = kLongestMatch;
pdfa = &dfa_longest_;
}
// Quick check.
DFA *dfa;
ATOMIC_LOAD_ACQUIRE(dfa, pdfa);
if (dfa != NULL)
return dfa;
MutexLock l(&dfa_mutex_);
... | false | false | false | false | false | 0 |
get_channel_info_list (bmc_info_state_data_t *state_data, channel_info_t *channel_info_list)
{
fiid_obj_t obj_cmd_rs = NULL;
unsigned int i;
uint8_t ci;
uint64_t val;
int rv = -1;
assert (state_data);
assert (channel_info_list);
if (!(obj_cmd_rs = fiid_obj_create (tmpl_cmd_get_channel_info_rs)))
{... | false | false | false | false | false | 0 |
synctex_node_page(synctex_node_t node){
synctex_node_t parent = NULL;
if (!node) {
return -1;
}
parent = SYNCTEX_PARENT(node);
while(parent) {
node = parent;
parent = SYNCTEX_PARENT(node);
}
if (node->class->type == synctex_node_type_sheet) {
return SYNCTEX_PAGE(node);
}
return -1;
} | false | false | false | false | false | 0 |
hermon_map_vpm ( struct hermon *hermon,
int ( *map ) ( struct hermon *hermon,
const struct hermonprm_virtual_physical_mapping* ),
uint64_t va, physaddr_t pa, size_t len ) {
struct hermonprm_virtual_physical_mapping mapping;
int rc;
assert ( ( va & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
assert ( ( ... | false | false | false | false | false | 0 |
_get_fv_view(AbiWidget* w)
{
AV_View* v = w->priv->m_pFrame->getCurrentView();
UT_return_val_if_fail(v!=0, NULL);
return static_cast<FV_View*>( v );
} | false | false | false | false | false | 0 |
getNextToken(const char *restrict buf, int i, int *x_return, int *y_return)
{
int x, y;
again:
while(buf[i] == ' ' || buf[i] == '\t')
i++;
if(buf[i] == '(') {
i++;
while(buf[i] != ')') {
if(buf[i] == '\n' || buf[i] == '\r')
return -1;
if(buf[i... | false | false | false | false | false | 0 |
BitVector_Word_Read(wordptr addr, N_int offset)
{
N_word size = BV_SIZE_(addr);
if (size > 0)
{
*(addr+size-1) &= BV_MASK_(addr);
if (offset < size) return( *(addr+offset) );
}
return( (N_int) 0 );
} | false | false | false | false | false | 0 |
long_fetch_ecs (int plane, int nwords, int weird_number_of_bits, int dma)
{
uae_u16 *real_pt = (uae_u16 *)pfield_xlateptr (bplpt[plane], nwords * 2);
int delay = (plane & 1) ? toscr_delay2 : toscr_delay1;
int tmp_nbits = out_nbits;
uae_u32 shiftbuffer = todisplay[plane][0];
uae_u32 outval = outword[plane];
uae_u3... | false | false | false | false | false | 0 |
gwy_app_data_browser_shut_down(void)
{
GwyAppDataBrowser *browser;
guint i;
browser = gwy_app_data_browser;
if (!browser)
return;
if (browser->window && GTK_WIDGET_VISIBLE(browser->window))
gwy_app_save_window_position(GTK_WINDOW(browser->window),
... | false | false | false | false | false | 0 |
allot_string(cell capacity, cell fill) {
data_root<string> str(allot_string_internal(capacity), this);
fill_string(str.untagged(), 0, capacity, fill);
return str.untagged();
} | false | false | false | false | false | 0 |
jl_declare_constant(jl_binding_t *b)
{
if (b->value != NULL && !b->constp) {
jl_errorf("cannot declare %s constant; it already has a value",
b->name->name);
}
b->constp = 1;
} | false | false | false | false | false | 0 |
populate_dlist(P_CmdSeq *page)
{
GtkTreeIter ti;
const GList *iter;
const CmdSeq *cs;
const CmdRow *row;
g_signal_handler_block(G_OBJECT(page->dstore), page->sig_delete);
gtk_list_store_clear(page->dstore);
if((cs = cmdseq_get_selected(page, &ti)) != NULL)
{
for(iter = cs->rows; iter != NULL; iter = g_list_n... | false | false | false | false | false | 0 |
write_state_pair_list (pair_p list)
{
int nbpair = 0;
pair_p current;
for (current = list; current != NULL; current = current->next)
{
write_state_pair (current);
nbpair++;
}
return nbpair;
} | false | false | false | false | false | 0 |
nvt_set_tx_carrier(struct rc_dev *dev, u32 carrier)
{
struct nvt_dev *nvt = dev->priv;
u16 val;
if (carrier == 0)
return -EINVAL;
nvt_cir_reg_write(nvt, 1, CIR_CP);
val = 3000000 / (carrier) - 1;
nvt_cir_reg_write(nvt, val & 0xff, CIR_CC);
nvt_dbg("cp: 0x%x cc: 0x%x\n",
nvt_cir_reg_read(nvt, CIR_CP), nvt_... | false | false | false | false | false | 0 |
IsPrivateI4( const char * cp )
{
struct in_addr in;
// sanity check
if ( !cp )
return false;
#ifdef WIN32
/* InetNtop / InetPton need >= Vista ! */
in.s_addr = inet_addr( cp );
if ( in.s_addr == INADDR_NONE )
{
return false;
}
#else
if ( inet_aton( cp, &in ) == 0 )
return false;
#endif
// see Util.... | false | false | false | false | false | 0 |
strings_equal_ignore_case (const string& a, const string& b)
{
if (a.length() == b.length()) {
return std::equal (a.begin(), a.end(), b.begin(), chars_equal_ignore_case);
}
return false;
} | false | false | false | false | false | 0 |
exo_die_desktop_item_new_from_file (const gchar *file)
{
ExoDieDesktopItem *desktop_item = NULL;
const gchar *comment;
const gchar *command;
const gchar *icon;
const gchar *name;
const gchar *type;
XfceRc *rc;
gint icon_len;
/* try to open the fi... | false | false | false | false | false | 0 |
parseIdentifier (
const unsigned char *cp, vString *const identifier)
{
vStringClear (identifier);
while (isIdentifierCharacter ((int) *cp))
{
vStringPut (identifier, (int) *cp);
++cp;
}
vStringTerminate (identifier);
return cp;
} | false | false | false | false | false | 0 |
bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset, int needed)
{
/* For each chunk covered by any of these sectors, set the
* counter to 2 and possibly set resync_needed. They should all
* be 0 at this point
*/
sector_t secs;
bitmap_counter_t *bmc;
spin_lock_irq(&bitmap->counts.lock);
bmc = bit... | false | false | false | false | false | 0 |
HTMLFrame(li, env, p)
HTMLInfo li;
HTMLEnv env;
MLElement p;
{
HTMLFrameInfo fi;
char *url;
ChimeraRequest *wr;
HTMLFrameSetInfo fset;
unsigned int size;
fset = (HTMLFrameSetInfo)env->closure;
if ((url = MLFindAttribute(p, "src")) == NULL) return;
if ((wr = RequestCreate(li->cres, url, li->burl)) == ... | false | false | false | false | false | 0 |
set_global_progress(gdouble fraction) {
GTimeVal curtime;
glong elapsed, remaining;
static glong lastupdate = 0;
gchar tmps[50];
GtkProgressBar* progr = (GtkProgressBar*) gtk_builder_get_object(builder, "progress_global");
g_get_current_time(&curtime);
if (fraction > (gdouble)0 && fraction < (gdouble)1 && curti... | false | false | false | false | false | 0 |
mapseek(Var map, Var key, Var *iter, int case_matters)
{ /* does NOT consume `map' or `'key',
ALWAYS returns a newly allocated value in `iter' */
rbnode node;
rbtrav *ptrav;
node.key = key;
ptrav = rbseek(map.v.tree, &node, case_matters);
if (ptrav && iter) {
iter->type = TYPE_ITER;
ite... | false | false | false | false | false | 0 |
sh_eth_tsu_find_entry(struct net_device *ndev, const u8 *addr)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
void *reg_offset = sh_eth_tsu_get_offset(mdp, TSU_ADRH0);
int i;
u8 c_addr[ETH_ALEN];
for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) {
sh_eth_tsu_read_entry(reg_offset, c_addr);
if (... | false | false | false | false | false | 0 |
free_isl_fixed_map_array(struct isl_fixed_map *v, int n)
{
int i;
if (!v)
return;
for (i = 0; i < n; ++i)
isl_int_clear(v[i].v);
free(v);
} | false | false | false | false | false | 0 |
activate_found(void)
{
struct frame *frame;
struct table *table;
struct loop *loop;
for (frame = frames; frame; frame = frame->next) {
for (table = frame->tables; table; table = table->next)
if (table->found_row)
table->active_row = table->found_row;
for (loop = frame->loops; loop; loop = loop->next)
... | false | false | false | false | false | 0 |
PrintTestList(CcTest* current) {
if (current == NULL) return;
PrintTestList(current->prev());
if (current->dependency() != NULL) {
printf("%s/%s<%s\n",
current->file(), current->name(), current->dependency());
} else {
printf("%s/%s<\n", current->file(), current->name());
}
} | false | false | false | false | false | 0 |
tab_tail()
{
if( m_iconbox.children().size() == 1 ) return;
std::string url_to;
Gtk::Box_Helpers::BoxList::iterator it = m_iconbox.children().end();
it--;
SKELETON::View* view = dynamic_cast< SKELETON::View* >( it->get_widget() );
if( view ) url_to = view->get_url();
if( !url_to.empty... | false | false | false | false | false | 0 |
parse_tag_67_packet(struct ecryptfs_key_record *key_rec,
struct ecryptfs_message *msg)
{
size_t i = 0;
char *data;
size_t data_len;
size_t message_len;
int rc;
/*
* ***** TAG 65 Packet Format *****
* | Content Type | 1 byte |
* | Status Indicator ... | false | true | false | false | false | 1 |
out(struct sm_metadata *smm)
{
int r = 0;
/*
* If we're not recursing then very bad things are happening.
*/
if (!smm->recursion_count) {
DMERR("lost track of recursion depth");
return -ENOMEM;
}
if (smm->recursion_count == 1)
apply_bops(smm);
smm->recursion_count--;
return r;
} | false | false | false | false | false | 0 |
globus_l_gram_read_job_manager_cred(
globus_gram_job_manager_t * manager,
const char * cred_path,
gss_cred_id_t * cred)
{
int rc;
FILE * fp;
struct stat stat;
... | false | false | false | false | true | 1 |
cleanup()
{
if (instance_ != 0) {
Registry::iterator e = registry_.end();
for (Registry::iterator i = registry_.begin(); i != e; ++i) {
delete i->second;
}
delete instance_;
instance_ = 0;
}
} | false | false | false | false | false | 0 |
readBytes( uint8_t* _dest, const int32_t _len ) {
uint8_t* dest = _dest;
int32_t len = _len;
while ( len > 0 ) {
if ( bufferPosition >= bufferLength ) {
currentBufferIndex++;
switchCurrentBuffer();
}
int32_t remainInBuffer = bufferLength - bufferPosition;
int32_t bytesToCopy = len ... | false | false | false | false | false | 0 |
msg_plexdata_release(MsgPlexData *data)
{
size_t i;
if (!data)
return;
for (i = 0; i < data->length; ++i)
msg_destroy(data->list + i);
mem_release(data->list);
mem_release(data);
} | false | false | false | false | false | 0 |
set_split(struct state *state, struct split *split) {
state->split = split;
if (split != NULL)
state->pos = split->end;
return split;
} | false | false | false | false | false | 0 |
find_define(const char *word, int len)
{
define_tag_t tag;
char buf[32];
const define_tag_t *p_ret;
if (len > (int)(sizeof(buf) - 1))
{
LOG_FMT(LNOTE, "%s: define too long at %d char (%d max) : %.*s\n",
__func__, len, (int)sizeof(buf), len, word);
return(NUL... | false | false | false | false | false | 0 |
ad1986a_fixup_eapd_mix_in(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
struct ad198x_spec *spec = codec->spec;
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
ad1986a_fixup_eapd(codec, fix, action);
spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_ENABLE;
}
} | false | false | false | false | false | 0 |
writeout_period(unsigned long t)
{
struct wb_domain *dom = (void *)t;
int miss_periods = (jiffies - dom->period_time) /
VM_COMPLETIONS_PERIOD_LEN;
if (fprop_new_period(&dom->completions, miss_periods + 1)) {
dom->period_time = wp_next_time(dom->period_time +
miss_periods * VM_COMPLETIONS_PERIOD_LEN);
... | false | false | false | false | false | 0 |
gui_set_state(const enum gui_state_e state)
{
g_assert(GUI_STATE_IS_VALID(state));
gui_priv.state = state;
if (gui_get_view() == GUI_VIEW_TEXT)
return;
const bool busy = (state == GUI_STATE_BUSY);
gtk_widget_set_visible(GTK_WIDGET(gui.button_hash), !busy);
gtk_widget_set_visible(GTK_WIDGET(gui.button_stop),... | false | false | false | false | false | 0 |
rm(char *filename)
{
int blockAddr, prevBlockAddr = -1;
struct INODE* currentFile;
/*Wyszukuje plik o podanej nazwie*/
for(blockAddr = superblock->firstFile; blockAddr != -1; blockAddr = currentFile->nextFile)
{
currentFile = &iNodeTable[blockAddr];
if(strcmp(currentFile->fileName, filename) == 0)
{
brea... | false | false | false | false | false | 0 |
graph_file_pair_foreign_derived(graph_file_pair_ty *gfpp,
const string_list_ty *slp)
{
size_t j;
string_ty *fn;
if (!gfpp->foreign_derived)
gfpp->foreign_derived = symtab_alloc(slp->nstrings);
for (j = 0; j < slp->nstrings; ++j)
{
fn = slp->string[j];
symt... | 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.