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 |
|---|---|---|---|---|---|---|
compile_length_quantifier_node(QtfrNode* qn, regex_t* reg)
{
int len, mod_tlen;
int infinite = IS_REPEAT_INFINITE(qn->upper);
int empty_info = qn->target_empty_info;
int tlen = compile_length_tree(qn->target, reg);
if (tlen < 0) return tlen;
/* anychar repeat */
if (NTYPE(qn->target) == NT_CANY) {
i... | false | false | false | false | false | 0 |
write_pdb_core(FILE *fp, gint i, struct core_pak *core, struct model_pak *model)
{
gdouble x[3];
gchar *res_name, *chain;
ARR3SET(x, core->x);
vecmat(model->latmat, x);
if (!core->res_name)
res_name = "UNK";
else
res_name = core->res_name;
if (!core->chain)
chain = "A";
else
chain = core->chain;
fprintf(fp,... | false | false | false | false | false | 0 |
init() {
/* sling ammunition */
create("flintstone", 1, 10, Attack(AT_CLAW, AD_PHYS, 1, 6), Attack(), Attack(), Attack(AT_CLAW, AD_PHYS, 1, 6), Attack(), Attack(), MATERIAL_MINERAL, GEM, 0, true, CHAOTIC | NEUTRAL | LAWFUL);
} | false | false | false | false | false | 0 |
Jim_PosixSetError(Jim_Interp *interp)
{
Jim_SetResultString(interp, strerror(errno), -1);
} | false | false | false | false | false | 0 |
check_wp(void)
{
if (test_bit(FD_VERIFY_BIT, &DRS->flags)) {
/* check write protection */
output_byte(FD_GETSTATUS);
output_byte(UNIT(current_drive));
if (result() != 1) {
FDCS->reset = 1;
return;
}
clear_bit(FD_VERIFY_BIT, &DRS->flags);
clear_bit(FD_NEED_TWADDLE_BIT, &DRS->flags);
debug_dcl(D... | false | false | false | false | false | 0 |
clear() throw(GsmException)
{
for (iterator i = begin(); i != end(); ++i)
erase(i);
} | false | false | false | false | false | 0 |
real_from_integer (r, mode, low, high, unsigned_p)
REAL_VALUE_TYPE *r;
enum machine_mode mode;
unsigned HOST_WIDE_INT low;
HOST_WIDE_INT high;
int unsigned_p;
{
if (low == 0 && high == 0)
get_zero (r, 0);
else
{
r->class = rvc_normal;
r->sign = high < 0 && !unsigned_p;
... | false | false | false | false | false | 0 |
CreateEstimatedSizeMap ( XMPMeta & stdXMP, PropSizeMap * propSizes )
{
#if Trace_PackageForJPEG
printf ( " Creating top level property map:\n" );
#endif
for ( size_t s = stdXMP.tree.children.size(); s > 0; --s ) {
XMP_Node * stdSchema = stdXMP.tree.children[s-1];
for ( size_t p = stdSchema->children.size()... | false | false | false | false | false | 0 |
utf8string_validate(
const char *begin,
const char *end,
const char **last
)
{
int rc = 0; /* Assume string is valid */
const char *p = NULL;
if ((begin == NULL) || (end == NULL)) {
rc = 1;
goto exit;
}
for (p = begin; p <= end; ... | false | false | false | false | false | 0 |
MGD77_Correction (struct MGD77_CORRECTION *C, double **value, double *aux, GMT_LONG rec)
{ /* Calculates the correction term for a single observation
* when data are given in a 2-D array and aux in a 1-D array for current record */
double dz = 0.0, z;
struct MGD77_CORRECTION *current = NULL;
for (current = C; cur... | false | false | false | false | false | 0 |
ReconcileAllCmlBondParities( inp_ATOM *at, int num_atoms, int bDisconnected )
{
int i, ret = 0;
S_CHAR *visited = (S_CHAR*) inchi_calloc( num_atoms, sizeof(*visited) );
if ( !visited )
return -1; /* out of RAM */
for ( i = 0; i < num_atoms; i ++ ) {
if ( at[i].sb_parity[0] && !visited[i]... | false | false | false | false | false | 0 |
handleTabPanePos (const EventArgs& e)
{
TabControl::TabPanePosition tpp;
switch (static_cast<const WindowEventArgs&> (e).window->getID ())
{
case 0:
tpp = TabControl::Top;
break;
case 1:
tpp = TabControl::Bottom;
... | false | false | false | false | false | 0 |
lookup_attribute (const gchar **attrs,
const gchar *attr)
{
gint i;
if (!attrs || !attr) {
return NULL;
}
for (i = 0; attrs[i] && attrs[i + 1]; i += 2) {
if (g_ascii_strcasecmp (attrs[i], attr) == 0) {
return attrs[i + 1];
}
}
return NULL;
} | false | false | false | false | false | 0 |
dav_method_report(request_rec *r)
{
dav_resource *resource;
const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r);
int result;
int label_allowed;
apr_xml_doc *doc;
dav_error *err;
/* If no versioning provider, decline the request */
if (vsn_hooks == NULL)
return DECLINED;
i... | false | false | false | false | false | 0 |
knh_strcaseuint64(kbytes_t t)
{
int ch[8] = {0};
kuint64_t n = 0;
size_t i, c = 0;
for(i = 0; i < 8; i++) {
while(t.text[c] == '_') c++;
if(c >= t.len) break;
ch[i] = toupper(t.text[c]); c++;
}
if(i > 0) {
switch(i) {
default: n |= ((kuint64_t)ch[7]);
case 7: n |= (((kuint64_t)ch[6]) << (64-56));
ca... | false | false | false | false | false | 0 |
GetBlockSize(std::string BlockName, int type)
{
int64_t size=0;
//Find total number of particles needed
for(unsigned int i=0; i<file_maps.size(); i++)
if(file_maps[i].blocks.count(BlockName)){
if(type >= 0 && type < N_TYPE)
... | false | false | false | false | false | 0 |
NullBlock( void *pData )
{
int nWords = nBlockXSize * nBlockYSize;
int nChunkSize = MAX(1,GDALGetDataTypeSize(eDataType)/8);
int bNoDataSet;
double dfNoData = GetNoDataValue( &bNoDataSet );
if( !bNoDataSet )
{
#ifdef ESRI_BUILD
if ( poGDS->nBitsPerSample >= 2 )
memset( pDat... | false | false | false | false | false | 0 |
wbcir_irq_rx(struct wbcir_data *data, struct pnp_dev *device)
{
u8 irdata;
DEFINE_IR_RAW_EVENT(rawir);
unsigned duration;
/* Since RXHDLEV is set, at least 8 bytes are in the FIFO */
while (inb(data->sbase + WBCIR_REG_SP3_LSR) & WBCIR_RX_AVAIL) {
irdata = inb(data->sbase + WBCIR_REG_SP3_RXDATA);
if (data->rxs... | false | false | false | false | false | 0 |
g2_gd_Alloc_Basic(int pid, void *pdp)
{
int icol;
for (icol=0;icol<32;icol++)
gdImageColorAllocate(PDP->im,g2_Basic_Colors[icol][0]/256,g2_Basic_Colors[icol][1]/256,g2_Basic_Colors[icol][2]/256);
PDP->NoOfInks = 32;
return 0;
} | false | false | false | false | false | 0 |
think_build_camp()
{
//----- check if any of the other camps protecting this town is still recruiting soldiers, if so, wait until their recruitment is finished. So we can measure the protection available accurately.
Nation* ownNation = nation_array[nation_recno];
FirmCamp* firmCamp;
Firm* firmPtr;
int campC... | false | false | false | false | false | 0 |
init(const svn_opt_revision_t * revision)
{
if (!revision)
{
m_revision.kind = svn_opt_revision_unspecified;
}
else
{
m_revision.kind = revision->kind;
// m_revision.value is a union so we are not
// allowed to set number if we want to use date
// and vice versa
... | false | false | false | false | false | 0 |
bcmgenet_set_hw_params(struct bcmgenet_priv *priv)
{
struct bcmgenet_hw_params *params;
u32 reg;
u8 major;
u16 gphy_rev;
if (GENET_IS_V4(priv)) {
bcmgenet_dma_regs = bcmgenet_dma_regs_v3plus;
genet_dma_ring_regs = genet_dma_ring_regs_v4;
priv->dma_rx_chk_bit = DMA_RX_CHK_V3PLUS;
priv->version = GENET_V4;
... | false | false | false | false | false | 0 |
cache_get_providers(request_rec *r,
cache_server_conf *conf,
apr_uri_t uri)
{
cache_dir_conf *dconf = ap_get_module_config(r->per_dir_config, &cache_module);
cache_provider_list *providers = NULL;
int i;
/* per directory cache disable */
if (dconf->disable) {
return NULL;
... | false | false | false | false | false | 0 |
swapoff_by_label(const char *label, int quiet) {
const char *special = fsprobe_get_devname_by_label(label);
return special ? do_swapoff(special, quiet, CANONIC) : cannot_find(label);
} | false | false | false | false | false | 0 |
ajSeqallGetFilename(const AjPSeqall seq)
{
if(!seq)
return NULL;
if(!seq->Seqin)
return NULL;
ajDebug("ajSeqallGetFilename '%S' usa: '%S'\n",
seq->Seqin->Name, seq->Seqin->Input->Qry);
if(ajStrGetLen(seq->Seqin->Input->Filename))
return seq->Seqin->Input->Filename;
return NULL;
} | false | false | false | false | false | 0 |
removeClient( KXMLGUIClient *client )
{
//kDebug(260) << client;
// don't try to remove the client's GUI if we didn't build it
if ( !client || client->factory() != this )
return;
if (d->emptyState())
emit makingChanges(true);
// remove this client from our client list
d->m_cli... | false | false | false | false | false | 0 |
GetHashForFile(std::string filename) const /*{{{*/
{
std::string fileHash;
FileFd Fd(filename, FileFd::ReadOnly);
if(Type == "MD5Sum")
{
MD5Summation MD5;
MD5.AddFD(Fd);
fileHash = (std::string)MD5.Result();
}
else if (Type == "SHA1")
{
SHA1Summation SHA1;
SHA1.A... | false | false | false | false | false | 0 |
has_multiple_baserels(PlannerInfo *root)
{
int num_base_rels = 0;
Index rti;
for (rti = 1; rti < root->simple_rel_array_size; rti++)
{
RelOptInfo *brel = root->simple_rel_array[rti];
if (brel == NULL)
continue;
/* ignore RTEs that are "other rels" */
if (brel->reloptkind == RELOPT_BASEREL)
if (+... | false | false | false | false | false | 0 |
rfc1035_init_resolv(struct rfc1035_res *res)
{
FILE *fp=fopen("/etc/resolv.conf", "r");
char rfc1035_buf[512];
RFC1035_ADDR ns[RFC1035_MAXNS];
int nns=0;
memset(res, 0, sizeof(*res));
while (fp && fgets(rfc1035_buf, sizeof(rfc1035_buf), fp))
{
char *p;
for (p=rfc1035_buf; *p; p++)
*p=tl(*p);
for (p=rfc10... | true | true | true | false | true | 1 |
get_digest_key(krb5_context context,
krb5_kdc_configuration *config,
hdb_entry_ex *server,
krb5_crypto *crypto)
{
krb5_error_code ret;
krb5_enctype enctype;
Key *key;
ret = _kdc_get_preferred_key(context,
config,
server,
"digest-service",
&enctype,
&key)... | false | false | false | false | false | 0 |
sort_clause(int c[], int n)
{
int i, j, temp;
for (i = 0; i < n-1; i++)
for (j = i+1; j < n; j++)
if (abs(c[j]) < abs(c[i])) {
temp = c[i]; c[i] = c[j]; c[j] = temp;
}
} | false | false | false | false | false | 0 |
formatHttpDate(qint64 date)
{
KDateTime dt;
dt.setTime_t(date);
QString ret = dt.toString(KDateTime::RFCDateDay);
ret.chop(6); // remove " +0000"
// RFCDate[Day] omits the second if zero, but HTTP requires it; see bug 240585.
if (!dt.time().second()) {
ret.append(QLatin1String(":00"))... | false | false | false | false | false | 0 |
wxIsAlphaNumeric(const wxString& val) {
int i;
for (i = 0; i < (int)val.Length(); i++) {
if (!wxIsalnum(val[i]))
return FALSE;
}
return TRUE;
} | false | false | false | false | false | 0 |
gee_linked_list_real_get (GeeAbstractList* base, gint index) {
GeeLinkedList * self;
gpointer result = NULL;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
gint _tmp2_ = 0;
GeeLinkedListNode* n = NULL;
gint _tmp3_ = 0;
GeeLinkedListNode* _tmp4_ = NULL;
gconstpointer _tmp5_ = NULL;
gpointer _tmp6_ = NULL;
self = (GeeLinke... | false | false | false | false | false | 0 |
pdacf_reset(struct snd_pdacf *chip, int powerdown)
{
u16 val;
val = pdacf_reg_read(chip, PDAUDIOCF_REG_SCR);
val |= PDAUDIOCF_PDN;
val &= ~PDAUDIOCF_RECORD; /* for sure */
pdacf_reg_write(chip, PDAUDIOCF_REG_SCR, val);
udelay(5);
val |= PDAUDIOCF_RST;
pdacf_reg_write(chip, PDAUDIOCF_REG_SCR, val);
udelay(20... | false | false | false | false | false | 0 |
recfield (LexState *ls, struct ConsControl *cc) {
/* recfield -> (NAME | `['exp1`]') = exp1 */
FuncState *fs = ls->fs;
int reg = ls->fs->freereg;
expdesc key, val;
int rkkey;
if (ls->t.token == TK_NAME) {
luaY_checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
checkname(ls, &key);
}
else... | false | false | false | false | false | 0 |
_e_manager_cb_window_show_request(void *data, int ev_type __UNUSED__, void *ev)
{
E_Manager *man;
Ecore_X_Event_Window_Show_Request *e;
man = data;
e = ev;
if (e_stolen_win_get(e->win)) return 1;
if (ecore_x_window_parent_get(e->win) != man->root)
return ECORE_CALLBACK_PASS_ON; /* try other han... | false | false | false | false | false | 0 |
on_server_session(session *s, void *v)
{
if (session_on_connect(s))
{
printf("SERVER: connected '%s'\n", session_get_remote_host(s, 0));
return 1;
}
if (session_on_disconnect(s))
{
printf("SERVER: disconnected\n");
return 0;
}
char *buf = 0;
if (!session_readmsg(s, &buf))
return 0;
if (g_debug) p... | false | false | false | false | false | 0 |
unparse_root(FILE *file, SGFNode *node)
{
sgf_putc(';', file);
if (sgfHasProperty(node, "GM"))
sgfPrintCharProperty(file, node, "GM");
else {
fputs("GM[1]", file);
sgf_column += 5;
}
sgfPrintCharProperty(file, node, "FF");
sgf_putc('\n', file);
sgfPrintCharProperty(file, node, "SZ");
... | false | false | false | false | false | 0 |
encode_result_set(SQLSMALLINT num_of_columns,
db_state *state)
{
db_result_msg msg;
columns(state) = alloc_column_buffer(num_of_columns);
msg = encode_column_name_list(num_of_columns, state);
if (msg.length == 0) { /* If no error has occurred */
msg = encode_value_list(num_of_columns,... | false | false | false | false | false | 0 |
__pyx_mp_ass_subscript_5attic_9hashindex_IndexBase(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
PyErr_Format(PyExc_NotImplementedError,
"Subscript assignment not supported by %s", Py_TYPE(o)->tp_name);
return -1;
}
else {
return __pyx_pw_5attic_9hashindex_9IndexBase_13__delitem__(o, i);
}... | false | false | false | false | false | 0 |
addToConfig(ArConfig* config, const char* sectionName, int priority)
{
if (config == NULL || sectionName == NULL)
{
ArLog::log(ArLog::Terse, "Could not add ArActionStallRecoverToConfig because config (%p) or section (%p) are null", config, sectionName);
return;
}
config->addParam(ArConfigArg(ArConfigArg... | false | false | false | false | false | 0 |
send_image(int report, int defrpt)
{
char answer[256], answer2[256], answer3[256];
if (report < 1 || report > 6)
report = defrpt;
fputs ("<img src=\"upsimage.cgi?display=", stdout);
switch ( report ) {
case 1:
getupsvar (monhost, "battcap", answer, sizeof(answer));
g... | false | false | false | false | false | 0 |
_evry_plugin_select(Evry_State *s, Evry_Plugin *p)
{
if (!s) return;
if (p)
{
s->plugin_auto_selected = EINA_FALSE;
}
else
{
p = eina_list_data_get(s->cur_plugins);
s->plugin_auto_selected = EINA_TRUE;
}
s->plugin = p;
if ((s->view && s->plugin && s->plugin-... | false | false | false | false | false | 0 |
ocfs2_orphan_scan_unlock(struct ocfs2_super *osb, u32 seqno)
{
struct ocfs2_lock_res *lockres;
struct ocfs2_orphan_scan_lvb *lvb;
if (!ocfs2_is_hard_readonly(osb) && !ocfs2_mount_local(osb)) {
lockres = &osb->osb_orphan_scan.os_lockres;
lvb = ocfs2_dlm_lvb(&lockres->l_lksb);
lvb->lvb_version = OCFS2_ORPHAN_LV... | false | false | false | false | false | 0 |
getNameElement(const char *pattern, unsigned const element) {
unsigned h(0);
const char *p(pattern);
while (*p && (*p != '-' || element != ++h)) ++p;
return (element == h ? newstr(p + 1, "-") : newstr("*"));
} | false | false | false | false | false | 0 |
CheckSea(int dir, int range, int remainocean)
{
if (type != R_OCEAN) return 0;
if (range-- < 1) return 1;
for (int d2 = -1; d2< 2; d2++) {
int direc = (dir + d2 + NDIRS) % NDIRS;
ARegion *newregion = neighbors[direc];
if (!newregion) continue;
remainocean += newregion->CheckSea(dir, range, remainocean);
if... | false | false | false | false | false | 0 |
monitor_add(char *interface)
{
char *rule;
DBusError err;
if (monitor_s == false && monitor_t == false && monitor_m == false)
dbus_connection_add_filter(connection, monitor_changed,
NULL, NULL);
if (g_strcmp0(interface, "Service") == 0) {
if (monitor_s == true)
return;
monitor_s = true;
} else if (g... | false | false | false | false | false | 0 |
hud_close()
{
int i;
size_t j, num_gauges = 0;
for (i = 0; i < Num_ship_classes; i++) {
num_gauges = Ship_info[i].hud_gauges.size();
for(j = 0; j < num_gauges; j++) {
vm_free(Ship_info[i].hud_gauges[j]);
Ship_info[i].hud_gauges[j] = NULL;
}
Ship_info[i].hud_gauges.clear();
}
num_gauges = default_h... | false | false | false | false | false | 0 |
amd8111e_init_ring(struct net_device *dev)
{
struct amd8111e_priv *lp = netdev_priv(dev);
int i;
lp->rx_idx = lp->tx_idx = 0;
lp->tx_complete_idx = 0;
lp->tx_ring_idx = 0;
if(lp->opened)
/* Free previously allocated transmit and receive skbs */
amd8111e_free_skbs(dev);
else{
/* allocate the tx and rx ... | false | false | false | false | false | 0 |
growBuf(Format *fmt)
{
uchar *newbuf;
ssize buflen;
buflen = (int) (fmt->endbuf - fmt->buf);
if (fmt->maxsize >= 0 && buflen >= fmt->maxsize) {
return 0;
}
if (fmt->growBy <= 0) {
/*
User supplied buffer
*/
return 0;
}
newbuf = mprAlloc(b... | false | true | false | false | false | 1 |
DNDDataReceivedCB(
GtkWidget *widget, GdkDragContext *dc,
gint x, gint y, GtkSelectionData *selection_data,
guint info, guint t, gpointer data) {
gboolean same;
GtkWidget *source_widget;
if((widget == NULL) || (data == NULL) || (dc == NULL)) return;
/* Important, check if we actually got data. Som... | false | false | false | false | false | 0 |
pixThin(PIX *pixs,
l_int32 type,
l_int32 connectivity,
l_int32 maxiters)
{
PIX *pixd;
SEL *sel;
SELA *sela;
PROCNAME("pixThin");
if (!pixs)
return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
if (pixGetDepth(pixs) != 1)
return (PIX *)ERROR_PTR("... | false | false | false | false | false | 0 |
mcc_get_cache_first(krb5_context context, krb5_cc_cursor *cursor)
{
struct mcache_iter *iter;
iter = calloc(1, sizeof(*iter));
if (iter == NULL)
return krb5_enomem(context);
HEIMDAL_MUTEX_lock(&mcc_mutex);
iter->cache = mcc_head;
if (iter->cache) {
HEIMDAL_MUTEX_lock(&(iter->cache->mutex));
... | false | false | false | false | false | 0 |
ppc32_exec_SLW(cpu_ppc_t *cpu,ppc_insn_t insn)
{
int rs = bits(insn,21,25);
int ra = bits(insn,16,20);
int rb = bits(insn,11,15);
register m_uint32_t s;
s = cpu->gpr[rb] & 0x3f;
if (likely(!(s & 0x20)))
cpu->gpr[ra] = cpu->gpr[rs] << s;
else
cpu->gpr[ra] = 0;
return(0);
} | false | false | false | false | false | 0 |
testvec (int n)
{
static double *x;
static int nx;
int t;
if (n == 0) {
/* clean up */
free(x);
x = NULL;
nx = 0;
return NULL;
}
if (n > nx) {
double *y = realloc(x, n * sizeof *x);
if (y == NULL) {
free(x);
x = NULL;
nx = 0;
return NULL;
}
nx = n;
x = y;
... | false | false | false | false | false | 0 |
read_file() {
char buf[256];
#ifndef _USING_FCGI_
FILE* f = fopen(HR_INFO_FILENAME, "r");
#else
FCGI_FILE* f = FCGI::fopen(HR_INFO_FILENAME, "r");
#endif
if (!f) return ERR_FOPEN;
int i, j, jj;
double x;
for (i=1; i<HR_NTYPES; i++) {
if (!fgets(buf, sizeof(buf), f)) {
f... | false | false | false | false | true | 1 |
value_to_double_int (prop_value_t val)
{
if (val.value
&& TREE_CODE (val.value) == INTEGER_CST)
return tree_to_double_int (val.value);
else
return double_int_zero;
} | false | false | false | false | false | 0 |
show()
{
trigrec_t *t;
if(!cmdinfo.istok1)
{
say("Usage: trigger-show <name>");
say("Use this command to display a trigger entry.");
return;
}
if(!trigger_istrigger(cmdinfo.tok1))
{
say("The trigger \"%s\" does not exist.", cmdinfo.tok1);
return;
}
t = trigger_get_trigger(cmdinfo.tok1);
say(" n... | false | false | false | false | false | 0 |
libsyssys_mkdir(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj pathname_scm;
const char * pathname;
ScmObj mode_scm;
int mode;
ScmObj SCM_SUBRARGS[2];
int SCM_i;
SCM_ENTER_SUBR("sys-mkdir");
for (SCM_i=0; SCM_i<2; SCM_i++) {
SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
}
pathname_scm = SCM_SU... | false | false | false | false | false | 0 |
FVDontAutoHint(FontViewBase *fv) {
int i, gid;
for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
(gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
SplineChar *sc = fv->sf->glyphs[gid];
sc->manualhints = true;
}
} | false | false | false | false | false | 0 |
mod_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
{
switch(param)
{
case AL_RING_MODULATOR_FREQUENCY:
*val = (ALint)effect->Modulator.Frequency;
break;
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
*val = (ALint)effect->Modulator.HighPas... | false | false | false | false | false | 0 |
exec_init(unsigned int num) { /* num == 0 */
int childpid;
int pipes[2];
if (strlen(Folders[0].folder) >= sizeof(Current_folder))
warn_exit("folder name is too long.");
STRCPY(Current_folder, Folders[0].folder);
ch_folder(Current_folder);
if (pipe(pipes) != 0) warn_exit("can't open pipe.");
childpid = FORK()... | false | false | false | false | false | 0 |
ValidSimple(BBInfo &TrueBBI, unsigned &Dups,
BranchProbability Prediction) const {
Dups = 0;
if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone)
return false;
if (TrueBBI.IsBrAnalyzable)
return false;
if (TrueBBI.BB->pred_size() > 1) {
if (TrueBBI.CannotBeCopied ||
... | false | false | false | false | false | 0 |
usb_sleep_charge_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 mode;
int ret;
ret = toshiba_usb_sleep_charge_get(toshiba, &mode);
if (ret < 0)
return ret;
return sprintf(buf, "%x\n", mode & SCI_USB_CHARGE_MODE_MASK);
... | false | true | false | false | false | 1 |
on_prompt_free (gpointer data)
{
on_prompt_args *args = data;
g_assert (args);
g_assert (args->op);
if (args->op->prompting)
dbus_connection_remove_filter (args->op->conn, on_prompt_signal, args);
g_free (args->path);
g_slice_free (on_prompt_args, args);
} | false | false | false | false | false | 0 |
mmc_test_capacity(struct mmc_card *card)
{
if (!mmc_card_sd(card) && mmc_card_blockaddr(card))
return card->ext_csd.sectors;
else
return card->csd.capacity << (card->csd.read_blkbits - 9);
} | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdf5lib_H5__1H5Rget_1region
(JNIEnv *env, jclass clss, jint dataset, jint ref_type,
jbyteArray ref )
{
hid_t status;
jboolean isCopy;
jbyte *refP;
if (ref_type != H5R_DATASET_REGION) {
h5badArgument( env, "H5Rget_region: bad ref_type ");
return -1;
}
if (ref... | false | false | false | false | false | 0 |
compareTo(const SegmentNode& other)
{
if (segmentIndex < other.segmentIndex) return -1;
if (segmentIndex > other.segmentIndex) return 1;
#if GEOS_DEBUG
cerr << setprecision(17) << "compareTo: " << *this << ", " << other <<endl;
#endif
if (coord.equals2D(other.coord)) {
#if GEOS_DEBUG
cerr << " Coordinates equa... | false | false | false | false | false | 0 |
gdk_pixbuf__xpm_image_load_xpm_data (const gchar **data)
{
GdkPixbuf *pixbuf;
struct mem_handle h;
GError *error = NULL;
h.data = data;
h.offset = 0;
pixbuf = pixbuf_create_from_xpm (mem_buffer, &h, &error);
if (error) {
g_warning ("Inl... | false | false | false | false | false | 0 |
isl_ast_build_substitute_values_union_map_domain(
__isl_keep isl_ast_build *build, __isl_take isl_union_map *umap)
{
isl_multi_aff *values;
if (!build)
return isl_union_map_free(umap);
values = isl_multi_aff_copy(build->values);
umap = isl_union_map_preimage_domain_multi_aff(umap, values);
return umap;
} | false | false | false | false | false | 0 |
_handle_ping(struct allocation_msg_thread *msg_thr,
slurm_msg_t *msg)
{
srun_ping_msg_t *ping = (srun_ping_msg_t *)msg->data;
debug3("received ping message");
slurm_send_rc_msg(msg, SLURM_SUCCESS);
if (msg_thr->callback.ping != NULL)
(msg_thr->callback.ping)(ping);
slurm_free_srun_ping_msg(msg->data);
... | false | false | false | false | false | 0 |
activate_filter_modes(Config *config)
{
config->add_notifier(new ModeNotifierImpl(config));
} | false | false | false | false | false | 0 |
process_contact_cb (GDataEntry *entry,
guint entry_key,
guint entry_count,
GetContactsData *data)
{
EBookBackendGooglePrivate *priv;
EBookBackend *backend = data->backend;
gboolean is_deleted, is_cached;
const gchar *uid;
priv = E_BOOK_BACKEND_GOOGLE_GET... | false | false | false | false | false | 0 |
InterpolatePoint(
vtkDataSetAttributes::FieldList& list,
vtkDataSetAttributes *fromPd,
int idx,
vtkIdType toId, vtkIdList *ptIds,
double *weights)
{
vtkAbstractArray *fromArray;
vtkAbstractArray *toArray;
for (int i=0; i < list.NumberOfFields; i++)
{
if ( list.FieldIndices[i] >= 0 && list.DSA... | false | false | false | false | false | 0 |
ir_wavedisplay_destroy(GtkObject * object) {
IRWaveDisplay * w = IR_WAVEDISPLAY(object);
IRWaveDisplayPrivate * p = IR_WAVEDISPLAY_GET_PRIVATE(w);
if (p->pixmap) {
gdk_pixmap_unref(p->pixmap);
p->pixmap = NULL;
}
if (p->wave) {
free(p->wave);
p->wave = NULL;
}
} | false | false | false | false | false | 0 |
IO_creadline(PyObject *self, char **output) {
char *n, *start, *end;
Py_ssize_t len;
if (!IO__opencheck(IOOOBJECT(self))) return -1;
n = start = ((IOobject*)self)->buf + ((IOobject*)self)->pos;
end = ((IOobject*)self)->buf + ((IOobject*)self)->string_size;
while (n < end && *n != '\n')
... | false | false | false | false | false | 0 |
ExitCode()
{
return errors!=0 || output->Error();
} | false | false | false | false | false | 0 |
write_uleb128 (bfd_byte *p, unsigned int val)
{
bfd_byte c;
do
{
c = val & 0x7f;
val >>= 7;
if (val)
c |= 0x80;
*(p++) = c;
}
while (val);
return p;
} | false | false | false | false | false | 0 |
dw_mci_enable_cd(struct dw_mci *host)
{
struct dw_mci_board *brd = host->pdata;
unsigned long irqflags;
u32 temp;
int i;
/* No need for CD if broken card detection */
if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
return;
/* No need for CD if all slots have a non-error GPIO */
for (i = 0; i < host->n... | false | false | false | false | false | 0 |
gp_itdb_remove(iTunesDB *itdb) {
g_return_if_fail (itdbs_head);
g_return_if_fail (itdb);
g_signal_emit(gtkpod_app, gtkpod_app_signals[ITDB_REMOVED], 0, itdb);
itdbs_head->itdbs = g_list_remove(itdbs_head->itdbs, itdb);
} | false | false | false | false | false | 0 |
md_start_sync(struct work_struct *ws)
{
struct mddev *mddev = container_of(ws, struct mddev, del_work);
int ret = 0;
if (mddev_is_clustered(mddev)) {
ret = md_cluster_ops->resync_start(mddev);
if (ret) {
mddev->sync_thread = NULL;
goto out;
}
}
mddev->sync_thread = md_register_thread(md_do_sync,
... | false | false | false | false | false | 0 |
AcquireQuantumInfo(const ImageInfo *image_info,
Image *image)
{
MagickBooleanType
status;
QuantumInfo
*quantum_info;
quantum_info=(QuantumInfo *) AcquireMagickMemory(sizeof(*quantum_info));
if (quantum_info == (QuantumInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFai... | false | false | false | false | false | 0 |
read_redirect(tokenizer_t *tok, int fd)
{
int mode = -1;
if ((*tok->buff == L'>') ||
(*tok->buff == L'^'))
{
tok->buff++;
if (*tok->buff == *(tok->buff-1))
{
tok->buff++;
mode = 1;
}
else
{
mode = 0;
}
... | false | false | false | false | false | 0 |
setOutput(std::ostream & stream)
{
this->closeFile();
this->filename = "";
this->externalOutputStream = &stream;
if (this->mode == SVUT_OUT_STD_COLOR)
this->mode = SVUT_OUT_STD_BW;
} | false | false | false | false | false | 0 |
inspect1(struct strscanner *p)
{
char buf[BUFSIZE];
char *bp = buf;
long len;
if (p->curr == 0) return rb_str_new2("");
if (p->curr > INSPECT_LENGTH) {
strcpy(bp, "..."); bp += 3;
len = INSPECT_LENGTH;
}
else {
len = p->curr;
}
memcpy(bp, CURPTR(p) - len, len... | false | false | false | false | false | 0 |
gst_rtp_base_payload_chain (GstPad * pad, GstObject * parent,
GstBuffer * buffer)
{
GstRTPBasePayload *rtpbasepayload;
GstRTPBasePayloadClass *rtpbasepayload_class;
GstFlowReturn ret;
rtpbasepayload = GST_RTP_BASE_PAYLOAD (parent);
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
... | false | false | false | false | false | 0 |
onUpdToggleGenres(FXObject*sender,FXSelector,void*){
if (source && source->canBrowse() && browsersplit->getExpanded()==SHOWBROWSER) {
sender->handle(this,FXSEL(SEL_COMMAND,FXWindow::ID_ENABLE),NULL);
if (genrelistframe->shown())
sender->handle(this,FXSEL(SEL_COMMAND,FXWindow::ID_CHECK),NULL);
else
... | false | false | false | false | false | 0 |
ConcreteCompute()
{
if (HasMean())
SetMean(mpStats->GetMean());
if (HasTemporalCentroid())
SetTemporalCentroid(mpStats->GetCentroid()/mpAudio->GetSampleRate());
if (HasEnergy())
SetEnergy(mpStats->GetEnergy());
if(HasVariance())
SetVariance(mpStats->GetVariance());
if(HasZeroCrossingRate())
SetZeroCrossi... | false | false | false | false | false | 0 |
gf2m_Madd(const EC_GROUP *group, const BIGNUM *x, BIGNUM *x1, BIGNUM *z1,
const BIGNUM *x2, const BIGNUM *z2, BN_CTX *ctx)
{
BIGNUM *t1, *t2;
int ret = 0;
/* Since Madd is static we can guarantee that ctx != NULL. */
BN_CTX_start(ctx);
t1 = BN_CTX_get(ctx);
t2 = BN_CTX_get(ctx);
if (t2 == NULL) goto err;
... | false | false | false | false | false | 0 |
epoint_comp(_MIPD_ epoint *a,epoint *b)
{
BOOL result;
#ifdef MR_OS_THREADS
miracl *mr_mip=get_mip();
#endif
if (mr_mip->ERNUM) return FALSE;
if (a==b) return TRUE;
if (a->marker==MR_EPOINT_INFINITY)
{
if (b->marker==MR_EPOINT_INFINITY) return TRUE;
else return FALSE;
}
i... | false | false | false | false | false | 0 |
GetExplicitDiscoverySpell(uint32 spellId, Player* player)
{
// explicit discovery spell chances (always success if case exist)
// in this case we have both skill and spell
SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(spellId);
if (tab == SkillDiscoveryStore.end())
return 0;
... | false | false | false | false | false | 0 |
semantic(Scope *sc)
{
if (!type)
{ // Note there is no operator overload
UnaExp::semantic(sc);
e1 = resolveProperties(sc, e1);
e1 = e1->checkToBoolean(sc);
if (e1->type == Type::terror)
return e1;
type = Type::tboolean;
}
return this;
} | false | false | false | false | false | 0 |
SimplifyInstructionsInBlock(BasicBlock *BB, const TargetData *TD) {
bool MadeChange = false;
for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
Instruction *Inst = BI++;
if (Value *V = SimplifyInstruction(Inst, TD)) {
WeakVH BIHandle(BI);
ReplaceAndSimplifyAllUses(Inst,... | false | false | false | false | false | 0 |
updateBlock(void)
{
m_pgb->truncate(0);
bool bRes = m_pBL->getBlockBuf(m_pgb);
UT_UNUSED(bRes);
UT_ASSERT(bRes);
m_pText = reinterpret_cast<UT_UCS4Char*>(m_pgb->getPointer(0));
UT_sint32 iNewLen = m_pgb->getLength();
if (iNewLen <= m_iStartIndex)
{
m_iStartIndex = iNewLen;
m_iPrevStartIndex = iNewLen;
}
... | false | false | false | false | false | 0 |
getCidHost(host_name)
char *host_name;
{
struct hostent *host ;
struct in_addr host_addr ;
/* determine address of CID */
if (isdigit(host_name[0]))
strcpy(cid_host, host_name) ;
else
{
if ((host = gethostbyname(host_name)) == NULL)
{
printf("getCidHost::gethostbyname\n") ;
exi... | false | false | false | false | false | 0 |
readChar(std::istream &istr, unsigned int bom)
{
unsigned char ch = (unsigned char)istr.get();
// For UTF-16 encoded files the BOM is 0xfeff/0xfffe. If the
// character is non-ASCII character then replace it with 0xff
if (bom == 0xfeff || bom == 0xfffe) {
unsigned char ch2 = (unsigned char)istr... | false | false | false | false | false | 0 |
MoveChase(Unit* target, float dist, float angle)
{
// ignore movement request if target not exist
if (!target)
{ return; }
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "%s chase to %s", m_owner->GetGuidStr().c_str(), target->GetGuidStr().c_str());
if (m_owner->GetTypeId() == TYPEID_PLAYER)
... | false | false | false | false | false | 0 |
_ds_set_signature (DSPAM_CTX * CTX, struct _ds_spam_signature *SIG,
const char *signature)
{
char filename[MAX_FILENAME_LENGTH];
char scratch[128];
FILE *file;
_ds_userdir_path(filename,
CTX->home,
(CTX->group) ? CTX->group : CTX->username,
... | false | false | false | false | false | 0 |
gen9_sseu_info_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_device_info *info;
int s_max = 3, ss_max = 4, eu_max = 8;
int s, ss;
u32 fuse2, s_enable, ss_disable, eu_disable;
u8 eu_mask = 0xff;
info = (struct intel_device_info *)&dev_priv->info;
fuse2 = I915_... | 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.