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 |
|---|---|---|---|---|---|---|
start(const Cgu::Callback::Callback* cb, bool joinable) {
// take ownership of the first argument
std::auto_ptr<Cgu::Callback::Callback> cb_a(const_cast<Cgu::Callback::Callback*>(cb));
std::auto_ptr<Thread> return_val;
// set joinable attribute
int detach_state;
if (joinable) detach_state = PTHREAD_CREAT... | false | false | false | false | false | 0 |
dvcman_init(IWTSVirtualChannelManager* pChannelMgr)
{
DVCMAN* dvcman = (DVCMAN*)pChannelMgr;
int i;
IWTSPlugin* pPlugin;
for (i = 0; i < dvcman->num_plugins; i++)
{
pPlugin = dvcman->plugins[i];
if (pPlugin->Initialize)
pPlugin->Initialize(pPlugin, pChannelMgr);
}
return 0;
} | false | false | false | false | false | 0 |
cosm1(x)
double x;
{
double xx;
if( (x < -PIO4) || (x > PIO4) )
return( cos(x) - 1.0 );
xx = x * x;
xx = -0.5*xx + xx * xx * polevl( xx, coscof, 6 );
return xx;
} | false | false | false | false | false | 0 |
usb_driver_release_interface(struct usb_driver *driver,
struct usb_interface *iface)
{
struct device *dev = &iface->dev;
/* this should never happen, don't release something that's not ours */
if (!dev->driver || dev->driver != &driver->drvwrap.driver)
return;
/* don't release from within disconnect() */
... | false | false | false | false | false | 0 |
doApply()
{
NodeImpl *firstChild = m_fragment->firstChild();
NodeImpl *lastChild = m_fragment->lastChild();
Selection selection = endingSelection();
// Delete the current selection, or collapse whitespace, as needed
if (selection.state() == Selection::RANGE)
deleteSelection();
else
... | false | false | false | false | false | 0 |
_gftpui_common_trans_file_or_dir (gftp_transfer * tdata)
{
gftp_file * curfle;
int ret;
if (g_thread_supported ())
g_static_mutex_lock (&tdata->structmutex);
curfle = tdata->curfle->data;
tdata->current_file_number++;
if (g_thread_supported ())
g_static_mutex_unlock (&tdata->structmutex);
if (... | false | false | false | false | false | 0 |
findMatchingHeader(const std::string& absPath,
const std::string& mocSubDir,
const std::string& basename,
const std::vector<std::string>& headerExtensions)
{
std::string header;
for(std::vector<std::string>::co... | false | false | false | false | false | 0 |
main (int ac, char **av)
{
unsigned long seed = 0; /* Random # seed */
/* parameters setup */
while (--ac > 0){
av++;
if (HDstrcmp("-fsize", *av)==0){
/* specify a different family file size */
ac--; av++;
if (ac > 0) {
family... | false | false | false | false | false | 0 |
au_sysrq_init(void)
{
int err;
char key;
err = -1;
key = *aufs_sysrq_key;
if ('a' <= key && key <= 'z')
err = register_sysrq_key(key, &au_sysrq_op);
if (unlikely(err))
pr_err("err %d, sysrq=%c\n", err, key);
return err;
} | false | false | false | false | false | 0 |
evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype)
{
int ret = -1;
Evas_Object_Textblock *o;
if (!cur) return -1;
o = (Evas_Object_Textblock *)(cur->obj->object_data)... | false | false | false | false | false | 0 |
heap_redo(XLogRecPtr lsn, XLogRecord *record)
{
uint8 info = record->xl_info & ~XLR_INFO_MASK;
switch (info & XLOG_HEAP_OPMASK)
{
case XLOG_HEAP_INSERT:
heap_xlog_insert(lsn, record);
break;
case XLOG_HEAP_DELETE:
heap_xlog_delete(lsn, record);
break;
case XLOG_HEAP_UPDATE:
heap_xlog_update(ls... | false | false | false | false | false | 0 |
gsb_account_new ( kind_account account_type,
gint currency_number,
gint bank_number,
gsb_real init_amount,
const gchar *name,
gchar *name_icon )
{
gint account_number;
/* create the new account */
account_number = gsb_data_account_new (account_type);
if ( acc... | false | false | false | false | false | 0 |
copyjob(const jobno_t jobnum)
{
int ch;
FILE *ifd, *ofd;
char *nam = mkspid(SPNAM, jobnum);
char path[PATH_MAX];
if (!(ifd = fopen(nam, "r")))
return 0;
sprintf(path, "%s/%s", popts.outdir, nam);
if (!(ofd = fopen(path, "w"))) {
fclose(ifd);
return 0;
}
while ((ch = getc(ifd)) != EOF)
putc(ch, o... | false | false | false | false | false | 0 |
FindFreeMpqSpace(TMPQArchive * ha, ULONGLONG * pFreeSpacePos)
{
TMPQHeader * pHeader = ha->pHeader;
TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
TFileEntry * pFileEntry = ha->pFileTable;
ULONGLONG FreeSpacePos = ha->pHeader->dwHeaderSize;
DWORD dwChunkCount;
// Par... | false | false | false | false | false | 0 |
FRenderCreateShadePicture(
Display *dpy, Window win, int alpha_percent)
{
static Pixmap shade_pixmap = None;
static FRenderPicture shade_picture = None;
static int saved_alpha_percent = 0;
Bool force_update = False;
FRenderColor frc;
if (!XRenderSupport || !FRenderGetExtensionSupported())
{
return 0;
}
/*... | false | false | false | false | false | 0 |
ownerRule() const
{
if( !m_parent ) return 0;
if( m_parent->isRule() ) return static_cast<CSSRuleImpl *>(m_parent);
return 0;
} | false | false | false | false | false | 0 |
AnnounceDisconnection()
{
if(!mCC->bFilePlayer && mCC->bConnected) {
// sent a disconnect message to any ports we're linked to
LinkedNode *pLink = pTransmitters;
mCC->bConnected = FALSE;
ConferenceClients--;
while(pLink != NULL) {
if(pLink->pTx->ConnectAnnouncements &&
... | false | false | false | false | false | 0 |
get_cheapest_path_for_pathkeys(List *paths, List *pathkeys,
CostSelector cost_criterion)
{
Path *matched_path = NULL;
ListCell *l;
foreach(l, paths)
{
Path *path = (Path *) lfirst(l);
/*
* Since cost comparison is a lot cheaper than pathkey comparison, do
* that first. (XXX is that sti... | false | false | false | false | false | 0 |
visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
ulong nbytes)
{
int err;
int bufsize = PAGE_SIZE;
int written = 0;
u8 *buf;
buf = (u8 *)__get_free_page(GFP_KERNEL);
if (!buf)
return -ENOMEM;
memset(buf, ch, bufsize);
while (nbytes > 0) {
int thisbytes = bufsize;
if (nbytes <... | false | false | false | false | false | 0 |
gda_holder_take_static_value (GdaHolder *holder, const GValue *value, gboolean *value_changed,
GError **error)
{
GValue *retvalue;
g_return_val_if_fail (GDA_IS_HOLDER (holder), FALSE);
g_return_val_if_fail (holder->priv, FALSE);
gda_holder_lock ((GdaLockable*) holder);
retvalue = real_gda_holder_set_cons... | false | false | false | false | false | 0 |
alarm_list_window_show (AlarmListWindow *list_window)
{
// Let the WM decide the initial position of the window (probably not 0,0)
gboolean first_time = !gtk_widget_get_realized (GTK_WIDGET (list_window->window));
gtk_window_present_with_time (list_window->window, gtk_get_current_event_time());
if (!fi... | false | false | false | false | false | 0 |
decompress8x4(unsigned char *pOut,
unsigned char *pIn,
int *lastDC,
int uvFlag,
struct comp_info *cinfo)
{
int i, x, y, dc;
int coeffs[32];
int deZigZag[32];
int *dest;
int *src;
unsigned char *qt = cinfo->qt;
if (!uvFlag) {
huffmanDecoderY(coeffs, (int *)pIn, cinfo);
/* iDPCM and dequantize firs... | false | false | false | false | false | 0 |
_slurm_vfcntl(int fd, int cmd, va_list va )
{
long arg ;
switch ( cmd )
{
case F_GETFL :
return fcntl ( fd , cmd ) ;
break ;
case F_SETFL :
arg = va_arg ( va , long ) ;
return fcntl ( fd , cmd , arg) ;
break ;
default :
return SLURM_PROTOCOL_ERROR ;
break ;
}
} | false | false | false | false | false | 0 |
Reset()
{
wxCriticalSectionLocker lock(m_sync);
m_summed_latency = 0;
m_measurements = 0;
m_start = wxDateTime();
} | false | false | false | false | false | 0 |
libfvalue_value_get_data(
libfvalue_value_t *value,
uint8_t **data,
size_t *data_size,
int *encoding,
libcerror_error_t **error )
{
libfvalue_internal_value_t *internal_value = NULL;
static char *function = "libfvalue_value_get_data";
if( value == NULL )
{
libcerror_... | false | false | false | false | false | 0 |
getsock_tcp_windowsize( int inSock, int inSend ) {
int theTCPWin = 0;
#ifdef SO_SNDBUF
int rc;
Socklen_t len;
/* send buffer -- query for buffer size */
len = sizeof( theTCPWin );
if ( inSend ) {
rc = getsockopt( inSock, SOL_SOCKET, SO_SNDBUF,
(char*) &theTCPWi... | false | false | false | false | false | 0 |
Render(vtkRenderer *ren, vtkVolume *vol)
{
ren->GetRenderWindow()->MakeCurrent();
if ( !this->Initialized )
{
this->Initialize(ren);
}
if ( this->RenderMethod == vtkVolumeTextureMapper3D::NO_METHOD )
{
vtkErrorMacro( "required extensions not supported" );
return;
}
vtkM... | false | false | false | false | false | 0 |
generateEvalCode(CompileState* comp)
{
Classification classify;
size_t index = classifyVariable(comp, classify);
OpValue out;
OpValue varName = OpValue::immIdent(&ident);
switch (classify) {
case Local: {
// Register read.
out = comp->localReadVal(index);
break;
}
... | false | false | false | false | false | 0 |
collectConnectionPath(const optional<ID_t> &, const KEYSize &size, const double middleX, const double middleY)
{
if (m_collecting)
m_currentPath = makeConnectionPath(size, middleX, middleY);
} | false | false | false | false | false | 0 |
fireworkx_event (Display *dpy, Window window, void *closure, XEvent *event)
{
struct state *st = (struct state *) closure;
if (event->type == ButtonPress)
{
recycle_oldest(st, event->xbutton.x, event->xbutton.y);
return True;
}
return False;
} | false | false | false | false | false | 0 |
insert_dir_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *dir,
char *date)
{
strip_trailing_junk(dir);
if (*rx->JobIds == 0) {
ua->error_msg(_("No JobId specified cannot continue.\n"));
return false;
} else {
Mmsg(rx->query, uar_jobid_fileinde... | false | false | false | false | false | 0 |
searchSuccBBs(MachineBasicBlock &MBB, Iter Slot) const {
if (DisableSuccBBSearch)
return false;
MachineBasicBlock *SuccBB = selectSuccBB(MBB);
if (!SuccBB)
return false;
RegDefsUses RegDU(*MBB.getParent()->getSubtarget().getRegisterInfo());
bool HasMultipleSuccs = false;
BB2BrMap BrMap;
std::un... | false | false | false | false | false | 0 |
bnx2x_power_sfp_module(struct link_params *params,
struct bnx2x_phy *phy,
u8 power)
{
struct bnx2x *bp = params->bp;
DP(NETIF_MSG_LINK, "Setting SFP+ power to %x\n", power);
switch (phy->type) {
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727:
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8722:
bnx2x_8727_powe... | false | false | false | false | false | 0 |
try_corosync(int command, enum cluster_type_e stack)
{
int rc = 0;
int quorate = 0;
uint32_t quorum_type = 0;
unsigned int nodeid = 0;
cpg_handle_t c_handle = 0;
quorum_handle_t q_handle = 0;
mainloop_io_t *ipc = NULL;
GMainLoop *amainloop = NULL;
struct ipc_client_callbacks node_c... | false | false | false | false | false | 0 |
load_volume_events( binistream *f, CVoiceData &voice )
{
int16 const number_of_volume_events = f->readInt( 2 );
TVolumeEvents &volume_events = voice.volume_events;
volume_events.reserve( number_of_volume_events );
for(int i=0; i<number_of_volume_events; ++i)
{
SVolumeEvent event;
... | false | false | false | false | false | 0 |
mime_exec (mime_var_t * obj, char *fifo)
{
int pid;
char *av[4];
char *type, *filename, *name;
char *c;
int fh;
struct sigaction new_action;
pid = fork ();
if (pid == -1)
{
empty_stdin ();
die_with_message (NULL, NULL, g_err_msg[E_SUBSHELL_FAIL]);
}
if (pid == 0)
{
... | true | true | false | false | true | 1 |
brasero_split_dialog_reset_clicked_cb (GtkButton *button,
BraseroSplitDialog *self)
{
BraseroSplitDialogPrivate *priv;
priv = BRASERO_SPLIT_DIALOG_PRIVATE (self);
if (!brasero_split_dialog_clear_confirm_dialog (self,
_("Do you really want to empty the slices preview?"),
GTK_STOCK_CANCEL,
... | false | false | false | false | false | 0 |
reader0_initialize_filp_1 (ats_ref_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp2) ;
ATSlocal (ats_ptr_type, tmp4) ;
ATSlocal (ats_ptr_type, tmp6) ;
__ats_lab_reader0_initialize_filp_1:
#line 84 "libatsdoc_reader.dats"
tmp4 = __ats_fun_2_closure_make (arg1) ;
#line 87 "libatsdoc_reader.dats"... | false | false | false | false | false | 0 |
slurmdb_report_set_start_end_time(time_t *start, time_t *end)
{
time_t my_time = time(NULL);
time_t temp_time;
struct tm start_tm;
struct tm end_tm;
int sent_start = (*start), sent_end = (*end);
// info("now got %d and %d sent", (*start), (*end));
/* Default is going to be the last day */
if(!sent_end) {
if(!... | false | false | false | false | false | 0 |
smtp_ehlo_recv(SMTPSession *session, const gchar *msg)
{
if (strncmp(msg, "250", 3) == 0) {
const gchar *p = msg;
p += 3;
if (*p == '-' || *p == ' ') p++;
if (g_ascii_strncasecmp(p, "AUTH", 4) == 0) {
p += 5;
if (strcasestr(p, "PLAIN"))
session->avail_auth_type |= SMTPAUTH_PLAIN;
if (strcasestr(p,... | false | false | false | false | false | 0 |
receive_uuids(struct drbd_connection *connection, struct packet_info *pi)
{
struct drbd_peer_device *peer_device;
struct drbd_device *device;
struct p_uuids *p = pi->data;
u64 *p_uuid;
int i, updated_uuids = 0;
peer_device = conn_peer_device(connection, pi->vnr);
if (!peer_device)
return config_unknown_volume... | false | false | false | false | false | 0 |
restore( int number, bool show )
{
if ( !canBeRestored( number ) )
return false;
KConfig *config = kapp->sessionConfig();
if ( readPropertiesInternal( config, number ) ){
if ( show )
KMainWindow::show();
return false;
}
return false;
} | false | false | false | false | false | 0 |
CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert)
{
if (ri->type != CMS_RECIPINFO_TRANS)
{
CMSerr(CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP,
CMS_R_NOT_KEY_TRANSPORT);
return -2;
}
return cms_SignerIdentifier_cert_cmp(ri->d.ktri->rid, cert);
} | false | false | false | false | false | 0 |
skk_util_convert_by_input_mode (const gchar* str, SkkInputMode input_mode) {
gchar* result = NULL;
SkkInputMode _tmp0_;
g_return_val_if_fail (str != NULL, NULL);
_tmp0_ = input_mode;
switch (_tmp0_) {
case SKK_INPUT_MODE_HIRAGANA:
{
const gchar* _tmp1_;
gchar* _tmp2_ = NULL;
_tmp1_ = str;
_tmp2_ = ... | false | false | false | false | false | 0 |
dm_get(struct mapped_device *md)
{
atomic_inc(&md->holders);
BUG_ON(test_bit(DMF_FREEING, &md->flags));
} | false | false | false | false | false | 0 |
sas_deform_port(struct asd_sas_phy *phy, int gone)
{
struct sas_ha_struct *sas_ha = phy->ha;
struct asd_sas_port *port = phy->port;
struct sas_internal *si =
to_sas_internal(sas_ha->core.shost->transportt);
struct domain_device *dev;
unsigned long flags;
if (!port)
return; /* done by a phy event */
dev ... | false | false | false | false | false | 0 |
Hbitseek(int32 bitid, int32 byte_offset, intn bit_offset)
{
CONSTR(FUNC, "Hbitseek"); /* for HERROR */
bitrec_t *bitfile_rec; /* access record */
int32 seek_pos; /* position of block to seek to */
int32 read_size; /* number of bytes to read into buffer */
int32 n;... | false | false | false | false | false | 0 |
FCEU_DrawInput(uint8 *buf)
{
int x;
for(x=0;x<2;x++)
if(JPorts[x]->Draw)
JPorts[x]->Draw(x,buf,JPAttrib[x]);
if(FCExp)
if(FCExp->Draw)
FCExp->Draw(buf,JPAttribFC);
} | false | false | false | false | false | 0 |
smsc75xx_rx_csum_offload(struct usbnet *dev, struct sk_buff *skb,
u32 rx_cmd_a, u32 rx_cmd_b)
{
if (!(dev->net->features & NETIF_F_RXCSUM) ||
unlikely(rx_cmd_a & RX_CMD_A_LCSM)) {
skb->ip_summed = CHECKSUM_NONE;
} else {
skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT));
skb->ip_summed = C... | false | false | false | false | false | 0 |
lcc_msm8960_probe(struct platform_device *pdev)
{
u32 val;
struct regmap *regmap;
regmap = qcom_cc_map(pdev, &lcc_msm8960_desc);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
/* Use the correct frequency plan depending on speed of PLL4 */
regmap_read(regmap, 0x4, &val);
if (val == 0x12) {
slimbus_src.freq_tb... | false | false | false | false | false | 0 |
ns83820_reset(struct nic *nic)
{
unsigned i;
DBG("ns83820_reset\n");
writel(0, ns->base + PQCR);
ns83820_setup_rx(nic);
for (i = 0; i < NR_TX_DESC; i++) {
tx_ring[i].link = 0;
tx_ring[i].bufptr = 0;
tx_ring[i].cmdsts = cpu_to_le32(0);
tx_ring[i].extsts = cpu_to_le32(0);
}
ns->tx_idx = 0;
ns->tx_done... | false | false | false | false | false | 0 |
okbutton_cb(Fl_Return_Button *, saveprefs *panel)
{
dbgprintf("Print Button pressed on save prefs panel\n");
if (panel->doTheSaving() == 0) {
// hide the window
panel->hide();
}
return;
} | false | false | false | false | false | 0 |
authenticateDirection(auth_user_request_t * auth_user_request)
{
if (!auth_user_request)
return -2;
if (authenticateUserAuthenticated(auth_user_request))
return 0;
if (auth_user_request->auth_user->auth_module > 0)
return authscheme_list[auth_user_request->auth_user->auth_module - 1].getdirection(auth_us... | false | false | false | false | false | 0 |
perform_delete(char ** args)
{
char *arg;
for (; (arg = *args); args++) {
int ret;
struct jobswanted jw;
struct apispq job;
if (decode_jnum(arg, &jw)) {
html_out_or_err("sbadargs", 1);
exit(E_USAGE);
}
if (gspool_jobfind(gspool_fd, GSPOOL_FLAG_IGNORESEQ, jw.jno, jw.host, &jw.slot, &job)... | false | false | false | false | false | 0 |
mca_pml_bfo_comm_proc_construct(mca_pml_bfo_comm_proc_t* proc)
{
proc->expected_sequence = 1;
proc->ompi_proc = NULL;
proc->send_sequence = 0;
OBJ_CONSTRUCT(&proc->frags_cant_match, opal_list_t);
OBJ_CONSTRUCT(&proc->specific_receives, opal_list_t);
OBJ_CONSTRUCT(&proc->unexpected_frags, opal_li... | false | false | false | false | false | 0 |
qla4xxx_get_mgmt_data(struct scsi_qla_host *ha, uint16_t fw_ddb_index,
uint16_t stats_size, dma_addr_t stats_dma)
{
int status = QLA_SUCCESS;
uint32_t mbox_cmd[MBOX_REG_COUNT];
uint32_t mbox_sts[MBOX_REG_COUNT];
memset(mbox_cmd, 0, sizeof(mbox_cmd[0]) * MBOX_REG_COUNT);
memset(mbox_sts, 0, sizeof(mbox_sts[0]... | false | false | false | false | false | 0 |
hash_table_lookup(char *key_file, time_t *pmtime)
{
int level, split;
uint32_t hash = str_hash(key_file);
size_t bucket;
struct bucket *el;
split = ht.split;
level = ht.level;
bucket = hash & ((1 << level) - 1);
if (bucket < split)
bucket = hash & ((1 << (level + 1)) - 1);
el = ht.bu... | false | false | false | false | false | 0 |
splot_points_realloc (gint nrows_prev, splotd *sp, GGobiData *d)
{
gint i;
vectorf_realloc (&sp->p1d.spread_data, d->nrows);
sp->planar = (gcoords *) g_realloc (sp->planar,
d->nrows * sizeof (gcoords));
sp->screen = (icoords *) g_realloc (sp->screen,
d->nrows * sizeof (icoords));
for (i=nrows_prev;... | false | false | false | false | false | 0 |
append(const FXchar* s){
if(s && s[0]){
register FXint len=length();
register FXint n=strlen(s);
length(len+n);
memcpy(str+len,s,n);
}
return *this;
} | false | false | false | false | true | 1 |
ooGetLocalIPAddress(char * pIPAddrs)
{
int ret;
struct hostent *hp;
struct ast_hostent phost;
char hostname[100];
if(pIPAddrs == NULL)
return -1; /* Need to find suitable return value */
ret = gethostname(hostname, 100);
if(ret == 0)
{
if ((hp = ast_gethostbyname(hostname, &phost)))... | false | false | false | false | false | 0 |
UpdateLookup()
{
if (!this->Lookup)
{
this->Lookup = new vtkStringArrayLookup();
this->Lookup->SortedArray = vtkStringArray::New();
this->Lookup->IndexArray = vtkIdList::New();
}
if (this->Lookup->Rebuild)
{
int numComps = this->GetNumberOfComponents();
vtkIdType numTuples = this->Ge... | false | false | false | false | false | 0 |
fc_find_ema(u32 f_ctl,
struct fc_lport *lport,
struct fc_frame_header *fh)
{
struct fc_exch_mgr_anchor *ema;
u16 xid;
if (f_ctl & FC_FC_EX_CTX)
xid = ntohs(fh->fh_ox_id);
else {
xid = ntohs(fh->fh_rx_id);
if (xid == FC_XID_UNKNOWN)
return list_entry(lport->ema_list.prev,
typeo... | false | false | false | false | false | 0 |
directory_load_state_free (DirectoryLoadState *state)
{
if (state->enumerator) {
if (!g_file_enumerator_is_closed (state->enumerator)) {
g_file_enumerator_close_async (state->enumerator,
0, NULL, NULL, NULL);
}
g_object_unref (state->enumerator);
}
if (state->load_mime_list_hash != NULL) {
i... | false | false | false | false | false | 0 |
to_hex64(PG_FUNCTION_ARGS)
{
uint64 value = (uint64) PG_GETARG_INT64(0);
text *result_text;
char *ptr;
const char *digits = "0123456789abcdef";
char buf[32]; /* bigger than needed, but reasonable */
ptr = buf + sizeof(buf) - 1;
*ptr = '\0';
do
{
*--ptr = digits[value % HEXBASE];
value /= HEXBASE... | false | false | false | false | false | 0 |
set_layer_y_align (ClutterBinLayer *self,
ClutterBinAlignment alignment)
{
ClutterLayoutManager *manager;
ClutterLayoutMeta *meta;
if (self->y_align == alignment)
return;
self->y_align = alignment;
meta = CLUTTER_LAYOUT_META (self);
manager = clutter_layout_meta_get_manager (m... | false | false | false | false | false | 0 |
vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct saa7146_vv *vv = dev->vv_data;
struct v4l2_window *win = &f->fmt.win;
enum v4l2_field field;
int maxw, maxh;
DEB_EE("dev:%p\n", dev);
if (NULL == vv->ov_fb.base) {
... | false | false | false | false | false | 0 |
R3Splits(const R3Plane& plane, const R3Triangle& triangle)
{
// Result values:
// 0 = on, 1 = below, 2 = above, 3 = crossing
int result = 0;
// Classify triangle with respect to plane
for (int i = 0; i < 3; i++) {
RNScalar d = R3SignedDistance(plane, triangle.Vertex(i)->Position());
if (!(result ... | false | false | false | false | false | 0 |
fuse_readv_resume (fuse_state_t *state)
{
gf_log ("glusterfs-fuse", GF_LOG_TRACE,
"%"PRIu64": READ (%p, size=%zu, offset=%"PRIu64")",
state->finh->unique, state->fd, state->size, state->off);
FUSE_FOP (state, fuse_readv_cbk, GF_FOP_READ, readv, state->fd,
... | false | false | false | false | false | 0 |
rpc_reason_string_translated(int reason) {
switch (reason) {
case RPC_REASON_USER_REQ: return _("Requested by user");
case RPC_REASON_NEED_WORK: return _("To fetch work");
case RPC_REASON_RESULTS_DUE: return _("To report completed tasks");
case RPC_REASON_TRICKLE_UP: return _("To send trickle-up mes... | false | false | false | false | false | 0 |
setup_enum_page(void){
char *zText;
const char *zEnum;
int nRow;
const char *zTitle;
const char *zName;
/* The user must be at least the administrator in order to see
** this screen.
*/
login_check_credentials();
if( !g.okAdmin ){
login_needed();
return;
}
/* What type of enumeration a... | false | false | false | false | false | 0 |
_trimBelow(SPObject *limit) {
while ( !_hierarchy.empty() && _hierarchy.front().object != limit ) {
SPObject *object=_hierarchy.front().object;
sp_object_ref(object, NULL);
_detach(_hierarchy.front());
_hierarchy.pop_front();
_removed_signal.emit(object);
sp_object_un... | false | false | false | false | false | 0 |
cavan_xml_tag_free(struct cavan_xml_tag *tag)
{
struct cavan_xml_attribute *attr = tag->attr;
while (attr)
{
struct cavan_xml_attribute *next = attr->next;
cavan_xml_attribute_free(attr);
attr = next;
}
if (tag->name && (tag->flags & CAVAN_XML_FLAG_NAME_ALLOC))
{
free((char *) tag->name);
}
if (tag-... | false | false | false | false | false | 0 |
qed_mcp_get_shmem_proto(struct qed_hwfn *p_hwfn,
struct public_func *p_info,
enum qed_pci_personality *p_proto)
{
int rc = 0;
switch (p_info->config & FUNC_MF_CFG_PROTOCOL_MASK) {
case FUNC_MF_CFG_PROTOCOL_ETHERNET:
*p_proto = QED_PCI_ETH;
break;
default:
rc = -EINVAL;
}
return rc;
} | false | false | false | false | false | 0 |
mpl_set_bit(mp_int *a, mp_size bitNum, mp_size value)
{
mp_size ix;
mp_err rv;
mp_digit mask;
ARGCHK(a != NULL, MP_BADARG);
ix = bitNum / MP_DIGIT_BIT;
if (ix + 1 > MP_USED(a)) {
rv = s_mp_pad(a, ix + 1);
if (rv != MP_OKAY)
return rv;
}
bitNum = bitNum % MP_DIGIT_BIT;
m... | false | false | false | false | false | 0 |
rdu_ent_compar_wh1(const void *_a, const void *_b)
{
int ret;
const struct au_rdu_ent *a = _a, *b = _b;
if (a->nlen <= AUFS_WH_PFX_LEN
|| memcmp(a->name, AUFS_WH_PFX, AUFS_WH_PFX_LEN))
ret = strcmp(a->name, b->name + AUFS_WH_PFX_LEN);
else
ret = strcmp(a->name + AUFS_WH_PFX_LEN, b->name);
/* DPri("%s, %... | false | false | false | false | false | 0 |
qbargME(vector<SpinorBarWaveFunction> & ain,
vector<VectorWaveFunction> & gin,
vector<VectorWaveFunction> & pout,
vector<SpinorWaveFunction> & aout,
bool calc) const {
// the particles should be in the order
// for the incoming
// 0 incoming fermion (vbar spinor) ... | false | false | false | false | false | 0 |
makeSubStream(Goffset startA, GBool limitedA,
Goffset lengthA, Object *dictA) {
return new FileStream(file, startA, limitedA, lengthA, dictA);
} | false | false | false | false | false | 0 |
git_repository_open_ext(
git_repository **repo_ptr,
const char *start_path,
uint32_t flags,
const char *ceiling_dirs)
{
int error;
git_buf path = GIT_BUF_INIT, parent = GIT_BUF_INIT;
git_repository *repo;
*repo_ptr = NULL;
if ((error = find_repo(&path, &parent, start_path, flags, ceiling_dirs)) < 0)
return... | false | false | false | false | false | 0 |
enter(char untilExitFlag)
{
if( active_flag )
return;
refresh_flag = 1;
active_flag = 1;
memset(game_menu_option_flag, 1, sizeof(game_menu_option_flag) );
if( !nation_array.player_recno)
{
// when in observe mode
game_menu_option_flag[1] = 0; // disable save game
game_men... | false | false | false | false | false | 0 |
rmi_populate_f30(struct hid_device *hdev)
{
struct rmi_data *data = hid_get_drvdata(hdev);
u8 buf[20];
int ret;
bool has_gpio, has_led;
unsigned bytes_per_ctrl;
u8 ctrl2_addr;
int ctrl2_3_length;
int i;
/* function F30 is for physical buttons */
if (!data->f30.query_base_addr) {
hid_err(hdev, "No GPIO/LEDs... | false | false | false | false | false | 0 |
ReplaceAllOpts(string opt, string val, vector<opt_pair> *in_vec) {
opt_pair optp;
optp.opt = StrLower(opt);
optp.val = val;
for (unsigned int x = 0; x < in_vec->size(); x++) {
if ((*in_vec)[x].val == optp.val) {
in_vec->erase(in_vec->begin() + x);
x--;
continue;
}
}
in_vec->push_back(optp);
} | false | false | false | false | false | 0 |
printMath(const string& section, list<string>& field, ostream& docout)
{
if (field.size() > 0) {
docout << section;
docout << "\\begin{displaymath}" << endl;
list<string>::iterator s;
for (s = field.begin(); s != field.end(); ++s) {
docout << *s << endl;
}
docout << "\\end{displaymath}" << endl;
doc... | false | false | false | false | false | 0 |
runlength(byte *out, byte *in, int length)
{
byte *p_in = in, *p_out = out, *p_end;
int count, climit, contflag;
p_end = p_in + length;
while(p_in < p_end) {
/* loop until 3 same data found */
count = 0;
climit = min(128, p_end - p_in);
for( ; count < climit; count++, p... | false | true | false | false | false | 1 |
add_intersecting_rect(struct mame_bitmap *dstbitmap, const struct rectangle *dstbounds, struct mame_bitmap *srcbitmap, const struct rectangle *srcbounds)
{
struct rectangle sect = *srcbounds;
int x, y, width;
/* compute the intersection and resulting width */
sect_rect(§, dstbounds);
width = sect.max_x... | false | false | false | false | false | 0 |
CDB___db_metaend(dbp, lockp, commit, callback, cookie)
DB *dbp;
DB_LOCK *lockp;
int commit, (*callback) __P((DB *, void *));
void *cookie;
{
DB_ENV *dbenv;
int ret, t_ret;
dbenv = dbp->dbenv;
/* End the transaction. */
if (commit) {
if ((ret = CDB_txn_commit(dbp->open_txn, DB_TXN_SYNC)) == 0) {
/*
*... | false | false | false | false | false | 0 |
wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[])
{
u32 val;
int ret;
wl1271_debug(DEBUG_TESTMODE, "testmode cmd set plt mode");
if (!tb[WL1271_TM_ATTR_PLT_MODE])
return -EINVAL;
val = nla_get_u32(tb[WL1271_TM_ATTR_PLT_MODE]);
switch (val) {
case PLT_OFF:
ret = wl1271_plt_stop(wl);
bre... | false | false | false | false | false | 0 |
uih_setfont(struct uih_context *uih)
{
if (catalog != NULL && find_text(catalog, "encoding")
&& find_text(catalog, "encoding")[0] == '2')
uih->encoding = 2;
else
uih->encoding = 1;
if (uih->image->flags & AAIMAGE)
uih->font = &xaafont;
else {
if (uih->encoding == 2) {
// A better heuristics wo... | false | false | false | false | false | 0 |
hasTransparency() const
{
AttributeSeq os;
iCascade->allNames(EOpacity, os);
for (uint i = 0; i < os.size(); ++i) {
Attribute val = iCascade->find(EOpacity, os[i]);
if (val != Attribute::ONE())
return true;
}
return false;
} | false | false | false | false | false | 0 |
trans(src_file)
char *src_file;
{
char *cname;
char buf[MaxPath]; /* file name construction buffer */
char *buf_ptr;
char *s;
struct fileparts *fp;
struct tdefnm *td;
struct token *t;
static char *test_largeints = "#ifdef LargeInts\nyes\n#endif\n";
static int first_time = 1;
cur_src =... | false | false | true | false | true | 1 |
sd_write_long_data(struct realtek_pci_sdmmc *host,
struct mmc_request *mrq)
{
struct rtsx_pcr *pcr = host->pcr;
struct mmc_host *mmc = host->mmc;
struct mmc_card *card = mmc->card;
struct mmc_command *cmd = mrq->cmd;
struct mmc_data *data = mrq->data;
int uhs = mmc_card_uhs(card);
u8 cfg2;
int err;
size_t dat... | false | false | false | false | false | 0 |
_setCheckItemValue(tControl item, tCheckState value,
tOperation op /* = op_UICHANGE */)
{
UT_return_if_fail (item <= m_vecProperties.getItemCount());
sControlData * pItem = _getPropertyItem (item);
UT_return_if_fail (pItem);
pItem->setData (value);
if ((op == op_UICHANGE) || (op == op_SYNC))
pItem-... | false | false | false | false | false | 0 |
get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size)
{
int id;
id = get_le16(pb);
codec->codec_type = CODEC_TYPE_AUDIO;
codec->codec_tag = id;
codec->channels = get_le16(pb);
codec->sample_rate = get_le32(pb);
codec->bit_rate = get_le32(pb) * 8;
codec->block_align = get_le... | false | false | false | false | false | 0 |
OP_ORR_ROR_REG(armcpu_t *cpu)
{
u32 i = cpu->instruction;
ROR_REG;
OP_ORR(2, 4);
} | false | false | false | false | false | 0 |
test_rebase_merge__commit_drops_already_applied(void)
{
git_rebase *rebase;
git_reference *branch_ref, *upstream_ref;
git_annotated_commit *branch_head, *upstream_head;
git_rebase_operation *rebase_operation;
git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
git_oid commit_id;
int error;
checkout... | false | false | false | false | false | 0 |
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__EditBox_NotifyActivate__00000013(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * control, unsigned int active, struct __ecereNameSpace__ecere__com__Instance * previous)
{
struct __ecereNameSpace__ecere__gui__di... | false | false | false | false | false | 0 |
contains_pseudo (x)
rtx x;
{
const char *fmt;
int i;
if (GET_CODE (x) == SUBREG)
x = SUBREG_REG (x);
if (GET_CODE (x) == REG)
{
if (REGNO (x) >= FIRST_PSEUDO_REGISTER)
return 1;
else
return 0;
}
fmt = GET_RTX_FORMAT (GET_CODE (x));
for (i = GET_RTX_LENGTH (GET_CODE (x)... | false | false | false | false | false | 0 |
L11()
{register object *VOL base=vs_base;
register object *VOL sup=base+VM11; VC11
vs_check;
{VOL object V37;
VOL object V38;
V37=(base[0]);
V38=(base[1]);
vs_top=sup;
goto TTL;
TTL:;
frs_push(FRS_CATCH,((object)VV[0]));
if(nlj_active)
{nlj_active=FALSE;frs_pop();
vs_top=sup;
goto T117;}
else{
base[2]= (... | false | false | false | false | false | 0 |
rech_endtoken(const char *adr, const char **start) {
char quote = '\0';
int length = 0;
while(is_space(*adr))
adr++;
if (*adr == '"' || *adr == '\'')
quote = *adr++;
*start = adr;
while(*adr != 0 && *adr != quote && (quote != '\0' || !is_space(*adr))) {
length++;
adr++;
}
return length;... | false | false | false | false | false | 0 |
getFile(StringRef Filename, std::string *ErrStr,
int64_t FileSize, struct stat *FileInfo) {
SmallString<256> PathBuf(Filename.begin(), Filename.end());
return MemoryBuffer::getFile(PathBuf.c_str(), ErrStr, FileSize, FileInfo);
} | false | false | false | false | false | 0 |
do_tr()
{
if (using_tr_eval()) {
_y[0].x = tr_input_limited();
tr_eval();
}else{
_y[0].x = tr_input(); // tr_involts();
assert(_y[0].f1 == value());
_y[0].f0 = _y[0].x * _y[0].f1;
assert(converged());
}
store_values();
q_load();
trace3("q", _y[0].x, _y[0].f0, _y[0].f1);
_i[0] = di... | 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.