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 |
|---|---|---|---|---|---|---|
impl_constructed (GObject *object)
{
RBDisplayPageMenu *menu;
RB_CHAIN_GOBJECT_METHOD (rb_display_page_menu_parent_class, constructed, object);
menu = RB_DISPLAY_PAGE_MENU (object);
g_signal_connect (menu->priv->real_model, "row-inserted", G_CALLBACK (row_inserted_cb), menu);
g_signal_connect (menu->priv->real_... | false | false | false | false | false | 0 |
CopyStuff( NumericData const &rhs )
{
data_.assign( rhs.data_.begin(), rhs.data_.end() );
scalarType_ = rhs.scalarType_;
for( std::size_t i=0; i<3; ++i )dimMag_[i] = rhs.dimMag_[i];
numberOfDimensions_ = rhs.numberOfDimensions_;
orderType_ = rhs.orderType_;
lowLimit_ = rhs.lowLimit_;
lowLimitSet_ = rhs.lo... | false | false | false | false | false | 0 |
buildin_getequipisequiped(struct script_state *st)
{
int num, i = -1;
struct map_session_data *sd;
num=conv_num(st,& (st->stack->stack_data[st->start+2]));
sd=script_rid2sd(st);
if(num > 0 && num <= EQUIP_INDEX_MAX)
i=pc_checkequip(sd,equip_pos[num-1]);
if(i >= 0){
push_val(st->stack,C_INT,1);
}else{
pus... | false | false | false | false | false | 0 |
bfa_iocfc_reset_queues(struct bfa_s *bfa)
{
int q;
for (q = 0; q < BFI_IOC_MAX_CQS; q++) {
bfa_reqq_ci(bfa, q) = 0;
bfa_reqq_pi(bfa, q) = 0;
bfa_rspq_ci(bfa, q) = 0;
bfa_rspq_pi(bfa, q) = 0;
}
} | false | false | false | false | false | 0 |
Redo (Component* comp, int n) {
UList* past, *future;
GetHistory(comp, past, future);
UList* cur = future->First();
for (int i = 0; i < n && cur != future->End(); ++i) {
Command* cmd = command(cur);
cmd->Execute();
future->Remove(cur);
past->Prepend(cur);
cur = f... | false | false | false | false | false | 0 |
cl_repo_get_bool(git_repository *repo, const char *cfg)
{
int val = 0;
git_config *config;
cl_git_pass(git_repository_config(&config, repo));
if (git_config_get_bool(&val, config, cfg) < 0)
giterr_clear();
git_config_free(config);
return val;
} | false | false | false | false | false | 0 |
gap_story_stb_elem_properties_dialog ( GapStbTabWidgets *tabw
, GapStoryElem *stb_elem
, GapStoryBoard *stb_dst)
{
GapStbPropWidget *pw;
gint idx;
/* check if already open */
for(pw=tabw->pw; pw!=NULL; pw=(GapStbPropWidget *)pw->next)
... | false | false | false | false | false | 0 |
gcd_percentile(gc_depth_t *gcd, int N, int p)
{
float n,d;
int k;
n = p*(N+1)/100;
k = n;
if ( k<=0 )
return gcd[0].depth;
if ( k>=N )
return gcd[N-1].depth;
d = n - k;
return gcd[k-1].depth + d*(gcd[k].depth - gcd[k-1].depth);
} | false | false | false | false | false | 0 |
ProcessStructError( INCHI_IOSTREAM *output_file, INCHI_IOSTREAM *log_file, /*int err,*/
char *pStrErrStruct, int nErrorType,
int *bXmlStructStarted, long num_inp, INPUT_PARMS *ip, char *pStr, int nStrLen )
{
int b_ok;
#ifdef INCHI_LIB
int bPlainText = (ip->bINChI... | false | false | false | false | false | 0 |
do_stolen_accounting(void)
{
struct vcpu_runstate_info state;
struct vcpu_runstate_info *snap;
s64 runnable, offline, stolen;
cputime_t ticks;
get_runstate_snapshot(&state);
WARN_ON(state.state != RUNSTATE_running);
snap = this_cpu_ptr(&xen_runstate_snapshot);
/* work out how much time the VCPU has not been... | false | false | false | false | false | 0 |
setPercentage(bool show)
{
if (GlobalConfig::showPercentage() == show) return;
if (_percentageToggleAction->isChecked() != show)
_percentageToggleAction->setChecked(show);
_expandedToggleAction->setEnabled(show);
GlobalConfig::setShowPercentage(show);
_partSelection->notifyChange(TraceItemView::co... | false | false | false | false | false | 0 |
OnSocketEvent(CSocketEvent& event)
{
switch (event.GetType())
{
case CSocketEvent::hostaddress:
{
const wxString& address = event.GetData();
m_pOwner->LogMessage(Status, _("Connecting to %s..."), address.c_str());
}
case CSocketEvent::connection_next:
if (event.GetError())
m_pOwner->LogMessage(Status... | false | false | false | false | false | 0 |
_updateRenderQueue(RenderQueue* queue)
{
if (mVisible)
{
queue->addRenderable(this, RENDER_QUEUE_OVERLAY, mZOrder);
}
} | false | false | false | false | false | 0 |
isUndefCopy(MachineInstr *MI, unsigned Reg,
const TargetInstrInfo *tii_,
SmallSet<unsigned, 8> &ImpDefRegs) {
if (MI->isCopy()) {
MachineOperand &MO0 = MI->getOperand(0);
MachineOperand &MO1 = MI->getOperand(1);
if (MO1.getReg() != Reg)
return false;
... | false | false | false | false | false | 0 |
drawclipped (Canvas* c, Coord l, Coord b, Coord r, Coord t) {
if (parent() == nil) {
drawclipped_gs(c, l, b, r, t, this);
} else {
Graphic31 gs;
total_gs(gs);
drawclipped_gs(c, l, b, r, t, &gs);
}
} | false | false | false | false | false | 0 |
close()
{
if(current == 0)
return;
unsigned count = current->header.number_of_chains;
if (count < 1) count = 1;
for(unsigned i = 0; i < count; ++i)
{
if (images != NULL)
{
current = &images[i];
for(unsigned j = 0; j < current->header.flb_count; ++j)
... | false | false | false | false | false | 0 |
do_test_geodetic_geocentric(const TGeodeticCoords c1)
{
TGeocentricCoords geo1;
mrpt::topography::geodeticToGeocentric(c1,geo1, TEllipsoid::Ellipsoid_WGS84() );
TGeodeticCoords c2;
mrpt::topography::geocentricToGeodetic(geo1, c2, TEllipsoid::Ellipsoid_WGS84() );
EXPECT_NEAR( c1.lat,c2.lat, 1e-8 );
EXPECT_NEA... | false | false | false | false | false | 0 |
gr_scan(const char *line)
{
struct group gr;
char *line_copy;
struct group *new_gr;
if ((line_copy = strdup(line)) == NULL)
return (NULL);
if (!__gr_scan(line_copy, &gr)) {
free(line_copy);
return (NULL);
}
new_gr = gr_dup(&gr);
free(line_copy);
if (gr.gr_mem != NULL)
free(gr.gr_mem);
return (new_gr... | false | false | false | false | false | 0 |
gst_siren_dec_finalize (GObject * object)
{
GstSirenDec *dec = GST_SIREN_DEC (object);
GST_DEBUG_OBJECT (dec, "Finalize");
Siren7_CloseDecoder (dec->decoder);
g_object_unref (dec->adapter);
G_OBJECT_CLASS (parent_class)->finalize (object);
} | false | false | false | false | false | 0 |
GetPostBuildCommands(ProjectBuildTarget* target) const
{
Compiler* compiler = target ? CompilerFactory::GetCompiler(target->GetCompilerID()) : m_pCompiler;
wxArrayString buildcmds = target ? target->GetCommandsAfterBuild() : m_pProject->GetCommandsAfterBuild();
if (!buildcmds.IsEmpty())
{
wxStri... | false | false | false | false | false | 0 |
LessPreciseFPMAD() { return UnsafeFPMath || LessPreciseFPMADOption; } | false | false | false | false | false | 0 |
vmx_set_interrupt_shadow(struct kvm_vcpu *vcpu, int mask)
{
u32 interruptibility_old = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO);
u32 interruptibility = interruptibility_old;
interruptibility &= ~(GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS);
if (mask & KVM_X86_SHADOW_INT_MOV_SS)
interruptibility |= GUEST_INT... | false | false | false | false | false | 0 |
va_expand_one_oc( const char *dn, const Slapi_Attr *a, Slapi_ValueSet *vs, const char *ocs )
{
struct objclass *this_oc, *sup_oc;
int p;
Slapi_Value **va = vs->va;
this_oc = oc_find_nolock( ocs, NULL, PR_FALSE );
if ( this_oc == NULL ) {
return; /* skip unknown object classes */
}
if ( this_oc->oc_su... | false | false | false | false | false | 0 |
bcf_empty1(bcf1_t *v)
{
bcf_clear1(v);
free(v->d.id);
free(v->d.als);
free(v->d.allele); free(v->d.flt); free(v->d.info); free(v->d.fmt);
if (v->d.var ) free(v->d.var);
free(v->shared.s); free(v->indiv.s);
} | false | false | false | false | false | 0 |
L7()
{register object *base=vs_base;
register object *sup=base+VM7; VC7
vs_check;
{object V39;
register object V40;
V39=(base[0]);
V40=(base[1]);
vs_top=sup;
goto TTL;
TTL:;
{object V41;
V41= ((V40))->v.v_self[(long)26];
base[3]= CMPcar((V41));
base[4]= elt((V40),(long)24);
base[6]= (V39);
base[7]= (V40);... | false | false | false | false | false | 0 |
get_sequence(u8 **walk)
{
int pv_indx = 0;
bool retval = FALSE; /* "Abnormal Completion" indicator */
bool ready_to_parse = FALSE;
char next_ch;
char pval[3];
#ifdef DEBUG_SCANNER
printf("%s:%d: debug: hex field:", iname, lineno);
#endif
pval[2]=0;
while ( pc < end )
{
next_ch = ... | true | true | false | false | false | 1 |
rfbScalingFind(rfbClientPtr cl, int width, int height)
{
rfbScreenInfoPtr ptr;
/* include the original in the search (ie: fine 1:1 scaled version of the frameBuffer) */
for (ptr=cl->screen; ptr!=NULL; ptr=ptr->scaledScreenNext)
{
if ((ptr->width==width) && (ptr->height==height))
retu... | false | false | false | false | false | 0 |
writeXMLToStream(XMLSerializer& xml_stream) const
{
xml_stream.openTag("Image")
.attribute("Name", d_name)
.attribute("XPos", PropertyHelper::uintToString(static_cast<uint>(d_area.d_left)))
.attribute("YPos", PropertyHelper::uintToString(static_cast<uint>(d_area.d_top)))
.attribute("... | false | false | false | false | false | 0 |
kate_streamheader_to_codecdata (const GValue * streamheader,
GstMatroskaTrackContext * context)
{
GstBuffer *buf0 = NULL;
if (!xiphN_streamheader_to_codecdata (streamheader, context, &buf0, -1))
return FALSE;
if (buf0 == NULL || GST_BUFFER_SIZE (buf0) < 64) { /* Kate ID header is 64 bytes */
GST_... | false | false | false | false | false | 0 |
hpfs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
int ret;
*pagep = NULL;
ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
hpfs_get_block,
&hpfs_i(mapping->host)->mmu_private);
if (un... | false | false | false | false | false | 0 |
gst_alpha_get_unit_size (GstBaseTransform * btrans,
GstCaps * caps, guint * size)
{
GstVideoFormat format;
gint width, height;
if (!gst_video_format_parse_caps (caps, &format, &width, &height))
return FALSE;
*size = gst_video_format_get_size (format, width, height);
GST_DEBUG_OBJECT (btrans, "unit ... | false | false | false | false | false | 0 |
ppc32_op_update_flags(ppc32_jit_tcb_t *b,jit_op_t *op)
{
if (op->param[0] != JIT_OP_INV_REG)
ppc32_update_cr(b,op->param[0],op->param[1]);
} | false | false | false | false | false | 0 |
on_status_received (const std::string uri,
const std::string status)
{
uri_infos[uri].status = status;
status_received (uri, status);
} | false | false | false | false | false | 0 |
backward(struct link_node **tree,
struct link_node *node,
struct link_node **target,
int *nopen,
int *nres)
{
struct link_node *p, *start, *temp_p;
BOOLEAN left_most, target_here;
if (node->first_child)
{
printf("attempted to back up from a node with a child\n");
exit(ABE... | false | false | false | false | false | 0 |
r600_mip_minify(unsigned size, unsigned level)
{
unsigned val;
val = max(1U, size >> level);
if (level > 0)
val = roundup_pow_of_two(val);
return val;
} | false | false | false | false | false | 0 |
set_signal(int sig, void (*sig_handler)(int))
{
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = sig_handler;
sa.sa_flags |= SA_RESTART;
if (sigaction(sig, &sa, 0) == -1) {
syslog(LOG_ERR, "sigaction(): %m");
exit(1);
}
} | false | false | false | false | false | 0 |
minor_free(ulong minor)
{
ulong flags;
minor /= AOE_PARTITIONS;
BUG_ON(minor >= N_DEVS);
spin_lock_irqsave(&used_minors_lock, flags);
BUG_ON(!test_bit(minor, used_minors));
clear_bit(minor, used_minors);
spin_unlock_irqrestore(&used_minors_lock, flags);
} | false | false | false | false | false | 0 |
set_str( set a )
#else
set_str( a )
set a;
#endif
{
/* Fast convert set a into ASCII char string...
assumes that all word bits are used in the set
and that SETSIZE is a multiple of WORDSIZE.
Trailing 0 bits are removed from the string.
if no bits are on or set is empty, "" is returned.
*/
register un... | false | false | false | false | false | 0 |
swapstring(char *foo, int doit)
{
if (doit)
{
char a = foo[0], b = foo[1], c = foo[2], d = foo[3];
foo[0] = d; foo[1] = c; foo[2] = b; foo[3] = a;
}
} | false | false | false | false | false | 0 |
ldapu_list_free (LDAPUList_t *list, LDAPUListNodeFn_t free_fn)
{
if (list) {
auto LDAPUListNode_t *node = list->head;
while (node) {
auto LDAPUListNode_t *next = node->next;
if (free_fn) {
(*free_fn)(node->info, 0);
node->info = 0;
}
node->info = 0;
free(node);
node = next;
}
l... | false | false | false | false | false | 0 |
iff_end_read_chunk()
{
ILuint end;
int part;
end = chunkStack[chunkDepth].start + chunkStack[chunkDepth].size + 8;
if (chunkStack[chunkDepth].chunkType != 0) {
end += 4;
}
// Add padding
part = end % 4;
if (part != 0) {
end += 4 - part;
}
iseek(end, IL_SEEK_SET);
chunkDepth--;
} | false | false | false | false | false | 0 |
after_put_font (ExcelWriteFont *f, gboolean was_added, gint index, gconstpointer dummy)
{
if (was_added) {
d (1, g_printerr ("Found unique font %d - %s\n",
index, excel_font_to_string (f)););
} else
excel_font_free (f);
} | false | false | false | false | false | 0 |
eth_pull ( struct net_device *netdev __unused, struct io_buffer *iobuf,
const void **ll_dest, const void **ll_source,
uint16_t *net_proto, unsigned int *flags ) {
struct ethhdr *ethhdr = iobuf->data;
/* Sanity check */
if ( iob_len ( iobuf ) < sizeof ( *ethhdr ) ) {
DBG ( "Ethernet packet too shor... | false | false | false | false | false | 0 |
binomial (int n, unsigned int pow)
{
Polynomial p;
int i, npow;
npow = 1;
for (i = (signed) pow; i >= 0; --i) {
p[i] = Math::choose (pow, i) * npow;
npow *= n;
}
return p;
} | false | false | false | false | false | 0 |
addPartItem(ModelPart * modelPart, ViewLayer::ViewLayerPlacement viewLayerPlacement, PaletteItem * paletteItem, bool doConnectors, bool & ok, ViewLayer::ViewID viewID, bool temporary) {
if (viewID == ViewLayer::PCBView && Board::isBoard(modelPart)) {
requestQuoteSoon();
}
return SketchWidget::addPar... | false | false | false | false | false | 0 |
sylk_write_sheet (SylkWriter *state)
{
GnmRange extent;
/* collect style and font info */
extent = sheet_get_extent (state->sheet, FALSE, TRUE);
sheet_style_foreach (state->sheet,
(GFunc)cb_sylk_collect_styles, state);
sheet_cell_foreach (state->sheet,
(GHFunc)cb_sylk_collect_cell_styles, state);
... | false | false | false | false | false | 0 |
libgnac_gstu_make_pipeline_element(GstElement *bin,
const gchar *element,
const gchar *name,
GError **error)
{
GstElement *elem = gst_element_factory_make(element, name);
if (!elem) {
libgnac_debug(... | false | false | false | false | false | 0 |
Read(const char *_fileName)
{
if(META_DEBUG)
{
METAIO_STREAM::cout << "MetaForm: Read" << METAIO_STREAM::endl;
}
if(_fileName != NULL)
{
strcpy(m_FileName, _fileName);
}
METAIO_STREAM::ifstream * tmpReadStream = new METAIO_STREAM::ifstream;
#ifdef __sgi
tmpReadStream->open(m_FileName... | false | false | false | false | false | 0 |
make_postulate (POSTULATE_T ** p, MOID_T * a, MOID_T * b)
{
POSTULATE_T *new_one;
if (top_postulate_list != NO_POSTULATE) {
new_one = top_postulate_list;
FORWARD (top_postulate_list);
} else {
new_one = (POSTULATE_T *) get_temp_heap_space ((size_t) ALIGNED_SIZE_OF (POSTULATE_T));
new_postulates++;... | false | false | false | false | false | 0 |
configfs_do_nothing(struct usb_composite_dev *cdev)
{
WARN_ON(1);
return -EINVAL;
} | false | false | false | false | false | 0 |
setIdColAcol() {
// Flavours and colours are trivial.
setId( id1, id2, 21, 22);
setColAcol( 1, 2, 2, 3, 1, 3, 0, 0);
if (rndmPtr->flat() > 0.5) swapColAcol();
} | false | false | false | false | false | 0 |
initialize(ErrorHandler *errh)
{
Vector<String> conf;
cp_argvec(configuration(), conf);
for (int i = 0; i < conf.size(); i++) {
Vector<String> words;
cp_spacevec(conf[i], words);
if (words.size() == 0 || !words[0].equals("CHECK_OVERLAP", 13))
continue;
int offset;
Vector<int> offsets(words.size()... | false | false | false | false | false | 0 |
getColors() const {
hsTArray<unsigned int> colors;
colors.setSize(fNumVerts);
switch (fEncoding.getCode() & plSpanEncoding::kColMask) {
case plSpanEncoding::kColA8:
{
unsigned char* cp = fCol;
for (unsigned int i=0; i<fNumVerts; i++) {
colors[i] = *cp << ... | false | false | false | false | false | 0 |
sftk_Attribute2SecItem(PLArenaPool *arena,SECItem *item,SFTKObject *object,
CK_ATTRIBUTE_TYPE type)
{
int len;
SFTKAttribute *attribute;
attribute = sftk_FindAttribute(object, type);
if (attribute == NULL) return CKR_TEMPLATE_INCOMPLETE;
len = attribute->attrib.ulValueLen;
if (arena) {
... | false | false | false | false | false | 0 |
tracker_needle_info_bar_closed (TrackerNeedle* self, GtkButton* source) {
GtkInfoBar* _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (source != NULL);
_tmp0_ = self->priv->info_bar;
gtk_widget_hide ((GtkWidget*) _tmp0_);
} | false | false | false | false | false | 0 |
print ()
{
printf ("%4d fe:fd:80:00:0%1x:%02x %c %-8.8s %-10.10s %02x %s%s%d\n",
id,
id >> 8, id & 0xff,
compress ? 'Y' : 'N',
connectmode == C_ONDEMAND ? "ondemand"
: connectmode == C_NEVER ? "never"
: connectmode == C_ALWAYS ? "always"
... | false | false | false | false | false | 0 |
getANDriOpcode(bool IsLP64, int64_t Imm) {
if (IsLP64) {
if (isInt<8>(Imm))
return X86::AND64ri8;
return X86::AND64ri32;
}
if (isInt<8>(Imm))
return X86::AND32ri8;
return X86::AND32ri;
} | false | false | false | false | false | 0 |
devfreq_resume_device(struct devfreq *devfreq)
{
if (!devfreq)
return -EINVAL;
if (!devfreq->governor)
return 0;
return devfreq->governor->event_handler(devfreq,
DEVFREQ_GOV_RESUME, NULL);
} | false | false | false | false | false | 0 |
null_device_start (Device * pself, DeviceAccessMode mode,
char * label, char * timestamp) {
NullDevice * self;
self = NULL_DEVICE(pself);
if (device_in_error(self)) return FALSE;
pself->access_mode = mode;
g_mutex_lock(pself->device_mutex);
pself->in_file = FALSE;
g_mute... | false | false | false | false | false | 0 |
ibvs_plft_map_get(
IN ibvs_t* const p_ibvs,
IN uint16_t lid,
IN uint8_t upper_ports,
OUT ib_vs_t *p_vs_mad)
{
osm_mad_addr_t mad_addr;
osm_madw_t *p_madw;
ib_api_status_t status;
osm_madw_t *p_madw_arr[1];
uint32_t attr_mod = 0;
OSM_LOG_ENTER(&(IbisObj.log));
osm_log(&(IbisO... | false | false | false | false | false | 0 |
seen_include (BusConfigParser *parser,
const DBusString *file)
{
DBusList *iter;
iter = parser->included_files;
while (iter != NULL)
{
if (! strcmp (_dbus_string_get_const_data (file), iter->data))
return TRUE;
iter = _dbus_list_get_next_link (&parser->included_files, iter);
}
re... | false | false | false | false | false | 0 |
filepathutil_addslash(ucs2_char_t* path)
{
size_t length = ucs2len(path);
if (length > 0) {
if (path[length-1] != PATHCHAR) {
/* Append PATHCHAR to path. */
path[length++] = PATHCHAR;
path[length] = 0;
}
}
return (path + length);
} | false | false | false | false | false | 0 |
set_current(int ch, float i, float *v)
{
// Sets CTMU current 'i' on a channel 'ch' and returns the voltage measured across the load.
// Allowed values of current are .55, 5.5, 55 and 550 micro ampleres. ch=0 puts CTMU Off.
byte res[2], irange;
int iv;
if(i > 500) // 550 uA range
irange = 0;
else if(i > 5... | false | false | false | false | false | 0 |
qat_uclo_map_image_page(struct icp_qat_uof_encap_obj
*encap_uof_obj,
struct icp_qat_uof_image *img,
struct icp_qat_uclo_encap_page *page)
{
struct icp_qat_uof_code_page *code_page;
struct icp_qat_uof_code_area *code_area;
struct icp_qat_uof_objtable *uword_block_tab;
struct icp_qat_uof_uw... | false | false | false | false | false | 0 |
stock_toggled (GtkWidget * widget, GladeButtonEditor * button_editor)
{
GladeProperty *property;
GladeWidget *gwidget = glade_editable_loaded_widget (GLADE_EDITABLE (button_editor));
if (glade_editable_loading (GLADE_EDITABLE (button_editor)) || !gwidget)
return;
if (!gtk_toggle_button_get_active
(G... | false | false | false | false | false | 0 |
loadFromSettings()
{
QSettings settings;
// restore generator
settings.beginGroup("Settings/StartPath");
QString lastGen = settings.value("LastGenerator").toString();
this->mStartCompilerSetupPage->setCurrentGenerator(lastGen);
settings.endGroup();
// restore compiler setup
settings.beginGroup("Setting... | false | false | false | false | false | 0 |
gcut_process_run (GCutProcess *process, GError **error)
{
GCutProcessPrivate *priv;
gboolean success;
gint input_fd = 0, output_fd = 0, error_fd = 0;
gchar **env;
GCutEventLoop *loop;
priv = GCUT_PROCESS_GET_PRIVATE(process);
if (!priv->command) {
g_set_error(error, GCUT_PROCESS_ER... | false | false | false | false | false | 0 |
focus(Client *c) {
if(!c || !ISVISIBLE(c))
for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
/* was if(selmon->sel) */
if(selmon->sel && selmon->sel != c)
unfocus(selmon->sel, False);
if(c) {
if(c->mon != selmon)
selmon = c->mon;
if(c->isurgent)
clearurgent(c);
detachstack(c);
attachstack(... | false | false | false | false | false | 0 |
openlog(const char *ident, int option, int facility)
{
int fd;
(void)option;
(void)facility; /* Unused */
if (__syslog_fd == -1) {
__syslog_fd = fd = open(LOGDEV, O_WRONLY);
if (fd == -1)
return;
fcntl(fd, F_SETFD, (long)FD_CLOEXEC);
}
syslog_flags = option;
strncpy(id, ident ? ident : "", MAXID);
... | false | false | false | false | false | 0 |
xcf_prn_close(gx_device *dev)
{
xcf_device * const xdev = (xcf_device *) dev;
if (xdev->cmyk_icc_link != NULL) {
gscms_release_link(xdev->cmyk_icc_link);
rc_decrement(xdev->cmyk_profile, "xcf_prn_close");
}
if (xdev->rgb_icc_link != NULL) {
gscms_release_link(xdev->rgb_icc_link... | false | false | false | false | false | 0 |
get_interval_stats(int left, int level, bool &in_limit, int &sz) {
double t = upper_threshold_at(level);
int w = (1 << level) * this->chunk_size;
sz = 0;
for (int i = left; i < left + w; ++i) {
sz += this->present[i] ? 1 : 0;
}
double q = (double)(sz+1) / doub... | false | false | false | false | false | 0 |
SetHistogram(const std::vector<uint32_t>& hist)
{
m_pHist1D.reset(new Histogram1D(hist.size()));
std::memcpy(m_pHist1D->GetDataPointer(), &(hist.at(0)),
sizeof(uint32_t)*hist.size());
} | false | false | false | false | false | 0 |
drmMapBufs(int fd)
{
drm_buf_map_t bufs;
drmBufMapPtr retval;
int i;
bufs.count = 0;
bufs.list = NULL;
bufs.virtual = NULL;
if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs))
return NULL;
if (!bufs.count)
return NULL;
if (!(bufs.list = drmMalloc(bufs.count * sizeof(*bufs.list... | false | false | false | false | false | 0 |
file_glob_specificities(const gchar *glob)
{
glong *specs;
gchar **globs;
gchar *s;
gint i, n;
globs = g_strsplit(glob, " ", 0);
if (!globs) {
specs = g_new(glong, 1);
*specs = 0;
return specs;
}
for (n = 0; globs[n]; n++)
;
specs = g_new(glong, n+1)... | false | false | false | false | false | 0 |
dav_fs_deleteset(apr_pool_t *p, const dav_resource *resource)
{
const char *dirpath;
const char *fname;
const char *state1;
const char *state2;
const char *pathname;
apr_status_t status;
/* Get directory, filename, and state-file names for the resource */
/* ### should test this result ... | false | false | false | false | false | 0 |
koneplus_keep_values_up_to_date(struct koneplus_device *koneplus,
u8 const *data)
{
struct koneplus_mouse_report_button const *button_report;
switch (data[0]) {
case KONEPLUS_MOUSE_REPORT_NUMBER_BUTTON:
button_report = (struct koneplus_mouse_report_button const *)data;
switch (button_report->type) {
case KO... | false | false | false | false | false | 0 |
hsw_ddi_pll_select(struct intel_crtc *intel_crtc,
struct intel_crtc_state *crtc_state,
struct intel_encoder *intel_encoder)
{
struct intel_shared_dpll *pll;
pll = intel_get_shared_dpll(intel_crtc, crtc_state,
intel_encoder);
if (!pll)
DRM_DEBUG_DRIVER("failed to find PLL for pipe %c\n",
pip... | false | false | false | false | false | 0 |
js_GetCurrentBytecodePC(JSContext* cx)
{
jsbytecode *pc, *imacpc;
#ifdef JS_TRACER
if (JS_ON_TRACE(cx)) {
pc = cx->bailExit->pc;
imacpc = cx->bailExit->imacpc;
} else
#endif
{
JS_ASSERT_NOT_ON_TRACE(cx); /* for static analysis */
JSStackFrame* fp = cx->fp;
if (f... | false | false | false | false | false | 0 |
get_library_export(const char *name, void *library_handle, const char ** pszError)
{
void * pExport;
#ifdef _WIN32
pExport = (void*)GetProcAddress((HMODULE)library_handle, name);
#else
dlerror(); // Clear possible previous errors
pExport = dlsym(library_handle, name);
#endif
if (NULL == pExport && pszError !=... | false | false | false | false | false | 0 |
readPPM(int *rows, int *cols, int * colors, char *filename) {
unsigned char r, g, b;
int i;
char tag[40];
Pixel *image;
FILE *fp;
int read, num[3], curchar;
if(filename != NULL && strlen(filename)){
if ((fp = fopen(filename, "r"))==NULL){
printf("Couldn't open image\n");
... | false | false | false | false | true | 1 |
rsa_hash (const rsaid &id, const rsachallenge &chg, rsaresponse &h)
{
EVP_MD_CTX ctx;
EVP_MD_CTX_init (&ctx);
require (EVP_DigestInit (&ctx, RSA_HASH));
require (EVP_DigestUpdate (&ctx, &chg, sizeof chg));
require (EVP_DigestUpdate (&ctx, &id, sizeof id));
require (EVP_DigestFinal (&ctx, (unsigned char ... | false | false | false | false | false | 0 |
cmd_level(void)
{
SearchDepth = 0;
sscanf (token[1], "%d %f %d", &TCMove, &TCTime, &TCinc);
if (TCMove == 0) {
TCMove = 35 /* MIN((5*(GameCnt+1)/2)+1,60) */;
printf("TCMove = %d\n",TCMove);
suddendeath = 1;
} else
suddendeath = 0;
if (TCTime == 0) {
SET (flags, TIMECTL);
SearchTime = ... | false | false | false | false | false | 0 |
ai_incident_diplomat(struct player *violator, struct player *victim)
{
players_iterate(pplayer) {
if (!pplayer->ai_controlled) {
continue;
}
if (pplayer != violator) {
/* Dislike backstabbing bastards */
pplayer->ai_common.love[player_index(violator)] -= MAX_AI_LOVE / 100;
if (vic... | false | false | false | false | false | 0 |
null_axis_dip(double str1,double dip1,double str2,double dip2)
/*
compute null axis dip when strike and dip are given
for each nodal plane.
Angles are in degrees.
*/
/* Genevieve Patau */
{
double den;
den = asind(sind(dip1) * sind(dip2) * sind(str1 - str2));
if (den < 0.)
den = -den;
return(den);
} | false | false | false | false | false | 0 |
convertGivenPointer( DcmObject *startPoint,
ItemOffset *itOffsets,
const unsigned long numOffsets,
const DcmTagKey &offsetTag )
{
OFCondition l_error = EC_Normal;
if ( startP... | false | false | false | false | false | 0 |
RetrieveDocType(std::string &DocType) const
{
switch(GetDocType())
{
case (Url_Undefined):
DocType="";
break;
case (Url_XHtml_11_Strict):
DocType="xhtml-11";
break;
case (Url_XHtml_10_Strict):
DocType="xhtml-10";
break;
case (Url_XHtml_10_Transiti... | false | false | false | false | false | 0 |
lubksb(Real* B, int mini)
{
REPORT
Tracer tr("BandLUMatrix::lubksb");
if (sing) Throw(SingularException(*this));
int n = nrows_val; int l = m1; int w = m1 + 1 + m2;
for (int k=0; k<n; k++)
{
int i = indx[k];
if (i!=k) { Real x=B[k]; B[k]=B[i]; B[i]=x; }
if (l<n) l++;
Real* m =... | false | false | false | false | false | 0 |
need_to_reassign_continents(const struct terrain *oldter,
const struct terrain *newter)
{
bool old_is_ocean, new_is_ocean;
if (!oldter || !newter) {
return FALSE;
}
old_is_ocean = is_ocean(oldter);
new_is_ocean = is_ocean(newter);
return (old_is_ocean && !new_is_oce... | false | false | false | false | false | 0 |
filterByExtension( TFileInfoList &lstFiles, const std::string &extension )
{
int i,n=(int)lstFiles.size();
for (i=n-1;i>=0;i--)
{
if ( 0!=os::_strcmpi(mrpt::system::extractFileExtension(lstFiles[i].name).c_str(),extension.c_str() ) )
{
// Does not match:
lstFiles.erase( lstFiles.begin()+i );
}
}
} | false | false | false | false | false | 0 |
processRGBA_Gray(imageStruct &image, imageStruct &right)
{
int datasize = image.xsize * image.ysize;
unsigned char *leftPix = image.data;
unsigned char *rightPix = right.data;
while(datasize--)
{
leftPix[chAlpha] = rightPix[chGray];
leftPix += 4;
rightPix+= 1;
}
} | false | false | false | false | false | 0 |
probe_source(SourceRecord *src)
{
NTP_Packet pkt;
int version = NTP_VERSION;
NTP_Mode my_mode = MODE_CLIENT;
struct timeval cooked;
union sockaddr_in46 his_addr;
int sock_fd;
socklen_t addrlen;
uint32_t ts_fuzz;
#if 0
printf("Sending probe to %s sent=%d samples=%d\n", UTI_IPToString(&src->ip_addr), s... | false | false | false | false | false | 0 |
std_bbtree_node_destroy(struct std_bbtreenode *node,
STDDestroyNotify key_destroy_func, STDDestroyNotify value_destroy_func)
{
if (node) {
std_bbtree_node_destroy(node->right,
key_destroy_func, value_destroy_func);
std_bbtree_node_destroy(node->left,
key_destr... | false | false | false | false | false | 0 |
create_string(cfg_parser_t *pctx, const char *contents, const cfg_type_t *type,
cfg_obj_t **ret)
{
isc_result_t result;
cfg_obj_t *obj = NULL;
int len;
CHECK(cfg_create_obj(pctx, type, &obj));
len = strlen(contents);
obj->value.string.length = len;
obj->value.string.base = isc_mem_get(pctx->mctx, len + 1... | false | false | false | false | false | 0 |
ff_match_text( const char *txt )
{
char *src = ff.pos;
txt = ff_skip_spaces( txt );
while ( *src && *txt )
{
if ( *src != *txt
&& ! ( isspace( ( unsigned char ) *src )
&& isspace( ( unsigned char ) *txt ) ) )
return NULL;
if ( isspace... | false | false | false | false | false | 0 |
stv0367cab_get_mclk(struct dvb_frontend *fe, u32 ExtClk_Hz)
{
struct stv0367_state *state = fe->demodulator_priv;
u32 mclk_Hz = 0;/* master clock frequency (Hz) */
u32 M, N, P;
if (stv0367_readbits(state, F367CAB_BYPASS_PLLXN) == 0) {
N = (u32)stv0367_readbits(state, F367CAB_PLL_NDIV);
if (N == 0)
N = N + ... | false | false | false | false | false | 0 |
i810_clear_bufs(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
drm_i810_clear_t *clear = data;
LOCK_TEST_WITH_RETURN(dev, file_priv);
/* GH: Someone's doing nasty things... */
if (!dev->dev_private)
return -EINVAL;
i810_dma_dispatch_clear(dev, clear->flags,
clear->clear_color, cle... | false | false | false | false | false | 0 |
CheckConstraint(char *type,char *name,char *lval,void *rval,char rvaltype,struct SubTypeSyntax ss)
{ int lmatch = false;
int i,l, allowed = false;
struct BodySyntax *bs;
char output[CF_BUFSIZE];
Debug("CheckConstraint(%s,%s,",type,lval);
if (DEBUG)
{
ShowRval(stdout,rval,rvaltype);
}
Debug(")\n");
... | true | true | false | false | false | 1 |
elm_entry_selection_paste(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if ((!wd) || (wd->password)) return;
_paste(obj, NULL, NULL);
} | false | false | false | false | false | 0 |
axmap_new(unsigned long nr_bits)
{
struct axmap *axmap;
unsigned int i, levels;
axmap = malloc(sizeof(*axmap));
if (!axmap)
return NULL;
levels = 1;
i = (nr_bits + BLOCKS_PER_UNIT - 1) >> UNIT_SHIFT;
while (i > 1) {
i = (i + BLOCKS_PER_UNIT - 1) >> UNIT_SHIFT;
levels++;
}
axmap->nr_levels = levels;
a... | false | true | false | false | true | 1 |
elideCopiesAndPHIs(MachineInstr *MI,
SmallVectorImpl<MachineInstr*> &Outs) {
// Looking through PHIs may create loops so we need to track what
// instructions we have visited before.
std::set<MachineInstr *> Reached;
SmallVector<MachineInstr *, 8> Front;
Front.push... | 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.