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 |
|---|---|---|---|---|---|---|
ocfs2_need_system_inode(struct ocfs2_super *osb, int ino)
{
if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_USRQUOTA)
&& (ino == USER_QUOTA_SYSTEM_INODE
|| ino == LOCAL_USER_QUOTA_SYSTEM_INODE))
return 0;
if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)
&& (i... | false | false | false | false | false | 0 |
group() const
{
QString groupName = m_entry.stringValue( KIO::UDSEntry::UDS_GROUP );
if (groupName.isEmpty() && m_bIsLocalUrl )
{
#ifdef Q_WS_WIN
QFileInfo a(m_url.toLocalFile( KUrl::RemoveTrailingSlash ));
groupName = a.group();
m_entry.insert( KIO::UDSEntry::UDS_GROUP, groupName );... | false | false | false | false | false | 0 |
patternm_init_members(struct cpssp* cpssp)
{
int i;
/* Set default resolution. */
patternm_size_set(cpssp, 640, 400);
cpssp->sync_count = 0;
/* clear screen */
for (i = 0; i < MAX_HEIGHT; i++) {
memset(cpssp->current_screen[i], 0,
sizeof(cpssp->current_screen[0]));
}
} | false | false | false | false | false | 0 |
ReadCoordinates(int meshFD, vtkMultiBlockDataSet *output)
{
// Read in the point coordinates. The coordinates are 3-tuples in an array
// named "coords".
int coordsVarId;
CALL_NETCDF(nc_inq_varid(meshFD, "coords", &coordsVarId));
vtkSmartPointer<vtkDataArray> coordData
= this->ReadPointDataArray(meshFD,... | false | false | false | false | false | 0 |
check_learning(struct role_acl *role)
{
struct proc_acl *tmp;
struct proc_acl *def_acl;
unsigned int errs_found = 0;
def_acl = role->root_label;
if (!def_acl)
return 0;
if (gr_learn)
return 0;
if (!gr_learn && role->roletype & GR_ROLE_LEARN) {
fprintf(stderr,
"Warning: You have enabled learning on the... | false | false | false | false | false | 0 |
do_execute(entry *e)
{
if(debug > 0)
{
printf("Executing %s\n", e->command);
}
e->running = 1;
e->pending = 0;
e->pid = fork();
if(e->pid < 0)
{
fprintf(stderr, "Failed to fork\n");
}
else if(e->pid > 0)
{
if(debug > 0)
{
printf("I'm the parent\n");
}
}
else
{
execl("/bin/bash", "/bin/bash"... | false | false | false | false | false | 0 |
type_ptrdiff(void)
{
switch (opt_b) {
case TARGET_I286:
return arch_i286_type_intptr_t();
case TARGET_I386:
return arch_i386_type_intptr_t();
default:
assert(0);
}
} | false | false | false | false | false | 0 |
cafebabe_constant_info_utf8_init(struct cafebabe_constant_info_utf8 *utf8,
struct cafebabe_stream *s)
{
if (cafebabe_stream_read_uint16(s, &utf8->length))
goto out;
utf8->bytes = cafebabe_stream_malloc(s, utf8->length);
if (!utf8->bytes)
goto out;
for (uint16_t i = 0; i < utf8->length; ++i) {
if (cafebabe_... | false | false | false | false | false | 0 |
gst_tee_do_message (GstTee * tee, GstPad * pad, gpointer data, gboolean is_list)
{
GST_OBJECT_LOCK (tee);
g_free (tee->last_message);
if (is_list) {
tee->last_message =
g_strdup_printf ("chain-list ******* (%s:%s)t %p",
GST_DEBUG_PAD_NAME (pad), data);
} else {
tee->last_message =
... | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "Context: ";
if(this->Context!=0)
{
os << static_cast<void *>(this->Context) <<endl;
}
else
{
os << "none" << endl;
}
} | false | false | false | false | false | 0 |
cr_entry_hstate_concise(const struct city *pcity,
const void *data)
{
static char buf[4];
fc_snprintf(buf, sizeof(buf), "%s",
(city_celebrating(pcity) ? "*"
: (city_unhappy(pcity) ? "X" : " ")));
return buf;
} | false | false | false | false | false | 0 |
fd_set_to_pollfd (GstPoll * set, fd_set * readfds, fd_set * writefds,
fd_set * errorfds)
{
guint i;
g_mutex_lock (&set->lock);
for (i = 0; i < set->active_fds->len; i++) {
struct pollfd *pfd = &g_array_index (set->active_fds, struct pollfd, i);
if (pfd->fd < FD_SETSIZE) {
pfd->revents = 0;
... | false | false | false | false | false | 0 |
sky_at_glance_cb (GtkWidget *menuitem, gpointer data)
{
GtkSatModule *module = GTK_SAT_MODULE (data);
//GtkWidget *skg;
//GtkWidget *window;
gchar *buff;
/* if module is busy wait until done then go on */
g_mutex_lock(module->busy);
if (module->skgwin != NULL) {
/* t... | false | false | false | false | false | 0 |
export_ncommit (rev_list *rl)
{
rev_ref *h;
rev_commit *c;
int n = 0;
for (h = rl->heads; h; h = h->next) {
if (h->tail)
continue;
for (c = h->commit; c; c = c->parent) {
n++;
if (c->tail)
break;
}
}
return n;
} | false | false | false | false | false | 0 |
timblogiw_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{
struct video_device *vdev = video_devdata(file);
dev_dbg(&vdev->dev, "%s: Entry\n", __func__);
strncpy(cap->card, TIMBLOGIWIN_NAME, sizeof(cap->card)-1);
strncpy(cap->driver, DRIVER_NAME, sizeof(cap->driver) - 1);
snprintf(cap->bu... | false | false | false | false | false | 0 |
rb_frozen_class_p(klass)
VALUE klass;
{
char *desc = "something(?!)";
if (OBJ_FROZEN(klass)) {
if (FL_TEST(klass, FL_SINGLETON))
desc = "object";
else {
switch (TYPE(klass)) {
case T_MODULE:
case T_ICLASS:
desc = "module"; break;
case T_CLASS:
desc = "class"; break;
... | false | false | false | false | false | 0 |
xml_attr_new(const gchar *name, const gchar *value)
{
XMLAttr *new_attr;
new_attr = g_new(XMLAttr, 1);
new_attr->name = XML_STRING_ADD(name);
new_attr->value = g_strdup(value);
return new_attr;
} | false | false | false | false | false | 0 |
insn_emit_breakpoint(cpu_mips_t *cpu,mips64_jit_tcb_t *b)
{
m_uint64_t pc;
int i;
pc = b->start_pc+((b->mips_trans_pos-1)<<2);
for(i=0;i<MIPS64_MAX_BREAKPOINTS;i++)
if (pc == cpu->breakpoints[i]) {
mips64_emit_breakpoint(b);
break;
}
} | false | false | false | false | false | 0 |
writeAlignment(Bitext* b, FILE* dumpFile, int** backtrace, int bestFinalState,
int* numSourceAlignments, int** sourceAlignment, bool printNulls, bool printInOrder)
{
int targetLen = b->getTargetLength();
int sourceLen = b->getSourceLength();
int id = b->getId();
if (printInOrder){
for (int i=1; i<=s... | false | false | false | false | false | 0 |
AddToRecentFilesHistory(const wxString& FileName)
// ----------------------------------------------------------------------------
{
wxString filename = FileName;
#ifdef __WXMSW__
// for windows, look for case-insensitive matches
// if found, don't add it
wxString low = filename.Lower();
for (size_t ... | false | false | false | false | false | 0 |
PyCMOR_dataset(PyObject *self,PyObject *args)
{
char *outpath;
char *experiment_id;
char *institution;
char *source;
char *calendar;
int realization;
char *contact;
char *history;
char *comment;
char *references;
char *model_id;
char *forcing;
char *institute_id;
char *par... | false | false | false | false | false | 0 |
gwy_app_recent_file_find(const gchar *filename_utf8,
GtkTreeIter *piter,
GwyRecentFile **prf)
{
GtkTreeIter iter;
GwyRecentFile *rf;
gchar *filename_canon = gwy_canonicalize_path(filename_utf8);
if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(gcontrols... | false | false | false | false | false | 0 |
write_inner(const wchar_t *data, size_t len)
{
trace(("wide_output_expand::write_inner(this = %08lX, data = %08lX, "
"len = %ld)\n{\n", (long)this, (long)data, (long)len));
while (len > 0)
{
wchar_t wc = *data++;
--len;
switch (wc)
{
case L'\n':
case ... | false | false | false | false | false | 0 |
egg_list_box_apply_filter_all (EggListBox *list_box)
{
EggListBoxPrivate *priv = list_box->priv;
EggListBoxChildInfo *child_info;
GSequenceIter *iter;
for (iter = g_sequence_get_begin_iter (priv->children);
!g_sequence_iter_is_end (iter);
iter = g_sequence_iter_next (iter))
{
child_info... | false | false | false | false | false | 0 |
mkext(char *f, char *s)
#endif
{
Extsym *e = mkext1(f, s);
if (e->extstg == STGCOMMON)
errstr("%.52s cannot be a subprogram: it is a common block.",f);
return e;
} | false | false | false | false | false | 0 |
handle_vector_size_attribute (tree *node, tree name, tree args,
int ARG_UNUSED (flags),
bool *no_add_attrs)
{
unsigned HOST_WIDE_INT vecsize, nunits;
enum machine_mode orig_mode;
tree type = *node, new_type, size;
*no_add_attrs = true;
size = TREE_VALUE (args);
if (!host_integerp (size,... | false | false | false | false | false | 0 |
reinit_result_set_metadata(MYSQL_STMT *stmt)
{
/* Server has sent result set metadata */
if (stmt->field_count == 0)
{
/*
This is 'SHOW'/'EXPLAIN'-like query. Current implementation of
prepared statements can't send result set metadata for these queries
on prepare stage. Read it now.
*/
... | false | false | false | false | false | 0 |
sinfo_new_change_plist_image (cpl_propertylist * plist,
float center_x,
float center_y )
{
float pixelscale ;
double ra ;
double dec ;
double angle ;
float radangle ;
float cd1_1, cd1_2, cd2_1, cd2_2 ;
char firsttext[2*FILE_NAME_SZ] ;
int sign_swap = -1;
do... | false | false | false | false | false | 0 |
FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool read_only, FLAC__bool preserve_file_stats)
{
const char *tempfile_path_prefix = 0; /*@@@ search for comments near 'flac_rename(...)' for what it will take to finish implementing this */
FLAC__ASSERT(0 != ite... | false | false | false | false | false | 0 |
check_in3270(void)
{
enum cstate new_cstate = NOT_CONNECTED;
static const char *state_name[] = {
"unconnected",
"pending",
"connected initial",
"TN3270 NVT",
"TN3270 3270",
"TN3270E",
"TN3270E NVT",
"TN3270E SSCP-LU",
"TN3270E 3270"
};
if (myopts[TELOPT_TN3270E]) {
if (!tn3270e_negotiated)
n... | false | false | false | false | false | 0 |
gt_encseq_builder_add_cstr(GtEncseqBuilder *eb, const char *str,
unsigned long strlen, const char *desc)
{
unsigned long i, offset;
gt_assert(eb && str);
if (eb->plainseq && !eb->own) {
GtUchar *theirseq = eb->plainseq;
eb->plainseq = gt_malloc((size_t) eb->seqlen * sizeof ... | false | false | false | false | false | 0 |
gog_pie_plot_pref (GogPiePlot *pie, GOCmdContext *cc)
{
GtkBuilder *gui =
go_gtk_builder_load ("res:go:plot_pie/gog-pie-prefs.ui",
GETTEXT_PACKAGE, cc);
GtkWidget *w;
PiePrefState *state;
if (gui == NULL)
return NULL;
state = g_new0 (PiePrefState, 1);
state->gobj = GOG_OBJECT (... | false | false | false | false | false | 0 |
update (GtkSourceSearchContext *search)
{
GtkTextIter start;
GtkTextIter end;
if (dispose_has_run (search))
{
return;
}
clear_search (search);
update_regex (search);
search->priv->scan_region = gtk_text_region_new (search->priv->buffer);
gtk_text_buffer_get_bounds (search->priv->buffer, &start, &end);
a... | false | false | false | false | false | 0 |
dm_sm_metadata_create(struct dm_space_map *sm,
struct dm_transaction_manager *tm,
dm_block_t nr_blocks,
dm_block_t superblock)
{
int r;
dm_block_t i;
struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm);
smm->begin = superblock + 1;
smm->recursion_count = 0;
smm->allocated_this_trans... | false | true | false | false | false | 1 |
checkrare(LINK)
struct LOC_getlocations *LINK;
{
long i;
boolean check;
locusvalues *WITH;
check = false;
for (i = 0; i < mlocus; i++) {
if (nohom[i]) {
WITH = thislocus[i];
if (WITH->freq[LINK->hap1[i] - 1] < minfreq ||
WITH->freq[LINK->hap2[i] - 1] < minfreq)
check = true;
}
}
r... | false | false | false | false | false | 0 |
BindTargetSymbol(XmtInputFieldWidget iw)
#else
static void BindTargetSymbol(iw)
XmtInputFieldWidget iw;
#endif
{
if (iw->input_field.target_symbol_name) {
iw->input_field.target_symbol =
XmtLookupSymbol(iw->input_field.target_symbol_name);
if (!iw->input_field.target_symbol)
XmtWarningMsg("XmtInputFiel... | false | false | false | false | false | 0 |
sys_timeformat_compiletf(PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
if (argv) {
vpiHandle arg;
/* Check that the unit argument is numeric. */
if (! is_numeric_obj(vpi_scan(argv))) {
vpi_printf("ERROR: %s:... | false | false | false | false | false | 0 |
inputmode_utf8_get_char(GVInputModesData *imd, offset_type offset)
{
int value;
int len;
value = gv_input_mode_get_byte(imd, offset);
if (value<0)
return INVALID_CHAR;
if (!utf8_is_valid_char(imd, offset))
{
g_warning ("invalid UTF character at offset %lu (%02x)", offset,
... | false | false | false | false | false | 0 |
wasp_init_waspvm( int argc, const char* argv[] ){
wasp_init_core_subsystems( );
wasp_tc tc = wasp_make_tc( );
wasp_argc = 0;
int i;
for( i = 0; i < argc; i ++ ){
if( ! strcmp( argv[i], "-d" ) ){
WASP_T ++;
}else if( ! strcmp( argv[i], "-x" ) ){
wasp_abort_on... | false | false | false | false | false | 0 |
wm_hubs_add_analogue_routes(struct snd_soc_codec *codec,
int lineout1_diff, int lineout2_diff)
{
struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
hubs->codec = codec;
INIT_LIST_HEAD(&hubs->dcs_cache);
init_completion(&hubs->dcs_d... | false | false | false | false | false | 0 |
msg_create_syslog_with_locker(Locker *locker, const char *ident, int option, int facility, int priority)
{
MsgSyslogData *data;
Msg *mesg;
if (!(data = msg_sysdata_create(ident, option, facility, priority)))
return NULL;
if (!(mesg = msg_create_with_locker(locker, MSG_SYSLOG, msg_out_syslog, data, (msg_release_... | false | false | false | false | false | 0 |
Init( const char *bundle, unsigned long size )
{
if( size < 16 )
throw MalformedBundleException( "packet too short for bundle" );
if( (size & 0x03L) != 0 )
throw MalformedBundleException( "bundle size must be multiple of four" );
if( bundle[0] != '#'
|| bundle[1] != 'b'
|| ... | false | false | false | false | false | 0 |
ecryptfs_exit_linear_subgraph_tf(struct ecryptfs_ctx *ctx,
struct param_node *param_node,
struct val_node **mnt_params, void **foo)
{
struct val_node *curr;
uint32_t num_param_vals = 0;
struct key_mod_param_val *param_vals;
struct ecryptfs_subgraph_ctx *subgraph_ctx;
char *sig_mnt_opt;
char sig[ECRYPTFS... | true | true | false | false | false | 1 |
scenario_callback(void)
{
GtkTreeIter it;
char *filename;
if (!gtk_tree_selection_get_selected(scenario_selection, NULL, &it)) {
return;
}
gtk_tree_model_get(GTK_TREE_MODEL(scenario_store), &it, 1, &filename, -1);
load_filename(filename);
} | false | false | false | false | false | 0 |
gst_rtsp_connection_set_qos_dscp (GstRTSPConnection * conn, guint qos_dscp)
{
GstRTSPResult res;
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (conn->read_socket != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (conn->write_socket != NULL, GST_RTSP_EINVAL);
res = set_qos_dscp (co... | false | false | false | false | false | 0 |
lt_dlloader_name (place)
lt_dlloader *place;
{
const char *name = 0;
if (place)
{
LT_DLMUTEX_LOCK ();
name = place ? place->loader_name : 0;
LT_DLMUTEX_UNLOCK ();
}
else
{
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
}
return name;
} | false | false | false | false | false | 0 |
slurm_auth_marshal_args( void *hosts, int timeout )
{
static int hostlist_idx = -1;
static int timeout_idx = -1;
static int count = sizeof( auth_args ) / sizeof( struct _arg_desc ) - 1;
void **argv;
/* Get indices from descriptor, if we haven't already. */
if ( ( hostlis... | false | false | false | false | false | 0 |
terminal_screen_container_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
TerminalScreenContainer *container = TERMINAL_SCREEN_CONTAINER (object);
TerminalS... | false | false | false | false | false | 0 |
AddPortMappings(
std::vector<CUPnPPortMapping> &upnpPortMapping)
{
std::ostringstream msg;
if (!WanServiceDetected()) {
msg << "UPnP Error: "
"CUPnPControlPoint::AddPortMapping: "
"WAN Service not detected.";
AddLogLineU(true, logUPnP, msg);
return false;
}
int n = upnpPortMapping.size();
bool ok =... | false | false | false | false | false | 0 |
property_to_attribute (const gchar *prop_name, const gchar *interface,
CK_ATTRIBUTE_TYPE *attr_type, DataType *data_type)
{
g_return_val_if_fail (prop_name, FALSE);
g_assert (attr_type);
g_assert (data_type);
/* If an interface is desired, check that it matches, and remove */
if (interface)... | false | false | false | false | false | 0 |
hud_targetbox_subsystem_in_view(object *target_objp, int *sx, int *sy)
{
ship_subsys *subsys;
vec3d subobj_pos;
vertex subobj_vertex;
int rval = -1;
polymodel *pm;
subsys = Player_ai->targeted_subsys;
if (subsys != NULL ) {
get_subsystem_pos(&subobj_pos, target_objp, subsys);
// is it subsystem in view... | false | false | false | false | false | 0 |
mark_parents_as_used(Topform c)
{
Ilist parents = get_parents(c->justification, TRUE);
Ilist p;
for (p = parents; p; p = p->next) {
Topform parent = find_clause_by_id(p->i);
parent->used = TRUE;
}
zap_ilist(parents);
} | false | false | false | false | false | 0 |
OnKey(wxKeyEvent& event)
{//========================================
PHONEME_LIST *p;
int display=1;
if(selected_ph < 0)
selected_ph = 0;
p = &phlist[selected_ph];
switch(event.GetKeyCode())
{
case WXK_F2:
// make and play from this clause
MakeWave2(phlist,numph);
break;
case WXK_LEFT:
if(selecte... | false | false | false | false | false | 0 |
isprint(int x) {
unsigned char c=x&0xff;
return (c>=32 && c<=126) || (c>=160);
} | false | false | false | false | false | 0 |
tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)
{
pthread_t gtp_thread;
pthread_t ptg_thread;
int err;
int ret = 0;
err = pthread_create(>p_thread, NULL, udt_copy_task_routine,
&s->gtp);
if (err)
die("Can't start thread for copying data: %s", strerror(err));
err = pthread_create(&ptg_thread, ... | false | false | false | false | false | 0 |
next() {
switch (counter_++) {
case OLD_POINTER_SPACE:
return Heap::old_pointer_space();
case OLD_DATA_SPACE:
return Heap::old_data_space();
case CODE_SPACE:
return Heap::code_space();
case MAP_SPACE:
return Heap::map_space();
case CELL_SPACE:
return Heap::cell_space(... | false | false | false | false | false | 0 |
gegl_config_get_property (GObject *gobject,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GeglConfig *config = GEGL_CONFIG (gobject);
switch (property_id)
{
case PROP_CACHE_SIZE:
g_value_set_int (v... | false | false | false | false | false | 0 |
is_unified_ideograph(Py_UCS4 code)
{
return
(0x3400 <= code && code <= 0x4DB5) || /* CJK Ideograph Extension A */
(0x4E00 <= code && code <= 0x9FCC) || /* CJK Ideograph */
(0x20000 <= code && code <= 0x2A6D6) || /* CJK Ideograph Extension B */
(0x2A700 <= code && code <= 0x2B734)... | false | false | false | false | false | 0 |
gen8_ppgtt_notify_vgt(struct i915_hw_ppgtt *ppgtt, bool create)
{
enum vgt_g2v_type msg;
struct drm_device *dev = ppgtt->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
unsigned int offset = vgtif_reg(pdp0_lo);
int i;
if (USES_FULL_48BIT_PPGTT(dev)) {
u64 daddr = px_dma(&ppgtt->pml4);
I915_W... | false | false | false | false | false | 0 |
mx_gtk_light_switch_set_active (MxGtkLightSwitch *lightswitch,
gboolean active)
{
MxGtkLightSwitchPrivate *priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE (lightswitch);
if (priv->active == active)
{
return;
}
else
{
priv->active = active;
if (active ... | false | false | false | false | false | 0 |
dump_immediate_uses (FILE *file)
{
tree var;
unsigned int x;
fprintf (file, "Immediate_uses: \n\n");
for (x = 1; x < num_ssa_names; x++)
{
var = ssa_name(x);
if (!var)
continue;
dump_immediate_uses_for (file, var);
}
} | false | false | false | false | false | 0 |
fence_wait_timeout(struct fence *fence, bool intr, signed long timeout)
{
signed long ret;
if (WARN_ON(timeout < 0))
return -EINVAL;
if (timeout == 0)
return fence_is_signaled(fence);
trace_fence_wait_start(fence);
ret = fence->ops->wait(fence, intr, timeout);
trace_fence_wait_end(fence);
return ret;
} | false | false | false | false | false | 0 |
XGI_GetTVPtr(unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
unsigned short i, tempdx, tempal, modeflag;
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
tempal = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
tempal = tempal & 0x3f;
tempdx = ... | false | false | false | false | false | 0 |
addedToScene(bool temporary) {
loadTemplates();
if (this->scene()) {
setInitialSize();
}
Board::addedToScene(temporary);
} | false | false | false | false | false | 0 |
setImage(const QIcon &icon)
{
d->image = icon.pixmap(IconSize(KIconLoader::Desktop));
} | false | false | false | false | false | 0 |
checkValue ( const std::string& Field )
{
if ( !Section )
return true;
Element = Section->FindByName(Field);
return Element == NULL;
} | false | false | false | false | false | 0 |
new_task(const char *rawdn)
{
Slapi_Task *task = NULL;
char *dn = NULL;
if (rawdn == NULL) {
return NULL;
}
dn = slapi_create_dn_string("%s", rawdn);
if (NULL == dn) {
LDAPDebug1Arg(LDAP_DEBUG_ANY,
"new_task failed: invalid task dn: %s\n", rawdn);
... | false | false | false | false | false | 0 |
appledouble_rename(struct afp_volume * volume, const char * path_from,
const char * path_to)
{
int resource;
char * newpath;
/* You can't rename*/
resource = extra_translate(volume, path_to, &newpath);
free(newpath);
if (resource==0) return 0;
return -EPERM;
} | false | false | false | false | false | 0 |
mankanshoku_move(tenm_object *my, double turn_per_frame)
{
double dx_temp;
double dy_temp;
/* sanity check */
if (my == NULL)
{
fprintf(stderr, "mankanshoku_move: my is NULL\n");
return 0;
}
if (turn_per_frame <= 0.5)
{
fprintf(stderr, "mankanshoku_move: strange turn_per_frame (%f)\n",
... | false | false | false | false | false | 0 |
pages_trim(void *addr, size_t alloc_size, size_t leadsize, size_t size)
{
void *ret = (void *)((uintptr_t)addr + leadsize);
assert(alloc_size >= leadsize + size);
#ifdef _WIN32
{
void *new_addr;
pages_unmap(addr, alloc_size);
new_addr = pages_map(ret, size);
if (new_addr == ret)
return (ret);
if (new_... | false | false | false | false | false | 0 |
sock_getpeername(PySocketSockObject *s)
{
sock_addr_t addrbuf;
int res;
socklen_t addrlen;
if (!getsockaddrlen(s, &addrlen))
return NULL;
memset(&addrbuf, 0, addrlen);
Py_BEGIN_ALLOW_THREADS
res = getpeername(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
Py_END_ALLOW_THREADS
if (... | false | false | false | false | false | 0 |
produce()
{
if ( selected ) {
finallySelected = selected;
quitModalLoop(0);
return true;
} else
return false;
} | false | false | false | false | false | 0 |
gsd_keyboard_manager_stop (GsdKeyboardManager *manager)
{
GsdKeyboardManagerPrivate *p = manager->priv;
g_debug ("Stopping keyboard manager");
if (p->dbus_own_name_id) {
g_bus_unown_name (p->dbus_own_name_id);
p->dbus_own_name_id = 0;
}
if (p->d... | false | false | false | false | false | 0 |
drawPartialBlockImage(RGBAImage& dest, const ImageRect& drect, const RGBAImage& tiles, int Nface, int Wface, int Uface, int B, double fraction, int rot, int flip)
{
int tilesize = 2*B;
// determine how many pixels to chop off the top of the N and W faces
int cutoff = max(0, min(tilesize - 1, (int)(fraction * til... | false | false | false | false | false | 0 |
kdb_ss(int argc, const char **argv)
{
if (argc != 0)
return KDB_ARGCOUNT;
/*
* Set trace flag and go.
*/
KDB_STATE_SET(DOING_SS);
return KDB_CMD_SS;
} | false | false | false | false | false | 0 |
lba_to_arena(struct btt *btt, sector_t sector, __u32 *premap,
struct arena_info **arena)
{
struct arena_info *arena_list;
__u64 lba = div_u64(sector << SECTOR_SHIFT, btt->sector_size);
list_for_each_entry(arena_list, &btt->arena_list, list) {
if (lba < arena_list->external_nlba) {
*arena = arena_list;
*... | false | false | false | false | false | 0 |
gf_sc_set_fps(GF_Compositor *compositor, Double fps)
{
if (fps) {
compositor->frame_rate = fps;
compositor->frame_duration = (u32) (1000 / fps);
gf_sc_reset_framerate(compositor);
}
} | false | false | false | false | false | 0 |
is_kill_allowed(server_rec * main_server, fcgid_procnode * procnode)
{
struct fcgid_stat_node *current_node;
if (!g_stat_pool || !procnode)
return 0;
/* Can I find the node base on inode, device id and cmdline? */
for (current_node = g_stat_list_header;
current_node != NULL; current_n... | false | false | false | false | false | 0 |
replace_unprintable_chars(char *buf) {
char *p;
for (p = buf; *p != '\0'; p++) {
if (*p < ' ') {
*p = ' ';
}
}
} | false | false | false | false | false | 0 |
DeleteOversizedParts() {
int num = 0, i;
for (i = 0; i < MAX_MBR_PARTS; i++) {
if ((partitions[i].GetStartLBA() > diskSize) || (partitions[i].GetLastLBA() > diskSize) ||
(partitions[i].GetStartLBA() > UINT32_MAX) || (partitions[i].GetLengthLBA() > UINT32_MAX)) {
cerr << "\aWarning: Delet... | false | false | false | false | false | 0 |
update(const struct timeval *tv)
{
m_timer.stop();
if (tv) {
AvahiUsec u = avahi_age(tv)/1000;
#ifdef QT4
m_timer.start( (u>0) ? 0 : -u);
#else
m_timer.start( (u>0) ? 0 : -u,true);
#endif
}
} | false | false | false | false | false | 0 |
OSSCaptureProc(ALvoid *ptr)
{
ALCdevice *pDevice = (ALCdevice*)ptr;
oss_data *data = (oss_data*)pDevice->ExtraData;
int frameSize;
int amt;
SetRTPriority();
frameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType);
while(!data->killNow)
{
amt = read(data->fd, data-... | false | true | false | false | true | 1 |
numeral_encode(FILE *fp, int num)
{
if (num == atoi(RENGO_ID)) fputc(0xff, fp);
else if (num < 0xf0-0x20) fputc(num+0x20, fp);
else {
fputc(num/(0xf0-0x20)+0xf0, fp);
fputc(num%(0xf0-0x20)+0x20, fp);
}
} | false | false | false | false | false | 0 |
eet_node_dump(Eet_Node *n,
int dumplevel,
Eet_Dump_Callback dumpfunc,
void *dumpdata)
{
Eet_Node *it;
if (!n)
return;
switch (n->type)
{
case EET_G_VAR_ARRAY:
case EET_G_ARRAY:
case EET_G_UNKNOWN:
ca... | false | false | false | false | false | 0 |
pnpacpi_encode_fixed_io(struct pnp_dev *dev,
struct acpi_resource *resource,
struct resource *p)
{
struct acpi_resource_fixed_io *fixed_io = &resource->data.fixed_io;
if (pnp_resource_enabled(p)) {
fixed_io->address = p->start;
fixed_io->address_length = resource_size(p);
} else {
fixed_io->ad... | false | false | false | false | false | 0 |
gck_mock_C_FindObjectsInit (CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate,
CK_ULONG ulCount)
{
Session *session;
FindObjects ctx;
session = g_hash_table_lookup (the_sessions, GUINT_TO_POINTER (hSession));
g_return_val_if_fail (session != NULL, CKR_SESSION_HANDLE_INVALID);
/* ... | false | false | false | false | false | 0 |
next_rule(void)
{
struct rule *rule;
/* Open conf file if we didn't do it yet */
if (!G.parser && G.filename) {
dbg3("config_open('%s')", G.filename);
G.parser = config_open2(G.filename, fopen_for_read);
G.filename = NULL;
}
if (G.rule_vec) {
/* mdev -s */
/* Do we have rule parsed already? */
if (G.... | false | false | false | false | false | 0 |
MSD(aset Ast, Ivector T){
Aset_I A; /* internal representation of Ast*/
Cell_I C; /* internal rep of target cell */
int i=1; /* how many fields of C speceifed*/
node Normals=0; /* output normals list */
int mv=0; /* total mixed vo... | false | false | false | false | false | 0 |
matrix_t_float (float* Y,const float* X,size_t n,size_t m)
{
size_t i,j;
for (j=0;j<m;j++)
for (i=0;i<n;i++)
Y[j+i*m] = X[i+j*n];
} | false | false | false | false | false | 0 |
build_rle_row(ubyte *r, int n_pixels, int bytes_per_pixel,
int compress, ubyte *buff, int *byte_count, int binary, int order, int compact)
{
int i;
if (compress) {
if (bytes_per_pixel==1)
encode_8bit_row(r, n_pixels, buff, byte_count, binary, order, compact);
... | false | false | false | false | false | 0 |
dGeomTriMeshDataSet(dTriMeshDataID g, int data_id, void* in_data)
{
dUASSERT(g, "argument not trimesh data");
switch (data_id)
{
case TRIMESH_FACE_NORMALS:
g->Normals = (dReal *) in_data;
break;
default:
dUASSERT(data_id, "invalid data type");
break;
}
return;
} | false | false | false | false | false | 0 |
IndexCheckExclusion(Relation heapRelation,
Relation indexRelation,
IndexInfo *indexInfo)
{
HeapScanDesc scan;
HeapTuple heapTuple;
Datum values[INDEX_MAX_KEYS];
bool isnull[INDEX_MAX_KEYS];
List *predicate;
TupleTableSlot *slot;
EState *estate;
ExprContext *econtext;
/*
* If we are reindex... | false | false | false | false | false | 0 |
init_fill(bg_typ, fg_typ)
schar bg_typ, fg_typ;
{
register int i,j;
long limit, count;
limit = (WIDTH * HEIGHT * 2) / 5;
count = 0;
while(count < limit) {
i = rn1(WIDTH-1, 2);
j = rnd(HEIGHT-1);
if (levl[i][j].typ == bg_typ) {
levl[i][j].typ = fg_typ;
count++;
}
}
} | false | false | false | false | false | 0 |
enumerate(wrapper_enumerator_t *this, certificate_t **cert)
{
auth_rule_t rule;
certificate_t *current;
public_key_t *public;
while (this->inner->enumerate(this->inner, &rule, ¤t))
{
if (rule == AUTH_HELPER_IM_HASH_URL ||
rule == AUTH_HELPER_SUBJECT_HASH_URL)
{ /* on-demand fetching of hash and url c... | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Field name: ";
if (this->FieldName)
{
os << this->FieldName << endl;
}
else
{
os << "(none)" << endl;
}
os << indent << "Field location: " << this->FieldLocation << endl;
os << indent ... | false | false | false | false | false | 0 |
groupTypeSelected(QAction* a)
{
selectedGroupType( (ProfileContext::Type) a->data().toInt() );
} | false | false | false | false | false | 0 |
orf_attach_results_to_gff3(GtFeatureNode *gf,
GtRange orf_rng, unsigned int orf_frame,
GtStrand strand, GT_UNUSED GtError *err)
{
GtGenomeNode *child;
GtStr *tag;
tag = gt_str_new_cstr(GT_ORF_FINDER_TAG);
orf_rng.start++; orf_rng.end... | true | true | false | false | false | 1 |
QCC_PR_CheakCompConstString(char *def)
{
char *s;
CompilerConstant_t *c;
c = pHash_Get(&compconstantstable, def);
if (c)
{
s = QCC_PR_CheakCompConstString(c->value);
return s;
}
return def;
} | false | false | false | false | false | 0 |
dwc2_frame_list_free(struct dwc2_hsotg *hsotg)
{
u32 *frame_list;
dma_addr_t frame_list_dma;
unsigned long flags;
spin_lock_irqsave(&hsotg->lock, flags);
if (!hsotg->frame_list) {
spin_unlock_irqrestore(&hsotg->lock, flags);
return;
}
frame_list = hsotg->frame_list;
frame_list_dma = hsotg->frame_list_dma... | false | false | false | false | false | 0 |
seek_position(SAMPLE_SPECS::sample_pos_t pos)
{
if (is_open() == true) {
off_t curpos_rep = pos * frame_size();
DBC_CHECK(curpos_rep >= 0);
/* fseeko doesn't seem to work with glibc 2.1.x */
#if _FILE_OFFSET_BITS==64
off_t seekpos = 0;
off_t seekstep = 0;
int whence = SEEK_SET;
while(curpos_re... | 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.