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 |
|---|---|---|---|---|---|---|
nOffspring(unsigned int value){
if(value != 1 && value != 2){
GAErr(GA_LOC, className(), "numCrossStrategy", gaErrBadCS);
noffspr = 1;
}
else{
noffspr = value;
}
params.set(gaNnOffspring, value);
return noffspr;
} | false | false | false | false | false | 0 |
vfs_list(Vfs_handle *handle,
int (*is_valid)(char *),
int (*compar)(const void *, const void *),
int (*add)(char *, char *, void ***), void ***names)
{
int n;
handle->error_msg = NULL;
handle->error_num = 0;
log_msg((LOG_TRACE_LEVEL, "vfs_list(%s,%s)",
handle->sd->store_name, CTX(handle)));... | false | false | false | false | false | 0 |
enum_fmt(struct v4l2_fmtdesc *f, u32 type)
{
int i, num;
struct vim2m_fmt *fmt;
num = 0;
for (i = 0; i < NUM_FORMATS; ++i) {
if (formats[i].types & type) {
/* index-th format of type type found ? */
if (num == f->index)
break;
/* Correct type but haven't reached our index yet,
* just increment ... | false | false | false | false | false | 0 |
tweak_stack_size(struct cli *cli, const struct parspec *par,
const char *arg)
{
unsigned low, u;
char buf[12];
low = sysconf(_SC_THREAD_STACK_MIN);
if (arg != NULL && !strcmp(arg, "32bit")) {
u = 65536;
if (u < low)
u = low;
sprintf(buf, "%u", u);
arg = buf;
}
tweak_generic_uint(cli, &master.wth... | false | false | false | false | false | 0 |
ffdsum(char *ascii, /* I - 16-char ASCII encoded checksum */
int complm, /* I - =1 to decode complement of the */
unsigned long *sum) /* O - 32-bit checksum */
/*
decode the 16-char ASCII encoded checksum into an unsigned 32-bit long.
If complm=TRUE, t... | false | false | false | false | false | 0 |
log_err_status(UErrorCode status, const char* pattern, ...)
{
va_list ap;
va_start(ap, pattern);
if ((status == U_FILE_ACCESS_ERROR || status == U_MISSING_RESOURCE_ERROR)) {
++DATA_ERROR_COUNT; /* for informational message at the end */
if (WARN_ON_MISSING_DATA == 0) {
... | false | false | false | false | false | 0 |
cave_find_in_range(struct cave *c, int *y, int y1, int y2,
int *x, int x1, int x2, cave_predicate pred) {
int yd = y2 - y1;
int xd = x2 - x1;
int i, n = yd * xd;
int *squares;
/* Allocate the squares, and randomize their order */
squares = C_ZNEW(n, int);
for (i = 0; i < n; i++) squares[i] = i;
/* D... | false | false | false | false | false | 0 |
print_sbytes(FILE *inptr,unsigned long count,unsigned long offset)
{
int i,j;
short byte;
int chpr = 0;
if(count)
{
byte = read_ubyte(inptr,offset);
if(feof(inptr) || ferror(inptr))
{
clearerr(inptr);
setcharsprinted(chpr);
return;
... | false | false | false | false | false | 0 |
sendToAllClientsPlain(const char *str)
{
std::list<ArSocket *>::iterator it;
if (myLoggingDataSent)
ArLog::log(ArLog::Terse, "ArNetServer::sendToAllClients: Sending %s", str);
for (it = myConns.begin(); it != myConns.end(); ++it)
{
(*it)->setLogWriteStrings(false);
(*it)->writeString(str);
(*it... | false | false | false | false | false | 0 |
calcWidth(bool) {
// Check that above threshold.
if (ps == 0.) return;
// Couplings to q qbar and l+ l-.
double vf = 0.;
double af = 0.;
double symMaj = 1.;
if (id1Abs < 9 && id1Abs%2 == 1) {
af = -1. + 2. * sin2tW;
vf = -1. + 4. * sin2tW / 3.;
} else if (id1Abs < 9) {
af ... | false | false | false | false | false | 0 |
pkix_pl_LdapDefaultClient_DecodeBindResponse(
PLArenaPool *arena,
SECItem *src,
LDAPMessage *pBindResponse,
SECStatus *pStatus,
void *plContext)
{
SECStatus rv = SECFailure;
LDAPMessage response;
PKIX_ENTER
(LDAPDEFAULTCLIENT,
... | false | false | false | false | false | 0 |
split_headers(Octstr *headers, List **split, List **expected)
{
long start;
long pos;
*split = gwlist_create();
*expected = gwlist_create();
start = 0;
for (pos = 0; pos < octstr_len(headers); pos++) {
if (octstr_get_char(headers, pos) == '\n') {
int c;
Octstr *l... | false | false | false | false | false | 0 |
snd_intel8x0m_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct intel8x0m *chip = snd_pcm_substream_chip(substream);
struct ichdev *ichdev = get_ichdev(substream);
unsigned char val = 0;
unsigned long port = ichdev->reg_offset;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER... | false | false | false | false | false | 0 |
client_releasedir (xlator_t *this, fd_t *fd)
{
int ret = -1;
clnt_conf_t *conf = NULL;
rpc_clnt_procedure_t *proc = NULL;
clnt_args_t args = {0,};
conf = this->private;
if (!conf || !conf->fops)
goto out;
args.fd = fd;
proc = ... | false | false | false | false | false | 0 |
handshake(u32 __iomem *ptr, u32 mask, u32 done, int usec)
{
u32 result;
do {
result = readl(ptr);
if (result == ~(u32)0) /* "device unplugged" */
return -ENODEV;
result &= mask;
if (result == done)
return 0;
udelay(1);
usec--;
} while (usec > 0);
return -ETIMEDOUT;
} | false | false | false | false | false | 0 |
gli_piclist_search(unsigned long id)
{
piclist_t *picptr;
picture_t *pic;
picptr = picstore;
while (picptr != NULL)
{
pic = picptr->picture;
if (pic && pic->id == id)
return picptr;
picptr = picptr->next;
}
return NULL;
} | false | false | false | false | false | 0 |
report_symmetry_elements_brief( void )
{
int i ;
char * symmetry_code = (char*)calloc( 1, 10*(PlanesCount+NormalAxesCount+ImproperAxesCount+InversionCentersCount+2) ) ;
char buf[ 100 ] ;
if( symmetry_code == NULL ){
fprintf( stderr, "Unable to allocate memory for symmetry... | false | false | false | false | false | 0 |
mono_decimal2UInt64(/*[In]*/decimal_repr* pA, guint64* pResult)
{
guint64 alo, ahi;
int scale;
MONO_ARCH_SAVE_REGS;
DECTO128(pA, alo, ahi);
scale = pA->signscale.scale;
if (scale > 0) {
div128DecadeFactor(&alo, &ahi, scale);
}
/* overflow if integer too large or < 0 */
if ... | false | false | false | false | false | 0 |
unescaped_size(S s,I n){I k=0;DO(n,k++;if('\\'==s[i])i+=max(1,odigitlen3(s+i+1)))R k;} | false | false | false | false | false | 0 |
semantic(Scope *sc)
{
//printf("TryFinallyStatement::semantic()\n");
body = body->semantic(sc);
sc = sc->push();
sc->tf = this;
sc->sbreak = NULL;
sc->scontinue = NULL; // no break or continue out of finally block
finalbody = finalbody->semanticNoScope(sc);
sc->pop();
if (!body... | false | false | false | false | false | 0 |
ComputeFirstNonZeroOpacityIndices()
{
// Find the first non-zero scalar opacity and gradient opacity points on
// the respective transfer functions
const int nComponents = this->GetNumberOfIndependentComponents();
// Initialize these arrays.
if (this->MinNonZeroScalarIndex)
{
delete [] this->MinNonZ... | false | false | false | false | false | 0 |
alarm_timer_del(struct k_itimer *timr)
{
if (!rtcdev)
return -ENOTSUPP;
if (alarm_try_to_cancel(&timr->it.alarm.alarmtimer) < 0)
return TIMER_RETRY;
return 0;
} | false | false | false | false | false | 0 |
updateSizes(HoleSettings & holeSettings) {
if (holeSettings.sizesComboBox == NULL) return;
int newIndex = -1;
QPointF current(TextUtils::convertToInches(holeSettings.holeDiameter), TextUtils::convertToInches(holeSettings.ringThickness));
for (int ix = 0; ix < holeSettings.sizesComboBox->count(); ix++) {
QStrin... | false | false | false | false | false | 0 |
LexTokenIntel() {
const AsmToken &lexedToken = lexDefinite();
switch(lexedToken.getKind()) {
default:
return lexedToken;
case AsmToken::Error:
SetError(Lexer->getErrLoc(), Lexer->getErr());
return lexedToken;
case AsmToken::Identifier: {
std::string upperCase = lexedToken.getString().str();... | false | false | false | false | false | 0 |
glfs_symlink (struct glfs *fs, const char *data, const char *path)
{
int ret = -1;
xlator_t *subvol = NULL;
loc_t loc = {0, };
struct iatt iatt = {0, };
uuid_t gfid;
dict_t *xattr_req = NULL;
int reval = 0;
__glfs_entry_fs (fs);
subvol = glf... | false | false | false | false | false | 0 |
coro_rss (pTHX_ struct coro *coro)
{
size_t rss = sizeof (*coro);
if (coro->mainstack)
{
if (coro->flags & CF_RUNNING)
{
#define SYM(sym) PL_ ## sym
CORO_RSS;
#undef SYM
}
else
{
#define SYM(sym) coro->slot->sym
CORO_RSS;
... | false | false | false | false | false | 0 |
count_size_and_length(const char *str, int *psize, int *plen)
{
char c;
const char *p = str;
int size = 0, len = 0;
while ((c = *p++) != 0) {
int i = SCM_CHAR_NFOLLOWS(c);
len++;
size++;
while (i-- > 0) {
if (!*p++) { len = -1; goto eos; }
size++;
... | false | false | false | false | false | 0 |
spell_check_sps()
{
char_u *p;
char_u *s;
char_u buf[MAXPATHL];
int f;
sps_flags = 0;
sps_limit = 9999;
for (p = p_sps; *p != NUL; )
{
copy_option_part(&p, buf, MAXPATHL, ",");
f = 0;
if (VIM_ISDIGIT(*buf))
{
s = buf;
sps_limit = getdigits(&s);
if (*s != NUL && !VI... | false | true | true | false | false | 1 |
gsb_form_scheduler_button_press_event ( GtkWidget *entry,
GdkEventButton *ev,
gint *ptr_origin )
{
gint element_number;
GtkWidget *date_entry;
element_number = GPOINTER_TO_INT (ptr_origin);
/* set the form sensitive */
gsb_form_change_sensitive_butto... | false | false | false | false | false | 0 |
igb_power_up_phy(struct e1000_hw *hw)
{
if (hw->phy.ops.power_up)
hw->phy.ops.power_up(hw);
igb_setup_link(hw);
} | false | false | false | false | false | 0 |
search_component(graph_t * g, node_t * n)
{
int c, i;
elist vec[4];
node_t *other;
edge_t *e;
add_to_component(n);
vec[0] = ND_out(n);
vec[1] = ND_in(n);
vec[2] = ND_flat_out(n);
vec[3] = ND_flat_in(n);
for (c = 0; c <= 3; c++) {
if (vec[c].list)
for (i = 0; (e = vec[c].l... | false | false | false | false | false | 0 |
vci_bitfield_iterate(struct lanai_dev *lanai,
const unsigned long *lp,
void (*func)(struct lanai_dev *,vci_t vci))
{
vci_t vci;
for_each_set_bit(vci, lp, NUM_VCI)
func(lanai, vci);
} | false | false | false | false | false | 0 |
nm_bluez_device_new (const char *path, NMConnectionProvider *provider)
{
NMBluezDevice *self;
NMBluezDevicePrivate *priv;
#if WITH_BLUEZ4
NMDBusManager *dbus_mgr;
DBusGConnection *connection;
#endif
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (provider != NULL, NULL);
self = (NMBluezDevice ... | false | false | false | false | false | 0 |
esum(int mu, double x)
{
/* ----------------------------------------------------------------------- */
/* EVALUATION OF EXP(MU + X) */
/* ----------------------------------------------------------------------- */
double w;
if (x > 0.0) {
goto L10;
}
if (mu < 0) {
goto L20;
}
... | false | false | false | false | false | 0 |
makePngPreview(const char * pszInFile, const char * pszPNGFile, UT_sint32 iWidth, UT_sint32 iHeight)
{
cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, iWidth, iHeight);
cairo_t *cr = cairo_create (surface);
GR_UnixCairoAllocInfo ai(NULL, false);
GR_CairoGraphics * pG = static_cast<GR_Ca... | false | false | false | false | false | 0 |
add_property_string_ex(zval *arg, const char *key, uint key_len, const char *str, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
MAKE_STD_ZVAL(z_key);
ZVAL_STRINGL(z_key, key, key_len-1, 1);
Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tm... | false | false | false | false | false | 0 |
visit(alu_node& n, bool enter) {
if (enter) {
rename_src(&n);
} else {
node *psi = NULL;
if (n.pred && n.dst[0]) {
value *d = n.dst[0];
unsigned index = get_index(rename_stack.top(), d);
value *p = sh.get_value_version(d, index);
psi = sh.create_node(NT_OP, NST_PSI);
container_node *parent;
... | false | false | false | false | false | 0 |
_handle_name_unpublish(int fd, Buf buf)
{
int rc;
uint32_t tmp32;
char *name = NULL;
Buf resp_buf = NULL;
debug3("mpi/pmi2: in _handle_name_unpublish");
safe_unpackstr_xmalloc(&name, &tmp32, buf);
if (tree_info.srun_addr)
rc = name_unpublish_up(name);
else
rc = name_unpublish_local(name);
out:
xfree(nam... | false | false | false | false | false | 0 |
AddLink(Loop *loops, BVertex *p0, BVertex **spares, int *nvert,
BVertex **first, BVertex **end)
{
BVertex *sp;
BVertex *p, *q;
BVertex *np, *nq;
Loop *lp;
int i, maxi;
int j, maxj;
int k;
sp = *spares;
for (j = 0, maxj = *nvert, p = p0; j < maxj; j++, p = p->next)
... | false | false | false | false | false | 0 |
get_vp_dst_reg(const prog_dst_register &dst)
{
dst_reg result;
assert(!dst.RelAddr);
switch (dst.File) {
case PROGRAM_TEMPORARY:
result = dst_reg(vp_temp_regs[dst.Index]);
break;
case PROGRAM_OUTPUT:
result = output_reg[dst.Index];
break;
case PROGRAM_ADDRESS: {
asser... | false | false | false | false | false | 0 |
gd_madd_spec(DIRFILE* D, const char* line, const char* parent) gd_nothrow
{
char *outstring = NULL;
char *in_cols[MAX_IN_COLS];
const char *tok_pos = NULL;
int n_cols;
int me;
gd_entry_t* E = NULL;
dtrace("%p, \"%s\", \"%s\"", D, line, parent);
if (D->flags & GD_INVALID) {/* don't crash */
_GD_Set... | false | false | false | false | false | 0 |
condition(const Service *srv)
{
if ( TCPService::isA(srv) || UDPService::isA(srv))
{
int srs = TCPUDPService::constcast(srv)->getSrcRangeStart();
int sre = TCPUDPService::constcast(srv)->getSrcRangeEnd();
compiler->normalizePortRange(srs,sre);
return (srs!=0 || sre!=0);
}
... | false | false | false | false | false | 0 |
ql_mpi_reset_work(struct work_struct *work)
{
struct ql_adapter *qdev =
container_of(work, struct ql_adapter, mpi_reset_work.work);
cancel_delayed_work_sync(&qdev->mpi_work);
cancel_delayed_work_sync(&qdev->mpi_port_cfg_work);
cancel_delayed_work_sync(&qdev->mpi_idc_work);
/* If we're not the dominant NIC fun... | false | false | false | false | false | 0 |
clipWorld() {
int left = lroundf(pos.getX()) - (spriteRacerBase->w / (2*RACER_IMAGE_CNT));
int top = lroundf(pos.getY()) - (spriteRacerBase->h / 2);
int right = lroundf(pos.getX()) + (spriteRacerBase->w / (2*RACER_IMAGE_CNT));
int bottom = lroundf(pos.getY()) + (spriteRacerBase->h / 2);
if ( left <= 1 ) {
... | false | false | false | false | false | 0 |
_e_fm2_file_rename(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
E_Fm2_Icon *ic;
char text[PATH_MAX + 256];
ic = data;
if ((ic->entry_dialog) || (ic->entry_widget)) return;
if (ic->sd->icon_menu.flags & E_FM2_MENU_NO_RENAME) return;
if (!_e_fm2_icon_entry_widget_add(ic))
{
... | true | true | false | false | false | 1 |
gdl_dock_get_named_items (GdlDock *dock)
{
GList *list = NULL;
g_return_val_if_fail (dock != NULL, NULL);
gdl_dock_master_foreach (GDL_DOCK_OBJECT_GET_MASTER (dock),
(GFunc) _gdl_dock_foreach_build_list, &list);
return list;
} | false | false | false | false | false | 0 |
pipeDelete(pipe_t *pipe)
{
if ( pipe )
{
if ( pipe->mutex ) free(pipe->mutex);
if ( pipe->tsDef ) free(pipe->tsDef);
if ( pipe->tsInq ) free(pipe->tsInq);
if ( pipe->recDef ) free(pipe->recDef);
if ( pipe->recInq ) free(pipe->recInq);
if ( pipe->vlistDef ) fr... | false | false | false | false | false | 0 |
Java_org_gdal_ogr_ogrJNI_DataSource_1ExecuteSQL_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) {
jlong jresult = 0 ;
OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
char *arg2 = (char *) 0 ;
OGRLayerShadow *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
... | false | false | false | false | false | 0 |
JNU_GetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy)
{
char *result = nativeGetStringPlatformChars(env, jstr, isCopy);
if (result == NULL) {
jbyteArray hab = 0;
if (isCopy)
*isCopy = JNI_TRUE;
if (fastEncoding == NO_ENCODING_YET)
initializeEn... | false | false | false | false | false | 0 |
sat_pow(unsigned int a, unsigned int b) {
unsigned int c = 1;
for (; b > 0; b--) {
c = sat_mul(c, a);
if (c == UINT_MAX)
break;
}
return c;
} | false | false | false | false | false | 0 |
ds2404_read_byte(struct device *dev)
{
int i;
u8 ret = 0;
gpio_direction_input(ds2404_gpio[DS2404_DQ].gpio);
for (i = 0; i < 8; i++) {
gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 0);
udelay(10);
if (gpio_get_value(ds2404_gpio[DS2404_DQ].gpio))
ret |= 1 << i;
gpio_set_value(ds2404_gpio[DS2404_CLK].gpio... | false | false | false | false | false | 0 |
linker_to_mod_or_lnk
___P((___mod_or_lnk (*linker) (___global_state_struct*)),
(linker)
___mod_or_lnk (*linker) ();)
{
___mod_or_lnk mol = linker (&___gstate);
if (mol->module.kind == ___LINKFILE_KIND)
{
void **p = mol->linkfile.linker_tbl;
while (*p != 0)
{
*p = linker_... | false | false | false | false | false | 0 |
_buildKeyFrameIndexMap(const vector<Real>::type& keyFrameTimes)
{
// Pre-allocate memory
mKeyFrameIndexMap.resize(keyFrameTimes.size() + 1);
size_t i = 0, j = 0;
while (j <= keyFrameTimes.size())
{
mKeyFrameIndexMap[j] = static_cast<ushort>(i);
while ... | false | false | false | false | false | 0 |
loggingGetWSObstaclesAndShape(CLogFileRecord &out_log)
{
out_log.WS_Obstacles.clear();
//Include the points of all levels (this could be improved depending on STEP2)
for (unsigned int i=0; i < m_WS_Obstacles_inlevels.size(); i++)
out_log.WS_Obstacles.insertAnotherMap( &m_WS_Obstacles_inlevels[i], CPose3D(0,0,0));... | false | false | false | false | false | 0 |
processLine(imap &imapAccount,
vector<const char *> &words)
{
if (words.size() >= 4 && strcmp(words[0], "*") == 0 &&
strcasecmp(words[1], "LIST") == 0)
{
vector<const char *> dummy;
dummy.push_back(words[2]);
string p=path;
if (p.size() > 0)
p += "/";
p += words2path(dummy);
imapFolder new... | false | false | false | false | false | 0 |
xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlChar *type,
const xmlChar *orig, const xmlChar *replace) {
xmlCatalogEntryPtr cur;
xmlCatalogEntryType typ;
int doregister = 0;
if ((catal == NULL) ||
((catal->type != XML_CATA_CATALOG) &&
(catal->type != XML_CATA_BROKE... | false | false | false | false | false | 0 |
GC_debug_malloc_atomic_uncollectable(size_t lb,
GC_EXTRA_PARAMS)
{
void * result =
GC_malloc_atomic_uncollectable(lb + UNCOLLECTABLE_DEBUG_BYTES);
if (result == 0) {
GC_err_printf(
"GC_debug_malloc_atomic_uncollectab... | false | false | false | false | false | 0 |
sd_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
switch (sd->bridge) {
case BRIDGE_OV511:
case BRIDGE_OV511PLUS:
ov511_pkt_scan(gspca_dev, data, len);
break;
case BRIDGE_OV518:
case BRIDGE_OV518PLUS:
o... | false | false | false | false | false | 0 |
put_stlg_short(FILE *fp, SuperTlg *stlg)
{
mfprintf(fp, "SuperTlg%d(%B", stlg->no, stlg->block);
if (stlg_is_tlg(stlg)) {
fprintf(fp, ".tlg%d", stlg->tlg->no);
}
else if (stlg_is_sb(stlg)) {
fprintf(fp, ".sb%d", stlg->sb->no);
}
fprintf(fp, ":%c%c",
(stlg->upper_ope... | false | false | false | false | false | 0 |
parseConstrainedSequenceOfType(tokenInfo *const token)
{
if (!parseSizeConstraint(token) && !parseConstraint(token))
return FALSE;
return parseSequenceOfType(token);
} | false | false | false | false | false | 0 |
id_to_icmpv6(uint8_t id)
{
return id < ARRAY_SIZE(icmpv6_typecodes) ?
icmpv6_typecodes[id].name : NULL;
} | false | false | false | false | false | 0 |
CleanupImpl()
{
const char* svn = this->CommandLineTool.c_str();
const char* svn_cleanup[] = {svn, "cleanup", 0};
OutputLogger out(this->Log, "cleanup-out> ");
OutputLogger err(this->Log, "cleanup-err> ");
this->RunChild(svn_cleanup, &out, &err);
} | false | false | false | false | false | 0 |
lSetPosHost(lListElem *ep, int pos, const char *value)
{
char *str = NULL;
int changed;
DENTER(CULL_BASIS_LAYER, "lSetPosHost");
if (!ep) {
LERROR(LEELEMNULL);
DEXIT;
return -1;
}
if (pos < 0) {
LERROR(LENEGPOS);
DEXIT;
return -1;
}
if (mt_get_type(ep->de... | false | false | false | false | false | 0 |
gst_asf_mux_write_header_object (GstAsfMux * asfmux, guint8 ** buf,
guint64 size, guint32 child_objects)
{
gst_asf_put_guid (*buf, guids[ASF_HEADER_OBJECT_INDEX]);
GST_WRITE_UINT64_LE (*buf + 16, size); /* object size */
GST_WRITE_UINT32_LE (*buf + 24, child_objects); /* # of child objects */
G... | false | false | false | false | false | 0 |
PC090OJ_eof_callback(void)
{
if (PC090OJ_buffer)
{
int i;
for (i=0;i<PC090OJ_ACTIVE_RAM_SIZE/2;i++)
PC090OJ_ram_buffered[i] = PC090OJ_ram[i];
}
} | false | false | false | false | false | 0 |
ReplaceAll(wstring& input, const wstring& search, const wstring& replace) {
size_t pos=0;
while(pos<input.size())
{
pos=input.find(search,pos);
if(pos==std::string::npos) break;
input.replace(pos,search.size(),replace);
pos +=replace.size();
}
} | false | false | false | false | false | 0 |
reset()
{
TestSuccessListener::reset();
ExclusiveZone zone( m_syncObject );
freeFailures();
m_testErrors = 0;
m_tests.clear();
} | false | false | false | false | false | 0 |
Num(Node *p) {
if (p == NULL) return 0; else return p->n;
} | false | false | false | false | false | 0 |
inchi_print_nodisplay( FILE* f, const char* lpszFormat, ... )
{
int ret=0;
va_list argList;
FILE* fi;
if (f)
fi = f;
else
fi = stdout;
my_va_start( argList, lpszFormat );
ret = vfprintf( fi, lpszFormat, argList );
return ret;
} | false | false | false | false | false | 0 |
ary_take_first_or_last(int argc, VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
{
VALUE nv;
long n;
long offset = 0;
rb_scan_args(argc, argv, "1", &nv);
n = NUM2LONG(nv);
if (n > RARRAY_LEN(ary)) {
n = RARRAY_LEN(ary);
}
else if (n < 0) {
rb_raise(rb_eArgError, "negative array ... | false | false | false | false | false | 0 |
GetFieldNames(const vtkStdString &tempPath,
const bool isLagrangian, vtkStringArray *cellObjectNames,
vtkStringArray *pointObjectNames)
{
// open the directory and get num of files
vtkDirectory *directory = vtkDirectory::New();
if (!directory->Open(tempPath.c_str()))
{
// no data
directory->De... | false | false | false | false | false | 0 |
attrd_perform_update(attr_hash_entry_t * hash_entry)
{
int rc = pcmk_ok;
struct attrd_callback_s *data = NULL;
const char *user_name = NULL;
if (hash_entry == NULL) {
return;
} else if (cib_conn == NULL) {
crm_info("Delaying operation %s=%s: cib not connected", hash_entry->id,
... | false | false | false | false | false | 0 |
ipath_map_sg(struct ib_device *dev, struct scatterlist *sgl,
int nents, enum dma_data_direction direction)
{
struct scatterlist *sg;
u64 addr;
int i;
int ret = nents;
BUG_ON(!valid_dma_direction(direction));
for_each_sg(sgl, sg, nents, i) {
addr = (u64) page_address(sg_page(sg));
/* TODO: handle highmem ... | false | false | false | false | false | 0 |
remove_proposal_cache (const gchar *key,
ProposalCache *cache,
GtkSourceCompletionWordsBuffer *buffer)
{
guint i;
for (i = 0; i < cache->use_count; ++i)
{
gtk_source_completion_words_library_remove_word (buffer->priv->library,
... | false | false | false | false | false | 0 |
iopause_select (iopause_fd * iop, unsigned int n, struct taia *then,
struct taia *now)
{
struct timeval tv;
fd_set rfds;
fd_set wfds;
int highfd;
unsigned int i;
int ms;
FD_ZERO (&rfds);
FD_ZERO (&wfds);
highfd = 0;
for (i = 0; i < n; i++) {
iop[i].revents = 0;
if (iop[i].fd < 0) /* EBADF */
conti... | false | false | false | false | true | 1 |
checkGuard(Exnode_t * gp, char *src, int line)
{
gp = exnoncast(gp);
if (gp && exisAssign(gp)) {
if (src) {
setErrorFileLine (src, line);
}
error(ERROR_WARNING, "assignment used as bool in guard");
}
} | false | false | false | false | false | 0 |
evas_buffer_outbuf_buf_free(Outbuf *buf)
{
if (buf->priv.back_buf)
{
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
evas_cache2_image_close(&buf->priv.back_buf->cache_entry);
else
#endif
evas_cache_image_drop(&buf->priv.back_buf->cache_entry);
}
free(buf);
} | false | false | false | false | false | 0 |
_wrap_svn_repos_delete_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
void *arg1 = (void *) 0 ;
char *arg2 = (char *) 0 ;
apr_pool_t *arg3 = (apr_pool_t *) 0 ;
apr_pool_t *_global_pool = NULL ;
PyObject *_global_py_pool = NULL ;
PyObject * obj0 = 0 ;
PyObject * obj2 = 0 ... | false | false | false | false | false | 0 |
alua_check_sense(struct scsi_device *sdev,
struct scsi_sense_hdr *sense_hdr)
{
switch (sense_hdr->sense_key) {
case NOT_READY:
if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0a) {
/*
* LUN Not Accessible - ALUA state transition
*/
alua_check(sdev, false);
return NEEDS_RETRY;
}
break;... | false | false | false | false | false | 0 |
UTI_AddDoubleToTimeval(struct timeval *start,
double increment,
struct timeval *end)
{
long int_part, frac_part;
/* Don't want to do this by using (long)(1000000 * increment), since
that will only cope with increments up to +/- 2148 seconds, which
is too marg... | false | false | false | false | false | 0 |
sig_tilde_perform(t_int *w)
{
t_float f = *(t_float *)(w[1]);
t_sample *out = (t_sample *)(w[2]);
int n = (int)(w[3]);
while (n--)
*out++ = f;
return (w+4);
} | false | false | false | false | false | 0 |
do_cbc_mac (gcry_cipher_hd_t c, const unsigned char *inbuf, size_t inlen,
int do_padding)
{
const unsigned int blocksize = 16;
gcry_cipher_encrypt_t enc_fn = c->spec->encrypt;
unsigned char tmp[blocksize];
unsigned int burn = 0;
unsigned int unused = c->u_mode.ccm.mac_unused;
size_t nblocks;
... | false | false | false | false | false | 0 |
httpFlushWrite(http_t *http) /* I - Connection to server */
{
int bytes; /* Bytes written */
DEBUG_printf(("httpFlushWrite(http=%p) data_encoding=%d", http,
http ? http->data_encoding : -1));
if (!http || !http->wused)
{
DEBUG_puts(http ? "1httpFlushWrite: Write buffer is empty." :
... | false | false | false | false | false | 0 |
Allocate (NPP aNPP, NPClass *aClass)
{
totemNPClass_base* _class = static_cast<totemNPClass_base*>(aClass);
return _class->InternalCreate (aNPP);
} | false | false | false | false | false | 0 |
memcg_cancel_update_list_lru(struct list_lru *lru,
int old_size, int new_size)
{
int i;
if (!list_lru_memcg_aware(lru))
return;
for_each_node(i)
memcg_cancel_update_list_lru_node(&lru->node[i],
old_size, new_size);
} | false | false | false | false | false | 0 |
change_owner_recurse_to_sequences(Oid relationOid, Oid newOwnerId, LOCKMODE lockmode)
{
Relation depRel;
SysScanDesc scan;
ScanKeyData key[2];
HeapTuple tup;
/*
* SERIAL sequences are those having an auto dependency on one of the
* table's columns (we don't care *which* column, exactly).
*/
depRel = heap_o... | false | false | false | false | false | 0 |
ap_environment_compare(ap_environment_t* env1,
ap_environment_t* env2)
{
ap_dimchange_t* dimchange1=NULL;
ap_dimchange_t* dimchange2=NULL;
ap_environment_t* e=NULL;
int res;
e = ap_environment_lce(env1,env2,&dimchange1,&dimchange2);
if (e==NULL) res = -2;
else if (dimchange1==NULL && dimchange2==NU... | false | false | false | false | false | 0 |
operator==(const MetaData& rLHS, const MetaData& rRHS)
{
if (rLHS.m_Label.compare(rRHS.m_Label) != 0)
return false;
if (rLHS.m_Description.compare(rRHS.m_Description) != 0)
return false;
if (rLHS.m_Unlocked != rRHS.m_Unlocked)
return false;
if (rLHS.HasInfo() && rRHS.HasInfo())
{... | false | false | false | false | false | 0 |
get_acl_size(list<pair<pIIR_Expression, pIIR_Root> > &acl_expr_list)
{
int count = 0;
for (list<pair<pIIR_Expression, pIIR_Root> >::iterator it = acl_expr_list.begin(); it != acl_expr_list.end(); it++)
{
const bool emit_directly = (*it).first == NULL;
pIIR_Root ex = (*it).second;
if (!emit_di... | false | false | false | false | false | 0 |
cogorc_convert_YUY2_AYUV (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int n, int m)
{
OrcExecutor _ex, *ex = &_ex;
static volatile int p_inited = 0;
static OrcProgram *p = 0;
void (*func) (OrcExecutor *);
if (!p_inited) {
orc_once_mutex_lock ();
if (!p_init... | false | false | false | false | false | 0 |
init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size TSRMLS_DC)
{
op_array->type = type;
if (CG(interactive)) {
/* We must avoid a realloc() on the op_array in interactive mode, since pointers to constants
* will become invalid
*/
initial_ops_size = INITIAL_INTERACTIVE_OP_ARRAY_SIZE... | false | false | false | false | false | 0 |
close() {
_assert_(true);
SharedLibraryCore* core = (SharedLibraryCore*)opq_;
if (!core->lib) return false;
bool err = false;
if (::dlclose(core->lib) != 0) err = true;
core->lib = NULL;
return !err;
} | false | false | false | false | false | 0 |
HasTranslucentPolygonalGeometry()
{
this->BuildRepresentation();
if ( this->CurrentProp )
{
return this->CurrentProp->HasTranslucentPolygonalGeometry();
}
else
{
return 0;
}
} | false | false | false | false | false | 0 |
delete_job_id_range(UAContext *ua, char *tok)
{
char *tok2;
JobId_t j,j1,j2;
tok2 = strchr(tok, '-');
if (!tok2) {
return false;
}
*tok2 = '\0';
tok2++;
j1 = str_to_int64(tok);
j2 = str_to_int64(tok2);
for (j=j1; j<=j2; j++) {
do_job_delete(ua, j);
}
return true;
} | false | false | false | false | false | 0 |
hpwdt_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
void __user *argp = (void __user *)arg;
int __user *p = argp;
int new_margin, options;
int ret = -ENOTTY;
switch (cmd) {
case WDIOC_GETSUPPORT:
ret = 0;
if (copy_to_user(argp, &ident, sizeof(ident)))
ret = -EFAULT;
break;
case WDIO... | false | false | false | false | false | 0 |
igb_probe_vfs(struct igb_adapter *adapter)
{
#ifdef CONFIG_PCI_IOV
struct pci_dev *pdev = adapter->pdev;
struct e1000_hw *hw = &adapter->hw;
/* Virtualization features not supported on i210 family. */
if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211))
return;
/* Of the below we really only want ... | false | false | false | false | false | 0 |
show() {
if (isVisible() || menuitems.empty())
return;
m_visible = true;
if (m_need_update)
updateMenu();
m_type_ahead.reset();
m_matches.clear();
m_window.showSubwindows();
m_window.show();
raise();
if (shown && shown != this)
shown->hide();
shown =... | false | false | false | false | false | 0 |
ins_compl_free()
{
compl_T *match;
int i;
vim_free(compl_pattern);
compl_pattern = NULL;
vim_free(compl_leader);
compl_leader = NULL;
if (compl_first_match == NULL)
return;
ins_compl_del_pum();
pum_clear();
compl_curr_match = compl_first_match;
do
{
match = comp... | false | false | false | false | false | 0 |
Swig_symbol_string_qualify(String *s, Symtab *st) {
int have_id = 0;
String *id = NewStringEmpty();
String *r = NewStringEmpty();
char *c = Char(s);
while (*c) {
if (isalpha((int) *c) || (*c == '_') || (*c == ':')) {
Putc(*c, id);
have_id = 1;
} else {
if (have_id) {
String *qid = S... | false | false | false | false | false | 0 |
pbsor_(integer *n, integer *ia, integer *ja, doublereal *a, doublereal *u, doublereal *rhs)
{
/* Local variables */
static integer i, ii, jj;
static doublereal ui, sum, omm1;
static integer jajj, ibgn, iend;
/* ... THIS SUBROUTINE COMPUTES A BACKWARD SOR SWEEP. */
/* ... PARAMETER LIST: */
/* ... | 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.