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 |
|---|---|---|---|---|---|---|
invertNormals ()
{
for (int i = 0; i < object [0]->numVertices; i ++)
{
object [0]->vertex [i].normal.neg ();
}
} | false | false | false | false | false | 0 |
readLine(UCHARBUF *f, UnicodeString &fileLine, IcuToolErrorCode &errorCode) {
int32_t lineLength;
const UChar *line = ucbuf_readline(f, &lineLength, errorCode);
if(line == NULL || errorCode.isFailure()) { return FALSE; }
// Strip trailing CR/LF, comments, and spaces.
const UChar *comment = u_memchr(... | false | false | false | false | false | 0 |
OP_STMDB2(armcpu_t *cpu)
{
u32 i, c, b;
u32 start;
u32 oldmode;
if(cpu->CPSR.bits.mode==USR)
return 2;
i = cpu->instruction;
c=0;
start = cpu->R[REG_POS(i,16)];
oldmode = armcpu_switchMode(cpu, SYS);
for(b=0; b<16; ++b)
{
if(BIT_N(i, 15-b))
... | false | false | false | false | false | 0 |
broadwater_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
I915_WRITE(RENCLK_GATE_D1, I965_RCZ_CLOCK_GATE_DISABLE |
I965_RCC_CLOCK_GATE_DISABLE |
I965_RCPB_CLOCK_GATE_DISABLE |
I965_ISC_CLOCK_GATE_DISABLE |
I965_FBC_CLOCK_GATE_DISABLE);
I915_WRIT... | false | false | false | false | false | 0 |
Save(const TreeMap *src,FILE *stream, SaveFunction saveFn,void *arg)
{
struct Node *rvp;
size_t elemsiz;
if (src == NULL) {
iError.RaiseError("Save",CONTAINER_ERROR_BADARG);
return CONTAINER_ERROR_BADARG;
}
if (stream == NULL) {
src->RaiseError("Save",CONTAINER_ERROR_BADARG);
ret... | false | false | false | false | false | 0 |
sap_init_socket_single(struct sap_s *sap) {
char *maddr;
int port;
sap->fd=socket_open(NULL, 0);
if (sap->fd == -1) {
fprintf(stderr, "Unable to open SAP socket\n");
exit(-1);
}
/* Last resort Multicast config */
maddr=SAP_V4_GLOBAL_ADDRESS;
port=SAP_PORT;
/* get SAP remote address from scope or grou... | false | false | false | false | false | 0 |
_setup_requeue(agent_arg_t *agent_arg_ptr, thd_t *thread_ptr,
int count, int *spot)
{
ret_data_info_t *ret_data_info = NULL;
ListIterator itr = list_iterator_create(thread_ptr->ret_list);
while((ret_data_info = list_next(itr))) {
debug2("got err of %d", ret_data_info->err);
if (ret_data_info->err != DSH_NO_... | false | false | false | false | false | 0 |
AllocateRowsFromDataSet(vtkDataSet* dataSet, int numberOfVariables)
{
if (dataSet==NULL)
{
vtkErrorMacro(<<"No dataSet provided.");
return;
}
vtkvmtkNeighborhood* neighborhood;
if (vtkPolyData::SafeDownCast(dataSet))
{
neighborhood = vtkvmtkPolyDataNeighborhood::New();
}
else if (vt... | false | false | false | false | false | 0 |
vm_instructions(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced, int in_urgent)
{
if (vms->starting && !strncasecmp(ast_channel_language(chan), "zh", 2)) { /* CHINESE (Taiwan) syntax */
return vm_instructions_zh(chan, vmu, vms, skipadvanced, in_urgent);
} else { /* Defa... | false | false | false | false | false | 0 |
rmaps_lama_hwloc_compare_subtrees(hwloc_obj_t left, hwloc_obj_t right)
{
int i, ret;
/*
* Check Types
*/
if( 0 != (ret = hwloc_compare_types(left->type, right->type)) ) {
return ret;
}
/*
* Check 'arity' at this level
*/
if( left->arity > right->arity ) {
re... | false | false | false | false | false | 0 |
apcsmart_ups_shutdown_with_delay(UPSINFO *ups, int shutdown_delay)
{
char response[32];
/*
* K K command
*
* This method should turn the UPS off completely according to this article:
* http://nam-en.apc.com/cgi-bin/nam_en.cfg/php/enduser/std_adp.php?p_faqid=604
*/
writechar('K', ups);
... | false | false | false | false | false | 0 |
board_button_release_event(GtkWidget *widget,
GdkEventButton *be,
gpointer data) {
Board *me;
int x,y;
bool must_repaint=false;
bool drop_from_drag=false;
if (be==0) return 0;
me=(Board *)data;
if ((be->button==1)&&(me->dr_active)) {
if (me->dr_step)
must_repaint=true;
me->... | false | false | false | false | false | 0 |
do_cmd_wiz_unhide(int d)
{
int i;
/* Process monsters */
for (i = 1; i < mon_max; i++)
{
monster_type *m_ptr = &mon_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
/* Skip distant monsters */
if (m_ptr->cdis > d) continue;
/* Optimize -- Repair flags */
repair_mflag_mark = repair_mf... | false | false | false | false | false | 0 |
match_it(aClient *one, char *mask, int what)
{
switch (what)
{
case MATCH_HOST:
return (match(mask, one->user->host)==0);
case MATCH_SERVER:
default:
return (match(mask, one->user->server)==0);
}
} | false | false | false | false | false | 0 |
Readin(Ainfile *f)
{
AString *temp;
temp = f->GetStr();
itemtype = LookupItem(temp);
delete temp;
amount = f->GetInt();
baseamount = f->GetInt();
if (itemtype == I_SILVER) temp = f->GetStr();
else temp = new AString(ItemDefs[itemtype].pSkill);
skill = LookupSkill(temp);
delete temp;
productivity = f->Get... | false | false | false | false | false | 0 |
PrivateScene_Process(GF_Codec *codec, u32 TimeAvailable)
{
u32 now;
GF_Channel *ch;
GF_Scene *scene_locked;
GF_SceneDecoder *sdec = (GF_SceneDecoder *)codec->decio;
GF_Err e = GF_OK;
/*muting systems codec means we don't decode until mute is off - likely there will be visible however
there is no other way to de... | false | false | false | false | false | 0 |
feature_in_list(char **l, char *f)
{
char *p;
int rv = 0, forced_off;
for(; l && *l; l++){
p = (forced_off = !struncmp(*l, "no-", 3)) ? *l + 3 : *l;
if(!strucmp(p, f))
rv = forced_off ? -1 : 1;
}
return(rv);
} | false | false | false | false | false | 0 |
xmmsv_list_iter_valid (xmmsv_list_iter_t *it)
{
return it && (it->position < it->parent->size) && (it->position >= 0);
} | false | false | false | false | false | 0 |
dictReplaceRaw(dict *d, void *key) {
dictEntry *entry = dictFind(d,key);
return entry ? entry : dictAddRaw(d,key);
} | false | false | false | false | false | 0 |
session_init (void)
{
Any_Type arg;
if (!param.max_conns)
param.max_conns = MAX_CONN;
if (!param.max_piped)
{
if (param.http_version >= 0x10001)
param.max_piped = MAX_PIPED;
else
/* no pipelining before HTTP/1.1... */
param.max_piped = 1;
}
if (param.max_conns > MAX_CONN)
{
... | false | false | false | false | false | 0 |
S_sublex_done(pTHX)
{
dVAR;
if (!PL_lex_starts++) {
SV * const sv = newSVpvs("");
if (SvUTF8(PL_linestr))
SvUTF8_on(sv);
PL_expect = XOPERATOR;
pl_yylval.opval = (OP*)newSVOP(OP_CONST, 0, sv);
return THING;
}
if (PL_lex_casemods) { /* oops, we've got some unbalanced parens */
PL_lex_state =... | false | false | false | false | false | 0 |
objc_is_id (tree type)
{
if (type && TREE_CODE (type) == IDENTIFIER_NODE)
{
tree t = identifier_global_value (type);
if (t)
type = t;
}
if (type && TREE_CODE (type) == TYPE_DECL)
type = TREE_TYPE (type);
/* NB: This function may be called before the ObjC front-end has
been initiali... | false | false | false | false | false | 0 |
Nsendfile(int fromfd, int tofd, const char *buf, size_t count)
{
off_t offset;
#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__) && defined(MAC_OS_X_VERSION_10_6))
off_t sent;
#endif
register size_t nleft;
register ssize_t r;
nleft = count;
while (nleft > 0) {
offset = count... | false | false | false | false | false | 0 |
_tenAnisoTen_Skew_d(const double _t[7]) {
double Q, num, dnm, ret, mn, ten[7];
mn = TEN_T_TRACE(_t)/3;
TEN_T_SET(ten, _t[0], _t[1]-mn, _t[2], _t[3], _t[4]-mn, _t[5], _t[6]-mn);
Q = _tenAnisoTen_Q_d(ten);
num = _tenAnisoTen_R_d(ten);
dnm = Q*sqrt(2*Q);
ret = dnm ? num/dnm : 0.0;
return AIR_CLAMP(-OOSQRT2... | false | false | false | false | false | 0 |
cx_list_splice(cx_list *tlist, cx_list_iterator position,
cx_list *slist, cx_list_iterator first,
cx_list_iterator last)
{
(void)slist; (void)tlist; /* Prevent warnings if cx_assert is disabled. */
cx_assert(slist != NULL);
cx_assert(first == _cx_list_end(slist)... | false | false | false | false | false | 0 |
fuse_fs_init(void)
{
int err;
fuse_inode_cachep = kmem_cache_create("fuse_inode",
sizeof(struct fuse_inode),
0, SLAB_HWCACHE_ALIGN,
fuse_inode_init_once);
err = -ENOMEM;
if (!fuse_inode_cachep)
goto out;
err = register_fuseblk();
if (err)
goto out2;
err = register_filesyst... | false | false | false | false | false | 0 |
job_table_init(int table_size)
{
int i;
GFARM_MALLOC_ARRAY(job_table, table_size);
if (job_table == NULL) {
errno = ENOMEM; gflog_fatal_errno(GFARM_MSG_1000294,
"job table");
}
for (i = 0; i < table_size; i++)
job_table[i] = NULL;
job_table_size = table_size;
} | false | false | false | false | false | 0 |
run_process_all(gboolean remote)
{
gchar *fout = g_strdup_printf("%s%stmp%sfout",gabedit_directory(),G_DIR_SEPARATOR_S,G_DIR_SEPARATOR_S);
gchar *ferr = g_strdup_printf("%s%stmp%sferr",gabedit_directory(),G_DIR_SEPARATOR_S,G_DIR_SEPARATOR_S);
gchar *command;
GtkWidget* Text[2];
GtkWidget* Frame[2];
GtkW... | false | false | false | false | false | 0 |
getImageRon(VimosImage *image)
{
const char modName[] = "getImageRon";
char comment[MAX_COMMENT_LENGTH];
VimosFloatArray *ron;
double dValue;
int nPorts = 0;
int i = 0;
if (!image) {
cpl_msg_debug(modName, "NULL input");
return NULL;
}
if... | false | false | false | false | false | 0 |
garcon_menu_node_tree_get_layout_merge_type (GNode *tree)
{
g_return_val_if_fail (garcon_menu_node_tree_get_node_type (tree) == GARCON_MENU_NODE_TYPE_MERGE, 0);
return ((GarconMenuNode *)tree->data)->data.layout_merge_type;
} | false | false | false | false | false | 0 |
wm8770_spi_remove(struct spi_device *spi)
{
struct wm8770_priv *wm8770 = spi_get_drvdata(spi);
int i;
for (i = 0; i < ARRAY_SIZE(wm8770->supplies); ++i)
regulator_unregister_notifier(wm8770->supplies[i].consumer,
&wm8770->disable_nb[i]);
snd_soc_unregister_codec(&spi->dev);
return 0;
} | false | false | false | false | false | 0 |
get_line(apr_bucket_brigade *bbout, apr_bucket_brigade *bbin,
conn_rec *c, apr_pool_t *p)
{
apr_status_t rv;
apr_size_t len;
char *line;
apr_brigade_cleanup(bbout);
rv = apr_brigade_split_line(bbout, bbin, APR_BLOCK_READ, 8192);
if (rv) {
ap_log_cerror(APLOG_MARK,... | false | false | false | false | false | 0 |
brasero_iso9660_seek (BraseroIsoCtx *ctx, gint address)
{
ctx->offset = 0;
ctx->num_blocks = 1;
/* The size of all the records is given by size member and its location
* by its address member. In a set of directory records the first two
* records are: '.' (id == 0) and '..' (id == 1). So since we've got
* th... | false | false | false | false | false | 0 |
common_init(MpegEncContext * s)
{
static int initialized=0;
switch(s->msmpeg4_version){
case 1:
case 2:
s->y_dc_scale_table=
s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
break;
case 3:
if(s->workaround_bugs){
s->y_dc_scale_table= old_ff_y_dc_scale_table;... | false | false | false | false | false | 0 |
string_subst(char *value, string_subst_lookup_t lookup, void *arg)
{
char *subvalue, *newvalue;
char *dollar, *ldelim, *rdelim;
char oldrdelim;
int length;
while(1) {
dollar = strchr(value, '$');
if(!dollar)
return value;
while(dollar > value) {
if(*(dollar - 1) == '\\') {
dollar = strchr(dollar ... | false | false | false | false | false | 0 |
get_used_colors(Gif_OptData *bounds, int use_transparency)
{
int top = bounds->top, width = bounds->width, height = bounds->height;
int i, x, y;
int all_ncol = all_colormap->ncol;
uint8_t *need = Gif_NewArray(uint8_t, all_ncol);
for (i = 0; i < all_ncol; i++)
need[i] = 0;
/* set elements that are in t... | false | false | false | false | false | 0 |
snd_hdac_display_power(struct hdac_bus *bus, bool enable)
{
struct i915_audio_component *acomp = bus->audio_component;
if (!acomp || !acomp->ops)
return -ENODEV;
dev_dbg(bus->dev, "display power %s\n",
enable ? "enable" : "disable");
if (enable) {
if (!bus->i915_power_refcount++) {
acomp->ops->get_power... | false | false | false | false | false | 0 |
set_default_channel_config(AACContext *ac, enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],
int channel_config)
{
if(channel_config < 1 || channel_config > 7) {
av_log(ac->avccontext, AV_LOG_ERROR, "invalid default channel configuration (%d)\n",
channel_config);
return -1;
... | false | false | false | false | false | 0 |
Transport_OIAP(TSS_HCONTEXT tspContext, /* in */
TCS_AUTHHANDLE* authHandle, /* out */
TPM_NONCE* nonce0) /* out */
{
TSS_RESULT result;
UINT32 decLen = 0;
BYTE *dec = NULL;
UINT64 offset;
TCS_HANDLE handlesLen = 0;
if ((result = obj_context_transport_init(tspContext)))
return... | false | false | false | false | false | 0 |
Close()
{
if( --(poFile->nRefCount) == 0 )
delete poFile;
poFile = NULL;
return 0;
} | false | false | false | false | false | 0 |
isJobSendOK (Job& job, FaxRequest* req)
{
/*
* Constrain the maximum number of times the phone
* will be dialed and/or the number of attempts that
* will be made (and reject jobs accordingly).
*/
u_short maxdials = fxmin((u_short) job.getJCI().getMaxDials(),req->maxdials);
if (req->totdi... | false | false | false | false | false | 0 |
updateColor()
{
UT_ASSERT(m_pDoc);
FV_View * pView = getView();
if(pView)
{
XAP_App * pApp = pView->getApp();
XAP_Prefs * pPrefs = pApp->getPrefs();
const gchar * pszTransparentColor = NULL;
pPrefs->getPrefsValue(static_cast<const gchar *>(XAP_PREF_KEY_ColorForTransparent),&pszTransparentColor);
//
// Save ... | false | false | false | false | false | 0 |
fetch_config(struct openconnect_info *vpninfo, char *fu, char *bu,
char *server_sha1)
{
struct vpn_option *opt;
char buf[MAX_BUF_LEN];
char *config_buf = NULL;
int result, buflen;
unsigned char local_sha1_bin[SHA_DIGEST_LENGTH];
char local_sha1_ascii[(SHA_DIGEST_LENGTH * 2)+1];
EVP_MD_CTX c;
int i;
sprintf... | false | false | false | false | false | 0 |
calendar_join_attendees(struct ast_calendar_event *event, char *buf, size_t len)
{
struct ast_str *tmp;
struct ast_calendar_attendee *attendee;
if (!(tmp = ast_str_create(32))) {
ast_log(LOG_ERROR, "Could not allocate memory for attendees!\n");
return;
}
AST_LIST_TRAVERSE(&event->attendees, attendee, next) {... | false | false | false | false | false | 0 |
mt2063_get_status(struct dvb_frontend *fe, u32 *tuner_status)
{
struct mt2063_state *state = fe->tuner_priv;
int status;
dprintk(2, "\n");
if (!state->init)
return -ENODEV;
*tuner_status = 0;
status = mt2063_lockStatus(state);
if (status < 0)
return status;
if (status)
*tuner_status = TUNER_STATUS_LOCK... | false | false | false | false | false | 0 |
pci_pm_prepare(struct device *dev)
{
struct device_driver *drv = dev->driver;
/*
* Devices having power.ignore_children set may still be necessary for
* suspending their children in the next phase of device suspend.
*/
if (dev->power.ignore_children)
pm_runtime_resume(dev);
if (drv && drv->pm && drv->pm->... | false | false | false | false | false | 0 |
gst_aspect_ratio_crop_init (GstAspectRatioCrop * aspect_ratio_crop)
{
GstPad *link_pad;
GstPad *src_pad;
GST_DEBUG_CATEGORY_INIT (aspect_ratio_crop_debug, "aspectratiocrop", 0,
"aspectratiocrop");
aspect_ratio_crop->ar_num = 0;
aspect_ratio_crop->ar_denom = 1;
g_mutex_init (&aspect_ratio_crop->crop... | false | false | false | false | false | 0 |
bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
int prot, int flags, file_ptr offset,
void **map_addr, bfd_size_type *map_len)
{
void *ret = (void *)-1;
if (abfd->iovec == NULL)
return ret;
return abfd->iovec->bmmap (abfd, addr, len, prot, flags, offset,
map_add... | false | false | false | false | false | 0 |
_meetGageKindParse(const char *_str, int constOnly) {
char *str;
gageKind *ret;
if (!_str) {
return NULL;
}
str = airToLower(airStrdup(_str));
if (!str) {
return NULL;
}
if (!strcmp(gageKindScl->name, str)) {
ret = gageKindScl;
} else if (!strcmp(gageKindVec->name, str)) {
ret = gageK... | false | false | false | false | false | 0 |
writeAttrs(XmlWriter &out, IomObject &obj)
{
tagv_type::iterator tag=tagList.find(obj->getTag());
// class not found?
if(tag==tagList.end()){
std::string msg="unknown type <";
msg+=+obj->getTag_c();
msg+=">";
iom_issueerr(msg.c_str());
// write all attributes
for(int attri=0;attri<obj->getAttrCount();att... | false | false | false | false | false | 0 |
NCiocount(const NC *const ncp, const NC_var *const varp,
const size_t *const edges,
size_t *const iocountp)
{
const size_t *edp0 = edges;
const size_t *edp = edges + varp->ndims;
const size_t *shp = varp->shape + varp->ndims;
if(IS_RECVAR(varp))
{
... | false | false | false | false | false | 0 |
nice_address_get_port (const NiceAddress *addr)
{
if (!addr)
return 0;
switch (addr->s.addr.sa_family)
{
case AF_INET:
return ntohs (addr->s.ip4.sin_port);
case AF_INET6:
return ntohs (addr->s.ip6.sin6_port);
}
g_return_val_if_reached (0);
} | false | false | false | false | false | 0 |
graph_symbol_to_ascii(struct graph_symbol *symbol)
{
if (symbol->commit) {
if (symbol->boundary)
return " o";
else if (symbol->initial)
return " I";
else if (symbol->merge)
return " M";
return " *";
}
if (symbol->merge) {
if (symbol->branch)
return "-+";
return "-.";
}
if (symbol->branch)... | false | false | false | false | false | 0 |
predlist_insert(struct predlist *list,
struct predicate *curr,
struct predicate **pprev)
{
struct predicate **insertpos = &(list->head);
*pprev = curr->pred_left;
if (options.optimisation_level > 2)
{
/* Insert the new node in the list after any other entries which
* are more selective.
... | false | false | false | false | false | 0 |
apply_color_option(color_option, newbot2, statusline)
struct color_option color_option;
const char *newbot2;
int statusline; /* apply color on this statusline: 1 or 2 */
{
if (!iflags.use_status_colors || !iflags.use_color) return;
curs(WIN_STATUS, 1, statusline-1);
start_color_option(color_option);
putstr(WIN_STAT... | false | false | false | false | false | 0 |
find_bypass_set (int regno, int bb)
{
struct expr *result = 0;
for (;;)
{
rtx src;
struct expr *set = lookup_set (regno, &set_hash_table);
while (set)
{
if (TEST_BIT (cprop_avout[bb], set->bitmap_index))
break;
set = next_set (regno, set);
}
if (set == 0)
break;
i... | false | false | false | false | false | 0 |
setFlag(int32_t bit, UColAttributeValue value,
int32_t defaultOptions, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) { return; }
switch(value) {
case UCOL_ON:
options |= bit;
break;
case UCOL_OFF:
options &= ~bit;
break;
case UCOL_DEFAUL... | false | false | false | false | false | 0 |
xlogVacuumPage(Relation index, Buffer buffer)
{
Page page = BufferGetPage(buffer);
XLogRecPtr recptr;
/* This is only used for entry tree leaf pages. */
Assert(!GinPageIsData(page));
Assert(GinPageIsLeaf(page));
if (!RelationNeedsWAL(index))
return;
/*
* Always create a full image, we don't track the cha... | false | false | false | false | false | 0 |
paintEvent( QPaintEvent *ev )
{
// let the style paint draghandles and in doubt override the shadow from above
QToolBar::paintEvent( ev );
// skip icons
QPainter p( this );
Skip *left = &m_prev;
Skip *right = &m_next;
if( layoutDirection() == Qt::RightToLeft )
{
left = &m_next;... | false | false | false | false | false | 0 |
roundtriptest(FXTextCodec *codec){
FXchar dst[32],src[32];
FXint c,n,i,j;
FXwchar wc;
printf("Roundtrip test for: %s..\n",codec->name());
for(i=0; i<256; i++){
src[0]=i;
codec->mb2wc(wc,src,1);
codec->wc2mb(dst,32,wc);
j=(FXuchar)dst[0];
printf("0x%02x -> 0x%04x -> 0x%02x %s\n",i,wc,j,(i!=... | false | false | false | false | false | 0 |
fsm_space_needed_to_cat(Size needed)
{
int cat;
/* Can't ask for more space than the highest category represents */
if (needed > MaxFSMRequestSize)
elog(ERROR, "invalid FSM request size %lu",
(unsigned long) needed);
if (needed == 0)
return 1;
cat = (needed + FSM_CAT_STEP - 1) / FSM_CAT_STEP;
if (ca... | false | false | false | false | false | 0 |
ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Handler_Flags flags)
{
int ret;
EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
{
ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_H... | false | false | false | false | false | 0 |
i8042_setup_kbd(void)
{
int error;
error = i8042_create_kbd_port();
if (error)
return error;
error = request_irq(I8042_KBD_IRQ, i8042_interrupt, IRQF_SHARED,
"i8042", i8042_platform_device);
if (error)
goto err_free_port;
error = i8042_enable_kbd_port();
if (error)
goto err_free_irq;
i8042_kbd_... | false | false | false | false | false | 0 |
IsCsoundOperator(char ch) {
if (isascii(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
ch == '(' || ch == ')' || ch == '=' || ch == '^' ||
ch == '[' || ch == ']' || ch == '<' || ch == '&' ||
ch == '>' || ch == ',' || ... | false | false | false | false | false | 0 |
bh1770_lux_rate(struct bh1770_chip *chip, int rate_index)
{
/* sysfs may call this when the chip is powered off */
if (pm_runtime_suspended(&chip->client->dev))
return 0;
/* Proper proximity response needs fastest lux rate (100ms) */
if (chip->prox_enable_count)
rate_index = 0;
return i2c_smbus_write_byte_da... | false | false | false | false | false | 0 |
gt_cntlist_show_ascii(GtBitsequence *cntlist,
unsigned long nofreads, FILE *file)
{
unsigned long i;
gt_assert(file != NULL);
fprintf(file, "[n: %lu]\n", nofreads);
for (i = 0; i < nofreads; i++)
if (GT_ISIBITSET(cntlist, i))
fprintf(file, "%lu\n", i);
} | false | false | false | false | false | 0 |
__log_put_next(env, lsn, dbt, hdr, old_lsnp)
ENV *env;
DB_LSN *lsn;
const DBT *dbt;
HDR *hdr;
DB_LSN *old_lsnp;
{
DB_LOG *dblp;
DB_LSN old_lsn;
LOG *lp;
int adv_file, newfile, ret;
dblp = env->lg_handle;
lp = dblp->reginfo.primary;
/*
* Save a copy of lp->lsn before we might decide to switch log
* fil... | false | false | false | false | false | 0 |
ajTrnSeqRevinitC(const AjPTrn trnObj, const char *str, ajint len,
AjPStr *pep)
{
ajint i;
ajint end;
const char *cp;
AjPStr transtr = NULL;
char *cq;
ajint trnlen;
ajuint iend;
end = (len/3)*3-1;
trnlen = (end+1)/3;
cp = &str[end];
transtr = ajStrNewRes... | false | false | false | false | false | 0 |
tomoyo_has_more_namespace(struct tomoyo_io_buffer *head)
{
return (head->type == TOMOYO_EXCEPTIONPOLICY ||
head->type == TOMOYO_PROFILE) && head->r.eof &&
head->r.ns->next != &tomoyo_namespace_list;
} | false | false | false | false | false | 0 |
ctest_libMalloc(const void *context, size_t size) {
/*if (VERBOSITY) {
printf("Allocated %ld\n", (long)size);
}*/
if (MINIMUM_MEMORY_SIZE_FAILURE <= size && size <= MAXIMUM_MEMORY_SIZE_FAILURE) {
return NULL;
}
return malloc(size);
} | false | false | false | false | false | 0 |
glusterd_nodesvc_set_online_status (char *server, gf_boolean_t status)
{
glusterd_conf_t *priv = NULL;
GF_ASSERT (server);
priv = THIS->private;
GF_ASSERT (priv);
GF_ASSERT (priv->shd);
GF_ASSERT (priv->nfs);
if (!strcmp("glustershd", server))
pr... | false | false | true | true | true | 1 |
suspend_headset(struct media_transport *transport,
struct media_owner *owner)
{
struct audio_device *device = transport->device;
if (!owner) {
headset_unlock(device, HEADSET_LOCK_READ | HEADSET_LOCK_WRITE);
transport->in_use = FALSE;
return 0;
}
return headset_suspend_stream(device, headset_suspend_co... | false | false | false | false | false | 0 |
meta_ui_accelerator_name (unsigned int keysym,
MetaVirtualModifier mask)
{
GdkModifierType mods = 0;
if (keysym == 0 && mask == 0)
{
return g_strdup ("disabled");
}
if (mask & META_VIRTUAL_SHIFT_MASK)
mods |= GDK_SHIFT_MASK;
if (mask & META_VIRTUAL_... | false | false | false | false | false | 0 |
setWallpaper(const QString &pluginName, const QString &mode)
{
KConfigGroup cfg = config();
bool newPlugin = true;
bool newMode = true;
if (d->drawWallpaper) {
if (d->wallpaper) {
// we have a wallpaper, so let's decide whether we need to swap it out
if (d->wallpaper->pl... | false | false | false | false | false | 0 |
PortalStart(Portal portal, ParamListInfo params, Snapshot snapshot)
{
Portal saveActivePortal;
ResourceOwner saveResourceOwner;
MemoryContext savePortalContext;
MemoryContext oldContext;
QueryDesc *queryDesc;
int eflags;
AssertArg(PortalIsValid(portal));
AssertState(portal->status == PORTAL_DEFINED);
/*
... | false | false | false | false | false | 0 |
CVReductionPop(WiggleIterator * wi) {
int i;
double mean, diff;
if (wi->done)
return;
WiggleReducerData * data = (WiggleReducerData *) wi->data;
Multiplexer * multi = data->multi;
if (multi->done) {
wi->done = true;
return;
}
wi->chrom = multi->chrom;
wi->start = multi->start;
wi->finish = multi->fi... | false | false | false | false | false | 0 |
pg_timezone_initialize(void)
{
pg_tz *def_tz = NULL;
/*
* Make sure that session_timezone and log_timezone are set.
* (session_timezone could still be NULL even if a timezone value was set
* in postgresql.conf, if that setting was interval-based rather than
* timezone-based.)
*/
if (!session_timezone)
... | false | false | false | false | false | 0 |
gf_isom_get_payt_count(GF_ISOFile *the_file, u32 trackNumber)
{
u32 i, count;
GF_TrackBox *trak;
GF_UserDataMap *map;
GF_HintInfoBox *hinf;
GF_PAYTBox *payt;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak) return 0;
if (!CheckHintFormat(trak, GF_4CC('r', 't', 'p', ' '))) return 0;
map =... | false | false | false | false | false | 0 |
arch_gen_dion(FILE *fp, struct scope *scope, struct declaration *dion)
{
if (dion->storage == STORAGE_TYPEDEF) {
/* Type definition only. */
return;
}
if (dion->storage != STORAGE_ASM
&& dion->identifier == NULL) {
/* struct/union/enum definition only. */
return;
}
if (dion->storage == STORAGE_EXTERN) {
... | false | false | false | false | false | 0 |
hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
{
struct hdmi_spec *spec = codec->spec;
unsigned int caps, config;
int pin_idx;
struct hdmi_spec_per_pin *per_pin;
int err;
caps = snd_hda_query_pin_caps(codec, pin_nid);
if (!(caps & (AC_PINCAP_HDMI | AC_PINCAP_DP)))
return 0;
config = snd_hda_codec_... | false | false | false | false | false | 0 |
parse_tproxy_mark(char *s, uint32_t *markp, uint32_t *maskp)
{
unsigned int value, mask = UINT32_MAX;
char *end;
if (!xtables_strtoui(s, &end, &value, 0, UINT32_MAX))
xtables_param_act(XTF_BAD_VALUE, "TPROXY", "--tproxy-mark", s);
if (*end == '/')
if (!xtables_strtoui(end + 1, &end, &mask, 0, UINT32_MAX))
x... | false | false | false | false | false | 0 |
amd_set_speed(struct pci_dev *dev, u8 dn, u8 udma_mask,
struct ide_timing *timing)
{
u8 t = 0, offset = amd_offset(dev);
pci_read_config_byte(dev, AMD_ADDRESS_SETUP + offset, &t);
t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(timing->setup, 1, 4) - 1) << ((3 - dn) << 1));
pci_write_config_byte(dev, AMD_ADDR... | false | false | false | false | false | 0 |
sysfs_get_uint(char *id, char *subsys, char *param,
unsigned int *value)
{
char *sysfs_value;
*value = -1;
sysfs_value = sysfs_get_value(id, subsys, param);
if (!sysfs_value)
return EIO;
errno = 0;
*value = strtoul(sysfs_value, NULL, 0);
if (errno)
return errno;
return 0;
} | false | false | false | false | false | 0 |
operator==(const CPose3DQuatPDFGaussianInf &p1,const CPose3DQuatPDFGaussianInf &p2)
{
return p1.mean==p2.mean && p1.cov_inv==p2.cov_inv;
} | false | false | false | false | false | 0 |
closeMess(void)
{
if(m_shaderString)delete [] m_shaderString;
m_shaderString=NULL;
m_size=0;
if(m_shader)
glDeleteShader( m_shader );
if(m_shaderARB)
glDeleteObjectARB( m_shaderARB );
gem::utils::glsl::delshader(m_shader);
gem::utils::glsl::delshader(m_shaderARB);
m_shader=0;
m_shaderARB = 0... | false | false | false | false | false | 0 |
progress_log_cb(GWEN_GUI *gwen_gui, guint32 id, GWEN_LOGGER_LEVEL level,
const gchar *text)
{
GncGWENGui *gui = GETDATA_GUI(gwen_gui);
GtkTextBuffer *tb;
GtkTextView *tv;
g_return_val_if_fail(gui, -1);
ENTER("gui=%p, text=%s", gui, text ? text : "(null)");
tv = GTK_TEXT_VIEW(g... | false | false | false | false | false | 0 |
SplinePointListSpiroTransform(SplinePointList *base, real transform[6], int allpoints ) {
SplinePointList *spl;
int allsel, anysel;
int i;
if ( allpoints )
return( SplinePointListTransform(base,transform,tpt_AllPoints));
for ( spl = base; spl!=NULL; spl = spl->next ) {
allsel = true; anysel=false... | false | false | false | false | false | 0 |
parse_flags (const gchar *arg)
{
GsmInhibitorFlag flags;
gchar **args;
gint i;
flags = 0;
args = g_strsplit (arg, ":", 0);
for (i = 0; args[i]; i++)
{
if (strcmp (args[i], "logout") == 0)
flags |= GSM_INHIBITOR_FLAG_LOGOUT;
else if (strcmp (args[i], "switch-user") == 0)
fla... | false | false | false | false | false | 0 |
finish_prep_stmt_init (PostgresConnectionData *cdata, GdaPostgresPStmt *ps, PGresult *pg_res, GType *col_types)
{
/* make sure @ps reports the correct number of columns */
if (_GDA_PSTMT (ps)->ncols < 0) {
if (pg_res)
_GDA_PSTMT (ps)->ncols = PQnfields (pg_res);
else
_GDA_PSTMT (ps)->ncols = 0;
}
... | false | false | false | false | false | 0 |
getListFormatInternal(
const Locale& locale, const char *style, UErrorCode& errorCode) {
if (U_FAILURE(errorCode)) {
return NULL;
}
CharString keyBuffer(locale.getName(), errorCode);
keyBuffer.append(':', errorCode).append(style, errorCode);
UnicodeString key(keyBuffer.data(), -1, US... | false | false | false | false | false | 0 |
GetTrans(ExState &State, TransTable tab) {
unsigned char TrS[512] = "";
unsigned char TrD[512] = "";
if (State.GetStrParam(View, (char *)TrS, sizeof(TrS)) == 0)
if (View->MView->Win->GetStr("Trans From", sizeof(TrS), (char *)TrS, HIST_TRANS) == 0)
return 0;
if (State.GetStrParam(Vie... | false | false | false | false | false | 0 |
nn_SpatialSubSampling_forward(lua_State *L)
{
THTensor *input = luaT_checkudata(L, 2, torch_Tensor_id);
int kW = luaT_getfieldcheckint(L, 1, "kW");
int kH = luaT_getfieldcheckint(L, 1, "kH");
int dW = luaT_getfieldcheckint(L, 1, "dW");
int dH = luaT_getfieldcheckint(L, 1, "dH");
int nInputPlane = luaT_get... | false | false | false | false | false | 0 |
setR4EncryptionParameters(
char const* user_password, char const* owner_password,
bool allow_accessibility, bool allow_extract,
qpdf_r3_print_e print, qpdf_r3_modify_e modify,
bool encrypt_metadata, bool use_aes)
{
std::set<int> clear;
interpretR3EncryptionParameters(
clear, user_password, owne... | false | false | false | false | false | 0 |
UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
return;
}
if (m_uiCleaveTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK)
{
... | false | false | false | false | false | 0 |
GTIFFree(GTIF* gtif)
{
int i;
if (!gtif) return;
/* Free parameter arrays */
if (gtif->gt_double) _GTIFFree (gtif->gt_double);
if (gtif->gt_short) _GTIFFree (gtif->gt_short);
/* Free GeoKey arrays */
if (gtif->gt_keys)
{
for (i = 0; i < MAX_KEYS; i++)
{
... | false | false | false | false | false | 0 |
copy_frags(struct sk_buff *skb,
const struct pkt_gl *gl, unsigned int offset)
{
int i;
/* usually there's just one frag */
__skb_fill_page_desc(skb, 0, gl->frags[0].page,
gl->frags[0].offset + offset,
gl->frags[0].size - offset);
skb_shinfo(skb)->nr_frags = gl->nfrags;
for (i = 1; i < gl-... | false | false | false | false | false | 0 |
gda_server_provider_render_operation (GdaServerProvider *provider, GdaConnection *cnc,
GdaServerOperation *op, GError **error)
{
g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), NULL);
g_return_val_if_fail (!cnc || GDA_IS_CONNECTION (cnc), NULL);
if (CLASS (provider)->render_operation) {
gchar ... | false | false | false | false | false | 0 |
unpack_comm(int n, int first, double *buf)
{
int i,k,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
}
// unpack sub-style contributions as contiguous chunks
for (k = 0; k < nstyles; k++)
m += styles[k]->unpac... | false | false | false | false | false | 0 |
__Pyx_PyNumber_Int(PyObject* x) {
PyNumberMethods *m;
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
if (PyInt_Check(x) || PyLong_Check(x))
#else
if (PyLong_Check(x))
#endif
return Py_INCREF(x), x;
m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
... | false | false | false | false | false | 0 |
FSFreeIxCounts(
FDB * pDb)
{
IX_STATS * pNextIxStat;
while (pDb->pIxStats)
{
pNextIxStat = pDb->pIxStats->pNext;
f_free( &pDb->pIxStats);
pDb->pIxStats = pNextIxStat;
}
} | 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.