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 |
|---|---|---|---|---|---|---|
begin_local_scope()
{ struct locallist_t *locals;
if ( local_nest_depth == 0 )
{ /* coming in from unnamed command */
/*init_local_scope(0); */
kb_error(3501,"INTERNAL ERROR: local_scope not initialized.\n",
RECOVERABLE);
}
locals = local_scope_bases[local_nest_depth-1];
locals->list[lo... | false | false | false | false | false | 0 |
startExecution()
{
bool ok = true;
QString filepath = evaluateString(ok, "file");
QString text = evaluateString(ok, "text");
Mode mode = evaluateListElement<Mode>(ok, modes, "mode");
if(!ok)
return;
QFile file(filepath);
if(!file.open(QIODevice::WriteOnly | QIODevice::Text | (mode == Truncate ? QIO... | false | false | false | false | false | 0 |
pdf_load_name_tree(pdf_document *xref, char *which)
{
fz_context *ctx = xref->ctx;
pdf_obj *root = pdf_dict_gets(xref->trailer, "Root");
pdf_obj *names = pdf_dict_gets(root, "Names");
pdf_obj *tree = pdf_dict_gets(names, which);
if (pdf_is_dict(tree))
{
pdf_obj *dict = pdf_new_dict(ctx, 100);
pdf_load_name_t... | false | false | false | false | false | 0 |
ParseURLProtocol( const kwsys_stl::string& URL,
kwsys_stl::string& protocol,
kwsys_stl::string& dataglom )
{
// match 0 entire url
// match 1 protocol
// match 2 dataglom following protocol://
kwsys::RegularExpression urlRe( VTK_URL_PROTOCO... | false | false | false | false | false | 0 |
gf_dash_get_mime_type(GF_MPD_SubRepresentation *subrep, GF_MPD_Representation *rep, GF_MPD_AdaptationSet *set)
{
if (subrep && subrep->mime_type) return subrep->mime_type;
if (rep && rep->mime_type) return rep->mime_type;
if (set && set->mime_type) return set->mime_type;
return NULL;
} | false | false | false | false | false | 0 |
lapm_tx_frame(lapm_state_t *s, uint8_t *frame, int len)
{
if ((s->debug & LAPM_DEBUG_LAPM_DUMP))
lapm_dump(s, frame, len, s->debug & LAPM_DEBUG_LAPM_RAW, TRUE);
/*endif*/
hdlc_tx_frame(&s->hdlc_tx, frame, len);
return 0;
} | false | false | false | false | false | 0 |
AddRootEntries(SnapshotFillerInterface* filler) {
if (EstimateObjectsCount() <= 0) return;
filler->AddEntry(kNativesRootObject, this);
} | false | false | false | false | false | 0 |
PutUpMenu( m )
Menu *m;
{
Coord x, y, sx, sy;
Window w;
sy = PDMENU_TOP;
sx = (m->box.right + m->box.left - m->width) / 2 + 1;
XTranslateCoordinates( display, window, RootWindowOfScreen( screen ),
sx, sy, &x, &y, &w );
if( x < 0 )
x = 0;
else if( x + m->width > WidthOfScreen( ... | false | false | false | false | false | 0 |
http_writecb(struct bufferevent *bev, void *_conn)
{
struct http_conn *conn = _conn;
struct evbuffer *outbuf = bufferevent_get_output(bev);
if (conn->choked) {
bufferevent_setwatermark(bev, EV_WRITE, 0, 0);
conn->choked = 0;
EVENT0(conn, on_write_more);
} else if (evbuffer_get_length(outbuf) == 0) {
if (!c... | false | false | false | false | false | 0 |
tracker_bus_array_cursor_real_get_string (TrackerSparqlCursor* base, gint column, glong* length) {
TrackerBusArrayCursor * self;
glong _vala_length = 0L;
const gchar* result = NULL;
gint _tmp0_ = 0;
const gchar* str = NULL;
gchar** _tmp1_ = NULL;
gint _tmp1__length1 = 0;
gint _tmp1__length2 = 0;
gint _tmp2_ = ... | false | false | false | false | false | 0 |
populateStack(Form::FormMain *rootForm)
{
if (!_stack) {
_stack = new QStackedLayout(q);
q->setLayout(_stack);
}
clearStackLayout();
_formMain = rootForm;
// Add the synthesis form
// QScrollArea *sa = new QScrollArea(q);
// sa->setWidge... | false | false | false | false | false | 0 |
dec_wd_count(struct wdir_info *d)
{
int count = itable_addto_count(wdirs_rc, d, -1);
debug(D_DEBUG, "working directory '%s' reference count -1, now %d references.\n", d->path, count);
if(count < 1)
{
debug(D_DEBUG, "working directory '%s' is not monitored anymore.\n", d->path);
hash_... | false | false | false | false | false | 0 |
drawbattvolt(const char *battvolts, const char *nombattvs)
{
gdImagePtr im;
char batttxt[16];
int battpos;
int hipos, lowpos;
double battvolt;
double nombattv;
double hip, lowp; /* hi and low red line conditions */
int minv, maxv, deltav;
im = InitIma... | false | false | false | false | false | 0 |
animFrameChanged(int frame)
{
setSpriteKey(KLinesRenderer::animationFrameId(KLinesRenderer::SelectedAnim, m_color, frame ));
} | false | false | false | false | false | 0 |
isReMaterializable(const LiveInterval &li,
SmallVectorImpl<LiveInterval*> &SpillIs,
bool &isLoad) {
isLoad = false;
for (LiveInterval::const_vni_iterator i = li.vni_begin(), e = li.vni_end();
i != e; ++i) {
const VNInfo *VNI = ... | false | false | false | false | false | 0 |
pentagon1024_reset(void)
{
int error;
error = machine_load_rom( 0, settings_current.rom_pentagon1024_0,
settings_default.rom_pentagon1024_0, 0x4000 );
if( error ) return error;
error = machine_load_rom( 1, settings_current.rom_pentagon1024_1,
settings_def... | false | false | false | false | false | 0 |
wsgi_server_group(request_rec *r, const char *s)
{
const char *name = NULL;
const char *value = NULL;
const char *h = NULL;
apr_port_t p = 0;
if (!s)
return "";
if (*s != '%')
return s;
name = s + 1;
if (*name) {
if (!strcmp(name, "{SERVER}")) {
h... | false | false | false | false | false | 0 |
ajSeqsetGetEnd(const AjPSeqset seq)
{
ajint jend;
if(!seq->End)
return (seq->Len);
jend = seq->End;
if(jend > 0)
jend--;
return 1 + ajCvtSposToPosStart(seq->Len, ajSeqsetGetBegin(seq)-1, jend);
} | false | false | false | false | false | 0 |
csv_import_count_columns ( gchar * contents, gchar * separator )
{
gint max = 0, i = 0;
GSList * list;
gchar * tmp = contents;
if ( ! contents )
return 0;
do
{
list = csv_get_next_line ( &tmp, separator );
if ( g_slist_length ( list ) > max )
{
max = g_slist_length ( list );
}
i++... | false | false | false | false | false | 0 |
configure_predefined_video_timings(struct v4l2_subdev *sd,
struct v4l2_dv_timings *timings)
{
struct adv7842_state *state = to_state(sd);
int err;
v4l2_dbg(1, debug, sd, "%s\n", __func__);
/* reset to default values */
io_write(sd, 0x16, 0x43);
io_write(sd, 0x17, 0x5a);
/* disable embedded syncs for auto gra... | false | false | false | false | false | 0 |
device_want_to_sleep(struct hci_uart *hu)
{
unsigned long flags;
struct qca_data *qca = hu->priv;
BT_DBG("hu %p want to sleep", hu);
spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca->ibs_recv_slps++;
switch (qca->rx_ibs_state) {
case HCI_IBS_RX_AWAKE:
/* Update state */
qca->rx_ibs_state = HCI_IBS_RX_AS... | false | false | false | false | false | 0 |
gtab_pre_select_idx(int c)
{
if (c < 0)
return FALSE;
if (c >= tss.pre_selN)
return TRUE;
#if 0
dbg("c %d %s ggg.gbuf_cursor:%d,%d\n", c, tss.pre_sel[c].str,
ggg.gbuf_cursor, ggg.gbufN);
#endif
gtab_buf_backspaceN(gtab_pre_select_phrase_len);
int len = tss.pre_sel[c].len;
insert_gbuf_cursor_p... | false | false | false | false | false | 0 |
t1_change_mtu(struct net_device *dev, int new_mtu)
{
int ret;
struct adapter *adapter = dev->ml_priv;
struct cmac *mac = adapter->port[dev->if_port].mac;
if (!mac->ops->set_mtu)
return -EOPNOTSUPP;
if (new_mtu < 68)
return -EINVAL;
if ((ret = mac->ops->set_mtu(mac, new_mtu)))
return ret;
dev->mtu = new_mt... | false | false | false | false | false | 0 |
getgziplevel(char *argv[], int *i)
{
char *endptr;
(*i)++;
if (!strcasecmp(argv[*i], "-z")) {
(*i)++;
errno = 0;
gziplevel = strtol(argv[*i], &endptr, 10);
if (errno || endptr == argv[*i] || gziplevel < 0 || gziplevel > 9) {
fprintf(stderr, "Compression level out of range: %s\n", argv[*i]);
exit(-1);
... | false | false | false | false | false | 0 |
_gda_postgres_meta_routines (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc,
GdaMetaStore *store, GdaMetaContext *context, GError **error,
const GValue *routine_catalog, const GValue *routine_schema,
const GValue *routine_name_n)
{
GdaDataModel *model;
gboolean retval = TRUE;
/* ... | false | false | false | false | false | 0 |
abraca_medialib_add_url_dialog_save_url (AbracaMedialibAddUrlDialog* self, const gchar* url) {
GtkTreeIter iter = {0};
gchar* current = NULL;
GtkListStore* _tmp0_;
GtkTreeIter _tmp1_ = {0};
gboolean _tmp2_ = FALSE;
GtkListStore* _tmp13_;
const gchar* _tmp14_;
GtkTreeIter _tmp15_ = {0};
g_return_if_fail (self !... | false | false | false | false | false | 0 |
ope_importaccount_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
{
Transaction *ope;
Account *acc, *dacc;
gtk_tree_model_get(model, iter, LST_DSPOPE_DATAS, &ope, -1);
acc = da_acc_get(ope->kacc);
if( acc )
{
if(acc->imp_key > 0)... | false | false | false | false | false | 0 |
__pyx_f_7dumbnet_5route_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_7dumbnet_addr *__pyx_v_dst = 0;
struct __pyx_obj_7dumbnet_addr *__pyx_v_gw = 0;
struct route_entry __pyx_v_entry;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_arg... | false | false | false | false | false | 0 |
arram_lget (uaecptr addr)
{
uae_u32 *m;
#ifdef JIT
special_mem |= S_READ;
#endif
addr -= arram_start;
addr &= arram_mask;
m = (uae_u32 *)(armemory_ram + addr);
if (strncmp ("T8", (char*)m, 2) == 0)
write_log_debug (_T("Reading T8 from addr %08x PC=%p\n"), addr, m68k_getpc ());
if (strncmp ("LAME", (char*)m, 4)... | false | false | false | false | false | 0 |
_scsih_set_volume_delete_flag(struct MPT3SAS_ADAPTER *ioc, u16 handle)
{
struct _raid_device *raid_device;
struct MPT3SAS_TARGET *sas_target_priv_data;
unsigned long flags;
spin_lock_irqsave(&ioc->raid_device_lock, flags);
raid_device = mpt3sas_raid_device_find_by_handle(ioc, handle);
if (raid_device && raid_dev... | false | false | false | false | false | 0 |
ft_ansi_stream_io( FT_Stream stream,
unsigned long offset,
unsigned char* buffer,
unsigned long count )
{
FT_FILE* file;
if ( !count && offset > stream->size )
return 1;
file = STREAM_FILE( stream );
if ( stream->pos ... | false | false | false | false | false | 0 |
ser_set_timeout_ms( ser_handler id, u32 timeout )
{
struct termios termdata;
tcgetattr( id, &termdata );
if( timeout == SER_INF_TIMEOUT )
{
termdata.c_cc[ VTIME ] = 0;
fcntl( id, F_SETFL, 0 ); // calls block
}
else if( timeout == SER_NO_TIMEOUT)
{
termdata.c_cc[ VTIME ] = 0;
fcntl( id, F... | false | false | false | false | false | 0 |
snic_unlink_and_release_req(struct snic *snic, struct scsi_cmnd *sc, int flag)
{
struct snic_req_info *rqi = NULL;
spinlock_t *io_lock = NULL;
unsigned long flags;
u32 start_time = jiffies;
io_lock = snic_io_lock_hash(snic, sc);
spin_lock_irqsave(io_lock, flags);
rqi = (struct snic_req_info *) CMD_SP(sc);
if (... | false | false | false | false | false | 0 |
_last()
{
Node* pn = m_pRoot;
if (pn == m_pLeaf)
return 0;
while(pn->right != m_pLeaf)
pn = pn->right;
return pn;
} | false | false | false | false | false | 0 |
inflateEnd(z_streamp z)
{
if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
return Z_STREAM_ERROR;
if (z->state->blocks != Z_NULL)
inflate_blocks_free(z->state->blocks, z);
ZFREE(z, z->state);
z->state = Z_NULL;
LuTracev((stderr, "inflate: end\n"));
return Z_OK;
} | false | false | false | false | false | 0 |
process_cdir_file_hdr(__G) /* return PK-type error code */
__GDEF
{
int error;
/*---------------------------------------------------------------------------
Get central directory info, save host and method numbers, and set flag
for lowercase conversion of filename, depending on the OS from which th... | false | false | false | false | false | 0 |
getTerminalWidth() { /* determine width of terminal */
#ifdef TIOCGWINSZ
#ifdef _M_UNIX /* SCO Unix 3.2.4 defines TIOCGWINSZ*/
#include <sys/stream.h> /* Required by sys/ptem.h */
#include <sys/ptem.h> /* Required to declare winsize ... | false | false | false | false | false | 0 |
get_empty_dgt(const char ref) const {
if (ref!='N') {
return static_cast<const diploid_genotype&>(*_empty_dgt[base_to_id(ref)]);
} else {
static const diploid_genotype n_dgt;
return static_cast<const diploid_genotype&>(n_dgt);
}
} | false | false | false | false | false | 0 |
share_start(Function *global_funcs)
{
global = global_funcs;
module_register(MODULE_NAME, share_table, 2, 3);
if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) {
module_undepend(MODULE_NAME);
return "This module requires Eggdrop 1.6.0 or later.";
}
if (!(transfer_funcs = module_depend(MODULE_NAME,... | false | false | false | false | false | 0 |
compareContractions(UChar32 c, const UChar *p, const UChar *q) {
// Parallel iteration over suffixes of both tables.
UCharsTrie::Iterator suffixes(p, 0, errorCode);
UCharsTrie::Iterator baseSuffixes(q, 0, errorCode);
const UnicodeString *ts = NULL; // Tailoring suffix.
const UnicodeString *bs = NUL... | false | false | false | false | false | 0 |
main(int argc, char* argv[])
{
try
{
return compile(argc, argv);
}
catch(const std::exception& ex)
{
getErrorStream() << argv[0] << ": error:" << ex.what() << endl;
return EXIT_FAILURE;
}
catch(const std::string& msg)
{
getErrorStream() << argv[0] << ": er... | false | false | false | false | false | 0 |
scg_cursor_move (SheetControlGUI *scg, int n,
gboolean jump_to_bound, gboolean horiz)
{
SheetView *sv = scg_view (scg);
GnmCellPos tmp = sv->edit_pos_real;
int step = (n>0) ? 1 : -1;
if (!wbcg_edit_finish (scg->wbcg, WBC_EDIT_ACCEPT, NULL))
return;
if (horiz)
tmp.col = sheet_find_boundary_horizontal (sv->... | false | false | false | false | false | 0 |
tps65910_sleepinit(struct tps65910 *tps65910,
struct tps65910_board *pmic_pdata)
{
struct device *dev = NULL;
int ret = 0;
dev = tps65910->dev;
if (!pmic_pdata->en_dev_slp)
return 0;
/* enabling SLEEP device state */
ret = tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL,
DEVCTRL_DEV_SLP_MASK);
if (re... | false | false | false | false | false | 0 |
r128_cce_indirect(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
drm_r128_private_t *dev_priv = dev->dev_private;
struct drm_device_dma *dma = dev->dma;
struct drm_buf *buf;
drm_r128_buf_priv_t *buf_priv;
drm_r128_indirect_t *indirect = data;
#if 0
RING_LOCALS;
#endif
LOCK_TEST_WITH_RETURN(de... | false | false | false | false | false | 0 |
generateRandom(char* buffer, int size)
{
#ifdef _WIN32
# if defined(_MSC_VER) && (_MSC_VER >= 1400)
for(int i = 0; i < size; ++i)
{
buffer[i] = random(256);
}
# else
//
// It's not clear from the Microsoft documentation if CryptGenRandom
// can be called concurrently from several thr... | false | false | false | false | false | 0 |
bf_file_read(Var arglist, Byte next, void *vdata, Objid progr)
{
package r;
Var fhandle = arglist.v.list[1];
file_mode mode;
file_type type;
int32 record_length = arglist.v.list[2].v.num;
int32 read_length;
char buffer[FILE_IO_BUFFER_LENGTH];
Var rv;
static Stream *str = 0;
int len = 0, read = 0... | true | true | false | false | true | 1 |
fancy_get_selection (MimeViewer *_viewer)
{
debug_print("fancy_get_selection\n");
FancyViewer *viewer = (FancyViewer *) _viewer;
#if WEBKIT_CHECK_VERSION(1,5,1)
viewer->doc = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(viewer->view));
viewer->window = webkit_dom_document_get_default_view (viewer->doc);
viewer... | false | false | false | false | false | 0 |
add_thumb_size_menu(GtkWidget *table, gint column, gint row, gchar *text)
{
GtkWidget *combo;
gint current;
gint i;
c_options->thumbnails.max_width = options->thumbnails.max_width;
c_options->thumbnails.max_height = options->thumbnails.max_height;
pref_table_label(table, column, row, text, 0.0);
combo = gtk_c... | false | false | false | false | false | 0 |
be_get_reg_len(struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
u32 log_size = 0;
if (!check_privilege(adapter, MAX_PRIVILEGES))
return 0;
if (be_physfn(adapter)) {
if (lancer_chip(adapter))
log_size = lancer_cmd_get_file_len(adapter,
LANCER_FW_DUMP_FILE);
else
... | false | false | false | false | false | 0 |
write(const void *buff, size_t len)
{
if (myFD < 0)
{
ArLog::log(ArLog::Terse, "ArSocket::write: called after socket closed");
return 0;
}
struct timeval tval;
fd_set fdSet;
tval.tv_sec = 0;
tval.tv_usec = 0;
FD_ZERO(&fdSet);
FD_SET(myFD, &fdSet);
if (select(myFD + 1, NULL, &fdSet, NULL,... | false | false | false | false | false | 0 |
on_about_activate ( GtkWidget *menuitem,
gpointer user_data )
{
GtkWidget * win = lookup_widget( menuitem, "about_window" );
if ( win )
{
gtk_window_set_transient_for(GTK_WINDOW(win), GTK_WINDOW(main_window));
gtk_widget_show( win );
}
} | false | false | false | false | false | 0 |
aer_init(struct pcie_device *dev)
{
if (forceload) {
dev_printk(KERN_DEBUG, &dev->device,
"aerdrv forceload requested.\n");
pcie_aer_force_firmware_first(dev->port, 0);
}
return 0;
} | false | false | false | false | false | 0 |
_Py_hashtable_print_stats(_Py_hashtable_t *ht)
{
size_t size;
size_t chain_len, max_chain_len, total_chain_len, nchains;
_Py_hashtable_entry_t *entry;
size_t hv;
double load;
size = _Py_hashtable_size(ht);
load = (double)ht->entries / ht->num_buckets;
max_chain_len = 0;
total_chai... | false | false | false | false | false | 0 |
makeV5Req(v4HeadType *req, dataBufType *buf)
{
register v5HeadType *v5;
v5=malloc(sizeof(v5HeadType)+2);
if (!v5) {
freeSomeMemory(buf);
v5=malloc(sizeof(v5HeadType)+2);
if (!v5)
return NULL;
}
v5->version = SOCKS_V5;
v5->cmd = req->cmd;
v5->flags = 0;
v5->atyp = ATYP_V4;
m... | false | false | false | false | true | 1 |
eaccess(path, mode)
const char *path;
int mode;
{
#if defined(S_IXGRP) && !defined(_WIN32) && !defined(__CYGWIN__)
struct stat st;
int euid;
if (stat(path, &st) < 0) return -1;
euid = geteuid();
if (euid == 0) {
/* Root can read or write any file. */
if (!(mode & X_OK))
return 0;... | false | false | false | false | false | 0 |
veb_tree_print_in_order(struct veb *veb)
{
int bfs = bfs_first(veb, 1);
while (bfs != -1)
{
printf("%lld\n", (unsigned long long) node_at(veb, bfs)->key.objectid);
bfs = bfs_next(veb, bfs, 1);
}
printf("\n");
} | false | false | false | false | false | 0 |
snd_hdsp_prepare(struct snd_pcm_substream *substream)
{
struct hdsp *hdsp = snd_pcm_substream_chip(substream);
int result = 0;
if (hdsp_check_for_iobox (hdsp))
return -EIO;
if (hdsp_check_for_firmware(hdsp, 1))
return -EIO;
spin_lock_irq(&hdsp->lock);
if (!hdsp->running)
hdsp_reset_hw_pointer(hdsp);
spi... | false | false | false | false | false | 0 |
qd_unlock(struct gfs2_quota_data *qd)
{
gfs2_assert_warn(qd->qd_gl->gl_name.ln_sbd,
test_bit(QDF_LOCKED, &qd->qd_flags));
clear_bit(QDF_LOCKED, &qd->qd_flags);
bh_put(qd);
slot_put(qd);
qd_put(qd);
} | false | false | false | false | false | 0 |
atlv_dup (Atlv *tlv,
gboolean siblings)
{
Atlv *copy;
if (!tlv)
return NULL;
copy = g_slice_new0 (Atlv);
memcpy (copy, tlv, sizeof (Atlv));
if (tlv->value != NULL)
copy->value = g_bytes_ref (tlv->value);
if (tlv->decoded != NULL)
copy->decoded = g_bytes_ref (tlv->decoded);
copy->child = atlv_... | false | false | false | false | false | 0 |
via_cmdbuf_size(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
drm_via_cmdbuf_size_t *d_siz = data;
int ret = 0;
uint32_t tmp_size, count;
drm_via_private_t *dev_priv;
DRM_DEBUG("\n");
LOCK_TEST_WITH_RETURN(dev, file_priv);
dev_priv = (drm_via_private_t *) dev->dev_private;
if (dev_priv->r... | false | false | false | false | false | 0 |
__intel_uncore_forcewake_put(struct drm_i915_private *dev_priv,
enum forcewake_domains fw_domains)
{
struct intel_uncore_forcewake_domain *domain;
if (!dev_priv->uncore.funcs.force_wake_put)
return;
fw_domains &= dev_priv->uncore.fw_domains;
for_each_fw_domain_masked(domain, fw_domains, dev_priv) {
if ... | false | false | false | false | false | 0 |
m88e3016_config_init(struct phy_device *phydev)
{
int reg;
/* Enable Scrambler and Auto-Crossover */
reg = phy_read(phydev, MII_88E3016_PHY_SPEC_CTRL);
if (reg < 0)
return reg;
reg &= ~MII_88E3016_DISABLE_SCRAMBLER;
reg |= MII_88E3016_AUTO_MDIX_CROSSOVER;
reg = phy_write(phydev, MII_88E3016_PHY_SPEC_CTRL, r... | false | false | false | false | false | 0 |
DiskSync(void) {
int i, retval = 0, platformFound = 0;
// If disk isn't open, try to open it....
if (!isOpen) {
OpenForRead();
} // if
if (isOpen) {
sync();
#if defined(__APPLE__) || defined(__sun__)
cout << "Warning: The kernel may continue to use old or deleted partitions.\n"
... | false | false | false | false | false | 0 |
adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
{
struct adv7511_link_config link_config;
struct adv7511 *adv7511;
struct device *dev = &i2c->dev;
unsigned int val;
int ret;
if (!dev->of_node)
return -EINVAL;
adv7511 = devm_kzalloc(dev, sizeof(*adv7511), GFP_KERNEL);
if (!adv7511)
re... | false | false | false | false | false | 0 |
iter_declaration(
struct tgsi_iterate_context *iter,
struct tgsi_full_declaration *decl )
{
struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;
uint file;
uint i;
/* No declarations allowed after the first instruction.
*/
if (ctx->num_instructions > 0)
report_error( ctx, "In... | false | false | false | false | false | 0 |
xlp_spi_transfer_one(struct spi_master *master,
struct spi_device *spi,
struct spi_transfer *t)
{
struct xlp_spi_priv *xspi = spi_master_get_devdata(master);
int ret = 0;
xspi->cs = spi->chip_select;
xspi->dev = spi->dev;
if (spi_transfer_is_last(master, t))
xspi->cmd_cont = 0;
else
xspi->cmd_cont... | false | false | false | false | false | 0 |
remapVarsInit(int map_type, remapgrid_t *rg, remapvars_t *rv)
{
/* Initialize all pointer */
if ( rv->pinit == FALSE )
{
rv->pinit = TRUE;
rv->grid1_add = NULL;
rv->grid2_add = NULL;
rv->wts = NULL;
}
/* Determine the number of weights */
if ( map_type == MAP_TYPE_C... | false | false | false | false | false | 0 |
searchrtlsym( Figure, Name, Index )
rtlfig_list *Figure;
char *Name;
short Index;
{
authtable *HashTable;
authelem *Element;
vexexpr *Atom;
rtldecl_list *Decl;
short Bound;
Name = namealloc( Name );
HashTable = Figure->HASH_DECLAR;
Elemen... | false | false | false | false | false | 0 |
GetProjectDataFromHash( cbProject* pProject)
// ----------------------------------------------------------------------------
{
// Get the ProjectData* that's associated with this cbProject&
// eg. cbProject* pProjectData = GetProjectFromHash(m_ProjectDataHash, pProject);
ProjectDataHash& hash = m_ProjectDat... | false | false | false | false | false | 0 |
stv_fsspace(int fd, unsigned *bs)
{
uintmax_t bsize, bavail;
#if defined(HAVE_SYS_STATVFS_H)
struct statvfs fsst;
AZ(fstatvfs(fd, &fsst));
bsize = fsst.f_frsize;
bavail = fsst.f_bavail;
#elif defined(HAVE_SYS_MOUNT_H) || defined(HAVE_SYS_VFS_H)
struct statfs fsst;
AZ(fstatfs(sc->fd, &fsst));
bsize = fsst.f_bs... | false | false | false | false | false | 0 |
endio_readpage_release_extent(struct extent_io_tree *tree, u64 start, u64 len,
int uptodate)
{
struct extent_state *cached = NULL;
u64 end = start + len - 1;
if (uptodate && tree->track_uptodate)
set_extent_uptodate(tree, start, end, &cached, GFP_ATOMIC);
unlock_extent_cached(tree, start, end, &cached, ... | false | false | false | false | false | 0 |
index_subsys_index_matches_associated(indexEntry *index, Slapi_Filter *f)
{
int ret = 0;
char **associated_attrs = index->associated_attrs;
if(INDEX_MATCH_NONE != index_subsys_index_matches_filter(index, f))
{
/* matched on indexed attribute */
ret = -1;
goto bail;
}
/* check associated attributes */
if(... | false | false | false | false | false | 0 |
derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
{
WINDOW *win;
int i;
int flags = _SUBWIN;
T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), orig, num_lines, num_columns,
begy, begx));
/*
* make sure window fits inside the original one
*/
if (begy < 0 || begx < 0... | false | false | false | false | false | 0 |
get_window (GtkTreeModel *model,
GtkTreeIter *iter)
{
MatewnckWindow *window;
gtk_tree_model_get (model, iter,
0, &window,
-1);
/* window may be NULL after we append to the list store and
* before we set the value with gtk_list_store_set()
*/
if... | false | false | false | false | false | 0 |
goo_canvas_table_set_child_property (GooCanvasItem *item,
GooCanvasItem *child,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item;
GooCanvasGroup *group = (GooCanvasGroup*) item;... | false | false | false | false | false | 0 |
delete_unreachable_blocks ()
{
bool changed = false;
basic_block b, next_bb;
find_unreachable_blocks ();
/* Delete all unreachable basic blocks. */
for (b = ENTRY_BLOCK_PTR->next_bb; b != EXIT_BLOCK_PTR; b = next_bb)
{
next_bb = b->next_bb;
if (!(b->flags & BB_REACHABLE))
{
flow_delet... | false | false | false | false | false | 0 |
editable_enters (GNCSearchCoreType *fe)
{
GNCSearchDouble *fi = (GNCSearchDouble *)fe;
GNCSearchDoublePrivate *priv ;
g_return_if_fail (fi);
g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
priv = _PRIVATE(fi);
if (priv->entry)
gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE)... | false | false | false | false | false | 0 |
__feupdateenv (const fenv_t *envp)
{
fexcept_t temp;
unsigned int xtemp = 0;
/* Save current exceptions. */
__asm__ ("fnstsw %0" : "=m" (*&temp));
/* If the CPU supports SSE we test the MXCSR as well. */
if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
__asm__ ("stmxcsr %0" : "=m" (*&xtemp));
temp = (... | false | false | false | false | false | 0 |
getLanguageBreakEngineFromFactory(UChar32 c, int32_t breakType)
{
UBool needsInit;
UErrorCode status = U_ZERO_ERROR;
UMTX_CHECK(NULL, (UBool)(gLanguageBreakFactories == NULL), needsInit);
if (needsInit) {
UStack *factories = new UStack(_deleteFactory, NULL, status);
if (fact... | false | false | false | false | false | 0 |
krb5_read (kx_context *kc,
int fd, void *buf, size_t len)
{
size_t data_len, outer_len;
krb5_error_code ret;
unsigned char tmp[4];
krb5_data data;
int l;
l = krb5_net_read (CONTEXT(kc), &fd, tmp, 4);
if (l == 0)
return l;
if (l != 4)
return -1;
data_len = (tmp[0] << 24) | (tm... | true | true | false | false | false | 1 |
fill_from_language_entry (GtrLanguagesFetcher *fetcher,
GtrLanguage *lang)
{
const gchar *entry_text;
fill_encoding_and_charset (fetcher);
entry_text = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (fetcher->priv->language_code))));
if (*entry_text == '\0')
{... | false | false | false | false | false | 0 |
radicalOfMonomialIdeal(PolynomialSet const &monomialGenerators)
{
PolynomialRing theRing=monomialGenerators.getRing();
PolynomialSet temp=monomialGenerators;
temp.markAndScale(LexicographicTermOrder()); //just to make sure that some term is marked
PolynomialSet ret(theRing);
for(PolynomialSet::const_iterato... | false | false | false | false | false | 0 |
_e_fwin_new(E_Container *con,
const char *dev,
const char *path)
{
E_Fwin *fwin;
E_Fwin_Page *page;
Evas_Object *o;
E_Zone *zone;
fwin = E_OBJECT_ALLOC(E_Fwin, E_FWIN_TYPE, _e_fwin_free);
if (!fwin) return NULL;
fwin->win = e_win_new(con);
if (!fwin->win)
{
... | false | false | false | false | false | 0 |
make_con_node(Module_table *mpt, qr_operator ope, SemBranch *branch, int k)
{
SemanticNode *node;
node = AllocSemanticNode(ope, TYPE_INT, NULL, 0);
node->rdata->kind = LEAF;
node->rdata->data.leaf = AllocSemanticLeaf(KIND_CONST,
get_const_int(k)->entry,
1);
node->ldata->kind... | false | false | false | false | false | 0 |
_iodbcdm_pushsqlerr (
HERR herr,
sqlstcode_t code,
void *msg)
{
sqlerr_t *ebuf;
sqlerr_t *perr = (sqlerr_t *) herr;
int idx = 0;
if (herr != SQL_NULL_HERR)
{
idx = perr->idx + 1;
}
if (idx == 64)
/* overwrite the top entry to prevent error stack blow out */
{
perr->co... | false | false | false | false | false | 0 |
add_book(title *book, int type, const char *fname, int lineno) {
titlelist *bl;
if (type == -1) {
LOG(llevInfo, "Warning: book with no type at %s, line %d; using type 0\n", fname, lineno);
type = 0;
}
bl = get_titlelist(type);
book->next = bl->first_book;
bl->first_book = book;... | false | false | false | false | false | 0 |
resize_buffer(int amount)
{
int pos, size;
pos = stk.last->cur - stk.last->buf;
size = stk.last->size + amount;
while (stk.last->size < size) stk.last->size *= 2;
stk.last->buf = (char *)realloc(stk.last->buf, stk.last->size);
check_mem(stk.last->buf);
stk.last->cur = stk.last->buf + pos;
} | false | false | false | false | false | 0 |
Add(const FileDescriptorProto& file) {
FileDescriptorProto* new_file = new FileDescriptorProto;
new_file->CopyFrom(file);
return AddAndOwn(new_file);
} | false | false | false | false | false | 0 |
Java_org_gdal_gdal_gdalJNI_Band_1ComputeBandStats_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdoubleArray jarg2, jint jarg3) {
GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
double *arg2 ;
int arg3 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(GDALRasterBandShadow ... | false | false | false | false | false | 0 |
evmap_io_foreach_event_fn(struct event_base *base, evutil_socket_t fd,
struct evmap_io *io_info, void *arg)
{
struct evmap_foreach_event_helper *h = arg;
struct event *ev;
int r;
LIST_FOREACH(ev, &io_info->events, ev_io_next) {
if ((r = h->fn(base, ev, h->arg)))
return r;
}
return 0;
} | false | false | false | false | false | 0 |
standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
{
PlannedStmt *result;
PlannerGlobal *glob;
double tuple_fraction;
PlannerInfo *root;
Plan *top_plan;
ListCell *lp,
*lr;
/* Cursor options may come from caller or from DECLARE CURSOR stmt */
if (parse->utilityStmt &&
IsA... | false | false | false | false | false | 0 |
add_struct (int x, int y, int tx, int ty, int bond, int smarked, int tmarked, int decoration, int color)
/* adds the data corresponding to a new bond */
{
struct data *last;
struct xy_co *coord;
int lx,ly;
if (bond == 17)
{
add_spline (x, y, (int) (x + 0.5 * (tx - x)), (int)(y - 0.5 * (ty - y)),
(... | false | false | false | false | false | 0 |
httpd_send_err( httpd_conn* hc, int status, char* title, char* extraheads, char* form, char* arg )
{
#ifdef ERR_DIR
char filename[1000];
/* Try virtual host error page. */
if ( hc->hs->vhost && hc->hostdir[0] != '\0' )
{
(void) my_snprintf( filename, sizeof(filename),
"%s/%s/err%d.html", hc->ho... | true | true | true | false | false | 1 |
window_tile_windows (int style)
{
WINDOW *win, *last_adjusted;
int numwins, avail, per_win_height, leftover;
int do_internals;
numwins = avail = 0;
do_internals = (style == TILE_INTERNALS);
for (win = windows; win; win = win->next)
if (do_internals || !win->node ||
(win->node->flags & N_IsInte... | false | false | false | false | false | 0 |
apm_open(void)
{
char *tmp;
int fd;
apm_info i;
if (access(APM_PROC, R_OK) || apm_read(&i) == 1)
return -1;
if (i.driver_version[0] >= '1')
{
if ((fd = open(APM_DEVICE, O_RDWR)) < 0)
{
/* Try to create it. This is reasonable
* for backward compatibility.
*/
if (mknod(A... | false | false | false | false | true | 1 |
unused()
{
// find first available block
for( unsigned i = 0; i < data.size(); i++ )
if( data[i] == Avail )
return i;
// completely full, so enlarge the table
unsigned block = data.size();
resize( data.size()+10 );
return block;
} | false | false | false | false | false | 0 |
http_rangeset_equal(const http_rangeset_t *hrs1, const http_rangeset_t *hrs2)
{
const slink_t *sl1, *sl2;
http_rangeset_check(hrs1);
http_rangeset_check(hrs2);
if (hrs1->length != hrs2->length)
return FALSE;
for (
sl1 = eslist_first(&hrs1->list), sl2 = eslist_first(&hrs2->list);
sl1 != NULL && sl2 != NULL... | false | false | false | false | false | 0 |
current_uuid_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct platform_device *pdev = to_platform_device(dev);
struct int3400_thermal_priv *priv = platform_get_drvdata(pdev);
int i;
for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; ++i) {
if ((priv->uuid_bi... | false | false | false | false | false | 0 |
on_clear()
{
joystick.clear_calibration();
update_with(joystick.get_calibration());
} | false | false | false | false | false | 0 |
gth_file_list_key_press_cb (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
GthBrowser *browser = user_data;
gboolean result = FALSE;
guint modifiers;
modifiers = gtk_accelerator_get_default_mod_mask ();
if ((event->state & modifiers) == 0) {
switch (event->keyval) {
... | 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.