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 |
|---|---|---|---|---|---|---|
isCompressedFile(std::string & cmd)
{
bool compressed = false, isInput = (flags_ & std::ios::in);
cmd = "";
unsigned int len = path_.size();
if( len > kGzipped.size()
&& path_.find(kGzipped) == len - kGzipped.size()) {
//gzip file command to compress or decompress
compressed = true;
// cmd =... | false | false | false | false | false | 0 |
tifm_alloc_device(struct tifm_adapter *fm, unsigned int id,
unsigned char type)
{
struct tifm_dev *sock = NULL;
if (!tifm_media_type_name(type, 0))
return sock;
sock = kzalloc(sizeof(struct tifm_dev), GFP_KERNEL);
if (sock) {
spin_lock_init(&sock->lock);
sock->type = type;
sock->socket_id = id;
s... | false | false | false | false | false | 0 |
OnSessionDestroy(Session* session) {
LOG(LS_INFO) << "TunnelSessionClientBase::OnSessionDestroy";
ASSERT(session_manager_->signaling_thread()->IsCurrent());
if (shutdown_)
return;
for (std::vector<TunnelSession*>::iterator it = sessions_.begin();
it != sessions_.end();
++it) {
if ((*it)->H... | false | false | false | false | false | 0 |
obj_context_get_connection_version(TSS_HCONTEXT tspContext, UINT32 *version)
{
struct tsp_object *obj;
struct tr_context_obj *context;
if ((obj = obj_list_get_obj(&context_list, tspContext)) == NULL)
return TSPERR(TSS_E_INVALID_HANDLE);
context = (struct tr_context_obj *)obj->data;
*version = context->current... | false | false | false | false | false | 0 |
fs_binding_get_vals(fs_binding *b, const char *name, int *bound)
{
#ifdef DEBUG_BINDING
if (!strcmp(DEBUG_BINDING, name)) printf("@@ get_vals("DEBUG_BINDING")\n");
#endif
int i;
for (i=0; 1; i++) {
if (!b[i].name) break;
if (!strcmp(b[i].name, name)) {
if (bound) *bound = b[i].bound;
return b[i... | false | false | false | false | false | 0 |
ssl_init() {
SSL_CTX *ctx = NULL;
SSL_load_error_strings();
SSL_library_init();
OpenSSL_add_all_algorithms();
if ((locks = calloc(CRYPTO_num_locks(), sizeof(pthread_mutex_t)))) {
for (int i = 0; i < CRYPTO_num_locks(); i++) {
pthread_mutex_init(&locks[i], NULL);
}
... | false | false | false | false | false | 0 |
CompAssComObjExpr (
Stat stat )
{
CVar record; /* record, left operand */
CVar rnam; /* name, left operand */
CVar rhs; /* rhs, right operand */
/* print a comment ... | false | false | false | false | false | 0 |
SVCmd_ResetScores_f (void)
{
if(!matchmode->value)
{
gi.cprintf(NULL, PRINT_HIGH, "This command works only in matchmode\n");
return;
}
ResetScores(true);
gi.bprintf(PRINT_HIGH, "Scores and time was resetted by console\n");
} | false | false | false | false | false | 0 |
genget(char *name, char **table, int stlen)
/* name to match */
/* name entry in table */
{
char **c, **found;
int n;
if (name == 0)
return 0;
found = 0;
for (c = table; *c != 0; c = (char **)((char *)c + stlen)) {
if ((n = isprefix(name, *c)) == 0)
continue;
if (n < 0) /* exac... | false | false | false | false | false | 0 |
on_line_width_combo_combo_entry_changed(GtkEditable *editable,
gpointer user_data)
{
char *tmp;
int t;
GdkGCValues gcvalues;
gpaint_canvas *canvas;
gpaint_drawing *drawing;
int position = 0;
debug_fn();
canvas = canvas_lookup(GTK_WI... | false | false | false | false | false | 0 |
DetermineCfenginePort()
{ struct servent *server;
if ((server = getservbyname(CFENGINE_SERVICE,"tcp")) == NULL)
{
CfOut(cf_verbose,"getservbyname","No registered cfengine service, using default");
snprintf(STR_CFENGINEPORT,15,"5308");
SHORT_CFENGINEPORT = htons((unsigned short)5308);
}
else
{
snp... | false | false | false | false | false | 0 |
spif_linked_list_done(spif_linked_list_t self)
{
spif_linked_list_item_t current;
ASSERT_RVAL(!SPIF_LIST_ISNULL(self), FALSE);
if (self->len) {
for (current = self->head; current;) {
spif_linked_list_item_t tmp;
tmp = current;
current = current->next;
... | false | false | false | false | false | 0 |
getTimerInfo(double *pdelapsed)
{
struct timeval tv;
// elapsed
gettimeofday(&tv,0);
*pdelapsed = (double)tv.tv_sec + 0.000001 * (double)tv.tv_usec;
if(*pdelapsed < 0.000001)
*pdelapsed = 0.000001;
} | false | false | false | false | false | 0 |
size() const
{
if (!group_ptr)
return 0;
int size;
BOOST_MPI_CHECK_RESULT(MPI_Group_size, (*group_ptr, &size));
return size;
} | false | false | false | false | false | 0 |
qla1280_device_reset(struct scsi_qla_host *ha, int bus, int target)
{
uint16_t mb[MAILBOX_REGISTER_COUNT];
int status;
ENTER("qla1280_device_reset");
mb[0] = MBC_ABORT_TARGET;
mb[1] = (bus ? (target | BIT_7) : target) << 8;
mb[2] = 1;
status = qla1280_mailbox_command(ha, BIT_2 | BIT_1 | BIT_0, &mb[0]);
/* Is... | false | false | false | false | false | 0 |
midgard_reflector_property_is_primary (MidgardReflectorProperty *self, const gchar *property)
{
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (property != NULL, FALSE);
g_return_val_if_fail (self->priv->klass != NULL, FALSE);
MgdSchemaPropertyAttr *prop_attr =
midgard_core_class_get_property... | false | false | false | false | false | 0 |
AcpiDmDescriptorName (
void)
{
if (ResourceName == ACPI_DEFAULT_RESNAME)
{
return;
}
AcpiOsPrintf ("%4.4s", (char *) &ResourceName);
} | false | false | false | false | false | 0 |
adjust_image_device(const char **img_path, const char **dev_path)
{
const char *tmp_path;
if (file_test(*dev_path, "b") >= 0)
{
return;
}
tmp_path = *img_path;
*img_path = *dev_path;
*dev_path = tmp_path;
} | false | false | false | false | false | 0 |
left_callback(int count, int key) {
reset_indent();
if (rl_point > 0) {
int i = line_start(rl_point);
rl_point = (i == 0 || rl_point-i > prompt_length) ?
rl_point-1 : i-1;
}
return 0;
} | false | false | false | false | false | 0 |
gt_ppt_hit_new(GtStrand strand, GtPPTResults *r)
{
GtPPTHit *h = gt_calloc((size_t) 1, sizeof (GtPPTHit));
gt_assert(h);
h->strand = strand;
h->res = r;
h->score = 0.0;
return h;
} | false | false | false | false | false | 0 |
_gcry_cipher_setctr (gcry_cipher_hd_t hd, const void *ctr, size_t ctrlen)
{
if (ctr && ctrlen == hd->cipher->blocksize)
{
memcpy (hd->u_ctr.ctr, ctr, hd->cipher->blocksize);
hd->unused = 0;
}
else if (!ctr || !ctrlen)
{
memset (hd->u_ctr.ctr, 0, hd->cipher->blocksize);
hd->unused... | false | false | false | false | false | 0 |
efi_snp_statistics ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, BOOLEAN reset,
UINTN *stats_len, EFI_NETWORK_STATISTICS *stats ) {
struct efi_snp_device *snpdev =
container_of ( snp, struct efi_snp_device, snp );
EFI_NETWORK_STATISTICS stats_buf;
DBGC2 ( snpdev, "SNPDEV %p STATISTICS%s", snpdev,
( reset ? " reset... | false | false | false | false | false | 0 |
strat_select_method (PyObject *self, PyObject *args)
{
PyStrategy *py_strat = (PyStrategy *)self;
PySelectionKey *py_key;
char *word = NULL;
if (!PyArg_ParseTuple (args, "sO!", &word, &PySelectionKeyType, &py_key))
return _ro (Py_False);
return _ro (py_strat->strat->sel (DICO_SELECT_RUN, py_key->... | false | false | false | false | false | 0 |
shuttleVFD_init(Driver *drvthis)
{
PrivateData *p;
struct usb_bus *bus;
int claim_rc;
// allocate and store private data
p = (PrivateData *)calloc(1, sizeof(PrivateData));
if (p == NULL) {
report(RPT_ERR, "%s: unable to allocate private data", drvthis->name);
return -1;
}
if (drvthis->store_pri... | false | false | false | false | false | 0 |
show_page_by_url(const char *browser, const char *url)
{
char com[1024];
/*
* Browsers which have openURL() command.
*/
if (locatestring(browser, "mozilla", MATCH_AT_LAST) ||
locatestring(browser, "netscape", MATCH_AT_LAST) ||
locatestring(browser, "netscape-remote", MATCH_AT_LAST))
{
char *path;
... | true | true | false | false | true | 1 |
CDB_txn_stat(dbenv, statp, db_malloc)
DB_ENV *dbenv;
DB_TXN_STAT **statp;
void *(*db_malloc) __P((size_t));
{
DB_TXNMGR *mgr;
DB_TXNREGION *region;
DB_TXN_STAT *stats;
TXN_DETAIL *txnp;
size_t nbytes;
u_int32_t nactive, ndx;
int ret, slop;
PANIC_CHECK(dbenv);
ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, DB... | false | false | false | false | false | 0 |
brasero_file_node_add (BraseroFileNode *parent,
BraseroFileNode *node,
GCompareFunc sort_func)
{
BraseroFileTreeStats *stats;
guint depth = 0;
parent->union2.children = brasero_file_node_insert (BRASERO_FILE_NODE_CHILDREN (parent),
node,
sort_func,
NULL);
node->pa... | false | false | false | false | false | 0 |
seekGame(int index)
{
IndexBaseType n = offset(index);
if(!m_file->seek(n))
{
qDebug() << "Seeking offset " << n << " failed!";
}
readLine();
} | false | false | false | false | false | 0 |
initialize(const char * szKeyBindingsKey, const char * szKeyBindingsDefaultValue)
{
gsf_init();
// create application-wide resources that
// are shared by everything.
// init keyboard language (cannot be in the constructor as it
// requires the platform code already initialised
setKbdLanguage(_getKbdLanguage())... | false | false | false | false | false | 0 |
get_irq_infos(struct IsdnCardState *cs, struct isar_reg *ireg)
{
ireg->iis = cs->BC_Read_Reg(cs, 1, ISAR_IIS);
ireg->cmsb = cs->BC_Read_Reg(cs, 1, ISAR_CTRL_H);
ireg->clsb = cs->BC_Read_Reg(cs, 1, ISAR_CTRL_L);
#if DUMP_MBOXFRAME
if (cs->debug & L1_DEB_HSCX)
debugl1(cs, "irq_stat(%02x,%02x,%d)", ireg->iis, ireg->... | false | false | false | false | false | 0 |
CreateJingleVideoCodecElem(const VideoCodec& codec) {
buzz::XmlElement* elem = new buzz::XmlElement(QN_JINGLE_RTP_PAYLOADTYPE);
AddXmlAttr(elem, QN_ID, codec.id);
elem->AddAttr(QN_NAME, codec.name);
elem->AddElement(CreatePayloadTypeParameterElem(
PAYLOADTYPE_PARAMETER_WIDTH, codec.width));
elem->AddEl... | false | false | false | false | false | 0 |
gst_caps_from_string (const gchar * string)
{
GstCaps *caps;
g_return_val_if_fail (string, FALSE);
caps = gst_caps_new_empty ();
if (gst_caps_from_string_inplace (caps, string)) {
return caps;
} else {
gst_caps_unref (caps);
return NULL;
}
} | false | false | false | false | false | 0 |
boostCollision(bool boost) {
// calculate boost from lab to rest
if(!boost) {
Lorentz5Momentum ptotal=incoming_.first ->momentum()+incoming_.second->momentum();
boost_ = LorentzRotation(-ptotal.boostVector());
Axis axis((boost_*incoming_.first ->momentum()).vect().unit());
if(axis.perp2()>0.) {
... | false | false | false | false | false | 0 |
ifile_read_header (ifile_db * idata, char **bufp)
{
char *line;
char *token = NULL;
long int i;
long int num;
if ((line = readline(bufp)) == NULL) return -1;
/* read folder names */
token = strtok(line, " \t");
for (i = 0; token != NULL; i++)
{
EXT_ARRAY_SET(idata->folder_name, char *, i, if... | false | false | false | false | false | 0 |
fw_hdrs_free(struct fw_hdr *hdr)
{
struct fw_hdr *next;
while (hdr) {
next = hdr->next;
kfree(hdr);
hdr = next;
}
} | false | false | false | false | false | 0 |
server_remove_player(struct player *pplayer)
{
const struct player_slot *pslot;
fc_assert_ret(NULL != pplayer);
/* save player slot */
pslot = pplayer->slot;
log_normal(_("Removing player %s."), player_name(pplayer));
notify_conn(pplayer->connections, NULL, E_CONNECTION, ftc_server,
_("You... | false | false | false | false | false | 0 |
data_stack_grow(SRE_STATE* state, Py_ssize_t size)
{
Py_ssize_t minsize, cursize;
minsize = state->data_stack_base+size;
cursize = state->data_stack_size;
if (cursize < minsize) {
void* stack;
cursize = minsize+minsize/4+1024;
TRACE(("allocate/grow stack %d\n", cursize));
... | false | true | false | false | false | 1 |
ecs_famille_chaine__affiche(const ecs_int_t num_fam,
ecs_famille_t *fam_tete)
{
int ifam;
ecs_famille_t *ptr_fam;
/*xxxxxxxxxxxxxxxxxxxxxxxxxxx Instructions xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
assert(fam_tete != NULL);
ifam = 1;
ptr_fam = fam_tete;
while (ptr_fam != ... | false | false | false | false | false | 0 |
generate_characters (int groups, int repeat,
int group_min, int group_max, int limit,
const char *charset)
{
static int is_initialized = FALSE;
int charset_length, group, chars;
char *buffer;
/* On first (usually only) call, seed the random number generator. */
if (... | false | false | false | false | false | 0 |
bmc150_accel_get_bw(struct bmc150_accel_data *data, int *val,
int *val2)
{
int i;
for (i = 0; i < ARRAY_SIZE(bmc150_accel_samp_freq_table); ++i) {
if (bmc150_accel_samp_freq_table[i].bw_bits == data->bw_bits) {
*val = bmc150_accel_samp_freq_table[i].val;
*val2 = bmc150_accel_samp_freq_table[i].val2... | false | false | false | false | false | 0 |
shmem_init(void)
{
int err = OSHMEM_SUCCESS;
int provided;
int required = SHMEM_THREAD_SINGLE;
if (oshmem_shmem_initialized) {
/*
* SPEC: If start_pes() is called multiple times, subsequent calls have no effect.
*/
return;
}
shmem_api_logger_output = opal_outp... | false | false | false | false | false | 0 |
guess_dm_gone(int t1, int t2) {
int wait = t2;
char *avoid = getenv("X11VNC_AVOID_WINDOWS");
time_t tcheck = last_client;
if (last_open_xdisplay > last_client) {
/* better time for -display WAIT:... */
tcheck = last_open_xdisplay;
}
if (avoid && !strcmp(avoid, "never")) {
return 1;
}
if (!screen || !scr... | false | false | false | false | false | 0 |
vartable_limits_set_by_var (gint j, GGobiData *d)
{
vartabled *vt = vartable_element_get (j, d);
GtkTreeModel *model;
GtkTreeIter iter;
if (!vartable_iter_from_varno(j, d, &model, &iter))
return;
if (vt) {
switch (vt->vartype) {
case integer:
case counter:
case uniform:
c... | false | false | false | false | false | 0 |
openLib(const string& lib_name)
{
bool success = (dlopen(lib_name.c_str(), RTLD_LAZY | RTLD_GLOBAL) != 0);
if (!success) {
char buffer[BUFF_SIZE];
sprintf(buffer, "%s did not load properly.\n Error: %s",
lib_name.c_str(), dlerror());
OpenBabel::obErrorLog.ThrowError(__FUNCTION__, buffer, O... | false | false | false | false | false | 0 |
head_check(unsigned long head,int check_layer)
{
/*
look for a valid header.
if check_layer > 0, then require that
nLayer = check_layer.
*/
/* bits 13-14 = layer 3 */
int nLayer=4-((head>>17)&3);
if( (head & 0xffe00000) != 0xffe00000) {
/* syncword */
return FALSE;
}
#if 0
if(!((he... | false | false | false | false | false | 0 |
intr_proc(int state)
{
if(_inraw){
if(state){
#if HAS_TERMIOS
_raw_tty.c_lflag |= ISIG; /* enable signals */
tcsetattr(STDIN_FD, TCSADRAIN, &_raw_tty);
#elif HAS_TERMIO
_raw_tty.c_lflag |= ISIG; /* enable signals */
(void)ioctl(STDIN_FD, TCSETAW, &_raw_tty);
#else /* RAW_BSD */
_raw... | false | false | false | false | false | 0 |
cb_build_perform_until (cb_tree condition, cb_tree varying)
{
cb_tree x;
x = cb_build_perform (CB_PERFORM_UNTIL);
CB_PERFORM (x)->test = condition;
CB_PERFORM (x)->varying = varying;
return x;
} | false | false | false | true | false | 1 |
xmlXPtrRangesEqual(xmlXPathObjectPtr range1, xmlXPathObjectPtr range2) {
if (range1 == range2)
return(1);
if ((range1 == NULL) || (range2 == NULL))
return(0);
if (range1->type != range2->type)
return(0);
if (range1->type != XPATH_RANGE)
return(0);
if (range1->user != ... | false | false | false | false | false | 0 |
restore_display(dispwin *p) {
/* Restore the ramdac */
if (p->or != NULL) {
p->set_ramdac(p, p->or, 0);
p->or->del(p->or);
p->or = NULL;
debugr("Restored original ramdac\n");
}
if (p->r != NULL) {
p->r->del(p->r);
p->r = NULL;
}
#if defined(UNIX_X11)
#if ScreenSaverMajorVersion >= 1 && ScreenSaverMi... | false | false | false | false | false | 0 |
getElement(const int position)
{
Link* link;
int i;
ASSERT(this);
if (position < 1 OR position > this->size)
{
return NUL(const void*);
}
else if (position == 1)
{
return this->first->element;
}
else if (position == this->size)
{
return this->last->element;
}
e... | false | false | false | true | false | 1 |
gtt_reports_menu_prepend_entry (GnomeApp *app, GnomeUIInfo *new_entry)
{
int i, nitems;
GnomeUIInfo * current_sysmenu, *new_sysmenu;
current_sysmenu = gtt_get_reports_menu ();
for (i=0; GNOME_APP_UI_ENDOFINFO != current_sysmenu[i].type; i++) {}
nitems = i+1;
new_sysmenu = g_new0 (GnomeUIInfo, nitems+1);
new_sy... | false | false | false | false | false | 0 |
ntru_gen_tern_poly(NtruIGFState *s, int df, NtruTernPoly *p) {
p->N = s->N;
p->num_ones = df;
p->num_neg_ones = df;
int idx;
int r[p->N];
memset(r, 0, sizeof r);
int t = 0;
while (t < df) {
ntru_IGF_next(s, &idx);
if (!r[idx]) {
p->neg_ones[t] = idx;
... | false | false | false | false | false | 0 |
gribFileSeekOld(int fileID, long *offset)
{
/* position file pointer after GRIB */
int ch;
int buffersize = 4096;
unsigned char buffer[4096];
int retry = 4096;
int i;
void *fileptr;
*offset = 0;
fileptr = filePtr(fileID);
ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[0] = ch;
... | false | false | false | false | false | 0 |
tpci200_slot_irq(struct slot_irq *slot_irq)
{
irqreturn_t ret;
if (!slot_irq)
return -ENODEV;
ret = slot_irq->handler(slot_irq->arg);
return ret;
} | false | false | false | false | false | 0 |
dowhatdoes_core(q, cbuf)
char q;
char *cbuf;
{
dlb *fp;
char bufr[BUFSZ];
register char *buf = &bufr[6], *ep, ctrl, meta;
fp = dlb_fopen(CMDHELPFILE, "r");
if (!fp) {
pline("Cannot open data file!");
return 0;
}
ctrl = ((q <= '\033') ? (q - 1 + 'A') : 0);
meta = ((0x80 & q) ? (0x7f & q) : 0);
while(dlb... | false | false | false | false | false | 0 |
sge_infotext_all_spaces(char* text) {
int i;
int back = 0;
if (text != NULL) {
for(i=0;i<strlen(text);i++) {
if(text[i] != ' ') {
back = 1;
break;
}
}
}
return back;
} | false | false | false | false | false | 0 |
net_connect(char *host, u_short port, int binary, int strong)
/*
* Function: Connect to the given host and port
* Returns: sock if OK
* -1 if error
* -2 if host not found
*
* Supports virtual hosting. Use enable_virtual_host() to configure.
* Set binary to 1 if a binary (non-buffer... | false | false | false | false | false | 0 |
delete_link(void *address, object link_ar)
{object *ar,*ar_end,*p;
p=0;
ar = link_ar->v.v_self;
ar_end = (object *)&(link_ar->ust.ust_self[link_ar->v.v_fillp]);
while (ar < ar_end)
{ if (*ar && *((void **)*ar)==address)
{ p = (object *) *ar;
*ar=0;
*p = *(ar+1);
number_unlinked++;}
ar=ar+2;}
i... | false | false | false | false | false | 0 |
better_p (const_edge e1, const_edge e2)
{
if (e1->count != e2->count)
return e1->count > e2->count;
if (e1->src->frequency * e1->probability !=
e2->src->frequency * e2->probability)
return (e1->src->frequency * e1->probability
> e2->src->frequency * e2->probability);
/* This is needed to avoid ... | false | false | false | false | false | 0 |
isStringOfOnes(uint64_t Mask, unsigned &LSB, unsigned &Length) {
unsigned First = findFirstSet(Mask);
uint64_t Top = (Mask >> First) + 1;
if ((Top & -Top) == Top) {
LSB = First;
Length = findFirstSet(Top);
return true;
}
return false;
} | false | false | false | false | false | 0 |
defineGeometry()
{
using namespace python;
docstring_options doc_options(true, true, false);
multidef("convexHull",
pythonConvexHull<double, float, Int32>(),
args("points"),
"Compute the convex hull of a point set.\n"
"\n"
"For details see convexHull_ in the vigra... | false | false | false | false | false | 0 |
sr_release(struct cdrom_device_info *cdi)
{
struct scsi_cd *cd = cdi->handle;
if (cd->device->sector_size > 2048)
sr_set_blocklength(cd, 2048);
} | false | false | false | false | false | 0 |
slapi_send_ldap_result_from_pb( Slapi_PBlock *pb)
{
int err;
char *matched;
char *text;
IFP fn = NULL;
slapi_pblock_get(pb, SLAPI_RESULT_CODE, &err);
slapi_pblock_get(pb, SLAPI_RESULT_TEXT, &text);
slapi_pblock_get(pb, SLAPI_RESULT_MATCHED, &matched);
slapi_pblock_get(pb,SLAPI_PLUGIN_DB_RESULT_FN,(void*)&fn);... | false | false | false | false | false | 0 |
fsl_asrc_dma_startup(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime;
struct device *dev = rtd->platform->dev;
struct fsl_asrc *asrc_priv = dev_get_drvdata(dev);
struct fsl_asrc_pair *pair;
pair = kzalloc(sizeo... | false | false | false | false | false | 0 |
custom_list_iter_nth_child (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *parent,
gint n)
{
CustomList *custom_list;
CustomRecord *parent_record;
g_return_val_if_fail (CUSTOM_IS_LIST (tree_model), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
... | false | false | false | false | false | 0 |
setMapType(QGraphicsGeoMap::MapType mapType)
{
if (d_ptr->mapData && d_ptr->manager) {
if (!d_ptr->manager->supportedMapTypes().contains(mapType))
return;
d_ptr->mapData->setMapType(mapType);
}
} | false | false | false | false | false | 0 |
parse_cli(int argc,char *argv[],int *operation,int *mode,char **hostname,char **port) {
int opt;
*operation=OPERATION_DEFAULT;
*mode=MODE_DEFAULT;
*port=NULL;
*hostname=NULL;
while ((opt=getopt(argc,argv,"h46rz"))!=-1) {
switch (opt) {
case 'h':
*operation=OPERATION_HELP;
return... | false | true | false | false | true | 1 |
OTF_RStream_readEvents( OTF_RStream* rstream, OTF_HandlerArray* handlers ) {
uint64_t recordcount= 0;
int ret;
# ifdef OTF_DEBUG
uint64_t currenttime= 0;
uint64_t oldtime= 0;
# endif
char next_char = '\0';
/* initialized? */
if ( NULL == rstream->eventBuffer ) {
/* init */
rstream->eventBuffer= OT... | false | false | false | false | false | 0 |
print()
{
std::ostringstream os;
os<<"\n";
for (int i=0; i<4; ++i)
{
for (int j=0; j<4; ++j)
{
os << m[i][j] <<" ";
}
os << "\n";
}
return os.str();
} | false | false | false | false | false | 0 |
berEncodePasswordData(
struct berval **requestBV,
char *objectDN,
char *password,
char *password2)
{
int err = 0, rc=0;
BerElement *requestBer = NULL;
char * utf8ObjPtr = NULL;
int utf8ObjSize = 0;
char * utf8PwdPtr = NULL;
int utf8PwdSize = 0;
char * utf8Pwd2Ptr = NULL;
int u... | false | false | false | false | false | 0 |
add_db_arg(char *arg)
{
char **temp;
db5util_db_args_size++;
temp = realloc(db5util_db_args,
sizeof(char *) * (db5util_db_args_size + 1));
if (temp == NULL)
return 0;
db5util_db_args = temp;
db5util_db_args[db5util_db_args_size-1] = arg;
db5util_db_args[db5util_db_... | false | false | false | false | false | 0 |
yperr_string (const int error)
{
const char *str;
switch (error)
{
case YPERR_SUCCESS:
str = N_("Success");
break;
case YPERR_BADARGS:
str = N_("Request arguments bad");
break;
case YPERR_RPC:
str = N_("RPC failure on NIS operation");
break;
case YPERR_DOMAIN:... | false | false | false | false | false | 0 |
selectsupported(aa_context * c)
{
int supported = c->params.supported;
char text[40];
int ch;
do {
static char *texts[] =
{
"Normal characters",
"Half bright (dim)",
"Double bright (bold)",
"Bold font",
"Reversed",
"8 bit ascii",
"Control characters"};
int masks[] =... | true | true | false | false | false | 1 |
rfc1035_hostnamecmp(const char *p, const char *q)
{
while (*p || *q)
{
if (*p == '.' || *q == '.' )
{
if ( (*p && *p != '.') || (*q && *q != '.'))
return (1);
while (*p == '.') ++p;
while (*q == '.') ++q;
continue;
}
if (!*p || !*q) return (1);
if ( tl(*p) != tl(*q)) return (1);
++p;
++q... | false | false | false | false | false | 0 |
get_goodcode_snippet (const char *source_version)
{
if (strcmp (source_version, "1.3") == 0)
return "class conftest {}\n";
if (strcmp (source_version, "1.4") == 0)
return "class conftest { static { assert(true); } }\n";
if (strcmp (source_version, "1.5") == 0)
return "class conftest<T> { T foo() { ret... | false | false | false | false | false | 0 |
MacroAddFunction(char *lookStr, unsigned int *recognizedLen, char **invStr)
{
MACROENTRY tMEntry;
MACROTEXT *curMT;
MACROTEXT *nextMT;
unsigned int i;
tMEntry.macroName = (char *)"%add()";
if (strlen(lookStr) > MAXREPLACESTRING)
{
LexError("Out of Temporary string replacement memory... | false | false | false | false | false | 0 |
dwc2_xfercomp_isoc_split_in(struct dwc2_hsotg *hsotg,
struct dwc2_host_chan *chan, int chnum,
struct dwc2_qtd *qtd)
{
struct dwc2_hcd_iso_packet_desc *frame_desc;
u32 len;
if (!qtd->urb)
return 0;
frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index];
len = dwc2_get_actual_xfer_length(... | false | false | false | false | false | 0 |
tda10086_set_tone(struct dvb_frontend *fe,
enum fe_sec_tone_mode tone)
{
struct tda10086_state* state = fe->demodulator_priv;
u8 t22k_off = 0x80;
dprintk ("%s\n", __func__);
if (state->config->diseqc_tone)
t22k_off = 0;
switch (tone) {
case SEC_TONE_OFF:
tda10086_write_byte(state, 0x36, t22k_off);
... | false | false | false | false | false | 0 |
cloneInternal(ExecState* exec, Interpreter* ctx, JSValue* in, QSet<JSObject*>& path)
{
if (exec->hadException()) // e.g. OOM or DATA_CLONE_ERR
return jsUndefined();
switch (in->type()) {
case NumberType:
case BooleanType:
case UndefinedType:
case NullType:
case S... | false | false | false | false | false | 0 |
zxid_set_epr_secmech(zxid_conf* cf, zxid_epr* epr, const char* secmec) {
if (!epr) {
ERR("Null EPR. %p", epr);
return;
}
if (!epr->Metadata)
epr->Metadata = zx_NEW_a_Metadata(cf->ctx, &epr->gg);
if (!epr->Metadata->SecurityContext)
epr->Metadata->SecurityContext = zx_NEW_di_SecurityContext(cf->c... | false | false | false | false | false | 0 |
git_config_file__snapshot(git_config_backend **out, diskfile_backend *in)
{
diskfile_readonly_backend *backend;
backend = git__calloc(1, sizeof(diskfile_readonly_backend));
GITERR_CHECK_ALLOC(backend);
backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION;
git_mutex_init(&backend->header.values_mutex);
b... | false | false | false | false | false | 0 |
EuclideanDotFunc(float X,float Y, float scale) {
const float AbsX=fabsf(X);
const float AbsY=fabsf(Y);
float Result;
if ((AbsX+AbsY)>1.0f) {
Result=((AbsY-1.0f)*(AbsY-1.0f)+
(AbsX-1.0f)*(AbsX-1.0f))-2.0f;
} else {
Result=2.0f-(AbsY*AbsY+AbsX*AbsX);
}
Result/=2.0f;
return static_cast<int>... | false | false | false | false | false | 0 |
picture_start_code_name (guint8 psc)
{
guint i;
const struct
{
guint8 psc;
const gchar *name;
} psc_names[] = {
{
0x00, "Picture Start"}, {
0xb0, "Reserved"}, {
0xb1, "Reserved"}, {
0xb2, "User Data Start"}, {
0xb3, "Sequence Header Start"}, {
0xb4, "Sequence Error"}, {
0... | false | false | false | false | false | 0 |
midgard_connection_get_user(MidgardConnection *self)
{
g_return_val_if_fail(self != NULL, NULL);
if (self->priv->user == NULL)
return NULL;
if (!G_IS_OBJECT(self->priv->user))
return NULL;
return MIDGARD_USER(self->priv->user);
} | false | false | false | false | false | 0 |
insertion_sort(int *numbers, int count, compare_cb cmp) {
int i = 0;
int j = 0;
int temp = 0;
int *target = malloc(count * sizeof(int));
if (!target)
die("Memory error");
memcpy(target, numbers, count * sizeof(int));
for (i = 0; i < count; i++) {
j = i;
while (... | false | false | false | false | false | 0 |
RateAdd(size_t nbytes, size_t bwlimit, double timestamp)
{
int update_nominal = 0;
if( m_history_last && timestamp < m_history_last->timestamp ){
// time went backward
ClearHistory();
}else Cleanup();
if( timestamp <= m_last_realtime ){ // time went backward
m_ontime = 0;
m_last_size = 0;
... | false | false | false | false | false | 0 |
getline(char **lineptr, size_t *n)
{
ssize_t ret;
switch (s_type) {
case TEXT:
ret = ::getline(lineptr, n, text.s_fp);
if (ret == -1)
return text_status();
break;
case GZIP: {
size_t offset = 0;
if (!*lineptr) {
*n = 128;
*lineptr = (char*)xmalloc(*n);
}
while (1) {
char *line = *li... | false | false | false | false | false | 0 |
game_keypress (gint key)
{
if (game_state == STATE_PLAYING) {
switch (key) {
case KBD_NW:
if (player_move (-1, -1)) {
move_robots ();
}
break;
case KBD_N:
if (player_move (0, -1)) {
move_robots ();
}
break;
case KBD_NE:
if (player_move (1, -1))... | false | false | false | false | false | 0 |
toString(bool verbose, const std::string &outputFormat) const
{
// Save this ErrorMessage in plain text.
// No template is given
if (outputFormat.length() == 0)
{
std::ostringstream text;
if (!_callStack.empty())
text << callStackToString(_callStack) << ": ";
if (_se... | false | false | false | false | false | 0 |
output_check_banner(bool live_check)
{
if (user_opts.check && live_check)
{
pg_log(PG_REPORT, "Performing Consistency Checks on Old Live Server\n");
pg_log(PG_REPORT, "------------------------------------------------\n");
}
else
{
pg_log(PG_REPORT, "Performing Consistency Checks\n");
pg_log(PG_REPORT, "---... | false | false | false | false | false | 0 |
iiter_foreach(IAnjutaIterable* iiter, GFunc callback, gpointer data, GError** e)
{
SourceviewCell* cell = SOURCEVIEW_CELL(iiter);
gint old_offset = cell->priv->offset;
iiter_first (IANJUTA_ITERABLE(cell), NULL);
while (iiter_next(IANJUTA_ITERABLE(cell), NULL))
{
(*callback)(cell, data);
}
cell->priv->offse... | false | false | false | false | false | 0 |
GetRRDisplayString_rdb(mDNS *const m, const ResourceRecord *rr, RDataBody *rd)
{
char *ptr = m->MsgBuffer;
mDNSu32 length = mDNS_snprintf(m->MsgBuffer, 79, "%4d %##s %s ", rr->rdlength, rr->name.c, DNSTypeName(rr->rrtype));
switch (rr->rrtype)
{
case kDNSType_A: mDNS_snprintf(m->MsgBuffer+length, 79-length, "%.... | false | false | false | false | false | 0 |
m_print(GtkWidget *, cchar *) // use GTK print v.9.4
{
PXM * print_addgrid(PXM *printimage); // v.11.01
int err;
char *printfile;
PXM *printimage, *pxmtemp;
zfuncs::F1_help_topic = "print";
if (! curr_... | false | false | false | false | false | 0 |
ipa_get_member_ptr_load_param (tree rhs, bool use_delta)
{
tree rec, ref_field, ref_offset, fld, fld_offset, ptr_field, delta_field;
if (TREE_CODE (rhs) == COMPONENT_REF)
{
ref_field = TREE_OPERAND (rhs, 1);
rhs = TREE_OPERAND (rhs, 0);
}
else
ref_field = NULL_TREE;
if (TREE_CODE (rhs) ... | false | false | false | false | false | 0 |
challenge_cb(struct fp_img_dev *dev, int status,
uint16_t num_regs, unsigned char *data, void *user_data)
{
struct fpi_ssm *ssm = user_data;
struct uru4k_dev *urudev = dev->priv;
unsigned char *respdata;
PK11Context *ctx;
int r, outlen;
r = status;
if (status != 0) {
fpi_ssm_mark_aborted(ssm, status);
retu... | false | false | false | false | false | 0 |
isns_scn_deregister(char *name)
{
int err;
uint16_t flags, length = 0;
char buf[2048];
struct isns_hdr *hdr = (struct isns_hdr *) buf;
struct isns_tlv *tlv;
if (!isns_fd)
if (isns_connect() < 0)
return 0;
memset(buf, 0, sizeof(buf));
tlv = (struct isns_tlv *) hdr->pdu;
length += isns_tlv_set_string(&tl... | false | false | false | false | false | 0 |
rsvg_handle_dispose (GObject *instance)
{
RsvgHandle *self = (RsvgHandle *) instance;
if (self->priv->is_disposed)
goto chain;
self->priv->is_disposed = TRUE;
g_hash_table_destroy (self->priv->entities);
rsvg_defs_free (self->priv->defs);
g_hash_table_destroy (self->priv->css_props);
... | false | false | false | false | false | 0 |
i2c_bit_read ( struct i2c_interface *i2c,
struct i2c_device *i2cdev, unsigned int offset,
uint8_t *data, unsigned int len ) {
struct i2c_bit_basher *i2cbit
= container_of ( i2c, struct i2c_bit_basher, i2c );
struct bit_basher *basher = &i2cbit->basher;
int rc = 0;
DBGC ( basher, "I2CBIT %p reading from... | false | false | false | false | false | 0 |
ext_tree_prepare_commit(struct nfs4_layoutcommit_args *arg)
{
struct pnfs_block_layout *bl = BLK_LO2EXT(NFS_I(arg->inode)->layout);
size_t count = 0, buffer_size = PAGE_SIZE;
__be32 *start_p;
int ret;
dprintk("%s enter\n", __func__);
arg->layoutupdate_page = alloc_page(GFP_NOFS);
if (!arg->layoutupdate_page)
... | false | false | false | false | false | 0 |
dce_v10_0_crtc_disable(struct drm_crtc *crtc)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
struct drm_device *dev = crtc->dev;
struct amdgpu_device *adev = dev->dev_private;
struct amdgpu_atom_ss ss;
int i;
dce_v10_0_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
if (crtc->primary->fb) {
int r;
struct amd... | 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.