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 |
|---|---|---|---|---|---|---|
sort_group_callback(GtkWidget *w, grouplist *g)
{
LList *l = g->members;
LList *sorted = NULL;
while (l) {
sorted = l_list_insert_sorted(sorted, l->data,
(LListCompFunc) contact_cmp);
l = l_list_remove_link(l, l);
}
g->members = sorted;
update_contact_list();
} | false | false | false | false | false | 0 |
ll_append_head(CIPHER_ORDER **head, CIPHER_ORDER *curr,
CIPHER_ORDER **tail)
{
if (curr == *head) return;
if (curr == *tail)
*tail=curr->prev;
if (curr->next != NULL)
curr->next->prev=curr->prev;
if (curr->prev != NULL)
curr->prev->next=curr->next;
(*head)->prev=curr;
curr->next= *head;
curr->prev=N... | false | false | false | false | false | 0 |
SDgetnamelen(int32 id, /* IN: object ID */
uint16 *name_len /* OUT: buffer for name's length */)
{
CONSTR(FUNC, "SDgetnamelen"); /* for HGOTO_ERROR */
NC *handle = NULL;
NC_var *var = NULL;
NC_dim *dim = NULL;
intn ret_value = SUCCEED;
#ifdef SDDEBUG
fprintf(stderr, "SDg... | false | false | false | false | false | 0 |
cellpos_parse (char const *cell_str, GnmSheetSize const *ss,
GnmCellPos *res, gboolean strict)
{
unsigned char dummy_relative;
cell_str = col_parse (cell_str, ss, &res->col, &dummy_relative);
if (!cell_str)
return NULL;
cell_str = row_parse (cell_str, ss, &res->row, &dummy_relative);
if (!cell_str)
r... | false | false | false | false | false | 0 |
dfb_screens_register( CoreGraphicsDevice *device,
void *driver_data,
ScreenFuncs *funcs )
{
CoreScreen *screen;
D_ASSERT( funcs != NULL );
if (num_screens == MAX_SCREENS) {
D_ERROR( "DirectFB/Core/screen: "
"... | false | false | false | false | false | 0 |
plus_r_dl_split (Scsi_Command &cmd,off64_t size)
{ int err;
unsigned int blocks,split;
unsigned char dvd_20[4+8];
cmd[0] = 0xAD; // READ DVD STRUCTURE
cmd[7] = 0x20; // "DVD+R Double Layer Boundary Information"
cmd[9] = sizeof(dvd_20);
cmd[11] = 0;
if ((err=cmd.transport(READ,dvd_20,... | false | false | false | false | false | 0 |
IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg,
bool const /*AutoInst*/, unsigned long const Depth, bool const FromUser)
{
if (FromUser == true) // as always: user is always right
return true;
// if we have checked before and it was okay, it will still be okay
if (PkgState[Pkg->ID].M... | false | false | false | false | false | 0 |
check_squares_zi (void)
{
gmp_randstate_ptr rands = RANDS;
mpz_t a, b, g;
int i, answer;
mp_size_t size_range, an, bn;
mpz_t bs;
mpz_init (bs);
mpz_init (a);
mpz_init (b);
mpz_init (g);
for (i = 0; i < 50; i++)
{
mpz_urandomb (bs, rands, 32);
size_range = mpz_get_ui (bs) % 10 +... | false | false | false | false | false | 0 |
snd_via686_pcm_pointer(struct snd_pcm_substream *substream)
{
struct via82xx *chip = snd_pcm_substream_chip(substream);
struct viadev *viadev = substream->runtime->private_data;
unsigned int idx, ptr, count, res;
if (snd_BUG_ON(!viadev->tbl_entries))
return 0;
if (!(inb(VIADEV_REG(viadev, OFFSET_STATUS)) & VIA_... | false | false | false | false | false | 0 |
phantom_remove ( struct pci_device *pci ) {
struct net_device *netdev = pci_get_drvdata ( pci );
struct phantom_nic *phantom = netdev_priv ( netdev );
unregister_settings ( &phantom->settings );
unregister_netdev ( netdev );
netdev_nullify ( netdev );
netdev_put ( netdev );
} | false | false | false | false | false | 0 |
bsg_validate_sgv4_hdr(struct request_queue *q, struct sg_io_v4 *hdr, int *rw)
{
int ret = 0;
if (hdr->guard != 'Q')
return -EINVAL;
switch (hdr->protocol) {
case BSG_PROTOCOL_SCSI:
switch (hdr->subprotocol) {
case BSG_SUB_PROTOCOL_SCSI_CMD:
case BSG_SUB_PROTOCOL_SCSI_TRANSPORT:
break;
default:
ret... | false | false | false | false | false | 0 |
run_grabcut_iteration (struct grabcut_params *GC, IplImage * image_c,
CvMat * mask_c, CvRect * bbox)
{
((cv::Mat *) GC->image)->data = (uchar *) image_c->imageData;
((cv::Mat *) GC->mask)->data = mask_c->data.ptr;
if (cvCountNonZero (mask_c))
grabCut (*((cv::Mat *) GC->image), *((cv::Mat *) GC->mask), cv... | false | false | false | false | false | 0 |
createMenu(const string &label) {
FbTk::Layer* layer = layerManager().getLayer(ResourceLayer::MENU);
FbMenu *menu = new FbMenu(menuTheme(), imageControl(), *layer);
if (!label.empty())
menu->setLabel(label);
return menu;
} | false | false | false | false | false | 0 |
dbReplace(redisDb *db, robj *key, robj *val) {
if (dictFind(db->dict,key->ptr) == NULL) {
sds copy = sdsdup(key->ptr);
dictAdd(db->dict, copy, val);
return 1;
} else {
dictReplace(db->dict, key->ptr, val);
return 0;
}
} | false | false | false | false | false | 0 |
color_matrix_dump (ColorMatrix * m)
{
int i, j;
printf ("[\n");
for (i = 0; i < 4; i++) {
printf (" ");
for (j = 0; j < 4; j++) {
printf (" %8.5g", m->m[i][j]);
}
printf ("\n");
}
printf ("]\n");
} | false | false | false | false | false | 0 |
assuan_accept (assuan_context_t ctx)
{
gpg_error_t rc = 0;
const char *p, *pend;
if (!ctx)
return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE);
if (ctx->max_accepts != -1)
{
if (ctx->max_accepts-- == 0)
return -1; /* second invocation for pipemode -> terminate */
}
if (ctx->accept_handler)
... | false | false | false | true | false | 1 |
go_menu_position_below (GtkMenu *menu,
gint *x,
gint *y,
gint *push_in,
gpointer user_data)
{
GtkWidget *widget = GTK_WIDGET (user_data);
gint sx, sy;
GtkRequisition req;
GdkScreen *screen;
gint monitor_num;
GdkRectangle monitor;
GdkWindow *window = gtk_widget_get_window (widget);
GtkA... | false | false | false | false | false | 0 |
hawki_extract_first_filename(
const cpl_frameset * in,
const char * tag)
{
const cpl_frame * cur_frame ;
/* Get the frame */
if ((cur_frame = cpl_frameset_find_const(in, tag)) == NULL) return NULL ;
return cpl_frame_get_filename(cur_frame) ;
} | false | false | false | false | false | 0 |
tgdb_run_or_queue_command(struct tgdb *tgdb, struct tgdb_command *command)
{
int can_issue;
can_issue = tgdb_can_issue_command(tgdb);
if (can_issue) {
if (tgdb_deliver_command(tgdb, command) == -1)
return -1;
} else {
/* Make sure to put the command into the correct queue. ... | false | false | false | false | false | 0 |
qr_fentrylk_helper (call_frame_t *frame, xlator_t *this, const char *volume,
fd_t *fd, const char *basename, entrylk_cmd cmd,
entrylk_type type)
{
qr_local_t *local = NULL;
qr_fd_ctx_t *fdctx = NULL;
uint64_t value = 0;
int32_t r... | false | false | false | true | false | 1 |
horSbSliding( int val )
{
if ( testTableFlags(Tbl_snapToHGrid) &&
testTableFlags(Tbl_smoothHScrolling) ) {
tFlags &= ~Tbl_snapToHGrid; // turn off snapping while sliding
setOffset( val, yOffs, false );
tFlags |= Tbl_snapToHGrid; // turn on snapping again
} else {
setOffset( val, yOffs, false );
}
} | false | false | false | false | false | 0 |
_cph_mechanism_get_action_for_name (CphMechanism *mechanism,
const char *name)
{
if (cph_cups_is_class (mechanism->priv->cups, name))
return "class-edit";
if (cph_cups_is_printer_local (mechanism->priv->cups, name))
return "printer-l... | false | false | false | false | false | 0 |
ds_reset(Ds *ds)
{
if (ds == NULL)
return(ds_init(NULL));
if (ds->buf != NULL && ds->clear_flag)
memzap(ds->buf, ds->len);
ds->len = 0;
return(ds);
} | false | false | false | false | false | 0 |
svg_close_device(gx_device *dev)
{
gx_device_svg *const svg = (gx_device_svg*)dev;
svg_write(svg, "\n<!-- svg_close_device -->\n");
/* close any open group elements */
while (svg->mark > 0) {
svg_write(svg, "</g>\n");
svg->mark--;
}
if (svg->header) {
svg_write(svg, "</svg>\n"... | false | false | false | false | false | 0 |
ignore_fs(const char *fstype, IgnoreList** ig)
{
if (!*ig) {
FILE* fs;
char line[128];
*ig = ignore_list_new();
ignore_list_add(*ig, "none");
if ((fs = fopen("/proc/filesystems", "r")) != NULL) {
while (fgets(line, sizeof line, fs)) {
if (!strncmp(line, "nodev", 5)) {
char *type;
t... | false | false | false | false | false | 0 |
elm_map_rotate_get(const Evas_Object *obj,
double *degree,
Evas_Coord *cx,
Evas_Coord *cy)
{
#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
ELM_MAP_DATA_GET(obj, sd);
if (degree) *degree = sd->rotate.d;
if (cx) *cx = sd->rotate.cx;
if (cy) *... | false | false | false | false | false | 0 |
ath10k_htc_alloc_skb(struct ath10k *ar, int size)
{
struct sk_buff *skb;
skb = dev_alloc_skb(size + sizeof(struct ath10k_htc_hdr));
if (!skb)
return NULL;
skb_reserve(skb, sizeof(struct ath10k_htc_hdr));
/* FW/HTC requires 4-byte aligned streams */
if (!IS_ALIGNED((unsigned long)skb->data, 4))
ath10k_warn(... | false | false | false | false | false | 0 |
xfrm_selector_parse(struct xfrm_selector *sel, int *argcp, char ***argvp)
{
int argc = *argcp;
char **argv = *argvp;
inet_prefix dst;
inet_prefix src;
char *upspecp = NULL;
memset(&dst, 0, sizeof(dst));
memset(&src, 0, sizeof(src));
while (1) {
if (strcmp(*argv, "src") == 0) {
NEXT_ARG();
get_prefix(... | false | true | true | false | false | 1 |
nicvf_config_rss(struct nicvf *nic)
{
union nic_mbx mbx = {};
struct nicvf_rss_info *rss = &nic->rss_info;
int ind_tbl_len = rss->rss_size;
int i, nextq = 0;
mbx.rss_cfg.vf_id = nic->vf_id;
mbx.rss_cfg.hash_bits = rss->hash_bits;
while (ind_tbl_len) {
mbx.rss_cfg.tbl_offset = nextq;
mbx.rss_cfg.tbl_len = mi... | false | false | false | false | false | 0 |
HTMLBreak(li, env, p)
HTMLInfo li;
HTMLEnv env;
MLElement p;
{
HTMLAttribID aid;
HTMLBox box;
box = HTMLCreateBox(li, env);
aid = HTMLAttributeToID(p, "clear");
if (aid == ATTRIB_LEFT) HTMLSetB(box, BOX_CLEAR_LEFT);
else if (aid == ATTRIB_RIGHT) HTMLSetB(box, BOX_CLEAR_RIGHT);
else if (aid == ATTRIB_ALL... | false | false | false | false | false | 0 |
onEnter(FXObject* sender,FXSelector sel,void* ptr){
FXLabel::onEnter(sender,sel,ptr);
if(isEnabled() && (flags&FLAG_PRESSED)) setCheck(!oldcheck);
return 1;
} | false | false | false | false | false | 0 |
arch_i286_gen_class_or(unsigned int a, unsigned int b)
{
unsigned int class;
if (a == CLASS_NONE) {
class = b;
} else if (b == CLASS_NONE) {
class = a;
} else {
/* FIXME */
class = 0; /* Make cppcheck happy. */
assert(0);
}
return class;
} | false | false | false | false | false | 0 |
EvalCondition(const wxString& in_cond, const wxString& true_clause, const wxString& false_clause, ProjectBuildTarget* target)
{
enum condition_codes {EQ = 1, LT = 2, GT = 4, NE = 8};
wxString cond(in_cond);
wxString result;
ReplaceMacros(cond, target, true);
if (!m_RE_IfSp.Matches(in_cond))
... | false | false | false | false | false | 0 |
mbfl_filt_conv_utf32be_wchar(int c, mbfl_convert_filter *filter)
{
int n;
if (filter->status == 0) {
filter->status = 1;
n = (c & 0xff) << 24;
filter->cache = n;
} else if (filter->status == 1) {
filter->status = 2;
n = (c & 0xff) << 16;
filter->cache |= n;
} else if (filter->status == 2) {
filter->s... | false | false | false | false | false | 0 |
Record(Handle<Object> object) {
if (object->IsUndefined()) {
Add(UNDEFINED);
return false;
} else if (object->IsBoolean()) {
Add(BOOLEAN);
return object->IsTrue();
} else if (object->IsNull()) {
Add(NULL_TYPE);
return false;
} else if (object->IsSmi()) {
Add(SMI);
return Smi::cas... | false | false | false | false | false | 0 |
set_minimum_mtu(int sk)
{
struct l2cap_options l2o;
socklen_t optlen;
memset(&l2o, 0, sizeof(l2o));
optlen = sizeof(l2o);
if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &optlen) < 0) {
perror("getsockopt");
return -1;
}
l2o.imtu = 48;
l2o.omtu = 48;
if (setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o... | false | false | false | false | false | 0 |
read_dev_id(char *arg, dm_thin_id *dev_id, int warning)
{
if (!kstrtoull(arg, 10, (unsigned long long *)dev_id) &&
*dev_id <= MAX_DEV_ID)
return 0;
if (warning)
DMWARN("Message received with invalid device id: %s", arg);
return -EINVAL;
} | false | false | false | false | false | 0 |
dns_copylabel(void *dst, const void *src, const void *buf)
{
uint8_t *q = dst;
const uint8_t *p = src;
unsigned int c0, c1;
while (1) {
c0 = p[0];
if (c0 >= 0xc0) {
/* Follow pointer */
c1 = p[1];
p = (const uint8_t *)buf + ((c0 - 0xc0) << 8) + c1;
} else if (c0) {
c0++; ... | false | false | false | false | false | 0 |
xsh_scired_ifu_offset_create(cpl_plugin *plugin){
cpl_recipe *recipe = NULL;
xsh_clipping_param crh_clip_param = {5.0, 5, 0.7, 0,0.3};
/* First param (conv_kernel) should be initialized correctly ! */
xsh_remove_crh_single_param crh_single = { 0.1, 5, 2.0, 4} ;
xsh_rectify_param rectify = { "tanh",
... | false | false | false | false | false | 0 |
computeTrace(const MachineBasicBlock *MBB) {
DEBUG(dbgs() << "Computing " << getName() << " trace through BB#"
<< MBB->getNumber() << '\n');
// Set up loop bounds for the backwards post-order traversal.
LoopBounds Bounds(BlockInfo, MTM.Loops);
// Run an upwards post-order search for the trace st... | false | false | false | false | false | 0 |
furthest(Point direction) const {
Point const * p = &boundary[0];
double d = dot(*p, direction);
for(unsigned i = 1; i < boundary.size(); i++) {
double dd = dot(boundary[i], direction);
if(d < dd) {
p = &boundary[i];
d = dd;
}
}
return p;
} | false | false | false | false | false | 0 |
qmonShareTreeCopy(Widget w, XtPointer cld, XtPointer cad)
{
Widget tree = (Widget)cld;
ListTreeItem *item = NULL;
ListTreeMultiReturnStruct ret;
tSTNUserData *data;
DENTER(GUI_LAYER, "qmonShareTreeCopy");
ListTreeGetHighlighted(tree, &ret);
if (ret.count <= 0) {
DEXIT;
return;
}
... | false | false | false | false | false | 0 |
scm_port_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
{
char *type = SCM_PTOBNAME (SCM_PTOBNUM (exp));
if (!type)
type = "port";
scm_puts ("#<", port);
scm_print_port_mode (exp, port);
scm_puts (type, port);
scm_putc (' ', port);
scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
scm_... | false | false | false | false | false | 0 |
forcedeth_map_regs ( struct forcedeth_private *priv )
{
void *ioaddr;
uint32_t bar;
unsigned long addr;
u32 register_size;
int reg;
int rc;
/* Set register size based on NIC */
if ( priv->driver_data & ( DEV_HAS_VLAN | DEV_HAS_MSI_X |
DEV_HAS_POWER_CNTRL | DEV_HAS_STATISTICS_V2 |
DEV_HAS_STATISTICS_V3 ) ) ... | false | false | false | false | false | 0 |
ini_error(char *msg)
{
char *error_buf;
int error_buf_len;
char *currently_parsed_filename;
TSRMLS_FETCH();
currently_parsed_filename = zend_ini_scanner_get_filename(TSRMLS_C);
if (currently_parsed_filename) {
error_buf_len = 128 + strlen(msg) + strlen(currently_parsed_filename); /* should be more than enough ... | false | true | false | false | false | 1 |
get_stack_inc_field_acc(JVM_CLASS *class, JVM_OPCODE op, u4 index)
{
int stack_increment;
char *this_desc;
CP_NODE *c;
int tmpsize;
if(!class) {
BAD_ARG();
return 0;
}
c = cp_entry_by_index(class, index);
if(!c) return -1;
c = cp_entry_by_index(class, c->val->cpnode.Methodref.name_and_type... | false | false | false | false | false | 0 |
readIntFields(istrstream*& data_line, int nof_fields, int* buffer)
{
//NOTE: we read data-lines until necessary number of
//data fields is read from the file
int counter;
for(counter = 0; counter < nof_fields; counter++) {
getDataField(data_line, dataFieldBuffer);
buffer[counter] = atol(dataFieldBuffer)... | false | false | false | false | false | 0 |
calculateScaleRatios(QPointF basePoint, QPointF startPoint, QPointF endPoint, int method)
{
QPointF oldSize = startPoint - basePoint;
QPointF newSize = endPoint - basePoint;
double yscale, xscale;
switch (method)
{
case ProportionalScale:
if (oldSize.x() == 0.0)
xscale = 1e6;
else
xscale = newSize... | false | false | false | false | false | 0 |
gerber_is_rs274d_p(gerb_file_t *fd)
{
char *buf;
int len = 0;
char *letter;
int i;
gboolean found_binary = FALSE;
gboolean found_ADD = FALSE;
gboolean found_D0 = FALSE;
gboolean found_D2 = FALSE;
gboolean found_M0 = FALSE;
gboolean found_M2 = FALSE;
gboolean found_star = FAL... | false | false | false | false | false | 0 |
VCLS_New(cls_cbc_f *before, cls_cbc_f *after, unsigned maxlen)
{
struct VCLS *cs;
ALLOC_OBJ(cs, VCLS_MAGIC);
AN(cs);
VTAILQ_INIT(&cs->fds);
VTAILQ_INIT(&cs->funcs);
cs->before = before;
cs->after = after;
cs->maxlen = maxlen;
return (cs);
} | false | false | false | true | false | 1 |
GC_roots_present(ptr_t b)
{
int h = rt_hash(b);
struct roots *p = GC_root_index[h];
while (p != 0) {
if (p -> r_start == (ptr_t)b) return(p);
p = p -> r_next;
}
return NULL;
} | false | false | false | false | false | 0 |
__to_dcenam(char *s, word32 dctyp)
{
switch ((byte) dctyp) {
case DC_NONE: strcpy(s, "**NONE?**"); break;
case DC_EVENT: strcpy(s,"event"); break;
case DC_DELAY: strcpy(s, "delay"); break;
case DC_RHSEVENT:strcpy(s,"rhs event"); break;
case DC_RHSDELAY:strcpy(s, "rhs delay"); break;
case DC_WAITEVENT: st... | false | false | false | false | false | 0 |
test_object_raw_short__oid_shortener_stresstest_git_oid_shorten(void)
{
#define MAX_OIDS 1000
git_oid_shorten *os;
char *oids[MAX_OIDS];
char number_buffer[16];
git_oid oid;
size_t i, j;
int min_len = 0, found_collision;
os = git_oid_shorten_new(0);
cl_assert(os != NULL);
/*
* Insert in the shortener 100... | false | false | false | false | false | 0 |
gedit_document_get_search_text (GeditDocument *doc,
guint *flags)
{
const gchar *search_text;
g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL);
if (flags != NULL)
{
*flags = 0;
if (gtk_source_search_settings_get_case_sensitive (doc->priv->deprecated_search_settings))
{
*flags |= GEDIT_SE... | false | false | false | false | false | 0 |
freeRange(const Key loKey, const Key hiKey)
{
int i;
SkipListElement* element;
SkipListElement* nextElement;
// scan all levels while key < searchKey
// starting with header in his level
element = myHeader;
for(i=myHeader->getLevel(); i>=0; i--) {
nextElement = element->getElement(i... | false | false | false | false | false | 0 |
gdict_client_context_disconnect (GdictClientContext *context)
{
GdictCommand *cmd;
g_return_if_fail (GDICT_IS_CLIENT_CONTEXT (context));
/* instead of just breaking the connection to the server, we push
* a QUIT command on the queue, and wait for every other scheduled
* command to perform; this allows the... | false | false | false | false | false | 0 |
convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
struct walk_stmt_info *wi)
{
struct nesting_info *info = (struct nesting_info *) wi->info;
tree save_local_var_chain;
bitmap save_suppress;
gimple stmt = gsi_stmt (*gsi);
switch (gimple_code (stmt))
{
case GIMPLE_O... | false | false | false | false | false | 0 |
iscsi_nla_alloc(uint16_t type, uint16_t len)
{
struct nlattr *attr;
attr = calloc(1, ISCSI_NLA_TOTAL_LEN(len));
if (!attr)
return NULL;
attr->nla_len = ISCSI_NLA_LEN(len);
attr->nla_type = type;
return attr;
} | false | false | false | false | false | 0 |
print_pow(__isl_take isl_printer *p,
__isl_keep isl_space *dim, __isl_keep isl_mat *div, int var, int exp)
{
p = print_base(p, dim, div, var);
if (exp == 1)
return p;
if (p->output_format == ISL_FORMAT_C) {
int i;
for (i = 1; i < exp; ++i) {
p = isl_printer_print_str(p, "*");
p = print_base(p, dim, div,... | false | false | false | false | false | 0 |
calc_fat_clusters(struct super_block *sb)
{
struct msdos_sb_info *sbi = MSDOS_SB(sb);
/* Divide first to avoid overflow */
if (sbi->fat_bits != 12) {
unsigned long ent_per_sec = sb->s_blocksize * 8 / sbi->fat_bits;
return ent_per_sec * sbi->fat_length;
}
return sbi->fat_length * sb->s_blocksize * 8 / sbi->fa... | false | false | false | false | false | 0 |
gnm_validation_is_ok (GnmValidation const *v)
{
unsigned nops, i;
switch (v->type) {
case GNM_VALIDATION_TYPE_CUSTOM:
case GNM_VALIDATION_TYPE_IN_LIST:
nops = 1;
break;
case GNM_VALIDATION_TYPE_ANY:
nops = 0;
break;
default: nops = (v->op == GNM_VALIDATION_OP_NONE) ? 0 : opinfo[v->op].nops;
}
for (i =... | false | false | false | false | false | 0 |
Gif_NewExtension(int kind, const char *app_name)
{
Gif_Extension *gfex = Gif_New(Gif_Extension);
if (!gfex)
return 0;
gfex->kind = app_name ? 255 : kind;
gfex->application = Gif_CopyString(app_name);
gfex->data = 0;
gfex->position = 0;
gfex->stream = 0;
gfex->next = 0;
gfex->free_data = 0;
if (!... | false | false | false | false | false | 0 |
xmlSecNssKeyDataX509GetCrl(xmlSecKeyDataPtr data, xmlSecSize pos) {
xmlSecNssX509DataCtxPtr ctx;
xmlSecNssX509CrlNodePtr head;
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataX509Id), NULL);
ctx = xmlSecNssX509DataGetCtx(data);
xmlSecAssert2(ctx != NULL, NULL);
xmlSecAssert2(ctx->crls... | false | false | false | false | false | 0 |
__ntyp_to_vpivarhtyp(struct net_t *np)
{
word32 otyp;
if (np->n_isaparam) otyp = vpiParameter;
else if (np->ntyp < NONWIRE_ST) otyp = vpiNet;
else if (np->n_isarr) otyp = vpiMemory;
else otyp = to_vpi_reghtyp(np->ntyp);
return(otyp);
} | false | false | false | false | false | 0 |
niu_init_ipp(struct niu *np)
{
u64 data[5], rbuf[5], val;
int i, max, err;
if (np->parent->plat_type != PLAT_TYPE_NIU) {
if (np->port == 0 || np->port == 1)
max = ATLAS_P0_P1_DFIFO_ENTRIES;
else
max = ATLAS_P2_P3_DFIFO_ENTRIES;
} else
max = NIU_DFIFO_ENTRIES;
data[0] = 0;
data[1] = 0;
data[2] = 0;
... | false | false | false | false | false | 0 |
main (int argc, char* argv[])
{
if (argc != 2) {
cerr << "Usage: fibonacci n" << endl;
return(1);
}
int n = atoi(argv[1]);
cout << "fib(" << n << ") = " << fibonacci(n) << endl;
return(0);
} | false | false | false | false | false | 0 |
inf_text_remote_delete_operation_get_concurrency_id(
InfAdoptedOperation* operation,
InfAdoptedOperation* against)
{
g_assert(INF_TEXT_IS_REMOTE_DELETE_OPERATION(operation));
return inf_text_delete_operation_get_concurrency_id(
INF_TEXT_DELETE_OPERATION(operation),
against
);
} | false | false | false | false | false | 0 |
escape(char * dest, const char * src, size_t limit, const char * others)
{
const char * begin = src;
const char * end = dest + limit;
if (asc_isspace(*src)) {
if (dest == end) return false;
*dest++ = '\\';
if (dest == end) return false;
*dest++ = *src++;
}
while (*src) {
... | false | false | false | false | false | 0 |
annotate_fileproc (void *callerdat, struct file_info *finfo)
{
char *expand, *version;
if (finfo->rcs == NULL)
return 1;
if (finfo->rcs->flags & PARTIAL)
RCS_reparsercsfile (finfo->rcs, NULL, NULL);
expand = RCS_getexpand (finfo->rcs);
version = RCS_getversion (finfo->rcs, tag, da... | false | false | false | false | false | 0 |
rfbInitConnection(rfbClient* client)
{
/* Unless we accepted an incoming connection, make a TCP connection to the
given VNC server */
if (!client->listenSpecified) {
if (!client->serverHost)
return FALSE;
if (client->destHost) {
if (!ConnectToRFBRepeater(client,client->serverHost,client->s... | false | false | false | false | false | 0 |
OnFileSelectButton(wxCommandEvent& event)
// ----------------------------------------------------------------------------
{
// Properties File Select button clicked
// let choose a file name to insert into snippet property
wxString ChosenFileName = wxFileSelector(wxT("Choose a file"));
if (not ChosenFi... | false | false | false | false | false | 0 |
check_header_entry (const message_ty *mp, const char *msgstr_string)
{
static const char *required_fields[] =
{
"Project-Id-Version", "PO-Revision-Date", "Last-Translator",
"Language-Team", "MIME-Version", "Content-Type",
"Content-Transfer-Encoding",
/* These are recommended but not yet required. *... | false | false | false | false | false | 0 |
StrAt ( const CurrentWord_t & Word, int iStart, int iLength, const char * szStr1 )
{
if ( iStart < 0 || iStart >= Word.iLengthPadded )
return false;
char * szPos = (char *)Word.pWord + iStart;
return !strncmp ( szPos, szStr1, iLength );
} | false | false | false | false | false | 0 |
vmxnet3_rq_init(struct vmxnet3_rx_queue *rq,
struct vmxnet3_adapter *adapter)
{
int i;
/* initialize buf_info */
for (i = 0; i < rq->rx_ring[0].size; i++) {
/* 1st buf for a pkt is skbuff */
if (i % adapter->rx_buf_per_pkt == 0) {
rq->buf_info[0][i].buf_type = VMXNET3_RX_BUF_SKB;
rq->buf_info[0][i].le... | false | false | false | false | false | 0 |
do_delete(void)
{
size_t orig_lenpt = 0;
#ifndef NANO_TINY
update_undo(DEL);
#endif
assert(openfile->current != NULL && openfile->current->data != NULL && openfile->current_x <= strlen(openfile->current->data));
openfile->placewewant = xplustabs();
if (openfile->current->data[openfile->current_x... | false | true | false | false | false | 1 |
gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,sector_t cap,int *ip)
{
u8 b, t;
gdth_ha_str *ha = shost_priv(sdev->host);
struct scsi_device *sd;
unsigned capacity;
sd = sdev;
capacity = cap;
b = sd->channel;
t = sd->id;
TRACE2(("gdth_bios_param() ha %d bus %d ta... | false | false | false | false | false | 0 |
mos_arc_background_1D(float *spectrum, float *back,
int length, int msize, int fsize)
{
const char *func = "mos_arc_background_1D";
float *minf;
float *maxf;
float *smof;
int i;
if (spectrum == NULL || back == NULL)
return cpl_error_set(fu... | false | false | false | false | false | 0 |
Make()
{
int nx = x_.size();
int ny = y_.size();
int i1, i2, j1, j2;
if( zoom_ )
{
j1 = nlo_;
j2 = nhi_;
i1 = mlo_;
i2 = mhi_;
}
else
{
j1 = 1;
j2 = ny;
i1 = 1;
i2 = nx;
}
//
// Determine min and max values in array. The minimum value will
// correspond to zero bo... | false | false | false | false | false | 0 |
updateTimeFromComboSelection(const int index)
{
if (index == -1) {
setTime(QTime(0,0));
return;
}
QTime time = d->combo->itemData(index).toTime();
setTime(time);
} | false | false | false | false | false | 0 |
unmount_fuse_locked(const char *mnt, int quiet, int lazy)
{
int res;
char *copy;
const char *last;
int umount_flags = lazy ? UMOUNT_DETACH : 0;
if (getuid() != 0) {
res = may_unmount(mnt, quiet);
if (res == -1)
return -1;
}
copy = strdup(mnt);
if (copy == NULL) {
fprintf(stderr, "%s: failed to alloca... | false | false | false | false | false | 0 |
ebews_populate_notes (EBookBackendEws *ebews,
EContact *contact,
EEwsItem *item,
GCancellable *cancellable,
GError **error)
{
const gchar *notes = e_ews_item_get_notes (item);
if (!notes)
return;
e_contact_set (contact, E_CONTACT_NOTE, notes);
} | false | false | false | false | false | 0 |
SelectItem(w, n)
Widget w;
int n;
{
CcWnnObject obj = (CcWnnObject)w;
int ret = 0;
if (obj->ccWnn.state == normal_state) return -1;
if (obj->ccWnn.jcbuf == NULL) {
ret = -1;
} else if (n >= 0) {
ret = insertSelection(obj, n);
if (obj->ccWnn.textchanged) {
XtCallCallbackList((Widget)obj,
... | false | false | false | false | false | 0 |
table_subset_value_at (ETableModel *table_model,
gint col,
gint row)
{
ETableSubset *table_subset = (ETableSubset *) table_model;
g_return_val_if_fail (VALID_ROW (table_subset, row), NULL);
table_subset->priv->last_access = row;
return e_table_model_value_at (
tabl... | false | false | false | false | false | 0 |
fits_add_history(struct ccd_frame *fr, char *val)
{
char lb[81];
FITS_row *v1;
if (val == NULL)
return 0;
if (fr == NULL)
return -1;
sprintf(lb, "HISTORY = %-70s", val);
// alloc space for a new one
v1 = realloc(fr->var, (fr->nvar + 1) * FITS_HCOLS);
if (v1 == NULL) {
err_printf("cannot alloc mem for hi... | true | true | false | false | false | 1 |
adns_synchronous(adns_state ads,
const char *owner,
adns_rrtype type,
adns_queryflags flags,
adns_answer **answer_r) {
adns_query qu;
int r;
r= adns_submit(ads,owner,type,flags,0,&qu);
if (r) return r;
r= adns_wait(ads,&qu,answer_r,0);
if (r) adns_cancel(qu);
return r;
} | false | false | false | false | false | 0 |
rb_str_to_dbl(str, badcheck)
VALUE str;
int badcheck;
{
char *s;
long len;
StringValue(str);
s = RSTRING(str)->ptr;
len = RSTRING(str)->len;
if (s) {
if (s[len]) { /* no sentinel somehow */
char *p = ALLOCA_N(char, len+1);
MEMCPY(p, s, char, len);
p[len] = '\0';
s... | false | false | false | false | false | 0 |
write_walk(ScmObj obj, ScmPort *port, ScmWriteContext *ctx)
{
ScmHashTable *ht = SCM_HASH_TABLE(SCM_CDR(port->data));
ScmObj elt;
#define REGISTER(obj) \
do { \
ScmObj e = Scm_HashTableRef(ht, (obj), SC... | false | false | false | false | false | 0 |
remember_info_filename (char *filename, char *expansion)
{
FILENAME_LIST *new;
if (names_and_files_index + 2 > names_and_files_slots)
{
int alloc_size;
names_and_files_slots += 10;
alloc_size = names_and_files_slots * sizeof (FILENAME_LIST *);
names_and_files = xrealloc (names_and_fil... | false | false | false | false | false | 0 |
WriteImage(std::ostream& ofs)
{
if (!m_cairo || !m_surface)
return;
vector<char> in;
cairo_surface_write_to_png_stream(m_surface, writeFunction, &in);
for (unsigned int i = 0; i < in.size(); ++i)
ofs << in.at(i);
} | false | false | false | false | false | 0 |
d(double z, PDFType type,
vector<double const *> const ¶meters,
bool give_log) const
{
int n1,n2,m1;
double psi;
getParameters(n1, n2, m1, psi, parameters);
int x = static_cast<int>(z);
int ll = max((int) 0, m1 - n2);
int uu = min(n1, m1);
double den = 0;
if (x... | false | false | false | false | false | 0 |
setPriorities(int size,const int * priorities)
{
delete [] priority_;
priority_ = new int [maximumColumns_];
CoinZeroN(priority_,maximumColumns_);
CoinMemcpyN(priorities,size,priority_);
} | false | false | false | false | false | 0 |
mail_label_list_store_ensure_defaults (EMailLabelListStore *store)
{
gint ii;
for (ii = 0; ii < G_N_ELEMENTS (label_defaults); ii++) {
GtkTreeIter iter;
const gchar *label_name;
const gchar *label_color;
const gchar *label_tag;
gchar *encoded;
label_name = gettext (label_defaults[ii].label_name);
labe... | false | false | false | false | false | 0 |
nbOpt_thresholdChanged(int nbid, double value)
{
if (nbid == 1)
emit noiseBlankerChanged(nbid, ui->nb1Button->isChecked(), (float) value);
else
emit noiseBlankerChanged(nbid, ui->nb2Button->isChecked(), (float) value);
} | false | false | false | false | false | 0 |
mark_fs_metablock(ext2_resize_t rfs,
ext2fs_block_bitmap meta_bmap,
int group, blk_t blk)
{
ext2_filsys fs = rfs->new_fs;
ext2fs_mark_block_bitmap(rfs->reserve_blocks, blk);
ext2fs_block_alloc_stats(fs, blk, +1);
/*
* Check to see if we overlap with the inode or block bitmap,
* or the inode... | false | false | false | false | false | 0 |
onDispose()
{
pd_disc->detach();
if( pd_member ) pd_member->detach();
} | false | false | false | false | false | 0 |
Gif_DeleteExtension(Gif_Extension *gfex)
{
if (!gfex)
return;
if (gfex->data && gfex->free_data)
(*gfex->free_data)(gfex->data);
Gif_DeleteArray(gfex->application);
if (gfex->stream) {
Gif_Stream *gfs = gfex->stream;
Gif_Extension *prev, *trav;
for (prev = 0, trav = gfs->extensions;
trav &... | false | false | false | false | false | 0 |
krb5int_cc_finalize(void)
{
struct krb5_cc_typelist *t, *t_next;
k5_cccol_force_unlock();
k5_cc_mutex_destroy(&cccol_lock);
k5_mutex_destroy(&cc_typelist_lock);
#ifndef NO_FILE_CCACHE
k5_cc_mutex_destroy(&krb5int_cc_file_mutex);
#endif
k5_cc_mutex_destroy(&krb5int_mcc_mutex);
#ifdef USE_KEYRING_... | false | false | false | false | false | 0 |
init_store_directory(void)
{
const char *data_home, *home;
if ((data_home = getenv("XDG_DATA_HOME"))) {
if (data_home[0] != '/') {
fprintf(stderr,
"The XDG_DATA_HOME path is not "
"absolute");
... | false | false | false | false | true | 1 |
change_End_or_Start(Block *target,
Block *nbpt,
Operand *opt1,
Operand *opt2)
{
Var_table *vpt;
Const_table *cpt;
switch(opt1->kind) {
case KIND_VAR:
vpt = search_var_table(target->module->var_head, opt1->entry);
i... | false | false | false | false | false | 0 |
on_combo_relationship_changed()
{
if(!m_portal)
return;
sharedptr<Relationship> relationship_related;
sharedptr<Relationship> relationship = m_combo_relationship->get_selected_relationship(relationship_related);
if(!relationship)
return;
//Check that the relationship is appropriate for use in a rela... | 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.