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 |
|---|---|---|---|---|---|---|
dyn_array_ensure_capacity (DynArray *da, int capacity, int elem_size)
{
int old_capacity = da->capacity;
char *new_data;
if (capacity <= old_capacity)
return;
if (da->capacity == 0)
da->capacity = 2;
while (capacity > da->capacity)
da->capacity *= 2;
new_data = (char *)sgen_alloc_internal_dynamic (elem_s... | false | false | false | false | false | 0 |
skip_via_lseek (char const *filename, int fdesc, off_t offset, int whence)
{
struct mtget s1;
struct mtget s2;
bool got_original_tape_position = (ioctl (fdesc, MTIOCGET, &s1) == 0);
/* known bad device type */
/* && s.mt_type == MT_ISSCSI2 */
off_t new_position = lseek (fdesc, offset, whence);
if (0 <= n... | false | false | false | false | false | 0 |
InsertPgAttributeTuple(Relation pg_attribute_rel,
Form_pg_attribute new_attribute,
CatalogIndexState indstate)
{
Datum values[Natts_pg_attribute];
bool nulls[Natts_pg_attribute];
HeapTuple tup;
/* This is a tad tedious, but way cleaner than what we used to do... */
memset(values, 0, sizeof(value... | false | false | false | false | false | 0 |
gnet_stats_drop_reason_to_string(msg_drop_reason_t reason)
{
static const char * const msg_drop_reasons[] = {
N_("Bad size"), /**< MSG_DROP_BAD_SIZE */
N_("Too small"), /**< MSG_DROP_TOO_SMALL */
N_("Too large"), /**< MSG_DROP_TOO_LARGE */
N_("Way too large"), /**< MSG_DROP_WAY_TOO_LARGE */... | false | false | false | false | false | 0 |
fli_convert_shortcut( const char * str,
long * sc )
{
int i = 0;
long offset = 0;
const char *c;
for ( c = str; *c && i < MAX_SHORTCUTS; c++ )
{
switch ( *c )
{
case '^' :
if ( offset & FL_CONTROL_MASK && c[ -1 ] == '^' )
... | false | false | false | false | false | 0 |
HTS_PStream_mlpg(HTS_PStream * pst)
{
size_t m;
if (pst->length == 0)
return;
for (m = 0; m < pst->vector_length; m++) {
HTS_PStream_calc_wuw_and_wum(pst, m);
HTS_PStream_ldl_factorization(pst); /* LDL factorization */
HTS_PStream_forward_substitution(pst); /* forward substit... | false | false | false | false | false | 0 |
prt_fname(JCR *jcr)
{
if (!jcr->fn_printed) {
Jmsg(jcr, M_INFO, 0, _("File: %s\n"), jcr->fname);
jcr->fn_printed = true;
}
} | false | false | false | false | false | 0 |
flush_list (LexState *ls, int m, int n) {
if (n > 0) {
code_oparg(ls, SETLIST, m, -n);
code_byte(ls->fs, (Byte)n);
}
} | false | false | false | false | false | 0 |
prefill_possible_map(void)
{
int i, possible;
/* no processor from mptable or madt */
if (!num_processors)
num_processors = 1;
i = setup_max_cpus ?: 1;
if (setup_possible_cpus == -1) {
possible = num_processors;
#ifdef CONFIG_HOTPLUG_CPU
if (setup_max_cpus)
possible += disabled_cpus;
#else
if (possibl... | false | false | false | false | false | 0 |
qed_sp_update_mcast_bin(struct qed_hwfn *p_hwfn,
struct vport_update_ramrod_data *p_ramrod,
struct qed_sp_vport_update_params *p_params)
{
int i;
memset(&p_ramrod->approx_mcast.bins, 0,
sizeof(p_ramrod->approx_mcast.bins));
if (p_params->update_approx_mcast_flg) {
p_ramrod->common.update_approx_mca... | false | false | false | false | false | 0 |
printList(int n)
{
int i;
if (header)
print_header();
if (n > best)
n = best;
for (i = 0; i < n; i++)
printf("%s\n", sort[i].explain);
} | false | false | false | false | false | 0 |
put_tgtstatus(const tgtdefn_t *tgt, const tgtstat_t *newstat)
{ char *newfname = NULL, *oldfname = NULL;
struct statfile *sfin, *sfout;
tgtstat_t *ts = NULL;
struct stat sbuff;
int badlock, eflag = 0;
(void)cm_path(&oldfname, CM_SYSRUN_PFX, cm_status_filename);
(void)cm_path(&newfname, CM_SYS... | false | false | false | false | false | 0 |
asn1_add_date_utc(unsigned char *time, x509_node *node)
{
unsigned char date[13], *sp;
x509_time xtime;
int ret;
sscanf((char*)time, "%d-%d-%d %d:%d:%d", &xtime.year, &xtime.mon,
&xtime.day, &xtime.hour, &xtime.min, &xtime.sec);
/* convert to YY */
if (xtime.year > 2000)
xtime.yea... | false | false | false | false | false | 0 |
gm204_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
const struct gf100_grctx_func *grctx = gr->func->grctx;
u32 tmp;
int i;
gf100_gr_mmio(gr, grctx->hub);
gf100_gr_mmio(gr, grctx->gpc);
gf100_gr_mmio(gr, grctx->zcull);
gf100_gr_... | false | false | false | false | false | 0 |
gtk_xtext_selection_up(GtkXText * xtext, textentry * start, textentry * end, int start_offset)
{
/* render all the complete lines */
if (start->next == end)
gtk_xtext_render_ents(xtext, end, NULL);
else
gtk_xtext_render_ents(xtext, start->next, end);
/* now the incomplete upper line */
if (start == xtext->buf... | false | false | false | false | false | 0 |
free_stmt(Stmt * stmt)
{
Stmt *next_stmt;
Cond_Arm *arm, *next_arm;
Except_Arm *except, *next_e;
for (; stmt; stmt = next_stmt) {
next_stmt = stmt->next;
switch (stmt->kind) {
case STMT_COND:
for (arm = stmt->s.cond.arms; arm; arm = next_arm) {
next_arm = arm->next;
free_expr(arm->conditi... | false | false | false | false | false | 0 |
ID3v2_TestFrameID_NonConformance(char* frameid) {
for (uint8_t i=0; i < 4; i++) {
if ( !((frameid[i] >= '0' && frameid[i] <= '9') || ( frameid[i] >= 'A' && frameid[i] <= 'Z' )) ) {
return true;
}
}
return false;
} | false | false | false | false | false | 0 |
build_Subtype (pVAUL_Name res_name,
pVAUL_Name type_mark,
pIIR_TypeList opt_constraint)
{
// When we have a constraint, build a ArraySubtype
//
if (opt_constraint)
return build_ArraySubtype (res_name, type_mark, opt_constraint);
// Build a ScalarSubtype when the type_mark denotes a scalar type;... | false | false | false | false | false | 0 |
action_insert_thumb (ExifData *ed, ExifLog *log, ExifParams p)
{
FILE *f;
if (!ed) return;
/* Get rid of the thumbnail */
action_remove_thumb (ed, log, p);
/* Insert new thumbnail */
f = fopen (p.set_thumb, "rb");
if (!f) {
exif_log (log, -1, "exif", _("Could not open "
"'%s' (%s)!"), p.set_thumb, strerr... | false | false | false | false | true | 1 |
linearFunc(float x, float *ret, int numDimen, int npnts, float *pnts)
{
int nspans = npnts - 1;
if (nspans < 1) // illegal
return;
x = FLOAT_CLAMP(x) * nspans;
int span = static_cast<int>(x);
// find the correct 2-point span of the linear list
if (span >= nspans)
s... | false | false | false | false | false | 0 |
H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
{
int ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
if(((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder)
ret_value = -1;
else if(((const H5O_link_t *)lnk1)->corder > ((const H5O_link_t... | false | false | false | false | false | 0 |
str2u(char **str)
{
unsigned long lu;
if (!isdigit((*str)[0]))
bb_error_msg_and_die("bad field specification");
lu = strtoul(*str, str, 10);
if ((sizeof(long) > sizeof(int) && lu > INT_MAX) || !lu)
bb_error_msg_and_die("bad field specification");
return lu;
} | false | false | false | false | false | 0 |
cl_display(char *prompt, char *fmt, ...)
{
va_list ap;
char *s;
int d;
int arg = 0;
if (strcmp(prompt, DEBUG) == 0 && cl_debug == 0)
return;
va_start(ap, fmt);
cl_winstatus_puts(prompt);
for (; *fmt; fmt++)
switch (*fmt) {
case '%':
arg = 1;
continue;
case 's':
if (arg) {
s = v... | false | false | false | false | false | 0 |
param(float val) {
if (_nParams < _maxParams) {
_params[_nParams].type = GIMP_PDB_FLOAT;
_params[_nParams].data.d_float = val;
_nParams++;
}
return *this;
} | false | false | false | false | false | 0 |
fs_get_data_size(fs_backend *be, int seg)
{
fs_data_size ret;
if (!be->ptrees_priv) {
fs_error(LOG_WARNING, "list unavailable");
fs_data_size errret = { 0, 0, 0, 0, 0 };
return errret;
}
ret.quads_s = 0;
ret.quads_sr = 0;
for (int i=0; i<be->ptree_length; i++) {
fs_backend_ptree_limited_op... | false | false | false | false | false | 0 |
ParseSwitchStatement(ZoneStringList* labels,
bool* ok) {
// SwitchStatement ::
// 'switch' '(' Expression ')' '{' CaseClause* '}'
SwitchStatement* statement = new SwitchStatement(labels);
Target target(&this->target_stack_, statement);
Expect(Token::SWITCH, CH... | false | false | false | false | false | 0 |
dfb_gfxcard_flush_texture_cache( void )
{
D_ASSUME( card != NULL );
if (card && card->funcs.FlushTextureCache)
card->funcs.FlushTextureCache( card->driver_data, card->device_data );
} | false | false | false | false | false | 0 |
loadGridMapLiquidData(FILE* in, uint32 offset, uint32 /*size*/)
{
GridMapLiquidHeader header;
fseek(in, offset, SEEK_SET);
size_t file_read = fread(&header, sizeof(header), 1, in);
if (file_read <= 0)
return false;
if (header.fourcc != *((uint32 const*)(MAP_LIQUID_MAGIC)))
return fal... | false | false | false | false | false | 0 |
lpfc_els_chk_latt(struct lpfc_vport *vport)
{
struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
struct lpfc_hba *phba = vport->phba;
uint32_t ha_copy;
if (vport->port_state >= LPFC_VPORT_READY ||
phba->link_state == LPFC_LINK_DOWN ||
phba->sli_rev > LPFC_SLI_REV3)
return 0;
/* Read the HBA Hos... | false | false | false | false | false | 0 |
list_main(void)
{
sub_context_ty *scp;
table_ty *tp;
int j;
table_ty *hit[SIZEOF(table)];
int nhit;
string_ty *s1;
string_ty *s2;
trace(("list_main()\n{\n"));
arglex();
const char *listname = 0;
change_identifier cid;
st... | false | false | false | false | false | 0 |
set_bio_pages_uptodate(struct bio *bio)
{
int i;
struct page *p;
for (i = 0; i < bio->bi_vcnt; i++) {
p = bio->bi_io_vec[i].bv_page;
SetPageUptodate(p);
}
} | false | false | false | false | false | 0 |
get_nth_icon( const unsigned int n )
{
if( n >= m_iconbox.children().size() ) return NULL;
Gtk::Box_Helpers::BoxList::iterator it = m_iconbox.children().begin();
for( unsigned int i = 0; i < n; ++i, ++it );
return dynamic_cast< SKELETON::View* >( it->get_widget() );
} | false | false | false | false | false | 0 |
hdm_read_completion(struct urb *urb)
{
struct mbo *mbo;
struct buf_anchor *anchor;
struct most_dev *mdev;
struct device *dev;
unsigned long flags;
unsigned int channel;
mbo = urb->context;
anchor = mbo->priv;
mdev = to_mdev(mbo->ifp);
channel = mbo->hdm_channel_id;
dev = &mdev->usb_device->dev;
if ((urb->... | false | false | false | false | false | 0 |
create_nt_window(AW_root *aw_root){
AW_window *aww;
GB_ERROR error = GB_request_undo_type(GLOBAL_gb_main, GB_UNDO_NONE);
if (error) aw_message(error);
nt_create_all_awars(aw_root,AW_ROOT_DEFAULT);
aww = create_nt_main_window(aw_root,0);
aww->show();
error = GB_request_undo_type(GLOBAL_gb_mai... | false | false | false | false | false | 0 |
findRunningThreadByTid(int tid) {
Thread *thread, *self = threadSelf();
disableSuspend(self);
pthread_mutex_lock(&lock);
for(thread = &main_thread; thread != NULL && thread->id != tid;
thread = thread->next);
pthread_mutex_unlock(&lock);
enableSuspend(self);
return thread;
} | false | false | false | false | false | 0 |
HSP_Display_print(HSP_Display *hd){
register gint pos, pause, width = 50;
g_assert(hd);
g_assert(hd->top->len == hd->mid->len);
g_assert(hd->mid->len == hd->low->len);
for(pos = 0, pause = hd->top->len-width; pos < pause; pos += width){
HSP_Display_print_ruler(hd, width, pos, TRUE);
... | false | false | false | false | false | 0 |
scif_qp_setup_handler(struct work_struct *work)
{
struct scif_dev *scifdev = container_of(work, struct scif_dev,
qp_dwork.work);
struct scif_hw_dev *sdev = scifdev->sdev;
dma_addr_t da = 0;
int err;
if (scif_is_mgmt_node()) {
struct mic_bootparam *bp = sdev->dp;
da = bp->scif_card_dma_addr;
scifdev->... | false | false | false | false | false | 0 |
Change()
{
// PS 3.3 - 2008 C.7.6.3.1.2 Photometric Interpretation
Output = Input;
if( PI == PhotometricInterpretation::YBR_FULL )
{
assert( Input->GetPhotometricInterpretation() == PhotometricInterpretation::RGB );
/*
In the case where Bits Allocated (0028,0100) has a value of 8 then the followin... | false | false | false | false | false | 0 |
_get_num_sectors(int fd)
{
unsigned long long bytes=0;
if (blkdev_get_size(fd, &bytes) == -1)
return 0;
return bytes / _get_sector_size(fd);
} | false | false | false | false | false | 0 |
hpav_init_sniffer_request(void *buf, int len, void *UNUSED(buffer))
{
int avail = len;
struct sniffer_request *mm = buf;
int control;
faifa_printf(out_stream, "Sniffer mode?\n");
for (control = HPAV_SC_DISABLE; control <= HPAV_SC_NO_CHANGE; control++) {
faifa_printf(out_stream, "%d: %s\n", control, get_sniffer_... | false | false | false | false | false | 0 |
branch_ext_bbox(branch_t *br, int *l, int *r, int *t, int *b)
{
int extra = conf.branch_margin & 1; /* Correct +/-1 error on div 2 */
branch_bbox(br, l, r, t, b);
if(l) *l -= conf.branch_margin/2;
if(r) *r += conf.branch_margin/2 + extra;
if(t) *t -= conf.branch_connect + conf.branch_margin/2;
if(b) *b += conf.br... | false | false | false | false | false | 0 |
GetExecutableFilename() const
{
if (m_TargetType == ttCommandsOnly)
return wxEmptyString;
if (m_PrefixGenerationPolicy != tgfpNone || m_ExtensionGenerationPolicy != tgfpNone)
{
wxString out = m_Filename;
GenerateTargetFilename(out);
return out;
}
wxFileName fname(m_... | false | false | false | false | false | 0 |
costella_base_error_fprint_tree( FILE* pfile,
COSTELLA_ERROR_NODE* pen, COSTELLA_UD udDepth, COSTELLA_UD udCleanup )
{
COSTELLA_UD ud;
/* Check pointers.
*/
if( !pfile || !pen )
{
return;
}
/* Print the indenting spaces.
*/
for( ud = 0; ud < udDepth; ud++ )
{
if( fprintf( pfile, " "... | false | false | false | false | false | 0 |
Cudd_FirstNode(
DdManager * dd,
DdNode * f,
DdNode ** node)
{
DdGen *gen;
int size;
/* Sanity Check. */
if (dd == NULL || f == NULL) return(NULL);
/* Allocate generator an initialize it. */
gen = ALLOC(DdGen,1);
if (gen == NULL) {
dd->errorCode = CUDD_MEMORY_OUT;
return(NULL);
... | false | false | false | false | false | 0 |
update_modification_time (GthChangeDateTask *self)
{
GList *scan;
GError *error = NULL;
GthMonitor *monitor;
GList *files;
if ((self->priv->fields & GTH_CHANGE_LAST_MODIFIED_DATE) == GTH_CHANGE_LAST_MODIFIED_DATE) {
GthDateTime *date_time;
date_time = gth_datetime_new ();
for (scan = self->p... | false | false | false | false | false | 0 |
rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer * jbuf)
{
guint64 high_ts, low_ts;
GstBuffer *high_buf, *low_buf;
guint32 result;
g_return_val_if_fail (jbuf != NULL, 0);
high_buf = g_queue_peek_head (jbuf->packets);
low_buf = g_queue_peek_tail (jbuf->packets);
if (!high_buf || !low_buf || high_buf == lo... | false | false | false | false | false | 0 |
iterate_game(Game * game)
{
struct timeval start_tv, end_tv;
struct timezone tz;
gint32 diff_t;
int stop;
while (game->state == STATE_RUNNING) {
gettimeofday(&start_tv, &tz);
game->mouse_move = get_mouse_x_position();
iterate_bat(game);
iterate_balls(game);
iterate_powerups(game);
iterate_blocks(game... | false | false | false | false | true | 1 |
max(double x, double y)
{
if (x > y)
return x;
else
return y;
} | false | false | false | false | false | 0 |
qla82xx_beacon_on(struct scsi_qla_host *vha)
{
int rval;
struct qla_hw_data *ha = vha->hw;
qla82xx_idc_lock(ha);
rval = qla82xx_mbx_beacon_ctl(vha, 1);
if (rval) {
ql_log(ql_log_warn, vha, 0xb050,
"mbx set led config failed in %s\n", __func__);
goto exit;
}
ha->beacon_blink_led = 1;
exit:
qla82xx_id... | false | false | false | false | false | 0 |
InterpolateKeys(aiVectorKey* valOut,const KeyTimeList& keys, const KeyFrameListList& inputs,
const bool geom,
double& max_time,
double& min_time)
{
ai_assert(keys.size());
ai_assert(valOut);
std::vector<unsigned int> next_pos;
const size_t count = inputs.size();
next_pos.resize(inputs.size(),0);
... | false | false | false | false | false | 0 |
poll_select_copy_remaining(struct timespec *end_time, void __user *p,
int timeval, int ret)
{
struct timespec rts;
struct timeval rtv;
if (!p)
return ret;
if (current->personality & STICKY_TIMEOUTS)
goto sticky;
/* No update for zero timeout */
if (!end_time->tv_sec && !end_time->tv_nsec)
retur... | false | false | false | false | false | 0 |
ExportTIFF_ArrayASCII ( const SXMPMeta & xmp, const char * xmpNS, const char * xmpProp,
TIFF_Manager * tiff, XMP_Uns8 ifd, XMP_Uns16 id )
{
try { // Don't let errors with one stop the others.
std::string itemValue, fullValue;
XMP_OptionBits xmpFlags;
bool foundXMP = xmp.GetProperty ( xmpNS, xmpProp, 0... | false | false | false | false | false | 0 |
handle_packet_from_client(struct server_packet_binding *bindings,
struct linked_server *ls,
const void *data, size_t length)
{
const unsigned char cmd
= *(const unsigned char*)data;
for (; bindings->handler != NULL; bindings++) {
if (bindings-... | false | false | false | false | false | 0 |
STRING_new_temp_value(VALUE *value, const char *src, int len)
{
value->_string.addr = STRING_new_temp(src, len);
value->_string.len = STRING_length(value->_string.addr);
value->_string.start = 0;
value->type = T_STRING;
} | false | false | false | false | false | 0 |
operation_is_completed (guint operation_id)
{
struct OperationState *op_state;
op_state = grl_operation_get_private_data (operation_id);
return !op_state || op_state->completed;
} | false | false | false | false | false | 0 |
IoFile_justClose(IoFile *self)
{
FILE *stream = DATA(self)->stream;
if (stream)
{
if (stream != stdout && stream != stdin)
{
if (DATA(self)->flags == IOFILE_FLAGS_PIPE)
{
pclose(stream);
}
else
{
fclose(stream);
DATA(self)->flags = IOFILE_FLAGS_NONE;
}
}
DATA(self)->stream = ... | false | false | false | false | false | 0 |
fraction_matrix__to_double(const fraction_matrix * self, double_matrix * pmat)
{
if (self->denominator == 0)
return_error(gs_error_rangecheck);
pmat->xx = (double)self->xx / self->denominator;
pmat->xy = (double)self->xy / self->denominator;
pmat->yx = (double)self->yx / self->denominator;
p... | false | false | false | false | false | 0 |
gtp_output(char prefix, int id, va_list params)
{
if (id == NO_REPLY) return;
gtp_prefix(prefix, id);
char *s;
while ((s = va_arg(params, char *))) {
fputs(s, stdout);
}
putchar('\n');
gtp_flush();
} | false | false | false | false | false | 0 |
AcpiTbOverrideTable (
ACPI_TABLE_DESC *OldTableDesc)
{
ACPI_STATUS Status;
char *OverrideType;
ACPI_TABLE_DESC NewTableDesc;
ACPI_TABLE_HEADER *Table;
ACPI_PHYSICAL_ADDRESS Address;
UINT32 Length;
/* (1) Attempt lo... | false | false | false | false | false | 0 |
mono_emit_unwind_op (MonoCompile *cfg, int when, int tag, int reg, int val)
{
MonoUnwindOp *op = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoUnwindOp));
op->op = tag;
op->reg = reg;
op->val = val;
op->when = when;
cfg->unwind_ops = g_slist_append_mempool (cfg->mempool, cfg->unwind_ops, op);
if (cfg->verbos... | false | false | false | false | false | 0 |
store_podcast_event_cb(GdkEvent * event, GtkTreeIter * iter, GtkTreePath * path) {
if (event->type == GDK_BUTTON_PRESS) {
GdkEventButton * bevent = (GdkEventButton *)event;
if (bevent->button == 3) {
set_popup_sensitivity(path);
switch (gtk_tree_path_get_depth(path)) {
case 1:
gtk_m... | false | false | false | false | false | 0 |
ezusb_read (
usb_dev_handle *device,
char *label,
unsigned char opcode,
unsigned short addr,
unsigned char *data,
size_t len
) {
int status;
if (verbose)
printf("%s, addr 0x%04x len %4d (0x%04x)\n", label, addr, (int)len, (int)len);
status = ctrl_msg (... | false | false | false | false | false | 0 |
param_check_password(gs_param_list * plist, const password * ppass)
{
if (ppass->size != 0) {
password pass;
int code = param_read_password(plist, "Password", &pass);
if (code)
return code;
if (pass.size != ppass->size ||
bytes_compare(&pass.data[0], pass.siz... | false | false | false | false | false | 0 |
AcpiDbExecuteSetup (
ACPI_DB_METHOD_INFO *Info)
{
ACPI_STATUS Status;
ACPI_FUNCTION_NAME (DbExecuteSetup);
/* Catenate the current scope to the supplied name */
Info->Pathname[0] = 0;
if ((Info->Name[0] != '\\') &&
(Info->Name[0] != '/'))
{
if (AcpiUtSafe... | false | false | false | false | false | 0 |
gst_sdp_demux_sink_event (GstPad * pad, GstEvent * event)
{
GstSDPDemux *demux;
gboolean res = TRUE;
demux = GST_SDP_DEMUX (gst_pad_get_parent (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
/* when we get EOS, start parsing the SDP */
res = gst_sdp_demux_start (demux);
gst... | false | false | false | false | false | 0 |
print_debug_cb (gpointer ref,
gint n_cols,
gchar **cols,
gchar **name)
{
gint i;
g_printerr (" DEBUG BEGIN:\n");
for (i = 0; i < n_cols; i++)
g_printerr (" NAME: '%s' VALUE: %s\n", name[i], cols[i]);
g_printerr (" DEBUG END\n");
return 0;
} | false | false | false | false | true | 1 |
connect_cluster(rados_t *cluster)
{
char *id = getenv("CEPH_CLIENT_ID");
if (id) std::cerr << "Client id is: " << id << std::endl;
int ret;
ret = rados_create(cluster, NULL);
if (ret) {
std::ostringstream oss;
oss << "rados_create failed with error " << ret;
return oss.str();
}
ret = rados_co... | false | false | false | false | false | 0 |
FDKaacEnc_findMaxMerge(
const INT* const mergeGainLookUp,
const SECTION_INFO* const huffsection,
const INT maxSfb,
INT* const maxNdx
)
{
INT i, maxMergeGain = 0;
for (i = 0; i + huffsection[i].sfbCnt < maxSfb; i += huffsection[i].sfbCnt)
{
if (... | false | false | false | false | false | 0 |
ReloadData ()
{
if (m_Closing)
return;
gcr_grid_delete_all (GCR_GRID (m_Grid));
m_Lines.clear ();
gcr::LineList* Lines = m_pDoc->GetLineList ();
for (list < Line * >::iterator i = Lines->begin (); i != Lines->end (); i++)
m_Lines[gcr_grid_append_row (GCR_GRID (m_Grid)/*FIXME*/)] = *i;
if (!m_Lines.size ())
... | false | false | false | false | false | 0 |
apply(const plan *ego_, R *I, R *O)
{
const P *ego = (const P *) ego_;
INT os = ego->os;
INT i, n = ego->n;
{
plan_rdft *cld = (plan_rdft *) ego->cld;
cld->apply((plan *) cld, I, O);
}
for (i = 1; i < n - i; ++i) {
E a, b;
a = O[os * i];
b = O[os * (n - i)];
#if FFT_SIGN =... | false | false | false | false | false | 0 |
hash_new (unsigned int table_size)
{
hash *h;
h = malloc (sizeof (struct hash_s));
if (!h) return NULL;
h->table = calloc (sizeof (struct item *), table_size);
if (!h->table) {
free (h);
return NULL;
}
h->s = iks_stack_new (sizeof (hash) * 128, 8192);
if (!h->s) {
free (h->table);
free (h);
return NU... | false | false | false | false | false | 0 |
warp_set_class(warp_class_type w)
{
if (w == warp_none) {
_warp_flat_offset.assign(0, 0);
_warp_speed = 1.0;
_warp_offset = 0.0;
}
_warp_class = w;
} | false | false | false | false | false | 0 |
CheckMultifieldSlotModify(
void *theEnv,
int code,
char *func,
INSTANCE_TYPE *ins,
EXPRESSION *args,
int *rb,
int *re,
DATA_OBJECT *newval)
{
DATA_OBJECT temp;
INSTANCE_SLOT *sp;
int start;
start = (args == GetFirstArgument()) ? 1 : 2;
EvaluationData(theEnv)->EvaluationError = FALSE;
... | false | false | false | false | false | 0 |
fill_terrain_sprite_layer(struct tileset *t,
struct drawn_sprite *sprs,
int layer_num,
const struct tile *ptile,
const struct terrain *pterrain,
struct terrain **tterrain_near)
{
struct sprite *sprite;
struct drawn_sprite *saved_sprs = sprs;
struct drawing_data *draw =... | false | false | false | false | false | 0 |
vlistInqVarIntKey(int vlistID, int varID, const char* name)
{
long int value = 0;
#if defined (HAVE_LIBGRIB_API)
/* check if the GRIB key was previously read and is stored in
"opt_grib_int_val" */
vlist_t *vlistptr;
vlistptr = vlist_to_pointer(vlistID);
int i;
for (i=0; i<vlistptr->vars[varID].opt_g... | false | false | false | false | false | 0 |
checkscreen(xmax, ymax)
int xmax, ymax;
{
CONST char *cp;
char *tty;
int i, row, wastty, dupn_line, dupdumbterm;
if (ttyio < 0) return;
#ifdef SIGWINCH
nowinch++;
#endif
dupn_line = -1;
#ifdef DEP_PTY
if (parentfd >= 0) row = WFILEMIN;
else
#endif
{
row = wheader + WFOOTER;
#ifdef _NOEXTRAWIN
row += (minr... | false | false | false | false | false | 0 |
scaleMatrix(cvector &s, double *m, int n) {
int i,j, curbase, newbase = -1;
double scale;
for(i = 0; i < actions[n]; i++) {
if(s[i+firstAction(n)] > 0.0) {
scale = s[i+firstAction(n)];
curbase = i*blockSize[n];
if(newbase < 0) {
newbase = curbase;
for(j = curbase; j < curbase+blockSize[n];... | false | false | false | false | false | 0 |
gst_input_selector_wait (RsnInputSelector * self, RsnSelectorPad * pad)
{
while (self->blocked && !self->flushing && !pad->flushing) {
/* we can be unlocked here when we are shutting down (flushing) or when we
* get unblocked */
GST_INPUT_SELECTOR_WAIT (self);
}
return self->flushing;
} | false | false | false | false | false | 0 |
hns_mdio_write(struct mii_bus *bus,
int phy_id, int regnum, u16 data)
{
int ret;
struct hns_mdio_device *mdio_dev = (struct hns_mdio_device *)bus->priv;
u8 devad = ((regnum >> 16) & 0x1f);
u8 is_c45 = !!(regnum & MII_ADDR_C45);
u16 reg = (u16)(regnum & 0xffff);
u8 op;
u16 cmd_reg_cfg;
dev_dbg(&bus->dev, "... | false | false | false | false | false | 0 |
change_all_dtu_param_to_dtu_trans_group(Stasche_table *spt)
{
Block *bpt;
Module_table *module;
Dtu_parameter *param_list = NULL;
module = spt->hmdf->block->module;
for (bpt = spt->hmdf->block->inner;
bpt != NULL;
bpt = bpt->next) {
if (bpt->cmp_localize != NULL
... | false | false | false | false | false | 0 |
crypto_cipher_crypt_inplace(crypto_cipher_t *env, char *buf, size_t len)
{
tor_assert(len < SIZE_T_CEILING);
aes_crypt_inplace(env->cipher, buf, len);
return 0;
} | false | false | false | false | false | 0 |
egg_file_format_chooser_dispose (GObject *obj)
{
EggFileFormatChooser *self = EGG_FILE_FORMAT_CHOOSER (obj);
if (NULL != self)
{
if (self->priv->idle_hack)
{
g_source_remove (self->priv->idle_hack);
self->priv->idle_hack = 0;
}
}
G_OBJECT_CLASS (egg_file_format_... | false | false | false | false | false | 0 |
mxf_is_body_partition_pack (const MXFUL * ul)
{
if (mxf_is_partition_pack (ul) && ul->u[13] == 0x03)
return TRUE;
return FALSE;
} | false | false | false | false | false | 0 |
snd_sonicvibes_create_gameport(struct sonicvibes *sonic)
{
struct gameport *gp;
sonic->gameport = gp = gameport_allocate_port();
if (!gp) {
dev_err(sonic->card->dev,
"sonicvibes: cannot allocate memory for gameport\n");
return -ENOMEM;
}
gameport_set_name(gp, "SonicVibes Gameport");
gameport_set_phys(gp,... | false | false | false | false | false | 0 |
cgiDecodeString (char *text)
{
char *cp, *xp;
for (cp=text,xp=text; *cp; cp++) {
if (*cp == '%') {
if (strchr("0123456789ABCDEFabcdef", *(cp+1))
&& strchr("0123456789ABCDEFabcdef", *(cp+2))) {
if (islower(*(cp+1)))
*(cp+1) = toupper(*(cp+1));
if (islower(*(cp+2)))
*(cp+2) = toupper(*(cp... | false | false | false | false | false | 0 |
getContentHeight(){
if(flags&FLAG_RECALC) recompute();
return items.no()*lineHeight;
} | false | false | false | false | false | 0 |
changeCoordinatesReference(const CPose3D &newReferenceBase )
{
const CMatrixDouble33 &M = newReferenceBase.getRotationMatrix();
// The mean:
mean = newReferenceBase + mean;
// The covariance:
M.multiply_HCHt(CMatrixDouble33(cov), cov); // save in cov
} | false | false | false | false | false | 0 |
es_getKeyState(sdl_data *sd, int len,char *buff)
{
Uint8 * keys;
char *bp, *start;
int length, sendlen, i;
keys = SDL_GetKeyState(&length);
bp = start = sdl_get_temp_buff(sd, length);
for(i=0; i<length; i++)
put8(bp, keys[i]);
sendlen = bp - start;
sdl_send(sd, sendlen);
} | false | false | false | false | false | 0 |
check_format_options(void)
{
if (!format) {
/* Select output format if none has been selected */
if (DISPLAY_HDR_ONLY(flags)) {
format = F_HEADER_OUTPUT;
}
else {
format = F_PPC_OUTPUT;
}
}
/* Get format position in array */
f_position = get_format_position(fmt, format);
/* Check options consist... | false | false | false | false | false | 0 |
fp_copy(ofp, ifp)
FILE *ofp, *ifp;
{
char line[CHA_INPUT_SIZE];
/* while (fget_line(line, sizeof(line), ifp) != NULL) { */
while (fgets(line, sizeof(line), ifp) != NULL) {
fputs(line, ofp);
fflush(ofp);
}
if (ifp != stdin)
fclose(ifp);
} | false | false | false | false | false | 0 |
get_netbios_dgm (decode_proto_t *dp)
{
guint8 mesg_type;
decode_proto_add(dp, "NETBIOS-DGM");
mesg_type = dp->cur_packet[0];
/* Magic numbers copied from ethereal, as usual
* They mean Direct (unique|group|broadcast) datagram */
if (mesg_type == 0x10 || mesg_type == 0x11 || mesg_type == 0x12)
decode... | false | false | false | false | false | 0 |
cdv_intel_dp_max_link_bw(struct gma_encoder *encoder)
{
struct cdv_intel_dp *intel_dp = encoder->dev_priv;
int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
switch (max_link_bw) {
case DP_LINK_BW_1_62:
case DP_LINK_BW_2_7:
break;
default:
max_link_bw = DP_LINK_BW_1_62;
break;
}
return max_link_bw;
} | false | false | false | false | false | 0 |
serviceThisCommand(DUL_NETWORKKEY ** network, DUL_ASSOCIATIONKEY ** association,
DUL_PRESENTATIONCONTEXT * ctx, MSG_TYPE messageType,
void **message, DUL_ASSOCIATESERVICEPARAMETERS * params,
const char *namingConvention)
{
CONDITION
cond;
MSG_GENERAL
* general;
if (!silent) {
general ... | false | false | false | false | false | 0 |
sci_remote_node_context_validate_context_buffer(struct sci_remote_node_context *sci_rnc)
{
union scu_remote_node_context *rnc_buffer;
struct isci_remote_device *idev = rnc_to_dev(sci_rnc);
struct domain_device *dev = idev->domain_dev;
struct isci_host *ihost = idev->owning_port->owning_controller;
rnc_buffer = sc... | false | false | false | false | false | 0 |
parse_xml (const QByteArray &b, int id)
{
LastFmHandler *x = dynamic_cast<LastFmHandler*> (m_xml.contentHandler ());
QXmlInputSource s;
s.setData (b);
x->reset ();
m_xml.parse (s);
if (x->type () == LastFmHandler::SIMILARARTIST) {
QList<LastFmArtist> l = x->artist_list ();
m_cache[m_cache_map[id]] = l;
e... | false | false | false | false | false | 0 |
plOpenFile(PLStream *pls)
{
int i = 0, count = 0;
size_t len;
char line[256];
while (pls->OutFile == NULL) {
/* Setting pls->FileName = NULL forces creation of a new family member */
/* You should also free the memory associated with it if you do this */
if (pls->family && pls->BaseName != NULL)
... | true | true | true | false | true | 1 |
command_quit(object *op, const char *params) {
if (QUERY_FLAG(op, FLAG_WAS_WIZ)) {
draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_ADMIN_DM, "Can't quit when in DM mode.");
return;
}
send_query(&op->contr->socket, CS_QUERY_SINGLECHAR,
i18n(op, "Quitting will delet... | false | false | false | false | false | 0 |
hsc_set_server_dir(HSCPRC * hp, STRPTR dir) {
set_estr(hp->server_dir, dir);
/* if dir does not already end with a directory separator,
* append if now */
if (!strchr(PATH_SEPARATOR, last_ch(dir))) {
app_estrch(hp->server_dir, PATH_SEPARATOR[0]);
}
D(fprintf(stderr, DHL "serverdir=`%s'... | false | false | false | false | false | 0 |
init_job_margin(GVJ_t *job)
{
GVC_t *gvc = job->gvc;
if (gvc->graph_sets_margin) {
job->margin = gvc->margin;
}
else {
/* set default margins depending on format */
switch (job->output_lang) {
case GVRENDER_PLUGIN:
job->margin = job->device.features->default_mar... | false | false | false | false | false | 0 |
tracker_read_text_from_stream (GInputStream *stream,
gsize max_bytes)
{
GString *s = NULL;
gsize n_bytes_remaining = max_bytes;
g_return_val_if_fail (stream, NULL);
g_return_val_if_fail (max_bytes > 0, NULL);
/* Reading in chunks of BUFFER_SIZE
* Loop is halted whenever... | 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.