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 |
|---|---|---|---|---|---|---|
beam_get_cone_dot(beam *b)
{
switch(b->type){
case BEAM_TYPE_A:
case BEAM_TYPE_C:
case BEAM_TYPE_D:
case BEAM_TYPE_E:
// even though these beams don't move, return a _very_ small value
return (float)cos(fl_radians(50.5f));
case BEAM_TYPE_B:
return vm_vec_dotprod(&b->binfo.dir_a, &b->binfo.dir_b);
defau... | false | false | false | false | false | 0 |
char_unicode_decode(unsigned char* dest, const unsigned char* src, int len)
{
int i, length = 0, pos = 0;
MBSTATE mbs;
MBSTATE_DEC_CLEAR(mbs);
for (i = 0; i < len / 2; i++) {
wchar_t wc = src[i * 2] << 8 | src[(i * 2) + 1];
length = char_uni_alphabet_decode(wc, dest, &mbs);
dest += length;
pos += length;
... | false | false | false | false | false | 0 |
__of_changeset_entry_notify(struct of_changeset_entry *ce, bool revert)
{
struct of_reconfig_data rd;
struct of_changeset_entry ce_inverted;
int ret;
if (revert) {
__of_changeset_entry_invert(ce, &ce_inverted);
ce = &ce_inverted;
}
switch (ce->action) {
case OF_RECONFIG_ATTACH_NODE:
case OF_RECONFIG_DETAC... | false | false | false | false | false | 0 |
gg_svg_clip_ellipse (cairo_t * cairo, struct gg_svg_shape *shape)
{
/* clipping an SVG Ellipse */
struct gg_svg_ellipse *ellipse = shape->data;
if (ellipse->rx <= 0 || ellipse->ry <= 0)
return;
/* clipping the Ellipse */
cairo_save (cairo);
cairo_translate (cairo, ellipse->cx + ellipse->rx / 2.0,
... | false | false | false | false | false | 0 |
initSocketAddress(struct sockaddr_in *name,
const char *hostname, unsigned short int port)
{
struct hostent *hostInfo;
memset(name, 0, sizeof(*name));
name->sin_family = AF_INET;
name->sin_port = htons(port);
// Try numeric interpretation (1.2.3.4) first, then
// hostname resolution if... | false | false | false | true | false | 1 |
ft_headinit(data, bytes)
void *data; /* Pointer to FITS cards. */
int bytes; /* Number of bytes in buffer. */
{
int match;
FITSHead fits;
FITSCard end = NULL;
FITSBuff *cards;
/* cast the namby-pamby void into a real pointer
*/
cards = (FITSCard) data;
Calloc(fits, sizeof(struct _FITSHead));
fit... | false | false | false | false | true | 1 |
pw_is_pwp_admin(Slapi_PBlock *pb, passwdPolicy *pwp){
Slapi_DN *bind_sdn = NULL;
int i;
/* first check if it's root */
if(pb->pb_requestor_isroot){
return 1;
}
/* now check if it's a Password Policy Administrator */
slapi_pblock_get(pb, SLAPI_REQUESTOR_SDN, &bind_sdn);
if(bind_sdn == NULL){
return 0;
}
f... | false | false | false | false | false | 0 |
bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
{
unsigned long chunk_kb;
struct bitmap_counts *counts;
if (!bitmap)
return;
counts = &bitmap->counts;
chunk_kb = bitmap->mddev->bitmap_info.chunksize >> 10;
seq_printf(seq, "bitmap: %lu/%lu pages [%luKB], "
"%lu%s chunk",
counts->pages - c... | false | false | false | false | false | 0 |
cbf_put_table (cbf_compress_data *data, unsigned int *bitcount)
{
unsigned int count, codes, endcode, maxbits;
/* Coded bits */
cbf_failnez (cbf_put_integer (data->file, data->bits, 0, CBF_TABLEENTRYBITS))
*bitcount = CBF_TABLEENTRYBITS;
/* How many symbols do we actually us... | false | false | false | false | false | 0 |
memory_clear(PyMemoryViewObject *self)
{
Py_CLEAR(self->base);
PyBuffer_Release(&self->view);
return 0;
} | false | false | false | false | false | 0 |
cycle_files()
{
/* Gives opennap the ability to re-open the log file after a HUP for
logrotate, etc. */
#ifndef WIN32
if(global.serverFlags & ON_BACKGROUND)
{
char path[_POSIX_PATH_MAX];
int fd = global.logfile;
log_message_level(LOG_LEVEL_DEBUG, "cycle_files: Cycling l... | false | false | false | false | false | 0 |
tonga_copy_vbios_smc_reg_table(const pp_atomctrl_mc_reg_table *table, phw_tonga_mc_reg_table *ni_table)
{
uint8_t i, j;
PP_ASSERT_WITH_CODE((table->last <= SMU72_DISCRETE_MC_REGISTER_ARRAY_SIZE),
"Invalid VramInfo table.", return -1);
PP_ASSERT_WITH_CODE((table->num_entries <= MAX_AC_TIMING_ENTRIES),
"Invalid V... | false | false | false | false | false | 0 |
glist_grab(t_glist *x, t_gobj *y, t_glistmotionfn motionfn,
t_glistkeyfn keyfn, int xpos, int ypos)
{
t_glist *x2 = glist_getcanvas(x);
if (motionfn)
x2->gl_editor->e_onmotion = MA_PASSOUT;
else x2->gl_editor->e_onmotion = 0;
x2->gl_editor->e_grab = y;
x2->gl_editor->e_motionfn = motionf... | false | false | false | false | false | 0 |
exo_wrap_table_get_max_child_size (const ExoWrapTable *table,
gint *max_width_return,
gint *max_height_return)
{
GtkRequisition child_requisition;
GtkWidget *child;
GList *lp;
gint max_width =... | false | false | false | false | false | 0 |
mnt_context_helper_setopt(struct libmnt_context *cxt, int c, char *arg)
{
if (cxt) {
switch(cxt->action) {
case MNT_ACT_MOUNT:
return mnt_context_mount_setopt(cxt, c, arg);
case MNT_ACT_UMOUNT:
return mnt_context_umount_setopt(cxt, c, arg);
}
}
return -EINVAL;
} | false | false | false | false | false | 0 |
qf_list()
{
struct qf_line *qfp;
int i;
if (qf_count == 0)
{
emsg(e_quickfix);
return;
}
qfp = qf_start;
gotocmdline(TRUE, NUL);
for (i = 1; !got_int && i <= qf_count; ++i)
{
sprintf((char *)IObuff, "%2d line %3ld col %2d %s: %s",
i,
(long)qfp->qf_lnum,
qfp->qf_col,
qf_types(qfp->qf_type, qf... | false | false | false | false | false | 0 |
configure(int x_,int y_,int w_,int h_)
{
if (x_!=x()||y_!=y()||w_!=width()||h_!=height())
{
configuration(x_,y_,w_,h_);
computeSize();
}
} | false | false | false | false | false | 0 |
d_genocide_kill(void *data, struct dentry *dentry)
{
struct dentry *root = data;
if (dentry != root) {
if (d_unhashed(dentry) || !dentry->d_inode)
return D_WALK_SKIP;
if (!(dentry->d_flags & DCACHE_GENOCIDE)) {
dentry->d_flags |= DCACHE_GENOCIDE;
dentry->d_lockref.count--;
}
}
return D_WALK_CONTINUE... | false | false | false | false | false | 0 |
set_variable(_cups_vars_t *vars, /* I - Variables */
const char *name, /* I - Variable name */
const char *value) /* I - Value string */
{
_cups_var_t key, /* Search key */
*var; /* New variable */
if (!_cups_strcasecmp(name, "filename"))
{
if (vars->filename)
free(... | false | false | false | false | false | 0 |
xsh_params_compute_ron_mbias_set3_check(cpl_parameterlist * parameters,
const char* rec_id,
const int sizex,const int sizey)
{
const char* pname=NULL;
cpl_parameter* p=NULL;
int nsamples=0;
int hsize=0;
int ival=0;
pname="random_nsamples";
check(nsamples=xsh_parameters_get_int(parameters,... | false | false | false | false | false | 0 |
send_gamma_table (Mustek_Scanner * s)
{
SANE_Status status;
if (s->one_pass_color_scan)
{
if (s->hw->flags & MUSTEK_FLAG_N)
/* This _should_ work for all one-pass scanners (not just
AB306N scanners), but it doesn't work for my Paragon
600 II SP with firmware rev 1.01. Too bad, since it would
... | false | false | false | false | false | 0 |
clipped_percent(sint64 a, sint64 b) {
int rv;
if (b <= 0)
return 0;
rv = (int)((100.0f*((float)a)/((float)b))+0.5f);
if (rv < 0)
return 0;
else if (rv > 100)
return 100;
return rv;
} | false | false | false | false | false | 0 |
wslay_event_call_on_frame_recv_chunk_callback
(wslay_event_context_ptr ctx, const struct wslay_frame_iocb *iocb)
{
if(ctx->callbacks.on_frame_recv_chunk_callback) {
struct wslay_event_on_frame_recv_chunk_arg arg;
arg.data = iocb->data;
arg.data_length = iocb->data_length;
ctx->callbacks.on_frame_recv_... | false | false | false | false | false | 0 |
gnutls_x509_crt_get_key_id (gnutls_x509_crt_t crt, unsigned int flags,
unsigned char *output_data,
size_t * output_data_size)
{
int pk, result = 0;
gnutls_datum_t pubkey;
if (crt == NULL)
{
gnutls_assert ();
return GNUTLS_E_INVALID_REQUEST;
... | false | false | false | false | false | 0 |
early_acpi_process_madt(void)
{
#ifdef CONFIG_X86_LOCAL_APIC
int error;
if (!acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) {
/*
* Parse MADT LAPIC entries
*/
error = early_acpi_parse_madt_lapic_addr_ovr();
if (!error) {
acpi_lapic = 1;
smp_found_config = 1;
}
if (error == -EINVAL) {
/*
... | false | false | false | false | false | 0 |
reset_xrefs (ColorData *color)
{
int i;
for (i = 0; i < dyn_array_ptr_size (&color->other_colors); ++i) {
ColorData *src = (ColorData *)dyn_array_ptr_get (&color->other_colors, i);
if (!src->visited)
continue;
src->visited = FALSE;
if (!dyn_array_ptr_size (&src->bridges))
reset_xrefs (src);
}
} | false | false | false | false | false | 0 |
xlog_grant_head_wake(
struct xlog *log,
struct xlog_grant_head *head,
int *free_bytes)
{
struct xlog_ticket *tic;
int need_bytes;
list_for_each_entry(tic, &head->waiters, t_queue) {
need_bytes = xlog_ticket_reservation(log, head, tic);
if (*free_bytes < need_bytes)
return false;
*free_bytes -= nee... | false | false | false | false | false | 0 |
imx_transmit_buffer(struct imx_port *sport)
{
struct circ_buf *xmit = &sport->port.state->xmit;
unsigned long temp;
if (sport->port.x_char) {
/* Send next char */
writel(sport->port.x_char, sport->port.membase + URTX0);
sport->port.icount.tx++;
sport->port.x_char = 0;
return;
}
if (uart_circ_empty(xmit... | false | false | false | false | false | 0 |
infd_directory_handle_remove_node(InfdDirectory* directory,
InfXmlConnection* connection,
const xmlNodePtr xml,
GError** error)
{
InfdDirectoryNode* node;
gchar* seq;
gboolean result;
node = infd_directory_get... | false | false | false | false | false | 0 |
notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
{
// Prepare the fragment params offsets
switch(pass_id)
{
case 701: // blur horz
{
// horizontal bloom
mat->load();
Ogre::GpuProgramParametersSharedPtr fparams =
mat->getBestTec... | false | false | false | false | false | 0 |
base64decode_len(const char *bufcoded)
{
sint32_t nbytesdecoded;
register const unsigned char *bufin;
register sint32_t nprbytes;
bufin = (const unsigned char *) bufcoded;
while (pr2six[*(bufin++)] <= 63);
nprbytes = (sint32_t)(bufin - (const unsigned char *) bufcoded) - 1;
nbytesdecoded =... | false | false | false | false | false | 0 |
blame_grep(struct view *view, struct line *line)
{
struct blame *blame = line->data;
struct blame_commit *commit = blame->commit;
regmatch_t pmatch;
#define MATCH(text) \
(*text && regexec(view->regex, text, 1, &pmatch, 0) != REG_NOMATCH)
if (commit) {
char buf[DATE_COLS + 1];
if (MATCH(commit->title) ||
... | false | false | false | false | false | 0 |
gen_split_2388 (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands ATTRIBUTE_UNUSED)
{
rtx _val = 0;
start_sequence ();
#line 6618 "../../src/gcc/config/i386/i386.md"
{
rtx pat;
operands[0] = gen_lowpart (SImode, operands[0]);
operands[1] = gen_lowpart (Pmode, operands[1]);
operands[3] = gen_lowpart (Pmode, oper... | false | false | false | false | false | 0 |
hdhomerun_control_get_device_id(struct hdhomerun_control_sock_t *cs)
{
if (!hdhomerun_control_connect_sock(cs)) {
hdhomerun_debug_printf(cs->dbg, "hdhomerun_control_get_device_id: connect failed\n");
return 0;
}
return cs->actual_device_id;
} | false | false | false | false | false | 0 |
item(int depth, GlyphIndex t) {
if (t < 0 || t >= items_.used_) {
ListImpl_range_error(t);
}
GlyphIndex target = items_.used_ - 1 - t;
HitTargetList& list = items_.lists_[target];
if (depth >= list.avail_) {
int new_avail = depth + HitTargetList_fixed;
HitTarget* new_targets = new HitTarget[new_a... | false | false | false | false | false | 0 |
gwim_(sflag, sfw1, sfw2)
integer sflag;
integer sfw1;
integer sfw2;
{
/* System generated locals */
integer ret_val;
/* Local variables */
integer av;
integer nobj, robj;
logical nocare;
/* GWIM, PAGE 2 */
ret_val = -1;
/* !ASSUME LOSE. */
av = advs_1.avehic[play_1.winner - 1];
... | false | false | false | false | false | 0 |
gdev_vector_put_params(gx_device * dev, gs_param_list * plist)
{
int ecode = 0;
int code;
gs_param_name param_name;
gs_param_string ofns;
bool open = dev->is_open, HighLevelDevice;
code = param_read_bool(plist, (param_name = "HighLevelDevice"), &HighLevelDevice);
if (code < 0)
retu... | false | true | false | false | true | 1 |
ThrowError(char *str)
{
obErrorLog.ThrowError("", str, obInfo);
} | false | false | false | false | false | 0 |
hub_clear_tt_buffer(struct usb_device *hdev, u16 devinfo, u16 tt)
{
/* Need to clear both directions for control ep */
if (((devinfo >> 11) & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_CONTROL) {
int status = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
HUB_CLEAR_TT_BUFFER, USB_RT_PORT,
devinfo ... | false | false | false | false | false | 0 |
ses_sm_alloc(void)
{
struct sessmem *sm;
unsigned char *p, *q;
volatile unsigned nws;
volatile unsigned nhttp;
unsigned l, hl;
if (VSC_C_main->n_sess_mem >= params->max_sess)
return (NULL);
/*
* It is not necessary to lock these, but we need to
* cache them locally, to make sure we get a consistent
* vi... | false | false | false | false | false | 0 |
accepts(void *data)
{
bool pass = true;
int32_t act_value = _column->getValue(data, _query);
int32_t ref_value = convertRefValue();
switch (_opid) {
case OP_EQUAL:
pass = act_value == ref_value; break;
case OP_GREATER:
pass = act_value > ref_value; break;
... | false | false | false | false | false | 0 |
adjusted_offset(int offset)
{
// All offsets >= H_offset have to be increased by H_length
// since all hint table location values disregard the hint table
// itself.
if (offset >= this->linp.H_offset)
{
return offset + this->linp.H_length;
}
return offset;
} | false | false | false | false | false | 0 |
gt_aligned_segment_offset_for_refpos(const GtAlignedSegment *as,
unsigned long refpos)
{
unsigned long r_offset, pos, ungapped_pos;
gt_assert(as != NULL);
if (refpos < as->r_left || refpos > as->r_right)
return GT_UNDEF_ULONG;
r_offset = refpos - as->r_left;
pos = 0;
ungapped_pos = 0;
while (ungap... | false | false | false | false | false | 0 |
UNKNOWN_ESC_WARN(ScanEnv *env, int c)
{
if (onig_warn == onig_null_warn || !RTEST(ruby_verbose)) return ;
onig_syntax_warn(env, "Unknown escape \\%c is ignored", c);
} | false | false | false | false | false | 0 |
protgnu(gseq **p)
{
/* this and the following are do-it-yourself garbage collectors.
Make a new node or pull one off the garbage list */
if (garbage != NULL) {
*p = garbage;
free((*p)->seq);
(*p)->seq = (seqptr)Malloc(chars*sizeof(sitearray));
garbage = garbage->next;
} else {
*p = (gseq ... | false | false | false | false | false | 0 |
parse_space(char ** line)
{
char * p;
p = * line;
while ((* p == ' ') || (* p == '\t'))
p ++;
if (p != * line) {
* line = p;
return TRUE;
}
else
return FALSE;
} | false | false | false | false | false | 0 |
genfkey_create_triggers(
sqlite3 *sdb, /* Connection to read schema from */
const char *zDb, /* Name of db to read ("main", "temp") */
void *pCtx, /* Context pointer to pass to xData */
int (*xData)(void *, int, const char *)
){
const char *z... | true | true | false | false | false | 1 |
mainloop_modify_fd(int fd, uint32_t events)
{
struct mainloop_data *data;
struct epoll_event ev;
int err;
if (fd < 0 || fd > MAX_MAINLOOP_ENTRIES - 1)
return -EINVAL;
data = mainloop_list[fd];
if (!data)
return -ENXIO;
if (data->events == events)
return 0;
memset(&ev, 0, sizeof(ev));
ev.events = even... | false | false | false | false | false | 0 |
iscsit_start_nopin_response_timer(struct iscsi_conn *conn)
{
struct iscsi_session *sess = conn->sess;
struct iscsi_node_attrib *na = iscsit_tpg_get_node_attrib(sess);
spin_lock_bh(&conn->nopin_timer_lock);
if (conn->nopin_response_timer_flags & ISCSI_TF_RUNNING) {
spin_unlock_bh(&conn->nopin_timer_lock);
retur... | false | false | false | false | false | 0 |
file_buffer_ready_cb (void **buffer,
gsize count,
GError *error,
gpointer user_data)
{
TransformatioData *tdata = user_data;
GthMetadata *metadata;
GthTransform orientation;
if (error != NULL) {
tdata->ready_func (error, tdata->user_data);
transformation_data_f... | false | false | false | false | false | 0 |
SV_InitOperatorCommands (void)
{
Cmd_AddCommand ("heartbeat", SV_Heartbeat_f);
Cmd_AddCommand ("kick", SV_Kick_f);
Cmd_AddCommand ("status", SV_Status_f);
Cmd_AddCommand ("serverinfo", SV_Serverinfo_f);
Cmd_AddCommand ("dumpuser", SV_DumpUser_f);
Cmd_AddCommand ("map", SV_Map_f);
Cmd_AddCommand ("start... | false | false | false | false | false | 0 |
create_combo_box (gchar *selected_widget)
{
ClutterActor *combo;
gint i, set_index = 0;
gchar *needle;
GType types[] = {
mx_grid_get_type (),
mx_box_layout_get_type (),
mx_table_get_type (),
mx_stack_get_type (),
mx_viewport_get_type (),
mx_kinetic_scroll_view_get_type ()
};
combo = mx_co... | false | false | false | false | false | 0 |
composeVecBoard(GdkGC *gc) {
Position *joker;
int i,j;
global.vpieces.drawSquares(buffer,gc,sqside, borx, bory);
if (gotAnimationLoop) joker=&fake; else joker=&position;
if (effectiveFlip())
for(i=0;i<8;i++)
for(j=0;j<8;j++)
global.vpieces.drawPiece(buffer,gc,sqside,borx+i*sqside,bory+j*sqside,
... | false | false | false | false | false | 0 |
getChar()
{
if (!*iLine)
return EOF;
// not yet at end of data
if (!*iChar) {
iLine++;
iChar = *iLine;
return '\n'; // important: iChar may be 0 now!
}
return *iChar++;
} | false | false | false | false | false | 0 |
_synctex_log_sheet(synctex_node_t sheet) {
if (sheet) {
printf("%s:%i\n",synctex_node_isa(sheet),SYNCTEX_PAGE(sheet));
printf("SELF:%p",(void *)sheet);
printf(" SYNCTEX_PARENT:%p",(void *)SYNCTEX_PARENT(sheet));
printf(" SYNCTEX_CHILD:%p",(void *)SYNCTEX_CHILD(sheet));
printf(" SYNCTEX_SIBLING:%p",(void *)SY... | false | false | false | false | false | 0 |
read_command_list (int looking_for, flag_context_ty outer_context)
{
for (;;)
{
enum word_type terminator;
terminator = read_command (looking_for, outer_context);
if (terminator != t_separator)
return terminator;
}
} | false | false | false | false | false | 0 |
sdrv_flag_check(ESP, FLAG, N)
integer ESP,FLAG,N;
{ char *c;
if (ESP<0)
{ sprintf(errmsg,"Internal error: SDRVMD: Storage shortage: ESP = %d\n",ESP);
kb_error(1846,errmsg,RECOVERABLE);
}
if (FLAG==0) return;
if (FLAG<0)
{ if ( !pos_def_warning_flag && !hessian_quiet_flag )
{ kb_error(1847,"... | false | false | false | false | false | 0 |
SetMaskedOutputValue(int num, double *v)
{
int idx;
if (num < 1)
{
vtkErrorMacro("Output value must have length greater than 0");
return;
}
if (num != this->MaskedOutputValueLength)
{
this->Modified();
}
if (num > this->MaskedOutputValueLength)
{
delete [] this->MaskedOut... | false | false | false | false | false | 0 |
sh_veu_bh(int irq, void *dev_id)
{
struct sh_veu_dev *veu = dev_id;
if (veu->xaction == MEM2MEM_DEF_TRANSLEN || veu->aborting) {
v4l2_m2m_job_finish(veu->m2m_dev, veu->m2m_ctx);
veu->xaction = 0;
} else {
sh_veu_device_run(veu);
}
return IRQ_HANDLED;
} | false | false | false | false | false | 0 |
on_back_button_clicked(GtkButton *button
, GdkEventButton *bevent
, GapPlayerMainGlobalParams *gpp)
{
if(gpp == NULL)
{
return;
}
gpp->play_backward = TRUE;
gpp->request_cancel_video_api = TRUE;
if(bevent)
{
if(bevent->state & GDK_SHIFT_MASK)
... | false | false | false | false | false | 0 |
delete_write_request(WriteRequest * r, int error) {
Channel * c = r->client->channel;
Trap trap;
if (set_trap(&trap)) {
write_stringz(&c->out, "R");
write_stringz(&c->out, r->token);
write_errno(&c->out, error);
write_stream(&c->out, MARKER_EOM);
clear_trap(&trap);
... | false | false | false | false | false | 0 |
socache_mc_remove(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id,
unsigned int idlen, apr_pool_t *p)
{
char buf[MC_KEY_LEN];
apr_status_t rv;
if (socache_mc_id2key(ctx, id, idlen, buf, sizeof buf)) {
ret... | true | true | false | false | false | 1 |
ajBaseAlphaCompare(ajint base, ajint base2)
{
ajint b1;
ajint b2;
if(!aj_base_I)
baseInit();
b1 = base;
b2 = base2;
if(b1<0)
b1=0;
if(b1>31)
b1=31;
if(b2<0)
b2=0;
if(b2>31)
b2=31;
return aj_base_prob[b1][b2];
} | false | false | false | false | false | 0 |
gar_get_road(struct gar_subfile *sub, off_t offset)
{
struct gar_road *r;
unsigned hash = ROAD_HASH(offset);
list_for_entry(r, &sub->net->lroads[hash], l)
if (r->offset == offset)
return r;
return NULL;
} | false | false | false | false | false | 0 |
DropDatabaseBuffers(Oid dbid)
{
int i;
/*
* We needn't consider local buffers, since by assumption the target
* database isn't our own.
*/
for (i = 0; i < NBuffers; i++)
{
volatile BufferDesc *bufHdr = GetBufferDescriptor(i);
/*
* As in DropRelFileNodeBuffers, an unlocked precheck should be safe
... | false | false | false | false | false | 0 |
load_ts_phrase()
{
FILE *fp = fph;
int i;
for(i=0; i < phraseN; i++)
free(phrase[i]);
free(phrase); phrase = NULL;
phraseN = 0;
dbg("fname %s\n", current_tsin_fname);
int ofs = is_gtab ? sizeof(TSIN_GTAB_HEAD):0;
fseek(fp, ofs, SEEK_SET);
while (!feof(fp)) {
u_int64_t phbuf[MAX_PHRASE_LEN]... | false | false | false | false | false | 0 |
wpt_desc(const char* args, const char** unused)
{
if (args) {
char* tmp, *c;
tmp = xstrdup((char*)args);
c = lrtrim(tmp);
if (*c) {
wpt_tmp->description = xstrappend(wpt_tmp->description, c);
}
xfree(tmp);
}
} | false | false | false | false | false | 0 |
blacklist_read2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **str, ssize_t len)
{
/* 2 bytes is a single integer, plus terminating null */
if (ast_str_size(*str) - ast_str_strlen(*str) < 2) {
if (len > ast_str_size(*str) || len == 0) {
ast_str_make_space(str, len ? len : ast_str_strlen(... | false | false | false | false | false | 0 |
mppe_init(struct ppp_ccp_t *ccp)
{
struct mppe_option_t *mppe_opt = _malloc(sizeof(*mppe_opt));
memset(mppe_opt, 0, sizeof(*mppe_opt));
int mppe;
if (ccp->ppp->ses.ctrl->mppe == MPPE_UNSET)
mppe = conf_mppe;
else
mppe = ccp->ppp->ses.ctrl->mppe;
if (mppe != MPPE_ALLOW)
mppe_opt->policy = mppe;
else
mpp... | false | false | false | false | false | 0 |
cpor_key_gen(const pdp_ctx_t *ctx, pdp_key_t *k, pdp_key_t *pub)
{
int status = -1;
pdp_cpor_ctx_t *p = NULL;
pdp_cpor_key_t *key = NULL;
pdp_cpor_key_t *pk = NULL;
BN_CTX *bctx = NULL;
if (!is_cpor(ctx) || !k) return -1;
p = ctx->cpor_param;
// check params
if (!p->Zp_bits)
... | false | false | false | false | false | 0 |
ares_free_data(void *dataptr)
{
struct ares_data *ptr;
if (!dataptr)
return;
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:1684)
/* 1684: conversion from pointer to same-sized integral type */
#endif
ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data));
#ifdef ... | false | false | false | false | false | 0 |
sendLocationForwardReply(giopStream* g,CORBA::Object_ptr obj,
CORBA::Boolean permanent) {
outputNewMessage(g);
char* hdr = (char*)g->pd_currentOutputBuffer +
g->pd_currentOutputBuffer->start;
hdr[7] = (char)GIOP::Reply;
GIOP_S& giop_s = *(GIOP_S*)g;
cdrStream& s = (cdrStre... | false | false | false | false | false | 0 |
gnc_date_string_to_dateformat(const char* fmt_str, QofDateFormat *format)
{
if (!fmt_str)
return TRUE;
if (!strcmp(fmt_str, "us"))
*format = QOF_DATE_FORMAT_US;
else if (!strcmp(fmt_str, "uk"))
*format = QOF_DATE_FORMAT_UK;
else if (!strcmp(fmt_str, "ce"))
*format = QOF_... | false | false | false | false | false | 0 |
dump_hunk(hi_diff_hunk *hunk)
{
switch (hunk->type)
{
case HI_DIFF_TYPE_DIFF:
DPRINTF("DIFF");break;
case HI_DIFF_TYPE_SAME:
DPRINTF("SAME");break;
case HI_DIFF_TYPE_SAME_BACKTRACKED:
DPRINTF("SAME_BT");break;
case HI_DIFF_TYPE_SAME_INDEXED:
DPRINTF("SAME_IDX");break;
} ... | false | false | false | false | false | 0 |
FFLU(MatrixBase &LU) const
{
if (is_a<DenseMatrix>(LU)) {
DenseMatrix &LU_ = static_cast<DenseMatrix &>(LU);
fraction_free_LU(*this, LU_);
}
} | false | false | false | false | false | 0 |
sys_mq_timedsend(struct tcb *tcp)
{
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
tprintf(", %lu, %ld, ", tcp->u_arg[2], tcp->u_arg[3]);
printtv(tcp, tcp->u_arg[4]);
}
return 0;
} | false | false | false | false | false | 0 |
_copy_field(struct dm_report *rh, struct field_properties *dest,
uint32_t field_num)
{
dest->field_num = field_num;
dest->width = rh->fields[field_num].width;
dest->flags = rh->fields[field_num].flags & DM_REPORT_FIELD_MASK;
/* set object type method */
dest->type = _find_type(rh, rh->fields[field_num].t... | false | false | false | false | false | 0 |
ipv4ll_recv_arp_packet(GDHCPClient *dhcp_client)
{
int bytes;
struct ether_arp arp;
uint32_t ip_requested;
int source_conflict;
int target_conflict;
memset(&arp, 0, sizeof(arp));
bytes = read(dhcp_client->listener_sockfd, &arp, sizeof(arp));
if (bytes < 0)
return bytes;
if (arp.arp_op != htons(ARPOP_REPLY)... | false | true | false | false | true | 1 |
bilinear_box_make_weights (PixopsFilterDimension *dim,
double scale)
{
int n = ceil (1/scale + 3.0);
double *pixel_weights;
double w;
int offset, i;
pixel_weights = g_malloc_n (sizeof (double) * SUBSAMPLE, n);
if (pixel_weights == NULL)
return FALSE;
dim->offset = -1.0;
dim->... | false | false | false | false | false | 0 |
parse_option (int short_opt, const char *long_opt, const char *arg)
{
if (!short_opt && !long_opt && !tool->allow_other_arguments)
{
option_error ("invalid argument '%s'", arg);
return;
}
if (short_opt == 'I'
|| (long_opt && !strcmp (long_opt, "image-file")))
{
if (image_file)
... | false | false | false | false | false | 0 |
gru_alloc_gts(struct vm_area_struct *vma,
int cbr_au_count, int dsr_au_count,
unsigned char tlb_preload_count, int options, int tsid)
{
struct gru_thread_state *gts;
struct gru_mm_struct *gms;
int bytes;
bytes = DSR_BYTES(dsr_au_count) + CBR_BYTES(cbr_au_count);
bytes += sizeof(struct gru_thread_state);
gts ... | false | false | false | false | false | 0 |
mime_toggle_button_cb(GtkWidget *button, GdkEventButton *event,
MimeView *mimeview)
{
g_object_ref(button);
mimeview_leave_notify(button, NULL, NULL);
mimeview->ctree_mode = !mimeview->ctree_mode;
if (mimeview->ctree_mode) {
gtk_arrow_set(GTK_ARROW(gtk_bin_get_child(GTK_BIN((button)))), GTK_ARROW_RIGHT... | false | false | false | false | false | 0 |
entry_dialog_selected(GtkWidget* widget_p, void* data) {
EntryDialog* instance_p = static_cast<EntryDialog*>(data);
if (widget_p == instance_p->ok_button_p) {
if (instance_p->selected_impl()) instance_p->close();
}
else if (widget_p == instance_p->cancel_button_p) instance_p->close();
else {
write_er... | false | false | false | false | false | 0 |
cper_print_proc_generic(const char *pfx,
const struct cper_sec_proc_generic *proc)
{
if (proc->validation_bits & CPER_PROC_VALID_TYPE)
printk("%s""processor_type: %d, %s\n", pfx, proc->proc_type,
proc->proc_type < ARRAY_SIZE(proc_type_strs) ?
proc_type_strs[proc->proc_type] : "unknown");
i... | false | false | false | false | false | 0 |
exclusive_subdmerge_max(const PseudoJet & jet, int nsub) const {
set<const history_element*> subhist;
// get the set of history elements that correspond to subjets at
// scale dcut
get_subhist_set(subhist, jet, -1.0, nsub);
set<const history_element*>::iterator highest = subhist.end();
highest--;
///... | false | false | false | false | false | 0 |
wrong_exception_type(PyObject *exc)
{
_Py_IDENTIFIER(__class__);
_Py_IDENTIFIER(__name__);
PyObject *type = _PyObject_GetAttrId(exc, &PyId___class__);
if (type != NULL) {
PyObject *name = _PyObject_GetAttrId(type, &PyId___name__);
Py_DECREF(type);
if (name != NULL) {
... | false | false | false | false | false | 0 |
_eina_file_map_rule_apply(Eina_File_Populate rule, void *addr, unsigned long int size, Eina_Bool hugetlb)
{
int tmp = 42;
int flag = MADV_RANDOM;
switch (rule)
{
case EINA_FILE_RANDOM: flag = MADV_RANDOM; break;
case EINA_FILE_SEQUENTIAL: flag = MADV_SEQUENTIAL; break;
case EINA_FILE_PO... | false | false | false | false | false | 0 |
set_params(SLMP_INFO * info, MGSL_PARAMS __user *new_params)
{
unsigned long flags;
MGSL_PARAMS tmp_params;
int err;
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):%s set_params\n",
__FILE__,__LINE__,info->device_name );
COPY_FROM_USER(err,&tmp_params, new_params, sizeof(MGSL_PARAMS));
if (err) {
if... | false | true | false | false | false | 1 |
check_domain(uint8_t *data, size_t size, int allow_short)
{
size_t i, np = 0;
if (!isalnum(data[0]))
return 0;
for (i = 1; i < size - 1; ++i) {
if (data[i] == '.') np++;
else if (!isalnum(data[i]) && data[i] != '-') break;
}
if (allow_short) {
/* We don't need a valid domain in the strict sense (with
... | false | false | false | false | false | 0 |
cubecone_pop(v_id,count)
vertex_id v_id;
int count; /* number of entries in vflist */
{
int i,k,m;
struct arc *ar;
facetedge_id fe;
REAL side[MAXCOORD];
REAL faceforce[MAXCOORD];
REAL facemag,bestmag,mag;
int bestk=0;
edge_id triples[6][4];
/* find mean triple edge vectors for each face */
/* ge... | false | false | false | false | true | 1 |
connect_fbterm(char raw)
{
get_im_socket();
if (imfd == -1) return;
Message msg;
msg.type = Connect;
msg.len = sizeof(msg);
msg.raw = (raw ? 1 : 0);
int ret = write(imfd, (char *)&msg, sizeof(msg));
} | false | false | false | false | false | 0 |
esp_data_bytes_sent(struct esp *esp, struct esp_cmd_entry *ent,
struct scsi_cmnd *cmd)
{
int fifo_cnt, ecount, bytes_sent, flush_fifo;
fifo_cnt = esp_read8(ESP_FFLAGS) & ESP_FF_FBYTES;
if (esp->prev_cfg3 & ESP_CONFIG3_EWIDE)
fifo_cnt <<= 1;
ecount = 0;
if (!(esp->sreg & ESP_STAT_TCNT)) {
ecount = (... | false | false | false | false | false | 0 |
add_structs_to_map(hash_lex_struct *st, int len)
{
hash_lex_struct *cur, *end= st+len;
for (cur= st; cur<end; cur++)
add_struct_to_map(cur);
for (cur= st; cur<end; cur++)
{
if (cur->first_char && cur->first_char != -1)
add_structs_to_map(cur->char_tails,cur->last_char-cur->first_char+1);
}
} | false | false | false | false | false | 0 |
qinstance_set_state(lListElem *this_elem, bool set_state, u_long32 bit)
{
bool ret = false;
u_long32 old_state = lGetUlong(this_elem, QU_state);
u_long32 new_state = old_state;
if (set_state) {
new_state |= bit;
} else {
new_state &= ~bit;
}
if (old_state != new_state) {
lSet... | false | false | false | false | false | 0 |
removePage( KPageWidgetItem *item )
{
if ( !item )
return;
Q_D(KPageWidgetModel);
PageItem *pageItem = d->rootItem->findChild( item );
if ( !pageItem ) {
qDebug( "Invalid KPageWidgetItem passed!" );
return;
}
emit layoutAboutToBeChanged();
disconnect(item, SIGNAL(changed()), this, SLOT(_... | false | false | false | false | false | 0 |
_cogl_pipeline_snippet_list_free (CoglPipelineSnippetList *list)
{
GList *l, *tmp;
for (l = list->entries; l; l = tmp)
{
tmp = l->next;
cogl_object_unref (l->data);
g_list_free_1 (l);
}
} | false | false | false | false | false | 0 |
_g_file_list_new_from_uriv (char **uris)
{
GList *r = NULL;
int i;
if (uris == NULL)
return NULL;
for (i = 0; uris[i] != NULL; i++)
r = g_list_prepend (r, g_file_new_for_uri (uris[i]));
return g_list_reverse (r);
} | false | false | false | false | false | 0 |
GRE_FontChanged(GGadget *g, GEvent *e) {
struct inherit_font_data ifd;
if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
GRE *gre = GDrawGetUserData(GGadgetGetWindow(g));
int index = GTabSetGetSel(gre->tabset);
GResInfo *res = gre->tofree[index].res;
int cid_off = GGadgetGetCid(g)... | false | false | false | false | false | 0 |
constructScopeDIE(CompileUnit *TheCU, LexicalScope *Scope) {
if (!Scope || !Scope->getScopeNode())
return NULL;
SmallVector <DIE *, 8> Children;
// Collect arguments for current function.
if (LScopes.isCurrentFunctionScope(Scope))
for (unsigned i = 0, N = CurrentFnArguments.size(); i < N; ++i)
i... | false | false | false | false | false | 0 |
complete_invoke (GkmTransaction *transaction, Complete *complete)
{
g_assert (complete);
g_assert (complete->func);
return (complete->func) (transaction, complete->object, complete->user_data);
} | 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.