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 |
|---|---|---|---|---|---|---|
BlastGC_ForwardBigObj (
heap_t *heap,
ml_val_t *p,
ml_val_t obj,
aid_t aid)
{
int i;
bigobj_region_t *region;
bigobj_desc_t *dp;
embobj_info_t *codeInfo;
for (i = BIBOP_ADDR_TO_INDEX(obj); !BO_IS_HDR(aid); aid = BIBOP[--i])
continue;
region = (bigobj_... | false | false | false | false | false | 0 |
gst_matroska_read_common_do_index_seek (GstMatroskaReadCommon * common,
GstMatroskaTrackContext * track, gint64 seek_pos, GArray ** _index,
gint * _entry_index, gboolean next)
{
GstMatroskaIndex *entry = NULL;
GArray *index;
if (!common->index || !common->index->len)
return NULL;
/* find entry jus... | false | false | false | false | false | 0 |
make_socket_pair()
{
int sockets_in[2];
int sockets_out[2];
FILE *fp1, *fp2;
object stream_in, stream_out, stream;
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets_in) < 0)
FEerror("Failure to open socket stream pair", 0);
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets_out) < 0)
FEerror("Failure to... | false | false | false | false | false | 0 |
request_data(const DjVuPort *src, const GURL & url)
{
if (url!=stream_url)
G_THROW( ERR_MSG("DjVuImage.not_decode") );
return stream_pool;
} | false | false | false | false | false | 0 |
ecryptfs_send_miscdev(struct ecryptfs_miscdev_ctx *miscdev_ctx,
struct ecryptfs_message *msg, uint8_t msg_type,
uint16_t msg_flags, uint32_t msg_seq)
{
uint32_t miscdev_msg_data_size;
size_t packet_len_size;
size_t packet_len;
uint32_t msg_seq_be32;
uint32_t i;
ssize_t written;
char packet_len_str[3];
... | true | true | false | false | false | 1 |
do_build_copy_assign (tree fndecl)
{
tree parm = DECL_CHAIN (DECL_ARGUMENTS (fndecl));
tree compound_stmt;
bool move_p = move_fn_p (fndecl);
bool trivial = trivial_fn_p (fndecl);
int flags = LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED;
compound_stmt = begin_compound_stmt (0);
parm = convert_from... | false | false | false | false | false | 0 |
fm10k_dbg_desc_break(struct seq_file *s, int i)
{
while (i--)
seq_puts(s, "-");
seq_puts(s, "\n");
} | false | false | false | false | false | 0 |
test_online_clone__ssh_with_paths(void)
{
char *bad_paths[] = {
"/bin/yes",
"/bin/false",
};
char *good_paths[] = {
"/usr/bin/git-upload-pack",
"/usr/bin/git-receive-pack",
};
git_strarray arr = {
bad_paths,
2,
};
const char *remote_url = cl_getenv("GITTEST_REMOTE_URL");
const char *remote_user = c... | false | false | false | false | false | 0 |
initConnector(QDomElement & connector, const QHash<QString, QPointer<ConnectorShared> > & connectorHash)
{
QString id = connector.attribute("connectorId");
if (id.isNull()) return;
if (id.isEmpty()) return;
ConnectorShared * connectorShared = connectorHash.value(id);
if (connectorShared == NULL) {
DebugDial... | false | false | false | false | false | 0 |
ResvMaxBits(lame_global_flags const *gfp, int mean_bits, int *targ_bits, int *extra_bits, int cbr)
{
lame_internal_flags *const gfc = gfp->internal_flags;
int add_bits;
int ResvSize = gfc->ResvSize, ResvMax = gfc->ResvMax;
/* conpensate the saved bits used in the 1st granule */
if (cbr)
... | false | false | false | false | false | 0 |
tree_contains_unbindable(struct mount *mnt)
{
struct mount *p;
for (p = mnt; p; p = next_mnt(p, mnt)) {
if (IS_MNT_UNBINDABLE(p))
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
plugin_set_subtree_config(PluginTargetData *subtree_config, const char *val)
{
int status = 0;
if (strcasecmp (val, ALL_DATA) == 0) /* allow access to both local and remote data */
{
plugin_set_global (subtree_config);
}
else if (strcasecmp (val, LOCAL_DATA) == 0) /* allow access to all locally hosted data */
... | 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));
GridRemovalDlg *_t = static_cast<GridRemovalDlg *>(_o);
switch (_id) {
case 0: _t->slotLimitChange((*reinterpret_cast< bool(*)>(... | false | false | false | false | false | 0 |
_ssh_log(int verbosity,
const char *function,
const char *format, ...)
{
char buffer[1024];
va_list va;
if (verbosity <= ssh_get_log_level()) {
va_start(va, format);
vsnprintf(buffer, sizeof(buffer), format, va);
va_end(va);
ssh_log_function(verbo... | false | false | false | false | false | 0 |
list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t *text,
unsigned int *foundkeys)
{
char namestr[DNS_NAME_FORMATSIZE];
char creatorstr[DNS_NAME_FORMATSIZE];
isc_result_t result;
dns_rbtnodechain_t chain;
dns_name_t foundname;
dns_fixedname_t fixedorigin;
dns_name_t *origin;
dns_rbtnod... | false | false | false | false | false | 0 |
Load(const char* chrIn)
{
if (!chrIn)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(chrIn);
std::istringstream loadStream(chrIn);
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1];
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
{
if (m_auiEncounter[i] =... | false | false | false | false | false | 0 |
helper_array_has_prefix(char **longest, char **shortest)
{
unsigned int i;
for (i = 0; longest[i] && shortest[i]; i++)
if (strcmp(longest[i], shortest[i]))
return 0;
return (shortest[i] == NULL);
} | false | false | false | false | false | 0 |
emit_group_move (dst, src)
rtx dst, src;
{
int i;
if (GET_CODE (src) != PARALLEL
|| GET_CODE (dst) != PARALLEL
|| XVECLEN (src, 0) != XVECLEN (dst, 0))
abort ();
/* Skip first entry if NULL. */
for (i = XEXP (XVECEXP (src, 0, 0), 0) ? 0 : 1; i < XVECLEN (src, 0); i++)
emit_move_insn ... | false | false | false | false | false | 0 |
netsnmp_inject_handler_before(netsnmp_handler_registration *reginfo,
netsnmp_mib_handler *handler,
const char *before_what)
{
netsnmp_mib_handler *handler2 = handler;
if (handler == NULL || reginfo == NULL) {
snmp_log(LOG_ERR, "netsnmp_inject_... | false | false | false | false | false | 0 |
_echoRayIntx_Rectangle(RAYINTX_ARGS(Rectangle)) {
echoPos_t pvec[3], qvec[3], tvec[3], det, t, u, v, *edge0, *edge1, tmp;
AIR_UNUSED(tstate);
if (echoMatterLight == obj->matter
&& (ray->shadow || !parm->renderLights)) {
return AIR_FALSE;
}
edge0 = obj->edge0;
edge1 = obj->edge1;
TRI_INTX(ray, o... | false | false | false | false | false | 0 |
getSelectedCreature()
{
if (!m_session)
return NULL;
return m_session->GetPlayer()->GetMap()->GetAnyTypeCreature(m_session->GetPlayer()->GetSelectionGuid());
} | false | false | false | false | false | 0 |
slurmdb_str_2_cluster_flags(char *flags_in)
{
uint32_t cluster_flags = 0;
char *token, *my_flags, *last = NULL;
my_flags = xstrdup(flags_in);
token = strtok_r(my_flags, ",", &last);
while (token) {
cluster_flags |= _str_2_cluster_flags(token);
token = strtok_r(NULL, ",", &last);
}
xfree(my_flags);
return ... | false | false | false | false | false | 0 |
get_element(const String& aname) {
if(Value *result=VStateless_object::get_element(aname))
return result;
check_key(aname);
memcached_return rc;
Serialization_data data;
data.ptr=f_memcached_get(fm, aname.cstr(), aname.length(), &data.length, &data.flags, &rc);
if(rc==MEMCACHED_SUCCESS){
return &deserializ... | false | false | false | false | false | 0 |
fop_readdir_cbk_stub (call_frame_t *frame, fop_readdir_cbk_t fn,
int32_t op_ret, int32_t op_errno,
gf_dirent_t *entries, dict_t *xdata)
{
call_stub_t *stub = NULL;
gf_dirent_t *stub_entry = NULL, *entry = NULL;
GF_VALIDATE_OR_GOTO ("call-stub", frame,... | false | false | false | false | false | 0 |
store_temp_auto_offset(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct sensor_device_attribute_2 *s_attr = to_sensor_dev_attr_2(attr);
int nr = s_attr->index;
int ofs = s_attr->nr;
struct lm93_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->... | false | false | false | false | false | 0 |
is_bridge_object_alive (MonoObject *obj, void *data)
{
SgenHashTable *table = data;
unsigned char *value = sgen_hash_table_lookup (table, obj);
if (!value)
return TRUE;
return *value;
} | false | false | false | false | false | 0 |
compute_bucket_size (size_t candidate, const Hash_tuning *tuning)
{
if (!tuning->is_n_buckets)
{
float new_candidate = candidate / tuning->growth_threshold;
if (SIZE_MAX <= new_candidate)
return 0;
candidate = new_candidate;
}
candidate = next_prime (candidate);
if (xalloc_oversized (ca... | false | false | false | false | false | 0 |
coro_sigelem_get (pTHX_ SV *sv, MAGIC *mg)
{
const char *s = MgPV_nolen_const (mg);
if (*s == '_')
{
SV **svp = 0;
if (strEQ (s, "__DIE__" )) svp = &PL_diehook;
if (strEQ (s, "__WARN__")) svp = &PL_warnhook;
if (svp)
{
SV *ssv;
if (!*svp)
ssv =... | false | false | false | false | false | 0 |
operator=(const vtkBalloon &balloon)
{
this->Text = balloon.Text;
// Don't leak if we already have an image.
if( this->Image )
{
this->Image->UnRegister(NULL);
this->Image = NULL;
}
this->Image = balloon.Image;
if ( this->Image )
{
this... | false | false | false | false | false | 0 |
on_tree_view_search_results_select_row(GtkTreeView *unused_tv,
gpointer unused_udata)
{
(void) unused_tv;
(void) unused_udata;
if (row_selected_ev) {
cq_resched(row_selected_ev, ROW_SELECT_TIMEOUT);
} else {
row_selected_ev = cq_main_insert(ROW_SELECT_TIMEOUT,
row_selected_expire, NULL);
}
} | false | false | false | false | false | 0 |
giraffe_stacking_config_add(cpl_parameterlist *list)
{
cpl_parameter *p;
if (list == NULL) {
return;
}
p = cpl_parameter_new_enum("giraffe.stacking.method",
CPL_TYPE_STRING,
"Stacking method: average, median, minmax or "
... | false | false | false | false | false | 0 |
find_paragraph_end(struct view *view, position_t offset)
{
Unicode_t ch, pch = UNICODE_BAD, ppch = UNICODE_BAD;
position_t next;
while (IS_UNICODE((ch = view_char(view, offset, &next))) &&
(ch == '\n' || pch != '\n' || ppch != '\n'))
offset = next, ppch = pch, pch = ch;
return offset;
} | false | false | false | false | false | 0 |
removeLayer(uint8 index)
{
if (index < mLayers.size())
{
uint8 blendIndex = std::max(index-1,0);
// Shift all GPU texture channels down one
shiftDownGPUBlendChannels(blendIndex);
LayerInstanceList::iterator i = mLayers.begin();
std::adva... | false | false | false | false | false | 0 |
findCorner(QPointF scenePos, Qt::KeyboardModifiers modifiers) {
//return ResizableBoard::NO_CORNER;
ResizableBoard::Corner corner = ResizableBoard::findCorner(scenePos, modifiers);
if (corner == ResizableBoard::NO_CORNER) return corner;
if (modifiers & altOrMetaModifier()) {
// free rotate
setCursor(*CursorMas... | false | false | false | false | false | 0 |
execute_compositor_queue(gx_device_clist_reader *cdev, gx_device **target, gx_device **tdev, gs_imager_state *pis,
gs_composite_t **ppcomp_first, gs_composite_t **ppcomp_last, gs_composite_t *pcomp_from,
int x0, int y0, gs_memory_t *mem, bool idle)
{
while (pcomp_fr... | false | false | false | false | false | 0 |
nis_mapname (char *map, int *pfix)
{
int i;
*pfix = 0;
for (i=0; aliases[i].alias != 0L; i++) {
if (!strcmp (aliases[i].alias, map)) {
*pfix = aliases[i].fix;
return aliases[i].map;
}
if (!strcmp (aliases[i].map, map)) {
*pfix = aliases[i].fix;
... | false | false | false | false | false | 0 |
r200EnsureEmitSize( struct gl_context * ctx , GLubyte* vimap_rev )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
GLuint space_required;
GLuint state_size;
GLuint nr_aos = 0;
int i;
/* predict number of aos to emit */
for (i = 0; i ... | false | false | false | false | false | 0 |
display_player(int mode)
{
/* Erase screen */
clear_from(0);
/* Stat info */
display_player_stat_info();
if (mode)
{
data_panel data[MAX_PANEL];
int rows = get_panel(1, data, N_ELEMENTS(data));
display_panel(data, rows, 1, &boundaries[1]);
/* Stat/Sustain flags */
display_player_sust_info();
/* ... | false | false | false | false | false | 0 |
ignore_procs(interp,s)
Tcl_Interp *interp;
char *s; /* function name */
{
return ((s[0] == 'p') &&
(s[1] == 'r') &&
(s[2] == 'o') &&
(s[3] == 'm') &&
(s[4] == 'p') &&
(s[5] == 't') &&
((s[6] == '1') ||
(s[6] == '2')) &&
(s[7] == '\0')
);
} | false | false | false | false | false | 0 |
evtag_payload_length(struct evbuffer *evbuf, ev_uint32_t *plength)
{
int res, len;
len = decode_tag_internal(NULL, evbuf, 0 /* dodrain */);
if (len == -1)
return (-1);
res = decode_int_internal(plength, evbuf, len);
if (res == -1)
return (-1);
return (0);
} | false | false | false | false | false | 0 |
gkrellm_gtk_button_connected(GtkWidget *box, GtkWidget **button,
gboolean expand, gboolean fill, gint pad,
void (*cb_func)(), gpointer data, gchar *string)
{
GtkWidget *b;
if (!string)
return;
if (!strncmp(string, "gtk-", 4))
b = gtk_button_new_from_stock(string);
else
b = gtk_button_new_with_label(st... | false | false | false | false | false | 0 |
pine_free_body_data(struct mail_bodystruct *body)
{
if(body){
if(body->type == TYPEMULTIPART){
PART *part = body->nested.part;
do /* for each part */
pine_free_body_data(&part->body);
while ((part = part->next) != NULL); /* until done */
}
else if(body->contents.text.data)
so_give((ST... | false | false | false | false | false | 0 |
device_mobile_device_got_modem_manager_gsm_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GError *error = NULL;
GDBusProxy *proxy;
NMDevice *device = (NMDevice *) user_data;
proxy = g_dbu... | false | false | false | false | false | 0 |
hattrie_initroot(hattrie_t *T)
{
node_ptr node;
if (T->bsize > 0) {
node.b = hhash_create(TRIE_BUCKET_SIZE);
node.b->flag = NODE_TYPE_HYBRID_BUCKET;
node.b->c0 = 0x00;
node.b->c1 = TRIE_MAXCHAR;
T->root.t = alloc_trie_node(T, node);
} else {
T->root.t = alloc_... | false | false | false | false | false | 0 |
team_port_disable(struct team *team,
struct team_port *port)
{
if (!team_port_enabled(port))
return;
if (team->ops.port_disabled)
team->ops.port_disabled(team, port);
hlist_del_rcu(&port->hlist);
__reconstruct_port_hlist(team, port->index);
port->index = -1;
team->en_port_count--;
team_queue_overrid... | false | false | false | false | false | 0 |
atacmd_close ( struct ata_command *atacmd, int rc ) {
struct ata_device *atadev = atacmd->atadev;
if ( rc != 0 ) {
DBGC ( atadev, "ATA %p tag %08x closed: %s\n",
atadev, atacmd->tag, strerror ( rc ) );
}
/* Shut down interfaces */
intf_shutdown ( &atacmd->ata, rc );
intf_shutdown ( &atacmd->block, rc... | false | false | false | false | false | 0 |
read_form_type(z_file *iff_file)
{
if (fsi->setfilepos(iff_file, 8L, SEEK_SET) == -1)
{
TRACE_LOG("%s\n", strerror(errno));
return NULL;
}
if (read_four_chars(iff_file) != 0)
{
TRACE_LOG("%s\n", strerror(errno));
return NULL;
}
return four_chars;
} | false | false | false | false | false | 0 |
testing_extension_basic (const gchar *loader)
{
PeasEngine *engine;
extension_plugin = g_strdup_printf ("extension-%s", loader);
engine = testing_engine_new ();
peas_engine_enable_loader (engine, loader);
/* Check that the loaders are created lazily */
g_assert (g_type_from_name ("PeasPluginLoader") == G... | false | false | false | false | false | 0 |
gth_browser_load_location (GthBrowser *browser,
GFile *location)
{
LoadLocationData *data;
data = g_new0 (LoadLocationData, 1);
data->browser = browser;
data->location_data = gth_file_data_new (location, NULL);
data->file_source = gth_main_get_file_source (data->location_data->file);
if (data->file_... | false | false | false | false | false | 0 |
GEN_select_gene(GBDATA* /*gb_main*/, AW_root *aw_root, const char *item_name) {
char *organism = strdup(item_name);
char *gene = strchr(organism, '/');
if (gene) {
*gene++ = 0;
aw_root->awar(AWAR_ORGANISM_NAME)->write_string(organism);
aw_root->awar(AWAR_GENE_NAME)->write_string(ge... | false | false | false | false | false | 0 |
scsi_device_get(struct scsi_device *sdev)
{
if (sdev->sdev_state == SDEV_DEL || sdev->sdev_state == SDEV_CANCEL)
goto fail;
if (!get_device(&sdev->sdev_gendev))
goto fail;
if (!try_module_get(sdev->host->hostt->module))
goto fail_put_device;
return 0;
fail_put_device:
put_device(&sdev->sdev_gendev);
fail:
... | false | false | false | false | false | 0 |
removeAttribute(int i)
{
int cur = 0;
for (AttributeVec::iterator it = _attributes.begin(); it != _attributes.end(); ++it, ++cur)
{
if (cur == i)
{
_attributes.erase(it);
break;
}
}
} | false | false | false | false | false | 0 |
is_bct_cond (rtx insn)
{
if (GET_CODE (insn) != JUMP_INSN)
return false;
#ifdef HAVE_doloop_end
if (!doloop_condition_get (PATTERN(insn)))
return false;
#else
return false;
#endif
return true;
} | false | false | false | false | false | 0 |
DivideRfmBlock(RfmBlock block, RfmStm stm)
{
RfmBlock new;
RfmBranch branch;
if ((block == NULL) || (stm == NULL)) {
return(NULL);
}
if (stm->block != block) {
return(NULL);
}
new = MakeRfmBlock(block, NULL);
new->outer = block->outer;
new->fork_list = block->fork_l... | false | false | false | false | false | 0 |
write_endpoints( FILE *f, const char *prefix, const str_list_t *list )
{
const struct str_list_entry_t *endpoint;
const char *p;
/* this should be an array of RPC_PROTSEQ_ENDPOINT but we want const strings */
print_file( f, 0, "static const unsigned char * const %s__RpcProtseqEndpoint[][2] =\n{\n", pre... | false | false | false | false | false | 0 |
JABBERConnected(void *data)
{
JABBER_Conn *JConn = (JABBER_Conn *)data;
eb_local_account *ela = NULL;
eb_jabber_local_account_data *jlad = NULL;
if (!JConn) {
eb_debug(DBG_JBR, "No JConn!\n");
return;
}
ela = find_local_account_by_conn(JConn);
if (!ela) {
eb_debug(DBG_JBR, "No ela!\n");
return;
}
jlad ... | false | false | false | false | false | 0 |
tsc2005_cmd(struct device *dev, u8 cmd)
{
u8 tx = TSC200X_CMD | TSC200X_CMD_12BIT | cmd;
struct spi_transfer xfer = {
.tx_buf = &tx,
.len = 1,
.bits_per_word = 8,
};
struct spi_message msg;
struct spi_device *spi = to_spi_device(dev);
int error;
spi_message_init(&msg);
spi_message_add... | false | false | false | false | false | 0 |
OnRegisterSceneNode()
{
if (IsVisible)
{
SceneManager->registerNodeForRendering(this, scene::ESNRP_SHADOW);
ISceneNode::OnRegisterSceneNode();
}
} | false | false | false | false | false | 0 |
line_monotonity(double *pole, int pole_step)
{
double p0 = pole[pole_step * 0];
double p1 = pole[pole_step * 1];
if (p1 - p0 > 1e-13)
return 1;
if (p0 - p1 > 1e-13)
return 2;
return 0;
} | false | false | false | false | false | 0 |
copy_NTLMResponse(const NTLMResponse *from, NTLMResponse *to)
{
memset(to, 0, sizeof(*to));
*(&(to)->success) = *(&(from)->success);
*(&(to)->flags) = *(&(from)->flags);
if((from)->sessionkey) {
(to)->sessionkey = malloc(sizeof(*(to)->sessionkey));
if((to)->sessionkey == NULL) goto fail;
if(der_copy_octet_string((from)... | false | true | false | false | false | 1 |
preparePassManager(PMStack &PMS) {
// Find LPPassManager
while (!PMS.empty() &&
PMS.top()->getPassManagerType() > PMT_LoopPassManager)
PMS.pop();
// If this pass is destroying high level information that is used
// by other passes that are managed by LPM then do not insert
// this pass in curr... | false | false | false | false | false | 0 |
autohelperconn27(int trans, int move, int color, int action)
{
int a, b, c;
UNUSED(color);
UNUSED(action);
a = AFFINE_TRANSFORM(648, trans, move);
b = AFFINE_TRANSFORM(647, trans, move);
c = AFFINE_TRANSFORM(611, trans, move);
return !cut_possible(a, OTHER_COLOR(color)) && !disconnect_helper(b,c);
} | false | false | false | false | false | 0 |
Shift(int start, int length, int delta)
{
/* Compute number of entries to shift */
if ((delta < 0) && (start < -delta)) start = -delta;
int nshift = nentries - start;
if (delta > 0) nshift -= delta;
if (nshift <= 0) return;
if ((length > 0) && (length < nshift)) nshift = length;
/* Shift queue entries */... | false | false | false | false | false | 0 |
flushCurrentWord()
{
while ( d->currentWord[0].isPunct() ) {
d->currentWord = d->currentWord.mid( 1 );
d->currentPos++;
}
QChar ch;
while ( !d->currentWord.isEmpty() && ( ch = d->currentWord[(int) d->currentWord.length() - 1] ).isPunct() &&
ch != '(' && ch != '@' )
d->currentWord.truncate( d->... | false | false | false | false | false | 0 |
notifyBeforeNodeRemoval(NodeImpl *n)
{
QListIterator<NodeIteratorImpl*> it(m_nodeIterators);
while (it.hasNext())
it.next()->notifyBeforeNodeRemoval(n);
} | false | false | false | false | false | 0 |
int_thread_set_item(ERR_STATE *d)
{
ERR_STATE *p;
LHASH_OF(ERR_STATE) *hash;
err_fns_check();
hash = ERRFN(thread_get)(1);
if (!hash)
return NULL;
CRYPTO_w_lock(CRYPTO_LOCK_ERR);
p = lh_ERR_STATE_insert(hash, d);
CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
ERRFN(thread_release)(&hash);
return p;
} | false | false | false | false | false | 0 |
gwy_deserialize_object_hash(const guchar *buffer,
gsize size,
gsize *position,
const guchar *object_name,
gsize *nitems)
{
gsize mysize;
GwySerializeItem *items;
mysize = gwy_serialize_check_stri... | false | false | false | false | false | 0 |
formfactor_probe(struct btd_adapter *adapter)
{
int chassis_type;
uint8_t minor = 0;
const char *formfactor;
char *contents;
if (g_file_get_contents(DMI_CHASSIS_FILE,
&contents, NULL, NULL) == FALSE) {
if (g_file_get_contents(DMI_CHASSIS_FILE_FALLBACK,
&contents, NULL, NULL) == FALSE) {
error("Could... | false | false | false | false | false | 0 |
die()
{
if(!m_death)
{
m_death = true;
emit dying();
m_xSpeed = 0;
m_xSpeed = 0;
if(m_badBonusCountdownTimer->isActive())
{
m_badBonusCountdownTimer->stop();
slot_removeBadBonus();
}
int row = m_arena->getRowFromY(m... | false | false | false | false | false | 0 |
processes_in_job (job)
int job;
{
int nproc;
register PROCESS *p;
nproc = 0;
p = jobs[job]->pipe;
do
{
p = p->next;
nproc++;
}
while (p != jobs[job]->pipe);
return nproc;
} | false | false | false | false | false | 0 |
interface_up(int fd, const char *iface) {
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1);
if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) {
if (interface_do_message)
daemon_log(LOG_WARNING, "Warning: Could not get interface flags.");... | false | true | false | false | false | 1 |
operator()(unsigned A, unsigned B) {
if (A == B)
return false;
MachineBasicBlock* ABlock = MRI.getVRegDef(A)->getParent();
MachineBasicBlock* BBlock = MRI.getVRegDef(B)->getParent();
if (preorder[ABlock] < preorder[BBlock])
return true;
else if (preorder[ABlock] > preorder[BBlo... | false | false | false | false | false | 0 |
cbrtest_ast2150(struct ast_private *ast)
{
int i;
for (i = 0; i < 8; i++)
if (mmctestburst2_ast2150(ast, i))
return 0;
return 1;
} | false | false | false | false | false | 0 |
runTextIO ( PropertyContainer& pc )
{
pc.addTagInteger( "Mode", mode, entranceModeNum, entranceModes );
pc.addTagInteger( "UnitHeightAbs", height_abs, choehenstufennum, heightTags );
pc.addInteger( "UnitHeightRel", height_rel, -100 );
pc.addTagInteger( "ContainerHeight", container_height, choehenstufennum, ... | false | false | false | false | false | 0 |
async_read_cb (GInputStream *stream,
GAsyncResult *res,
AsyncData *async)
{
GeditDocumentLoader *loader;
GError *error = NULL;
gedit_debug (DEBUG_LOADER);
/* manually check cancelled state */
if (g_cancellable_is_cancelled (async->cancellable))
{
async_data_free (async);
return;
}
load... | false | false | false | false | false | 0 |
getInstructionCase(Record *R,
CodeGenTarget &Target) {
std::string Case;
BitsInit *BI = R->getValueAsBitsInit("Inst");
const std::vector<RecordVal> &Vals = R->getValues();
unsigned NumberedOp = 0;
// Loop over all of the fields in the instruction, determining... | false | false | false | false | false | 0 |
parse(CS& File)
{untested();
File.skipbl();
unsigned here = File.cursor();
char quote = File.ctoc();
_data = "";
for (;;) {untested();
if (File.skip1(quote)) {untested();
break;
}else if (!File.more()) {untested();
File.warn(0, "end of file in quoted string");
File.warn(0, here, "str... | false | false | false | false | false | 0 |
convertFromUnsignedParts(const integerPart *src,
unsigned int srcCount,
roundingMode rounding_mode)
{
unsigned int omsb, precision, dstCount;
integerPart *dst;
lostFraction lost_fraction;
category = fcNormal;
omsb = APInt::tcMSB(src, srcCoun... | false | false | false | false | false | 0 |
simple_pthread_setup(void **testdata)
{
int retval;
pthread_t *test_thread;
int num_threads = NUM_PTHREADS;
int i;
test_thread = malloc(sizeof(pthread_t)*num_threads);
if (test_thread == NULL) {
perror("malloc");
goto out;
}
my_barrier = NUM_PTHREADS+1;
for (i=0; i<num_th... | false | false | false | false | false | 0 |
Flength()
{
long nn;
unsigned len;
switch(*FLAGPTR(argStkPtr)) {
case fVECTOR:
case fSTRING:
case fBYTESTRING:
case fRECORD:
len = *VECLENPTR(argStkPtr);
return(mkfixnum(len));
case fSTACK:
nn = stacklength(argStkPtr);
return(mkinum(nn));
case fSTREAM... | false | false | false | false | false | 0 |
gen_crc_table() {
/* generate the table of CRC remainders for all possible bytes */
static const unsigned long POLYNOMIAL = 0x04c11db7UL;
std::vector<unsigned long> crc_table;
for ( unsigned long i = 0; i < 256; ++i ) {
unsigned long crc = i << 24;
for ( int j = 0; j < 8; j++ ) {
if ( crc & 0x... | false | false | false | false | false | 0 |
hwloc_topology_insert_misc_object_by_parent(struct hwloc_topology *topology, hwloc_obj_t parent, const char *name)
{
hwloc_obj_t obj = hwloc_alloc_setup_object(HWLOC_OBJ_MISC, -1);
if (name)
obj->name = strdup(name);
if (!topology->is_loaded) {
hwloc_free_unlinked_object(obj);
errno = EINVAL;
ret... | false | false | false | false | false | 0 |
initialize_texture_fields(struct gl_context *ctx,
GLenum target,
struct gl_texture_object *texObj,
GLint levels,
GLsizei width, GLsizei height, GLsizei depth,
GLenum internalFormat, mesa_for... | false | false | false | false | false | 0 |
sort_compare(struct userrec *a, struct userrec *b)
{
/* Order by flags, then alphabetically
* first bots: +h / +a / +l / other bots
* then users: +n / +m / +o / other users
* return true if (a > b)
*/
if (a->flags & b->flags & USER_BOT) {
if (~bot_flags(a) & bot_flags(b) & BOT_HUB)
return 1;
... | false | false | false | false | false | 0 |
ixgbevf_configure_msix(struct ixgbevf_adapter *adapter)
{
struct ixgbevf_q_vector *q_vector;
int q_vectors, v_idx;
q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;
adapter->eims_enable_mask = 0;
/* Populate the IVAR table and set the ITR values to the
* corresponding register.
*/
for (v_idx = 0; v_idx... | false | false | false | false | false | 0 |
initializeFMIndex(int sampleRate)
{
// initialize the occurance table
m_occurrence.initialize(m_bwStr, sampleRate);
// Calculate the C(a) array
// Calculate the total number of occurances of each character in the BW str
AlphaCount64 tmp;
for(size_t i = 0; i < m_bwStr.length(); ++i)
{
... | false | false | false | false | false | 0 |
volgen_graph_free (volgen_graph_t *graph)
{
xlator_t *trav = NULL;
xlator_t *trav_old = NULL;
for (trav = first_of (graph) ;; trav = trav->next) {
if (trav_old)
xlator_destroy (trav_old);
trav_old = trav;
if (!trav)
... | false | false | false | false | false | 0 |
smaller_gam(x)
double x;
{
double t, d;
struct Double r, xx;
if (x < x0 + LEFT) {
t = x, TRUNC(t);
d = (t+x)*(x-t);
t *= t;
xx.a = (t + x), TRUNC(xx.a);
xx.b = x - xx.a; xx.b += t; xx.b += d;
t = (one-x0); t += x;
d = (one-x0); d -= t; d += x;
x = xx.a + xx.b;
} else {
xx.a = x, TRUNC(xx.a);
x... | false | false | false | false | false | 0 |
createTransmission(const std::string& str)
{
std::string result;
std::istringstream is(str);
while (is) {
std::string s;
is >> s;
if (s.empty())
break;
std::string::iterator si = s.begin();
for (; si != s.end(); si++)
*si = toupper(*si);
result.append(s);
}
if (result.subst... | false | false | false | false | false | 0 |
tile(Monitor *m) {
unsigned int i, n, h, mw, my, ty;
Client *c;
for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if(n == 0)
return;
if(n > m->nmaster)
mw = m->nmaster ? m->ww * m->mfact : 0;
else
mw = m->ww;
for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), ... | false | false | false | false | false | 0 |
rtc_update_hrtimer(struct rtc_device *rtc, int enabled)
{
/*
* We always cancel the timer here first, because otherwise
* we could run into BUG_ON(timer->state != HRTIMER_STATE_CALLBACK);
* when we manage to start the timer before the callback
* returns HRTIMER_RESTART.
*
* We cannot use hrtimer_cancel() h... | false | false | false | false | false | 0 |
inf_text_gtk_buffer_insert_text_cb_before(GtkTextBuffer* gtk_buffer,
GtkTextIter* location,
gchar* text,
gint len,
gpointer user_data)
{
InfTextGtkBuf... | false | false | false | false | false | 0 |
main (int argc, char *argv[])
{
ClutterScript *script;
ClutterActor *stage;
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return 1;
script = clutter_script_new ();
load_script_from_file (script, UI_FILE);
clutter_script_connect_signals (script, script);
clutter_script_get_objects (scrip... | false | false | false | false | false | 0 |
GetBlurKernel(unsigned long width,const double sigma,double **kernel)
{
#define KernelRank 3
double
alpha,
normalize;
int
bias;
register long
i;
/*
Generate a 1-D convolution matrix. Calculate the kernel at higher
resolution than needed and average the results as a form of numerical... | false | false | false | false | false | 0 |
typedefHandler(Node *n) {
if (generate_typedef_flag) {
is_function = 0;
Printf(f_cl, "\n(ffi:def-c-type %s %s)\n", Getattr(n, "name"), get_ffi_type(n, Getattr(n, "type")));
}
return Language::typedefHandler(n);
} | false | false | false | false | false | 0 |
go_io_context_new (GOCmdContext *cc)
{
GOIOContext *ioc;
g_return_val_if_fail (GO_IS_CMD_CONTEXT (cc), NULL);
ioc = g_object_new (GO_TYPE_IO_CONTEXT, NULL);
/* The cc is optional for subclasses, but mandatory in this class. */
ioc->impl = cc;
g_object_ref (ioc->impl);
return ioc;
} | false | false | false | false | false | 0 |
netsnmp_add_traphandler(Netsnmp_Trap_Handler* handler,
oid *trapOid, int trapOidLen ) {
netsnmp_trapd_handler *traph, *traph2;
if ( !handler )
return NULL;
traph = SNMP_MALLOC_TYPEDEF(netsnmp_trapd_handler);
if ( !traph )
return NULL;
/*
* Populate thi... | false | false | false | false | false | 0 |
gRecvCmd(int *cmd)
{
gDebug("receiving command from %s ...\n", curtalk->pipe->who);
if (reader(curtalk->pipe->fd.r, cmd, sizeof(*cmd)) == sizeof(*cmd)) {
gDebug(" -> %d\n", *cmd);
return 1;
}
gDebug(" -> no data\n");
return False;
} | false | false | false | false | false | 0 |
getModRefInfo(const LoadInst *L,
const MemoryLocation &Loc) {
// Be conservative in the face of volatile/atomic.
if (!L->isUnordered())
return MRI_ModRef;
// If the load address doesn't alias the given address, it doesn't read
// or write the specified memory.
if (Loc.... | false | false | false | false | false | 0 |
soap_set_mime_attachment(struct soap *soap, char *ptr, size_t size, enum soap_mime_encoding encoding, const char *type, const char *id, const char *location, const char *description)
{ struct soap_multipart *content = soap_new_multipart(soap, &soap->mime.first, &soap->mime.last, ptr, size);
if (!content)
return S... | 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.