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 |
|---|---|---|---|---|---|---|
downloads_gui_range_string(const struct download *d)
{
static char buf[256];
char range_start[64];
const char *and_more = "";
filesize_t length;
gboolean metric;
download_check(d);
if (d->file_info->use_swarming) {
length = d->chunk.size;
if (d->chunk.end > d->chunk.start + d->chunk.size)
and_more = "+"... | false | false | false | false | false | 0 |
gsb_automem_entry_changed (GtkWidget *entry,
gpointer null )
{
gchar **data;
data = g_object_get_data ( G_OBJECT ( entry ), "pointer");
if (data)
{
if ( *data )
g_free ( *data );
*data = my_strdup (gtk_entry_get_text ( GTK_ENTRY (entry) ));
if ( etat.modification_fichier == 0 )
... | false | false | false | false | false | 0 |
apply_vbr_preset(lame_global_flags * gfp, int a, int enforce)
{
vbr_presets_t const *vbr_preset = get_vbr_preset(lame_get_VBR(gfp));
float x = gfp->VBR_q_frac;
vbr_presets_t p = vbr_preset[a];
vbr_presets_t q = vbr_preset[a + 1];
vbr_presets_t const *set = &p;
NOOP(vbr_q);
NOOP(quant_comp... | false | false | false | false | false | 0 |
profilesToXmlnode( void ) {
xmlnode *node, *child;
GList *cur;
node = xmlnode_new( "profile" );
xmlnode_set_attrib( node, "version", "1.0" );
for ( cur = getProfiles(); cur != NULL; cur = cur -> next ) {
child = profileToXmlnode( cur -> data );
xmlnode_insert_child( node, child );
}
if ( psActiveProfile !... | false | false | false | false | false | 0 |
gwy_data_view_make_pixmap(GwyDataView *data_view)
{
const GtkAllocation *alloc;
GtkWidget *widget;
gint width, height, scwidth, scheight;
if (!data_view->xres || !data_view->yres) {
gwy_object_unref(data_view->base_pixbuf);
return;
}
if (data_view->base_pixbuf) {
width ... | false | false | false | false | false | 0 |
fft_synth_sanitize_args(FFTSynthArgs *args)
{
args->active_page = CLAMP(args->active_page,
PAGE_DIMENSIONS, PAGE_NPAGES-1);
args->update = !!args->update;
args->seed = MAX(0, args->seed);
args->randomize = !!args->randomize;
args->freq_min = CLAMP(args->freq_min, 0.0, G... | false | false | false | false | false | 0 |
clk_sp810_of_setup(struct device_node *node)
{
struct clk_sp810 *sp810 = kzalloc(sizeof(*sp810), GFP_KERNEL);
const char *parent_names[2];
int num = ARRAY_SIZE(parent_names);
char name[12];
struct clk_init_data init;
static int instance;
int i;
bool deprecated;
if (!sp810) {
pr_err("Failed to allocate memor... | false | false | false | false | false | 0 |
category_group_list_free (GList *groups)
{
GList *ptr;
for (ptr = groups; ptr != NULL; ptr = ptr->next) {
FormatTemplateCategoryGroup *group = ptr->data;
g_free (group->name);
g_free (group->description);
category_list_free (group->categories);
g_free (group);
}
g_list_free (groups);
} | false | false | false | false | false | 0 |
debris_clear_expired_flag(debris *db)
{
if ( db->flags & DEBRIS_EXPIRE ) {
db->flags &= ~DEBRIS_EXPIRE;
if ( db->is_hull ) {
Num_hull_pieces--;
list_remove(Hull_debris_list, db);
Assert( Num_hull_pieces >= 0 );
}
}
} | false | false | false | false | false | 0 |
object_cache_tests_test_create (ObjectCacheTests* self) {
TestCache* cache = NULL;
TestCache* _tmp0_ = NULL;
#line 149 "/home/treitter/collabora/folks/tests/folks/object-cache.vala"
g_return_if_fail (self != NULL);
#line 152 "/home/treitter/collabora/folks/tests/folks/object-cache.vala"
_tmp0_ = test_cache_new ("te... | false | false | false | false | false | 0 |
ensAssemblyexceptionfeatureadaptorFetchByIdentifier(
EnsPAssemblyexceptionfeatureadaptor aefa,
ajuint identifier,
EnsPAssemblyexceptionfeature *Paef)
{
AjBool result = AJFALSE;
if (!aefa)
return ajFalse;
if (!identifier)
return ajFalse;
if (!Paef)
return ajFalse;
... | false | false | false | false | false | 0 |
setSettings(SegmentSettings settings)
{
for (SegmentLine* line = m_lines.first(); line; line = m_lines.next())
{
ASSERT_ENGAUGE(line != 0);
line->setPen(PointSetStyles::instance().pointSetPen(settings.lineColor, settings.lineSize));
}
} | false | false | false | false | false | 0 |
DXLNewEvent(int serialId, DXLPacketTypeEnum ptype, const char *msg)
{
int msgsize = 0;
DXLEvent *event = (DXLEvent*)malloc(sizeof(DXLEvent));
if (!event)
return NULL;
event->serial = serialId;
event->type = ptype;
if (msg) {
msgsize = strlen(msg) + 1;
if (msgsize > DXL_... | false | true | false | false | false | 1 |
update_realtime_member_field(struct member *mem, const char *queue_name, const char *field, const char *value)
{
int ret = -1;
if (ast_strlen_zero(mem->rt_uniqueid)) {
return ret;
}
if ((ast_update_realtime("queue_members", "uniqueid", mem->rt_uniqueid, field, value, SENTINEL)) > 0) {
ret = 0;
}
return re... | false | false | false | false | false | 0 |
getExtension() const
{
std::string::size_type pos = _name.rfind('.');
if (pos != std::string::npos)
return _name.substr(pos + 1);
else
return std::string();
} | false | false | false | false | false | 0 |
ibx_enable_hdmi(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
u32 temp;
temp = I915_READ(intel_hdmi-... | false | false | false | false | false | 0 |
edit_config(arg)
CONST char *arg;
{
if (!arg && FILEPERROW < WFILEMINCUSTOM) {
warning(0, NOROW_K);
return(FNC_CANCEL);
}
if (customize(arg) <= 0) return(FNC_CANCEL);
return(FNC_EFFECT);
} | false | false | false | false | false | 0 |
processIOPacket(ArRobotPacket *packet)
{
int i, num;
if (packet->getID() != 0xf0)
return false;
myLastIOPacketReceivedTime = packet->getTimeReceived();
// number of DigIn bytes
num = packet->bufToUByte();
for (i = 0; i < num; ++i)
myIODigIn[i] = packet->bufToUByte();
myIODigInSize = num;
// ... | false | false | false | false | false | 0 |
istgt_add_transfer_task(CONN_Ptr conn, ISTGT_LU_CMD_Ptr lu_cmd)
{
ISTGT_R2T_TASK_Ptr r2t_task;
uint32_t transfer_len;
uint32_t transfer_tag;
int first_burst_len;
int max_burst_len;
int data_len;
int offset = 0;
int len;
int idx;
int rc;
MTX_LOCK(&conn->r2t_mutex);
if (conn->pending_r2t >= conn->max_r2t) {
... | false | false | false | false | false | 0 |
H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
void *thing, unsigned UNUSED *flags_ptr)
{
H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* Local heap prefix to flush */
H5WB_t *wb = NULL; /* Wrapped buffer for heap data */
uint8_t heap_buf[H5HL_SPEC_READ_SIZE]; ... | false | false | false | false | false | 0 |
dht_rename_links_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
inode_t *inode, struct iatt *stbuf,
struct iatt *preparent, struct iatt *postparent,
dict_... | false | false | false | false | false | 0 |
xmlSecDSigCtxProcessObjectNode(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node) {
xmlNodePtr cur;
int ret;
xmlSecAssert2(dsigCtx != NULL, -1);
xmlSecAssert2(dsigCtx->status == xmlSecDSigStatusUnknown, -1);
xmlSecAssert2(node != NULL, -1);
/* we care about Manifest nodes only; ignore everything ... | false | false | false | false | false | 0 |
path_matrix_fill(GthPathMatrix *pm, GthPath **path, GtRowInfo *ri)
{
unsigned long genptr, refptr, genidx, refidx;
GthPath e_path, i_path;
bool lower;
for (genptr = pm->gen_range.start; genptr <= pm->gen_range.end; genptr++) {
for (refptr = pm->ref_range.start; refptr <= pm->ref_range.end; refptr++) {
... | false | false | false | false | false | 0 |
vector_to_index(vthread_t thr, unsigned base,
unsigned width, bool signed_flag)
{
uint64_t v = 0;
bool unknown_flag = false;
vvp_bit4_t vv = BIT4_0;
for (unsigned i = 0 ; i < width ; i += 1) {
vv = thr_get_bit(thr, base);
if (bit4_is_xz(vv)) {
v =... | false | false | false | false | false | 0 |
nlPreconditioner_SSOR(NLdouble* x, NLdouble* y) {
NLdouble omega = nlCurrentContext->omega ;
static double* work = NULL ;
static int work_size = 0 ;
NLuint n = nlCurrentContext->n ;
if(n != work_size) {
work = NL_RENEW_ARRAY(NLdouble, work, n) ;
work_size = n ;
}
nlMultL... | false | false | false | false | false | 0 |
inf_adopted_split_operation_unsplit_impl(InfAdoptedSplitOperation* operation,
GSList** list)
{
InfAdoptedSplitOperationPrivate* priv;
priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(operation);
/* Since we prepend the entries to the list, we begin with the second
* operatio... | false | false | false | false | false | 0 |
place_garden(int room)
{
struct roominfo *ri = &rooms[room];
int x1 = ri->x;
int y1 = ri->y;
int x2 = x1 + ri->w - 1;
int y2 = y1 + ri->h - 1;
int i, j;
int num;
for (i = y1; i <= y2; i++)
for (j = x1; j <= x2; j++)
mapgen_set_floor(j, i, ISO_OVERLAY_FLOOR_SAND_WITH_GRASS_1 + MyRandom(4));
// Cycle thro... | false | false | false | false | false | 0 |
timedate1_proxy_set_property_cb (GDBusProxy *proxy,
GAsyncResult *res,
gpointer user_data)
{
const _ExtendedGDBusPropertyInfo *info = user_data;
GError *error;
error = NULL;
if (!g_dbus_proxy_call_finish (proxy, res, &error))
{
g_warning ("Error setting property `%s' on interface org.freedesk... | false | false | false | false | false | 0 |
ACL_ParseString( NSErr_t *errp, char *buffer )
{
ACLListHandle_t *handle = NULL;
int eid = 0;
int rv = 0;
const char *errmsg;
ACL_InitAttr2Index();
if ( acl_parse_crit == NULL )
acl_parse_crit = crit_init();
crit_enter( acl_parse_crit );
if ( acl_InitScanner( errp, NULL, buffer ) < 0 ... | false | false | false | false | false | 0 |
dapm_idle_bias_off(struct snd_soc_dapm_context *dapm)
{
if (dapm->idle_bias_off)
return true;
switch (snd_power_get_state(dapm->card->snd_card)) {
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
return dapm->suspend_bias_off;
default:
break;
}
return false;
} | false | false | false | false | false | 0 |
rb_gst_process_embedded_image (const GstTagList *taglist, const char *tag)
{
GstSample *sample;
GstMapInfo mapinfo;
GdkPixbufLoader *loader;
GdkPixbuf *pixbuf;
GError *error = NULL;
const GValue *val = NULL;
guint i;
for (i = 0; ; i++) {
const GValue *value;
const char *media_type;
GstStructure *caps_str... | false | false | false | false | false | 0 |
os_time (lua_State *L) {
time_t t;
if (lua_isnoneornil(L, 1)) /* called without args? */
t = time(NULL); /* get current time */
else {
struct tm ts;
luaL_checktype(L, 1, LUA_TTABLE);
lua_settop(L, 1); /* make sure table is at the top */
ts.tm_sec = getfield(L, "sec", 0);
ts.tm_min = get... | false | false | false | false | false | 0 |
mapif_save_pet(int fd,int account_id,struct s_pet *data)
{
if(sizeof(struct s_pet) != RFIFOW(fd,2) - 8) {
printf("inter pet: data size error %lu %d\n",(unsigned long)sizeof(struct s_pet),RFIFOW(fd,2)-8);
return 0;
}
if(petdb_load(data->pet_id)) {
if(data->hungry < 0)
data->hungry = 0;
else if(data->hungr... | false | false | false | false | false | 0 |
settings_window_layouts_populate()
{
START_FUNC
GtkTreeIter iter;
GtkCellRenderer *cell;
DIR *dp=opendir(DATADIR "/layouts");
struct dirent *ep;
gchar *name;
struct layout *layout;
struct layout_infos *infos;
if (dp!=NULL) {
if (settings_window->layout_list) {
gtk_list_store_clear(settings_window->layout... | false | false | false | false | false | 0 |
_state_set_all(Elm_Radio_Smart_Data *sd)
{
const Eina_List *l;
Eina_Bool disabled = EINA_FALSE;
Evas_Object *child, *selected = NULL;
EINA_LIST_FOREACH (sd->group->radios, l, child)
{
ELM_RADIO_DATA_GET(child, sdc);
if (sdc->state) selected = child;
if (sdc->value == sd->group... | false | false | false | false | false | 0 |
_wi_runtime_zombie_abort(wi_runtime_instance_t *instance) {
wi_pool_t *pool;
pool = wi_pool_init(wi_pool_alloc());
WI_ASSERT(0, "%p %@ is a deallocated instance", instance, instance);
wi_release(pool);
} | false | false | false | false | false | 0 |
panel_detach(struct parport *port)
{
if (port->number != parport)
return;
if (!pprt) {
pr_err("%s: port->number=%d parport=%d, nothing to unregister.\n",
__func__, port->number, parport);
return;
}
if (scan_timer.function)
del_timer_sync(&scan_timer);
if (pprt) {
if (keypad.enabled) {
misc_... | false | false | false | false | false | 0 |
L7()
{register object *base=vs_base;
register object *sup=base+VM7; VC7
vs_check;
{object V17;
object V18;
object V19;
object V20;
V17=(base[0]);
V18=(base[1]);
V19=(base[2]);
V20=(base[3]);
vs_top=sup;
goto TTL;
TTL:;
base[4]= (V19);
base[5]= ((object)VV[36]);
vs_top=(vs_base=base+4)+2;
(void) (*Lnk94)... | false | false | false | false | false | 0 |
cifs_idmap_sid_to_str(void *handle __attribute__ ((unused)),
const struct cifs_sid *csid, char **string)
{
int rc;
wbcErr wbcrc;
char *domain = NULL;
char *name = NULL;
enum wbcSidType sntype;
struct wbcDomainSid wsid;
size_t len;
csid_to_wsid(&wsid, csid);
wbcrc = wbcLookupSid(&wsid, &domain, &name, &snt... | false | false | false | false | false | 0 |
gitno_connect(gitno_socket *s_out, const char *host, const char *port, int flags)
{
struct addrinfo *info = NULL, *p;
struct addrinfo hints;
GIT_SOCKET s = INVALID_SOCKET;
int ret;
#ifdef GIT_WIN32
/* on win32, the WSA context needs to be initialized
* before any socket calls can be performed */
WSADATA wsd;
... | false | false | false | false | false | 0 |
__subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data,
struct ib_device *ibdev, u8 port,
u32 *resp_len)
{
struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
u32 n_blocks_sent = OPA_AM_NBLK(am);
u32 start_block = am & 0x7ff;
u16 *p = (u16 *) data;
__be16 *q = (__be16 *)data;
int i;
u16 n_blo... | false | false | false | false | false | 0 |
ensOntologyNewIni(EnsPOntologyadaptor oa,
ajuint identifier,
AjPStr name,
AjPStr space)
{
EnsPOntology ontology = NULL;
if (!name)
return NULL;
AJNEW0(ontology);
ontology->Use = 1U;
ontolog... | false | false | false | false | false | 0 |
setIcmpCodeFromName(const QString &s)
{
if (icmp_code_names.count(s) > 0)
{
icmp_code = icmp_code_names[s];
} else
error_tracker->registerError(
QString("ICMP code name '%1' is unknown").arg(s));
} | false | false | false | false | false | 0 |
e_book_remove_contact_by_id_async (EBook *book,
const gchar *id,
EBookAsyncCallback cb,
gpointer closure)
{
AsyncData *data;
g_return_val_if_fail (E_IS_BOOK (book), FALSE);
g_return_val_if_fail (id != NULL, FALS... | false | false | false | false | false | 0 |
interleave_nodes(struct mempolicy *policy)
{
unsigned nid, next;
struct task_struct *me = current;
nid = me->il_next;
next = next_node(nid, policy->v.nodes);
if (next >= MAX_NUMNODES)
next = first_node(policy->v.nodes);
if (next < MAX_NUMNODES)
me->il_next = next;
return nid;
} | false | false | false | false | false | 0 |
PointDataNeedToReadTimeStep(vtkXMLDataElement *eNested)
{
// First thing need to find the id of this dataarray from its name:
const char* name = eNested->GetAttribute("Name");
int idx = this->PointDataArraySelection->GetEnabledArrayIndex(name);
// Easy case no timestep:
int numTimeSteps = eNested->GetVectorA... | false | false | false | false | false | 0 |
std_name_parser (char const *str,
G_GNUC_UNUSED GnmConventions const *convs)
{
gunichar uc = g_utf8_get_char (str);
if (!g_unichar_isalpha (uc) && uc != '_' && uc != '\\')
return NULL;
do {
str = g_utf8_next_char (str);
uc = g_utf8_get_char (str);
} while (g_unichar_isalnum (uc) ||
uc == '_' ||
uc ... | false | false | false | false | false | 0 |
Lock() {
int result = pthread_mutex_lock(&mInternal->mutex);
if (result != 0) {
GOOGLE_LOG(FATAL) << "pthread_mutex_lock: " << strerror(result);
}
} | false | false | false | false | false | 0 |
findTextBegin()
{
d->m_findPos = -1;
d->m_findNode = 0;
d->m_findPosEnd = -1;
d->m_findNodeEnd= 0;
d->m_findPosStart = -1;
d->m_findNodeStart = 0;
d->m_findNodePrevious = 0;
delete d->m_find;
d->m_find = 0L;
} | false | false | false | false | false | 0 |
getsecs(const char *strp, long * const secsp)
{
int num;
/*
** `HOURSPERDAY * DAYSPERWEEK - 1' allows quasi-Posix rules like
** "M10.4.6/26", which does not conform to Posix,
** but which specifies the equivalent of
** ``02:00 on the first Sunday on or after 23 Oct''.
*/
strp = getnum(strp, &num, 0, HOURSPERDA... | false | false | false | false | false | 0 |
setMaterialShininess(GLfloat shininess)
{
if (shininess != mShininess)
{
mShininess = shininess;
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, mShininess);
}
} | false | false | false | false | false | 0 |
octeon_setup_output_queues(struct octeon_device *oct)
{
u32 i, num_oqs = 0;
u32 num_descs = 0;
u32 desc_size = 0;
/* this causes queue 0 to be default queue */
if (OCTEON_CN6XXX(oct)) {
/* CFG_GET_OQ_MAX_BASE_Q(CHIP_FIELD(oct, cn6xxx, conf)); */
num_oqs = 1;
num_descs =
CFG_GET_NUM_DEF_RX_DESCS(CHIP_FIEL... | false | false | false | false | false | 0 |
free_attributes(bgav_sdp_attr_t ** attr)
{
int index;
if(!attr || !(*attr))
return;
index = 0;
while((*attr)[index].type != BGAV_SDP_TYPE_NONE)
{
MY_FREE((*attr)[index].name);
switch((*attr)[index].type)
{
case BGAV_SDP_TYPE_NONE:
return;
case BGAV_SDP_TYPE_INT:
... | false | false | false | false | false | 0 |
get_client_class(struct Client *acptr)
{
struct SLink *tmp;
struct ConnectionClass *cl;
/* Return the most recent(first on LL) client class... */
if (acptr && !IsMe(acptr) && (cli_confs(acptr)))
for (tmp = cli_confs(acptr); tmp; tmp = tmp->next)
{
if (tmp->value.aconf && (cl = tmp->value.aconf->c... | false | false | false | false | false | 0 |
MExMirrPPU(uint32 A) {
static int8 lastmirr = -1, curmirr;
if (A < 0x2000) {
lastppu = A >> 10;
curmirr = mcache[lastppu];
if (curmirr != lastmirr) {
setmirror(MI_0 + curmirr);
lastmirr = curmirr;
}
}
} | false | false | false | false | false | 0 |
uv_exepath(char* buffer, size_t* size) {
if (!buffer || !size) {
return -1;
}
*size = readlink("/proc/self/exe", buffer, *size - 1);
if (*size <= 0) return -1;
buffer[*size] = '\0';
return 0;
} | false | false | false | false | false | 0 |
sim_main(void)
{
md_inst_t inst;
register md_addr_t addr, target_PC = 0;
enum md_opcode op;
register int is_write;
int stack_idx;
enum md_fault_type fault;
fprintf(stderr, "sim: ** starting functional simulation w/ predictors **\n");
/* set up initial default next PC */
regs.regs_NPC = regs.regs_PC ... | false | false | false | false | false | 0 |
_sql_identifier_needs_quotes (const gchar *str)
{
const gchar *ptr;
g_return_val_if_fail (str, FALSE);
for (ptr = str; *ptr; ptr++) {
/* quote if 1st char is a number */
if ((*ptr <= '9') && (*ptr >= '0')) {
if (ptr == str)
return TRUE;
continue;
}
if (((*ptr >= 'A') && (*ptr <= 'Z')) ||
((*... | false | false | false | false | false | 0 |
gf_log_set_callback(void *usr_cbk, gf_log_cbk cbk)
{
gf_log_cbk prev_cbk = log_cbk;
log_cbk = cbk;
if (!log_cbk) log_cbk = default_log_callback;
user_log_cbk = usr_cbk;
return prev_cbk;
} | false | false | false | false | false | 0 |
sign_test (const double *x, const double *y,
int v1, int v2, const DATASET *dset,
double *result, gretlopt opt, PRN *prn)
{
double pv;
int n, w, t;
n = w = 0;
for (t=dset->t1; t<=dset->t2; t++) {
if (!na(x[t]) && !na(y[t]) && x[t] != y[t]) {
w += (x[t] > y[t]);
n++;
}
}... | false | false | false | false | false | 0 |
bytestoword32 (WORD32 *x, const char *pt) {
int i;
for (i=0; i<16; i++) {
int j=i*4;
x[i] = (((WORD32)(unsigned char)pt[j+3] << 8 |
(WORD32)(unsigned char)pt[j+2]) << 8 |
(WORD32)(unsigned char)pt[j+1]) << 8 |
(WORD32)(unsigned char)pt[j];
}
} | false | false | false | false | false | 0 |
gst_capsfilter_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstCapsFilter *capsfilter = GST_CAPSFILTER (object);
switch (prop_id) {
case PROP_FILTER_CAPS:{
GstCaps *new_caps;
GstCaps *old_caps, *suggest, *nego;
const GstCaps *new_caps_val = gs... | false | false | false | false | false | 0 |
set_fld_rng(struct fld_rng *fr, char *arg1, char *arg2) {
char *folder = arg1;
char *range = NULL, *last = NULL;
char *p;
if (arg1 != NULL) range = strchr(arg1, SP);
if (range == NULL)
range = arg2;
else
*range++ = NUL;
if (range == NULL)
fr->first = fr->last = fr->num = 0;
else if (strncmp(range, "last:... | false | false | false | false | false | 0 |
TrimSelection(SelectionRange range) {
for (size_t i=0; i<ranges.size();) {
if ((i != mainRange) && (ranges[i].Trim(range))) {
// Trimmed to empty so remove
for (size_t j=i; j<ranges.size()-1; j++) {
ranges[j] = ranges[j+1];
if (j == mainRange-1)
mainRange--;
}
ranges.pop_back();
} else {
... | false | false | false | false | false | 0 |
GC_is_heap_ptr(const void *p)
{
bottom_index *bi;
GC_ASSERT(GC_is_initialized);
GET_BI(p, bi);
return HDR_FROM_BI(bi, p) != 0;
} | false | false | false | false | false | 0 |
gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
{
QofBook *book;
Transaction *gnc_trans;
const gchar *fitid;
const GWEN_TIME *valuta_date;
time64 current_time;
const char *custref;
gchar *description;
Split *split;
gchar *memo;
g_return_val_if_fail(ab_trans... | false | false | false | false | false | 0 |
update_change_cb(CCViewControls *controls)
{
controls->args->update
= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(controls->update));
gtk_dialog_set_response_sensitive(GTK_DIALOG(controls->dialog),
RESPONSE_PREVIEW,
... | false | false | false | false | false | 0 |
AtEOXact_Namespace(bool isCommit)
{
/*
* If we abort the transaction in which a temp namespace was selected,
* we'll have to do any creation or cleanout work over again. So, just
* forget the namespace entirely until next time. On the other hand, if
* we commit then register an exit callback to clean out the... | false | false | false | false | false | 0 |
os_unlink(const nstring &path)
{
trace(("os_unlink(path = \"%s\")\n{\n", path.c_str()));
os_become_must_be_active();
//
// We must check that we are not unlinking a directory,
// because we are set-uid-root, and root can unlink directories!
//
struct stat st;
#ifdef S_IFLNK
int oret = g... | false | false | false | false | false | 0 |
wl1271_acx_cca_threshold(struct wl1271 *wl)
{
struct acx_energy_detection *detection;
int ret;
wl1271_debug(DEBUG_ACX, "acx cca threshold");
detection = kzalloc(sizeof(*detection), GFP_KERNEL);
if (!detection) {
ret = -ENOMEM;
goto out;
}
detection->rx_cca_threshold = cpu_to_le16(wl->conf.rx.rx_cca_thresh... | false | false | false | false | false | 0 |
WLDGetString( const string &name )
{
map <string, string>::iterator str_iter;
if((str_iter = WLDStringStorage.find(name)) != WLDStringStorage.end() )
return str_iter->second;
return WLDEmptyStr;
} | false | false | false | false | false | 0 |
SpellHit(Unit* pCaster, const SpellEntry* pSpell) override
{
if (pCaster->GetTypeId() == TYPEID_PLAYER && (pSpell->Id == SPELL_FLARE || pSpell->Id == SPELL_FOLLY))
{
++m_uiFlareCount;
if (m_uiFlareCount >= 2 && m_creature->getFaction() != FACTION_FRIENDLY_F)
{
... | false | false | false | false | false | 0 |
wm831x_status_src_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct wm831x_status *led = to_wm831x_status(led_cdev);
int i;
ssize_t ret = 0;
mutex_lock(&led->mutex);
for (i = 0; i < ARRAY_SIZE(led_src_texts); i++)
if (i ... | false | true | false | false | false | 1 |
_overlay_group_coord_member_update(Overlay_Group *grp,
Evas_Coord x,
Evas_Coord y,
Eina_List *members)
{
char text[32];
EINA_SAFETY_ON_NULL_RETURN(grp);
if (!grp->ovl) return;
_overlay_default_coord_s... | true | true | false | false | false | 1 |
block_dump___mark_inode_dirty(struct inode *inode)
{
if (inode->i_ino || strcmp(inode->i_sb->s_id, "bdev")) {
struct dentry *dentry;
const char *name = "?";
dentry = d_find_alias(inode);
if (dentry) {
spin_lock(&dentry->d_lock);
name = (const char *) dentry->d_name.name;
}
printk(KERN_DEBUG
... | false | false | false | false | false | 0 |
ixgbe_dbg_netdev_ops_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{
struct ixgbe_adapter *adapter = filp->private_data;
int len;
/* don't allow partial writes */
if (*ppos != 0)
return 0;
if (count >= sizeof(ixgbe_dbg_netdev_ops_buf))
return -ENOSPC;
len = si... | false | false | false | false | false | 0 |
FuzzyStrCmp(const wxString& a, const wxString& b)
{
size_t aCookie = 0, bCookie = 0;
wxString aField, bField;
do {
aField = GetNextField(a, aCookie);
bField = GetNextField(b, bCookie);
if (aField.IsNumber() && bField.IsNumber()) {
unsigned long aInteger = StrToULong(aField);
unsigned long bInteger = St... | false | false | false | false | false | 0 |
DLM_QueueUpdateHub( CString nick, CString hubname )
{
m_pDownloadQueue->pQueueMutex->Lock();
bool res = false;
DCConfigHubItem hubitem;
DCTransferQueueObject * TransferObject;
if ( (TransferObject = m_pDownloadQueue->GetUserTransferObject( nick, hubname, CString() )) != 0 )
{
if ( (res = CConfig::Instance()->... | false | false | false | false | false | 0 |
command_dump (argc, argv)
int argc;
char *argv[];
{
int begin, length;
char *s;
EB_Position pos;
begin = 1;
s = variable_ref ("max-dump");
length = s ? (atoi (s) / EB_SIZE_PAGE) : (MAX_DUMP_SIZE / EB_SIZE_PAGE);
if (length == 0)
length = 1;
switch (argc) {
case 1:
xprintf ("%s: too... | false | false | false | false | false | 0 |
pop_cost_one_pair (coalesce_list_p cl, int *p1, int *p2)
{
cost_one_pair_p ptr;
ptr = cl->cost_one_list;
if (!ptr)
return NO_BEST_COALESCE;
*p1 = ptr->first_element;
*p2 = ptr->second_element;
cl->cost_one_list = ptr->next;
free (ptr);
return 1;
} | false | false | false | false | false | 0 |
may_umount(struct vfsmount *mnt)
{
int ret = 1;
down_read(&namespace_sem);
lock_mount_hash();
if (propagate_mount_busy(real_mount(mnt), 2))
ret = 0;
unlock_mount_hash();
up_read(&namespace_sem);
return ret;
} | false | false | false | false | false | 0 |
Command_Py(char *word[], char *word_eol[], void *userdata)
{
char *cmd = word[2];
int ok = 0;
if (strcasecmp(cmd, "LIST") == 0) {
ok = 1;
Command_PyList();
} else if (strcasecmp(cmd, "EXEC") == 0) {
if (word[3][0]) {
ok = 1;
IInterp_Exec(word_eol[3]);
}
} else if (strcasecmp(cmd, "LOAD") == 0) {
if... | false | false | false | false | false | 0 |
static_site (double *input, const char **wyckoff,
const int *driver, int n_positions, double *positions, gamgi_bool *equal)
{
double *positions_new;
int n_positions_new;
int start, end;
int site, n_equal;
positions_new = (double *) malloc (3 * n_positions * sizeof (double));
for (site = 1; site <= driver[0]; site++)
... | false | false | false | false | false | 0 |
boardReset()
{
d_boardCellDiscovered = 0;
for(size_t i = 0 ; i < MinesweeperSize ; ++i)
{
for(size_t j = 0 ; j < MinesweeperSize ; ++j)
{
d_board[i][j] = 0;
}
}
} | false | false | false | false | false | 0 |
RequestDataObject(
vtkInformation*,
vtkInformationVector** inputVector ,
vtkInformationVector* outputVector)
{
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
if (!inInfo)
{
return 0;
}
vtkPointSet *input = vtkPointSet::SafeDownCast(
inInfo->Get(vtkDataObject::DATA_OBJECT... | false | false | false | false | false | 0 |
qib_7322_init_hwerrors(struct qib_devdata *dd)
{
int pidx;
u64 extsval;
extsval = qib_read_kreg64(dd, kr_extstatus);
if (!(extsval & (QIB_EXTS_MEMBIST_DISABLED |
QIB_EXTS_MEMBIST_ENDTEST)))
qib_dev_err(dd, "MemBIST did not complete!\n");
/* never clear BIST failure, so reported on each driver load */
qib_... | false | false | false | false | false | 0 |
ib_cmrc_complete_recv ( struct ib_device *ibdev __unused,
struct ib_queue_pair *qp,
struct ib_address_vector *dest __unused,
struct ib_address_vector *source __unused,
struct io_buffer *iobuf, int rc ) {
struct ib_cmrc_connection *cmrc = ib_qp_get_ownerdata ( qp );
/* Close the connec... | false | false | false | false | false | 0 |
LoadGeometryFromDB()
{
int nInvalid, nGeometries, nGeometriesCount, nBytes, rowId;
long iFID;
bool bAddFeature, bSkipInvalid;
CPLString osSQL;
OGRGeometry *poGeometry;
VFKFeatureSQLite *poFeature;
VFKReaderSQLite *poReader;
sqlite3_stmt *hStmt;
poReader... | false | false | false | false | false | 0 |
R2Contains(const R2Halfspace& halfspace1, const R2Halfspace& halfspace2)
{
// Return whether halfspace1 contains halfspace2
RNScalar dot = halfspace1.Normal().Dot(halfspace2.Normal());
if (RNIsEqual(dot, 1.0)) {
// Halfspaces are parallel ???
return RNIsLessOrEqual(halfspace1.Line().C(), halfspace2.Line()... | false | false | false | false | false | 0 |
elimInoutBeh (beh)
befig_list *beh;
{
bepor_list *port;
chain_list *expr;
/* recherche des INOUT qui ne sont pas des bus */
port = beh->BEPOR;
while (port)
{
if (port->DIRECTION == 'B' && port->TYPE == 'B')
{
printf ("WARNING : %s is considered as an output signal\n", port->NAME);
/* ... | false | false | false | false | false | 0 |
gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active)
{
gboolean result = FALSE;
GstBaseSink *basesink;
GstBaseSinkClass *bclass;
basesink = GST_BASE_SINK (gst_pad_get_parent (pad));
bclass = GST_BASE_SINK_GET_CLASS (basesink);
if (active) {
GstFormat format;
gint64 duration;
/* we ... | false | false | false | false | false | 0 |
rl_vi_delete_to (count, key)
int count, key;
{
int c, start_pos;
if (_rl_uppercase_p (key))
rl_stuff_char ('$');
else if (vi_redoing)
rl_stuff_char (_rl_vi_last_motion);
start_pos = rl_point;
if (rl_vi_domove (key, &c))
{
rl_ding ();
return -1;
}
/* These are the motion ... | false | false | false | false | false | 0 |
scale_icon (task *tk)
{
int xx, yy, x, y, w, h, d, bw;
Pixmap pix, mk = None;
XGCValues gcv;
GC mgc=None;
XGetGeometry (dd, tk->icon, &pix, &x, &y, &w, &h, &bw, &d);
pix = XCreatePixmap (dd, tk->win, ICONWIDTH, ICONHEIGHT, scr_depth);
if (tk->mask != None)
{
mk = XCreatePixmap (dd, tk->win, ICONWIDTH, ICONH... | false | false | false | false | false | 0 |
_k_circular_queue_realloc(KCircularQueue *q, unsigned int new_size)
{
char *newdata;
unsigned int till_end;
newdata = malloc(q->el_size * new_size);
till_end = q->allocated_size - q->first;
memcpy(newdata, q->data + q->first*q->el_size, till_end*q->el_size);
if (till_end < q->size) {
memcpy(n... | false | true | false | false | false | 1 |
parser_add_result(parsenode *p) {
if(DEBUG) cout << "BUG: parser_add_result: " << p->to_string() << endl;
g_parsetree.push_back(p);
} | false | false | false | false | false | 0 |
ssyl_out(const cst_item *syl)
{
/* Number of stressed syllables until last major break */
const cst_item *ss,*p,*fs;
int c;
ss = item_as(syl,"Syllable");
fs = path_to_item(syl,"R:SylStructure.parent.R:Phrase.parent.daughtern.R:SylStructure.daughtern");
for (c=0, p=item_next(ss);
p && (c < ... | false | false | false | false | false | 0 |
bochs_hw_setbase(struct bochs_device *bochs,
int x, int y, u64 addr)
{
unsigned long offset = (unsigned long)addr +
y * bochs->stride +
x * (bochs->bpp / 8);
int vy = offset / bochs->stride;
int vx = (offset % bochs->stride) * 8 / bochs->bpp;
DRM_DEBUG_DRIVER("x %d, y %d, addr %llx -> offset %lx, vx %d... | false | false | false | false | false | 0 |
it87_gpio_direction_out(struct gpio_chip *chip,
unsigned gpio_num, int val)
{
u8 mask, group;
int rc = 0;
struct it87_gpio *it87_gpio = to_it87_gpio(chip);
mask = 1 << (gpio_num % 8);
group = (gpio_num / 8);
spin_lock(&it87_gpio->lock);
rc = superio_enter();
if (rc)
goto exit;
/* set the output en... | false | false | false | false | false | 0 |
option_toggle_handle(menu_type *m, const ui_event *event,
int oid)
{
bool next = FALSE;
if (event->type == EVT_SELECT) {
/* Hack -- birth options can not be toggled after birth */
/* At birth, m->flags == MN_DBL_TAP. After birth, m->flags == MN_NO_TAGS */
if (!(OPT_BIRTH <= oid && oid <= OPT_BIRTH + N_OPTS_B... | false | false | false | false | false | 0 |
ellipticEdm(m)
REAL m;
{ if ( m == 1.0 ) return 1.0e31;
return m==0 ? -M_PI/8 : (ellipticE(m) - ellipticK(m))/2/m;
} | 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.