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 |
|---|---|---|---|---|---|---|
draw(KBBBallsOnBoard* ballsOnBoard, const int borderPosition)
{
const int columns = ballsOnBoard->columns();
const int rows = ballsOnBoard->rows();
QList<int> points;
const int oppositeBorderPosition = ballsOnBoard->oppositeBorderPositionWithPoints(borderPosition, points);
QPainterPath path;
setSize(borderPos... | false | false | false | false | false | 0 |
get_header (void)
{
size_t col;
alloc_table_row ();
for (col = 0; col < ncolumns; col++)
{
char *cell = NULL;
char const *header = _(columns[col]->caption);
if (columns[col]->field == SIZE_FIELD
&& (header_mode == DEFAULT_MODE
|| (header_mode == OUTPUT_MODE
... | true | true | false | false | false | 1 |
probe_asf(bgav_input_context_t * input)
{
bgav_GUID_t guid;
if(!bgav_GUID_get(&guid, input))
return 0;
if(bgav_GUID_equal(&guid, &guid_header))
{
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
gnc_tree_control_split_reg_recn_test (GncTreeViewSplitReg *view, GtkTreePath *spath)
{
GncTreeModelSplitReg *model;
GtkTreePath *mpath;
GtkTreeIter m_iter;
Split *split = NULL;
Transaction *trans = NULL;
gboolean is_trow1, is_trow2, is_split, is_blank;
Account *anchor;
char recn;
EN... | false | false | false | false | false | 0 |
getExpr(const MachineOperand &MO,
MCSymbolRefExpr::VariantKind Kind) const {
const MCSymbol *Symbol;
bool HasOffset = true;
switch (MO.getType()) {
case MachineOperand::MO_MachineBasicBlock:
Symbol = MO.getMBB()->getSymbol();
HasOffset = false;
break;
case MachineOpera... | false | false | false | false | false | 0 |
vl_set_printf_func (printf_func_t printf_func)
{
vl_get_state()->printf_func = printf_func ? printf_func : do_nothing_printf ;
} | false | false | false | false | false | 0 |
p_vtrack_spinbutton_cb( GtkEditable *editable
, GapStbTabWidgets *tabw)
{
gint32 vtrack;
if(tabw == NULL) { return; }
vtrack = (gint32)GTK_ADJUSTMENT(tabw->vtrack_spinbutton_adj)->value;
if(vtrack != tabw->vtrack)
{
GapStoryBoard *stb_dst;
tabw->vtrack = vtrack;
stb_d... | false | false | false | false | false | 0 |
numSlitsInWindowTable(VimosWindowTable *wTable)
{
/* check input */
if (wTable == NULL) {
cpl_msg_error("numSlitsInWindowTable","NULL input table");
pilErrno = 1;
return(0);
}
/* is this a Window Table ?*/
if (strcmp(wTable->name, VM_WIN)) {
cpl_msg_error("numSlitsInWindowTable","The... | false | false | false | false | false | 0 |
gst_alloc_trace_live_all (void)
{
GList *walk = _gst_alloc_tracers;
int num = 0;
while (walk) {
GstAllocTrace *trace = (GstAllocTrace *) walk->data;
num += trace->live;
walk = g_list_next (walk);
}
return num;
} | false | false | false | false | false | 0 |
H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/,
size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/,
size_t namelen, char name[]/*out*/,
unsigned *filter_config /*out*/)
{
H5P_genplist_t *plist; /* Property list */
H5O_pline_t pline; ... | false | false | false | false | false | 0 |
gpk_update_viewer_textview_follow_link (GtkWidget *text_view, GtkTextIter *iter)
{
GSList *tags = NULL, *tagp = NULL;
tags = gtk_text_iter_get_tags (iter);
for (tagp = tags; tagp != NULL; tagp = tagp->next) {
GtkTextTag *tag = tagp->data;
const gchar *href = (const gchar *) (g_object_get_data (G_OBJECT (tag), "... | false | false | false | false | false | 0 |
chap_build_config(struct iscsi_chap_rec *crec, struct iovec *iovs)
{
struct iovec *iov = NULL;
int count = 0;
/* start at 2, because 0 is for nlmsghdr and 1 for event */
iov = iovs + 2;
if (!chap_fill_param_uint(&iov[count], ISCSI_CHAP_PARAM_INDEX,
crec->chap_tbl_idx,
sizeof(crec->chap_tbl_idx)))
c... | false | false | false | false | false | 0 |
new_yield(node)
NODE *node;
{
long state = Qtrue;
if (node) {
no_blockarg(node);
if (nd_type(node) == NODE_ARRAY && node->nd_next == 0) {
node = node->nd_head;
state = Qfalse;
}
if (node && nd_type(node) == NODE_SPLAT) {
state = Qtrue;
... | false | false | false | false | false | 0 |
transformTypeCast(ParseState *pstate, TypeCast *tc)
{
Node *result;
Node *expr = transformExpr(pstate, tc->arg);
Oid inputType = exprType(expr);
Oid targetType;
int32 targetTypmod;
int location;
typenameTypeIdAndMod(pstate, tc->typeName, &targetType, &targetTypmod);
if (inputType == InvalidOid)
... | false | false | false | false | false | 0 |
git_config_maybe_bool(const char *name, const char *value)
{
int v = git_config_maybe_bool_text(name, value);
if (0 <= v)
return v;
if (!strcmp(value, "0"))
return 0;
if (!strcmp(value, "1"))
return 1;
return -1;
} | false | false | false | false | false | 0 |
dc1394_video_get_data_depth(dc1394camera_t *camera, uint32_t *depth)
{
dc1394error_t err;
uint32_t value;
dc1394video_mode_t mode;
dc1394color_coding_t coding;
*depth = 0;
if (camera->iidc_version >= DC1394_IIDC_VERSION_1_31) {
err= dc1394_get_control_register(camera, REG_CAMERA_DATA_DE... | false | false | false | false | false | 0 |
target_stat_tgt_port_inst_show(struct config_item *item,
char *page)
{
struct se_lun *lun = to_stat_tgt_port(item);
struct se_device *dev;
ssize_t ret = -ENODEV;
rcu_read_lock();
dev = rcu_dereference(lun->lun_se_dev);
if (dev)
ret = snprintf(page, PAGE_SIZE, "%u\n", dev->hba_index);
rcu_read_unlock();
ret... | false | false | false | false | false | 0 |
st_setup(char *str)
{
int i, len, ints[5];
char *stp;
stp = get_options(str, ARRAY_SIZE(ints), ints);
if (ints[0] > 0) {
for (i = 0; i < ints[0] && i < ARRAY_SIZE(parms); i++)
if (parms[i].val)
*parms[i].val = ints[i + 1];
} else {
while (stp != NULL) {
for (i = 0; i < ARRAY_SIZE(parms); i++) {
... | false | false | false | false | false | 0 |
sync_request_alloc()
{
SyncRequest *req;
req = (SyncRequest *) slapi_ch_calloc( 1, sizeof( SyncRequest ));
req->req_pblock = NULL;
if (( req->req_lock = PR_NewLock()) == NULL ) {
slapi_log_error (SLAPI_LOG_FATAL, SYNC_PLUGIN_SUBSYSTEM, "sync_request_alloc: cannot initialize lock structure. ");
slapi_ch_free((... | false | false | false | false | false | 0 |
DSDPVMatCheck(DSDPVMat X, SDPConeVec W1, SDPConeVec W2){
int info,i,n,nn;
double *xx,eig,eps=1e-13,one=1.0;
double fnorm0,fnorm1,fnorm2,fnorm3,fnorm4;
DSDPFunctionBegin;
info=DSDPVMatGetSize(X,&n);DSDPCHKERR(info);
info=SDPConeVecSet(one,W1);DSDPCHKERR(info);
info=DSDPVMatAddOuterProduct(X,1.23456,W1);DSD... | false | false | false | false | false | 0 |
copyTableDescriptors(VimosTable *inTable, VimosTable *outTable)
{
VimosDescriptor *inDesc;
VimosDescriptor *outDesc;
VimosDescriptor *tDesc;
char modName[] = "copyTableDescriptors";
inDesc = inTable->descs;
outDesc = outTable->descs;
tDesc = outDesc;
while (outDesc) {
tDesc = outDesc... | false | false | false | false | false | 0 |
_e_pointer_cb_move(void *data,
Evas *e __UNUSED__,
Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
E_Pointer *p;
Evas_Coord x, y;
if (!e_config->show_cursor) return;
if (!(p = data)) return;
if (!p->e_cursor) retu... | false | false | false | false | false | 0 |
intel_fb_obj_flush(struct drm_i915_gem_object *obj,
bool retire, enum fb_op_origin origin)
{
struct drm_device *dev = obj->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev);
unsigned frontbuffer_bits;
WARN_ON(!mutex_is_locked(&dev->struct_mutex));
if (!obj->frontbuffer_bits)
return;
frontbuffer_b... | false | false | false | false | false | 0 |
row_vers_old_has_index_entry(
/*=========================*/
ibool also_curr,/*!< in: TRUE if also rec is included in the
versions to search; otherwise only versions
prior to it are searched */
const rec_t* rec, /*!< in: record in the clustered index; the
caller must have a latch on the page */
mtr_t* m... | false | false | false | false | false | 0 |
pwok(const char *good, const char *guess, int do_crypt)
{
char *cs;
if (do_crypt == 0)
return strcmp(good, guess) == 0;
cs = crypt(guess, good);
if (cs)
return strcmp(good, cs) == 0;
return 0;
} | false | false | false | false | true | 1 |
isclib_timer_callback(isc_task_t *taskp,
isc_event_t *eventp)
{
struct timeout *t = (struct timeout *)eventp->ev_arg;
struct timeout *q, *r;
/* Get the current time... */
gettimeofday (&cur_tv, (struct timezone *)0);
/*
* Find the timeout on the dhcp list and remove it.
* As the list isn't ordered w... | false | false | false | false | false | 0 |
lpfc_complete_unsol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
struct lpfc_iocbq *saveq, uint32_t fch_r_ctl,
uint32_t fch_type)
{
int i;
/* unSolicited Responses */
if (pring->prt[0].profile) {
if (pring->prt[0].lpfc_sli_rcv_unsol_event)
(pring->prt[0].lpfc_sli_rcv_unsol_event) (phba, pri... | false | false | false | false | false | 0 |
arizona_ldo1_hc_map_voltage(struct regulator_dev *rdev,
int min_uV, int max_uV)
{
int sel;
sel = DIV_ROUND_UP(min_uV - rdev->desc->min_uV, rdev->desc->uV_step);
if (sel >= rdev->desc->n_voltages)
sel = rdev->desc->n_voltages - 1;
return sel;
} | false | false | false | false | false | 0 |
notebook_tab_added_cb (GtkNotebook *notebook,
GladeDesignView *view,
guint page_num,
GladeWindow *window)
{
GladeProject *project;
GtkWidget *inspector;
++window->priv->num_tabs;
project = glade_design_view_get_project (view);
g_signal_connect (G_OBJECT (project), "notify::modifie... | false | false | false | false | false | 0 |
e_text_reflow (GnomeCanvasItem *item,
gint flags)
{
EText *text;
text = E_TEXT (item);
if (text->needs_reset_layout) {
reset_layout (text);
text->needs_reset_layout = 0;
text->needs_calc_height = 1;
}
if (text->needs_split_into_lines) {
split_into_lines (text);
text->needs_split_into_l... | false | false | false | false | false | 0 |
gx_forward_fill_mask(gx_device * dev,
const byte * data, int dx, int raster, gx_bitmap_id id,
int x, int y, int w, int h,
const gx_drawing_color * pdcolor, int depth,
gs_logical_operation_t lop, const gx_clip_path * pcpath)
{
gx_dev... | false | false | false | false | false | 0 |
key(const format& fmt, double sz,
const pen_data& bpen,
const std::string& len) const
{
const double L(legend_item::key_coord(sz, len));
screen_data tmp(__epix_legend_key(L));
tmp.border(bpen.color(), bpen.width().name());
// draw a centered horizontal segment in the current line sty... | false | false | false | false | false | 0 |
camKeypointsInternalsPrepareDescriptor()
{
int x, y, i, j;
// Test whether this initialization has already been done before
if (camKPNbAttPoints[0] == -1) {
for (i = 0; i < 20 * 20 * 4; i++) {
camKPAttPoint[i] = 0;
camKPCoeff[i] = 0;
}
// For all the camKPAttPoints, find the attrac... | false | false | false | false | false | 0 |
gle_pow_ii(int x, int n) {
int pow = 1;
if(n > 0) {
while (true) {
if ((n & 1) != 0) {
pow *= x;
}
if ((n >>= 1) != 0) {
x *= x;
} else {
break;
}
}
}
return pow;
} | false | false | false | false | false | 0 |
findTextNext( bool reverse )
{
if (parentPart())
return parentPart()->findTextNext( reverse );
return d->m_find.findTextNext( reverse );
} | false | false | false | false | false | 0 |
test_lookup_remove_no_attributes (Test *test, gconstpointer unused)
{
guint n_objects, check;
n_objects = gkm_mock_module_count_objects (0);
g_assert_cmpuint (n_objects, >, 0);
/* Shouldn't remove anything if no attributes */
gkm_wrap_login_remove_secret (NULL);
check = gkm_mock_module_count_objects (0);
g_as... | false | false | false | false | false | 0 |
registerNs(const std::string& ns,
const std::string& prefix)
{
std::string ns2 = ns;
if ( ns2.substr(ns2.size() - 1, 1) != "/"
&& ns2.substr(ns2.size() - 1, 1) != "#") ns2 += "/";
// Check if there is already a registered namespace with this p... | false | false | false | false | false | 0 |
ov511_i2c_r(struct sd *sd, u8 reg)
{
struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
int rc, value, retries;
/* Two byte write cycle */
for (retries = 6; ; ) {
/* Select camera register */
reg_w(sd, R51x_I2C_SADDR_2, reg);
/* Initiate 2-byte write cycle */
reg_w(sd, R511_I2C_CTL, 0x03);
do {
r... | false | false | false | false | false | 0 |
curse_weapon(void)
{
object_type *o_ptr;
char o_name[80];
/* Curse the weapon */
o_ptr = &p_ptr->inventory[INVEN_WIELD];
/* Nothing to curse */
if (!o_ptr->kind) return (FALSE);
/* Describe */
object_desc(o_name, sizeof(o_name), o_ptr, ODESC_FULL);
/* Attempt a saving throw */
if (o_ptr->artifact && (r... | false | false | false | false | false | 0 |
pathconv(pp)
pathtable *pp;
{
char *path, buf[MAXPATHLEN];
int lang;
lang = pp -> lang;
if (!(path = pathlang(pp, 0))) return;
if (lang != pp -> lang) {
kanjiconv(buf, path, MAXPATHLEN - 1, DEFCODE, lang, L_FNAME);
if (pp -> flags & P_ISARRAY)
kanjiconv(path, buf,
MAXPATHLEN - 1, pp -> lang, DEFCODE, L... | false | false | false | false | false | 0 |
isl_stream_new_str(struct isl_ctx *ctx, const char *str)
{
struct isl_stream *s;
if (!str)
return NULL;
s = isl_stream_new(ctx);
if (!s)
return NULL;
s->str = str;
return s;
} | false | false | false | false | false | 0 |
get_item_selected()
{
Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
if(refTreeSelection)
{
return refTreeSelection->get_selected();
}
if(m_refListStore)
return m_refListStore->children().end();
else
return Gtk::TreeModel::iterator();
} | false | false | false | false | false | 0 |
do_additional( const byte *ad, u64 adlen )
{
u64 n ;
assert( ad != NULL ) ;
memset( accum, 0, AES_BYTES ) ;
while (adlen > 0) {
n = (u64) ((adlen >= AES_BYTES)? AES_BYTES : adlen) ;
addmul((byte *) accum,ad,n,(byte *) H);
ad += n ;
adlen -= n;
}
#ifdef TESTING
printf("accum after ad: %08x %08x %08x %... | false | false | false | false | false | 0 |
read_text(const char* file_name, char* &c, bool trunc, uint64_t lim)
{
if (c != NULL) {
delete [] c;
c = NULL;
}
uint64_t n = get_file_size(file_name) + 1; // add one for the 0 byte
if (trunc and lim+1 < n) {
n = lim+1;
}
//std::cerr<<"file has size "<< n <<std::endl;
std... | false | false | false | false | false | 0 |
fsp_res_import (fsp_link *link, fs_segment segment,
int count, fs_resource buffer[])
{
unsigned int k, serial_length = 0;
for (k = 0; k < count; ++k) {
serial_length+= ((28 + strlen(buffer[k].lex)) / 8);
}
int length = 8 + (8 * serial_length);
unsigned char *out = message_new(FS_INS... | false | false | false | false | false | 0 |
splot_map_deactivate()
{
if (!splot_map_active)
return;
splot_map_active = 0;
/* restore the original values */
surface_rot_x = splot_map_surface_rot_x;
surface_rot_z = splot_map_surface_rot_z;
surface_scale = splot_map_surface_scale;
axis_array[FIRST_Y_AXIS].range_flags ^= RANGE_REVERSE;
... | true | true | false | false | false | 1 |
set_time_format(void)
{
GKeyFile *keyfile = g_key_file_new();
g_key_file_load_from_file(keyfile, config_global, G_KEY_FILE_NONE, NULL);
gint value = g_key_file_get_integer(keyfile, "Global", "TimeType", NULL);
g_key_file_free(keyfile);
if (value == 24)
{
GtkWidget *combo = GTK_WIDGET (gtk_builder_get_obje... | false | false | false | false | false | 0 |
make_keywords_tables(void)
{ int i, j, h, tp=0;
char **oplist, **maclist;
if (!glulx_mode) {
oplist = opcode_list_z;
maclist = opmacro_list_z;
}
else {
oplist = opcode_list_g;
maclist = opmacro_list_g;
}
for (j=0; *(oplist[j]); j++) {
opcode_names.keyw... | false | false | false | false | true | 1 |
index_fsub(Topform c, Indexop op, Clock clock)
{
#ifdef FEATURES
if (number_of_literals(c) == 1)
lindex_update_first(Unit_index, c, op);
else {
Ilist f = features(c);
if (op == INSERT)
di_tree_insert(f, Nonunit_index, c);
else
di_tree_delete(f, Nonunit_index, c);
zap_ilist(f);
}
#e... | false | false | false | false | false | 0 |
connection_acquire_nolock (Connection *conn)
{
/* connection in the closing state can't be acquired */
if (conn->c_flags & CONN_FLAG_CLOSING)
{
/* This may happen while other threads are still working on this connection */
slapi_log_error(SLAPI_LOG_FATAL, "connection",
"conn=%" NS... | false | false | false | false | false | 0 |
memarea_drop_all(memarea_t *area)
{
memarea_chunk_t *chunk, *next;
for (chunk = area->first; chunk; chunk = next) {
next = chunk->next_chunk;
chunk_free_unchecked(chunk);
}
area->first = NULL; /*fail fast on */
tor_free(area);
} | false | false | false | false | false | 0 |
eraRxr(double a[3][3], double b[3][3], double atb[3][3])
/*
** - - - - - - -
** e r a R x r
** - - - - - - -
**
** Multiply two r-matrices.
**
** Given:
** a double[3][3] first r-matrix
** b double[3][3] second r-matrix
**
** Returned:
** atb double[3][3] a * b
**
** Note... | false | false | false | false | false | 0 |
obj_policy_flush_secret(TSS_HPOLICY hPolicy)
{
struct tsp_object *obj;
struct tr_policy_obj *policy;
if ((obj = obj_list_get_obj(&policy_list, hPolicy)) == NULL)
return TSPERR(TSS_E_INVALID_HANDLE);
policy = (struct tr_policy_obj *)obj->data;
__tspi_memset(&policy->Secret, 0, policy->SecretSize);
policy->Sec... | false | false | false | false | false | 0 |
lms_db_table_version_set(sqlite3 *db, const char *table, unsigned int version)
{
int r, ret;
sqlite3_stmt *stmt;
stmt = lms_db_compile_stmt(db,
"INSERT OR REPLACE INTO lms_internal (tab, version) VALUES (?, ?)");
if (!stmt)
return -1;
ret = lms_db_bind_text(stmt, 1, table, -1);
... | false | false | false | false | false | 0 |
unmarshalChar(cdrStream& stream)
{
_CORBA_Char c;
c = stream.unmarshalOctet();
if (c < 0x80)
return c;
else
OMNIORB_THROW(DATA_CONVERSION,
DATA_CONVERSION_BadInput,
(CORBA::CompletionStatus)stream.completion());
#ifdef NEED_DUMMY_RETURN
return 0;
#endif
} | false | false | false | false | false | 0 |
ahd_dma_tag_create(struct ahd_softc *ahd, bus_dma_tag_t parent,
bus_size_t alignment, bus_size_t boundary,
dma_addr_t lowaddr, dma_addr_t highaddr,
bus_dma_filter_t *filter, void *filterarg,
bus_size_t maxsize, int nsegments,
bus_size_t maxsegsz, int flags, bus_dma_tag_t *ret_tag)
{
bus_dma_ta... | false | false | false | false | false | 0 |
p_rowpage_spinbutton_cb( GtkEditable *editable
, GapStbTabWidgets *tabw)
{
gint32 rowpage;
if(tabw == NULL) { return; }
rowpage = (gint32)GTK_ADJUSTMENT(tabw->rowpage_spinbutton_adj)->value;
if(rowpage != tabw->rowpage)
{
p_tabw_set_rowpage_and_refresh(tabw, rowpage);
}
if... | false | false | false | false | false | 0 |
Java_java_nio_Bits_copyToShortArray(JNIEnv *env, jobject this, jlong srcAddr,
jobject dst, jlong dstPos, jlong length)
{
jbyte *bytes;
size_t size;
jshort *srcShort, *dstShort, *endShort;
jshort tmpShort;
srcShort = (jshort *)jlong_to_ptr(srcAddr);
while (le... | false | false | false | false | false | 0 |
disable_percpu_irq(unsigned int irq)
{
unsigned int cpu = smp_processor_id();
unsigned long flags;
struct irq_desc *desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU);
if (!desc)
return;
irq_percpu_disable(desc, cpu);
irq_put_desc_unlock(desc, flags);
} | false | false | false | false | false | 0 |
slab_pre_alloc_hook(struct kmem_cache *s,
gfp_t flags)
{
flags &= gfp_allowed_mask;
lockdep_trace_alloc(flags);
might_sleep_if(gfpflags_allow_blocking(flags));
if (should_failslab(s->object_size, flags, s->flags))
return NULL;
return memcg_kmem_get_cache(s, flags);
} | false | false | false | false | false | 0 |
serve_disk_data(GkrellmdMonitor *mon, gboolean first_serve)
{
DiskData *disk;
GList *list;
gchar *buf = NULL;
gkrellmd_set_serve_name(mon, "disk");
for (list = disk_list; list; list = list->next)
{
disk = (DiskData *) list->data;
if (!disk->changed && !first_serve)
continue;
if (!disk->subdisk_paren... | false | false | false | false | false | 0 |
RemovePart(vtkProp3D *prop)
{
if ( this->Parts->IsItemPresent(prop) )
{
prop->RemoveConsumer(this);
this->Parts->RemoveItem(prop);
this->Modified();
}
} | false | false | false | false | false | 0 |
qed_reset_vport_stats(struct qed_dev *cdev)
{
int i;
for_each_hwfn(cdev, i) {
struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
struct eth_mstorm_per_queue_stat mstats;
struct eth_ustorm_per_queue_stat ustats;
struct eth_pstorm_per_queue_stat pstats;
struct qed_ptt *p_ptt = qed_ptt_acquire(p_hwfn);
if (!p_ptt)... | false | false | false | false | false | 0 |
suggestPlaylistSize() const
{
if ( m_comparison == CompareNumLessThan ) {
return static_cast<quint32>( m_duration ) / 300000 ;
} else if ( m_comparison == CompareNumGreaterThan ) {
return static_cast<quint32>( m_duration ) / 180000;
} else {
return static_cast<quint32>( m_duration ) ... | false | false | false | false | false | 0 |
hfs_set_uuid(blkid_probe pr, unsigned char const *hfs_info, size_t len)
{
static unsigned char const hash_init[MD5LENGTH] = {
0xb3, 0xe2, 0x0f, 0x39, 0xf2, 0x92, 0x11, 0xd6,
0x97, 0xa4, 0x00, 0x30, 0x65, 0x43, 0xec, 0xac
};
unsigned char uuid[MD5LENGTH];
struct MD5Context md5c;
if (memcmp(hfs_info, "\0\0\0\0\... | false | false | false | false | false | 0 |
validateCfgError(const std::string &cfg, const std::string ¯o)
{
const std::string id = "ConfigurationNotChecked";
std::list<ErrorLogger::ErrorMessage::FileLocation> locationList;
ErrorLogger::ErrorMessage::FileLocation loc;
loc.line = 1;
loc.setfile(file0);
locationList.push_back(loc);
... | false | false | false | false | false | 0 |
endInit(Solver& s) {
if (s.strategies().heuReinit) { vars_.clear(); }
bool moms = s.strategies().heuMoms != 0;
for (Var v = 1; v <= s.numVars(); ++v) {
if (s.value(v) == value_free && score_[v].pos_ == vars_.end()) {
if (moms) {
score_[v].activity_ = momsScore(s, v);
}
score_[v].pos_ = vars_.inser... | false | false | false | false | false | 0 |
dcc_get_rename_file(const char *fname)
{
GString *newname;
struct stat statbuf;
char *ret;
int num;
newname = g_string_new(NULL);
num = 1;
do {
g_string_printf(newname, "%s.%d", fname, num);
num++;
} while (stat(newname->str, &statbuf) == 0);
ret = newname->str;
g_string_free(newname, FALSE);
return re... | false | false | false | false | false | 0 |
get_active_row_from_text( Ink_ComboBoxEntry_Action* action, const gchar* target_text ) {
// Check if text in list
gint row = 0;
gboolean found = false;
GtkTreeIter iter;
gboolean valid = gtk_tree_model_get_iter_first( action->model, &iter );
while ( valid ) {
// Get text from list entry
gchar* tex... | false | false | false | false | false | 0 |
bnxt_report_link(struct bnxt *bp)
{
if (bp->link_info.link_up) {
const char *duplex;
const char *flow_ctrl;
u16 speed, fec;
netif_carrier_on(bp->dev);
if (bp->link_info.duplex == BNXT_LINK_DUPLEX_FULL)
duplex = "full";
else
duplex = "half";
if (bp->link_info.pause == BNXT_LINK_PAUSE_BOTH)
flow_... | false | false | false | false | false | 0 |
FcCharSetInsertLeaf (FcCharSet *fcs, FcChar32 ucs4, FcCharLeaf *leaf)
{
int pos;
pos = FcCharSetFindLeafPos (fcs, ucs4);
if (pos >= 0)
{
free (FcCharSetLeaf (fcs, pos));
FcCharSetLeaves(fcs)[pos] = FcPtrToOffset (FcCharSetLeaves(fcs),
leaf);
return FcTrue;
}
pos = -pos - 1;
... | false | false | false | false | false | 0 |
ixgbevf_stop_hw_vf(struct ixgbe_hw *hw)
{
u32 number_of_queues;
u32 reg_val;
u16 i;
/* Set the adapter_stopped flag so other driver functions stop touching
* the hardware
*/
hw->adapter_stopped = true;
/* Disable the receive unit by stopped each queue */
number_of_queues = hw->mac.max_rx_queues;
for (i = ... | false | false | false | false | false | 0 |
HandleGameObjectCreate(GameObject* go)
{
OutdoorPvP::HandleGameObjectCreate(go);
switch (go->GetEntry())
{
case GO_TOWER_BANNER_NORTHPASS:
InitBanner(go, TOWER_ID_NORTHPASS);
break;
case GO_TOWER_BANNER_CROWNGUARD:
InitBanner(go, TOWER_ID_CROWNGUARD);
... | false | false | false | false | false | 0 |
fm_file_info_get_disp_name(FmFileInfo* fi)
{
const char *disp_name = _fm_path_get_display_name(fi->path);
/* return basename if FmFileInfo is incomplete yet. it is a failure. */
g_return_val_if_fail(disp_name != NULL, fm_path_get_basename(fi->path));
return disp_name;
} | false | false | false | false | false | 0 |
riskcumul(LINK)
struct LOC_likelihood *LINK;
{
int i;
thisarray *WITH;
WITH = LINK->proband->gen;
if (sexlink && LINK->proband->male) {
for (i = 0; i < mgeno; i++) {
if (riskmale[i])
LINK->hetero += WITH->genarray[i];
}
return;
}
for (i = 0; i < fgeno; i++) {
if (risk2[i])
LINK... | false | false | false | false | false | 0 |
ast_taskprocessor_unreference(struct ast_taskprocessor *tps)
{
if (tps) {
ao2_lock(tps_singletons);
ao2_unlink(tps_singletons, tps);
if (ao2_ref(tps, -1) > 1) {
ao2_link(tps_singletons, tps);
}
ao2_unlock(tps_singletons);
}
return NULL;
} | false | false | false | false | false | 0 |
should_show_open_with (NautilusPropertiesWindow *window)
{
NautilusFile *file;
char *mime_type;
char *extension;
gboolean hide;
/* Don't show open with tab for desktop special icons (trash, etc)
* or desktop files. We don't get the open-with menu for these anyway.
*
* Also don't show it for folders. Changin... | false | false | false | false | false | 0 |
operator= (const Vec3 &v) {
// check for self assignment
if (this == &v)
return *this;
for(int i=0; i<VEC3_SIZE; i++) {
this->components[i] = v.components[i];
}
// return the existing object
return *this;
} | false | false | false | false | false | 0 |
packet_open(struct netdev *dev)
{
struct sockaddr_ll sll;
int fd, rv, one = 1;
/*
* Get a PACKET socket for IP traffic.
*/
fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
if (fd == -1) {
perror("socket");
return -1;
}
/*
* We want to broadcast
*/
if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &... | false | false | false | false | false | 0 |
terminal_util_get_lp_url (const char *orig_url)
{
char *uri;
const char *bugnum = orig_url;
while (*bugnum && ! g_ascii_isdigit (*bugnum))
bugnum++;
uri = g_strdup_printf ("https://bugs.launchpad.net/bugs/%s", bugnum);
return uri;
} | false | false | false | false | false | 0 |
gee_array_list_iterator_real_remove (GeeIterator* base) {
GeeArrayListIterator * self;
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;
gint _tmp9_ = 0;
gpointe... | false | false | false | false | false | 0 |
EnvDeftemplateSlotExistP(
void *theEnv,
void *vTheDeftemplate,
char *slotName)
{
struct deftemplate *theDeftemplate = (struct deftemplate *) vTheDeftemplate;
short position;
/*===============================================*/
/* If we're dealing with an implied deftemplate, */
/* then ... | false | false | false | false | false | 0 |
countAvailAddrs(SPtr<TDUID> clntDuid,
SPtr<TIPv6Addr> clntAddr, int iface)
{
/// @todo: long long long int (128bit) could come in handy
double avail = 0; // how many are available?
double ifaceAssigned = 0; // how many are assigned on this iface?
SPtr<TSrvCfgIfa... | false | false | false | false | false | 0 |
citizens_random(const struct city *pcity)
{
int total = citizens_count(pcity);
int chocen = fc_rand(total);
citizens_iterate(pcity, pslot, nationality) {
chocen -= nationality;
if (chocen <= 0) {
return pslot;
}
} citizens_iterate_end;
fc_assert(FALSE);
return NULL;
} | false | false | false | false | false | 0 |
free_local_client(struct Client *client_p)
{
s_assert(NULL != client_p);
s_assert(&me != client_p);
if(client_p->localClient == NULL)
return;
/*
* clean up extra sockets from P-lines which have been discarded.
*/
if(client_p->localClient->listener)
{
s_assert(0 < client_p->localClient->listener->ref_cou... | false | false | false | true | false | 1 |
labelTransformation(
const QPointF &pos, const QSizeF &size ) const
{
QTransform transform;
transform.translate( pos.x(), pos.y() );
transform.rotate( labelRotation() );
int flags = labelAlignment();
if ( flags == 0 )
{
switch ( alignment() )
{
case RightScale:
... | false | false | false | false | false | 0 |
list_find_attribute(const gchar *attr)
{
GtkCMCList *clist = GTK_CMCLIST(personEditDlg->clist_attrib);
UserAttribute *attrib;
gint row = 0;
while((attrib = gtk_cmclist_get_row_data(clist, row))) {
if (!g_ascii_strcasecmp(attrib->name, attr)) {
gtk_cmclist_select_row(clist, row, 0);
return TRUE;
}
row++;... | false | false | false | false | false | 0 |
control_event_signal(uintptr_t signal)
{
const char *signal_string = NULL;
if (!control_event_is_interesting(EVENT_SIGNAL))
return 0;
switch (signal) {
case SIGHUP:
signal_string = "RELOAD";
break;
case SIGUSR1:
signal_string = "DUMP";
break;
case SIGUSR2:
signal_st... | false | false | false | false | false | 0 |
curl_multi_cleanup(CURLM *multi_handle)
{
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
struct SessionHandle *data;
struct SessionHandle *nextdata;
if(GOOD_MULTI_HANDLE(multi)) {
bool restore_pipe = FALSE;
SIGPIPE_VARIABLE(pipe_st);
multi->type = 0; /* not good anymore */
/* Clo... | false | false | false | false | false | 0 |
ho_res_get(struct irs_ho *this) {
struct pvt *pvt = (struct pvt *)this->private;
if (!pvt->res) {
struct __res_state *res;
res = (struct __res_state *)malloc(sizeof *res);
if (!res) {
errno = ENOMEM;
return (NULL);
}
memset(res, 0, sizeof *res);
ho_res_set(this, res, free);
}
return (pvt->res);
... | false | false | false | false | false | 0 |
gst_output_selector_handle_sink_event (GstPad * pad, GstEvent * event)
{
gboolean res = TRUE;
GstOutputSelector *sel;
GstPad *output_pad = NULL;
sel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
if (G_UNLIKELY (sel == NULL)) {
gst_event_unref (event);
return FALSE;
}
switch (GST_EVENT_TYPE (... | false | false | false | false | false | 0 |
popup_play_default_change_sound(popup_info *pi)
{
if ( pi->nchoices > 1 ) {
int i, mouse_over=0;
UI_BUTTON *br, *b;
// only play if mouse not currently highlighting a choice
for ( i = 0; i < pi->nchoices; i++ ) {
br = &Popup_button_regions[i];
b = &Popup_buttons[i];
if ( br->button_down() ) {
mo... | false | false | false | false | false | 0 |
esl_fwrite_u16(FILE *fp, uint16_t n)
{
n = esl_hton16(n);
if (fwrite(&n, sizeof(uint16_t), 1, fp) != 1) return eslFAIL;
return eslOK;
} | false | false | false | false | false | 0 |
setPlayerNumber( uint nb )
{
_players.clear();
for( uint i = 0; i < nb; i++ ) {
_players.append( new GenericPlayer( 0 ) );
}
} | false | false | false | false | false | 0 |
chess_view2_d_draw_piece (ChessView2D* self, cairo_t* c, cairo_surface_t* surface, gint size, ChessPiece* piece, gdouble alpha) {
gboolean _tmp0_ = FALSE;
ChessScene* _tmp1_;
ChessScene* _tmp2_;
const gchar* _tmp3_;
const gchar* _tmp4_;
gboolean _tmp8_;
cairo_t* _tmp10_;
gint _tmp11_;
gint _tmp12_;
ChessPiece... | false | false | false | false | false | 0 |
client_reserve_lock_cbk (call_frame_t *frame,
void *cookie,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
struct gf_flock *lock)
{
clnt_local_t *local = NULL;
clnt_conf_t *c... | false | false | false | false | false | 0 |
rssyl_read_existing_thr(void *arg)
{
RSSylParseCtx *ctx = (RSSylParseCtx *)arg;
RSSylFolderItem *ritem = ctx->ritem;
FolderItem *item = &ritem->item;
RSSylFeedItem *fitem = NULL;
DIR *dp;
struct dirent *d;
gint num;
gchar *path;
debug_print("RSSyl: rssyl_read_existing_thr()\n");
path = folder_item_get_path(... | false | false | false | false | false | 0 |
ocfs2_mark_extent_written(struct inode *inode,
struct ocfs2_extent_tree *et,
handle_t *handle, u32 cpos, u32 len, u32 phys,
struct ocfs2_alloc_context *meta_ac,
struct ocfs2_cached_dealloc_ctxt *dealloc)
{
int ret;
trace_ocfs2_mark_extent_written(
(unsigned long long)OCFS2_I(ino... | false | false | false | false | false | 0 |
get_sym_addr(char *symbol)
{
ULONG i, symsection=-1, adr=0;
for(i=0; i<elfsymtabcount; i++)
{
if (strcmp(&strtab[ECL(elfsymtab[i].st_name)], symbol)==0)
{
symsection=ECW(elfsymtab[i].st_shndx);
break;
}
}
if (symsection!=-1)
{
for(i=0; i<elfsymtabcount; i++)
{
if (EC... | false | false | false | false | false | 0 |
context_config_tool(struct pine *ps, int cmd, CONF_S **cl, unsigned int flags)
{
int retval = 0;
switch(cmd){
case MC_DELETE :
if(!fixed_var((*cl)->var, "delete", "collection"))
retval = context_config_delete(ps, cl);
break;
case MC_EDIT :
if(!fixed_var((*cl)->var, "change", "collection"))
... | 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.