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 |
|---|---|---|---|---|---|---|
set_entry (htab, key, keylen, newval)
hash_table *htab;
const void *key;
size_t keylen;
void *newval;
{
hash_entry *table = (hash_entry *) htab->table;
size_t idx = lookup (htab, key, keylen, compute_hashval (key, keylen));
if (table[idx].used == 0)
return -1;
table[idx].data = newval;... | false | false | false | false | false | 0 |
addPreISel() {
const AMDGPUSubtarget &ST = *getAMDGPUTargetMachine().getSubtargetImpl();
addPass(createFlattenCFGPass());
if (ST.IsIRStructurizerEnabled())
addPass(createStructurizeCFGPass());
return false;
} | false | false | false | false | false | 0 |
irtrans_flush(Driver *drvthis)
{
PrivateData *p = drvthis->private_data;
LCDCOMMAND buf;
STATUSBUFFER stat;
if (!memcmp(p->shadow_buf, p->framebuf, p->width * p->height))
return;
if ((time(0) - p->last_time) < p->timeout)
return;
memcpy(buf.framebuffer, p->framebuf, p->width ... | false | true | false | false | false | 1 |
cs5535_mfgpt_free_timer(struct cs5535_mfgpt_timer *timer)
{
unsigned long flags;
uint16_t val;
/* timer can be made available again only if never set up */
val = cs5535_mfgpt_read(timer, MFGPT_REG_SETUP);
if (!(val & MFGPT_SETUP_SETUP)) {
spin_lock_irqsave(&timer->chip->lock, flags);
__set_bit(timer->nr, time... | false | false | false | false | false | 0 |
snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *sockname, const char *sname, int mode)
{
snd_ctl_t *ctl;
snd_ctl_shm_t *shm = NULL;
snd_client_open_request_t *req;
snd_client_open_answer_t ans;
size_t snamelen, reqlen;
int err;
int result;
int sock = -1;
snd_ctl_shm_ctrl_t *ctrl = NULL;
sn... | false | true | true | false | true | 1 |
P_PointOnLineSide
( fixed_t x,
fixed_t y,
line_t* line )
{
fixed_t dx;
fixed_t dy;
fixed_t left;
fixed_t right;
if (!line->dx)
{
if (x <= line->v1->x)
return line->dy > 0;
return line->dy < 0;
}
if (!line->dy)
{
if (y <= line->v1->y)
... | false | false | false | false | false | 0 |
gth_hook_remove_callback (const char *name,
GCallback callback)
{
GthHook *hook;
GHook *function;
hook = GET_HOOK (name);
function = g_hook_find_func (hook->list, TRUE, callback);
if (function == NULL) {
g_warning ("callback not found in hook '%s'", name);
return;
}
g_hook_destroy_link (hook->list,... | false | false | false | false | false | 0 |
maddr_ins(struct ma_info **lst, struct ma_info *m)
{
struct ma_info *mp;
for (; (mp = *lst) != NULL; lst = &mp->next) {
if (mp->index > m->index)
break;
}
m->next = *lst;
*lst = m;
} | false | false | false | false | false | 0 |
AppendProperty(const char* prop, const char* value,
bool asString)
{
if (!prop)
{
return;
}
// handle special props
std::string propname = prop;
if ( propname == "INCLUDE_DIRECTORIES" )
{
std::vector<std::string> varArgsExpanded;
cmSystemTools::ExpandList... | false | false | false | false | false | 0 |
lp8788_alarm_irq_register(struct platform_device *pdev,
struct lp8788_rtc *rtc)
{
struct resource *r;
struct lp8788 *lp = rtc->lp;
struct irq_domain *irqdm = lp->irqdm;
int irq;
rtc->irq = 0;
/* even the alarm IRQ number is not specified, rtc time should work */
r = platform_get_resource_byname(pdev, IORES... | false | false | false | false | false | 0 |
isl_local_space_flatten_range(
__isl_take isl_local_space *ls)
{
if (!ls)
return NULL;
if (!ls->dim->nested[1])
return ls;
ls = isl_local_space_cow(ls);
if (!ls)
return NULL;
ls->dim = isl_space_flatten_range(ls->dim);
if (!ls->dim)
return isl_local_space_free(ls);
return ls;
} | false | false | false | false | false | 0 |
SetDocRoot(char *name)
{ char file[CF_BUFSIZE];
FILE *fout,*fin;
struct stat sb;
if (LOOKUP)
{
CfOut(cf_verbose, "","Ignoring document root in lookup mode");
return;
}
snprintf(file,CF_BUFSIZE-1,"%s/document_root.dat",CFWORKDIR);
MapName(file);
if (cfstat(file,&sb) == -1 && strlen(name) > 0)
{
... | true | true | false | false | true | 1 |
__libc_dlsym_private (struct link_map *map, const char *name)
{
struct do_dlsym_args sargs;
sargs.map = map;
sargs.name = name;
if (! dlerror_run (do_dlsym_private, &sargs))
return DL_SYMBOL_ADDRESS (sargs.loadbase, sargs.ref);
return NULL;
} | false | false | false | false | false | 0 |
wtp_pdu_dump(WTP_PDU *pdu, int level) {
char *dbg = "wap.wtp";
switch (pdu->type) {
#define PDU(name, docstring, fields, is_valid) \
case name: { \
struct name *p = &pdu->u.name; \
debug(dbg, 0, "%*sWTP %s PDU at %p:", \
level, "", #name, (void *)pdu); \
fields \
} break;
#define UINT(field, docstring, b... | false | false | false | false | false | 0 |
wrap_hex_pdu_construct (GType object_type, const gchar* hexpdu, guint tpdulen) {
WrapHexPdu* self = NULL;
const gchar* _tmp0_ = NULL;
gchar* _tmp1_ = NULL;
guint _tmp2_ = 0U;
g_return_val_if_fail (hexpdu != NULL, NULL);
self = (WrapHexPdu*) g_type_create_instance (object_type);
_tmp0_ = hexpdu;
_tmp1_ = g_strdu... | false | false | false | false | false | 0 |
Decrypt(const std::string & key,
const mpz_class & tweak,
uint32_t tweak_len_in_bits,
const mpz_class & cihpertext,
uint32_t cihpertext_len_bits,
mpz_class * plaintext) {
// [FFX2] pg 3., line 21
if (!ValidateKey(key)) {
... | false | false | false | false | false | 0 |
ratio_column_print(LHAFileHeader *header)
{
if (!strcmp(header->compress_method, "-lhd-")) {
printf("******");
} else {
printf("%5.1f%%", compression_percent(header->compressed_length,
header->length));
}
} | false | false | false | false | false | 0 |
FixupOrdering()
{
int i;
/* -------------------------------------------------------------------- */
/* Recurse ordering children. */
/* -------------------------------------------------------------------- */
for( i = 0; i < GetChildCount(); i++ )
GetChild(i... | false | false | false | false | false | 0 |
Space(char *n)
{
int i;
i = strlen(n);
if( i < 1) return "\t\t\t";
if( i < 8 ) return "\t\t";
return "\t";
} | false | false | false | false | false | 0 |
CorrectEndDXT1(ILushort *ex0, ILushort *ex1, ILboolean HasAlpha)
{
ILushort Temp;
if (HasAlpha) {
if (*ex0 > *ex1) {
Temp = *ex0;
*ex0 = *ex1;
*ex1 = Temp;
}
}
else {
if (*ex0 < *ex1) {
Temp = *ex0;
*ex0 = *ex1;
*ex1 = Temp;
}
}
return;
} | false | false | false | false | false | 0 |
snd_usX2Y_hwdep_dsp_load(struct snd_hwdep *hw,
struct snd_hwdep_dsp_image *dsp)
{
struct usX2Ydev *priv = hw->private_data;
int lret, err = -EINVAL;
snd_printdd( "dsp_load %s\n", dsp->name);
if (access_ok(VERIFY_READ, dsp->image, dsp->length)) {
struct usb_device* dev = priv->dev;
char *buf;
buf = m... | false | false | false | false | false | 0 |
adjustPosition( qreal pos, const QGradientStops &stops )
{
QGradientStops::const_iterator itr = stops.constBegin();
const qreal smallDiff = 0.00001;
while ( itr != stops.constEnd() ) {
const QGradientStop &stop = *itr;
++itr;
bool atEnd = ( itr != stops.constEnd() );
if ( qFu... | false | false | false | false | false | 0 |
cut_sub_process_new (const char *test_directory, CutTestContext *test_context)
{
CutSubProcess *sub_process;
CutRunContext *parent_run_context = NULL;
CutRunContext *pipeline;
if (test_context)
parent_run_context = cut_test_context_get_run_context(test_context);
pipeline = cut_pipeline_new... | false | false | false | false | false | 0 |
QuadTree_get_supernodes_internal(QuadTree qt, real bh, real *point, int nodeid, int *nsuper, int *nsupermax, real **center, real **supernode_wgts, real **distances, real *counts, int *flag){
SingleLinkedList l;
real *coord, dist;
int dim, i;
(*counts)++;
if (!qt) return;
dim = qt->dim;
l = qt->l;
if (... | false | false | false | false | false | 0 |
rb_num2ll(VALUE val)
{
if (NIL_P(val)) {
rb_raise(rb_eTypeError, "no implicit conversion from nil");
}
if (FIXNUM_P(val)) return (LONG_LONG)FIX2LONG(val);
switch (TYPE(val)) {
case T_FLOAT:
if (RFLOAT_VALUE(val) < LLONG_MAX_PLUS_ONE
&& RFLOAT_VALUE(val) > LLONG_MIN_MINUS_ONE) {
retur... | false | false | false | false | false | 0 |
readSharedColorAtom (Display *disp,
Colormap *cmap, /* The colormap ID */
int *lutStart, /* The first available LUT value */
int *nPC) /* The number of pseudocolor values used */
{
Atom colormapAtom; /* Atom for specifying colormap info to server */
int status;
Atom actualType;... | false | false | false | false | false | 0 |
receiveData (int *cmd, int len)
{
int i;
int reg;
/* send header */
reg = registerRead (0x19) & 0xF8;
/* send bytes */
i = 0;
while (((reg == 0xD0) || (reg == 0xC0)) && (i < len))
{
/* write byte */
cmd[i] = registerRead (0x1C);
reg = registerRead (0x19) & 0xF8;
i++;
}
... | false | false | false | false | false | 0 |
time_allocation(double time, double inc, int movestogo) {
ASSERT(time>0);
ASSERT(inc>=-1.0);
ASSERT(movestogo>=-1);
double time_max, alloc;
// dynamic allocation
time_max = time * 0.95 - 1.0;
if (time_max < 0.0) time_max = 0.0;
alloc = (time_max + inc * double(movestogo-1)) / double(movesto... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__eda__CSVReport_AddPage(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * page)
{
struct __ecereNameSpace__ecere__sys__Size __simpleStruct1;
struct __ecereNameSpace__ecere__sys__Size __simpleStruct0 =
{
(((int)0x7fffffff)) - 10, (((int)... | false | false | false | true | false | 1 |
CreateFixedSpillStackObject(uint64_t Size,
int64_t SPOffset) {
unsigned Align = MinAlign(SPOffset, StackAlignment);
Align = clampStackAlignment(!StackRealignable || !RealignOption, Align,
StackAlignment);
Objects.insert(Objects.begin(... | false | false | false | false | false | 0 |
next_Area(int parsed, list l, g_areas g, msg * m)
{
if (parsed == NORMAL) {
if (l->size == 0)
return 0;
else {
msg tmp;
memcpy(&tmp, l->head->m, sizeof(msg));
*m = tmp;
removeNode(l);
return 1;
}
}
else {
return next(g, m);
}
} | false | false | false | false | false | 0 |
service_udp4(packetinfo *pi, signature* sig_serv_udp)
{
int rc; /* PCRE */
int ovector[15];
int tmplen;
signature *tmpsig;
bstring app, service_name;
app = service_name = NULL;
if (pi->plen < 5 ) return;
/* should make a config.tcp_client_flowdept etc
* a range ... | false | false | false | false | false | 0 |
mouseReleaseEvent(QMouseEvent *e)
{
// only accept click if it was inside this cube
if(e->x()< 0 || e->x() > width() || e->y() < 0 || e->y() > height())
return;
if(e->button() == Qt::LeftButton && _clicksAllowed) {
e->accept();
emit clicked (m_row, m_col);
}
} | false | false | false | false | false | 0 |
partial_get_filename(const gchar *server, const gchar *login,
const gchar *muidl)
{
gchar *path;
gchar *result = NULL;
FILE *fp;
gchar buf[POPBUFSIZE];
gchar uidl[POPBUFSIZE];
time_t recv_time;
time_t now;
gchar *sanitized_uid = g_strdup(login);
subst_for_filename(sanitized_uid);
path = g_strconcat(... | false | false | false | false | false | 0 |
nautilus_window_slot_go_home (NautilusWindowSlot *slot,
NautilusWindowOpenFlags flags)
{
GFile *home;
g_return_if_fail (NAUTILUS_IS_WINDOW_SLOT (slot));
home = g_file_new_for_path (g_get_home_dir ());
nautilus_window_slot_open_location (slot, home, flags);
g_object_unref (home);
} | false | false | false | false | false | 0 |
decrypt_payloads(private_message_t *this, keymat_t *keymat)
{
payload_t *payload, *previous = NULL;
enumerator_t *enumerator;
payload_rule_t *rule;
payload_type_t type;
status_t status = SUCCESS;
char *was_encrypted = NULL;
enumerator = this->payloads->create_enumerator(this->payloads);
while (enumerator->enum... | false | false | false | false | false | 0 |
write_agg_replacement_chain (struct output_block *ob, struct cgraph_node *node)
{
int node_ref;
unsigned int count = 0;
lto_symtab_encoder_t encoder;
struct ipa_agg_replacement_value *aggvals, *av;
aggvals = ipa_get_agg_replacements_for_node (node);
encoder = ob->decl_state->symtab_node_encoder;
node_ref... | false | false | false | false | false | 0 |
od_get_esd(GF_ObjectDescriptor *OD, u16 ESID)
{
GF_ESD *esd;
u32 i = 0;
while ((esd = (GF_ESD *)gf_list_enum(OD->ESDescriptors, &i)) ) {
if (esd->ESID==ESID) return esd;
}
return NULL;
} | false | false | false | false | false | 0 |
select_del(void *arg, struct event *ev)
{
struct selectop *sop = arg;
check_selectop(sop);
if (ev->ev_events & EV_SIGNAL)
return (evsignal_del(ev));
if (sop->event_fds < ev->ev_fd) {
check_selectop(sop);
return (0);
}
if (ev->ev_events & EV_READ) {
FD_CLR(ev->ev_fd, sop->event_readset_in);
sop->event... | false | false | false | false | false | 0 |
str_starts_with(const char * string, const char * prefix) {
const char * string_ptr = string;
const char * prefix_ptr = prefix;
while (*string_ptr != '\0' && *prefix_ptr != '\0') {
if (*string_ptr != *prefix_ptr) {
return false;
}
string_ptr++;
prefix_ptr++;
}
if (*string_ptr == '\0' && ... | false | false | false | false | false | 0 |
__videobuf_iolock(struct videobuf_queue *q,
struct videobuf_buffer *vb,
struct v4l2_framebuffer *fbuf)
{
struct videobuf_vmalloc_memory *mem = vb->priv;
int pages;
BUG_ON(!mem);
MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM);
switch (vb->memory) {
case V4L2_MEMORY_MMAP:
dprintk(1, "%s memory method ... | false | false | false | false | false | 0 |
process(const NodePtr &node, FOTBuilder &fotb)
{
ProcessContext context(*interpreter_, fotb);
context.process(node);
} | false | false | false | false | false | 0 |
binding_to_template_parms_of_scope_p (cxx_binding *binding,
cp_binding_level *scope)
{
tree binding_value, tmpl, tinfo;
int level;
if (!binding || !scope || !scope->this_entity)
return false;
binding_value = binding->value ? binding->value : binding->type;
tinfo = get_template_info (scope->th... | false | false | false | false | false | 0 |
wrap_check()
{ edge_id e_id;
facet_id f_id;
int numerr = 0;
int count = 0;
int i;
if ( web.torus_flag )
FOR_ALL_EDGES(e_id)
{ WRAPTYPE wrap = get_edge_wrap(e_id);
for ( i = 0 ; i < SDIM ; i++, wrap >>= TWRAPBITS )
switch ( wrap & WRAPMASK )
{
case NEGWRAP : break;
c... | false | false | false | false | false | 0 |
TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *def_policy)
{
if (ctx->default_policy) ASN1_OBJECT_free(ctx->default_policy);
if (!(ctx->default_policy = OBJ_dup(def_policy))) goto err;
return 1;
err:
TSerr(TS_F_TS_RESP_CTX_SET_DEF_POLICY, ERR_R_MALLOC_FAILURE);
return 0;
} | false | false | false | false | false | 0 |
run_command(const gchar *command, const gchar *file_name,
const gchar *file_type, const gchar *func_name)
{
gchar *result = NULL;
gchar **argv;
if (g_shell_parse_argv(command, NULL, &argv, NULL))
{
GError *error = NULL;
gchar **env;
file_name = (file_name != NULL) ? file_name : "";
file_type = (fi... | false | false | false | false | false | 0 |
handle_subunit_info(struct avctp *session,
uint8_t transaction, uint8_t *code,
uint8_t *subunit, uint8_t *operands,
size_t operand_count, void *user_data)
{
if (*code != AVC_CTYPE_STATUS) {
*code = AVC_CTYPE_REJECTED;
return 0;
}
*code = AVC_CTYPE_STABLE;
/* The first operand should be 0x07 for... | false | false | false | false | false | 0 |
hi_diff_get_hunk(hi_diff *diff,
hi_file *file,
off_t pos)
{
hi_diff_hunk *found;
hi_diff_hunk search_hunk = {
.src_start = pos,
.dst_start = pos,
.src_end = 0,
.dst_end = 0
};
if (diff->src == file)
{
search_hunk.type = HI_DIFF_... | false | false | false | false | false | 0 |
dict_create(long size_hint, void (*destroy_value)(void *))
{
Dict *dict;
long i;
dict = gw_malloc(sizeof(*dict));
/*
* Hash tables tend to work well until they are fill to about 50%.
*/
dict->size = size_hint * 2;
dict->tab = gw_malloc(sizeof(dict->tab[0]) * dict->size);
for... | false | false | false | false | false | 0 |
directory_get_directories(const std::string & dir,
std::list<std::string> & files)
{
if(!Glib::file_test(dir, Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_DIR)) {
return;
}
Glib::Dir d(dir);
for(Glib::Dir::iterator iter = d.begin(); iter != d.end(); ++iter) {
... | false | false | false | false | false | 0 |
ax88172a_reset(struct usbnet *dev)
{
struct asix_data *data = (struct asix_data *)&dev->data;
struct ax88172a_private *priv = dev->driver_priv;
int ret;
u16 rx_ctl;
ax88172a_reset_phy(dev, priv->use_embdphy);
msleep(150);
rx_ctl = asix_read_rx_ctl(dev);
netdev_dbg(dev->net, "RX_CTL is 0x%04x after software re... | false | false | false | false | false | 0 |
_reg_segment(map_segment_t *s, int *num_btl)
{
int rc = OSHMEM_SUCCESS;
int my_pe;
int nprocs;
nprocs = oshmem_num_procs();
my_pe = oshmem_my_proc_id();
s->mkeys_cache = (sshmem_mkey_t **) calloc(nprocs,
sizeof(sshmem_mkey_t *));
if (NULL ==... | false | false | false | false | false | 0 |
regulator_find_supply_alias(
struct device *dev, const char *supply)
{
struct regulator_supply_alias *map;
list_for_each_entry(map, ®ulator_supply_alias_list, list)
if (map->src_dev == dev && strcmp(map->src_supply, supply) == 0)
return map;
return NULL;
} | false | false | false | false | false | 0 |
wap_appl_init(Cfg *cfg)
{
gw_assert(run_status == limbo);
queue = gwlist_create();
fetches = counter_create();
gwlist_add_producer(queue);
run_status = running;
charsets = wml_charsets();
caller = http_caller_create();
gwthread_create(main_thread, NULL);
gwthread_create(return_repli... | false | false | false | false | false | 0 |
__Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
PyObject *method, *result = NULL;
method = __Pyx_PyObject_GetAttrStr(obj, method_name);
if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyMethod_Check(method))) {
PyObject *self = PyMethod_GET_SELF(met... | false | false | false | false | false | 0 |
dragDrop(const QString &text, ContactViewItem *i)
{
if(!d->pa->loggedIn())
return;
// get group
ContactViewItem *gr;
if(i->type() == ContactViewItem::Group)
gr = i;
else
gr = (ContactViewItem *)static_cast<Q3ListViewItem *>(i)->parent();
Jid j(text);
if(!j.isValid())
return;
Entry *e = findEntry(j);
... | false | false | false | false | false | 0 |
posix_sysconf(PyObject *self, PyObject *args)
{
PyObject *result = NULL;
int name;
if (PyArg_ParseTuple(args, "O&:sysconf", conv_sysconf_confname, &name)) {
int value;
errno = 0;
value = sysconf(name);
if (value == -1 && errno != 0)
posix_error();
else
... | false | false | false | false | false | 0 |
pixOctcubeQuantFromCmapLUT(PIX *pixs,
PIXCMAP *cmap,
l_int32 mindepth,
l_int32 *cmaptab,
l_uint32 *rtab,
l_uint32 *gtab,
l_uint32 *btab)
{
l_i... | false | false | false | false | false | 0 |
mini_parse_debug_options (void)
{
const char *options = g_getenv ("MONO_DEBUG");
gchar **args, **ptr;
if (!options)
return;
args = g_strsplit (options, ",", -1);
for (ptr = args; ptr && *ptr; ptr++) {
const char *arg = *ptr;
if (!strcmp (arg, "handle-sigint"))
debug_options.handle_sigint = TRUE;
el... | false | false | false | false | false | 0 |
add_color_selector(GtkWidget *page, gchar *name, gchar *gconf_path, MultiloadApplet *ma)
{
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *color_picker;
GdkColor color;
gchar *color_string;
color_string = panel_applet_gconf_get_string(ma->applet, gconf_path, NULL);
if (!color_string)
color_string = g_strdup ("... | false | false | false | false | false | 0 |
sigmaKin() {
// Get S(x) values for G amplitude.
complex sS(0., 0.);
complex sT(0., 0.);
complex sU(0., 0.);
if (eDopMode == 0) {
sS = ampLedS( sH/pow2(eDLambdaT), eDnGrav, eDLambdaT, eDMD);
sT = ampLedS( tH/pow2(eDLambdaT), eDnGrav, eDLambdaT, eDMD);
sU = ampLedS( uH/pow2(eDLambdaT), eDnGrav, e... | false | false | false | false | false | 0 |
fixname(s)
char *s;
{
while (*s) {
if (!isalpha(*s) && !isdigit(*s))
*s = '_';
s++;
}
} | false | false | false | false | false | 0 |
test_submodule_modify__sync(void)
{
git_submodule *sm1, *sm2, *sm3;
git_config *cfg;
const char *str;
#define SM1 "sm_unchanged"
#define SM2 "sm_changed_head"
#define SM3 "sm_added_and_uncommited"
/* look up some submodules */
cl_git_pass(git_submodule_lookup(&sm1, g_repo, SM1));
cl_git_pass(git_submodule_looku... | false | false | false | false | false | 0 |
ACL_ListFind (NSErr_t *errp, ACLListHandle_t *acl_list, char *acl_name, int flags )
{
ACLHandle_t *result = NULL;
ACLWrapper_t *wrapper;
Symbol_t *sym;
if ( acl_list == NULL || acl_name == NULL )
return( result );
/*
* right now the symbol table exists if there hasn't been
* any collisions b... | false | false | false | false | false | 0 |
find_language_template(const char *languageName)
{
PLTemplate *result;
Relation rel;
SysScanDesc scan;
ScanKeyData key;
HeapTuple tup;
rel = heap_open(PLTemplateRelationId, AccessShareLock);
ScanKeyInit(&key,
Anum_pg_pltemplate_tmplname,
BTEqualStrategyNumber, F_NAMEEQ,
NameGetDatum(languageName));... | false | false | false | false | false | 0 |
acdPromptMatrix(AcdPAcd thys)
{
static ajint count = 0;
AjBool protein = ajFalse;
const AjPStr knowntype;
acdAttrToBool(thys, "protein", ajFalse, &protein);
knowntype = acdKnowntypeDesc(thys);
if(ajStrGetLen(knowntype))
{
count++;
acdPromptStandardS(thys, knowntype);
if(!ajStrSuffixC... | false | false | false | false | false | 0 |
incr_sub_inclusive_time_ix(pTHX_ void *subr_entry_ix_void)
{
/* recover the I32 ix that was stored as a void pointer */
I32 save_ix = (I32)PTR2IV(subr_entry_ix_void);
incr_sub_inclusive_time(aTHX_ subr_entry_ix_ptr(save_ix));
} | false | false | false | false | false | 0 |
decode_quoted_printable(char *dest,
char *src,
size_t *size)
{
int cc;
size_t i=0;
while (*src != 0 && i < *size) {
if (*src == '=') {
src++;
if (!*src) {
break;
}
/* remove soft line breaks*/
if ((*src == '\n') || (*src == '\r')){
src++;
if ((*src ... | false | false | false | false | false | 0 |
setColumnDraggingEnabled(bool setting)
{
if (d_movingEnabled != setting)
{
d_movingEnabled = setting;
// make the setting change for all component segments.
for (uint i = 0; i <getColumnCount(); ++i)
{
d_segments[i]->setDragMovingEnabled(d_movingEnabled);
}
// Fire setting changed event.
WindowEven... | false | false | false | false | false | 0 |
lpc18xx_uart_serial_out(struct uart_port *p, int offset, int value)
{
/*
* For DMA mode one must ensure that the UART_FCR_DMA_SELECT
* bit is set when FIFO is enabled. Even if DMA is not used
* setting this bit doesn't seem to affect anything.
*/
if (offset == UART_FCR && (value & UART_FCR_ENABLE_FIFO))
val... | false | false | false | false | false | 0 |
build_nt VPARAMS ((enum tree_code code, ...))
{
tree t;
int length;
int i;
VA_OPEN (p, code);
VA_FIXEDARG (p, enum tree_code, code);
t = make_node (code);
length = TREE_CODE_LENGTH (code);
for (i = 0; i < length; i++)
TREE_OPERAND (t, i) = va_arg (p, tree);
VA_CLOSE (p);
return t;
} | false | false | false | false | true | 1 |
filter_store_populate(void)
{
GList *work;
if (!filter_store) return;
gtk_list_store_clear(filter_store);
work = filter_get_list();
while (work)
{
FilterEntry *fe;
GtkTreeIter iter;
fe = work->data;
work = work->next;
gtk_list_store_append(filter_store, &iter);
gtk_list_store_set(filter_store, &... | false | false | false | false | false | 0 |
dlg_open_with (FrWindow *window,
GList *file_list)
{
OpenData *o_data;
GtkWidget *app_chooser;
o_data = g_new0 (OpenData, 1);
o_data->window = window;
o_data->file_list = file_list;
app_chooser = gtk_app_chooser_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL,
G_FILE (file_list->da... | false | false | false | false | false | 0 |
skip_row_internal( source & s, const int width )
{
int numOutBytes = 0;
rle_decoder::byte b;
bool re = false; // read error
while( numOutBytes < width && !re && !s.eof() )
{
const int check = s.read( &b, 1 );
if( check != 1 ) re = true;
if( b >= 0 /*&& b <= 127*/ ) /* 2nd is always true */
... | false | false | false | false | false | 0 |
_clutter_im_module_create (const gchar *context_id)
{
ClutterIMModule *im_module;
ClutterIMContext *context = NULL;
if (!contexts_hash)
clutter_im_module_initialize ();
if (strcmp (context_id, SIMPLE_ID) != 0)
{
im_module = g_hash_table_lookup (contexts_hash, context_id);
if (!im_module)
... | false | false | false | false | false | 0 |
popbuffer() {
struct buffer_el *el = ppop(&bufferstack);
currbuffer = el;
free(result);
if (!el) return;
result = el->buffer;
resultsize = el->size;
} | true | true | false | false | false | 1 |
ipoctal_copy_write_buffer(struct ipoctal_channel *channel,
const unsigned char *buf,
int count)
{
unsigned long flags;
int i;
unsigned int *pointer_read = &channel->pointer_read;
/* Copy the bytes from the user buffer to the internal one */
for (i = 0; i < count; i++) {
if (i <= (PAGE_SIZE - c... | false | false | false | false | false | 0 |
sectionAt(int sectionIndex) const
{
if(sectionIndex < 0 || sectionIndex >= mConfig.getNumSections())
{
throwError("FindSectionError", tr("Invalid section index"));
return QString();
}
return mConfig.getSectionNameAt(sectionIndex);
} | false | false | false | false | false | 0 |
ReadPhone (const AreaCodeDesc* Desc, long Index)
/* Read the phone number that is located at the given index. If we have a
* part of the table already loaded into memory, use the memory copy, else
* read the phone number from disk.
*/
{
if (Desc->Table && Index >= Desc->First && Index <= Desc->Last) {
/*... | false | false | false | false | false | 0 |
send_message(URLTranslation *trans, Msg *msg)
{
int max_msgs;
Octstr *header, *footer, *suffix, *split_chars;
int catenate;
unsigned long msg_sequence, msg_count;
List *list;
Msg *part;
gw_assert(msg != NULL);
gw_assert(msg_type(msg) == sms);
if (trans != NULL)
max_msgs = urltrans... | false | false | false | false | false | 0 |
free_chunklist (CodeChunk *chunk)
{
CodeChunk *dead;
#if defined(HAVE_VALGRIND_MEMCHECK_H) && defined (VALGRIND_JIT_UNREGISTER_MAP)
int valgrind_unregister = 0;
if (RUNNING_ON_VALGRIND)
valgrind_unregister = 1;
#define valgrind_unregister(x) do { if (valgrind_unregister) { VALGRIND_JIT_UNREGISTER_MAP(NULL,x); } ... | false | false | false | false | false | 0 |
edit_entry_form(GRSTgaclUser *user, char *dn, GRSTgaclPerm perm, char *help_uri, char *dir_path, char *file, char *dir_uri, char *admin_file){
// Presents the user with an editable form containing details of entry denoted by CGI variable entry_no*/
int entry_no, cred_no, i, admin=0, timestamp=atol(GRSThttpGetCGI("t... | false | false | false | false | true | 1 |
homebank_upgrade_to_v02(void)
{
GList *list;
DB( g_print("\n[hb-xml] homebank_upgrade_to_v02\n") );
list = g_list_first(GLOBALS->ope_list);
while (list != NULL)
{
Transaction *entry = list->data;
entry->kacc++;
entry->kxferacc++;
list = g_list_next(list);
}
list = g_list_first(GLOBALS->arc_list);
while... | false | false | false | false | false | 0 |
Cns_get_usrinfo_by_uid(dbfd, uid, user_entry, lock, rec_addr)
struct Cns_dbfd *dbfd;
uid_t uid;
struct Cns_userinfo *user_entry;
int lock;
Cns_dbrec_addr *rec_addr;
{
char func[23];
int i = 0;
static char query[] =
"SELECT USERID, USERNAME, USER_CA, BANNED FROM Cns_userinfo \
WHERE userid = %d";
static char que... | false | false | false | false | false | 0 |
make_metaclass(VALUE klass)
{
VALUE super;
VALUE metaclass = rb_class_boot(Qundef);
FL_SET(metaclass, FL_SINGLETON);
rb_singleton_class_attached(metaclass, klass);
if (META_CLASS_OF_CLASS_CLASS_P(klass)) {
METACLASS_OF(klass) = METACLASS_OF(metaclass) = metaclass;
}
else {
VALUE tmp = ME... | false | false | false | false | false | 0 |
prtext(unsigned char *p, int leng) {
int n, c;
int pos = 25;
printf("\"");
for ( n=0; n<leng; n++ ) {
c = *p++;
if (fold && pos >= fold) {
printf ("\\\n\t");
pos = 13; /* tab + \xab + \ */
if (c == ' ' || c == '\t') {
putchar ('\\');
++pos;
}
}
switch (... | false | false | false | false | false | 0 |
read_restart(FILE *fp)
{
allocate();
if (comm->me == 0) {
fread(&k[1],sizeof(double),atom->ndihedraltypes,fp);
fread(&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp);
fread(&shift[1],sizeof(int),atom->ndihedraltypes,fp);
fread(&weight[1],sizeof(double),atom->ndihedraltypes,fp);
fread(&weig... | false | false | false | false | false | 0 |
get16_and_mask(char *from, uint16_t *to, uint16_t *mask, int base)
{
char *p, *buffer;
int i;
if ( (p = strrchr(from, '/')) != NULL) {
*p = '\0';
i = strtol(p+1, &buffer, base);
if (*buffer != '\0' || i < 0 || i > 65535)
return -1;
*mask = htons((uint16_t)i);
} else
*mask = 65535;
i = strtol(from, &b... | false | false | false | false | false | 0 |
get_position (void)
{
GList *tmp;
gint64 position;
gst_element_query_position (GST_ELEMENT (pipeline), GST_FORMAT_TIME,
&position);
tmp = seeks;
GST_LOG ("Current position: %" GST_TIME_FORMAT, GST_TIME_ARGS (position));
while (tmp) {
SeekInfo *seek = tmp->data;
if ((position >= (seek->seeking... | false | false | false | false | false | 0 |
index_select(struct index_state *state)
{
index_tellexists(state);
/* always print flags */
index_checkflags(state, 1);
if (state->firstnotseen)
prot_printf(state->out, "* OK [UNSEEN %u] Ok\r\n",
state->firstnotseen);
prot_printf(state->out, "* OK [UIDVALIDITY %u] Ok\r\n",
state->mailbox... | false | false | false | false | false | 0 |
gridGenWeights(int gridID, double *grid_area, double *grid_wgts)
{
int i, nvals, gridsize, gridtype;
int status = 0;
int *grid_mask = NULL;
double total_area;
gridtype = gridInqType(gridID);
gridsize = gridInqSize(gridID);
if ( gridtype == GRID_GME )
{
gridID = gridToUnstructured(gridID, 1);... | false | false | false | false | false | 0 |
kget_chap(uint64_t transport_handle, uint32_t host_no,
uint16_t chap_tbl_idx, uint32_t num_entries,
char *chap_buf, uint32_t *valid_chap_entries)
{
int rc = 0;
int ev_size;
struct iscsi_uevent ev;
struct iovec iov[2];
char nlm_ev[NLMSG_SPACE(sizeof(struct iscsi_uevent))];
struct nlmsghdr *nlh;
mem... | false | false | false | false | false | 0 |
DrawAndBlit(void)
{
// Change the view size if needed
if (setsizeneeded)
{
R_ExecuteSetViewSize();
}
// Do buffered drawing
switch (gamestate)
{
case GS_LEVEL:
if (!gametic)
{
break;
}
if (automapactive)
... | false | false | false | false | false | 0 |
SetOptionValue(const char* optionName,
const char* name,
const char* value,
bool createMissingArgument)
{
OptionVector::iterator it = m_OptionVector.begin();
while(it != m_OptionVector.end())
{
if((*it).name =... | false | false | false | false | false | 0 |
gth_browser_activate_action_catalog_remove (GtkAction *action,
GthBrowser *browser)
{
GthFileData *file_data;
GSettings *settings;
file_data = gth_browser_get_folder_popup_file_data (browser);
settings = g_settings_new (GTHUMB_MESSAGES_SCHEMA);
if (g_settings_get_boolean (settings, PREF_MSG_CONFIRM_D... | false | false | false | false | false | 0 |
extractItem(const char *filesPath, const char *outName, int32_t idx, char outType) {
char filename[1024];
UDataSwapper *ds;
FILE *file;
Item *pItem;
int32_t fileLength;
uint8_t itemCharset, outCharset;
UBool itemIsBigEndian, outIsBigEndian;
if(idx<0 || itemCount<=idx) {
return;
... | false | false | false | false | true | 1 |
make_parsing_routine(int32 routine_address)
{
/* This routine is used only in grammar version 1: the corresponding
table is left empty in GV2. */
int l;
for (l=0; l<no_grammar_token_routines; l++)
if (grammar_token_routine[l] == routine_address)
... | false | false | false | false | false | 0 |
__print_p2p_messages(FILE*stream)
{
int i;
__print_p2p_message_header(stream);
for(i=0;i<NB_TRACES; i++) {
/* reduce each trace counter */
p_eztrace_container p_cont = GET_PROCESS_CONTAINER(i);
__print_p2p_messages_recurse(stream, 0, p_cont);
}
} | false | false | false | false | false | 0 |
vacm_context_handler(netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests)
{
subtree_context_cache *context_ptr;
for(; requests; requests = requests->next) {
... | false | false | false | false | false | 0 |
xml_open_doc(gchar * xml_filename, FILE * study_file,
guint64 location, guint64 size,
gchar ** perror_buf) {
xmlDocPtr doc;
gchar * xml_buffer;
long location_long;
size_t size_size;
size_t bytes_read;
if (study_file == NULL) { /* directory format */
if ((doc = xmlParseFile(xml_file... | 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.