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 |
|---|---|---|---|---|---|---|
put_event (spi::InternalLoggingEvent const & ev)
{
flags_type ret_flags = ERROR_BIT;
try
{
ev.gatherThreadSpecificData ();
SemaphoreGuard semguard (sem);
MutexGuard mguard (mutex);
ret_flags |= flags;
if (flags & EXIT)
{
ret_flag... | false | false | false | false | false | 0 |
cbf_write_character (cbf_file *file, int c)
{
/* Does the file exist? */
if (!file)
return EOF;
/* Write the next character */
if (c == '\n')
{
/* Line termination */
if (file->write_encoding & ENC_CRTERM)
cbf_failnez (cbf_put_character (file, '\r'))
if (file->write_encodin... | false | false | false | false | false | 0 |
lpfc_oas_tgt_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct Scsi_Host *shost = class_to_shost(dev);
struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
unsigned int cnt = count;
uint8_t wwpn[WWN_SZ];
int rc;
if (!phba->cfg_fof)
return -EP... | false | true | false | false | false | 1 |
fwheel_set_ready_callback(void * window, void *func, void *data)
{
struct fwheel_t *fwheel;
fwheel = (struct fwheel_t *)g_object_get_data(G_OBJECT(window), "fwheel");
if (! fwheel) {
err_printf("Filter wheel wasn't found\n");
return;
}
INDI_set_callback(INDI_COMMON (fwheel), FWHEEL_CALLBACK_READY, func, data);... | false | false | false | false | false | 0 |
diff_file(tmp_orig, tmp_new, tmp_diff)
char_u *tmp_orig;
char_u *tmp_new;
char_u *tmp_diff;
{
char_u *cmd;
#ifdef FEAT_EVAL
if (*p_dex != NUL)
/* Use 'diffexpr' to generate the diff file. */
eval_diff(tmp_orig, tmp_new, tmp_diff);
else
#endif
{
cmd = alloc((unsigned)(STRLEN(tmp_orig) + S... | false | false | false | false | false | 0 |
allocation_complete(int fd, short args, void *cbdata)
{
orte_state_caddy_t *state = (orte_state_caddy_t*)cbdata;
orte_job_t *jdata = state->jdata;
orte_job_t *daemons;
jdata->state = ORTE_JOB_STATE_ALLOCATION_COMPLETE;
/* get the daemon job object */
if (NULL == (daemons = orte_get_job_data_ob... | false | false | false | false | false | 0 |
syscall_handler (struct registers_t *regs)
{
void *location;
int ret;
/* Firstly, check if the requested syscall number is valid.
* The syscall number is found in EAX.
*/
if (regs->eax >= N_SYSCALLS)
return;
location = syscalls[regs->eax]; /* Get the required syscall location */
... | false | false | false | false | false | 0 |
gnc_tree_control_split_reg_cut_trans (GncTreeViewSplitReg *view)
{
GncTreeModelSplitReg *model;
Transaction *from_trans;
Account *anchor;
g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
model = gnc_tree_view_split_reg_get_model_from_view (view);
anchor = gnc_tree_model_split_reg_get_anc... | false | false | false | false | false | 0 |
error(const Twine &Message, StringRef ArgName) {
if (!ArgName.data())
ArgName = ArgStr;
if (ArgName.empty())
errs() << HelpStr; // Be nice for positional arguments
else
errs() << GlobalParser->ProgramName << ": for the -" << ArgName;
errs() << " option: " << Message << "\n";
return true;
} | false | false | false | false | false | 0 |
popen2_impl(FILE** in, FILE** out, const char* program, const char* const argv[], const char* const envp[], int lookup_path) {
int child_stdout = -1;
int child_stdin = -1;
int to_be_written = -1;
int to_be_read = -1;
if(in) {
int p[2]={-1,-1};
int ret = pipe(p);
if(ret!=0) { return -1; }
... | false | false | false | false | false | 0 |
xgene_dma_free_desc_list(struct xgene_dma_chan *chan,
struct list_head *list)
{
struct xgene_dma_desc_sw *desc, *_desc;
list_for_each_entry_safe(desc, _desc, list, node)
xgene_dma_clean_descriptor(chan, desc);
} | false | false | false | false | false | 0 |
RemoveKey(StringRef Key) {
int Bucket = FindKey(Key);
if (Bucket == -1) return 0;
StringMapEntryBase *Result = TheTable[Bucket].Item;
TheTable[Bucket].Item = getTombstoneVal();
--NumItems;
++NumTombstones;
return Result;
} | false | false | false | false | false | 0 |
gdbstub_state(struct kgdb_state *ks, char *cmd)
{
int error;
switch (cmd[0]) {
case 'e':
error = kgdb_arch_handle_exception(ks->ex_vector,
ks->signo,
ks->err_code,
remcom_in_buffer,
remcom_out_buffer,
ks->linux_regs);
return error;
case 's':
case 'c':
strcpy(remc... | false | true | false | false | false | 1 |
iscsi_task_tx_start(struct iscsi_connection *conn)
{
struct iscsi_task *task;
int is_rsp, err = 0;
if (list_empty(&conn->tx_clist))
goto nodata;
conn_write_pdu(conn);
task = list_first_entry(&conn->tx_clist, struct iscsi_task, c_list);
dprintf("found a task %" PRIx64 " %u %u %u\n", task->tag,
ntohl(((struc... | false | false | false | false | false | 0 |
open(void)
{
initServer(); // complete state initialization
fxStr emsg;
if (!initClientFIFO(emsg)) {
logInfo("connection refused (%s) from %s [%s]",
(const char*) emsg,
(const char*) remotehost, (const char*) remoteaddr);
reply(420, "%s server cannot initialize: %s",
(const char*) ... | false | false | false | false | false | 0 |
free_busy_data_cb (ECalClient *client,
const GSList *free_busy,
const gchar *func_name)
{
if (g_slist_length ((GSList *) free_busy) > 0)
received_free_busy_data = TRUE;
} | false | false | false | false | false | 0 |
log_matches_cb (GiggleGit *git,
GiggleJob *job,
GError *error,
gpointer user_data)
{
RevisionSearchData *data;
GiggleRevListViewPriv *priv;
const gchar *log;
gchar *casefold_log;
data = (RevisionSearchData *) user_data;
priv = GET_PRIV (data->list);
if (error) {
... | false | false | false | false | false | 0 |
fm_v4l2_fops_poll(struct file *file, struct poll_table_struct *pts)
{
int ret;
struct fmdev *fmdev;
fmdev = video_drvdata(file);
mutex_lock(&fmdev->mutex);
ret = fmc_is_rds_data_available(fmdev, file, pts);
mutex_unlock(&fmdev->mutex);
if (ret < 0)
return POLLIN | POLLRDNORM;
return 0;
} | false | false | false | false | false | 0 |
BgWriterShmemInit(void)
{
bool found;
BgWriterShmem = (BgWriterShmemStruct *)
ShmemInitStruct("Background Writer Data",
BgWriterShmemSize(),
&found);
if (BgWriterShmem == NULL)
ereport(FATAL,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("not enough shared memory for background writer")));
if (... | false | false | false | false | false | 0 |
clear()
{
for(size_t i=0; i<alignedToE.size(); i++)
alignedToE[i].clear();
for(size_t i=0; i<alignedToF.size(); i++)
alignedToF[i].clear();
alignedToE.clear();
alignedToF.clear();
} | false | false | false | false | false | 0 |
reset()
{
while (head != NULL) {
InsertionRecord *record = head;
head = head->next;
LE_DELETE_ARRAY(record);
}
tail = (InsertionRecord *) &head;
growAmount = 0;
} | false | false | false | false | false | 0 |
sync_name_list_add(struct sync_name_list *l,
const char *name)
{
struct sync_name *item = xzmalloc(sizeof(struct sync_name));
if (l->tail)
l->tail = l->tail->next = item;
else
l->head = l->tail = item;
l->count++;
item->next = NULL;
item->name = xstrdup(name);
ite... | false | false | false | false | false | 0 |
SizeHandles()
{
double radius = this->vtk3DWidget::SizeHandles(1.0);
for ( int i = 0; i < this->NumberOfHandles; ++i )
{
this->HandleGeometry[i]->SetRadius(radius);
}
} | false | false | false | false | false | 0 |
unreadLine(const QByteArray &line, bool addnl)
{
QByteArray tmp = line;
if (addnl)
tmp += '\n';
if (!tmp.isEmpty())
d->m_Inbuf.prepend(tmp);
} | false | false | false | false | false | 0 |
SystemCommand(const unsigned int verbose,const char *command)
{
int
status;
#if defined(POSIX)
char
message[MaxTextExtent];
#endif /* POSIX */
const char
*message_p = (const char *) NULL;
{
/*
Verify that we are allowed to run this program.
*/
ExceptionInfo
exception;
... | true | true | false | false | true | 1 |
_font_preview_update(Evas_Object *win)
{
Evas_Font_Size sz;
char *name;
if (!fndata.cur_font)
return;
name = elm_font_fontconfig_name_get(fndata.cur_font, fndata.cur_style);
sz = fndata.cur_size;
if (sz < 0)
sz = (-sz * 10) / 100;
if (sz == 0)
sz = 10;
edje_object_text_class_s... | false | false | false | false | false | 0 |
datetime_check_timezone(const DateTime * dt, int minutes)
{
if (!datetime_is_absolute(dt))
return datetime_error(-1, "datetime not absolute");
if (!have(DATETIME_MINUTE, dt))
return datetime_error(-2, "datetime has no minute");
if (!datetime_is_valid_timezone(minutes))
return datetime_error(-3, "invalid ... | false | false | false | false | false | 0 |
repairItem ( ContainerBase* item, int newDamage )
{
if ( !canRepair( item ) )
return item->damage;
if ( item == this )
if ( damage - repairableDamage() > newDamage )
newDamage = damage - repairableDamage();
int orgdam = item->damage;
Resources cost;
newDamage = getMaxRepair... | false | false | false | false | false | 0 |
dissect_ppdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, struct SESSION_DATA_STRUCTURE* local_session)
{
proto_item *ti;
proto_tree *pres_tree;
struct SESSION_DATA_STRUCTURE* session;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
/* do we have spdu type from the s... | false | false | false | false | false | 0 |
de4x5_bad_srom(struct de4x5_private *lp)
{
int i, status = 0;
for (i = 0; i < ARRAY_SIZE(enet_det); i++) {
if (!memcmp(&lp->srom, &enet_det[i], 3) &&
!memcmp((char *)&lp->srom+0x10, &enet_det[i], 3)) {
if (i == 0) {
status = SMC;
} else if (i == 1) {
status = ACCTON;
}
break;
}
... | false | false | false | false | false | 0 |
Inverse(const Point &P) const
{
if (P.identity)
return P;
else
{
m_R.identity = false;
m_R.y = m_field->Add(P.x, P.y);
m_R.x = P.x;
return m_R;
}
} | false | false | false | false | false | 0 |
g_funcs_filesel(SCM scm_msg, SCM scm_templ, SCM scm_flags)
{
int c_flags;
char *r, *msg, *templ;
SCM v;
SCM_ASSERT (scm_is_string (scm_msg), scm_msg,
SCM_ARG1, "gschem-filesel");
SCM_ASSERT (scm_is_string (scm_templ), scm_templ,
SCM_ARG2, "gschem-filesel");
/*! \bug FIXME -- figure out ... | false | false | false | false | false | 0 |
kasan_report_error(struct kasan_access_info *info)
{
unsigned long flags;
const char *bug_type;
/*
* Make sure we don't end up in loop.
*/
kasan_disable_current();
spin_lock_irqsave(&report_lock, flags);
pr_err("================================="
"=================================\n");
if (info->access_ad... | false | false | false | false | false | 0 |
make_prefs_window (void)
{
xine_cfg_entry_t entry;
gboolean done;
if (!xine_config_get_first_entry (xine, &entry))
return NULL;
tooltips = gtk_tooltips_new ();
prefs = create_page ("", 0); /* root page */
do
{
const char *point;
GNode *section;
if (!entry.description ||
!(point= strrc... | false | false | false | false | false | 0 |
cool_lower_flag(unsigned int steps)
{
static float pivot_x = 34.0;
static float pivot_y = 80.0;
float inc = (PI/2.0)/(float)steps;
int poly, point;
if (flag_angle < inc) return;
for (; flag_angle > 0.0; flag_angle -= inc)
{
for(poly = 0; poly < 2; poly++)
for(point = 0; point < 4... | false | false | false | false | false | 0 |
bitmap_init(bitmap_t *bitmap, const bitmap_info_t *binfo)
{
size_t extra;
unsigned i;
/*
* Bits are actually inverted with regard to the external bitmap
* interface, so the bitmap starts out with all 1 bits, except for
* trailing unused bits (if any). Note that each group uses bit 0 to
* correspond to the ... | false | false | false | false | false | 0 |
jas_calloc(size_t nmemb, size_t size)
{
void *ptr;
size_t n;
n = nmemb * size;
if (!(ptr = jas_malloc(n * sizeof(char)))) {
return 0;
}
memset(ptr, 0, n);
return ptr;
} | false | false | false | false | false | 0 |
get_display_data (Display *display,
Bool create)
{
ListNode *node;
AgPerDisplayData *dd;
node = display_datas;
while (node != NULL)
{
dd = (AgPerDisplayData*) node;
if (dd->display == display)
return dd;
node = node->next;
}
if (!create... | false | false | false | false | false | 0 |
givehelp (interactive)
int interactive; /* NZ for interactive-mode help */
{
#ifdef COMMANDFORSPACE
char ch;
#endif
register FILE *helpout; /* File to write help to */
if (interactive)
{
ierase ();
helpout = stdout;
}
else
helpout = stderr;
(void) fprintf (helpout, CORR_C_HELP_1,... | false | false | false | false | false | 0 |
p_find_frame_in_img_cache(void *gpp_void
, gint32 framenr, gint32 *image_id, gint32 *layer_id)
{
GapOnionMainGlobalParams *gpp;
gint32 l_idx;
*image_id = -1;
*layer_id = -1;
gpp = (GapOnionMainGlobalParams *)gpp_void;
for(l_idx = 0; l_idx < MIN(gpp->cache.count, GAP_ONION_CACHE_... | false | false | false | false | false | 0 |
pwm_fan_remove(struct platform_device *pdev)
{
struct pwm_fan_ctx *ctx = platform_get_drvdata(pdev);
thermal_cooling_device_unregister(ctx->cdev);
if (ctx->pwm_value)
pwm_disable(ctx->pwm);
return 0;
} | false | false | false | false | false | 0 |
find_connection (GSList *list, const char *filter_type, const char *filter_val)
{
NMSettingConnection *s_con;
NMConnection *connection;
GSList *iterator;
const char *id;
const char *uuid;
iterator = list;
while (iterator) {
connection = NM_CONNECTION (iterator->data);
s_con = nm_connection_get_setting_conne... | false | false | false | false | false | 0 |
ftp_state_user(struct connectdata *conn)
{
CURLcode result;
struct FTP *ftp = conn->data->reqdata.proto.ftp;
/* send USER */
NBFTPSENDF(conn, "USER %s", ftp->user?ftp->user:"");
state(conn, FTP_USER);
conn->data->state.ftp_trying_alternative = FALSE;
return CURLE_OK;
} | false | false | false | false | false | 0 |
FcSortCompare (const void *aa, const void *ab)
{
FcSortNode *a = *(FcSortNode **) aa;
FcSortNode *b = *(FcSortNode **) ab;
double *as = &a->score[0];
double *bs = &b->score[0];
double ad = 0, bd = 0;
int i;
i = a->n;
while (i-- && (ad = *as++) == (bd = *bs++))
;
re... | false | false | false | false | false | 0 |
wantCellVBreakAt(UT_sint32 vpos, UT_sint32 yCellMin)
{
UT_sint32 i =0;
UT_sint32 iYBreak = vpos;
fp_Container * pCon;
//fp_Line * pLine = NULL;
UT_sint32 footHeight = 0;
fp_TableContainer * pTab = static_cast<fp_TableContainer *>(getContainer());
UT_return_val_if_fail(pTab,0);
for(i=0; i < countCons(); i++)
{
... | false | false | false | false | false | 0 |
shminit(void *memory, unsigned int nbytes, int first)
{
int nunits;
nunits = nbytes >> LAM_LOG_ALIGN;
freelist = memory;
poolbase = memory;
*freelist = 1;
if (first) {
(poolbase + 1)->s.ptr = 1;
(poolbase + 1)->s.size = nunits - 1;
}
} | false | false | false | false | false | 0 |
set_options(or_options_t *new_val, char **msg)
{
int i;
smartlist_t *elements;
config_line_t *line;
or_options_t *old_options = global_options;
global_options = new_val;
/* Note that we pass the *old* options below, for comparison. It
* pulls the new options directly out of global_options. */
if (optio... | false | false | false | false | false | 0 |
FillWindow(const byte *str, size_t length)
{
unsigned int maxBlockSize = (unsigned int)STDMIN(2UL*DSIZE, 0xffffUL);
if (m_stringStart >= maxBlockSize - MAX_MATCH)
{
if (m_blockStart < DSIZE)
EndBlock(false);
memcpy(m_byteBuffer, m_byteBuffer + DSIZE, DSIZE);
m_dictionaryEnd = m_dictionaryEnd < DSIZE ? 0 ... | false | false | false | false | false | 0 |
vmx_get_lpage_level(void)
{
if (enable_ept && !cpu_has_vmx_ept_1g_page())
return PT_DIRECTORY_LEVEL;
else
/* For shadow and EPT supported 1GB page */
return PT_PDPE_LEVEL;
} | false | false | false | false | false | 0 |
mvumi_io_attach(struct mvumi_hba *mhba)
{
struct Scsi_Host *host = mhba->shost;
struct scsi_device *sdev = NULL;
int ret;
unsigned int max_sg = (mhba->ib_max_size + 4 -
sizeof(struct mvumi_msg_frame)) / sizeof(struct mvumi_sgl);
host->irq = mhba->pdev->irq;
host->unique_id = mhba->unique_id;
host->can_queue =... | false | false | false | false | false | 0 |
clickatell_parse_reply(SMSCConn *conn, Msg *msg, int status,
List *headers, Octstr *body)
{
if (status == HTTP_OK || status == HTTP_ACCEPTED) {
Dict *param;
Octstr *msgid;
if ((param = clickatell_parse_body(body)) != NULL &&
(msgid = dict_get(param... | false | false | false | false | false | 0 |
expm1l(long double x)
{
long double px, qx, xx;
int k;
/* Overflow. */
if (x > MAXLOGL)
return (huge*huge); /* overflow */
if (x == 0.0)
return x;
/* Minimum value. */
if (x < minarg)
return -1.0L;
xx = C1 + C2;
/* Express x = ln 2 (k + remainder), remainder not exceeding 1/2. */
px = floorl (0.5 + x / xx)... | false | false | false | false | false | 0 |
main (argc, argv)
int argc;
char **argv;
{
int c, nfiles, retCode = 0;
volatile int i;
while ((c = getopt (argc, argv, "Ceinqv")) != EOF) {
switch (c) {
case 'C': /* repair derived object cache */
repairCache = TRUE;
break;
case 'e': /* edit mode */
verbosityLevel = EDIT... | false | false | false | false | false | 0 |
gst_tag_mux_render_end_tag (GstTagMux * mux)
{
GstTagMuxClass *klass;
GstBuffer *buffer;
GstTagList *taglist;
GstFlowReturn ret;
taglist = gst_tag_mux_get_tags (mux);
klass = GST_TAG_MUX_CLASS (G_OBJECT_GET_CLASS (mux));
if (klass->render_end_tag == NULL)
goto no_vfunc;
buffer = klass->render_en... | false | false | false | false | false | 0 |
ccw_clear(struct vc_data *vc, struct fb_info *info, int sy,
int sx, int height, int width)
{
struct fbcon_ops *ops = info->fbcon_par;
struct fb_fillrect region;
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
u32 vyres = GETVYRES(ops->p->scrollmode, info);
region.color = attr_bgcol_ec(bgshift,vc,info);
reg... | false | false | false | false | false | 0 |
get_sockstat(struct sockstat *s)
{
char buf[256];
FILE *fp;
memset(s, 0, sizeof(*s));
if ((fp = net_sockstat_open()) == NULL)
return -1;
while(fgets(buf, sizeof(buf), fp) != NULL)
get_sockstat_line(buf, s);
fclose(fp);
if ((fp = net_sockstat6_open()) == NULL)
return 0;
while(fgets(buf, sizeof(buf), fp)... | true | true | false | false | false | 1 |
get_bgram1_tile_info(int tile_index)
{
int attr = xain_bgram1[tile_index | 0x400];
SET_TILE_INFO(
1,
xain_bgram1[tile_index] | ((attr & 7) << 8),
(attr & 0x70) >> 4,
(attr & 0x80) ? TILE_FLIPX : 0)
} | false | false | false | false | false | 0 |
showDrugInfo(const QModelIndex &item)
{
Internal::DrugInfo di(item.row(), this);
di.exec();
} | false | false | false | false | false | 0 |
convertMode(unsigned long mode_)
{
::A r=aplus_nl;
int i,j,s=0,count=0;
char *str;
for (i=2; i<=MSBottom; i*=2)
{
if (stringEnumHashTable()->lookup((unsigned long)(mode_&i))!=0) count++;
}
if (count>0)
{
r=gv(Et,count);
for (j=0,i=2; i<=MSBottom; i*=2)
{
if ((str=(char *)s... | false | false | false | false | false | 0 |
index_mm_open(struct kmod_ctx *ctx, const char *filename,
bool populate, unsigned long long *stamp)
{
int fd;
int flags;
struct stat st;
struct index_mm *idx;
struct {
uint32_t magic;
uint32_t version;
uint32_t root_offset;
} hdr;
void *p;
DBG(ctx, "file=%s\n", filename);
idx = malloc(sizeof(*idx))... | false | false | false | false | false | 0 |
ifec_rx_process ( struct net_device *netdev )
{
struct ifec_private *priv = netdev->priv;
int cur_rx = priv->cur_rx;
struct io_buffer *iob = priv->rx_iobs[cur_rx];
struct ifec_rfd *rfd = priv->rfds[cur_rx];
unsigned int rx_len;
s16 status;
DBGP ( "ifec_rx_process\n" );
/* Process any received packets */
wh... | false | false | false | false | false | 0 |
TidQualFromExpr(Node *expr, int varno)
{
List *rlst = NIL;
ListCell *l;
if (is_opclause(expr))
{
/* base case: check for tideq opclause */
if (IsTidEqualClause((OpExpr *) expr, varno))
rlst = list_make1(expr);
}
else if (expr && IsA(expr, ScalarArrayOpExpr))
{
/* another base case: check for tid =... | false | false | false | true | false | 1 |
netsnmp_table_dataset_replace_row(netsnmp_table_data_set *table,
netsnmp_table_row *origrow,
netsnmp_table_row *newrow)
{
if (!table)
return;
netsnmp_table_data_replace_row(table->table, origrow, newrow);
} | false | false | false | false | false | 0 |
output_subframe_verbatim(FlacEncodeContext *s, int ch)
{
int i;
FlacFrame *frame;
FlacSubframe *sub;
int32_t res;
frame = &s->frame;
sub = &frame->subframes[ch];
for(i=0; i<frame->blocksize; i++) {
res = sub->residual[i];
put_sbits(&s->pb, sub->obits, res);
}
} | false | false | false | false | false | 0 |
gth_filter_real_create_control (GthTest *test)
{
GthFilter *filter = (GthFilter *) test;
GtkWidget *control = NULL;
switch (filter->priv->limit_type) {
case GTH_LIMIT_TYPE_NONE:
break;
case GTH_LIMIT_TYPE_FILES:
control = create_control_for_files (filter);
break;
case GTH_LIMIT_TYPE_SIZE:
control = creat... | false | false | false | false | false | 0 |
isMeson() const {
if (idSave <= 100 || (idSave >= 1000000 && idSave <= 9000000)
|| idSave >= 9900000) return false;
if (idSave == 130 || idSave == 310) return true;
if (idSave%10 == 0 || (idSave/10)%10 == 0 || (idSave/100)%10 == 0
|| (idSave/1000)%10 != 0) return false;
return true;
} | false | false | false | false | false | 0 |
destroy_user_vars (void)
{
int i, j;
for (i=0; i<n_vars; i++) {
if (uvars[i] == NULL) {
break;
}
user_var_destroy(uvars[i]);
for (j=i; j<n_vars-1; j++) {
uvars[j] = uvars[j+1];
}
uvars[n_vars-1] = NULL;
i--;
}
set_nvars(0, "destroy_user_vars");
free(uvars);
uvars = NULL;
... | false | false | false | false | false | 0 |
kmo_imagelist_get_flux(const cpl_imagelist *cube)
{
int nz = 0;
const cpl_image *img = NULL;
double flux = 0.0;
KMO_TRY
{
KMO_TRY_ASSURE(cube != NULL,
CPL_ERROR_NULL_INPUT,
"No input data is provided!");
... | false | false | false | false | false | 0 |
setMax(u32 max)
{
Max = max;
if (Text.size() > Max && Max != 0)
Text = Text.subString(0, Max);
} | false | false | false | false | false | 0 |
saa7164_cmd_alloc_seqno(struct saa7164_dev *dev)
{
int i, ret = -1;
mutex_lock(&dev->lock);
for (i = 0; i < SAA_CMD_MAX_MSG_UNITS; i++) {
if (dev->cmds[i].inuse == 0) {
dev->cmds[i].inuse = 1;
dev->cmds[i].signalled = 0;
dev->cmds[i].timeout = 0;
ret = dev->cmds[i].seqno;
break;
}
}
mutex_unloc... | false | false | false | false | false | 0 |
SetRotAtomsByFix(OBMol &mol)
{
int ref[4];
OBRotor *rotor;
vector<int> rotatoms;
vector<int>::iterator j;
vector<OBRotor*>::iterator i;
GetDFFVector(mol,_dffv,_fixedatoms);
for (rotor = BeginRotor(i);rotor;rotor = NextRotor(i))
{
rotatoms.clear();
rotor->GetDihedral... | false | false | false | false | false | 0 |
dictplace(struct dict *d, int len)
{
char *place;
struct localstor *ls, *newls;
if (len >= LOCALSTORBLOCK)
return NULL;
ls = d->localdict;
if (!ls)
return NULL;
/* if not enough space is allocated, insert new block at head of list
* so d->localstor always contains the block from which... | false | false | false | false | false | 0 |
GetPlainAnsiFileName(
const TCHAR * szFileName,
char * szPlainName)
{
const TCHAR * szPlainNameT = GetPlainFileNameT(szFileName);
// Convert the plain name to ANSI
while(*szPlainNameT != 0)
*szPlainName++ = (char)*szPlainNameT++;
*szPlainName = 0;
} | false | false | false | false | false | 0 |
FuncIDText (uint16_t funcid)
{
switch (funcid)
{
/* Request */
case ISNS_REG_DEV_ATTR_REQ : return("Register Device Attribute Request");
case ISNS_DEV_ATTR_QRY_REQ : return("Device Attribute Query Request");
case ISNS_DEV_GET_NXT_REQ : return("Device Get Next Request");
case ISNS_DEREG_DEV_REQ ... | false | false | false | false | false | 0 |
gconf_editor_window_copy_key_name (GtkAction *action, GtkWidget *callback_data)
{
GConfEditorWindow *window = GCONF_EDITOR_WINDOW (callback_data);
char *path;
gchar *key;
GtkTreeIter iter;
GtkTreeIter child_iter;
if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection
(GTK_TREE_VIEW (window->... | false | false | false | false | false | 0 |
filter_changed (GtkWidget *entry, GParamSpec *pspec, GtkWidget *list)
{
const gchar *pattern;
GtkTreeModel *filter_model;
GtkTreeModel *model;
pattern = gtk_entry_get_text (GTK_ENTRY (entry));
filter_model = gtk_tree_view_get_model (GTK_TREE_VIEW (list));
model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_... | false | false | false | false | false | 0 |
session_request_multi(dns_sock_t *sock, int thread_id)
{
dns_sock_buf_t *sbuf;
dns_session_t *session;
plog(LOG_DEBUG, "%s: multiworker mode", MODULE);
if ((sbuf = dns_pool_get(&SessionBufPool)) == NULL) {
plog(LOG_CRIT, "%s: bufpool empty!!", __func__);
return -1;
}
if (sessi... | false | false | false | false | false | 0 |
commit_index(
git_commit **i_commit,
git_index *index,
git_signature *stasher,
const char *message,
const git_commit *parent)
{
git_tree *i_tree = NULL;
git_oid i_commit_oid;
git_buf msg = GIT_BUF_INIT;
int error;
if ((error = build_tree_from_index(&i_tree, index)) < 0)
goto cleanup;
if ((error = git_buf... | false | false | false | false | false | 0 |
gee_tree_map_entry_set_real_higher (GeeAbstractSortedSet* base, GeeMapEntry* item) {
GeeTreeMapEntrySet * self;
GeeMapEntry* result = NULL;
GeeTreeMapNode* l = NULL;
GeeTreeMap* _tmp0_ = NULL;
GeeMapEntry* _tmp1_ = NULL;
gconstpointer _tmp2_ = NULL;
gconstpointer _tmp3_ = NULL;
GeeTreeMapNode* _tmp4_ = NULL;
G... | false | false | false | false | false | 0 |
matcher_run(const struct cli_matcher *root,
const unsigned char *buffer, uint32_t length,
const char **virname, struct cli_ac_data *mdata,
uint32_t offset,
const struct cli_target_info *tinfo,
cli_file_t ftype,
struct cli_matched_type **ftoffset,
unsigned i... | false | false | false | false | false | 0 |
HistogramCombineEntropyBin(
VP8LHistogramSet* const image_histo,
VP8LHistogram* cur_combo,
int16_t* const bin_map, int bin_depth, int num_bins,
double combine_cost_factor, int low_effort) {
int bin_id;
VP8LHistogram** const histograms = image_histo->histograms;
for (bin_id = 0; bin_id < num_bins;... | false | false | false | false | false | 0 |
read(int &i)
{
READ_INTEGER(i, int);
} | false | false | false | false | false | 0 |
ossl_cipher_set_key(VALUE self, VALUE key)
{
EVP_CIPHER_CTX *ctx;
StringValue(key);
GetCipher(self, ctx);
if (RSTRING_LEN(key) < EVP_CIPHER_CTX_key_length(ctx))
ossl_raise(eCipherError, "key length too short");
if (EVP_CipherInit_ex(ctx, NULL, NULL, (unsigned char *)RSTRING_PTR(key), NULL... | false | false | false | false | false | 0 |
e_table_header_set_selection (ETableHeader *eth,
gboolean allow_selection)
{
g_return_if_fail (eth != NULL);
g_return_if_fail (E_IS_TABLE_HEADER (eth));
} | false | false | false | false | false | 0 |
gretl_matrix_xtr_symmetric (gretl_matrix *m)
{
double x;
int mij, mji;
int i, j;
for (i=0; i<m->rows; i++) {
for (j=0; j<i; j++) {
mij = mdx(m,i,j);
mji = mdx(m,j,i);
x = m->val[mij];
x += m->val[mji];
m->val[mij] = m->val[mji] = 0.5 * x;
}
}
} | false | false | false | false | false | 0 |
evd_resolver_on_resolver_result (GResolver *resolver,
GAsyncResult *async_result,
gpointer user_data)
{
GList *result = NULL;
GError *error = NULL;
GSimpleAsyncResult *res;
EvdResolverData *data;
res = G_SIMPLE_ASYNC_RESULT (user_data)... | false | false | false | false | false | 0 |
nouveau_check_framebuffer_complete(struct gl_context *ctx,
struct gl_framebuffer *fb)
{
struct gl_renderbuffer_attachment *color =
&fb->Attachment[BUFFER_COLOR0];
struct gl_renderbuffer_attachment *depth =
&fb->Attachment[BUFFER_DEPTH];
int color_bpp = 0, zeta_bpp;
if (color->Type == GL_TEXTURE) {
col... | false | false | false | false | false | 0 |
insert_packed_refs(const char *packed_refs, struct ref **list)
{
FILE *f = fopen(packed_refs, "r");
static char buffer[PATH_MAX];
if (!f)
return;
for (;;) {
int cmp = cmp, len;
if (!fgets(buffer, sizeof(buffer), f)) {
fclose(f);
return;
}
if (hexval(buffer[0]) > 0xf)
continue;
len = strlen(... | false | false | false | false | false | 0 |
bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func)
{
if (!bd) {
return;
}
bd_mutex_lock(&bd->mutex);
gc_free(&bd->graphics_controller);
if (func) {
bd->graphics_controller = gc_init(bd->regs, handle, func);
}
bd_mutex_unlock(&bd->mutex);
} | false | false | false | false | false | 0 |
qce_ahash_update(struct ahash_request *req)
{
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
struct qce_sha_reqctx *rctx = ahash_request_ctx(req);
struct qce_alg_template *tmpl = to_ahash_tmpl(req->base.tfm);
struct qce_device *qce = tmpl->qce;
struct scatterlist *sg_last, *sg;
unsigned int total, len;
uns... | false | false | false | false | false | 0 |
file_chooser_dialog_response_cb (GtkDialog *dialog,
int response,
gpointer user_data)
{
GthSlideshowPreferences *self = user_data;
switch (response) {
case GTK_RESPONSE_DELETE_EVENT:
case GTK_RESPONSE_CANCEL:
gtk_widget_destroy (GTK_WIDGET (dialog));
break;
case GTK_RESPONSE_OK:
{
GSL... | false | false | false | false | false | 0 |
sky2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct mii_ioctl_data *data = if_mii(ifr);
struct sky2_port *sky2 = netdev_priv(dev);
struct sky2_hw *hw = sky2->hw;
int err = -EOPNOTSUPP;
if (!netif_running(dev))
return -ENODEV; /* Phy still in reset */
switch (cmd) {
case SIOCGMIIPHY:
dat... | false | false | false | false | false | 0 |
multipart_buffer_new(char *boundary, long length, request_rec *r)
{
multipart_buffer *self = (multipart_buffer *)
apr_pcalloc (r->pool, sizeof(multipart_buffer));
int minsize = strlen(boundary)+6;
if(minsize < FILLUNIT) minsize = FILLUNIT;
self->r = r;
self->buffer = (char *) apr_pcalloc(r->pool,... | false | false | false | false | false | 0 |
xr(A z,A a,A w)
{
I i,f=a->t==Et,n=f?a->n:1;
if(f)for(i=n;i--;*--Y=ic((A)a->p[i]));
*--Y=0,z=(A)xin(z,n,w),++Y;
if(f)DO(n,dc((A)(*Y++)));
R(I)z;
} | false | false | false | false | true | 1 |
it87_init_device(struct platform_device *pdev)
{
struct it87_sio_data *sio_data = dev_get_platdata(&pdev->dev);
struct it87_data *data = platform_get_drvdata(pdev);
int tmp, i;
u8 mask;
/*
* For each PWM channel:
* - If it is in automatic mode, setting to manual mode should set
* the fan to full speed by ... | false | false | false | false | false | 0 |
hash_get_column(HASH * Hash, const char *key)
{
HASH_COLUMN *Column;
if (key == NULL || *key == '\0')
return -1;
Column = bsearch(key, Hash->Columns, Hash->nColumns, sizeof(HASH_COLUMN), hash_lookup_column);
if (Column == NULL)
return -1;
return Column->val;
} | false | false | false | false | false | 0 |
_ocfs2_free_suballoc_bits(handle_t *handle,
struct inode *alloc_inode,
struct buffer_head *alloc_bh,
unsigned int start_bit,
u64 bg_blkno,
unsigned int count,
void (*undo_fn)(unsigned int bit,
unsigned long *bitmap))
{
int status = 0;
u32 tmp_used;
str... | false | false | false | false | false | 0 |
copy_from(cdrAnyMemoryStream& mbs)
{
if( !pd_disc->copy_from(mbs) ) return 0;
discriminatorHasChanged();
pd_curr_index = 0;
return !pd_member || pd_member->copy_from(mbs);
} | false | false | false | false | false | 0 |
gst_rtp_mpa_robust_depay_process (GstBaseRTPDepayload * depayload,
GstBuffer * buf)
{
GstRtpMPARobustDepay *rtpmpadepay;
gint payload_len, offset;
guint8 *payload;
gboolean cont, dtype;
guint av, size;
GstClockTime timestamp;
rtpmpadepay = GST_RTP_MPA_ROBUST_DEPAY (depayload);
payload_len = gst_rt... | false | false | false | false | false | 0 |
cm3323_get_it_bits(struct cm3323_data *data)
{
int bits;
bits = (data->reg_conf & CM3323_CONF_IT_MASK) >>
CM3323_CONF_IT_SHIFT;
if (bits >= ARRAY_SIZE(cm3323_int_time))
return -EINVAL;
return bits;
} | 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.