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 |
|---|---|---|---|---|---|---|
ticket_translate(const char *name, char *ticket_subject)
{
char command[PATH_MAX * 2 + 4096];
const char *dummy;
if(chirp_ticket_isticketsubject(name, &dummy)) {
strcpy(ticket_subject, name);
return 1;
}
char *pk = xxmalloc(65536); /* max size of public key */
sprintf(command, "sed '/^\\s*#/d' < '%s' | open... | true | true | false | false | true | 1 |
perpeki_chip_draw(tenm_object *my, int priority)
{
tenm_color color;
int i;
int suffix;
int status = 0;
int dx;
int dy;
int theta;
/* sanity check */
if (my == NULL)
return 0;
if (priority != 0)
return 0;
/* border */
color = tenm_map_color(158, 158, 158);
if (my->count[1] >= 0)
{... | false | false | false | false | false | 0 |
glfs_getcwd (struct glfs *fs, char *buf, size_t n)
{
int ret = -1;
inode_t *inode = NULL;
char *path = NULL;
__glfs_entry_fs (fs);
if (!buf || n < 2) {
ret = -1;
errno = EINVAL;
goto out;
}
inode = glfs_cwd_get (fs);
if (!inode) {
strncpy (buf, "/", n);
ret = 0;
g... | false | true | false | false | false | 1 |
longest_ancestor_length(const char *path, const char *prefix_list)
{
char buf[PATH_MAX+1];
const char *ceil, *colon;
int len, max_len = -1;
if (prefix_list == NULL || !strcmp(path, "/"))
return -1;
for (colon = ceil = prefix_list; *colon; ceil = colon+1) {
for (colon = ceil; *colon && *colon != ':'; colon++)... | true | true | true | false | false | 1 |
post_proxy_fail_handler(REQUEST *request)
{
/*
* A proper time is required for wait_a_bit.
*/
request->delay = USEC / 10;
gettimeofday(&now, NULL);
/*
* Not set up to run Post-Proxy-Type = Fail.
*
* Mark the request as still running, and figure out what
* to do next.
*/
if (!setup_post_proxy_fail(re... | false | false | false | false | false | 0 |
ael_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) ael_yyalloc(n ,yyscanner );
if ( ! buf )
YY_FATAL_ERROR( "out ... | false | false | false | false | false | 0 |
gst_mve_audio_data (GstMveDemux * mve, guint8 type, const guint8 * data,
guint16 len, GstBuffer ** output)
{
GstFlowReturn ret;
GstMveDemuxStream *s = mve->audio_stream;
GstBuffer *buf = NULL;
guint16 stream_mask;
guint16 size;
GST_LOG_OBJECT (mve, "audio data");
if (s == NULL) {
GST_ELEMENT_ERR... | false | false | false | false | false | 0 |
EmitFill(uint64_t NumBytes, uint8_t FillValue,
unsigned AddrSpace) {
const MCExpr *E = MCConstantExpr::Create(FillValue, getContext());
for (uint64_t i = 0, e = NumBytes; i != e; ++i)
EmitValue(E, 1, AddrSpace);
} | false | false | false | false | false | 0 |
gst_atomic_queue_unref (GstAtomicQueue * queue)
{
g_return_if_fail (queue != NULL);
if (g_atomic_int_dec_and_test (&queue->refcount))
gst_atomic_queue_free (queue);
} | false | false | false | false | false | 0 |
guestfs_remount_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
GuestfsRemount *self = GUESTFS_REMOUNT(object);
GuestfsRemountPrivate *priv = self->priv;
switch (property_id) {
case PROP_GUESTFS_REMOUNT_RW:
g_value_set_enum(value, priv->rw);
break;
defaul... | false | false | false | false | false | 0 |
on_unstaged_button_press (GtkWidget *widget,
GdkEventButton *event,
GitgCommitView *view)
{
GitgChangedFile *file;
if (event->type != GDK_BUTTON_PRESS)
{
return;
}
if (event->button == 1 &&
column_icon_test (view->priv->tree_view_unstaged,
... | false | false | false | false | false | 0 |
getActionAttributes(std::string& id,
std::string& type, std::string& issuer, AttributeFactory* attrfactory) {
return getAttributesHelper(id, type, issuer, attrfactory, std::string("Action"));
} | false | false | false | false | false | 0 |
method_27(const int *account, int *weight) {
int transform[6][10] =
{ {0,0,0,0,0,0,0,0,0,0}, // zero for non-transform [0][x]
{0,1,5,9,3,7,4,8,2,6}, // first transform line [1][x]
{0,1,7,6,9,8,3,2,5,4}, // second transform line [2][x]
{0,1,8,4,6,2,9,5,7,3}, // third transform line [3][x]
{0,1,2,3,... | false | false | false | false | false | 0 |
ParseCertRelative(DecodedCert* cert, word32 inSz, int type, int verify,
Signer* signers)
{
word32 confirmOID;
int ret;
int badDate = 0;
if ((ret = DecodeToKey(cert, inSz, verify)) < 0) {
if (ret == ASN_BEFORE_DATE_E || ret == ASN_AFTER_DATE_E)
badDate = ret;
... | false | false | false | false | false | 0 |
InsertNextTuple(const double * tuple)
{
VTK_LEGACY_BODY(vtkFieldData::InsertNextTuple, "VTK 5.2");
vtkIdType id=this->GetNumberOfTuples();
// this->InsertTuple(id, tuple);
// Unrolled to avoid warnings.
int count=0;
for ( int j=0; j < this->GetNumberOfArrays(); j++ )
{
vtkDataArray* da = vtkDataAr... | false | false | false | true | false | 1 |
tcs_wrap_GetTestResult(struct tcsd_thread_data *data)
{
TCS_CONTEXT_HANDLE hContext;
TSS_RESULT result;
UINT32 resultDataSize;
BYTE *resultData = NULL;
if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm))
return TCSERR(TSS_E_INTERNAL_ERROR);
LogDebugFn("thread %ld context %x", THREAD_ID, hConte... | false | false | false | false | false | 0 |
operator<<(std::ostream &out, const Node &n)
{
switch (n.type) {
case Node::Nothing:
out << "[]";
break;
case Node::URI:
if (n.value == "") {
out << "[empty-uri]";
} else {
out << "<" << n.value.toStdString() << ">";
}
break;
case N... | false | false | false | false | false | 0 |
intif_charposreq(int account_id,const char *name,int flag)
{
if (inter_fd < 0)
return -1;
WFIFOW(inter_fd,0)=0x3090;
WFIFOL(inter_fd,2)=account_id;
memcpy(WFIFOP(inter_fd,6),name,24);
WFIFOB(inter_fd,30)=flag;
WFIFOSET(inter_fd,31);
return 0;
} | false | false | false | false | false | 0 |
dMassTranslate (dMass *m, dReal x, dReal y, dReal z)
{
// if the body is translated by `a' relative to its point of reference,
// the new inertia about the point of reference is:
//
// I + mass*(crossmat(c)^2 - crossmat(c+a)^2)
//
// where c is the existing center of mass and I is the old inertia.
int ... | false | false | false | false | false | 0 |
_luks_dump(struct crypt_device *cd)
{
int i;
log_std(cd, "LUKS header information for %s\n\n", mdata_device_path(cd));
log_std(cd, "Version: \t%d\n", cd->u.luks1.hdr.version);
log_std(cd, "Cipher name: \t%s\n", cd->u.luks1.hdr.cipherName);
log_std(cd, "Cipher mode: \t%s\n", cd->u.luks1.hdr.cipherMode);
... | false | false | false | false | false | 0 |
httpAddrCopyList(
http_addrlist_t *src) /* I - Source address list */
{
http_addrlist_t *dst = NULL, /* First list entry */
*prev = NULL, /* Previous list entry */
*current = NULL;/* Current list entry */
while (src)
{
if ((current = malloc(sizeof(http_addrlist_t))) == NULL)
{
current =... | false | false | false | false | false | 0 |
gst_water_ripple_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstWaterRipple *water_ripple;
GstGeometricTransform *gt;
gdouble v;
gt = GST_GEOMETRIC_TRANSFORM_CAST (object);
water_ripple = GST_WATER_RIPPLE_CAST (object);
GST_OBJECT_LOCK (gt);
switch (pro... | false | false | false | false | false | 0 |
Ns_DRand(void)
{
if (!initialized) {
Ns_CsEnter(&lock);
if (!initialized) {
unsigned long seed;
Ns_GenSeeds(&seed, 1);
#ifdef HAVE_DRAND48
srand48((long) seed);
#elif defined(HAVE_RANDOM)
srandom((unsigned int) seed);
#else
srand((unsigned int) seed);
#endif
initialized =... | false | false | false | false | false | 0 |
snd_seq_pool_init(struct snd_seq_pool *pool)
{
int cell;
struct snd_seq_event_cell *cellptr;
unsigned long flags;
if (snd_BUG_ON(!pool))
return -EINVAL;
cellptr = vmalloc(sizeof(struct snd_seq_event_cell) * pool->size);
if (!cellptr)
return -ENOMEM;
/* add new cells to the free cell list */
spin_lock_irq... | false | false | false | false | false | 0 |
fr_start(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
#ifdef DEBUG_LINK
printk(KERN_DEBUG "fr_start\n");
#endif
if (state(hdlc)->settings.lmi != LMI_NONE) {
state(hdlc)->reliable = 0;
state(hdlc)->dce_changed = 1;
state(hdlc)->request = 0;
state(hdlc)->fullrep_sent = 0;
state(hdlc)->last... | false | false | false | false | false | 0 |
StoreStamp(Window window,int x,int y,int w,int h)
{
#if PROXY_GROUP_DEBUG
fprintf(stderr,"StoreStamp %x %d %d %d %d\n",(int)window,x,y,w,h);
#endif
stamp=(stamp+1)%stampLimit;
stampMax=stamp;
if(stampMin==stampMax)
{
stampMin=(stampMax+1)%stampLimit;
}
stampQueue[stamp].window=window;
stampQueue[stamp].x=x;... | false | false | false | false | false | 0 |
node_height(const hb_node *node)
{
unsigned l, r;
ASSERT(node != NULL);
l = node->llink ? node_height(node->llink) + 1 : 0;
r = node->rlink ? node_height(node->rlink) + 1 : 0;
return MAX(l, r);
} | false | false | false | false | false | 0 |
ShowCurrentObject(Pointer,DisplayOrErase)
struct o *Pointer;
int DisplayOrErase;
{
struct ka AOI;
/*
* Show the object with an X through the bounding box.
*/
CDBB(Parameters.kpCellDesc,Pointer,&AOI.kaLeft,&AOI.kaBottom,
&AOI.kaRight,&AOI.kaTop);
if (DisplayOrErase == DISPLAY) {
... | false | false | false | false | false | 0 |
rcvmsg_update_loc (RcvMsg * rmsg, const char *file, int line)
{
int flen = strlen (file);
if (rmsg->lastctx == CK_CTX_TEST) {
free (rmsg->test_file);
rmsg->test_line = line;
rmsg->test_file = emalloc (flen + 1);
strcpy (rmsg->test_file, file);
} else {
free (rmsg->fixture_file);
rmsg->fix... | false | true | false | false | false | 1 |
getAvailableHeight(void) const
{
fl_DocSectionLayout * pDSL = getOwningSection();
UT_sint32 avail = getHeight() - pDSL->getTopMargin() - pDSL->getBottomMargin();
UT_sint32 i =0;
for(i=0; i< static_cast<UT_sint32>(countFootnoteContainers()); i++)
{
fp_FootnoteContainer * pFC = getNthFootnoteContainer(i);
avail ... | false | false | false | false | false | 0 |
setDefaultInitArgs(InitArgs *args) {
/* Long longs are used here because with PAE, a 32-bit
machine can have more than 4GB of physical memory */
long long phys_mem = nativePhysicalMemory();
args->asyncgc = FALSE;
args->verbosegc = FALSE;
args->verbosedll = FALSE;
args->verboseclass... | false | false | false | false | true | 1 |
delay_ft1(t_delay *x, t_floatarg g)
{
if (g < 0) g = 0;
x->x_deltime = g;
} | false | false | false | false | false | 0 |
sendAuthRequest(Port *port, AuthRequest areq)
{
StringInfoData buf;
pq_beginmessage(&buf, 'R');
pq_sendint(&buf, (int32) areq, sizeof(int32));
/* Add the salt for encrypted passwords. */
if (areq == AUTH_REQ_MD5)
pq_sendbytes(&buf, port->md5Salt, 4);
#if defined(ENABLE_GSS) || defined(ENABLE_SSPI)
/*
* Ad... | false | false | false | false | false | 0 |
tr_resume_msg(void)
{
char s1[RECLEN], s2[RECLEN];
if (__inst_ptr != __last_tritp)
{
__tr_msg("==> tracing in %s (%s) line %s\n",
__msg2_blditree(s1, __inst_ptr), __inst_ptr->itip->imsym->synam,
__bld_lineloc(s2, (word32) __sfnam_ind, __slin_cnt));
__last_tritp = __inst_ptr;
}
if (__last_trtime !=... | false | false | false | false | false | 0 |
SelectTM_ (MolComplexS *mol_complexSP, int mol_complexesN,
int selection_modeI)
{
long selected_atomsN = 0;
int mol_complexI;
MolComplexS *curr_mol_complexSP;
size_t atomsN, atomI;
VectorS normal_vectorS;
double membrane_center_x, membrane_center_y, membrane_center_z;
double half_thickness;
AtomS *curr_atomSP;... | false | false | false | false | false | 0 |
reduceForOctaedralSymmetry(MolSymMolecule *mol,gint sym)
{
gdouble eps = 1e-3;
if(mol->numberOfAtoms >0) eps = mol->listOfAtoms[0].eps;
rotationAroundZAxisByPi(mol);
removeAllPointsOnOneSideOfAPlane(mol, 0.0, -1.0, 0.0, eps);
removeAllPointsOnOneSideOfAPlane(mol, 0.577350269, 0.0, -0.816496581, eps);
removeAllPo... | false | false | false | false | false | 0 |
strncpy(char * dest,const char *src,size_t count)
{
char *tmp = dest;
while (count-- && (*dest++ = *src++) != '\0')
/* nothing */;
return tmp;
} | false | true | false | false | false | 1 |
operator!=(const SConfig &s1, const SConfig &s2)
{
return
(s1.gamespeed != s2.gamespeed) ||
(s1.gravity != s2.gravity) ||
(s1.acc != s2.acc) ||
(s1.energyNeed != s2.energyNeed) ||
(s1.sunEnergy != s2.sunEnergy) ||
(s1.rotationSpeed != s2.rotationSpeed) ||
(s1.mineActivateTime != s2.mineActivateTime) ||
(s1.mineFuel ... | false | false | false | false | false | 0 |
isl_qpolynomial_opt_on_domain(
__isl_take isl_qpolynomial *qp, __isl_take isl_set *set, int max)
{
struct isl_opt_data data = { NULL, 1, NULL, max };
if (!set || !qp)
goto error;
if (isl_upoly_is_cst(qp->upoly)) {
isl_set_free(set);
return qp;
}
set = fix_inactive(set, qp);
data.qp = qp;
if (isl_set_f... | false | false | false | false | false | 0 |
fold_builtin_classify_type (tree arg)
{
if (arg == 0)
return build_int_cst (integer_type_node, no_type_class);
return build_int_cst (integer_type_node, type_to_class (TREE_TYPE (arg)));
} | false | false | false | false | false | 0 |
bus_context_shutdown (BusContext *context)
{
DBusList *link;
link = _dbus_list_get_first_link (&context->servers);
while (link != NULL)
{
shutdown_server (context, link->data);
link = _dbus_list_get_next_link (&context->servers, link);
}
} | false | false | false | false | false | 0 |
spawn_i (ACE_THR_FUNC func,
void *args,
long flags,
ACE_thread_t *t_id,
ACE_hthread_t *t_handle,
long priority,
int grp_id,
... | false | false | false | false | false | 0 |
foreach_callback(gpointer data, gpointer user_data)
{
char *item = (char *)data;
const char *item_cmp = items[foreach_iterate_index++];
if(foreach_iterate_error != NULL) {
return;
}
if(item != item_cmp) {
foreach_iterate_error = FAILED(
"Expected item at %d to be %s, but it was %s",
foreach_iterate_i... | false | false | false | false | false | 0 |
sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq)
{
struct sh_mmcif_host *host = mmc_priv(mmc);
struct device *dev = sh_mmcif_host_to_dev(host);
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
if (host->state != STATE_IDLE) {
dev_dbg(dev, "%s() rejected, state %u\n",
__func__, host-... | false | false | false | false | false | 0 |
ipmi_sdr_parse_management_controller_device_locator_parameters (ipmi_sdr_parse_ctx_t ctx,
const void *sdr_record,
unsigned int sdr_record_len,
... | false | false | false | false | false | 0 |
file_directory(const char *s) /* I - Filename or URL */
{
char *dir; /* Pointer to directory separator */
static char buf[1024]; /* Buffer for files with targets */
if (s == NULL)
return (NULL);
if (strncmp(s, "http://", 7) == 0 || strncmp(s, "https://", 8) == 0)
{
/*
* Handle URLs...
*/
... | false | false | false | false | false | 0 |
acpi_event_init(void)
{
int error = 0;
if (acpi_disabled)
return 0;
/* create genetlink for acpi event */
error = acpi_event_genetlink_init();
if (error)
printk(KERN_WARNING PREFIX
"Failed to create genetlink family for ACPI event\n");
return 0;
} | false | false | false | false | false | 0 |
math_preferences_dialog_set_combo_box_from_int (MathPreferencesDialog* self, GtkComboBox* combo, gint value) {
GtkTreeIter iter = {0};
gboolean valid = FALSE;
GtkComboBox* _tmp0_ = NULL;
GtkTreeModel* _tmp1_ = NULL;
GtkTreeModel* _tmp2_ = NULL;
GtkTreeIter _tmp3_ = {0};
gboolean _tmp4_ = FALSE;
gboolean _tmp16_... | false | false | false | false | false | 0 |
prioqueue_clone(queue_t *target, queue_t *source)
{
int result = -1;
struct avltree_node *node;
queue_element_t *element = NULL;
if (target && source) {
target->capacity = source->capacity;
target->size = 0;
target->callback_duplicate = source->callback_duplicate;
target... | false | false | false | false | false | 0 |
computeYCoord(int row_)
{
int pixmapH=0;
// Checking if _pixmap is equal to zero is good enough because the existence of
// _pixmap implies the existence of _insensitivePixmap
if (showPixmap()==MSTrue&&pixmap()!=0)
{
if (sensitive()==MSTrue) pixmapH=pixmap()->height();
else pixmapH=insensitivePixma... | false | false | false | false | false | 0 |
ldns_pkt_ixfr_request_new(ldns_rdf *rr_name, ldns_rr_class rr_class,
uint16_t flags, ldns_rr* soa)
{
ldns_rr* authsoa_rr = soa;
if (!authsoa_rr) {
authsoa_rr = ldns_pkt_authsoa(rr_name, rr_class);
}
return ldns_pkt_query_new_internal(rr_name, LDNS_RR_TYPE_IXFR,
rr_class, flags, authsoa_rr);
} | false | false | false | false | false | 0 |
p_stop(struct seq_file *f, void *p)
{
struct aa_profile *profile = p;
struct aa_ns *root = f->private, *ns;
if (profile) {
for (ns = profile->ns; ns && ns != root; ns = ns->parent)
mutex_unlock(&ns->lock);
}
mutex_unlock(&root->lock);
aa_put_ns(root);
} | false | false | false | false | false | 0 |
IoXmlReader_nodeType(IoXmlReader *self, IoObject *locals, IoMessage *m)
{
//printf("\nnodeType begin\n");
ENSURE_OPEN;
int ret = xmlTextReaderNodeType(DATA(self)->reader);
if (ret < 0)
{
printf("ERROR!!!!!!!!\n");
IoState_error_(IOSTATE, m, DATA(self)->error);
}
switch (ret) {
case XML_READER_TYPE_NONE:... | false | false | false | false | false | 0 |
emit_cleared_in_main (const std::string reason)
{
cleared (reason);
} | false | false | false | false | false | 0 |
pixModifyBrightness(PIX *pixd,
PIX *pixs,
l_float32 fract)
{
l_int32 w, h, d, i, j, wpl;
l_int32 rval, gval, bval, hval, sval, vval;
l_uint32 *data, *line;
PROCNAME("pixModifyBrightness");
if (!pixs)
return (PIX *)ERROR_PTR("pixs not defined"... | false | false | false | false | false | 0 |
atoms_copy(int argc, t_atom *from, t_atom *to)
{
int i;
for (i = 0; i < argc; i++)
to[i] = from[i];
} | false | false | false | false | false | 0 |
internalSendMessage( QString msg )
{
appendChar( (uchar) std::min( msg.length(), 250 ) );
/// XXX: we suppose small messages for the moment <= 250
for( int i = 0; i < std::min( msg.length(), 250 ); i++ ) {
appendChar( (uchar) (msg.toLatin1())[i] );
}
send();
} | false | false | false | false | false | 0 |
uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
INIT(FDATASYNC);
req->file = file;
POST;
} | false | false | false | false | false | 0 |
hkl_vector_normalize(HklVector *self)
{
int status = HKL_FAIL;
double norm = hkl_vector_norm2(self);
if ( norm > HKL_EPSILON )
{
hkl_vector_div_double(self, norm);
status = HKL_SUCCESS;
}
return status;
} | false | false | false | false | false | 0 |
inMap( int row, int col )
{
if( row < _height && row >= 0 && col >= 0 && col < _width ) {
return true;
} else {
//logEE("Point not in fight map row %d , col %d , height %d, width %d", row, col , _height, _width);
return false;
}
} | false | false | false | false | false | 0 |
SubstituteAndAppend(
string* output, const char* format,
const SubstituteArg& arg0, const SubstituteArg& arg1,
const SubstituteArg& arg2, const SubstituteArg& arg3,
const SubstituteArg& arg4, const SubstituteArg& arg5,
const SubstituteArg& arg6, const SubstituteArg& arg7,
const SubstituteArg& ar... | false | false | false | false | false | 0 |
sqstd_getfile(HSQUIRRELVM v, SQInteger idx, SQFILE *file)
{
SQFile *fileobj = NULL;
if(SQ_SUCCEEDED(sq_getinstanceup(v,idx,(SQUserPointer*)&fileobj,(SQUserPointer)SQSTD_FILE_TYPE_TAG))) {
*file = fileobj->GetHandle();
return SQ_OK;
}
return sq_throwerror(v,_SC("not a file"));
} | false | false | false | false | false | 0 |
find_data_references(CELL look_for_)
{
look_for = look_for_;
begin_scan();
while((obj = next_object()) != F)
do_slots(UNTAG(obj),find_data_references_step);
/* end scan */
gc_off = false;
} | false | false | false | false | false | 0 |
a3d_read_packet(struct gameport *gameport, int length, char *data)
{
unsigned long flags;
unsigned char u, v;
unsigned int t, s;
int i;
i = 0;
t = gameport_time(gameport, A3D_MAX_START);
s = gameport_time(gameport, A3D_MAX_STROBE);
local_irq_save(flags);
gameport_trigger(gameport);
v = gameport_read(gamepor... | false | false | false | false | false | 0 |
riva_is_connected(struct riva_par *par, Bool second)
{
volatile U032 __iomem *PRAMDAC = par->riva.PRAMDAC0;
U032 reg52C, reg608;
Bool present;
if(second) PRAMDAC += 0x800;
reg52C = NV_RD32(PRAMDAC, 0x052C);
reg608 = NV_RD32(PRAMDAC, 0x0608);
NV_WR32(PRAMDAC, 0x0608, reg608 & ~0x00010000);
NV_WR32(PRAMDAC, 0... | false | false | false | false | false | 0 |
GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
void *scls, const char *option, const char *value)
{
unsigned int *val = scls;
if (1 != SSCANF (value, "%u", val))
{
FPRINTF (stderr, _("You must pass a number to the `%s' option.\n"), option);
return G... | false | false | false | false | false | 0 |
sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
{
/* When we already have some bits in our internal buffer concatenate
both inputs first. */
if (ctx->buflen != 0)
{
size_t left_over = ctx->buflen;
size_t add = 256 - left_over > len ? len : 256 - left_over;
... | false | false | false | false | false | 0 |
listPushSort(List root, void* val, int (*compare)(const void*, const void*))
{
/* compare should return -1 on lesser, 0 on equal and 1 on greater */
List iterator = root;
while (iterator->n && compare(iterator->n->v, val) < 0)
iterator = listNext(iterator);
listAddAfter(root, iterator, val);
} | false | false | false | false | false | 0 |
L6()
{register object *base=vs_base;
register object *sup=base+VM6; VC6
vs_reserve(VM6);
{object V15;
check_arg(1);
V15=(base[0]);
vs_top=sup;
goto TTL;
TTL:;
base[1]= list(3,((object)VV[15]),small_fixnum(0),one_minus((V15)));
vs_top=(vs_base=base+1)+1;
return;
}
} | false | false | false | false | false | 0 |
gst_chroma_hold_start (GstBaseTransform * btrans)
{
GstChromaHold *self = GST_CHROMA_HOLD (btrans);
GST_CHROMA_HOLD_LOCK (self);
gst_chroma_hold_init_params (self);
GST_CHROMA_HOLD_UNLOCK (self);
return TRUE;
} | false | false | false | false | false | 0 |
be_func_init(struct be_adapter *adapter)
{
int status;
status = be_fw_wait_ready(adapter);
if (status)
return status;
if (be_reset_required(adapter)) {
status = be_cmd_reset_function(adapter);
if (status)
return status;
/* Wait for interrupts to quiesce after an FLR */
msleep(100);
/* We can clea... | false | false | false | false | false | 0 |
mic_dma_issue_pending(struct dma_chan *ch)
{
struct mic_dma_chan *mic_ch = to_mic_dma_chan(ch);
spin_lock(&mic_ch->issue_lock);
/*
* Write to head triggers h/w to act on the descriptors.
* On MIC, writing the same head value twice causes
* a h/w error. On second write, h/w assumes we filled
* the entire rin... | false | false | false | false | false | 0 |
__udf_clear_extent_cache(struct inode *inode)
{
struct udf_inode_info *iinfo = UDF_I(inode);
if (iinfo->cached_extent.lstart != -1) {
brelse(iinfo->cached_extent.epos.bh);
iinfo->cached_extent.lstart = -1;
}
} | false | false | false | false | false | 0 |
operator bool() const { // conversion to boolean
switch (type) {
case T_INTEGER:
case T_CHAR:
case T_BYTE:
case T_BOOL:
return integer != 0 ;
case T_REAL:
return real != 0.0 ;
case T_STRING:
return str != NULL || *str != "" ;
case T_VECTOR:
return vec->... | false | false | false | false | false | 0 |
apply(const QImage &image, const QRect& clipRect /*= QRect()*/ ) const
{
QImage out;
QImage::Format fmt = image.format();
Punch(image, &out, clipRect);
if (out.format() != fmt) {
out = out.convertToFormat(fmt);
}
return out;
} | false | false | false | false | false | 0 |
posix_pipe2(PyObject *self, PyObject *arg)
{
int flags;
int fds[2];
int res;
flags = _PyLong_AsInt(arg);
if (flags == -1 && PyErr_Occurred())
return NULL;
res = pipe2(fds, flags);
if (res != 0)
return posix_error();
return Py_BuildValue("(ii)", fds[0], fds[1]);
} | false | false | false | false | false | 0 |
infecthull(struct mesh *m, struct behavior *b)
#else /* not ANSI_DECLARATORS */
void infecthull(m, b)
struct mesh *m;
struct behavior *b;
#endif /* not ANSI_DECLARATORS */
{
struct otri hulltri;
struct otri nexttri;
struct otri starttri;
struct osub hullsubseg;
triangle **deadtriangle;
vertex horg, hdest;
... | false | false | false | false | false | 0 |
free_model (model_t *model)
/*
* Model destructor:
* Free memory allocated by the arithmetic 'model'.
*
* No return value.
*
* Side effects:
* struct 'model' is discarded
*/
{
if (model != NULL)
{
if (model->context != NULL)
fiasco_free (model->context);
fiasco_free (model->totals);
... | false | false | false | false | false | 0 |
parse_envlist(PyObject* env, Py_ssize_t *envc_ptr)
{
char **envlist;
Py_ssize_t i, pos, envc;
PyObject *keys=NULL, *vals=NULL;
PyObject *key, *val, *key2, *val2;
char *p, *k, *v;
size_t len;
i = PyMapping_Size(env);
if (i < 0)
return NULL;
envlist = PyMem_NEW(char *, i + 1);... | false | false | false | false | false | 0 |
vec_stack_o_reserve_1 (void *vec, int reserve, size_t vec_offset,
size_t elt_size, bool exact MEM_STAT_DECL)
{
bool found;
unsigned int ix;
void *newvec;
found = false;
for (ix = VEC_length (void_p, stack_vecs); ix > 0; --ix)
{
if (VEC_index (void_p, stack_vecs, ix - 1) == vec)
{
VEC_u... | false | false | false | false | false | 0 |
string_buffer_append(string_buffer_t *string_buffer, const char *s, int len)
{
if (string_buffer->length + len + 1 > string_buffer->capacity) {
string_buffer->capacity = 2 * string_buffer->capacity;
string_buffer->string = realloc(string_buffer->string, string_buffer->capacity);
if (!string_buffer->string)
... | false | true | false | false | false | 1 |
writeDirectory(Buffer &buffer)
{
int offset = buffer.putInteger(messages.size());
for (MsgMap::iterator i = messages.begin(); i != messages.end(); i++) {
const std::wstring &name = (*i).first;
offset += buffer.putUtf8(name);
offset += buffer.putInteger((*i).second.offset);
}
retu... | false | false | false | false | false | 0 |
nautilus_window_slot_handle_event (NautilusWindowSlot *slot,
GdkEventKey *event)
{
NautilusWindow *window;
gboolean retval;
retval = FALSE;
window = nautilus_window_slot_get_window (slot);
if (slot->details->isearch_enable) {
GdkEvent *new_event;
char *old_text;
const char *new_text;
gboole... | false | false | false | false | false | 0 |
read()
{
// Get the identification header from the Ogg implementation.
// http://tools.ietf.org/html/draft-terriberry-oggopus-01#section-5.1
ByteVector data = d->file->packet(0);
// *Magic Signature*
int pos = 8;
// *Version* (8 bits, unsigned)
d->opusVersion = uchar(data.at(pos));
pos += 1;
// *... | false | false | false | false | false | 0 |
fp_mul(fp_int *A, fp_int *B, fp_int *C)
{
int y, yy;
/* call generic if we're out of range */
if (A->used + B->used > FP_SIZE) {
fp_mul_comba(A, B, C);
return ;
}
y = MAX(A->used, B->used);
yy = MIN(A->used, B->used);
/* pick a comba (unrolled 4/8/16/32 x or rolled) base... | false | false | false | false | false | 0 |
Th_SetResult(Th_Interp *pInterp, const char *z, int n){
/* Free the current result */
Th_Free(pInterp, pInterp->zResult);
pInterp->zResult = 0;
pInterp->nResult = 0;
if( n<0 ){
n = th_strlen(z);
}
if( z && n>0 ){
char *zResult;
zResult = Th_Malloc(pInterp, n+1);
memcpy(zResult, z, n);
... | false | true | false | false | false | 1 |
rootedtonotrooted()
{
node *q, *r, *temp, *newbase;
boolean sumhaslength = false;
double sumlength = 0;
/* Use the leftmost non-tip immediate descendant of the root,
root at that, write a multifurcation with that as the base.
If both descendants are tips, write tree as is. */
root = simplifiedtree.... | false | false | false | false | false | 0 |
read_stipple() {
skip();
String s;
read(s);
read(s);
if (s == "u") {
return nil;
}
if (s == "n") {
return no_stipple;
}
float dither;
s.convert(dither);
for (ListItr(StippleList) i(stipples_); i.more(); i.next()) {
const Stipple* st = i.cur();
if (st->dither_ == di... | false | false | false | false | false | 0 |
rb_econv_asciicompat_encoding(const char *ascii_incompat_name)
{
st_data_t v;
st_table *table2;
struct asciicompat_encoding_t data;
if (!st_lookup(transcoder_table, (st_data_t)ascii_incompat_name, &v))
return NULL;
table2 = (st_table *)v;
/*
* Assumption:
* There is at most o... | false | false | false | false | false | 0 |
ssh_read_control_file (ssh_control_file_t cf,
char *r_hexgrip,
int *r_disabled, int *r_ttl, int *r_confirm)
{
gpg_error_t err;
do
err = read_control_file_item (cf);
while (!err && !cf->item.valid);
if (!err)
{
if (r_hexgrip)
strcpy (r_hexgrip,... | false | false | false | false | false | 0 |
kvp_frame_fail_handler(gpointer data_for_children,
GSList* data_from_children,
GSList* sibling_data,
gpointer parent_data,
gpointer global_data,
gpointer *result,
const gchar *tag)
{... | false | false | false | false | false | 0 |
drmFreeDevices(drmDevicePtr devices[], int count)
{
int i;
if (devices == NULL)
return;
for (i = 0; i < count && devices[i] != NULL; i++)
drmFreeDevice(&devices[i]);
} | false | false | false | false | false | 0 |
setHrZonesFromLT(HrZoneRange &range) {
range.zones.clear();
if (scheme.nzones_default == 0)
initializeZoneParameters();
for (int i = 0; i < scheme.nzones_default; i++) {
int lo = scheme.zone_default_is_pct[i] ? scheme.zone_default[i] * range.lt / 100 : scheme.zone_default[i];
int hi = lo;
... | false | false | false | false | false | 0 |
lock_is_stale(
/** file name of lock file */
const char *const name,
/** quiet flag */
const int quiet)
{
char buf[512];
int fd;
int len;
char *pid;
char *host;
char *tmp;
unsigned long npid;
fd = open(name, O_RDONLY, 0);
if (fd < 0) {
if (errno == ENOENT) {
/* file has ... | true | true | true | false | true | 1 |
split_aff(__isl_keep isl_map *map)
{
int i, n;
struct isl_aff_split *split;
isl_ctx *ctx;
ctx = isl_map_get_ctx(map);
split = isl_calloc_array(ctx, struct isl_aff_split, map->n);
if (!split)
return NULL;
for (i = 0; i < map->n; ++i) {
isl_basic_map *bmap;
split[i].aff = get_aff(isl_basic_map_copy(map->p[... | false | false | false | false | false | 0 |
IS_UpdateVideoPos(GF_Scene *scene)
{
MFURL url;
M_Transform2D *tr;
GF_MediaObject *mo;
u32 w, h, v_w, v_h;
if (!scene->visual_url.OD_ID && !scene->visual_url.url) return;
url.count = 1;
url.vals = &scene->visual_url;
mo = IS_CheckExistingObject(scene, &url, GF_MEDIA_OBJECT_VIDEO);
if (!mo) return;
tr = (M_Tr... | false | false | false | false | false | 0 |
group_key_press (ETableGroup *etg,
gint row,
gint col,
GdkEvent *event,
ETable *et)
{
gboolean return_val = FALSE;
GdkEventKey *key = (GdkEventKey *) event;
gint y, row_local, col_local;
GtkAdjustment *adjustment;
GtkScrollable *scrollable;
gdoub... | false | false | false | false | false | 0 |
val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
String *res;
if (!cmp.compare())
{
null_value=1;
return 0;
}
res=args[0]->val_str(str);
null_value=args[0]->null_value;
return res;
} | false | false | false | false | false | 0 |
iobuf_init(iobuf* io, int fd, unsigned bufsize, char* buffer, unsigned flags)
{
memset(io, 0, sizeof *io);
if (!bufsize) bufsize = iobuf_bufsize;
#ifdef MAP_ANONYMOUS
if (!buffer) {
if ((buffer = mmap(0, bufsize, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)) != MAP_FAILED)
flags |= I... | false | false | false | false | false | 0 |
IdlPyPlatformDefines(PyObject* self, PyObject* args)
{
if (!PyArg_ParseTuple(args, (char*)"")) return 0;
PyObject* l = PyList_New(0);
#ifdef HAS_LongLong
PyList_Append(l, PyString_FromString("-DHAS_LongLong"));
#endif
#ifdef HAS_LongDouble
PyList_Append(l, PyString_FromString("-DHAS_LongDouble"));
#en... | 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.