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 |
|---|---|---|---|---|---|---|
Do_Asus_Video_Info()
{
ifstream file_in;
char *filename;
int type;
filename = "/proc/acpi/asus/disp";
file_in.open(filename);
if (!file_in)
{
if(Be_asus_quiet)
{
cout<<"<not available>"<<endl;
return 0;
}
else
{
... | false | false | false | false | false | 0 |
account_miner_job_traverse_folder (GomAccountMinerJob *job,
const gchar *folder_id,
GError **error)
{
GList *entries, *l;
entries = zpj_skydrive_list_folder_id (ZPJ_SKYDRIVE (job->service),
folder_id,
... | false | false | false | false | false | 0 |
TCMalloc_ResumeAllProcessThreads(int num_threads, pid_t *thread_pids) {
int detached_at_least_one = 0;
while (num_threads-- > 0) {
detached_at_least_one |= sys_ptrace_detach(thread_pids[num_threads]) >= 0;
}
return detached_at_least_one;
} | false | false | false | false | false | 0 |
get_sem_info(struct sem_info *sem_info, ulong shp, int id)
{
char buf[BUFSIZE];
sem_info->sem_array = shp - OFFSET(sem_array_sem_perm);
/*
* cache sem_array
*/
readmem(sem_info->sem_array, KVADDR, buf, SIZE(sem_array),
"sem_array", FAULT_ON_ERROR);
sem_info->key = INT(buf + OFFSET(sem_array_s... | false | false | false | false | false | 0 |
size_of_encoded_value (int encoding)
{
if (encoding == DW_EH_PE_omit)
return 0;
switch (encoding & 0x07)
{
case DW_EH_PE_absptr:
return POINTER_SIZE / BITS_PER_UNIT;
case DW_EH_PE_udata2:
return 2;
case DW_EH_PE_udata4:
return 4;
case DW_EH_PE_udata8:
return 8;
}... | true | true | false | false | false | 1 |
c_alpha_read(gs_composite_t ** ppcte, const byte * data, uint size,
gs_memory_t * mem)
{
gs_composite_alpha_params_t params;
int code, nbytes = 1;
if (size < 1 || *data > composite_op_last)
return_error(gs_error_rangecheck);
params.op = *data;
if_debug1m('v', mem, "[v]c_alpha_r... | false | true | false | false | false | 1 |
git_zstream_deflatebuf(git_buf *out, const void *in, size_t in_len)
{
git_zstream zs = GIT_ZSTREAM_INIT;
int error = 0;
if ((error = git_zstream_init(&zs)) < 0)
return error;
if ((error = git_zstream_set_input(&zs, in, in_len)) < 0)
goto done;
while (!git_zstream_done(&zs)) {
size_t step = git_zstream_sug... | false | false | false | false | false | 0 |
irplib_matrix_product_normal_create(const cpl_matrix * self)
{
double sum;
cpl_matrix * product;
const double * ai = cpl_matrix_get_data_const(self);
const double * aj;
double * bwrite;
const int m = cpl_matrix_get_nrow(self);
const int n = cpl_matrix_get_ncol(self... | false | false | false | false | false | 0 |
format(MSString& aString_,const MSFormat& aFormat_) const
{ return (aFormat_.formatType()==MSFormat::Rate)?format(aString_,aFormat_.rateFormat()):format(aString_); } | false | false | false | false | false | 0 |
cd_window_import_free_helper (CdWindowSetWidgetHelper *helper)
{
if (helper->cancellable != NULL)
g_object_unref (helper->cancellable);
g_object_unref (helper->window);
g_object_unref (helper->res);
g_free (helper);
} | false | false | false | false | false | 0 |
amdkfd_fence_wait_timeout(unsigned int *fence_addr,
unsigned int fence_value,
unsigned long timeout)
{
BUG_ON(!fence_addr);
timeout += jiffies;
while (*fence_addr != fence_value) {
if (time_after(jiffies, timeout)) {
pr_err("kfd: qcm fence wait loop timeout expired\n");
return -ETIME;
}
schedule... | false | false | false | false | false | 0 |
Execute () {
Editor* ed = GetEditor();
if (OnlyOneEditorOf(ed->GetComponent()) && !ReadyToClose(ed)) {
return;
}
Style* style;
boolean reset_caption = false;
if (chooser_ == nil) {
style = new Style(Session::instance()->style());
chooser_ = DialogKit::instance()->file_chooser(".", st... | false | false | false | false | false | 0 |
update_attributes_model (Compselect *compselect, TOPLEVEL *preview_toplevel)
{
GtkListStore *model;
GtkTreeIter iter;
GtkTreeViewColumn *column;
GList *listiter, *o_iter, *o_attrlist, *filter_list;
gchar *name, *value;
OBJECT *o_current;
model = (GtkListStore*) gtk_tree_view_get_model (compselect->attrtr... | false | false | false | false | false | 0 |
cfg_shutdown_callback(corosync_cfg_handle_t h, corosync_cfg_shutdown_flags_t flags)
{
crm_info("Corosync wants to shut down: %s",
(flags == COROSYNC_CFG_SHUTDOWN_FLAG_IMMEDIATE) ? "immediate" :
(flags == COROSYNC_CFG_SHUTDOWN_FLAG_REGARDLESS) ? "forced" : "optional");
/* Never allow c... | false | false | false | false | false | 0 |
mx_stylable_iface_init (MxStylableIface *iface)
{
static gboolean is_initialized = FALSE;
if (!is_initialized)
{
GParamSpec *pspec;
ClutterColor color = { 0x00, 0x00, 0x00, 0xff };
ClutterColor bg_color = { 0xff, 0xff, 0xff, 0x00 };
is_initialized = TRUE;
pspec = clutter_param_s... | false | false | false | false | false | 0 |
hget_header(hashp, page_size)
HTAB *hashp;
u_int32_t page_size;
{
u_int32_t num_copied, i;
u_int8_t *hdr_dest;
num_copied = 0;
i = 0;
hdr_dest = (u_int8_t *)&hashp->hdr;
/*
* XXX
* This should not be printing to stderr on a "normal" error case.
*/
lseek(hashp->fp, 0, SEEK_SET);
num_copied = read(hash... | false | false | false | false | false | 0 |
similarity_measure(
int *score,
git_diff_list *diff,
const git_diff_find_options *opts,
void **cache,
size_t a_idx,
size_t b_idx)
{
git_diff_file *a_file = similarity_get_file(diff, a_idx);
git_diff_file *b_file = similarity_get_file(diff, b_idx);
bool exact_match = FLAG_SET(opts, GIT_DIFF_FIND_EXACT_MATCH_ONL... | false | false | false | false | false | 0 |
png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
error_message)
{
int iout = 0, iin = 0;
while (iin < 4)
{
int c = png_ptr->chunk_name[iin++];
if (isnonalpha(c))
{
buffer[iout++] = '[';
buffer[iout++] = png_digit[(c & 0xf0) >> 4];
... | false | false | false | false | false | 0 |
compare_keys (gcry_sexp_t key, gcry_sexp_t sexp)
{
guchar hash1[20], hash2[20];
guchar *p;
/* Now compare them */
p = gcry_pk_get_keygrip (key, hash1);
g_assert ("couldn't get key id for private key" && p == hash1);
p = gcry_pk_get_keygrip (sexp, hash2);
g_assert ("couldn't get key id for parsed private key" &&... | false | false | false | false | false | 0 |
gar_nod_parse_nod3(struct gar_subfile *sub)
{
int i, rc;
off_t o;
int x,y,p;
struct nod_bond nb;
if (!sub->net || !sub->net->nod) {
return -1;
}
if (!sub->net->nod->nod3_offset || !sub->net->nod->nod3_length) {
log(1, "NOD: No boundary nodes defined\n");
return 0;
}
log(11, "nod3recsize=%d nodbond=%d\n"... | false | false | false | false | false | 0 |
lm49453_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
{
struct lm49453_priv *lm49453 = snd_soc_codec_get_drvdata(codec);
switch (level) {
case SND_SOC_BIAS_ON:
case SND_SOC_BIAS_PREPARE:
break;
case SND_SOC_BIAS_STANDBY:
if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BI... | false | false | false | false | false | 0 |
init_orientation(Gtk::Orientation const &orientation)
{
static_cast<Gtk::Toolbar*>(_widget)->set_orientation(orientation);
if (orientation == Gtk::ORIENTATION_VERTICAL) {
set_handle_position(Gtk::POS_TOP);
}
switch (orientation) {
case Gtk::ORIENTATION_HORIZONTAL: {
Glib::Ref... | false | false | false | false | false | 0 |
MakeWMOFilename(char* fn, std::string fname)
{
if(loadFromMPQ)
sprintf(fn,"%s",fname.c_str());
else
{
NormalizeFilename(_PathToFileName(fname));
sprintf(fn,"./data/wmos/%s",fname.c_str());
}
} | false | false | false | false | false | 0 |
multi_pxo_process_nick_change(char *data)
{
char *from, *to;
player_list *lookup;
// get the new string
from = strtok(data," ");
to = strtok(NULL,"");
if((from != NULL) && (to != NULL)){
lookup = multi_pxo_find_player(from);
if(lookup != NULL){
strcpy_s(lookup->name,to);
// if this is also my nick, ... | false | false | false | false | false | 0 |
capture_read_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = ssm->priv;
struct aes2550_dev *aesdev = dev->priv;
unsigned char *data = transfer->buffer;
int r;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
fp_dbg("request is not completed, %... | false | false | false | false | false | 0 |
_dxf_CREATE_HW_TRANSLATION (void *win)
{
#if defined(DX_NATIVE_WINDOWS)
return NULL;
#else
int i ;
DEFWINDATA(win) ;
hwTranslationP ret ;
char *gammaStr;
ENTRY(("_dxf_CREATE_HW_TRANSLATION (0x%x)",win));
if (! (ret = (hwTranslationP) tdmAllocate(sizeof(translationT))))
{
EXIT(("ERROR: Alloc fa... | false | false | false | false | false | 0 |
fillPuzzleList (KSelectAction * s, const PuzzleItem itemList [])
{
QStringList list;
for (uint i=0; (strcmp (itemList[i].menuText, "END") != 0); i++) {
list.append (i18n(itemList[i].menuText));
}
s->setItems(list);
return (list.count() - 1);
} | false | false | false | false | false | 0 |
gt_graphics_cairo_get_text_height(GtGraphics *gg)
{
GtGraphicsCairo *g = gt_graphics_cairo_cast(gg);
gt_assert(g);
return g->font_height;
} | false | false | false | false | false | 0 |
sd_wait_voltage_stable_1(struct realtek_pci_sdmmc *host)
{
struct rtsx_pcr *pcr = host->pcr;
int err;
u8 stat;
/* Reference to Signal Voltage Switch Sequence in SD spec.
* Wait for a period of time so that the card can drive SD_CMD and
* SD_DAT[3:0] to low after sending back CMD11 response.
*/
mdelay(1);
... | false | false | false | false | false | 0 |
fuse_write_update_size(struct inode *inode, loff_t pos)
{
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_inode *fi = get_fuse_inode(inode);
bool ret = false;
spin_lock(&fc->lock);
fi->attr_version = ++fc->attr_version;
if (pos > inode->i_size) {
i_size_write(inode, pos);
ret = true;
}
spin_unlock... | false | false | false | false | false | 0 |
transformPrepareStmt(ParseState *pstate, PrepareStmt *stmt)
{
Query *result = makeNode(Query);
List *argtype_oids; /* argtype OIDs in a list */
Oid *argtoids = NULL; /* and as an array */
int nargs;
List *queries;
int i;
result->commandType = CMD_UTILITY;
result->utilityStmt = (Node *) stmt;
... | false | false | false | false | false | 0 |
textControls (char *buf)
{
if (controls == CONTROLS_KEYBOARD) sprintf (buf, "%s", "KEYBOARD");
else if (controls == CONTROLS_MOUSE) sprintf (buf, "%s", "MOUSE");
else if (controls == CONTROLS_JOYSTICK) sprintf (buf, "%s", "JOYSTICK");
} | false | false | false | false | false | 0 |
create_font_btn (const PreferencesWidget * widget, GtkWidget * * label,
GtkWidget * * font_btn, const char * domain)
{
*font_btn = gtk_font_button_new();
gtk_font_button_set_use_font(GTK_FONT_BUTTON(*font_btn), TRUE);
gtk_font_button_set_use_size(GTK_FONT_BUTTON(*font_btn), TRUE);
gtk_widget_set_hexpan... | false | false | false | false | false | 0 |
GraalDelInstance( InstanceRds )
rdsins_list *InstanceRds;
{
phins_list *InstanceMbk;
rdsrec_list *ScanRec;
rdsrec_list *DelRec;
char Layer;
rdsbegin();
*(rdsins_list **)(InstanceRds->USER) = InstanceRds->NEXT;
if ( InstanceRds->NEXT != (rdsins_list *)NULL )
{
InstanceRds->NEXT->U... | false | false | false | false | false | 0 |
v9fs_file_lock_dotl(struct file *filp, int cmd, struct file_lock *fl)
{
struct inode *inode = file_inode(filp);
int ret = -ENOLCK;
p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %pD\n",
filp, cmd, fl, filp);
/* No mandatory locks */
if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
goto out_err... | false | false | false | false | false | 0 |
SetLayer (int layer)
{
char *state = NULL;
Window mRootWin = RootWindow (_display, DefaultScreen (_display));
XEvent xev;
memset (&xev, 0, sizeof(xev));
if (_wmType & wm_LAYER) {
if (!_state.origLayer)
_state.origLayer = GetGnomeLayer ();
xev.type = ClientMessage;
xev.xclient.displa... | false | false | false | false | false | 0 |
generate_simple_sort(int size, char * name, int left)
{
// please make sure that i,j,k,z can be modified
fprintf(codefile,
" // sorting %s\n"
" // only if there is more than 1 permutation in class\n"
" if (Perm.MTO_class_%s())\n"
" {\n"
" for (i=0; i<%d; i++)\n"
" for (j=0; j<%d;... | false | false | false | false | false | 0 |
bpq_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct bpq_ethaddr __user *ethaddr = ifr->ifr_data;
struct bpqdev *bpq = netdev_priv(dev);
struct bpq_req req;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case SIOCSBPQETHOPT:
if (copy_from_user(&req, ifr->ifr_data, sizeof(stru... | false | false | false | false | false | 0 |
ToStdString(std::string &str) const
{
str.reserve(size() + 1);
Convert::Unicode::UTF32ToANSI(begin(), end(), std::back_inserter(str), 0);
return str;
} | false | false | false | false | false | 0 |
Term_mn(CTX ctx, kTerm *tk)
{
if(TT_(tk) == TT_FUNCNAME || TT_(tk) == TT_NAME || TT_(tk) == TT_UNAME || TT_(tk) == TT_UFUNCNAME) {
TT_(tk) = TT_MN;
(tk)->mn = knh_getmn(ctx, TK_tobytes(tk), MN_NEWID);
}
if(TT_(tk) == TT_NEW) {
TT_(tk) = TT_MN;
(tk)->mn = knh_getmn(ctx, TK_tobytes(tk), MN_NEWID);
}
DBG_ASSE... | false | false | false | false | false | 0 |
gw_menu_popup_catalog_rename ( GtkMenuItem *m, GtkCTreeNode *node) {
gboolean result = FALSE;
GtkWindow *window = NULL;
GWCatalogPlugin *plugin = NULL;
GWDBContext *context = gw_am_get_current_catalog_context ( );
GWDBCatalog *catalog = NULL;
#ifdef GW_DEBUG_GUI_CALLBACK_COMPONENT
g_print ( "*** GW - %s (%d) ::... | false | false | false | false | false | 0 |
check_onebit (void)
{
static const long data[] = {
-513, -512, -511, -65, -64, -63, -32, -1,
0, 1, 32, 53, 54, 64, 128, 256, 511, 512, 513
};
mpf_t f;
double got, want;
long got_exp, want_exp;
int i;
mpf_init2 (f, 1024L);
for (i = 0; i < numberof (data); i++)
{
mpf_set_ui (... | false | false | false | false | false | 0 |
_getBufferUTF32Str() const
{
if ( mBufferType != bt_utf32string ) {
_cleanBuffer();
mBuffer.mUTF32StrBuffer = new utf32string();
mBufferType = bt_utf32string;
}
mBuffer.mUTF32StrBuffer->clear();
} | false | false | false | false | false | 0 |
get_icon() override
{
return gnote::IconManager::obj().get_icon(gnote::IconManager::SPECIAL_NOTES, 22);
}
} | false | false | false | false | false | 0 |
fixListHierarchy(void)
{
UT_uint32 iNumLists = m_vecLists.getItemCount();
fl_AutoNum * pAutoNum;
if (iNumLists == 0)
{
return false;
}
else
{
// Some documents may contain empty lists
// that appear as a result of importing ODT file which contains
// nested lists without pa... | false | false | false | false | false | 0 |
EmptyWidth(EmptyOp empty) {
int id = AllocInst(1);
if (id < 0)
return NoMatch();
inst_[id].InitEmptyWidth(empty, 0);
if (empty & (kEmptyBeginLine|kEmptyEndLine))
prog_->MarkByteRange('\n', '\n');
if (empty & (kEmptyWordBoundary|kEmptyNonWordBoundary)) {
int j;
for (int i = 0; i < 256; i = j) {... | false | false | false | false | false | 0 |
gwy_func_use_info_compare(gconstpointer a,
gconstpointer b)
{
const GwyFunctionUseInfo *ainfo, *binfo;
gdouble aw, bw;
ainfo = (const GwyFunctionUseInfo*)a;
binfo = (const GwyFunctionUseInfo*)b;
aw = ainfo->global + ainfo->local;
bw = binfo->global + binfo->local;
... | false | false | false | false | false | 0 |
add(const ClpSimplex * /*model*/, double * array,
int iColumn, double multiplier) const
{
CoinBigIndex j = iColumn << 1;
int iRowM = indices_[j];
int iRowP = indices_[j+1];
if (iRowM >= 0)
array[iRowM] -= multiplier;
if (iRowP >= 0)
array[iRowP] += mult... | false | false | false | false | false | 0 |
php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
{
Bucket *f;
Bucket *s;
zval result;
zval first;
zval second;
f = *((Bucket **) a);
s = *((Bucket **) b);
if (f->nKeyLength == 0) {
Z_TYPE(first) = IS_LONG;
Z_LVAL(first) = f->h;
} else {
Z_TYPE(first) = IS_STRING;
Z_STRVAL(first... | false | false | false | false | false | 0 |
rb_if_indextoname(const char *succ_prefix, const char *fail_prefix, unsigned int ifindex, char *buf, size_t len)
{
#if defined(HAVE_IF_INDEXTONAME)
char ifbuf[IFNAMSIZ];
if (if_indextoname(ifindex, ifbuf) == NULL)
return snprintf(buf, len, "%s%u", fail_prefix, ifindex);
else
return snprintf(... | false | false | false | false | false | 0 |
read_row_values(TABLE *table,
unsigned char *buf,
Field **fields,
bool read_all)
{
Field *f;
if (unlikely(! m_row_exists))
return HA_ERR_RECORD_DELETED;
/* Set the null bits... | false | false | false | false | false | 0 |
ufs_rmdir (struct inode * dir, struct dentry *dentry)
{
struct inode * inode = d_inode(dentry);
int err= -ENOTEMPTY;
if (ufs_empty_dir (inode)) {
err = ufs_unlink(dir, dentry);
if (!err) {
inode->i_size = 0;
inode_dec_link_count(inode);
inode_dec_link_count(dir);
}
}
return err;
} | false | false | false | false | false | 0 |
freetuxtv_cellrenderer_recordingslist_finalize (GObject *object)
{
FreetuxTVCellRendererRecordingsList *self;
self = FREETUXTV_CELLRENDERER_RECORDINGSLIST(object);
G_OBJECT_CLASS (freetuxtv_cellrenderer_recordingslist_parent_class)->finalize (object);
if(self->szTitle){
g_free(self->szTitle);
self->szTitle = ... | false | false | false | false | false | 0 |
update_size_window (MetaResizePopup *popup)
{
char *str;
int x, y;
int width, height;
g_return_if_fail (popup->size_window != NULL);
/* Translators: This represents the size of a window. The first number is
* the width of the window and the second is the height.
*/
str = g_strdup_printf (_("%d ... | false | false | false | false | false | 0 |
_get_icon(void *data)
{
Evas *evas;
E_Config_Dialog_Data *cfdata;
Evas_Object *icon = NULL;
char buf[4096];
cfdata = data;
if (!cfdata) return NULL;
e_widget_disabled_set(cfdata->gui.icon, 1);
if (cfdata->gui.icon)
evas_object_del(cfdata->gui.icon);
cfdata->gui.icon = NULL;
... | false | false | false | false | false | 0 |
search_oid (const char *oid, int *algorithm, gcry_md_oid_spec_t *oid_spec)
{
gcry_module_t module;
int ret = 0;
if (oid && ((! strncmp (oid, "oid.", 4))
|| (! strncmp (oid, "OID.", 4))))
oid += 4;
module = gcry_md_lookup_oid (oid);
if (module)
{
gcry_md_spec_t *digest = module->spec;
... | false | false | false | false | false | 0 |
internalOpen(void)
{
mySocket->init();
ArLog::log(ArLog::Verbose, "ArTcpConnection::internalOpen: Connecting to %s %d", myHostName.c_str(), myPortNum);
if (mySocket->connect(const_cast<char *>(myHostName.c_str()), myPortNum,
ArSocket::TCP))
{
myStatus = STATUS_OPEN;
mySocket->setNonBlock();
... | false | false | false | false | false | 0 |
ax88179_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
{
struct usbnet *dev = netdev_priv(net);
u8 opt;
if (ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_MONITOR_MOD,
1, 1, &opt) < 0) {
wolinfo->supported = 0;
wolinfo->wolopts = 0;
return;
}
wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
... | false | false | false | false | false | 0 |
insertPlaylists( int topModelRow, Playlists::PlaylistList playlists )
{
TrackLoader *loader = new TrackLoader(); // auto-deletes itself
loader->setProperty( "topModelRow", QVariant( topModelRow ) );
connect( loader, SIGNAL(finished(Meta::TrackList)),
SLOT(slotLoaderWithRowFinished(Meta::TrackLi... | false | false | false | false | false | 0 |
_rtl8152_set_rx_mode(struct net_device *netdev)
{
struct r8152 *tp = netdev_priv(netdev);
u32 mc_filter[2]; /* Multicast hash filter */
__le32 tmp[2];
u32 ocp_data;
netif_stop_queue(netdev);
ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
ocp_data &= ~RCR_ACPT_ALL;
ocp_data |= RCR_AB | RCR_APM;
if (net... | false | false | false | false | false | 0 |
startDisplayP2(struct display *d)
{
char *cname, *cgname;
openCtrl(d);
debug("forking session\n");
ASPrintf(&cname, "sub-daemon for display %s", d->name);
ASPrintf(&cgname, "greeter for display %s", d->name);
switch (gFork(&d->pipe, "master daemon", cname,
&d->gpipe, cgname, 0... | false | false | false | false | false | 0 |
next(Dbt &key, Dbt &data)
{
if (*p_ == (u_int32_t)-1) {
key.set_data(0);
key.set_size(0);
data.set_data(0);
data.set_size(0);
p_ = 0;
} else {
key.set_data(data_ + *p_);
p_--;
key.set_size(*p_);
p_--;
data.set_data(data_ + *p_);
p_--;
data.set_size(*p_);
p_--;
}
return (p_ != 0);
} | false | false | false | false | false | 0 |
get_ip_name (name_add_t *nt)
{
if (nt->dir == INBOUND)
fill_node_id(&nt->node_id, IP, nt, 16, 0, AF_INET);
else
fill_node_id(&nt->node_id, IP, nt, 12, 0, AF_INET);
if (!pref.name_res)
add_name (ipv4_to_str (nt->node_id.addr.ip.addr_v4),
NULL, &nt->node_id, nt);
else
add_name (ip... | false | false | false | false | false | 0 |
GetColorInterpretation()
{
NITFBandInfo *psBandInfo = psImage->pasBandInfo + nBand - 1;
if( poColorTable != NULL )
return GCI_PaletteIndex;
if( EQUAL(psBandInfo->szIREPBAND,"R") )
return GCI_RedBand;
if( EQUAL(psBandInfo->szIREPBAND,"G") )
return GCI_GreenBand;
if( EQU... | false | false | false | false | false | 0 |
smb_fdata(const u_char *buf, const char *fmt, const u_char *maxbuf,
int unicodestr)
{
static int depth = 0;
char s[128];
char *p;
while (*fmt) {
switch (*fmt) {
case '*':
fmt++;
while (buf < maxbuf) {
const u_char *buf2;
depth++;
buf2 = smb_fdata(buf, fmt, maxbuf, unicodestr);
d... | false | false | false | false | false | 0 |
UnloadBlob_PCR_COMPOSITE(UINT64 *offset, BYTE *blob, TCPA_PCR_COMPOSITE *out)
{
TSS_RESULT rc;
if (!out) {
UINT32 size;
if ((rc = UnloadBlob_PCR_SELECTION(offset, blob, NULL)))
return rc;
UnloadBlob_UINT32(offset, &size, blob);
if (size > 0)
UnloadBlob(offset, size, blob, NULL);
return TSS_SUCCESS... | false | false | false | false | false | 0 |
frob_into_branch_around (gimple tp, eh_region region, tree over)
{
gimple x;
gimple_seq cleanup, result;
location_t loc = gimple_location (tp);
cleanup = gimple_try_cleanup (tp);
result = gimple_try_eval (tp);
if (region)
emit_post_landing_pad (&eh_seq, region);
if (gimple_seq_may_fallthru (cleanup... | false | false | false | false | false | 0 |
FcCharSetInsertLeaf (FcCharSet *fcs, FcChar32 ucs4, FcCharLeaf *leaf)
{
int pos;
pos = FcCharSetFindLeafPos (fcs, ucs4);
if (pos >= 0)
{
FcMemFree (FC_MEM_CHARLEAF, sizeof (FcCharLeaf));
free (FcCharSetLeaf (fcs, pos));
FcCharSetLeaves(fcs)[pos] = FcPtrToOffset (FcCharSetLeaves(fcs),
l... | false | false | false | false | false | 0 |
fireball_play_warphole_close_sound(fireball *fb)
{
int sound_index;
object *fireball_objp;
fireball_objp = &Objects[fb->objnum];
sound_index = SND_WARP_OUT;
if ( fb->warp_close_sound_index > -1 ) {
sound_index = fb->warp_close_sound_index;
} else if ( fb->flags & FBF_WARP_CAPITAL_SIZE ) {
sound_index = S... | false | false | false | false | false | 0 |
merge_info(FILE_INFO& new_info) {
char buf[256];
if (max_nbytes <= 0 && new_info.max_nbytes) {
max_nbytes = new_info.max_nbytes;
sprintf(buf, " <max_nbytes>%.0f</max_nbytes>\n", new_info.max_nbytes);
}
// replace existing URLs with new ones
//
download_urls.replace(new_info... | false | false | false | false | false | 0 |
l_dnaCreateFromIArray(l_int32 *iarray,
l_int32 size)
{
l_int32 i;
L_DNA *da;
PROCNAME("l_dnaCreateFromIArray");
if (!iarray)
return (L_DNA *)ERROR_PTR("iarray not defined", procName, NULL);
if (size <= 0)
return (L_DNA *)ERROR_PTR("size must be > 0", procName, N... | false | false | false | false | false | 0 |
ast_say_datetime_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
int hour;
ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, f... | true | true | false | false | false | 1 |
bfa_iocpf_sm_ready(struct bfa_iocpf_s *iocpf, enum iocpf_event event)
{
struct bfa_ioc_s *ioc = iocpf->ioc;
bfa_trc(ioc, event);
switch (event) {
case IOCPF_E_DISABLE:
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabling);
break;
case IOCPF_E_GETATTRFAIL:
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail_sync);
... | false | false | false | false | false | 0 |
kmx61_get_mode(struct kmx61_data *data, u8 *mode, u8 device)
{
int ret;
ret = i2c_smbus_read_byte_data(data->client, KMX61_REG_STBY);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_stby\n");
return ret;
}
*mode = 0;
if (device & KMX61_ACC) {
if (ret & KMX61_ACC_STBY_BIT)
*mode |= KMX61_A... | false | false | false | false | false | 0 |
vs_exist(virtual_server_t * old_vs)
{
element e;
list l = check_data->vs;
virtual_server_t *vs;
virtual_server_group_t *vsg;
if (LIST_ISEMPTY(l))
return NULL;
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
vs = ELEMENT_DATA(e);
if (VS_ISEQ(old_vs, vs)) {
/* Check if group exist */
if (vs->vsgname) {
... | false | false | false | false | false | 0 |
sync_getflags(struct dlist *kl,
struct mailbox *mailbox,
struct index_record *record)
{
struct dlist *ki;
int userflag;
for (ki = kl->head; ki; ki = ki->next) {
char *s = xstrdup(ki->sval);
if (s[0] == '\\') {
/* System flags */
lcase(s);
if (!strcmp(s, "\\seen")) {
record->syst... | false | false | false | false | false | 0 |
gradientbevelfilter_type(const fn_call& fn)
{
GradientBevelFilter_as* ptr = ensure<ThisIsNative<GradientBevelFilter_as> >(fn);
if (fn.nargs == 0)
{
switch (ptr->m_type)
{
case GradientBevelFilter::FULL_BEVEL:
return as_value("full");
break;
... | false | false | false | false | false | 0 |
F_mpz_neg(F_mpz_t f1, const F_mpz_t f2)
{
if (!COEFF_IS_MPZ(*f2)) // coeff is small
{
F_mpz t = -*f2; // Need to save value in case of aliasing
_F_mpz_demote(f1);
*f1 = t;
} else // coeff is large
{
// No need to retain value in promotion, as if aliased, both already large
__mpz_struct * mpz_... | false | false | false | false | false | 0 |
io2_read(CTX ctx, kio_t *io2, char *buf, size_t bufsiz)
{
size_t rsize = 0;
while(bufsiz > 0) {
long remsiz = io2->tail - io2->top;
if(remsiz > 0) {
if(remsiz <= bufsiz) {
knh_memcpy(buf, io2->buffer + io2->top, bufsiz);
io2->top += bufsiz;
rsize += bufsiz;
return rsize;
}
else {
knh_... | false | false | false | false | false | 0 |
do_dungeon()
{
int rcnt = 0;
Sprintf(filename, DATA_IN_TEMPLATE, DGN_I_FILE);
if (!(ifp = fopen(filename, RDTMODE))) {
perror(filename);
exit(EXIT_FAILURE);
}
filename[0]='\0';
#ifdef FILE_PREFIX
Strcat(filename, file_prefix);
#endif
Sprintf(eos(filename), DGN_TEMPLATE, DGN_O_FILE);
if (!(ofp = fopen(filen... | false | false | false | false | true | 1 |
cmdGetBuffer610p (int cmd, int len, unsigned char *buffer)
{
int status, i, tmp;
int word[5];
int read, needed, max;
if (gMode == UMAX_PP_PARPORT_EPP)
return EPPcmdGetBuffer610p (cmd, len, buffer);
/* first we set length and channel */
/* compute word */
word[0] = len / 65536;
word[1] = (len / 256... | false | false | false | false | false | 0 |
patest1Callback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData )
{
patest1data *da... | false | false | false | false | false | 0 |
counterTypeToString( uint32_t properties ) {
switch( properties & OTF_COUNTER_TYPE_BITS ) {
CASE_RETURN( TYPE, ACC );
CASE_RETURN( TYPE, ABS );
default: {
static char unknown_buffer[ 64 ];
sprintf( unknown_buffer, "UNKNOWN <%u>",
properties & OTF_COUNTER_TYPE_BITS );
return unknown_buffer;
}
}
} | false | false | false | false | false | 0 |
cos_array_unadd(cos_array_t *pca, cos_value_t *pvalue)
{
cos_array_element_t *pcae = pca->elements;
if (pcae == 0 ||
pcae->index != (pcae->next == 0 ? 0 : pcae->next->index + 1)
)
return_error(gs_error_rangecheck);
*pvalue = pcae->value;
pca->elements = pcae->next;
gs_free_o... | false | false | false | false | false | 0 |
qof_query_kvp_predicate (QofQueryCompare how,
QofQueryParamList *path, const KvpValue *value)
{
query_kvp_t pdata;
QofQueryParamList *node;
g_return_val_if_fail (path && value, NULL);
pdata = g_new0 (query_kvp_def, 1);
pdata->pd.type_name = query_kvp_type;
pdata->pd.ho... | false | false | false | false | false | 0 |
SySetGetNextEntry(SySet *pSet, void **ppEntry)
{
register unsigned char *zSrc;
if( pSet->nCursor >= pSet->nUsed ){
/* Reset cursor */
pSet->nCursor = 0;
return SXERR_EOF;
}
zSrc = (unsigned char *)SySetBasePtr(pSet);
if( ppEntry ){
*ppEntry = (void *)&zSrc[pSet->nCursor * pSet->eSize];
}
pSet->nCursor++;... | false | false | false | false | false | 0 |
amitk_data_set_set_injected_dose(AmitkDataSet * ds,amide_data_t new_injected_dose) {
g_return_if_fail(AMITK_IS_DATA_SET(ds));
if (ds->injected_dose != new_injected_dose) {
ds->injected_dose = new_injected_dose;
amitk_data_set_set_scale_factor(ds, calculate_scale_factor(ds));
}
} | false | false | false | false | false | 0 |
file_write(struct wif *wi, unsigned char *h80211, int len,
struct tx_info *ti)
{
struct priv_file *pn = wi_priv(wi);
if (h80211 && ti && pn) {}
return len;
} | false | false | false | false | false | 0 |
Lower(const MachineInstr *MI, MCInst &OutMI) const {
OutMI.setOpcode(MI->getOpcode());
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
const MachineOperand &MO = MI->getOperand(i);
MCOperand MCOp;
switch (MO.getType()) {
default:
MI->dump();
llvm_unreachable("unknown oper... | false | false | false | false | false | 0 |
determine_unroll_factor (vec<chain_p> chains)
{
chain_p chain;
unsigned factor = 1, af, nfactor, i;
unsigned max = PARAM_VALUE (PARAM_MAX_UNROLL_TIMES);
FOR_EACH_VEC_ELT (chains, i, chain)
{
if (chain->type == CT_INVARIANT || chain->combined)
continue;
/* The best unroll factor for this chain... | false | false | false | false | false | 0 |
relocate(
void * pvOldAlloc,
void * pvNewAlloc)
{
FlmRecord * pOldRec = (FlmRecord *)pvOldAlloc;
FlmRecord * pNewRec = (FlmRecord *)pvNewAlloc;
RCACHE * pRCache;
RCACHE * pVersion;
flmAssert( pOldRec->getRefCount() == 1);
flmAssert( pOldRec->isCached());
flmAssert( pvNewAlloc < pvOldAlloc);
// Upd... | false | false | false | false | false | 0 |
neo_tasklet(unsigned long data)
{
struct dgnc_board *bd = (struct dgnc_board *)data;
struct channel_t *ch;
unsigned long flags;
int i;
int state = 0;
int ports = 0;
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return;
/* Cache a couple board values */
spin_lock_irqsave(&bd->bd_lock, flags);
state = bd->state... | false | false | false | false | false | 0 |
recv_control_msg(struct au0828_dev *dev, u16 request, u32 value,
u16 index, unsigned char *cp, u16 size)
{
int status = -ENODEV;
mutex_lock(&dev->mutex);
if (dev->usbdev) {
status = usb_control_msg(dev->usbdev,
usb_rcvctrlpipe(dev->usbdev, 0),
request,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
... | false | false | false | false | false | 0 |
process( std::string name_, const ssize_t argc, const char **argv )
{
modifyImage();
size_t status =
InvokeDynamicImageFilter( name_.c_str(), &image(), argc, argv,
&image()->exception );
if (status == false)
throwException( image()->exception );
} | false | false | false | false | false | 0 |
setTransformType(const TransformType &type)
{
if (type == d_ptr->transType)
return;
d_ptr->transType = type;
emit transformTypeChanged(type);
} | false | false | false | false | false | 0 |
btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_path *path,
const char *name, int name_len,
u64 inode_objectid, u64 ref_objectid, int ins_len,
int cow)
{
int ret;
struct btrfs_key key;
struct btrfs_inode_extref *extref;
key.objectid = inode... | false | false | false | false | false | 0 |
align_to_column(chunk_t *pc, int column)
{
if (column == pc->column)
{
return;
}
LOG_FMT(LINDLINE, "%s: %d] col %d on %.*s [%s] => %d\n",
__func__, pc->orig_line, pc->column, pc->len, pc->str,
get_token_name(pc->type), column);
int col_delta = column - pc->column;
int min... | false | false | false | false | false | 0 |
max_error_bound()
{
if (mode_!=estimate_condition && mode_ != estimate_condition_verbose)
return 0;
if (!factored_)
{
spFactor(pmatrix_);
if (!est_condition())
return 0;
factored_ = true;
}
double roundoff = spRoundoff(pmatrix_, largest_);
if (rcond_>0)
return roundoff/rcond_;
r... | false | false | false | false | false | 0 |
RPCEvaluate( double *padfTerms, double *padfCoefs )
{
double dfSum = 0.0;
int i;
for( i = 0; i < 20; i++ )
dfSum += padfTerms[i] * padfCoefs[i];
return dfSum;
} | false | false | false | false | false | 0 |
size_request (GtkWidget *widget,
GtkRequisition *requisition,
BonoboDockItem *dock_item)
{
GtkBin *bin;
GtkRequisition child_requisition;
bin = GTK_BIN (widget);
/* If our child is not visible, we still request its size, since
we won't have any useful hint for our size otherwise. */... | 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.