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 |
|---|---|---|---|---|---|---|
submit_wait_noreset()
{
int wait_stat;
pid_t wait_pid;
while ((wait_pid=wait(&wait_stat)) != submit_pid)
{
if (wait_pid == -1 && errno == ECHILD) return (-1);
}
if (WIFEXITED(wait_stat) && WEXITSTATUS(wait_stat) == 0)
return (0);
return (-1);
} | false | false | false | false | false | 0 |
decode_gfx(UINT16 *pflookup, UINT16 *molookup)
{
UINT8 *prom1 = &memory_region(REGION_PROMS)[0x000];
UINT8 *prom2 = &memory_region(REGION_PROMS)[0x200];
int obj, i;
/* reset the globals */
memset(&bank_gfx[0][0], 0, sizeof(bank_gfx));
/* loop for two sets of objects */
for (obj = 0; obj < 2; obj++)
... | false | false | false | false | false | 0 |
_fmpz_poly_equal(const fmpz_poly_t input1, const fmpz_poly_t input2)
{
if (input1 == input2) return 1;
if (input1->length != input2->length) return 0;
long i,j;
for (i = 0; i < input1->length; i++)
{
for (j = 0; j < ABS(input1->coeffs[i*(input1->limbs+1)])+1; j++)
{
if (in... | false | false | false | false | false | 0 |
emitPRERETEmu(const FlowInstruction *i)
{
uint32_t pos = i->target.bb->binPos + 8; // +8 to skip an op */
code[0] = 0x10000003; // bra
code[1] = 0x00000780; // always
switch (i->subOp) {
case NV50_IR_SUBOP_EMU_PRERET + 0: // bra to the call
break;
case NV50_IR_SUBOP_EMU_PRERET + 1: // bra to s... | false | false | false | false | false | 0 |
json_timeline_add_tag_branch_clause(Blob *pSql,
cson_object * pPayload){
char const * zTag = NULL;
char const * zBranch = NULL;
int tagid = 0;
if(! g.perm.Read ){
return 0;
}
zTag = json_find_option_cstr("tag",NULL,NULL);
if(!zTag || !*zTag){
zBranch... | false | false | false | false | false | 0 |
ListChoice(int hmm)
{
char buf[32];
if(!hmm)
{
int num=0;
tryagain:
printf(" <'Enter' to continue, (S)top, or enter a number.> ");
fgets(buf,32,stdin);
if(buf[0]=='s' || buf[0]=='S') return(-1);
if(buf[0]=='\n') return(0);
if(!sscanf(buf,"%d",&num))
return(0);
if(num<1) goto tryaga... | false | false | false | false | false | 0 |
RemoveItem(vtkInformation* info,
vtkInformationKey* value)
{
vtkInformationKeyVectorValue* v =
static_cast<vtkInformationKeyVectorValue *>
(this->GetAsObjectBase(info));
if(v)
{
std::vector<vtkInformationKey*>::iterator it=std::find(v->Value.begin(),v->... | false | false | false | false | false | 0 |
dw_wdt_resume(struct device *dev)
{
int err = clk_prepare_enable(dw_wdt.clk);
if (err)
return err;
dw_wdt_keepalive();
return 0;
} | false | false | false | false | false | 0 |
drawNameText(float alpha) {
if(!selected && alpha <= 0.01) return;
float name_alpha = selected ? 1.0 : alpha;
if(selected) {
file_selected_font.draw(screenpos.x, screenpos.y, name);
} else {
file_font.setAlpha(name_alpha);
file_font.draw(screenpos.x, screenpos.y, gGourceSetting... | false | false | false | false | false | 0 |
liblist_25alist_deleteX(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj elt_scm;
ScmObj elt;
ScmObj list_scm;
ScmObj list;
ScmObj cmpmode_scm;
ScmObj cmpmode;
ScmObj SCM_SUBRARGS[4];
int SCM_i;
SCM_ENTER_SUBR("%alist-delete!");
if (SCM_ARGCNT >= 4
&& !SCM_NULLP(SCM_ARGREF(SCM_ARGCNT-1)))... | false | false | false | false | false | 0 |
copy_screen(void) {
char *fbp;
int i, y, block_size;
if (! fs_factor) {
return 0;
}
if (debug_tiles) fprintf(stderr, "copy_screen\n");
if (unixpw_in_progress) return 0;
if (! main_fb) {
return 0;
}
block_size = ((dpy_y/fs_factor) * main_bytes_per_line);
fbp = main_fb;
y = 0;
X_LOCK;
/* screen m... | true | true | false | false | false | 1 |
parse_user_validate(struct webauth_context *ctx, apr_xml_doc *doc,
struct webauth_user_validate **result)
{
apr_xml_elem *child;
int s = WA_ERR_REMOTE_FAILURE;
struct webauth_user_validate *validate;
const char *content;
if (strcmp(doc->root->name, "authdata") != 0) {
wa... | false | false | false | false | false | 0 |
extensible_string_setup
___P((extensible_string *str,
int n),
(str,
n)
extensible_string *str;
int n;)
{
#define EXTENSIBLE_STRING_INITIAL_BUFFER_SIZE 32
if (n < EXTENSIBLE_STRING_INITIAL_BUFFER_SIZE)
n = EXTENSIBLE_STRING_INITIAL_BUFFER_SIZE;
str->buffer = ___CAST(extensible_stri... | false | false | false | false | false | 0 |
nfsd4_client_tracking_init(struct net *net)
{
int status;
struct path path;
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
/* just run the init if it the method is already decided */
if (nn->client_tracking_ops)
goto do_init;
/*
* First, try a UMH upcall. It should succeed or fail quickly, so
* ther... | false | false | false | false | false | 0 |
freesimpleoption(Cmppairwiseopt *cmppairwise)
{
gt_str_array_delete(cmppairwise->strings);
gt_str_array_delete(cmppairwise->files);
gt_str_delete(cmppairwise->text);
if (cmppairwise->charlistlen != NULL)
{
gt_str_delete(cmppairwise->charlistlen->charlist);
gt_free(cmppairwise->charlistlen);
}
} | false | false | false | false | false | 0 |
packbuilder_config(git_packbuilder *pb)
{
git_config *config;
int ret;
int64_t val;
if (git_repository_config__weakptr(&config, pb->repo) < 0)
return -1;
#define config_get(KEY,DST,DFLT) do { \
ret = git_config_get_int64(&val, config, KEY); \
if (!ret) (DST) = val; \
else if (ret == GIT_ENOTFOUND) (DST) = (D... | false | false | false | false | false | 0 |
finish_loading (NemoView *view)
{
NemoFileAttributes attributes;
nemo_window_report_load_underway (view->details->window,
NEMO_VIEW (view));
/* Tell interested parties that we've begun loading this directory now.
* Subclasses use this to know that the new metadata is now available.
*/
g_signal_emit... | false | false | false | false | false | 0 |
_addReplySdsToList(redisClient *c, sds s) {
robj *tail;
if (c->flags & REDIS_CLOSE_AFTER_REPLY) {
sdsfree(s);
return;
}
if (listLength(c->reply) == 0) {
listAddNodeTail(c->reply,createObject(REDIS_STRING,s));
} else {
tail = listNodeValue(listLast(c->reply));
... | false | false | false | false | false | 0 |
gfs2_ld_assigns(struct gfs2_log_descriptor *ld,
const char *strfield, const char *val)
{
checkassigns(strfield, ld, ld_reserved, val);
return -1;
} | false | false | false | false | false | 0 |
ikrt_nanosleep(ikptr secs, ikptr nsecs /*, ikpcb* pcb */){
struct timespec t;
t.tv_sec =
is_fixnum(secs)
? (unsigned long) unfix(secs)
: ref(secs, off_bignum_data);
t.tv_nsec =
is_fixnum(nsecs)
? (unsigned long) unfix(nsecs)
: ref(nsecs, off_bignum_data);
return fix(nanoslee... | false | false | false | false | false | 0 |
put(struct child *c, const Str &key, const Str &val)
{
always_assert(c->seq0_ == c->seq1_);
unsigned int sseq = c->seq1_;
c->conn->sendputwhole(key, val, sseq);
c->conn->flush();
const Json& result = c->conn->receive();
always_assert(result && result[0] == sseq);
++c->seq0_;
++c->seq1... | false | false | false | false | false | 0 |
elementEndCallback(void */*userData*/, const XML_Char *name) {
if (_ignoreCache) {
return;
}
std::string ename = name;
/// XXX: validation?
if (ename == "plugin") {
if (_xmlCurrentPlugin) {
APICache::PluginAPICacheI &api = _xmlCurrentPlugin->getApiHandler();
api.endXmlParsing();
... | false | false | false | false | false | 0 |
remove_cache (CamelSession *session,
GCancellable *cancellable,
CamelFolderSummary *summary,
GError **error)
{
GSList *to_remove_infos = NULL;
CAMEL_DB_RELEASE_SQLITE_MEMORY;
if (time (NULL) - summary->priv->cache_load_time < SUMMARY_CACHE_DROP)
return;
camel_folder_su... | false | false | false | false | false | 0 |
wbc_gtk_init_zoom (WBCGtk *wbcg)
{
#warning TODO : Add zoom to selection
static char const * const preset_zoom [] = {
"200%",
"150%",
"100%",
"75%",
"50%",
"25%",
NULL
};
int i;
/* ----- horizontal ----- */
wbcg->zoom_haction =
g_object_new (go_action_combo_text_get_type (),
"name", "Zoo... | false | false | false | false | false | 0 |
qtanh(NUMBER *q, NUMBER *epsilon)
{
NUMBER *tmp1, *tmp2, *tmp3;
long n, m;
n = qilog2(epsilon);
if (n > 0 || qiszero(q))
return qlink(&_qzero_);
n = -n;
tmp1 = qqabs(q);
tmp2 = qmul(tmp1, &_qlge_);
m = qtoi(tmp2); /* exp(|q|) < 2^(m+1) or m == MAXLONG */
qfree(tmp2);
if (m > 1 + n/2) {
qfree(tmp1);
re... | false | false | false | false | false | 0 |
free_childs(xmlNodePtr node)
{
g_return_if_fail(node != NULL);
if (node->xmlChildrenNode)
xmlFreeNodeList(node->xmlChildrenNode);
node->xmlChildrenNode = NULL;
node->last = NULL;
} | false | false | false | false | false | 0 |
decrypt_string (char *key, char *str)
{
UWORD_32bits left, right;
char *p, *s, *dest, *d;
int i;
dest = (char *) malloc(strlen(str) + 12);
s = (char *) malloc(strlen(str) + 12);
strcpy(s, str);
p = s;
while (*p) p++;
for (i = 0; i < 12; i++) *p++ = 0;
blowfish_init((UBYTE_08bits*)key, strlen(key), 0);
p = s... | false | false | false | false | false | 0 |
nrf_rcv_pkt_poll_dec(int maxsize, uint8_t * pkt, uint32_t const key[4]){
int len;
uint16_t cmpcrc;
len=nrf_rcv_pkt_poll(maxsize,pkt);
if(len <=0)
return len;
// if(key==NULL) return len;
cmpcrc=crc16(pkt,len-2);
if(key!=NULL)
xxtea_decode_words((uint32_t*)pkt,len/4,key);
... | false | false | false | false | true | 1 |
export_point_from_fsid(uint32 fsid, time_t **last_mtime, uint32 **dir_hash)
{
e_item *list;
exports_access = TRUE;
list = export_list;
while (list) {
if (list->fsid == fsid) {
if (last_mtime != NULL)
*last_mtime = &list->last_mtime;
if (dir_hash != NULL)
*dir_hash = &list->dir_h... | false | false | false | false | false | 0 |
PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) c... | false | false | false | false | false | 0 |
parseComplexFieldIndex (ComplexFieldIndex ent)
{
if (ent->dtype == StringValue)
{
return 0;
}
else if (ent->name != NULL)
{
size_t nlen = strlen (ent->name);
char *name = ent->name;
if (name[0] == '$')
{
return 0;
}
ent->admSubfield = NULL;
ent->dtype = Invalid... | false | false | false | false | false | 0 |
parse_name (GScanner *scanner)
{
GTokenType token;
guint buttons = 0;
guint modifier = 0;
guint len = 0;
gchar *name;
token = g_scanner_cur_token(scanner);
if (token != G_TOKEN_STRING)
{
g_scanner_unexp_token (scanner, G_TOKEN_STRING, NULL,
NULL, NULL, "aborting",... | false | false | false | false | false | 0 |
_set_umask_env(void)
{
char mask_char[5];
mode_t mask;
if (getenv("SLURM_UMASK")) /* use this value */
return SLURM_SUCCESS;
if (opt.umask >= 0) {
mask = opt.umask;
} else {
mask = (int)umask(0);
umask(mask);
}
sprintf(mask_char, "0%d%d%d",
((mask>>6)&07), ((mask>>3)&07), mask&07);
if (setenvf(NULL... | true | true | false | false | true | 1 |
outlines_wthread(void *arg) // worker thread function
{
int index = *((int *) arg);
int px, py, ii, dist = 0;
double olth, imbr, br8, dold, dnew;
double red1, green1, blue1, red3, green3, blue3;
uint16 *pix1, *pix8, *pix3;
olt... | false | false | false | false | false | 0 |
xmlparser_gc_clear(XMLParserObject *self)
{
EXPAT(ParserFree)(self->parser);
Py_CLEAR(self->handle_close);
Py_CLEAR(self->handle_pi);
Py_CLEAR(self->handle_comment);
Py_CLEAR(self->handle_end);
Py_CLEAR(self->handle_data);
Py_CLEAR(self->handle_start);
Py_CLEAR(self->handle_doctype);
... | false | false | false | false | false | 0 |
setPath( const QString& _path )
{
#if defined(Q_WS_WIN) && defined(DEBUG_KURL)
kDebug(kurlDebugArea()) << "KUrl::setPath " << " " << _path.toLatin1().data();
#endif
if ( scheme().isEmpty() )
setScheme( QLatin1String( "file" ) );
QString path = KShell::tildeExpand( _path );
if (path.isEmpty())
... | false | false | false | false | false | 0 |
mbfl_buffer_converter_feed(mbfl_buffer_converter *convd, mbfl_string *string)
{
int n;
unsigned char *p;
mbfl_convert_filter *filter;
int (*filter_function)(int c, mbfl_convert_filter *filter);
if (convd == NULL || string == NULL) {
return -1;
}
mbfl_memory_device_realloc(&convd->device, convd->device.pos + s... | false | false | false | false | false | 0 |
multipart_index_of (GMimeMultipart *multipart, GMimeObject *part)
{
guint i;
for (i = 0; i < multipart->children->len; i++) {
if (part == (GMimeObject *) multipart->children->pdata[i])
return i;
}
return -1;
} | false | false | false | false | false | 0 |
AddRotamer(std::vector<int> arr)
{
unsigned int i;
double angle,res=255.0/360.0;
if (arr.size() != (_vrotor.size() + 1))
return; // wrong size key
unsigned char *rot = new unsigned char [_vrotor.size()+1];
rot[0] = (unsigned char)arr[0];
for (i = 0;i < _vrotor.size();++i)
{
... | false | false | false | false | false | 0 |
on_reauthentication_started_cb (GdmDBusWorker *worker,
GAsyncResult *res,
gpointer user_data)
{
GdmSessionConversation *conversation = user_data;
GdmSession *self;
GError *error = NULL;
gboolean worked;
char ... | false | false | false | false | false | 0 |
mdb_mid2l_search( ID2L ids, ID id )
{
/*
* binary search of id in ids
* if found, returns position of id
* if not found, returns first position greater than id
*/
unsigned base = 0;
unsigned cursor = 1;
int val = 0;
unsigned n = ids[0].mid;
while( 0 < n ) {
unsigned pivot = n >> 1;
cursor = base + pi... | false | false | false | false | false | 0 |
iwl_mvm_get_key_sta_id(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
if (sta) {
struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
return mvm_sta->sta_id;
}
/*
* The device expects GTKs for stat... | false | false | false | false | false | 0 |
handleEndNamespaceDecl(void* userData, const XML_Char* prefix)
{
ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
if (pThis->_pContentHandler)
pThis->_pContentHandler->endPrefixMapping(prefix ? XMLString(prefix) : EMPTY_STRING);
} | false | false | false | false | false | 0 |
prettyName() const
{
return QString("%1 from %2")
.arg( _dep->name().isEmpty() ? QString("(global)") : _dep->name())
.arg(part()->name());
} | false | false | false | false | false | 0 |
mb_rebuild_ofr_list(gpointer dialog)
{
GtkListStore *ofr_store;
GtkWidget *ofr_list;
GtkScrolledWindow *scw;
char *titles[] = {"Object", "Band", "Status", "Zpoint", "Err", "Fitted",
"Outliers", "MEU", "Airmass", "MJD", NULL};
int i;
GtkTreeViewColumn *column;
ofr_list = gtk_object_get_data(GTK_OBJECT(dialo... | false | false | false | false | false | 0 |
copy(bool b) {
expr_list* T = new expr_list;
std::list<ast_expr*>::iterator I;
for (I = args.begin(); I != args.end(); I++) {
ast_expr* e = *I;
ast_expr* e2 = e->copy(b);
T->LIST.push_back(e2);
}
ast_expr_builtin* e = ast_expr_builtin::new_builtin_expr(driver->copy(b), get_b... | false | false | false | false | false | 0 |
ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
struct page *page, struct inode *inode,
bool update_times)
{
loff_t pos = page_offset(page) +
(char *) de - (char *) page_address(page);
unsigned len = fs16_to_cpu(dir->i_sb, de->d_reclen);
int err;
lock_page(page);
err = ufs_prepare_chunk(page,... | false | false | false | false | false | 0 |
toolbar_clear_list(ToolbarType source)
{
while (toolbar_config[source].item_list != NULL) {
ToolbarItem *item = (ToolbarItem*) toolbar_config[source].item_list->data;
toolbar_config[source].item_list =
g_slist_remove(toolbar_config[source].item_list, item);
g_free(item->file);
g_free(item->text);
g_f... | false | false | false | false | false | 0 |
Suff_DoPaths(void)
{
Suff *s;
LstNode *ln;
char *ptr;
struct Path inIncludes; /* Cumulative .INCLUDES path */
struct Path inLibs; /* Cumulative .LIBS path */
TAILQ_INIT(&inIncludes);
TAILQ_INIT(&inLibs);
for (ln = Lst_First(&sufflist); ln != NULL; ln = Lst_Succ(ln)) {
s = Lst_Datum(ln);
#ifdef INCLUDES
if... | false | false | false | false | false | 0 |
multi_oo_send_control_info()
{
ubyte data[MAX_PACKET_SIZE], stop;
ubyte data_add[MAX_PACKET_SIZE];
ubyte oo_flags;
int add_size;
int packet_size = 0;
// if I'm dying or my object type is not a ship, bail here
if((Player_obj != NULL) && (Player_ship->flags & SF_DYING)){
return;
}
// build the header
BUI... | false | false | false | false | false | 0 |
timeout_check(ur_map_key_type key,
ur_map_value_type value,
void *arg) {
if(value && arg) {
timeout_check_arg_type *tcat=(timeout_check_arg_type*)arg;
rtcp_alloc_type* rat=(rtcp_alloc_type*)value;
if(turn_time_before(rat->t, tcat->t) && (tcat->tn<MAX_TOKEN_DEL)) {
tcat->t... | false | false | false | false | false | 0 |
filter_reload_parameters(xmlNode * param_set, const char *restart_string)
{
int len = 0;
char *name = NULL;
char *match = NULL;
if (param_set == NULL) {
return;
}
if (param_set) {
xmlAttrPtr xIter = param_set->properties;
while (xIter) {
const char *prop_na... | false | false | false | false | false | 0 |
nct7802_regmap_is_volatile(struct device *dev, unsigned int reg)
{
return (reg != REG_BANK && reg <= 0x20) ||
(reg >= REG_PWM(0) && reg <= REG_PWM(2));
} | false | false | false | false | false | 0 |
new_xpath_variable(xpath_value_type type, const char_t* name)
{
switch (type)
{
case xpath_type_node_set:
return new_xpath_variable<xpath_variable_node_set>(name);
case xpath_type_number:
return new_xpath_variable<xpath_variable_number>(name);
case xpath_type_string:
return new_xpath_va... | false | false | false | false | false | 0 |
buttonReleaseEvent(XButtonEvent &re) {
if (m_last_pressed_button == static_cast<int>(re.button)) {
m_last_pressed_button = 0;
}
if (isMoving())
stopMoving();
else if (isResizing())
stopResizing();
else if (m_attaching_tab)
attachTo(re.x_root, re.y_root);
else if... | false | false | false | false | false | 0 |
page_alloc(struct mem *mem, unsigned width)
{
unsigned chunk_size = CHUNK_SIZE(width);
int sz = sizeof(struct mem_page) + chunk_size * CHUNKS_ON_PAGE + 3;
char *ptr;
if (posix_memalign((void*)&ptr, mem->cache_line_size, sz) != 0) {
abort();
}
mem->pages_allocated ++;
mem->allocated += sz;
struct mem_page *pa... | false | false | false | false | false | 0 |
create_database(const char *dbname)
{
_stringlist *sl;
/*
* We use template0 so that any installation-local cruft in template1 will
* not mess up the tests.
*/
header(_("creating database \"%s\""), dbname);
if (encoding)
psql_command("postgres", "CREATE DATABASE \"%s\" TEMPLATE=template0 ENCODING='%s'%s", ... | false | false | false | false | false | 0 |
pt_pmu_hw_init(void)
{
struct dev_ext_attribute *de_attrs;
struct attribute **attrs;
size_t size;
int ret;
long i;
attrs = NULL;
for (i = 0; i < PT_CPUID_LEAVES; i++) {
cpuid_count(20, i,
&pt_pmu.caps[CR_EAX + i*PT_CPUID_REGS_NUM],
&pt_pmu.caps[CR_EBX + i*PT_CPUID_REGS_NUM],
&pt_pmu.caps... | false | false | false | false | false | 0 |
showUsage ( std::ostream& out ) const
{
out << getUsage(this->getTermColumns()) << endl;
} | false | false | false | false | false | 0 |
_find_first_config_node(const void *start, const char *path)
{
const struct dm_config_tree *cft = start;
const struct dm_config_node *cn = NULL;
while (cft) {
if ((cn = _find_config_node(cft->root, path)))
return cn;
cft = cft->cascade;
}
return NULL;
} | false | false | false | false | false | 0 |
preferences_init (void)
{
GApplication *app;
if (prefs) {
return;
}
app = g_application_get_default ();
if (!app) {
g_warning ("Cannot launch Preferences: No default application found");
return;
}
prefs = g_new0 (... | false | false | false | false | false | 0 |
early_platform_left(struct early_platform_driver *epdrv,
int id)
{
struct platform_device *pd;
list_for_each_entry(pd, &early_platform_device_list, dev.devres_head)
if (platform_match(&pd->dev, &epdrv->pdrv->driver))
if (pd->id >= id)
return 1;
return 0;
} | false | false | false | false | false | 0 |
AcpiPsExecuteMethod (
ACPI_EVALUATE_INFO *Info)
{
ACPI_STATUS Status;
ACPI_PARSE_OBJECT *Op;
ACPI_WALK_STATE *WalkState;
ACPI_FUNCTION_TRACE (PsExecuteMethod);
/* Quick validation of DSDT header */
AcpiTbCheckDsdtHeader ();
/* Validate the Info and me... | false | false | false | false | false | 0 |
CountEvalAtoms(char *class)
{ char *sp;
int count = 0, bracklevel = 0;
for (sp = class; *sp != '\0'; sp++)
{
if (*sp == '(')
{
Debug4("+(\n");
bracklevel++;
continue;
}
if (*sp == ')')
{
Debug4("-)\n");
bracklevel--;
continue;
}
if ((bra... | false | true | false | false | false | 1 |
SetVertex(GemState* state,float x, float y, float z, float tx, float ty,int curCoord)
{
int i;
TexCoord*texcoords=NULL;
int numCoords = 0;
int numUnits = 0;
state->get(GemState::_GL_TEX_NUMCOORDS, numCoords);
state->get(GemState::_GL_TEX_UNITS, numUnits);
if (numCoords) {
tx=state->texCoordX(curCoo... | false | false | false | false | false | 0 |
gets(char *buf, unsigned int nBytes)
{
if(!fptr)
return 0;
return fgets(buf, nBytes, fptr);
} | false | false | false | false | false | 0 |
rwm_suffix_massage_regexize( const char *s )
{
char *res, *ptr;
const char *p, *r;
int i;
if ( s[0] == '\0' ) {
return ch_strdup( "^(.+)$" );
}
for ( i = 0, p = s;
( r = strchr( p, ',' ) ) != NULL;
p = r + 1, i++ )
;
res = ch_calloc( sizeof( char ), strlen( s )
+ STRLENOF( "((.+),)?" )
+ STR... | false | false | false | false | false | 0 |
fr_command_rename__delete (FrArchive *archive,
GList **file_list,
gboolean is_dir,
gboolean dir_in_archive,
const char *original_path)
{
FrCommand *self = FR_COMMAND (archive);
gboolean added_dir;
/* temporarily add the dir to rename to the list if it's stored i... | false | false | false | false | false | 0 |
viewrtlgen( Generic )
rtlgen_list *Generic;
{
fprintf( stdout, "\n--> Generic" );
fprintf( stdout, "\n\t\tATOM : " );
viewvexexprbound( Generic->VEX_ATOM );
fprintf( stdout, "\n\t\tEXPR : " );
viewvexexprbound( Generic->VEX_EXPR );
if ( Generic->BASE >= VEX_MAX_TYPE )
{
fprintf( stdout, "\n\... | false | false | false | false | false | 0 |
enableMaster()
{
int result = 0;
/* Must have the lock when we do enable of disable. */
lock();
if (!getMasterEnabled())
{
active_tranxs_ = new ActiveTranx(&LOCK_binlog_, trace_level_);
if (active_tranxs_ != NULL)
{
commit_file_name_inited_ = false;
reply_file_name_inited_ = false;
... | false | false | false | false | false | 0 |
bitmap_flush(struct mddev *mddev)
{
struct bitmap *bitmap = mddev->bitmap;
long sleep;
if (!bitmap) /* there was no bitmap */
return;
/* run the daemon_work three time to ensure everything is flushed
* that can be
*/
sleep = mddev->bitmap_info.daemon_sleep * 2;
bitmap->daemon_lastrun -= sleep;
bitmap_dae... | false | false | false | false | false | 0 |
thread_cond_timespec( struct timespec *tp, time_t sec )
{
#if defined _POSIX_CLOCK_SELECTION && _POSIX_CLOCK_SELECTION >= 0 \
&& defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
if ( clock_gettime( clockid, tp ) )
msglog( MSG_FATAL|LOG_ERRNO, "thread_cond_timespec: " \
"clock_gettime failed" );
#else
#warn... | false | false | false | false | false | 0 |
sc_realloc (void *pointer, size_t size)
{
void *allocated;
if (size == 0)
{
sc_free (pointer);
return sc_zero_allocation;
}
if (pointer == sc_zero_allocation)
pointer = NULL;
allocated = realloc (pointer, size);
if (!allocated)
sc_fatal ("sc_realloc: requested %lu bytes\n", (sc_... | false | false | false | false | false | 0 |
Stop(const Arguments& args) {
HandleScope scope;
StatWatcher *handler = ObjectWrap::Unwrap<StatWatcher>(args.Holder());
handler->Emit(stop_symbol, 0, NULL);
handler->Stop();
return Undefined();
} | false | false | false | false | false | 0 |
kindConstr(line,alpha,m,c)
Int line; /* Determine kind of constructor */
Int alpha;
Int m;
Cell c; {
Cell h = getHead(c);
Int n = argCount;
#if DEBUG_KINDS
Printf("kindConstr: alpha=%d, m=%d, c=",alpha,m);
printType(stdout,c);
Printf("\n");
#endif
switch (whatIs(h)) {
case POLYTYPE :... | false | false | false | false | false | 0 |
ShellFree(struct Shell *sh)
{
if (sh != NULL) {
free(sh->name);
free(sh->path);
free(sh->echoOff);
free(sh->echoOn);
free(sh->noPrint);
free(sh->errCheck);
free(sh->ignErr);
free(sh->echo);
free(sh->exit);
ArgArray_Done(&sh->builtins);
free(sh->meta);
free(sh);
}
} | false | false | false | false | false | 0 |
AddInvite(Player* player)
{
if (!player || player->GetGroupInvite())
{ return false; }
Group* group = player->GetGroup();
if (group && group->isBGGroup())
{ group = player->GetOriginalGroup(); }
if (group)
{ return false; }
RemoveInvite(player);
m_invitees.insert(player... | false | false | false | false | false | 0 |
wait_rfifo_ready(struct sh_flctl *flctl)
{
uint32_t timeout = LOOP_TIMEOUT_MAX;
while (timeout--) {
uint32_t val;
/* check FIFO */
val = readl(FLDTCNTR(flctl)) >> 16;
if (val & 0xFF)
return;
udelay(1);
}
timeout_error(flctl, __func__);
} | false | false | false | false | false | 0 |
send_to_world(World *world, const char *cmd, gint len)
{
/* cmd should be in UTF-8 */
gchar *locale_cmd;
gsize locale_len;
GError *error = NULL;
gboolean has_incomplete_line;
has_incomplete_line = world->printed_until;
if (!world->dont_flush) {
flush_buffer(world, 1);
}
locale_cmd = g_... | false | false | false | false | false | 0 |
xpc_make_first_contact_uv(struct xpc_partition *part)
{
struct xpc_activate_mq_msg_uv msg;
/*
* We send a sync msg to get the remote partition's remote_act_state
* updated to our current act_state which at this point should
* be XPC_P_AS_ACTIVATING.
*/
xpc_send_activate_IRQ_part_uv(part, &msg, sizeof(msg),
... | false | false | false | false | false | 0 |
maya_gpio_sw_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_maya44 *chip = snd_kcontrol_chip(kcontrol);
unsigned int shift = GET_GPIO_VAL_SHIFT(kcontrol->private_value);
unsigned int val;
val = (snd_ice1712_gpio_read(chip->ice) >> shift) & 1;
if (GET_GPIO_VAL_INV(kcont... | false | false | false | false | false | 0 |
log_format_has(const char *format, char esc)
{
const char *p;
if (!format)
return 0;
for (p = format; (p = strchr(p, '%')) != NULL; ) {
for (p++; *p == '\''; p++) {} /*SHARED ITERATOR*/
if (*p == '-')
p++;
while (isDigit(p))
p++;
while (*p == '\'') p++;
if (!*p)
break;
if (*p == esc)
retu... | false | false | false | false | false | 0 |
L50()
{register object *base=vs_base;
register object *sup=base+VM42; VC42
vs_check;
vs_top=sup;
goto TTL;
TTL:;
if(((((object)VV[89])->s.s_dbind))==Cnil){
goto T738;}
vs_base=vs_top;
(void) (*Lnk355)();
return;
goto T738;
T738:;
base[0]= ((object)VV[130]);
vs_top=(vs_base=base+0)+1;
(void) (*Lnk351)();
r... | false | false | false | false | false | 0 |
ast_str2tos(const char *value, unsigned int *tos)
{
int fval;
unsigned int x;
if (sscanf(value, "%30i", &fval) == 1) {
*tos = fval & 0xFF;
return 0;
}
for (x = 0; x < ARRAY_LEN(dscp_pool1); x++) {
if (!strcasecmp(value, dscp_pool1[x].name)) {
*tos = dscp_pool1[x].space << 2;
return 0;
}
}
return... | false | false | false | false | false | 0 |
ay_add_auto_conversation(eb_local_account *ela,
const char *name, int public)
{
FILE *fp;
char buff[4096];
snprintf(buff, 4095, "%schatroom_autoconnect", config_dir);
if (!ela || !name)
return;
eb_debug(DBG_CORE, "buff %s\n", buff);
if ((fp = fopen(buff, "r"))) {
while (fgets(buff, sizeof(buff)... | false | false | false | false | false | 0 |
hp_sw_bus_attach(struct scsi_device *sdev)
{
struct hp_sw_dh_data *h;
int ret;
h = kzalloc(sizeof(*h), GFP_KERNEL);
if (!h)
return -ENOMEM;
h->path_state = HP_SW_PATH_UNINITIALIZED;
h->retries = HP_SW_RETRIES;
h->sdev = sdev;
ret = hp_sw_tur(sdev, h);
if (ret != SCSI_DH_OK || h->path_state == HP_SW_PATH_UN... | false | false | false | false | false | 0 |
asn1PE_H245H262VideoMode_profileAndLevel (OOCTXT* pctxt, H245H262VideoMode_profileAndLevel* pvalue)
{
int stat = ASN_OK;
ASN1BOOL extbit;
/* extension bit */
extbit = (ASN1BOOL)(pvalue->t > 11);
encodeBit (pctxt, extbit);
if (!extbit) {
/* Encode choice index value */
stat = encodeCo... | false | false | false | false | false | 0 |
convert_color_channel (guint8 src,
guint8 alpha)
{
return alpha ? src / (alpha / 255.0) : 0;
} | false | false | false | false | false | 0 |
init_offsets(void)
{
#define init_offset(struct, member) do { \
koffset(struct, member) = MEMBER_OFFSET(#struct, #member);\
if (koffset(struct, member) < 0) { \
fprintf(fp, "failed to init the offset, struct:"\
#struct ", member:" #member); \
return -1; \
} \
} while (0)
init_offset(... | false | true | false | false | true | 1 |
operator()(Corpse* u)
{
// ignore bones
if (u->GetType() == CORPSE_BONES)
return false;
Player* owner = ObjectAccessor::FindPlayer(u->GetOwnerGuid());
if (!owner || i_fobj->IsFriendlyTo(owner))
return false;
if (i_fobj->IsWithinDistInMap(u, i_range))
return true;
retu... | false | false | false | false | false | 0 |
test_send_objects_sync (ETestServerFixture *fixture,
gconstpointer user_data)
{
ECalClient *cal_client;
GError *error = NULL;
icalcomponent *icalcomp, *modified_icalcomp = NULL;
GSList *users = NULL;
cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
icalcomp = create_object... | false | false | false | false | false | 0 |
createUDTSocket(UDTSOCKET& usock, int port = 0, bool rendezvous = false)
{
addrinfo hints;
addrinfo* res;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_flags = AI_PASSIVE;
hints.ai_family = g_IP_Version;
hints.ai_socktype = g_Socket_Type;
char service[16];
sprintf(service, "%d", port);... | false | false | false | false | false | 0 |
v2_read_header(struct quota_handle *h, struct v2_disk_dqheader *dqh)
{
if (h->e2fs_read(&h->qh_qf, 0, dqh, sizeof(struct v2_disk_dqheader)) !=
sizeof(struct v2_disk_dqheader))
return 0;
return 1;
} | false | false | false | false | false | 0 |
vis_show (GtkVideo *this, xine_audio_port_t **audio_port)
{
if (xine_get_stream_info (stream, XINE_STREAM_INFO_HAS_VIDEO) ||
!xine_get_stream_info (stream, XINE_STREAM_INFO_HAS_AUDIO))
return FALSE;
return gtk_video_set_vis (this, audio_port, TRUE);
} | false | false | false | false | false | 0 |
zerotestbv(Bit_vector *a, int l)
{
int i;
for (i=0 ; i<l ; i++) if (*a++) return 0;
return 1;
} | false | false | false | false | false | 0 |
wait_till_fw_empty(adapter_t *adapter)
{
unsigned long flags = 0;
int i;
/*
* Set the quiescent flag to stop issuing cmds to FW.
*/
spin_lock_irqsave(&adapter->lock, flags);
adapter->quiescent++;
spin_unlock_irqrestore(&adapter->lock, flags);
/*
* Wait till there are no more cmds outstanding at FW. Try... | false | false | false | false | false | 0 |
caml_extunix_setresgid(value r, value e, value s)
{
CAMLparam3(r, e, s);
gid_t rgid = Int_val(r);
gid_t egid = Int_val(e);
gid_t sgid = Int_val(s);
if (setresgid(rgid, egid, sgid) == -1)
uerror("setresgid", Nothing);
CAMLreturn(Val_unit);
} | false | false | false | false | false | 0 |
read_utility(void *dev, unsigned long ubus_addr)
{
struct idt77252_dev *card = dev;
unsigned long flags;
u8 value;
if (!card) {
printk("Error: No such device.\n");
return -1;
}
spin_lock_irqsave(&card->cmd_lock, flags);
writel(SAR_CMD_READ_UTILITY + ubus_addr, SAR_REG_CMD);
waitfor_idle(card);
value = re... | false | false | false | false | false | 0 |
__exec_rosync_misctf(void)
{
register i_tev_ndx tevpi;
__rosync_slot = TRUE;
for (tevpi = __tehdr_rosynci; tevpi != -1; tevpi = __tevtab[tevpi].tenxti)
rosync_call_misctf(tevpi);
/* slot end action turned off all at once later */
/* add the list on to head of tev free list */
__tevtab[__teend_rosynci].tenxti... | false | false | false | false | false | 0 |
format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
if (spec->named != NULL)
{
unsigned int i;
for (i = 0; i < spec->named_arg_count; i++)
free (spec->named[i].name);
free (spec->named);
}
free (spec);
} | 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.