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 |
|---|---|---|---|---|---|---|
gpc_b16g(Pixel *out, const Pixel *in, const Background *back)
{
if (in->a <= 0)
out->r = out->g = out->b = back->ig;
else
{
double a = in->a/65535.;
double a1 = 1-a;
a /= 65535;
out->r = out->g = out->b = sRGB(in->g * a + back->dg * a1);
}
out->a = 255;
} | false | false | false | false | false | 0 |
champlain_view_remove_layer (ChamplainView *view,
ChamplainLayer *layer)
{
DEBUG_LOG ()
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
g_return_if_fail (CHAMPLAIN_IS_LAYER (layer));
champlain_layer_set_view (layer, NULL);
clutter_actor_remove_child (view->priv->user_layers, CLUTTER_ACTOR (layer));
} | false | false | false | false | false | 0 |
gtv_unblank_screen (GtkVideo *gtv)
{
static gboolean dbus_deny = FALSE;
gboolean inhibit = gtv_test_inhibit_blank (gtv);
#ifdef XDG_SCREENSAVER_COMMAND
if (gtv->priv->have_xdg_screensaver)
{
if (inhibit != !!gtv->priv->xdg_active)
{
Window id = inhibit
? gdk_x11_drawable_get_xid (gtk_widget_get... | false | false | false | false | false | 0 |
ad_server_new(void) {
if (initialized) {
initialized = true;
//evthread_use_pthreads();
}
ad_server_t *server = NEW_OBJECT(ad_server_t);
if (server == NULL) {
return NULL;
}
// Initialize instance.
server->options = qhashtbl(0, 0);
server->stats = qhashtbl(100, ... | false | false | false | false | false | 0 |
ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
{
struct ath_common *common = ath9k_hw_common(ah);
REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE);
if (IS_CHAN_HT20(chan)) {
REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_PARALLEL_CAL_ENABLE);
REG_SET_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_E... | false | false | false | false | false | 0 |
BackTab_action(Widget w _is_unused, XEvent *event, String *params,
Cardinal *num_params)
{
register int baddr, nbaddr;
int sbaddr;
action_debug(BackTab_action, event, params, num_params);
if (check_usage(BackTab_action, *num_params, 0, 0) < 0)
return;
reset_idle_timer();
if (kybdlock) {
if (KYBDLOCK_IS_... | false | false | false | false | false | 0 |
checkReadlinkBufferUsage(const Token* ftok, const Token *scope_begin, const unsigned int varid, const MathLib::bigint total_size)
{
const std::string& funcname = ftok->str();
const Token* bufParam = ftok->tokAt(2)->nextArgument();
if (funcname == "readlinkat")
bufParam = bufParam ? bufParam->nextAr... | false | false | false | true | false | 1 |
sgen_object_register_for_finalization (GCObject *obj, void *user_data)
{
while (add_stage_entry (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry, fin_stage_entries, obj, user_data) == -1) {
if (try_lock_stage_for_processing (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry)) {
LOCK_GC;
process_stage_entries (NUM_FIN_... | false | false | false | false | false | 0 |
endEditing(int deleted_)
{
int i, n;
_mult = 1;
long ref = _cursor->position;
if (_inserting)
{
_inserting->insertLocation(&_cursor->location, _refresh);
if (_enable_display >= 0)
{
layout(_column_width > 0 ? _column_width : pWidth(),
//
// The beginning of text often gets
... | false | false | false | false | false | 0 |
printtype (u_int mode)
{
switch (mode & S_IFMT)
{
case S_IFDIR:
putchar ('/');
return (1);
case S_IFIFO:
putchar ('|');
return (1);
case S_IFLNK:
putchar ('@');
return (1);
case S_IFSOCK:
putchar ('=');
return (1);
}
if (mode & (S_IXUSR | S_IXG... | false | false | false | false | false | 0 |
wakeup_source_report_event(struct wakeup_source *ws)
{
ws->event_count++;
/* This is racy, but the counter is approximate anyway. */
if (events_check_enabled)
ws->wakeup_count++;
if (!ws->active)
wakeup_source_activate(ws);
} | false | false | false | false | false | 0 |
tps65910_get_ctrl_register(int id)
{
switch (id) {
case TPS65910_REG_VRTC:
return TPS65910_VRTC;
case TPS65910_REG_VIO:
return TPS65910_VIO;
case TPS65910_REG_VDD1:
return TPS65910_VDD1;
case TPS65910_REG_VDD2:
return TPS65910_VDD2;
case TPS65910_REG_VDD3:
return TPS65910_VDD3;
case TPS65910_REG_VDIG1:... | false | false | false | false | false | 0 |
smalldepthbwtrangesplitwithoutspecial(GtArrayBoundswithchar *bwci,
const Mbtab **mbtab,
GtUchar alphasize,
GtCodetype parentcode,
... | false | false | false | false | false | 0 |
is_root_device_stat (struct stat *statbuf)
{
if (statbuf->st_rdev == root_device) return 1;
return 0;
} | false | false | false | false | false | 0 |
find_next(char *str, char find)
{
char *cp = str;
if (cp == NULL)
return NULL;
while (*cp != '\0' && *cp != '\n' && *cp != find)
cp++;
return (*cp == find) ? cp : NULL;
} | false | false | false | false | false | 0 |
pp_mathchar(int m, int *out, int *lout) {
int mchar,mfam,mtyp;
int ix;
double x1,y1,x2,y2,reqhi,yc;
double oldhei;
oldhei = p_hei;
mchar = m & 0xff;
mfam = (m & 0xf00) / 0x100;
mtyp = (m & 0xf000) / 0x1000;
if (mtyp == 7 && famdef>=0) mfam = famdef;
if (mtyp == 7) mtyp = 0;
ix = 'b'; /* center on letter b *... | false | false | false | false | false | 0 |
ppp_sock_fprog_ioctl_trans(unsigned int fd, unsigned int cmd,
struct sock_fprog32 __user *u_fprog32)
{
struct sock_fprog __user *u_fprog64 = compat_alloc_user_space(sizeof(struct sock_fprog));
void __user *fptr64;
u32 fptr32;
u16 flen;
if (get_user(flen, &u_fprog32->len) ||
get_user(fptr32, &u_fprog32->fi... | false | false | false | false | false | 0 |
gth_media_viewer_page_finalize (GObject *obj)
{
GthMediaViewerPage *self;
self = GTH_MEDIA_VIEWER_PAGE (obj);
if (self->priv->update_progress_id != 0) {
g_source_remove (self->priv->update_progress_id);
self->priv->update_progress_id = 0;
}
if (self->priv->up... | false | false | false | false | false | 0 |
OnEvent(const SEvent & event)
{
if(event.EventType == EET_MOUSE_INPUT_EVENT
&& event.MouseInput.Event == EMIE_MOUSE_MOVED)
MouseMovesReceived++;
return false;
} | false | false | false | false | false | 0 |
num_exact(VALUE v)
{
VALUE tmp;
int t;
t = TYPE(v);
switch (t) {
case T_FIXNUM:
case T_BIGNUM:
return v;
case T_RATIONAL:
break;
case T_STRING:
case T_NIL:
goto typeerror;
default:
if ((tmp = rb_check_funcall(v, rb_intern("to_r"), 0... | false | false | false | false | false | 0 |
latex_gensumlineb(FILE *outf, Outchoices *od, int namecode, double x,
double x7, logical isaverage) {
char **lngstr = od->lngstr;
unsigned int bm;
char *c;
fprintf(outf, "{\\bf %s%s} ", lngstr[namecode], lngstr[colon_]);
bm = (od->rawbytes)?0:findbmult(x, od->bytesdp);
printbytes(outf, od, x, b... | false | false | false | false | false | 0 |
get_uid(void *user_data)
{
struct media_player *mp = user_data;
DBG("%p", mp->track);
if (mp->track == NULL)
return UINT64_MAX;
return 0;
} | false | false | false | false | false | 0 |
handleAfterKeyPressEvent(QKeyEvent *event)
{
// Only attempt to handle Backspace and Return
if ((event->key() != Qt::Key_Backspace)
&& (event->key() != Qt::Key_Return))
return false;
QTextCursor cursor = textEdit->textCursor();
bool handled = false;
if (!cursor.hasSelection() &... | false | false | false | false | false | 0 |
equiv_format(const Py_buffer *dest, const Py_buffer *src)
{
const char *dfmt, *sfmt;
assert(dest->format && src->format);
dfmt = dest->format[0] == '@' ? dest->format+1 : dest->format;
sfmt = src->format[0] == '@' ? src->format+1 : src->format;
if (strcmp(dfmt, sfmt) != 0 ||
dest->itemsize... | false | false | false | false | false | 0 |
remove_trailing_spaces(char *str)
{
int i, len;
len = strlen(str);
for(i=(len-1); i>-1; i--)
{
if(str[i]!=' ') break;
}
str[i+1] = 0;
} | false | false | false | false | false | 0 |
e_tree_freeze_state_change (ETree *tree)
{
g_return_if_fail (E_IS_TREE (tree));
tree->priv->state_change_freeze++;
if (tree->priv->state_change_freeze == 1)
tree->priv->state_changed = FALSE;
g_return_if_fail (tree->priv->state_change_freeze != 0);
} | false | false | false | false | false | 0 |
ExpandThis(enum cfreport level,char *string,char buffer[CF_EXPANDSIZE])
{
if (level == cf_error || ((strstr(string,"$(this.") == 0) && (strstr(string,"${this.") == 0)))
{
strncpy(buffer,string,CF_EXPANDSIZE-1);
return true;
}
return ExpandPrivateScalar(CONTEXTID,string,buffer);
} | true | true | false | false | false | 1 |
_createBuffers(void)
{
/* Allocate / reallocate vertex data
Note that we allocate enough space for ALL the billboards in the pool, but only issue
rendering operations for the sections relating to the active billboards
*/
/* Alloc positions ( 1 or 4 verts per billboar... | false | false | false | false | false | 0 |
updateMechList(void)
{
gss_mech_info minfo;
#if defined(_WIN32)
time_t lastConfModTime = getRegConfigModTime(MECH_KEY);
if (g_confFileModTime >= lastConfModTime)
return;
g_confFileModTime = lastConfModTime;
loadConfigFromRegistry(HKEY_CURRENT_USER, MECH_KEY);
loadConfigFromRegistry(HKEY_LOCAL_MACHINE, MECH_KEY... | false | false | false | false | false | 0 |
my_fill_utf32(CHARSET_INFO *cs,
char *s, size_t slen, int fill)
{
char buf[10];
uint buflen;
char *e= s + slen;
DBUG_ASSERT((slen % 4) == 0);
buflen= cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf,
(uchar*) buf + sizeof(buf));
DBUG_ASSERT(buflen == 4);
wh... | true | true | false | false | false | 1 |
_sw_client_contact_view_generic_cb (DBusGProxy *proxy,
GError *error,
gpointer userdata)
{
if (error)
{
g_warning (G_STRLOC ": Error when calling %s: %s",
(const gchar *)userdata,
error->message);
g_error_... | false | false | false | false | false | 0 |
orient_page(struct ps_spec *spec)
{
int mode = PORTRAIT;
int pagewidth_in_pixels;
int pageheight_in_pixels;
int badfit = 0;
float wx, wy;
float aspect;
float page_aspect;
if (!spec->width_dpi) {
wx = spec->page_width - 2*spec->page_margin;
wy = spec->page_height - 2*spec->page_margin;... | false | false | false | false | false | 0 |
ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,
struct sk_buff *skb,
struct ath10k_fw_stats *stats)
{
const struct wmi_10_2_stats_event *ev = (void *)skb->data;
u32 num_pdev_stats;
u32 num_pdev_ext_stats;
u32 num_vdev_stats;
u32 num_peer_stats;
int i;
if (!skb_pull(skb, sizeof(*ev)))
ret... | false | false | false | false | false | 0 |
qlcnic_dcb_cee_peer_get_pg(struct net_device *netdev,
struct cee_pg *pg)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
struct qlcnic_dcb_cee *peer;
u8 i, j, k, map;
if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state))
return 0;
peer = &adapter->dcb->cfg->type[QLC_DCB_PEER_IDX];
for (i =... | false | false | false | false | false | 0 |
_eina_hash_find_by_hash(const Eina_Hash *hash,
Eina_Hash_Tuple *tuple,
int key_hash,
Eina_Hash_Head **hash_head)
{
Eina_Hash_Element *hash_element;
int rb_hash = key_hash & EINA_HASH_RBTREE_MASK;
key_hash &= hash->mask;
if (!hash->buc... | false | false | false | false | false | 0 |
add_group(const Glib::RefPtr<type_model>& model_parts, const Gtk::TreeModel::iterator& parent, const sharedptr<const LayoutGroup>& group)
{
Gtk::TreeModel::iterator iterNewItem;
if(!parent)
{
//Add it at the top-level, because nothing was selected:
iterNewItem = model_parts->append();
}
else
{
i... | false | false | false | false | false | 0 |
removeRows(int row, int count, const QModelIndex &parent)
{
// qWarning() << "removeRows" << row << count;
if (d->m_ReadOnly)
return false;
Internal::TreeItem *parentItem = 0;
if (!parent.isValid())
parentItem = d->m_RootItem;
else
parentItem = d->getItem(parent);
d->all... | false | false | false | false | false | 0 |
slapi_rwlock_wrlock( Slapi_RWLock *rwlock )
{
int ret = 0;
if (rwlock != NULL) {
#ifdef USE_POSIX_RWLOCKS
ret = pthread_rwlock_wrlock((pthread_rwlock_t *)rwlock);
#else
PR_RWLock_Wlock((PRRWLock *)rwlock);
#endif
}
return ret;
} | false | false | false | false | false | 0 |
sac_parse_and_display_locations (guchar * a_file_uri)
{
enum CRStatus status = CR_OK;
CRDocHandler *sac_handler = NULL;
CRParser *parser = NULL;
g_return_val_if_fail (a_file_uri, CR_BAD_PARAM_ERROR);
parser = cr_parser_new_from_file (a_file_uri, CR_UTF_8);
if (!parser) ... | false | false | false | false | false | 0 |
pf_push_under(struct parse_frame *pf)
{
struct parse_frame *npf1;
struct parse_frame *npf2;
LOG_FMT(LPF, "%s: before count = %d\n", __func__, cpd.frame_count);
if ((cpd.frame_count < (int)ARRAY_SIZE(cpd.frames)) &&
(cpd.frame_count >= 1))
{
npf1 = &cpd.frames[cpd.frame_count - 1];
np... | false | false | false | false | false | 0 |
L37()
{register object *base=vs_base;
register object *sup=base+VM37; VC37
vs_check;
{object V104;
object V105;
object V106;
V104=(base[0]);
V105=(base[1]);
V106=(base[2]);
vs_top=sup;
goto TTL;
TTL:;
V107= list(2,((object)VV[133]),(V104));
V108= list(2,((object)VV[133]),(V105));
{object V110;
object V111... | false | false | false | false | false | 0 |
RemoveClicks(sampleCount len, float *buffer)
{
int i;
int j;
int left = 0;
float msw;
int ww;
int s2 = sep/2;
float *ms_seq = new float[len];
float *b2 = new float[len];
for( i=0; i<len; i++)
b2[i] = buffer[i]*buffer[i];
/* Shortcut for rms - multiple passes through b2, accumulati... | false | false | false | false | false | 0 |
pgstat_report_autovac(Oid dboid)
{
PgStat_MsgAutovacStart msg;
if (pgStatSock == PGINVALID_SOCKET)
return;
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_AUTOVAC_START);
msg.m_databaseid = dboid;
msg.m_start_time = GetCurrentTimestamp();
pgstat_send(&msg, sizeof(msg));
} | false | false | false | false | false | 0 |
handle_hss(struct fw_card *card, struct fw_request *request,
int tcode, int destination, int source, int generation,
unsigned long long offset, void *data, size_t length,
void *callback_data)
{
struct scs *scs = callback_data;
struct snd_rawmidi_substream *stream;
if (offset != scs->hss_h... | false | false | false | false | false | 0 |
moveToEndOfLine()
{
while( !isend( line[cc] )) cc++;
lexstart = cc;
lexterm = cc;
lexstartprev = lexstart;
} | false | false | false | false | false | 0 |
fetchFile(void)
{
FILE * prefs;
struct stat myStat;
if (home == NULL)
{
#ifndef _WIN32
char * h = getenv("HOME");
#else
char * h = ".";
#endif
if (h==NULL) return;
home = (char *)malloc(strlen(h)+strlen(prefsfile)+2);
strcpy(home,h);
st... | false | false | false | false | false | 0 |
gst_camerabin_color_balance_set_value (GstColorBalance * cb,
GstColorBalanceChannel * channel, gint value)
{
if (cb && GST_CAMERABIN (cb)->src_vid_src) {
GstColorBalance *cbl = GST_COLOR_BALANCE (GST_CAMERABIN (cb)->src_vid_src);
gst_color_balance_set_value (cbl, channel, value);
}
} | false | false | false | false | false | 0 |
blink_view(long, long) {
if (_blink_in) {
_blink_in = 0;
} else {
_blink_in = 1;
}
_blink_state = 1;
update(nil);
long flash_rate = long(0.5 * 1000000);
Dispatcher::instance().startTimer(0, flash_rate, _blink_handler);
} | false | false | false | false | false | 0 |
get_metadata_fast_cb (void *buffer,
gssize buffer_size,
GError *error,
gpointer user_data)
{
MetadataCallData *data;
data = user_data;
if (G_UNLIKELY (error)) {
g_simple_async_result_set_from_error (data->res, error);
} else {
GInputS... | false | false | false | false | false | 0 |
sbp_login_count_all_by_lun(
struct sbp_tpg *tpg,
u32 unpacked_lun,
int exclusive)
{
struct se_session *se_sess;
struct sbp_session *sess;
struct sbp_login_descriptor *login;
int count = 0;
spin_lock_bh(&tpg->se_tpg.session_lock);
list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) {
sess ... | false | false | false | false | false | 0 |
vflist_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
{
ViewFile *vf = data;
GtkTreePath *tpath;
GtkTreeIter iter;
FileData *fd = NULL;
if (bevent->button == MOUSE_BUTTON_MIDDLE)
{
vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
}
if (bevent->button != MOUSE_BUTTON_LEFT && bevent-... | false | false | false | false | false | 0 |
pr_unidiff_hunk (hunk)
struct change *hunk;
{
int first0, last0, first1, last1, show_from, show_to, i, j, k;
struct change *next;
char const *function;
size_t function_length;
/* Determine range of line numbers involved in each file. */
analyze_hunk (hunk, &first0, &last0, &first1, &last1, &show_fro... | false | false | false | false | false | 0 |
seek(long offset, Position pos)
{
long newIdx = 0;
switch (pos) {
case BasicIo::cur: newIdx = p_->idx_ + offset; break;
case BasicIo::beg: newIdx = offset; break;
case BasicIo::end: newIdx = p_->size_ + offset; break;
}
if (newIdx < 0 || newIdx > p_->size_) ... | false | false | false | false | false | 0 |
ssl3_HandleECDHClientKeyExchange(sslSocket *ss, SSL3Opaque *b,
PRUint32 length,
SECKEYPublicKey *srvrPubKey,
SECKEYPrivateKey *srvrPrivKey)
{
PK11SymKey * pms;
SECStatus rv;
SECKEYPublicKey clntPubKey;
CK_M... | false | false | false | false | false | 0 |
init ( int x, int y, int color, int depth )
{
agmp = (tgraphmodeparameters *) & activegraphmodeparameters;
oldparams = *agmp ;
char* cbuf = (char*) malloc ( x * y * depth/8 );
if ( !cbuf )
throw fatalgraphicserror ( "could not allocate memory !");
buf = cbuf;
for ( int i = 0; i < (x*y*depth/8);... | false | false | false | false | false | 0 |
isConstFalseVal(const SDNode *N) const {
if (!N)
return false;
const ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N);
if (!CN) {
const BuildVectorSDNode *BV = dyn_cast<BuildVectorSDNode>(N);
if (!BV)
return false;
BitVector UndefElements;
CN = BV->getConstantSplatNode(&UndefElements);... | false | false | false | false | false | 0 |
thin_presuspend(struct dm_target *ti)
{
struct thin_c *tc = ti->private;
if (dm_noflush_suspending(ti))
noflush_work(tc, do_noflush_start);
} | false | false | false | false | false | 0 |
layout_status_update_progress(LayoutWindow *lw, gdouble val, const gchar *text)
{
if (!layout_valid(&lw)) return;
if (!lw->info_progress_bar) return;
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(lw->info_progress_bar), val);
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(lw->info_progress_bar), (text) ? text : " ");... | false | false | false | false | false | 0 |
fscache_object_mark_killed(struct fscache_object *object,
enum fscache_why_object_killed why)
{
if (test_and_set_bit(FSCACHE_OBJECT_KILLED_BY_CACHE, &object->flags)) {
pr_err("Error: Object already killed by cache [%s]\n",
object->cache->identifier);
return;
}
switch (why) {
case FSCACHE_OBJECT_NO... | false | false | false | false | false | 0 |
dns_rpz_policy2str(dns_rpz_policy_t policy) {
const char *str;
switch (policy) {
case DNS_RPZ_POLICY_PASSTHRU:
str = "PASSTHRU";
break;
case DNS_RPZ_POLICY_NXDOMAIN:
str = "NXDOMAIN";
break;
case DNS_RPZ_POLICY_NODATA:
str = "NODATA";
break;
case DNS_RPZ_POLICY_RECORD:
str = "Local-Data";
break;
... | false | false | false | false | false | 0 |
rdump_symlink(ext2_ino_t ino, struct ext2_inode *inode,
const char *fullname)
{
ext2_file_t e2_file;
char *buf;
errcode_t retval;
buf = malloc(inode->i_size + 1);
if (!buf) {
com_err("rdump", errno, "while allocating for symlink");
goto errout;
}
/* Apparently, this is the right way to detect and hand... | false | true | false | false | false | 1 |
find_debugfs_path(const char *dri_base)
{
char buf[FILENAME_MAX];
struct stat sb;
int i, ret;
for (i = 0; i < 16; i++) {
snprintf(buf, FILENAME_MAX, "%s/%i/name", dri_base, i);
snprintf(mmio_data.debugfs_path, FILENAME_MAX,
"%s/%i/", dri_base, i);
snprintf(mmio_data.debugfs_forcewake_path, FILENAME_MAX,... | true | true | false | false | false | 1 |
process(const char *infile, bool file_is_expr, bool flatten,
const char *outfile, ErrorHandler *errh)
{
RouterT *r = read_router(infile, file_is_expr, errh);
if (!r)
return;
if (flatten)
r->flatten(errh);
// open output file
FILE *outf = open_output_file(outfile, errh);
if (!outf) {
delete ... | false | false | false | false | false | 0 |
pixaWriteStream(FILE *fp,
PIXA *pixa)
{
l_int32 n, i;
PIX *pix;
PROCNAME("pixaWriteStream");
if (!fp)
return ERROR_INT("stream not defined", procName, 1);
if (!pixa)
return ERROR_INT("pixa not defined", procName, 1);
n = pixaGetCount(pixa);
fprintf(fp, "\nPi... | false | false | false | false | false | 0 |
R_AddPointToBox(int x, int y, fixed_t * box)
{
if (x < box[BOXLEFT])
box[BOXLEFT] = x;
if (x > box[BOXRIGHT])
box[BOXRIGHT] = x;
if (y < box[BOXBOTTOM])
box[BOXBOTTOM] = y;
if (y > box[BOXTOP])
box[BOXTOP] = y;
} | false | false | false | false | false | 0 |
removeColinear(QList<GridPoint> & gridPoints) {
// eliminate redundant colinear points
int ix = 0;
while (ix < gridPoints.count() - 2) {
GridPoint p1 = gridPoints[ix];
GridPoint p2 = gridPoints[ix + 1];
if (p1.z == p2.z) {
GridPoint p3 = gridPoints[ix + 2];
if (p2.z == p3.z) {
... | false | false | false | false | false | 0 |
s_to_number(signed long n, ikpcb* pcb) {
ikptr fx = fix(n);
if (unfix(fx) == n) {
return fx;
}
ikptr bn = ik_safe_alloc(pcb, align(wordsize+disp_bignum_data));
if (n > 0){
ref(bn, 0) = (ikptr)(bignum_tag | (1 << bignum_length_shift));
ref(bn, disp_bignum_data) = (ikptr)n;
} else {
ref(bn, 0... | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "AttenuationValues: (" << this->AttenuationValues[0] << ", "
<< this->AttenuationValues[1] << ", "
<< this->AttenuationValues[2] << ")\n";
os << indent << "AmbientColor: (" << this->AmbientColor[0] << "... | false | false | false | false | false | 0 |
caml_empty_global_roots(struct global_root_list * rootlist)
{
struct global_root * gr, * next;
int i;
for (gr = rootlist->forward[0]; gr != NULL; /**/) {
next = gr->forward[0];
caml_stat_free(gr);
gr = next;
}
for (i = 0; i <= rootlist->level; i++) rootlist->forward[i] = NULL;
rootlist->level =... | false | false | false | false | false | 0 |
applyCorrections(void) {
// Correct ball coordinates
for(JML_INT32 i = balln - 1; i >= 0; i--) {
b[i].gx += bm1;
b[i].gy += bm1;
}
} | false | false | false | false | false | 0 |
__tracefs_remove(struct dentry *dentry, struct dentry *parent)
{
int ret = 0;
if (simple_positive(dentry)) {
if (dentry->d_inode) {
dget(dentry);
switch (dentry->d_inode->i_mode & S_IFMT) {
case S_IFDIR:
ret = simple_rmdir(parent->d_inode, dentry);
break;
default:
simple_unlink(parent->d_in... | false | false | false | false | false | 0 |
unicode_type_find (GstTypeFind * tf, const GstUnicodeTester * tester,
guint n_tester, const char *media_type, gboolean require_bom)
{
size_t n;
gint len = 4;
const guint8 *data = gst_type_find_peek (tf, 0, len);
int prob = -1;
const gint max_scan_size = 256 * 1024;
int endianness = 0;
if (!data) {
... | false | false | false | false | false | 0 |
iloc_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i, j, item_count, extent_count;
GF_ItemLocationBox *ptr = (GF_ItemLocationBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_int(bs, ptr->offset_size, 4);
gf_bs_write_int(bs, ptr->length_size, 4);
gf_bs_w... | false | false | false | false | false | 0 |
CalcDefaultThreadNum() const
{
// glibc extention to get cpu info
int num = sysconf(_SC_NPROCESSORS_CONF);
slog(LOG_DEBUG, "threadpool, cpu number:%d\n", num);
if (num <= 0) num = 2;
if (static_cast<size_t>(num) > (sizeof(long long) << 3))
{
num = (sizeof(long long) << 3);
}
r... | false | false | false | false | false | 0 |
l4_redirect_list_check(in_addr_t addr)
{
struct l4_redirect *n;
pthread_rwlock_rdlock(&l4_list_lock);
list_for_each_entry(n, &l4_redirect_list, entry) {
if (n->addr == addr) {
pthread_rwlock_unlock(&l4_list_lock);
return 1;
}
}
pthread_rwlock_unlock(&l4_list_lock);
return 0;
} | false | false | false | false | false | 0 |
mca_spml_yoda_enable(bool enable)
{
SPML_VERBOSE(50, "*** yoda ENABLED ****");
if (false == enable) {
return OSHMEM_SUCCESS;
}
OBJ_CONSTRUCT(&mca_spml_yoda.lock, opal_mutex_t);
/**
*If we get here this is the SPML who get selected for the run. We
* should get ownership for the pu... | false | false | false | false | false | 0 |
utf8_valid(const char *str) {
/* Is this a valid utf8 string? */
int ch;
while ( (ch=utf8_ildb(&str))!='\0' )
if ( ch==-1 )
return( false );
return( true );
} | false | false | false | false | false | 0 |
collect_free(block_t *b, void **&freelist, int &count, bool destroy)
{
for (void **m=b->lo; m<b->hi; m+=nptrs_chunk)
{
char *c = (char*)m;
for (unsigned int i=1; i<nptrs_chunk/2; i++)
if (! c[i])
{
miniobj_t *obj = (miniobj_t*)m[i+i];
if (destroy && obj && m[i... | false | false | false | false | false | 0 |
us_example_mudp_tx (
const char *multicast_address,
const char *multicast_service,
const char *interface
)
{
int fd;
bool r = false;
struct addrinfo *multicastgroup;
multicastgroup = us_net_get_addrinfo ( multicast_address, multicast_service, SOCK_DGRAM, false );
{
char multicast... | true | true | false | false | false | 1 |
IsANumberChar(int ch) {
// Not exactly following number definition (several dots are seen as OK, etc.)
// but probably enough in most cases.
return (ch < 0x80) &&
(isdigit(ch) || toupper(ch) == 'E' ||
ch == '.' || ch == '-' || ch == '+');
} | false | false | false | false | false | 0 |
db_set_message_list(struct mail_cache_db * maildb,
carray * msglist)
{
MMAPString * mmapstr;
char key_value[PATH_MAX];
int r;
unsigned int i;
size_t cur_token;
int res;
mmapstr = mmap_string_new("");
if (mmapstr == NULL) {
res = MAIL_ERROR_MEMORY;
goto err;
}
cur_token = 0;
for(i... | false | false | false | false | false | 0 |
iff_init_color(int r, int g, int b)
{
typedef struct temp_color_t {
int r;
int g;
int b;
} temp_color_t;
int i, idx;
temp_color_t *c;
static int num_iff_colors = 0;
static temp_color_t temp_colors[MAX_IFF_COLORS];
Assert(r >= 0 && r <= 255);
Assert(g >= 0 && g <= 255);
Assert(b >= 0 && b <= 255);
//... | false | false | false | false | false | 0 |
getPolyHeight(dtPolyRef ref, const float* pos, float* height) const
{
dtAssert(m_nav);
const dtMeshTile* tile = 0;
const dtPoly* poly = 0;
if (dtStatusFailed(m_nav->getTileAndPolyByRef(ref, &tile, &poly)))
return DT_FAILURE | DT_INVALID_PARAM;
if (poly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION)
{
const ... | false | false | false | false | false | 0 |
print(raw_ostream &OS, SlotIndexes *Indexes) const {
OS << "# Machine code for function " << Fn->getName() << ":\n";
// Print Frame Information
FrameInfo->print(*this, OS);
// Print JumpTable Information
if (JumpTableInfo)
JumpTableInfo->print(OS);
// Print Constant Pool
ConstantPool->print(OS);
... | false | false | false | false | false | 0 |
SetPropertyLabel( wxPGPropArg id, const wxString& newproplabel )
{
wxPG_PROP_ARG_CALL_PROLOG()
p->SetLabel( newproplabel );
wxPropertyGridState* state = p->GetParentState();
wxPropertyGrid* pg = state->GetGrid();
if ( pg->HasFlag(wxPG_AUTO_SORT) )
pg->Sort(p->GetParent());
if ( pg->G... | false | false | false | false | false | 0 |
btreeIdbucketFree(AjPIdbucket *thys)
{
AjPIdbucket pthis = NULL;
ajuint n;
ajuint i;
/*ajDebug("In btreeIdbucketFree\n"); */
if(!thys || !*thys)
return;
pthis = *thys;
n = pthis->Maxentries;
for(i=0;i<n;++i)
btreeIdFree(&pthis->Ids[i]);
AJFREE(pthis->keylen);
AJFR... | false | false | false | false | false | 0 |
setup_element (const gchar * factory, ElementSetup setup,
GstStaticPadTemplate * sink_template,
GstCaps * sink_caps, GstStaticPadTemplate * src_template,
GstCaps * src_caps)
{
GstElement *element;
GstBus *bus;
gchar *caps_str = NULL;
if (setup) {
element = setup (factory);
} else {
elemen... | false | false | false | false | false | 0 |
setEndPointId(const unsigned int type, const unsigned int id)
{
if (type == (unsigned int) VertID::src)
{
_srcId = id;
}
else // if (type == (unsigned int) VertID::dst)
{
_dstId = id;
}
} | false | false | false | false | false | 0 |
UArray_readFromCStream_(UArray *self, FILE *fp)
{
long totalItemsRead = 0;
long itemsPerBuffer = 4096 / self->itemSize;
UArray *buffer = UArray_new();
UArray_setItemType_(buffer, self->itemType);
UArray_setSize_(buffer, itemsPerBuffer);
if (!fp) { perror("UArray_readFromCStream_"); return -1; }
while(!feof(fp... | false | false | false | false | false | 0 |
fish_sound_comments_free (FishSound * fsound)
{
fs_vector_foreach (fsound->comments, (FishSoundFunc)fs_comment_free);
fs_vector_delete (fsound->comments);
fsound->comments = NULL;
if (fsound->vendor) fs_free (fsound->vendor);
fsound->vendor = NULL;
return 0;
} | false | false | false | false | false | 0 |
sync_playlist_mode_none_toggled(GtkToggleButton *togglebutton) {
gchar *key;
g_return_if_fail (repository_view);
key = get_playlist_prefs_key(repository_view->itdb_index, repository_view->playlist, KEY_SYNCMODE);
if (gtk_toggle_button_get_active(togglebutton)) {
finish_int_storage(key, SYNC_P... | false | false | false | false | false | 0 |
sys_rand_two_args_compiletf(PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
vpiHandle seed, arg2;
/* Check that there are arguments. */
if (argv == 0) {
vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
... | false | false | false | false | false | 0 |
parseTagLine (tagFile *file, tagEntry *const entry)
{
int i;
char *p = file->line.buffer;
char *tab = strchr (p, TAB);
entry->fields.list = NULL;
entry->fields.count = 0;
entry->kind = NULL;
entry->fileScope = 0;
entry->name = p;
if (tab != NULL)
{
*tab = '\0';
p = tab + 1;
entry->file = p;
tab = st... | false | false | false | false | true | 1 |
pcmciamtd_cistpl_geo(struct pcmcia_device *p_dev,
tuple_t *tuple,
void *priv_data)
{
struct pcmciamtd_dev *dev = priv_data;
cisparse_t parse;
cistpl_device_geo_t *t = &parse.device_geo;
int i;
if (pcmcia_parse_tuple(tuple, &parse))
return -EINVAL;
dev->pcmcia_map.bankwidth = t->geo[0].buswidth;
/* fr... | false | false | false | false | false | 0 |
check_all_va_list_escapes (struct stdarg_info *si)
{
basic_block bb;
FOR_EACH_BB (bb)
{
gimple_stmt_iterator i;
for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
{
gimple stmt = gsi_stmt (i);
tree use;
ssa_op_iter iter;
if (is_gimple_debug (stmt))
continue;
FOR_EACH... | false | false | false | false | true | 1 |
__fill_random_buf(void *buf, unsigned int len, unsigned long seed)
{
long *ptr = buf;
while ((void *) ptr - buf < len) {
*ptr = seed;
ptr++;
seed *= GOLDEN_RATIO_PRIME;
seed >>= 3;
}
} | false | false | false | false | false | 0 |
test_status_worktree__first_commit_in_progress(void)
{
git_repository *repo;
git_index *index;
status_entry_single result;
cl_git_pass(git_repository_init(&repo, "getting_started", 0));
cl_git_mkfile("getting_started/testfile.txt", "content\n");
memset(&result, 0, sizeof(result));
cl_git_pass(git_status_foreac... | false | false | false | false | false | 0 |
check_write ()
{
return (hwm == 0 || in_core_msg_cnt < (size_t) hwm || data_dam);
} | false | false | false | false | false | 0 |
add_target_series (const char *vname, DATASET *dset,
int *varnum)
{
char *gen;
int err;
gen = gretl_strdup_printf("series %s", vname);
err = generate(gen, dset, OPT_Q, NULL);
free(gen);
if (!err) {
int i, v = dset->v - 1;
for (i=0; i<dset->n; i++) {
dset->Z[v][i] = NADBL;
}
... | false | false | false | false | false | 0 |
gst_debug_compare_log_function_by_data (gconstpointer entry, gconstpointer data)
{
gpointer entrydata = ((LogFuncEntry *) entry)->user_data;
return (entrydata < data) ? -1 : (entrydata > data) ? 1 : 0;
} | 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.