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 |
|---|---|---|---|---|---|---|
http_basicauth (const char *user, const char *password,
char* dest, int len)
{
static const char enctable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
char *tmp;
char *sptr;
char *dptr;
int count;
count = strlen (user) + 1;
if (password != N... | true | true | false | false | true | 1 |
DoOnValidationFailure( wxPGProperty* property, wxVariant& WXUNUSED(invalidValue) )
{
int vfb = m_validationInfo.m_failureBehavior;
if ( vfb & wxPG_VFB_BEEP )
::wxBell();
if ( (vfb & wxPG_VFB_MARK_CELL) &&
!property->HasFlag(wxPG_PROP_INVALID_VALUE) )
{
if ( !property->GetCell(... | false | false | false | false | false | 0 |
removeCamera(const char *cameraName)
{
if (cameraName == NULL) {
return false;
}
lock();
std::map<std::string, CameraInfo*>::iterator iter =
myCameraToInfoMap.find(cameraName);
if (iter == myCameraToInfoMap.end()) {
unlock();
return false;
}
delete... | false | false | false | false | false | 0 |
globus_i_gram_usage_stats_init(
globus_gram_job_manager_t * manager)
{
globus_result_t result;
char * target_str;
char * ptr;
char * target;
globus_list_t * list... | false | false | false | false | true | 1 |
layout_sync_options_with_current_state(LayoutWindow *lw)
{
Histogram *histogram;
if (!layout_valid(&lw)) return;
lw->options.main_window.maximized = window_maximized(lw->window);
if (!lw->options.main_window.maximized)
{
layout_geometry_get(lw, &lw->options.main_window.x, &lw->options.main_window.y,
&... | false | false | false | false | false | 0 |
clutter_script_default_connect (ClutterScript *script,
GObject *gobject,
const gchar *signal_name,
const gchar *signal_handler,
GObject *connect_gobject,
... | false | false | false | false | false | 0 |
Function(const vector<string>& args)
{
if(!AssertArgument(args, 2, 2)) return ("");
string dirname=CanonicalPath(Engine->GetDataPath(), args[1]);
struct stat buf;
if(stat(dirname.c_str(),&buf)) return("");
if(S_ISDIR(buf.st_mode)) {
return("1");
}else{
return("0");
}
} | false | false | false | false | false | 0 |
already_determined (List_Node *ptr)
{
int is_determined = 1;
for (char *temp = ptr->keysig; is_determined && *temp; temp++)
is_determined = determined_[(int) *temp];
return is_determined;
} | false | false | false | false | false | 0 |
ItclDestroyObject(cdata)
ClientData cdata; /* object instance data */
{
ItclObject *contextObj = (ItclObject*)cdata;
ItclClass *cdefnPtr = (ItclClass*)contextObj->classDefn;
Tcl_HashEntry *entry;
Itcl_InterpState istate;
/*
* Attempt to destruct the object, but ignore any errors.
*/... | false | false | false | false | false | 0 |
parse_response_tag (const parser_strings_t *strings,
xmlTextReaderPtr reader)
{
xmlChar *href = NULL;
xmlChar *etag = NULL;
gint depth = xmlTextReaderDepth (reader);
response_element_t *element;
while (xmlTextReaderRead (reader) == 1 && xmlTextReaderDepth ... | false | false | false | false | false | 0 |
_eef_inst_func_mov (eef_addr_t opnd_addr, gchar dst, gchar src)
{
eef_data_t *src_ptr, *dst_ptr;
eef_data_t src_data, *dst_data;
/* get ptrs of regs else NULL */
src_ptr = eef_loc_of_reg (src);
dst_ptr = eef_loc_of_reg (dst);
/* load and refer data */
src_data = (src_ptr) ? *src_ptr : sys.mem[eef_regpai... | false | false | false | false | false | 0 |
classifyAttribHTML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
bool wordIsNumber = IsNumber(start, styler);
char chAttr = SCE_H_ATTRIBUTEUNKNOWN;
if (wordIsNumber) {
chAttr = SCE_H_NUMBER;
} else {
char s[100];
GetTextSegment(styler, start, end, s, sizeof(s));
if (keywords.... | false | false | false | false | false | 0 |
strdeepen(s)
struct string *s;
{
char *p;
if(s->s_size) {
p=malloc(s->s_size);
if(!p) return 0;
memcpy(p, s->s_base, s->s_size);
s->s_base=p;
s->s_alloc=s->s_size;
}
return 1;
} | false | false | false | false | false | 0 |
GDALDumpOpenSharedDatasetsForeach(void* elt, void* user_data)
{
SharedDatasetCtxt* psStruct = (SharedDatasetCtxt*) elt;
FILE *fp = (FILE*) user_data;
const char *pszDriverName;
GDALDataset *poDS = psStruct->poDS;
if( poDS->GetDriver() == NULL )
pszDriverName = "DriverIsNULL";
else
... | false | false | false | false | false | 0 |
derive_dynload_initfn(const char *filename)
{
const char *head, *tail, *s;
char *name, *d;
head = strrchr(filename, '/');
if (head == NULL) head = filename;
else head++;
tail = strchr(head, '.');
if (tail == NULL) tail = filename + strlen(filename);
name = SCM_NEW_ATOMIC2(char *, sizeo... | false | false | false | false | false | 0 |
gg_svg_add_point (struct gg_svg_dyn_points *dyn, double x, double y)
{
struct gg_svg_dyn_point *p = malloc (sizeof (struct gg_svg_dyn_point));
p->x = x;
p->y = y;
p->next = NULL;
if (dyn->first == NULL)
dyn->first = p;
if (dyn->last != NULL)
dyn->last->next = p;
dyn->last = p;
dyn->poi... | false | false | false | false | false | 0 |
updateMapRect( QRectF rect )
{
TRACE("MapView::updateMapRect");
QList<QRectF> rectlist;
rectlist.append( rect );
_map->updateMapRect(sceneRect());
} | false | false | false | false | false | 0 |
testEncodeDecode()
{
{
std::stringstream str;
Base64Encoder encoder(str);
encoder << "The quick brown fox ";
encoder << "jumped over the lazy dog.";
encoder.close();
Base64Decoder decoder(str);
std::string s;
int c = decoder.get();
while (c != -1) { s += char(c); c = decoder.get(); }
assert (s == "... | false | false | false | false | false | 0 |
Definition (ostream& out) {
Coord l, b, r, t;
RectOvComp* comp = (RectOvComp*) GetSubject();
comp->GetRect()->GetOriginal(l, b, r, t);
if (!svg_format()) {
out << "rectangle(";
out << l << "," << b << "," << r << "," << t;
} else {
out << "<rect x=\"" << l << "\" y=\"" << b
<<... | false | false | false | false | false | 0 |
destination_button_clicked_cb(GtkWidget *button, gpointer data)
{
if (rec_settings.destination)
g_free(rec_settings.destination);
rec_settings.destination = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(button));
} | false | false | false | false | false | 0 |
RotateOrthTest(PIX *pixs,
L_REGPARAMS *rp)
{
l_int32 zero, count;
PIX *pixt, *pixd;
/* Test 4 successive 90 degree rotations */
pixt = pixRotate90(pixs, 1);
pixd = pixRotate90(pixt, 1);
pixDestroy(&pixt);
pixt = pixRotate90(pixd, 1);
pixDestroy(&pixd);
pixd = pi... | false | false | false | false | false | 0 |
store_item_optimize(struct store *store, int item)
{
int j;
object_type *o_ptr;
/* Get the object */
o_ptr = &store->stock[item];
/* Must exist */
if (!o_ptr->kind) return;
/* Must have no items */
if (o_ptr->number) return;
/* One less object */
store->stock_num--;
/* Slide everyone */
for (j = item; ... | false | false | false | false | false | 0 |
mongo_cmd_get_error_helper( mongo *conn, const char *db,
bson *realout, const char *cmdtype ) {
bson out[1];
bson_bool_t haserror = 0;
/* Reset last error codes. */
mongo_clear_errors( conn );
bson_init_zero(out);
/* If there's an error, store its code a... | false | false | false | false | false | 0 |
descramble_nordicpro (uae_u8 *buf, int size, int odd)
{
if (odd) {
descramble2 (buf, size);
descramble2a (buf, size);
} else {
descramble1 (buf, size);
descramble1a (buf, size);
}
} | false | false | false | false | false | 0 |
z_window_style (void)
{
zword win = winarg0 ();
zword flags = zargs[1];
flush_buffer ();
/* Supply default arguments */
if (zargc < 3)
zargs[2] = 0;
/* Set window style */
switch (zargs[2]) {
case 0: wp[win].attribute = flags; break;
case 1: wp[win].attribute |= flags; break;
case 2... | false | false | false | false | false | 0 |
access_has_replacements_p (struct access *acc)
{
struct access *child;
if (acc->grp_to_be_replaced)
return true;
for (child = acc->first_child; child; child = child->next_sibling)
if (access_has_replacements_p (child))
return true;
return false;
} | false | false | false | false | false | 0 |
getFirstBrokenCell(bool bCacheResultOnly) const
{
if (bCacheResultOnly || m_pFirstBrokenCell)
{
return m_pFirstBrokenCell;
}
if (getPrev())
{
fp_TableContainer * pPrevTable = static_cast<fp_TableContainer*>(getPrev());
if (pPrevTable->getFirstBrokenCell(true))
{
return pPrevTable->getFirstBrokenCell(tr... | false | false | false | false | false | 0 |
dc_map_hard_tile(int script, int* yield, int* preturnint, int tile_position, int hard_tile_index)
{
// developers can retrieve/modify a hard tile
// Yeah... they can only modify valid tiles
if (tile_position >= 1 && tile_position <= 96)
{
//Only change the value if it is greater than 0...
if (hard... | false | false | false | false | false | 0 |
get_disc_last_lsn_cdrdao (void *p_user_data)
{
_img_private_t *p_env = p_user_data;
track_t i_leadout = p_env->gen.i_tracks;
uint16_t i_blocksize = p_env->tocent[i_leadout-1].blocksize;
long i_size;
if (p_env->tocent[i_leadout-1].sec_count) {
i_size = p_env->tocent[i_leadout-1].sec_count;
} else {
... | false | false | false | false | false | 0 |
release_call(struct voice_call *vc)
{
DBG("%s", vc->number);
return send_method_call(OFONO_BUS_NAME, vc->obj_path,
OFONO_VC_INTERFACE, "Hangup",
NULL, NULL, DBUS_TYPE_INVALID);
} | false | false | false | false | false | 0 |
pixRemoveAlpha(PIX *pixs)
{
PROCNAME("pixRemoveAlpha");
if (!pixs)
return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
if (pixGetDepth(pixs) == 32 && pixGetSpp(pixs) == 4)
return pixAlphaBlendUniform(pixs, 0xffffff00);
else
return pixClone(pixs);
} | false | false | false | false | false | 0 |
get_bool(OM_uint32 *minor_status,
const gss_buffer_t value,
int *flag)
{
if (value->value == NULL || value->length != 1) {
*minor_status = EINVAL;
return GSS_S_FAILURE;
}
*flag = *((const char *)value->value) != 0;
return GSS_S_COMPLETE;
} | false | false | false | false | false | 0 |
gst_mini_object_init (GstMiniObject * mini_object, guint flags, GType type,
GstMiniObjectCopyFunction copy_func,
GstMiniObjectDisposeFunction dispose_func,
GstMiniObjectFreeFunction free_func)
{
mini_object->type = type;
mini_object->refcount = 1;
mini_object->lockstate = 0;
mini_object->flags = fla... | false | false | false | false | false | 0 |
panel_place_menu_item_finalize (GObject *object)
{
PanelPlaceMenuItem *menuitem = (PanelPlaceMenuItem *) object;
gconf_client_remove_dir (panel_gconf_get_client (),
DESKTOP_IS_HOME_DIR_DIR,
NULL);
gconf_client_remove_dir (panel_gconf_get_client (),
NAMES_DIR,
NULL);
if (menuitem->priv->bookmar... | false | false | false | false | false | 0 |
browseProtein()
{
// Mark Jan 18th 2007: changes to remember working Dir
FileDialog fd;
aaMatrixPath = fd.getOpenFileName(this, tr("Find Protein Matrix"));
string path = aaMatrixPath.toStdString();
if(path != "")
{
int lenOfStri... | false | false | false | false | false | 0 |
FreeImage_SetPluginEnabled(FREE_IMAGE_FORMAT fif, BOOL enable) {
if (s_plugins != NULL) {
PluginNode *node = s_plugins->FindNodeFromFIF(fif);
if (node != NULL) {
BOOL previous_state = node->m_enabled;
node->m_enabled = enable;
return previous_state;
}
}
return -1;
} | false | false | false | false | false | 0 |
list() {
for (vector<string>::size_type i = 0; i < m_Names.size(); i++) {
if (m_Types[i] != -1) {
cout << m_Names[i] << " (" << i << ")" << endl;
}
}
} | false | false | false | false | false | 0 |
clutter_backend_gdk_copy_event_data (ClutterBackend *backend,
const ClutterEvent *src,
ClutterEvent *dest)
{
GdkEvent *gdk_event;
gdk_event = _clutter_event_get_platform_data (src);
if (gdk_event != NULL)
_clutter_event_set_p... | false | false | false | false | false | 0 |
substitutions_finished(VarOrdering::ord_type ot)
{
// create an external ordering of new_atoms from old_atoms
const vector<const char*>& oa_ext = old_atoms.get_allvar();
vector<const char*> na_ext;
for (unsigned int i = 0; i < oa_ext.size(); i++) {
const char* oname = oa_ext[i];
// add the old name itself
na_... | false | false | false | false | false | 0 |
C_i_nequalp(C_word x, C_word y)
{
if(x & C_FIXNUM_BIT) {
if(y & C_FIXNUM_BIT) return C_mk_bool(x == y);
else if(!C_immediatep(y) && C_block_header(y) == C_FLONUM_TAG)
return C_mk_bool((double)C_unfix(x) == C_flonum_magnitude(y));
barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "=", y);
}
else if(!C_i... | false | false | false | false | false | 0 |
snd_card_asihpi_playback_formats(struct snd_card_asihpi *asihpi,
u32 h_stream)
{
struct hpi_format hpi_format;
u16 format;
u16 err;
u32 h_control;
u32 sample_rate = 48000;
u64 formats = 0;
/* on cards without SRC, must query at valid rate,
* maybe set by external sync
*/
err = hpi_mixer_get_control(asi... | false | false | false | false | false | 0 |
avbin_log_callback(void *ptr,
int level,
const char *fmt,
va_list vl)
{
static char message[8192];
const char *module = NULL;
if (level > av_log_level || !user_log_callback)
return;
if (ptr)
{
... | false | false | false | false | false | 0 |
get_inh_search_path(VMG0_)
{
CVmObjTads *curp;
CVmObjTadsInhQueue *q = G_tadsobj_queue;
pfq_ele *q_ele;
vm_tadsobj_hdr *hdr = get_hdr();
tadsobj_inh_path *path;
/*
* There are multiple superclasses. If we've already calculated a
* path for this object, simply use the pr... | false | false | false | false | false | 0 |
search_return_block(Block *block_head)
{
Block *bpt;
for (bpt = block_head; bpt != NULL; bpt = bpt->next) {
if (bpt->post_head != NULL
&& search_specified_statement(bpt->post_head->stm_head,
OPE_RETURN)) {
return bpt;
} else if (... | false | false | false | false | false | 0 |
data_flush(void){
struct data_pack *base;
struct data_pack *clean;
struct data_pack *next;
int step;
// parse hash table
step = 0;
while(step < HASH_SIZE){
base = &data_mac_tab[step];
clean = base->next_mac;
while(clean != base){
if(clean->flag == APPEND){
// get next
next = clean->next_mac;
... | true | true | false | false | false | 1 |
WriteScalefactors(CoderInfo *coderInfo,
BitStream *bitStream,
int writeFlag)
{
/* this function takes care of counting the number of bits necessary */
/* to encode the scalefactors. In addition, if the writeFlag == 1, */
/* then the scalefactors are written out ... | false | false | false | false | false | 0 |
fetch_sun(uint32_t *starts, uint32_t *lens, uint32_t *start, uint32_t *stop)
{
int i, continuous = 1;
*start = 0;
*stop = cylinders * heads * sectors;
for (i = 0; i < partitions; i++) {
struct sun_partition *part = &sunlabel->partitions[i];
struct sun_tag_flag *tag = &sunlabel->part_tags[i];
if (part->num_... | false | false | false | false | false | 0 |
he_refresh_part(hedit, pos1, pos2)
struct he_s *hedit;
long pos1, pos2;
{
long i, j, k;
int update_f = 0;
int lastline_f = 0;
if (pos2 < 0) {
pos2 = hedit->buffer->size - 1;
++lastline_f;
}
if (pos1 > pos2) i = pos1, pos1 = pos2, pos2 = i;
j = HE_LINE(pos1 - hedit->screen_offset);
k = lastl... | false | false | false | false | false | 0 |
rend_service_relaunch_rendezvous(origin_circuit_t *oldcirc)
{
origin_circuit_t *newcirc;
cpath_build_state_t *newstate, *oldstate;
tor_assert(oldcirc->_base.purpose == CIRCUIT_PURPOSE_S_CONNECT_REND);
/* Don't relaunch the same rend circ twice. */
if (oldcirc->hs_service_side_rend_circ_has_been_relaunched) ... | false | false | false | false | false | 0 |
glade_project_widget_visibility_changed (GladeProject *project,
GladeWidget *widget,
gboolean visible)
{
g_return_if_fail (GLADE_IS_PROJECT (project));
g_return_if_fail (project == glade_widget_get_project (widget));
g_sig... | false | false | false | false | false | 0 |
gee_array_list_iterator_real_get (GeeIterator* base) {
GeeArrayListIterator * self;
gpointer result = NULL;
gint _tmp0_ = 0;
GeeArrayList* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
gint _tmp4_ = 0;
GeeArrayList* _tmp5_ = NULL;
gint _tmp6_ = 0;
gboolean _tmp7_ = FALSE;
GeeArrayList* _tmp8_ = NULL;
gpo... | false | false | false | false | false | 0 |
EC_NewKey(ECParams *ecParams, ECPrivateKey **privKey)
{
SECStatus rv = SECFailure;
#ifdef NSS_ENABLE_ECC
int len;
unsigned char *privKeyBytes = NULL;
if (!ecParams) {
PORT_SetError(SEC_ERROR_INVALID_ARGS);
return SECFailure;
}
len = ecParams->order.len;
privKeyBytes = ec_GenerateRandomPr... | false | false | false | false | false | 0 |
xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt,
xmlSchemaIDCMatcherPtr matcher,
xmlSchemaIDCSelectPtr sel,
int type)
{
xmlSchemaIDCStateObjPtr sto;
/*
* Reuse the state objects from the pool.
*/
if (vctxt->xpathStatePoo... | false | false | false | false | false | 0 |
cacheobj_free(struct cacheobj *cobj)
{
av_unref_obj(cobj->obj);
av_log(AVLOG_DEBUG, "got rid of cached object <%s> size %lli",
cobj->name != NULL ? cobj->name : "?", cobj->diskusage);
av_free(cobj->name);
} | false | false | false | false | false | 0 |
_gda_web_set_connection_error_from_xmldoc (GdaConnection *cnc, xmlDocPtr doc, GError **error)
{
xmlNodePtr node, root;
GdaConnectionEvent *ev = NULL;
g_return_val_if_fail (doc, NULL);
root = xmlDocGetRootElement (doc);
for (node = root->children; node; node = node->next) {
if (!strcmp ((gchar*) node->name, "st... | false | false | false | false | false | 0 |
init_zspage(struct page *first_page, struct size_class *class)
{
unsigned long off = 0;
struct page *page = first_page;
BUG_ON(!is_first_page(first_page));
while (page) {
struct page *next_page;
struct link_free *link;
unsigned int i = 1;
void *vaddr;
/*
* page->index stores offset of first object st... | false | false | false | false | false | 0 |
usc_OutDmaReg( struct mgsl_struct *info, u16 RegAddr, u16 RegValue )
{
/* Note: The DCAR is located at the adapter base address */
/* Note: must preserve state of BIT8 in DCAR */
outw( RegAddr + info->mbre_bit, info->io_base );
outw( RegValue, info->io_base );
/* Read to flush write to DCAR */
if ( info->bus_ty... | false | false | false | false | false | 0 |
callValueType( KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args )
{
Q_UNUSED(args);
KJSEmbed::ValueBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::ValueBinding>(exec, self );
if( imp )
{
return KJS::jsString( imp->className().ascii() );
}
return KJS::jsNull();
} | false | false | false | false | false | 0 |
refmpn_submul_1c (mp_ptr rp, mp_srcptr sp, mp_size_t size,
mp_limb_t multiplier, mp_limb_t carry)
{
AORSMUL_1C (refmpn_sub_n);
} | false | false | false | false | false | 0 |
JNI_CallNonvirtualVoidMethod(JNIEnv *env, jobject this, jclass clazz, jmethodID methodID, ...)
{
va_list args;
enter_vm_from_jni();
if (transform_method_for_nonvirtual_call(this, clazz, &methodID))
return; /* rethrow */
va_start(args, methodID);
vm_call_method_this_v(methodID, this, args, NULL);
va_end(args)... | false | false | false | false | false | 0 |
Traverse(WordNode *root, void (*poly)(char *word))
{
WordNode *currentNode = root;
while (currentNode)
{
poly(currentNode->word);
currentNode = currentNode->next;
}
} | false | false | false | false | false | 0 |
grl_flickr_source_browse (GrlSource *source,
GrlSourceBrowseSpec *bs)
{
if (GRL_FLICKR_SOURCE (source)->priv->user_id) {
grl_flickr_source_personal_browse (source, bs);
} else {
grl_flickr_source_public_browse (source, bs);
}
} | false | false | false | false | false | 0 |
esl_opt_GetSetter(const ESL_GETOPTS *g, char *optname)
{
int opti;
if (get_optidx_exactly(g, optname, &opti) != eslOK) esl_fatal("no such option %s\n", optname);
return g->setby[opti];
} | false | false | false | false | false | 0 |
cdrom_command_multi (void)
{
int seekpos = msf2lsn (fromlongbcd (cdrom_command_buffer + 1));
int endpos = msf2lsn (fromlongbcd (cdrom_command_buffer + 4));
if (cdrom_playing)
cdaudiostop ();
cdrom_speed = (cdrom_command_buffer[8] & 0x40) ? 2 : 1;
cdrom_result_buffer[0] = cdrom_command;
cdrom_result_buffer[1] =... | false | false | false | false | false | 0 |
srec_mkobject (bfd *abfd)
{
tdata_type *tdata;
srec_init ();
tdata = (tdata_type *) bfd_alloc (abfd, sizeof (tdata_type));
if (tdata == NULL)
return FALSE;
abfd->tdata.srec_data = tdata;
tdata->type = 1;
tdata->head = NULL;
tdata->tail = NULL;
tdata->symbols = NULL;
tdata->symtail = NULL;
t... | false | false | false | false | false | 0 |
ParseIntValues(
istream &infile, std::string &linetext, std::string::iterator &pos,
int *values, int n)
{
this->SkipWhitespace(infile, linetext, pos, 0);
int i = 0;
while (pos != linetext.end() && *pos != ';' && i < n)
{
const char *cp = linetext.c_str() + (pos - linetext.begin());
char *ep = 0;
... | false | false | false | false | false | 0 |
Clear(void)
{
int i;
for(i = A1; i <= H8; ++i)
{
Board[i] = EMPTY;
}
for(i = WK; i <= BP; ++i)
{
Material[i] = 0;
for(unsigned int j = 0; j < 8; ++j)
{
NumOnRank[i][j] = NumOnFyle[i][j] = 0;
}
for(unsigned int d = 0; d < 15; ++d)
... | false | false | false | false | false | 0 |
demote_cblock(struct smq_policy *mq,
struct policy_locker *locker,
dm_oblock_t *oblock)
{
struct entry *demoted = q_peek(&mq->clean, mq->clean.nr_levels, false);
if (!demoted)
/*
* We could get a block from mq->dirty, but that
* would add extra latency to the triggering bio as it
* waits for the wr... | false | false | false | false | false | 0 |
srcpop(Datasrc* src)
{
if(src != NULL) {
Datasrc* prev = src->prev;
*src = *prev;
freedatasrc(prev);
}
DUMPSRC(src,"<");
} | false | false | false | false | false | 0 |
jsiFreeMoreMemory() {
JsVar *history = jsvObjectGetChild(execInfo.hiddenRoot, JSI_HISTORY_NAME, 0);
if (!history) return 0;
JsVar *item = jsvArrayPopFirst(history);
bool freed = item!=0;
jsvUnLock(item);
jsvUnLock(history);
// TODO: could also free the array structure?
// TODO: could look at all streams... | false | false | false | false | false | 0 |
tl_set_interval(tl_timer * timer, int interval)
{
if (timer->interval <= 0) {
tl_reset_timer(timer);
}
timer->interval = interval;
if (timer->group == asyncgroup)
update_async();
} | false | false | false | false | false | 0 |
FLAC__bitreader_get_read_crc16(FLAC__BitReader *br)
{
FLAC__ASSERT(0 != br);
FLAC__ASSERT(0 != br->buffer);
FLAC__ASSERT((br->consumed_bits & 7) == 0);
FLAC__ASSERT(br->crc16_align <= br->consumed_bits);
/* CRC any tail bytes in a partially-consumed word */
if(br->consumed_bits) {
const uint32_t tail = br->buf... | false | false | false | false | false | 0 |
removeTab(IconButton *btn) {
if (m_tab_container.removeItem(btn))
delete btn;
} | false | false | false | false | false | 0 |
intern_data_parent_part_one(DDS & dds,
ConstraintEvaluator & eval,
sequence_values_stack_t &
sequence_values_stack)
{
DBG(cerr << "Entering intern_data_parent_part_one for " << name() << endl);
int... | false | false | false | false | false | 0 |
copyFrom(const CPointPDF &o)
{
if (this == &o) return; // It may be used sometimes
// Convert to gaussian pdf:
o.getCovarianceAndMean(cov,mean);
} | false | false | false | false | false | 0 |
EraseAt(Dlist *l,size_t position)
{
DlistElement *rvp=NULL,*last;
void *removed=NULL;
if (l == NULL) return iError.NullPtrError("iDlist.InsertIn");
if (position >= l->count) {
l->RaiseError("iDlist.EraseAt",CONTAINER_ERROR_INDEX,l,position);
return CONTAINER_ERROR_INDEX;
}
if (l-... | false | false | false | false | false | 0 |
bnxt_hwrm_queue_pri2cos_cfg(struct bnxt *bp, struct ieee_ets *ets)
{
struct hwrm_queue_pri2cos_cfg_input req = {0};
int rc = 0, i;
u8 *pri2cos;
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_PRI2COS_CFG, -1, -1);
req.flags = cpu_to_le32(QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH_BIDIR |
QUEUE_PRI2COS_CFG_REQ_FLAGS_IVLAN);... | false | false | false | false | false | 0 |
glusterd_handle_log_rotate (rpcsvc_request_t *req)
{
int32_t ret = -1;
gf_cli_req cli_req = {{0,}};
dict_t *dict = NULL;
glusterd_op_t cli_op = GD_OP_LOG_ROTATE;
char *volname = NULL;
GF_ASSE... | false | false | false | true | false | 1 |
wifi_utils_is_wifi (const char *iface, const char *sysfs_path)
{
char phy80211_path[255];
struct stat s;
g_return_val_if_fail (iface != NULL, FALSE);
if (sysfs_path) {
/* Check for nl80211 sysfs paths */
snprintf (phy80211_path, sizeof (phy80211_path), "%s/phy80211", sysfs_path);
if ((stat (phy80211_path, &... | true | true | false | false | false | 1 |
threadSend(int m) {
pthread_mutex_lock(&t_messages_mutex);
if (pthread_self() == threadId) {
m *= -1;
}
t_messages.push_back(m);
pthread_mutex_unlock(&t_messages_mutex);
} | false | false | false | false | false | 0 |
get_num_tokens(char *str)
{
int namecount = 0;
if (!str)
return namecount;
while (*str != EOS) {
str += strspn(str, WHITESPACE);
if (*str == EOS)
break;
str += strcspn(str, WHITESPACE);
namecount++;
}
return namecount;
} | false | false | false | false | false | 0 |
hmc5843_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{
struct hmc5843_data *data = iio_priv(indio_dev);
int rate, range;
switch (mask) {
case IIO_CHAN_INFO_SAMP_FREQ:
rate = hmc5843_get_samp_freq_index(data, val, val2);
if (rate < 0)
re... | false | false | false | false | false | 0 |
secfile_insert_str_full(struct section_file *secfile,
const char *string,
const char *comment,
bool allow_replace,
bool no_escape, const char *path, ...)
{
char fullp... | false | false | false | false | false | 0 |
loadPageSetup()
{
QPrinter *printer = d->printer;
if (! printer)
d->printer = printer = new QPrinter;
QSettings s;
if (s.contains("printer/pageSize"))
{
int n = s.value("printer/pageSize").toInt();
if (n >= 0 || n < QPrinter::Custom)
printer->setPaperSize((QPrinter::PageSize)n);
... | false | false | false | false | false | 0 |
value_name_list_by_control(const std::string& mode, uint8_t channel, uint8_t number)
{
boost::shared_ptr<ChannelNameSet> chan_names = channel_name_set_by_channel(mode, channel);
if (!chan_names) {
return boost::shared_ptr<const ValueNameList>();
}
boost::shared_ptr<ControlNameList> control_names = control_name_l... | false | false | false | false | false | 0 |
fm_irq_handle_rds_start(struct fmdev *fmdev)
{
if (fmdev->irq_info.flag & FM_RDS_EVENT & fmdev->irq_info.mask) {
fmdbg("irq: rds threshold reached\n");
fmdev->irq_info.stage = FM_RDS_SEND_RDS_GETCMD_IDX;
} else {
/* Continue next function in interrupt handler table */
fmdev->irq_info.stage = FM_HW_TUNE_OP_END... | false | false | false | false | false | 0 |
cp_eat_space(String &str)
{
const char *begin = str.begin(), *end = str.end();
const char *space = cp_skip_space(begin, end);
str = str.substring(space, end);
return space != begin;
} | false | false | false | false | false | 0 |
stripe_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct statvfs *stbuf)
{
stripe_local_t *local = NULL;
int32_t callcnt = 0;
if (!this || !frame || !frame->local) {
gf_log ("stripe", GF_LOG_DEBUG, ... | false | false | false | false | false | 0 |
zero_hepevt_entry( int i ) const {
if ( i <=0 || i > HepMC::HEPEVT_Wrapper::max_number_entries() ) return;
HEPEVT_Wrapper::set_status( i, 0 );
HEPEVT_Wrapper::set_id( i, 0 );
HEPEVT_Wrapper::set_parents( i, 0, 0 );
HEPEVT_Wrapper::set_children( i, 0, 0 );
HEPEVT_Wrapper::set_momentum... | false | false | false | false | false | 0 |
__fops_poll(struct file *file, struct poll_table_struct *wait)
{
struct video_device *vdev = video_devdata(file);
struct saa7146_fh *fh = file->private_data;
struct videobuf_buffer *buf = NULL;
struct videobuf_queue *q;
unsigned int res = v4l2_ctrl_poll(file, wait);
DEB_EE("file:%p, poll:%p\n", file, wait);
if... | false | false | false | false | false | 0 |
get_indexpath_pages(Path *bitmapqual)
{
double result = 0;
ListCell *l;
if (IsA(bitmapqual, BitmapAndPath))
{
BitmapAndPath *apath = (BitmapAndPath *) bitmapqual;
foreach(l, apath->bitmapquals)
{
result += get_indexpath_pages((Path *) lfirst(l));
}
}
else if (IsA(bitmapqual, BitmapOrPath))
{
Bi... | false | false | false | false | false | 0 |
processError(const char *format, va_list args,
const char *errorType, int disposition) {
// Report error
if (disposition == PBRT_ERROR_IGNORE)
return;
// Build up an entire formatted error string and print it all at once;
// this way, if multiple threads are printing messages at once, t... | false | false | false | false | false | 0 |
gnc_budget_lookup (const GncGUID *guid, const QofBook *book)
{
QofCollection *col;
g_return_val_if_fail(guid, NULL);
g_return_val_if_fail(book, NULL);
col = qof_book_get_collection (book, GNC_ID_BUDGET);
return GNC_BUDGET(qof_collection_lookup_entity (col, guid));
} | false | false | false | false | false | 0 |
validate(const char *pString_,unsigned row_)
{ return (MSView::model()!=0)?((list().set(row_,pString_)==MSError::MSSuccess)?MSTrue:MSFalse):MSTrue; } | false | false | false | false | false | 0 |
uvd_v6_0_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
if (!(adev->cg_flags & AMD_CG_SUPPORT_UVD_MGCG))
return 0;
if (enable) {
if (adev->flags & AMD_IS_APU)... | false | false | false | false | false | 0 |
setCompletedText( const QString& t, bool marked )
{
if ( !d->autoSuggest )
return;
const QString txt = text();
if ( t != txt )
{
setText(t);
if ( marked )
setSelection(t.length(), txt.length()-t.length());
setUserSelection(false);
}
else
setUserS... | false | false | false | false | false | 0 |
iscsi_session_recovery_timedout(struct iscsi_cls_session *cls_session)
{
struct iscsi_session *session = cls_session->dd_data;
spin_lock_bh(&session->lock);
if (session->state != ISCSI_STATE_LOGGED_IN) {
session->state = ISCSI_STATE_RECOVERY_FAILED;
if (session->leadconn)
wake_up(&session->leadconn->ehwait);... | false | false | false | false | false | 0 |
fserve_recheck_mime_types (ice_config_t *config)
{
FILE *mimefile;
char line[4096];
char *type, *ext, *cur;
mime_type *mapping;
avl_tree *new_mimetypes;
if (config->mimetypes_fn == NULL)
return;
mimefile = fopen (config->mimetypes_fn, "r");
if (mimefile == NULL)
{
WA... | true | true | false | false | true | 1 |
insertFloatImage(float a[], int sizex, int sizey,
int x, int y, int nx, int ny, float region[])
{
int i,j;
char modName[] = "insertFloatImage";
if (x >= 0 && y >= 0 && sizex >= x + nx && sizey >= y + ny)
{
for (i=0; i<ny; i++)
{
for (j=0; j<nx; j++)
{
a[sizex*(y+i)+x+j] = regio... | false | false | false | false | false | 0 |
object_verify_double_null(const lListElem *ep, lList **answer_list, int nm)
{
bool ret = true;
if (lGetDouble(ep, nm) != 0.0) {
answer_list_add_sprintf(answer_list, STATUS_ESYNTAX, ANSWER_QUALITY_ERROR,
MSG_OBJECT_DOUBLE_NULL, lNm2Str(nm));
ret = false;
}
return ... | 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.