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 |
|---|---|---|---|---|---|---|
suspend_signal_handler (int _dummy, siginfo_t *info, void *context)
{
MonoThreadInfo *current = mono_thread_info_current ();
gboolean ret;
if (current->syscall_break_signal) {
current->syscall_break_signal = FALSE;
return;
}
ret = mono_threads_get_runtime_callbacks ()->thread_state_init_from_sigctx (¤... | false | false | false | false | false | 0 |
get_hourly_history_bucket(int cmd)
{
time_t now = time(NULL);
int hour = ((int) now) / 3600;
int bucket = hour % HISTORY_HOURS;
HistoryBucket *b = &(hourly_history[cmd][bucket]);
if (b->elapsed != hour) {
b->first = now;
b->elapsed = hour;
b->count = 0;
b->slaves = 0;
b->ms = 0;
b->activated =... | false | false | false | false | false | 0 |
account_find_from_id(gint id)
{
GList *cur;
PrefsAccount *ac;
for (cur = account_list; cur != NULL; cur = cur->next) {
ac = (PrefsAccount *)cur->data;
if (id == ac->account_id)
return ac;
}
return NULL;
} | false | false | false | false | false | 0 |
igb_initialize_M88E1512_phy(struct e1000_hw *hw)
{
struct e1000_phy_info *phy = &hw->phy;
s32 ret_val = 0;
/* Switch to PHY page 0xFF. */
ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0x00FF);
if (ret_val)
goto out;
ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_2, 0x214B);
if (ret_val)... | false | false | false | false | false | 0 |
fix_mfm_sync (FDI *fdi)
{
int i, pos, off1, off2, off3, mask1, mask2, mask3;
for (i = 0; i < fdi->mfmsync_offset; i++) {
pos = fdi->mfmsync_buffer[i];
off1 = (pos - 1) >> 3;
off2 = (pos + 1) >> 3;
off3 = pos >> 3;
mask1 = 1 << (7 - ((pos - 1) & 7));
mask2 = 1 << (7 - ((pos + 1) & 7));
mask3 = 1 << (7 -... | false | false | false | false | false | 0 |
CFontz_set_contrast(Driver *drvthis, int promille)
{
PrivateData *p = drvthis->private_data;
char out[4] = { CFONTZ_Contrast_Control, 0 };
// Check it
if ((promille < 0) || (promille > 1000))
return;
// Store it
p->contrast = promille;
// And do it (converted from [0,1000] - > [0,100])
out[1] = (unsigned c... | false | false | false | false | false | 0 |
GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h,
const char *service_name,
struct GNUNET_TIME_Relative timeout,
GNUNET_ARM_Callback cb, void *cb_cls)
{
struct ARM_ShutdownContext *arm_shutdown_ctx;
struct GNUNET_CLIENT_Connection *client;
LOG (GNUNET_ERROR_TYPE_INFO, _("Stopping service `%s' wit... | false | false | false | false | false | 0 |
cost_bitmap_and_node(BitmapAndPath *path, PlannerInfo *root)
{
Cost totalCost;
Selectivity selec;
ListCell *l;
/*
* We estimate AND selectivity on the assumption that the inputs are
* independent. This is probably often wrong, but we don't have the info
* to do better.
*
* The runtime cost of the Bit... | false | false | false | false | false | 0 |
cmp(const FWObject *x, bool recursive) throw(FWException)
{
const PolicyRule *rx = PolicyRule::constcast(x);
if (rx == NULL) return false;
if (getDirection() != rx->getDirection() ||
getAction() != rx->getAction() ||
getLogging() != rx->getLogging()) return false;
return Rule::cmp(x, re... | false | false | false | false | false | 0 |
i7core_put_devices(struct i7core_dev *i7core_dev)
{
int i;
edac_dbg(0, "\n");
for (i = 0; i < i7core_dev->n_devs; i++) {
struct pci_dev *pdev = i7core_dev->pdev[i];
if (!pdev)
continue;
edac_dbg(0, "Removing dev %02x:%02x.%d\n",
pdev->bus->number,
PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
pc... | false | false | false | false | false | 0 |
gst_base_rtp_audio_payload_class_init (GstBaseRTPAudioPayloadClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
g_type_class_add_private (klass, sizeof (GstBaseRTPAudioPayloadPrivate));
gobject_class = (GObjectClass *) klass;
g... | false | false | false | false | false | 0 |
test_pytime_object_to_timeval(PyObject *self, PyObject *args)
{
PyObject *obj;
time_t sec;
long usec;
if (!PyArg_ParseTuple(args, "O:pytime_object_to_timeval", &obj))
return NULL;
if (_PyTime_ObjectToTimeval(obj, &sec, &usec) == -1)
return NULL;
return Py_BuildValue("Nl", _PyLong... | false | false | false | false | false | 0 |
varpool_used_from_object_file_p (struct varpool_node *node)
{
if (!TREE_PUBLIC (node->decl))
return false;
if (resolution_used_from_other_file_p (node->resolution))
return true;
return false;
} | false | false | false | false | false | 0 |
sxgbe_set_eee_pls(void __iomem *ioaddr, const int link)
{
u32 ctrl;
ctrl = readl(ioaddr + SXGBE_CORE_LPI_CTRL_STATUS);
/* If the PHY link status is UP then set PLS */
if (link)
ctrl |= LPI_CTRL_STATUS_PLS;
else
ctrl &= ~LPI_CTRL_STATUS_PLS;
writel(ctrl, ioaddr + SXGBE_CORE_LPI_CTRL_STATUS);
} | false | false | false | false | false | 0 |
vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{
struct tm6000_core *dev = ((struct tm6000_fh *)priv)->dev;
struct video_device *vdev = video_devdata(file);
strlcpy(cap->driver, "tm6000", sizeof(cap->driver));
strlcpy(cap->card, "Trident TVMaster TM5600/6000/6010", sizeof(cap->ca... | false | false | false | false | false | 0 |
soup_address_get_sockaddr (SoupAddress *addr, int *len)
{
SoupAddressPrivate *priv;
g_return_val_if_fail (SOUP_IS_ADDRESS (addr), NULL);
priv = SOUP_ADDRESS_GET_PRIVATE (addr);
if (priv->sockaddr && len)
*len = SOUP_ADDRESS_FAMILY_SOCKADDR_SIZE (SOUP_ADDRESS_GET_FAMILY (priv));
return (struct sockaddr *)priv->... | false | false | false | false | false | 0 |
dma_timer( int n_channel, UINT32 n_scanline )
{
if( n_scanline != 0xffffffff )
{
timer_adjust( m_p_timer_dma[ n_channel ], cpu_getscanlinetime( n_scanline ), n_channel, 0 );
}
else
{
timer_adjust( m_p_timer_dma[ n_channel ], TIME_NEVER, 0, 0 );
}
m_p_n_dma_lastscanline[ n_channel ] = n_scanline;
} | false | false | false | false | false | 0 |
hdlc_tx_corrupt_frame(hdlc_tx_state_t *s)
{
if (s->len <= 0)
return -1;
s->crc ^= 0xFFFF;
s->buffer[HDLC_MAXFRAME_LEN] ^= 0xFF;
s->buffer[HDLC_MAXFRAME_LEN + 1] ^= 0xFF;
s->buffer[HDLC_MAXFRAME_LEN + 2] ^= 0xFF;
s->buffer[HDLC_MAXFRAME_LEN + 3] ^= 0xFF;
return 0;
} | false | false | false | false | false | 0 |
i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
{
u8 bw_share[I40E_MAX_TRAFFIC_CLASS] = {0};
struct i40e_vsi_context ctxt;
int ret = 0;
int i;
/* Check if enabled_tc is same as existing or new TCs */
if (vsi->tc_config.enabled_tc == enabled_tc)
return ret;
/* Enable ETS TCs with equal BW Share for no... | false | false | false | false | false | 0 |
tone_start(struct GUI *gui)
{
int note, pressed, freq, usec;
if (!gui->pressed) return;
set_pixmap(gui, TRUE);
pressed = gui->pressed & ~(BLACK_PRESSED | WHITE_PRESSED);
if (gui->pressed & WHITE_PRESSED) {
note = 14 * (pressed / 7) + 2 * (pressed % 7);
} else {
note = 14 * (pressed / 7) + 2 * (pressed % 7)... | false | false | false | false | false | 0 |
fput_sem_shared_branch(FILE *fp,
const SemBranch *branch,
const Module_table *module,
const int current_pe,
Boolean opt_scalar_map)
{
int n;
switch (branch->kind) {
case EMPTY:
n = 0;
break;
case NODE:
n = fput_sem_shared_node0(fp, branch->d... | false | false | false | false | false | 0 |
gr_opengl_translate_texture_matrix(int unit, vec3d *shift)
{
GLint current_matrix;
if (unit > GL_supported_texture_units) {
/*tex_shift=*shift;*/
return;
}
glGetIntegerv(GL_MATRIX_MODE, ¤t_matrix);
vglActiveTextureARB(GL_TEXTURE0_ARB+unit);
glMatrixMode(GL_TEXTURE);
glTranslated(shift->xyz.x, shift-... | false | false | false | false | false | 0 |
gst_signal_processor_do_pulls (GstSignalProcessor * self, guint nframes)
{
GList *sinkpads;
/* FIXME: not threadsafe atm */
sinkpads = GST_ELEMENT (self)->sinkpads;
for (; sinkpads; sinkpads = sinkpads->next) {
GstSignalProcessorPad *spad = (GstSignalProcessorPad *) sinkpads->data;
GstFlowReturn ret ... | false | false | false | false | false | 0 |
recv_subn_get_pkeytable(struct ib_smp *smp,
struct ib_device *ibdev)
{
u32 startpx = 32 * (be32_to_cpu(smp->attr_mod) & 0xffff);
u16 *p = (u16 *) smp->data;
__be16 *q = (__be16 *) smp->data;
/* 64 blocks of 32 16-bit P_Key entries */
memset(smp->data, 0, sizeof(smp->data));
if (startpx == 0) {
struct i... | false | false | false | false | false | 0 |
bfa_fcs_lport_abts_acc(struct bfa_fcs_lport_s *port, struct fchs_s *rx_fchs)
{
struct fchs_s fchs;
struct bfa_fcxp_s *fcxp;
int len;
bfa_trc(port->fcs, rx_fchs->d_id);
bfa_trc(port->fcs, rx_fchs->s_id);
fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE);
if (!fcxp)
return;
len = fc_ba_acc_build(&fchs, bfa_fc... | false | false | false | false | false | 0 |
GetWaterLevel(float x, float y, float z, float* pGround /*= NULL*/) const
{
if (const_cast<TerrainInfo*>(this)->GetGrid(x, y))
{
// we need ground level (including grid height version) for proper return water level in point
float ground_z = GetHeightStatic(x, y, z, true, DEFAULT_WATER_SEARCH);
... | false | false | false | false | false | 0 |
append(char c, char **buff, unsigned *pos, unsigned *bufflen)
/** Append character to string, reallocating memory as necessary */
{ unsigned newlen;
if (*pos >= *bufflen) {
newlen = (*bufflen) * 2 + 64;
*buff = (char*)realloc(*buff, (size_t)newlen);
*bufflen = newlen;
}
(*buf... | false | false | false | false | false | 0 |
ar_card_themes_get_theme_any (ArCardThemes *theme_manager)
{
ThemesAnyData data = { theme_manager, NULL };
g_return_val_if_fail (AR_IS_CARD_THEMES (theme_manager), NULL);
ar_debug_print (AR_DEBUG_CARD_THEME,
"Fallback: trying to load any theme\n");
ar_card_themes_request_themes (theme_m... | false | false | false | false | false | 0 |
tree_occupation_inner(struct veb *veb, int bfs_root)
{
if (!node_valid_pos(veb, bfs_root))
return 0;
return 1 + tree_occupation_inner(veb, bfs_left(bfs_root)) +
tree_occupation_inner(veb, bfs_right(bfs_root));
} | false | false | false | false | false | 0 |
free_path_list(JCR *jcr)
{
if (jcr->path_list) {
jcr->path_list->destroy();
free(jcr->path_list);
jcr->path_list = NULL;
}
} | false | false | false | false | false | 0 |
CachedCrl_Compare(CachedCrl* a, CachedCrl* b, PRBool* isDupe,
PRBool* isUpdated)
{
PORT_Assert(a);
PORT_Assert(b);
PORT_Assert(isDupe);
PORT_Assert(isUpdated);
if (!a || !b || !isDupe || !isUpdated || !a->crl || !b->crl)
{
PORT_SetError(SEC_ERROR_LIBRARY_F... | false | false | false | false | false | 0 |
__ext4_warning_inode(const struct inode *inode, const char *function,
unsigned int line, const char *fmt, ...)
{
struct va_format vaf;
va_list args;
if (!ext4_warning_ratelimit(inode->i_sb))
return;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
printk(KERN_WARNING "EXT4-fs warning (device %s): %s:... | false | false | false | false | false | 0 |
fill_queue (GstScaletempo * scaletempo, GstBuffer * buf_in, guint offset)
{
GstScaletempoPrivate *p = GST_SCALETEMPO_GET_PRIVATE (scaletempo);
guint bytes_in = GST_BUFFER_SIZE (buf_in) - offset;
guint offset_unchanged = offset;
if (p->bytes_to_slide > 0) {
if (p->bytes_to_slide < p->bytes_queued) {
g... | false | true | false | false | false | 1 |
script_headers(lua_State *L, char **headers) {
lua_getglobal(L, "wrk");
lua_getfield(L, 1, "headers");
for (char **h = headers; *h; h++) {
char *p = strchr(*h, ':');
if (p && p[1] == ' ') {
lua_pushlstring(L, *h, p - *h);
lua_pushstring(L, p + 2);
lua_sett... | false | false | false | false | false | 0 |
gl_label_box_finalize (GObject *object)
{
glLabelBox *lbox = GL_LABEL_BOX (object);
g_return_if_fail (object && GL_IS_LABEL_BOX (object));
gl_color_node_free (&(lbox->priv->fill_color_node));
gl_color_node_free (&(lbox->priv->line_color_node));
g_free (lbox->priv);
G_OBJECT_CLASS (gl_label_box_parent_class)->f... | false | false | false | false | false | 0 |
update(std::istream &is)
{
std::string rest_of_buffer;
read(is, rest_of_buffer, BLOCK_BYTES - buffer.size());
buffer += rest_of_buffer;
while (is)
{
uint32 block[BLOCK_INTS];
buffer_to_block(buffer, block);
transform(block);
read(is, buffer, BLOCK_BYTES);
}
} | false | false | false | false | false | 0 |
chess_engine_write_line (ChessEngine* self, const gchar* line) {
const gchar* _tmp0_;
gchar* _tmp1_;
gchar* l;
const gchar* _tmp2_;
const gchar* _tmp3_;
gint _tmp4_ = 0;
gchar* _tmp5_ = NULL;
gchar* d;
gint d_length1;
gint _d_size_;
gchar* _tmp6_;
gint _tmp6__length1;
g_return_if_fail (self != NULL);
g_re... | false | false | false | false | false | 0 |
save_pid(int pid) {
int n;
FILE *file;
struct stat stat_buf;
/* if pidfile exists, check if the process is running */
if(stat(pidfile, &stat_buf) == 0) {
file = fopen(pidfile, "r");
if(!file) {
log_text(err, "'%s' already exists, but can not be read. "
"Execution shall continue, ... | false | false | false | false | false | 0 |
find_match_char(char *buffer, char *match, char *result)
{
char *position;
remove_leading_whitespace(buffer);
if(strstr(buffer, match) == strstr(buffer, buffer))
{
position = strpbrk(buffer, delims);
if (position != NULL) {
position += 1;
strcpy(result, position);
position = strstr(result, "\n");... | false | true | true | false | false | 1 |
tray_icon_activate_cb (GtkStatusIcon *status_icon, MyApp *app)
{
/* if not popping up messages automatically, popup a
message on button 1 click */
if (app->messages && (! app->popup_cb)) {
dequeue_message (app);
} else if (phonemgr_listener_connected (app->listener) != FALSE) {
create_send_dialog (app, NULL,... | false | false | false | false | false | 0 |
AddPatientDirectoryRecord()
{
gdcm::DataSet &rootds = GetFile().GetDataSet();
gdcm::Scanner const & scanner = GetScanner();
Attribute<0x10,0x20> patientid;
gdcm::Scanner::ValuesType patientids = scanner.GetValues( patientid.GetTag() );
//unsigned int npatients = patientids.size();
const gdcm::DataElement ... | false | false | false | false | false | 0 |
qmonSubmitAskForProject(Widget w, XtPointer cld, XtPointer cad)
{
Boolean status = False;
lList *pl = NULL;
lListElem *cep = NULL;
int n, i;
StringConst *strs = NULL;
static char buf[BUFSIZ];
lList *alp = NULL;
DENTER(GUI_LAYER, "qmonSubmitAskForProject");
qmonMirrorMultiAnswer(PROJEC... | true | true | false | false | false | 1 |
gfs_gedge_new (GfsGEdgeClass * klass,
GfsBox * b1, GfsBox * b2,
FttDirection d)
{
GfsGEdge * edge;
g_return_val_if_fail (klass != NULL, NULL);
g_return_val_if_fail (b1 != NULL, NULL);
g_return_val_if_fail (b2 != NULL, NULL);
g_return_val_if_fail (d >= 0 && d < FTT_NEIGHBORS, NULL);
edge = GFS_GE... | false | false | false | false | false | 0 |
paramInteger(const USystemParams *param, char *target, int32_t targetCapacity, UErrorCode *status) {
if(U_FAILURE(*status))return 0;
if(param->paramStr==NULL || param->paramStr[0]=='d') {
return integerToStringBuffer(target,targetCapacity,param->paramInt, 10,status);
} else if(param->paramStr[0]=='x') {
r... | false | false | false | false | false | 0 |
SetAxes( const char *pszTargetKey,
const char *pszXAxisName,
OGRAxisOrientation eXAxisOrientation,
const char *pszYAxisName,
OGRAxisOrientation eYAxisOrientation )
{
/* ---------------------------... | false | false | false | false | false | 0 |
skipitem(const char **p_format, va_list *p_va, int flags)
{
const char *format = *p_format;
char c = *format++;
switch (c) {
/* simple codes
* The individual types (second arg of va_arg) are irrelevant */
case 'b': /* byte -- very short int */
case 'B': /* byte as bitfield */
case 'h... | false | false | false | false | false | 0 |
cik_enable_sdma_mgls(struct amdgpu_device *adev,
bool enable)
{
u32 orig, data;
if (enable && (adev->cg_flags & AMD_CG_SUPPORT_SDMA_LS)) {
orig = data = RREG32(mmSDMA0_POWER_CNTL + SDMA0_REGISTER_OFFSET);
data |= 0x100;
if (orig != data)
WREG32(mmSDMA0_POWER_CNTL + SDMA0_REGISTER_OFFSET, data);
orig... | false | false | false | false | false | 0 |
bt866_write(struct bt866 *encoder, u8 subaddr, u8 data)
{
struct i2c_client *client = v4l2_get_subdevdata(&encoder->sd);
u8 buffer[2];
int err;
buffer[0] = subaddr;
buffer[1] = data;
encoder->reg[subaddr] = data;
v4l_dbg(1, debug, client, "write 0x%02x = 0x%02x\n", subaddr, data);
for (err = 0; err < 3;) {
... | false | false | false | false | false | 0 |
chopen (input_buffer)
char **input_buffer;
{
int handle = 0;
init_ch (*input_buffer);
/*
* Initialization of the input
*/
if (yy_channelparse () == -2)
return(-2); /* Syntax error */
handle = wind ();
if ((!strcmp (channel[channel_handle].type, "alpha"))
/*
* Checking if alphanumerical window was s... | false | false | false | false | false | 0 |
xopendir(char *name)
{
DIR *dir;
if (name == NULL || (dir = opendir(name)) == NULL) {
return NULL;
// perror("opendir() faild ::");
// fprintf(stderr, "Can`t open dir: %s\n", name);
// exit(2);
}
return dir;
} | false | false | false | false | false | 0 |
build_mem_elf64_ehdr(const char *buf, off_t len, struct mem_ehdr *ehdr)
{
Elf64_Ehdr lehdr;
if ((uintmax_t)len < (uintmax_t)sizeof(lehdr)) {
/* Buffer is to small to be an elf executable */
if (probe_debug) {
fprintf(stderr, "Buffer is to small to hold ELF header\n");
}
return -1;
}
memcpy(&lehdr, buf, s... | false | false | false | false | false | 0 |
ath10k_pci_chip_reset(struct ath10k *ar)
{
if (QCA_REV_988X(ar))
return ath10k_pci_qca988x_chip_reset(ar);
else if (QCA_REV_6174(ar))
return ath10k_pci_qca6174_chip_reset(ar);
else if (QCA_REV_9377(ar))
return ath10k_pci_qca6174_chip_reset(ar);
else if (QCA_REV_99X0(ar))
return ath10k_pci_qca99x0_chip_reset... | false | false | false | false | false | 0 |
OnEndDragTreeItem(wxTreeEvent &event)
{
// SetCursor(wxCursor(wxCROSS_CURSOR));
if(m_Tree->GetItemImage(event.GetItem())!=fvsFolder) //can only copy to folders
return;
for(int i=0;i<m_ticount;i++)
{
wxString path(GetFullPath(m_selectti[i]));
wxFileName destpath;
if(!event.... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
PatientSelector *_t = static_cast<PatientSelector *>(_o);
switch (_id) {
case 0: { bool _r = _t->setFilterPatientModel((*reinter... | false | false | false | false | false | 0 |
checkXrayAngiographicAttributes(DcmItem *dataset,
const OFString &sopClass,
const char *filename)
{
OFCondition result = EC_Normal;
/* requirements depend on SOP class */
if (compare... | false | false | false | false | false | 0 |
unicode_ssetup_strings(char **pbcc_area, struct cifs_ses *ses,
const struct nls_table *nls_cp)
{
char *bcc_ptr = *pbcc_area;
int bytes_ret = 0;
/* BB FIXME add check that strings total less
than 335 or will need to send them as arrays */
/* unicode strings, must be word aligned before the call */
/* if ((... | false | false | false | false | false | 0 |
pull_var_clause_walker(Node *node, pull_var_clause_context *context)
{
if (node == NULL)
return false;
if (IsA(node, Var))
{
if (((Var *) node)->varlevelsup == 0)
context->varlist = lappend(context->varlist, node);
return false;
}
if (IsA(node, PlaceHolderVar))
{
switch (context->behavior)
{
case ... | false | false | false | false | false | 0 |
wb_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode,
struct iatt *buf, struct iatt *preparent,
struct iatt *postparent)
{
long flags = 0;
wb_file_t *file = NULL;
wb_conf_t... | false | false | false | true | false | 1 |
compute_shift_with_kw( cpl_propertylist *header,
xsh_rectify_param *rectify_par,
double **ref_ra,
double **ref_dec,
int flag)
{
double ref_ra_cumoff, ref_dec_cumoff;
double ra_cumoff, dec_cumoff;
double ra_reloff, dec_reloff, ra_off, dec_off;
double posang=0;
/* double b... | false | false | false | false | false | 0 |
write_cifs_stat(int curr, unsigned long long itv, int fctr,
struct io_hdr_stats *shi, struct cifs_stats *ioni,
struct cifs_stats *ionj)
{
if (DISPLAY_HUMAN_READ(flags)) {
printf("%-22s\n%23s", shi->name, "");
}
else {
printf("%-22s ", shi->name);
}
/* rB/s wB/s fo/s fc/s fd/s*/
pr... | false | false | false | false | false | 0 |
x_dialog_raise_all(GSCHEM_TOPLEVEL *w_current)
{
if(w_current->sowindow) {
gdk_window_raise(w_current->sowindow->window);
}
if(w_current->cswindow) {
gdk_window_raise(w_current->cswindow->window);
}
if(w_current->iwindow) {
gdk_window_raise(w_current->iwindow->window);
}
if(w_current->tiwindow... | false | false | false | false | false | 0 |
gwy_app_data_browser_sync_mask(GwyContainer *data,
GQuark quark,
GwyDataView *data_view)
{
GwyContainer *current_data;
gboolean has_dfield, has_layer;
const gchar *strkey;
GwyPixmapLayer *layer;
GwyAppKeyType type;
gint i;
has_df... | false | false | false | false | false | 0 |
append_strdup(const char* str, size_t helper_length, Language lang) {
size_t known_length=helper_length?helper_length:strlen(str);
if(!known_length)
return *this;
// first: langs
langs.append(body, lang, known_length);
// next: letters themselves
body.append_strdup_know_length(str, known_length);
ASSERT_STRI... | false | false | false | false | false | 0 |
sync_rename_list_add(struct sync_rename_list *l,
const char *uniqueid, const char *oldname,
const char *newname, const char *partition)
{
struct sync_rename *result
= xzmalloc(sizeof(struct sync_rename));
if (l->tail)
l->tail = l->tail->next = result;
else
l->h... | false | false | false | false | false | 0 |
read_info (SANE_String fname)
{
SANE_Byte buf[256];
SANE_Int i;
SANE_Char f[] = "read_info";
SANE_Char path[256];
strcpy (path, "\\PCCARD\\DCIM\\");
strcat (path, (char *) folder_list[current_folder]);
strcat (path, "\\");
strcat (path, fname);
path[strlen (path) - 3] = '\0';
strcat (path, ".JPG");... | false | false | false | false | false | 0 |
adfspart_check_EESOX(struct parsed_partitions *state)
{
Sector sect;
const unsigned char *data;
unsigned char buffer[256];
struct eesox_part *p;
sector_t start = 0;
int i, slot = 1;
data = read_part_sector(state, 7, §);
if (!data)
return -1;
/*
* "Decrypt" the partition table. God knows why...
*/
... | true | true | false | false | false | 1 |
apply_dns_settings ( void ) {
struct sockaddr_in *sin_nameserver =
( struct sockaddr_in * ) &nameserver;
int len;
if ( ( len = fetch_ipv4_setting ( NULL, &dns_setting,
&sin_nameserver->sin_addr ) ) >= 0 ){
sin_nameserver->sin_family = AF_INET;
DBG ( "DNS using nameserver %s\n",
inet_ntoa ( sin_... | false | false | false | false | false | 0 |
xhci_get_endpoint_mult(struct usb_device *udev,
struct usb_host_endpoint *ep)
{
if (udev->speed < USB_SPEED_SUPER ||
!usb_endpoint_xfer_isoc(&ep->desc))
return 0;
return ep->ss_ep_comp.bmAttributes;
} | false | false | false | false | false | 0 |
fifo_peek(SCREEN *sp)
{
int ch = sp->_fifo[peek];
TR(TRACE_IEVENT, ("peeking at %d", peek));
p_inc();
return ch;
} | false | false | false | false | false | 0 |
redrawrange(after, pre, post)
long after; /* lower bound of redrawafter */
long pre; /* upper bound of preredraw */
long post; /* upper bound of postredraw */
{
if (after == redrawafter)
{
/* multiple insertions/deletions at the same place -- combine
* them
*/
preredraw -= (post - pre);
if (postredraw ... | false | false | false | false | false | 0 |
callback_send_o_method_group_subscribe(void *user, VNodeID node_id, uint16 group_id)
{
VSNodeObject *node;
unsigned int i, j;
node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
if(node == NULL || vs_get_node(node_id, V_NT_OBJECT) == NULL)
return;
if(group_id < node->group_count && node->groups[group_id].... | false | false | false | false | false | 0 |
parse(int argc, char *argv[]) {
for (int x = 1; x < argc; x++) {
if ((!strcmp(argv[x], "-u")) || (!strcmp(argv[x], "--usage"))) {
usage();
exit(0);
}
if ((!strcmp(argv[x], "-h")) || (!strcmp(argv[x], "--help"))) {
help();
exit(0);
}
if ((!strcmp(argv[x], "-v")) || (!strcmp(... | false | false | false | false | false | 0 |
emulate_dcmpl(double value1, double value2)
{
if (isnan(value1) || isnan(value2))
return -1;
return __emulate_dcmpx(value1, value2);
} | false | false | false | false | false | 0 |
handle_condition(THD *thd,
uint sql_errno,
const char* sqlstate,
MYSQL_ERROR::enum_warning_level level,
const char* msg,
... | false | false | false | false | false | 0 |
Java_java_io_RandomAccessFile_open(JNIEnv *env,
jobject this, jstring path, jint mode)
{
int flags = 0;
if (mode & java_io_RandomAccessFile_O_RDONLY)
flags = O_RDONLY;
else if (mode & java_io_RandomAccessFile_O_RDWR) {
flags = O_RDWR | O_CREAT;
if (... | false | false | false | false | false | 0 |
sym_ccb_from_dsa(struct sym_hcb *np, u32 dsa)
{
int hcode;
struct sym_ccb *cp;
hcode = CCB_HASH_CODE(dsa);
cp = np->ccbh[hcode];
while (cp) {
if (cp->ccb_ba == dsa)
break;
cp = cp->link_ccbh;
}
return cp;
} | false | false | false | false | false | 0 |
make_united_mode (MOID_T * m)
{
MOID_T *u;
PACK_T *v, *w;
int mods;
if (m == NO_MOID) {
return (MODE (ERROR));
} else if (ATTRIBUTE (m) != SERIES_MODE) {
return (m);
}
/* Do not unite a single UNION */
if (DIM (m) == 1 && IS (MOID (PACK (m)), UNION_SYMBOL)) {
return (MOID (PACK (m)));
}
/* S... | false | false | false | false | false | 0 |
player_in_city_map(const struct player *pplayer,
const struct tile *ptile)
{
city_tile_iterate(CITY_MAP_MAX_RADIUS_SQ, ptile, ptile1) {
struct city *pcity = tile_city(ptile1);
if (pcity && city_owner(pcity) == pplayer
&& city_map_radius_sq_get(pcity) >= sq_map_distance(ptile,
... | false | false | false | false | false | 0 |
get_wd_usage(struct wdir_info *d)
{
#if !defined(HAS_FTS_H)
static int did_message = 0;
if(!did_message) {
debug(D_NOTICE, "fts_open is not implemented on this platform.");
did_message = 1;
}
return 1;
#else
char *argv[] = {d->path, NULL};
FTS *hierarchy;
FTSENT *entry;
d->files = 0;
d->directories = 0;
... | false | false | false | false | false | 0 |
server_port_flush(struct evdns_server_port *port)
{
struct server_request *req = port->pending_replies;
ASSERT_LOCKED(port);
while (req) {
int r = sendto(port->socket, req->response, req->response_len, 0,
(struct sockaddr*) &req->addr, req->addrlen);
if (r < 0) {
int err = evutil_socket_geterror(port->s... | false | false | false | false | false | 0 |
find_category (MonoString *category)
{
int i;
for (i = 0; i < NUM_CATEGORIES; ++i) {
if (mono_string_compare_ascii (category, predef_categories [i].name) == 0)
return &predef_categories [i];
}
return NULL;
} | false | false | false | false | false | 0 |
endSelection(int y, int x)
{
int y1a, y2a, y1b, y2b;
getSelection(&y1a, NULL, &y2a, NULL, true);
ys2 = y;
xs2 = x;
getSelection(&y1b, NULL, &y2b, NULL, true);
/*if (y1a == y1b)
updateViews(GMIN(y2a, y2b), GMAX(y2a, y2b) - GMIN(y2a, y2b) + 1);
else if (y2a == y2b)
updateViews(GMIN(y1a, y1b), GMAX(y1a, y1b) ... | false | false | false | false | false | 0 |
send(uint8 value)
{
if (inbuffer == NULL)
return;
/* Add new byte to IKBD buffer */
D(bug("ikbd: send(0x%02x) at position %d",value,inwrite));
inbuffer[inwrite++] = value;
inwrite &= (inbufferlen-1);
if (inread == inwrite) {
/* Queue full, need cleanup */
switch (inbuffer[inread]) {
/* Remove a packe... | false | false | false | false | false | 0 |
cavan_dialog_move_handler(struct cavan_window *win, struct cavan_input_message_point *point)
{
struct cavan_dialog *dialog = (struct cavan_dialog *) win;
if (dialog->move_able && win->pressed && dialog->backup == NULL)
{
struct cavan_display_device *display;
struct cavan_display_memory_rect *mem;
display = w... | false | false | false | false | false | 0 |
RequestForwarding(SystemAddress proxyCoordinator, SystemAddress sourceAddress, SystemAddress targetAddressAsSeenFromCoordinator, RakNet::TimeMS timeoutOnNoDataMS, RakNet::BitStream *serverSelectionBitstream)
{
// Return false if not connected
ConnectionState cs = rakPeerInterface->GetConnectionState(proxyCoordina... | false | false | false | false | false | 0 |
readAndInsertPixelData(I2DImgSource* imgSource,
DcmDataset* dset,
E_TransferSyntax& outputTS)
{
Uint16 samplesPerPixel, rows, cols, bitsAlloc, bitsStored, highBit, pixelRepr, planConf;
Uint16 pixAspectH =1; Uint16 pixAspectV... | false | false | false | false | false | 0 |
rsp_rcpt (siobuf_t conn, smtp_session_t session)
{
int code;
code = read_smtp_response (conn, session,
&session->rsp_recipient->status, NULL);
if (code < 0)
{
session->rsp_state = S_quit;
return;
}
if (code == 2)
session->current_message->valid_recipients += 1;
else
ses... | false | false | false | false | false | 0 |
AcpiDmDumpMethodInfo (
ACPI_STATUS Status,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *Next;
ACPI_THREAD_STATE *Thread;
ACPI_WALK_STATE *NextWalkState;
ACPI_NAMESPACE_NODE *PreviousMethod = NULL;
/* Ignore co... | false | false | false | false | false | 0 |
sirf_audio_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &snd_soc_sirf_audio_card;
struct sirf_audio_card *sirf_audio_card;
int ret;
sirf_audio_card = devm_kzalloc(&pdev->dev, sizeof(struct sirf_audio_card),
GFP_KERNEL);
if (sirf_audio_card == NULL)
return -ENOMEM;
sirf_audio_dai_link[0... | false | false | false | false | false | 0 |
setChecked(const bool check)
{
if (m_Item) {
if (m_Item->itemData()) {
if (check)
m_Item->itemData()->setData(0, 2, Qt::CheckStateRole);
else
m_Item->itemData()->setData(0, 0, Qt::CheckStateRole);
}
}
} | false | false | false | false | false | 0 |
read_param(GIOChannel * channel, gchar ** client_dir,
gboolean * clear_list)
{
size_t size = 0;
gchar *server_dir;
struct stat client_stat, server_stat;
GError *err = NULL;
gchar command;
g_io_channel_read_chars(channel, &command, 1, &size, &err);
if (size != 1) {... | false | false | false | false | false | 0 |
free_async(struct async *as)
{
int i;
put_pid(as->pid);
if (as->cred)
put_cred(as->cred);
for (i = 0; i < as->urb->num_sgs; i++) {
if (sg_page(&as->urb->sg[i]))
kfree(sg_virt(&as->urb->sg[i]));
}
kfree(as->urb->sg);
kfree(as->urb->transfer_buffer);
kfree(as->urb->setup_packet);
usb_free_urb(as->urb);
... | false | false | false | false | false | 0 |
hsv2rgb (hsv, rgb)
struct hsv *hsv;
struct rgb *rgb;
{
int i;
float f, p, q, r, h, v;
v = hsv->v;
if (hsv->s == 0) {
rgb->r = v; rgb->g = v; rgb->b = v; }
else {
h = hsv->h / 60;
i = (int) h;
f = h - i;
p = hsv->v * (1 - hsv->s);
q = hsv->v * (1 - (hsv->s * f));
r = hsv->v * (1 - (hs... | false | false | false | false | false | 0 |
zoomIn()
{
int i = levelForZoom(m_currentZoom);
if (i < m_zoomLevels.count() - 1)
m_currentZoom = m_zoomLevels[i + 1];
applyZoom();
} | false | false | false | false | false | 0 |
tok_show(t)
register struct token *t;
{
register struct token *p;
if (t->tokno == TOK_LIST) {
register struct token *s;
/*
* This branch is completely in terms of tok_xxx() primitives, so
* there is no need to check the line control information.
*/
for (s = t->head; s; s = s->next) {
tok_show_c... | false | false | false | false | false | 0 |
load(const std::string &filename, const CFileProvider &fp)
{
binistream *f = fp.open(filename); if(!f) return false;
char id[4];
unsigned int i;
size = fp.filesize(f) - 4; // filesize minus header
f->readString(id, 4);
if(strncmp(id,"CBMF",4)) { fp.close(f); return false; }
song = new unsigned char [siz... | false | false | false | false | false | 0 |
build_verbs_ulp_payload(
struct sdma_engine *sde,
struct hfi1_sge_state *ss,
u32 length,
struct verbs_txreq *tx)
{
struct hfi1_sge *sg_list = ss->sg_list;
struct hfi1_sge sge = ss->sge;
u8 num_sge = ss->num_sge;
u32 len;
int ret = 0;
while (length) {
len = ss->sge.length;
if (len > length)
len = lengt... | false | false | false | false | false | 0 |
ahc_restart(struct ahc_softc *ahc)
{
uint8_t sblkctl;
ahc_pause(ahc);
/* No more pending messages. */
ahc_clear_msg_state(ahc);
ahc_outb(ahc, SCSISIGO, 0); /* De-assert BSY */
ahc_outb(ahc, MSG_OUT, MSG_NOOP); /* No message to send */
ahc_outb(ahc, SXFRCTL1, ahc_inb(ahc, SXFRCTL1) & ~BITBUCKET);
ahc_outb(ah... | false | false | false | false | false | 0 |
recordDependencyOnSingleRelExpr(const ObjectAddress *depender,
Node *expr, Oid relId,
DependencyType behavior,
DependencyType self_behavior)
{
find_expr_references_context context;
RangeTblEntry rte;
context.addrs = new_object_addresses();
/* We gin up a rather bogus rangetable list to han... | false | false | false | false | false | 0 |
do_make_symlink (GVfsBackend *backend,
GVfsJobMakeSymlink *job,
const char *filename,
const char *symlink_value)
{
GError *error;
GFile *file;
g_print ("(II) try_make_symlink ('%s' --> '%s') \n", filename, symlink_value);
file = get_g_file_from_local (file... | 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.