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 |
|---|---|---|---|---|---|---|
read(DcmItem &dataset)
{
/* first, check whether sequence is present and non-empty */
DcmSequenceOfItems sequence(DCM_ReferencedSeriesSequence);
OFCondition result = getElementFromDataset(dataset, sequence);
checkElementValue(sequence, "1-n", "1", result);
if (result.good())
{
/* iterate... | false | false | false | false | false | 0 |
get_sockerr(aClient *cptr)
{
int errtmp = errno, err = 0;
SOCK_LEN_TYPE len = sizeof(err);
#ifdef SO_ERROR
if (cptr->fd >= 0)
if (!GETSOCKOPT(cptr->fd, SOL_SOCKET, SO_ERROR, &err, &len))
if (err)
errtmp = err;
#endif
return errtmp;
} | false | false | false | false | false | 0 |
as_hill_parse_read(void)
{
char *word = as_argv[as_current];
struct as_hill * hill;
int n = as_hill_counter;
if (word == NULL || strcmp(word, "*") == 0)
as_hill_read();
else if (strcmp(word, "random") == 0 || strcmp(word, "r") == 0)
as_hill_read_random();
else
as_display(ERR, "unknown keyword: %s",... | false | false | false | false | false | 0 |
ipw2100_tx_allocate(struct ipw2100_priv *priv)
{
int i, j, err = -EINVAL;
void *v;
dma_addr_t p;
IPW_DEBUG_INFO("enter\n");
err = bd_queue_allocate(priv, &priv->tx_queue, TX_QUEUE_LENGTH);
if (err) {
IPW_DEBUG_ERROR("%s: failed bd_queue_allocate\n",
priv->net_dev->name);
return err;
}
priv->tx_buffer... | false | false | false | false | false | 0 |
il_chswitch_done(struct il_priv *il, bool is_success)
{
if (test_bit(S_EXIT_PENDING, &il->status))
return;
if (test_and_clear_bit(S_CHANNEL_SWITCH_PENDING, &il->status))
ieee80211_chswitch_done(il->vif, is_success);
} | false | false | false | false | false | 0 |
gst_compare_collect_pads (GstCollectPads * cpads, GstCompare * comp)
{
GstBuffer *buf1, *buf2;
buf1 = gst_collect_pads_pop (comp->cpads,
gst_pad_get_element_private (comp->sinkpad));
buf2 = gst_collect_pads_pop (comp->cpads,
gst_pad_get_element_private (comp->checkpad));
if (!buf1 && !buf2) {
... | false | false | false | false | false | 0 |
_e_fileman_dbus_daemon_free(E_Fileman_DBus_Daemon *d)
{
if (d->pending.request_name)
dbus_pending_call_cancel(d->pending.request_name);
if (d->obj)
{
e_dbus_object_interface_detach(d->obj, d->iface);
e_dbus_object_free(d->obj);
}
if (d->iface)
e_dbus_interface_unref(d->ifa... | false | false | false | false | false | 0 |
mod_fund_type_attribute (type, decl_const, decl_volatile)
tree type;
int decl_const;
int decl_volatile;
{
char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_mod_fund_type);
sprintf (begin_label, MT_BEGIN_LABEL_FM... | false | false | false | false | false | 0 |
cx_fw_reset(struct ipmi_intf *intf)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_OEM_SS;
req.msg.cmd = IPMI_CMD_OEM_FW_RESET;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_ERR,
"Error resetting firmware to factory default\n");
ret... | false | false | false | false | false | 0 |
EmitFunctionBodyStart() {
VRegMapping.clear();
OutStreamer->EmitRawText(StringRef("{\n"));
setAndEmitFunctionVirtualRegisters(*MF);
SmallString<128> Str;
raw_svector_ostream O(Str);
emitDemotedVars(MF->getFunction(), O);
OutStreamer->EmitRawText(O.str());
} | false | false | false | false | false | 0 |
c_tree_expr_nonnegative_p (tree t)
{
if (TREE_CODE (t) == STMT_EXPR)
{
t = COMPOUND_BODY (STMT_EXPR_STMT (t));
/* Find the last statement in the chain, ignoring the final
* scope statement */
while (TREE_CHAIN (t) != NULL_TREE
&& TREE_CODE (TREE_CHAIN (t)) != SCOPE_STMT)
... | false | false | false | false | false | 0 |
unity_webapps_service_launch_browser_with_homepage (const gchar *homepage)
{
gchar *commandline_format = NULL;
gchar *commandline = NULL;
gboolean ret = FALSE;
GError *error;
commandline_format = get_browser_command_line_format (homepage);
if (commandline_format == NULL)
{
g_critical ("Error co... | false | false | false | false | false | 0 |
decode_ContextFlags(const unsigned char *p HEIMDAL_UNUSED_ATTRIBUTE, size_t len HEIMDAL_UNUSED_ATTRIBUTE, ContextFlags *data, size_t *size)
{
size_t ret = 0;
size_t l HEIMDAL_UNUSED_ATTRIBUTE;
int e HEIMDAL_UNUSED_ATTRIBUTE;
memset(data, 0, sizeof(*data));
{
size_t Top_datalen, Top_oldlen;
Der_type Top_type;
e = der_m... | false | false | false | false | false | 0 |
create_finish_failed (GObject *object,
GAsyncResult *res,
gpointer user_data)
{
g_assert (object == (GObject *)bus);
g_assert (user_data == NULL);
GError *error = NULL;
IBusInputContext *context = NULL;
context = ibus_bus_create_input_context_as... | false | false | false | false | false | 0 |
p_list_set(li_object *args) {
li_object *lst, *obj;
int k;
assert_nargs(3, args);
assert_list(li_car(args));
assert_integer(li_cadr(args));
lst = li_car(args);
k = li_to_integer(li_cadr(args));
obj = li_caddr(args);
while (k--)
lst = li_cdr(lst);
return li_set_car(lst, o... | false | false | false | false | false | 0 |
cliLogin_destroy(CliLogin *cl, bool propagate) {
assert(MAGIC(cl));
assert(MAGIC(cl->main));
str_deinit(&cl->user);
str_deinit(&cl->pass);
cl->main->destroyCallback = NULL;
if (propagate && cl->cd->conn.loginMode)
cliMain_destroy(cl->main);
MAGIC_UNSET(cl);
wms_free(cl);
} | false | false | false | false | false | 0 |
color_apply(inspector_t* insp)
{
// aliases
int nTiles = insp->nTiles;
int baseSetSize = insp->size;
int* colors = insp->p2c;
insp->colOrig = (int*) malloc (baseSetSize * sizeof(int));
int* offset = (int*) malloc ((nTiles + 1) * sizeof(int));
offset[0] = 0;
for (int i = 1; i <= nTiles; i++ )
offse... | false | true | false | false | false | 1 |
abort_csn_callback(const CSN *csn, void *data)
{
Replica *r = (Replica *)data;
Object *ruv_obj;
RUV *ruv;
int rc;
PR_ASSERT(NULL != csn);
PR_ASSERT(NULL != data);
ruv_obj = replica_get_ruv (r);
PR_ASSERT (ruv_obj);
ruv = (RUV*)object_get_data (ruv_obj);
PR_ASSERT (ruv);
PR_Lock(r->repl_l... | false | false | false | false | false | 0 |
sbob_cmp(sbob_t *sb, sbob_pad_t pad, const void *in, size_t len)
{
int j, d;
size_t i;
j = sb->l;
d = 0;
for (i = 0; i < len; i++) {
if (j == SBOB_RATE) {
sb->s.b[SBOB_RATE] ^= pad;
sbob_pi(&sb->s);
j = 0;
}
if (d == 0)
d = ((i... | false | false | false | false | false | 0 |
NET_CL_Connect(net_addr_t *addr, net_connect_data_t *data)
{
int start_time;
int last_send_time;
server_addr = addr;
memcpy(net_local_wad_sha1sum, data->wad_sha1sum, sizeof(sha1_digest_t));
memcpy(net_local_deh_sha1sum, data->deh_sha1sum, sizeof(sha1_digest_t));
net_local_is_freedoom = data->i... | false | false | false | false | false | 0 |
sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
{
uint read_bytes = 0;
int tmp_read_bytes;
count_bytes = MIN(count_bytes, (uint) SG(request_info).content_length - SG(read_post_bytes));
while (read_bytes < count_bytes) {
tmp_read_bytes = read(STDIN_FILENO, buffer + read_bytes, count_bytes - read_byte... | false | false | false | false | false | 0 |
cpu_to_edmac(struct sh_eth_private *mdp, u32 x)
{
switch (mdp->edmac_endian) {
case EDMAC_LITTLE_ENDIAN:
return cpu_to_le32(x);
case EDMAC_BIG_ENDIAN:
return cpu_to_be32(x);
}
return x;
} | false | false | false | false | false | 0 |
do_s2io_add_mc(struct s2io_nic *sp, u8 *addr)
{
int i;
u64 mac_addr = 0;
struct config_param *config = &sp->config;
for (i = 0; i < ETH_ALEN; i++) {
mac_addr <<= 8;
mac_addr |= addr[i];
}
if ((0ULL == mac_addr) || (mac_addr == S2IO_DISABLE_MAC_ENTRY))
return SUCCESS;
/* check if the multicast mac already... | false | false | false | false | false | 0 |
FITS_dump( FL_IMAGE * im )
{
FILE *fp = im->fpout;
unsigned short *ras;
int n = 0,
bits;
bits = im->type == FL_IMAGE_GRAY ? 8 : 16;
ras = im->gray[ 0 ];
/* write a brief header */
dump_space( fp, 80 - fprintf( fp, "SIMPLE = T " ) );
dump_space( fp, 80 - fprintf( fp, "BITPIX ... | false | false | false | false | false | 0 |
usb_ep_autoconfig_reset (struct usb_gadget *gadget)
{
struct usb_ep *ep;
list_for_each_entry (ep, &gadget->ep_list, ep_list) {
ep->claimed = false;
ep->driver_data = NULL;
}
gadget->in_epnum = 0;
gadget->out_epnum = 0;
} | false | false | false | false | false | 0 |
solo_enc_on(struct solo_enc_dev *solo_enc)
{
u8 ch = solo_enc->ch;
struct solo_dev *solo_dev = solo_enc->solo_dev;
u8 interval;
solo_update_mode(solo_enc);
/* Make sure to do a bandwidth check */
if (solo_enc->bw_weight > solo_dev->enc_bw_remain)
return -EBUSY;
solo_enc->sequence = 0;
solo_dev->enc_bw_remai... | false | false | false | false | false | 0 |
isFirstCharacter(UT_UCSChar Character) const
{
UT_UCSChar c;
if (getCharacter(0, c))
return c == Character;
// not found
return false;
} | false | false | false | false | false | 0 |
fl_set_choice_align( FL_OBJECT * ob,
int align )
{
FLI_CHOICE_SPEC *sp = ob->spec;
if ( sp->align != align )
{
sp->align = align;
fl_redraw_object( ob );
}
} | false | false | false | false | false | 0 |
zeroForces()
{
console.XDebug() << "TriMesh::zeroForces()\n";
for(vector<Triangle>::iterator iter=m_triangles.begin();
iter!=m_triangles.end();
iter++){
iter->zeroForce();
}
console.XDebug() << "end TriMesh::zeroForces()\n";
} | false | false | false | false | false | 0 |
maybe_duplicate_eh_stmt_fn (struct function *new_fun, gimple new_stmt,
struct function *old_fun, gimple old_stmt,
struct pointer_map_t *map, int default_lp_nr)
{
int old_lp_nr, new_lp_nr;
void **slot;
if (!stmt_could_throw_p (new_stmt))
return false;
old_lp_nr = lookup_stmt_eh_lp_fn (old_fun... | false | false | false | false | false | 0 |
AcpiTbSetTableLoadedFlag (
UINT32 TableIndex,
BOOLEAN IsLoaded)
{
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
{
if (IsLoaded)
{
AcpiGbl_RootTableList.Tables[TableIndex].Flags |=
... | false | false | false | false | false | 0 |
BackgroundCall() {
MutexLock l(&mutex_);
assert(bg_compaction_scheduled_);
if (shutting_down_.Acquire_Load()) {
// No more background work when shutting down.
} else if (!bg_error_.ok()) {
// No more background work after a background error.
} else {
BackgroundCompaction();
}
bg_compaction_sc... | false | false | false | false | false | 0 |
isBitcodeFile() const {
std::string actualMagic;
if (!getMagicNumber(actualMagic, 4))
return false;
LLVMFileType FT =
IdentifyFileType(actualMagic.c_str(),
static_cast<unsigned>(actualMagic.length()));
return FT == Bitcode_FileType;
} | false | false | false | false | false | 0 |
drm_fb_cma_alloc(struct drm_device *dev,
struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_cma_object **obj,
unsigned int num_planes)
{
struct drm_fb_cma *fb_cma;
int ret;
int i;
fb_cma = kzalloc(sizeof(*fb_cma), GFP_KERNEL);
if (!fb_cma)
return ERR_PTR(-ENOMEM);
drm_helper_mode_fill_fb_struct(&fb_cma->fb, ... | false | false | false | false | false | 0 |
track_new(const char *p)
{
track_t *track = alloc(sizeof(track_t));
p = match_literal(p, "PBRTL,");
p = match_unsigned(p, &track->count);
p = match_char(p, ',');
p = match_unsigned(p, &track->index);
p = match_char(p, ',');
struct tm tm;
memset(&tm, 0, sizeof tm);
p = match_unsigned(... | false | false | false | false | false | 0 |
imapx_untagged_quotaroot (CamelIMAPXServer *is,
CamelIMAPXStream *stream,
GCancellable *cancellable,
GError **error)
{
CamelIMAPXStore *store;
CamelIMAPXStoreNamespace *ns;
CamelFolder *folder = NULL;
gchar *mailbox_name = NULL;
gchar **... | false | false | false | false | false | 0 |
pack( char *& buffer, const VT_MPI_INT & bufferSize,
VT_MPI_INT & bufferPos )
{
DefRec_BaseS::pack( buffer, bufferSize, bufferPos );
// type
CALL_MPI( MPI_Pack( &type, 1, MPI_UNSIGNED, buffer, bufferSize, &bufferPos,
MPI_COMM_WORLD ) );
// name.length()
... | false | false | false | false | false | 0 |
Cudd_PrintDebug(
DdManager * dd,
DdNode * f,
int n,
int pr)
{
DdNode *azero, *bzero;
int nodes;
int leaves;
double minterms;
int retval = 1;
if (f == NULL) {
(void) fprintf(dd->out,": is the NULL DD\n");
(void) fflush(dd->out);
return(0);
}
azero = DD_ZERO(dd);
... | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdf5lib_H5_H5Rcreate
(JNIEnv *env, jclass clss,
jbyteArray ref, jint loc_id, jstring name, jint ref_type, jint space_id)
{
char* rName;
jboolean isCopy;
herr_t status;
jbyte *refP;
if (ref == NULL) {
h5nullArgument( env, "H5Rcreate: ref is NULL");
return -1;
}... | false | false | false | false | false | 0 |
storeEntryReset(StoreEntry * e)
{
MemObject *mem = e->mem_obj;
debug(20, 3) ("storeEntryReset: %s\n", storeUrl(e));
assert(mem->swapout.sio == NULL);
stmemFree(&mem->data_hdr);
mem->inmem_hi = mem->inmem_lo = 0;
httpReplyDestroy(mem->reply);
mem->reply = httpReplyCreate();
e->expires = e... | false | false | false | false | false | 0 |
fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset,
unsigned HOST_WIDE_INT size)
{
tree ret;
/* We found the field with exact match. */
if (useless_type_conversion_p (type, TREE_TYPE (ctor))
&& !offset)
return canonicalize_constructor_val (ctor);
/* We are at the end of... | false | false | false | false | false | 0 |
iwl_mvm_max_scan_ie_fw_cmd_room(struct iwl_mvm *mvm)
{
int max_probe_len;
max_probe_len = SCAN_OFFLOAD_PROBE_REQ_SIZE;
/* we create the 802.11 header and SSID element */
max_probe_len -= 24 + 2;
/* DS parameter set element is added on 2.4GHZ band if required */
if (iwl_mvm_rrm_scan_needed(mvm))
max_probe_len... | false | false | false | false | false | 0 |
bus_remove_driver(struct device_driver *drv)
{
if (!drv->bus)
return;
if (!drv->suppress_bind_attrs)
remove_bind_files(drv);
driver_remove_groups(drv, drv->bus->drv_groups);
driver_remove_file(drv, &driver_attr_uevent);
klist_remove(&drv->p->knode_bus);
pr_debug("bus: '%s': remove driver %s\n", drv->bus->nam... | false | false | false | false | false | 0 |
php_handle_special_queries(TSRMLS_D)
{
if (PG(expose_php) && SG(request_info).query_string && SG(request_info).query_string[0] == '=') {
if (php_info_logos(SG(request_info).query_string + 1 TSRMLS_CC)) {
return 1;
} else if (!strcmp(SG(request_info).query_string + 1, PHP_CREDITS_GUID)) {
php_print_credits(PH... | false | false | false | false | false | 0 |
add_period(string *p1)
{
int p1_val = atoi(p1->c_str());
det_shocks_periods.push_back(make_pair(p1_val, p1_val));
delete p1;
} | false | false | false | false | false | 0 |
cmp_reach_def(const void *data, const void *arg)
{
int r;
Reach_def *rd1, *rd2;
rd1 = (Reach_def *)data;
rd2 = (Reach_def *)arg;
if (rd1->entry == rd2->entry
&& rd1->kind == rd2->kind
&& rd1->module == rd2->module)
r = 0;
else
r =1;
return r;
} | false | false | false | false | false | 0 |
safe_name(struct kobject *kobj, const char *orig_name)
{
const char *name = orig_name;
struct kernfs_node *kn;
int i = 0;
/* don't be a hero. After 16 tries give up */
while (i < 16 && (kn = sysfs_get_dirent(kobj->sd, name))) {
sysfs_put(kn);
if (name != orig_name)
kfree(name);
name = kasprintf(GFP_KERNE... | false | false | false | false | false | 0 |
BuildPath (cairo_t *cr) const
{
list <Point>::const_iterator i = m_Points.begin (), end = m_Points.end ();
cairo_move_to (cr, (*i).x, (*i).y);
for (i++; i != end; i++)
cairo_line_to (cr, (*i).x, (*i).y);
cairo_close_path (cr);
} | false | false | false | false | false | 0 |
inode_close_read(struct file_opening *fo, struct gfarm_timespec *atime)
{
struct inode *inode = fo->inode;
struct inode_open_state *ios = inode->u.c.state;
if ((fo->flag & GFARM_FILE_TRUNC_PENDING) != 0) {
inode_file_update(fo, 0, atime, &inode->i_mtimespec,
NULL, NULL);
} else if (atime != NULL)
inode_s... | false | false | false | false | false | 0 |
unpack_RGB (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
gpointer dest, const gpointer data[GST_VIDEO_MAX_PLANES],
const gint stride[GST_VIDEO_MAX_PLANES], gint x, gint y, gint width)
{
int i;
const guint8 *s = GET_LINE (y);
guint8 *d = dest;
for (i = 0; i < width; i++) {
d[i * 4 + 0] ... | false | false | false | false | false | 0 |
register_mount_service(SVCXPRT * udptransp, SVCXPRT * tcptransp)
{
if (opt_portmapper) {
pmap_unset(MOUNTPROG, MOUNTVERS1);
pmap_unset(MOUNTPROG, MOUNTVERS3);
}
if (udptransp != NULL) {
/* Register MOUNT service (v1) for UDP */
if (!svc_register
(udptransp, MOUNTPROG, MOUNTVERS1, mountprog_3,
... | false | false | false | false | false | 0 |
ffasin (struct gafunc *pfc, struct gastat *pst) {
gaint i,rc,cnt;
struct gagrid *pgr;
struct gastn *stn;
struct garpt *rpt;
gadouble *val;
char *valu;
if (pfc->argnum!=1) {
gaprnt (0,"Error from ASIN: Too many or too few args \n");
gaprnt (0," One argument expected \n");
return (1);
... | false | false | false | false | true | 1 |
cbdataAddType(cbdata_type type, const char *name, int size, FREE * free_func)
{
if (type)
return type;
type = cbdata_types;
cbdataInitType(type, name, size, free_func);
return type;
} | false | false | false | false | false | 0 |
nav_get_set_camera()
{
static camid nav_camera;
if(!nav_camera.isValid())
{
nav_camera = cam_create("Nav camera");
}
cam_set_camera(nav_camera);
return nav_camera.getCamera();
} | false | false | false | false | false | 0 |
XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo)
{
unsigned short tempah, tempal, tempbl, i;
tempal = pVBInfo->LCDResInfo;
tempah = pVBInfo->LCDTypeInfo;
i = 0;
tempbl = pVBInfo->LCDCapList[i].LCD_ID;
while (tempbl != 0xFF) {
if ((tempbl & 0x80) && (tempbl != 0x80)) {
tempal = tempah;
tempbl &= ~0x80;... | false | false | false | false | false | 0 |
DtStrtoul64 (
char *String,
UINT64 *ReturnInteger)
{
char *ThisChar = String;
UINT32 ThisDigit;
UINT64 ReturnValue = 0;
int DigitCount = 0;
/* Skip over any white space in the buffe... | false | false | false | false | false | 0 |
filelayout_mark_request_commit(struct nfs_page *req,
struct pnfs_layout_segment *lseg,
struct nfs_commit_info *cinfo,
u32 ds_commit_idx)
{
struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg);
u32 i, j;
if (fl->commit_through_mds) {
nfs_request_add_commit_list(req, &cinfo->mds... | false | false | false | false | false | 0 |
makeCircleSVG(QPointF p, double r, QPointF offset, double dpi, double printerScale)
{
double cx = (p.x() - offset.x()) * dpi / printerScale;
double cy = (p.y() - offset.y()) * dpi / printerScale;
double rr = r * dpi / printerScale;
QString stroke = "black";
return QString("<circle fill=\"black\" cx=\"%1\" cy=\"%... | false | false | false | false | false | 0 |
check_subject_auth(struct webauth_context *ctx, const char *auth)
{
int s = WA_ERR_NONE;
if (strcmp(auth, "krb5") != 0 && strcmp(auth, "webkdc") != 0) {
s = WA_ERR_CORRUPT;
wai_error_set(ctx, s, "unknown auth type %s", auth);
}
return s;
} | false | false | false | false | false | 0 |
parallel_global_slots(const sge_assignment_t *a, int *slots, int *slots_qend)
{
dispatch_t result = DISPATCH_NEVER_CAT;
lList *hard_request = lGetList(a->job, JB_hard_resource_list);
lList *load_attr = lGetList(a->gep, EH_load_list);
lList *config_attr = lGetList(a->gep, EH_consumable_config_list);
lLis... | false | false | false | false | false | 0 |
garcon_menu_separator_get_default (void)
{
static GarconMenuSeparator *separator = NULL;
if (G_UNLIKELY (separator == NULL))
{
/* Create a new separator */
separator = g_object_new (GARCON_TYPE_MENU_SEPARATOR, NULL);
g_object_add_weak_pointer (G_OBJECT (separator), (gpointer) &separator);
... | false | false | false | false | false | 0 |
vd_resolve (const char* dnsname, const char* server, VDError *ex)
{
struct addrinfo hints;
struct addrinfo *ai = NULL;
memset (&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
if (getaddrinfo (dnsname, server, &hints, &ai) != 0) {
... | false | false | false | false | false | 0 |
readMatrix(char *filename, double **A) {
std::ifstream ifs(filename);
if (!ifs) {
perror("cannot open the file");
exit(1);
}
int n;
int a, b;
long la, lb;
ifs >> n;
*A = new double[n*n];
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
ifs >> a;
if... | false | false | false | false | false | 0 |
ftrace_create_function_files(struct trace_array *tr,
struct dentry *parent)
{
int ret;
/*
* The top level array uses the "global_ops", and the files are
* created on boot up.
*/
if (tr->flags & TRACE_ARRAY_FL_GLOBAL)
return 0;
ret = allocate_ftrace_ops(tr);
if (ret)
return ret;
ftrace_create_fil... | false | false | false | false | false | 0 |
setCurrentFile(const QString& fileName, CaseSensitivity cs)
{
zipError=UNZ_OK;
if(mode!=mdUnzip) {
qWarning("QuaZip::setCurrentFile(): ZIP is not open in mdUnzip mode");
return false;
}
if(fileName.isNull()) {
hasCurrentFile_f=false;
return true;
}
// Unicode-aware reimplementation of the un... | false | false | false | false | false | 0 |
recvStanza()
{
QDomElement e = stanzaToRecv;
stanzaToRecv = QDomElement();
return e;
} | false | false | false | false | false | 0 |
ajCodDel(AjPCod *pthys)
{
AjPCod thys = *pthys;
if(!thys)
return;
AJFREE(thys->fraction);
AJFREE(thys->tcount);
AJFREE(thys->num);
AJFREE(thys->aa);
AJFREE(thys->back);
ajStrDel(&thys->Name);
ajStrDel(&thys->Species);
ajStrDel(&thys->Division);
ajStrDel(&thys->Rele... | false | false | false | false | false | 0 |
defaults_get_file(char *filename)
{
for(int i = 0; i < Num_default_files; i++)
{
if(!stricmp(Default_files[i].filename, filename))
{
return Default_files[i].contents;
}
}
//WMC - This is really bad, because it means we have a default table missing.
Error(LOCATION, "Default table '%s' missing from executa... | false | false | false | false | false | 0 |
cgraph_remove_node (struct cgraph_node *node)
{
struct cgraph_node *n;
int uid = node->uid;
cgraph_call_node_removal_hooks (node);
cgraph_node_remove_callers (node);
cgraph_node_remove_callees (node);
node->ipa_transforms_to_apply.release ();
/* Incremental inlining access removed nodes stored in the po... | false | false | false | false | false | 0 |
__iwl_mvm_mac_start(struct iwl_mvm *mvm)
{
int ret;
lockdep_assert_held(&mvm->mutex);
/* Clean up some internal and mac80211 state on restart */
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
iwl_mvm_restart_cleanup(mvm);
ret = iwl_mvm_up(mvm);
if (ret && test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &m... | false | false | false | false | false | 0 |
cbf_make_context (cbf_context **context)
{
/* Allocate the memory */
cbf_failnez (cbf_alloc ((void **) context, NULL, sizeof (cbf_context), 1))
/* Initialise */
(*context)->temporary = NULL;
(*context)->connections = 1;
... | false | false | false | false | false | 0 |
ems_pcmcia_interrupt(int irq, void *dev_id)
{
struct ems_pcmcia_card *card = dev_id;
struct net_device *dev;
irqreturn_t retval = IRQ_NONE;
int i, again;
/* Card not present */
if (readw(card->base_addr) != 0xAA55)
return IRQ_HANDLED;
do {
again = 0;
/* Check interrupt for each channel */
for (i = 0; ... | false | false | false | false | false | 0 |
totem_file_opened_async_cb (TotemObject *totem,
const gchar *uri,
TotemChaptersPlugin *plugin)
{
gchar *cmml_file;
g_return_if_fail (TOTEM_IS_OBJECT (totem));
g_return_if_fail (TOTEM_IS_CHAPTERS_PLUGIN (plugin));
g_return_if_fail (uri != NULL);
if (g_str_has_prefix (uri, "http") != FALSE)
re... | false | false | false | false | false | 0 |
maybe_add_partition (GduVolumeGrid *grid,
GPtrArray *lines,
UDisksPartition *partition)
{
const gchar *name;
guint number;
gchar *s;
if (partition == NULL)
goto out;
name = udisks_partition_get_name (partition);
number = udisks_partition_get_number (pa... | false | false | false | false | false | 0 |
snd_pcm_channel_info_user(struct snd_pcm_substream *substream,
struct snd_pcm_channel_info __user * _info)
{
struct snd_pcm_channel_info info;
int res;
if (copy_from_user(&info, _info, sizeof(info)))
return -EFAULT;
res = snd_pcm_channel_info(substream, &info);
if (res < 0)
return res;
if (copy_to_... | false | false | false | false | false | 0 |
rsc_stonith_ordering(resource_t * rsc, action_t * stonith_op, pe_working_set_t * data_set)
{
gboolean is_stonith = FALSE;
if (rsc->children) {
GListPtr gIter = NULL;
for (gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
resource_t *child_rsc = (resource_t *) gIter->data... | false | false | false | false | false | 0 |
set_stpui_curve_values(GtkWidget *gcurve, const stp_curve_t *seed)
{
if (stp_curve_get_gamma(seed))
{
stpui_curve_set_gamma(STPUI_CURVE(gcurve), stp_curve_get_gamma(seed));
}
else
{
stp_curve_t *copy = stp_curve_create_copy(seed);
const float *fdata;
size_t count;
stp_curve... | false | false | false | false | false | 0 |
evaluate_math_two_args(NetExpr*&arg0_, NetExpr*&arg1_, const char*name)
{
eval_expr(arg0_);
eval_expr(arg1_);
NetEConst*tmpi0 = dynamic_cast<NetEConst *>(arg0_);
NetECReal*tmpr0 = dynamic_cast<NetECReal *>(arg0_);
NetEConst*tmpi1 = dynamic_cast<NetEConst *>(arg1_);
NetECReal*tmpr1 = ... | false | false | false | false | false | 0 |
handle_name_option(const char *spec)
{
debug((1, "handle_name_option(spec = %s)", spec))
if (g.done_config)
return;
if (g.done_name)
prog_usage_msg("Misplaced option: --name=%s in config file (must be on command line)", spec);
if (strspn(spec, ACCEPT_NAME) != strlen(spec))
prog_usage_msg("Invalid --name ar... | false | false | false | false | false | 0 |
OpenASF ( LFA_FileRef fileRef, ObjectState & inOutObjectState )
{
XMP_Uns64 pos = 0;
XMP_Uns64 len;
try {
pos = LFA_Seek ( fileRef, 0, SEEK_SET );
} catch ( ... ) {}
if ( pos != 0 ) return 0;
// read first and following chunks
while ( ReadObject ( fileRef, inOutObjectState, &len, pos) ) {}
return inOutObj... | false | false | false | false | false | 0 |
m88rs6000t_set_bb(struct m88rs6000t_dev *dev,
u32 symbol_rate_KSs, s32 lpf_offset_KHz)
{
u32 f3dB;
u8 reg40;
f3dB = symbol_rate_KSs * 9 / 14 + 2000;
f3dB += lpf_offset_KHz;
f3dB = clamp_val(f3dB, 6000U, 43000U);
reg40 = f3dB / 1000;
return regmap_write(dev->regmap, 0x40, reg40);
} | false | false | false | false | false | 0 |
flickcurl_groups_getInfo(flickcurl* fc, const char* group_id, const char* lang)
{
xmlDocPtr doc = NULL;
xmlXPathContextPtr xpathCtx = NULL;
flickcurl_group **groups = NULL;
flickcurl_group *group = NULL;
flickcurl_init_params(fc, 0);
if(!group_id)
return NULL;
flickcurl_add_param(fc, "group_id",... | false | false | false | false | false | 0 |
ComputeSectionLinkPrefix(std::string const& name)
{
// Map from section name to a prefix for links pointing within the
// section. For example, the commands section should have HTML
// links to each command with names like #command:ADD_EXECUTABLE.
if(name.find("Command") != name.npos)
{
return "command... | false | false | false | false | false | 0 |
objectSyntaxCopy(RootObject *o)
{
if (!o)
return NULL;
Type *t = isType(o);
if (t)
return t->syntaxCopy();
Expression *e = isExpression(o);
if (e)
return e->syntaxCopy();
return o;
} | false | false | false | false | false | 0 |
ast_get_indication_zone(const char *country)
{
struct ast_tone_zone *tz = NULL;
struct ast_tone_zone zone_arg = {
.nrringcadence = 0,
};
if (ast_strlen_zero(country)) {
ao2_lock(ast_tone_zones);
if (default_tone_zone) {
tz = ast_tone_zone_ref(default_tone_zone);
}
ao2_unlock(ast_tone_zones);
return... | false | false | false | false | false | 0 |
query_addnxrrsetnsec(ns_client_t *client, dns_db_t *db,
dns_dbversion_t *version, dns_name_t **namep,
dns_rdataset_t **rdatasetp, dns_rdataset_t **sigrdatasetp)
{
dns_name_t *name;
dns_rdataset_t *sigrdataset;
dns_rdata_t sigrdata;
dns_rdata_rrsig_t sig;
unsigned int labels;
isc_buffer_t *dbuf, b;
... | false | false | false | false | false | 0 |
tracker_sparql_query_parse_construct_object_list (TrackerSparqlQuery* self, TrackerSparqlSolution* var_value_map, GError** error) {
GError * _inner_error_ = NULL;
#line 969 "/home/martyn/Source/tracker/src/libtracker-data/tracker-sparql-query.vala"
g_return_if_fail (self != NULL);
#line 969 "/home/martyn/Source/track... | false | false | false | false | false | 0 |
agp_allocate_memory(struct agp_bridge_data *bridge,
size_t page_count, u32 type)
{
int scratch_pages;
struct agp_memory *new;
size_t i;
int cur_memory;
if (!bridge)
return NULL;
cur_memory = atomic_read(&bridge->current_memory_agp);
if ((cur_memory + page_count > bridge->max_memory_agp) ||
(cur_mem... | false | false | false | false | false | 0 |
chanlist_get_selected (server *serv, gboolean get_topic)
{
char *chan;
GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (serv->gui->chanlist_list));
GtkTreeModel *model;
GtkTreeIter iter;
if (!gtk_tree_selection_get_selected (sel, &model, &iter))
return NULL;
gtk_tree_model_get (model, &iter... | false | false | false | false | false | 0 |
F_mpz_set_limbs(F_mpz_t f, const mp_limb_t * x, const ulong limbs)
{
if (limbs == 0L) // x is zero
{
F_mpz_zero(f);
} else if (limbs == 1L) // x is 1 limb
{
F_mpz_set_ui(f, x[0]);
} else // x is more than one limb
{
__mpz_struct * mpz_ptr = _F_mpz_promote(f);
// read limbs, least significant first, n... | false | false | false | false | false | 0 |
do_cody ()
/* The CODIFY command takes an input text file and generates an output text */
/* file containing C code to write out the input text file. The need for this */
/* command springs from the weaver. Experience with FunnelWeb showed that use */
/* of a separate header file, to be included, while apparently sen... | false | false | false | false | false | 0 |
read_Bools(struct archive_read *a, unsigned char *data, size_t num)
{
const unsigned char *p;
unsigned i, mask = 0, avail = 0;
for (i = 0; i < num; i++) {
if (mask == 0) {
if ((p = header_bytes(a, 1)) == NULL)
return (-1);
avail = *p;
mask = 0x80;
}
data[i] = (avail & mask)?1:0;
mask >>= 1;
}
... | false | false | false | false | false | 0 |
recalcSections()
{
tCaption = 0;
head = foot = firstBody = 0;
has_col_elems = false;
RenderObject *child = firstChild();
// We need to get valid pointers to caption, head, foot and firstbody again
while ( child ) {
switch(child->style()->display()) {
case TABLE_CAPTION:
if ( !tCaption &&... | false | false | false | false | false | 0 |
set_profiler(CollectorObject *co, FileCoverage * current_file,
int tracing, int force_trace)
{
if(current_file || force_trace) {
if(!tracing) {
PyEval_SetProfile(NULL, NULL);
Py_INCREF((PyObject *)co);
PyEval_SetTrace(collector_trace_callback, (Py... | false | false | false | false | false | 0 |
storedHttpPost( QIODevice* ioDevice, const KUrl& url, qint64 size, JobFlags flags )
{
KUrl _url(url);
if (_url.path().isEmpty())
{
_url.setPath("/");
}
StoredTransferJob* job = precheckHttpPost(_url, ioDevice, flags);
if (job)
return job;
// If no size is specified and the QI... | false | false | false | false | false | 0 |
FreeInterpPage(void *arg)
{
InterpPage *ipagePtr = arg;
Page *pagePtr = ipagePtr->pagePtr;
NsServer *servPtr = pagePtr->servPtr;
FreeObjs(ipagePtr->objs);
Ns_MutexLock(&servPtr->adp.pagelock);
if (--pagePtr->refcnt == 0) {
if (pagePtr->hPtr != NULL) {
Tcl_DeleteHashEntry(pagePtr->hPtr);
... | false | false | false | false | false | 0 |
_response_board_conf (GtkButton *button,
gint arg1,
gpointer user_data)
{
GcomprisBoardConf *u= (GcomprisBoardConf*)user_data;
if (u->Confcallback){
switch (arg1){
case GTK_RESPONSE_APPLY:
/* Do not close the config dialog if the user returns FALSE */
if ( ! u->Confcallback(u->... | false | false | false | false | false | 0 |
setConfigItem(const char* tag, const char* value)
{
if (streq(tag, "headers")) {
char* cp = strcpy(new char[strlen(value) + 1], value);
char* tp;
do {
tp = strchr(cp, ' ');
if (tp) {
*tp++ = '\0';
}
if (streq(cp, "clear")) {
... | false | false | false | false | false | 0 |
archbar(file, dir)
CONST char *file, *dir;
{
#ifndef _NOBROWSE
int i;
#endif
CONST char *cp;
char *arch;
int len;
#ifndef _NOBROWSE
if (browselist) {
if (!browsevar) arch = Xstrdup(nullstr);
else {
len = 0;
for (i = 0; browsevar[i]; i++)
len += strlen(browsevar[i]) + 1;
arch = Xmalloc(len + 1);
... | false | false | false | false | false | 0 |
proc_icmp_redirect_off(const char *interface)
{
char fname[256];
int fd, ret = FALSE;
sprintf(fname, "/proc/sys/net/ipv4/conf/%s/send_redirects", interface);
fd = open(fname, O_WRONLY);
if (fd < 0)
return FALSE;
if (write(fd, "0\n", 2) == 2)
ret = TRUE;
close(fd);
return ret;
} | 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.