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 |
|---|---|---|---|---|---|---|
free_wispr_routes(struct connman_wispr_portal_context *wp_context)
{
while (wp_context->route_list != NULL) {
struct wispr_route *route = wp_context->route_list->data;
DBG("free route to %s if %d type %d", route->address,
route->if_index, wp_context->type);
switch(wp_context->type) {
case CONNMAN_IPCONFI... | false | false | false | false | false | 0 |
efi_file_close ( EFI_FILE_PROTOCOL *this ) {
struct efi_file *file = container_of ( this, struct efi_file, file );
/* Do nothing if this is the root */
if ( ! file->image )
return 0;
/* Close file */
DBGC ( file, "EFIFILE %s closed\n", efi_file_name ( file ) );
image_put ( file->image );
free ( file );
ret... | false | false | false | false | false | 0 |
static_apply (gamgi_symmetry *symmetry, gamgi_element *element)
{
int i, j, j_best;
double distance, distance_best;
int n_atoms = symmetry->n_atoms;
gamgi_atom **atoms = symmetry->atoms;
gamgi_atom new;
char *used;
/***********************************************
* used is only allocated inside this function *
*****... | false | false | false | false | false | 0 |
opt_get_linger(lua_State *L, p_socket ps)
{
struct linger li; /* obj, name */
int len = sizeof(li);
int err = opt_get(L, ps, SOL_SOCKET, SO_LINGER, (char *) &li, &len);
if (err)
return err;
lua_newtable(L);
lua_pushboolean(L, li.l_onoff);
lua_setfield(L, -2, "on"... | false | false | false | false | false | 0 |
httpConnect(HttpConn *conn, cchar *method, cchar *url)
{
mprAssert(conn);
mprAssert(method && *method);
mprAssert(url && *url);
if (conn->endpoint) {
httpError(conn, HTTP_CODE_BAD_GATEWAY, "Can't call connect in a server");
return MPR_ERR_BAD_STATE;
}
mprLog(4, "Http: client req... | false | false | false | true | false | 1 |
level2bits(const char *level, int *errorp)
{
char *orig, *str, *ptr;
int ret, singlelevel, negative;
if (errorp != NULL)
*errorp = FALSE;
g_return_val_if_fail(level != NULL, 0);
if (*level == '\0')
return 0;
orig = str = g_strdup(level);
ret = 0;
for (ptr = str; ; str++) {
if (*str == ' ')
*str++ ... | false | false | false | false | false | 0 |
ippOpValue(const char *name) /* I - Textual name */
{
int i;
if (!strncmp(name, "0x", 2))
return ((ipp_op_t)strtol(name + 2, NULL, 16));
for (i = 0; i < (sizeof(ipp_std_ops) / sizeof(ipp_std_ops[0])); i ++)
if (!_cups_strcasecmp(name, ipp_std_ops[i]))
return ((ipp_op_t)i);
if (!_cups_strcase... | false | false | false | false | false | 0 |
load_table(int t)
{
int i, j, ncols, nrows, dbfcol;
DBFHandle dbf;
char *buf;
ROW *rows;
VALUE *val;
G_debug(2, "load_table(): tab = %d", t);
if (db.tables[t].loaded == TRUE) /*already loaded */
return DB_OK;
dbf = DBFOpen(db.tables[t].file, "r");
if (dbf == NULL) {
append_error... | false | false | false | false | false | 0 |
xx_recurse(Term t, Ilist pos, int *n)
{
if (pos == NULL) {
Term v = get_variable_term(*n);
(*n)++;
return v;
}
else {
int i;
Term new = get_rigid_term_like(t);
for (i = 0; i < ARITY(t); i++) {
Term arg;
if (i == pos->i-1)
arg = xx_recurse(ARG(t,i), pos->next, n);
else {
... | false | false | false | false | false | 0 |
get_name() const
{ return std::string("Dir_cache_task ") + this->dir_; } | false | false | false | false | false | 0 |
gen_vec_unpacku_lo_v4si (rtx operand0,
rtx operand1)
{
rtx _val = 0;
start_sequence ();
{
rtx operands[2];
operands[0] = operand0;
operands[1] = operand1;
#line 5713 "../../src/gcc/config/arm/neon.md"
{
rtvec v = rtvec_alloc (4/2) ;
rtx t1;
int i;
for (i = 0; i < (4/2) ; i++)
RTVEC_... | false | false | false | false | true | 1 |
free_simple_loop_desc (struct loop *loop)
{
struct niter_desc *desc = simple_loop_desc (loop);
if (!desc)
return;
free (desc);
loop->aux = NULL;
} | false | false | false | false | false | 0 |
mono_attach_start (void)
{
char path [256];
int fd;
if (started)
return FALSE;
/* Check for the existence of the trigger file */
/*
* We don't do anything with this file, and the only thing an attacker can do
* by creating it is to enable the attach mechanism if the process receives a
* SIGQUIT signal... | true | true | false | false | true | 1 |
closeSocket(ClientSockData* client)
{
if (client->ssl != NULL)
{
int n=SSL_shutdown(client->ssl);
if(!n)
{
shutdown(client->socketId, 1);
SSL_shutdown(client->ssl);
}
SSL_free(client->ssl);
}
shutdown (client->socketId, SHUT_RDWR);
close(client->socketId);
} | false | false | false | false | false | 0 |
ipr_reinit_ipr_cmnd(struct ipr_cmnd *ipr_cmd)
{
struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
struct ipr_ioasa *ioasa = &ipr_cmd->s.ioasa;
struct ipr_ioasa64 *ioasa64 = &ipr_cmd->s.ioasa64;
dma_addr_t dma_addr = ipr_cmd->dma_addr;
int hrrq_id;
hrrq_id = ioarcb->cmd_pkt.hrrq_id;
memset(&ioarcb->cmd_pkt, 0, sizeo... | false | false | false | false | false | 0 |
isSticky() {
return isBaseSticky() && isLocalSticky();
} | false | false | false | false | false | 0 |
gfs_write_mac_velocity (GfsDomain * domain,
gdouble scale,
FttTraverseFlags flags,
gint level,
GtsBBox * bbox,
FILE * fp)
{
gpointer data[3];
GfsNorm norm;
g_return_if_fail (domain != NULL);
g_return_if_fail (fp != NULL);
norm = gfs_domain_norm_velocity (domain, flags... | false | false | false | false | false | 0 |
si2157_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct si2157_config *cfg = client->dev.platform_data;
struct dvb_frontend *fe = cfg->fe;
struct si2157_dev *dev;
struct si2157_cmd cmd;
int ret;
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) {
ret = -ENOMEM;
dev_err(&client->d... | false | true | false | false | false | 1 |
postCoreInitialization()
{
if (Utils::Log::warnPluginsCreation())
qWarning() << Q_FUNC_INFO;
// Core is fully intialized as well as all plugins
// In debug mode, add the script dialog
if (!Utils::isReleaseCompilation()) {
Core::Context ctx(Core::Constants::C_GLOBAL);
Core::Comma... | false | false | false | false | false | 0 |
update_bad_pixel_map(cpl_image* im)
{
int szx = cpl_image_get_size_x(im);
int szy = cpl_image_get_size_y(im);
int x = 0;
cpl_mask* bpm = cpl_image_get_bpm(im);
for (x = 1; x <=szx; x++)
{
int y = 0;
for(y = 1; y <= szy; y++)
{
int isnull = 0;
double value = cpl_image_get(im, x, y, &isnull);
if (is... | false | false | false | false | false | 0 |
acpi_ut_get_object_size(union acpi_operand_object *internal_object,
acpi_size * obj_length)
{
acpi_status status;
ACPI_FUNCTION_ENTRY();
if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) ==
ACPI_DESC_TYPE_OPERAND)
&& (internal_object->common.type == ACPI_TYPE_PACKAGE)) {
status =
acpi_ut_get_pac... | false | false | false | false | false | 0 |
visu_ui_element_combobox_new(gboolean hasAllSelector, gboolean hasNoneSelector,
const gchar *format)
{
VisuUiElementCombobox *wd;
GObjectClass *klass;
GtkCellRenderer *renderer;
DBG_fprintf(stderr, "VisuUi ElementCombobox: creating new object with format: '%s'.\n",
format)... | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdflib_HDFDeprecated_DFSDgetdims
( JNIEnv *env,
jclass clss,
jstring filename,
jintArray rank, /* OUT: int */
jintArray dimsizes, /* OUT: int[] should be at least 'maxrank' long */
jint maxrank)
{
intn rval;
jchar * name;
jint * dims;
jint * rnk;
jboolean bb;
name =(jchar *) EN... | false | false | false | false | false | 0 |
send_flow_control(struct nozomi *dc)
{
u32 i, more_flow_control_to_be_updated = 0;
u16 *ctrl;
for (i = PORT_MDM; i < MAX_PORT; i++) {
if (dc->port[i].update_flow_control) {
if (more_flow_control_to_be_updated) {
/* We have more flow control to be updated */
return 1;
}
dc->port[i].ctrl_ul.port = ... | false | false | false | false | false | 0 |
proc_setmaxgroups(VALUE obj, VALUE val)
{
size_t ngroups = FIX2INT(val);
if (ngroups > 4096)
ngroups = 4096;
maxgroups = ngroups;
return INT2FIX(maxgroups);
} | false | false | false | false | false | 0 |
validate_switches (const char *start)
{
const char *p = start;
const char *atom;
size_t len;
int i;
bool suffix = false;
bool starred = false;
#define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0)
next_member:
SKIP_WHITE ();
if (*p == '!')
p++;
SKIP_WHITE ();
if (*p == '... | false | false | false | false | false | 0 |
ModExp(const BigNumber& bn1, const BigNumber& bn2)
{
BigNumber ret;
BN_CTX* bnctx;
bnctx = BN_CTX_new();
BN_mod_exp(ret._bn, _bn, bn1._bn, bn2._bn, bnctx);
BN_CTX_free(bnctx);
return ret;
} | false | false | false | false | false | 0 |
DisplayFromDoc(int lineDoc) const {
if (OneToOne()) {
return (lineDoc <= linesInDocument) ? lineDoc : linesInDocument;
} else {
if (lineDoc > displayLines->Partitions())
lineDoc = displayLines->Partitions();
return displayLines->PositionFromPartition(lineDoc);
}
} | false | false | false | false | false | 0 |
tcm_loop_drop_nexus(
struct tcm_loop_tpg *tpg)
{
struct se_session *se_sess;
struct tcm_loop_nexus *tl_nexus;
tl_nexus = tpg->tl_nexus;
if (!tl_nexus)
return -ENODEV;
se_sess = tl_nexus->se_sess;
if (!se_sess)
return -ENODEV;
if (atomic_read(&tpg->tl_tpg_port_count)) {
pr_err("Unable to remove TCM_Loop... | false | false | false | false | false | 0 |
float64_to_int32(float64 a, float_status_t &status)
{
Bit64u aSig = extractFloat64Frac(a);
Bit16s aExp = extractFloat64Exp(a);
int aSign = extractFloat64Sign(a);
if ((aExp == 0x7FF) && aSig) aSign = 0;
if (aExp) aSig |= BX_CONST64(0x0010000000000000);
int shiftCount = 0x42C - aExp;
if (0 < s... | false | false | false | false | false | 0 |
lad_sm_search_checkf_block(Array_table *ldm,
StripMiningInnerLoop *kick_smil)
{
List *li, *kick_list;
StripMiningInnerLoop *smil;
Block *block;
Array_def_use_table_semnode *mod, *aduts;
int mod_entry, flag;
smil = NULL;
block = NULL;
mod = NULL;
kick_list = lad_sm_change_smil... | false | false | false | true | false | 1 |
getHostFileName( char* result, ExtDrive* drv, char* pathName, const char* name )
{
struct stat statBuf;
DFNAME(bug("HOSTFS: getHostFileName (%s,%s)", pathName, name));
// if the whole thing fails then take the requested name as is
// it also completes the path
strcpy( result, name );
if ( ! strpbrk( name, "*?"... | false | false | false | false | false | 0 |
draw_frame( gpointer data)
{
GtkWidget *window=data;
if(!movie_pixmaps || !data || !GTK_WIDGET(window)
//#if GTK_MAJOR_VERSION >= 2
// || !GDK_IS_DRAWABLE(widget->window)
//#endif
) return FALSE;
movie_pixmaps_frame++;
if(movie_pixmaps_frame>=movie_pixmaps_num)
movie_pixmaps_frame... | false | false | false | false | false | 0 |
makeName(const Path & profile, unsigned int num,
Path & outLink)
{
Path prefix = (format("%1%-%2%") % profile % num).str();
outLink = prefix + "-link";
} | false | false | false | false | false | 0 |
nxt_display_flush(nxt_display_t *display,int notdirty) {
char screen[NXT_DISPLAY_HEIGHT/8][NXT_DISPLAY_WIDTH];
int x,y;
if (!notdirty && !display->dirty) return 0;
if ((display->modid = nxt_mod_get_id(display->nxt,NXT_DISPLAY_MODFILE))!=-1) {
for (y=0;y<64;y++) {
for (x=0;x<100;x++) {
if (di... | false | false | false | false | true | 1 |
fcoe_ctlr_mode_set(struct fc_lport *lport, struct fcoe_ctlr *fip,
enum fip_state fip_mode)
{
void *priv;
WARN_ON(lport->state != LPORT_ST_RESET &&
lport->state != LPORT_ST_DISABLED);
if (fip_mode == FIP_MODE_VN2VN) {
lport->rport_priv_size = sizeof(struct fcoe_rport);
lport->point_to_multipoint = 1... | false | false | false | false | false | 0 |
SetOptionComplete(METAIO_STL::string optionName,
bool complete)
{
OptionVector::iterator it = m_OptionVector.begin();
while(it != m_OptionVector.end())
{
if((*it).name == optionName)
{
(*it).complete = complete;
return;
}
++it;
}
} | false | false | false | false | false | 0 |
btreeSecbucketNew(ajuint n, ajuint idlen)
{
AjPSecbucket bucket = NULL;
ajuint i;
/* ajDebug("In btreeSecbucketNew\n"); */
if(n)
{
if(statSaveSecbucketNext)
{
bucket = statSaveSecbucket[--statSaveSecbucketNext];
for(i=0;i<bucket->Maxentries;++i)
... | false | false | false | false | false | 0 |
MlcOpenChannel(mud_channel *pc, int fd)
{
mud_device *pd = &msp->device[pc->dindex];
unsigned char buf[HPMUD_BUFFER_SIZE];
int stat=0, len, n;
MLCOpenChannel *pCmd;
MLCOpenChannelReply *pReply;
memset(buf, 0, sizeof(MLCOpenChannel));
pCmd = (MLCOpenChannel *)buf;
n = sizeof(MLCOpenChannel);
... | false | false | false | false | false | 0 |
ssl_var_lookup_ssl_cert_dn(apr_pool_t *p, X509_NAME *xsname, char *var)
{
char *result, *ptr;
X509_NAME_ENTRY *xsne;
int i, j, n, idx = 0;
apr_size_t varlen;
/* if an _N suffix is used, find the Nth attribute of given name */
ptr = strchr(var, '_');
if (ptr != NULL && strspn(ptr + 1, "01234... | false | false | false | false | false | 0 |
_glade_dnd_get_data (GdkDragContext *context,
GtkSelectionData *selection,
guint info)
{
GdkAtom target = gtk_selection_data_get_target (selection);
if (info == GLADE_DND_INFO_DATA &&
g_strcmp0 (gdk_atom_name (target), GLADE_DND_TARGET_DATA) == 0)
{... | false | false | false | false | false | 0 |
ReactToSpecialKeys(void)
{
if ( cmd_is_active(CMD_QUIT) )
QuitGameMenu();
if ( cmd_is_activeR(CMD_PAUSE) )
Pause ();
if ( cmd_is_active (CMD_SCREENSHOT) )
TakeScreenshot();
// this stuff remains hardcoded to keys
if ( KeyIsPressedR('c') && AltPressed() && CtrlPressed() && ShiftPressed() )
... | false | false | false | false | false | 0 |
RValidPos(EPoint Pos) {
if ((Pos.Col >= 0) &&
(Pos.Row >= 0) &&
(Pos.Row < RCount))
return 1;
return 0;
} | false | false | false | false | false | 0 |
wl1251_sdio_remove(struct sdio_func *func)
{
struct wl1251 *wl = sdio_get_drvdata(func);
struct wl1251_sdio *wl_sdio = wl->if_priv;
/* Undo decrement done above in wl1251_probe */
pm_runtime_get_noresume(&func->dev);
if (wl->irq)
free_irq(wl->irq, wl);
wl1251_free_hw(wl);
kfree(wl_sdio);
sdio_claim_host(fu... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
ConfigDialog *_t = static_cast<ConfigDialog *>(_o);
switch (_id) {
case 0: _t->defaultFontChanged(); break;
case 1: _t->... | false | false | false | false | false | 0 |
queueCanPop(int id)
{
if (id >=0 && id < Q_MAX && _queues[id] != NULL) {
return (g_async_queue_length(_queues[id]) > 0 ? RC_OK : RC_NOK);
}
return RC_NOK;
} | false | false | false | false | false | 0 |
pit_task_delete(int id, PProject pp)
{
PTask pt;
bool standalone = (pp == NULL);
if (standalone) pit_db_load();
id = task_find_current(id, &pt);
if (standalone) pp = (PProject)pit_table_find(projects, pt->project_id);
if (pp) {
/*
** Preserve task name and number_of_notes befor... | false | false | false | false | false | 0 |
md_create_appicon(Window p, int x, int y, char *name,
Pixmap pm1, Pixmap pm2)
{
char *data;
Window w;
int res, l=strlen(name);
#ifdef HAVE_ALLOCA
struct NewAppIcon *nai=alloca(sizeof(struct NewAppIcon)+l);
#else
struct NewAppIcon *nai=malloc(sizeof(struct NewAppIcon)+l);
if(nai==NULL) return None;
#endi... | false | false | false | false | false | 0 |
Decode(WEBP_CSP_MODE mode, const uint8_t* const data,
size_t data_size, int* const width, int* const height,
WebPDecBuffer* const keep_info) {
WebPDecParams params;
WebPDecBuffer output;
WebPInitDecBuffer(&output);
WebPResetDecParams(¶ms);
params.output = &ou... | false | false | false | false | false | 0 |
dirEntryToStatus(const char * path, const DirEntry & dirEntry)
{
Pool pool;
svn_wc_entry_t * e =
static_cast<svn_wc_entry_t *>(
apr_pcalloc(pool, sizeof(svn_wc_entry_t)));
std::string url(path);
url += '/';
url += dirEntry.name();
e->name = dirEntry.name();
e->revision = d... | false | false | false | false | false | 0 |
guestfs_session_equal(GuestfsSession *session, const gchar *file1, const gchar *file2, GError **err)
{
guestfs_h *g = session->priv->g;
if (g == NULL) {
g_set_error(err, GUESTFS_ERROR, 0,
"attempt to call %s after the session has been closed",
"equal");
return -1;
}
int ... | false | false | false | false | false | 0 |
reduce_to_bit_field_precision (rtx exp, rtx target, tree type)
{
HOST_WIDE_INT prec = TYPE_PRECISION (type);
if (target && GET_MODE (target) != GET_MODE (exp))
target = 0;
/* For constant values, reduce using build_int_cst_type. */
if (CONST_INT_P (exp))
{
HOST_WIDE_INT value = INTVAL (exp);
... | false | false | false | false | false | 0 |
TXT_InputBoxKeyPress(TXT_UNCAST_ARG(inputbox), int key)
{
TXT_CAST_ARG(txt_inputbox_t, inputbox);
unsigned int c;
if (!inputbox->editing)
{
if (key == KEY_ENTER)
{
StartEditing(inputbox);
return 1;
}
// Backspace or delete erases the contents of ... | false | false | false | false | false | 0 |
dwarf_get_abbrev_count(Dwarf_Debug dbg)
{
Dwarf_Abbrev ab;
Dwarf_Unsigned offset = 0;
Dwarf_Unsigned length = 0;
Dwarf_Unsigned attr_count = 0;
Dwarf_Unsigned abbrev_count = 0;
int abres = DW_DLV_OK;
Dwarf_Error err;
while ((abres = dwarf_get_abbrev(dbg, offset, &ab,
&length, &a... | false | false | false | false | false | 0 |
convert_1_s8_to_1_s8 (xmms_sample_converter_t *conv, void *tin, guint len, void *tout)
{
xmms_samples8_t *in = (xmms_samples8_t *)tin;
xmms_samples8_t *out = (xmms_samples8_t *)tout;
gint i, j;
/* this code doesn't look optimized,
but the compiler should fix that */
for (i = 0; i < len; i++) {
guint32 temp[1]... | false | false | false | false | false | 0 |
LineAdd() {
if (InsLine(VToR(CP.Row), 1) && MoveDown()) return 1;
return 0;
} | false | false | false | false | false | 0 |
findTraced(ViewGeometry::WireFlags flags, QList<ConnectorItem *> & ends) {
QList<Wire *> chainedWires;
this->collectChained(chainedWires, ends);
if (ends.count() != 2) {
DebugDialog::debug(QString("wire in jumper or trace must have two ends") );
return NULL;
}
return ConnectorItem::directlyWiredTo(ends[0], e... | false | false | false | false | false | 0 |
tooltip_map(Tooltip *tt, int x, int y, const FcChar8 *text, int len)
{
XUnmapWindow(tt->mainwin->dpy, tt->window);
XftTextExtents8(tt->mainwin->dpy, tt->font, text, len, &tt->extents);
tt->width = tt->extents.width + 8;
tt->height = tt->font_height + 5 + (tt->shadow.pixel ? 2 : 0);
XResizeWindow(tt->mainwin->d... | false | false | false | false | false | 0 |
PointInSelection(Point pt) {
SelectionPosition pos = SPositionFromLocation(pt);
int xPos = XFromPosition(pos);
for (size_t r=0; r<sel.Count(); r++) {
SelectionRange range = sel.Range(r);
if (range.Contains(pos)) {
bool hit = true;
if (pos == range.Start()) {
// see if just before selection
if (pt.x... | false | false | false | false | false | 0 |
checkMeshElements(MeshElementTable* table, bool swap_to_ccw)
{
bool result = true;
for (int i = 0; i < table->NofElements(); i++) {
meshElementCode code = table->getElementCode(i);
int* nodes = table->nodeIds[i];
result = checkMeshElement(code, nodes, swap_to_ccw);
}
return result;
} | false | false | false | false | false | 0 |
SWIG_Tcl_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
char result[1024];
char *r = result;
if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
*(r++) = '_';
r = SWIG_PackData(r,ptr,sz);
strcpy(r,type->name);
return Tcl_NewStringObj(result,-1);
} | false | false | false | false | false | 0 |
wl1251_fetch_nvs(struct wl1251 *wl)
{
const struct firmware *fw;
struct device *dev = wiphy_dev(wl->hw->wiphy);
int ret;
ret = request_firmware(&fw, WL1251_NVS_NAME, dev);
if (ret < 0) {
wl1251_error("could not get nvs file: %d", ret);
return ret;
}
if (fw->size % 4) {
wl1251_error("nvs size is not mult... | false | false | false | false | false | 0 |
ratio_counts(col)
struct working *col;
{
int aa;
double ndiag, total, ratio;
total = col->totcnt * (col->totcnt - 1.0) / 2.0;
ndiag = 0.0;
for (aa = 1; aa < AAS; aa++)
if (col->cnt[aa] > 1.0)
ndiag += col->cnt[aa] * (col->cnt[aa] - 1.0) / 2.0;
if (ndiag < total) ratio = ndiag/(total -... | false | false | false | false | false | 0 |
EnsureMkDir(const string& dir) {
if (!IsDirectory(dir)) {
int done = 0;
string temp = dir;
vector<string> comps;
do {
string::size_type i = temp.rfind(DIR_SEP);
if (i != string::npos) {
comps.push_back(temp.substr(i+1));
temp = temp.substr(0, i);
} else {
comps.push_back(temp);
done = ... | false | false | false | false | false | 0 |
ijmlist_idx_remove_by_index(jmlist jml,jmlist_index index)
{
jmlist_debug(__func__,"called with jml=%p, index=%u",jml,index);
if( !jml->idx_list.usage )
{
jmlist_debug(__func__,"cannot get by index on empty list (lnk_list.usage=0)");
jmlist_debug(__func__,"returning with failure.");
jmlist_errno = JMLIST_ERRO... | false | false | false | false | false | 0 |
operator+(const hsBounds3Ext& right) const {
hsBounds3Ext result = *this;
result += right;
return result;
} | false | false | false | false | false | 0 |
env_tilde_new(t_floatarg fnpoints, t_floatarg fperiod)
{
int npoints = fnpoints;
int period = fperiod;
t_sigenv *x;
t_sample *buf;
int i;
if (npoints < 1) npoints = 1024;
if (period < 1) period = npoints/2;
if (period < npoints / MAXOVERLAP + 1)
period = npoints / MAXOVERLAP + 1... | false | false | false | false | false | 0 |
make_sv_object(pTHX_ SV *sv)
{
SV *const arg = sv_newmortal();
const char *type = 0;
IV iv;
dMY_CXT;
for (iv = 0; iv < (IV)(sizeof(specialsv_list)/sizeof(SV*)); iv++) {
if (sv == specialsv_list[iv]) {
type = "B::SPECIAL";
break;
}
}
if (!type) {
type = svclassnames[SvTYPE(sv)];... | false | false | false | false | false | 0 |
init_pseudo_attacks() {
Square s;
for(s = SQ_A1; s <= SQ_H8; s++) {
BishopPseudoAttacks[s] = bishop_attacks_bb(s, EmptyBoardBB);
RookPseudoAttacks[s] = rook_attacks_bb(s, EmptyBoardBB);
QueenPseudoAttacks[s] = queen_attacks_bb(s, EmptyBoardBB);
}
} | false | false | false | false | false | 0 |
AddFrame(const Frame& in1, const Frame& in2, Frame& out)
{
if(mIgnoreResidualCtl.GetLastValue()<0.01) // is 0
{
mSpectrumAdder.Start();
mSpectrumAdder.Do(in1.GetResidualSpec(),in2.GetResidualSpec(),out.GetResidualSpec());
mSpectrumAdder.Stop();
}
out.SetSpectralPeakArray(in1.GetSpectralPeakArray()+in2.GetSpec... | false | false | false | false | false | 0 |
setIntFieldValue(JNIEnv *env,
jobject obj,
const char *fieldName,
jfieldID *fieldID,
jint value)
{
jclass objClass = 0;
jfieldID objFieldID = 0;
if (fieldID == NULL) {
objClass = (*env)->GetObjectClass(env, obj);
if (objC... | false | false | false | false | false | 0 |
fuse_conn_abort_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
struct fuse_conn *fc = fuse_ctl_file_conn_get(file);
if (fc) {
fuse_abort_conn(fc);
fuse_conn_put(fc);
}
return count;
} | false | false | false | false | false | 0 |
write(dimeOutput * const file)
{
bool ret = dimeTableEntry::preWrite(file);
if (ret) {
ret = dimeTableEntry::write(file);
}
return ret;
} | false | false | false | false | false | 0 |
gt_emissionmergedesa_stepdeleteandinsertothersuffixes(
Emissionmergedesa *emmesa, GtError *err)
{
Mergertrienode *tmpsmallestleaf, *tmplcpnode;
Largelcpvalue tmpexception;
GtUchar tmpsmalllcpvalue;
int retval;
unsigned long tmpsuftabvalue,
tmplcpvalue,
tmplas... | false | false | false | false | false | 0 |
setserial_parse_config( const char *token, char *cptr )
{
setserialno = atoi(cptr);
setserialno++;
DEBUGMSGTL(("snmpSetSerialNo",
"Re-setting SnmpSetSerialNo to %d\n", setserialno));
} | false | false | false | false | true | 1 |
appendsearchargs(s, s1, s2)
struct searchargs *s, *s1, *s2;
{
struct searchsub **tail = &s->sublist;
while (*tail) tail = &(*tail)->next;
*tail = (struct searchsub *)xmalloc(sizeof(struct searchsub));
(*tail)->sub1 = s1;
(*tail)->sub2 = s2;
(*tail)->next = 0;
} | false | false | false | false | false | 0 |
kinst_buffer_vram(data32_t *base)
{
UINT16 *dest = vram_buffer;
int y;
/* it is not at all understood how this really works; it breaks in
the disk test, but this seems to be a close approximation to the
real thing otherwise */
/* loop over rows */
for (y = 0; y < 240; y++)
{
data32_t *src = &... | false | true | false | false | false | 1 |
add_visitor(visitfunc fn, void *context)
{
struct visitor *p = xmalloc(sizeof(struct visitor));
p->inspector = fn;
p->context = context;
p->next = NULL;
if (NULL == lastinspector)
{
lastinspector = inspectors = p;
}
else
{
lastinspector->next = p;
lastinspector = p;
}
... | false | false | false | false | false | 0 |
openMessCallback(void *data, t_symbol*s,int argc, t_atom*argv)
{
int codec=-1;
if (!argc || argc>3)goto illegal_openmess;
if (argv[0].a_type != A_SYMBOL)goto illegal_openmess;
if (argc==2){
if (argv[1].a_type == A_SYMBOL)
GetMyClass(data)->csMess(atom_getsymbol(argv+1), false);
else if (argv[1].... | false | false | false | false | false | 0 |
binheap_addrow(struct binheap *bh)
{
unsigned u;
/* First make sure we have space for another row */
if (&ROW(bh, bh->length) >= bh->array + bh->rows) {
u = bh->rows * 2;
bh->array = realloc(bh->array, sizeof(*bh->array) * u);
assert(bh->array != NULL);
/* NULL out new pointers */
while (bh->rows < u)
... | false | false | false | true | false | 1 |
LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
{
SRes res;
CLzmaEnc *p = (CLzmaEnc *)pp;
CSeqOutStreamBuf outStream;
LzmaEnc_SetInputBuf(p, src, srcLen);
outStr... | false | false | false | false | false | 0 |
xvip_pipeline_set_stream(struct xvip_pipeline *pipe, bool on)
{
int ret = 0;
mutex_lock(&pipe->lock);
if (on) {
if (pipe->stream_count == pipe->num_dmas - 1) {
ret = xvip_pipeline_start_stop(pipe, true);
if (ret < 0)
goto done;
}
pipe->stream_count++;
} else {
if (--pipe->stream_count == 0)
x... | false | false | false | false | false | 0 |
get_config_dword(const char *ident, uint32 def)
{
String e;
e = "/config/";
e.append(ident);
ht_registry_node *n;
Container *dir;
if (registry->find_data_entry(e.contentChar(), &n, true, &dir)) {
if (n->type == RNT_DWORD) {
ht_registry_data_dword *s = (ht_registry_data_dword *)n->data;
return s->value;
... | false | false | false | false | false | 0 |
gretl_dlopen (const char *path, int now)
{
void *handle = NULL;
#ifdef WIN32
if (strstr(path, "R.dll")) {
handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
} else {
handle = LoadLibrary(path);
}
#else
handle = dlopen(path, (now)? RTLD_NOW : RTLD_LAZY);
#endif
if (handle == N... | false | false | false | false | false | 0 |
test_rev_decz80( libspectrum_byte *source, int final_len, int source_len )
{
/* source is reversed !!! */
int dst_pnt = final_len-1;
int src_pnt = source_len-1;
int overwrite = 0;
libspectrum_byte b1;
libspectrum_byte b2;
libspectrum_byte times;
while (dst_pnt >=0 && !overwrite)
{
b1 = source[src_pnt];
... | false | false | false | false | false | 0 |
parseIndicatedReservedName(const AllowedParams &allow,
Param &parm)
{
Syntax::ReservedName rn;
if (!getIndicatedReservedName(&rn))
return 0;
if (!allow.reservedName(rn)) {
message(ParserMessages::invalidReservedName,
StringMessageArg(currentToken()));
return 0;
}
parm.type = Param::in... | false | false | false | false | false | 0 |
createDataDict()
{
/* Make sure only one thread tries to initialize the dictionary */
#ifdef WITH_THREADS
dataDictLock.wrlock();
#endif
#ifdef DONT_LOAD_EXTERNAL_DICTIONARIES
const OFBool loadExternal = OFFalse;
#else
const OFBool loadExternal = OFTrue;
#endif
/* Make sure no other thread managed to create th... | false | false | false | false | false | 0 |
cogorc_convert_UYVY_YUY2 (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 |
gst_video_get_size_from_caps (const GstCaps * caps, gint * size)
{
GstVideoFormat format = 0;
gint width = 0, height = 0;
g_return_val_if_fail (gst_caps_is_fixed (caps), FALSE);
g_return_val_if_fail (size != NULL, FALSE);
if (gst_video_format_parse_caps (caps, &format, &width, &height) == FALSE) {
GST_W... | false | false | false | false | false | 0 |
get_lasting_view(off_t offset, off_t start, section_size_type size,
bool aligned, bool cache)
{
File_read::View* pv = this->find_or_make_view(offset, start, size,
aligned, cache);
pv->lock();
return new File_view(*this, pv,
(pv->data()
+ (offset + start - pv->start() + pv->byteshift())));... | false | false | false | false | false | 0 |
swan_find_upgrade_file(const char *tmp_file)
{
unsigned int i;
int ret;
const char *dev_list[] = {SDCARD_DEVICE "p1", SDCARD_DEVICE, EMMC_DEVICE "p1", EMMC_DEVICE};
system_command("rm /tmp/* %s -rf", tmp_file);
for (i = 0; i < ARRAY_SIZE(dev_list); i++)
{
ret = swan_find_upgrade_file_from(dev_list[i], tmp_fil... | false | false | false | false | false | 0 |
slotFileClose()
{
if(m_currentDatabase)
{
// Don't remove Clipboard
if(databaseInfo()->IsLoaded())
{
if(QuerySaveDatabase())
{
m_openingTreeWidget->cancel(false);
m_databaseList->setFileClose(databaseInfo()->filePath(), databaseInfo... | false | false | false | false | false | 0 |
instantiate_scev_1 (basic_block instantiate_below,
struct loop *evolution_loop, struct loop *inner_loop,
tree chrec,
bool fold_conversions, htab_t cache, int size_expr)
{
tree op0 = instantiate_scev_r (instantiate_below, evolution_loop,
inner_loop, TREE_OPERAND (chrec, 0),
fold_conversions... | false | false | false | false | false | 0 |
LTsolve(const MAT *L, const VEC *b, VEC *out, double diag)
#endif
{
unsigned int dim;
int i, i_lim;
Real **L_me, *b_ve, *out_ve, tmp, invdiag, tiny;
if ( ! L || ! b )
error(E_NULL,"LTsolve");
dim = min(L->m,L->n);
if ( b->dim < dim )
error(E_SIZES,"LTsolve");
out = v_resi... | false | false | false | true | false | 1 |
paramsToParameters(Params params, FLANNParameters* p)
{
if (params.find("checks")!=params.end()) {
p->checks = (int)params["checks"];
}
if (params.find("cb_index")!=params.end()) {
p->cb_index = (int)params["cb_index"];
}
if (params.find("trees")!=params.end()... | false | false | false | false | false | 0 |
_basic_apply(E_Config_Dialog *dialog, E_Config_Dialog_Data *cfdata)
{
E_Mixer_Gadget_Config *conf = dialog->data;
const char *card, *channel;
conf->lock_sliders = cfdata->lock_sliders;
conf->show_locked = cfdata->show_locked;
conf->keybindings_popup = cfdata->keybindings_popup;
conf->using_default = ... | false | false | false | false | false | 0 |
qmail_domains_init(void)
{
assume_local = getenv("CVM_QMAIL_ASSUME_LOCAL") != 0;
if (!str_copy2s(&vdomains_path, qmail_root, "/control/virtualdomains")
|| !str_copy2s(&locals_path, qmail_root, "/control/locals"))
return -1;
if (!load_locals()
|| !load_vdomains())
return -1;
return 0;
} | false | false | false | false | false | 0 |
_swrast_feedback_line(struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1)
{
GLenum token = GL_LINE_TOKEN;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (swrast->StippleCounter == 0)
token = GL_LINE_RESET_TOKEN;
_mesa_feedback_token(ctx, (GLfloat) (GLint) token);
i... | false | false | false | false | false | 0 |
percentage_color_of(value, max, color_options)
int value, max;
const struct percent_color_option *color_options;
{
if (color_options == NULL) {
struct color_option result = {NO_COLOR, 0};
return result;
}
if (100 * value <= color_options->percentage * max)
return color_options->color_option;
return percentage... | false | false | false | false | false | 0 |
cs35l32_handle_of_data(struct i2c_client *i2c_client,
struct cs35l32_platform_data *pdata)
{
struct device_node *np = i2c_client->dev.of_node;
unsigned int val;
if (of_property_read_u32(np, "cirrus,sdout-share", &val) >= 0)
pdata->sdout_share = val;
of_property_read_u32(np, "cirrus,boost-manager", &val)... | 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.