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 |
|---|---|---|---|---|---|---|
HandleByValArgument(Value *Arg, Instruction *TheCall,
const Function *CalledFunc,
InlineFunctionInfo &IFI,
unsigned ByValAlignment) {
Type *AggTy = cast<PointerType>(Arg->getType())->getElementType();
// If the ca... | false | false | false | false | false | 0 |
do_one_ref(const char *base, each_ref_fn fn, int trim,
int flags, void *cb_data, struct ref_list *entry)
{
if (strncmp(base, entry->name, trim))
return 0;
if (!(flags & DO_FOR_EACH_INCLUDE_BROKEN)) {
if (entry->flag & REF_BROKEN)
return 0; /* ignore dangling symref */
if (!has_sha1_file(entry->sha1)... | false | false | false | false | false | 0 |
read_nodes(struct lscpu_desc *desc)
{
int i;
/* number of NUMA node */
while (path_exist(_PATH_SYS_SYSTEM "/node/node%d", desc->nnodes))
desc->nnodes++;
if (!desc->nnodes)
return;
desc->nodemaps = xcalloc(desc->nnodes, sizeof(cpu_set_t *));
/* information about how nodes share different CPUs */
for (i = ... | false | false | false | false | false | 0 |
b1pcmcia_procinfo(struct capi_ctr *ctrl)
{
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
if (!cinfo)
return "";
sprintf(cinfo->infobuf, "%s %s 0x%x %d r%d",
cinfo->cardname[0] ? cinfo->cardname : "-",
cinfo->version[VER_DRIVER] ? cinfo->version[VER_DRIVER] : "-",
cinfo->card ? cinfo->card->port ... | false | false | false | false | false | 0 |
pat_match_meth(struct sample *smp, struct pattern_expr *expr, int fill)
{
int icase;
struct pattern_list *lst;
struct pattern *pattern;
list_for_each_entry(lst, &expr->patterns, list) {
pattern = &lst->pat;
/* well-known method */
if (pattern->val.i != HTTP_METH_OTHER) {
if (smp->data.meth.meth == patter... | false | false | false | false | false | 0 |
Game_run() {
// clock & time record variables
f32 start_t = 0.f, frame_t = 0.f;
// gameplay/IA update variables
const f32 phy_dt = 0.01f;
f32 phy_update = 0.f, one_sec = 0.f;
// MAIN LOOP
while( true ) {
// sample frame start time
start_t = Clock_getElapsedTime( &game->clo... | false | false | false | false | false | 0 |
nrbt_walk_action(void* nodekey, const GtRBTreeContext which,
const unsigned long depth, GT_UNUSED void *actinfo)
{
unsigned long key = *(unsigned long *) nodekey;
if (depth > gt_rbtree_max_depth) {
gt_rbtree_max_depth = depth;
}
if (which == GT_RBTREE_LEAF || which == GT_RBTREE_... | false | false | false | false | false | 0 |
print_value(union jackctl_parameter_value value, jackctl_param_type_t type)
{
switch (type) {
case JackParamInt:
printf("parameter value = %d\n", value.i);
break;
case JackParamUInt:
printf("parameter value = %u\n", value.ui);
break;
case ... | false | false | false | false | false | 0 |
getScreenNumber(unsigned char *currentScreenNumber)
{
ArRobotPacket sendPacket(HEADER1, HEADER2);
sendPacket.setID (GET_CURRENT_SCREEN_NUM);
for (int i = 0; i < 5; i++) {
if (!mySender->sendPacket(&sendPacket)) {
ArLog::log (ArLog::Terse,
"%s::getScreenNumber() Could not send get screen number to L... | false | false | false | false | false | 0 |
__wa_seg_submit(struct wa_rpipe *rpipe, struct wa_xfer *xfer,
struct wa_seg *seg, int *dto_done)
{
int result;
/* default to done unless we encounter a multi-frame isoc segment. */
*dto_done = 1;
/*
* Take a ref for each segment urb so the xfer cannot disappear until
* all of the callbacks run.
*/
wa... | false | false | false | false | false | 0 |
Scm_MonotonicMerge1(ScmObj sequences)
{
ScmObj result = SCM_NIL, next, h;
ScmObj *seqv, *sp, *tp;
int nseqs = Scm_Length(sequences);
if (nseqs < 0) Scm_Error("bad list of sequences: %S", sequences);
seqv = SCM_NEW_ARRAY(ScmObj, nseqs);
for (sp=seqv; SCM_PAIRP(sequences); sp++, sequences=SCM_CDR... | false | false | false | false | false | 0 |
clock_values(char* ck, chain_list* abl)
{
int ret=0;
if (ABL_ATOM(abl)) {
if (ABL_ATOM_VALUE(abl)==ck) return 1;
else return 0;
}
if (ABL_OPER(abl)==ABL_STABLE) return 0;
for (abl=ABL_CDR(abl); abl; abl=ABL_CDR(abl)) {
ret+=clock_values(ck,ABL_CAR(abl));
}
return ret;
} | false | false | false | false | false | 0 |
ajMathGmean(const float *s, ajint n)
{
float x;
ajint i;
for(i=0,x=1.0;i<n;++i) x*=s[i];
return (float)pow((double)x,(double)(1.0/(float)n));
} | false | false | false | false | false | 0 |
zoneStringFormat_cleanup(void)
{
umtx_destroy(&gZSFCacheLock);
if (gZoneStringFormatCache != NULL) {
delete gZoneStringFormatCache;
gZoneStringFormatCache = NULL;
}
gZoneStringFormatCache = NULL;
return TRUE;
} | false | false | false | false | false | 0 |
paint(QPainter * painter, const QRect & rect, QIcon::Mode mode, QIcon::State state)
{
if (!mIconLoader) {
return;
}
Q_UNUSED(state)
const int kstate = qIconModeToKIconState(mode);
KIconLoader::Group group = KIconLoader::Desktop;
if (QWidget* targetWidget = dynamic_cast<QWidget*>(paint... | false | false | false | false | false | 0 |
FBPolygon(Pixel,Type,StyleId,xy,n)
int Pixel,Type,StyleId,n;
int *xy;
{
/*
* Type == FILL means fill
* Type == OUTLINE means outline
* StyleId defines stipple pattern (0 = SOLID)
*/
int j,n2,X,Y,Z,T,Xo,Yo;
Poly poly;
FBForeground(DISPLAY,Pixel);
(*GR[FB.fInterface].gSetFp)(Style... | false | false | false | false | false | 0 |
ar9003_mci_send_coex_version_query(struct ath_hw *ah,
bool wait_done)
{
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
u32 payload[4] = {0, 0, 0, 0};
if (mci->bt_version_known ||
(mci->bt_state == MCI_BT_SLEEP))
return;
MCI_GPM_SET_TYPE_OPCODE(payload, MCI_GPM_COEX_AGENT,
MCI_GPM_COEX_VERSI... | false | false | false | false | false | 0 |
pick_offscreen_child (GdkWindow *offscreen_window,
double widget_x,
double widget_y,
GladeDesignLayout *bin)
{
GladeDesignLayoutPrivate *priv = bin->priv;
GtkWidget *child = gtk_bin_get_child (GTK_BIN (bin));
if (child && gtk_w... | false | false | false | false | false | 0 |
impl_set_CurrentValue (DBusMessageIter * iter, void *user_data)
{
AtkValue *value = (AtkValue *) user_data;
GValue src = { 0 };
GValue dest = { 0 };
gdouble dub;
DBusMessageIter iter_variant;
g_return_val_if_fail (ATK_IS_VALUE (user_data), FALSE);
dbus_message_iter_recurse (iter, &iter_variant);
if (d... | false | false | false | false | false | 0 |
interactions(const QString &engineUid) const
{
QVector<IDrugInteraction *> toReturn;
for(int i = 0; i < m_Interactions.count(); ++i) {
IDrugInteraction *di = m_Interactions.at(i);
if (di->engine()->uid() == engineUid || engineUid.isEmpty()) {
toReturn << di;
}
}
retur... | false | false | false | false | false | 0 |
setObjectiveCoefficient( int elementIndex, double elementValue )
{
#ifndef NDEBUG
if (elementIndex < 0 || elementIndex >= numberColumns_) {
indexError(elementIndex, "setObjectiveCoefficient");
}
#endif
objective()[elementIndex] = elementValue;
whatsChanged_ = 0; // Can't be sure (use ClpSi... | false | false | false | false | false | 0 |
AddNewItem(wxSortedArrayString& sortedArrayString, const wxString& newItem)
{
// Adds item to array only if it does not exist
bool added = false;
if ( sortedArrayString.Index(newItem.c_str()) == wxNOT_FOUND )
{
sortedArrayString.Add(newItem);
added = true;
}
return added;
} | false | false | false | false | false | 0 |
MinMax( std::vector<double> const &x, int nrows, int i1,
int i2, int j1, int j2, double &min, double &max )
{
min = x[j1+i1*nrows];
max = min;
for( int i=i1; i<i2; ++i )
{
for( int j=j1; j<j2; ++j )
{
double val = x[j+i*nrows];
if( min > val )min = val;
if( max < val )max ... | false | false | false | false | false | 0 |
tbbtdump(TBBT_TREE * tree, intn method)
{
if (tree != NULL && *(TBBT_NODE **) tree != NULL)
{
printf("Number of nodes in the tree: %ld\n", tree->count);
tbbt1dump(tree->root, method);
} /* end if */
else
printf("Tree is empty\n");
} | false | false | false | false | false | 0 |
Comsolrow(char *line1,FILE *io)
{
int i,isend;
char line0[MAXLINESIZE],*charend;
for(i=0;i<MAXLINESIZE;i++)
line0[i] = ' ';
newline:
charend = fgets(line0,MAXLINESIZE,io);
isend = (charend == NULL);
if(isend) return(1);
for(i=0;i<MAXLINESIZE;i++) line1[i] = line0[i];
return(0);
} | true | true | false | false | false | 1 |
resamp_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
{
SpeexResamplerState *resamp_pvt = pvt->pvt;
unsigned int out_samples = (OUTBUF_SIZE / sizeof(int16_t)) - pvt->samples;
unsigned int in_samples;
if (!f->datalen) {
return -1;
}
in_samples = f->datalen / 2;
speex_resampler_process_int(resamp_pvt,... | false | false | false | false | false | 0 |
row_collapsed_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *path, gpointer callback_data)
{
NemoListView *view;
NemoFile *file;
NemoDirectory *directory;
GtkTreeIter parent;
struct UnloadDelayData *unload_data;
GtkTreeModel *model;
char *uri;
view = NEMO_LIST_VIEW (callback_data);
model ... | false | false | false | false | false | 0 |
snd_es1968_playback_close(struct snd_pcm_substream *substream)
{
struct es1968 *chip = snd_pcm_substream_chip(substream);
struct esschan *es;
if (substream->runtime->private_data == NULL)
return 0;
es = substream->runtime->private_data;
spin_lock_irq(&chip->substream_lock);
list_del(&es->list);
spin_unlock_ir... | false | false | false | false | false | 0 |
resize(u_int length) {
length *= elementsize;
maxi = length;
if (length>num) {
getmem();
createElements(data + num, length - num);
} else if (num>length) {
destroyElements(data + length, num - length);
getmem();
}
num = length;
} | false | false | false | false | false | 0 |
gzfile_make_header(struct gzfile *gz)
{
Bytef buf[10]; /* the size of gzip header */
unsigned char flags = 0, extraflags = 0;
if (!NIL_P(gz->orig_name)) {
flags |= GZ_FLAG_ORIG_NAME;
}
if (!NIL_P(gz->comment)) {
flags |= GZ_FLAG_COMMENT;
}
if (gz->mtime == 0) {
gz->mtime = time(0);
... | false | false | false | false | false | 0 |
xlib_rgb_ensure_stage (void)
{
if (image_info->stage_buf == NULL)
image_info->stage_buf = malloc (IMAGE_HEIGHT * STAGE_ROWSTRIDE);
return image_info->stage_buf;
} | false | false | false | false | false | 0 |
dh_generate_f(ssh_session session) {
#ifdef HAVE_LIBCRYPTO
bignum_CTX ctx = bignum_ctx_new();
if (ctx == NULL) {
return -1;
}
#endif
session->next_crypto->f = bignum_new();
if (session->next_crypto->f == NULL) {
#ifdef HAVE_LIBCRYPTO
bignum_ctx_free(ctx);
#endif
return -1;
}
#ifdef HAVE_LIBGCR... | false | false | false | false | false | 0 |
str_unit(struct num n)
{
const char *unit;
char buf[20]; /* @@@ plenty */
if (n.exponent == 0)
return "";
switch (n.type) {
case nt_mm:
unit = "mm";
break;
case nt_mil:
unit = "mil";
break;
default:
abort();
}
if (n.exponent == 1)
return unit;
sprintf(buf, "%s^%d", unit, n.exponent);
return un... | false | false | false | false | false | 0 |
internalSlot()
{
// Check whether the QTimer::timeout() signal is on-time.
int timeOnClock = t.elapsed();
// If the signal is too early, ignore it. If it is on-time +/-halfTick,
// trigger an internal signal. If it is late, trigger more internal
// signals, in order to "catch up".
while ... | false | false | false | false | false | 0 |
rosh_search_nonsp(const char *istr, const int ipos)
{
int curpos;
char c;
curpos = ipos;
c = istr[curpos];
while (c && isspace(c))
c = istr[++curpos];
return curpos;
} | false | false | false | false | false | 0 |
detect_main_class_button()
{
enum { BUTTON_X = 14, BUTTON_Y = 14, BUTTON_WIDTH = 146, BUTTON_HEIGHT = 28 };
enum { BUTTON_Y_SPACING = 30 };
for( int c=1 ; c<=ENCYC_CLASS_COUNT ; c++ )
{
//if( mouse.press_area( BUTTON_X, BUTTON_Y + (c-1)*BUTTON_Y_SPACING, BUTTON_X + BUTTON_WIDTH-1,
// BUTTON_Y + c*BUTTON_Y_SPAC... | false | false | false | false | false | 0 |
data_seq_free(sdp_data_t *seq)
{
sdp_data_t *d = seq->val.dataseq;
while (d) {
sdp_data_t *next = d->next;
sdp_data_free(d);
d = next;
}
} | false | false | false | false | false | 0 |
propstate_clear_value(struct propstate *ps)
{
if (!ps) {
return;
}
propval_free(ps->property_value);
ps->property_value = NULL;
} | false | false | false | false | false | 0 |
settout()
{
int speed_chars;
static const struct {
unsigned int bsize;
unsigned int brate;
} speeds[] = {
#ifdef B0
{ 1, B0 },
#endif
#ifdef B50
{ 1, B50 },
#endif
#ifdef B75
{ 1, B75 },
#endif
#ifdef B110
{ 1, B110 },
#endif
#ifdef B134
{ 1, B134 },
#endif
#ifdef B150
{ 1, B150 },
#endif
#ifdef B2... | false | false | false | false | false | 0 |
my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
{
const char *str0= str;
switch (sq)
{
case MY_SEQ_INTTAIL:
if (*str == '.')
{
for(str++ ; str != end && *str == '0' ; str++);
return (size_t) (str - str0);
}
return 0;
case MY_SEQ_SPACES:
for ( ; str < e... | false | false | false | false | false | 0 |
_lldpctl_atom_get_str_mgmt(lldpctl_atom_t *atom, lldpctl_key_t key)
{
char *ipaddress = NULL;
size_t len; int af;
struct _lldpctl_atom_mgmt_t *m =
(struct _lldpctl_atom_mgmt_t *)atom;
/* Local and remote port */
switch (key) {
case lldpctl_k_mgmt_ip:
switch (m->mgmt->m_family) {
case LLDPD_AF_IPV4:
l... | false | false | false | false | false | 0 |
WriteDSPM( int nScale )
{
if( nScale == 0 )
nScale = 52000;
/* -------------------------------------------------------------------- */
/* Add the DSID field. */
/* -------------------------------------------------------------------- */
DDFRecord *poRec ... | false | false | false | false | false | 0 |
busNameAcquired(GDBusConnection *connection,
const gchar *name,
gpointer userData) throw ()
{
boost::shared_ptr<OwnNameAsyncData> *data = static_cast< boost::shared_ptr<OwnNameAsyncData> *>(userData);
(*data)->m_state = OWN_NAME_OBTAINE... | false | false | false | false | false | 0 |
gst_check_setup_events_with_stream_id (GstPad * srcpad, GstElement * element,
GstCaps * caps, GstFormat format, const gchar * stream_id)
{
GstSegment segment;
gst_segment_init (&segment, format);
fail_unless (gst_pad_push_event (srcpad,
gst_event_new_stream_start (stream_id)));
if (caps)
fai... | false | false | false | false | false | 0 |
getGlobalELFBinding(const GlobalValue *GV) {
if (GV->hasInternalLinkage())
return ELF::STB_LOCAL;
if (GV->isWeakForLinker() && !GV->hasCommonLinkage())
return ELF::STB_WEAK;
return ELF::STB_GLOBAL;
} | false | false | false | false | false | 0 |
ReLoad()
{
CLAM::ProcessingFactory& factory = CLAM::ProcessingFactory::GetInstance();
std::list<std::string> usedLibraries=GetUsedLibraries();
std::list<std::string>::const_iterator itLibraries;
// iterate on used libraries
for (itLibraries=usedLibraries.begin();itLibraries!=usedLibraries.end();itLibraries++)
{
... | false | false | false | false | false | 0 |
aiGetMaterialFloatArray(const aiMaterial* pMat,
const char* pKey,
unsigned int type,
unsigned int index,
float* pOut,
unsigned int* pMax)
{
ai_assert (pOut != NULL);
ai_assert (pMat != NULL);
const aiMaterialProperty* prop;
aiGetMaterialProperty(pMat,pKey,type,index, (const aiMaterialProperty**) &prop);
... | false | false | false | false | false | 0 |
destroy_info_view() {
if (!info_view)
return;
unregister_info_update_track_view(on_info_view_update_track_view);
unregister_info_update_playlist_view(on_info_view_update_playlist_view);
unregister_info_update_totals_view(on_info_view_update_totals_view);
if (info_view->window && GTK_IS_WID... | false | false | false | false | false | 0 |
_isHoliday(const MSDate& date_, MSHolidaySet& set_, const MSResourceCodeSet& rCodeSet_)
{
if (rCodeSet_.isEmpty()==MSTrue || date_.isSet()==MSFalse)
{
return MSFalse;
}
unsigned len=rCodeSet_.numberOfElements();
for(unsigned int i=0; i<len; ++i)
{
if (_isHoliday(date_,set_,rCodeSet_.elem... | false | false | false | false | false | 0 |
print_unsafe_warning_to_log(int unsafe_type, char* buf,
char* query)
{
DBUG_ENTER("print_unsafe_warning_in_log");
sprintf(buf, ER(ER_BINLOG_UNSAFE_STATEMENT),
ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type]));
sql_print_warning(ER(ER_MESSAGE_AND_STATEMENT), buf, query);
... | false | false | false | false | false | 0 |
kf_select_all(int, Fl_Text_Editor* e) {
e->buffer()->select(0, e->buffer()->length());
const char *copy = e->buffer()->selection_text();
if (*copy) Fl::copy(copy, (int) strlen(copy), 0);
free((void*)copy);
return 1;
} | false | false | false | false | false | 0 |
createInstance(const Locale& locale, UErrorCode& status) {
if (U_FAILURE(status)) {
return NULL;
}
TimeZoneGenericNames* instance = new TimeZoneGenericNames();
if (instance == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
TZGNCoreRef *cacheEntry = NULL;
... | false | false | false | false | false | 0 |
dump_chip_info(struct HAL_VERSION chip_vers)
{
uint cnt = 0;
char buf[128];
cnt += sprintf((buf+cnt), "Chip Version Info: CHIP_8188E_");
cnt += sprintf((buf+cnt), "%s_", IS_NORMAL_CHIP(chip_vers) ?
"Normal_Chip" : "Test_Chip");
cnt += sprintf((buf+cnt), "%s_", IS_CHIP_VENDOR_TSMC(chip_vers) ?
"T... | true | true | false | false | false | 1 |
ipvlan_rcv_frame(struct ipvl_addr *addr, struct sk_buff **pskb,
bool local)
{
struct ipvl_dev *ipvlan = addr->master;
struct net_device *dev = ipvlan->dev;
unsigned int len;
rx_handler_result_t ret = RX_HANDLER_CONSUMED;
bool success = false;
struct sk_buff *skb = *pskb;
len = skb->len + ETH_HLEN;
if (u... | false | false | false | false | false | 0 |
encodeBit (OOCTXT* pctxt, ASN1BOOL value)
{
int stat = ASN_OK;
/* If start of new byte, init to zero */
if (pctxt->buffer.bitOffset == 8) {
pctxt->buffer.data[pctxt->buffer.byteIndex] = 0;
}
/* Adjust bit offset and determine if at end of current byte */
if (--pctxt->buffer.bitOffset < 0) {... | false | false | false | false | false | 0 |
compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc,
struct hash_table_d *table)
{
unsigned int i;
/* Initialize any bitmaps that were passed in. */
if (transp)
{
if (table->set_p)
sbitmap_vector_zero (transp, last_basic_block);
else
sbitmap_vector_ones (transp, last... | false | false | false | false | false | 0 |
StringToWord(const char *string)
{//=================================================
// Pack 4 characters into a word
int ix;
unsigned char c;
unsigned int word;
word = 0;
for(ix=0; ix<4; ix++)
{
if(string[ix]==0) break;
c = string[ix];
word |= (c << (ix*8));
}
return(word);
} | false | false | false | false | false | 0 |
printXmpDate(std::ostream& os, const Value& value, const ExifData*)
{
if (!(value.size() == 19 || value.size() == 20) || value.typeId() != xmpText) {
return os << value;
}
std::string stringValue = value.toString();
if (stringValue[19] == 'Z') {
stringValue =... | false | false | false | false | false | 0 |
setup_unity_settings (CcDisplayPanel *self)
{
const gchar * const *schemas;
/* Only use the unity-2d schema if it's installed */
schemas = g_settings_list_schemas ();
while (*schemas != NULL)
{
if (g_strcmp0 (*schemas, UNITY2D_GSETTINGS_LAUNCHER) == 0)
{
self->priv->unity2d_settings... | false | false | false | false | false | 0 |
get_date(mailmessage * msg)
{
struct tm tmval;
time_t timeval;
struct mailimf_date_time * date_time;
if (msg->msg_single_fields.fld_orig_date == NULL)
return (time_t) -1;
date_time = msg->msg_single_fields.fld_orig_date->dt_date_time;
tmval.tm_sec = date_time->dt_sec;
tmval.tm_min = date_time... | false | false | false | false | false | 0 |
timer_stop(struct timeval *tvp)
{
struct timeval tv1;
struct timezone tz;
double t;
gettimeofday(&tv1, &tz);
if (tvp->tv_usec > tv1.tv_usec) {
tv1.tv_sec--;
tv1.tv_usec += 1000000;
}
tv1.tv_sec -= tvp->tv_sec;
tv1.tv_usec -= tvp->tv_usec;
return t = tv1.tv_sec + (double)tv1.tv_use... | false | false | false | false | false | 0 |
modifyPrcd(name)
char *name;
{
int ready_flag ;
process_t *p_p ;
prcd_t *p_pr, **pp_pr ;
ready_flag = 0 ; /* update all processes' precedent list */
for (p_p = process_list ; p_p != NULL ; p_p = p_p->next)
{
pp_pr = &p_p->prcd ;
p_pr = p_p->prcd ;
/* scan the precedence list */
... | false | false | false | false | false | 0 |
cx24116_writereg(struct cx24116_state *state, int reg, int data)
{
u8 buf[] = { reg, data };
struct i2c_msg msg = { .addr = state->config->demod_address,
.flags = 0, .buf = buf, .len = 2 };
int err;
if (debug > 1)
printk("cx24116: %s: write reg 0x%02x, value 0x%02x\n",
__func__, reg, data);
err = i2c_tran... | false | false | false | false | false | 0 |
alps_reconnect(struct psmouse *psmouse)
{
struct alps_data *priv = psmouse->private;
psmouse_reset(psmouse);
if (alps_identify(psmouse, priv) < 0)
return -1;
return priv->hw_init(psmouse);
} | false | false | false | false | false | 0 |
vty_config_write(vty_t *vty)
{
vty_out(vty, "line vty%s", VTY_NEWLINE);
/* exec-timeout */
if (vty_timeout_val != VTY_TIMEOUT_DEFAULT) {
vty_out(vty, " exec-timeout %ld %ld%s",
vty_timeout_val / 60,
vty_timeout_val % 60, VTY_NEWLINE);
}
/* login */
if (no_password_check)
vty_out(vty, " no login%s", V... | false | false | false | false | false | 0 |
AddSubDirectory(const char* sub,
bool excludeFromAll, bool preorder)
{
// the source path must be made full if it isn't already
std::string srcPath = sub;
if (!cmSystemTools::FileIsFullPath(srcPath.c_str()))
{
srcPath = this->GetCurrentDirectory();
srcPath += "/";
... | false | false | false | false | false | 0 |
shortlog_output(struct shortlog *log)
{
int i, j;
struct strbuf sb = STRBUF_INIT;
if (log->sort_by_number)
qsort(log->list.items, log->list.nr, sizeof(struct string_list_item),
compare_by_number);
for (i = 0; i < log->list.nr; i++) {
struct string_list *onelines = log->list.items[i].util;
if (log->summar... | false | false | false | false | false | 0 |
duplicateForUndo(const FWObject *obj) throw(FWException)
{
if (ClusterGroup::constcast(obj)==NULL) return *this;
setRO(false);
ClusterGroupOptions *their_opts = ClusterGroupOptions::cast(
obj->getFirstByType(ClusterGroupOptions::TYPENAME));
ClusterGroupOptions *mine_opts = ClusterGroupOptions:... | false | false | false | false | false | 0 |
load_dir_plugins(const char *plugin_dir)
{
Plugin *plugin;
int i;
Dmsg0(dbglvl, "Load dir plugins\n");
if (!plugin_dir) {
Dmsg0(dbglvl, "No dir plugin dir!\n");
return;
}
bplugin_list = New(alist(10, not_owned_by_alist));
if (!load_plugins((void *)&binfo, (void *)&bfuncs, plugin_dir, p... | false | false | false | false | false | 0 |
dict_open(krb5_context context, const char *dict_file,
krb5_pwqual_moddata *data)
{
krb5_error_code ret;
dict_moddata dict;
*data = NULL;
/* Allocate and initialize a dictionary structure. */
dict = malloc(sizeof(*dict));
if (dict == NULL)
return ENOMEM;
dict->word_list =... | false | false | false | false | false | 0 |
pixQuantizeIfFewColors(PIX *pixs,
l_int32 maxcolors,
l_int32 mingraycolors,
l_int32 octlevel,
PIX **ppixd)
{
l_int32 d, ncolors, iscolor, graycolors;
PIX *pixg, *pixd;
PROCNAME("pixQuantizeIfFewColors");
... | false | false | false | false | false | 0 |
guestfs_session_internal_test_rstructerr(GuestfsSession *session, GError **err)
{
guestfs_h *g = session->priv->g;
if (g == NULL) {
g_set_error(err, GUESTFS_ERROR, 0,
"attempt to call %s after the session has been closed",
"internal_test_rstructerr");
return NULL;
}
stru... | false | true | false | false | false | 1 |
gt_ht_remove(GtHashtable *ht, const void *elem)
{
htsize_t remove_pos = free_mark, referent = free_mark;
gt_ht_traverse_list_of_key(ht, elem,,
if (link != free_mark
&& !ht->table_info.cmp(elem,
gt_ht_elem_pt... | false | false | false | false | false | 0 |
startExecution()
{
bool ok = true;
QString filename = evaluateString(ok, "file");
QString variable = evaluateVariable(ok, "variable");
Mode mode = evaluateListElement<Mode>(ok, modes, "mode");
if(!ok)
return;
if(filename.isEmpty())
{
emit executionException(UnableToReadFileE... | false | false | false | false | false | 0 |
json_array_extend(json_t *json, json_t *other_json)
{
json_array_t *array, *other;
unsigned int i;
if(!json_is_array(json) || !json_is_array(other_json))
return -1;
array = json_to_array(json);
other = json_to_array(other_json);
if(!json_array_grow(array, other->entries, 1))
re... | false | false | false | false | false | 0 |
db_key_type (DB *db, u_int32_t action) {
switch (db_get_type(db)) {
case DB_QUEUE: case DB_RECNO: return -1;
case DB_BTREE: switch (action) {
case DB_GET_RECNO: case DB_SET_RECNO: return -1;
default: return 0;
}
default: return 0;
}
} | false | false | false | false | false | 0 |
senddata(int socket, char *buffer, int length)
{
#if !(defined(WIN32) && !defined(CYGWIN))
static char crlf[] = "\r\n";
int rc;
for(rc=0;rc < length;)
{
rc = TEMP_FAILURE_RETRY(
send(socket,&buffer[rc],length-rc,MSG_NOSIGNAL));
if(CHECK_RC(rc))
return -1;
}
for(rc=0;rc < 2;)
{
rc = T... | false | true | false | false | false | 1 |
client_connect(stype_t *server)
{
struct sockaddr_storage csock;
#if defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED)
int clen;
#else
socklen_t clen;
#endif
int fd;
nut_ctype_t *client;
clen = sizeof(csock);
fd = accept(server->sock_fd, (struct sockaddr *) &csock, &clen);
if (fd < 0) {
return;
}
cl... | false | false | false | false | false | 0 |
analogtv_setup_teletext(analogtv_input *input)
{
int x,y;
int teletext=ANALOGTV_BLACK_LEVEL;
/* Teletext goes in line 21. But I suspect there are other things
in the vertical retrace interval */
for (y=19; y<22; y++) {
for (x=ANALOGTV_PIC_START; x<ANALOGTV_PIC_END; x++) {
if ((x&7)==0) {
... | false | false | false | false | false | 0 |
_GWidget_FindPrev(GContainerD *cd,GGadget *oldfocus,GGadget **first, int *found) {
GGadget *g;
GWidgetD *w;
if ( cd==NULL || !cd->iscontainer )
return( false );
for ( g=cd->gadgets; g!=NULL; g=g->prev ) {
if ( g->focusable && g->state!=gs_invisible && g->state!=gs_disabled ) {
if ( *first==NULL )... | false | false | false | false | false | 0 |
get_original_type(ObjectInfo * obj) {
obj = get_object_type(obj);
while (is_modified_type(obj)) {
obj = obj->mType;
}
return obj;
} | false | false | false | false | false | 0 |
setImage(const char *image_on, const char *image_off)
{
safe_strcpy(m_image_on, image_on);
if (image_off[0]) {
safe_strcpy(m_image_off, image_off);
}
else {
safe_strcpy(m_image_off, m_image_on);
}
} | false | false | false | false | false | 0 |
check_instances(Literals lit1, Context subst1,
Literals lit2, Context subst2,
int res_type)
{
if (!Check_instances)
return TRUE;
else
return
check_instance(lit1, subst1, res_type) &&
check_instance(lit2, subst2, res_type);
} | false | false | false | false | false | 0 |
finish_parse_f(struct parser *p) {
struct feature *f, *n;
f_info = mem_zalloc(z_info->f_max * sizeof(*f));
for (f = parser_priv(p); f; f = f->next) {
if (f->fidx >= z_info->f_max)
continue;
memcpy(&f_info[f->fidx], f, sizeof(*f));
}
f = parser_priv(p);
while (f) {
n = f->next;
mem_free(f);
f = n;
... | false | false | false | false | false | 0 |
T_MovePoly(polyevent_t * pe)
{
int absSpeed;
polyobj_t *poly;
if (PO_MovePolyobj(pe->polyobj, pe->xSpeed, pe->ySpeed))
{
absSpeed = abs(pe->speed);
pe->dist -= absSpeed;
if (pe->dist <= 0)
{
poly = GetPolyobj(pe->polyobj);
if (poly->specialdata ==... | false | false | false | false | false | 0 |
EndianSwapBytes( int byteOffset, int length )
{
if (DoEndianSwap())
{
ReverseBytesInPlace(data+byteOffset, length);
}
} | false | false | false | false | false | 0 |
globus_libc_telldir(DIR *dirp)
{
long pos=-1;
int save_errno;
if(dirp != GLOBUS_NULL)
{
globus_libc_lock();
pos = telldir(dirp);
save_errno=errno;
globus_libc_unlock();
errno = save_errno;
return pos;
}
else
{
return pos;
}
} | false | false | false | false | false | 0 |
__os_ioinfo(env, path, fhp, mbytesp, bytesp, iosizep)
ENV *env;
const char *path;
DB_FH *fhp;
u_int32_t *mbytesp, *bytesp, *iosizep;
{
struct stat sb;
int ret;
if (DB_GLOBAL(j_ioinfo) != NULL)
return (DB_GLOBAL(j_ioinfo)(path,
fhp->fd, mbytesp, bytesp, iosizep));
DB_ASSERT(env, F_ISSET(fhp, DB_FH_OPEN... | false | false | false | false | false | 0 |
CreateVideoOutputDevice(const OpalConnection & connection,
const OpalMediaFormat & media_fmt,
PBoolean preview,
PVideoOutputDevice * & device,
PBoolean & auto_delete)
{
P... | false | false | false | false | false | 0 |
snd_trident_pcm_pan_control_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];
unsigned char val;
int change = 0;
if (uco... | false | false | false | false | false | 0 |
execute( vector < string > & argv,
string & out )
{
if( argv.size() == 0 )
{
if( caller->code != "" )
out += caller->code + "\n";
else
out += "error: no code to print\n";
}
else
{
vector<string>::si... | false | false | false | false | false | 0 |
_getFilePos(ArchiveHandle *AH, lclContext *ctx)
{
pgoff_t pos;
if (ctx->hasSeek)
{
/*
* Prior to 1.7 (pg7.3) we relied on the internally maintained
* pointer. Now we rely on ftello() always, unless the file has been
* found to not support it. For debugging purposes, print a warning
* if the interna... | false | false | false | false | false | 0 |
setMargins(int footer, int header)
{
m_footer_margin = footer;
m_header_margin = header;
m_footer_visible = (m_footer_visible != 0) ? -m_footer_margin : 0;
m_header_visible = (m_header_visible != 0) ? m_header_margin : 0;
updateMask();
showHeader();
} | false | false | false | false | false | 0 |
EstimateScaleFactors(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS],
QC_OUT_CHANNEL qcOutChannel[MAX_CHANNELS],
Word16 logSfbEnergy[MAX_CHANNELS][MAX_GROUPED_SFB],
Word16 logSfbFormFactor[MAX_CHANNELS][MAX_GROUPED_SFB],
... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
try
{
// open SMS store file
SortedSMSStore sms((string)"sms.sms");
// print all entries
cout << "Entries in sms.sms<0>:" << endl;
for (SortedSMSStore::iterator i = sms.begin(); i != sms.end(); ++i)
cout << "Entry#" << i->index() << ":" << endl
... | false | false | false | false | false | 0 |
chess_piece_get_symbol (ChessPiece* self) {
gunichar result;
gunichar c;
PieceType _tmp0_;
ChessPlayer* _tmp1_;
Color _tmp2_;
gunichar _tmp5_;
g_return_val_if_fail (self != NULL, 0U);
c = (gunichar) ' ';
_tmp0_ = self->type;
switch (_tmp0_) {
case PIECE_TYPE_PAWN:
{
c = (gunichar) 'p';
break;
}
... | false | false | false | false | false | 0 |
evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
{
Evas_Object_Textblock *o;
Evas_Object_Textblock_Line *ln1, *ln2;
Evas_Object_Textblock_Item *it1, *it2;
Eina_List *rects = NULL;
Evas_Textblock_Rectangle *tr;
if (!cur1 || !cur1->node) ret... | false | false | false | false | false | 0 |
connectToServer(NConnect_State &state) {
switch (state.type) {
case SAT_UNIX:
return connectToUnixServer(state.s_unix);
case SAT_TCP:
return connectToTcpServer(state.s_tcp);
default:
throw RuntimeException("Unknown address type");
}
} | false | false | false | false | false | 0 |
dataString(qint64 size)
{
QString unit;
double newSize;
if (size < 1024) {
newSize = size;
unit = tr("bytes");
} else if (size < 1024 * 1024) {
newSize = (double)size / (double)1024;
unit = tr("kB");
} else if (size < 1024 * 1024 * 1024) {
newSize = (double)s... | false | false | false | false | false | 0 |
arizona_lhpf_coeff_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
__be16 *data = (__be16 *)ucontrol->value.bytes.data;
s16 val = be16_to_cpu(*data);
if (a... | 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.