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 |
|---|---|---|---|---|---|---|
m_detach(mtmp, mptr)
struct monst *mtmp;
struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */
{
if (mtmp->mleashed) m_unleash(mtmp, FALSE);
/* to prevent an infinite relobj-flooreffects-hmon-killed loop */
mtmp->mtrapped = 0;
mtmp->mhp = 0; /* simplify some tests: force mhp to 0 */
relobj(m... | false | false | false | false | false | 0 |
updateCoordsFileNew(){
long time;
double x, y, phi;
int w,nw,ne,e;
coordFile >> time;
coordFile >> x >> y;
coordFile >> phi;
coordFile >> w >> nw >> ne >> e;
if (coordFile.eof()){
currentPos[0] = 0.0;
currentPos[1] = 0.0;
currentPos[2] = 0.0;
currentSonar[0] = 0;
currentSonar... | false | false | false | false | false | 0 |
WAV_OutputWrite(HANDLE_WAV wav, void *sampleBuffer, UINT numberOfSamples, int nBufBits, int nSigBits)
{
SCHAR *bptr = (SCHAR*)sampleBuffer;
SHORT *sptr = (SHORT*)sampleBuffer;
LONG *lptr = (LONG*)sampleBuffer;
LONG tmp;
int bps = Unpack(wav->header.bitsPerSample);
UINT i;
/* Pack samp... | false | false | false | false | false | 0 |
qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 8)
qt_static_metacall(this, _c, _id, _a);
_id -= 8;
}
#ifndef QT_NO_PROPERTIES
else if ... | false | false | false | false | false | 0 |
move_action_down(GtkButton *button, gpointer user_data)
{
GtkTreeIter sel_iter;
/* Check if selected */
if (gtk_tree_selection_get_selected(actions_selection, NULL, &sel_iter))
{
/* Create iter to next row */
GtkTreeIter next_iter = sel_iter;
/* Check if next row exists */
if (gtk_tree_model_ite... | false | false | false | false | false | 0 |
add_dsakey_to_keyfile(DSA *dsa, char *host, char *filename, tBoolean autoaccept)
{
FILE *fp = NULL;
Buffer buf;
char *str = NULL;
int ret = 0;
switch (is_dsakey_in_keyfile(dsa, host, filename)) {
case 0:
Display(LOG_LEVEL_3, ELInfo, TSP_AUTH_PASSDSS_STRING, GOGO_STR_ERR_IN_KEY_VERIF);
Display(LOG... | false | false | false | false | false | 0 |
process_orphans(GtOrphanage *orphanage, GtFeatureInfo *feature_info,
bool strict, unsigned int last_terminator,
GtTypeChecker *type_checker, GtQueue *genome_nodes,
GtError *err)
{
GtGenomeNode *orphan;
int had_err = 0;
gt_error_check... | false | false | false | false | false | 0 |
ToObject() {
if (IsJSReceiver()) {
return this;
} else if (IsNumber()) {
Isolate* isolate = Isolate::Current();
Context* global_context = isolate->context()->global_context();
return CreateJSValue(global_context->number_function(), this);
} else if (IsBoolean()) {
Isolate* isolate = HeapObject... | false | false | false | false | false | 0 |
_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
{
unsigned long irqL;
if (obj == NULL)
return _SUCCESS;
spin_lock_irqsave(&queue->lock, irqL);
list_add_tail(&obj->list, &queue->queue);
spin_unlock_irqrestore(&queue->lock, irqL);
return _SUCCESS;
} | false | false | false | false | false | 0 |
fs_rtp_special_source_stop_locked (FsRtpSpecialSource *self)
{
if (self->priv->src)
{
if (self->priv->stop_thread)
{
GST_DEBUG ("stopping thread for special source already running");
return TRUE;
}
g_object_ref (self);
self->priv->stop_thread = g_thread_new ("special-source-stop",
... | false | false | false | false | false | 0 |
gn_bmp_sms_read(int type, unsigned char *message, unsigned char *code, gn_bmp *bitmap)
{
int offset = 0;
bitmap->type = type;
switch (type) {
case GN_BMP_PictureMessage:
offset = 2;
break;
case GN_BMP_OperatorLogo:
if (!code) return GN_ERR_UNKNOWN;
bitmap->netcode[0] = '0' + (message[0] & 0x0f);
bitmap... | false | false | false | false | false | 0 |
gda_vconnection_data_model_get_model (GdaVconnectionDataModel *cnc, const gchar *table_name)
{
GdaVConnectionTableData *td;
g_return_val_if_fail (GDA_IS_VCONNECTION_DATA_MODEL (cnc), NULL);
g_return_val_if_fail (cnc->priv, NULL);
if (!table_name || !(*table_name))
return NULL;
td = _gda_vconnection_get_table_da... | false | false | false | false | false | 0 |
ipath_dereg_mr(struct ib_mr *ibmr)
{
struct ipath_mr *mr = to_imr(ibmr);
int i;
ipath_free_lkey(&to_idev(ibmr->device)->lk_table, ibmr->lkey);
i = mr->mr.mapsz;
while (i) {
i--;
kfree(mr->mr.map[i]);
}
if (mr->umem)
ib_umem_release(mr->umem);
kfree(mr);
return 0;
} | false | false | false | false | false | 0 |
bds_mltadd(const BAND *A, const BAND *B, double alpha, BAND *OUT)
#endif
{
int i;
if ( ! A || ! B )
error(E_NULL,"bds_mltadd");
if ( A->mat->n != B->mat->n )
error(E_SIZES,"bds_mltadd");
if ( A == OUT || B == OUT )
error(E_INSITU,"bds_mltadd");
OUT = bd_copy(A,OUT);
OUT = bd_resize(OUT,max(A->... | false | false | false | true | false | 1 |
efx_ptp_remove_multicast_filters(struct efx_nic *efx)
{
struct efx_ptp_data *ptp = efx->ptp_data;
if (ptp->rxfilter_installed) {
efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_REQUIRED,
ptp->rxfilter_general);
efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_REQUIRED,
ptp->rxfilter_event);
ptp->rxfil... | false | false | false | false | false | 0 |
manager_create_application(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
struct hdp_application *app;
const char *name;
DBusMessageIter iter;
GError *err = NULL;
dbus_message_iter_init(msg, &iter);
app = hdp_get_app_config(&iter, &err);
if (err != NULL) {
g_error_free(err);
return btd_erro... | false | false | false | false | false | 0 |
on_popup_sources_config_cols_activate(GtkMenuItem *unused_menuitem,
void *unused_udata)
{
GtkWidget *widget, *cc;
(void) unused_menuitem;
(void) unused_udata;
widget = fi_gui_sources_widget();
g_return_if_fail(widget);
cc = gtk_column_chooser_new(GTK_WIDGET(widget));
gtk_menu_popup(GTK_MENU(cc), NUL... | false | false | false | false | false | 0 |
detect_right()
{
if( state == 0 || none_record ) // closed
return 0;
if( mouse.single_click( ix1, iy1, ix2, iy2, 1 ) ) // 1-right mouse button
{
int recNo;
recNo = top_rec_no +
(mouse.click_y(1)-iy1) / (rec_height+rec_y_space) * x_max_rec +
(mouse.... | false | false | false | false | false | 0 |
FCEUD_SetInput (bool fourscore, bool microphone, ESI port0, ESI port1,
ESIFC fcexp)
{
eoptions &= ~EO_FOURSCORE;
if (fourscore)
{ // Four Score emulation, only support gamepads, nothing else
eoptions |= EO_FOURSCORE;
CurInputType[0] = SI_GAMEPAD; // Controllers 1 and 3
CurInputType[1] = S... | false | false | false | false | false | 0 |
authCommand(redisClient *c) {
if (!server.requirepass) {
addReplyError(c,"Client sent AUTH, but no password is set");
} else if (!time_independent_strcmp(c->argv[1]->ptr, server.requirepass)) {
c->authenticated = 1;
addReply(c,shared.ok);
} else {
c->authenticated = 0;
addRep... | false | false | false | false | false | 0 |
report_build_records_field(const FoundSet& found_set, xmlpp::Element& nodeParent, const sharedptr<const LayoutItem_Field>& field, const Glib::RefPtr<Gnome::Gda::DataModel>& datamodel, guint row, guint& colField, bool vertical)
{
const Field::glom_field_type field_type = field->get_glom_type();
xmlpp::Element* node... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__com__Container_Delete(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__IteratorPointer * i)
{
uint64 data = ((uint64 (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__ext... | false | false | false | true | false | 1 |
inf_text_chunk_iter_get_bytes(InfTextChunkIter* iter)
{
g_return_val_if_fail(iter != NULL, 0);
return ((InfTextChunkSegment*)g_sequence_get(iter->first))->length;
} | false | false | false | false | false | 0 |
queue_element_unlock(struct fuse *f, struct lock_queue_element *qe)
{
struct node *wnode;
if (qe->first_locked) {
wnode = qe->wnode1 ? *qe->wnode1 : NULL;
unlock_path(f, qe->nodeid1, wnode, NULL);
}
if (qe->second_locked) {
wnode = qe->wnode2 ? *qe->wnode2 : NULL;
unlock_path(f, qe->nodeid2, wnode, NULL);
... | false | false | false | false | false | 0 |
tv_subconnector_show(struct device *device,
struct device_attribute *attr,
char *buf)
{
struct drm_connector *connector = to_drm_connector(device);
struct drm_device *dev = connector->dev;
struct drm_property *prop;
uint64_t subconnector;
int ret;
prop = dev->mode_config.tv_subconnector_property;... | false | false | false | false | false | 0 |
matrix_cpy_float (float* Y,size_t iy,size_t jy,const float* X,size_t ix,size_t jx,size_t n,size_t m,size_t nx,size_t ny)
{
size_t i,j;
for (j=0;j<m;j++) {
for (i=0;i<n;i++) {
Y[(i+iy)+(j+jy)*ny] = X[(i+ix)+(j+jx)*nx];
}
}
} | false | false | false | false | false | 0 |
sccnxp_console_putchar(struct uart_port *port, int c)
{
int tryes = 100000;
while (tryes--) {
if (sccnxp_port_read(port, SCCNXP_SR_REG) & SR_TXRDY) {
sccnxp_port_write(port, SCCNXP_THR_REG, c);
break;
}
barrier();
}
} | false | false | false | false | false | 0 |
real_handle_cont( pid_t pid, pid_state *state )
{
pid_t child=(pid_t)state->context_state[1];
pid_state *child_state=lookup_state( child );
__ptrace_request req=(__ptrace_request)state->context_state[0];
if( req==PTRACE_CONT ) {
child_state->trace_mode|=TRACE_CONT;
dlog("ptrace: %d PTRAC... | false | false | false | false | false | 0 |
deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes, unsigned *wildmatch)
{
// Extra check
if (tparam && tparam->ty == Tenum)
{
TypeEnum *tp = (TypeEnum *)tparam;
if (sym != tp->sym)
return MATCHnomatch;
}
Type *tb = toBasetype();
if... | false | false | false | false | false | 0 |
ast_autoservice_start(struct ast_channel *chan)
{
int res = 0;
struct asent *as;
AST_LIST_LOCK(&aslist);
AST_LIST_TRAVERSE(&aslist, as, list) {
if (as->chan == chan) {
as->use_count++;
break;
}
}
AST_LIST_UNLOCK(&aslist);
if (as) {
/* Entry exists, autoservice is already handling this channel */
... | false | false | false | false | false | 0 |
position_display (Position *pos)
{
register Square square;
register gshort rank;
for (rank = 8; rank >= 1; rank--) {
for (square = A1 + ((rank - 1) * 10);
square <= H1 + ((rank - 1) * 10);
square++) {
g_warning("%c ", piece_to_ascii(pos->square [square]));
}
g_warning("\n");
}
} | false | false | false | false | false | 0 |
frpw_test_pnp ( PIA *pi )
/* returns chip_type: 0 = Xilinx, 1 = ASIC */
{ int olddelay, a, b;
#ifdef FRPW_HARD_RESET
w0(0); w2(8); udelay(50); w2(0xc); /* parallel bus reset */
mdelay(1500);
#endif
olddelay = pi->delay;
pi->delay = 10;
pi->saved_r0 = r0();
pi->saved_r2 = r2();
... | false | false | false | false | false | 0 |
fritzboxPutMessage( int nSock, unsigned nApplId, unsigned char *pnMsg ) {
unsigned char anSendBuffer[ SEND_BUFSIZ ];
int nNum;
int nLen = CAPIMSG_LEN( pnMsg );
int nCommand = CAPIMSG_COMMAND( pnMsg );
int nSubCommand = CAPIMSG_SUBCOMMAND( pnMsg );
nLen = capi_processMessage( pnMsg, nApplId, nCommand, nSubCommand... | true | true | false | false | false | 1 |
img_hash_cra_init(struct crypto_tfm *tfm)
{
struct img_hash_ctx *ctx = crypto_tfm_ctx(tfm);
const char *alg_name = crypto_tfm_alg_name(tfm);
int err = -ENOMEM;
ctx->fallback = crypto_alloc_ahash(alg_name, 0,
CRYPTO_ALG_NEED_FALLBACK);
if (IS_ERR(ctx->fallback)) {
pr_err("img_hash: Could not load fallbac... | false | false | false | false | false | 0 |
rb_symname_p(name)
const char *name;
{
const char *m = name;
int localid = Qfalse;
if (!m) return Qfalse;
switch (*m) {
case '\0':
return Qfalse;
case '$':
if (is_special_global_name(++m)) return Qtrue;
goto id;
case '@':
if (*++m == '@') ++m;
goto id;
case '<':
swi... | false | false | false | false | false | 0 |
rb_obj_protected_methods(argc, argv, obj)
int argc;
VALUE *argv;
VALUE obj;
{
if (argc == 0) { /* hack to stop warning */
VALUE args[1];
args[0] = Qtrue;
return rb_class_protected_instance_methods(1, args, CLASS_OF(obj));
}
return rb_class_protected_instance_methods(argc, argv, CLASS_OF(obj... | false | false | false | false | false | 0 |
Java_org_mortbay_setuid_SetUID_getgrgid(JNIEnv * env, jclass j, jint gid)
{
struct group* gr;
gr=getgrgid(gid);
if (!gr)
{
char strErr[255];
sprintf(strErr, "Group with gid %d is not found!!!", gid);
throwNewJavaSecurityException(env, strErr);
return NULL;
}
... | false | false | false | false | false | 0 |
PlotCmd_from_tmpfile(void)
{
PlotCmd cmd;
if (!silent_mode && !again)
switch (vec_cntr_r++) {
case 0:
Eprintf("\nProcessing Cmd: ");
break;
case 1:
Eprintf("1 ");
break;
case 2:
Eprintf("2 ");
break;
case 5:
Eprintf("5 ");
break;
case 10:
Eprintf("10 ");
break;
case 20:
... | false | true | false | false | true | 1 |
language_cxx_trigger_completion (Language_Provider *lgcxx, guint ch)
{
g_return_if_fail(lgcxx);
Language_CXXDetails *lgcxxdet = LANGUAGE_CXX_GET_PRIVATE(lgcxx);
gint current_pos;
gchar *member_function_buffer = NULL;
guint prev_char;
current_pos = gtk_scintilla_get_current_pos(lgcxxdet->sci);
gboolean aut... | false | false | false | false | false | 0 |
gtty (fd, params)
int fd;
struct sgttyb *params;
{
if (params == NULL)
{
__set_errno (EINVAL);
return -1;
}
__set_errno (ENOSYS);
return -1;
} | false | false | false | false | false | 0 |
addBinary(Literal p, Literal q, bool learnt) {
uint32 added = 0;
if (!shared_) {
if (!learnt) { p.clearWatch(); q.clearWatch(); }
else { p.watch(); q.watch(); }
getList(~p).push_left(q);
getList(~q).push_left(p);
added = 1;
}
#if WITH_THREADS
else if (learnt && !getList(~p).hasLearnt(q)) {
getLi... | false | false | false | false | false | 0 |
luaI_print (void) {
TaggedString *ts = luaS_new("tostring");
lua_Object obj;
int i = 1;
while ((obj = lua_getparam(i++)) != LUA_NOOBJECT) {
luaA_pushobject(&ts->u.s.globalval);
lua_pushobject(obj);
luaD_call((L->stack.top-L->stack.stack)-1, 1);
if (ttype(L->stack.top-1) != LUA_T_STRING)
lu... | false | false | false | false | false | 0 |
validation_error_str(int validation_error)
{
const char *placeholder= _("Unknown validation error.");
/* THIS IS A TEMPORARY PLACEHOLDER !!!! */
const char *str_error[] = { _(""),
_(""),
_(""),
_(""),
... | false | false | false | false | false | 0 |
ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis )
{
if ( replaceThis->parent != this )
return 0;
TiXmlNode* node = withThis.Clone();
if ( !node )
return 0;
node->next = replaceThis->next;
node->prev = replaceThis->prev;
if ( replaceThis->next )
replaceThis->next->prev = node;
else
last... | false | false | false | false | false | 0 |
gst_spectrum_free_channel_data (GstSpectrum * spectrum)
{
if (spectrum->channel_data) {
gint i;
GstSpectrumChannel *cd;
GST_DEBUG_OBJECT (spectrum, "freeing data for %d channels",
spectrum->num_channels);
for (i = 0; i < spectrum->num_channels; i++) {
cd = &spectrum->channel_data[i];
... | false | false | false | false | false | 0 |
merge_trees(struct tree *head,
struct tree *merge,
struct tree *common,
const char *branch1,
const char *branch2,
struct tree **result)
{
int code, clean;
if (subtree_merge) {
merge = shift_tree_object(head, merge);
common = shift_tree_object(head, common);
}
if (sha_eq(common->object.sha1, merge->o... | false | false | false | false | false | 0 |
scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx)
{
struct page *page = NULL;
unsigned long index;
struct scrub_fixup_nodatasum *fixup = fixup_ctx;
int ret;
int corrected = 0;
struct btrfs_key key;
struct inode *inode = NULL;
struct btrfs_fs_info *fs_info;
u64 end = offset + PAGE_SIZE - 1;
... | false | false | false | false | false | 0 |
globus_gatekeeper_util_tokenize(char * command,
char ** args,
int * n,
char * sep)
{
int i;
char * cp;
char * pp;
char * qp;
char ** arg;
arg = args;
i = *n - 1;
cp = command;
while (*cp)
{
/* skip leading sep characters */
while (*cp && strchr(sep, *cp))
{
cp++;
}... | false | false | false | false | false | 0 |
GC_init_linux_data_start()
{
extern ptr_t GC_find_limit();
if (GC_no_dls)
/*
* Not needed, avoids the SIGSEGV caused by GC_find_limit which
* complicates debugging.
*/
return;
# ifdef LINUX
/* Try the easy approaches first: */
if ((ptr_t)__data_start != 0) {
GC_data_start = (ptr_... | true | true | false | false | false | 1 |
i2c_dev_init(void)
{
int res;
printk(KERN_INFO "i2c /dev entries driver\n");
res = register_chrdev(I2C_MAJOR, "i2c", &i2cdev_fops);
if (res)
goto out;
i2c_dev_class = class_create(THIS_MODULE, "i2c-dev");
if (IS_ERR(i2c_dev_class)) {
res = PTR_ERR(i2c_dev_class);
goto out_unreg_chrdev;
}
i2c_dev_class-... | false | false | false | false | false | 0 |
xlw_popup_menu (widget, event)
Widget widget;
XEvent *event;
{
XlwMenuWidget mw;
if (!XtIsShell (widget))
return;
mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
if (event)
XtCallActionProc ((Widget) mw, "start", event, NULL, 0);
else
{
XEvent dummy;
... | false | false | false | false | false | 0 |
alloc_buf(struct virtqueue *vq, size_t buf_size,
int pages)
{
struct port_buffer *buf;
reclaim_dma_bufs();
/*
* Allocate buffer and the sg list. The sg list array is allocated
* directly after the port_buffer struct.
*/
buf = kmalloc(sizeof(*buf) + sizeof(struct scatterlist) * pages,
GFP_KE... | false | false | false | false | false | 0 |
Csec_map2id(Csec_context_t *ctx, char *principal, uid_t *uid, gid_t *gid) {
char *func = "Csec_map2id";
char username[CA_MAXNAMELEN];
*uid = *gid = -1;
if (Csec_map2name(ctx, principal, username, CA_MAXNAMELEN)<0) {
Csec_trace(func, "Could not find mapping for <%s>\n", principal)
/* Serrno and e... | true | true | false | false | false | 1 |
procmsg_get_thread_tree(GSList *mlist)
{
GNode *root, *parent, *node, *next;
GHashTable *msgid_table;
GHashTable *subject_hashtable = NULL;
MsgInfo *msginfo;
const gchar *msgid;
GSList *reflist;
START_TIMING("");
root = g_node_new(NULL);
msgid_table = g_hash_table_new(g_str_hash, g_str_equal);
if (pr... | false | false | false | false | false | 0 |
gl_color_combo_button_new (const gchar *icon_name,
const gchar *default_label,
guint default_color,
guint color)
{
glColorComboButton *this;
GtkWidget *wimage;
GdkPixbuf *pixbuf1,... | false | false | false | false | false | 0 |
cmdline_parse (int key, char *arg, struct argp_state *state)
{
struct ipmi_oem_arguments *cmd_args = state->input;
error_t ret;
switch (key)
{
case LIST_KEY:
cmd_args->list = 1;
break;
case VERBOSE_KEY:
cmd_args->verbose_count++;
break;
case ARGP_KEY_ARG:
{
i... | false | false | false | false | false | 0 |
random_hint(void)
{
struct hint *v, *r = NULL;
int n;
for (v = hints, n = 1; v; v = v->next, n++)
if (one_in_(n))
r = v;
return r->hint;
} | false | false | false | true | false | 1 |
temp_input_show(struct device *dev, struct device_attribute *attr, char *buf)
{
int temperature;
int ret;
struct thermal_hwmon_attr *hwmon_attr
= container_of(attr, struct thermal_hwmon_attr, attr);
struct thermal_hwmon_temp *temp
= container_of(hwmon_attr, struct thermal_hwmon_temp,
temp_input);
... | false | true | false | false | false | 1 |
MakeDateRecent(bool checked, wxDatePickerCtrl *picker)
{
wxDateTime when = picker->GetValue();
if( checked && (!when.IsValid() ||
when < wxDateTime(1, wxDateTime::Jan, 1975, 0, 0, 0)) )
{
when = wxDateTime::Now();
picker->SetValue(when);
}
} | false | false | false | false | false | 0 |
HTTP_HostOfURL(char *url)
{
static char host[1024];
char *cps;
char *cpe;
cps = strstr(url, "//");
cps += 2;
for (cpe = cps; *cpe != '/' && *cpe != ':' && *cpe != NUL; cpe++)
;
strncpy(host, cps, cpe-cps);
host[cpe-cps] = NUL;
return host;
} | false | false | false | false | false | 0 |
nodeListChunkRest(EvalContext &context, Interpreter &interp, bool &chunk)
{
if (!head_ || !head_->nodeListFirst(context, interp))
return tail_->nodeListChunkRest(context, interp, chunk);
NodeListObj *tem = head_->nodeListChunkRest(context, interp, chunk);
ELObjDynamicRoot protect(interp, tem);
return new (i... | false | false | false | false | false | 0 |
freeContext (OOCTXT* pctxt)
{
ASN1BOOL saveBuf;
ast_mutex_lock(&pctxt->pLock);
saveBuf = (pctxt->flags & ASN1SAVEBUF) != 0;
if (pctxt->buffer.dynamic && pctxt->buffer.data) {
if (saveBuf) {
memHeapMarkSaved (&pctxt->pMsgMemHeap, pctxt->buffer.data, TRUE);
}
else {
mem... | false | false | false | false | false | 0 |
RetainedSize(bool exact) {
if (exact && (retained_size_ & kExactRetainedSizeTag) == 0) {
CalculateExactRetainedSize();
}
return retained_size_ & (~kExactRetainedSizeTag);
} | false | false | false | false | false | 0 |
addForcedTname( char *token, int tnum )
#else
addForcedTname( token, tnum )
char *token;
int tnum;
#endif
{
TermEntry *p;
require(token!=NULL, "addTname: invalid token name");
if ( (p=(TermEntry *)hash_get(Tname, token)) != NULL ) return p->token;
p = newTermEntry( token );
Ttrack( p->str );
p->token = tnum;
ha... | false | false | false | false | false | 0 |
C4_Model_add_state(C4_Model *model, gchar *name){
register C4_State *state = C4_State_create(name);
g_assert(model);
g_assert(name);
g_assert(model->is_open);
g_ptr_array_add(model->state_list, state);
return state;
} | false | false | false | false | false | 0 |
id3v2_frame_finish (GstId3v2Tag * tag, GstId3v2Frame * frame)
{
if (frame->dirty) {
frame->len = frame->writer->len - 10;
GST_LOG ("[%s] %u bytes", frame->id, frame->len);
if (tag->major_version == 3) {
GST_WRITE_UINT32_BE (frame->writer->str + 4, frame->len);
} else {
/* Version 4 uses a ... | false | false | false | false | false | 0 |
PushToHistory (const string &str){
TContext *ctx=GetCurrentContext();
if (!ctx) return;
ctx->history.push_back(str);
} | false | false | false | false | false | 0 |
add_bit( libspectrum_byte bit )
{
current_byte <<= 1;
current_byte |= (bit & 0x01);
if( ++num_bits == 8 ) {
data.push_back(current_byte);
current_byte = 0;
num_bits = 0;
}
} | false | false | false | false | false | 0 |
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
GObject *object;
NMDeviceInfinibandPrivate *priv;
NMDevice *self;
object = G_OBJECT_CLASS (nm_device_infiniband_parent_class)->constructor (type,
... | false | false | false | false | false | 0 |
close_engine(void) {
if(!engines[current_engine])
return; /* no engine was opened -> nothing to do */
init_engine();
++current_engine;
#if 0
ENGINE_finish(e);
ENGINE_free(e);
e=NULL;
s_log(LOG_DEBUG, "Engine closed");
#endif
} | false | false | false | false | false | 0 |
e2_combobox_append_history_strv (GtkWidget *combo, gchar **strv)
{
guint i;
for (i = 0; strv[i] != NULL; i++)
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), strv[i]);
} | false | false | false | false | false | 0 |
imapx_parse_capability (CamelIMAPXStream *stream,
GCancellable *cancellable,
GError **error)
{
gint tok;
guint len;
guchar *token, *p, c;
gboolean free_token = FALSE;
struct _capability_info * cinfo;
GError *local_error = NULL;
cinfo = g_malloc0 (sizeof (*cinfo));... | false | false | false | false | false | 0 |
hash_chainon (tree list1, tree list2)
{
if (list2 == 0)
return list1;
if (list1 == 0)
return list2;
if (TREE_CHAIN (list1) == NULL_TREE)
return hash_tree_chain (TREE_VALUE (list1), list2);
return hash_tree_chain (TREE_VALUE (list1),
hash_chainon (TREE_CHAIN (list1), list2));
} | false | false | false | false | false | 0 |
imsp_to_ldap_filter(abook_fielddata *flist, int fcount, char **filter,
struct ldap_config ldapconfig)
{
int i, j;
static char filt[2048];
int filter_is_empty = 1;
strlcpy(filt, "(&", sizeof(filt));
strlcat(filt, ldapconfig.defaultfilter, sizeof(filt));
for (i = 0; i < fcount; i++) {
for... | false | false | false | false | false | 0 |
e_cal_backend_get_object_finish (ECalBackend *backend,
GAsyncResult *result,
GError **error)
{
GSimpleAsyncResult *simple;
AsyncContext *async_context;
gchar *calobj;
g_return_val_if_fail (
g_simple_async_result_is_valid (
result, G_OBJECT (back... | false | false | false | false | false | 0 |
SetSizeHints( int minX, int minY )
{
if( mShuttleMode != eIsCreating )
return;
mpLastWind->SetSizeHints( minX, minY );
} | false | false | false | false | false | 0 |
visitShuffleVectorInst(ShuffleVectorInst &I){
ExecutionContext &SF = ECStack.back();
Type *Ty = I.getType();
if(!(Ty->isVectorTy()))
llvm_unreachable("Unhandled dest type for shufflevector instruction");
GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
GenericValue Src2 = getOperandValue(I.getO... | false | false | false | false | false | 0 |
prand_clip_point(prand *s, double *cd, double *d) {
int e, di = s->di;
double ss = 0.0;
int rv = 0;
for (e = 0; e < di; e++) {
ss += d[e];
cd[e] = d[e];
if (cd[e] < 0.0) {
cd[e] = 0.0;
rv |= 1;
} else if (cd[e] > 1.0) {
cd[e] = 1.0;
rv |= 1;
} \
}
if (ss > s->ilimit) {
ss ... | false | false | false | false | false | 0 |
hb_ot_position_default (hb_ot_shape_context_t *c)
{
hb_direction_t direction = c->buffer->props.direction;
unsigned int count = c->buffer->len;
hb_glyph_info_t *info = c->buffer->info;
hb_glyph_position_t *pos = c->buffer->pos;
for (unsigned int i = 0; i < count; i++)
{
c->font->get_glyph_advance_for_di... | false | false | false | false | false | 0 |
ide_find_port_slot(const struct ide_port_info *d)
{
int idx = -ENOENT;
u8 bootable = (d && (d->host_flags & IDE_HFLAG_NON_BOOTABLE)) ? 0 : 1;
u8 i = (d && (d->host_flags & IDE_HFLAG_QD_2ND_PORT)) ? 1 : 0;
/*
* Claim an unassigned slot.
*
* Give preference to claiming other slots before claiming ide0/ide1,
... | false | false | false | false | false | 0 |
disassociate_ctty(int on_exit)
{
struct tty_struct *tty;
if (!current->signal->leader)
return;
tty = get_current_tty();
if (tty) {
if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY) {
tty_vhangup_session(tty);
} else {
struct pid *tty_pgrp = tty_get_pgrp(tty);
if (tty_pgrp) {
kill_pgrp(tt... | false | false | false | false | false | 0 |
PK11_ImportDERCert(PK11SlotInfo *slot, SECItem *derCert,
CK_OBJECT_HANDLE key, char *nickname, PRBool includeTrust)
{
CERTCertificate *cert;
SECStatus rv;
cert = CERT_NewTempCertificate(CERT_GetDefaultCertDB(),
derCert, NULL, PR_FALSE, PR_TRUE);
if (cert == NULL) r... | false | false | false | false | false | 0 |
extract_ChargeRadical( char *elname, int *pnRadical, int *pnCharge )
{
char *q, *r, *p;
int nCharge=0, nRad = 0, charge_len = 0, k, nVal, nSign, nLastSign=1, len;
p = elname;
/* extract radicals & charges */
while ( q = strpbrk( p, "+-^" ) ) {
switch ( *q ) {
case '+':
ca... | false | false | false | false | false | 0 |
hydra_receive_line(int socket) {
char buf[1024], *buff, *buff2, text[64];
int i, j = 1, k, got = 0;
if ((buff = malloc(sizeof(buf))) == NULL) {
fprintf(stderr, "[ERROR] could not malloc\n");
return NULL;
}
memset(buff, 0, sizeof(buf));
if (debug)
printf("[DEBUG] hydra_receive_line: waittime: %d... | false | false | false | false | false | 0 |
gfarm_server_initialize(void)
{
gfarm_error_t e;
gflog_initialize();
e = gfarm_server_config_read();
if (e != GFARM_ERR_NO_ERROR) {
gflog_debug(GFARM_MSG_1000977,
"gfarm_server_config_read() failed: %s",
gfarm_error_string(e));
return (e);
}
gfarm_config_set_default_spool_on_server();
return (GFARM... | false | false | false | false | false | 0 |
chunk_alloc(size_t size, bool base, bool *zero)
{
void *ret;
assert(size != 0);
assert((size & chunksize_mask) == 0);
#ifdef JEMALLOC_SWAP
if (swap_enabled) {
ret = chunk_alloc_swap(size, zero);
if (ret != NULL)
goto RETURN;
}
if (swap_enabled == false || opt_overcommit) {
#endif
#ifdef JEMALLOC_DSS
r... | false | false | false | false | false | 0 |
Get(const JString &_name)
{
for (u32 i = 0; i < index.size(); ++i)
{
if (index[i] && index[i]->name == _name)
{
if (index[i]->res)
{
return index[i]->res->data;
}
// Encontrado pero no cargado
return 0;
}
}
return 0;
} | false | false | false | false | false | 0 |
rt_tile_free_all(RendererTiles *rt)
{
GList *work;
work = rt->tiles;
while (work)
{
ImageTile *it;
it = work->data;
work = work->next;
rt_tile_free(it);
}
g_list_free(rt->tiles);
rt->tiles = NULL;
rt->tile_cache_size = 0;
} | false | false | false | false | false | 0 |
jitter_d(node_t * np, int nG, int n)
{
int k;
for (k = n; k < Ndim; k++)
ND_pos(np)[k] = nG * drand48();
} | false | false | false | false | true | 1 |
xattach_pipes (class reader_t *inpipe_,
class writer_t *outpipe_)
{
zmq_assert (inpipe_ && outpipe_);
zmq_assert (in_pipes.size () == out_pipes.size ());
in_pipes.push_back (inpipe_);
out_pipes.push_back (outpipe_);
} | false | false | false | false | false | 0 |
gw_am_add_recent_file ( const gchar *filepath) {
gint result = -1;
gchar *recents_files = NULL;
gint max_nb_files = -1;
gchar **recents_files_list = NULL;
gint i = 0;
gboolean already_exist = FALSE;
gchar *recents_files_tmp = NULL;
gchar *recents_file = NULL;
#if GW_DEBUG_MODE
gw_am_log_msg ( 0, __FILE__, __... | false | false | false | false | false | 0 |
ario_notification_manager_get_instance (void)
{
ARIO_LOG_FUNCTION_START;
static ArioNotificationManager *notification_manager = NULL;
ArioServer *server;
if (!notification_manager) {
ArioNotifier *notifier;
notification_manager = g_object_new (TYPE_ARIO_... | false | false | false | false | false | 0 |
equals(TokenizerPos& pos) const {
return (m_col == pos.m_col && m_line == pos.m_line);
} | false | false | false | false | false | 0 |
startWorkers(fm_index *fmi, int num, char *pats) {
// Starts 4 threads, each of which will process num/4 patterns
// There are no synchronization primitives because they're unnecessary.
pthread_t threads[4];
int i;
void *status;
struct thread_args **ta = malloc(4 * sizeof (struct thread_args*));
for (i = ... | false | false | false | false | false | 0 |
uid_clean_up(struct mail_cache_db * uid_db,
struct mailmessage_list * env_list)
{
chash * hash_exist;
int res;
int r;
unsigned int i;
chashdatum key;
chashdatum value;
char key_str[PATH_MAX];
/* flush cache */
hash_exist = chash_new(CHASH_DEFAULTSIZE, CHASH_COPYALL);
if (hash_exist == NULL... | true | true | false | false | false | 1 |
ajBtreeIdwildDel(AjPBtIdwild *Pthis)
{
AjPBtIdwild thys = NULL;
AjPBtId id = NULL;
if(!Pthis || !*Pthis)
return;
thys = *Pthis;
ajStrDel(&thys->id);
while(ajListPop(thys->list,(void **)&id))
ajBtreeIdDel(&id);
ajListFree(&thys->list);
AJFREE(thys);
*Pthis = NULL;
... | false | false | false | false | false | 0 |
dbus_server_listen (const char *address,
DBusError *error)
{
DBusServer *server;
DBusAddressEntry **entries;
int len, i;
DBusError first_connect_error = DBUS_ERROR_INIT;
dbus_bool_t handled_once;
_dbus_return_val_if_fail (address != NULL, NULL);
_dbus_return_val_if_error_is... | false | false | false | false | false | 0 |
main(int argc, char *argv[]) {
cl::ParseCommandLineOptions(argc, argv);
sys::PrintStackTraceOnErrorSignal();
PrettyStackTraceProgram X(argc, argv);
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
if (std::error_code EC = dumpInput(InputFilename)) {
errs() << "Error: '" << EC.message() << "'\n";
... | false | false | false | false | false | 0 |
rtl8723_download_fw(struct ieee80211_hw *hw,
bool is_8723be, int max_count)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtlwifi_firmware_header *pfwheader;
u8 *pfwdata;
u32 fwsize;
int err;
enum version_8723e version = rtlhal->version;
int max_page;
if ... | false | false | false | false | false | 0 |
shootArray(const int size, long* vect, double m) {
int i;
for (i=0; i<size; ++i)
vect[i] = shoot(m);
} | 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.