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 |
|---|---|---|---|---|---|---|
dbg_xlate_ptr(proc_t *p, xaddr_t addr)
{
mapping_t *map;
unsigned int off;
map = dbg_map_lookup_by_address(p, addr, &off);
if (!map)
return NULL;
if ((addr < map->address)
|| (addr > (map->address + map->size - 4))) {
return NULL;
}
return map->data + off;
} | false | false | false | false | false | 0 |
RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
void *pData, int nBufXSize, int nBufYSize,
GDALDataType eBufType,
int nPixelSpace, int nLineSpace )
{
if( nPixelSpace*8 == GDALGetDataTypeSize( eBufType )
&& nLineSpace == nP... | false | false | false | false | false | 0 |
bar_pane_histogram_update_cb(gpointer data)
{
const HistMap *histmap;
PaneHistogramData *phd = data;
phd->idle_id = 0;
phd->need_update = FALSE;
gtk_widget_queue_draw_area(GTK_WIDGET(phd->drawing_area), 0, 0, phd->histogram_width, phd->histogram_height);
if (phd->fd == NULL) return FALSE;
histmap = histmap_... | false | false | false | false | false | 0 |
sh2_set_reg (int regnum, unsigned val)
{
switch( regnum )
{
case SH2_PC:
case REG_PC:
sh2.pc = val;
sh2.delay = 0;
break;
case REG_SP: sh2.r[15] = val; break;
case SH2_PR: sh2.pr = val; break;
case SH2_SR:
sh2.sr = val;
CHECK_PENDING_IRQ("sh2_set_reg");
break;
case SH2_GBR: ... | false | false | false | false | false | 0 |
fetch_arg(char *head, char* tail)
{
char *cp;
for (cp = head; *cp && cp < tail; cp++);
return (cp == tail ? NULL : cp + 1);
} | false | false | false | false | false | 0 |
luaH_newkey (lua_State *L, Table *t, const TValue *key) {
Node *mp;
TValue aux;
if (ttisnil(key)) luaG_runerror(L, "table index is nil");
else if (ttisfloat(key)) {
lua_Number n = fltvalue(key);
lua_Integer k;
if (luai_numisnan(n))
luaG_runerror(L, "table index is NaN");
if (numisinteger(n... | false | false | false | false | false | 0 |
Curl_connected_proxy(struct connectdata *conn,
int sockindex)
{
if(!conn->bits.proxy || sockindex)
/* this magic only works for the primary socket as the secondary is used
for FTP only and it has FTP specific magic in ftp.c */
return CURLE_OK;
switch(conn->proxytype) {
... | false | false | false | false | false | 0 |
playlist_editor_status_changed(MpdObj * mi, ChangedStatusType what, void *data)
{
if (what & MPD_CST_STORED_PLAYLIST)
{
playlist_editor_fill_list_real();
}
} | false | false | false | false | false | 0 |
runtime_initialize()
{
if(cpu_pic->program_memory[PMindex+1])
{
word2_opcode = cpu_pic->program_memory[PMindex+1]->get_opcode();
if((word2_opcode & 0xff00) != 0xf000)
{
cout << "16bit-instructions.cc LFSR error\n";
return;
}
cpu_pic->program_memory[PMindex+1]->update_line_number( file... | false | false | false | false | false | 0 |
print_a2(const char *val, const rnode *r)
{
int machine = r->machine, syscall = r->syscall;
char *out;
const char *sys = audit_syscall_to_name(syscall, machine);
if (sys) {
if (strncmp(sys, "fcntl", 5) == 0) {
int ival;
errno = 0;
ival = strtoul(val, NULL, 16);
if (errno) {
a... | false | false | false | false | false | 0 |
coff_symbol_from (bfd *ignore_abfd ATTRIBUTE_UNUSED,
asymbol *symbol)
{
if (!bfd_family_coff (bfd_asymbol_bfd (symbol)))
return (coff_symbol_type *) NULL;
if (bfd_asymbol_bfd (symbol)->tdata.coff_obj_data == (coff_data_type *) NULL)
return (coff_symbol_type *) NULL;
return (coff_symbol_type *) symbo... | false | false | false | true | false | 1 |
print_common(unsigned id, const char *name, const char *prefix)
{
if (prefix) {
printf("%s", prefix);
}
if (!(option_mask32 & NAME_NOT_NUMBER) || !name) {
printf("%u", id);
}
if (!option_mask32 || (option_mask32 & NAME_NOT_NUMBER)) {
if (name) {
printf(option_mask32 ? "%s" : "(%s)", name);
} else {
/... | false | false | false | false | true | 1 |
_PR_CleanupCMon(void)
{
_PR_DESTROY_LOCK_MCACHE();
while (free_entries) {
PR_DestroyMonitor(free_entries->mon);
free_entries = free_entries->next;
}
num_free_entries = 0;
while (mcache_blocks) {
MonitorCacheEntryBlock *block;
block = mcache_blocks;
mcache_b... | false | false | false | false | false | 0 |
bittoint4(PG_FUNCTION_ARGS)
{
VarBit *arg = PG_GETARG_VARBIT_P(0);
uint32 result;
bits8 *r;
/* Check that the bit string is not too long */
if (VARBITLEN(arg) > sizeof(result) * BITS_PER_BYTE)
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("integer out of range")));
result... | false | false | false | false | true | 1 |
mono_dl_open (const char *name, int flags, char **error_msg)
{
MonoDl *module;
void *lib;
MonoDlFallbackHandler *dl_fallback = NULL;
int lflags = mono_dl_convert_flags (flags);
if (error_msg)
*error_msg = NULL;
module = (MonoDl *) malloc (sizeof (MonoDl));
if (!module) {
if (error_msg)
*error_msg = g_st... | false | false | false | false | false | 0 |
LZ4HC_InsertAndGetWiderMatch (LZ4HC_Data_Structure* hc4, const BYTE* ip, const BYTE* startLimit, const BYTE* matchlimit, int longest, const BYTE** matchpos, const BYTE** startpos)
{
U16* const chainTable = hc4->chainTable;
HTYPE* const HashTable = hc4->hashTable;
INITBASE(base,hc4->base);
const BYTE* ref;
... | false | false | false | false | false | 0 |
power_allocator_throttle(struct thermal_zone_device *tz, int trip)
{
int ret;
int switch_on_temp, control_temp;
struct power_allocator_params *params = tz->governor_data;
/*
* We get called for every trip point but we only need to do
* our calculations once
*/
if (trip != params->trip_max_desired_temperatur... | false | false | false | false | false | 0 |
hdhomerun_device_create_from_str_device_id(const char *device_str, struct hdhomerun_debug_t *dbg)
{
int i;
const char *ptr = device_str;
for (i = 0; i < 8; i++) {
if (!is_hex_char(*ptr++)) {
return NULL;
}
}
if (*ptr == 0) {
unsigned int device_id;
if (sscanf(device_str, "%x", &device_id) != 1) {
re... | false | false | false | false | false | 0 |
store_pwm_freq(struct device *dev, struct device_attribute *devattr,
const char *buf, size_t count)
{
int nr = to_sensor_dev_attr(devattr)->index;
struct w83627hf_data *data = dev_get_drvdata(dev);
static const u8 mask[]={0xF8, 0x8F};
unsigned long val;
int err;
err = kstrtoul(buf, 10, &val);
if (err)
... | false | false | false | false | false | 0 |
oper_reshufle (GelETree *n, int oper)
{
gboolean shuffled = FALSE;
/* First sort out multiplications or addi */
if (n->op.oper == oper) {
GelETree *l, *r;
GEL_GET_LR (n, l, r);
/* always swap values to go first */
if (r->type == GEL_VALUE_NODE &&
l->type != GEL_VALUE_NODE) {
n->op.args = r;
r-... | false | false | false | true | false | 1 |
__indirect_glMultiTexCoord4s(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
{
struct glx_context * const gc = __glXGetCurrentContext();
const GLuint cmdlen = 16;
emit_header(gc->pc, X_GLrop_MultiTexCoord4sv, cmdlen);
(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
(void) memcpy((void *)(g... | false | true | false | false | false | 1 |
compute_lambda(Matrix *R, Matrix *Q, Vector *g) {
int col = -1;
Vector *c = vector_make_size(R->cols, Q->type, MATR_PRECISE, R->size),
*lambda = vector_make_size(R->cols, R->type, MATR_PRECISE, R->size);
VectorIterator vit;
double minval = -1.0*QP_LINEAR_ACCURACY;
matr_vector(Q, g, c); //sparse dot non-... | false | false | false | false | false | 0 |
smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
unsigned short ircc_fir,
unsigned short ircc_sir,
unsigned char ircc_dma,
unsigned char ircc_irq)
{
struct pci_dev *dev = NULL;
unsigned short ss_vendor = 0x0000;
unsigned short ss_device = 0x0000;
int ret = 0;
for_... | false | false | false | false | false | 0 |
run_diff_cmd(const char *pgm,
const char *name,
const char *other,
const char *attr_path,
struct diff_filespec *one,
struct diff_filespec *two,
const char *xfrm_msg,
struct diff_options *o,
int complete_rewrite)
{
if (!DIFF_OPT_TST(o, ALLOW_EXTERNAL))
pgm = NULL;
else {
struct user... | false | false | false | false | false | 0 |
level_find_node(const X509_POLICY_LEVEL *level,
const X509_POLICY_NODE *parent,
const ASN1_OBJECT *id)
{
X509_POLICY_NODE *node;
int i;
for (i = 0; i < sk_X509_POLICY_NODE_num(level->nodes); i++)
{
node = sk_X509_POLICY_NODE_value(level->nodes, i);
if (node->parent == parent)
{
if (!OBJ_cmp(n... | false | false | false | false | false | 0 |
glusterd_volume_stop_glusterfs (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo,
gf_boolean_t del_brick)
{
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
char pidfile[P... | false | false | false | true | false | 1 |
hci_read_ext_inquiry_response(int dd, uint8_t *fec, uint8_t *data, int to)
{
read_ext_inquiry_response_rp rp;
struct hci_request rq;
memset(&rq, 0, sizeof(rq));
rq.ogf = OGF_HOST_CTL;
rq.ocf = OCF_READ_EXT_INQUIRY_RESPONSE;
rq.rparam = &rp;
rq.rlen = READ_EXT_INQUIRY_RESPONSE_RP_SIZE;
if (hci_send_req... | false | false | false | false | false | 0 |
_mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg)
{
struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev);
int ret;
assert_smi_lock(ds);
if (bus == NULL)
return -EINVAL;
ret = __mv88e6xxx_reg_read(bus, ds->pd->sw_addr, addr, reg);
if (ret < 0)
return ret;
dev_dbg(ds->master_dev, "<- a... | false | false | false | false | false | 0 |
eel_accessibility_text_get_character_count (AtkText *text)
{
GailTextUtil *util = get_simple_text (text);
g_return_val_if_fail (util != NULL, -1);
return gtk_text_buffer_get_char_count (util->buffer);
} | false | false | false | false | false | 0 |
paint()
{
debug("in Widget::paint()\n");
if (m_app) {
Renderer *r = m_app->renderer();
Box dirty = getDirtyRegion();
r->color(0,0,0,0xff);
r->rect(m_screen_x, m_screen_y, dirty.w, dirty.h);
}
} | false | false | false | false | false | 0 |
freeMethodInlinedInfo(MethodBlock *mb) {
Instruction *instruction = mb->code;
CodeBlockHeader **blocks = mb->code;
CodeBlockHeader *block = NULL;
QuickPrepareInfo *prepare_info;
ProfileInfo *profile_info;
int i;
if(!enabled)
return;
/* Scan handlers within the method */
fo... | false | true | false | false | false | 1 |
remove_clicked()
{
// Remove the icon file and call UpdateIconStore ().
Gtk::TreeIter iter;
iter = icon_tree->get_selection()->get_selected();
if (!iter) {
return;
}
std::string icon_path = (*iter)[m_columns.file_path];
gnote::utils::HIGMessageDialog dialog(NULL,
... | false | false | false | false | false | 0 |
rtl8723au_write16(struct rtw_adapter *padapter, u16 addr, u16 val)
{
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
struct usb_device *udev = pdvobjpriv->pusbdev;
int ret;
mutex_lock(&pdvobjpriv->usb_vendor_req_mutex);
pdvobjpriv->usb_buf.val16 = cpu_to_le16(val);
ret = usb_control_msg(udev, usb_sn... | false | false | false | false | false | 0 |
ipaddr_add(int ifindex, in_addr_t addr, int mask)
{
struct ipaddr_req {
struct nlmsghdr n;
struct ifaddrmsg i;
char buf[4096];
} req;
if (!rth)
open_rth();
if (!rth)
return -1;
memset(&req, 0, sizeof(req) - 4096);
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
req.n.nlmsg_flags = NLM_F... | true | true | false | false | false | 1 |
cobalt_stream_struct_init(struct cobalt *cobalt)
{
int i;
for (i = 0; i < COBALT_NUM_STREAMS; i++) {
struct cobalt_stream *s = &cobalt->streams[i];
s->cobalt = cobalt;
s->flags = 0;
s->is_audio = false;
s->is_output = false;
s->is_dummy = true;
/* The Memory DMA channels will always get a lower chann... | false | false | false | false | false | 0 |
getReservedRegs(const MachineFunction &MF) const {
BitVector Reserved(getNumRegs());
Reserved.set(MBlaze::R0);
Reserved.set(MBlaze::R1);
Reserved.set(MBlaze::R2);
Reserved.set(MBlaze::R13);
Reserved.set(MBlaze::R14);
Reserved.set(MBlaze::R15);
Reserved.set(MBlaze::R16);
Reserved.set(MBlaze::R17);
Re... | false | false | false | false | false | 0 |
sock_bind(PySocketSockObject *s, PyObject *addro)
{
sock_addr_t addrbuf;
int addrlen;
int res;
if (!getsockaddrarg(s, addro, SAS2SA(&addrbuf), &addrlen))
return NULL;
Py_BEGIN_ALLOW_THREADS
res = bind(s->sock_fd, SAS2SA(&addrbuf), addrlen);
Py_END_ALLOW_THREADS
if (res < 0)
... | false | false | false | false | false | 0 |
object_length_bytes(OBJ x) {
switch (x->kind) {
case KIND_OBJECT:
return sizeof(Object);
case KIND_BVECTOR:
return sizeof(BVector) + x->length;
case KIND_VECTOR:
return sizeof(Vector) + x->length * sizeof(OBJ);
case KIND_OVECTOR:
return sizeof(OVector) + x->length * sizeof(O... | false | false | false | false | false | 0 |
gnm_logcf (gnm_float x, gnm_float i, gnm_float d)
{
gnm_float c1 = 2 * d;
gnm_float c2 = i + d;
gnm_float c4 = c2 + d;
gnm_float a1 = c2;
gnm_float b1 = i * (c2 - i * x);
gnm_float b2 = d * d * x;
gnm_float a2 = c4 * c2 - b2;
const gnm_float cfVSmall = 1.0e-14;/* ~= relative tolerance */... | false | false | false | false | false | 0 |
SplineFontFindBounds(SplineFont *sf,DBounds *bounds) {
int i, k, first, last;
bounds->minx = bounds->maxx = 0;
bounds->miny = bounds->maxy = 0;
for ( i = 0; i<sf->glyphcnt; ++i ) {
SplineChar *sc = sf->glyphs[i];
if ( sc!=NULL ) {
first = last = ly_fore;
if ( sf->multilayer )
last = sc->... | false | false | false | false | false | 0 |
addvar_vartable_expand (GGobiData * d, gint ncols)
{
gint j;
for (j = d->ncols; j < d->ncols + ncols; j++) {
/*-- allocate the new vartable element, initialize with default values --*/
vartabled *vt = vartable_element_new (d);
transform_values_init (vt);
}
} | false | false | false | false | false | 0 |
ExpandGeneric(xp, regmatch, num_file, file, func, escaped)
expand_T *xp;
regmatch_T *regmatch;
int *num_file;
char_u ***file;
char_u *((*func)__ARGS((expand_T *, int)));
/* returns a string from the list */
int escaped;
{
int i;
int count = 0;
int round;
char_u *str;
... | false | false | false | false | false | 0 |
__pyx_tp_clear_7sklearn_5utils_11seq_dataset_CSRDataset(PyObject *o) {
struct __pyx_obj_7sklearn_5utils_11seq_dataset_CSRDataset *p = (struct __pyx_obj_7sklearn_5utils_11seq_dataset_CSRDataset *)o;
PyObject* tmp;
if (__pyx_ptype_7sklearn_5utils_11seq_dataset_SequentialDataset->tp_clear) {
__pyx_ptype_7sklearn... | false | false | false | false | false | 0 |
_gnutls_read_connection_state_init (gnutls_session_t session)
{
const uint16_t epoch_next = session->security_parameters.epoch_next;
int ret;
/* Update internals from CipherSuite selected.
* If we are resuming just copy the connection session
*/
if (session->internals.resumed == RESUME_FALSE)
{
... | false | false | false | false | false | 0 |
posix_fsync (call_frame_t *frame, xlator_t *this,
fd_t *fd, int32_t datasync)
{
int32_t op_ret = -1;
int32_t op_errno = 0;
int _fd = -1;
struct posix_fd * pfd = NULL;
int ret = -1;
struct iatt ... | false | false | false | false | false | 0 |
Fax3Decode1D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
{
DECLARE_STATE(tif, sp, "Fax3Decode1D");
(void) s;
if (occ % sp->b.rowbytes)
{
TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read");
return (-1);
}
CACHE_STATE(tif, sp);
thisrun = sp->curruns;
while (occ > 0... | false | false | false | false | false | 0 |
calcFontProperties( DragItem& d, bool isHeader )
{
// This defaults to application's default font if not set
QFontMetrics fm( d.m_font );
QRect rect = fm.boundingRect( d.m_text );
// Augment to font height as this particular string might be less tall
if ( fm.height() > rect.height() )
{
... | false | false | false | false | false | 0 |
e_dbus_interface_method_add(E_DBus_Interface *iface, const char *member, const char *signature, const char *reply_signature, E_DBus_Method_Cb func)
{
E_DBus_Method *m;
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, 0);
m = e_dbus_method_new(member, signature, reply_signature, func);
DBG("E-dbus: Add method %s: %p", mem... | false | false | false | false | false | 0 |
jp_pilot_connect(int *Psd, const char *device)
{
int sd;
int ret;
struct SysInfo sys_info;
*Psd=0;
sd = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_DLP);
if (sd < 0) {
int err = errno;
perror("pi_socket");
jp_logf(JP_LOG_WARN, "pi_socket %s\n", strerror(err));
return EXIT_F... | false | false | false | false | false | 0 |
ql_sem_spinlock(struct ql_adapter *qdev, u32 sem_mask)
{
unsigned int wait_count = 30;
do {
if (!ql_sem_trylock(qdev, sem_mask))
return 0;
udelay(100);
} while (--wait_count);
return -ETIMEDOUT;
} | false | false | false | false | false | 0 |
evg_surface_delete(GF_SURFACE _this)
{
EVGSurface *surf = (EVGSurface *)_this;
if (!surf)
return;
#ifndef INLINE_POINT_CONVERSION
if (surf->points) gf_free(surf->points);
surf->points = NULL;
#endif
if (surf->stencil_pix_run) gf_free(surf->stencil_pix_run);
surf->stencil_pix_run = NULL;
if (surf->raster) evg_... | false | false | false | false | false | 0 |
GetImageCache(const ImageInfo *image_info,const char *path,
ExceptionInfo *exception)
{
char
key[MaxTextExtent];
ExceptionInfo
*sans_exception;
Image
*image;
ImageInfo
*read_info;
(void) FormatLocaleString(key,MaxTextExtent,"cache:%s",path);
sans_exception=AcquireExceptionInfo();
ima... | false | false | false | false | false | 0 |
gs_fapi_get_metrics_count(gs_fapi_font *ff)
{
if (!ff->is_type1 && ff->is_cid) {
gs_font_cid2 *pfcid = (gs_font_cid2 *) ff->client_font_data;
return (pfcid->cidata.MetricsCount);
}
return 0;
} | false | false | false | false | false | 0 |
createShellProcess(s8 **command)
{
s32 fd;
mPid = forkpty(&fd, NULL, NULL, NULL);
switch (mPid) {
case -1:
break;
case 0: // child process
initShellProcess();
setenv("TERM", "linux", 1);
if (command) {
execvp(command[0], command);
} else {
s8 *shell = getenv("SHELL");
if (shell) execlp(shell... | false | false | false | false | true | 1 |
cxusb_bluebird_gpio_pulse(struct dvb_usb_device *d, u8 pin, int low)
{
cxusb_bluebird_gpio_rw(d, pin, low ? 0 : pin);
msleep(5);
cxusb_bluebird_gpio_rw(d, pin, low ? pin : 0);
} | false | false | false | false | false | 0 |
__pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj_7sklearn_5utils_13weight_vector_WeightVector *__pyx_v_w, __pyx_t_7sklearn_12linear_model_8sgd_fast_DOUBLE *__pyx_v_q_data_ptr, __pyx_t_7sklearn_12linear_model_8sgd_fast_INTEGER *__pyx_v_x_ind_ptr, int __pyx_v_xnnz, double __pyx_v_u) {
double __pyx_v... | false | false | false | false | false | 0 |
complete_in_idle_cb (gpointer user_data)
{
unity_webapps_context_new_data *data;
data = (unity_webapps_context_new_data *)user_data;
if (!data || !data->webapps_context)
return FALSE;
// first unref what should be unrefed
if (data->webapps_object_needs_unref == TRUE)
g_object_unref (G_OBJECT (data-... | false | false | false | false | false | 0 |
jack_dbus_get_method_args(
struct jack_dbus_method_call *call,
int type,
...)
{
va_list args;
DBusError error;
bool retval = true;
va_start (args, type);
dbus_error_init (&error);
if (!dbus_message_get_args_valist (call->message, &error, type, args))
{
jack_dbus_error (... | false | false | false | false | false | 0 |
f_has_key(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
rettv->vval.v_number = 0;
if (argvars[0].v_type != VAR_DICT)
{
EMSG(_(e_dictreq));
return;
}
if (argvars[0].vval.v_dict == NULL)
return;
rettv->vval.v_number = dict_find(argvars[0].vval.v_dict,
get_tv_string(&a... | false | false | false | false | false | 0 |
abraca_filter_view_on_key_press_event (AbracaFilterView* self, GdkEventKey* e) {
gboolean result = FALSE;
GdkEventKey _tmp0_;
guint _tmp1_;
guint _tmp2_ = 0U;
GdkEventKey _tmp3_;
GdkModifierType _tmp4_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (e != NULL, FALSE);
_tmp0_ = *e;
_tmp1_ = ... | false | false | false | false | false | 0 |
set_block_loop_order(Module_table *mhead)
{
Module_table *mpt;
int i;
int max_tlg_num = get_max_tlg_tag_module(mhead);
int max_dlg_num = get_max_dlg_tag_module(mhead);
int max_car_num = max_dlg_num;
int **loop_order_dlg, **loop_order_car, *loop_order_tlg;
loop_order_dlg = zcalloc(max_tlg_... | false | false | false | false | false | 0 |
ftran(double *b, double *sol, bool save) const
{
Lxeqb(b);
Hxeqb(b);
if ( save ){
// keep vector
keepSize_=0;
for ( int i=0; i<numberRows_; ++i ){
if ( fabs(b[i]) < zeroTolerance_ ) continue;
vecKeep_[keepSize_]=b[i];
indKeep_[keepSize_++]=i;
}
}
Uxeqb(b,sol);
} | false | false | false | false | false | 0 |
recv_real(vvp_net_ptr_t port, double bit,
vvp_context_t context)
{
if (context) {
vvp_fun_anyedge_state_s*state = static_cast<vvp_fun_anyedge_state_s*>
(vvp_get_context_item(context, context_idx_));
if (recv_real_(port, bit, state->bits... | false | false | false | false | false | 0 |
spool_create_dynamic_context(lList **answer_list, const char *method,
const char *shlib_name, const char *args)
{
const char *compiled_method;
lListElem *context = NULL;
DENTER(TOP_LAYER, "spool_create_dynamic_context");
#ifdef SPOOLING_berkeleydb
compiled_method = "berkeleydb... | false | false | false | false | false | 0 |
write_attr_value (attr, value)
struct attr_desc *attr;
rtx value;
{
int op;
switch (GET_CODE (value))
{
case CONST_STRING:
write_attr_valueq (attr, XSTR (value, 0));
break;
case CONST_INT:
printf (HOST_WIDE_INT_PRINT_DEC, INTVAL (value));
break;
case SYMBOL_REF:
... | false | false | false | false | false | 0 |
pn533_target_found_felica(struct nfc_target *nfc_tgt, u8 *tgt_data,
int tgt_data_len)
{
struct pn533_target_felica *tgt_felica;
tgt_felica = (struct pn533_target_felica *)tgt_data;
if (!pn533_target_felica_is_valid(tgt_felica, tgt_data_len))
return -EPROTO;
if ((tgt_felica->nfcid2[0] == PN533_FELICA_SEN... | false | false | false | false | false | 0 |
fm10k_set_pauseparam(struct net_device *dev,
struct ethtool_pauseparam *pause)
{
struct fm10k_intfc *interface = netdev_priv(dev);
struct fm10k_hw *hw = &interface->hw;
if (pause->autoneg || !pause->tx_pause)
return -EINVAL;
/* we can only support pause on the PF to avoid head-of-line blocking */
if (hw->m... | false | false | false | false | false | 0 |
generic_ivar_remove(VALUE obj, ID id, st_data_t *valp)
{
st_table *tbl;
st_data_t data, key = (st_data_t)id;
int status;
if (!generic_iv_tbl) return 0;
if (!st_lookup(generic_iv_tbl, (st_data_t)obj, &data)) return 0;
tbl = (st_table *)data;
status = st_delete(tbl, &key, valp);
if (tbl->... | false | false | false | false | false | 0 |
Java_org_xmlsoft_Node_getPropImpl
(JNIEnv *env, jobject obj, jstring jprop) {
xmlNode *node = findNode(env, obj);
xmlChar *prop = (xmlChar*)(*env)->GetStringUTFChars(env, jprop, NULL);
xmlChar *value = xmlGetProp(node, prop);
(*env)->ReleaseStringUTFChars(env, jprop, (const char*)prop);
if (value... | false | false | false | false | false | 0 |
CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs)
{
unsigned char *smder = NULL;
int smderlen, r;
smderlen = i2d_X509_ALGORS(algs, &smder);
if (smderlen <= 0)
return 0;
r = CMS_signed_add1_attr_by_NID(si, NID_SMIMECapabilities,
V_ASN1_SEQUENCE, smder, smderlen);
OPENSSL_free(smder);
return... | false | false | false | false | false | 0 |
chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at)
char *name;
int quoted;
int *quoted_dollar_atp, *contains_dollar_at;
{
char *temp1;
if (name == 0)
{
if (quoted_dollar_atp)
*quoted_dollar_atp = 0;
if (contains_dollar_at)
*contains_dollar_at = 0;
return 0;
... | false | false | false | false | false | 0 |
calculator_mode_cb (Calculator* self) {
MathButtons* buttons = NULL;
MathWindow* _tmp0_ = NULL;
MathButtons* _tmp1_ = NULL;
MathButtons* _tmp2_ = NULL;
MathButtons* _tmp3_ = NULL;
gchar* state = NULL;
gchar* _tmp4_ = NULL;
MathButtons* _tmp5_ = NULL;
ButtonMode _tmp6_ = 0;
ButtonMode _tmp7_ = 0;
GSimpleActio... | false | false | false | false | false | 0 |
fuse_write_resume (fuse_state_t *state)
{
struct iobref *iobref = NULL;
struct iobuf *iobuf = NULL;
iobref = iobref_new ();
if (!iobref) {
gf_log ("glusterfs-fuse", GF_LOG_ERROR,
"%"PRIu64": WRITE iobref allocation failed",
... | false | false | false | false | false | 0 |
rt5670_button_detect(struct snd_soc_codec *codec)
{
int btn_type, val;
val = snd_soc_read(codec, RT5670_IL_CMD);
btn_type = val & 0xff80;
snd_soc_write(codec, RT5670_IL_CMD, val);
if (btn_type != 0) {
msleep(20);
val = snd_soc_read(codec, RT5670_IL_CMD);
snd_soc_write(codec, RT5670_IL_CMD, val);
}
return... | false | false | false | false | false | 0 |
data_cmp(const void *a, const void *b)
{
int rcode;
const CONF_DATA *one = a;
const CONF_DATA *two = b;
rcode = one->flag - two->flag;
if (rcode != 0) return rcode;
return strcmp(one->name, two->name);
} | false | false | false | false | false | 0 |
uv_cwd(char* buffer, size_t size) {
if (buffer == NULL)
return -EINVAL;
if (size == 0)
return -EINVAL;
if (getcwd(buffer, size) == NULL)
return -errno;
return 0;
} | false | false | false | false | false | 0 |
notifyMrDone(giopMonitor* m, CORBA::Boolean exit_on_error)
{
ASSERT_OMNI_TRACEDMUTEX_HELD(pd_lock,0);
omni_tracedmutex_lock sync(pd_lock);
if (!exit_on_error && !m->collection()->isEmpty()) {
// We may have seen a race condition in which the Monitor is about
// to return when another connection has been ... | false | false | false | false | false | 0 |
brasero_playlist_increase_activity_counter (BraseroPlaylist *playlist)
{
GdkWindow *window;
window = gtk_widget_get_window (GTK_WIDGET (playlist->priv->tree));
if (!window)
return;
if (playlist->priv->activity_counter == 0) {
GdkCursor *cursor;
cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (... | false | false | false | false | false | 0 |
zmq_msg_size (zmq_msg_t *msg_)
{
if (msg_->content == (zmq::msg_content_t*) ZMQ_VSM)
return msg_->vsm_size;
if (msg_->content == (zmq::msg_content_t*) ZMQ_DELIMITER)
return 0;
return ((zmq::msg_content_t*) msg_->content)->size;
} | false | false | false | false | false | 0 |
mon_damage(object *monster, int damage)
{
char *mn;
short row, col;
monster->hp_to_kill -= damage;
if (monster->hp_to_kill <= 0) {
row = monster->row;
col = monster->col;
dungeon[row][col] &= ~MONSTER;
mvaddch_rogue(row, col, get_dungeon_char(row, col));
fight_monster = 0;
cough_up(monster);
m... | false | false | false | false | true | 1 |
twMousePressEvent(QMouseEvent *event)
{
//qDebug() << this << "twMousePressEvent()";
if (event->button() == Qt::LeftButton) {
QTreeWidgetItem *item = this->ui->treeWidget->itemAt(event->pos());
if (item) {
this->dragObj = item->data(0, Qt::UserRole).value<abt_EmpfaengerInfo*>();
this->dragStartPos = event->... | false | false | false | false | false | 0 |
test_gnc_account_join_children (Fixture *fixture, gconstpointer pData)
{
Account *root = gnc_account_get_root (fixture->acct);
Account *broker = gnc_account_lookup_by_name (root, "broker");
Account *income = gnc_account_lookup_by_name (root, "income");
gint broker_desc = gnc_account_n_descendants (broke... | false | false | false | false | false | 0 |
ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
s32 err;
/* not searching for SFP so there is nothing to do here */
if (!(adapter->flags2 & IXGBE_FLAG2_SEARCH_FOR_SFP) &&
!(adapter->flags2 & IXGBE_FLAG2_SFP_NEEDS_RESET))
return;
if (adapter->sfp_poll_time &... | false | false | false | false | false | 0 |
poly_basis_dx(ssize_t n, double x, double y)
{
/* polynomial term for x derivative */
switch(n) {
case 0: return( 0.0 ); /* constant */
case 1: return( 1.0 );
case 2: return( 0.0 ); /* affine order = 1 terms = 3 */
case 3: return( y ); /* bilinear order = 1.5 terms = 4 */
cas... | false | false | false | false | false | 0 |
Swap(IndexVec& v, IndexVec& n, IndexVec& t, IndexVec& c,
size_t sI, size_t tI) {
std::swap(v[sI],v[tI]);
if (v.size() == n.size()) std::swap(n[sI],n[tI]);
if (v.size() == t.size()) std::swap(t[sI],t[tI]);
if (v.size() == c.size()) std::swap(c[sI],c[tI]);
} | false | false | false | false | false | 0 |
isPalindrome(std::string test) {
std::string reverse = strRev(test);
if (test.compare(reverse) == 0) return true;
return false;
} | false | false | false | false | false | 0 |
static_unlist (gamgi_voronoi *voronoi)
{
gamgi_slist **cells;
gamgi_slist *slist;
int n_cells;
int cell_x, cell_y, cell_z;
int offset;
/********************************************
* remove lists of nodes, one for each cell *
********************************************/
cells = voronoi->cells;
n_cells = voronoi->n... | false | false | false | false | false | 0 |
_q_saturationChanged(int s)
{
if (s != saturation)
emit q_func()->saturationChanged(saturation = s);
} | false | false | false | false | false | 0 |
fs_backend_init(const char *db_name, int flags)
{
fs_backend *ret = calloc(1, sizeof(fs_backend));
ret->db_name = db_name;
ret->segment = -1;
if (flags & FS_BACKEND_NO_OPEN) {
return ret;
}
ret->md = fs_metadata_open(db_name);
if (!ret->md) {
fs_error(LOG_CRIT, "cannot read metadata file ... | false | false | false | false | false | 0 |
sel_estimate_number_of_insns (basic_block bb)
{
int res = 0;
insn_t insn = NEXT_INSN (BB_HEAD (bb)), next_tail = NEXT_INSN (BB_END (bb));
for (; insn != next_tail; insn = NEXT_INSN (insn))
if (NONDEBUG_INSN_P (insn))
res++;
return res;
} | false | false | false | false | false | 0 |
elm_win_socket_listen(Evas_Object *obj,
const char *svcname,
int svcnum,
Eina_Bool svcsys)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
if (!sd->ee) return EINA_FALSE;
if (!ecore_evas_extn_socket_lis... | false | false | false | false | false | 0 |
coeff(int narg, char **arg)
{
if (!allocated) allocate();
if (narg != 3) error->all(FLERR,"Incorrect args for pair coefficients");
// parse pair of atom types
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
// read funcfl file if hasn't alre... | false | false | false | false | false | 0 |
rgb2pixel_8bits_or_less( FL_IMAGE * im,
unsigned int r,
unsigned int g,
unsigned int b,
FL_RGB2PIXEL * s )
{
unsigned int ret;
RGB2PIXEL_8_OR_LESS( im, r, g, b, s, ret );
return ret;
} | false | false | false | false | false | 0 |
set_value(int value, bool using_slider)
{
if(value < min_value) value = min_value;
if(value > max_value) value = max_value;
if(cur_value != value)
{
cur_value = value;
if(using_slider)
sig_slider_moved(cur_value);
if((using_slider && tracking) || using_slider == false)
sig_value_changed(cur_value);
... | false | false | false | false | false | 0 |
ds2482_remove(struct i2c_client *client)
{
struct ds2482_data *data = i2c_get_clientdata(client);
int idx;
/* Unregister the 1-wire bridge(s) */
for (idx = 0; idx < data->w1_count; idx++) {
if (data->w1_ch[idx].pdev != NULL)
w1_remove_master_device(&data->w1_ch[idx].w1_bm);
}
/* Free the memory */
kfree... | false | false | false | false | false | 0 |
getCmdInsertRangeVariables( PT_DocPosition& posStart,
PT_DocPosition& posEnd,
fl_BlockLayout*& pBL1,
fl_BlockLayout*& pBL2 )
{
posStart = getPoint();
posEnd = posStart;
if (!isSelectionEmpty())
{
if (m_Selection.getSelectionAnchor() < posStart)
{
posStart = m_Selection.g... | false | false | false | false | false | 0 |
_e_smart_randr_monitor_adjacent_move(E_Smart_Data *sd, Evas_Object *obj, Evas_Object *skip)
{
Eina_List *l = NULL;
Evas_Object *mon;
Eina_Rectangle o;
/* get the current geometry of the monitor we were passed in */
e_smart_monitor_current_geometry_get(obj, &o.x, &o.y, NULL, NULL);
e_layout_child_geom... | false | false | false | false | false | 0 |
slotDictionaryChanged()
{
delete d->spell;
d->spellReady = false;
d->wordCount = 0;
d->errorCount = 0;
d->autoDict.clear();
d->spell = new K3Spell( 0, i18n( "Incremental Spellcheck" ), this,
SLOT(slotSpellReady(K3Spell*)), d->mSpellConfig );
} | false | false | false | false | false | 0 |
yellowfin_timer(unsigned long data)
{
struct net_device *dev = (struct net_device *)data;
struct yellowfin_private *yp = netdev_priv(dev);
void __iomem *ioaddr = yp->base;
int next_tick = 60*HZ;
if (yellowfin_debug > 3) {
netdev_printk(KERN_DEBUG, dev, "Yellowfin timer tick, status %08x\n",
ioread16(io... | false | false | false | false | false | 0 |
Mixer_init(MixerObject *self, PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {"name", NULL};
char *name;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &name))
return -1;
self->mixer = create(name);
if (self->mixer == NULL) {
PyErr_SetString(PyExc_RuntimeError,
"error creating mixe... | 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.