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 |
|---|---|---|---|---|---|---|
g_mime_header_iter_prev (GMimeHeaderIter *iter)
{
GMimeHeader *prev;
g_return_val_if_fail (iter != NULL, FALSE);
/* make sure current cursor is valid */
if (!g_mime_header_iter_is_valid (iter))
return FALSE;
/* make sure prev item is valid */
prev = iter->cursor->prev;
if (!prev || !prev->prev)
return ... | false | false | false | false | false | 0 |
mainloop_trigger_complete(crm_trigger_t * trig)
{
crm_trace("Trigger handler %p complete", trig);
trig->running = FALSE;
} | false | false | false | false | false | 0 |
lookupStableName(StgPtr p)
{
StgWord res;
initStablePtrTable();
ACQUIRE_LOCK(&stable_mutex);
res = lookupStableName_(p);
RELEASE_LOCK(&stable_mutex);
return res;
} | false | false | false | false | false | 0 |
_nl_init_alt_digit (struct __locale_data *current)
{
struct lc_time_data *data;
if (current->private.time == NULL)
{
current->private.time = malloc (sizeof *current->private.time);
if (current->private.time == NULL)
return;
memset (current->private.time, 0, sizeof *current->private.time);
... | false | false | false | false | false | 0 |
asc7621_update_device(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct asc7621_data *data = i2c_get_clientdata(client);
int i;
/*
* The asc7621 chips guarantee consistent reads of multi-byte values
* regardless of the order of the reads. No special logic is needed
* so we can just re... | false | false | false | false | false | 0 |
tab_completion_new_with_history(GtkWidget **entry, const gchar *text,
const gchar *history_key, gint max_levels,
void (*enter_func)(const gchar *, gpointer), gpointer data)
{
GtkWidget *box;
GtkWidget *combo;
GtkWidget *combo_entry;
GtkWidget *button;
GList *work;
TabCompData *td;
gint n = 0;
b... | false | false | false | false | false | 0 |
getSeqName(int seqNo)
{
if( (seqNo >= getSequenceNumber()) || (seqNo<0) )
throw new IndexOutOfRangeException("No such sequence.");
return seqNames[seqNo];
} | false | false | false | false | false | 0 |
buildin_areawarp(struct script_state *st)
{
int x,y,m;
char *mapname, *str;
int x0,y0,x1,y1;
mapname=conv_str(st,& (st->stack->stack_data[st->start+2]));
x0=conv_num(st,& (st->stack->stack_data[st->start+3]));
y0=conv_num(st,& (st->stack->stack_data[st->start+4]));
x1=conv_num(st,& (st->stack->stack_data[st->st... | false | false | false | false | false | 0 |
get_dacs_buf_config(request_rec *r)
{
dacs_buf_config *bc_rec;
bc_rec = (dacs_buf_config *) ap_get_module_config(r->request_config,
&auth_dacs_module);
if (bc_rec == NULL)
bc_rec = init_dacs_buf(r);
return(bc_rec);
} | false | false | false | false | false | 0 |
test_book_increment_and_format_counter ( Fixture *fixture, gconstpointer pData )
{
const char *counter_name = "Counter name";
const char *err_no_book = "No book";
const char *err_invalid_cnt = "Invalid counter name";
gchar *format;
gchar *r;
gint64 counter;
/* need this as long as we have f... | false | false | false | false | false | 0 |
libnet_build_ip(u_short len, u_char tos, u_short id, u_short frag, u_char ttl,
u_char prot, u_long src, u_long dst, const u_char *payload,
int payload_s, u_char *buf)
{
struct libnet_ip_hdr ip_hdr;
if (!buf)
{
return (-1);
}
ip_hdr.ip_v = 4; ... | false | true | false | false | false | 1 |
of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq)
{
struct device_node *dn, *ppnode;
struct pci_dev *ppdev;
__be32 laddr[3];
u8 pin;
int rc;
/* Check if we have a device node, if yes, fallback to standard
* device tree parsing
*/
dn = pci_device_to_OF_node(pdev);
if (dn) {
rc ... | false | false | false | false | false | 0 |
read_from_stream (char* buffer, std::streamsize length)
{
if (this->stream_ == 0) return -1;
this->stream_->read (buffer, length);
return ACE_Utils::truncate_cast<int> (this->stream_->gcount ());
} | false | false | false | false | false | 0 |
BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValuePairs ¶ms)
{
unsigned long iterations = 0;
clock_t start = clock();
double timeTaken;
do
{
for (unsigned int i=0; i<1024; i++)
c.SetKey(key, keyLength, params);
timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND;
iter... | false | false | false | false | false | 0 |
sigdelread_dsp(t_sigdelread *x, t_signal **sp)
{
t_sigdelwrite *delwriter =
(t_sigdelwrite *)pd_findbyclass(x->x_sym, sigdelwrite_class);
x->x_sr = sp[0]->s_sr * 0.001;
x->x_n = sp[0]->s_n;
if (delwriter)
{
sigdelwrite_updatesr(delwriter, sp[0]->s_sr);
sigdelwrite_checkvecsiz... | false | false | false | false | false | 0 |
go(int location, int dir)
{
ExitEntry *theExit;
bool ok;
Aword oldloc;
theExit = (ExitEntry *) pointerTo(instances[location].exits);
if (instances[location].exits != 0)
while (!isEndOfArray(theExit)) {
if (theExit->code == dir) {
ok = TRUE;
if (theExit->checks != 0) {
if (sectionTra... | false | false | false | false | false | 0 |
iwl_dbgfs_protection_mode_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos) {
struct iwl_priv *priv = file->private_data;
char buf[8];
int buf_size;
int rts;
if (!priv->cfg->ht_params)
return -EINVAL;
memset(buf, 0, sizeof(buf));
buf_size = min(count, sizeof(buf) - ... | true | true | false | false | false | 1 |
finalize()
{
// Pull out metadata, before the no-ops are removed.
for(unsigned int i=0; i<m_cpuOps.size(); ++i)
{
m_cpuOps[i]->dumpMetadata(m_metadata);
}
// GPU Process setup
//
// Partition the original, raw opvec into 3 segments for GPU... | false | false | false | false | false | 0 |
_get_upload_uri_for_query_and_folder (GDataDocumentsUploadQuery *query, GDataDocumentsFolder *folder)
{
if (query == NULL) {
query = gdata_documents_upload_query_new ();
}
if (folder != NULL) {
gdata_documents_upload_query_set_folder (query, folder);
}
return gdata_documents_upload_query_build_uri (query);
} | false | false | false | false | false | 0 |
zoneMeta_cleanup(void)
{
umtx_destroy(&gZoneMetaLock);
if (gCanonicalIDCache != NULL) {
uhash_close(gCanonicalIDCache);
gCanonicalIDCache = NULL;
}
gCanonicalIDCacheInitialized = FALSE;
if (gOlsonToMeta != NULL) {
uhash_close(gOlsonToMeta);
gOlsonToMeta = NULL;
... | false | false | false | false | false | 0 |
g_proxy_mount_operation_handle_ask_password (const gchar *wrapped_id,
const gchar *message,
const gchar *default_user,
const gchar *default_domain,
... | false | false | false | false | false | 0 |
read_line(FILE *f, int *plen)
{
int len;
char *line;
if (!f)
return NULL;
line = fgets(COMMON_buffer, COMMON_BUF_MAX, f);
if (!line)
return NULL;
len = strlen(line);
if (line[len - 1] == '\n')
{
line[len - 1] = 0;
len--;
}
if (plen)
*plen = len;
return line;
} | false | false | false | false | false | 0 |
describe(std::ostream& out) const throw()
{
if (! desc.empty())
out << desc << std::endl;
ledger::balance_t * ptr = NULL;
out << std::right;
out.width(20);
switch (bal->type) {
case ledger::value_t::BOOLEAN:
out << (*((bool *) bal->data) ? "true" : "false");
break;
case ledger::value_t::INT... | false | false | false | false | false | 0 |
rc_gethostbyname(const char *hostname)
{
struct hostent *hp;
#ifdef GETHOSTBYNAME_R
#if defined (GETHOSTBYNAMERSTYLE_SYSV) || defined (GETHOSTBYNAMERSTYLE_GNU)
struct hostent hostbuf;
size_t hostbuflen;
char *tmphostbuf;
int res;
int herr;
hostbuflen = 1024;
tmphostbuf = malloc(hostbuflen);
#endif
#endif
#... | false | false | false | false | false | 0 |
EmitSpecialPropOp(JSContext *cx, JSParseNode *pn, JSOp op, JSCodeGenerator *cg)
{
/*
* Special case for obj.__proto__, obj.__parent__, obj.__count__ to
* deoptimize away from fast paths in the interpreter and trace recorder,
* which skip dense array instances by going up to Array.prototype before
... | false | false | false | false | false | 0 |
InsertHtmlStatementLinkDescription(const unsigned int IDUrl,
const unsigned int TagPosition, const std::string& LinkDescription)
{
std::ostringstream SQLStatement;
if (debug >4)
cout << "Inserting a new Link description into '"
<< MySQLDB << "': tag " << TagPosition << endl;
SQLStatement ... | false | false | false | false | false | 0 |
samples (void)
{
static const struct {
const char *n;
unsigned long k;
const char *want;
} data[] = {
{ "0", 123456, "0" },
{ "1", 543210, "0" },
{ "2", 123321, "0" },
{ "3", 234567, "0" },
{ "10", 23456, "0" },
/* negatives, using bin(-n,k)=bin(n+k-1,k) */
... | false | false | false | false | false | 0 |
mouseLeftPress(UT_sint32 x, UT_sint32 y)
{
if(!isActive())
{
m_iInlineDragMode = FV_InlineDrag_WAIT_FOR_MOUSE_CLICK;
setDragType(x,y,false);
return;
}
if(getImageAPFromXY(x,y) != m_pImageAP)
{
cleanUP();
m_iInlineDragMode = FV_InlineDrag_WAIT_FOR_MOUSE_CLICK;
setDragType(x,y,false);
//
// Se... | false | false | false | false | false | 0 |
ipmi_oem_dell_get_chassis_identify_status (ipmi_oem_state_data_t *state_data)
{
uint8_t bytes_rq[IPMI_OEM_MAX_BYTES];
uint8_t bytes_rs[IPMI_OEM_MAX_BYTES];
uint8_t identify_status;
int rs_len;
int rv = -1;
assert (state_data);
assert (!state_data->prog_data->args->oem_options_count);
/* Dell Powered... | false | false | false | false | false | 0 |
intel_cqm_event_start(struct perf_event *event, int mode)
{
struct intel_pqr_state *state = this_cpu_ptr(&pqr_state);
u32 rmid = event->hw.cqm_rmid;
if (!(event->hw.cqm_state & PERF_HES_STOPPED))
return;
event->hw.cqm_state &= ~PERF_HES_STOPPED;
if (state->rmid_usecnt++) {
if (!WARN_ON_ONCE(state->rmid != r... | false | false | false | false | false | 0 |
__onscreen(cs_engine_t *e, cs_obj_t *o)
{
int gx = CS2PIXEL(o->point.gx);
int gy = CS2PIXEL(o->point.gy);
if((gx + o->w < 0) || (gx > e->w))
return 0;
if((gy + o->h < 0) || (gy > e->h))
return 0;
return 1;
} | false | false | false | false | false | 0 |
slotFrameSelectionChanged()
{
// get the frameClass
QList<QListWidgetItem *> items = m_commonUi->framesList->selectedItems();
if (items.isEmpty())
return;
QListWidgetItem * item = items.first();
quint32 frameClass = item->data(Qt::UserRole).toUInt();
emit applyLook(frameClass, m_content-... | false | false | false | false | false | 0 |
recvfrom_wto(int sock, void *buf, unsigned int len, struct sockaddr *saddr,
u_int *timo)
{
u_int slen;
int n;
struct timeval to, then, now;
fd_set rd, wr;
if(!*timo) {
return 0;
}
to.tv_sec = *timo / 1000000;
to.tv_usec = (*timo - (to.tv_sec * 1000000));
FD_ZERO(&rd);
FD_ZERO(&wr);
FD_SET(sock, &rd)... | false | false | false | false | false | 0 |
cln_read(struct triton_md_handler_t *h)
{
struct tcp_client_t *cln = container_of(h, typeof(*cln), hnd);
int n;
char *d;
while (1) {
n = read(h->fd, cln->cmdline + cln->recv_pos, RECV_BUF_SIZE - 1 - cln->recv_pos);
if (n == 0)
break;
if (n < 0) {
if (errno != EAGAIN)
log_error("cli: read: %s\n", st... | false | false | false | false | false | 0 |
clear_view (GladeEditorProperty * eprop)
{
GladeEPropModelData *eprop_data = GLADE_EPROP_MODEL_DATA (eprop);
GtkTreeViewColumn *column;
/* Clear columns ... */
while ((column = gtk_tree_view_get_column (eprop_data->view, 0)) != NULL)
gtk_tree_view_remove_column (eprop_data->view, column);
/* Clear store... | false | false | false | false | false | 0 |
rpc_clnt_reconnect (void *trans_ptr)
{
rpc_transport_t *trans = NULL;
rpc_clnt_connection_t *conn = NULL;
struct timeval tv = {0, 0};
int32_t ret = 0;
struct rpc_clnt *clnt = NULL;
trans = trans_ptr;
if (!trans ... | false | false | false | false | false | 0 |
clutter_bin_layout_get_preferred_height (ClutterLayoutManager *manager,
ClutterContainer *container,
gfloat for_width,
gfloat *min_height_p,
... | false | false | false | false | false | 0 |
SendPacketToTeam(Team teamId, WorldPacket* packet, Player* sender, bool self)
{
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
if (itr->second.OfflineRemoveTime)
continue;
Player* plr = sObjectMgr.GetPlayer(itr->first);
i... | false | false | false | false | false | 0 |
partition_contains_all_rw (struct graph *rdg,
vec<partition_t> partitions)
{
int i;
partition_t partition;
int nrw = number_of_rw_in_rdg (rdg);
FOR_EACH_VEC_ELT (partitions, i, partition)
if (nrw == number_of_rw_in_partition (rdg, partition))
return true;
return false;
} | false | false | false | false | false | 0 |
resume_thread_internal (MonoInternalThread *thread)
{
if (!mono_thread_info_new_interrupt_enabled ()) {
thread->resume_event = CreateEvent (NULL, TRUE, FALSE, NULL);
if (thread->resume_event == NULL) {
UNLOCK_THREAD (thread);
return FALSE;
}
/* Awake the thread */
SetEvent (thread->suspend_event);
... | false | false | false | false | false | 0 |
screen_update (rp_screen *s, int width, int height)
{
rp_frame *f;
int oldwidth,oldheight;
PRINT_DEBUG (("screen_update(%d,%d)\n", width, height));
if (rp_have_xinerama)
{
/* TODO: how to do this with xinerama? */
return;
}
if (s->width == width && s->height == height)
/* nothing to ... | false | false | false | false | false | 0 |
check_for_end_of_game()
{
int i, j, k, available_moves=0;
set_arrows();
if (stack_count_cards(outcells[0]) == 13 &&
stack_count_cards(outcells[1]) == 13 &&
stack_count_cards(outcells[2]) == 13 &&
stack_count_cards(outcells[3]) == 13)
{
set_centered_pic(youwin);
return;
}
if (hin... | false | false | false | false | false | 0 |
EvaluateInDifferentType(Value *V, Type *Ty,
bool isSigned) {
if (Constant *C = dyn_cast<Constant>(V)) {
C = ConstantExpr::getIntegerCast(C, Ty, isSigned /*Sext or ZExt*/);
// If we got a constantexpr back, try to simplify it with DL info.
if (ConstantExpr *CE =... | false | false | false | false | false | 0 |
build_const_cast (tree type, tree expr, tsubst_flags_t complain)
{
tree r;
if (type == error_mark_node || error_operand_p (expr))
return error_mark_node;
if (processing_template_decl)
{
tree t = build_min (CONST_CAST_EXPR, type, expr);
if (!TREE_SIDE_EFFECTS (t)
&& type_dependent_express... | false | false | false | false | false | 0 |
mail_cache_db_del(struct mail_cache_db * cache_db,
const void * key, size_t key_len)
{
#if DBVERS >= 1
int r;
DBT db_key;
DB * dbp;
dbp = cache_db->internal_database;
memset(&db_key, 0, sizeof(db_key));
db_key.data = (void *) key;
db_key.size = key_len;
#if DBVERS > 1
r = dbp->del(dbp, NU... | false | false | false | false | false | 0 |
dibusb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
if (0 == dvb_usb_device_init(intf, &dibusb1_1_properties,
THIS_MODULE, NULL, adapter_nr) ||
0 == dvb_usb_device_init(intf, &dibusb1_1_an2235_properties,
THIS_MODULE, NULL, adapter_nr) ||
0 == dvb_usb_device_init(in... | false | false | false | false | false | 0 |
__mlx4_qp_reserve_range(struct mlx4_dev *dev, int cnt, int align,
int *base, u8 flags)
{
u32 uid;
int bf_qp = !!(flags & (u8)MLX4_RESERVE_ETH_BF_QP);
struct mlx4_priv *priv = mlx4_priv(dev);
struct mlx4_qp_table *qp_table = &priv->qp_table;
if (cnt > MLX4_MAX_BF_QP_RANGE && bf_qp)
return -ENOMEM;
uid ... | false | false | false | false | false | 0 |
se_startup_response_cb (GtkWidget *widget, int response, gpointer data)
{
GtkTextIter start, end;
switch (response)
{
case 1:
{
char *file = get_config_filename (FILE_STARTUP);
char *tmp = read_entire_file (file, NULL);
if (!tmp && errno != ENOENT)
display_error (FROM_GXINE, _("Couldn't ... | false | false | false | false | false | 0 |
_e2p_find_response_cb (GtkDialog *dialog, gint response, E2_FindDialogRuntime *rt)
{
// printd (DEBUG, "Find plugin dialog response cb, response %d", response);
switch (response)
{
case GTK_RESPONSE_CLOSE:
case GTK_RESPONSE_DELETE_EVENT:
case GTK_RESPONSE_NONE:
pthread_mutex_lock (&find_mutex);
//cancel r... | false | false | false | false | false | 0 |
nfs_lock_and_join_requests(struct page *page, bool nonblock)
{
struct inode *inode = page_file_mapping(page)->host;
struct nfs_page *head, *subreq;
struct nfs_page *destroy_list = NULL;
unsigned int total_bytes;
int ret;
try_again:
total_bytes = 0;
WARN_ON_ONCE(destroy_list);
spin_lock(&inode->i_lock);
/*
... | false | false | false | false | false | 0 |
log (const cl_N& x)
{
// Methode:
// (complex (log (abs x)) (phase x))
var cl_R r = abs(x);
if (zerop(r)) // (abs x) = 0 -> Error
{ throw division_by_0_exception(); }
return complex(ln(r),phase(x));
}
} | false | false | false | false | false | 0 |
writeToFile(const char* pszFileName) const
{
UT_ASSERT(pszFileName && pszFileName[0]);
if (!strncmp (pszFileName, "file://", 7))
pszFileName += 7;
FILE* fp = fopen(pszFileName, "wb");
if (!fp)
{
return false;
}
UT_uint32 iBytesWritten = fwrite(m_pBuf, 1, m_iSize, fp);
if (iBytesWritten != m_iSize)
{
f... | false | false | false | false | false | 0 |
GetValueAsString(Option option,
METAIO_STL::string fieldName)
{
METAIO_STL::string fieldname = fieldName;
if(fieldName == "")
{
fieldname = option.name;
}
METAIO_STL::vector<Field>::const_iterator itField = option.fields.begin();
while(itField != option.fields.end())
{
if((... | false | false | false | false | false | 0 |
photos_query_builder_where (gboolean global, gint flags)
{
PhotosBaseManager *col_mngr;
PhotosBaseManager *srch_typ_mngr;
gchar *col_mngr_where = NULL;
gchar *filter = NULL;
gchar *optional = NULL;
gchar *sparql;
gchar *srch_typ_mngr_where = NULL;
col_mngr = photos_collection_manager_dup_singleton ();
... | false | false | false | false | false | 0 |
convert_ascii_sha1(void *buffer)
{
unsigned char sha1[20];
struct entry *entry;
if (get_sha1_hex(buffer, sha1))
die("expected sha1, got '%s'", (char*) buffer);
entry = convert_entry(sha1);
memcpy(buffer, sha1_to_hex(entry->new_sha1), 40);
} | true | true | false | false | false | 1 |
tuplesort_begin_common(int workMem, bool randomAccess)
{
Tuplesortstate *state;
MemoryContext sortcontext;
MemoryContext oldcontext;
/*
* Create a working memory context for this sort operation. All data
* needed by the sort will live inside this context.
*/
sortcontext = AllocSetContextCreate(CurrentMemory... | false | false | false | false | false | 0 |
us_socket_collection_handle_readable_set( us_socket_collection_t *self,
fd_set const *readable_set,
uint64_t current_time_in_milliseconds )
{
int i;
for ( i = 0; i < self->num_sockets; ++i )
{
int fd = self... | false | false | false | false | false | 0 |
commSetupDoneP()
{
int rcomm = communication & ~d->usePty;
if (rcomm & Stdin)
close(in[0]);
if (rcomm & Stdout)
close(out[1]);
if (rcomm & Stderr)
close(err[1]);
in[0] = out[1] = err[1] = -1;
// Don't create socket notifiers if no interactive comm is to be expected
if (run_mode != NotifyOnExi... | false | false | false | false | false | 0 |
_clutter_actor_handle_event (ClutterActor *self,
const ClutterEvent *event)
{
GPtrArray *event_tree;
ClutterActor *iter;
gboolean is_key_event;
gint i = 0;
/* XXX - for historical reasons that are now lost in the mists of time,
* key events are delivered regardless of wh... | false | false | false | false | false | 0 |
putcursor(c, n)
int c, n;
{
win_x += n;
while (n--) VOID_C XXputch(c);
#ifdef DEP_ORIGSHELL
if (dumbmode);
else if (shellmode && win_x >= n_column) {
VOID_C XXputch(' ');
VOID_C XXputch('\r');
win_x = 0;
win_y++;
}
#endif
} | false | false | false | false | false | 0 |
wil_read_file_ioblob(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
enum { max_count = 4096 };
struct debugfs_blob_wrapper *blob = file->private_data;
loff_t pos = *ppos;
size_t available = blob->size;
void *buf;
size_t ret;
if (pos < 0)
return -EINVAL;
if (pos >= available ... | false | false | false | false | false | 0 |
tlg_has_same_edcond(const Tlg *tlg) {
Boolean flg_edcond;
IntSet (*edcond);
int mt_num;
int i;
mt_num = get_number_of_inner_blocks(tlg->block);
edcond = malloc((mt_num + 1) *sizeof(IntSet));
if (edcond == NULL)
fatal("alloc failed\n");
make_exec_determinating_cond(tlg->block, e... | false | true | false | false | true | 1 |
argv_finish_token(int *argc, char ***argv)
{
if (*argc == ARGV_MAX_ENTRIES - 1)
errx(1, "argv_finish_token: reached max argv entries(%d)", ARGV_MAX_ENTRIES);
if (strlen((*argv)[*argc]) == 0)
return;
*argc = *argc + 1;
if (((*argv)[*argc] = calloc(ARGV_MAX_TOKEN_LEN, sizeof(char))) == NULL)
... | false | false | false | false | false | 0 |
iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct napi_struct *napi,
struct iwl_rx_cmd_buffer *rxb)
{
struct iwl_rx_packet *pkt = rxb_addr(rxb);
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
/*
* Do the notification wait before RX handlers so
* even if the RX handler consumes the RXB we have
... | false | false | false | false | false | 0 |
addPadding( char *string, int startIndent, int toIndent,
int tabDist, int useTabs, char nullSubsChar, int *charsAdded ) {
char * outPtr;
int len, indent;
indent = startIndent;
outPtr = string;
if ( useTabs ) {
while ( indent < toIndent ) {
len = Fl_Text_Buffer::character_wid... | false | false | false | false | false | 0 |
flush_internal (ZStream *stream, gboolean is_final)
{
gint status;
if (!stream->compress)
return 0;
if (!is_final && stream->stream->avail_in != 0) {
status = deflate (stream->stream, Z_PARTIAL_FLUSH);
if (status != Z_OK && status != Z_STREAM_END)
return status;
}
return write_to_managed (stream);
} | false | false | false | false | false | 0 |
gst_value_intersect_array (GValue * dest, const GValue * src1,
const GValue * src2)
{
guint size;
guint n;
GValue val = { 0 };
/* only works on similar-sized arrays */
size = gst_value_array_get_size (src1);
if (size != gst_value_array_get_size (src2))
return FALSE;
/* quicker value when we don'... | false | false | false | false | false | 0 |
HandleSetFactionAtWarOpcode(WorldPacket& recv_data)
{
DEBUG_LOG("WORLD: Received opcode CMSG_SET_FACTION_ATWAR");
uint32 repListID;
uint8 flag;
recv_data >> repListID;
recv_data >> flag;
GetPlayer()->GetReputationMgr().SetAtWar(repListID, flag);
} | false | false | false | false | false | 0 |
island_terrain_free(void)
{
if (!island_terrain.init) {
return;
}
terrain_select_list_iterate(island_terrain.forest, ptersel) {
terrain_select_list_remove(island_terrain.forest, ptersel);
tersel_free(ptersel);
} terrain_select_list_iterate_end;
terrain_select_list_iterate(island_terrain.desert, ... | false | false | false | false | false | 0 |
H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id,
haddr_t addr, size_t size, void *buf /*out*/)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
HDasser... | false | false | false | false | false | 0 |
getimebuf(buf, ptrp)
CONST char *buf;
int *ptrp;
{
int c;
if (getinkcode() != EUC || !isekana(buf, *ptrp))
c = (u_char)(buf[*ptrp]);
else c = mkekana((u_char)(buf[++(*ptrp)]));
(*ptrp)++;
return(c);
} | false | false | false | false | false | 0 |
vzt_wr_flush(struct vzt_wr_trace *lt)
{
if(lt)
{
if((lt->timegranule)||(lt->timepos > 0))
{
if(lt->granule_dirty)
{
lt->timepos++;
vzt_wr_flush_granule(lt, 1);
}
}
}
} | false | false | false | false | false | 0 |
gnc_tree_model_owner_iter_nth_child (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *parent_iter,
int n)
{
GncTreeModelOwner *model;
GncTreeModelOwnerPrivate *priv;
if (parent_iter)
... | false | false | false | false | false | 0 |
VP8IteratorProgress(const VP8EncIterator* const it, int delta) {
VP8Encoder* const enc = it->enc_;
if (delta && enc->pic_->progress_hook != NULL) {
const int percent = (enc->mb_h_ <= 1)
? it->percent0_
: it->percent0_ + delta * it->y_ / (enc->mb_h_ - 1);
return We... | false | false | false | false | false | 0 |
_kadm5_check_handle(void *handle)
{
CHECK_HANDLE(handle);
return 0;
} | false | false | false | false | false | 0 |
LookupPhonemeString(const char *string)
{//========================================
int ix;
unsigned char c;
unsigned int mnem;
// Pack up to 4 characters into a word
mnem = 0;
for(ix=0; ix<4; ix++)
{
if(string[ix]==0) break;
c = string[ix];
mnem |= (c << (ix*8));
}
return(PhonemeCode(mnem));
} | false | false | false | false | false | 0 |
summary_beg() const
{
if ( summ ) {
if ( html )
std::cout << "<B><FONT COLOR='#FF0000'><!--SUMMARY_BEGIN-->" << std::endl;
else
std::cout << "<!--SUMMARY_BEGIN-->" << std::endl;
}
} | false | false | false | false | false | 0 |
elf_get_symbols (ElfDesc *elfd)
{
unsigned char *ident;
ident = elfd->hdr.hdr32.e_ident;
if (ident[EI_CLASS] == ELFCLASS32)
return elf32_get_symbols (elfd);
else
return elf64_get_symbols (elfd);
} | false | false | false | false | false | 0 |
overlayInImageIsROI(size_t idx)
{
Uint16 group = getOverlayInImageGroup(idx); // returns 0 if currentImage==NULL
if (group==0) return OFFalse;
if (EMO_RegionOfInterest == currentImage->getOverlayMode(group)) return OFTrue;
else return OFFalse;
} | false | false | false | false | false | 0 |
paintEvent(QPaintEvent *pe)
{
QWidget::paintEvent(pe);
if (count())
return;
QPainter p(this);
QColor c = palette().color(foregroundRole());
c.setAlpha(c.alpha()*64/255);
p.setPen(c);
p.drawText(rect(), Qt::AlignCenter | Qt::TextWordWrap, i18n("Drag in and out items from above."));
... | false | false | false | false | false | 0 |
ncattput(
int ncid,
int varid,
const char* name,
nc_type datatype,
int len,
const void* value
)
{
const int status = nc_put_att(ncid, varid, name, datatype, len, value);
if(status != NC_NOERR)
{
nc_advise("ncattput", status, "ncid %d", ncid);
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
get_envelope(const struct ff_effect *effect)
{
static const struct ff_envelope empty_envelope;
switch (effect->type) {
case FF_PERIODIC:
return &effect->u.periodic.envelope;
case FF_CONSTANT:
return &effect->u.constant.envelope;
default:
return &empty_envelope;
}
} | false | false | false | false | false | 0 |
bifcap(bifcxdef *ctx, int argc)
{
bifcntargs(ctx, 0, argc);
tiocaps(ctx->bifxtio); /* set output driver next-char-capitalized flag */
} | false | false | false | false | false | 0 |
mfgetc(mFILE *mf) {
if (mf == m_channel[0]) init_mstdin();
if (mf->offset < mf->size) {
return (unsigned char)mf->data[mf->offset++];
}
mf->eof = 1;
return -1;
} | false | false | false | false | false | 0 |
_ecs_mem_block_info(const void *p_get)
{
struct _ecs_mem_block_t *pinfo = NULL;
unsigned long idx;
if (_ecs_mem_global_block_array != NULL) {
for (idx = _ecs_mem_global_block_nbr - 1;
idx > 0 && (_ecs_mem_global_block_array + idx)->p_bloc != p_get;
idx--);
if ((_ecs_mem_global_block_... | false | false | false | false | false | 0 |
set_config_parameter(config_entry_t *conf, char *subsystem_name, char *driver_name,
char *option, char *value)
{
subsystem_options_t **subsys_optionsp;
driver_option_t **driver_optionsp;
int subsystem_nr = -1;
int i = 0;
while (subsystem_nr == -1 && i < FREESCI_DRIVER_SUBSYSTEMS_NR) {
if (!strcasecmp(sub... | false | false | false | false | false | 0 |
painter ( const PG_Rect &src, const ASCString& name, const PG_Rect &dst) {
Surface screen = Surface::Wrap( PG_Application::GetScreen() );
if ( name == "unitpad_unitsymbol" ) {
Vehicle* v = dynamic_cast<Vehicle*>(container);
if ( v )
v->paint( screen, SPoint( dst... | false | false | false | false | false | 0 |
wlcore_probe_of(struct device *dev, int *irq,
struct wlcore_platdev_data *pdev_data)
{
struct device_node *np = dev->of_node;
if (!np || !of_match_node(wlcore_sdio_of_match_table, np))
return -ENODATA;
*irq = irq_of_parse_and_map(np, 0);
if (!*irq) {
dev_err(dev, "No irq in platform data\n");
kfree(pd... | false | false | false | false | false | 0 |
createTexture(const Size& size)
{
NullTexture* t = new NullTexture(size);
d_textures.push_back(t);
return *t;
} | false | false | false | false | false | 0 |
bits_compliment(mp_limb_t* src, mp_limb_t* dst, long int n){
mp_limb_t carry = 1;
long int i;
for(i=0; i<n; i++){
mp_limb_t d = src[i];
mp_limb_t c = carry + ~ d;
dst[i] = c;
carry = (carry && ! d);
}
} | false | false | false | false | false | 0 |
af_buildkey (list, gen, rev, key)
Af_revlist *list;
int gen;
int rev;
Af_key *key; /* out */
{
register int i = list->af_listlen-1;;
key->af_ldes = list;
while (!(list->af_list[i].af_class & AF_VALID) ||
(list->af_list[i].af_gen != gen) ||
(list->af_list[i].af_rev != rev)) {
i--;
... | false | false | false | false | false | 0 |
GetCurrentTime(int frame)
{
long result = 0;
Lock();
if (plugin && the_object && the_object->ready) {
result = plugin->frame_to_sec(the_object, frame < 0 ? GetPosition()
: frame);
}
Unlock();
if (result < 0) {
alsaplayer_error("Huh, negative????");
}
return (int)result;
} | false | false | false | false | false | 0 |
gp_processor_rom_width(enum proc_class class)
{
int rom_width;
switch (class) {
case PROC_CLASS_GENERIC:
case PROC_CLASS_PIC12:
case PROC_CLASS_SX:
rom_width = 12;
break;
case PROC_CLASS_PIC14:
rom_width = 14;
break;
case PROC_CLASS_PIC16:
case PROC_CLASS_EEPROM16:
rom_width = 16;
... | false | false | false | false | false | 0 |
cd_sensor_dbus_get_property (GDBusConnection *connection_, const gchar *sender,
const gchar *object_path, const gchar *interface_name,
const gchar *property_name, GError **error,
gpointer user_data)
{
CdSensor *sensor = CD_SENSOR (user_data);
CdSensorPrivate *priv = sensor->priv;
GVariant *re... | false | false | false | false | false | 0 |
del_hook(int hook_num, Function func)
{
if (hook_num < REAL_HOOKS) {
struct hook_entry *p = hook_list[hook_num], *o = NULL;
while (p) {
if (p->func == func) {
if (o == NULL)
hook_list[hook_num] = p->next;
else
o->next = p->next;
nfree(p);
break;
... | false | false | false | false | false | 0 |
saa7164_shutdown(struct saa7164_dev *dev)
{
dprintk(1, "%s()\n", __func__);
} | false | false | false | false | false | 0 |
printree(boolean treeprint,boolean noroot,boolean didreroot,node2 *root)
{
/* prints out diagram of the tree */
/* used in mix & penny */
long tipy, i;
double scale;
putc('\n', outfile);
if (!treeprint)
return;
putc('\n', outfile);
tipy = 1;
coordinates2(root, &tipy);
scale = 1.5;
putc('\n', ... | false | false | false | false | false | 0 |
radeon_connector_hotplug(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
struct radeon_device *rdev = dev->dev_private;
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
struct radeon_connecto... | false | false | false | false | false | 0 |
MKBlockChecksum(uint32_t* ckSum, const unsigned char* data, size_t len) {
uint32_t* curDWordPtr;
uint32_t curDWord;
uint32_t myCkSum;
myCkSum = *ckSum;
if(data) {
curDWordPtr = (uint32_t*) data;
while(curDWordPtr < (uint32_t*)(&data[len & 0xFFFFFFFC])) {
curDWord = *curDWordPtr;
FLI... | false | false | false | false | false | 0 |
clone_variables(struct ast_channel *original, struct ast_channel *clonechan)
{
struct ast_var_t *current, *newvar;
/* Append variables from clone channel into original channel */
/* XXX Is this always correct? We have to in order to keep MACROS working XXX */
AST_LIST_APPEND_LIST(ast_channel_varshead(original), as... | false | false | false | false | true | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.