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 |
|---|---|---|---|---|---|---|
Match(Isolate* isolate,
Handle<ByteArray> code_array,
Handle<String> subject,
int* registers,
int start_position) {
ASSERT(subject->IsFlat());
AssertNoAllocation a;
const byte* code_bas... | false | false | false | false | false | 0 |
parseWorklist(FILE* f, DcmDataset& dset)
{
SimpleStr hexChar(2);
SimpleStr val;
int valCount = 0;
int c;
/* ignore first '\\' */
while (((c = fgetc(f)) != EOF) && isspace(c)) {
/* do nothing */
}
if (c != SEPARATOR_CHAR) {
CERR << "error: expected \'" << char(SEPARATOR_CHAR) << "\' " ... | false | false | false | false | false | 0 |
setCanvasMargin( int margin, int axis )
{
if ( margin < -1 )
margin = -1;
if ( axis == -1 )
{
for ( axis = 0; axis < QwtPlot::axisCnt; axis++ )
d_data->canvasMargin[axis] = margin;
}
else if ( axis >= 0 && axis < QwtPlot::axisCnt )
d_data->canvasMargin[axis] = ma... | false | false | false | false | false | 0 |
G_free_cell_stats(struct Cell_stats *s)
{
int i;
for (i = 1; i <= s->N; i++)
G_free(s->node[i].count);
G_free(s->node);
return 0;
} | false | false | false | false | false | 0 |
generic_prepare(struct odbc_obj *obj, void *data)
{
int res, i;
SQLHSTMT stmt;
SQLINTEGER nativeerror = 0, numfields = 0;
SQLSMALLINT diagbytes = 0;
unsigned char state[10], diagnostic[256];
res = SQLAllocHandle (SQL_HANDLE_STMT, obj->con, &stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
... | true | true | false | false | false | 1 |
spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
struct spi_transfer *transfer)
{
struct dma_async_tx_descriptor *desc_tx = NULL, *desc_rx = NULL;
int ret;
unsigned long timeout;
u32 dma;
int left;
struct spi_master *master = spi_imx->bitbang.master;
struct sg_table *tx = &transfer->tx_sg, *rx = &transfer-... | false | false | false | false | false | 0 |
method_name(opt, opt2)
ccp_options *opt, *opt2;
{
static char result[64];
if (!ANY_COMPRESS(*opt))
return "(none)";
switch (opt->method) {
case CI_DEFLATE:
case CI_DEFLATE_DRAFT:
if (opt2 != NULL && opt2->deflate_size != opt->deflate_size)
sprintf(result, "Deflate%s (%d/%d)",
(opt-... | false | false | false | false | false | 0 |
ircnet_flush_proxies(struct ircproxy **p) {
while (*p) {
struct ircproxy *t;
t = *p;
*p = (*p)->next;
_ircnet_freeproxy(t);
}
*p = 0;
} | false | false | false | false | false | 0 |
R3Intersects(const R3Plane& plane, const R3Box& box)
{
// Return whether sphere intersects plane
RNOctant octant = plane.Normal().Octant();
if (R3SignedDistance(plane, box.Corner(octant)) < 0) return RN_NULL_CLASS_ID;
if (R3SignedDistance(plane, box.Corner(~octant & 0x7)) > 0) return RN_NULL_CLASS_ID;
... | false | false | false | false | false | 0 |
swi_polcart_sp(double *l, double *x)
{
double sinlon, coslon, sinlat, coslat;
double xx[6], rxy, rxyz;
/* zero speed */
if (l[3] == 0 && l[4] == 0 && l[5] == 0) {
x[3] = x[4] = x[5] = 0;
swi_polcart(l, x);
return;
}
/* position */
coslon = cos(l[0]);
sinlon = sin(l[0]);
coslat = cos(l[1]);... | false | false | false | false | false | 0 |
print_ip(unsigned char *bp, int length)
{
struct ip *iph;
u_int ip_off, ip_hl, ip_len;
iph = (struct ip *)bp;
if (length < LIBNET_IP_H) {
printf("truncated-ip %d", length);
return;
}
ip_hl = iph->ip_hl * 4;
ip_len = ntohs(iph->ip_len);
if (length < ip_len) {
printf("truncated-ip - %d byte... | false | false | false | false | false | 0 |
uca_camera_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
UcaCameraPrivate *priv = UCA_CAMERA_GET_PRIVATE (object);
switch (property_id) {
case PROP_IS_RECORDING:
g_value_set_boolean (value, priv->is_recording);
break;
case PROP_IS_... | false | false | false | false | false | 0 |
timeout(int fd, short args, void *cbdata)
{
local_jobtracker_t *jtrk = (local_jobtracker_t*)cbdata;
orte_job_t *jdata;
orte_show_help("help-ras-slurm.txt", "slurm-dyn-alloc-timeout", true);
opal_output_verbose(2, orte_ras_base_framework.framework_output,
"%s Timed out on dynamic... | false | false | false | false | false | 0 |
settings_action(GKeyFile *config, SettingAction action)
{
guint i;
StashGroup *group;
foreach_ptr_array(group, i, keyfile_groups)
{
switch (action)
{
case SETTING_READ:
stash_group_load_from_key_file(group, config); break;
case SETTING_WRITE:
stash_group_save_to_key_file(group, config); break;
... | false | false | false | false | false | 0 |
bttv_set_dma(struct bttv *btv, int override)
{
unsigned long cmd;
int capctl;
btv->cap_ctl = 0;
if (NULL != btv->curr.top) btv->cap_ctl |= 0x02;
if (NULL != btv->curr.bottom) btv->cap_ctl |= 0x01;
if (NULL != btv->cvbi) btv->cap_ctl |= 0x0c;
capctl = 0;
capctl |= (btv->cap_ctl & 0x03) ? 0x03 ... | false | false | false | false | false | 0 |
Problem_5_test(){
Chapter18 chapter18;
string file[]={"a", "b","c","d","c","a","b","e","d"};
vector<string> strVector(file, file+9);
string str1[]={"a", "b", "c"};
string str2[]={"d","d", "d"};
int correctResult[] = {2, 2, 1};
for(size_t i=0; i!=3; ++i){
int result = chapter18.Problem_5(str... | false | false | false | false | false | 0 |
zx_EASY_ENC_elem(struct zx_ctx* c, struct zx_elem_s* x)
{
int len = zx_LEN_WO_any_elem(c, x);
char* buf = ZX_ALLOC(c, len+1);
char* p = zx_ENC_WO_any_elem(c, x, buf);
if (p != buf+len) {
ERR("Encoded length(%d) does not match computed length(%d). ED(%.*s)", p-buf, len, p-buf, buf);
len = p-buf;
}
bu... | false | false | false | false | false | 0 |
gkm_mock_C_CreateObject (CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate,
CK_ULONG ulCount, CK_OBJECT_HANDLE_PTR phObject)
{
GArray *attrs;
Session *session;
gboolean token, priv;
CK_OBJECT_CLASS klass;
CK_OBJECT_HANDLE object;
CK_ATTRIBUTE_PTR attr;
g_assert (phObject != NULL);
... | false | false | false | false | false | 0 |
icalvalue_geo_as_ical_string(icalvalue* value) {
struct icalgeotype data;
char* str;
icalerror_check_arg_rz( (value!=0),"value");
data = icalvalue_get_geo(value);
str = (char*)icalmemory_tmp_buffer(25);
sprintf(str,"%f;%f",data.lat,data.lon);
return str;
} | false | true | false | false | false | 1 |
Cvar_List_f (void)
{
cvar_t *var;
int i;
i = 0;
for (var = cvar_vars ; var ; var = var->next, i++)
{
if (var->flags & CVAR_ARCHIVE)
Com_Printf ("*");
else
Com_Printf (" ");
if (var->flags & CVAR_USERINFO)
Com_Printf ("U");
else
Com_Printf (" ");
if (var->flags & CVAR_SERVE... | false | false | false | false | false | 0 |
printLineChar(char c,gint n)
{
gint i;
for(i=0;i<n;i++)
printf("%c",c);
printf("\n");
} | false | false | false | false | false | 0 |
type_error (void)
{
extern int yylineno;
gf_log ("parser", GF_LOG_ERROR,
"Volume %s, before line %d: Please specify volume type",
curr->name, yylineno);
return;
} | false | false | false | false | false | 0 |
main(int argc, char** argv) {
Support::Timer t_total;
t_total.start();
FlatZinc::FlatZincOptions opt("Gecode/FlatZinc");
opt.parse(argc, argv);
if (argc!=2) {
cerr << "Usage: " << argv[0] << " [options] <file>" << endl;
cerr << " " << argv[0] << " -help for more information" << endl;
e... | false | false | false | false | false | 0 |
stream_close(STREAM *stream)
{
STRING_free(&stream->string.buffer);
return FALSE;
} | false | false | false | false | false | 0 |
ssh_scp_response(ssh_scp scp, char **response){
unsigned char code;
int r;
char msg[128];
if(scp==NULL)
return SSH_ERROR;
r=ssh_channel_read(scp->channel,&code,1,0);
if(r == SSH_ERROR)
return SSH_ERROR;
if(code == 0)
return 0;
if(code > 2){
ssh_set_error(scp->session,SSH_FATAL, "SCP: invalid status c... | true | true | false | false | false | 1 |
insertTab()
{
assert(bool(m_currentParagraph));
const KEYObjectPtr_t object(new TabObject());
m_currentParagraph->objects.push_back(object);
} | false | false | false | false | false | 0 |
kmx61_set_wake_up_odr(struct kmx61_data *data, int val, int val2)
{
int ret, odr_bits;
odr_bits = kmx61_convert_wake_up_odr_to_bit(val, val2);
if (odr_bits < 0)
return odr_bits;
ret = i2c_smbus_write_byte_data(data->client, KMX61_REG_CTRL2,
odr_bits);
if (ret < 0)
dev_err(&data->client->dev, "Error writ... | false | false | false | false | false | 0 |
bet_data_future_set_max_number ( gint number )
{
if ( number > future_number )
future_number = number;
} | false | false | false | false | false | 0 |
DtsGetPibFrom422(uint8_t *pibBuff, uint8_t mode422)
{
uint32_t i;
//First stripe has PIB data and second one has Extension PB. so total 256 bytes
if (mode422 == OUTPUT_MODE422_YUY2) {
for(i=0; i<256; i++) {
pibBuff[i] = pibBuff[i*2];
}
} else if (mode422 == OUTPUT_MODE422_UYVY) {
for(i=0; i<256; i++) {
... | false | false | false | false | false | 0 |
history_setunique(TYPE(History) *h, TYPE(HistEvent) *ev, int uni)
{
if (h->h_next != history_def_next) {
he_seterrev(ev, _HE_NOT_ALLOWED);
return -1;
}
history_def_setunique(h->h_ref, uni);
return 0;
} | false | false | false | false | false | 0 |
facet_knot_energy_fix_init(mode,mi)
int mode; /* energy or gradient */
struct method_instance *mi;
{
edge_id e_id;
REAL *x;
vertex_id v_id,vv_id;
int i;
REAL d[MAXCOORD]; /* difference vector between vertices */
REAL rr;
REAL power;
facetedge_id fe;
REAL area,s11,s12,s22,side1[MAXCOORD],side2[MAXCOOR... | false | false | false | false | false | 0 |
read_head_info(struct commit_list **tellme_more)
{
struct command **p = &commands;
for (;;) {
static char line[1000];
unsigned char old_sha1[20], new_sha1[20];
struct command *cmd;
char *refname;
int len, reflen;
len = packet_read_line(0, line, sizeof(line));
if (!len)
break;
if (line[len-1] == '\... | true | true | false | false | false | 1 |
utest_fit(ESL_RANDOMNESS *r, ESL_MIXDCHLET *d, int ntrials, int ncounts, double tol, int reps, int be_verbose)
{
char *msg ; // = "esl_dirichlet: fit unit test failed";
ESL_MIXDCHLET *id = NULL;
double **counts;
double *probs = malloc(sizeof(double) * d->K);
int qused;
... | false | false | false | false | false | 0 |
ref_stack_extend(ref_stack_t *pstack, uint request)
{
uint keep = (pstack->top - pstack->bot + 1) / 3;
uint count = pstack->p - pstack->bot + 1;
const ref_stack_params_t *params = pstack->params;
if (request > params->data_size)
return_error(params->overflow_error);
if (keep + request > pst... | false | false | false | false | false | 0 |
nss_load_all_libraries (const char *service, const char *def)
{
service_user *ni = NULL;
if (__nss_database_lookup (service, NULL, def, &ni) == 0)
while (ni != NULL)
{
nss_load_library (ni);
ni = ni->next;
}
} | false | false | false | false | false | 0 |
search_directory(char *absolute_dirname, bool recursive)
{
struct z_story_list *z_story_list = get_z_story_list();
struct babel_info *babel = load_babel_info();
#ifndef DISABLE_CONFIGFILES
ensure_dot_fizmo_dir_exists();
#endif // DISABLE_CONFIGFILES
if ((nof_files_found = count_files(absolute_dirname, recursi... | false | false | false | false | false | 0 |
clearResultsTable()
{
resultsTable->selectionModel()->clearSelection();
// zap the 3 main cols and two hidden ones
for (int i=0; i<resultsTable->rowCount(); i++) {
for (int j=0; j<resultsTable->columnCount(); j++)
delete resultsTable->takeItem(i,j);
}
} | false | false | false | false | false | 0 |
cifs_uncached_readdata_release(struct kref *refcount)
{
struct cifs_readdata *rdata = container_of(refcount,
struct cifs_readdata, refcount);
unsigned int i;
for (i = 0; i < rdata->nr_pages; i++) {
put_page(rdata->pages[i]);
rdata->pages[i] = NULL;
}
cifs_readdata_release(refcount);
} | false | false | false | false | false | 0 |
ra_debug_msg (unsigned int level, const char *format, ...)
{
va_list ap;
va_start (ap, format);
if ((debug_new_regalloc & level) != 0 && rtl_dump_file != NULL)
vfprintf (rtl_dump_file, format, ap);
va_end (ap);
} | false | false | false | false | true | 1 |
rd_options(u32b version)
{
int i, n;
byte b;
u16b tmp16u;
u32b flag[8];
u32b mask[8];
u32b window_flag[ANGBAND_TERM_MAX];
u32b window_mask[ANGBAND_TERM_MAX];
/*** Oops ***/
/* Ignore old options */
strip_bytes(16);
/*** Special info */
/* Read "delay_factor" */
rd_byte(&b);
op_ptr->delay_factor =... | false | false | false | false | false | 0 |
initialize_and_process_args(int argc, char *argv[])
{
/* initialize option defaults */
_opt_default();
/* initialize options with env vars */
_opt_env();
/* initialize options with argv */
_opt_args(argc, argv);
if (opt.verbose > 3)
_opt_list();
return 1;
} | false | false | false | false | false | 0 |
getNames(CollidingThing * collidingThing) {
QStringList names;
QList<ItemBase *> itemBases;
if (collidingThing->nonConnectorItem) {
itemBases << collidingThing->nonConnectorItem->attachedTo();
}
foreach (ItemBase * itemBase, itemBases) {
if (itemBase) {
itemBase = itemBas... | false | false | false | false | false | 0 |
renumber_subrs(const Vector<int> &renumbering)
{
Vector<Type1Subr *> old_subrs;
old_subrs.swap(_subrs);
for (int i = 0; i < old_subrs.size() && i < renumbering.size(); i++) {
int r = renumbering[i];
Type1Subr *s = old_subrs[i];
if (r >= 0 && s)
set_subr(r, s->t1cs(), s->definer());
else
delete... | false | false | false | false | false | 0 |
data(DataEvent *event)
{
lines(dataLine, event->data(), event->dataLength());
delete event;
} | false | false | false | false | false | 0 |
btn_button_get_color_bg(Button *btn, BtnFace face, GdkColor *bg)
{
if((btn != NULL) && (bg != NULL))
{
if(btn->color[face][0].valid)
{
*bg = btn->color[face][0].color;
return TRUE;
}
}
return FALSE;
} | false | false | false | false | false | 0 |
DB_Register(DB_DRIVER *driver)
{
if (_drivers_count >= MAX_DRIVER)
return;
_drivers[_drivers_count] = driver;
_drivers_count++;
} | false | false | false | false | false | 0 |
ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat)
{
struct sqlca_t *sqlca = ECPGget_sqlca();
char *sqlstate;
char *message;
if (sqlca == NULL)
{
ecpg_log("out of memory");
ECPGfree_auto_mem();
return;
}
if (result)
{
sqlstate = PQresultErrorField(result, PG_DIAG_SQLSTATE);... | false | false | false | false | false | 0 |
M2TS_FlushRequested(M2TSIn *m2ts)
{
u32 i, j, req_prog_count, count, prog_id, found;
gf_mx_p(m2ts->mx);
found = 0;
count = gf_list_count(m2ts->ts->requested_pids);
for (i=0; i<count; i++) {
M2TSIn_Prog *req_pid = gf_list_get(m2ts->ts->requested_pids, i);
GF_M2TS_ES *es = m2ts->ts->ess[req_pid->pid];
if (es... | false | false | false | false | false | 0 |
nicvf_read_bgx_stats(struct nicvf *nic, struct bgx_stats_msg *bgx)
{
if (bgx->rx)
nic->bgx_stats.rx_stats[bgx->idx] = bgx->stats;
else
nic->bgx_stats.tx_stats[bgx->idx] = bgx->stats;
} | false | false | false | false | false | 0 |
DoSummonPack(uint8 uiIndex)
{
for (uint8 i = 0; i < MAX_SUMMON_POSITIONS; ++i)
{
// This requires order of the array
if (asSummonInfo[i].uiPosition > uiIndex)
{
break;
}
if (asSummonInfo[i].uiPosition == uiIndex)
... | false | false | false | false | false | 0 |
setup_vertical_widgets_position(int step,
Sint16 start_x, Sint16 start_y, Uint16 w, Uint16 h,
struct widget *pBegin, struct widget *pEnd)
{
struct widget *pBuf = pEnd;
register int count = 0;
register int real_start_x = start_x;
int ret = 0;
while(pBuf)
{
pBuf->size.x = real_start_x;
pBuf->s... | false | false | false | false | false | 0 |
val_maindir(void)
{
int errs = 0;
struct stat sbuf;
if (stat(".", &sbuf) < 0) {
fprintf(stderr, "Cannot \"stat\" main directory %s - aborting\n", spdir);
exit(E_SETUP);
}
if (sbuf.st_uid != Daemuid) {
errs++;
fprintf(stderr, "Spool directory %s is owned by %s not %s\n", spdir, prin_uname(sbuf.st_uid)... | false | false | false | false | true | 1 |
get_prompt(lua_State *L, bool firstline) {
const char *p;
lua_getfield(L, LUA_GLOBALSINDEX, firstline ? "_PROMPT" : "_PROMPT2");
p = lua_tostring(L, -1);
if (p == NULL) p = (firstline ? "> " : ">> ");
lua_pop(L, 1); /* remove global */
return p;
} | false | false | false | false | false | 0 |
paintNormalButton(QPainter *painter, const QStyleOptionGraphicsItem *option)
{
QRectF rect = option->exposedRect;
const qreal rad = (rect.width() / 2 ) + 1;
QRadialGradient gr(rad, rad, rad, 3 * rad / 5, 3 * rad / 5);
gr.setColorAt(0.0, QColor(255, 255, 255, 191));
gr.setColorAt(0.2, QColor(255, 25... | false | false | false | false | false | 0 |
sock_write(const int sock, const char * buffer, int nbytes)
{
while (nbytes > 0) {
int rbytes = write(sock, buffer, nbytes);
if (rbytes < 0)
return 0;
buffer += rbytes;
nbytes -= rbytes;
}
return 1;
} | false | false | false | false | false | 0 |
parts_to_text (TpMessage *msg,
TpChannelTextMessageFlags *out_flags,
TpChannelTextMessageType *out_type,
TpHandle *out_sender,
guint *out_timestamp)
{
GHashTable *header = g_ptr_array_index (msg->parts, 0);
if (out_type != NULL)
{
/* The fallbac... | false | false | false | false | false | 0 |
gtk_bgbox_configure_event (GtkWidget *widget, GdkEventConfigure *e)
{
ENTER;
DBG("geom: size (%d, %d). pos (%d, %d)\n", e->width, e->height, e->x, e->y);
RET(FALSE);
} | false | false | false | false | false | 0 |
dump_file(FILE *fp, const char *filename)
{
int fd = open(filename, O_RDONLY);
if (fd >= 0) {
fputs(G.jiffy_line, fp);
fflush(fp);
bb_copyfd_eof(fd, fileno(fp));
close(fd);
fputc('\n', fp);
}
} | false | false | false | false | true | 1 |
vmw_context_cotables_unref(struct vmw_user_context *uctx)
{
struct vmw_resource *res;
int i;
for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
spin_lock(&uctx->cotable_lock);
res = uctx->cotables[i];
uctx->cotables[i] = NULL;
spin_unlock(&uctx->cotable_lock);
if (res)
vmw_resource_unreference(&res);
}
} | false | false | false | false | false | 0 |
collIter_bos(collIterate *source) {
// if we're going backwards, we need to know whether there is more in the
// iterator, even if we are in the side buffer
if(source->flags & UCOL_USE_ITERATOR || source->origFlags & UCOL_USE_ITERATOR) {
return !source->iterator->hasPrevious(source->iterator);
}
if (sourc... | false | false | false | false | false | 0 |
ca0106_set_capture_mic_line_in(struct snd_ca0106 *emu)
{
u32 tmp;
if (emu->capture_mic_line_in) {
/* snd_ca0106_i2c_write(emu, ADC_MUX, 0); */ /* Mute input */
tmp = inl(emu->port+GPIO) & ~0x400;
tmp = tmp | 0x400;
outl(tmp, emu->port+GPIO);
/* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); */
} else {
... | false | false | false | false | false | 0 |
repeat_score_seq(register char *seq, register int **R,
register long o, register long n)
/********************************************************************
/ptr=seq1+s
seq1: MQNKSQKETGDILGISQMHVSRL
seq2: MPPLFVMNNEILMHLRALKKTKKDVS
|...... n .......|
**************************************... | false | false | false | false | false | 0 |
php_cli_server_chunk_immortal_new(const char *buf, size_t len) /* {{{ */
{
php_cli_server_chunk *chunk = pemalloc(sizeof(php_cli_server_chunk), 1);
if (!chunk) {
return NULL;
}
chunk->type = PHP_CLI_SERVER_CHUNK_IMMORTAL;
chunk->next = NULL;
chunk->data.immortal.p = buf;
chunk->data.immortal.len = len;
retur... | false | false | false | false | false | 0 |
get_copy_ctor (tree type, tsubst_flags_t complain)
{
int quals = (TYPE_HAS_CONST_COPY_CTOR (type)
? TYPE_QUAL_CONST : TYPE_UNQUALIFIED);
tree argtype = build_stub_type (type, quals, false);
tree fn = locate_fn_flags (type, complete_ctor_identifier, argtype,
LOOKUP_NORMAL, complain);
if (fn == er... | false | false | false | false | false | 0 |
catch_setobs_errors (const char *stobs, int pd, int min, int structure)
{
int panel = structure == STACKED_TIME_SERIES ||
structure == STACKED_CROSS_SECTION;
int err = 0;
if (pd == 1) {
if (min > 0) {
gretl_errmsg_set(_("no ':' allowed in starting obs with "
"frequency 1"));
err = 1;... | false | false | false | false | false | 0 |
evaluate_spline (spline_type s, at_real t)
{
spline_type V[4]; /* We need degree+1 splines, but assert degree <= 3. */
signed i, j;
at_real one_minus_t = (at_real) 1.0 - t;
polynomial_degree degree = SPLINE_DEGREE (s);
for (i = 0; i <= degree; i++)
{
V[0].v[i].x = s.v[i].x;
V[0].v[i].y = ... | false | false | false | false | false | 0 |
de_recycle_aino (Unit *unit, a_inode *aino)
{
aino_test (aino);
if (aino->next == 0 || aino == &unit->rootnode)
return;
aino->next->prev = aino->prev;
aino->prev->next = aino->next;
aino->next = aino->prev = 0;
unit->aino_cache_size--;
} | false | false | false | false | false | 0 |
SetGridCursorCell( const wxSheetCoords& coords )
{
// Note: can set to invalid coords < 0 to hide cursor, but not out of range
wxCHECK_RET((coords.GetRow() < GetNumberRows()) &&
(coords.GetCol() < GetNumberCols()),
wxT("Invalid coords in wxSheet::SetGridCursorCell"));
... | false | false | false | false | false | 0 |
red_error_middle(short* tl, short* id, int y, int w) {
long error=0;
id += y*w/4;
tl += y*w;
// middle pixels
for (int x=1; x<w-1; x+=2) {
int residule = (36*tl[x]+
6*tl[-w+x] +6*tl[w+x]+
6*tl[x-1] +6*tl[x+1]+
tl[-w+x-1] +tl[-w+x+1]+
tl[w+x-1] +tl[w+x+1])/64 - id[x/2];
error ... | false | false | false | false | false | 0 |
nlmsvc_traverse_shares(struct nlm_host *host, struct nlm_file *file,
nlm_host_match_fn_t match)
{
struct nlm_share *share, **shpp;
shpp = &file->f_shares;
while ((share = *shpp) != NULL) {
if (match(share->s_host, host)) {
*shpp = share->s_next;
kfree(share);
continue;
}
shpp = &share->s_next;
}
... | false | false | false | false | false | 0 |
scan_bits (NODE_T * p, A68_REF ref_file)
{
A68_FILE *f = FILE_DEREF (&ref_file);
int ch, flip = FLIP_CHAR, flop = FLOP_CHAR;
reset_transput_buffer (INPUT_BUFFER);
ch = char_scanner (f);
while (ch != EOF_CHAR && (IS_SPACE (ch) || IS_NL_FF (ch))) {
if (IS_NL_FF (ch)) {
skip_nl_ff (p, &ch, ref_file);
... | false | false | false | false | false | 0 |
gauss_elimination(double **A, double *b, int rows)
{
int i, j, k;
double tmpval = 0.0;
for (k = 0; k < rows - 1; k++) {
#pragma omp parallel for schedule (static) private(i, j, tmpval) shared(k, A, b, rows)
for (i = k + 1; i < rows; i++) {
tmpval = A[i][k] / A[k][k];
b[i] = b[i] - tmpval * b[k];... | false | false | false | false | false | 0 |
fac_compact(fac_t f) {
long int i, j;
for (i = 0, j = 0; i < f[0].num_facs; i++) {
if (f[0].pow[i] > 0) {
if (j < i) {
f[0].fac[j] = f[0].fac[i];
f[0].pow[j] = f[0].pow[i];
}
j++;
}
}
f[0].num_facs = j;
} | false | false | false | false | false | 0 |
text2blli(const char **text,struct atm_blli *blli)
{
switch (fetch(text,"l2=","l3=",NULL)) {
case 0:
if (text2l2_proto(text,blli) < 0) return -1;
break;
case 1:
return text2l3_proto(text,blli);
default:
return -1;
}
if (!**text) return 0;
if (fetch(text,",l3=",NULL) < 0) return 0;... | false | false | false | false | false | 0 |
clear_datum(H5F_t * f,
void * thing,
hbool_t dest)
{
int idx;
struct datum * entry_ptr;
HDassert( thing );
entry_ptr = (struct datum *)thing;
idx = addr_to_datum_index(entry_ptr->base_addr);
HDassert( idx >= 0 );
HDassert( idx < NUM_DATA_ENTRIES );
HDassert( ... | false | false | false | false | false | 0 |
cypress_close(struct usb_serial_port *port)
{
struct cypress_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
kfifo_reset_out(&priv->write_fifo);
spin_unlock_irqrestore(&priv->lock, flags);
dev_dbg(&port->dev, "%s - stopping urbs\n", __func__);
usb_kil... | false | false | false | false | false | 0 |
cb_status__normal(
const char *path, unsigned int status_flags, void *payload)
{
status_entry_counts *counts = payload;
if (counts->debug)
cb_status__print(path, status_flags, NULL);
if (counts->entry_count >= counts->expected_entry_count) {
counts->wrong_status_flags_count++;
goto exit;
}
if (strcmp(pat... | false | false | false | false | false | 0 |
jspeStatementFunctionDecl() {
JsVar *funcName = 0;
JsVar *funcVar;
JSP_ASSERT_MATCH(LEX_R_FUNCTION);
bool actuallyCreateFunction = JSP_SHOULD_EXECUTE || ((execInfo.execute&EXEC_PARSE_FUNCTION_DECL)!=0);
if (actuallyCreateFunction) {
funcName = jsvMakeIntoVariableName(jslGetTokenValueAsVar(execInfo.lex), ... | false | false | false | false | false | 0 |
apply_to_page_range(struct mm_struct *mm, unsigned long addr,
unsigned long size, pte_fn_t fn, void *data)
{
pgd_t *pgd;
unsigned long next;
unsigned long end = addr + size;
int err;
BUG_ON(addr >= end);
pgd = pgd_offset(mm, addr);
do {
next = pgd_addr_end(addr, end);
err = apply_to_pud_range(mm, pgd, ad... | false | false | false | false | false | 0 |
_load_file(const char *file)
{
FILE *f;
size_t size;
int alloc = 0, len = 0;
char *text = NULL, buf[16384 + 1];
f = fopen(file, "rb");
if (!f) return NULL;
while ((size = fread(buf, 1, sizeof(buf) - 1, f)))
{
char *tmp_text;
buf[size] = 0;
tmp_text = _buf_append(text, ... | false | false | false | false | false | 0 |
newPoolToken(pANTLR3_TOKEN_FACTORY factory)
{
pANTLR3_COMMON_TOKEN token;
/* See if we need a new token pool before allocating a new
* one
*/
if (factory->nextToken >= ANTLR3_FACTORY_POOL_SIZE)
{
/* We ran out of tokens in the current pool, so we need a new pool
*/
ne... | false | false | false | false | false | 0 |
modify_target_string(AW_window *aww, AW_CL cl_mod_mode) {
ModMode mod_mode = ModMode(cl_mod_mode);
AW_root *root = aww->get_root();
char *target_string = root->awar(AWAR_TARGET_STRING)->read_string();
GB_ERROR error = 0;
if (mod_mode == TS_MOD_CLEAR) target_string[0] =... | false | false | false | false | false | 0 |
xenbus_map_ring(struct xenbus_device *dev, grant_ref_t *gnt_refs,
unsigned int nr_grefs, grant_handle_t *handles,
unsigned long *vaddrs, bool *leaked)
{
phys_addr_t phys_addrs[XENBUS_MAX_RING_GRANTS];
int i;
if (nr_grefs > XENBUS_MAX_RING_GRANTS)
return -EINVAL;
for (i = 0; i < nr_grefs; i++)
phys... | false | false | false | false | false | 0 |
lostpeer(int sig)
{
if (connected) {
if (cout != NULL) {
shutdown(fileno(cout), SHUT_RDWR);
fclose(cout);
cout = NULL;
}
if (data >= 0) {
shutdown(data, SHUT_RDWR);
close(data);
data = -1;
}
connected = 0;
}
pswitch(1);
if (connected) {
if (cout != NULL) {
shutd... | false | false | false | false | false | 0 |
textUnderCursor() const
{
QTextCursor cursor = textCursor();
int curpos = cursor.position();
QString text = cursor.block().text().left(curpos);
QStringList wordList = text.split(QRegExp("[^\\w\\.]"));
if (wordList.isEmpty())
return QString();
return wordList.last();
} | false | false | false | false | false | 0 |
VasyDriveSynopsysConvertDeclType( Base )
int Base;
{
int Type;
Type = VasyConvertDeclType[ Base ];
if ( VasyFlagStdLogic )
{
if ( Type == VEX_TYPE_BIT ) Type = VEX_TYPE_STD_LOGIC;
else
if ( Type == VEX_TYPE_BIT_VECTOR ) Type = VEX_TYPE_STD_LOGIC_VECTOR;
}
return( Type );
} | false | false | false | false | false | 0 |
action_nemo_manual_callback (GtkAction *action,
gpointer user_data)
{
NemoWindow *window;
GError *error;
GtkWidget *dialog;
const char* helpuri;
const char* name = gtk_action_get_name (action);
error = NULL;
window = NEMO_WINDOW (user_data);
if (g_str_equal (name, "NemoHelpSearch")) {
helpuri = "help:... | false | false | false | false | false | 0 |
insertText( const QString& gmnCode , int insertIndex )
{
if ( !mLanguageTextEdit->isEnabled() )
return;
QTextCursor cursor = mLanguageTextEdit->textCursor();
QString selectedText = cursor.selectedText();
QString leftPart , rightPart;
if ( insertIndex >= 0 )
{
leftPart = gmnCode.left( insertIndex );
righ... | false | false | false | false | false | 0 |
ho_bitmap_clone (const ho_bitmap * m)
{
ho_bitmap *m_out;
/*
* allocate memory
*/
m_out = ho_bitmap_new (m->width, m->height);
if (!m_out)
return NULL;
m_out->x = m->x;
m_out->y = m->y;
m_out->type = m->type;
m_out->font_height = m->font_height;
m_out->font_width = m->font_width;
m_out... | false | true | false | false | false | 1 |
SmiSubConstant(Register dst, Register src, Smi* constant) {
if (constant->value() == 0) {
if (!dst.is(src)) {
movq(dst, src);
}
} else if (dst.is(src)) {
ASSERT(!dst.is(kScratchRegister));
Register constant_reg = GetSmiConstant(constant);
subq(dst, constant_reg);
} else {
if (constan... | false | false | false | false | false | 0 |
list_9p_stub (XDR *xdr_in)
{
char **r;
if (optargs_bitmask != 0) {
reply_with_error ("header optargs_bitmask field must be passed as 0 for calls that don't take optional arguments");
goto done_no_free;
}
r = do_list_9p ();
if (r == NULL)
/* do_list_9p has already called reply_with_error */
g... | false | false | false | false | false | 0 |
Nset_background_cmd(Nv_data * data, Tcl_Interp * interp, /* Current interpreter. */
int argc, /* Number of arguments. */
char **argv /* Argument strings. */
)
{
char buf[128];
if (argc == 2)
if (0 > (data->BGcolor = tcl_color_to_int(argv[1]))) {
sprintf(buf, "Unable to convert %s to color\n", a... | false | false | false | false | false | 0 |
clientdbDump(StoreEntry * sentry)
{
ClientInfo *c;
log_type l;
int icp_total = 0;
int icp_hits = 0;
int http_total = 0;
int http_hits = 0;
storeAppendPrintf(sentry, "Cache Clients:\n");
hash_first(client_table);
while ((c = (ClientInfo *) hash_next(client_table))) {
storeAppendPrint... | false | false | false | false | false | 0 |
_dmalloc_chunk_count_changed(const unsigned long mark,
const int count_not_freed_b,
const int count_freed_b)
{
skip_alloc_t *slot_p;
int freed_b, used_b;
int checking_list_c = 0;
unsigned int mem_count = 0;
/* run through the blocks */
for (slot_p = skip_address_list->sa_next_p[0];
... | false | false | false | false | false | 0 |
matrix_check1ray(pk_internal_t* pk, matrix_t* mat)
{
size_t i;
bool res;
res = true;
for (i = 0; i<mat->nbrows; i++){
if (numint_sgn(mat->p[i][pk->dec-1])<0){
res = false;
break;
}
}
return res;
} | false | false | false | false | false | 0 |
paintEvent(QPaintEvent *)
{
QString filename = mUpButtonName;
if (mDown)
filename = mDownButtonName;
QPixmap newPix(filename);
QPainter painter(this);
painter.drawPixmap(0, 0, newPix);
resize(33,25);
} | false | false | false | false | false | 0 |
wt_status_print_untracked(struct wt_status *s)
{
struct dir_struct dir;
int i;
int shown_header = 0;
struct strbuf buf = STRBUF_INIT;
memset(&dir, 0, sizeof(dir));
if (!s->untracked) {
dir.show_other_directories = 1;
dir.hide_empty_directories = 1;
}
setup_standard_excludes(&dir);
read_directory(&dir, "... | false | false | false | false | false | 0 |
getCovarianceAndMean(CMatrixDouble33 &estCov, CPose2D &estMean2D) const
{
size_t N = m_modes.size();
this->getMean(estMean2D);
estCov.zeros();
if (N)
{
// 1) Get the mean:
double sumW = 0;
CMatrixDouble31 estMeanMat = CMatrixDouble31(estMean2D);
CMatrixDouble33 temp;
CMatrixDouble31 estMean_i;
for ... | false | false | false | false | false | 0 |
gvnc_tls_mutex_init (void **priv)
{ \
GMutex *lock = NULL;
lock = g_mutex_new();
*priv = lock;
return 0;
} | false | false | false | false | false | 0 |
uevent_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct kobject *top_kobj;
struct kset *kset;
struct kobj_uevent_env *env = NULL;
int i;
size_t count = 0;
int retval;
/* search the kset, the device belongs to */
top_kobj = &dev->kobj;
while (!top_kobj->kset && top_kobj->parent... | false | true | false | false | false | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.