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 |
|---|---|---|---|---|---|---|
ComputeHash(const std::string & filename)
{
struct stat results;
if (stat(filename.c_str(), &results) == 0)
{
// Treat the mtime + inode as a proxy for the contents
std::ostringstream fasthash;
fasthash << results.st_ino << ":";... | false | false | false | false | false | 0 |
OGRGeoJSONWriteLineCoords( OGRLineString* poLine, int nCoordPrecision )
{
json_object* poObjPoint = NULL;
json_object* poObjCoords = json_object_new_array();
const int nCount = poLine->getNumPoints();
for( int i = 0; i < nCount; ++i )
{
if( poLine->getCoordinateDimension() == 2 )
... | false | false | false | false | false | 0 |
handle_reply(int http_op_retval) {
char filename[256];
int nitems;
if (!rfp) return; // op was canceled
if (http_op_retval) {
if (log_flags.notice_debug) {
msg_printf(0, MSG_INFO,
"[notice] fetch of %s failed: %d", rfp->url, http_op_retval
);
}... | false | false | false | false | false | 0 |
ProcessDTRCACHE_CHECKED(DTR_ptr request){
// There's no need to check additionally for cache error
// If the error has occurred -- we just proceed the normal
// workflow as if it was not cached at all.
// But we should clear error flag if it was set by the pre-processor
request->reset_error_status()... | false | false | false | false | false | 0 |
static_ok_view (gamgi_direction *direction,
gamgi_window *window)
{
GtkWidget *dialog = window->dialog0;
GtkWidget *entry;
const char *name;
/***********************
* get direction color *
***********************/
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_red");
name = gtk_entry_get_text ... | false | false | false | false | false | 0 |
intel_dc21285_init(struct pci_dev *dev, struct map_pci_info *map)
{
unsigned long base, len;
base = pci_resource_start(dev, PCI_ROM_RESOURCE);
len = pci_resource_len(dev, PCI_ROM_RESOURCE);
if (!len || !base) {
/*
* No ROM resource
*/
base = pci_resource_start(dev, 2);
len = pci_resource_len(dev, 2)... | false | false | false | false | false | 0 |
clear_entries()
{
int i;
for(i=0; i<4; i++) {
ignore_changed_signal = TRUE;
gtk_entry_set_text(GTK_ENTRY(entry[i]), "");
}
accumulator = 0;
} | false | false | false | false | false | 0 |
is_min4_four_centre(int v)
/* return 1 if v is the centre of a four-reduction, 0 if not.
*/
{
EDGE *e;
if (degree[v] != 4) return 0;
e = firstedge[v];
if (degree[e->prev->end] >= 5 && degree[e->next->end] >= 5
|| degree[e->end] >= 5 && degree[e->next->next->end] >= 5)
return 1;
... | false | false | false | false | false | 0 |
lp8788_irq_unregister(struct platform_device *pdev,
struct lp8788_charger *pchg)
{
int i;
int irq;
for (i = 0; i < pchg->num_irqs; i++) {
irq = pchg->irqs[i].virq;
if (!irq)
continue;
free_irq(irq, pchg);
}
} | false | false | false | false | false | 0 |
node_is_authentic(const char *vendor, const header_t *head)
{
if (vendor) {
if (is_strcaseprefix(vendor, "limewire/")) {
return !header_get(head, "Bye-Packet") &&
header_get(head, "Remote-IP") &&
header_get(head, "Vendor-Message") &&
header_get(head, "Accept-Encoding");
}
}
return TRUE;
} | false | false | false | false | false | 0 |
optimize(int result, bool keepLvalue)
{ Expression *e;
//printf("SliceExp::optimize(result = %d) %s\n", result, toChars());
e = this;
e1 = e1->optimize(WANTvalue | (result & WANTexpand));
if (!lwr)
{ if (e1->op == TOKstring)
{ // Convert slice of string literal into dynamic array
... | false | false | false | false | false | 0 |
add_ic_call(struct compilation_unit *cu, struct insn *insn)
{
struct ic_call *ic_call;
ic_call = malloc(sizeof(struct ic_call));
if (!ic_call)
return -ENOMEM;
ic_call->insn = insn;
list_add_tail(&ic_call->list_node, &cu->ic_call_list);
return 0;
} | false | false | false | false | false | 0 |
ack_pkt(git_pkt **out, const char *line, size_t len)
{
git_pkt_ack *pkt;
GIT_UNUSED(line);
GIT_UNUSED(len);
pkt = git__calloc(1, sizeof(git_pkt_ack));
GITERR_CHECK_ALLOC(pkt);
pkt->type = GIT_PKT_ACK;
line += 3;
len -= 3;
if (len >= GIT_OID_HEXSZ) {
git_oid_fromstr(&pkt->oid, line + 1);
line += GIT_OID_... | false | false | false | false | false | 0 |
cli_print_brick_status (cli_volume_status_t *status)
{
int fieldlen = CLI_VOL_STATUS_BRICK_LEN;
int bricklen = 0;
char *p = NULL;
int num_tabs = 0;
p = status->brick;
bricklen = strlen (p);
while (bricklen > 0) {
if (bricklen > fieldlen) {
... | false | false | false | false | false | 0 |
audio_wave_format(int wid, audio_formats_t fmt, int fs)
{
unsigned old_xsize, new_size;
wid = audio_wave_alloc(wid);
if(wid < 0)
return wid;
old_xsize = wavetab[wid].xsize;
wavetab[wid].format = fmt;
wavetab[wid].rate = fs;
if(wavetab[wid].data.si8)
{
new_size = _calc_xsize(wid);
if(wavetab[wid].xsize !=... | false | false | false | false | false | 0 |
Mtr_SwapGroups(
MtrNode * first /* first node to be swapped */,
MtrNode * second /* second node to be swapped */)
{
MtrNode *node;
MtrNode *parent;
int sizeFirst;
int sizeSecond;
if (second->younger == first) { /* make first first */
node = first;
first = second;
second = node;
} else if... | false | false | false | false | false | 0 |
dvr_add_pcb(struct adapter_s *a, unsigned int pid, unsigned int type,
unsigned int pidt, void (*callback)(void *data, void *arg), void *arg) {
struct pidcallback_s *pcb;
logwrite(LOG_DEBUG, "dvr: Add %s callback for PID %4d (0x%04x) type %d (%s)",
((type == DVRCB_TS) ? "TS" : "Section"), pid, pid, pidt, pidtnam... | false | false | false | false | false | 0 |
isVariableChanged(const Token *start, const Token *end, const unsigned int varid)
{
for (const Token *tok = start; tok != end; tok = tok->next()) {
if (tok->varId() == varid) {
if (Token::Match(tok, "%var% ="))
return true;
const Token *parent = tok->astParent();
... | false | false | false | false | false | 0 |
IsNexusInCore(const Cache cache,const NexusInfo *nexus_info)
{
MagickPassFail
status=MagickFail;
const CacheInfo
* restrict cache_info=(const CacheInfo *) cache;
if (cache_info && (cache_info->storage_class != UndefinedClass))
{
if (cache_info->type == PingCache)
{
status=Mag... | false | false | false | false | false | 0 |
ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x)
{
BUF_MEM *b = NULL;
const unsigned char *p;
void *ret=NULL;
int len;
len = asn1_d2i_read_bio(in, &b);
if(len < 0) goto err;
p=(const unsigned char *)b->data;
ret=ASN1_item_d2i(x,&p,len, it);
err:
if (b != NULL) BUF_MEM_free(b);
return(ret);
} | false | false | false | false | false | 0 |
close_pl(PG_FUNCTION_ARGS)
{
Point *pt = PG_GETARG_POINT_P(0);
LINE *line = PG_GETARG_LINE_P(1);
Point *result;
LINE *tmp;
double invm;
result = (Point *) palloc(sizeof(Point));
if (FPzero(line->B)) /* vertical? */
{
result->x = line->C;
result->y = pt->y;
PG_RETURN_POINT_P(result);
}
if... | false | false | false | false | false | 0 |
disp_total()
{
//--- calculate the total income and expense ----//
float totalIncome = (float) 0;
float totalExpense = (float) 0;
Nation* nationPtr = nation_array[info.viewing_nation_recno];
int i;
for( i=0 ; i<INCOME_TYPE_COUNT ; i++ )
totalIncome += nationPtr->income_365days(i);
for( i=0 ; i<EXPENSE_TY... | false | false | false | false | false | 0 |
mc_get_pub_by_slot(TCPA_KEY_HANDLE tpm_handle)
{
struct key_mem_cache *tmp;
TCPA_STORE_PUBKEY *ret;
if (tpm_handle == NULL_TPM_HANDLE)
return NULL;
for (tmp = key_mem_cache_head; tmp; tmp = tmp->next) {
LogDebugFn("TCSD mem_cached handle: 0x%x",
tmp->tcs_handle);
if (tmp->tpm_handle == tpm_handle) {
... | false | false | false | false | false | 0 |
__ieee754_sinhl(long double x)
{
long double t,w,h;
u_int32_t jx,ix,i0,i1;
/* Words of |x|. */
GET_LDOUBLE_WORDS(jx,i0,i1,x);
ix = jx&0x7fff;
/* x is INF or NaN */
if(__builtin_expect(ix==0x7fff, 0)) return x+x;
h = 0.5;
if (jx & 0x8000) h = -h;
/* |x| in [0,25], return sign(x)*0.5*(E+E/(E+1))) */... | false | false | false | false | false | 0 |
setup_cli_server(void)
{
ns_bzero(&cliserver,sizeof(struct cli_server));
cliserver.listen_fd = -1;
cliserver.verbose = turn_params.verbose;
if(pthread_create(&(cliserver.thr), NULL, run_cli_server_thread, &cliserver)<0) {
perror("Cannot create cli thread\n");
exit(-1);
}
pthread_detach(cliserver.thr);
} | false | false | false | false | false | 0 |
drisw_create_screen(struct drisw_loader_funcs *lf)
{
struct sw_winsys *winsys = NULL;
struct pipe_screen *screen = NULL;
winsys = dri_create_sw_winsys(lf);
if (winsys == NULL)
return NULL;
screen = sw_screen_create(winsys);
if (!screen)
goto fail;
screen = debug_screen_wrap(screen);
... | false | false | false | false | false | 0 |
smi_dvb_init(struct smi_port *port)
{
int ret;
struct dvb_adapter *adap = &port->dvb_adapter;
struct dvb_demux *dvbdemux = &port->demux;
dev_dbg(&port->dev->pci_dev->dev,
"%s, port %d\n", __func__, port->idx);
ret = dvb_register_adapter(adap, "SMI_DVB", THIS_MODULE,
&port->dev->pci_dev->dev,
adap... | false | false | false | false | false | 0 |
send_imap_cmd( imap_store_t *ctx, struct imap_cmd *cmd )
{
int bufl, litplus;
const char *buffmt;
char buf[1024];
cmd->tag = ++ctx->nexttag;
if (!cmd->param.data) {
buffmt = "%d %s\r\n";
litplus = 0;
} else if ((cmd->param.to_trash && ctx->trashnc == TrashUnknown) || !CAP(LITERALPLUS)) {
buffmt = "%d %s{%d... | false | false | false | false | false | 0 |
g450_preinit(struct matrox_fb_info *minfo)
{
u_int32_t c2ctl;
u_int8_t curctl;
u_int8_t c1ctl;
/* minfo->hw.MXoptionReg = minfo->values.reg.opt; */
minfo->hw.MXoptionReg &= 0xC0000100;
minfo->hw.MXoptionReg |= 0x00000020;
if (minfo->devflags.novga)
minfo->hw.MXoptionReg &= ~0x00000100;
if (minfo->devflags.n... | false | false | false | false | false | 0 |
lua_copy (lua_State *L, int fromidx, int toidx) {
TValue *fr, *to;
lua_lock(L);
fr = index2addr(L, fromidx);
to = index2addr(L, toidx);
api_checkvalidindex(to);
setobj(L, to, fr);
if (isupvalue(toidx)) /* function upvalue? */
luaC_barrier(L, clCvalue(L->ci->func), fr);
/* LUA_REGISTRYINDEX does not... | false | false | false | false | false | 0 |
mpz_poly_fread(mpz_poly_t poly, FILE* f)
{
// read poly length
unsigned long length;
if (!fscanf(f, "%ld", &length))
return 0;
poly->length = 0;
mpz_poly_ensure_alloc(poly, length);
// read coefficients
for (unsigned long i = 0; i < length; i++)
{
if (!mpz_inp_str(poly->coeffs[i], ... | false | false | false | false | false | 0 |
build_probe_list(struct inode *inode,
struct vm_area_struct *vma,
unsigned long start, unsigned long end,
struct list_head *head)
{
loff_t min, max;
struct rb_node *n, *t;
struct uprobe *u;
INIT_LIST_HEAD(head);
min = vaddr_to_offset(vma, start);
max = min + (end - start) - 1;
spin_lock(&uprobes_tr... | false | false | false | false | false | 0 |
main(int argc, char** argv) {
char buf[256];
FILE* in, *out;
fprintf(stderr, "worker starting\n");
in = fopen("in", "r");
if (!in) {
fprintf(stderr, "missing input file\n");
exit(1);
}
out = fopen("out", "w");
if (!out) {
fprintf(stderr, "can't open output file\... | false | false | false | false | true | 1 |
razf_end_flush(RAZF *rz){
uint32_t tout;
if(rz->buf_len){
_razf_write(rz, rz->inbuf, rz->buf_len);
rz->buf_off = rz->buf_len = 0;
}
while(1){
tout = rz->stream->avail_out;
deflate(rz->stream, Z_FINISH);
rz->out += tout - rz->stream->avail_out;
if(rz->stream->avail_out < RZ_BUFFER_SIZE){
#ifdef _USE_KNET... | false | false | false | false | false | 0 |
System_ShellOpen(char * fileName, va_list args)
{
bool result = false;
char filePath[MAX_F_STRING*4];
int len;
#if defined(__WIN32__)
filePath[0] = '"';
vsnprintf(filePath+1, sizeof(filePath)-2,fileName, args);
#else
vsnprintf(filePath, sizeof(filePath), fileName, args);
#endif
filePath[sizeof(file... | false | false | false | false | false | 0 |
LoadConstants (LoadState* S, Proto* f)
{
int i,n;
n=LoadInt(S);
f->k=luaM_newvector(S->L,n,TObject);
f->sizek=n;
for (i=0; i<n; i++)
{
TObject* o=&f->k[i];
int t=LoadByte(S);
switch (t)
{
case LUA_TNUMBER:
setnvalue(o,LoadNumber(S));
break;
case LUA_TSTRING:
setsvalue2n(o,LoadString(S));
break;
... | false | false | false | false | false | 0 |
DoTraffic(void *p)
{
static unsigned uLedBitsOld=0;
static long lAllPacketsPrior=0;
static struct timeval tWhenPrior;
struct timeval tWhenNow;
struct timeval tWhenDiff;
#if HAVE_GETIFADDRS
struct ifaddrs *pIfAddrs;
struct ifaddrs *pThisIfAddrs;
#... | false | false | false | false | false | 0 |
get_mutable_buffer(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable)
{
size_t length = size / sizeof(char_t);
if (is_mutable)
{
out_buffer = static_cast<char_t*>(const_cast<void*>(contents));
out_length = length;
}
else
{
char_t* buffer = stat... | false | false | false | false | false | 0 |
serial_loop(WORKER_INFO *info, ESL_SQFILE *dbfp)
{
int sstatus;
ESL_SQ *dbsq = NULL; /* one target sequence (digital) */
dbsq = esl_sq_CreateDigital(info->om->abc);
/* Main loop: */
while ((sstatus = esl_sqio_Read(dbfp, dbsq)) == eslOK)
{
p7_pli_NewSeq(info->pli, dbsq);
p7_bg_S... | false | false | false | false | false | 0 |
add_all_nodes(const std::string& what)
{
for (NODE_MAP::const_iterator
i = CARD_LIST::card_list.nodes()->begin();
i != CARD_LIST::card_list.nodes()->end();
++i) {
if ((i->first != "0") && (i->first.find('.') == std::string::npos)) {
NODE* node = i->second;
assert (node);
pus... | false | false | false | false | false | 0 |
cx24123_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct cx24123_state *state = fe->demodulator_priv;
int sync = cx24123_readreg(state, 0x14);
*status = 0;
if (state->config->dont_use_pll) {
u32 tun_status = 0;
if (fe->ops.tuner_ops.get_status)
fe->ops.tuner_ops.get_status(fe, &tun_stat... | false | false | false | false | false | 0 |
compute_CP_length(const int snumber,
StatementDataTable* statement_data)
{ int i;
int j;
int successor_max;
int max;
#ifdef DEBUG_MKTG
if (snumber == 0)
{ fprintf(stderr, "%s %d : *** Oops! "
"A Statement does not find. Why?\n"
"Bec... | false | false | false | false | false | 0 |
mca_pml_bfo_recv_request_reset(mca_pml_bfo_recv_request_t* match) {
int i;
assert(true != match->req_recv.req_base.req_pml_complete);
/* Free up any resources that were reserved for this receive. This
* was copied from the receive completion code. */
for(i = 0; i < (int)match->req_rdma_cnt; i++... | false | false | false | false | false | 0 |
rtl8723a_EfuseGetCurrentSize_BT(struct rtw_adapter *padapter)
{
u16 btusedbytes;
u16 efuse_addr;
u8 bank, startBank;
u8 hoffset = 0, hworden = 0;
u8 efuse_data, word_cnts = 0;
u16 retU2 = 0;
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
btusedbytes = pHalData->BTEfuseUsedBytes;
efuse_addr = (u16)... | false | false | false | false | false | 0 |
ITR_indexTT(tkitr_t *itr, kterm_t tt, int def)
{
int i;
for(i = itr->c; i < itr->e; i++) {
if(TT_(itr->ts[i]) == tt) return i;
}
return def;
} | false | false | false | false | false | 0 |
propertySetXMLRead(const std::string &el,
std::map<std::string, std::string> map,
Property::Set &set,
Property::Property *¤tProp) {
if (el == "property") {
std::string propName = map["name"];
std:... | false | false | false | false | false | 0 |
write(hsStream* S) {
S->writeShort(fName.len());
S->writeStr(fName);
S->writeInt(fVars.getSize());
S->writeBool(fServerMayDelete);
for (size_t i=0; i<fVars.getSize(); i++)
fVars[i].write(S);
} | false | false | false | false | false | 0 |
save_custom_extra (int *len, uae_u8 *dstptr)
{
uae_u8 *dstbak, *dst;
if (dstptr)
dstbak = dst = dstptr;
else
dstbak = dst = xmalloc (uae_u8, 1000);
SL ((currprefs.cs_compatible << 24) | (&get_mem_bank (0) != &chipmem_bank ? 2 : 0) | 1);
SB (currprefs.genlock ? 1 : 0);
SB (currprefs.cs_rtc);
SL (currprefs.c... | false | false | false | false | false | 0 |
parseVideoTag(const FLVTag& flvtag, const FLVVideoTag& videotag, boost::uint32_t thisTagPos)
{
if ( ! _video ) {
log_error(_("Unexpected video tag found at offset %d of FLV stream "
"advertising no video in header. We'll warn only once per "
"FLV, expecting any further video t... | false | false | false | false | false | 0 |
DoAlarmAction(void)
{
if (hide_taskbar_alarm)
{
hide_taskbar_alarm = False;
HideTaskBar();
}
if (stick_taskbar_alarm)
{
stick_taskbar_alarm = False;
WarpTaskBar(auto_stick_y);
}
if (tip_window_alarm)
{
tip_window_alarm = False;
if (AutoHide && WindowState == 0)
{
Windo... | false | false | false | false | false | 0 |
mousePressEvent(QMouseEvent *e)
{
if (Qt::LeftButton!=e->button())
return;
e->accept();
for (int index = 0; index < m_tabs.count(); ++index) {
if (tabRect(index).contains(e->pos())) {
m_currentIndex = index;
update();
m_triggerTimer.start(0);
b... | false | false | false | false | false | 0 |
data(Type t) const
{
ByteVector v;
switch(t) {
case Latin1:
{
for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++)
v.append(char(*it));
break;
}
case UTF8:
{
std::string s = to8Bit(true);
v.setData(s.c_str(), s.length());
break;
}
case UTF16:
{
... | false | false | false | false | false | 0 |
extract_hostnames(struct remote *rp, GtkWidget *hwig, GtkWidget *awig)
{
const gchar *h = gtk_entry_get_text(GTK_ENTRY(hwig));
const gchar *a = gtk_entry_get_text(GTK_ENTRY(awig));
netid_t resip;
enum IPatype htype;
if (strlen(h) >= HOSTNSIZE) {
doerror(toplevel, "Sorry host name %s is too long", h);
retu... | false | true | false | false | false | 1 |
mbfl_identify_encoding_name(mbfl_string *string, enum mbfl_no_encoding *elist, int elistsz, int strict)
{
const mbfl_encoding *encoding;
encoding = mbfl_identify_encoding(string, elist, elistsz, strict);
if (encoding != NULL &&
encoding->no_encoding > mbfl_no_encoding_charset_min &&
encoding->no_encoding ... | false | false | false | false | false | 0 |
vf_selection_get_list_by_index(ViewFile *vf)
{
GList *list = NULL;
switch (vf->type)
{
case FILEVIEW_LIST: list = vflist_selection_get_list_by_index(vf); break;
case FILEVIEW_ICON: list = vficon_selection_get_list_by_index(vf); break;
}
return list;
} | false | false | false | false | false | 0 |
show_one_toolset(FILE *toolfile, int toolnum, word32 addr)
{
word32 rout_addr;
int num_routs;
int i;
num_routs = dis_get_memory_ptr(addr);
fprintf(toolfile, "Tool 0x%02x, table: 0x%06x, num_routs:%03x\n",
toolnum, addr, num_routs);
for(i = 1; i < num_routs; i++) {
rout_addr = dis_get_memory_ptr(addr + 4*i);... | false | false | false | false | false | 0 |
clip(int x, int y, int w, int h)
{
if (graphics_disabled) return;
ex = x;
ey = y;
ew = w;
eh = h;
if (ew < 0) ew = 0;
if (eh < 0) eh = 0;
if (ex < 0)
{
ew += ex;
ex = 0;
}
if (ey < 0)
{
eh += ey;
ey = 0;
}
if (ex+ew > table_width)
ew = table_width - ex;
if (ey+eh > tab... | false | false | false | false | false | 0 |
apol_infoflow_analysis_append_class_perm(const apol_policy_t * p,
apol_infoflow_analysis_t * ia, const char *class_name, const char *perm_name)
{
apol_obj_perm_t *op = NULL;
size_t i;
if (p == NULL || ia == NULL) {
ERR(p, "%s", strerror(EINVAL));
errno = EINVAL;
return -1;
}
if (class_name == NULL... | false | false | false | false | false | 0 |
gkd_secret_objects_dispatch (GkdSecretObjects *self, DBusMessage *message)
{
GckBuilder builder = GCK_BUILDER_INIT;
DBusMessage *reply = NULL;
GError *error = NULL;
GList *objects;
GckSession *session;
gchar *c_ident;
gchar *i_ident;
gboolean is_item;
const char *path;
g_return_val_if_fail (GKD_SECRET_IS_OBJ... | false | false | false | false | false | 0 |
globus_l_gram_audit_write_timestamp(
FILE * f,
time_t when,
const char * delim)
{
int rc;
char * t;
char * tmp;
struct tm... | true | true | false | false | false | 1 |
check_for_overlaps (VEC (fieldoff_s,heap) *fieldstack)
{
fieldoff_s *fo = NULL;
unsigned int i;
HOST_WIDE_INT lastoffset = -1;
FOR_EACH_VEC_ELT (fieldoff_s, fieldstack, i, fo)
{
if (fo->offset == lastoffset)
return true;
lastoffset = fo->offset;
}
return false;
} | false | false | false | false | false | 0 |
findInodeInfo(
unixFile *pFile, /* Unix file with file desc used in the key */
unixInodeInfo **ppInode /* Return the unixInodeInfo object here */
){
int rc; /* System call return code */
int fd; /* The file descriptor for pFile */
struct unixF... | false | false | false | false | false | 0 |
GetClippingPlaneInDataCoords(
vtkMatrix4x4 *propMatrix, int i, double hnormal[4])
{
vtkPlaneCollection *clipPlanes = this->ClippingPlanes;
const double *mat = *propMatrix->Element;
if (clipPlanes)
{
int n = clipPlanes->GetNumberOfItems();
if (i >= 0 && i < n)
{
// Get the plane
vt... | false | false | false | false | true | 1 |
scale_vec(double scalefactor, long nvals, double *restrict values)
{
long n;
#if defined(_OPENMP)
#pragma omp parallel for default(none) shared(nvals, scalefactor, values)
#endif
for ( n = 0; n < nvals; ++n )
{
values[n] *= scalefactor;
}
} | false | false | false | false | false | 0 |
max14577_muic_chg_handler(struct max14577_muic_info *info)
{
int chg_type;
bool attached;
int ret = 0;
chg_type = max14577_muic_get_cable_type(info,
MAX14577_CABLE_GROUP_CHG, &attached);
dev_dbg(info->dev,
"external connector is %s(chg_type:0x%x, prev_chg_type:0x%x)\n",
attached ? "attached" : "detached... | false | false | false | false | false | 0 |
deliver()
{
m_server->incomingMessage( m_message );
m_delivered = true;
} | false | false | false | false | false | 0 |
bilinear_magnify_make_weights (PixopsFilterDimension *dim,
double scale)
{
double *pixel_weights;
int n;
int offset;
int i;
if (scale > 1.0) /* Linear */
{
n = 2;
dim->offset = 0.5 * (1 / scale - 1);
}
else /* Tile */
{
... | false | false | false | false | false | 0 |
getRowFromIdPos(int id, int pos) const
{
bool foundid = false;
// this loop finds the last *nonempty* row with the same id
// and position <= pos
RowList::const_iterator bestrow = rowlist.begin();
RowList::const_iterator it = rowlist.begin();
RowList::const_iterator const end = rowlist.end();
for (; it != end; ... | false | false | false | false | false | 0 |
Alignment_print_sugar_block(Alignment *alignment,
Sequence *query, Sequence *target, FILE *fp){
fprintf(fp, "%s %d %d %c %s %d %d %c %d",
query->id,
Alignment_get_coordinate(alignment, query, target,
TRUE, TRUE),
Alignment_get_... | false | false | false | false | false | 0 |
arcnet_unregister_proto(struct ArcProto *proto)
{
int count;
if (arc_proto_default == proto)
arc_proto_default = &arc_proto_null;
if (arc_bcast_proto == proto)
arc_bcast_proto = arc_proto_default;
if (arc_raw_proto == proto)
arc_raw_proto = arc_proto_default;
for (count = 0; count < 256; count++) {
if (a... | false | false | false | false | false | 0 |
cavan_window_init(struct cavan_window *win, struct cavan_application_context *context)
{
int ret;
struct cavan_display_device *display;
if (context == NULL)
{
pr_red_info("context == NULL");
return -EINVAL;
}
ret = pthread_mutex_init(&win->lock, NULL);
if (ret < 0)
{
pr_error_info("pthread_mutex_init");... | false | false | false | false | false | 0 |
is_cardinal_tileset_dir(const struct tileset *t,
enum direction8 dir)
{
if (t->hex_width > 0 || t->hex_height > 0) {
return is_valid_tileset_dir(t, dir);
} else {
return (dir == DIR8_NORTH || dir == DIR8_EAST
|| dir == DIR8_SOUTH || dir == DIR8_WEST);
}
} | true | true | false | false | false | 1 |
gsb_scheduler_list_fill_transaction_row ( GtkTreeStore *store,
GtkTreeIter *iter,
const gchar *line[SCHEDULER_COL_VISIBLE_COLUMNS] )
{
gchar *color_str = NULL;
gint i;
if ( line[COL_NB_AMOUNT] && g_utf8_strchr ( line[COL_NB_AMOUNT], -1, '-' ) )
color_... | false | false | false | false | true | 1 |
deviceClassIntegrate(device_ *r)
{
devicePrivate_ *p;
double Veq, R, i0;
ReturnErrIf(r == NULL);
p = r->private;
ReturnErrIf(p == NULL);
Debug("Integrating %s %s %p", r->class->type, r->refdes, r);
/* Modified Nodal Analysis Stamp
*
* |_Vk_Vj_Ir_|_rhs_|
* k | -- -- 1 | -- | + /\ Rn -
* ... | false | false | false | false | false | 0 |
_rtl92d_phy_pimode_switch(struct ieee80211_hw *hw, bool pi_mode)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
u32 mode;
RTPRINT(rtlpriv, FINIT, INIT_IQK,
"BB Switch to %s mode!\n", pi_mode ? "PI" : "SI");
mode = pi_mode ? 0x01000100 : 0x01000000;
rtl_set_bbreg(hw, 0x820, MASKDWORD, mode);
rtl_set_bbreg(hw, 0x828... | false | false | false | false | false | 0 |
print_comment(FILE *file, CloogOptions *options,
const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
if (options->language == LANGUAGE_FORTRAN) {
fprintf(file, "! ");
vfprintf(file, fmt, args);
fprintf(file, "\n");
} else {
fprintf(file, "/* ");
vfprintf(file, fmt, args);
fp... | false | false | false | false | false | 0 |
SWIG_Tcl_GetModule(Tcl_Interp *interp) {
const char *data;
swig_module_info *ret = 0;
/* first check if pointer already created */
data = Tcl_GetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TCL_GLOBAL_ONLY);
if (data) {
SWIG_UnpackData(data, &ret, size... | false | false | false | false | false | 0 |
write_ratio_db(PyObject *self, PyObject *args){
PyObject *ratio_dict;
PyObject *dict_key, *dict_value;
DBT key, data;
DB *rdb;
double ratio;
simprof sp;
Py_ssize_t ppos;
int i;
DB_BTREE_STAT *stat;
memset(&key, 0, sizeof(key));
memset(&data, 0, sizeof(data));
if(!PyArg_... | false | false | false | false | false | 0 |
gst_tag_list_add_valist_values (GstTagList * list, GstTagMergeMode mode,
const gchar * tag, va_list var_args)
{
g_return_if_fail (GST_IS_TAG_LIST (list));
g_return_if_fail (gst_tag_list_is_writable (list));
g_return_if_fail (GST_TAG_MODE_IS_VALID (mode));
g_return_if_fail (tag != NULL);
if (mode == GST_T... | false | false | false | false | false | 0 |
pass_establish(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
{
struct iwch_ep *ep = ctx;
struct cpl_pass_establish *req = cplhdr(skb);
PDBG("%s ep %p\n", __func__, ep);
ep->snd_seq = ntohl(req->snd_isn);
ep->rcv_seq = ntohl(req->rcv_isn);
set_emss(ep, ntohs(req->tcp_opt));
dst_confirm(ep->dst);
state_... | false | false | false | false | false | 0 |
ac_out(U16B low, U16B high, U16B tot) {
register U32B r;
r=(U32B)(h-l)+1;
h=(U16B)(r*high/tot-1)+l;
l+=(U16B)(r*low/tot);
if (!((h^l)&0x8000)) {
putbit(l&0x8000);
while(s) {
--s;
putbit(~l&0x8000);
}
l<<=1;
h<<=1;
h|=1;
while (!((h^l)&0x8000)) {
putbit(l&0x8000);
... | false | false | false | false | false | 0 |
nilfs_collect_dat_data(struct nilfs_sc_info *sci,
struct buffer_head *bh, struct inode *inode)
{
int err;
err = nilfs_bmap_propagate(NILFS_I(inode)->i_bmap, bh);
if (err < 0)
return err;
err = nilfs_segctor_add_file_block(sci, bh, inode, sizeof(__le64));
if (!err)
sci->sc_datablk_cnt++;
return err;
} | false | false | false | false | false | 0 |
fix_notes(const char *name, char *notes)
{
char *cleft, *cright, *cback, *ctmp;
if ((! name) || (! notes)) {
return notes;
}
/* do we have a BACKSLASH in shortname ? */
cback = strchr(name, '\\');
if ((! cback) || (cback == name)) {
return notes;
}
/* do we have left, but no right parenthesis... | false | false | false | false | false | 0 |
ssa_analyze_liveness(struct compilation_unit *cu)
{
int err = 0;
err = init_sets(cu);
if (err)
goto out;
analyze_use_def(cu);
err = analyze_live_sets(cu);
out:
return err;
} | false | false | false | false | false | 0 |
odb_cache(git_odb *odb)
{
if (odb->rc.owner != NULL) {
git_repository *owner = odb->rc.owner;
return &owner->objects;
}
return &odb->own_cache;
} | false | false | false | false | false | 0 |
Cpdt(Task *task)
{
task->clock = 0.0;
ReadytaskChk_for_Dt(task);
comp_cand_tasks(task);
comp_cand_pc(task);
while (check_end(task)) {
while (task->Readys > 0
&& number_IntSet(task->cand_pc) > 0) {
Makectt(task);
ReadySel(task);
TaskAssign(ta... | false | false | false | false | false | 0 |
set_value(std::string val, CdlValueFormat new_format)
{
CYG_REPORT_FUNCNAME("CdlSimpleValue::set_value (string)");
CYG_REPORT_FUNCARG1XV(this);
value = val;
int_value = 0;
double_value = 0.0;
valid_flags = string_valid;
format = new_format... | false | false | false | false | false | 0 |
usm_handle_report(void *sessp,
netsnmp_transport *transport, netsnmp_session *session,
int result, netsnmp_pdu *pdu)
{
/*
* handle reportable errors
*/
/* this will get in our way */
usm_free_usmStateReference(pdu->securityStateRef);
pdu->securityStateRef ... | false | false | false | false | false | 0 |
toggleFullscreen()
{
if ( !GetScreen() )
return false;
int w = GetScreen()->w;
int h = GetScreen()->h;
// queueOperation( new MouseVisibility( false ), true );
int flags = SDL_SWSURFACE;
if ( !fullScreen )
flags |= SDL_FULLSCREEN;
queueOperation( new InitScreenOp( w,h,bitsperpixel,f... | false | false | false | false | false | 0 |
search_find_again(gboolean change_direction)
{
GeanyDocument *doc = document_get_current();
g_return_if_fail(doc != NULL);
if (search_data.text)
{
gboolean forward = ! search_data.backwards;
gint result = document_find_text(doc, search_data.text, search_data.original_text, search_data.flags,
change_directi... | false | false | false | false | false | 0 |
encode_cb_sequence_res(struct svc_rqst *rqstp,
struct xdr_stream *xdr,
const struct cb_sequenceres *res)
{
__be32 *p;
__be32 status = res->csr_status;
if (unlikely(status != 0))
goto out;
status = encode_sessionid(xdr, &res->csr_sessionid);
if (status)
goto out;
p = xdr_reserve_space(... | false | false | false | false | false | 0 |
LM_UploadBlock (void)
{
int texture = gl_lms.current_lightmap_texture;
GL_SelectTexture (GL_TEXTURE0);
// FIXME: OH FFS this is so stupid: tell the GL_Bind batching mechanism
// that texture unit 0 has been re-bound, as it most certainly has been.
gl_state.currenttextures[gl_state.currenttmu] = -1;
GL_B... | false | false | false | false | false | 0 |
CheckMult(int nindex1, int indexarray1[],
int nindex2, int indexarray2[],
int nindex3, int indexarray3[],
int &nindexr, int indexarrayr[]) const
{
int i, i2, i3;
nindexr=0;
int sortindexarray1[mx_array_dim], sortindexarray2[mx_array_dim],
... | false | false | false | false | false | 0 |
ckinit(size_t size, size_t reserved, bool leaking)
{
void *arena;
ckhunk_t *ck;
g_assert(size >= reserved);
size = size_saturate_add(size, ckalloc_round(sizeof(struct ckhunk)));
g_assert(size_is_positive(size));
g_assert(size_is_non_negative(reserved));
arena = leaking ? vmm_core_alloc(size) : vmm_core_alloc_... | false | false | false | false | false | 0 |
e132xs_mul(void)
{
INT32 op1, op2;
INT32 single_word;
op1 = op2 = 0;
//PC or SR aren't denoted, else result is undefined
if( (S_CODE == PC_CODE && !S_BIT) || (S_CODE == SR_CODE && !S_BIT) || (D_CODE == PC_CODE && !D_BIT) || (D_CODE == SR_CODE && !D_BIT) )
{
verboselog( 1, "Denoted PC or SR in MUL in... | false | false | false | false | false | 0 |
sp_color_preview_set_rgba32 (SPColorPreview *cp, guint32 rgba)
{
cp->rgba = rgba;
if (GTK_WIDGET_DRAWABLE (cp)) {
gtk_widget_queue_draw (GTK_WIDGET (cp));
}
} | false | false | false | false | false | 0 |
pinentry_active_p (ctrl_t ctrl, int waitseconds)
{
(void)ctrl;
if (waitseconds > 0)
{
pth_event_t evt;
int rc;
evt = pth_event (PTH_EVENT_TIME, pth_timeout (waitseconds, 0));
if (!pth_mutex_acquire (&entry_lock, 0, evt))
{
if (pth_event_occurred (evt))
rc ... | false | false | false | false | false | 0 |
COM_Standard_color(int number)
{
struct color_rgb rgb;
if (number < 0 || number >= G_num_standard_colors())
return;
rgb = G_standard_color_rgb(number);
COM_Color_RGB(rgb.r, rgb.g, rgb.b);
} | false | false | false | false | false | 0 |
dobatch_r2hc(const P *ego, R *I, R *O, R *buf, INT batchsz)
{
X(cpy2d_ci)(I, buf,
ego->n, ego->rs0, WS(ego->bcsr /* hack */, 1),
batchsz, ego->ivs, 1, 1);
if (IABS(WS(ego->csr, 1)) < IABS(ego->ovs)) {
/* transform directly to output */
ego->k(buf, buf + WS(ego->bcsr /* hack */, 1),
O, O + ego... | false | false | false | false | false | 0 |
RelocateField(BinaryObject &BO, uint32_t Offset,
int64_t Value, unsigned Size) {
if (Size == 32)
BO.fixWord32(Value, Offset);
else if (Size == 64)
BO.fixWord64(Value, Offset);
else
llvm_unreachable("don't know howto patch relocatable field");
} | 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.