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 |
|---|---|---|---|---|---|---|
as102_alloc_usb_stream_buffer(struct as102_dev_t *dev)
{
int i;
dev->stream = usb_alloc_coherent(dev->bus_adap.usb_dev,
MAX_STREAM_URB * AS102_USB_BUF_SIZE,
GFP_KERNEL,
&dev->dma_addr);
if (!dev->stream) {
dev_dbg(&dev->bus_adap.usb_dev->dev,
"%s: usb_buffer_alloc failed\n", __... | false | false | false | false | false | 0 |
guc_ring_doorbell(struct i915_guc_client *gc)
{
struct guc_process_desc *desc;
union guc_doorbell_qw db_cmp, db_exc, db_ret;
union guc_doorbell_qw *db;
void *base;
int attempt = 2, ret = -EAGAIN;
base = kmap_atomic(i915_gem_object_get_page(gc->client_obj, 0));
desc = base + gc->proc_desc_offset;
/* Update the... | false | false | false | false | false | 0 |
catenate(const char *pString)
{
if (pString!=0)
{
unsigned slen=strlen(pString);
unsigned len=length()+slen;
char *temp=new char[len+1];
if (string()!=0) fastcopy(string(),temp,length());
fastcopy(pString,temp+length(),slen);
if (string()!=0) delete [] _string;
_stri... | false | false | false | false | false | 0 |
yapp2unix(char *ytime)
{
int i;
unsigned short time, date;
if (strlen(ytime) != 8)
return 0;
for (i = 0; i < 8; i++)
if (!isxdigit(ytime[i]))
return 0;
time = strtoul(ytime + 4, (char **) NULL, 16);
ytime[4] = 0;
date = strtoul(ytime, (char **) NULL, 16);
return (date_dos2unix(time, date));
} | false | false | false | false | false | 0 |
wrkval_grow(int32 nsize)
{
int32 osize;
osize = __wrkval_buflen;
if (osize == 0)
{
if (nsize > RECLEN) __wrkval_buflen = nsize;
else __wrkval_buflen = RECLEN;
__wrkvalbufp = __my_malloc(__wrkval_buflen);
return;
}
__wrkvalbufp = __my_realloc(__wrkvalbufp, osize, nsize);
__wrkval_buflen = nsize;
} | false | false | false | false | false | 0 |
string_assign(STRING *str, CHAR *init)
{
if(str)
{
if(str->str != init)
{
os_free(str->str);
str->str = os_new(CHAR, strlen(init) + 1);
strcpy(str->str, init);
str->len = strlen(init);
str->allocated_len = str->len + 1;
}
}
else
{
str = string_new(init);
}
return str;
} | false | false | false | false | false | 0 |
setPerformanceTestEnabled(DOMElement *elemNetwork)
{
DOMElement *elemTestEnabled = NULL;
if(elemNetwork == NULL) return E_UNKNOWN;
ASSERT_NETWORK_OPTIONS_PARENT
(elemNetwork->getNodeName(), OPTIONS_NODE_PERFORMANCE_TEST);
getDOMChildByName(elemNetwork, OPTIONS_NODE_PERFORMANCE_TEST, elemTestEnabled, false);
if... | false | false | false | false | false | 0 |
jas_iccprof_destroy(jas_iccprof_t *prof)
{
if (prof->attrtab)
jas_iccattrtab_destroy(prof->attrtab);
if (prof->tagtab.ents)
jas_free(prof->tagtab.ents);
jas_free(prof);
} | false | false | false | false | false | 0 |
refresh_preview_surfaces (void)
{
guint i;
GdkPixbuf *scaled = NULL;
GtkWidget *widget = preview_widgets[0];
GtkStyleContext *context;
GdkRGBA bg;
cairo_t *cr;
GdkRectangle preview_rect;
context = gtk_widget_get_style_context (widget);
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_N... | false | false | false | false | false | 0 |
decorationMask() const {
unsigned int ret = 0;
if (decorations.titlebar)
ret |= WindowState::DECORM_TITLEBAR;
if (decorations.handle)
ret |= WindowState::DECORM_HANDLE;
if (decorations.border)
ret |= WindowState::DECORM_BORDER;
if (decorations.iconify)
ret |= WindowSt... | false | false | false | false | false | 0 |
find_desc(const char *dev)
{
struct chan_oss_pvt *o = NULL;
if (!dev)
ast_log(LOG_WARNING, "null dev\n");
for (o = oss_default.next; o && o->name && dev && strcmp(o->name, dev) != 0; o = o->next);
if (!o)
ast_log(LOG_WARNING, "could not find <%s>\n", dev ? dev : "--no-device--");
return o;
} | false | false | false | false | false | 0 |
GetUserDefinedValue(const char *name) const
{
if( name && *name )
{
UserDefinedValue key(name);
UserDefinedValues::const_iterator it = UserDefinedValuePool.find( key );
assert( strcmp(it->Name.c_str(), name) == 0 );
return it->Value.c_str();
}
return NULL;
} | false | false | false | false | false | 0 |
calc_max_width()
{
/* maxwidth is the maximum width of the long argument */
unsigned maxwidth = 0;
unsigned i;
for(i = 0; i < cli_option_count; i++) {
unsigned width = 0;
cli_option* o = cli_full_options[i];
if(o->name) {
width += strlen(o->name);
switch(o->type) {
case CLI_STRING:... | false | false | false | false | false | 0 |
stktable_trash_oldest(struct stktable *t, int to_batch)
{
struct stksess *ts;
struct eb32_node *eb;
int batched = 0;
eb = eb32_lookup_ge(&t->exps, now_ms - TIMER_LOOK_BACK);
while (batched < to_batch) {
if (unlikely(!eb)) {
/* we might have reached the end of the tree, typically because
* <now_ms> is i... | false | false | false | false | false | 0 |
Letter(size_t vl, size_t vr, int i) const{
char l;
if(i==1){
l = (char)csa->getT(vl);
return l;
}
/*else return Letter(psi_{i-1}(vl),1)*/
size_t p1 = vl+1;
for(size_t j=0; j<(size_t)(i-1); j++)
p1 = csa->getPsi(p1);
/*
uint v_sa, v_i;
v_sa = csa_lookup(csa, v->left+1)-1; //SA[v->left]
v_i = ... | false | false | false | false | false | 0 |
bgzf_flush(BGZF* fp)
{
while (fp->block_offset > 0) {
int count, block_length;
block_length = deflate_block(fp, fp->block_offset);
if (block_length < 0) return -1;
#ifdef _USE_KNETFILE
count = fwrite(fp->compressed_block, 1, block_length, fp->x.fpw);
#else
count = fwrite(fp->compre... | false | false | false | false | false | 0 |
cache_dump_multi(struct list_head *list)
{
struct list_head *p;
struct mapent *me;
list_for_each(p, list) {
me = list_entry(p, struct mapent, multi_list);
logmsg("key=%s", me->key);
}
} | false | false | false | false | false | 0 |
addArtist( Meta::ArtistPtr artistPtr )
{
m_mc->addArtist( artistPtr );
const Meta::ServiceArtistPtr artist = Meta::ServiceArtistPtr::dynamicCast( artistPtr );
if ( artist && artist->id() != 0 )
m_artistIdMap.insert( artist->id(), artistPtr );
} | false | false | false | false | false | 0 |
eebmd_rmall(GtkWidget *w, gpointer data)
{
list<EngineBookmark *>::iterator ei;
EEBMDp me;
me=(EEBMDp) data;
for(ei=global.EnginePresets.begin();ei!=global.EnginePresets.end();ei++)
delete(*ei);
global.EnginePresets.clear();
global.writeRC();
me->refresh();
me->updateRightPane();
} | false | false | false | false | false | 0 |
uri_decoded_copy (const char *part,
gsize length)
{
unsigned char *s, *d;
char *decoded = g_strndup (part, length);
s = d = (unsigned char *)decoded;
do {
if (*s == '%') {
if (!g_ascii_isxdigit (s[1]) ||
!g_ascii_isxdigit (s[2])) {
... | false | false | false | false | false | 0 |
AcpiUtCreateUpdateState (
ACPI_OPERAND_OBJECT *Object,
UINT16 Action)
{
ACPI_GENERIC_STATE *State;
ACPI_FUNCTION_ENTRY ();
/* Create the generic state object */
State = AcpiUtCreateGenericState ();
if (!State)
{
return (NULL);
}
/* Init fie... | false | false | false | false | false | 0 |
_close_session (ipmiconsole_ctx_t c)
{
assert (c);
assert (c->magic == IPMICONSOLE_CTX_MAGIC);
assert (c->session.close_session_flag);
/*
* Close the session differently depending on the state of the session
*/
if (c->session.protocol_state == IPMICONSOLE_PROTOCOL_STATE_START
|| c->session.protoc... | false | false | false | false | false | 0 |
e_win_centered_set(E_Win *win, int centered)
{
E_OBJECT_CHECK(win);
E_OBJECT_TYPE_CHECK(win, E_WIN_TYPE);
if ((win->state.centered) && (!centered))
{
win->state.centered = 0;
_e_win_state_update(win);
}
else if ((!win->state.centered) && (centered))
{
win->state.center... | false | false | false | false | false | 0 |
find_afterward (struct decision_head *head, struct decision *real_afterward)
{
struct decision *p, *q, *afterward;
/* We can't propagate alternatives across subroutine boundaries.
This is not incorrect, merely a minor optimization loss. */
p = head->first;
afterward = (p->subroutine_number > 0 ? NULL : ... | false | false | false | false | false | 0 |
isl_qpolynomial_neg(__isl_take isl_qpolynomial *qp)
{
if (!qp)
return NULL;
return isl_qpolynomial_mul_isl_int(qp, qp->dim->ctx->negone);
} | false | false | false | false | false | 0 |
pairbasicfree(VALUE_PAIR *pair)
{
if (pair->type == PW_TYPE_TLV) free(pair->vp_tlv);
/* clear the memory here */
memset(pair, 0, sizeof(*pair));
free(pair);
} | false | false | false | false | false | 0 |
qnx6_match(struct super_block *s, int len, const char *name,
struct qnx6_dir_entry *de)
{
struct qnx6_sb_info *sbi = QNX6_SB(s);
if (memcmp(name, de->de_fname, len) == 0)
return fs32_to_cpu(sbi, de->de_inode);
return 0;
} | false | false | false | false | false | 0 |
netxen_nic_get_pauseparam(struct net_device *dev,
struct ethtool_pauseparam *pause)
{
struct netxen_adapter *adapter = netdev_priv(dev);
__u32 val;
int port = adapter->physical_port;
pause->autoneg = 0;
if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
if ((port < 0) || (port >= NETXEN_NIU_MAX_GBE_PORTS))
... | false | false | false | false | false | 0 |
RemovePlayerSpecificFlag(uint16 index, uint32 oldFlag, Player* plr)
{
/* Validate input */
MANGOS_ASSERT(index < m_valuesCount || PrintIndexError(index, true));
uint32 oldval, newval;
/* See if we already have custom flags set for the player */
if (m_plrSpecificFlags.find(plr->GetGUIDLow()) != m_p... | false | false | false | false | false | 0 |
PyVTKObject_GetAttr(PyObject *op, PyObject *attr)
{
PyVTKObject *self = (PyVTKObject *)op;
char *name = PyString_AsString(attr);
PyVTKClass *pyclass = self->vtk_class;
PyObject *bases;
PyObject *value;
if ((value = PyDict_GetItem(self->vtk_dict, attr)))
{
Py_INCREF(value);
return value;
}
... | false | false | false | true | false | 1 |
do_vio_entry(const char *filename, void *symval,
char *alias)
{
char *tmp;
DEF_FIELD_ADDR(symval, vio_device_id, type);
DEF_FIELD_ADDR(symval, vio_device_id, compat);
sprintf(alias, "vio:T%sS%s", (*type)[0] ? *type : "*",
(*compat)[0] ? *compat : "*");
/* Replace all whitespace with underscores */
for (tmp... | false | true | false | false | false | 1 |
camel_imapx_command_queue_get_length (CamelIMAPXCommandQueue *queue)
{
g_return_val_if_fail (queue != NULL, 0);
return g_queue_get_length ((GQueue *) queue);
} | false | false | false | false | false | 0 |
OnCreatureCreate(Creature* pCreature)
{
switch (pCreature->GetEntry())
{
case NPC_ZOLO:
case NPC_GASHER:
case NPC_LORO:
case NPC_HUKKU:
case NPC_ZULLOR:
case NPC_MIJAN:
++m_uiProtectorsRemaining;
break;
case NPC_JAMMALAN:
ca... | false | false | false | false | false | 0 |
HasTranslucentPolygonalGeometry()
{
int result=0;
result |= this->LinesActor->HasTranslucentPolygonalGeometry();
if ( this->Actor->GetVisibility() )
{
result |= this->Actor->HasTranslucentPolygonalGeometry();
}
if ( this->ActiveActor->GetVisibility() )
{
result |= this->ActiveActor->HasTrans... | false | false | false | false | false | 0 |
gf_bt_offset_time(GF_BTParser *parser, Double *time)
{
if (!parser->is_wrl) {
Double res;
res = parser->au_time;
res /= parser->bifs_es->timeScale;
*time += res;
}
} | false | false | false | false | false | 0 |
score_value (GstBaseTransform * base, const GstVideoFormatInfo * in_info,
const GValue * val, gint * min_loss, const GstVideoFormatInfo ** out_info)
{
const gchar *fname;
const GstVideoFormatInfo *t_info;
GstVideoFormatFlags in_flags, t_flags;
gint loss;
fname = g_value_get_string (val);
t_info = gst_v... | false | false | false | false | false | 0 |
WriteCreate(nMessage &m, unsigned short cycle_id ){
m << position;
m << direction;
m << distance;
unsigned short flags = 0;
if ( braking )
flags |= 0x01;
if ( chatting )
flags |= 0x02;
m << flags;
// store message ID for later reference
messageID = m.MessageID();
... | false | false | false | false | false | 0 |
add_widget (GtkUIManager *merge, GtkWidget *widget, GtkContainer *container)
{
GtkWidget *handlebox;
if (!GTK_IS_TOOLBAR (widget)) return;
handlebox =gtk_handle_box_new ();
g_object_ref (handlebox);
gtk_handle_box_set_handle_position (GTK_HANDLE_BOX(handlebox),GTK_POS_TOP);
/* GTK_SHADOW_NONE, GTK_SHAD... | false | false | false | false | false | 0 |
incorporateValue(const Value *V) {
if (const MDNode *M = dyn_cast<MDNode>(V))
return incorporateMDNode(M);
if (!isa<Constant>(V) || isa<GlobalValue>(V)) return;
// Already visited?
if (!VisitedConstants.insert(V).second)
return;
// Check this type.
incor... | false | false | false | false | false | 0 |
lha_input_stream_skip(LHAInputStream *stream, size_t bytes)
{
// If we have a dedicated skip function, use it; otherwise,
// the read function can be used to perform a skip.
if (stream->type->skip != NULL) {
return stream->type->skip(stream->handle, bytes);
} else {
uint8_t data[32];
unsigned int len;
int ... | false | false | false | false | false | 0 |
setImmutability(const ImmutabilityType immutable)
{
if (d->immutability == immutable || d->immutability == SystemImmutable) {
return;
}
kDebug() << "setting immutability to" << immutable;
d->immutability = immutable;
d->updateContainmentImmutability();
//tell non-containments that might... | false | false | false | false | false | 0 |
clear_table(int **table){
int i,j;
for(i=0;i<COL;i++){
for(j=0;j<ROW;j++){
table[i][j]=0;
}
}
} | false | false | false | false | false | 0 |
operator==( const WeightContainer & other ) const
{
if( size() != other.size() ) { return false; }
if( m_names != other.m_names ) { return false; }
if( m_weights != other.m_weights ) { return false; }
return true;
} | false | false | false | false | false | 0 |
rb_linebuf_new_line(buf_head_t * bufhead)
{
buf_line_t *bufline;
rb_dlink_node *node;
bufline = rb_linebuf_allocate();
if(bufline == NULL)
return NULL;
++bufline_count;
node = rb_make_rb_dlink_node();
/* Stick it at the end of the buf list */
rb_dlinkAddTail(bufline, node, &bufhead->list);
bufline->refco... | false | false | false | false | false | 0 |
swizzle_texel(const GLfloat texel[4], GLfloat colorOut[4], GLuint swizzle)
{
if (swizzle == SWIZZLE_NOOP) {
COPY_4V(colorOut, texel);
}
else {
GLfloat vector[6];
vector[SWIZZLE_X] = texel[0];
vector[SWIZZLE_Y] = texel[1];
vector[SWIZZLE_Z] = texel[2];
vector[SWIZZLE_W] = tex... | false | false | false | false | false | 0 |
rec_print_new(
/*==========*/
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
ut_ad(rec);
ut_ad(offsets);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (!rec_offs_comp(offsets)) {
rec_print_old... | false | false | false | false | false | 0 |
cdc_ncm_init(struct usbnet *dev)
{
struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
u8 iface_no = ctx->control->cur_altsetting->desc.bInterfaceNumber;
int err;
err = usbnet_read_cmd(dev, USB_CDC_GET_NTB_PARAMETERS,
USB_TYPE_CLASS | USB_DIR_IN
|USB_RECIP_INTERFACE,
0, iface_n... | false | false | false | false | false | 0 |
order_changed (gpointer user_data)
{
GthMetadataChooser *self = user_data;
if (self->priv->changed_id != 0)
g_source_remove (self->priv->changed_id);
self->priv->changed_id = 0;
gth_metadata_chooser_reorder_list (self);
g_signal_emit (self, gth_metadata_chooser_signals[CHANGED], 0);
return FALSE;
} | false | false | false | false | false | 0 |
draw ( void )
{
if ( m_priv->is_draw )
{
draw_in_pixmap (m_priv->cv->drawing);
}
} | false | false | false | false | false | 0 |
c_bpdel(state_t *s)
{
breakpoint_t *bp, *bp_next, *bp_prev;
int i = 0, found = 0;
int type;
/* Find breakpoint with given index */
bp_prev = NULL;
bp = s->bp_list;
while (bp && i < cmd_params [0].val)
{
bp_prev = bp;
bp = bp->next;
i++;
}
if (!bp)
{
sciprintf ("Invalid breakpoint index %i\n",... | false | false | false | false | false | 0 |
split_domain_pma(
__isl_take isl_pw_multi_aff *opt, __isl_take isl_pw_aff *min_expr_pa,
__isl_take isl_set *min_expr, __isl_take isl_mat *cst)
{
int n_in;
int i;
isl_space *space;
isl_pw_multi_aff *res;
if (!opt || !min_expr || !cst)
goto error;
n_in = isl_pw_multi_aff_dim(opt, isl_dim_in);
space = isl_pw_... | false | false | false | false | false | 0 |
qla4xxx_init_response_q_entries(struct scsi_qla_host *ha)
{
uint16_t cnt;
struct response *pkt;
pkt = (struct response *)ha->response_ptr;
for (cnt = 0; cnt < RESPONSE_QUEUE_DEPTH; cnt++) {
pkt->signature = RESPONSE_PROCESSED;
pkt++;
}
} | false | false | false | false | false | 0 |
_bt_page_recyclable(Page page)
{
BTPageOpaque opaque;
/*
* It's possible to find an all-zeroes page in an index --- for example, a
* backend might successfully extend the relation one page and then crash
* before it is able to make a WAL entry for adding the page. If we find a
* zeroed page then reclaim it.
... | false | false | false | false | false | 0 |
tree_diff(group_type **tree1, group_type **tree2, double *lengths1,
double* lengths2, long patternsz1, long patternsz2,
long ntree1, long ntree2, long trees_in_1, long trees_in_2)
{
long diffl;
double diffd;
switch (dtype) {
case PHYLIPSYMMETRIC:
diffl = symetric_diff (t... | false | false | false | false | false | 0 |
full_write(void *data, size_t size)
{
if (fwrite(data, size, 1, idxfile) != 1) {
dico_log(L_ERR, errno, _("write error"));
exit(EX_UNAVAILABLE);
}
} | false | false | false | false | false | 0 |
time_write_xml(output::pointer fp, const char *name, time_t this_thing,
int show)
{
if (this_thing == TIME_NOT_SET && !show)
return;
if (!name)
name = "time";
fp->fprintf
(
"<%s>%ld</%s> <!-- %.24s -->\n",
name,
(long)this_thing,
name,
ctime(&this_thing)
);
} | false | false | false | false | false | 0 |
_recalcWidth()
{
// TODO -- is this really needed ???
// this should not be needed, since lookup properties is called
// when formatting changes - Tomas
//lookupProperties();
getGraphics()->setFont(_getFont());
UT_sint32 iNewWidth = 0;
if(UT_UCS4_strlen(m_sFieldValue) > 0)
{
iNewWidth = getGraphics()->measur... | false | false | false | false | false | 0 |
vsnprintf ( char *buf, size_t size, const char *fmt, va_list args ) {
struct sputc_context sctx;
size_t len;
size_t end;
/* Hand off to vcprintf */
sctx.ctx.handler = printf_sputc;
sctx.buf = buf;
sctx.max_len = size;
len = vcprintf ( &sctx.ctx, fmt, args );
/* Add trailing NUL */
if ( size ) {
end = size... | false | false | false | false | false | 0 |
Init()
{
// This function initializes GnuTLS
m_initialized = true;
int res = gnutls_global_init();
if (res)
{
LogError(res, _T("gnutls_global_init"));
Uninit();
return false;
}
#if TLSDEBUG
if (!pLoggingControlSocket)
{
pLoggingControlSocket = m_pOwner;
gnutls_global_set_log_function(log_func);
gnu... | false | false | false | false | false | 0 |
erase( const string & key )
{
map<string, t_CKUINT>::iterator iter = m_map.find( key );
t_CKINT v = iter != m_map.end();
// if obj
if( m_is_obj && iter != m_map.end() )
((Chuck_Object *)(*iter).second)->release();
// erase
if( v ) m_map.erase( key );
return v;
} | false | false | false | false | false | 0 |
itemdb_isequip3(int nameid)
{
int type = itemdb_type(nameid);
int result;
switch(type) {
case ITEMTYPE_ARMOR:
case ITEMTYPE_WEAPON:
case ITEMTYPE_BOW:
case ITEMTYPE_BOTHHAND:
case ITEMTYPE_ARMORTM:
case ITEMTYPE_ARMORTB:
case ITEMTYPE_ARMORMB:
case ITEMTYPE_ARMORTMB:
case ITEMTYPE_GUN:
case ITEM... | false | false | false | false | false | 0 |
res_WriteDirObj(const struct sess *sp, ssize_t low, ssize_t high)
{
ssize_t u = 0;
size_t ptr, off, len;
struct storage *st;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
ptr = 0;
VTAILQ_FOREACH(st, &sp->obj->store, list) {
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
u += st->len;
len ... | false | false | false | false | false | 0 |
append_removed(gpointer key, gpointer value, gpointer user_data)
{
char *objpath = key;
DBusMessageIter *iter = user_data;
DBG("removed %s", objpath);
dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &objpath);
} | false | false | false | false | false | 0 |
krb5_fcc_interpret(krb5_context context, int errnum)
{
register krb5_error_code retval;
switch (errnum) {
case ENOENT:
retval = KRB5_FCC_NOFILE;
break;
case EPERM:
case EACCES:
#ifdef EISDIR
case EISDIR: /* Mac doesn't have EISDIR */
#endif
case ENOTDIR... | false | false | false | false | false | 0 |
_e_wid_fprev_preview_reset(E_Widget_Data *wd)
{
Evas_Object *o;
evas_object_del(wd->o_preview_scrollframe);
wd->o_preview_scrollframe = wd->o_preview_preview = NULL;
if (wd->preview_text_file_thread) ecore_thread_cancel(wd->preview_text_file_thread);
wd->preview_text_file_thread = NULL;
if (wd->is... | false | false | false | false | false | 0 |
multiline_comment(const std::string& orig, int first_indent, int second_indent)
{
CYG_REPORT_FUNCNAME("CdlInterpreter::multiline_comment");
std::string indent = std::string(first_indent, ' ') + "# " + std::string(second_indent, ' ');
std::string result = "";
bool indent_needed = true;
std::s... | false | false | false | false | false | 0 |
if_deregister_receive (info)
struct interface_info *info;
{
/* for LPF this is simple, packet filters are removed when sockets
are closed */
close (info -> rfdesc);
info -> rfdesc = -1;
if (!quiet_interface_discovery)
log_info ("Disabling input on LPF/%s/%s%s%s",
info -> name,
print_hw_addr (info -... | false | false | false | false | false | 0 |
do_action(json_parser *parser, uint8_t next_state)
{
struct action_descr *descr = &actions_map[next_state & ~0x80];
if (descr->call) {
int ret;
if (descr->dobuffer)
CHK(do_buffer(parser));
CHK((descr->call)(parser));
}
if (descr->state)
parser->state = descr->state;
parser->type = descr->type;
return ... | false | false | false | false | false | 0 |
setupDefaultRootStyle(DOM::DocumentImpl *d)
{
assert(m_fontSizes.size());
// We only care about setting up a default font
// that the media queries module can use early for
// computing its font-relative units (e.g.em/ex)
if (d) {
// setup some variables needed by applyRule
logicalD... | false | false | false | false | false | 0 |
mpd_sync_recv_line(struct mpd_async *async, const struct timeval *tv0)
{
struct timeval tv, *tvp;
char *line;
if (tv0 != NULL) {
tv = *tv0;
tvp = &tv;
} else
tvp = NULL;
while (true) {
line = mpd_async_recv_line(async);
if (line != NULL)
return line;
if (!mpd_sync_io(async, tvp))
return NULL;
... | false | false | false | false | false | 0 |
kb_set_shortcut(GtkTreeStore *store, GtkTreeIter *iter,
guint key, GdkModifierType mods)
{
gchar *key_string = gtk_accelerator_name(key, mods);
GtkTreeIter parent;
guint kid, gid;
GeanyKeyBinding *kb;
gboolean bold;
gtk_tree_store_set(store, iter, KB_TREE_SHORTCUT, key_string, -1);
g_free(key_string);
gtk_t... | false | false | false | false | false | 0 |
do_srv_query(unsigned int logopt, char *name, u_char **packet)
{
int len = PACKETSZ;
unsigned int last_len = len;
char ebuf[MAX_ERR_BUF];
u_char *buf;
while (1) {
buf = malloc(last_len);
if (!buf) {
char *estr = strerror_r(errno, ebuf, MAX_ERR_BUF);
error(logopt, "malloc: %s", estr);
return -1;
}
... | true | true | false | false | false | 1 |
Java_com_sun_grid_jgdi_util_shell_editor_EditorUtil_nativeSgeEdit(JNIEnv *env, jclass clazz, jstring path) {
jint ret = 0;
uid_t uid = getuid();
uid_t gid = getgid();
const char *strpath = NULL;
DENTER(TOP_LAYER, "Java_com_sun_grid_jgdi_util_shell_editor_EditorUtil_nativeSgeEdit");
strpath = (*env)-... | false | false | false | false | false | 0 |
us_buffer_append_rounded_data( us_buffer_t *self, const void *data, size_t data_length )
{
bool r = true;
size_t nul_count = 0;
size_t i;
r &= us_buffer_append( self, data, data_length );
// length -> padding
// 4 -> 0
// 5 -> 3
// 6 -> 2
// 7 -> 1
// 8 -> 0
nul_count = ( 4 -... | false | false | false | false | false | 0 |
search_files_replace_clicked (SearchFiles* sf)
{
GtkTreeIter iter;
if (gtk_tree_model_get_iter_first(sf->priv->files_model, &iter))
{
AnjutaCommandQueue* queue = anjuta_command_queue_new(ANJUTA_COMMAND_QUEUE_EXECUTE_MANUAL);
const gchar* pattern =
gtk_entry_get_text (GTK_ENTRY (sf->priv->search_entry));
co... | false | false | false | false | false | 0 |
save_hist(HISTORY_S *history, char *savethis, unsigned saveflags, void *cntxt)
{
size_t l;
int plusone;
if(!(history && history->histsize > 0))
return;
plusone = (history->origindex + 1) % history->histsize;
if(!history->hist[history->origindex]){
history->hist[history->origindex] = (ONE_H... | false | true | false | false | false | 1 |
accept_editor(FieldEditor* e) {
if (_to_printer) {
selected_ = e->text();
fchooser_->dismiss(true);
} else {
String* path = Directory::canonical(*e->text());
e->field(*path);
if (chdir(*path)) {
/* chdir has copied the string */
delete path;
} else {
selected_ = path;
fchooser_->dismi... | false | false | false | false | false | 0 |
Cudd_PrintMinterm(
DdManager * manager,
DdNode * node)
{
int i, *list;
background = manager->background;
zero = Cudd_Not(manager->one);
list = ALLOC(int,manager->size);
if (list == NULL) {
manager->errorCode = CUDD_MEMORY_OUT;
return(0);
}
for (i = 0; i < manager->size; i++) list[i] ... | false | false | false | false | false | 0 |
vprbrd_i2c_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs,
int num)
{
struct i2c_msg *pmsg;
int i, ret,
error = 0;
struct vprbrd *vb = (struct vprbrd *)i2c->algo_data;
struct vprbrd_i2c_addr_msg *amsg =
(struct vprbrd_i2c_addr_msg *)vb->buf;
struct vprbrd_i2c_status *smsg = (struct vprbrd_i2c_status *)vb... | false | false | false | false | false | 0 |
L10()
{register object *base=vs_base;
register object *sup=base+VM10; VC10
vs_check;
{object V74;
V74=(base[0]);
vs_top=sup;
goto TTL;
TTL:;{object V75;
if((((object)VV[34])->s.s_dbind)==Cnil){
V75= Cnil;
goto T256;}
{object V76 =((V74))->s.s_plist;
object ind= ((object)VV[35]);
while(V76!=Cnil){
if(V76->... | false | false | false | false | false | 0 |
study_recalc_voxel_dim(AmitkStudy * study) {
amide_real_t voxel_dim;
amide_real_t zoom;
if (AMITK_OBJECT_CHILDREN(study) == NULL)
return; /* no children, no voxel dim to recalculate */
voxel_dim = amitk_data_sets_get_max_min_voxel_size(AMITK_OBJECT_CHILDREN(study));
if (AMITK_STUDY_VOXEL_DIM_VALID(stud... | false | false | false | false | false | 0 |
type_engine_print_exp_dot_member( Chuck_Env * env, a_Exp_Dot_Member member )
{
// UNUSED: Chuck_Value * value = NULL;
Chuck_Type * the_base = NULL;
t_CKBOOL base_static = FALSE;
string str;
// type check the base
member->t_base = type_engine_check_exp( env, member->base );
if( !member->t_ba... | false | false | false | false | false | 0 |
mca_allocator_bucket_realloc(
mca_allocator_base_module_t * mem,
void * ptr,
size_t size,
mca_mpool_base_registration_t** registration)
{
mca_allocator_bucket_t * mem_options = (mca_allocator_bucket_t *) mem;
/* initialize for later bit shifts */
size_t bucket_size = 1;
int bucket_num;... | false | false | false | false | false | 0 |
targetX() const
{
if (x_target() != -1)
return x_target();
int x = 0;
int y = 0;
getPos(x, y);
return x;
} | false | false | false | false | false | 0 |
close() {
int result;
if(!file) return -1;
result = ::fclose(file);
if(!result && modified) {
file = NULL;
return s3_put_file(local_name, name.rest, bucket, AMZ_PERM_PRIVATE, username, password);
} else {
return result;
}
} | false | false | false | false | false | 0 |
xprt_register(xprt)
SVCXPRT *xprt;
{
register int sock = xprt->xp_sock;
#ifdef FD_SETSIZE
if (xports == NULL) {
xports = (SVCXPRT **)
mem_alloc(FD_SETSIZE * sizeof(SVCXPRT *));
}
if (sock < _rpc_dtablesize()) {
xports[sock] = xprt;
FD_SET(sock, &svc_fdset);
}
#else
if (sock < NOFILE) {
xports[sock] = ... | false | false | false | false | false | 0 |
ctr_drbg_reseed( ctr_drbg_context *ctx,
const unsigned char *additional, size_t len )
{
unsigned char seed[CTR_DRBG_MAX_SEED_INPUT];
size_t seedlen = 0;
if( ctx->entropy_len + len > CTR_DRBG_MAX_SEED_INPUT )
return( POLARSSL_ERR_CTR_DRBG_INPUT_TOO_BIG );
memset( seed, 0, C... | true | true | false | false | false | 1 |
del_tbuf(tandbuf *goner)
{
struct share_msgq *q, *r;
tandbuf *t = NULL, *old = NULL;
for (t = tbuf; t; old = t, t = t->next) {
if (t == goner) {
if (old)
old->next = t->next;
else
tbuf = t->next;
for (q = t->q; q && q->msg[0]; q = r) {
r = q->next;
nfree(q->m... | false | false | false | false | false | 0 |
clocks_clock_base_init (ClocksClockIface * iface) {
static gboolean initialized = FALSE;
if (!initialized) {
initialized = TRUE;
g_object_interface_install_property (iface, g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G... | false | false | false | false | false | 0 |
connect_socket(thread *thread, connection *c) {
struct addrinfo addr = cfg.addr;
struct aeEventLoop *loop = thread->loop;
int fd, flags;
fd = socket(addr.ai_family, addr.ai_socktype, addr.ai_protocol);
flags = fcntl(fd, F_GETFL, 0);
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
if (connect(fd, ... | false | false | false | false | false | 0 |
set_mode(enum grecs_callback_command cmd,
grecs_locus_t *locus,
void *varptr,
grecs_value_t *value,
void *cb_data)
{
static struct xlat_tab tab[] = {
{ "daemon", MODE_DAEMON },
{ "inetd", MODE_INETD },
{ NULL }
};
if (cmd != grecs_callback_set_value) {
grecs_error(locus, 0, _("Unexpected block... | false | false | false | false | false | 0 |
find_duration (char *durtok)
{
int temp;
int dotted;
int duration;
char dur[10];
int quart;
int i, j, k;
int rc;
int done;
int high;
int low;
rc = 0;
strncpy(dur, &(buffer[5]), 3);
dur[4] = '\0';
sscanf (dur, " %d", &temp);
high = temp;
low = 0;
done = FALSE;
while ( high > 0 && !done )
{
if... | false | false | false | false | false | 0 |
GetX()
{
OGRGeometry *poGeom;
OGRPoint *poPoint=NULL;
/*-----------------------------------------------------------------
* Fetch and validate geometry
*----------------------------------------------------------------*/
poGeom = GetGeometryRef();
if (poGeom && wkbFlatten(poGeom->getGeo... | false | false | false | false | false | 0 |
ixgbe_get_san_mac_addr_offset(struct ixgbe_hw *hw,
u16 *san_mac_offset)
{
s32 ret_val;
/*
* First read the EEPROM pointer to see if the MAC addresses are
* available.
*/
ret_val = hw->eeprom.ops.read(hw, IXGBE_SAN_MAC_ADDR_PTR,
san_mac_offset);
if (ret_val)
hw_err(hw, "eeprom read at offset ... | false | false | false | false | false | 0 |
getStrongHashOffered(ZrtpPacketHello *hello, int32_t algoName) {
int numHash = hello->getNumHashes();
bool nonNist = (algoName == *(int32_t*)e414 || algoName == *(int32_t*)e255) && configureAlgos.getSelectionPolicy() == ZrtpConfigure::PreferNonNist;
if (nonNist) {
for (int i = 0; i < numHash; i++)... | false | false | false | false | false | 0 |
ravb_ptp_enable(struct ptp_clock_info *ptp,
struct ptp_clock_request *req, int on)
{
switch (req->type) {
case PTP_CLK_REQ_EXTTS:
return ravb_ptp_extts(ptp, &req->extts, on);
case PTP_CLK_REQ_PEROUT:
return ravb_ptp_perout(ptp, &req->perout, on);
default:
return -EOPNOTSUPP;
}
} | false | false | false | false | false | 0 |
get_domain(struct device *dev)
{
struct protection_domain *domain;
struct iommu_domain *io_domain;
if (!check_device(dev))
return ERR_PTR(-EINVAL);
io_domain = iommu_get_domain_for_dev(dev);
if (!io_domain)
return NULL;
domain = to_pdomain(io_domain);
if (!dma_ops_domain(domain))
return ERR_PTR(-EBUSY);... | false | false | false | false | false | 0 |
v4l2_i2c_subdev_addr(struct v4l2_subdev *sd)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return client ? client->addr : I2C_CLIENT_END;
} | false | false | false | false | false | 0 |
print_execpi(struct text_object *obj, char *p, int p_max_size)
{
struct execi_data *ed = obj->data.opaque;
struct text_object subroot;
struct information *tmp_info;
if (!ed)
return;
tmp_info = malloc(sizeof(struct information));
memcpy(tmp_info, &info, sizeof(struct information));
if (time_to_update(ed)) {
... | false | false | false | false | false | 0 |
verify_certificate_callback (gnutls_session_t session)
{
unsigned int status;
const gnutls_datum_t *cert_list;
unsigned int cert_list_size;
int ret;
gnutls_x509_crt_t cert;
const char *hostname;
/* read hostname */
hostname = gnutls_session_get_ptr (session);
/* This verification function uses the t... | 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.