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 |
|---|---|---|---|---|---|---|
pdf_free_ocg(fz_context *ctx, pdf_ocg_descriptor *desc)
{
if (!desc)
return;
pdf_drop_obj(desc->intent);
fz_free(ctx, desc->ocgs);
fz_free(ctx, desc);
} | false | false | false | false | false | 0 |
merged_vhost_configs_exist(server_rec *s)
{
while (s != NULL) {
cas_cfg *c = ap_get_module_config(s->module_config, &auth_cas_module);
if (c->merged) {
return TRUE;
}
s = s->next;
}
return FALSE;
} | false | false | false | false | false | 0 |
allowOptInMsg(int msg, int opt)
{
// standard options specified in RFC3315
if (msg>13)
return 1; // allow everthing in new messages
if (opt <=20) {
return OptInMsg[msg-1][opt-1];
}
// additional options: allow them
return 1;
} | false | false | false | false | false | 0 |
ExecSeqStat3 (
Stat stat )
{
UInt leave; /* a leave-statement was executed */
/* execute the statements */
if ( (leave = EXEC_STAT( ADDR_STAT(stat)[0] )) != 0 ) { return leave; }
if ( (leave = EXEC_STAT( ADDR_STAT(... | false | false | false | false | false | 0 |
getRandom(char *buf, size_t len)
{
if(openRandom() == -1) {
perror("getRandom:");
return -EINVAL;
}
while(len) {
int r;
r = read(randomfd,buf,len);
if (-1 == r && errno != -EINTR) {
perror("read: "); return -EINVAL;
}
len-= r; buf += r;
}
return 0;
} | false | false | false | false | false | 0 |
user_matrix_vec (const gretl_matrix *m, int *err)
{
gretl_matrix *R = NULL;
if (gretl_is_null_matrix(m)) {
R = gretl_null_matrix_new();
} else {
R = gretl_matrix_alloc(m->rows * m->cols, 1);
if (R != NULL) {
gretl_matrix_vectorize(R, m);
}
}
if (R == NULL) {
*err = E_ALLOC;
}
r... | false | false | false | false | false | 0 |
_dxf_BuildIMReadFileName
( char *buf,
int bufl,
char *basename, /* Has path but no extension */
char *fullname, /* As specified */
char *extension, /* File extension */
int framenum,
int *numeric ) /* Numbers postfixed onto name or not? */
{
int i;
int fd = -1;
int appendable_fil... | false | false | false | false | false | 0 |
cdCompCompare(cdCompTime ca, cdCompTime cb){
int test;
if ((test = VALCMP(ca.year, cb.year)))
return test;
else if ((test = VALCMP(ca.month, cb.month)))
return test;
else if ((test = VALCMP(ca.day, cb.day)))
return test;
else
return (test = VALCMP(ca.hour, cb.hour));
} | false | false | false | false | false | 0 |
RTC_WriteProtectionCmd(FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
/* Enable the write protection for RTC registers */
RTC->WPR = 0xFF;
}
else
{
/* Disable the write protection for RTC regist... | false | false | false | false | false | 0 |
have_pythonappend(Node *n) {
String *str = Getattr(n, "feature:pythonappend");
if (!str)
str = Getattr(n, "feature:addtofunc");
return (str != NULL && Len(str) > 0);
} | false | false | false | false | false | 0 |
exfat_exfat2unix(le16_t date, le16_t time, uint8_t centisec)
{
time_t unix_time = EPOCH_DIFF_SEC;
uint16_t ndate = le16_to_cpu(date);
uint16_t ntime = le16_to_cpu(time);
uint16_t day = ndate & 0x1f; /* 5 bits, 1-31 */
uint16_t month = ndate >> 5 & 0xf; /* 4 bits, 1-12 */
uint16_t year = ndate >> 9; ... | false | false | false | false | false | 0 |
bot_ufno(int idx, char *par)
{
putlog(LOG_BOTS, "*", "%s %s: %s", USERF_REJECTED, dcc[idx].nick, par);
dcc[idx].status &= ~STAT_OFFERED;
if (!(dcc[idx].status & STAT_GETTING))
dcc[idx].status &= ~STAT_SHARE;
} | false | false | false | false | false | 0 |
ResetDirection( std::vector<std::string> args, std::ostream* /*out_stream = NULL */ )
{
// put the arguments coming in as 'args' into standard (argc,argv) format;
// 'args' doesn't have the command name as first, argument, so add it manually;
// 'args' may have adjacent arguments concatenated into one argument,
... | false | false | false | false | false | 0 |
unzoom_client(client_t *c)
{
geom_t f;
if (c->zoomed) {
c->geom = c->save;
c->zoomed = 0;
if (c->frame) {
f = frame_geom(c);
XMoveResizeWindow(dpy, c->frame, f.x, f.y, f.w, f.h);
XResizeWindow(dpy, c->win, c->geom.w, c->geom.h);
redraw_fr... | false | false | false | false | false | 0 |
SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE * OutputHandle)
{
tdsdump_log(TDS_DBG_FUNC, "SQLAllocHandle(%d, %p, %p)\n", HandleType, InputHandle, OutputHandle);
switch (HandleType) {
case SQL_HANDLE_STMT:
return _SQLAllocStmt(InputHandle, OutputHandle);
break;
case SQL_HANDLE_DBC:
... | false | false | false | false | false | 0 |
parseHeaderEntries(stringstream *pms)
{
pms->seekg(0, ios::beg);
vector<string> DataList;
while (!pms->eof())
{
char line_buffer[ATC_LINE_BUF_SIZE] = {0};
pms->getline(line_buffer, ATC_LINE_BUF_SIZE);
if (strcmp(line_buffer, "\r") != 0)
{
DataList.push_back(line_buffer);
}
}
if (DataList.size() ==... | false | false | false | false | false | 0 |
hide_window (rp_window *win)
{
if (win == NULL) return;
/* An unmapped window is not inside a frame. */
win->frame_number = EMPTY;
/* Ignore the unmap_notify event. */
XSelectInput(dpy, win->w, WIN_EVENTS&~(StructureNotifyMask));
XUnmapWindow (dpy, win->w);
XSelectInput (dpy, win->w, WIN_EVENTS);
/* E... | false | false | false | false | false | 0 |
__domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
struct scatterlist *sg, unsigned long phys_pfn,
unsigned long nr_pages, int prot)
{
struct dma_pte *first_pte = NULL, *pte = NULL;
phys_addr_t uninitialized_var(pteval);
unsigned long sg_res = 0;
unsigned int largepage_lvl = 0;
unsig... | false | false | false | false | false | 0 |
chatnet_read(CONFIG_NODE *node)
{
CHAT_PROTOCOL_REC *proto;
CHATNET_REC *rec;
char *type;
if (node == NULL || node->key == NULL)
return;
type = config_node_get_str(node, "type", NULL);
proto = type == NULL ? NULL : chat_protocol_find(type);
if (proto == NULL) {
proto = type == NULL ? chat_pro... | false | false | false | false | false | 0 |
device_set_state (NMIP6Device *device, NMIP6DeviceState state)
{
NMIP6DeviceState old_state;
g_return_val_if_fail (device != NULL, FALSE);
if (state == device->state)
return FALSE;
old_state = device->state;
device->state = state;
nm_log_dbg (LOGD_IP6, "(%s) IP6 device state: %s -> %s",
device_g... | false | false | false | false | false | 0 |
getStringLength(const CharString &strings) const {
int32_t offset=stringOffset;
if(offset>=0) {
return (uint8_t)strings[offset];
} else {
offset=~offset;
return ((int32_t)(uint8_t)strings[offset]<<8)|(uint8_t)strings[offset+1];
}
} | false | false | false | false | false | 0 |
getproduct(void)
{
int type; /* type of value found */
long op; /* opcode to generate */
type = getorexpr();
for (;;) {
switch (gettoken()) {
case T_MULT: op = OP_MUL; break;
case T_DIV: op = OP_DIV; break;
case T_MOD: op = OP_MOD; break;
case T_SLASHSLASH: op = OP_QUO; break;
default:
rescantoken... | false | false | false | false | false | 0 |
lpfc_sli4_queue_destroy(struct lpfc_hba *phba)
{
int idx;
if (phba->cfg_fof)
lpfc_fof_queue_destroy(phba);
if (phba->sli4_hba.hba_eq != NULL) {
/* Release HBA event queue */
for (idx = 0; idx < phba->cfg_fcp_io_channel; idx++) {
if (phba->sli4_hba.hba_eq[idx] != NULL) {
lpfc_sli4_queue_free(
phba... | false | false | false | false | false | 0 |
BigDecimal_mult(VALUE self, VALUE r)
{
ENTER(5);
Real *c, *a, *b;
size_t mx;
GUARD_OBJ(a,GetVpValue(self,1));
if (RB_TYPE_P(r, T_FLOAT)) {
b = GetVpValueWithPrec(r, DBL_DIG+1, 1);
}
else if (RB_TYPE_P(r, T_RATIONAL)) {
b = GetVpValueWithPrec(r, a->Prec*VpBaseFig(), 1);
}
else {
b... | false | false | false | false | false | 0 |
case_tree2list (struct case_node *node, struct case_node *right)
{
struct case_node *left;
if (node->right)
right = case_tree2list (node->right, right);
node->right = right;
if ((left = node->left))
{
node->left = 0;
return case_tree2list (left, node);
}
return node;
} | false | false | false | false | false | 0 |
intif_trylock_guild_storage(struct map_session_data *sd,int npc_id)
{
if (inter_fd < 0)
return -1;
WFIFOW(inter_fd,0) = 0x301a;
WFIFOL(inter_fd,2) = sd->status.account_id;
WFIFOL(inter_fd,6) = sd->status.guild_id;
WFIFOL(inter_fd,10) = npc_id;
WFIFOSET(inter_fd,14);
return 0;
} | false | false | false | false | false | 0 |
fyxchg_syncs (qdaemon)
struct sdaemon *qdaemon ATTRIBUTE_UNUSED;
{
char inithdr[Y_INIT_HDR_LEN];
unsigned short header[3];
unsigned short ichk;
size_t clen, cfirst;
int rpktsize;
/* Send our configuration. We could use only one array (for local
and remote). But this is safer in case the code ch... | false | false | false | false | false | 0 |
do_clean_named_io_objs(pTHX_ SV *const sv)
{
dVAR;
SV *obj;
assert(SvTYPE(sv) == SVt_PVGV);
assert(isGV_with_GP(sv));
if (!GvGP(sv) || sv == (SV*)PL_stderrgv || sv == (SV*)PL_defoutgv)
return;
SvREFCNT_inc(sv);
if ( ((obj = MUTABLE_SV(GvIO(sv)) )) && SvOBJECT(obj)) {
DEBUG_D((PerlIO_print... | false | false | false | false | false | 0 |
iwpm_set_valid(u8 nl_client, int valid)
{
if (nl_client >= RDMA_NL_NUM_CLIENTS)
return;
iwpm_admin.client_list[nl_client] = valid;
} | false | false | false | false | false | 0 |
eval_return_structure(Pa_object *lh_str,
Pa_object *rh_str,
Statement *stm,
Pa_info *callee_out,
Pa_info *caller_out,
Map_info *map_info)
{
Op_entry *lh_members, *rh_members;
Op_entry *lh_m, *rh_m;
... | false | false | false | false | false | 0 |
queueIds( const QList<quint64> &ids )
{
foreach( quint64 id, ids )
{
if( !m_queue.contains( id ) )
m_queue.enqueue( id );
}
} | false | false | false | false | false | 0 |
currentNodePageNumber(const NodePtr &node)
{
inlinePrepare();
syncCharFormat();
GroveString id;
unsigned long n;
if (node->getId(id) == accessOK) {
os() << "{\\field\\flddirty{\\*\\fldinst PAGEREF ";
outputBookmarkName(node->groveIndex(), id.data(), id.size());
os() << "}{\\fldrslt 000}}";
}
e... | false | false | false | false | false | 0 |
tw68_queue_setup(struct vb2_queue *q, const void *parg,
unsigned int *num_buffers, unsigned int *num_planes,
unsigned int sizes[], void *alloc_ctxs[])
{
const struct v4l2_format *fmt = parg;
struct tw68_dev *dev = vb2_get_drv_priv(q);
unsigned tot_bufs = q->num_buffers + *num_buffers;
sizes[0] = (dev->... | false | false | false | false | false | 0 |
_Xi18nNewClient(Xi18n i18n_core)
{
static CARD16 connect_id = 0;
int new_connect_id;
Xi18nClient *client;
if (i18n_core->address.free_clients)
{
client = i18n_core->address.free_clients;
i18n_core->address.free_clients = client->next;
new_connect_id = client->connect_id;
}
... | false | false | false | false | false | 0 |
get_line(FILE *f, char *buf, unsigned size, int *lineno,
const char *file)
{
int too_long = 0;
while (fgets_unlocked(buf, size, f)) {
/* remove newline */
char *ptr = strchr(buf, 0x0a);
if (ptr) {
if (!too_long) {
*ptr = 0;
return buf;
}
// Reset and start with the next line
too_long = 0;
... | false | false | false | false | false | 0 |
tex_get_char_code(uchar** in, int* code) {
// parse the string "{number}"
// and make in point to after the "}"
string res;
while (*(*in) != '}' && *(*in) != 0) {
res += *(*in);
(*in)++;
}
if (*(*in) == '}') {
(*in)++;
}
texint((char*)(res.c_str()+1), code);
} | false | false | false | false | false | 0 |
Debug(void)
{
int i,j;
for (j=1;j<=nbobj;j++)
for (i=0; i<=TabCObj[TabIdObj[j]].NbCase; i++)
{
/* Execution du bloc d'instruction */
fprintf(stderr,"Id de l'objet %d\n",TabIdObj[j]);
fprintf(stderr,"Nb Instruction %d\n",TabIObj[TabIdObj[j]][i].NbInstr);
}
} | false | false | false | false | false | 0 |
reload_inner_reg_of_subreg (x, mode, output)
rtx x;
enum machine_mode mode;
int output;
{
rtx inner;
/* Only SUBREGs are problematical. */
if (GET_CODE (x) != SUBREG)
return 0;
inner = SUBREG_REG (x);
/* If INNER is a constant or PLUS, then INNER must be reloaded. */
if (CONSTANT_P (... | false | false | false | false | false | 0 |
set_constraint_gsettings_boolean (gint constraint_id,
gboolean flag)
{
GSettings * select_settings;
select_settings = g_settings_new ("org.gnome.gnome-search-tool.select");
switch (constraint_id) {
case SEARCH_CONSTRAINT_CONTAINS_THE_TEXT:
g_settings_set_boolean (select_sett... | false | false | false | false | false | 0 |
amdgpu_atombios_encoder_get_encoder_mode(struct drm_encoder *encoder)
{
struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder);
struct drm_connector *connector;
struct amdgpu_connector *amdgpu_connector;
struct amdgpu_connector_atom_dig *dig_connector;
/* dp bridges are always DP */
if (amdgpu_encode... | false | false | false | false | false | 0 |
open_rawlog (struct server *serv)
{
GtkWidget *hbox, *vscrollbar, *vbox;
char tbuf[256];
if (serv->gui->rawlog_window)
{
mg_bring_tofront (serv->gui->rawlog_window);
return;
}
snprintf (tbuf, sizeof tbuf, _(DISPLAY_NAME": Raw Log (%s)"), serv->servername);
serv->gui->rawlog_window =
mg_create_generic_tab... | false | false | false | false | false | 0 |
datetime_to_filetime (GDateTime *dt)
{
static const guint64 epoch = G_GINT64_CONSTANT (11644473600);
GTimeVal tv;
if (!dt)
return 0u;
/* ft is number of 100ns since Jan 1 1601 */
g_date_time_to_timeval (dt, &tv);
return (tv.tv_sec + epoch) * 10000000u + tv.tv_usec * 10u;
} | false | false | false | false | false | 0 |
separateComponents(const vector<Component*> &components) {
unsigned n=components.size();
Rectangle* bbs[n];
double origX[n], origY[n];
for(unsigned i=0;i<n;i++) {
bbs[i]=components[i]->getBoundingBox();
origX[i]=bbs[i]->getCentreX();
origY[i]=bbs[i]->g... | false | false | false | false | false | 0 |
lcdFillRect_JS(struct JsGraphics *gfx, short x1, short y1, short x2, short y2) {
JsVar *fillRect = jsvObjectGetChild(gfx->graphicsVar/*lcdProto*/, "iFillRect", 0);
if (fillRect) {
JsVar *args[5];
args[0] = jsvNewFromInteger(x1);
args[1] = jsvNewFromInteger(y1);
args[2] = jsvNewFromInteger(x2);
a... | false | false | false | false | false | 0 |
display_IDT_info(struct cpudata *cpu)
{
printf ("Family: %u Model: %u Stepping: %u\n",
cpu->family, cpu->model, cpu->stepping);
printf ("CPU Model : %s\n", cpu->name);
get_model_name (cpu);
/* Check for presence of extended info */
decode_feature_flags (cpu);
if (cpu->maxei == 0)
return;
if (show_cachein... | false | false | false | false | false | 0 |
elsa_irq(int intno, void *dev_id)
{
struct inf_hw *hw = dev_id;
u8 val;
spin_lock(&hw->lock);
val = inb((u32)hw->cfg.start + ELSA_IRQ_ADDR);
if (!(val & ELSA_IRQ_MASK)) {
spin_unlock(&hw->lock);
return IRQ_NONE; /* shared */
}
hw->irqcnt++;
mISDNipac_irq(&hw->ipac, irqloops);
spin_unlock(&hw->lock);
retu... | false | false | false | false | false | 0 |
ahci_handle_port_intr(struct ata_host *host, u32 irq_masked)
{
unsigned int i, handled = 0;
for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap;
if (!(irq_masked & (1 << i)))
continue;
ap = host->ports[i];
if (ap) {
ahci_port_intr(ap);
VPRINTK("port %u\n", i);
} else {
VPRINTK("port %u ... | false | false | false | false | false | 0 |
write_prices( GncSqlBackend* be )
{
GNCPriceDB* priceDB;
write_objects_t data;
g_return_val_if_fail( be != NULL, FALSE );
priceDB = gnc_pricedb_get_db( be->book );
data.be = be;
data.is_ok = TRUE;
return gnc_pricedb_foreach_price( priceDB, write_price, &data, TRUE );
} | false | false | false | false | false | 0 |
get_connection_for_active (NMActiveConnection *active)
{
const char *path;
g_return_val_if_fail (active != NULL, NULL);
path = nm_active_connection_get_connection (active);
g_return_val_if_fail (path != NULL, NULL);
return (NMConnection *) g_hash_table_lookup (connections, path);
} | false | false | false | false | false | 0 |
xcorrgm_ascii_plot (double *xcf, int xcf_m, PRN *prn)
{
double *xk = malloc((xcf_m * 2 + 1) * sizeof *xk);
int k;
if (xk == NULL) {
return E_ALLOC;
}
for (k=-xcf_m; k<=xcf_m; k++) {
xk[k+xcf_m] = k;
}
pprintf(prn, "\n\n%s\n\n", _("Cross-correlogram"));
graphyx(xcf, xk, 2 * xcf_m + 1... | false | false | false | false | true | 1 |
operator* (const Segment& seg, const Sphere& S)
{
if (seg.malformed() || S.malformed())
return Segment(true);
// else
P dir(seg.end2() - seg.end1());
dir *= 1.0/norm(dir);
const P posn(S.center() - seg.end1());
const P perp(posn%dir);
if (S.radius() <= norm(perp)) // disjoint
... | false | false | false | false | false | 0 |
switchToNonprimitive ( DLTree* left, DLTree* right )
{
TConcept* C = resolveSynonym(getCI(left));
// not a named concept
if ( C == NULL || C == pTop || C == pBottom )
return false;
// make sure that we avoid making an individual equals to smth-else
TConcept* D = resolveSynonym(getCI(right));
if ( C->isSinglet... | false | false | false | false | false | 0 |
DoEvent(XEvent * event)
{
switch (event->type)
{
case Expose:
isMapped = TRUE;
isRedrawNeeded = TRUE;
break;
case MapNotify:
isMapped = TRUE;
break;
case UnmapNotify:
isMapped = FALSE;
break;
case KeyPress:
DoKeyPress(&event->xkey);
break;
case ConfigureNotify:
DoConfig... | false | false | false | false | false | 0 |
_print_job_user_name(priority_factors_object_t * job, int width,
bool right, char* suffix)
{
if (job == NULL) /* Print the Header instead */
_print_str("USER", width, right, true);
else if (job == (priority_factors_object_t *) -1)
_print_str("", width, right, true);
else {
char *uname = uid_to_string((uid_... | false | false | false | false | false | 0 |
final(private_mac_t *this, u_int8_t *out)
{
chunk_t iv;
iv = chunk_alloca(this->b);
memset(iv.ptr, 0, iv.len);
/* (4) For block M[n]: */
if (this->remaining_bytes == this->b && !this->zero)
{
/* a) If the blocksize of M[n] is 128 bits:
* XOR M[n] with E[n-1] and Key K2, then encrypt the result with
*... | false | false | false | false | false | 0 |
LocalizeRadix(const char* input, const char* radix_pos) {
// Determine the locale-specific radix character by calling sprintf() to
// print the number 1.5, then stripping off the digits. As far as I can
// tell, this is the only portable, thread-safe way to get the C library
// to divuldge the locale's radix c... | false | false | false | false | false | 0 |
draw_dashed_horizontal_hatch (cairo_surface_t *hatch, GpHatch *hbr)
{
double hatch_wd = gdip_hatch_get_width (hbr);
double hatch_ht = gdip_hatch_get_height (hbr);
double line_width = gdip_hatch_get_line_width (hbr);
double line_space = 4;
double dash_len = 4;
/* hatch is not supposed to be affected by user matrix... | false | false | false | false | false | 0 |
optimize()
const
{
tree::pointer tp = create(get_arg()->optimize());
if (tp->constant())
tp = tp->optimize_constant();
return tp;
} | false | false | false | false | false | 0 |
FCEUI_SetVidSystem(int a) {
FSettings.PAL = a ? 1 : 0;
if (GameInfo) {
FCEU_ResetVidSys();
FCEU_ResetPalette();
FCEUD_VideoChanged();
}
} | false | false | false | false | false | 0 |
begin(GB_DRAW *d)
{
gDraw *dr;
EXTRA(d)->dr = dr = new gDraw();
EXTRA(d)->font = NULL;
/*if (GB.Is(d->device, CLASS_Window))
dr->connect(((CWINDOW *)d->device)->ob.widget);
else */
if (GB.Is(d->device, CLASS_DrawingArea))
{
gDrawingArea *da = (gDrawingArea *)((CDRAWINGAREA *)d->device)->ob.widget;
if (... | false | false | false | false | false | 0 |
job_step_signal(uint32_t job_id, uint32_t step_id,
uint16_t signal, uid_t uid)
{
struct job_record *job_ptr;
struct step_record *step_ptr;
int rc = SLURM_SUCCESS;
static bool notify_slurmd = true;
#if defined HAVE_BG_FILES && !defined HAVE_BG_L_P
static int notify_srun = 1;
#else
static int notify_srun = -1... | false | false | false | false | false | 0 |
vector_unary_inv(
vector* tgt, /*!< Target vector for operation results to be stored */
const vector* src /*!< Source vector to perform operation on */
) { PROFILE(VECTOR_UNARY_INV);
bool retval; /* Return value for this function */
switch( src->suppl.part.data_type ) {
case VDATA_UL :
{
... | false | false | false | false | false | 0 |
assoc_open(int c)
{
ASSOC *assoc = (ASSOC *)check_malloc(sizeof(ASSOC));
const char *tmpfile = get_tmpfile(c);
assoc->dbop = dbop_open(tmpfile, 1, 0600, DBOP_REMOVE);
if (assoc->dbop == NULL)
abort();
return assoc;
} | false | false | false | false | false | 0 |
frame_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
uchar *g = fl_gray_ramp();
int b = ((int) strlen(c)) / 4 + 1;
for (x += b, y += b, w -= 2 * b, h -= 2 * b; b > 1; b --)
{
// Draw lines around the perimeter of the button, 4 colors per
// circuit.
fl_color(shade_color(g[(int)*c++]... | false | false | false | false | false | 0 |
addCoins(Coin* c1, const Coin* c2)
{
size_t i;
for(i = 0; i < c2->symbols.size; i++) uivector_push_back(&c1->symbols, c2->symbols.data[i]);
c1->weight += c2->weight;
} | false | false | false | false | false | 0 |
adm1021_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct device *dev = &client->dev;
struct adm1021_data *data;
struct device *hwmon_dev;
data = devm_kzalloc(dev, sizeof(struct adm1021_data), GFP_KERNEL);
if (!data)
return -ENOMEM;
data->client = client;
data->type = id->driver_d... | false | false | false | false | false | 0 |
evdns_base_set_option(struct evdns_base *base,
const char *option, const char *val, int flags)
{
int res;
EVDNS_LOCK(base);
res = evdns_base_set_option_impl(base, option, val, flags);
EVDNS_UNLOCK(base);
return res;
} | false | false | false | false | false | 0 |
si476x_core_stop(struct si476x_core *core, bool soft)
{
int err = 0;
atomic_set(&core->is_alive, 0);
if (soft) {
/* TODO: This probably shoud be a configurable option,
* so it is possible to have the chips keep their
* oscillators running
*/
struct si476x_power_down_args args = {
.xosc = false,
};... | false | false | false | false | false | 0 |
print_tagged_components(IOP::MultipleComponentProfile& components)
{
CORBA::ULong total = components.length();
for (CORBA::ULong index=0; index < total; index++) {
try {
CORBA::String_var content;
content = IOP::dumpComponent(components[index]);
char* p = content;
char* q;
do {
q... | false | false | false | false | false | 0 |
bfa_ioc_sm_fail_retry(struct bfa_ioc_s *ioc, enum ioc_event event)
{
bfa_trc(ioc, event);
switch (event) {
case IOC_E_ENABLED:
bfa_fsm_set_state(ioc, bfa_ioc_sm_getattr);
break;
case IOC_E_PFFAILED:
case IOC_E_HWERROR:
/*
* Initialization retry failed.
*/
ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS... | false | false | false | false | false | 0 |
set_higthlight (GphpeditStatusComboBox *combo, GtkMenuItem *item){
const gchar *label = gtk_menu_item_get_label (item);
gint type;
if (g_strcmp0(label,_("Cobol"))==0){
type = TAB_COBOL;
} else if (g_strcmp0(label,_("C/C++"))==0){
type = TAB_CXX;
} else if (g_strcmp0(label,_("CSS"))==0){
type = TAB... | false | false | false | false | false | 0 |
EnableCatchingThrow(cb_unused bool enable)
{
NOT_IMPLEMENTED();
} | false | false | false | false | false | 0 |
x25_asy_open(struct net_device *dev)
{
struct x25_asy *sl = netdev_priv(dev);
unsigned long len;
int err;
if (sl->tty == NULL)
return -ENODEV;
/*
* Allocate the X.25 frame buffers:
*
* rbuff Receive buffer.
* xbuff Transmit buffer.
*/
len = dev->mtu * 2;
sl->rbuff = kmalloc(len + 4, GFP_KERNEL);
... | false | false | false | false | false | 0 |
stp_clear_parameter(stp_vars_t *v, const char *parameter, stp_parameter_type_t type)
{
switch (type)
{
case STP_PARAMETER_TYPE_STRING_LIST:
stp_clear_string_parameter(v, parameter);
break;
case STP_PARAMETER_TYPE_FILE:
stp_clear_file_parameter(v, parameter);
break;
case STP_PAR... | false | false | false | false | false | 0 |
e_fm2_device_volume_find_fast(const char *udi)
{
Eina_List *l;
E_Volume *v;
if (!udi) return NULL;
EINA_LIST_FOREACH(_e_vols, l, v)
if (udi == v->udi) return v;
return NULL;
} | false | false | false | false | false | 0 |
pheapSortStrictOrder(PHEAP *ph)
{
l_int32 i, index, size;
PROCNAME("pheapSortStrictOrder");
if (!ph)
return ERROR_INT("ph not defined", procName, 1);
size = ph->n; /* save the actual size */
for (i = 0; i < size; i++) {
index = size - i;
SWAP_ITEMS(0, index - 1);
ph->n--; /* reduc... | false | false | false | false | false | 0 |
on_item_created (GooCanvas *canvas,
GooCanvasItem *item,
GooCanvasItemModel *model,
gpointer data)
{
if (!goo_canvas_item_model_get_parent (model)) {
/* root item / canvas */
g_signal_connect (item, "motion_notify_event",... | false | false | false | false | false | 0 |
gk110_pmu_pgob(struct nvkm_pmu *pmu, bool enable)
{
struct nvkm_device *device = pmu->subdev.device;
static const struct {
u32 addr;
u32 data;
} magic[] = {
{ 0x020520, 0xfffffffc },
{ 0x020524, 0xfffffffe },
{ 0x020524, 0xfffffffc },
{ 0x020524, 0xfffffff8 },
{ 0x020524, 0xffffffe0 },
{ 0x020530, 0x... | false | false | false | false | false | 0 |
mtdswap_readsect(struct mtd_blktrans_dev *dev,
unsigned long page, char *buf)
{
struct mtdswap_dev *d = MTDSWAP_MBD_TO_MTDSWAP(dev);
struct mtd_info *mtd = d->mtd;
unsigned int realblock, retries;
loff_t readpos;
struct swap_eb *eb;
size_t retlen;
int ret;
d->sect_read_count++;
if (header) {
if (unlikel... | false | false | false | false | false | 0 |
add_to_current( char *name,
TIC_P_DEFLT_TYPE fc_token,
fwtoken definer)
{
if ( define_token )
{
char *nu_name = strdup( name);
save_current = *current_definitions;
add_tic_entry( nu_name, FC_TOKEN_FUNC, fc_token,
definer, 0 , TRUE , NULL, current_definitions );
}el... | false | false | false | false | false | 0 |
rfbTightCleanup (rfbScreenInfoPtr screen)
{
if (tightBeforeBufSize) {
free (tightBeforeBuf);
tightBeforeBufSize = 0;
tightBeforeBuf = NULL;
}
if (tightAfterBufSize) {
free (tightAfterBuf);
tightAfterBufSize = 0;
tightAfterBuf = NULL;
}
if (j) tjDestroy... | false | false | false | false | false | 0 |
ReadLight( Collada::Light& pLight)
{
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
if (IsElement("light")) {
SkipElement();
}
else if (IsElement("spot")) {
pLight.mType = aiLightSource_SPOT;
}
else if (IsElement("ambient")) {
... | false | false | false | false | false | 0 |
gtkaml_ast_markup_complex_attribute_construct (GType object_type, const gchar* attribute_name, GtkamlAstMarkupTag* parent_tag, GtkamlAstMarkupTag* value_tag, ValaSourceReference* source_reference) {
GtkamlAstMarkupComplexAttribute* self = NULL;
const gchar* _tmp0_;
GtkamlAstMarkupTag* _tmp1_;
const gchar* _tmp2_;
... | false | false | false | false | false | 0 |
__make_move(cs_obj_t *o, int wx, int wy)
{
/*
* Movement
*/
__move_point(&o->point, wx, wy);
/*
* Animation
*/
if(o->flags & CS_OBJ_DOANIM)
{
/*
FIXME: Dirty hack here... Should play *any* death animation one-shot and then die.
*/
if((o->flags & CS_OBJ_DYING)
&& (o->anim.cframe >> 4 == 14))
cs_... | false | false | false | false | false | 0 |
gthshowalignmentdna(GtFile *outfp,
unsigned long linewidth,
Editoperation *alignment,
unsigned long lenalg,
unsigned long indelcount,
const GtUchar *useqorig,
unsigned lo... | false | false | false | false | false | 0 |
acquire_write_mbox(struct mailmbox_folder * folder)
{
int r;
int res;
r = mailmbox_validate_write_lock(folder);
if (r != MAILMBOX_NO_ERROR) {
res = mboxdriver_mbox_error_to_mail_error(r);
goto err;
}
if (folder->mb_written_uid < folder->mb_max_uid) {
r = mailmbox_expunge_no_lock(folder);
... | false | false | false | false | false | 0 |
vampReleaseOutputDescriptor(VampOutputDescriptor *desc)
{
#ifdef DEBUG_PLUGIN_ADAPTER
std::cerr << "PluginAdapterBase::Impl::vampReleaseOutputDescriptor(" << desc << ")" << std::endl;
#endif
if (desc->identifier) free((void *)desc->identifier);
if (desc->name) free((void *)desc->name);
if (desc->descri... | false | false | false | false | false | 0 |
CreateVoiceChannel_w(
BaseSession* session, const std::string& content_name, bool rtcp) {
// This is ok to alloc from a thread other than the worker thread
ASSERT(initialized_);
VoiceMediaChannel* media_channel = media_engine_->CreateChannel();
if (media_channel == NULL)
return NULL;
VoiceChannel* vo... | false | false | false | false | false | 0 |
ref_make_ref(void *ptrptr, size_t size, size_t ref_ofs) {
*(void**) ptrptr = calloc(1, size);
if (*(void **)ptrptr == NULL) {
return -1;
} else {
void *ptr = *(void **)ptrptr;
*((ref_t *) ((char*) ptr + ref_ofs)) = 1;
return 0;
}
} | false | false | false | false | false | 0 |
startRequest(QOrganizerAbstractRequest* req)
{
if (!req)
return false;
QWeakPointer<QOrganizerAbstractRequest> checkDeletion(req);
updateRequestState(req, QOrganizerAbstractRequest::ActiveState);
if (!checkDeletion.isNull())
performAsynchronousOperation(req);
return true;
} | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__gui__controls__DataField_Move(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * after)
{
struct __ecereNameSpace__ecere__gui__controls__DataField * __ecerePointer___ecereNameSpace__ecere__gui__controls__DataField = (struct __ecer... | false | false | false | false | false | 0 |
open_mtd_by_chdev(const char *mtd_dev)
{
int err, major, minor, mode;
struct path path;
/* Probably this is an MTD character device node path */
err = kern_path(mtd_dev, LOOKUP_FOLLOW, &path);
if (err)
return ERR_PTR(err);
/* MTD device number is defined by the major / minor numbers */
major = imajor(d_backi... | false | false | false | false | false | 0 |
device_remove_file_self(struct device *dev,
const struct device_attribute *attr)
{
if (dev)
return sysfs_remove_file_self(&dev->kobj, &attr->attr);
else
return false;
} | false | false | false | false | false | 0 |
apparmor_file_alloc_security(struct file *file)
{
int error = 0;
/* freed by apparmor_file_free_security */
struct aa_label *label = aa_begin_current_label(DO_UPDATE);
file->f_security = aa_alloc_file_ctx(label, GFP_KERNEL);
if (!file_ctx(file))
error = -ENOMEM;
aa_end_current_label(label);
return error;
} | false | false | false | false | false | 0 |
rnd_next(uchar *buf)
{
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
TRUE);
ha_macro_statistic_inc(ha_read_rnd_next_count);
int error=mi_scan(file, buf);
table->status=error ? STATUS_NOT_FOUND: 0;
if (!error)
rows_read++;
MYSQL_READ_ROW_DONE(error);
retu... | false | false | false | false | false | 0 |
brasero_tool_dialog_set_medium (BraseroToolDialog *self,
BraseroMedium *medium)
{
BraseroToolDialogPrivate *priv;
if (!medium)
return FALSE;
priv = BRASERO_TOOL_DIALOG_PRIVATE (self);
return brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (priv->selector), medium);
} | false | false | false | false | false | 0 |
XGI_GetVBType(struct vb_device_info *pVBInfo)
{
unsigned short flag, tempbx, tempah;
tempbx = VB_SIS302B;
flag = xgifb_reg_get(pVBInfo->Part4Port, 0x00);
if (flag == 0x02)
goto finish;
tempbx = VB_SIS301;
flag = xgifb_reg_get(pVBInfo->Part4Port, 0x01);
if (flag < 0xB0)
goto finish;
tempbx = VB_SIS301B;
... | false | false | false | false | false | 0 |
RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache) {
if (!log_->IsEnabled() || !FLAG_log_regexp) return;
LogMessageBuilder msg(this);
msg.Append("regexp-compile,");
LogRegExpSource(regexp);
msg.Append(in_cache ? ",hit\n" : ",miss\n");
msg.WriteToLogFile();
} | false | false | false | false | false | 0 |
getDateTimePattern(
const UResourceBundle *resource,
UnicodeString &result,
UErrorCode &status) {
UnicodeString defaultCalendarName;
if (!getStringWithFallback(
resource,
"calendar/default",
defaultCalendarName,
status)) {
return FA... | false | false | false | false | false | 0 |
open_stream(std::ofstream &o) {
o.open(filename.c_str(),std::ofstream::app);
if(!o.is_open()) return false;
o<<(Arc::Time().str(Arc::UserTime));
o<<" ";
return true;
} | 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.