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 |
|---|---|---|---|---|---|---|
PyvtkMath_Matrix3x3ToQuaternion(PyObject *, PyObject *args)
{
vtkPythonArgs ap(args, "Matrix3x3ToQuaternion");
double temp0[3][3];
static int size0[2] = { 3, 3 };
double temp1[4];
double save1[4];
const int size1 = 4;
PyObject *result = NULL;
if (ap.CheckArgCount(2) &&
ap.GetNArray(*temp0, 2, si... | false | false | false | false | false | 0 |
areVerticesBehindPlane(const btVector3& planeNormal, const btAlignedObjectArray<btVector3>& vertices, btScalar margin)
{
int numvertices = vertices.size();
for (int i=0;i<numvertices;i++)
{
const btVector3& N1 = vertices[i];
btScalar dist = btScalar(planeNormal.dot(N1))+btScalar(planeNormal[3])-margin;
if (dis... | false | false | false | false | false | 0 |
ArgusProcessISL (struct ether_header *ep, int length)
{
struct ether_header *retn = NULL;
int type = (((unsigned char *)ep)[5] >> 4) & 0x0F;
#define ARGUS_TYPE_ETHER 0x0
#define ARGUS_TYPE_TR 0x0
#define ARGUS_TYPE_FDDI 0x2
#define ARGUS_TYPE_ATM 0x3
switch (type) {
case ARGUS_TYPE_ETHER:
e... | false | false | false | false | false | 0 |
printAST(ExprStream& os) const {
if(isNull()) return os << "Null" << endl;
bool isLetDecl(getKind() == LETDECL);
os << "(" << push;
os << getEM()->getKindName(getKind());
if (isApply()) {
os << space << "{" << getOp().getExpr() << push << "}";
}
else if (isSymbol()) {
os << space << "{Symbol: " <<... | false | false | false | false | false | 0 |
mousePressEvent(QMouseEvent *event)
{
switch (event->button()) {
case Qt::XButton1:
m_historyBackAction->activate(QAction::Trigger);
break;
case Qt::XButton2:
m_historyForwardAction->activate(QAction::Trigger);
break;
default:
QMainWindow::mousePressEvent(event);
... | false | false | false | false | false | 0 |
AST_cmp_arr_dec (Node *node, SymTable *st, Program *p, CompContext *cc, bool follow) {
if (cc->context != NULL) {
fputs ("fatal: arrays are forbidden inside functions\n", stderr);
fprintf (stderr, " arising from declaration of %s[] in %s\n",
node->value->as.string, cc->context->name);
... | false | false | false | false | false | 0 |
pcipcwd_clear_status(void)
{
int control_status;
int msb;
int reset_counter;
if (debug >= VERBOSE)
pr_info("clearing watchdog trip status & LED\n");
control_status = inb_p(pcipcwd_private.io_addr + 1);
if (debug >= DEBUG) {
pr_debug("status was: 0x%02x\n", control_status);
pr_debug("sending: 0x%02x\n",
... | false | false | false | false | false | 0 |
hwloc_decode_from_base64(char const *src, char *target, size_t targsize)
{
unsigned int tarindex, state;
int ch;
char *pos;
state = 0;
tarindex = 0;
while ((ch = *src++) != '\0') {
if (isspace(ch)) /* Skip whitespace anywhere. */
continue;
if (ch == Pad64)
break;
pos = strchr(Base64, ch);
if (po... | false | false | false | false | false | 0 |
maybe_emit_chk_warning (tree exp, enum built_in_function fcode)
{
int is_strlen = 0;
tree len, size;
location_t loc = tree_nonartificial_location (exp);
switch (fcode)
{
case BUILT_IN_STRCPY_CHK:
case BUILT_IN_STPCPY_CHK:
/* For __strcat_chk the warning will be emitted only if overflowing
... | false | false | false | false | true | 1 |
isSearching() {
return ((channel_type_flags & (CHANNEL_TYPE_WAITING | CHANNEL_TYPE_QUICK_SEARCH)) || (state != MESSAGE_RECEIVED));
} | false | false | false | false | false | 0 |
gsf_output_seek (GsfOutput *output, gsf_off_t offset, GSeekType whence)
{
gsf_off_t pos = offset;
g_return_val_if_fail (output != NULL, FALSE);
switch (whence) {
case G_SEEK_SET: break;
case G_SEEK_CUR: pos += output->cur_offset; break;
case G_SEEK_END: pos += output->cur_size; break;
default :
g_warning ("I... | false | false | false | false | false | 0 |
read_cached_record(JOIN_TAB *tab)
{
uchar *pos;
uint length;
bool last_record;
CACHE_FIELD *copy,*end_field;
last_record=tab->cache.record_nr++ == tab->cache.ptr_record;
pos=tab->cache.pos;
for (copy=tab->cache.field,end_field=copy+tab->cache.fields ;
copy < end_field;
copy++)
{
if (... | false | false | false | false | false | 0 |
my_unescape(char *string, char **last) {
char *result;
char enclose;
apr_size_t i;
apr_size_t j;
apr_size_t len;
if (!string) {
return string;
}
len = strlen(string);
enclose = string[0];
result = string;
for (i = 1, j = 0; i < len; i++, j++) {
/* check if we have an escape char */
... | false | false | false | false | false | 0 |
object_replace_any_type(lListElem *this_elem, int name, lListElem *org_elem)
{
int cull_ret = 0;
int out_pos = lGetPosViaElem(this_elem, name, SGE_NO_ABORT);
int in_pos = lGetPosViaElem(org_elem, name, SGE_NO_ABORT);
int type = lGetPosType(lGetElemDescr(this_elem), out_pos);
DENTER(OBJECT_LAYER, "object... | false | false | false | false | false | 0 |
mdc_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata)
{
mdc_local_t *local = NULL;
local = frame->local;
if (op_ret != 0)
goto out;
... | false | false | false | false | false | 0 |
tx_clear_pressed (GtkWidget * widget, gpointer data)
{
PSK31info rxinfo;
commGetInfo (COMM_RXCH, &rxinfo, sizeof (rxinfo));
if (rxinfo.ptt == 0 )
return ;
commControl (COMM_TXCH, COMM_PTT, PTTOFF|PTTFORCE);
} | false | false | false | false | false | 0 |
feat_print(cst_file fd,const cst_features *f)
{
cst_featvalpair *p;
for (p=f->head; p; p=p->next)
{
cst_fprintf(fd, "%s ",p->name);
val_print(fd,p->val);
cst_fprintf(fd,"\n");
}
return 0;
} | false | false | false | false | false | 0 |
gt_differencecover_vparamverify(const GtDifferencecover *dcov,
GtError *err)
{
if (dcov->vparam < dcov->prefixlength)
{
gt_error_set(err,"difference cover modulo %u is too small, use larger "
"parameter for option -dc",dcov->vparam);
return -1;... | false | false | false | false | false | 0 |
gets_quiet(char *s, int len)
{
#ifdef WIN32
HANDLE h;
DWORD con_orig, con_quiet;
DWORD read_len = 0;
memset(s, 0, len);
h = GetStdHandle(STD_INPUT_HANDLE);
GetConsoleMode(h, &con_orig);
con_quiet &= ~ENABLE_ECHO_INPUT;
con_quiet |= ENABLE_LINE_INPUT;
SetConsoleMode(h, con_quiet);
if(!ReadConsole(h, s, len, ... | false | false | false | false | false | 0 |
rl_vi_prev_word (count, key)
int count, key;
{
if (count < 0)
return (rl_vi_next_word (-count, key));
if (rl_point == 0)
{
rl_ding ();
return (0);
}
if (_rl_uppercase_p (key))
rl_vi_bWord (count, key);
else
rl_vi_bword (count, key);
return (0);
} | false | false | false | false | false | 0 |
setConflict(Literal p, const Antecedent& a, uint32 data) {
++stats.conflicts;
conflict_.push_back(~p);
if (strategy_.search != SolverStrategies::no_learning && !a.isNull()) {
if (data == UINT32_MAX) {
a.reason(*this, p, conflict_);
}
else {
// temporarily replace old data with new data
uint32 saved = ... | false | false | false | false | false | 0 |
init_coll_func_pointers(mca_coll_ml_module_t *ml_module)
{
mca_coll_base_module_2_0_0_t *coll_base = &ml_module->super;
int iboffload_used =
mca_coll_ml_check_if_bcol_is_used("iboffload", ml_module, COLL_ML_TOPO_MAX);
/* initialize coll component function pointers */
coll_base->coll_module_ena... | false | false | false | false | false | 0 |
Send2(ConfClient *pCC,void *Data,int Count,int bControlPort)
{
ConfServer *pCS = pCC->pCS;
int TxLen;
IPAdrUnion HisAdr;
int Socket;
if(bEchoLinkEnabled || !pCS->biLinkConf) {
HisAdr.ADDR = pCC->HisAdr.ADDR;
HisAdr.i.sin_family = AF_INET;
if(bControlPort) {
// rtcp (control)
... | false | false | false | false | true | 1 |
pkix_PolicyChecker_PolicyMapProcessing(
PKIX_List *policyMaps, /* CertPolicyMaps */
PKIX_Boolean certPoliciesIncludeAny,
PKIX_List *qualsOfAny,
PKIX_PolicyCheckerState *state,
void *plContext)
{
PKIX_UInt32 numPolicies = 0;
PKIX_UInt32 polX = 0;
PKIX_PL_O... | false | false | false | false | false | 0 |
do_sftp_init(void)
{
struct sftp_packet *pktin;
struct sftp_request *req, *rreq;
/*
* Do protocol initialisation.
*/
if (!fxp_init()) {
fzprintf(sftpError,
"Fatal: unable to initialise SFTP on server: %s\n", fxp_error());
return 1; /* failure */
}
/*
* Find out wher... | false | false | false | false | false | 0 |
on_finished(FmFileOpsJob* job, FmProgressDisplay* data)
{
GtkWindow* parent = NULL;
/* preserve pointers that fm_progress_display_destroy() will unreference
as they may be requested by trash support below */
if(data->parent)
parent = g_object_ref(data->parent);
g_object_ref(job);
if... | false | false | false | false | false | 0 |
getNValue(DataRefImpl Sym) const {
if (is64Bit()) {
MachO::nlist_64 Entry = getSymbol64TableEntry(Sym);
return Entry.n_value;
}
MachO::nlist Entry = getSymbolTableEntry(Sym);
return Entry.n_value;
} | false | false | false | false | false | 0 |
floatcompare(const void *v1, const void *v2)
{
const FLOAT *const a = v1, *const b = v2;
if (*a > *b)
return 1;
if (*a < *b)
return -1;
return 0;
} | false | false | false | false | false | 0 |
Encode(BYTE * &buffer, long &size, DWORD imagetype)
{
if (buffer!=NULL){
strcpy(info.szLastError,"the buffer must be empty");
return false;
}
CxMemFile file;
file.Open();
if(Encode(&file,imagetype)){
buffer=file.GetBuffer();
size=file.Size();
return true;
}
return false;
} | false | false | false | false | false | 0 |
setXComb(tStdXCombPtr xc) {
MEBase::setXComb(xc);
theMatrixElement->setXComb(xc);
for ( vector<Ptr<MatchboxInsertionOperator>::ptr>::iterator v =
virtuals().begin(); v != virtuals().end(); ++v )
(**v).setXComb(xc);
} | false | false | false | false | false | 0 |
cb_exporter_finalize (Workbook *wb, GOFileSaver *saver)
{
g_return_if_fail (GO_IS_FILE_SAVER (saver));
g_return_if_fail (IS_WORKBOOK (wb));
g_return_if_fail (wb->file_exporter == saver);
workbook_set_file_exporter (wb, NULL);
} | false | false | false | false | false | 0 |
getDirFromProgram(_TCHAR* program)
{
_TCHAR* ch;
if(programDir != NULL)
return programDir;
programDir = malloc( (_tcslen( program ) + 1) * sizeof(_TCHAR) );
_tcscpy( programDir, program );
ch = lastDirSeparator( programDir );
if (ch != NULL)
{
*(ch+1) = _T_ECLIPSE('\0');
return progra... | false | false | false | false | false | 0 |
xlog_iclogs_empty(
struct xlog *log)
{
xlog_in_core_t *iclog;
iclog = log->l_iclog;
do {
/* endianness does not matter here, zero is zero in
* any language.
*/
if (iclog->ic_header.h_num_logops)
return 0;
iclog = iclog->ic_next;
} while (iclog != log->l_iclog);
return 1;
} | false | false | false | false | false | 0 |
SetSelectedBPP(void)
{
const SDL_VideoInfo *info;
if (TrySetSelectedBPP())
{
return;
}
// screen_bpp does not match any supported pixel depth. Query SDL
// to find out what it recommends using.
info = SDL_GetVideoInfo();
if (info != NULL && info->vfmt != NULL)
{
... | false | false | false | false | false | 0 |
sendmail(const char *subject, const char *content, const char *mail_acct)
{
pid_t pid;
if (access(email_command, 01) == 0)
{
FILE *mail;
int fd;
fd = safe_popen(&pid, mail_acct);
if (fd < 0)
return 1;
mail = fdopen(fd, "w");
if (mail == NULL) {
kill(pid, SIGKILL);
close(fd);
audit_msg(LOG... | false | false | false | false | false | 0 |
_e2pcr_crypt_buffer (guint8 hashes[KEY_LENGTH],
guint8 *iseed, guint8 *jseed, gpointer filebuffer, csize_t filebuffersize)
{
guchar *encryptedbufferp, *filebufferp;
csize_t indx;
guint8 i, j, temp;
encryptedbufferp = filebufferp = filebuffer;
i = *iseed;
j = *jseed;
for (indx = 0; indx < filebuffersize; indx+... | false | false | false | false | false | 0 |
safe_formatstr(char *formatstr) {
char *endptr;
long int field_width = 0;
if (*formatstr != '%') {
return 0;
}
formatstr++;
if (*formatstr == 'H' || *formatstr == 'U') {
/* matches the built in formatters */
formatstr++;
}
else {
/* match %-?([0-9]*)s with... | false | false | false | false | false | 0 |
cxgb_vlan_mode(struct net_device *dev, netdev_features_t features)
{
struct port_info *pi = netdev_priv(dev);
struct adapter *adapter = pi->adapter;
if (adapter->params.rev > 0) {
t3_set_vlan_accel(adapter, 1 << pi->port_id,
features & NETIF_F_HW_VLAN_CTAG_RX);
} else {
/* single control for all ports */... | false | false | false | false | false | 0 |
c99_vsnprintf(const char *fmt, va_list ap)
{
int n, size = 100;
char *p;
if ((p = malloc (size)) == NULL)
return -1;
while (1)
{
/* Try to print in the allocated space. */
n = vsnprintf (p, size, fmt, ap);
/* If that worked, return the string. */
if (n > -1 && n < size)
return size;
/* Else try again with m... | false | false | false | false | true | 1 |
parseCamera(const YAML::Node& node)
{
Point p, c;
Vector u;
int width, height;
node["eye"] >> p;
node["center"] >> c;
node["up"] >> u;
node["viewSize"][0] >> width;
node["viewSize"][1] >> height;
return new Camera(p, c, u, width, height);
} | false | false | false | false | false | 0 |
draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
struct gallivm_state *gallivm,
struct lp_type type,
boolean is_fetch,
unsigned textu... | false | false | false | false | false | 0 |
daemon_init()
{
int fd;
fd = open("/dev/null", O_RDWR);
if (fd == -1)
exit(-1);
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
setsid();
chdir("/");
} | false | false | false | false | true | 1 |
bam_index(BGZF *fp, int min_shift)
{
int n_lvls, i, fmt;
bam1_t *b;
hts_idx_t *idx;
bam_hdr_t *h;
h = bam_hdr_read(fp);
if (min_shift > 0) {
int64_t max_len = 0, s;
for (i = 0; i < h->n_targets; ++i)
if (max_len < h->target_len[i]) max_len = h->target_len[i];
max_len += 256;
for (n_lvls = 0, s = 1<<min... | false | false | false | false | false | 0 |
toggle_mainwindow_visibility(GtkWidget *app)
{
static gint posx, posy;
if (gtk_widget_get_visible(app))
{
gtk_window_get_position(GTK_WINDOW(app), &posx, &posy);
gtk_widget_hide(app);
}
else
{
if ((posx >= 0) && (posy >= 0))
gtk_window_move(GTK_WINDOW(app), posx, posy);
gtk_window_present(GTK_WINDOW(ap... | false | false | false | false | false | 0 |
ga_client_get_property(GObject * object,
guint property_id,
GValue * value, GParamSpec * pspec) {
GaClient *client = GA_CLIENT(object);
GaClientPrivate *priv = GA_CLIENT_GET_PRIVATE(client);
switch (property_id) {
case PROP_STATE:
g_value_se... | false | false | false | false | false | 0 |
bumps_init (Display *dpy, Window Win)
{
SBumps *Bumps = (SBumps *) calloc (1, sizeof(SBumps));
#ifdef VERBOSE
time_t Time = time( NULL );
uint16_t iFrame = 0;
#endif /* VERBOSE */
CreateBumps( Bumps, dpy, Win );
Bumps->delay = get_integer_resource(dpy, "delay", "Integer" );
Bumps->duration = get_integer_... | false | false | false | false | false | 0 |
bcf_sweep_bwd(bcf_sweep_t *sw)
{
if ( sw->direction==SW_FWD ) sw_seek(sw, SW_BWD);
if ( !sw->nrec ) sw_fill_buffer(sw);
if ( !sw->nrec ) return NULL;
return &sw->rec[ --sw->nrec ];
} | false | false | false | false | false | 0 |
error_gen_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
off_t off)
{
int op_errno = 0;
eg_t *egp = NULL;
int enable = 1;
egp = this->private;
enable = egp->enable[GF_FOP_READDIRP];
if (enable)
... | false | false | false | false | false | 0 |
mem_alloc(size_t size)
{
MEMHDR * p;
p= malloc(sizeof(MEMHDR) + size);
if (p == NULL)
return(NULL);
mem_list_add(p);
return HDR_TO_CLIENT(p);
} | false | false | false | false | false | 0 |
search_for(unsigned char marker, char **cursor)
{
while (**cursor && **cursor != marker)
{
(*cursor)++;
}
if (**cursor == '\0')
{
return FALSE;
}
else
{
(*cursor)++;
return TRUE;
}
} | false | false | false | false | false | 0 |
mdb_data_dump(MdbTableDef *table)
{
unsigned int i;
char *bound_values[MDB_MAX_COLS];
for (i=0;i<table->num_cols;i++) {
bound_values[i] = (char *) g_malloc(256);
mdb_bind_column(table, i+1, bound_values[i], NULL);
}
mdb_rewind_table(table);
while (mdb_fetch_row(table)) {
for (i=0;i<table->num_cols;i++) {
... | true | true | false | false | true | 1 |
RandomSoup(ModeInfo * mi)
{
demonstruct *dp = &demons[MI_SCREEN(mi)];
int row, col, mrow = 0;
for (row = 0; row < dp->nrows; ++row) {
for (col = 0; col < dp->ncols; ++col) {
dp->oldcell[col + mrow] =
(unsigned char) LRAND() % ((unsigned char) dp->states);
if (!addtolist(mi, col, row, dp->oldcell... | false | false | false | false | false | 0 |
sys_fadvise64_64(struct tcb *tcp)
{
if (entering(tcp)) {
int argn;
printfd(tcp, tcp->u_arg[0]);
tprintf(", ");
#if defined ARM || defined POWERPC
argn = printllval(tcp, "%lld, ", 2);
#else
argn = printllval(tcp, "%lld, ", 1);
#endif
argn = printllval(tcp, "%lld, ", argn);
#if defined ARM || defined POWERPC... | false | false | false | false | false | 0 |
on_file_read(const Glib::RefPtr<Gio::AsyncResult>& result, const Glib::RefPtr<Gio::File>& source)
{
ensure_idle_handler_connection();
try
{
m_stream = source->read_finish(result);
m_buffer.reset(new Buffer);
m_stream->read_async(m_buffer->buf, sizeof(m_buffer->buf), sigc::mem_fun(*this, &CsvParser::... | false | false | false | false | false | 0 |
microdesc_list_missing_digest256(networkstatus_t *ns, microdesc_cache_t *cache,
int downloadable_only, digestmap_t *skip)
{
smartlist_t *result = smartlist_new();
time_t now = time(NULL);
tor_assert(ns->flavor == FLAV_MICRODESC);
SMARTLIST_FOREACH_BEGIN(ns->routerstatus_list, ro... | false | false | false | false | false | 0 |
position_to_line( int pos, int *lineNum ) {
int i;
*lineNum = 0;
if ( pos < mFirstChar ) return 0;
if ( pos > mLastChar ) {
if ( empty_vlines() ) {
if ( mLastChar < mBuffer->length() ) {
if ( !position_to_line( mLastChar, lineNum ) ) {
Fl::error("Fl_Text_Display::position_to_line():... | false | false | false | false | false | 0 |
spif_dlinked_list_iterator_next(spif_dlinked_list_iterator_t self)
{
spif_obj_t tmp;
ASSERT_RVAL(!SPIF_ITERATOR_ISNULL(self), SPIF_NULL_TYPE(obj));
REQUIRE_RVAL(!SPIF_LIST_ISNULL(self->subject), SPIF_NULL_TYPE(obj));
REQUIRE_RVAL(!SPIF_DLINKED_LIST_ITEM_ISNULL(self->current), SPIF_NULL_TYPE(obj));
... | false | false | false | false | false | 0 |
getPixbuf()
{
if (_type == VOID)
return NULL;
if (!img && pic)
{
img = gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, width(), height());
gdk_pixbuf_get_from_drawable(img, pic, NULL, 0, 0, 0, 0, width(), height());
if (mask)
{
uchar *s, *d;
int i;
GdkPixbuf *alpha;
... | false | false | false | false | false | 0 |
alt_print_count_offset (const MODEL *pmod, const DATASET *dset, PRN *prn)
{
int offvar = gretl_model_get_int(pmod, "offset_var");
if (offvar > 0) {
char name[24];
sprintf(name, "log(%s)", dset->varname[offvar]);
if (plain_format(prn)) {
pprintf(prn, "\n %-13s 1.0\n", name);
} else if (rtf_f... | true | true | false | false | false | 1 |
get_pool(string host, short port)
{
PoolManager &pm = instance();
// find or insert host
map<pair<string, short>, SocketPool>::iterator it;
it = pm.m_pools.find(make_pair(host, port));
if (it == pm.m_pools.end()) {
HostPort hp = make_pair(host, port);
it = pm.m_pools.insert(make_pai... | false | false | false | false | false | 0 |
mraid_mm_attach_buf(mraid_mmadp_t *adp, uioc_t *kioc, int xferlen)
{
mm_dmapool_t *pool;
int right_pool = -1;
unsigned long flags;
int i;
kioc->pool_index = -1;
kioc->buf_vaddr = NULL;
kioc->buf_paddr = 0;
kioc->free_buf = 0;
/*
* We need xferlen amount of memory. See if we can get it from our
* dma... | false | false | false | false | false | 0 |
ndmp_sxa_mover_connect (struct ndm_session *sess,
struct ndmp_xa_buf *xa, struct ndmconn *ref_conn)
{
#ifndef NDMOS_OPTION_NO_DATA_AGENT
struct ndm_data_agent * da = &sess->data_acb;
#endif /* !NDMOS_OPTION_NO_DATA_AGENT */
struct ndm_tape_agent * ta = &sess->tape_acb;
ndmp9_error error;
int will_write;
char ... | false | false | false | false | false | 0 |
RemoveStdObjects() {
for( JScriptObjCtxInstances::iterator i = jscriptStdObjects_.begin();
i != jscriptStdObjects_.end(); ++i ) {
if( (*i)->GetContext() == this && (*i)->GetPluginLoader() == 0 &&
( (*i)->parent() == this || (*i)->parent() == 0 ) ) (*i)->destroy();
}
jscrip... | false | false | false | false | false | 0 |
add_portal(struct list_head *rec_list, discovery_rec_t *drec,
char *targetname, char *address, char *port, char *tag)
{
struct sockaddr_storage ss;
struct node_rec *rec;
if (resolve_address(address, port, &ss)) {
log_error("cannot resolve %s", address);
return 0;
}
rec = calloc(1, sizeof(*rec));
if ... | false | false | false | false | false | 0 |
fli_init_stipples( void )
{
if ( ! fli_gray_pattern[ 0 ] )
{
fli_gray_pattern[ 0 ] =
XCreateBitmapFromData( flx->display, fl_root,
( char * ) gray40_bits, 8, 8 );
fli_gray_pattern[ 1 ] =
XCreateBitmapFromData( flx->display, fl_root,
... | false | false | false | false | false | 0 |
fcoe_vport_create(struct fc_vport *vport, bool disabled)
{
struct Scsi_Host *shost = vport_to_shost(vport);
struct fc_lport *n_port = shost_priv(shost);
struct fcoe_port *port = lport_priv(n_port);
struct fcoe_interface *fcoe = port->priv;
struct net_device *netdev = fcoe->netdev;
struct fc_lport *vn_port;
int r... | false | false | false | false | false | 0 |
allComputerPlayers()
{
PlayersArray::iterator it = playerList()->begin();
PlayersArray::iterator it_end = playerList()->end();
for (; it != it_end; it++)
{
if ( ! dynamic_cast<Player*>(*it)-> isAI() )
{
return false;
}
}
return true;
} | false | false | false | false | false | 0 |
loginAccount()
{
static utmp ut; // zero unset fields
ut.ut_pid = getpid();
ut.ut_type = LOGIN_PROCESS;
#if HAS_UTEXIT
ut.ut_exit.e_exit = 0;
ut.ut_exit.e_termination = 0;
#endif
ut.ut_time = Sys::now();
// mark utmp entry as a login
strncpy(ut.ut_user, "LOGIN", sizeof (ut.ut_user));
... | false | false | false | false | false | 0 |
onTreeClicked(FXObject*,FXSelector,void* ptr){
FXString string=getItemPathname((FXTreeItem*)ptr);
button->handle(this,FXSEL(SEL_COMMAND,ID_UNPOST),NULL); // Unpost the list
if(ptr){
field->setText(tree->getItemText((FXTreeItem*)ptr));
field->setIcon(tree->getItemClosedIcon((FXTreeItem*)ptr));
remov... | false | false | false | false | false | 0 |
mg_place_userlist_and_chanview(gtk_window_ui_t *gui)
{
GtkOrientation orientation;
GtkWidget *chanviewbox = NULL;
int pos;
mg_sanitize_positions(&tab_pos_config, &gui_ulist_pos_config);
if (gui->chanview) {
pos = tab_pos_config;
orientation = chanview_get_orientation(gui->chanview);
if ((pos == POS_BOTTOM... | false | false | false | false | false | 0 |
parse_ack(const char *msg, unsigned *index, pid_t *pid)
{
*index=0;
*pid=0;
while (*msg != ' ')
{
if (*msg < '0' || *msg > '9') return (-1);
*index = *index * 10 + (*msg++ - '0');
}
++msg;
while (*msg)
{
if (*msg < '0' || *msg > '9') return (-1);
*pid = *pid * 10 + (*msg++ - '0');
}
return (0);
} | false | false | false | false | false | 0 |
__of_remove_property(struct device_node *np, struct property *prop)
{
struct property **next;
for (next = &np->properties; *next; next = &(*next)->next) {
if (*next == prop)
break;
}
if (*next == NULL)
return -ENODEV;
/* found the node */
*next = prop->next;
prop->next = np->deadprops;
np->deadprops = ... | false | false | false | false | false | 0 |
hp_rb_null_key_length(HP_KEYDEF *keydef, const uchar *key)
{
const uchar *start_key= key;
HA_KEYSEG *seg, *endseg;
for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg; seg++)
{
if (seg->null_bit && !*key++)
continue;
key+= seg->length;
}
return (uint) (key - start_key);
} | false | false | false | false | false | 0 |
GetAllFilenamesFromTagToValue(Tag const &t, const char *valueref) const
{
Directory::FilenamesType theReturn;
if( valueref )
{
const std::string valueref_str = String<>::Trim( valueref );
Directory::FilenamesType::const_iterator file = Filenames.begin();
for(; file != Filenames.end(); ++file)
... | false | false | false | false | false | 0 |
gth_file_store_iter_previous (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
GthFileStore *file_store;
GthFileRow *row;
if ((iter == NULL) || (iter->user_data == NULL))
return FALSE;
file_store = (GthFileStore *) tree_model;
g_return_val_if_fail (VALID_ITER (iter, file_store), FALSE);
row = (Gth... | false | false | false | false | false | 0 |
_render_to_pixmap(GdkPixbuf *pixbuf, GdkPixmap **pixmap, GdkBitmap **mask,
gint x_src, gint y_src, gint x_dst, gint y_dst, gint w, gint h)
{
gdk_pixbuf_render_to_drawable(pixbuf, *pixmap, _GK.draw1_GC,
x_src, y_src, x_dst, y_dst,
w, h, GDK_RGB_DITHER_NORMAL, 0, 0);
if (mask && *mask)
gdk_pixbuf_render_thre... | false | false | false | false | false | 0 |
canonicalize_text (dest, src, len, pquote)
uchar *dest;
const uchar *src;
size_t len;
uchar *pquote;
{
uchar *orig_dest = dest;
uchar quote = *pquote;
while (len)
{
if (is_space (*src) && !quote)
{
do
src++, len--;
while (len && is_space (*src));
*dest++ = ' ';
}
... | false | false | false | false | false | 0 |
OnEditorClosed(EditorBase* editor)
{
// the caller of the function should guarantee its a built-in editor
wxString filename = editor->GetFilename();
const int pos = m_StandaloneFiles.Index(filename);
if (pos != wxNOT_FOUND)
{
m_StandaloneFiles.RemoveAt(pos);
if (m_StandaloneFiles.IsE... | false | false | false | false | false | 0 |
gst_camerabin_provide_clock (GstElement * element)
{
GstClock *clock = NULL;
GstClock *vidbin_clock = NULL;
GstCameraBin *camera = GST_CAMERABIN (element);
GstElement *aud_src = GST_CAMERABIN_VIDEO (camera->vidbin)->aud_src;
if (aud_src)
vidbin_clock = gst_element_provide_clock (aud_src);
if (camera->... | false | false | false | false | false | 0 |
G_color_values(const char *name, float *r, float *g, float *b)
{
int i;
*r = *g = *b = 0.0;
for (i = 0; colors[i].name[0]; i++)
if (strcmp(name, colors[i].name) == 0) {
*r = colors[i].r;
*g = colors[i].g;
*b = colors[i].b;
return 1;
}
return -1;
} | false | false | false | false | false | 0 |
psmouse_sliced_command(struct psmouse *psmouse, unsigned char command)
{
int i;
if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSCALE11))
return -1;
for (i = 6; i >= 0; i -= 2) {
unsigned char d = (command >> i) & 3;
if (ps2_command(&psmouse->ps2dev, &d, PSMOUSE_CMD_SETRES))
return -1;
}
return ... | false | false | false | false | false | 0 |
pfs_paranoia_add_pid(pid_t pid)
{
if(paranoia_mode == 0)
return -1;
pid_t *pid_ptr = shared_table;
unsigned long pid_count = 0;
debug(D_PROCESS, "shared table %p", shared_table);
debug(D_PROCESS, "initial value %d", *pid_ptr);
while((*pid_ptr != 0) && (*pid_ptr != 1)) {
debug(D_PROCESS, "pid count %d", pid_c... | false | false | false | false | false | 0 |
record_set_pid (UTMP *u,
GPid pid)
{
#if defined(HAVE_UT_UT_PID)
/* Set pid */
if (pid != 0) {
u->ut_pid = pid;
}
g_debug ("using ut_pid %d", (int) u->ut_pid);
#endif
} | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__eda__StringList__OnUnserialize(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * channel)
{
struct __ecereNameSpace__eda__StringList * __ecerePointer___ecereNameSpace__eda__StringList = (struct __ecereNameSpace__eda__StringList *)(this ... | false | false | false | false | false | 0 |
suphp_handle_cmd_engine(cmd_parms *cmd, void *mconfig,
int flag)
{
server_rec *s = cmd->server;
suphp_conf *cfg;
if (mconfig)
cfg = (suphp_conf *) mconfig;
else
cfg = (suphp_conf *) ap_get_module_config(s->module_config, &suphp_module);
if... | false | false | false | false | false | 0 |
keyboard_up (NemoIconContainer *container,
GdkEventKey *event)
{
IsBetterIconFunction fallback;
fallback = NULL;
if (container->details->auto_layout &&
nemo_icon_container_is_layout_vertical (container) &&
!is_rectangle_selection_event (event)) {
if (gtk_widget_get_direction (GTK_WIDGET (container... | false | false | false | false | false | 0 |
Aggro(Unit* /*pWho*/) override
{
DoScriptText(SAY_AGGRO, m_creature);
// Remove flying in case Nefarian aggroes before his combat point was reached
if (m_creature->IsLevitating())
{
m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0);
m_creature->SetLevitate(f... | false | false | false | false | false | 0 |
unregister_sec_mod(int secmod)
{
struct snmp_secmod_list *sptr, *lptr;
for (sptr = registered_services, lptr = NULL; sptr;
lptr = sptr, sptr = sptr->next) {
if (sptr->securityModel == secmod) {
if ( lptr )
lptr->next = sptr->next;
else
re... | false | false | false | false | false | 0 |
quicksort(List *list, long left, long right, int(*cmp)(const void *, const void *))
{
if (left < right) {
long l = left;
long r = right;
void *pivot = GET(list, right);
do {
while (cmp(GET(list, l), pivot) < 0) l++;
while (cmp(GET(list, r), pivot) > 0) r--;
... | false | false | false | true | false | 1 |
csv_import_assistant_account_page_prepare (GtkAssistant *assistant,
gpointer user_data)
{
CsvImportInfo *info = user_data;
gtk_list_store_clear (info->store);
if (csv_import_read_file (info->file_name, info->regexp->str, info->store, 11 ) == MATCH_FOUND)
gtk_widget_set_sensitive (info->hea... | false | false | false | false | false | 0 |
GetDatabaseAge()
{
CF_DB *dbp;
if (!OpenDB(AVDB,&dbp))
{
return;
}
cf_chmod(AVDB,0644);
if (ReadDB(dbp,"DATABASE_AGE",&AGE,sizeof(double)))
{
WAGE = AGE / CF_WEEK * CF_MEASURE_INTERVAL;
Debug("\n\nPrevious DATABASE_AGE %f\n\n",AGE);
}
else
{
Debug("No previous AGE\n");
AGE = 0.0;
}
... | false | false | false | false | false | 0 |
shield_set_strength(object *objp, float strength)
{
int i;
for (i = 0; i < MAX_SHIELD_SECTIONS; i++)
shield_set_quad(objp, i, strength / MAX_SHIELD_SECTIONS);
} | false | false | false | false | false | 0 |
pa_crc32(const char *in, size_t in_size){
unsigned long crc32=0xFFFFFFFF;
InitCrc32Table();
for(size_t i = 0; i<in_size; i++)
CalcCrc32(in[i], crc32);
return ~crc32;
} | false | false | false | false | false | 0 |
parse(QString &text, QStringList &errors)
{
// setup the input buffer and clear errors
WithingsParser_set(text);
WithingsParsererrors.clear();
// clear previous parse data
Readings.clear();
_readings.clear();
reading = WithingsReading();
// parse that sucker
//yydebug = 0; -- needs... | false | false | false | false | false | 0 |
to_hex64(PG_FUNCTION_ARGS)
{
uint64 value = (uint64) PG_GETARG_INT64(0);
char *ptr;
const char *digits = "0123456789abcdef";
char buf[32]; /* bigger than needed, but reasonable */
ptr = buf + sizeof(buf) - 1;
*ptr = '\0';
do
{
*--ptr = digits[value % HEXBASE];
value /= HEXBASE;
} while (ptr > buf &... | true | true | false | false | false | 1 |
allocate_itemsets(void)
{
register short *itemp;
register short *item_end;
register int symbol;
register int i;
register int count;
register int max;
register short *symbol_count;
count = 0;
symbol_count = NEW2(nsyms, short);
item_end = ritem + nitems;
for (itemp = ritem; i... | false | false | false | false | false | 0 |
CoarserLockCovers(const PREDICATELOCKTARGETTAG *newtargettag)
{
PREDICATELOCKTARGETTAG targettag,
parenttag;
targettag = *newtargettag;
/* check parents iteratively until no more */
while (GetParentPredicateLockTag(&targettag, &parenttag))
{
targettag = parenttag;
if (PredicateLockExists(&targettag))
... | false | false | false | false | false | 0 |
UnregisterResourceReleaseCallback(ResourceReleaseCallback callback, void *arg)
{
ResourceReleaseCallbackItem *item;
ResourceReleaseCallbackItem *prev;
prev = NULL;
for (item = ResourceRelease_callbacks; item; prev = item, item = item->next)
{
if (item->callback == callback && item->arg == arg)
{
if (prev)
... | false | false | false | false | false | 0 |
iscsit_add_cmd_to_immediate_queue(
struct iscsi_cmd *cmd,
struct iscsi_conn *conn,
u8 state)
{
struct iscsi_queue_req *qr;
qr = kmem_cache_zalloc(lio_qr_cache, GFP_ATOMIC);
if (!qr) {
pr_err("Unable to allocate memory for"
" struct iscsi_queue_req\n");
return;
}
INIT_LIST_HEAD(&qr->qr_list);
qr->cmd =... | false | false | false | false | false | 0 |
uart_stop(struct tty_struct *tty)
{
struct uart_state *state = tty->driver_data;
struct uart_port *port = state->uart_port;
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
port->ops->stop_tx(port);
spin_unlock_irqrestore(&port->lock, flags);
} | 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.