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 |
|---|---|---|---|---|---|---|
gnibbles_board_rescale (GnibblesBoard *board, gint tilesize)
{
gint i, count;
gfloat x_pos, y_pos;
ClutterActor *tmp;
if (!board->level)
return;
if (!board->surface)
return;
board->width = BOARDWIDTH * tilesize;
board->height = BOARDHEIGHT * tilesize;
clutter_actor_set_size (CLUTTER_ACTOR (bo... | false | false | false | false | false | 0 |
isTargetActionSupported(const string &target, const string &action)
{
bool res=false;
try
{
res = getTargetCapabilityBool(target, "actions/" + action + "/supported");
} catch (FWException &ex) { }
return res;
} | false | false | false | false | false | 0 |
menu_namecmp(name, mname)
char_u *name;
char_u *mname;
{
int i;
for (i = 0; name[i] != NUL && name[i] != TAB; ++i)
if (name[i] != mname[i])
break;
return ((name[i] == NUL || name[i] == TAB)
&& (mname[i] == NUL || mname[i] == TAB));
} | false | false | false | false | false | 0 |
os_curdir(void)
{
static string_ty *result;
if (!result)
{
string_ty *dot;
dot = str_from_c(".");
result = os_pathname(dot);
str_free(dot);
}
return str_copy(result);
} | false | false | false | false | false | 0 |
cmd_unalias (int interactive UNUSED, struct cmdarg **args)
{
int i;
/* Are we updating an existing alias, or creating a new one? */
i = find_alias_index (ARG_STRING(0));
if (i >= 0)
{
char *tmp;
alias_list_last--;
/* Free the alias and put the last alias in the the space to
kee... | false | false | false | false | false | 0 |
gpk_cell_renderer_info_set_property (GObject *object, guint param_id,
const GValue *value, GParamSpec *pspec)
{
const gchar *text;
gchar **split;
gboolean ret;
guint i;
PkInfoEnum info;
GpkCellRendererInfo *cru = GPK_CELL_RENDERER_INFO (object);
switch (param_id) {
case PROP_VALUE:
cru->priv->value ... | false | false | false | false | false | 0 |
writeBlock(const ByteVector &data)
{
uint size = data.size();
if(long(d->position + size) > length()) {
truncate(d->position + size);
}
memcpy(d->data.data() + d->position, data.data(), size);
d->position += size;
} | false | false | false | false | false | 0 |
_wrap_dpns_getpath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
u_signed64 arg2 ;
char *arg3 = (char *) 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
int result;
if (!PyArg_ParseTuple(args,(char *)"OOO:dpns_getpath",&ob... | false | false | false | false | false | 0 |
hostapd_set_rid(const char *dev, u16 rid, u8 *data, size_t len,
int show_err)
{
struct prism2_hostapd_param *param;
int res;
size_t blen = PRISM2_HOSTAPD_RID_HDR_LEN + len;
if (blen < sizeof(*param))
blen = sizeof(*param);
param = (struct prism2_hostapd_param *) malloc(blen);
if (param == NULL)
return ... | false | false | false | false | false | 0 |
handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
{
_pRequest = &request;
_pResponse = &response;
if (authenticate())
{
try
{
run();
}
catch (Poco::Exception& exc)
{
if (!response.sent())
{
sendErrorResponse(HTTPResponse::HTTP_INTERNAL_SERVER_ERROR, exc.displayText());
... | false | false | false | false | false | 0 |
string_slice (const gchar* self, glong start, glong end) {
gchar* result = NULL;
glong string_length = 0L;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
glong _tmp2_ = 0L;
glong _tmp5_ = 0L;
gboolean _tmp8_ = FALSE;
glong _tmp9_ = 0L;
gboolean _tmp12_ = FALSE;
glong _tmp13_ = 0L;
glong _tmp16_ = 0L;
glong _tmp17_ = 0L;... | false | false | false | false | false | 0 |
libsize (const luaL_Reg *l) {
int size = 0;
for (; l->name; l++) size++;
return size;
} | false | false | false | false | false | 0 |
eina_module_load(Eina_Module *m)
{
#ifdef HAVE_DLOPEN
void *dl_handle;
Eina_Module_Init *initcall;
EINA_SAFETY_ON_NULL_RETURN_VAL(m, EINA_FALSE);
DBG("m=%p, handle=%p, file=%s, refs=%d", m, m->handle, m->file, m->ref);
if (m->handle)
goto loaded;
dl_handle = dlopen(m->file, RTLD_NOW);
if ... | false | false | false | false | false | 0 |
writenet(const void *ptr, size_t len)
{
/* flush buffer if no room for new data) */
while ((&netobuf[BUFSIZ] - nfrontp) < len) {
/* if this fails, don't worry, buffer is a little big */
netflush();
}
if ((&netobuf[BUFSIZ] - nfrontp) < len)
abort();
memmove(nfrontp, ptr, len);
nfrontp += len;... | false | false | false | false | false | 0 |
acpi_battery_technology(struct acpi_battery *battery)
{
if (!strcasecmp("NiCd", battery->device_chemistry))
return POWER_SUPPLY_TECHNOLOGY_NiCd;
if (!strcasecmp("NiMH", battery->device_chemistry))
return POWER_SUPPLY_TECHNOLOGY_NiMH;
if (!strcasecmp("LION", battery->device_chemistry))
return POWER_SUPPLY_TECHN... | false | false | false | false | false | 0 |
inf_adopted_request_get_property(GObject* object,
guint prop_id,
GValue* value,
GParamSpec* pspec)
{
InfAdoptedRequest* request;
InfAdoptedRequestPrivate* priv;
request = INF_ADOPTED_REQUEST(object);
priv = INF_A... | false | false | false | false | false | 0 |
internalConnectSim(void)
{
lockDevice();
double offset = myOffsetAmount;
double increment = myIncrementAmount;
unlockDevice();
myRobot->lock();
// return true if we could send all the commands
if (myRobot->comInt(36, -ArMath::roundInt(offset)) && // Start angle
myRobot->comInt(37, ArMath::roundIn... | false | false | false | false | false | 0 |
navi_dialog_poll(GtkWidget *w, gpointer data)
{
gint32 frame_nr;
gint32 update_flag;
gint32 video_preview_size;
if(gap_debug) printf("navi_dialog_poll TIMER POLL\n");
if(naviD)
{
if(suspend_gimage_notify == 0)
{
update_flag = NUPD_IMAGE_MENU;
video_preview_size = nav... | false | false | false | false | false | 0 |
SetUp()
{
minValueTC_->Enable( true );
minLabel_->Enable( true );
incValueTC_->Enable( true );
incLabel_->Enable( true );
maxValueTC_->Enable( true );
maxLabel_->Enable( true );
numValueTC_->Enable( true );
numLabel_->Enable( true );
switch ( choicesRB_->GetSelection() )
{
case 0:
case 3:
... | false | false | false | false | false | 0 |
dump(fd)
FILE *fd;
{
register int i;
register struct hash *current;
fprintf(fd,"# Macros:\n");
for(i = 0; i < HASHSIZE; i++)
{
if (hashTable[i].name)
{
current = &hashTable[i];
while(current != (struct hash *) NIL)
{
if((current->name[0] != '$') &&
(current->name[0] != ... | false | false | false | false | false | 0 |
ata_read_log_page(struct ata_device *dev, u8 log,
u8 page, void *buf, unsigned int sectors)
{
unsigned long ap_flags = dev->link->ap->flags;
struct ata_taskfile tf;
unsigned int err_mask;
bool dma = false;
DPRINTK("read log page - log 0x%x, page 0x%x\n", log, page);
/*
* Return error without actuall... | false | false | false | false | false | 0 |
inflateReset(z_streamp strm)
{
struct inflate_state FAR *state;
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
state = (struct inflate_state FAR *)strm->state;
state->wsize = 0;
state->whave = 0;
state->wnext = 0;
return inflateResetKeep(strm);
} | false | false | false | false | false | 0 |
FindModifiedNodeSlot(SDNode *N,
SDValue Op1, SDValue Op2,
void *&InsertPos) {
if (doNotCSE(N))
return 0;
SDValue Ops[] = { Op1, Op2 };
FoldingSetNodeID ID;
AddNodeIDNode(ID, N->getOpcode(), N->getVTList(), Ops, 2);
AddN... | false | false | false | false | false | 0 |
esl_buffer_OpenMem(const char *p, esl_pos_t n, ESL_BUFFER **ret_bf)
{
ESL_BUFFER *bf = NULL;
int status;
if ((status = buffer_create(&bf)) != eslOK) goto ERROR;
bf->mem = (char *) p; /* force discard of const qualifier; this is ok; mem won't be altered in eslBUFFER_STRING mode */
bf->n = (... | false | false | false | false | false | 0 |
ExecuteOperation(RackspaceOperation &ro)
{
if (ConnectToServerManagementDomain(ro)==false)
return false;
RakNet::RakString command(
"%s %s/%s HTTP/1.1\n"
"Host: %s\n"
"Content-Type: application/xml\n"
"Content-Length: %i\n"
"Accept: application/xml\n"
"X-Auth-Token: %s\n",
ro.httpCommand.... | false | false | false | false | false | 0 |
qilog(NUMBER *q, ZVALUE base)
{
long n;
ZVALUE tmp1, tmp2;
if (qiszero(q))
return NULL;
if (qisunit(q))
return qlink(&_qzero_);
if (qisint(q))
return itoq(zlog(q->num, base));
tmp1 = q->num;
tmp1.sign = 0;
if (zrel(tmp1, q->den) > 0) {
zquo(tmp1, q->den, &tmp2, 0);
n = zlog(tmp2, base);
zfree(tmp2... | false | false | false | false | false | 0 |
object_info_out(const object_type *o_ptr, oinfo_detail_t mode)
{
bitflag flags[OF_SIZE];
bitflag pval_flags[MAX_PVALS][OF_SIZE];
bool something = FALSE;
bool known = object_is_known(o_ptr);
bool full = mode & OINFO_FULL;
bool terse = mode & OINFO_TERSE;
bool subjective = mode & OINFO_SUBJ;
bool ego = mode & OI... | false | false | false | false | false | 0 |
e_categories_add (const gchar *category,
const gchar *unused,
const gchar *icon_file,
gboolean searchable)
{
g_return_if_fail (category != NULL);
g_return_if_fail (*category);
if (!initialized)
initialize_categories ();
categories_add_full (category, icon_fi... | false | false | false | false | false | 0 |
_rl_move_vert (to)
int to;
{
register int delta, i;
if (_rl_last_v_pos == to || to > _rl_screenheight)
return;
if ((delta = to - _rl_last_v_pos) > 0)
{
for (i = 0; i < delta; i++)
putc ('\n', rl_outstream);
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_... | false | false | false | false | false | 0 |
create_session(struct l2tp_parm *p)
{
GENL_REQUEST(req, 1024, genl_family, 0, L2TP_GENL_VERSION,
L2TP_CMD_SESSION_CREATE, NLM_F_REQUEST | NLM_F_ACK);
addattr32(&req.n, 1024, L2TP_ATTR_CONN_ID, p->tunnel_id);
addattr32(&req.n, 1024, L2TP_ATTR_PEER_CONN_ID, p->peer_tunnel_id);
addattr32(&req.n, 1024, L2TP_ATT... | false | false | false | false | false | 0 |
update_eth_regs_async(pegasus_t *pegasus)
{
int ret = -ENOMEM;
struct urb *async_urb;
struct usb_ctrlrequest *req;
req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
if (req == NULL)
return ret;
async_urb = usb_alloc_urb(0, GFP_ATOMIC);
if (async_urb == NULL) {
kfree(req);
return ret;
}
req->bR... | false | false | false | false | false | 0 |
avlalloc(void *(*key) (), void *(*value) (), int (*compare) (), void *(*insert) (), void *(*replace) (),
void (*remove) ())
{
struct avl *p;
if (key == (void *(*) ()) (0))
key = _key;
if (value == (void *(*) ()) (0))
value = _value;
if (compare == (int (*) ()) (0))
compare = _compare;
if ... | false | false | false | false | false | 0 |
xmt_restore_context(GF_SceneLoader *load)
{
u32 i;
GF_StreamContext *sc;
GF_XMTParser *parser = (GF_XMTParser *)load->loader_priv;
if (!parser || !load->ctx) return GF_BAD_PARAM;
/*restore context - note that base layer are ALWAYS declared BEFORE enhancement layers with gpac parsers*/
i=0;
while ((sc = (GF_Stre... | false | false | false | false | false | 0 |
change_dir_to_diag( int *dir)
{
if (*dir == 8) *dir = 7;
if (*dir == 4) *dir = 1;
if (*dir == 2) *dir = 3;
if (*dir == 6) *dir = 9;
} | false | false | false | false | false | 0 |
addAccepted(std::string caseName,std::string methodName)
{
//error
if (caseName.empty() && methodName.empty())
return;
//ok
svutTestFilterBasicRule entry = {caseName,methodName};
filters.push_back(entry);
} | false | false | false | false | false | 0 |
xmlGetAttrPairN(xmlNodePtr el, unsigned int n, xmlChar **attr_name,
xmlChar **attr_value)
{
xmlAttr *attr;
if ((attr = xmlGetAttrN(el, n)) == NULL)
return(-1);
if (attr_name != NULL)
*attr_name = xmlStrdup(attr->name);
if (attr_value != NULL) {
if (attr->children == NULL || attr->children->type != XML... | false | false | false | false | false | 0 |
tog_more(Var *var)
{
if (!more) clear_more(display_screen->outcount);
else reset_outcount(display_screen);
return 1;
} | false | false | false | false | false | 0 |
SFileHasFile(HANDLE hMpq, const char * szFileName)
{
TMPQArchive * ha = (TMPQArchive *)hMpq;
DWORD dwFileIndex = 0;
int nError = ERROR_SUCCESS;
if(!IsValidMpqHandle(ha))
nError = ERROR_INVALID_HANDLE;
if(szFileName == NULL || *szFileName == 0)
nError = ERROR_INVALID_PARAMET... | false | false | false | false | false | 0 |
create_boot_params(CHAR16 *args, memdesc_t *initrd, memdesc_t *vmcode, UINTN *cookie)
{
/*
* XXX: need cleanup
* See ia32 code for explanation on why it is so big.
*/
#define BOOT_PARAM_MEMSIZE 16384
UINTN bpsize, cmdline_size;
boot_params_t *bp;
CHAR8 *cp;
CHAR16 ch;
/*
* Allocate runtime services memory... | false | false | false | false | false | 0 |
SeriesDescriptionCallback(DICOMParser *,
doublebyte,
doublebyte,
DICOMParser::VRTypes,
unsigned char* val,
quadbyte len )
{
... | false | false | false | false | false | 0 |
_st_add_entry(NormalSortTabPage *self, TabEntry *entry) {
GtkTreeIter iter;
GtkTreeModel *model;
NormalSortTabPagePrivate *priv = NORMAL_SORT_TAB_PAGE_GET_PRIVATE(self);
model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
g_return_if_fail (model != NULL);
/* Insert the compilation entry betw... | false | false | false | false | false | 0 |
awt_create_selection_list_on_table_fields(GBDATA *gb_main,AW_window *aws,const char *table_name, const char *varname)
{
AW_selection_list *id;
struct awt_sel_list_for_tables *cbs;
GB_push_transaction(gb_main);
id = aws->create_selection_list(varname,0,"",40,8);
cbs = new awt_sel_list_for_tables;
... | false | false | false | false | false | 0 |
Detach()
{
CPLMutexHolderD( &hRBMutex );
if( poOldest == this )
poOldest = poPrevious;
if( poNewest == this )
{
poNewest = poNext;
}
if( poPrevious != NULL )
poPrevious->poNext = poNext;
if( poNext != NULL )
poNext->poPrevious = poPrevious;
poPreviou... | false | false | false | false | false | 0 |
composite_to_jsonb(Datum composite, JsonbInState *result)
{
HeapTupleHeader td;
Oid tupType;
int32 tupTypmod;
TupleDesc tupdesc;
HeapTupleData tmptup,
*tuple;
int i;
td = DatumGetHeapTupleHeader(composite);
/* Extract rowtype info and find a tupdesc */
tupType = HeapTupleHeaderGetTypeId(td);
tupT... | false | false | false | false | false | 0 |
lto_create_files_from_ids (splay_tree_node node, void *data)
{
struct lwstate *lw = (struct lwstate *)data;
struct lto_file_decl_data *file_data = (struct lto_file_decl_data *)node->value;
lto_file_finalize (file_data, lw->file);
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Creating file %s with sub i... | false | true | false | false | true | 1 |
type_engine_scan2_prog( Chuck_Env * env, a_Program prog,
te_HowMuch how_much )
{
t_CKBOOL ret = TRUE;
if( !prog )
return FALSE;
// log
EM_log( CK_LOG_FINER, "(pass 2) type verification scan '%s'...",
env->context->filename.c_str() );
// push inden... | false | false | false | false | false | 0 |
mouseReleaseEvent(QGraphicsSceneMouseEvent * event) {
if (m_corner == ResizableBoard::NO_CORNER) {
Board::mouseReleaseEvent(event);
return;
}
event->accept();
m_corner = ResizableBoard::NO_CORNER;
setKinCursor(Qt::ArrowCursor);
InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this... | false | false | false | false | false | 0 |
t1_getwmsedec(
OPJ_INT32 nmsedec,
OPJ_UINT32 compno,
OPJ_UINT32 level,
OPJ_UINT32 orient,
OPJ_INT32 bpno,
OPJ_UINT32 qmfbid,
OPJ_FLOAT64 stepsize,
OPJ_UINT32 numcomps,
const OPJ_FLOAT64 * mct_norms)
{
OPJ_FLOAT64 w1 = 1, w2, wmsedec;
if
(mct_norms)
{
w1 = mct_norms[comp... | false | false | false | false | false | 0 |
set_snomask(struct Client *cptr, unsigned int newmask, int what)
{
unsigned int oldmask, diffmask; /* unsigned please */
int i;
struct SLink *tmp;
oldmask = cli_snomask(cptr);
if (what == SNO_ADD)
newmask |= oldmask;
else if (what == SNO_DEL)
newmask = oldmask & ~newmask;
else if (what !=... | false | false | false | false | false | 0 |
arenas_initialized_ctl(const size_t *mib, size_t miblen, void *oldp,
size_t *oldlenp, void *newp, size_t newlen)
{
int ret;
unsigned nread, i;
malloc_mutex_lock(&ctl_mtx);
READONLY();
if (*oldlenp != narenas * sizeof(bool)) {
ret = EINVAL;
nread = (*oldlenp < narenas * sizeof(bool))
? (*oldlenp / si... | false | false | false | false | false | 0 |
draw_background (GsdBackgroundManager *manager,
gboolean use_crossfade)
{
GdkDisplay *display;
int n_screens;
int i;
if (nautilus_is_drawing_background (manager) ||
dont_draw_background (manager)) {
return;
... | false | false | false | false | false | 0 |
init_cs_connection(crm_cluster_t * cluster)
{
int retries = 0;
while (retries < 5) {
int rc = init_cs_connection_once(cluster);
retries++;
switch (rc) {
case CS_OK:
return TRUE;
break;
case CS_ERR_TRY_AGAIN:
case CS_E... | false | false | false | false | false | 0 |
spk_serial_release(void)
{
if (speakup_info.port_tts == 0)
return;
synth_release_region(speakup_info.port_tts, 8);
speakup_info.port_tts = 0;
} | false | false | false | false | false | 0 |
arti_speak(obj)
struct obj *obj;
{
register const struct artifact *oart = get_artifact(obj);
const char *line;
char buf[BUFSZ];
/* Is this a speaking artifact? */
if (!oart || !(oart->spfx & SPFX_SPEAK))
return;
line = getrumor(bcsign(obj), buf, TRUE);
if (!*line)
line = "NetHack rumors file closed fo... | false | false | false | false | false | 0 |
soap_out_SOAP_ENV__Detail(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Detail *a, const char *type)
{
(void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Detail), type))
return soap->error;
soap_outliteral(soap, ... | false | false | false | false | false | 0 |
gbcpu_step(void)
{
uint8_t op;
if (!gbcpu_halted) {
op = mem_get(gbcpu_regs.rn.pc++);
DPRINTF("%04x: %02x", gbcpu_regs.rn.pc - 1, op);
ops[op].fn(op, &ops[op]);
DEB(show_reg_diffs());
return 1;
}
if (gbcpu_halted == 1 && gbcpu_if == 0) {
fprintf(stderr, "CPU locked up (halt with interrupts disabled).\... | false | false | false | false | false | 0 |
TestCapability( const char * pszCap )
{
if (EQUAL(pszCap,OLCFastFeatureCount) &&
m_poFilterGeom == NULL && m_poAttrQuery == NULL )
return TRUE;
else
return FALSE;
} | false | false | false | false | false | 0 |
chrec_fold_automatically_generated_operands (tree op0,
tree op1)
{
if (op0 == chrec_dont_know
|| op1 == chrec_dont_know)
return chrec_dont_know;
if (op0 == chrec_known
|| op1 == chrec_known)
return chrec_known;
if (op0 == chrec_not_analyzed_yet
|| op1 == chrec_not_analyzed_ye... | false | false | false | false | false | 0 |
scm_load_internal(const char *filename)
{
ScmObj path, port, sexp;
char *c_path;
#if SCM_USE_MULTIBYTE_CHAR
ScmCharCodec *saved_codec;
#endif
DECLARE_INTERNAL_FUNCTION("load");
CDBG((SCM_DBG_FILE, "loading ~S", filename));
c_path = find_path(filename);
if (!c_path)
ERR("file \"~S\"... | false | false | false | false | false | 0 |
check_cred(struct webauth_context *ctx, const struct webauth_token_cred *cred,
enum encode_mode mode)
{
CHECK_STR( cred, subject);
CHECK_STR( cred, type);
CHECK_STR( cred, service);
CHECK_DATA(cred, data);
CHECK_EXP( cred, expiration, mode);
return check_cred_type(ctx, cred->type);
} | false | false | false | false | false | 0 |
update_sample_mask( struct st_context *st )
{
unsigned sample_mask = 0xffffffff;
struct pipe_framebuffer_state *framebuffer = &st->state.framebuffer;
/* dependency here on bound surface (or rather, sample count) is worrying */
unsigned sample_count = util_framebuffer_get_num_samples(framebuffer);
if (st... | false | false | false | false | false | 0 |
cb_close_conn_pool(cb_conn_pool * pool) {
cb_outgoing_conn *conn, *nextconn;
int secure = pool->secure;
int i = 0;
slapi_lock_mutex( pool->conn.conn_list_mutex );
if (secure) {
for (i=0; i< MAX_CONN_ARRAY; i++) {
for (conn = pool->connarray[i]; conn != NULL; conn = nextconn) {
if ( conn->statu... | false | false | false | false | false | 0 |
dl_get (const DataList *dl, const void *element, CMPFN cmpfn)
{
int i;
PR_ASSERT (dl);
PR_ASSERT (element);
PR_ASSERT (cmpfn);
for (i = 0; i < dl->element_count; i++)
{
if (cmpfn (dl->elements[i], element) == 0)
{
return dl->elements[i];
}
}
return NULL;
} | false | false | false | false | false | 0 |
add_one_base_init (tree binfo, tree parm, bool move_p, tree inh,
tree member_init_list)
{
tree init;
if (inh)
{
/* An inheriting constructor only has a mem-initializer for
the base it inherits from. */
if (BINFO_TYPE (binfo) != inh)
return member_init_list;
tree *p = &init;
ini... | false | false | false | false | false | 0 |
gent_dataset2(void)
{
hid_t fid, dataset, space, create_plist;
hsize_t dims[2];
hsize_t maxdims[2];
int dset1[10][20];
double dset2[30][10];
int i, j;
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
create_plist = H5Pcreate(H5P_DATASET_CREATE);
dims[0] = 5; dims[1] ... | false | false | false | false | false | 0 |
get_opcode(const char *cp, const char *filename, int linenum) {
unsigned int i;
for (i = 0; commands[i].name; i++)
if (strcasecmp(cp, commands[i].name) == 0)
return commands[i].opcode;
fprintf(stderr, "%.200s: line %d: Bad configuration option: %.200s\n",
filename, linenum, cp);
return oBadCmd;
} | false | false | false | false | false | 0 |
ExecReScanSetOp(SetOpState *node, ExprContext *exprCtxt)
{
ExecClearTuple(node->ps.ps_ResultTupleSlot);
node->ps.ps_OuterTupleSlot = NULL;
node->subplan_done = false;
node->numOutput = 0;
/*
* if chgParam of subnode is not null then plan will be re-scanned by
* first ExecProcNode.
*/
if (((PlanState *) nod... | false | false | false | false | false | 0 |
printLabels (std::ostream& os) const
{
for (constLabelIterator l = m_labels.begin(); l != m_labels.end(); l++) {
const Array2dFileLabel& label = **l;
label.print (os);
os << std::endl;
}
} | false | false | false | false | false | 0 |
add( HTMLElementImpl* element, HTMLElementImpl* before, int& exceptioncode )
{
if(!element || element->id() != ID_OPTION)
return;
HTMLOptionElementImpl* option = static_cast<HTMLOptionElementImpl*>(element);
//Fast path for appending an item. Can't be done if it is selected and
//we're single-s... | false | false | false | false | false | 0 |
length_LastReq(const LastReq *data)
{
size_t ret = 0;
{
size_t Top_tag_oldret = ret;
unsigned int n_Top_tag;
ret = 0;
for(n_Top_tag = (data)->len; n_Top_tag > 0; --n_Top_tag){
size_t Top_tag_for_oldret = ret;
ret = 0;
{
size_t Top_tag_S_Of_tag_oldret = ret;
ret = 0;
ret += length_LR_TYPE(&(&(data)->val[n_Top_tag - 1])-... | false | false | false | false | false | 0 |
icmViewingConditions_write(
icmBase *pp,
unsigned int of /* File offset to write from */
) {
icmViewingConditions *p = (icmViewingConditions *)pp;
icc *icp = p->icp;
unsigned int len;
char *bp, *buf; /* Buffer to write from */
int rv = 0;
/* Allocate a file write buffer */
if ((len = p->get_size((icmBase *... | false | true | false | false | false | 1 |
ims_pcu_init_application_mode(struct ims_pcu *pcu)
{
static atomic_t device_no = ATOMIC_INIT(-1);
const struct ims_pcu_device_info *info;
int error;
error = ims_pcu_get_device_info(pcu);
if (error) {
/* Device does not respond to basic queries, hopeless */
return error;
}
error = ims_pcu_identify_type(pcu... | false | false | false | false | false | 0 |
clutter_input_device_get_device_coords (ClutterInputDevice *device,
gint *x,
gint *y)
{
ClutterPoint point;
clutter_input_device_get_coords (device, NULL, &point);
if (x)
*x = point.x;
if (y)
*... | false | false | false | false | false | 0 |
folder_search_get_size (CamelSExp *sexp,
gint argc,
CamelSExpResult **argv,
CamelFolderSearch *search)
{
CamelSExpResult *r;
r (printf ("executing get-size\n"));
/* are we inside a match-all? */
if (search->current) {
r = camel_sexp_result_... | false | false | false | false | false | 0 |
compress_file(char *filename, int mode_num)
{
char *temp_fn, randstr[5];
int ret;
/* Create temporary filename. */
temp_fn = nmalloc(strlen(filename) + 5);
make_rand_str(randstr, 4);
strcpy(temp_fn, filename);
strcat(temp_fn, randstr);
/* Compress file. */
ret = compress_to_file(filename, temp_fn, m... | true | true | false | false | false | 1 |
timeval_sub(struct timeval recent, struct timeval old)
{
float diff;
if (old.tv_usec > recent.tv_usec) {
diff = 1000000 + recent.tv_usec - old.tv_usec;
recent.tv_sec--;
} else
diff = recent.tv_usec - old.tv_usec;
diff += (float)(recent.tv_sec - old.tv_sec) * 1000000;
return diff;
} | false | false | false | false | false | 0 |
thunderbirdPreferences( void ) {
GtkWidget *psDialog;
GtkFileFilter *psFilter;
gint nResult;
gchar *pnDir;
gchar anFile[ 256 ];
const gchar *pnBook;
psDialog = gtk_file_chooser_dialog_new( _( "Select Thunderbird addressbook" ), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK... | false | false | false | false | false | 0 |
defineOptions(OptionSet& options)
{
for (SubsystemVec::iterator it = _subsystems.begin(); it != _subsystems.end(); ++it)
{
(*it)->defineOptions(options);
}
} | false | false | false | false | false | 0 |
ql_dump_buffer(uint32_t level, scsi_qla_host_t *vha, int32_t id,
uint8_t *b, uint32_t size)
{
uint32_t cnt;
uint8_t c;
if (!ql_mask_match(level))
return;
ql_dbg(level, vha, id, " 0 1 2 3 4 5 6 7 8 "
"9 Ah Bh Ch Dh Eh Fh\n");
ql_dbg(level, vha, id, "--------------------------------... | false | false | false | false | false | 0 |
lookup (const struct table_entry *table, size_t table_size, int32_t rel_ip)
{
unsigned long table_len = table_size / sizeof (struct table_entry);
const struct table_entry *e = 0;
unsigned long lo, hi, mid;
/* do a binary search for right entry: */
for (lo = 0, hi = table_len; lo < hi;)
{
mid = (lo ... | false | false | false | false | false | 0 |
mono_gc_weak_link_add (void **link_addr, MonoObject *obj, gboolean track)
{
/* libgc requires that we use HIDE_POINTER... */
*link_addr = (void*)HIDE_POINTER (obj);
if (track)
GC_REGISTER_LONG_LINK (link_addr, obj);
else
GC_GENERAL_REGISTER_DISAPPEARING_LINK (link_addr, obj);
} | false | false | false | false | false | 0 |
makeCompletion(const QString& text)
{
//kDebug() << text << "d->cwd=" << d->cwd;
KUrlCompletionPrivate::MyURL url(text, d->cwd);
d->compl_text = text;
// Set d->prepend to the original URL, with the filename [and ref/query] stripped.
// This is what gets prepended to the directory-listing matches... | false | false | false | false | false | 0 |
exp1 (LexState *ls) {
vardesc v;
exp0(ls, &v);
lua_pushvar(ls, &v);
if (is_in(ls->token, expfollow) < 0)
luaX_error(ls, "ill-formed expression");
} | false | false | false | false | false | 0 |
pkix_CacheCertChain_Lookup(
PKIX_PL_Cert* targetCert,
PKIX_List* anchors,
PKIX_PL_Date *testDate,
PKIX_Boolean *pFound,
PKIX_BuildResult **pBuildResult,
void *plContext)
{
PKIX_List *cachedValues = NULL;
PKIX_List *cachedKeys = NULL;
PKIX_Error *ca... | false | false | false | false | false | 0 |
marble_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
{
GstMarble *marble = GST_MARBLE_CAST (gt);
gint displacement;
displacement = 127 * (1 + noise_2 (marble->noise, x / marble->xscale,
y / marble->xscale));
displacement = CLAMP (displacement, 0, 255);
*in_x ... | false | false | false | false | false | 0 |
stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
{
int i;
if (stbi_jpeg_test_memory(buffer,len))
return stbi_jpeg_load_from_memory(buffer,len,x,y,comp,req_comp);
if (stbi_png_test_memory(buffer,len))
return stbi_png_load_from_memory(buffer,len,x,y,comp,... | false | false | false | false | false | 0 |
lame_set_force_short_blocks(lame_global_flags * gfp, int short_blocks)
{
if (is_lame_global_flags_valid(gfp)) {
/* enforce disable/enable meaning, if we need more than two values
we need to switch to an enum to have an apropriate representation
of the possible meanings of the value */
... | false | false | false | false | false | 0 |
ho_dimentions_get_columns (const ho_bitmap * m)
{
int i, return_val;
int hlink_value;
ho_bitmap *m_cols = NULL;
ho_bitmap *m_temp = NULL;
ho_objmap *m_obj = NULL;
ho_bitmap *m_clean;
/* clean tresholding artefacts from image */
if (m->width > 120 && m->height > 120)
{
m_clean = ho_bitmap_clone_wi... | false | false | false | false | false | 0 |
write (const std::valarray<std::complex<double> >& indata,
const std::vector<long>& vectorLengths,
long firstRow)
{
using std::valarray;
firstRow = std::max(firstRow,static_cast<long>(1));
if (ColumnVectorData<std::complex<double> >* col
... | false | false | false | false | false | 0 |
agent_disconnect(Agent *agent, int fd)
{
int ret, err;
if (!agent)
return set_errno(EINVAL);
if ((err = agent_wrlock(agent)))
return set_errno(err);
ret = agent_disconnect_unlocked(agent, fd);
if ((err = agent_unlock(agent)))
return set_errno(err);
return ret;
} | false | false | false | false | false | 0 |
set_clabel()
{
char *new_format;
c_token++;
label_contours = TRUE;
if ((new_format = try_to_get_string())) {
strncpy(contour_format, new_format, sizeof(contour_format));
free(new_format);
}
} | false | false | false | false | false | 0 |
GetHeight(double loc[2], int ij[2])
{
// Compute the ij location (assuming 2D image plane)
//
int i;
double pcoords[2];
for (i=0; i<2; i++)
{
if ( ij[i] >= this->Extent[i*2] && ij[i] < this->Extent[i*2 + 1] )
{
pcoords[i] = loc[i] - (double)ij[i];
}
else if ( ij[i] < this->E... | false | false | false | false | false | 0 |
handleScrollPane(const EventArgs& e)
{
const WindowEventArgs& wargs = static_cast<const WindowEventArgs&>(e);
size_t i;
float delta = 0;
// Find the leftmost visible button
for (i = 0; i < d_tabButtonVector.size(); ++i)
{
if (d_tabButtonVector [i]->isVisible (true))
break;
... | false | false | false | false | false | 0 |
parse_strip(const gchar *name)
{
gint i;
gchar *base, *temp;
temp = g_path_get_basename(name);
/* get the rightmost '.' */
for (i=strlen(temp) ; i-- ; )
if (*(temp+i) == '.')
{
base = g_strndup(temp, i);
g_free(temp);
return(base);
}
/* not found - return the whole thing */
return(temp);
} | false | false | false | false | false | 0 |
fsa9480_remove(struct i2c_client *client)
{
struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client);
if (client->irq)
free_irq(client->irq, usbsw);
sysfs_remove_group(&client->dev.kobj, &fsa9480_group);
device_init_wakeup(&client->dev, 0);
kfree(usbsw);
return 0;
} | false | false | false | false | false | 0 |
remove_unprovisioned_services()
{
gchar **services;
GKeyFile *keyfile, *configkeyfile;
char *file, *section;
int i = 0;
services = connman_storage_get_services();
if (services == NULL)
return;
for (;services[i] != NULL; i++) {
file = section = NULL;
keyfile = configkeyfile = NULL;
keyfile = connman_st... | false | false | false | false | false | 0 |
soap_env_get_body(SoapEnv * env)
{
xmlNodePtr node;
if (env == NULL)
{
log_error1("env object is NULL");
return NULL;
}
if (env->root == NULL)
{
log_error1("env has no xml");
return NULL;
}
for (node = soap_xml_get_children(env->root); node; node = soap_xml_get_next(node))
{
if ... | false | false | false | false | false | 0 |
protocol_connect( proto *p, const char *host, int port ) {
PHOST h = phost_resolve(host);
if( h == UNRESOLVED_HOST )
return proto_error(p,"Failed to resolve host");
p->s = psock_create();
if( p->s == INVALID_SOCKET )
return proto_error(p,"Failed to create socket");
if( psock_connect(p->s,h,port) != PS_OK )
r... | false | false | false | false | false | 0 |
sisusb_outurb_available(struct sisusb_usb_data *sisusb)
{
int i;
for (i = 0; i < sisusb->numobufs; i++) {
if ((sisusb->urbstatus[i] & (SU_URB_BUSY|SU_URB_ALLOC)) == 0)
return i;
}
return -1;
} | false | false | false | false | false | 0 |
destroysyntax(int &lexpos, int &lineno)
{
int idno=0;
lexmovenext(lexpos);
if (id!=outArray[lexpos])
outerror(lineno, "function name is missing.");
else
{
idno=idnosyn++;
lexmovenext(lexpos);
}
Instruct.insert(destroye, idno);
moveoverreturn(lexpos, lineno);
} | 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.