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 |
|---|---|---|---|---|---|---|
__esp_interrupt(struct esp *esp)
{
int finish_reset, intr_done;
u8 phase;
/*
* Once INTRPT is read STATUS and SSTEP are cleared.
*/
esp->sreg = esp_read8(ESP_STATUS);
esp->seqreg = esp_read8(ESP_SSTEP);
esp->ireg = esp_read8(ESP_INTRPT);
if (esp->flags & ESP_FLAG_RESETTING) {
finish_reset = 1;
} els... | false | false | false | false | false | 0 |
calctbereverse(const GtTwobitencoding *tbe,
unsigned long startpos)
{
unsigned long remain = GT_MODBYUNITSIN2BITENC(startpos);
if (remain < (unsigned long) (GT_UNITSIN2BITENC - 1)) /* right end of word */
{
unsigned long unit = GT_DIVBYUNITSIN2BITENC(startpos);
... | false | false | false | false | false | 0 |
static_ok_global (gamgi_window *window_dialog)
{
gamgi_window *window_mouse;
gamgi_layer *layer;
gamgi_object *object;
gamgi_dlist *dlist;
gamgi_slist *start;
cache.local = FALSE;
/********************************
* get object list, dialog data *
********************************/
if (gamgi->groups == NULL)
{ gam... | false | false | false | false | false | 0 |
dbiblast_newname(AjPStr* nname, const AjPStr oname,
const char *suff)
{
ajStrAssignS(nname, oname);
if(ajStrGetCharFirst(oname)=='@')
ajStrCutStart(nname, 1);
ajStrAppendK(nname, '.');
ajStrAppendC(nname, suff);
return;
} | false | false | false | false | false | 0 |
keyword(char *line,char *code)
{
int i;
char key[MAXLINE];
for(i=0;!isspace(line[i]) && line[i]!=EOS;i++)
key[i]=line[i];
key[i]=EOS;
return( strcmp(key,code) == 0 );
} | false | false | false | false | false | 0 |
cflag(void *v)
{
struct message *m;
int *msgvec = v;
int *ip;
for (ip = msgvec; *ip != 0; ip++) {
m = &message[*ip-1];
setdot(m);
if ((m->m_flag & (MFLAG|MFLAGGED)) == 0)
m->m_flag |= MFLAG|MFLAGGED;
}
return 0;
} | false | false | false | false | false | 0 |
load_values_config(const char *tmp)
{
char *val = NULL;
char *vals = NULL, *save = NULL;
struct values *value = NULL;
if (ast_strlen_zero(tmp)) {
ast_log(LOG_WARNING, "Values not specified. Module not loaded.\n");
return -1;
}
if (!(save = vals = ast_strdup(tmp))) {
ast_log(LOG_ERROR, "Out of memory creati... | false | false | false | false | false | 0 |
segment2_findT(float *t, const segment2 *s, const vec2 *v) {
float epsilon = 0.001;
if( fabs(s->vDirection.v[0]) > fabs(s->vDirection.v[1]) ) {
*t = (v->v[0] - s->vStart.v[0]) / s->vDirection.v[0];
if( fabs(v->v[1] - (s->vStart.v[1] + *t * s->vDirection.v[1])) >
epsilon ) {
return 1;
}
} else {
*t = (... | false | false | false | false | false | 0 |
search_gui_refresh_popup(void)
{
/*
* The following popup items are set insensitive if nothing is currently
* selected (actually if the cursor is unset).
*/
static const struct {
const gchar *name;
gboolean local;
} menu[] = {
{ "popup_search_metadata", TRUE },
{ "popup_search_browse_host", FALSE },
... | false | false | false | false | false | 0 |
vmsg_send_head_pong_v2(struct gnutella_node *n, const struct sha1 *sha1,
uint8 code, uint8 flags)
{
ggep_stream_t gs;
size_t ggep_len;
uint32 msgsize;
uint32 paysize;
char *payload;
payload = vmsg_fill_type(v_tmp_data, T_LIME, 24, 2);
paysize = 0;
ggep_stream_init(&gs, &payload[paysize],
&v_tmp[sizeof(v_tm... | false | false | false | false | false | 0 |
reduce(struct cparse_params *v, long act)
{
VALUE code;
v->ruleno = -act * 3;
code = rb_catch("racc_jump", reduce0, v->value_v);
v->errstatus = num_to_long(rb_ivar_get(v->parser, id_errstatus));
return NUM2INT(code);
} | false | false | false | false | false | 0 |
set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp)
{
struct snd_sf_sample *sample;
sample = find_sample(sf, avp->sample);
if (sample == NULL)
return NULL;
/* add in the actual sample offsets:
* The voice_info addresses define only the relative offset
* from sample pointers. Here we calc... | false | false | false | false | false | 0 |
revwalk_next_toposort(git_commit_list_node **object_out, git_revwalk *walk)
{
git_commit_list_node *next;
unsigned short i;
for (;;) {
next = git_commit_list_pop(&walk->iterator_topo);
if (next == NULL) {
giterr_clear();
return GIT_ITEROVER;
}
if (next->in_degree > 0) {
next->topo_delay = 1;
co... | false | false | false | false | false | 0 |
setFileNameReadOnly( bool ro )
{
foreach(KPropertiesDialogPlugin *it, d->m_pageList) {
KFilePropsPlugin* plugin = dynamic_cast<KFilePropsPlugin*>(it);
if ( plugin ) {
plugin->setFileNameReadOnly( ro );
break;
}
}
} | false | false | false | false | false | 0 |
obex_services_start (void)
{
if (bluetoothd_enabled == FALSE ||
has_console == FALSE)
return;
if (g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED) == TRUE) {
obexpush_up ();
}
if (g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_ENABLED) == TRUE) {
obexftp_up ... | false | false | false | false | false | 0 |
addAction( QAction *action, int size )
{
if ( !action ) {
debug() << "ERROR!!! PASSED INVALID ACTION";
return 0;
}
Plasma::IconWidget *tool = new Plasma::IconWidget( this );
tool->setAction( action );
tool->setText( QString() );
tool->setToolTip( action->text() );
tool->set... | false | false | false | false | false | 0 |
clone_internal_constraints(resource_t * rsc, pe_working_set_t * data_set)
{
resource_t *last_rsc = NULL;
GListPtr gIter = rsc->children;
clone_variant_data_t *clone_data = NULL;
get_clone_variant_data(clone_data, rsc);
pe_rsc_trace(rsc, "Internal constraints for %s", rsc->id);
new_rsc_order(rs... | false | false | false | false | false | 0 |
Cudd_addSetNZ(
DdManager * dd,
DdNode ** f,
DdNode ** g)
{
DdNode *F, *G;
F = *f; G = *g;
if (F == G) return(F);
if (F == DD_ZERO(dd)) return(G);
if (G == DD_ZERO(dd)) return(F);
if (cuddIsConstant(G)) return(G);
return(NULL);
} | false | false | false | false | false | 0 |
reschedule_precache(const char *number, const char *context, int expiration)
{
int len;
struct dundi_precache_queue *qe, *prev;
AST_LIST_LOCK(&pcq);
AST_LIST_TRAVERSE_SAFE_BEGIN(&pcq, qe, list) {
if (!strcmp(number, qe->number) && !strcasecmp(context, qe->context)) {
AST_LIST_REMOVE_CURRENT(list);
break;
... | false | true | false | false | false | 1 |
done(__this__)
{
itk_hash_table* hash_table = PREPARED(this);
if (hash_table)
itk_free_hash_table(hash_table, true, false);
PREPARED_(this) = NULL;
} | false | false | false | false | false | 0 |
visitBinaryElement(TiffBinaryElement* object)
{
// Temporarily overwrite byteorder according to that of the binary element
ByteOrder boOrig = byteOrder_;
if (object->elByteOrder() != invalidByteOrder) byteOrder_ = object->elByteOrder();
encodeTiffComponent(object);
byteOrder_... | false | false | false | false | false | 0 |
vertconcat(const SparseMatrix& A, const SparseMatrix& B, SparseMatrix& ret)
{
if (A.Ncols() != B.Ncols()) {throw Exception("Cols don't match in SparseMatrix::vertconcat");}
ret.ReSize(A.Nrows()+B.Nrows(),A.Ncols());
for (int i=1; i<=A.Nrows(); i++) {ret.row(i) = A.row(i);}
for (int i=1; i<=B.Nr... | false | false | false | false | false | 0 |
split(const std::string & s) {
std::vector<std::string> substrings;
std::size_t front = 0, back = 0, size = 0;
while (front != std::string::npos)
{
// find beginning of substring
front = s.find_first_not_of(" \t\n\r", back);
back = s.find_first_of(" \t\n\r", front);
... | false | false | false | false | false | 0 |
parsestr(int fd, char *cmdstr)
{
char databuf[1024];
static int addr = 0;
int index = 0;
int parseval = -1;
int cmd =0 ;
while (1)
{
switch (*cmdstr)
{
case ':': /* write bytes */
a2exec(fd, cmd, &addr, parseval, databuf, &index);
cmd = 0x92;
parseval = -1;
break;
ca... | false | false | false | false | false | 0 |
getValue(const UT_String &stKey, UT_String &stValue) const
{
gchar *pEntry = m_hash.pick(stKey);
if (!pEntry)
return false;
stValue = pEntry;
return true;
} | false | false | false | false | false | 0 |
SetActiveRoute(uint16_t iRoute)
{
SetPowerStatus(CEC_POWER_STATUS_ON);
CCECDeviceMap* map = m_processor->GetDevices();
if (!map)
return;
CCECBusDevice* newRoute = m_processor->GetDeviceByPhysicalAddress(iRoute, true);
if (newRoute && newRoute->IsHandledByLibCEC())
{
// we were made the active sour... | false | false | false | false | false | 0 |
process_rename_data_list (gpointer user_data)
{
BrowserData *data = user_data;
GList *scan;
g_source_remove (data->update_renamed_files_id);
data->update_renamed_files_id = 0;
for (scan = data->rename_data_list; scan; scan = scan->next) {
RenameData *rename_data = scan->data;
GthCatalog *catalog;
GLi... | false | false | false | false | false | 0 |
list_pop_front(list *l)
{
if (!l)
return NULL;
if (!l->front)
return NULL;
l->cnt--;
node *save = l->front;
l->front = l->front->next;
if (l->front)
l->front->prev = NULL;
else
l->back = NULL;
return save;
} | false | false | false | false | false | 0 |
zretrieveInitFile(afn,cmdstr,pfname)A afn;C *cmdstr;C **pfname;
{
C *fname=getfilename(afn);
int fd;
/* vette arguments */
if(fname==(C *)0){H("\343 PKG: zretrieve: bad filename argument\n");R -1;}
Busted=0;
/* open file */
if(-1==(fd=open(fname,O_RDONLY)))
{
H("\343 PKG: zretrieve: cannot open fi... | false | false | false | false | false | 0 |
utf8_strwidth(const char *string)
{
int width = 0;
const char *orig = string;
while (1) {
if (!string)
return strlen(orig);
if (!*string)
return width;
width += utf8_width(&string, NULL);
}
} | false | false | false | false | false | 0 |
on_terminal_copy_cb (GtkAction * action, TerminalPlugin *term_plugin)
{
VteTerminal *term;
if (term_plugin->child_pid)
term = VTE_TERMINAL (term_plugin->term);
else
term = VTE_TERMINAL (term_plugin->shell);
if (vte_terminal_get_has_selection(term))
vte_terminal_copy_clipboard(term);
} | false | false | false | false | false | 0 |
freeerr(ERROR *n)
{
vsrm(n->file);
vsrm(n->msg);
enquef(ERROR, link, &errnodes, n);
} | false | false | false | false | false | 0 |
execute( const MapCoordinate& pos, ContainerBase* subject, int num )
{
if ( !subject )
return;
Vehicle* veh = dynamic_cast<Vehicle*>(subject);
if ( !veh )
return;
auto_ptr<ServiceCommand> ser ( new ServiceCommand( parent.getContainer() ));
ser->setDestination( subject );
ser->getTransfer... | false | false | false | false | false | 0 |
wm8350_ldo_set_suspend_disable(struct regulator_dev *rdev)
{
struct wm8350 *wm8350 = rdev_get_drvdata(rdev);
int volt_reg, ldo = rdev_get_id(rdev);
u16 val;
switch (ldo) {
case WM8350_LDO_1:
volt_reg = WM8350_LDO1_LOW_POWER;
break;
case WM8350_LDO_2:
volt_reg = WM8350_LDO2_LOW_POWER;
break;
case WM8350_... | false | false | false | false | false | 0 |
filter_read(i_ctx_t *i_ctx_p, int npop, const stream_template * templat,
stream_state * st, uint space)
{
os_ptr op = osp;
uint min_size = templat->min_out_size + max_min_left;
uint save_space = ialloc_space(idmemory);
/* PLRM3 requires the following, *not* max(space, save_space). */
uin... | false | false | false | false | false | 0 |
rd_dump_registers(unsigned long cpc, unsigned long csr)
{
const char sr_str[2][17] = { "t.sm.000...xnzvc", "T.SM.111...XNZVC" };
int x;
extern struct _board_data board_data;
/* Here is the format, right from coldfire
PC: 0001002C SR: 2000 [t.Sm.000...xnzvc]
An: 00012000 00011500 00020001 00000000 00000000 0000000... | true | true | false | false | false | 1 |
ePerl_Cfnwrite(char *cpBuf, int nBuf, int cNum, char *cpOut, int *cpOutLen)
{
char *cpI;
char *cpO;
int i;
int n;
char *cpE;
if (*cpOutLen <= 0) { abort(); }
cpI = cpBuf;
cpO = cpOut;
cpE = cpBuf+(nBuf*cNum);
while (cpI < cpE) {
if (*cpI == '&') {
for (i = 0;... | false | false | false | false | false | 0 |
gC(I t,I r,I n,I *d,I *p)
{
A z=ga(t,r,n,d);
p?tmv(t,z->p,p,n):zer(t,z->p,n);
R(I)z;
} | false | false | false | false | false | 0 |
transcribe_array_factorized (PLOTGROUP *grp, int i,
const DATASET *dset)
{
const double *y = dset->Z[grp->list[1]];
const double *d = dset->Z[grp->list[2]];
int t, n = 0;
for (t=dset->t1; t<=dset->t2; t++) {
if (d[t] == grp->dvals->val[i] && !na(y[t])) {
grp->x[n++] = y[t];
}
}
re... | false | false | false | false | false | 0 |
r592_wait_status(struct r592_device *dev, u32 mask, u32 wanted_mask)
{
unsigned long timeout = jiffies + msecs_to_jiffies(1000);
u32 reg = r592_read_reg(dev, R592_STATUS);
if ((reg & mask) == wanted_mask)
return 0;
while (time_before(jiffies, timeout)) {
reg = r592_read_reg(dev, R592_STATUS);
if ((reg & m... | false | false | false | false | false | 0 |
push_with_options(struct transport *transport, int flags)
{
int err;
int nonfastforward;
transport_set_verbosity(transport, verbosity, progress);
if (receivepack)
transport_set_option(transport,
TRANS_OPT_RECEIVEPACK, receivepack);
if (thin)
transport_set_option(transport, TRANS_OPT_THIN, "yes");
... | false | false | false | false | false | 0 |
__memcg_destroy_list_lru_node(struct list_lru_memcg *memcg_lrus,
int begin, int end)
{
int i;
for (i = begin; i < end; i++)
kfree(memcg_lrus->lru[i]);
} | false | false | false | false | false | 0 |
ath9k_mgd_prepare_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
struct ath_softc *sc = hw->priv;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_vif *avp = (struct ath_vif *) vif->drv_priv;
struct ath_beacon_config *cur_conf;
struct ath_chanctx *go_ctx;
unsigned long timeout;
b... | false | false | false | false | false | 0 |
writeProp(OFile *fp, VObject *o)
{
if (NAME_OF(o)) {
struct PreDefProp *pi;
VObjectIterator t;
const char **fields_ = 0;
pi = lookupPropInfo(NAME_OF(o));
if (pi && ((pi->flags & PD_BEGIN) != 0)) {
writeVObject_(fp,o);
return;
}
if (isAPropertyOf(o,VCGroupingProp))
writeGroup(fp,o);
else
... | false | false | false | false | false | 0 |
realloc_items(void *mem, size_t *size, size_t new_size, size_t item_size)
{
size_t num_chunks = *size / ITEM_CHUNK_SIZE;
size_t num_chunks_new = (new_size + ITEM_CHUNK_SIZE - 1) / ITEM_CHUNK_SIZE;
if (mem == NULL || num_chunks != num_chunks_new) {
*size = num_chunks_new * ITEM_CHUNK_SIZE;
mem = realloc(mem, *si... | false | false | false | false | false | 0 |
lotus_rldb_register_id (LotusRLDB *rldb, guint16 id)
{
g_return_if_fail (id > 0);
g_return_if_fail (rldb->pending_id == 0);
#ifdef DEBUG_RLDB
g_printerr ("Defining id %d.\n", id);
#endif
rldb->pending_id = id;
} | false | false | false | false | false | 0 |
mlx4_alloc_resize_buf(struct mlx4_ib_dev *dev, struct mlx4_ib_cq *cq,
int entries)
{
int err;
if (cq->resize_buf)
return -EBUSY;
cq->resize_buf = kmalloc(sizeof *cq->resize_buf, GFP_ATOMIC);
if (!cq->resize_buf)
return -ENOMEM;
err = mlx4_ib_alloc_cq_buf(dev, &cq->resize_buf->buf, entries);
if (err) ... | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdf5lib_H5_H5Fis_1hdf5
(JNIEnv *env, jclass clss, jstring name)
{
htri_t retVal = 0;
char * file;
jboolean isCopy;
if (name == NULL) {
/* exception -- bad argument? */
h5nullArgument( env, "H5Fis_hdf5: name is NULL");
return JNI_FALSE;
}
file = (char *)... | false | false | false | false | false | 0 |
path_s_glob(int argc, VALUE *argv, VALUE klass)
{
VALUE args[2];
int n;
n = rb_scan_args(argc, argv, "11", &args[0], &args[1]);
if (rb_block_given_p()) {
return rb_block_call(rb_cDir, rb_intern("glob"), n, args, glob_i, klass);
}
else {
VALUE ary;
long i;
ary = r... | false | false | false | false | false | 0 |
IndexCount()
{
unsigned long i = 0;
if ( m_pBaseArray )
{
i = m_pBaseArray->Size()/sizeof(struct filebaseobject);
}
return i;
} | false | false | false | false | false | 0 |
xen_kdump_p2m_mfn(char *arg)
{
ulong value;
int errflag;
errflag = 0;
value = htol(arg, RETURN_ON_ERROR|QUIET, &errflag);
if (!errflag) {
xen_kdump_data.p2m_mfn = value;
if (CRASHDEBUG(1))
error(INFO,
"xen_kdump_data.p2m_mfn override: %lx\n",
value);
} else
error(WARNING, "invalid p2m_mf... | false | false | false | false | false | 0 |
pop()
{
void * ret = NULL;
sp_thread_mutex_lock( &mMutex );
if( mQueue->getLength() == 0 ) {
sp_thread_cond_wait( &mCond, &mMutex );
}
ret = mQueue->pop();
sp_thread_mutex_unlock( &mMutex );
return ret;
} | false | false | false | false | false | 0 |
OrBody(FILE *fp, int x, int y, unsigned int pins, unsigned int colour)
{
if(fp == NULL)
{
fprintf(stderr, "Error: NULL file pointer passed to %s()\n",
__func__);
return 1;
}
/* top and bottom lines */
fprintf(fp, "L %d %d %d %d %u\n",
x, y+300, x+300, y+300, colour);
fprintf(fp, "... | false | false | false | false | false | 0 |
try_connect(void)
{
int pipefd, ret;
struct sockaddr_un saddr;
memset(&saddr, '\0', sizeof(saddr));
saddr.sun_family = AF_UNIX;
snprintf(saddr.sun_path, sizeof(saddr.sun_path), "%s", pipefn);
pipefd = socket(AF_UNIX, SOCK_STREAM, 0);
if (pipefd < 0)
fatal_with_errno(EXIT_FAILURE, "socket");
ret = connect(... | false | false | false | false | false | 0 |
main (int argc, char *argv[])
{
char hostname[1024];
hostname[1023] = '\0';
gethostname(hostname, 1023);
QApplication app (argc, argv);
char str_display[1050];
snprintf(str_display, 1050, "i7z @ %s", hostname);
MyWidget i7z_widget;
i7z_widget.setWindowTitle(str_display);
i7z_widget.show ();
retu... | false | false | false | false | false | 0 |
PyFF_registerGlyphSeparationHook(PyObject *self, PyObject *args) {
PyObject *name; /* Ignored for now */
PyObject *hook, *arg=NULL;
if ( !PyArg_ParseTuple(args,"O|OO",&hook, &arg, &name ) )
return( NULL );
if ( hook==Py_None ) {
Py_XDECREF((PyObject *) PyFF_GlyphSeparationHook);
Py_XDECREF( PyFF_Glyp... | false | false | false | false | false | 0 |
multi_new_active_game( void )
{
active_game *new_game;
new_game = (active_game *)vm_malloc(sizeof(active_game));
if ( new_game == NULL ) {
nprintf(("Network", "Cannot allocate space for new active game structure\n"));
return NULL;
}
if ( Active_game_head != NULL ) {
new_game->next = Active_game_head->next... | false | false | false | false | false | 0 |
getParentWindow(const URI& uri)
{
wxString ms = uri.getParam(wxT("parent_window"));
unsigned long mo;
if (!ms.ToULong(&mo))
return 0;
return (wxWindow*)mo;
} | false | false | false | false | false | 0 |
filter_return (pIIR_Declaration d, filter_return_closure *rc)
{
if (d->is(IR_FUNCTION_DECLARATION))
{
pIIR_FunctionDeclaration f = pIIR_FunctionDeclaration(d);
int c1, c2;
if (is_array_func(f, rc->a))
{
c1 = conversion_cost (pIIR_ArrayType(f->return_type)->element_type,
rc->t, rc->k);
... | false | false | false | false | false | 0 |
artist()
{
if (m_v2) return m_v2->artist->p;
if (m_v1) {
m_v1->artist[sizeof(m_v1->artist)-1] = 0;
return m_v1->artist;
}
return NULL;
} | false | false | false | false | false | 0 |
rinoo_http_response_setmsg(t_http *http, const char *msg)
{
strtobuffer(&http->response.msg, msg);
} | false | false | false | false | false | 0 |
isert_np_cma_handler(struct isert_np *isert_np,
enum rdma_cm_event_type event)
{
isert_dbg("%s (%d): isert np %p\n",
rdma_event_msg(event), event, isert_np);
switch (event) {
case RDMA_CM_EVENT_DEVICE_REMOVAL:
isert_np->cm_id = NULL;
break;
case RDMA_CM_EVENT_ADDR_CHANGE:
isert_np->cm_id = isert_s... | false | false | false | false | false | 0 |
__certificate_properties_fill_cert_ext (GtkTreeStore *store,
GtkTreeIter *parent,
gnutls_x509_crt_t *certificate)
{
gint result;
const gint OID_SIZE_MAX = 128;
gchar oid[OID_SIZE_MAX];
gsize oid_size = OID_SIZE_MAX;
gint critical;
guint i;
GtkTreeIter j;
GtkTreeIter k;
GtkTreeIter l... | false | false | false | false | false | 0 |
replaceArrays(DICompositeType *&T, DINodeArray Elements,
DINodeArray TParams) {
{
TypedTrackingMDRef<DICompositeType> N(T);
if (Elements)
N->replaceElements(Elements);
if (TParams)
N->replaceTemplateParams(DITemplateParameterArray(TParams));
T = N.get();
}
... | false | false | false | false | false | 0 |
static_import_gml (const char *fullname,
gamgi_ml *ml)
{
char *shortname, *filename;
/********************************************
* make sure fullname is an acceptable name *
********************************************/
shortname = gamgi_io_file_name (fullname, ml->window);
if (shortname == NULL) return FALSE;
... | false | false | false | false | false | 0 |
ipmipower_check_payload_type (ipmipower_powercmd_t ip, packet_type_t pkt)
{
uint8_t payload_type;
uint8_t expected_payload_type;
uint64_t val;
assert (ip);
assert (PACKET_TYPE_VALID_RES (pkt));
assert (pkt == OPEN_SESSION_RES
|| pkt == RAKP_MESSAGE_2_RES
|| pkt == RAKP_MESSAGE_4_RES
... | false | false | false | false | false | 0 |
_dwarf_addr_finder(dwarf_elf_handle elf_file_ptr,
Dwarf_addr_callback_func cb_func, int *dwerr)
{
Dwarf_Error err = 0;
Dwarf_Debug dbg = 0;
int res = 0;
int errval = 0;
int sections_found = 0;
res = dwarf_elf_init(elf_file_ptr, DW_DLC_READ, /* errhand */ 0,
/* errarg */ 0, &dbg, &e... | false | false | false | false | false | 0 |
GetTail(Object o, char *name, Pointer l)
{
Field f;
Object next;
int n, i;
byte *ptr;
int size;
Array a;
if (DXGetObjectClass(o) == CLASS_FIELD)
{
f = (Field)o;
}
else /* object is a series */
{
f = NULL;
for (i = 0; NULL != (next = DXGetSeriesMember((Series)o, i, NULL))... | false | true | false | false | false | 1 |
get_size(const char *file)
{
int fd;
long size;
fd = xopen(file, O_RDWR);
if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
close(fd);
return (size * 512);
}
size = count_blocks(fd);
close(fd);
return size;
} | false | false | false | false | false | 0 |
pass_username_set(struct entry *ent, const char *param, const char *val)
{
struct pass_session *fts;
struct statefile *sf = (struct statefile *) av_namespace_get(ent);
struct pass_session *passd = (struct pass_session *) sf->data;
unsigned int len;
AV_LOCK(pass_lock);
fts = pass_get_session(pas... | false | false | false | false | false | 0 |
RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// get the input and outpu... | false | false | false | false | false | 0 |
SaveSettings()
{
FILE *fp;
struct Directive *dptr;
int ii, ret;
char buffer[MAXLINE + 1],
tmp[MAXLINE + 1],
tempname[MAXLINE + 1];
/* MMkay, this should write safe config files so that they won't get
* b0rked if something happens when writing. -kre */
ircsprintf(tempname, "%s.tmp", SETPATH);
if (!(fp = fop... | false | false | false | false | false | 0 |
check_table (IBusEngineSimple *simple,
IBusComposeTable *table,
gint n_compose)
{
// g_debug("check_table");
IBusEngineSimplePrivate *priv = simple->priv;
gint row_stride = table->max_seq_len + 2;
guint16 *seq;
g_assert (IBUS_IS_ENGINE_SIMPLE (simple));
i... | false | false | false | false | false | 0 |
reindex_all_databases(const char *host, const char *port,
const char *username, bool password,
const char *progname, bool echo, bool quiet)
{
PGconn *conn;
PGresult *result;
int i;
conn = connectDatabase("postgres", host, port, username, password, progname);
result = executeQuery(conn, "SELEC... | false | false | false | false | false | 0 |
relations_cmp2(const void *a, const void *b)
{
la_col_t * ra = (la_col_t *) a;
la_col_t * rb = (la_col_t *) b;
if (!ra->weight) printf("ra error\n");
long point;
if (ra->weight > rb->weight) return 1;
else if (ra->weight < rb->weight) return -1;
for (point = ra->weight-1; (ra->data[point] == r... | false | false | false | false | false | 0 |
historySearch()
{
historyOverlay.clear();
historyCursorPos.clear();
int pos = historyPos;
HSWidget *hsw = new HSWidget(this);
int selected = hsw->exec(e->cursorRect().bottomRight());
delete hsw;
if (selected >= 0 && selected < history.size())
pos = selected;
toHistory(pos);
} | false | false | false | false | false | 0 |
H5O_dtype_set_share(void *_mesg/*in,out*/, const H5O_shared_t *sh)
{
H5T_t *dt = (H5T_t *)_mesg;
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
HDassert(dt);
HDassert(sh);
/* Make sure the shared message location is initialized, so that it
* either has valid sharing information or i... | false | false | false | false | false | 0 |
printpage()
{
sheetside = 0;
sheets++;
printf("/sd 0 def\n");
if (no_border == FALSE)
printf("%d sn\n", sheets - (restart ? old_sheets : 0));
if (printdate)
printf("cd\n");
if (filename_footer && landscape)
printf("fnf\n");
#if defined(SYSV) || defined(BSD)
if (login_... | false | false | false | false | false | 0 |
get_options(int argc, char **argv, const char *progname)
{
signed char c;
while((c = getopt(argc, argv, "d:r:s:k:w:f:o:vh")) > -1) {
switch (c) {
case 'r':
repeat_filename = optarg;
break;
case 's':
if(*optarg == 'd') {
rectangle_size = -1;
max_mem_kb = strtol(optarg + 1, 0, 10);
if(max_me... | false | true | false | false | true | 1 |
genwqe_start_traps(struct genwqe_dev *cd)
{
__genwqe_writeq(cd, IO_SLC_MISC_DEBUG_CLR, 0xcull);
if (genwqe_need_err_masking(cd))
__genwqe_writeq(cd, IO_SLC_MISC_DEBUG, 0x0aull);
} | false | false | false | false | false | 0 |
agfindedge_by_key(Agraph_t * g, Agnode_t * t, Agnode_t * h,
Agtag_t key)
{
Agedge_t *e, template;
Agsubnode_t *sn;
if ((t == NILnode) || (h == NILnode))
return NILedge;
template.base.tag = key;
template.node = t; /* guess that fan-in < fan-out */
sn = agsubrep(g, h);
if (!sn) e = 0... | false | false | false | false | false | 0 |
ecc_shared_secret(ecc_key *private_key, ecc_key *public_key,
unsigned char *out, unsigned long *outlen)
{
unsigned long x;
ecc_point *result;
void *prime, *a;
int err;
LTC_ARGCHK(private_key != NULL);
LTC_ARGCHK(public_key != NULL);
LTC_ARGCHK(out ... | false | false | false | true | false | 1 |
get_partition_parser(const char *name)
{
struct mtd_part_parser *p, *ret = NULL;
spin_lock(&part_parser_lock);
list_for_each_entry(p, &part_parsers, list)
if (!strcmp(p->name, name) && try_module_get(p->owner)) {
ret = p;
break;
}
spin_unlock(&part_parser_lock);
return ret;
} | false | false | false | false | false | 0 |
row_activated_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data)
{
GdictSpeller *speller = GDICT_SPELLER (user_data);
GdictSpellerPrivate *priv = speller->priv;
GtkTreeIter iter;
gchar *word, *db_name;
gboolean valid;
valid = gtk_t... | false | false | false | false | false | 0 |
gf_odf_del_oci_name(GF_OCICreators *ocn)
{
u32 i;
GF_OCICreator_item *tmp;
if (!ocn) return GF_BAD_PARAM;
i=0;
while ((tmp = (GF_OCICreator_item *)gf_list_enum(ocn->OCICreators, &i))) {
if (tmp->OCICreatorName) gf_free(tmp->OCICreatorName);
gf_free(tmp);
}
gf_list_del(ocn->OCICreators);
gf_free(ocn);
ret... | false | false | false | false | false | 0 |
isReassociationCandidate(const MachineInstr &Inst,
bool &Commuted) const {
return isAssociativeAndCommutative(Inst) &&
hasReassociableOperands(Inst, Inst.getParent()) &&
hasReassociableSibling(Inst, Commuted);
} | false | false | false | false | false | 0 |
main(){
int sum =0;
int i=0;
int totalNum=0;
for( i= 0 ; i<1000000;i++){
if(isPalindromeBoth(i)){
sum+=i;
totalNum++;
}
}
printf("Total both base palindromes below 1000000 is %d and the sum is %d \n",totalNum,sum);
} | false | false | false | false | false | 0 |
mergeSort(IntegerVector &v)
{
IntegerVector temp(v.size());
return mergeSortRek(v,0,v.size(),temp);
} | false | false | false | false | false | 0 |
free_popup_file_in_idle_cb (gpointer data)
{
FMTreeView *view;
view = FM_TREE_VIEW (data);
if (view->details->popup_file != NULL) {
nemo_file_unref (view->details->popup_file);
view->details->popup_file = NULL;
}
view->details->popup_file_idle_handler = 0;
return FALSE;
} | false | false | false | false | false | 0 |
setLineClosed( bool closed )
{
Q_D( LineAnnotation );
if (!d->pdfAnnot)
{
d->lineClosed = closed;
return;
}
if (d->pdfAnnot->getType() != Annot::typeLine)
{
AnnotPolygon *polyann = static_cast<AnnotPolygon*>(d->pdfAnnot);
// Set new subtype and switch intent if... | false | false | false | false | false | 0 |
AssignProtectedObjSet(const StackObjSet &UnassignedObjs,
SmallSet<int, 16> &ProtectedObjs,
MachineFrameInfo *MFI,
bool StackGrowsDown, int64_t &Offset,
... | false | false | false | false | false | 0 |
o2net_set_nn_state(struct o2net_node *nn,
struct o2net_sock_container *sc,
unsigned valid, int err)
{
int was_valid = nn->nn_sc_valid;
int was_err = nn->nn_persistent_error;
struct o2net_sock_container *old_sc = nn->nn_sc;
assert_spin_locked(&nn->nn_lock);
if (old_sc && !sc)
atomic_dec(&o2n... | false | false | false | false | false | 0 |
textblock(Paragraph *p, int toplevel)
{
Line *t, *next;
for ( t = p->text; t ; t = next ) {
if ( ((next = t->next) == 0) || endoftextblock(next, toplevel) ) {
p->align = centered(p->text, t);
t->next = 0;
return next;
}
}
return t;
} | false | false | false | false | false | 0 |
SkipSection()
{
// must handle subsections ...
int iCnt = 0;
while (true)
{
if ('}' == *filePtr)
{
--iCnt;
if (0 == iCnt)
{
// go to the next valid token ...
++filePtr;
SkipToNextToken();
return true;
}
}
else if ('{' == *filePtr)
{
++iCnt;
}
else if ('\0' == *filePtr)
... | false | false | false | false | false | 0 |
flmIndexingAfterCommit(
FDB * pDb)
{
F_BKGND_IX * pStartIx;
F_BKGND_IX * pStopIx;
F_BKGND_IX * pNextIx;
FLMBOOL bThreadsActive;
FLMBOOL bStopped;
// Signal all background indexing threads in the stop list
// to shutdown. Poll until all have terminated.
for( ;;)
{
bThreadsActive = FALSE;
fo... | false | false | false | false | false | 0 |
serio_handle_event(struct work_struct *work)
{
struct serio_event *event;
mutex_lock(&serio_mutex);
while ((event = serio_get_event())) {
switch (event->type) {
case SERIO_REGISTER_PORT:
serio_add_port(event->object);
break;
case SERIO_RECONNECT_PORT:
serio_reconnect_port(event->object);
break... | false | false | false | false | false | 0 |
e1000_setup_rx_resources(struct e1000_adapter *adapter,
struct e1000_rx_ring *rxdr)
{
struct pci_dev *pdev = adapter->pdev;
int size, desc_len;
size = sizeof(struct e1000_rx_buffer) * rxdr->count;
rxdr->buffer_info = vzalloc(size);
if (!rxdr->buffer_info)
return -ENOMEM;
desc_len = sizeof(struct e1000... | false | false | false | false | false | 0 |
Send_DownloadFile_Cmd(wxString file_hash, wxString cmd, uint32 opt_arg)
{
CECPacket *ec_cmd = 0;
CMD4Hash fileHash;
wxCHECK2(fileHash.Decode(file_hash), /* Do nothing. */ );
CECTag hashtag(EC_TAG_PARTFILE, fileHash);
if (cmd == wxT("pause")) {
ec_cmd = new CECPacket(EC_OP_PARTFILE_PAUSE);
} else if (cmd == wx... | false | false | false | false | false | 0 |
doDispatch(Cursor & cur, FuncRequest & cmd)
{
if (cmd.action() == LFUN_INSET_MODIFY) {
buffer().removeBiblioTempFiles();
cache.recalculate = true;
}
InsetCommand::doDispatch(cur, cmd);
} | false | false | false | false | false | 0 |
force_kill_timeout(gpointer user_data)
{
pid_t pid = GPOINTER_TO_INT(user_data);
if (pid > 0) {
if (kill(pid, SIGKILL) == 0)
connman_warn("killing pid %d by force", pid);
}
return FALSE;
} | 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.