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 |
|---|---|---|---|---|---|---|
logfile_mod_stdio_flush(Logfile * lf)
{
l_stdio_t *ll = (l_stdio_t *) lf->data;
if (0 == ll->offset)
return;
logfileWriteWrapper(lf, ll->buf, (size_t) ll->offset);
ll->offset = 0;
} | false | false | false | false | false | 0 |
set_check(fz_context *ctx, pdf_obj *chk, char *name)
{
pdf_obj *n = pdf_dict_getp(chk, "AP/N");
pdf_obj *val = NULL;
fz_var(val);
fz_try(ctx)
{
/* If name is a possible value of this check
* box then use it, otherwise use "Off" */
if (pdf_dict_gets(n, name))
val = pdf_new_name(ctx, name);
else
val =... | false | false | false | false | false | 0 |
fmgr_isbuiltin(Oid id)
{
int low = 0;
int high = fmgr_nbuiltins - 1;
/*
* Loop invariant: low is the first index that could contain target entry,
* and high is the last index that could contain it.
*/
while (low <= high)
{
int i = (high + low) / 2;
const FmgrBuiltin *ptr = &fmgr_builtins[i];
if... | false | false | false | false | false | 0 |
ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz,
bool compressed)
{
char *hdr;
struct timespec timestamp;
size_t len;
/* Report zeroed timestamp if called before timekeeping has resumed. */
if (__getnstimeofday(×tamp)) {
timestamp.tv_sec = 0;
timestamp.tv_nsec = 0;
}
hdr = kasprintf(GFP... | false | false | false | false | false | 0 |
ct_close(CS_CONNECTION * con, CS_INT option)
{
tdsdump_log(TDS_DBG_FUNC, "ct_close(%p, %d)\n", con, option);
tds_free_socket(con->tds_socket);
con->tds_socket = NULL;
return CS_SUCCEED;
} | false | false | false | false | false | 0 |
sig_complete_msg(GList **list, WINDOW_REC *window,
const char *word, const char *line,
int *want_space)
{
SERVER_REC *server, *msgserver;
g_return_if_fail(list != NULL);
g_return_if_fail(word != NULL);
g_return_if_fail(line != NULL);
server = window->active_server;
if (server == NULL || !server-... | false | false | false | false | false | 0 |
parse_manfid(tuple_t *tuple, cistpl_manfid_t *m)
{
if (tuple->TupleDataLen < 4)
return -EINVAL;
m->manf = get_unaligned_le16(tuple->TupleData);
m->card = get_unaligned_le16(tuple->TupleData + 2);
return 0;
} | false | false | false | false | false | 0 |
band_hash_enter
( Line *edge, band_value_sel select, hash_table_ptr hash, int *o )
{
band_edge_hash_rec element;
band_edge_hash_ptr element_ptr;
/* DXASSERTGOTO ( ( edge->p == edge->q ) == ( select == NEITHER_VALUE ) ); */
if ( edge->p <= edge->q )
element.edge = *edge;
else
... | false | false | false | false | false | 0 |
voc_get_spec_str(voccxdef *ctx, char vocw_id,
char *buf, size_t buflen,
const char *default_name)
{
int found;
/* presume we won't find it */
found = FALSE;
/* if there's a special word list, search it for this entry */
if (ctx->v... | false | true | false | false | false | 1 |
UpdateExamineMemory()
{
return m_examineMemoryDialog && IsWindowReallyShown(m_examineMemoryDialog->GetWindow());
} | false | false | false | false | false | 0 |
st_for(struct cfq_group *cfqg,
enum wl_class_t class,
enum wl_type_t type)
{
if (!cfqg)
return NULL;
if (class == IDLE_WORKLOAD)
return &cfqg->service_tree_idle;
return &cfqg->service_trees[class][type];
} | false | false | false | false | false | 0 |
__snd_seq_driver_register(struct snd_seq_driver *drv, struct module *mod)
{
if (WARN_ON(!drv->driver.name || !drv->id))
return -EINVAL;
drv->driver.bus = &snd_seq_bus_type;
drv->driver.owner = mod;
return driver_register(&drv->driver);
} | false | false | false | false | false | 0 |
Wait(PthreadMutex& m, float waitTime)
{
if (waitTime >= 0.f)
{
struct timespec timeout;
struct timeval now;
unsigned int round = (unsigned int) waitTime;
gettimeofday(&now, 0);
//timeout.tv_sec = now.tv_sec + (int)waitTime;
//waitTime -= (int)waitTime;
//timeout.tv_nsec = (now.tv_usec + (int)(waitTi... | false | false | false | false | false | 0 |
SaveState(
vtkInformation *info,
vtkXMLDataElement *root)
{
// Grab the vector associated with this key.
vtkInformationQuadratureSchemeDefinitionVectorValue* base =
static_cast<vtkInformationQuadratureSchemeDefinitionVectorValue *>(this->GetAsObjectBase(info));
// If it doesn't exist or it's ... | false | false | false | false | false | 0 |
Write(double timestamp)
{
StdStreamLogOutput::m_Mutex.Lock();
if ( this->m_Stream )
{
( *this->m_Stream ) << timestamp;
}
StdStreamLogOutput::m_Mutex.Unlock();
} | false | false | false | false | false | 0 |
btdm_SetCoexTable(struct rtw_adapter *padapter, u32 val0x6c0,
u32 val0x6c8, u8 val0x6cc)
{
RTPRINT(FBT, BT_TRACE, ("set coex table, set 0x6c0 = 0x%x\n", val0x6c0));
rtl8723au_write32(padapter, 0x6c0, val0x6c0);
RTPRINT(FBT, BT_TRACE, ("set coex table, set 0x6c8 = 0x%x\n", val0x6c8));
rtl8723au_write32(padapter... | false | false | false | false | false | 0 |
set( unsigned int i, bool b )
{
if ( i > 15 ) {
return;
}
unsigned char p; //bitmask
int n;
if ( i < 8 ) { //first byte
p = ( 1 << i );
n = 0;
} else { //second byte
p = ( 1 << ( i - 8 ) );
n = 1;
}
if ( b ) {
mBits[n] = mBits[n] | p;
} else {
mBits[n] = mBits[n] & ( 255... | false | false | false | false | false | 0 |
seek_other_array( Ic_array_table *array_list, Block *bpt, int *other_hits,
int target_dim, Element *target_element )
{
Statement *stm;
Def_use_table *other_arr;
int other_dim, number;
Ic_array_table *ic_array;
Array_table *arr_tbl_pt;
if( bpt->kind == BB || bpt->kind == BPA ){
for( stm = bp... | false | false | false | false | false | 0 |
PyInterpreterState_Clear(PyInterpreterState *interp)
{
PyThreadState *p;
HEAD_LOCK();
for (p = interp->tstate_head; p != NULL; p = p->next)
PyThreadState_Clear(p);
HEAD_UNLOCK();
Py_CLEAR(interp->codec_search_path);
Py_CLEAR(interp->codec_search_cache);
Py_CLEAR(interp->codec_error_r... | false | false | false | false | false | 0 |
qib_hol_event(unsigned long opaque)
{
struct qib_pportdata *ppd = (struct qib_pportdata *)opaque;
/* If hardware error, etc, skip. */
if (!(ppd->dd->flags & QIB_INITTED))
return;
if (ppd->hol_state != QIB_HOL_UP) {
/*
* Try to flush sends in case a stuck packet is blocking
* SMP replies.
*/
qib_hol... | false | false | false | false | false | 0 |
InitScale( void )
{
switch( m_oRbxScale.GetSelection( ) )
{
case eSCALE_LIN :
m_oPnlStep.bSetName( wxT("Step Increment") );
m_oPnlStep.bSetVarType( eVAR_FLT );
m_oPnlStep.bSetParms( 1.0, 0.0, 100.0, 1.0, 10.0 );
m_oPnlStep.bShowUnits( TRUE );
break;
case eSCALE_LOG :
m_o... | false | false | false | false | false | 0 |
ho_pixbuf_clone_window (const ho_pixbuf * m, const int x, const int y,
const int width, const int height)
{
ho_pixbuf *m_out;
int x1, y1;
unsigned char val;
/* allocate memory */
m_out = ho_pixbuf_new (m->n_channels, width, height, 0);
if (!m_out)
return NULL;
/*
* copy data
*/
/* color... | false | false | false | false | false | 0 |
go_string_equal (gconstpointer gstr_a, gconstpointer gstr_b)
{
GOString const *a = gstr_a;
GOString const *b = gstr_b;
return a == b || (NULL != a && NULL != b && a->str == b->str);
} | false | false | false | false | false | 0 |
init() {
/* helms */
create("helm of brilliance", 50, 50, MATERIAL_IRON, 1, 0, PROPERTY_MAGIC | PROPERTY_BRILLIANCE);
create("helm of opposite alignment", 50, 50, MATERIAL_IRON, 1, 0, PROPERTY_MAGIC);
create("dunce cap", 1, 4, MATERIAL_CLOTH, 0, 0, PROPERTY_MAGIC | PROPERTY_STUPIDITY);
create("cornuthaum", 80, 4, ... | false | false | false | false | false | 0 |
edac_mc_sysfs_init(void)
{
struct bus_type *edac_subsys;
int err;
/* get the /sys/devices/system/edac subsys reference */
edac_subsys = edac_get_sysfs_subsys();
if (edac_subsys == NULL) {
edac_dbg(1, "no edac_subsys\n");
err = -EINVAL;
goto out;
}
mci_pdev = kzalloc(sizeof(*mci_pdev), GFP_KERNEL);
if (!... | false | false | false | false | false | 0 |
file_size(struct stat *st)
{
#ifdef _WIN32
return (st->st_size + 1023) & ~1023;
#else
size_t size = st->st_blocks * 512;
if ((size_t)st->st_size > size) {
/* probably a broken stat() call ... */
size = (st->st_size + 1023) & ~1023;
}
return size;
#endif
} | false | false | false | false | false | 0 |
WriteMacOSXContentBuild(const std::string& input,
const std::string& output)
{
this->AddMacOSXContentRule();
cmNinjaDeps outputs;
outputs.push_back(output);
cmNinjaDeps deps;
deps.push_back(input);
cmNinjaVars vars;
this->WriteBuild(*this->BuildFileStream,... | false | false | false | false | false | 0 |
default_normch(int ch)
{
if (isalnum(ch) || (ch == '_'))
{
return TRUE;
}
else
{
return FALSE;
}
} | false | false | false | false | false | 0 |
tp_get_bus (void)
{
GError *error = NULL;
DBusGConnection *bus = _tp_dbus_starter_bus_conn (&error);
if (bus == NULL)
{
WARNING ("Failed to connect to starter bus: %s", error->message);
exit (1);
}
return bus;
} | false | false | false | false | false | 0 |
GetSuffixVariableInternal(bool implib)
{
switch(this->GetType())
{
case cmTarget::STATIC_LIBRARY:
return "CMAKE_STATIC_LIBRARY_SUFFIX";
case cmTarget::SHARED_LIBRARY:
return (implib
? "CMAKE_IMPORT_LIBRARY_SUFFIX"
: "CMAKE_SHARED_LIBRARY_SUFFIX");
case cmTarget:... | false | false | false | false | false | 0 |
get_java_parse_string(gm_gpslib* L, int gm_type, const char*& name1, const char*& name2) {
switch (gm_type) {
case GMTYPE_INT:
name1 = "Integer";
name2 = "parseInt";
break;
case GMTYPE_LONG:
name1 = "Long";
name2 = "parseLong";
... | false | false | false | false | false | 0 |
afs_fill_super(struct super_block *sb,
struct afs_mount_params *params)
{
struct afs_super_info *as = sb->s_fs_info;
struct afs_fid fid;
struct inode *inode = NULL;
int ret;
_enter("");
/* fill in the superblock */
sb->s_blocksize = PAGE_CACHE_SIZE;
sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
sb->s_magic ... | false | false | false | false | false | 0 |
CDB___txn_count(txnp)
DB_TXN *txnp;
{
DB_TXN *kids;
int n;
n = 1;
for (kids = TAILQ_FIRST(&txnp->kids);
kids != NULL;
kids = TAILQ_NEXT(kids, klinks))
n += CDB___txn_count(kids);
return (n);
} | false | false | false | false | false | 0 |
rawxyz_sanitize_args(RawXYZArgs *args)
{
if (args->interpolation != GWY_INTERPOLATION_ROUND
&& (gint)args->interpolation != GWY_INTERPOLATION_FIELD)
args->interpolation = GWY_INTERPOLATION_LINEAR;
if (args->exterior != GWY_EXTERIOR_MIRROR_EXTEND
&& args->exterior != GWY_EXTERIOR_PERIODIC... | false | false | false | false | false | 0 |
grl_data_add_binary (GrlData *data,
GrlKeyID key,
const guint8 *buf,
gsize size)
{
GrlRelatedKeys *relkeys;
g_return_if_fail (GRL_IS_DATA (data));
g_return_if_fail (key);
if (!buf || !size) {
return;
}
relkeys = grl_related_keys_new ();
... | false | false | false | false | false | 0 |
spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref TSRMLS_DC)
{
spl_recursive_it_iterator *iterator;
spl_recursive_it_object *object;
if (by_ref) {
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
iterator = emalloc(sizeof(spl_recursive_it_iterator));
... | false | false | false | false | false | 0 |
_got_videos_cb (RestProxyCall *call,
const GError *error,
GObject *weak_object,
gpointer user_data)
{
SwYoutubeItemView *item_view = SW_YOUTUBE_ITEM_VIEW (weak_object);
SwYoutubeItemViewPrivate *priv = GET_PRIVATE (item_view);
SwService *service;
Rest... | false | false | false | false | false | 0 |
g_typelib_new_from_memory (guint8 *memory,
gsize len,
GError **error)
{
GITypelib *meta;
if (!validate_header_basic (memory, len, error))
return NULL;
meta = g_slice_new0 (GITypelib);
meta->data = memory;
meta->len = len;
meta->owns_memory = TRUE;
meta->modules = NULL;
return met... | false | false | false | false | false | 0 |
comp_unit_find_nearest_line (unit, addr, filename_ptr, functionname_ptr,
linenumber_ptr, stash)
struct comp_unit* unit;
bfd_vma addr;
const char **filename_ptr;
const char **functionname_ptr;
unsigned int *linenumber_ptr;
struct dwarf2_debug *stash;
{
bfd_boolean line_p;
bfd_bo... | false | false | false | false | false | 0 |
start_again()
{
int i, j;
for (i = 0; i < 4; i++)
stack_flip_stack(tableau[i], hand);
for (i = 0; i < 4; i++)
stack_flip_stack(foundation[i], hand);
stack_flip_stack(stock, hand);
stack_shuffle(hand);
stack_shuffle(hand);
stack_shuffle(hand);
for (i = 0; i < CARDS_IN_STOCK; i++)
stack_flip_card(hand,... | false | true | false | false | false | 1 |
try_match(nil *t, term *r, match *m) {
if(r->type == TNIL) {
m->add_match(r,t);
m->success();
return match::singleton(m);
} else if (r->type == THOLE) {
m->success();
m->add_param(((hole *)r)->index, t);
return match::singleton(m);
}
return m->failure();
} | false | false | false | false | false | 0 |
handle_pipe_ra_stderr(int fd, gpointer user_data)
{
gboolean rc = TRUE;
char * data = NULL;
ra_pipe_op_t * rapop = (ra_pipe_op_t *)user_data;
CHECK_ALLOCATED(rapop, "ra_pipe_op", FALSE);
if (fd <= STDERR_FILENO) {
lrmd_log(LOG_CRIT, "%s:%d: Attempt to read from "
" closed/invalid file descriptor %d."
, __... | false | false | false | false | false | 0 |
normalize_newlines(const gchar *str)
{
const gchar *p;
gchar *out, *outp;
out = outp = g_malloc(strlen(str) + 1);
for (p = str; *p != '\0'; ++p) {
if (*p == '\r') {
if (*(p + 1) != '\n')
*outp++ = '\n';
} else
*outp++ = *p;
}
*outp = '\0';
return out;
} | false | false | false | false | false | 0 |
ReadYUV(FILE* in_file, WebPPicture* const pic) {
const int use_argb = pic->use_argb;
const int uv_width = (pic->width + 1) / 2;
const int uv_height = (pic->height + 1) / 2;
int y;
int ok = 0;
pic->use_argb = 0;
if (!WebPPictureAlloc(pic)) return ok;
for (y = 0; y < pic->height; ++y) {
if (fread(pi... | false | false | false | false | false | 0 |
bt_ctf_event_class_destroy(struct bt_ctf_ref *ref)
{
struct bt_ctf_event_class *event_class;
if (!ref) {
return;
}
event_class = container_of(ref, struct bt_ctf_event_class, ref_count);
bt_ctf_field_type_put(event_class->context);
bt_ctf_field_type_put(event_class->fields);
g_free(event_class);
} | false | false | false | false | false | 0 |
_tenEMBimodalConfThresh(tenEMBimodalParm *biparm) {
static const char me[]="_tenEMBimodalConfThresh";
double m1, s1, m2, s2, f1, f2, A, B, C, D, t1, t2;
biparm->confidence = ((biparm->mean2 - biparm->mean1)
/ (biparm->stdv1 + biparm->stdv2));
m1 = biparm->mean1;
s1 = biparm->stdv1;
... | false | false | false | false | false | 0 |
launch_scheduler(void)
{
thread_t thread;
signal_set(SIGCHLD, thread_child_handler, master);
/*
* Processing the master thread queues,
* return and execute one ready thread.
*/
while (thread_fetch(master, &thread)) {
/* Run until error, used for debuging only */
#ifdef _DEBUG_
if ((debug & 520) == 520) ... | false | false | false | false | false | 0 |
on_bookmarks_file_changed (GFileMonitor *monitor,
GFile *file,
GFile *other_file,
GFileMonitorEvent event_type,
GeditFileBookmarksStore *model)
{
switch (event_type)
{
case G_FILE_MONITOR_EVENT_CHANGED:
case G_FILE_MONITOR_EVENT_CREATED... | false | false | false | false | false | 0 |
NewFrontTriangle(SweepContext& tcx, Point& point, Node& node)
{
Triangle* triangle = new Triangle(point, *node.point, *node.next->point);
triangle->MarkNeighbor(*node.triangle);
tcx.AddToMap(triangle);
Node* new_node = new Node(point);
nodes_.push_back(new_node);
new_node->next = node.next;
new_node->p... | false | false | false | false | false | 0 |
yy_OptionallyIndentedLine(yycontext *ctx)
{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos;
yyprintf((stderr, "%s\n", "OptionallyIndentedLine"));
{ int yypos1282= ctx->pos, yythunkpos1282= ctx->thunkpos; if (!yy_Indent(ctx)) goto l1282; goto l1283;
l1282:; ctx->pos= yypos1282; ctx->thunkpos= yythunkpos128... | false | false | false | false | false | 0 |
alm_files_cell_renderer_real_get_size (GtkCellRenderer* base, GtkWidget* widget, GdkRectangle* cell_area, gint* x_offset, gint* y_offset, gint* width, gint* height) {
AlmFilesCellRenderer * self;
gint _vala_x_offset = 0;
gint _vala_y_offset = 0;
gint _vala_width = 0;
gint _vala_height = 0;
self = (AlmFilesCellRen... | false | false | false | false | false | 0 |
FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out)
{
unsigned i, j;
if(br == 0) {
fprintf(out, "bitreader is NULL\n");
}
else {
fprintf(out, "bitreader: capacity=%u words=%u bytes=%u consumed: words=%u, bits=%u\n", br->capacity, br->words, br->bytes, br->consumed_words, br->consumed_bits);
for(i = 0;... | false | false | false | false | false | 0 |
gkd_ssh_agent_proto_read_public_dsa (EggBuffer *req,
gsize *offset,
GckBuilder *attrs)
{
g_assert (req);
g_assert (offset);
g_assert (attrs);
if (!gkd_ssh_agent_proto_read_mpi (req, offset, attrs, CKA_PRIME) ||
!gkd_ssh_agent_proto_read... | false | false | false | false | false | 0 |
SetSettingDefaultLogicalAddress(cec_logical_address address)
{
bool bReturn(false);
/* check whether this value was changed */
{
CLockObject lock(m_mutex);
if (m_persistedConfiguration.logicalAddresses.primary == address)
return bReturn;
m_bNeedsWrite = true;
}
LIB_CEC->AddLog(CEC_LOG_DEBU... | false | false | false | false | false | 0 |
gamgi_mesa_rotate_molecule (gamgi_molecule *molecule,
double *quaternion, double *rotate, double *center)
{
gamgi_dlist *dlist;
gamgi_mesa_rotate_out_molecule (molecule, quaternion, rotate, center);
dlist = molecule->group_start;
while (dlist != NULL)
{ gamgi_mesa_rotate_group (GAMGI_CAST_GROUP dlist->data, quate... | false | false | false | false | false | 0 |
profile_after_prologue (FILE *file ATTRIBUTE_UNUSED)
{
if (!targetm.profile_before_prologue () && crtl->profile)
profile_function (file);
} | false | false | false | false | false | 0 |
setConfigData(const QString &protocol,
const QString &host,
const QString &key,
const QString &value )
{
MetaData config;
config.insert(key, value);
setConfigData(protocol, host, config);
} | false | false | false | false | false | 0 |
pma_get_portsamplesresult_ext(struct ib_pma_mad *pmp,
struct ib_device *ibdev, u8 port)
{
struct ib_pma_portsamplesresult_ext *p =
(struct ib_pma_portsamplesresult_ext *)pmp->data;
struct qib_ibdev *dev = to_idev(ibdev);
struct qib_devdata *dd = dd_from_dev(dev);
struct qib_ibport *ibp = to_iport(ibdev, por... | false | false | false | false | false | 0 |
diff_two(const char *file1, const char *label1,
const char *file2, const char *label2)
{
xpparam_t xpp;
xdemitconf_t xecfg;
xdemitcb_t ecb;
mmfile_t minus, plus;
if (read_mmfile(&minus, file1) || read_mmfile(&plus, file2))
return 1;
printf("--- a/%s\n+++ b/%s\n", label1, label2);
fflush(stdout);
memset(&x... | false | false | false | false | false | 0 |
egg_tray_manager_plug_removed (GtkSocket *socket,
EggTrayManager *manager)
{
Window *window;
ENTER;
window = g_object_get_data (G_OBJECT (socket), "egg-tray-child-window");
g_hash_table_remove (manager->socket_table, GINT_TO_POINTER (*window));
g_object_set_data (G_OBJECT (socket), "egg... | false | false | false | false | false | 0 |
file_proxy(const char *url) /* I - URL of proxy server */
{
char scheme[HTTP_MAX_URI], /* Method name (must be HTTP) */
username[HTTP_MAX_URI], /* Username:password information */
hostname[HTTP_MAX_URI], /* Hostname */
resource[HTTP_MAX_URI]; /* Resource name */
int port; /* Port number */
if (url == NULL... | false | false | false | false | false | 0 |
xmms_medialib_string_cb (xmmsv_t **row, gpointer udata)
{
gchar **str = udata;
const gchar *buf;
if (row && row[0] && xmmsv_get_type (row[0]) == XMMSV_TYPE_STRING) {
xmmsv_get_string (row[0], &buf);
*str = g_strdup (buf);
} else
XMMS_DBG ("Expected string but got something else!");
return 0;
} | false | false | false | false | false | 0 |
gst_frei0r_src_stop (GstBaseSrc * basesrc)
{
GstFrei0rSrc *self = GST_FREI0R_SRC (basesrc);
GstFrei0rSrcClass *klass = GST_FREI0R_SRC_GET_CLASS (basesrc);
if (self->f0r_instance) {
klass->ftable->destruct (self->f0r_instance);
self->f0r_instance = NULL;
}
gst_video_info_init (&self->info);
self->n... | false | false | false | false | false | 0 |
NT_set_compression(AW_window *, AW_CL dis_compr, AW_CL){
GB_transaction dummy(GLOBAL_gb_main);
GB_ERROR error = GB_set_compression(GLOBAL_gb_main,dis_compr);
if (error) aw_message(error);
} | false | false | false | false | false | 0 |
alx_tpd_avail(struct alx_priv *alx)
{
struct alx_tx_queue *txq = &alx->txq;
if (txq->write_idx >= txq->read_idx)
return alx->tx_ringsz + txq->read_idx - txq->write_idx - 1;
return txq->read_idx - txq->write_idx - 1;
} | false | false | false | false | false | 0 |
contacts_inspected (TpConnection *connection,
const gchar **ids,
const GError *error,
gpointer user_data,
GObject *weak_object)
{
ContactsContext *c = user_data;
g_assert (weak_object == c->weak_object);
g_assert (c->handles->len == ... | false | false | false | false | false | 0 |
_gda_thread_provider_handle_virtual_connection (GdaThreadProvider *provider, GdaConnection *sub_cnc)
{
ThreadConnectionData *cdata;
GdaServerProvider *sub_prov;
GdaThreadWrapper *wr;
GdaConnection *cnc;
g_return_val_if_fail (GDA_IS_THREAD_PROVIDER (provider), NULL);
g_return_val_if_fail (GDA_IS_VIRTUAL_CONNECTIO... | false | false | false | false | false | 0 |
dump_e820(void)
{
com32sys_t ireg, oreg;
struct e820_data ed;
uint32_t type;
memset(&ireg, 0, sizeof ireg);
ireg.eax.w[0] = 0xe820;
ireg.edx.l = 0x534d4150;
ireg.ecx.l = sizeof(struct e820_data);
ireg.edi.w[0] = OFFS(__com32.cs_bounce);
ireg.es = SEG(__com32.cs_bounce);
memset... | false | true | false | false | false | 1 |
c_give(void)
{
int unowned[NUM_CITY];
count_t i, count;
count = 0; /* nothing in list yet */
for (i = 0; i < NUM_CITY; i++) {
if (city[i].owner == UNOWNED) {
unowned[count] = i; /* remember this city */
count += 1;
}
}
if (count == 0) {
error ("There are no unowned cities.");
ksen... | false | false | false | false | false | 0 |
getBestAppending(int32_t missingFields, UDateTimePatternMatchOptions options) {
UnicodeString resultPattern, tempPattern;
UErrorCode err=U_ZERO_ERROR;
int32_t lastMissingFieldMask=0;
if (missingFields!=0) {
resultPattern=UnicodeString();
const PtnSkeleton* specifiedSkeleton=NULL;
... | false | false | false | false | false | 0 |
slotViewSetFractalAlgorithm(QAction* action)
{
const int algorithmID = action->data().toInt();
if(algorithmID < 1000000) {
View->changeAlgorithm(algorithmID);
View->configChanged();
ViewZoomBack->setEnabled(View->isZoomBackPossible());
}
} | false | false | false | false | false | 0 |
RaTypeMatches (u_short policytype, u_short recordtype)
{
int retn = 1;
if (policytype != 0xFFFF)
if ((policytype != recordtype) && (recordtype != 65535))
retn = 0;
return(retn);
} | false | false | false | false | false | 0 |
replace_var_in_array_du_table(Array_lmad *lmad_head, List *slist_head)
{
Array_lmad *lmad;
Array_lmad_region *region;
Array_lmad_dim *dim;
List *slist;
Quadruple *quad;
SemTree *stmlist_tree;
Statement *tmp_stm;
Boolean change_flg;
change_flg = FALSE;////
for(slist = slist_head... | false | false | false | false | false | 0 |
find_another_by_swack(struct bau_pq_entry *msg,
struct bau_control *bcp)
{
struct bau_pq_entry *msg_next = msg + 1;
unsigned char swack_vec = msg->swack_vec;
if (msg_next > bcp->queue_last)
msg_next = bcp->queue_first;
while (msg_next != msg) {
if ((msg_next->canceled == 0) && (msg_next->replied_to == ... | false | false | false | false | false | 0 |
s_get(void *ptr, Py_ssize_t size)
{
Py_ssize_t i;
char *p;
p = (char *)ptr;
for (i = 0; i < size; ++i) {
if (*p++ == '\0')
break;
}
return PyBytes_FromStringAndSize((char *)ptr, (Py_ssize_t)i);
} | false | false | false | false | false | 0 |
next_ep_desc(struct usb_descriptor_header **t)
{
for (; *t; t++) {
if ((*t)->bDescriptorType == USB_DT_ENDPOINT)
return t;
}
return NULL;
} | false | false | false | false | false | 0 |
toolbox_dnd_data_received(G_GNUC_UNUSED GtkWidget *widget,
GdkDragContext *context,
G_GNUC_UNUSED gint x,
G_GNUC_UNUSED gint y,
GtkSelectionData *data,
G_GNUC_UNUSED guint info,
... | false | false | false | false | false | 0 |
svd_closeFile(FILE *file) {
if (file == stdin || file == stdout) return;
if (isPipe(file)) pclose(file);
else fclose(file);
} | false | false | false | false | false | 0 |
is_acl_user(const char *host, const char *user)
{
bool res;
/* --skip-grants */
if (!initialized)
return TRUE;
mysql_mutex_lock(&acl_cache->lock);
res= find_acl_user(host, user, TRUE) != NULL;
mysql_mutex_unlock(&acl_cache->lock);
return res;
} | false | false | false | false | false | 0 |
xdefinecolor(const std::string& model,
const std::string& name,
double d1, double d2,
double d3, double d4) const
{
std::stringstream obuf;
obuf << "\\xdefinecolor{" << name << "}{cmyk}{"
<< d1 << "," << d2 << "," << d3 << "," << d4 << "}%"
<< std::endl;
return obuf.str();
} | false | false | false | false | false | 0 |
GetSLX(JSContext *cx, uintN argc, jsval *vp)
{
JSScript *script;
script = ValueToScript(cx, argc == 0 ? JSVAL_VOID : vp[2]);
if (!script)
return JS_FALSE;
*vp = INT_TO_JSVAL(js_GetScriptLineExtent(script));
return JS_TRUE;
} | false | false | false | false | false | 0 |
CGF_SFX_HideBreakableGlass (edict_t * aGlassPane)
{
// remove all attached decals
edict_t *decal;
decal = 0;
while ((decal = G_Find (decal, FOFS (classname), "decal")))
{
if (decal->owner == aGlassPane)
{
// make it goaway in the next frame
decal->nextthink = level.time + FRAMETIME;
}
}
... | false | false | false | false | false | 0 |
check_pin_protected_entry(void)
{
const char * fcn_name = "check_pin_protected_entry";
static char msg[128];
herr_t result;
H5F_t * file_ptr = NULL;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
TESTING("H5C_pin_protected_entry() functionality");
pass = TRUE;
... | false | false | false | false | false | 0 |
Set(unsigned int styleNumber_, const char *s_,
unsigned int len_, XYPOSITION *positions_, unsigned int clock_) {
Clear();
styleNumber = styleNumber_;
len = len_;
clock = clock_;
if (s_ && positions_) {
positions = new XYPOSITION[len + (len / 4) + 1];
for (unsigned int i=0; i<len; i++) {
positions[i] = stat... | false | false | false | false | false | 0 |
dbstmt_prop_write(zval *object, zval *member, zval *value TSRMLS_DC)
{
pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC);
convert_to_string(member);
if(strcmp(Z_STRVAL_P(member), "queryString") == 0) {
pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read on... | false | false | false | false | false | 0 |
core_scsi3_emulate_pro_clear(struct se_cmd *cmd, u64 res_key)
{
struct se_device *dev = cmd->se_dev;
struct se_node_acl *pr_reg_nacl;
struct se_session *se_sess = cmd->se_sess;
struct t10_reservation *pr_tmpl = &dev->t10_pr;
struct t10_pr_registration *pr_reg, *pr_reg_tmp, *pr_reg_n, *pr_res_holder;
u64 pr_res_ma... | false | false | false | false | false | 0 |
json_append_object(lua_State *l, json_config_t *cfg,
strbuf_t *json)
{
int comma, keytype;
json_encode_descend(l, cfg);
/* Object */
strbuf_append_char(json, '{');
lua_pushnil(l);
/* table, startkey */
comma = 0;
while (lua_next(l, -2) != 0) {
if... | false | false | false | false | false | 0 |
sst_byt_pcm_work(struct work_struct *work)
{
struct sst_byt_pcm_data *pcm_data =
container_of(work, struct sst_byt_pcm_data, work);
if (snd_pcm_running(pcm_data->substream))
sst_byt_pcm_restore_stream_context(pcm_data->substream);
} | false | false | false | false | false | 0 |
build_ctor_function (const char *name, vec<FuncDeclaration *> functions, vec<VarDeclaration *> gates)
{
tree expr_list = NULL_TREE;
// If there is only one function, just return that
if (functions.length() == 1 && gates.is_empty())
return (functions[0])->toSymbol();
// Increment gates first.
for (size_t... | false | false | false | false | false | 0 |
TBufferNewPage(VP8TBuffer* const b) {
VP8Tokens* page = NULL;
const size_t size = sizeof(*page) + b->page_size_ * sizeof(token_t);
if (!b->error_) {
page = (VP8Tokens*)WebPSafeMalloc(1ULL, size);
}
if (page == NULL) {
b->error_ = 1;
return 0;
}
page->next_ = NULL;
*b->last_page_ = page;
b... | false | false | false | false | false | 0 |
loadProblem ( const CoinPackedMatrix& matrix,
const double* collb, const double* colub,
const double* obj,
const double* rowlb, const double* rowub,
const double * rowObjective)
{
ClpPackedMatrix* clpMatrix =
... | false | false | false | false | false | 0 |
Put(const byte *inString, size_t length)
{
assert(m_size + length <= m_buffer.size());
byte *end = (m_size < size_t(m_buffer.end()-m_begin)) ? m_begin + m_size : m_begin + m_size - m_buffer.size();
size_t len = STDMIN(length, size_t(m_buffer.end()-end));
memcpy(end, inString, len);
if (len < length)
memcpy(m_buf... | false | false | false | false | false | 0 |
texprint (MODEL *pmod, const DATASET *dset, char *fname,
gretlopt opt)
{
PRN *prn;
int eqn = (opt & OPT_E);
int doc = (opt & OPT_O);
int err = 0;
if (RQ_SPECIAL_MODEL(pmod)) {
return E_NOTIMP;
}
prn = make_tex_prn(pmod->ID, fname, eqn, doc, &err);
if (!err) {
err = tex_print... | false | false | false | false | false | 0 |
gp2ap020a00f_set_operation_mode(struct gp2ap020a00f_data *data,
enum gp2ap020a00f_opmode op)
{
unsigned int op_reg_val;
int err;
if (op != GP2AP020A00F_OPMODE_SHUTDOWN) {
err = regmap_read(data->regmap, GP2AP020A00F_OP_REG,
&op_reg_val);
if (err < 0)
return err;
/*
* Shutdown the device if the... | false | false | false | false | false | 0 |
NEONThumb2DataIPostEncoder(const MCInst &MI,
unsigned EncodedValue) const {
if (isThumb2()) {
// NEON Thumb2 data-processsing encodings are very simple: bit 24 is moved
// to bit 12 of the high half-word (i.e. bit 28), and bits 27-24 are
// set to 1111.
... | false | false | false | false | false | 0 |
icalcomponent_get_first_property (icalcomponent* component, icalproperty_kind kind)
{
struct icalcomponent_impl *c = (struct icalcomponent_impl*)component;
icalerror_check_arg_rz( (component!=0),"component");
for( c->property_iterator = pvl_head(c->properties);
c->property_iterator != 0;
c->property_itera... | false | false | false | false | false | 0 |
gnome_keyring_get_default_keyring (GnomeKeyringOperationGetStringCallback callback,
gpointer data,
GDestroyNotify destroy_data)
{
GkrOperation *op;
gkr_init ();
op = get_default_keyring_st... | false | false | false | false | false | 0 |
newunitbl(size)
ALLOC_T size;
{
u_char *tbl;
if ((tbl = (u_char *)malloc(size))) return(tbl);
VOID_C openunitbl(NULL);
if (unicodebuffer) unicodebuffer = 0;
return(NULL);
} | false | false | false | false | false | 0 |
process(const LEReferenceTo<CursiveAttachmentSubtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
{
LEGlyphID glyphID = glyphIterator->getCurrGlyphID();
le_int32 coverageIndex = getGlyphCoverage(base, glyphID, success);
le_uint16 eeCount ... | false | false | false | false | false | 0 |
rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta,
u32 *rate_n_flags, int index)
{
struct iwl_priv *priv;
u8 valid_tx_ant;
u8 ant_sel_tx;
priv = lq_sta->drv;
valid_tx_ant = priv->nvm_data->valid_tx_ant;
if (lq_sta->dbg_fixed_rate) {
ant_sel_tx =
((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK)
>> RATE... | 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.