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 |
|---|---|---|---|---|---|---|
InsertPreCalculatedScores(
const TargetPhrase& targetPhrase, ScoreComponentCollection* scoreBreakdown) const
{
boost::unordered_map<TargetPhrase,ScoreComponentCollection>::const_iterator scoreIter =
m_precalculatedScores.find(targetPhrase);
if (scoreIter != m_precalculatedScores.end()) {
scoreBreakdow... | false | false | false | false | false | 0 |
GC_allochblk(size_t sz, int kind, unsigned flags/* IGNORE_OFF_PAGE or 0 */)
{
word blocks;
int start_list;
struct hblk *result;
int may_split;
int split_limit; /* Highest index of free list whose blocks we */
/* split. */
GC_ASS... | false | false | false | false | false | 0 |
Attribute_dealloc(PyObject *self)
{
Py_DECREF(((AttributeObject*)self)->time);
Py_TYPE(self)->tp_free((PyObject *)self);
} | false | false | false | false | false | 0 |
OnIdle(wxIdleEvent& event)
// ----------------------------------------------------------------------------
{
event.Skip();
// Focus the new selected editor. This doesn't work if a long compile
// is active since there's no idle time. User will have to click into
// the editor window to activate it.
... | false | false | false | false | false | 0 |
read_pk0304_header(const gar_gfile_t *gf, pk0304_header_t *hdr,
jmp_buf env) {
byte_t s[30];
size_t n;
// Try to read the next PK0304 chunk header (local file header).
n = gar_gfile_read(gf, s, sizeof(s), env);
if (n < sizeof(s) || memcmp(s, "PK\3\4", 4)) {
return 0; // the... | false | false | false | false | false | 0 |
parseType (tokenInfo *const token)
{
tokenInfo* const id = newToken ();
copyToken (id, token);
readToken (token);
if (isType (token, TOKEN_COLON)) /* check for "{entity: TYPE}" */
{
readToken (id);
readToken (token);
}
if (isKeyword (id, KEYWORD_like))
{
if (isType (token, TOKEN_IDENTIFIER) ||
isKeyw... | false | false | false | false | false | 0 |
DeleteStateMachine()
{
delete si_GridStates[GRID_STATE_INVALID];
delete si_GridStates[GRID_STATE_ACTIVE];
delete si_GridStates[GRID_STATE_IDLE];
delete si_GridStates[GRID_STATE_REMOVAL];
} | false | false | false | false | false | 0 |
SVG_AttachStream(GF_BaseDecoder *plug, GF_ESD *esd)
{
const char *sOpt;
GF_BitStream *bs;
SVGIn *svgin = (SVGIn *)plug->privateStack;
if (esd->decoderConfig->upstream) return GF_NOT_SUPPORTED;
svgin->loader.type = GF_SM_LOAD_SVG;
/* decSpecInfo is not null only when reading from an SVG file (local or distant, ca... | false | false | false | false | false | 0 |
_backup_orc_audio_convert_pack_s32_double_swap (OrcExecutor * ORC_RESTRICT ex)
{
int i;
int n = ex->n;
orc_union64 * ORC_RESTRICT ptr0;
const orc_union32 * ORC_RESTRICT ptr4;
orc_union32 var33;
#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
volatile orc_union64 var34;
... | false | false | false | false | false | 0 |
axis_add_grid() {
for (int i = 1; i <= 2; i++) {
if (xxgrid[i]) {
double len = axis_horizontal(i) ? ylength : xlength;
if (!xx[i].hasGridOnTop()) xx[i].setGrid(true);
xx[i].ticks_length = len;
xx[i+2].ticks_off = true;
if (xx[i].subticks_length == 0.0) {
xx[i].subticks_length = len;
xx[i+2].su... | false | false | false | false | false | 0 |
rad_copy_variable(char *to, const char *from)
{
int length = 0;
int sublen;
*(to++) = *(from++);
length++;
while (*from) {
switch (*from) {
case '"':
case '\'':
sublen = rad_copy_string(to, from);
if (sublen < 0) return sublen;
from += sublen;
to += sublen;
length += sublen;
break;
cas... | false | false | false | false | false | 0 |
LexInit(const wxString& pszInput)
{
_pszLexStr = strdup(unicode2UTF8(pszInput));
_pszLexBuff = _pszLexStr;
} | false | false | false | false | false | 0 |
dump_battery(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) {
if (hardware->dmi.battery.filled == false) {
CREATE_NEW_OBJECT;
add_s("dmi.warning","no battery structure found");
FLUSH_OBJECT;
return;
}
CREATE_NEW_OBJECT;
add_s("dmi.item","battery");
add_hs(dmi.battery.manufacturer);
a... | false | false | false | false | false | 0 |
write_data_all(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
for (int j = i; j <= atom->ntypes; j++)
fprintf(fp,"%d %d %g %g %g %g\n",i,j,
epsilon[i][j],sigma[i][j],eps14[i][j],sigma14[i][j]);
} | false | false | false | false | false | 0 |
fail(std::string message)
{
try {
callback.fail(message);
delete this;
} catch (...) {
delete this;
LIBMAIL_THROW(LIBMAIL_THROW_EMPTY);
}
} | false | false | false | false | false | 0 |
rssyl_item_new(Folder *folder)
{
RSSylFolderItem *ritem;
debug_print("RSSyl: item_new\n");
ritem = g_new0(RSSylFolderItem, 1);
ritem->url = NULL;
ritem->default_refresh_interval = TRUE;
ritem->default_expired_num = TRUE;
ritem->fetch_comments = FALSE;
ritem->fetch_comments_for = -1;
ritem->silent_update = 0... | false | false | false | false | false | 0 |
CallSyscacheCallbacks(int cacheid, ItemPointer tuplePtr)
{
int i;
for (i = 0; i < syscache_callback_count; i++)
{
struct SYSCACHECALLBACK *ccitem = syscache_callback_list + i;
if (ccitem->id == cacheid)
(*ccitem->function) (ccitem->arg, cacheid, tuplePtr);
}
} | false | false | false | false | false | 0 |
numericoid_validate(
const char *begin,
const char *end
)
{
int rc = 0; /* assume the value is valid */
int found_separator = 0;
const char *p = NULL;
if ((begin == NULL) || (end == NULL)) {
rc = 1;
goto exit;
}
/* Per RFC 4512:
*
* numericoid = number 1*( DOT number )
*/
/* one pass of this loo... | false | false | false | false | false | 0 |
smbfindint(int id, struct smbfnsint *list)
{
int sindex;
for (sindex = 0; list[sindex].name; sindex++)
if (list[sindex].id == id)
return(&list[sindex]);
return(&list[0]);
} | false | false | false | false | false | 0 |
unmarshalTypeCode(cdrStream &s)
{
TypeCode_offsetTable otbl;
TypeCode_base* tc = TypeCode_marshaller::unmarshal(s, &otbl);
TypeCode_collector::markLoopMembers(tc);
return tc;
} | false | false | false | false | false | 0 |
mnt_add_count(struct mount *mnt, int n)
{
#ifdef CONFIG_SMP
this_cpu_add(mnt->mnt_pcp->mnt_count, n);
#else
preempt_disable();
mnt->mnt_count += n;
preempt_enable();
#endif
} | false | false | false | false | false | 0 |
fso_gsm_at_channel_finalize (GObject* obj) {
FsoGsmAtChannel * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, FSO_GSM_TYPE_AT_CHANNEL, FsoGsmAtChannel);
_g_free0 (self->name);
_g_object_unref0 (self->priv->modem);
G_OBJECT_CLASS (fso_gsm_at_channel_parent_class)->finalize (obj);
} | false | false | false | false | false | 0 |
increase_font_size()
{
LOG(LOG_DEBUG, "IN : increase_font_size()");
font_resize(&fontset_normal, 1);
font_resize(&fontset_bold, 1);
font_resize(&fontset_superscript, 1);
font_resize(&fontset_italic, 1);
restart_main_window();
save_preference();
LOG(LOG_DEBUG, "OUT : increase_font_size()");
} | false | false | false | false | false | 0 |
drv_HD_quit(const int quiet)
{
info("%s: shutting down display.", Name);
drv_generic_text_quit();
drv_generic_gpio_quit();
/* clear display */
drv_HD_clear();
/* say goodbye... */
if (!quiet) {
drv_generic_text_greet("goodbye!", NULL);
}
drv_HD_stop();
return (0);
} | false | false | false | false | false | 0 |
count_pid(void)
{
DIR *dir;
struct dirent *drp;
unsigned int pid = 0;
/* Open /proc directory */
if ((dir = opendir(PROC)) == NULL) {
perror("opendir");
exit(4);
}
/* Get directory entries */
while ((drp = readdir(dir)) != NULL) {
if (isdigit(drp->d_name[0])) {
/* There is at least the TGID */
pid... | false | false | false | false | true | 1 |
scale(float* v, float p, int n)
{
for (int i=0; i<n; ++i)
v[i] = v[i] * p;
} | false | false | false | false | false | 0 |
istgt_lu_dvd_reset(ISTGT_LU_Ptr lu, int lun)
{
ISTGT_LU_DVD *spec;
int flags;
int rc;
if (lu == NULL) {
return -1;
}
if (lun >= lu->maxlun) {
return -1;
}
if (lu->lun[lun].type == ISTGT_LU_LUN_TYPE_NONE) {
return -1;
}
if (lu->lun[lun].type != ISTGT_LU_LUN_TYPE_REMOVABLE) {
return -1;
}
spec = (IST... | false | false | false | false | false | 0 |
lm85_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
struct device *dev = &client->dev;
struct device *hwmon_dev;
struct lm85_data *data;
int idx = 0;
data = devm_kzalloc(dev, sizeof(struct lm85_data), GFP_KERNEL);
if (!data)
return -ENOMEM;
data->client = client;
data->type = id->driver_... | false | false | false | false | false | 0 |
glusterd_volume_heal_use_rsp_dict (dict_t *rsp_dict)
{
int ret = 0;
dict_t *ctx_dict = NULL;
glusterd_op_t op = GD_OP_NONE;
GF_ASSERT (rsp_dict);
op = glusterd_op_get_op ();
GF_ASSERT (GD_OP_HEAL_VOLUME == op);
ctx_dict = glusterd_... | false | false | false | false | false | 0 |
pdf14_cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state * pis,
gx_device * dev, gs_color_select_t select)
{
int i, ncomps = dev->color_info.num_components;
bool additive = dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE;
frac comp_value = all;
frac cm_... | false | false | false | false | false | 0 |
pmc_reprogram_counter(struct kvm_pmc *pmc, u32 type,
unsigned config, bool exclude_user,
bool exclude_kernel, bool intr,
bool in_tx, bool in_tx_cp)
{
struct perf_event *event;
struct perf_event_attr attr = {
.type = type,
.size = sizeof(attr),
.pinned = true,
.exclude_idle = true,
.exclude... | false | false | false | false | false | 0 |
fill_goto_sprite_array(const struct tileset *t,
struct drawn_sprite *sprs,
const struct tile *ptile,
const struct tile_edge *pedge,
const struct tile_corner *pcorner)
{
struct drawn_sprite *saved_sprs = sprs;
if (is_valid_goto_destination(ptile)) {
bool warn= FALSE;
int length;
... | true | true | false | false | false | 1 |
H5D__nonexistent_readvv_cb(hsize_t UNUSED dst_off, hsize_t src_off, size_t len,
void *_udata)
{
H5D_chunk_readvv_ud_t *udata = (H5D_chunk_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */
H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */
hbool_t fb_info_init = FALSE; /* Whet... | false | false | false | false | false | 0 |
mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount,
bool is_rel_write)
{
struct mmc_command cmd = {0};
cmd.opcode = MMC_SET_BLOCK_COUNT;
cmd.arg = blockcount & 0x0000FFFF;
if (is_rel_write)
cmd.arg |= 1 << 31;
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
return mmc_wait_for_cmd(card-... | false | false | false | false | false | 0 |
directory_find_client_side(string_ty *client_side)
{
if (!dir_info_cs)
return 0;
return (directory_ty *)dir_info_cs->query(client_side);
} | false | false | false | false | false | 0 |
make_function_proc(i_ctx_t *i_ctx_p, ref *op, gs_function_t *pfn)
{
ref cref; /* closure */
int code;
code = ialloc_ref_array(&cref, a_executable | a_execute, 2,
".buildfunction");
if (code < 0)
return code;
make_istruct_new(cref.value.refs, a_executable | a_ex... | false | false | false | false | false | 0 |
init_rolling_window(std::list<std::string>& rolling_window, std::ifstream& memory_file) const
{
std::string token;
int count = 0;
// following while test relies on the fact that if first condition
// is true, then the second condition will not be evaluated: in
// other words, a token will not be rea... | false | false | false | false | false | 0 |
sgen_pin_stats_register_global_remset (GCObject *obj)
{
GlobalRemsetClassEntry empty_entry;
GlobalRemsetClassEntry *entry;
if (!do_pin_stats)
return;
memset (&empty_entry, 0, sizeof (GlobalRemsetClassEntry));
entry = (GlobalRemsetClassEntry *)lookup_vtable_entry (&global_remset_class_hash_table, SGEN_LOAD_VTAB... | false | false | false | false | false | 0 |
sashimi_timeout (sashimiConnection* conn, guint timeout)
{
g_return_if_fail(conn != NULL);
g_mutex_lock(conn->mutex);
conn->timeout = timeout;
g_mutex_unlock(conn->mutex);
} | false | false | false | false | false | 0 |
xTree_node_first_key(struct fsck_Xtree_info *xtiptr,
struct fsck_inode_record *inorecptr,
struct fsck_ino_msg_info *msg_info_ptr,
int desired_action)
{
int xnfk_rc = FSCK_OK;
/*
* the key in the 1st xad must match the key in the parent
* node's xad describing this node
*/
if (xtiptr->this_Qel->node... | false | false | false | false | false | 0 |
Create_Tiled_File(
const char* pifile, const char* tiledfile, int twidth, int theight
) {
PortableImageHelper* pih;
int width, height;
boolean compressed;
boolean tiled;
int xbeg, xend, ybeg, yend;
int ignore;
if ((twidth < 10) || (theight < 10)) {
return "tile dimensions must ... | false | false | false | false | false | 0 |
rtw_alloc_xmitframe23a_ext(struct xmit_priv *pxmitpriv)
{
struct xmit_frame *pxframe = NULL;
struct list_head *plist, *phead;
struct rtw_queue *queue = &pxmitpriv->free_xframe_ext_queue;
spin_lock_bh(&queue->lock);
if (list_empty(&queue->queue)) {
RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
"rtw_alloc_xm... | false | false | false | false | false | 0 |
clear_sheet (SheetObject *so, GOUndo **pundo)
{
if (pundo) {
GOUndo *u = go_undo_binary_new
(g_object_ref (so),
so->sheet,
(GOUndoBinaryFunc)sheet_object_set_sheet,
(GFreeFunc) g_object_unref,
NULL);
*pundo = go_undo_combine (*pundo, u);
}
sheet_object_clear_sheet (so);
} | false | false | false | false | false | 0 |
gs_cspace_indexed_lookup_bytes(const gs_color_space *pcs, float index_float,
unsigned char *output)
{
const gs_indexed_params *pip = &pcs->params.indexed;
const gs_color_space *pbcs = pcs->base_space;
int m = cs_num_components(pbcs);
int index;
index = (is_fneg(index_float) ... | false | false | false | false | false | 0 |
__arch_prctl (int code, uintptr_t *addr)
{
int res;
uint64_t addr64;
void *prctl_arg = addr;
switch (code)
{
case ARCH_GET_FS:
case ARCH_GET_GS:
prctl_arg = &addr64;
break;
}
res = INLINE_SYSCALL (arch_prctl, 2, code, prctl_arg);
if (res == 0)
switch (code)
{
ca... | false | false | false | false | false | 0 |
seekContextNix(seekContext *sctx) {
if (sctx) {
airFree(sctx->flag);
sctx->flag = NULL;
sctx->_shape = gageShapeNix(sctx->_shape);
sctx->nsclDerived = nrrdNuke(sctx->nsclDerived);
sctx->nspanHist = nrrdNuke(sctx->nspanHist);
sctx->range = nrrdRangeNix(sctx->range);
sctx->nvidx = nrrdNuke(... | false | false | false | false | false | 0 |
Initialize(Handle<Object> target) {
StreamWrap::Initialize(target);
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
t->SetClassName(String::NewSymbol("Pipe"));
t->InstanceTemplate()->SetInternalFieldCount(1);
NODE_SET_PROTOTYPE_METHOD(t, "close", HandleWrap::Close);
NODE_SET... | false | false | false | false | false | 0 |
showInfoForJob(QTableWidgetItem * item)
{
QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(this);
int row = item->row();
QString jobid = tableJob->item(row, 0)->text();
new Job(jobid, pageSelectorTreeWidgetItem);
// connect(j, SIGNAL(destroyed()), this, SLOT(populateTree()));
} | false | false | false | false | false | 0 |
doCancel(QUndoCommand * parentCommand) {
emit setProgressMessage(tr("Routing canceled! Now cleaning up..."));
ProcessEventBlocker::processEvents();
restoreOriginalState(parentCommand);
cleanUpNets();
} | false | false | false | false | false | 0 |
efx_change_mtu(struct net_device *net_dev, int new_mtu)
{
struct efx_nic *efx = netdev_priv(net_dev);
int rc;
rc = efx_check_disabled(efx);
if (rc)
return rc;
if (new_mtu > EFX_MAX_MTU)
return -EINVAL;
netif_dbg(efx, drv, efx->net_dev, "changing MTU to %d\n", new_mtu);
efx_device_detach_sync(efx);
efx_st... | false | false | false | false | false | 0 |
search_gui_remove_record(record_t *rc)
{
results_set_t *rs;
record_check(rc);
g_assert(0 == rc->refcount);
rs = rc->results_set;
results_set_check(rs);
rc->results_set = NULL;
g_assert(rs->num_recs > 0);
g_assert(rs->records);
rs->records = g_slist_remove(rs->records, rc);
rs->num_recs--;
if (... | false | false | false | false | false | 0 |
PrintDebugInfo(const char* msg, DebugPrintingLevel debugPrintingLevel)
{
if(enableDebugInfoPrinting == true)
debugPrintCallback.Execute(msg);
} | false | false | false | false | false | 0 |
vnc_mpi_to_bytes(const gcry_mpi_t value, guchar* result, size_t size)
{
gcry_error_t error;
size_t len;
int i;
error = gcry_mpi_print(GCRYMPI_FMT_USG, result, size, &len, value);
if (gcry_err_code (error) != GPG_ERR_NO_ERROR) {
VNC_DEBUG ("MPI error: %s", gcry_strerror (error));
abo... | false | false | false | false | false | 0 |
SendReadyUpdate(unsigned eventIndex, unsigned systemIndex, bool forceIfNotDefault)
{
ReadyEventNode *ren = readyEventNodeList[eventIndex];
RakNet::BitStream bs;
// I do this rather than write true or false, so users that do not use BitStreams can still read the data
if ((ren->eventStatus!=ren->systemList[syste... | false | false | false | false | false | 0 |
lookdict_unicode_nodummy(PyDictObject *mp, PyObject *key,
Py_hash_t hash, PyObject ***value_addr)
{
size_t i;
size_t perturb;
size_t mask = DK_MASK(mp->ma_keys);
PyDictKeyEntry *ep0 = &mp->ma_keys->dk_entries[0];
PyDictKeyEntry *ep;
/* Make sure this function doesn't ha... | false | false | false | false | false | 0 |
gt_sequence_buffer_gb_free(GtSequenceBuffer *sb)
{
GtSequenceBufferGB *sbe = gt_sequence_buffer_gb_cast(sb);
if (sb->pvt->inputstream)
gt_file_delete(sb->pvt->inputstream);
gt_str_delete(sbe->headerbuffer);
gt_str_delete(sbe->overflowbuffer);
gt_str_delete(sbe->keywordbuffer);
} | false | false | false | false | false | 0 |
m68hc11_find_z_replacement (insn, info)
rtx insn;
struct replace_info *info;
{
int reg;
info->replace_reg = NULL_RTX;
info->must_load_z = 1;
info->need_save_z = 1;
info->must_save_reg = 1;
info->must_restore_reg = 1;
info->first = insn;
info->x_used = 0;
info->y_used = 0;
info->can_use_d ... | false | false | false | false | false | 0 |
ffppru( fitsfile *fptr, /* I - FITS file pointer */
long group, /* I - group to write(1 = 1st group) */
LONGLONG firstelem, /* I - first vector element to write(1 = 1st) */
LONGLONG nelem, /* I - number of values to write */
... | false | false | false | false | false | 0 |
regmap_name_read_file(struct file *file,
char __user *user_buf, size_t count,
loff_t *ppos)
{
struct regmap *map = file->private_data;
int ret;
char *buf;
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!buf)
return -ENOMEM;
ret = snprintf(buf, PAGE_SIZE, "%s\n", map->dev->driver->name);
if (ret ... | false | false | false | false | false | 0 |
assert_all_refnames_match(git_vector *output)
{
size_t i;
git_reference *ref;
cl_assert_equal_sz(output->length, ARRAY_SIZE(refnames));
git_vector_sort(output);
git_vector_foreach(output, i, ref) {
cl_assert_equal_s(ref->name, refnames[i]);
git_reference_free(ref);
}
git_vector_free(output);
} | false | false | false | false | false | 0 |
manipulating (const Event& e, Tool31& tool) {
boolean flag = true;
long count = _gr_list->count();
Coord l, b, r, t;
Window* w = e.window();
Canvas* c = w->canvas();
for (long i = 0; i < count && flag; i++) {
Graphic31* target = _gr_list->item(i);
target->getbounds(l, b, r, t);
... | false | false | false | false | false | 0 |
dounset(trp)
syntaxtree *trp;
{
char **argv;
int i, n, len, ret;
argv = (trp -> comm) -> argv;
ret = RET_SUCCESS;
for (i = 1; i < (trp -> comm) -> argc; i++) {
len = strlen(argv[i]);
if (getshellvar(argv[i], len)) n = unset(argv[i], len);
else n = unsetshfunc(argv[i], len);
if (n < 0) {
ret = RET_FAIL;... | false | false | false | false | false | 0 |
divide(void *a, void *b, void *c, void *d)
{
LTC_ARGCHK(a != NULL);
LTC_ARGCHK(b != NULL);
return mpi_to_ltc_error(mp_div(a, b, c, d));
} | false | false | false | false | false | 0 |
windfall_benefit(const struct city *src,
const struct city *dest,
const struct caravan_parameter *param) {
if (!param->consider_windfall || !can_cities_trade(src, dest)) {
return 0;
}
else {
int bonus = get_caravan_enter_city_trade_bonus(src, d... | false | false | false | false | false | 0 |
pcap_daq_get_capabilities(void *handle)
{
Pcap_Context_t *context = (Pcap_Context_t *) handle;
uint32_t capabilities = DAQ_CAPA_BPF;
if (context->device)
capabilities |= DAQ_CAPA_INJECT;
capabilities |= DAQ_CAPA_BREAKLOOP;
if (!context->delayed_open)
capabilities |= DAQ_CAPA_UNPRI... | false | false | false | false | false | 0 |
gm_get_sentence_if_trivial_sentblock(ast_sent* s)
{
if (s->get_nodetype() == AST_SENTBLOCK)
{
ast_sent* t;
if (gm_is_sentblock_trivial((ast_sentblock*) s, t))
{
return t;
}
}
return s;
} | false | false | false | false | false | 0 |
execute( vector< string > & argv,
string & out )
{
if( argv.size() < 1)
out += "usage: " + usage() + "\n";
else if( commands.find( argv[0] ) == commands.end() )
// command doesn't exist
out += "error: vm " + argv[0] + ": command not found\n";
e... | false | false | false | false | false | 0 |
_mobj_parse_object(BITSTREAM *bs, MOBJ_OBJECT *obj)
{
int i;
obj->resume_intention_flag = bs_read(bs, 1);
obj->menu_call_mask = bs_read(bs, 1);
obj->title_search_mask = bs_read(bs, 1);
bs_skip(bs, 13); /* padding */
obj->num_cmds = bs_read(bs, 16);
obj->cmds = calloc(obj->num_cmds, si... | false | false | false | false | false | 0 |
IsUpperTriangular_op (GelCtx *ctx, GelETree * * a, gboolean *exception)
{
int i,j,w;
GelMatrixW *m;
if G_UNLIKELY ( ! check_argument_square_matrix (a, 0, "IsUpperTriangular"))
return NULL;
m = a[0]->mat.matrix;
w = gel_matrixw_width (m);
for (j = 1; j < w; j++) {
for (i = 0; i < j; i++) {
GelETree *node... | false | false | false | false | false | 0 |
getrest(std::string&s)
{
while (C && (C == ' ' || C == 9 || issplit(C)))
pa_the_ptr++;
s = (pa_the_ptr < pa_the_str.size()) ? pa_the_str.substr(pa_the_ptr) : "";
} | false | false | false | false | false | 0 |
gigaset_isdn_rcv_err(struct bc_state *bcs)
{
/* if currently ignoring packets, just count down */
if (bcs->ignore) {
bcs->ignore--;
return;
}
/* update statistics */
bcs->corrupted++;
/* ToDo: signal error -> LL */
} | false | false | false | false | false | 0 |
clean_encoding_name(const char *key, char *newkey)
{
const char *p;
char *np;
for (p = key, np = newkey; *p != '\0'; p++)
{
if (isalnum((unsigned char) *p))
{
if (*p >= 'A' && *p <= 'Z')
*np++ = *p + 'a' - 'A';
else
*np++ = *p;
}
}
*np = '\0';
return newkey;
} | false | false | false | false | false | 0 |
write_sysex_contents(smf_event_t *event)
{
int ret;
unsigned char sysex_status = 0xF0;
assert(smf_event_is_sysex(event));
ret = track_append(event->track, &sysex_status, 1);
if (ret)
return (ret);
/* -1, because length does not include status byte. */
ret = write_vlq(event, event->midi_buffer_length - 1);
... | false | false | false | false | false | 0 |
device_gpadc_init(struct pm80x_chip *chip,
struct pm80x_platform_data *pdata)
{
struct pm80x_subchip *subchip = chip->subchip;
struct regmap *map = subchip->regmap_gpadc;
int data = 0, mask = 0, ret = 0;
if (!map) {
dev_warn(chip->dev,
"Warning: gpadc regmap is not available!\n");
return -EINVAL... | false | false | false | false | false | 0 |
appendAngularJoint(const AJoint::Specs& specs,Cluster* body0,Body body1)
{
AJoint* pj = new(btAlignedAlloc(sizeof(AJoint),16)) AJoint();
pj->m_bodies[0] = body0;
pj->m_bodies[1] = body1;
pj->m_refs[0] = pj->m_bodies[0].xform().inverse().getBasis()*specs.axis;
pj->m_refs[1] = pj->m_bodies[1].xform().inverse().getB... | false | false | false | false | false | 0 |
domsg(BASE *b, unsigned char *s, void *object, int *notify)
{
if (notify)
*notify = 1;
strlcpy((char *)msgbuf, (char *)s, JOE_MSGBUFSIZE);
vsrm(s);
msgnw(b->parent, *msgbuf ? msgbuf : NULL);
return 0;
} | false | false | false | false | false | 0 |
find_lflf(char *c)
{
for (c = strchr(c, '\n') ; c ; c = strchr(c, '\n'))
if (*++c == '\n')
return c;
return NULL;
} | false | false | false | false | false | 0 |
em28xx_pctv_290e_set_lna(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct em28xx_i2c_bus *i2c_bus = fe->dvb->priv;
struct em28xx *dev = i2c_bus->dev;
#ifdef CONFIG_GPIOLIB
struct em28xx_dvb *dvb = dev->dvb;
int ret;
unsigned long flags;
if (c->lna == 1)
flags = GP... | false | false | false | false | false | 0 |
dm_SQL_W2A (SQLWCHAR * inStr, ssize_t size)
{
SQLCHAR *outStr = NULL;
size_t len;
if (inStr == NULL)
return NULL;
if (size == SQL_NTS)
len = wcslen (inStr);
else
len = size;
if (len < 0)
return NULL;
if ((outStr = (SQLCHAR *) malloc (len * UTF8_MAX_CHAR_LEN + 1)) != NULL)
{
i... | false | true | false | false | false | 1 |
push_scope (pIIR_DeclarativeRegion s)
{
s->declarative_region = cur_scope;
cur_scope = s;
decls_in_flight(s).init();
if (s->is(IR_SUBPROGRAM_DECLARATION))
cur_body = pIIR_SubprogramDeclaration(s);
} | false | false | false | false | false | 0 |
readqueue() {
if (obj_tail==obj_head) return 0;
Fl_Widget *o = obj_queue[obj_tail++];
if (obj_tail >= QUEUE_SIZE) obj_tail = 0;
return o;
} | false | false | false | false | false | 0 |
linevector_free (struct linevector *vec)
{
unsigned int ln;
if (vec->vector != NULL)
{
for (ln = 0; ln < vec->nlines; ++ln)
if (--vec->vector[ln]->refcount == 0)
free (vec->vector[ln]);
free (vec->vector);
}
} | false | false | false | false | true | 1 |
sim_fini(struct _memory_segment *s)
{
TRACE("starting.\n");
free(s->data);
free(s->name);
TRACE("done.\n");
} | false | false | false | false | false | 0 |
anthy_xstrcmp_with_ondisk(xstr *xs,
ondisk_xstr *dxs)
{
int *d = (int *)dxs;
int len = anthy_dic_ntohl(d[0]);
int i;
xchar c;
if (len != xs->len) {
return 1;
}
d++;
for (i = 0; i < len; i++) {
c = anthy_dic_ntohl(d[i]);
if (xs->str[i] != c) {
return 1;
}
}
return 0;
} | false | false | false | false | false | 0 |
opal_hash_table_get_value_ptr(opal_hash_table_t* ht, const void* key,
size_t key_size, void **ptr)
{
opal_list_t* list = ht->ht_table + opal_hash_value(ht->ht_mask, key,
key_size);
opal_ptr_hash_node_t *node;
#if OPAL_ENABLE_DEBUG
if(ht->ht_tabl... | false | false | false | false | false | 0 |
extend_outfile_size()
{
if( min_outfile_size > 0 || sparse_size > 0 )
{
const long long min_size = std::max( min_outfile_size, sparse_size );
const long long size = lseek( odes_, 0, SEEK_END );
if( size < 0 ) return false;
if( min_size > size )
{
const uint8_t zero = 0;
if( wri... | false | false | false | false | false | 0 |
isd200_init_info(struct us_data *us)
{
struct isd200_info *info;
info = kzalloc(sizeof(struct isd200_info), GFP_KERNEL);
if (!info)
return ISD200_ERROR;
info->id = kzalloc(ATA_ID_WORDS * 2, GFP_KERNEL);
info->RegsBuf = kmalloc(sizeof(info->ATARegs), GFP_KERNEL);
info->srb.sense_buffer = kmalloc(SCSI_SENSE_BUF... | false | false | false | false | false | 0 |
test_chgat(void)
{
STATUS st;
init_status(stdscr, &st);
do {
switch (st.ch) {
case '.': /* change from current position */
chgat(st.count, st.attr, st.pair, (void *) 0);
touch_if_needed(stdscr, st.y_val);
break;
case ',': /* change from beginning of window */
mvchgat(0, 0, st.coun... | false | false | false | false | false | 0 |
smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
{
/* This check is no longer done by usbnet */
if (skb->len < dev->net->hard_header_len)
return 0;
while (skb->len > 0) {
u32 rx_cmd_a, rx_cmd_b, align_count, size;
struct sk_buff *ax_skb;
unsigned char *packet;
memcpy(&rx_cmd_a, skb->data, sizeo... | false | false | false | false | false | 0 |
g_vfs_backend_ftp_use_workaround (GVfsBackendFtp * ftp,
GVfsFtpWorkaround workaround)
{
int cur, set;
g_return_if_fail (G_VFS_IS_BACKEND_FTP (ftp));
g_return_if_fail (workaround < 32);
set = 1 << workaround;
while (((cur = g_atomic_int_get (&ftp->workarounds)) & set) == 0 ... | false | false | false | false | false | 0 |
is_gen9_shadowed(struct drm_i915_private *dev_priv, u32 reg)
{
int i;
for (i = 0; i < ARRAY_SIZE(gen9_shadowed_regs); i++)
if (reg == gen9_shadowed_regs[i])
return true;
return false;
} | false | false | false | false | false | 0 |
expand_envnames(struct work_queue_worker *w, const char *payload)
{
char *expanded_name;
char *str, *curr_pos;
char *delimtr = "$";
char *token;
str = xxstrdup(payload);
expanded_name = (char *) malloc(strlen(payload) + (50 * sizeof(char)));
if(expanded_name == NULL) {
return NULL;
} else {
//Initialize t... | false | false | false | false | false | 0 |
convert_to_git(const char *path, const char *src, size_t len,
struct strbuf *dst, enum safe_crlf checksafe)
{
struct git_attr_check check[3];
int crlf = CRLF_GUESS;
int ident = 0, ret = 0;
const char *filter = NULL;
setup_convert_check(check);
if (!git_checkattr(path, ARRAY_SIZE(check), check)... | false | false | false | false | false | 0 |
inf_text_gtk_view_set_view(InfTextGtkView* view,
GtkTextView* gtk_view)
{
InfTextGtkViewPrivate* priv;
priv = INF_TEXT_GTK_VIEW_PRIVATE(view);
if(priv->textview != NULL)
{
inf_signal_handlers_disconnect_by_func(
G_OBJECT(priv->textview),
#if GTK_CHECK_VERSION(2, 91, 0)
... | false | false | false | false | false | 0 |
astro_sunpos(double d, double *lon, double *r)
{
double M, /* Mean anomaly of the Sun */
w, /* Mean longitude of perihelion */
/* Note: Sun's mean longitude = M + w */
e, /* Eccentricity of Earth's orbit */
E, /* Eccentric anomaly */
x,... | false | false | false | false | false | 0 |
convert_menus_finished (GladeProject *project,
ConvertData *data)
{
GList *l;
GladeWidget *widget, *accel_group = NULL;
GladeProperty *property;
for (l = data->menus; l; l = l->next)
{
widget = l->data;
property = glade_widget_get_property (widget, "accel-group");
if (accel_group == NULL)
{
Glad... | false | false | false | false | false | 0 |
webcamMakeVideoDisplayLink()
{
GnashWebcamPrivate* webcam = _globalWebcam;
if (gst_bin_get_by_name(GST_BIN(webcam->_pipeline), "video_display_bin") == NULL) {
gst_object_ref(webcam->_videoDisplayBin);
gst_bin_add (GST_BIN(webcam->_pipeline), webcam->_videoDisplayBin);
}
GstPad *v... | false | false | false | false | false | 0 |
bufferevent_rate_limit_group_new(struct event_base *base,
const struct ev_token_bucket_cfg *cfg)
{
struct bufferevent_rate_limit_group *g;
struct timeval now;
ev_uint32_t tick;
event_base_gettimeofday_cached(base, &now);
tick = ev_token_bucket_get_tick_(&now, cfg);
g = mm_calloc(1, sizeof(struct bufferevent... | false | false | false | false | false | 0 |
cx23885_video_dev_alloc(
struct cx23885_tsport *tsport,
struct pci_dev *pci,
struct video_device *template,
char *type)
{
struct video_device *vfd;
struct cx23885_dev *dev = tsport->dev;
dprintk(1, "%s()\n", __func__);
vfd = video_device_alloc();
if (NULL == vfd)
return NULL;
*vfd = *template;
snprintf(v... | false | false | false | true | false | 1 |
GDALGetCacheMax64()
{
if( !bCacheMaxInitialized )
{
const char* pszCacheMax = CPLGetConfigOption("GDAL_CACHEMAX",NULL);
bCacheMaxInitialized = TRUE;
if( pszCacheMax != NULL )
{
GIntBig nNewCacheMax = (GIntBig)CPLScanUIntBig(pszCacheMax, strlen(pszCacheMax));
... | 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.