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 |
|---|---|---|---|---|---|---|
_ib_cache_gid_table_find(struct ib_device *ib_dev,
const union ib_gid *gid,
const struct ib_gid_attr *val,
unsigned long mask,
u8 *port, u16 *index)
{
struct ib_gid_table **ports_table = ib_dev->cache.gid_cache;
struct ib_gid_table *table;
u8 p;
int local_index;
for (p = 0; p < ib_... | false | false | false | false | false | 0 |
handle_missing_table(struct realtime_sqlite3_db *db, const char *table, va_list ap)
{
const char *column;
int type, first = 1, res;
size_t sz;
struct ast_str *sql;
if (!(sql = ast_str_create(128))) {
return -1;
}
while ((column = va_arg(ap, typeof(column))) && (type = va_arg(ap, typeof(type))) && (sz = va_ar... | false | false | false | false | false | 0 |
list_model_iterate (TestConformSimpleFixture *fixture,
gconstpointer data)
{
ModelData test_data = { NULL, 0 };
ClutterModelIter *iter;
gint i;
test_data.model = clutter_list_model_new (N_COLUMNS,
G_TYPE_STRING, "Foo",
... | false | false | false | false | false | 0 |
keyspan_pda_open(struct tty_struct *tty,
struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
u8 *room;
int rc = 0;
struct keyspan_pda_private *priv;
/* find out how much room is in the Tx ring */
room = kmalloc(1, GFP_KERNEL);
if (!room)
return -ENOMEM;
rc = usb_control_msg(serial... | false | false | false | false | false | 0 |
pw_encodevals_ext( Slapi_PBlock *pb, const Slapi_DN *sdn, Slapi_Value **vals )
{
int i;
passwdPolicy *pwpolicy=NULL;
char *(*pws_enc) ( char *pwd ) = NULL;
if ( (NULL == pb) || (NULL == vals) ) {
return( 0 );
}
/* new_passwdPolicy gives us a local policy if sdn and pb are set and
can be used to find a lo... | false | false | false | false | false | 0 |
extDefDatatype(int datatype, int *prec, int *number)
{
if ( datatype != DATATYPE_FLT32 && datatype != DATATYPE_FLT64 &&
datatype != DATATYPE_CPX32 && datatype != DATATYPE_CPX64 )
datatype = DATATYPE_FLT32;
if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
*number = 2;
else
*numb... | false | false | false | false | false | 0 |
value_adjust(char *adjust_str, long base, long page_size)
{
long long adjust;
char *iter;
/* Convert and validate the adjust. */
errno = 0;
adjust = strtol(adjust_str, &iter, 0);
/* Catch strtol errors and sizes that overflow the native word size */
if (errno || adjust_str == iter) {
if (errno == ERANGE)
e... | false | false | false | false | false | 0 |
inf_communication_method_remove_member(InfCommunicationMethod* method,
InfXmlConnection* connection)
{
g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method));
g_return_if_fail(INF_IS_XML_CONNECTION(connection));
g_return_if_fail(inf_communication_method_is_member(method, conn... | false | false | false | false | false | 0 |
InvalidateCurrentWorkingDir(const CServerPath& path)
{
wxASSERT(!path.IsEmpty());
if (m_CurrentPath.IsEmpty())
return;
if (m_CurrentPath == path || path.IsParentOf(m_CurrentPath, false))
{
if (m_pCurOpData)
m_invalidateCurrentPath = true;
else
m_CurrentPath.Clear();
}
} | false | false | false | false | false | 0 |
select_view_line(struct view *view, unsigned long lineno)
{
if (lineno - view->offset >= view->height) {
view->offset = lineno;
view->lineno = lineno;
if (view_is_displayed(view))
redraw_view(view);
} else {
unsigned long old_lineno = view->lineno - view->offset;
view->lineno = lineno;
if (view_is_di... | false | false | false | false | false | 0 |
can_submit() {
if (getService()==SERVICE_LASTFM)
return !( (flags&FLAG_DISABLED) || (flags&FLAG_BANNED) || (flags&FLAG_BADAUTH) || (flags&FLAG_BADTIME));
else
return !( (flags&FLAG_DISABLED) || (flags&FLAG_BANNED) || (flags&FLAG_BADAUTH) || (flags&FLAG_BADTIME) || username.empty() || password.empty() );
} | false | false | false | false | false | 0 |
_dmalloc_strpbrk(const char *file, const int line,
const char *str, const char *list)
{
if (BIT_IS_SET(_dmalloc_flags, DEBUG_CHECK_FUNCS)) {
if ((! dmalloc_verify_pnt(file, line, "strpbrk", str,
0 /* not exact */, -1))
|| (! dmalloc_verify_pnt(file, line, "strpbrk", list,
0 /* not exact */, -1... | false | false | false | false | false | 0 |
SortByError()
{
// TODO: Is a bubble sort, not so eficient O(N^2)
// TODO: Enhancement 1: Do a Quick Sort
// TODO: Engancement 2: Sort an index array
DataArray & errors = GetCandidatesErr();
DataArray & freqs = GetCandidatesFreq();
const int nCandidates = GetnCandidates();
for (int i=0; i<nCandidates; i+... | false | false | false | false | false | 0 |
file_info_cmp (const void *p1, const void *p2)
{
const struct file_info *const s1 = (const struct file_info *) p1;
const struct file_info *const s2 = (const struct file_info *) p2;
const unsigned char *cp1;
const unsigned char *cp2;
/* Take care of file names without directories. We need to make sure that
... | false | false | false | false | false | 0 |
write_image_square (FttCell * cell, gpointer * data)
{
Colormap * colormap = data[0];
gdouble * min = data[1];
gdouble * max = data[2];
GfsVariable * v = data[3];
Image * image = data[4];
FttVector * lambda = data[5];
FttVector p;
GtsColor fc = { 0., 0., 0. }; /* nodata = black */
if (GFS_HAS_DATA (ce... | false | false | false | false | false | 0 |
off_to_str (off_t off)
{
static char bufs[NUM_SIMUL_OFF_TO_STRS][80];
static char (*next_buf)[80] = bufs;
if (next_buf >= (bufs + NUM_SIMUL_OFF_TO_STRS))
next_buf = bufs;
if (sizeof (off) > sizeof (long))
sprintf (*next_buf, "%lld", (long long int) off);
else if (sizeof (off) == sizeof (long))
s... | false | false | false | false | false | 0 |
send_file(struct mg_connection *conn, const char *path) {
char buf[1024];
struct stat st;
int n;
FILE *fp;
if (stat(path, &st) == 0 && (fp = fopen(path, "rb")) != NULL) {
mg_printf(conn, "--w00t\r\nContent-Type: image/jpeg\r\n"
"Content-Length: %lu\r\n\r\n", (unsigned long) st.st_size);
... | true | true | false | false | true | 1 |
div_normalization_factor(u_long w)
{
u_long b = (1L<<(WORD_BITS-1)), c = 0;
for (; b > 0; b>>=1, c++) {
if (w & b) return c;
}
/* something got wrong here */
Scm_Panic("bignum.c: div_normalization_factor: can't be here");
return 0; /* dummy */
} | false | false | false | false | false | 0 |
mailimf_header_string_write_driver(int (* do_write)(void *, const char *, size_t), void * data, int * col,
const char * str, size_t length)
{
int state;
const char * p;
const char * word_begin;
const char * word_end;
const char * next_word;
int first;
state = STATE_BEGIN;
p = str;
word_begin... | false | false | false | false | false | 0 |
orinoco_nortel_hw_init(struct orinoco_pci_card *card)
{
int i;
u32 reg;
/* Setup bridge */
if (ioread16(card->bridge_io) & 1) {
printk(KERN_ERR PFX "brg1 answer1 wrong\n");
return -EBUSY;
}
iowrite16(0x118, card->bridge_io + 2);
iowrite16(0x108, card->bridge_io + 2);
mdelay(30);
iowrite16(0x8, card->bridg... | false | false | false | false | false | 0 |
eet_clearcache(void)
{
int num = 0;
int i;
/*
* We need to compute the list of eet file to close separately from the cache,
* due to eet_close removing them from the cache after each call.
*/
LOCK_CACHE;
for (i = 0; i < eet_writers_num; i++)
{
if (eet_writers[i]->references <= 0... | false | true | false | false | false | 1 |
srpdev_close ( struct srp_device *srpdev, int rc ) {
struct srp_command *srpcmd;
struct srp_command *tmp;
if ( rc != 0 ) {
DBGC ( srpdev, "SRP %p closed: %s\n",
srpdev, strerror ( rc ) );
}
/* Shut down interfaces */
intf_shutdown ( &srpdev->socket, rc );
intf_shutdown ( &srpdev->scsi, rc );
/* Sh... | false | false | false | false | false | 0 |
dfb_window_repaint( CoreWindow *window,
const DFBRegion *region,
DFBSurfaceFlipFlags flags )
{
DFBResult ret;
CoreWindowStack *stack = window->stack;
D_ASSERT( window != NULL );
D_ASSERT( window->stack != NULL );
DFB_REGION_ASSERT_I... | false | false | false | false | false | 0 |
w5100_write_socket_port( nic_w5100_t *self, nic_w5100_socket_t *socket, int which, libspectrum_byte b )
{
nic_w5100_debug( "w5100: writing 0x%02x to S%d_PORT%d\n", b, socket->id, which );
socket->port[which] = b;
if( ++socket->bind_count == 2 ) {
if( socket->state == W5100_SOCKET_STATE_UDP && !socket->socket_... | false | false | false | false | false | 0 |
insert_freq(GHashTable *h, fs_quad_freq *f)
{
fs_quad_freq *old = (fs_quad_freq *)g_hash_table_lookup(h, f);
if (old) {
old->freq += f->freq;
} else {
g_hash_table_insert(h, f, f);
}
fs_quad_freq ponly = *f;
ponly.sec = FS_RID_NULL;
old = (fs_quad_freq *)g_hash_table_lookup(h... | false | false | false | false | false | 0 |
insert_type (char **argv, int *arg_ptr,
const struct parser_table *entry,
PRED_FUNC which_pred)
{
mode_t type_cell;
struct predicate *our_pred;
float rate = 0.5;
const char *typeletter;
if (collect_arg(argv, arg_ptr, &typeletter))
{
if (strlen(typeletter) != 1u)
{
error(1, 0, _("Arg... | false | false | false | false | false | 0 |
gtkaml_ast_markup_attribute_real_resolve (GtkamlAstMarkupAttribute* self, GtkamlMarkupResolver* resolver, GtkamlAstMarkupTag* markup_tag, GError** error) {
GtkamlAstMarkupTag* _tmp0_;
ValaDataType* _tmp1_;
ValaDataType* _tmp2_;
GtkamlAstMarkupTag* _tmp3_;
ValaDataType* _tmp4_;
ValaDataType* _tmp5_;
ValaObjectTyp... | false | false | false | false | false | 0 |
mc13xxx_rtc_irq_enable_unlocked(struct device *dev,
unsigned int enabled, int irq)
{
struct mc13xxx_rtc *priv = dev_get_drvdata(dev);
int (*func)(struct mc13xxx *mc13xxx, int irq);
if (!priv->valid)
return -ENODATA;
func = enabled ? mc13xxx_irq_unmask : mc13xxx_irq_mask;
return func(priv->mc13xxx, irq);
} | false | false | false | false | false | 0 |
hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen,
const unsigned char *in, unsigned long inlen, ...)
{
hash_state *md;
int err;
va_list args;
const unsigned char *curptr;
unsigned long curlen;
LTC_ARGCHK(in... | false | false | false | true | false | 1 |
read_data_sectors_image ( void *p_user_data, void *p_buf,
lsn_t i_lsn, uint16_t i_blocksize,
uint32_t i_blocks )
{
const _img_private_t *p_env = p_user_data;
if (!p_env || !p_env->gen.cdio) return DRIVER_OP_UNINIT;
{
CdIo_t *p_cdio = p_env->gen.cdio;
track_t i_track ... | false | false | false | false | false | 0 |
withinDrawBinned (splotd * sp, gint m, GdkDrawable * drawable, GdkGC * gc)
{
displayd *display = sp->displayptr;
GGobiData *d = display->d;
ggobid *gg = GGobiFromSPlot (sp);
gint n, lwidth, ltype, gtype;
if (!gg || !display)
return;
if (display->options.whiskers_show_p) {
n = 2 * m;
lwidth = l... | false | false | false | false | false | 0 |
setcmd( /* returns length or -1 (error) */
int ident, /* radio ID */
int cmmd, /* command */
int subcmd /* subcommand */
)
{
u_char cmd[] = {FI, FI, FI, FI};
u_char rsp[BMAX];
cmd[0] = cmmd;
cmd[1] = subcmd;
if (subcmd & 0x8000)
cmd[2] = (subcmd >> 8) & 0x7f;
return (setcmda(ident, cmd, rsp));
} | false | false | false | false | false | 0 |
Find(const std::string& name, bool recursive ) {
for(PG_Widget* i = first(); i != NULL; i = i->next()) {
if(i->GetName() == name) {
return i;
}
}
if ( recursive )
for(PG_Widget* i = first(); i != NULL; i = i->next()) {
PG_Widget* w = i->FindChild(name, recursive );
if( w ) {
return w;
}
}
re... | false | false | false | false | false | 0 |
create_hdmi(struct platform_device *dev)
{
int ret;
ret = sysfs_create_group(&dev->dev.kobj, &hdmi_attribute_group);
if (ret)
goto error_create_hdmi;
return 0;
error_create_hdmi:
remove_hdmi(dev);
return ret;
} | false | false | false | false | false | 0 |
ecc_export(unsigned char *out, unsigned long *outlen, int type, ecc_key *key)
{
int err;
unsigned char flags[1];
unsigned long key_size;
LTC_ARGCHK(out != NULL);
LTC_ARGCHK(outlen != NULL);
LTC_ARGCHK(key != NULL);
/* type valid? */
if (key->type != PK_PRIVATE && type == PK_... | true | true | false | true | false | 1 |
gle_int_to_string_bin(int value, string* binary) {
vector<unsigned char> values;
while (value > 0) {
values.push_back((unsigned char)(value % 2));
value /= 2;
}
stringstream out;
for (int i = values.size()-1; i >= 0; i--) {
out << (int)values[i];
}
*binary = out.str();
} | false | false | false | false | false | 0 |
RegExpFlagsToString(RegExp::Flags flags) {
char flags_buf[3];
int num_flags = 0;
if ((flags & RegExp::kGlobal) != 0) flags_buf[num_flags++] = 'g';
if ((flags & RegExp::kMultiline) != 0) flags_buf[num_flags++] = 'm';
if ((flags & RegExp::kIgnoreCase) != 0) flags_buf[num_flags++] = 'i';
ASSERT(num_flags <= st... | false | false | false | false | true | 1 |
compare_nodes (void const *a, void const *b)
{
struct merge_node const *nodea = a;
struct merge_node const *nodeb = b;
if (nodea->level == nodeb->level)
return (nodea->nlo + nodea->nhi) < (nodeb->nlo + nodeb->nhi);
return nodea->level < nodeb->level;
} | false | false | false | false | false | 0 |
load_module(void)
{
int res = ast_custom_function_register(&srv_query_function);
if (res < 0) {
return AST_MODULE_LOAD_DECLINE;
}
res = ast_custom_function_register(&srv_result_function);
if (res < 0) {
return AST_MODULE_LOAD_DECLINE;
}
return AST_MODULE_LOAD_SUCCESS;;
} | false | false | false | false | false | 0 |
vl_hikm_push (VlHIKMTree *f, vl_uint32 *asgn, vl_uint8 const *data, vl_size N)
{
vl_uindex i, d ;
vl_size M = vl_hikm_get_ndims (f) ;
vl_size depth = vl_hikm_get_depth (f) ;
/* for each datum */
for(i = 0 ; i < N ; i++) {
VlHIKMNode *node = f->root ;
d = 0 ;
while (node) {
vl_uint32 best ;
... | false | false | false | false | false | 0 |
enic_grxclsrlall(struct enic *enic, struct ethtool_rxnfc *cmd,
u32 *rule_locs)
{
int j, ret = 0, cnt = 0;
cmd->data = enic->rfs_h.max - enic->rfs_h.free;
for (j = 0; j < (1 << ENIC_RFS_FLW_BITSHIFT); j++) {
struct hlist_head *hhead;
struct hlist_node *tmp;
struct enic_rfs_fltr_node *n;
hhead = &enic... | false | false | false | false | false | 0 |
check_markers (ClutterTimeline *timeline,
gint delta)
{
ClutterTimelinePrivate *priv = timeline->priv;
struct CheckIfMarkerHitClosure data;
/* shortcircuit here if we don't have any marker installed */
if (priv->markers_by_name == NULL)
return;
/* store the details of the timeline so that... | false | false | false | false | false | 0 |
log2withScale_128(guint64 alo, guint64 ahi, int scale)
{
int tlog2 = log2_128(alo, ahi);
if (tlog2 < 0) tlog2 = 0;
return tlog2 - (scale * 33219) / 10000;
} | false | false | false | false | false | 0 |
str() const
{
char ss[6];
snprintf(ss, sizeof(ss), "%s%s%c",
square_str[from()],
square_str[to()],
(flags() & MOVE_PROMOTION) ?
tolower(piece_char[promote_to()])
: '\0' );
return std::string(ss);
} | false | false | false | false | false | 0 |
setTextEngine( QwtText::TextFormat format,
QwtTextEngine *engine )
{
if ( format == QwtText::AutoText )
return;
if ( format == QwtText::PlainText && engine == NULL )
return;
EngineMap::const_iterator it = d_map.find( format );
if ( it != d_map.end() )
{
const QwtTextEng... | false | false | false | false | false | 0 |
possibly_as_a_result_of_a_preceding(explain_string_buffer_t *sb, int fildes)
{
int flags;
flags = fcntl(fildes, F_GETFL);
if (flags < 0)
flags = O_RDWR;
explain_string_buffer_puts(sb, ", ");
switch (flags & O_ACCMODE)
{
case O_RDONLY:
explain_buffer_gettext
... | false | false | false | false | false | 0 |
load (string fname)
{
igzstream file;
s_int8 retvalue = -1;
string fdef (MAPS_DIR);
fdef += fname;
file.open (fdef);
if (!file.is_open ())
return -1;
if (fileops::get_version (file, 1, 1, fdef))
retvalue = get (file);
file.close ();
filename_ = fname;
return ret... | false | false | false | false | false | 0 |
variable_cb_2(p_cb_data cause)
{
struct vcd_info* info = vcd_dmp_list;
PLI_UINT64 now = timerec_to_time64(cause->time);
if (now != vcd_cur_time) {
fstWriterEmitTimeChange(dump_file, now);
vcd_cur_time = now;
}
do {
show_this_item(info);
info->scheduled = 0... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
if(argc > 1) {
run_from_file(argv[1]);
} else {
fprintf(stderr, "Error: Please specify a .svm compiled bytecode file.\n");
return -1;
}
/* for debugging purposes */
/* print_memory(30); */
return 0;
} | false | false | false | false | false | 0 |
gst_multipart_demux_class_init (GstMultipartDemuxClass * klass)
{
int i;
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
gobject_class->finalize = gst_multipart_demux_finalize;
gobject_class->set_property = gst_multipart_set_property;
go... | false | false | false | false | false | 0 |
calc_gaussgrid(double *yvals, int ysize, double yfirst, double ylast)
{
double *yw;
long yhsize;
long i;
yw = (double *) malloc(ysize*sizeof(double));
gaussaw(yvals, yw, ysize);
free(yw);
for ( i = 0; i < ysize; i++ )
yvals[i] = asin(yvals[i])/M_PI*180.0;
if ( yfirst < ylast && yfirst > -90.0 && y... | false | false | false | false | false | 0 |
can_remove_node_now_p_1 (struct cgraph_node *node)
{
/* FIXME: When address is taken of DECL_EXTERNAL function we still
can remove its offline copy, but we would need to keep unanalyzed node in
the callgraph so references can point to it. */
return (!node->symbol.address_taken
&& !ipa_ref_has_aliases_... | false | false | false | false | false | 0 |
merge_clusters(cluster_t *cluster)
{
int first, second;
while (cluster->num_clusters > 1) {
if (find_clusters_to_merge(cluster, &first, &second) != -1)
merge(cluster, first, second);
}
return cluster;
} | false | false | false | false | false | 0 |
gzfile_close(struct gzfile *gz, int closeflag)
{
VALUE io = gz->io;
gz->end(gz);
gz->io = Qnil;
gz->orig_name = Qnil;
gz->comment = Qnil;
if (closeflag && rb_respond_to(io, id_close)) {
rb_funcall(io, id_close, 0);
}
} | false | false | false | false | false | 0 |
common_vh_start(int num_pixmaps)
{
int i;
total_pixmaps = num_pixmaps;
for (i = 0;i < 8;i++)
{
if (i < total_pixmaps)
{
if (!(pixmap[i] = auto_malloc(256*256))) return 1;
}
else
pixmap[i] = NULL;
}
return 0;
} | false | false | false | false | false | 0 |
docloseopen(void)
{
int ret;
if (testcalls <= simulatedopcount)
return;
if (debug)
prt("%lu close/open\n", testcalls);
if ((ret = rbd_close(image)) < 0) {
prterrcode("docloseopen: close", ret);
report_failure(180);
}
ret = rbd_open(ioctx, iname, &image, NULL);
if (ret < 0) {
prterrcode("docloseopen: ... | false | false | false | false | false | 0 |
wl1251_cmd_template_set(struct wl1251 *wl, u16 cmd_id,
void *buf, size_t buf_len)
{
struct wl1251_cmd_packet_template *cmd;
size_t cmd_len;
int ret = 0;
wl1251_debug(DEBUG_CMD, "cmd template %d", cmd_id);
WARN_ON(buf_len > WL1251_MAX_TEMPLATE_SIZE);
buf_len = min_t(size_t, buf_len, WL1251_MAX_TEMPLATE_SI... | false | false | false | false | false | 0 |
printf_frames(const uint8_t* bits, int max_frames,
int row, int major, int minor, int print_empty, int no_clock)
{
int i, i_without_clk;
char prefix[128], suffix[128];
if (row < 0)
sprintf(prefix, "f%i ", abs(row));
else
sprintf(prefix, "r%i ma%i mi%i ", row, major, minor);
if (is_empty(bits, 130)) {
for ... | true | true | false | false | false | 1 |
divided_max_mean(data_t *dataseries_i, int datalength, int length, int *offset)
{
int shift=length;
//if sorting data the following is an important speedup hack
if (shift>180) shift=180;
int window_length=length+shift;
if (window_length>datalength) window_length=datalength;
// put down as ma... | false | false | false | false | false | 0 |
getNamespaceId(const KEYXMLReader::AttributeIterator &attribute)
{
return attribute.getToken(attribute.getNamespace() ? attribute.getNamespace() : "");
} | false | false | false | false | false | 0 |
ppolicy_initialize()
{
int i, code;
for (i=0; pwd_OpSchema[i].def; i++) {
code = register_at( pwd_OpSchema[i].def, pwd_OpSchema[i].ad, 0 );
if ( code ) {
Debug( LDAP_DEBUG_ANY,
"ppolicy_initialize: register_at failed\n", 0, 0, 0 );
return code;
}
/* Allow Manager to set these as needed */
if ( is... | false | false | false | false | false | 0 |
bcm3510_attach(const struct bcm3510_config *config,
struct i2c_adapter *i2c)
{
struct bcm3510_state* state = NULL;
int ret;
bcm3510_register_value v;
/* allocate memory for the internal state */
state = kzalloc(sizeof(struct bcm3510_state), GFP_KERNEL);
if (state == NULL)
goto error;
/* setup the stat... | false | false | false | false | false | 0 |
ReleaseCurrentLock()
{
if (IGNORELOCK)
{
return;
}
Debug("ReleaseCurrentLock(%s)\n",CFLOCK);
if (strlen(CFLAST) == 0)
{
return;
}
if (DeleteLock(CFLOCK) == -1)
{
Debug("Unable to remove lock %s\n",CFLOCK);
return;
}
if (PutLock(CFLAST) == -1)
{
snprintf(OUTPUT,CF_BUFSIZE*2,"Una... | false | false | false | false | false | 0 |
cc_on_dialog_remove_clicked(GtkButton *button, struct cc_dialog *cc)
{
GtkTreeIter iter;
if (gtk_tree_selection_get_selected(cc->selection, NULL, &iter))
gtk_list_store_remove(cc->store, &iter);
} | false | false | false | false | false | 0 |
test(char *URL)
{
CURL *curl;
CURLcode res=CURLE_OK;
struct curl_slist *slist = NULL;
struct WriteThis pooh;
pooh.counter = 0;
if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
fprintf(stderr, "curl_global_init() failed\n");
return TEST_ERR_MAJOR_BAD;
}
if ((curl = curl_easy_init()) == NULL... | false | false | false | false | false | 0 |
moveResizeForClient(int new_x, int new_y,
unsigned int new_width, unsigned int new_height, int gravity, unsigned int client_bw) {
m_placed = true;
frame().moveResizeForClient(new_x, new_y, new_width, new_height, gravity, client_bw);
setFocusFlag(m_focused);
m_state.shaded... | false | false | false | false | false | 0 |
relpath(RelFileNode rnode, ForkNumber forknum)
{
int pathlen;
char *path;
if (rnode.spcNode == GLOBALTABLESPACE_OID)
{
/* Shared system relations live in {datadir}/global */
Assert(rnode.dbNode == 0);
pathlen = 7 + OIDCHARS + 1 + FORKNAMECHARS + 1;
path = (char *) palloc(pathlen);
if (forknum != MAI... | false | false | false | false | false | 0 |
GammaBuilder_reftrace(CTX ctx, kRawPtr *o FTRARG)
{
size_t i;
knh_GammaBuilderEX_t *b = DP((kGammaBuilder*)o);
KNH_ENSUREREF(ctx, b->gcapacity * 3);
for(i = 0; i < b->gcapacity; i++) {
KNH_ADDREF(ctx, b->gf[i].tkIDX);
KNH_ADDREF(ctx, b->gf[i].tk);
}
KNH_ADDREF(ctx, (b->mtd));
KNH_ADDREF(ctx, (b->stmt));
KNH... | false | false | false | false | false | 0 |
EmitNonLocalJumpFixup(JSContext *cx, JSCodeGenerator *cg, JSStmtInfo *toStmt)
{
intN depth, npops;
JSStmtInfo *stmt;
/*
* The non-local jump fixup we emit will unbalance cg->stackDepth, because
* the fixup replicates balanced code such as JSOP_LEAVEWITH emitted at the
* end of a with stateme... | false | false | false | false | false | 0 |
unregister_slave_subprocess (pid_t child)
{
/* The easiest way to remove an entry from a list that can be used by
an asynchronous signal handler is just to mark it as unused. For this,
we rely on sig_atomic_t. */
slaves_entry_t *s = slaves;
slaves_entry_t *s_end = s + slaves_count;
for (; s < s_end... | false | false | false | false | false | 0 |
sis_malloc(struct sis_memreq *req)
{
struct sis_video_info *ivideo = sisfb_heap->vinfo;
if(&ivideo->sisfb_heap == sisfb_heap)
sis_int_malloc(ivideo, req);
else
req->offset = req->size = 0;
} | false | false | false | false | false | 0 |
lgs8gxx_write_reg(struct lgs8gxx_state *priv, u8 reg, u8 data)
{
int ret;
u8 buf[] = { reg, data };
struct i2c_msg msg = { .flags = 0, .buf = buf, .len = 2 };
msg.addr = priv->config->demod_address;
if (priv->config->prod != LGS8GXX_PROD_LGS8G75 && reg >= 0xC0)
msg.addr += 0x02;
if (debug >= 2)
dprintk("%s:... | false | false | false | false | false | 0 |
xtra_tcl_get(Tcl_Interp * irp, struct userrec *u,
struct user_entry *e, int argc, char **argv)
{
struct xtra_key *x;
BADARGS(3, 4, " handle XTRA ?key?");
if (argc == 4) {
for (x = e->u.extra; x; x = x->next)
if (!egg_strcasecmp(argv[3], x->key)) {
Tcl_AppendResult(irp, ... | false | false | false | false | false | 0 |
index_iterator__index_entry(index_iterator *ii)
{
const git_index_entry *ie = git_index_get_byindex(ii->index, ii->current);
if (ie != NULL && iterator__past_end(ii, ie->path)) {
ii->current = git_index_entrycount(ii->index);
ie = NULL;
}
return ie;
} | false | false | false | false | false | 0 |
get_length_mbs_utf8_compose( int flags, const char *src, int srclen )
{
int ret = 0;
unsigned int res;
WCHAR composed[2];
const char *srcend = src + srclen;
composed[0] = 0;
while (src < srcend)
{
unsigned char ch = *src++;
if (ch < 0x80) /* special fast case for 7-bit ASCI... | false | false | false | false | false | 0 |
currentIsoCountry() const
{
bool ok;
int country = itemData(currentIndex()).toInt(&ok);
return ok? Utils::countryToIso(QLocale::Country(country)).toUpper() : QString();
} | false | false | false | false | false | 0 |
_show_add_to_group_dialog_on_idle (GSList *pictures)
{
FrogrController *controller = NULL;
FrogrControllerPrivate *priv = NULL;
FrogrModel *model = NULL;
GSList *groups = NULL;
controller = frogr_controller_get_instance ();
priv = FROGR_CONTROLLER_GET_PRIVATE (controller);
/* Keep the source while inter... | false | false | false | false | false | 0 |
doDuties()
{
if (!OriginalMsg) {
Log(Error) << "Internal error. Unable to set prefixes: setContext() not called." << LogEnd;
return false;
}
switch(OriginalMsg->getType()) {
case REQUEST_MSG:
case SOLICIT_MSG:
return addPrefixes();
case RELEASE_MSG:
return delPrefixes();
case RENEW_MSG... | false | false | false | false | false | 0 |
js_DoubleToECMAUint32(jsdouble d)
{
int32 i;
JSBool neg;
jsdouble two32;
if (!JSDOUBLE_IS_FINITE(d))
return 0;
/*
* We check whether d fits int32, not uint32, as all but the ">>>" bit
* manipulation bytecode stores the result as int, not uint. When the
* result does not fit ... | false | false | false | false | false | 0 |
GH5_FetchAttribute( hid_t loc_id, const char *pszAttrName,
double &dfResult, bool bReportError )
{
hid_t hAttr = H5Aopen_name( loc_id, pszAttrName );
dfResult = 0.0;
if( hAttr < 0 )
{
if( bReportError )
CPLError( CE_Failure, CPLE_AppDefined,
... | false | false | false | false | false | 0 |
do_grxclass(struct cmd_context *ctx)
{
struct ethtool_rxnfc nfccmd;
int err;
if (ctx->argc == 2 && !strcmp(ctx->argp[0], "rx-flow-hash")) {
int rx_fhash_get;
rx_fhash_get = rxflow_str_to_type(ctx->argp[1]);
if (!rx_fhash_get)
exit_bad_args();
nfccmd.cmd = ETHTOOL_GRXFH;
nfccmd.flow_type = rx_fhash_ge... | false | false | false | false | false | 0 |
H5Pget_nlinks(hid_t plist_id, size_t *nlinks)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*z", plist_id, nlinks);
if(!nlinks)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid... | false | false | false | false | false | 0 |
create_handshake_request(FXString & request) {
FXMutexLock lock(mutex_data);
FXTRACE((60,"GMAudioScrobbler::create_handshake_request\n"));
if (mode==SERVICE_LASTFM) {
FXString signature=GMStringFormat("api_key%smethodauth.getSessiontoken%s%s",CLIENT_KEY,token.text(),CLIENT_SECRET);
checksum(signature);
... | false | false | false | false | false | 0 |
probable_prime_dh_safe(BIGNUM *p, int bits, const BIGNUM *padd,
const BIGNUM *rem, BN_CTX *ctx)
{
int i,ret=0;
BIGNUM *t1,*qadd,*q;
bits--;
BN_CTX_start(ctx);
t1 = BN_CTX_get(ctx);
q = BN_CTX_get(ctx);
qadd = BN_CTX_get(ctx);
if (qadd == NULL) goto err;
if (!BN_rshift1(qadd,padd)) goto err;
if (!BN_ran... | false | false | false | false | false | 0 |
do_cmd_wiz_zap(int d)
{
int i;
/* Banish everyone nearby */
for (i = 1; i < mon_max; i++)
{
monster_type *m_ptr = &mon_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
/* Skip distant monsters */
if (m_ptr->cdis > d) continue;
/* Delete the monster */
delete_monster_idx(i);
}
/* U... | false | false | false | false | false | 0 |
getuser(void)
{
static char user[64];
if(user[0] == 0){
struct passwd *pw = getpwuid(getuid());
strcpy(user, pw ? pw->pw_name : "nobody");
}
return user;
} | false | false | false | false | false | 0 |
watchUpdated()
{
statusBar->clearstatus();
statusBar->status(_("Updating watch list..."));
statusBar->flush();
getServer()->saveFolderIndex(this);
statusBar->status(_("... done"));
} | false | false | false | false | false | 0 |
vpsmemMuckOut( CoreSurfacePool *pool,
void *pool_data,
void *pool_local,
CoreSurfaceBuffer *buffer )
{
CoreSurface *surface;
VPSMemPoolData *data = pool_data;
VPSMemPoolLocalData *local = pool_local;
D_DEBU... | false | false | false | false | false | 0 |
vmx_get_nmi_mask(struct kvm_vcpu *vcpu)
{
if (!cpu_has_virtual_nmis())
return to_vmx(vcpu)->soft_vnmi_blocked;
if (to_vmx(vcpu)->nmi_known_unmasked)
return false;
return vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_NMI;
} | false | false | false | false | false | 0 |
mode_check_assertion (NODE_T * p)
{
SOID_T w, y;
make_soid (&w, STRONG, MODE (BOOL), 0);
mode_check_enclosed (SUB_NEXT (p), &w, &y);
SORT (&y) = SORT (&w); /* Patch */
if (!is_coercible_in_context (&y, &w, NO_DEFLEXING)) {
cannot_coerce (NEXT (p), MOID (&y), MOID (&w), MEEK, NO_DEFLEXING, ENCLOSED_CLAUSE)... | false | false | false | false | false | 0 |
state_new(HTK_HMM_INFO *hmm)
{
HTK_HMM_State *new;
int i;
new = (HTK_HMM_State *)mybmalloc2(sizeof(HTK_HMM_State), &(hmm->mroot));
new->name = NULL;
new->nstream = hmm->opt.stream_info.num;
new->w = NULL;
new->pdf = (HTK_HMM_PDF **)mybmalloc2(sizeof(HTK_HMM_PDF *) * new->nstream, &(hmm->mroot));
for(i=... | false | false | false | false | false | 0 |
auth() const
{
Auth ret;
const char* sp = getHeader("Authorization");
if (!sp)
return ret;
std::string s = sp;
std::string::size_type p = s.find(' ');
if (p == std::string::npos)
return ret;
std::istringstream in(s);
in.ignore(p + 1);
cxxtools::BasicTextIStream<ch... | false | false | false | false | false | 0 |
readTriMesh(const std::string& meshfilename)
{
console.XDebug() << "CLatticeMaster::readTriMesh(" << meshfilename << ")\n";
// buffers
MeshNodeDataVector node_send_buffer;
MeshTriDataVector tri_send_buffer;
// mesh reader
MeshReader reader(meshfilename);
// --- Nodes ---
MeshReader::NodeIterator &nite... | false | false | false | false | false | 0 |
imx_pcm_dma_init(struct platform_device *pdev, size_t size)
{
struct snd_dmaengine_pcm_config *config;
struct snd_pcm_hardware *pcm_hardware;
config = devm_kzalloc(&pdev->dev,
sizeof(struct snd_dmaengine_pcm_config), GFP_KERNEL);
*config = imx_dmaengine_pcm_config;
if (size)
config->prealloc_buffer_size = si... | false | false | false | false | false | 0 |
globus_l_gfs_remote_node_request(
globus_l_gfs_remote_handle_t * my_handle,
int num_nodes,
char * repo_name,
globus_l_gfs_remote_node_cb callback,
void * user_arg)
{
int ... | false | false | false | false | false | 0 |
trigger_key_use (edict_t * self, edict_t * other, edict_t * activator)
{
int index;
if (!self->item)
return;
if (!activator->client)
return;
index = ITEM_INDEX (self->item);
if (!activator->client->pers.inventory[index])
{
if (level.time < self->touch_debounce_time)
return;
self->to... | false | false | false | false | false | 0 |
trace_distinct_msg(char *prefix, FILE *f, char *s, va_list args)
{
GSList *list=trace_buffer;
gchar *str=g_strdup_vprintf((gchar *)s, args);
int cksum=trace_cksum((const char *)str);
int *pcksum;
gboolean ignore=FALSE;
while (list) {
if ((*(int *)(list->data))==cksum) {
ignore=TRUE;
break;
}
list=list... | false | false | false | false | false | 0 |
ipv6_scan(const char* s, ipv6addr* addr)
{
uint16 bits[8];
unsigned len1;
unsigned len2;
unsigned i;
len1 = len2 = 0;
if (s[0] == ':' && s[1] == ':')
++s;
else {
while (len1 < 8) {
const char* news;
if ((news = parse_hexpart(s, &bits[len1])) == 0 ||
(news == s && *news != ':'))
ret... | false | false | false | false | true | 1 |
devres_remove_group(struct device *dev, void *id)
{
struct devres_group *grp;
unsigned long flags;
spin_lock_irqsave(&dev->devres_lock, flags);
grp = find_group(dev, id);
if (grp) {
list_del_init(&grp->node[0].entry);
list_del_init(&grp->node[1].entry);
devres_log(dev, &grp->node[0], "REM");
} else
WARN... | false | false | false | false | false | 0 |
prescriptionHasAllergies()
{
if (!d->m_AllergyEngine)
return false;
foreach(const IDrug *drug, d->m_DrugsList) {
d->m_AllergyEngine->check(DrugsDB::IDrugAllergyEngine::Allergy, drug->drugId().toString());
if (d->m_AllergyEngine->has(DrugsDB::IDrugAllergyEngine::Allergy, drug->drugId().to... | 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.