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 |
|---|---|---|---|---|---|---|
monitor_pixel_set(
struct cpssp *cpssp,
unsigned int x, unsigned int y,
uint8_t r, uint8_t g, uint8_t b
)
{
uint8_t *buffer = &cpssp->pixel_buffer[y * MAX_HEIGHT * 4 + x * 4];
if ( buffer[0] != b
|| buffer[1] != g
|| buffer[2] != r ) {
buffer[0] = b;
buffer[1] = g;
buffer[2] = r;
sig_opt_rgb_p... | false | false | false | false | false | 0 |
afr_sh_data_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *statpre,
struct iatt *statpost, dict_t *xdata)
{
afr_local_t *local = NULL;
afr_private_t *priv = NULL;
int... | false | false | false | false | false | 0 |
speedX() {
if ( (_speedX > 0) &&
(_x < (_team->xmax() - _frames->width())) )
return(_speedX);
if ( (_speedX < 0) &&
(_x > _team->xmin()) )
return(_speedX);
return(0);
} | false | false | false | false | false | 0 |
count_subboxes( pix *pp ){
int ii=0, num_mini=0, num_same=0, cnt=0;
struct box *box2,*box4;
progress_counter_t *pc = NULL;
if (JOB->cfg.verbose) { fprintf(stderr,"# count subboxes\n# ..."); }
pc = open_progress(JOB->res.boxlist.n,"count_subboxes");
for_each_data(&(JOB->res.boxlist)) {
box2 = (struct ... | false | false | false | false | false | 0 |
setT2Resend(int32_t counter) {
if (counter < 0 || counter > 10)
stateEngine->setT2Resend(counter);
} | false | false | false | false | false | 0 |
ff_celp_lp_synthesis_filterf(
float *out,
const float* filter_coeffs,
const float* in,
int buffer_length,
int filter_length)
{
int i,n;
// These two lines are to avoid a -1 subtraction in the main loop
filter_length++;
filter_coeffs--;
for(n=0; n<buffer_leng... | false | false | false | false | false | 0 |
correct(std::vector<unsigned int> const& ideg, int loop, double eps,
std::vector<vnl_rnpoly_solve_cmplx> const& pdg,
std::vector<vnl_rnpoly_solve_cmplx> const& qdg,
double t,
std::vector<vnl_rnpoly_solve_cmplx>& x,
std::vecto... | false | false | false | false | false | 0 |
nouveau_page_flip_emit(struct nouveau_channel *chan,
struct nouveau_bo *old_bo,
struct nouveau_bo *new_bo,
struct nouveau_page_flip_state *s,
struct nouveau_fence **pfence)
{
struct nouveau_fence_chan *fctx = chan->fence;
struct nouveau_drm *drm = chan->drm;
struct drm_device *dev... | false | false | false | false | false | 0 |
usb_shutdown(void)
{
usbmuxd_log(LL_DEBUG, "usb_shutdown");
FOREACH(struct usb_device *usbdev, &device_list) {
device_remove(usbdev);
usb_disconnect(usbdev);
} ENDFOREACH
collection_free(&device_list);
libusb_exit(NULL);
} | false | false | false | false | false | 0 |
dump_index(bgav_stream_t * s)
{
int i;
gavl_timecode_t tc;
if(s->type == BGAV_STREAM_VIDEO)
{
for(i = 0; i < s->file_index->num_entries; i++)
{
bgav_dprintf(" K: %d, P: %"PRId64", T: %"PRId64" CT: %c ",
!!(s->file_index->entries[i].flags & PACKET_FLAG_KEY),
... | false | false | false | false | false | 0 |
RTreeReInsert(RTree_t * rtp, Node_t * n, struct ListNode **ee)
{
register struct ListNode *l;
if (!(l = RTreeNewListNode()))
return -1;
l->node = n;
l->next = *ee;
*ee = l;
return 0;
} | false | false | false | false | false | 0 |
authBasicInit(authScheme * scheme)
{
static int init = 0;
if (basicConfig->authenticate) {
if (!basic_data_pool)
basic_data_pool = memPoolCreate("Basic Scheme User Data", sizeof(basic_data));
authbasic_initialised = 1;
if (basicauthenticators == NULL)
basicauthenticators = helperCreate("basicauthen... | false | false | false | false | false | 0 |
add_range (GstQueue2 * queue, guint64 offset, gboolean update_existing)
{
GstQueue2Range *range, *prev, *next;
GST_DEBUG_OBJECT (queue, "find range for %" G_GUINT64_FORMAT, offset);
if ((range = find_range (queue, offset))) {
GST_DEBUG_OBJECT (queue,
"reusing range %" G_GUINT64_FORMAT "-%" G_GUINT64... | false | false | false | false | false | 0 |
VasyDriveSynopsysPort( RtlFigure )
rtlfig_list *RtlFigure;
{
rtldecl_list *RtlDeclar;
vexexpr *VexPort;
char *PortName;
char *PortDir;
char *PortBase;
char *PortVecDir;
RtlDeclar = RtlFigure->DECLAR[ RTL_DECLAR_PORT ];
if ( RtlDeclar != (rtldecl_list *)0 )
{
... | false | false | false | false | false | 0 |
streamClose(int streamID)
{
int index;
int vlistID;
stream_t *streamptr;
streamptr = stream_to_pointer(streamID);
stream_check_ptr(__func__, streamptr);
if ( CDI_Debug )
Message("streamID = %d filename = %s", streamID, streamptr->filename);
vlistID = streamptr->vlistID;
void (*streamCloseDeleg... | false | false | false | false | false | 0 |
addOrRemoveBlockFromTOC(fl_BlockLayout * pBlock)
{
UT_sint32 count = getNumTOCs();
if(count == 0)
{
return false;
}
UT_UTF8String sStyle;
pBlock->getStyle(sStyle);
UT_sint32 i = 0;
UT_sint32 inTOC = count;
UT_sint32 _addTOC = 0;
for(i=0; i<count; i++)
{
fl_TOCLayout * pTOC = getNthTOC(i);
if(pTOC->isB... | false | false | false | false | false | 0 |
inmd_switch_popup_handler (GtkWidget *widget, GdkEvent *event)
{
if (!menu)
create_inmd_switch();
GdkEventButton *event_button;
if (event->type == GDK_BUTTON_PRESS) {
event_button = (GdkEventButton *) event;
gtk_menu_popup (GTK_MENU(menu), NULL, NULL, NULL, NULL,
event_button->bu... | false | false | false | false | false | 0 |
ungetc_unlocked(int c, FILE *stream) {
if (stream->ungotten || c<0 || c>255)
return EOF;
/* GNU configure configure wants us to differentiate between an ungetc
* of the byte that was actually there ("backup ungetc") and a
* different byte. Sigh. */
if (stream->bm && stream->buf[stream->bm-1]==c) {
-... | false | false | false | false | false | 0 |
eel_set_integer(const char *name, int value)
{
eel_symbol_t *sym = eel_s_get(name, EST_VARIABLE);
if(!sym)
return NULL;
eel_d_freestring(&sym->data);
sym->data.type = EDT_INTEGER;
sym->data.value.i = value;
return sym;
} | false | false | false | false | false | 0 |
stop_t200(struct PStack *st, int i)
{
if (test_and_clear_bit(FLG_T200_RUN, &st->l2.flag))
FsmDelTimer(&st->l2.t200, i);
} | false | false | false | false | false | 0 |
SetSizes(BoxPtr box, Position x, Position y)
{
BoxPtr child;
int width, height;
int bw;
Widget w;
SubInfoPtr info;
switch (box->type) {
case VariableBox: /* ??? */
break;
case WidgetBox:
w = box->u.widget.widget;
if (w)
{
info = (SubInfoPtr) w->core.constraints;
widt... | false | false | false | false | false | 0 |
mp_sqr (mp_int * a, mp_int * b)
{
int res;
#ifdef BN_MP_TOOM_SQR_C
/* use Toom-Cook? */
if (a->used >= TOOM_SQR_CUTOFF) {
res = mp_toom_sqr(a, b);
/* Karatsuba? */
} else
#endif
#ifdef BN_MP_KARATSUBA_SQR_C
if (a->used >= KARATSUBA_SQR_CUTOFF) {
res = mp_karatsuba_sqr (a, b);
} else
#endif
{
... | false | false | false | false | false | 0 |
kfd_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct kfd_process *process;
process = kfd_get_process(current);
if (IS_ERR(process))
return PTR_ERR(process);
if ((vma->vm_pgoff & KFD_MMAP_DOORBELL_MASK) ==
KFD_MMAP_DOORBELL_MASK) {
vma->vm_pgoff = vma->vm_pgoff ^ KFD_MMAP_DOORBELL_MASK;
return... | false | false | false | false | false | 0 |
gt_ltr_refseq_match_stream_next(GtNodeStream *ns, GtGenomeNode **gn,
GtError *err)
{
GtLTRRefseqMatchStream *rms;
GtGenomeNode *ref_gn;
int had_err = 0;
unsigned long n_to_check = 0;
gt_error_check(err);
rms = gt_ltr_refseq_match_stream_cast(ns);
if (rms->first_... | false | false | false | false | false | 0 |
hwloc_bitmap_alloc_full(void)
{
struct hwloc_bitmap_s * set = hwloc_bitmap_alloc();
if (set) {
set->infinite = 1;
set->ulongs[0] = HWLOC_SUBBITMAP_FULL;
}
return set;
} | false | false | false | false | false | 0 |
scopecmp (const void *p1, const void *p2)
{
const struct scopeentry *e1 = (const struct scopeentry *) p1;
const struct scopeentry *e2 = (const struct scopeentry *) p2;
if (e1->netmask > e2->netmask)
return -1;
if (e1->netmask == e2->netmask)
return 0;
return 1;
} | false | false | false | false | false | 0 |
show_results(){
int userpos=0; /* position of user found, 0 => not found */
printf("\nfound: %2d\n\n",userfill);
printf(" Username UserID Terminal idle Starttime BanningEnd WarningEnd\n");
for (userpos=1; userpos<=userfill; userpos++){
printf(" --> %-10s %4d %-10s %5d %10d %10d %10d... | false | false | false | false | false | 0 |
__sizchg_widen(register struct xstk_t *xsp, int32 nblen)
{
register int32 wi;
register word32 *wpna, *wpnb, *wpob;
int32 nwlen, nubits, stkwlen, xtrabits;
/* case 1: widening */
if (nblen <= WBITS) { xsp->xslen = nblen; return; }
nwlen = wlen_(nblen);
/* case 2: multiword but into same number of words - does no... | false | false | false | false | false | 0 |
print_block(int ident, Block* b) {
if(!b) { fprintf(outfile, ";\n"); return; }
print_ident(ident);
fprintf(outfile, "{\n");
print_declrlist(ident + 2, b->declrs);
print_commlist(ident + 2, b->comms);
print_ident(ident);
fprintf(outfile, "}\n");
} | false | false | false | false | false | 0 |
pca953x_irq_setup(struct pca953x_chip *chip,
int irq_base)
{
struct i2c_client *client = chip->client;
int ret, i, offset = 0;
if (client->irq && irq_base != -1
&& (chip->driver_data & PCA_INT)) {
switch (chip->chip_type) {
case PCA953X_TYPE:
offset = PCA953X_INPUT;
break;
case PCA957X_TYPE:... | false | false | false | false | false | 0 |
dht_layout_dir_mismatch (xlator_t *this, dht_layout_t *layout, xlator_t *subvol,
loc_t *loc, dict_t *xattr)
{
int idx = 0;
int pos = -1;
int ret = 0;
int err = 0;
int dict_ret = 0;
int32_t disk_layout[4];
vo... | false | true | false | false | false | 1 |
push_transform(
Canvas* c, const Allocation& a, const Allocation& natural
) const {
Transformer t(transformer_);
transform(t, a, natural);
c->push_transform();
c->transform(t);
} | false | false | false | false | false | 0 |
STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint32_t *block_size) {
if (disk_ioctl(0, GET_SECTOR_COUNT, block_num) != 0) {
return (-1);
}
if (disk_ioctl(0, GET_SECTOR_SIZE, block_size) != 0) {
return (-1);
}
return (0);
} | false | false | false | false | false | 0 |
ath5k_debug_init_device(struct ath5k_hw *ah)
{
struct dentry *phydir;
ah->debug.level = ath5k_debug;
phydir = debugfs_create_dir("ath5k", ah->hw->wiphy->debugfsdir);
if (!phydir)
return;
debugfs_create_file("debug", S_IWUSR | S_IRUSR, phydir, ah,
&fops_debug);
debugfs_create_file("registers", S_IRUSR... | false | false | false | false | false | 0 |
SeenDefineFuncArgComment(void)
{
char* comment=GetCurrentComment();
#if DEBUG
printf("#Preproc.c# #define Function arg comment '%s' in %s()\n",comment,cur_def->name);
#endif
if(!cur_def->args->s2[cur_def->args->n-1])
cur_def->args->s2[cur_def->args->n-1]=MallocString(comment);
} | false | false | false | false | false | 0 |
FatalException(TryCatch &try_catch) {
HandleScope scope;
// Check if uncaught_exception_counter indicates a recursion
if (uncaught_exception_counter > 0) {
ReportException(try_catch, true);
exit(1);
}
if (listeners_symbol.IsEmpty()) {
listeners_symbol = NODE_PSYMBOL("listeners");
uncaught_ex... | false | false | false | false | false | 0 |
ns_interface_accepttcp(ns_interface_t *ifp) {
isc_result_t result;
/*
* Open a TCP socket.
*/
result = isc_socket_create(ifp->mgr->socketmgr,
isc_sockaddr_pf(&ifp->addr),
isc_sockettype_tcp,
&ifp->tcpsocket);
if (result != ISC_R_SUCCESS) {
isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_ERRO... | false | false | false | false | false | 0 |
device_wakeup_detach_irq(struct device *dev)
{
struct wakeup_source *ws;
ws = dev->power.wakeup;
if (ws)
ws->wakeirq = NULL;
} | false | false | false | false | false | 0 |
get_dyndns_system_handler(CMD_DATA *p_cmd, int current_nr, void *p_context)
{
DYNDNS_SYSTEM *p_dns_system = NULL;
DYN_DNS_CLIENT *p_self = (DYN_DNS_CLIENT *)p_context;
DYNDNS_SYSTEM_INFO *it;
if (p_self == NULL)
return RC_INVALID_POINTER;
it = get_dyndns_system_table();
for (; it != NULL && it->id != LAST_DNS... | false | false | false | false | true | 1 |
charIsValid9660(char theChar)
{
if( (theChar >= '0' && theChar <= '9') ||
(theChar >= 'a' && theChar <= 'z') ||
(theChar >= 'A' && theChar <= 'Z') ||
strchr("._-$~", theChar) )
{
return true;
}
else
return false;
} | false | false | false | false | false | 0 |
stop_feed(struct dvb_demux_feed *dvbdmxfeed)
{
struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
struct ddb_input *input = dvbdmx->priv;
if (--input->users)
return input->users;
ddb_input_stop(input);
return 0;
} | false | false | false | false | false | 0 |
ParseResources(ILuint ResourceSize, ILubyte *Resources)
{
ILushort ID;
ILubyte NameLen;
ILuint Size;
if (Resources == NULL) {
ilSetError(IL_INTERNAL_ERROR);
return IL_FALSE;
}
while (ResourceSize > 13) { // Absolutely has to be larger than this.
if (strncmp("8BIM", (const char*)Resources, 4)) {
//re... | false | true | false | false | false | 1 |
kempld_wdt_update_timeouts(struct kempld_wdt_data *wdt_data)
{
struct kempld_device_data *pld = wdt_data->pld;
struct kempld_wdt_stage *pretimeout_stage;
struct kempld_wdt_stage *timeout_stage;
unsigned int pretimeout, timeout;
pretimeout_stage = &wdt_data->stage[STAGE_PRETIMEOUT];
timeout_stage = &wdt_data->sta... | false | false | false | false | false | 0 |
handle_fasteoi_irq(struct irq_desc *desc)
{
struct irq_chip *chip = desc->irq_data.chip;
raw_spin_lock(&desc->lock);
if (!irq_may_run(desc))
goto out;
desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
kstat_incr_irqs_this_cpu(desc);
/*
* If its disabled or no action available
* then mask it and get out of ... | false | false | false | false | false | 0 |
clientdbCutoffDenied(struct in_addr addr)
{
const char *key;
int NR;
int ND;
double p;
ClientInfo *c;
if (!Config.onoff.client_db)
return 0;
key = xinet_ntoa(addr);
c = (ClientInfo *) hash_lookup(client_table, key);
if (c == NULL)
return 0;
/*
* If we are in a cutoff windo... | false | false | false | false | false | 0 |
matindices(MATRIX *mp, long index)
{
LIST *lp;
int j;
long d;
VALUE val;
if (index < 0 || index >= mp->m_size)
return NULL;
lp = listalloc();
val.v_type = V_NUM;
j = mp->m_dim;
while (--j >= 0) {
d = mp->m_max[j] - mp->m_min[j] + 1;
val.v_num = itoq(index % d + mp->m_min[j]);
insertlistfirst(lp, &va... | false | false | false | false | false | 0 |
egg_editable_toolbar_set_model (EggEditableToolbar *toolbar,
EggToolbarsModel *model)
{
g_return_if_fail (EGG_IS_TOOLBARS_MODEL (model));
g_return_if_fail (EGG_IS_EDITABLE_TOOLBAR (toolbar));
g_return_if_fail (toolbar->priv->manager);
if (toolbar->priv->model == model) return;
if (toolbar->priv->model... | false | false | false | false | false | 0 |
get_search_context (GeditViewFrame *frame)
{
GeditDocument *doc;
GtkSourceSearchContext *search_context;
GtkSourceSearchSettings *search_settings;
doc = gedit_view_frame_get_document (frame);
search_context = _gedit_document_get_search_context (doc);
if (search_context == NULL)
{
return NULL;
}
search_set... | false | false | false | false | false | 0 |
ceph_fill_file_size(struct inode *inode, int issued,
u32 truncate_seq, u64 truncate_size, u64 size)
{
struct ceph_inode_info *ci = ceph_inode(inode);
int queue_trunc = 0;
if (ceph_seq_cmp(truncate_seq, ci->i_truncate_seq) > 0 ||
(truncate_seq == ci->i_truncate_seq && size > inode->i_size)) {
dout("size %l... | false | false | false | false | false | 0 |
gst_aiff_mux_write_comm_header (GstAiffMux * aiffmux, guint32 audio_data_size,
GstByteWriter * writer)
{
gst_byte_writer_put_uint32_le (writer, GST_MAKE_FOURCC ('C', 'O', 'M', 'M'));
gst_byte_writer_put_uint32_be (writer, 18);
gst_byte_writer_put_uint16_be (writer, aiffmux->channels);
/* numSampleFrames val... | false | false | false | false | false | 0 |
airCRC32(const unsigned char *cdata, size_t len, size_t unit, int swap) {
unsigned int crc=0;
size_t ii, jj, nn, mm;
const unsigned char *crev;
if (!(cdata && len)) {
return 0;
}
if (swap) {
/* if doing swapping, we need make sure we have a unit size,
and that it divides into len */
if (... | false | false | false | false | false | 0 |
evd_tls_session_get_direction (EvdTlsSession *self)
{
g_return_val_if_fail (EVD_IS_TLS_SESSION (self), 0);
if (self->priv->session == NULL)
return 0;
else
if (gnutls_record_get_direction (self->priv->session) == 0)
return G_IO_IN;
else
return G_IO_OUT;
} | false | false | false | false | false | 0 |
function(DCEparsestate* state, Object fcnname, Object args)
{
DCEfcn* fcn = (DCEfcn*)dcecreate(CES_FCN);
fcn->name = nulldup((char*)fcnname);
fcn->args = args;
return fcn;
} | false | false | false | false | false | 0 |
reserve(int bytes)
{
totalSize += bytes;
char *ptr;
if (tail + bytes <= buffers.last().size()) {
ptr = buffers.last().data() + tail;
tail += bytes;
} else {
buffers.last().resize(tail);
QByteArray tmp;
tmp.resize(qMax(CHUNK... | false | false | false | false | false | 0 |
highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC)
{
zend_lex_state original_lex_state;
zval tmp = *str;
str = &tmp;
zval_copy_ctor(str);
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==... | false | false | false | false | false | 0 |
logspace_sub (double logx, double logy)
{
return logx + R_Log1_Exp(logy - logx);
} | false | false | false | false | false | 0 |
setup_book (EBookClient *book_client)
{
if (!add_contact_from_test_case_verify (book_client, "simple-1", NULL) ||
!add_contact_from_test_case_verify (book_client, "simple-2", NULL) ||
!add_contact_from_test_case_verify (book_client, "name-only", NULL)) {
g_error ("Failed to add contacts");
}
} | false | false | false | false | false | 0 |
generateWRTbl(Tree sig, Tree tbl, Tree idx, Tree data)
{
string tblName(CS(tbl));
fClass->addExecCode(subst("$0[$1] = $2;", tblName, CS(idx), CS(data)));
return tblName;
} | false | false | false | false | false | 0 |
makebmp(const char *step, const char *tempd, int w, int h, void *data) {
unsigned int tmp1, tmp2, tmp3, tmp4, y;
char *fname;
FILE *f;
if(!tempd) return;
if(!(fname = cli_gentemp(tempd))) return;
if(!(f = fopen(fname, "wb"))) {
cli_unlink(fname);
cli_dbgmsg("makebmp: failed to create file %s\... | false | false | false | false | false | 0 |
test_sum (mpfr_prec_t f, unsigned long n)
{
mpfr_t sum, real_sum, real_non_rounded;
mpfr_t *tab;
unsigned long i;
int rnd_mode;
/* Init */
tab = (mpfr_t *) (*__gmp_allocate_func) (n * sizeof(mpfr_t));
for (i = 0; i < n; i++)
mpfr_init2 (tab[i], f);
mpfr_inits2 (f, sum, real_sum, real_non_rounded, (... | false | false | false | false | false | 0 |
dumpCurrentSet() const {
if (!pd_handlers_sorted) ((orbOptions*)this)->sortHandlers();
sequenceString_var result(new sequenceString());
omnivector<orbOptions::Handler*>::const_iterator i = pd_handlers.begin();
omnivector<orbOptions::Handler*>::const_iterator last = pd_handlers.end();
for (; i != last; i++... | false | false | false | false | false | 0 |
gst_object_control_properties (GObject * object, ...)
{
GstController *ctrl;
va_list var_args;
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
va_start (var_args, object);
ctrl = gst_controller_new_valist (object, var_args);
va_end (var_args);
return (ctrl);
} | false | false | false | false | false | 0 |
AcpiDbExecuteTest (
char *TypeArg)
{
UINT32 Temp;
AcpiUtStrupr (TypeArg);
Temp = AcpiDbMatchArgument (TypeArg, AcpiDbTestTypes);
if (Temp == ACPI_TYPE_NOT_FOUND)
{
AcpiOsPrintf ("Invalid or unsupported argument\n");
return;
}
switch ... | false | false | false | false | false | 0 |
bignum_divide(bignum* numerator, bignum* denominator,
bignum** quotient, bignum** remainder) {
if (BIGNUM_ZERO_P(denominator)) {
divide_by_zero_error();
return;
}
if (BIGNUM_ZERO_P(numerator)) {
(*quotient) = numerator;
(*remainder) = numerator;
} else {
int r_n... | false | false | false | false | false | 0 |
ezxml_str2utf8(char **s, size_t *len)
{
char *u;
size_t l = 0, sl, max = *len;
long c, d;
int b, be = (**s == '\xFE') ? 1 : (**s == '\xFF') ? 0 : -1;
if (be == -1) return NULL; // not UTF-16
u = malloc(max);
for (sl = 2; sl < *len - 1; sl += 2) {
c = (be) ? (((*s)[sl] & 0xFF) << 8)... | false | false | false | false | false | 0 |
calc_waypoint_instance(int waypoint_list_index, int waypoint_index)
{
Assert(waypoint_list_index >= 0);
Assert(waypoint_index >= 0);
return waypoint_list_index * 0x10000 + waypoint_index;
} | false | false | false | false | false | 0 |
trim (char **dest, const char *str)
{
/* remove the leading and trailing "'" from str
and store the result in dest */
const char *end = strrchr (str, '\'');
size_t len = LT_STRLEN (str);
char *tmp;
FREE (*dest);
if (!end)
return 1;
if (len > 3 && str[0] == '\'')
{
tmp = MALLOC ... | false | true | false | false | false | 1 |
lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd,
loff_t pos, bool rw)
{
struct iov_iter iter;
struct bio_vec *bvec;
struct bio *bio = cmd->rq->bio;
struct file *file = lo->lo_backing_file;
int ret;
/* nomerge for loop request queue */
WARN_ON(cmd->rq->bio != cmd->rq->biotail);
bvec = __bvec_iter... | false | false | false | false | false | 0 |
write(ostream & os) const
{
// Maybe the paragraph has special spacing
spacing().writeFile(os, true);
// The labelwidth string used in lists.
if (!labelWidthString().empty())
os << "\\labelwidthstring "
<< to_utf8(labelWidthString()) << '\n';
// Start of appendix?
if (startOfAppendix())
os << "\\start_... | false | false | false | false | false | 0 |
diagpkt_write(struct file *fp, const char __user *data,
size_t count, loff_t *off)
{
struct hfi1_devdata *dd;
struct send_context *sc;
u8 vl;
struct diag_pkt dp;
if (count != sizeof(dp))
return -EINVAL;
if (copy_from_user(&dp, data, sizeof(dp)))
return -EFAULT;
/*
* The Send Context is derived from... | false | false | false | false | false | 0 |
evas_key_grab_find(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive)
{
/* MEM OK */
Eina_List *l;
Evas_Key_Grab *g;
EINA_LIST_FOREACH(obj->layer->evas->grabs, l, g)
{
if ((g->modifiers == modifiers) &&
(g->no... | false | false | false | false | false | 0 |
s_font_prelight(GtkComboBox * combo, const gchar *text, _wd * wd)
{
GtkWidget *widget;
gint x;
gint y;
if (wd &&
wd->m_pUnixToolbar &&
!wd->m_pUnixToolbar->m_pFontPreview) {
widget = GTK_WIDGET(combo);
GtkAllocation alloc;
gtk_widget_get_allocation(widget, &alloc);
gdk_window_get_or... | false | false | false | false | false | 0 |
free_ifi_info(struct ifi_info *ifihead)
{
struct ifi_info *ifi, *ifinext;
for (ifi = ifihead; ifi != NULL; ifi = ifinext) {
if (ifi->ifi_addr != NULL)
free(ifi->ifi_addr);
if (ifi->ifi_brdaddr != NULL)
free(ifi->ifi_brdaddr);
if (ifi->ifi_dstaddr != NULL)
free(ifi->ifi_dstaddr);
ifinext = ifi->ifi_n... | false | false | false | false | false | 0 |
getch()
{
t_CKINT c;
if( empty() ) return 0;
m_buffer->get( &c, 1, m_read_index );
return c;
} | false | false | false | false | false | 0 |
cb_expr_shift_sign (const int op)
{
int have_not = 0;
if (TOKEN (-1) == '!') {
have_not = 1;
expr_index--;
}
expr_reduce ('=');
if (TOKEN (-1) == 'x') {
VALUE (-1) = cb_build_binary_op (VALUE (-1), op, cb_zero);
if (have_not) {
VALUE (-1) = cb_build_negation (VALUE (-1));
}
}
} | false | false | false | false | false | 0 |
writeToStream(mrpt::utils::CStream &out, int *out_Version) const
{
if (out_Version)
*out_Version = 0;
else
{
out << (uint32_t)sizeof(m_Val[0][0]);
// First, write the number of rows and columns:
out << (uint32_t)m_Rows << (uint32_t)m_Cols;
if (m_Rows>0 && m_Cols>0)
for (unsigned int i=0;i<m_Rows;i++)
... | false | false | false | false | false | 0 |
cm_optimized_Free(CM_OPTIMIZED *ocm)
{
int v = 0;
if (ocm->tsc[0] != NULL) free(ocm->tsc[0]);
while (ocm->oesc[v] == NULL && v < ocm->M) { v++; }
if (ocm->oesc[v] != NULL) free(ocm->oesc[v]);
if (ocm->endsc != NULL) free(ocm->endsc);
if (ocm->beginsc != NULL) free(ocm->beginsc);
if (ocm->oesc != NULL) f... | false | false | false | false | false | 0 |
send(const A &msg_)
{
ipcWarn(wrnlvl(),"%t pString_Connection::send\n");
if(isInReset()||readChannel()==0) return -1;
if(Ct!=msg_->t) return -1;
MSBuffer *sb=new MSBuffer(msg_->n+sizeof(int));
if(NULL==sb) return -1;
int msgLen=htonl((int)msg_->n);
sb->stuff((char *)(&msgLen),sizeof(int));
sb->stuff((c... | false | false | false | false | false | 0 |
e100_init_module(void)
{
if (((1 << debug) - 1) & NETIF_MSG_DRV) {
pr_info("%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
pr_info("%s\n", DRV_COPYRIGHT);
}
return pci_register_driver(&e100_driver);
} | false | false | false | false | false | 0 |
switches(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; i++) {
char *argument = argv[i];
if (argument[0] == '-') {
switch (toLower(argument[1]))
{
case 'i':
ignoreErrorOption = TRUE;
break;
... | false | false | false | false | false | 0 |
L13()
{register object *base=vs_base;
register object *sup=base+VM13; VC13
vs_check;
{object V21;
object V22;
V21=(base[0]);
V22=(base[1]);
vs_top=sup;
goto TTL;
TTL:;
(void)(sputprop((V21),((object)VV[33]),(V22)));
base[2]= (V21);
base[3]= small_fixnum(450);
if(!(((V22))==(((object)VV[34])))){
goto T56;}
... | false | false | false | false | false | 0 |
JS_ArenaGrow(JSArenaPool *pool, void *p, size_t size, size_t incr)
{
void *newp;
/*
* If p points to an oversized allocation, it owns an entire arena, so we
* can simply realloc the arena.
*/
if (size > pool->arenasize)
return JS_ArenaRealloc(pool, p, size, incr);
JS_ARENA_ALLOC... | false | false | false | false | false | 0 |
efi_find_mirror(void)
{
void *p;
u64 mirror_size = 0, total_size = 0;
for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
efi_memory_desc_t *md = p;
unsigned long long start = md->phys_addr;
unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
total_size += size;
if (md->attribute & E... | false | false | false | false | false | 0 |
imapx_store_notify (GObject *object,
GParamSpec *pspec)
{
if (g_str_equal (pspec->name, "settings")) {
imapx_store_connect_to_settings (CAMEL_STORE (object));
imapx_store_update_store_flags (CAMEL_STORE (object));
}
/* Do not chain up. None of our ancestor classes implement the
* notify()... | false | false | false | false | false | 0 |
provider_resolv_host_addr(struct vpn_provider *provider)
{
if (provider->host == NULL)
return;
if (connman_inet_check_ipaddress(provider->host) > 0)
return;
if (provider->host_ip != NULL)
return;
/*
* If the hostname is not numeric, try to resolv it. We do not wait
* the result as it might take some ti... | false | false | false | false | false | 0 |
session_ipc_create(struct iscsi_session *session)
{
struct iscsi_conn *conn = &session->conn[0];
int err = 0, pass_ep = 1;
uint32_t host_no = -1;
if (session->t->template->ep_connect != ktransport_ep_connect)
pass_ep = 0;
retry_create:
err = ipc->create_session(session->t->handle,
pass_ep ? conn->transpor... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__com__Container_TakeOut(struct __ecereNameSpace__ecere__com__Instance * this, uint64 d)
{
struct __ecereNameSpace__ecere__com__IteratorPointer * i = ((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, uint64 value))this->_vT... | false | false | false | false | false | 0 |
http_get_path(struct http_txn *txn)
{
char *ptr, *end;
ptr = txn->req.chn->buf->p + txn->req.sl.rq.u;
end = ptr + txn->req.sl.rq.u_l;
if (ptr >= end)
return NULL;
/* RFC2616, par. 5.1.2 :
* Request-URI = "*" | absuri | abspath | authority
*/
if (*ptr == '*')
return NULL;
if (isalpha((unsigned char)*... | false | false | false | false | false | 0 |
fttlv_enc_uint8(void *buf, int buf_size, int flip, u_int16 t, u_int8 v)
{
u_int16 len;
if (buf_size < 5)
return -1;
len = 1;
if (flip) {
SWAPINT16(t);
SWAPINT16(len);
}
bcopy(&t, buf, 2);
buf = (char*)buf + 2;
bcopy(&len, buf, 2);
buf = (char*)buf + 2;
bcopy(&v, buf, 1);
retur... | false | true | false | false | false | 1 |
go_path_arc_full (PathParseState *state, double x1, double y1, double x2, double y2,
double x3, double y3, double x4, double y4)
{
double cx, cy, rx, ry, th0, th1;
cx = (x1 + x2) / 2.;
cy = (y1 + y2) / 2;
rx = MAX (x1, x2) - cx;
ry = MAX (y1, y2) - cy;
th0 = atan2 ((y3 - cy) / ry, (x3 - cx) /... | false | false | false | false | false | 0 |
begin_verification_conversation (GdmSession *self,
GDBusMethodInvocation *invocation,
const char *service_name)
{
GdmSessionConversation *conversation;
gdm_session_start_conversation (self, service_name);
c... | false | false | false | false | false | 0 |
SetBitOff(unsigned bit_offset)
{
unsigned word_offset = bit_offset >> WORDROLL;
bit_offset &= WORDMASK;
if (word_offset < GetSize())
_set[word_offset] &= (~(1 << bit_offset));
} | false | false | false | false | false | 0 |
check_constraint_len (void)
{
const char *p;
int d;
for (p = ",#*+=&%!1234567890"; *p; p++)
for (d = -9; d < 9; d++)
if (constraint_len (p, d) != d)
abort ();
} | false | false | false | false | false | 0 |
bc_get_ret_index(const unsigned char *code)
{
if (*code == OPC_WIDE)
return read_u16(code + 2);
return read_u8(code + 1);
} | false | false | false | false | false | 0 |
init(GtkWidget *widget)
{
GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);
GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget);
if(!GTK_IS_WIDGET(widget)) return TRUE;
if(!GTK_WIDGET_REALIZED(widget)) return TRUE;
if (gdk_gl_drawable_gl_begin (gldrawable, glcontext))
{
glViewport(0,0... | false | false | false | false | false | 0 |
list_apply( ListNode *list, void (*f)(void *) )
#else
list_apply( list, f )
ListNode *list;
void (*f)();
#endif
{
ListNode *p;
require(f!=NULL, "list_apply: NULL function to apply");
if ( list == NULL ) return;
for (p = list->next; p!=NULL; p=p->next) (*f)( p->elem );
} | false | false | false | true | false | 1 |
hwloc_topology_diff_load_xmlbuffer(hwloc_topology_t topology __hwloc_attribute_unused,
const char *xmlbuffer, int buflen,
hwloc_topology_diff_t *firstdiffp, char **refnamep)
{
hwloc_localeswitch_declare;
char *env;
int force_nolibxml;
int ret;
if (!hwloc_libxml_callbacks && !hwloc_nolibxml_call... | false | false | false | false | true | 1 |
is_duplicate(int hp, double ra, double dec, int Nside,
intmap_t* starlists,
double* ras, double* decs, double dedupr2) {
double xyz[3];
int neigh[9];
int nn;
double xyz2[3];
int j, k;
radecdeg2xyzarr(ra, dec, xyz);
// Check this healpix...
neigh[0] = hp;
// Check neighbouring healpixes... (+1 is ... | false | false | false | false | false | 0 |
hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c)
{
if (c->buffer->flags & HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES)
return;
hb_codepoint_t space;
enum {
SPACE_DONT_KNOW,
SPACE_AVAILABLE,
SPACE_UNAVAILABLE
} space_status = SPACE_DONT_KNOW;
unsigned int count = c->buffer->len;
hb_g... | false | false | false | false | false | 0 |
filedsn_test_clicked (GtkWidget *widget, TDSNCHOOSER *choose_t)
{
char dsn[1024];
char connstr[4096] = { 0 };
gchar *filedsn;
if (!choose_t)
return;
/* Retrieve filedsn file name */
filedsn = gtk_entry_get_text (GTK_ENTRY (choose_t->file_entry));
filedsn_get_dsn (filedsn, dsn, sizeof (dsn));
/* C... | 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.