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 |
|---|---|---|---|---|---|---|
dj_free_sfx(unsigned char sfx_num)
{
if (main_info.no_sound)
return;
free(sounds[sfx_num].buf);
memset(&sounds[sfx_num], 0, sizeof(sfx_data));
} | false | false | false | false | false | 0 |
dbus_init( ) {
char * request_ret = NULL;
unsigned int result;
GError * error = NULL;
/* Initialize the GType/GObject system */
g_type_init();
g_print(":main Connecting to the Session D-Bus.\n");
bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
if ( error != NULL )
{
fpri... | false | false | false | false | false | 0 |
secu_PrintECPublicKey(FILE *out, SECKEYPublicKey *pk, char *m, int level)
{
SECItem curveOID = { siBuffer, NULL, 0};
SECU_Indent(out, level); fprintf(out, "%s:\n", m);
SECU_PrintInteger(out, &pk->u.ec.publicValue, "PublicValue", level+1);
/* For named curves, the DEREncodedParams field contains an
... | false | false | false | false | false | 0 |
slice_add(int id, Tcl_Interp * interp, int argc, char *argv[])
{
if (GVL_slice_add(id) == -1) {
Tcl_SetResult(interp, "Error: unable to add slice", TCL_VOLATILE);
return (TCL_ERROR);
}
return (TCL_OK);
} | false | false | false | false | false | 0 |
r_jacobi(){ //Equation (18) AG2012
double rj = 0;
if (galaxy.type == 1)
rj = pow((N*mm.nbody)/(3.0*galaxy.M.nbody),(1.0/3.0))*galaxy.R.nbody;
else if (galaxy.type == 2)
rj = pow((N*mm.nbody)/(2.0*galaxy.M.nbody),(1.0/3.0))*galaxy.R.nbody;
return rj;
} | false | false | false | false | false | 0 |
rnd_pos(const void *pos)
{
PFS_mutex *mutex;
PFS_rwlock *rwlock;
PFS_cond *cond;
PFS_file *file;
set_position(pos);
switch (m_pos.m_index_1) {
case pos_all_instr::VIEW_MUTEX:
DBUG_ASSERT(m_pos.m_index_2 < mutex_max);
mutex= &mutex_array[m_pos.m_index_2];
if (mutex->m_lock.is_populated())
... | false | false | false | false | false | 0 |
tcm_qla2xxx_shutdown_session(struct se_session *se_sess)
{
struct qla_tgt_sess *sess = se_sess->fabric_sess_ptr;
struct scsi_qla_host *vha;
unsigned long flags;
BUG_ON(!sess);
vha = sess->vha;
spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
target_sess_cmd_list_set_waiting(se_sess);
spin_unlock_irqrestore(... | false | false | false | false | false | 0 |
gst_video_encoder_decide_allocation_default (GstVideoEncoder * encoder,
GstQuery * query)
{
GstAllocator *allocator = NULL;
GstAllocationParams params;
gboolean update_allocator;
/* we got configuration from our peer or the decide_allocation method,
* parse them */
if (gst_query_get_n_allocation_param... | false | false | false | false | false | 0 |
parse_command(int argc, char *argv[], struct GParams *params)
{
params->mode_all = G_define_flag();
params->mode_all->key = 'a';
params->mode_all->description =
_("Use draw mode for all loaded surfaces");
params->mode_all->guisection = _("Surfaces");
/*** surface attributes ***/
args_surfa... | false | false | false | false | false | 0 |
update_read_polygon_sc_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_SC_ORDER* polygon_sc)
{
if (orderInfo->fieldFlags & ORDER_FIELD_01)
update_read_coord(s, &polygon_sc->xStart, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_02)
update_read_coord(s, &polygon_sc->yStart, orderInfo->delta... | false | false | false | false | false | 0 |
e1000_get_bus_info_82542(struct e1000_hw *hw)
{
DEBUGFUNC("e1000_get_bus_info_82542");
hw->bus.type = e1000_bus_type_pci;
hw->bus.speed = e1000_bus_speed_unknown;
hw->bus.width = e1000_bus_width_unknown;
return E1000_SUCCESS;
} | false | false | false | false | false | 0 |
parseOperand(OperandVector &Operands, StringRef Mnemonic) {
OperandMatchResultTy ResTy = MatchOperandParserImpl(Operands, Mnemonic);
// If there wasn't a custom match, try the generic matcher below. Otherwise,
// there was a match, but an error occurred, in which case, just return that
// the operand parsing ... | false | false | false | false | false | 0 |
nfsd4_get_session_locked(struct nfsd4_session *ses)
{
__be32 status;
if (is_session_dead(ses))
return nfserr_badsession;
status = get_client_locked(ses->se_client);
if (status)
return status;
atomic_inc(&ses->se_ref);
return nfs_ok;
} | false | false | false | false | false | 0 |
text_editor_replace_selection (TextEditor * te, const gchar* r_str)
{
if (!te) return;
scintilla_send_message (SCINTILLA(te->scintilla), SCI_REPLACESEL, 0,
(long)r_str);
} | false | false | false | false | false | 0 |
asn1_get_int(const uint8_t *buf, int *offset, uint8_t **object)
{
int len;
if ((len = asn1_next_obj(buf, offset, ASN1_INTEGER)) < 0)
goto end_int_array;
if (len > 1 && buf[*offset] == 0x00) /* ignore the negative byte */
{
len--;
(*offset)++;
}
*object = (uint8_t *)... | false | true | false | false | false | 1 |
HmacFile(const char *hexKey, const char *file)
{
member_ptr<MessageAuthenticationCode> mac;
if (strcmp(hexKey, "selftest") == 0)
{
cerr << "Computing HMAC/SHA1 value for self test.\n";
mac.reset(NewIntegrityCheckingMAC());
}
else
{
std::string decodedKey;
StringSource(hexKey, true, new HexDecoder(new Stri... | false | false | false | false | false | 0 |
GetNeutralBrush()
{
QRadialGradient rgrad(20, 20, 40, 5, 5);
rgrad.setColorAt(0.0, QColor(0xff, 0xff, 0xff, 0xff));
rgrad.setColorAt(1.0, QColor(0x80, 0x80, 0x80, 0xff));
return QBrush(rgrad);
} | false | false | false | false | false | 0 |
_set_upload_headers (YoutubeProxy *self,
SoupMessageHeaders *headers,
const gchar *filename)
{
YoutubeProxyPrivate *priv = self->priv;
gchar *user_auth_header;
gchar *devkey_header;
gchar *basename;
const gchar *user_agent;
/* Set the user agent, if one was set in ... | false | false | false | false | false | 0 |
http_read(URLContext *h, uint8_t *buf, int size)
{
HTTPContext *s = h->priv_data;
int len;
/* read bytes from input buffer first */
len = s->buf_end - s->buf_ptr;
if (len > 0) {
if (len > size)
len = size;
memcpy(buf, s->buf_ptr, len);
s->buf_ptr += len;
} el... | false | true | false | false | false | 1 |
menu_handle_mouse(menu_type *menu, const ui_event_data *in,
ui_event_data *out)
{
int new_cursor;
if (!region_inside(&menu->active, in))
{
/* A click to the left of the active region is 'back' */
if (region_inside(&menu->boundary, in) &&
in->mousex < menu->active.col)
out->type = EVT_ESCAPE;
}
else
... | false | false | false | false | false | 0 |
setFromString(const char *color_string, int screen) {
if (color_string == 0) {
free();
return false;
}
string color_string_tmp = color_string;
StringUtil::removeFirstWhitespace(color_string_tmp);
StringUtil::removeTrailingWhitespace(color_string_tmp);
Display *disp = App::insta... | false | false | false | false | false | 0 |
unblock_children (GnlComposition * comp)
{
GstIterator *children;
children = gst_bin_iterate_elements (GST_BIN (comp));
retry:
if (G_UNLIKELY (gst_iterator_fold (children,
(GstIteratorFoldFunction) unblock_child_pads, NULL,
comp) == GST_ITERATOR_RESYNC)) {
gst_iterator_resync (ch... | false | false | false | false | false | 0 |
velocity_get_pci_info(struct velocity_info *vptr,
struct pci_device *pdev)
{
if (pci_read_config_byte(pdev, PCI_REVISION_ID, &vptr->rev_id) < 0) {
printf("DEBUG: pci_read_config_byte failed\n");
return -1;
}
adjust_pci_device(pdev);
vptr->ioaddr = pci_bar_start(pdev, PCI_BASE_ADDRESS_0);
vptr->memaddr =... | false | false | false | false | false | 0 |
find_previous_pathsep(path, psep)
char_u *path;
char_u **psep;
{
/* skip the current separator */
if (*psep > path && vim_ispathsep(**psep))
--*psep;
/* find the previous separator */
while (*psep > path)
{
if (vim_ispathsep(**psep))
return OK;
mb_ptr_back(path, *psep);
}
r... | false | false | false | false | false | 0 |
list_dir_status_header(UAContext *ua)
{
char dt[MAX_TIME_LENGTH];
char b1[35], b2[35], b3[35], b4[35], b5[35];
ua->send_msg(_("%s Version: %s (%s) %s %s %s\n"), my_name, VERSION, BDATE,
HOST_OS, DISTNAME, DISTVER);
bstrftime_nc(dt, sizeof(dt), daemon_start_time);
ua->send_msg(_("Daemon start... | false | false | false | false | false | 0 |
sisfb_detect_lcd_type(struct sis_video_info *ivideo)
{
u8 reg;
int i;
reg = SiS_GetReg(SISCR, 0x36);
reg &= 0x0f;
if(ivideo->sisvga_engine == SIS_300_VGA) {
ivideo->CRT2LCDType = sis300paneltype[reg];
} else if(ivideo->chip >= SIS_661) {
ivideo->CRT2LCDType = sis661paneltype[reg];
} else {
ivideo->CRT2LCD... | false | false | false | false | false | 0 |
__s5k6a3_get_format(
struct s5k6a3 *sensor, struct v4l2_subdev_pad_config *cfg,
u32 pad, enum v4l2_subdev_format_whence which)
{
if (which == V4L2_SUBDEV_FORMAT_TRY)
return cfg ? v4l2_subdev_get_try_format(&sensor->subdev, cfg, pad) : NULL;
return &sensor->format;
} | false | false | false | false | false | 0 |
create_segment_event (GstRDTDepay * depay, gboolean update,
GstClockTime position)
{
GstSegment segment;
gst_segment_init (&segment, GST_FORMAT_TIME);
segment.rate = depay->play_speed;
segment.applied_rate = depay->play_scale;
segment.start = position;
if (depay->npt_stop != -1)
segment.stop = dep... | false | false | false | false | false | 0 |
getRealDevStress(const Tensor &stressTensor) const
{
StressTensor::ComplexVector eigenvals = stressTensor.getEigenvalues();
double devStress = 0.0;
if (is3d())
{
std::sort(eigenvals.begin(), eigenvals.end(), RealImagComparer());
devStress = (eigenvals[2].real() - eigenvals[0... | false | false | false | false | false | 0 |
pricedb_book_end (QofBook *book)
{
GNCPriceDB *db;
QofCollection *col;
if (!book)
return;
col = qof_book_get_collection(book, GNC_ID_PRICEDB);
db = qof_collection_get_data(col);
qof_collection_set_data(col, NULL);
gnc_pricedb_destroy(db);
} | false | false | false | false | false | 0 |
screen_end(int need_redraw)
{
Screen *screen = display_screen;
int oldmore = more;
hide_screen(screen);
if (screen->nback_filtered) {
screen->nback_filtered = screen->nback = 0;
screen->nnew_filtered = screen->nnew = 0;
special_var[VAR_more].val.u.ival = 0;
/* XXX optimize if (jump < screenful) (b... | false | false | false | false | false | 0 |
downloads_directory_monitor_real_start (DataProvider* base) {
DownloadsDirectoryMonitor * self;
const gchar* _tmp0_ = NULL;
self = (DownloadsDirectoryMonitor*) base;
_tmp0_ = self->priv->downloads_path;
if (_tmp0_ != NULL) {
DataHub* _tmp1_ = NULL;
DataHub* _tmp2_ = NULL;
gint _tmp3_ = 0;
gchar** _tmp4_ = ... | false | false | false | false | false | 0 |
champlain_label_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ChamplainLabel *label = CHAMPLAIN_LABEL (object);
switch (prop_id)
{
case PROP_TEXT:
champlain_label_set_text (label, g_value_get_string (value));
break;
case PROP_IMAGE:
... | false | false | false | false | false | 0 |
xmlSchematronFreePatterns(xmlSchematronPatternPtr patterns) {
xmlSchematronPatternPtr next;
while (patterns != NULL) {
next = patterns->next;
if (patterns->name != NULL)
xmlFree(patterns->name);
xmlFree(patterns);
patterns = next;
}
} | false | false | false | false | false | 0 |
is_jpg( const char* url, int n )
{
// .jpg
if( *( url + n -4 ) == '.' &&
*( url + n -3 ) == 'j' &&
*( url + n -2 ) == 'p' &&
*( url + n -1 ) == 'g' ) return true;
if( *( url + n -4 ) == '.' &&
*( url + n -3 ) == 'J' &&
*( url + n -2 ) == 'P' &&
*( url + n -1... | false | false | false | false | false | 0 |
INT2tLdd(size_t nrCells, void *Buf)
{
size_t i;
INT2 *inBuf = (INT2 *)Buf;
UINT1 *outBuf = (UINT1 *)Buf;
for(i=0; i < (size_t)nrCells; i++)
if (inBuf[i] != MV_INT2)
{
outBuf[i] = (UINT1)(ABS(inBuf[i]) % 10);
if (outBuf[i] == 0)
outBuf[i] = MV_UINT1;
}
else
outBuf[i] = MV_UINT1;
} | false | false | false | false | false | 0 |
kmo_duplicate_unused_ifus(cpl_array **unused)
{
cpl_array **ret = NULL;
KMO_TRY
{
KMO_TRY_ASSURE(unused != NULL,
CPL_ERROR_NULL_INPUT,
"Not all input data is provided!");
KMO_TRY_EXIT_IF_NULL(
ret = (cpl_array**)cpl_calloc(KMOS_... | false | false | false | false | false | 0 |
isEphemeralValueOf(Instruction *I, const Value *E) {
SmallVector<const Value *, 16> WorkSet(1, I);
SmallPtrSet<const Value *, 32> Visited;
SmallPtrSet<const Value *, 16> EphValues;
// The instruction defining an assumption's condition itself is always
// considered ephemeral to that assumption (even if it ha... | false | false | false | false | false | 0 |
df_bb_du_chain_create (df, bb, ru)
struct df *df;
basic_block bb;
bitmap ru;
{
struct bb_info *bb_info = DF_BB_INFO (df, bb);
rtx insn;
bitmap_copy (ru, bb_info->ru_out);
/* For each def in BB create a linked list (chain) of uses
reached from the def. */
for (insn = bb->end; insn && ins... | false | false | false | false | false | 0 |
SkipMultiLineComment() {
ASSERT(c0_ == '*');
Advance();
while (c0_ >= 0) {
uc32 ch = c0_;
Advance();
if (unicode_cache_->IsLineTerminator(ch)) {
// Following ECMA-262, section 7.4, a comment containing
// a newline will make the comment count as a line-terminator.
has_multiline_comm... | false | false | false | false | false | 0 |
httpGetHeader(HttpConn *conn, cchar *key)
{
if (conn->rx == 0) {
mprAssert(conn->rx);
return 0;
}
return mprLookupKey(conn->rx->headers, slower(key));
} | false | false | false | false | false | 0 |
clear_line_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
gpointer user_data)
{
RevLookupData *data = user_data;
GtkListStore *store = GTK_LIST_STORE(model);
gpointer ab_acc;
g_return_val_if_fail(data && store, FALSE);
gtk_tree_model_get(model, iter, ACCOUNT_LIST_COL_A... | false | false | false | false | false | 0 |
cmd_addhistory()
{
userrec *u;
if(!cmdinfo.istok2)
{
say("Usage: addhistory <nick> <entry...>");
sayf(2,0,"Use this command to add an entry to a user's account history. Useful for making notes to yourself, or other masters.");
return;
}
u = User_user(cmdinfo.tok1);
if(!u->registered)
{
sayf(0,0,"The n... | false | false | false | false | false | 0 |
read_pbm_raw(ByteStream &bs)
{
unsigned char *row = bytes_data + border;
row += (nrows-1) * bytes_per_row;
for (int n = nrows-1; n>=0; n--)
{
unsigned char acc = 0;
unsigned char mask = 0;
for (int c = 0; c<ncolumns; c++)
{
if (!mask)
{
bs.read(&... | false | false | false | false | false | 0 |
client_timeout(gpointer user_data)
{
struct tcp_partial_client_data *client = user_data;
int sock;
sock = g_io_channel_unix_get_fd(client->channel);
DBG("client %d timeout pending %d bytes", sock, client->buf_end);
g_hash_table_remove(partial_tcp_req_table, GINT_TO_POINTER(sock));
return FALSE;
} | false | false | false | false | false | 0 |
initfilterplugin(struct filterplugininfo &filterplugininfo,
class Options &options, bool debugmode)
{
std::string aclfilename = options["acl_filename"];
if (aclfilename.empty()) return false;
localdebugmode = debugmode;
filterplugininfo.pluginname = PLUGIN_NAME;
if (!(parseacl(acl, aclfilename))) return false... | false | false | false | false | false | 0 |
goo_canvas_table_set_common_property (GObject *object,
GooCanvasTableData *table_data,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
gboolean recompute_bounds = TRUE;
switch (prop_id)
{
case PROP_X:
ta... | false | false | false | false | false | 0 |
_mouse_down_cb(void *data,
Evas *evas __UNUSED__,
Evas_Object *obj __UNUSED__,
void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
ELM_PHOTOCAM_DATA_GET(data, sd);
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold =... | false | false | false | false | false | 0 |
rtl_start_rx(struct r8152 *tp)
{
int i, ret = 0;
INIT_LIST_HEAD(&tp->rx_done);
for (i = 0; i < RTL8152_MAX_RX; i++) {
INIT_LIST_HEAD(&tp->rx_info[i].list);
ret = r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL);
if (ret)
break;
}
if (ret && ++i < RTL8152_MAX_RX) {
struct list_head rx_queue;
unsigned... | false | false | false | false | false | 0 |
tick_in( SAMPLE * sample, DWORD__ n )
{
if( !prepare_tick_in() )
return FALSE;
if( !n ) n = Digitalio::m_num_channels_in;
while( n-- )
*sample++ = *m_data_ptr_in++;
return TRUE;
} | false | false | false | false | false | 0 |
constructVertex(tSubProPtr sub) {
// extract the particles in the hard process
ParticleVector hard;
hard.push_back(sub->incoming().first);hard.push_back(sub->incoming().second);
hard.push_back(sub->outgoing()[0]);
if(hard[0]->id()<hard[1]->id()) swap(hard[0],hard[1]);
vector<SpinorWaveFunction> fin;
ve... | false | false | false | false | false | 0 |
setDetailAccessConstraints(QContactDetail *detail, QContactDetail::AccessConstraints constraints)
{
if (detail) {
QContactDetailPrivate::setAccessConstraints(detail, constraints);
}
} | false | false | false | false | false | 0 |
sony_nc_battery_care_limit_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{
unsigned int result, cmd;
unsigned long value;
if (count > 31)
return -EINVAL;
if (kstrtoul(buffer, 10, &value))
return -EINVAL;
/* limit values (2 bits):
* 00 - none
* 01 - 80%... | false | false | false | false | false | 0 |
gimple_type_hash_1 (const void *p, enum gtc_mode mode)
{
const_tree t = (const_tree) p;
VEC(tree, heap) *sccstack = NULL;
struct pointer_map_t *sccstate;
struct obstack sccstate_obstack;
hashval_t val;
void **slot;
struct tree_int_map m;
if (mode == GTC_MERGE
&& type_hash_cache == NULL)
type_... | false | false | false | false | false | 0 |
make_bad_inode_v1(void)
{
struct minix_inode * inode = &Inode[MINIX_BAD_INO];
int i,j,zone;
int ind=0,dind=0;
unsigned short ind_block[MINIX_BLOCK_SIZE>>1];
unsigned short dind_block[MINIX_BLOCK_SIZE>>1];
#define NEXT_BAD (zone = next(zone))
if (!badblocks)
return;
mark_inode(MINIX_BAD_INO);
inode->i_nlinks... | false | false | false | false | false | 0 |
ocfs2_hamming_encode(u32 parity, void *data, unsigned int d, unsigned int nr)
{
unsigned int i, b, p = 0;
BUG_ON(!d);
/*
* b is the hamming code bit number. Hamming code specifies a
* 1-based array, but C uses 0-based. So 'i' is for C, and 'b' is
* for the algorithm.
*
* The i++ in the for loop is so t... | false | false | false | false | false | 0 |
gwy_combo_box_metric_unit_new(GCallback callback,
gpointer cbdata,
gint from,
gint to,
GwySIUnit *unit,
gint active)
{
GtkWidget *combo;
GwyEnum *entries;
gin... | false | false | false | false | false | 0 |
remove_obsolete_buildings(struct player *pplayer)
{
city_list_iterate(pplayer->cities, pcity) {
remove_obsolete_buildings_city(pcity, FALSE);
} city_list_iterate_end;
} | false | false | false | false | false | 0 |
_pack_update_resv_msg(resv_desc_msg_t * msg, Buf buffer,
uint16_t protocol_version)
{
uint32_t array_len;
xassert(msg != NULL);
if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) {
packstr(msg->name, buffer);
pack_time(msg->start_time, buffer);
pack_time(msg->end_time, buffer);
pack32(msg... | false | false | false | false | false | 0 |
queuepath(hfsvol *vol, char *path, darray *dirs, darray *files, int flags)
{
queueent ent;
darray *array;
if (hfs_stat(vol, path, &ent.dirent) == -1)
{
hfsutil_perrorp(path);
return (errno == ENOENT) ? 0 : -1;
}
ent.path = path;
ent.free = 0;
array = ((ent.dirent.flags & HFS_ISDIR) &&... | false | false | false | false | false | 0 |
F_switch_on_structure(ArgVal arg[])
{
SwtTbl *t;
SwtElt *elem;
DEF_STR(str);
DEF_INTEGER(arity);
DEF_INTEGER(label);
Args1(INTEGER(nb_elem));
t = Create_Switch_Table(TBL_STC, nb_elem);
for (elem = t->elem; nb_elem--; elem++)
{
LOAD_STR(str);
LOAD_INTEGER(arity);
LOAD_INTEGER(la... | false | false | false | false | false | 0 |
Insert( const wxPlotData &source, int index ) const
{
wxCHECK_MSG( Ok() && source.Ok(), wxPlotData(), wxT("Invalid wxPlotData") );
wxPCHECK_MINMAX_MSG(index, 0, M_PLOTDATA->m_count, wxPlotData(), wxT("invalid index"));
int count = M_PLOTDATA->m_count;
int src_count = source.GetCount();
wxPlotD... | false | false | false | false | false | 0 |
bq2415x_get_vender_code(struct bq2415x_device *bq)
{
int ret;
ret = bq2415x_exec_command(bq, BQ2415X_VENDER_CODE);
if (ret < 0)
return 0;
/* convert to binary */
return (ret & 0x1) +
((ret >> 1) & 0x1) * 10 +
((ret >> 2) & 0x1) * 100;
} | false | false | false | false | false | 0 |
strcasecmp_internal(char * input1, char * input2)
{
if ( (input1==0) || (input2==0) )
{
fprintf(stderr,"Error , calling strcasecmp_internal with null parameters \n");
return 1;
}
unsigned int len1 = strlen(input1);
unsigned int len2 = strlen(input2);
if (len1!=len2)
{
... | false | false | false | false | false | 0 |
fsl_spi_grlib_probe(struct device *dev)
{
struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct spi_master *master = dev_get_drvdata(dev);
struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master);
struct fsl_spi_reg *reg_base = mpc8xxx_spi->reg_base;
int mbits;
u32 capabilities;
capabiliti... | false | false | false | false | false | 0 |
scan_and_match(char *string, const char *pattern, unsigned flags)
{
char *loc;
char *end;
unsigned len = strlen(string);
int early_exit;
/* We can stop the scan early only if the string part
* we are matching against is shrinking, and the pattern has
* an unquoted "star" at the corresponding end. There are tw... | false | false | false | false | false | 0 |
mono_bitset_find_start (const MonoBitSet *set)
{
int i;
for (i = 0; i < set->size / BITS_PER_CHUNK; ++i) {
if (set->data [i])
return my_g_bit_nth_lsf_nomask (set->data [i]) + i * BITS_PER_CHUNK;
}
return -1;
} | false | false | false | false | false | 0 |
decide_unroll_constant_iterations (struct loop *loop, int flags)
{
unsigned nunroll, nunroll_by_av, best_copies, best_unroll = 0, n_copies, i;
struct niter_desc *desc;
double_int iterations;
if (!(flags & UAP_UNROLL))
{
/* We were not asked to, just return back silently. */
return;
}
if... | false | false | false | false | false | 0 |
get_suitable_record_to_view_details(const Gnome::Gda::Value& primary_key_value, Glib::ustring& table_name, Gnome::Gda::Value& table_primary_key_value) const
{
//Initialize output parameters:
table_name = Glib::ustring();
table_primary_key_value = Gnome::Gda::Value();
if(!m_portal)
return;
const Document... | false | false | false | false | false | 0 |
_gtk_marshal_VOID__BOXED_BOXEDv (GClosure *closure,
GValue *return_value,
gpointer instance,
va_list args,
gpointer marshal_data,
... | false | false | false | false | false | 0 |
clearDiagnosticText()
{
QMutexLocker locker(&logMutex);
dtext = QString();
} | false | false | false | false | false | 0 |
LI32__MATCH_DIMENSIONS__predlib(V293,V294)
object V293;register object V294;
{ VMB32 VMS32 VMV32
goto TTL;
TTL:;
if(((V293))!=Cnil){
goto T1348;}
{object V295 = (((V294))==Cnil?Ct:Cnil);
VMR32(V295)}
goto T1348;
T1348:;
if(!((car((V294)))==(((object)VV[19])))){
goto T1352;}
goto T1350;
goto T1352;
T1352:;
... | false | false | false | false | false | 0 |
rgbFromWaveLength(const double wave)
{
double r = 0.0;
double g = 0.0;
double b = 0.0;
if (wave >= 380.0 && wave <= 440.0) {
r = -1.0 * (wave - 440.0) / (440.0 - 380.0);
b = 1.0;
} else if (wave >= 440.0 && wave <= 490.0) {
g = (wave - 440.0) / (490.0 - 440.0);
b = 1.0;
} else... | false | false | false | false | false | 0 |
sys_msgrcv(struct tcb *tcp)
{
if (entering(tcp)) {
tprintf("%d, ", (int) tcp->u_arg[0]);
} else {
if (indirect_ipccall(tcp)) {
struct ipc_wrapper {
struct msgbuf *msgp;
long msgtyp;
} tmp;
if (umove(tcp, tcp->u_arg[3], &tmp) < 0) {
tprintf("%#lx, %lu, ",
tcp->u_arg[3], tcp->u_arg[1]);
... | false | false | false | false | false | 0 |
PQconnectStartParams(const char *const * keywords,
const char *const * values,
int expand_dbname)
{
PGconn *conn;
PQconninfoOption *connOptions;
/*
* Allocate memory for the conn structure
*/
conn = makeEmptyPGconn();
if (conn == NULL)
return NULL;
/*
* Parse the conninfo arrays
*/
con... | false | false | false | false | false | 0 |
gnc_tree_model_account_iter_n_children (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
GncTreeModelAccount *model;
gint num;
g_return_val_if_fail (GNC_IS_TREE_MODEL_ACCOUNT (tree_model), FALSE);
ENTER("model %p, iter %s", tree_model, iter_to_string(iter));
m... | false | false | false | false | false | 0 |
Trspi_Encrypt_ECB(UINT16 alg, BYTE *key, BYTE *in, UINT32 in_len, BYTE *out,
UINT32 *out_len)
{
TSS_RESULT result = TSS_SUCCESS;
EVP_CIPHER_CTX ctx;
UINT32 tmp;
switch (alg) {
case TSS_ALG_AES:
break;
default:
result = TSPERR(TSS_E_INTERNAL_ERROR);
goto done;
break;
}
EVP_CIPHER_CTX_init(&ct... | false | false | false | false | false | 0 |
nClusterings() {
if (!mother) return 0;
int w = mother->nClusterings();
w += 1;
return w;
} | false | false | false | false | false | 0 |
startElement_HOSTS(void *data, const char *el, const char **attr)
{
xmldata_t *xmldata = (xmldata_t *)data;
int i;
struct xml_tag *xt;
/* In non-scalable mode, we do not process summary data. */
if (!gmetad_config.scalable_mode) return 0;
/* Add up/down hosts to this grid summary */
for(i = 0; at... | false | false | false | false | false | 0 |
abi_widget_save ( AbiWidget * w, const char * fname, const char * extension_or_mimetype, const char * exp_props)
{
UT_return_val_if_fail ( w != NULL, FALSE );
UT_return_val_if_fail ( IS_ABI_WIDGET(w), FALSE );
UT_return_val_if_fail ( w->priv->m_pDoc, FALSE );
UT_return_val_if_fail ( fname != NULL, FALSE );
IEFile... | false | false | false | false | false | 0 |
free_element(EL *el, MESH *mesh)
{
free_dof_ptrs(el->dof, mesh);
if(mesh->dim > 1 && el->new_coord) {
free_real_d(mesh, el->new_coord);
el->new_coord = nil;
}
if (el->child[1]) AI_free_leaf_data((void *) el->child[1], mesh);
freeMemory(el, ((MESH_MEM_INFO*)(mesh->mem_info))->element);
... | false | false | false | false | false | 0 |
uncompress_recover(unsigned char *dest, ulong destlen,
unsigned char *source, ulong sourcelen)
{
int byte, bit;
ulong retlen = destlen;
int good_decomp = 0, good_rv = -1;
/* Generate all single bit errors */
if (sourcelen > 16384) {
lkcd_print("uncompress_rec... | false | false | false | false | false | 0 |
DivExactD1(unsigned long * c, long n)
{
unsigned long t = 0;
long i;
for (i = 0; i < n; i++) {
t ^= (c[i] >> 1) | ((i + 1 < n)
? (c[i + 1] << (GF2X_WORDSIZE - 1)) : 0);
t ^= t << 3 ^ t << 6;
t ^= t << 9 ^ t << 18;
t ^= t << 27
#if (GF2X_WORDSIZE == 64)
^ t << 54
#elif (GF2X_WORDSIZE != 32)
... | false | false | false | false | false | 0 |
UpdateCRC(unsigned long crc,
const unsigned char *buf, size_t len) {
unsigned long c = crc ^ 0xffffffffL;
unsigned n;
if (!crc_table_computed)
MakeCRCTable();
for (n = 0; n < len; n++) {
c = crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8);
}
return c ^ 0xffffffffL;
} | false | false | false | false | false | 0 |
slotTextChanged(const QString &/*string*/)
{
element()->m_value = KUrl( widget()->url() ).pathOrUrl();
} | false | false | false | false | false | 0 |
unpack16(uint16_t * valp, Buf buffer)
{
uint16_t ns;
if (remaining_buf(buffer) < sizeof(ns))
return SLURM_ERROR;
memcpy(&ns, &buffer->head[buffer->processed], sizeof(ns));
*valp = ntohs(ns);
buffer->processed += sizeof(ns);
return SLURM_SUCCESS;
} | false | false | false | false | false | 0 |
miner_finalize (GObject *object)
{
TrackerMiner *miner = TRACKER_MINER (object);
if (miner->priv->update_id != 0) {
g_source_remove (miner->priv->update_id);
}
if (miner->priv->watch_name_id != 0) {
g_bus_unwatch_name (miner->priv->watch_name_id);
}
if (miner->priv->registration_id != 0) {
g_dbus_connect... | false | false | false | false | false | 0 |
show(AW_device *device) {
if (gen_root) {
#if defined(DEBUG) && 0
fprintf(stderr, "GEN_graphic::show\n");
#endif // DEBUG
gen_root->paint(device);
}
else {
device->line(GEN_GC_DEFAULT, -100,-100,100,100);
device->line(GEN_GC_DEFAULT, -100,100,100,-100);
}
} | false | false | false | false | false | 0 |
ecm_alloc_inst(void)
{
struct f_ecm_opts *opts;
opts = kzalloc(sizeof(*opts), GFP_KERNEL);
if (!opts)
return ERR_PTR(-ENOMEM);
mutex_init(&opts->lock);
opts->func_inst.free_func_inst = ecm_free_inst;
opts->net = gether_setup_default();
if (IS_ERR(opts->net)) {
struct net_device *net = opts->net;
kfree(opt... | false | false | false | false | false | 0 |
allocation_grow(struct allocation **alloc, unsigned int *size) {
void *ptr = realloc(*alloc, (*size * 2 + 1) * sizeof(**alloc));
if (ptr) {
*alloc = ptr;
*size = *size * 2 + 1;
return 1;
} else {
return 0;
}
} | false | false | false | false | false | 0 |
cb_alert_config_button(GtkWidget *button, NetMon *net)
{
gboolean read, write;
read = GTK_TOGGLE_BUTTON(net->alert_config_rx_button)->active;
write = GTK_TOGGLE_BUTTON(net->alert_config_tx_button)->active;
if (!read && !write)
{
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(net->alert_config_rx_button),... | false | true | false | false | true | 1 |
iconSizes() const {
if( p->icon_sizes == NULL ) {
p->icon_sizes = new int[ p->icon_count * 2 + 2 ];
for( int i = 0;
i < p->icon_count;
++i ) {
p->icon_sizes[ i * 2 ] = p->icons[ i ].size.width;
p->icon_sizes[ i * 2 + 1 ] = p->icons[ i ].size.height;
... | false | false | false | false | false | 0 |
FindObject_with_Path(HIDDesc_t *pDesc, HIDPath_t *Path, uint8_t Type)
{
int i;
for (i = 0; i < pDesc->nitems; i++) {
HIDData_t *pData = &pDesc->item[i];
if (pData->Type != Type) {
continue;
}
if (memcmp(pData->Path.Node, Path->Node, (Path->Size) * sizeof(HIDNode_t))) {
continue;
}
return p... | false | false | false | false | false | 0 |
L12()
{register object *base=vs_base;
register object *sup=base+VM12; VC12
vs_check;
{object V77;
object V78;
object V79;
object V80;
object V81;
V77=(base[0]);
V78=(base[1]);
V79=(base[2]);
V80=(base[3]);
V81=(base[4]);
vs_top=sup;
goto TTL;
TTL:;
{object V82;
V82= ((V81))->v.v_self[(long)33];
base[5]... | false | false | false | false | false | 0 |
AcpiTbResizeRootTableList (
void)
{
ACPI_TABLE_DESC *Tables;
UINT32 TableCount;
ACPI_FUNCTION_TRACE (TbResizeRootTableList);
/* AllowResize flag is a parameter to AcpiInitializeTables */
if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE))
{
ACPI... | false | false | false | false | false | 0 |
readFromDAQ(
std::vector<mrpt::obs::CObservationRawDAQPtr> &outObservations,
bool &hardwareError )
{
hardwareError = false;
outObservations.clear();
if ( !checkDAQIsWorking() )
{
hardwareError = true;
return;
}
// Read from the pipe:
m_state = ssWorking;
for (list<TInfoPerTask>::iterator it=m_runni... | false | false | false | false | false | 0 |
FileSSLAccept(CONSFILE *cfp)
#else
FileSSLAccept(cfp)
CONSFILE *cfp;
#endif
{
int retval;
if (cfp->waitForWrite == FLAGTRUE) {
cfp->waitForWrite = FLAGFALSE;
if (cfp->wbuf->used <= 1)
FD_CLR(cfp->fd, &winit);
}
cfp->waitForRead = FLAGFALSE;
CONDDEBUG((1, "FileSSLAccept(): about to SSL_ac... | false | false | false | false | false | 0 |
seckeys_free(struct seckeys *sk)
{
int i;
g_assert(sk);
for (i = 0; i < sk->scnt; i++) {
kuid_t *id = sk->skeys[i];
kuid_atom_free(id);
}
knode_free(sk->kn);
WFREE_ARRAY(sk->skeys, sk->scnt);
WFREE(sk);
} | false | false | false | false | false | 0 |
finish_create_config_async_sucess (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GMainLoop *loop = (GMainLoop *)user_data;
GError *error = NULL;
IBusConfig *config =
ibus_config_new_async_finish (res... | false | false | false | false | false | 0 |
congen_s_fetch(register congen_susp_type susp, snd_list_type snd_list)
{
int cnt = 0; /* how many samples computed */
int togo;
int n;
sample_block_type out;
register sample_block_values_type out_ptr;
register sample_block_values_type out_ptr_reg;
register double value_reg;
register do... | 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.