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 |
|---|---|---|---|---|---|---|
automap_edges_mindist(void)
{
edgelist *p;
for(p = all_edges; p; p=p->next) {
int len = p->node->is_oneway ? 4 : 2;
p->node->min_length = p->node->guess_length = len;
}
} | false | false | false | false | false | 0 |
FindAttribute(const char* attr, Direction dir) const
{
if (attr)
{
if (dir == Both || dir == Encode)
{
avm::vector<AttributeInfo>::const_iterator it;
for (it = encoder_info.begin(); it != encoder_info.end(); it++)
if (it->IsAttr(attr))
return &(*it);
}
if (dir == Both || dir == Decode)
{
... | false | false | false | false | false | 0 |
cnic_get_vlan(struct net_device *dev,
struct net_device **vlan_dev)
{
if (dev->priv_flags & IFF_802_1Q_VLAN) {
*vlan_dev = vlan_dev_real_dev(dev);
return vlan_dev_vlan_id(dev);
}
*vlan_dev = dev;
return 0;
} | false | false | false | false | false | 0 |
midgard_core_dbcolumn_new(void)
{
MidgardDBColumn *mdc = g_new(MidgardDBColumn, 1);
mdc->table_name = NULL;
mdc->column_name = NULL;
mdc->column_desc = NULL;
mdc->dbtype = NULL;
mdc->gtype = 0;
mdc->index = FALSE;
mdc->unique = FALSE;
mdc->gvalue = NULL;
mdc->primary = FALSE;
mdc->dvalue = NULL;
mdc->aut... | false | false | false | false | false | 0 |
pixmapToBase64(const QPixmap &pixmap)
{
QByteArray byteArray;
if (pixmap.isNull())
return byteArray;
QBuffer buffer(&byteArray);
if (!pixmap.save(&buffer, "PNG")) {
LOG_ERROR_FOR("Global",
QString("Unable to transform QPixmap to base64 QByteArray. "
... | false | false | false | false | false | 0 |
wait_or_whine(pid_t pid, const char *argv0, int silent_exec_failure)
{
int status, code = -1;
pid_t waiting;
int failed_errno = 0;
while ((waiting = waitpid(pid, &status, 0)) < 0 && errno == EINTR)
; /* nothing */
if (waiting < 0) {
failed_errno = errno;
error("waitpid for %s failed: %s", argv0, strerror(e... | false | false | false | false | false | 0 |
visitStoreInst(StoreInst &SI) {
auto &DL = SI.getModule()->getDataLayout();
uint64_t Size = DL.getTypeStoreSize(SI.getValueOperand()->getType());
if (Size == 0)
return;
uint64_t Align;
if (ClPreserveAlignment) {
Align = SI.getAlignment();
if (Align == 0)
Align = DL.getABITypeAlignment(SI.ge... | false | false | false | false | false | 0 |
popup_candidate_window (GtkIMContextHangul *hcontext)
{
char* key;
HanjaList* list;
if (hcontext->candidate != NULL)
{
close_candidate_window(hcontext);
}
if (hanja_table == NULL)
hanja_table = hanja_table_load(NULL);
key = im_hangul_get_candidate_string(hcontext);
list = hanja_table_... | false | false | false | false | false | 0 |
sqrt_vec(int n, float *vec)
{
int i;
double d;
for (i = 0; i < n; i++) {
/* do this in two steps to avoid a bug in gcc-4.00 on AIX */
d = sqrt(vec[i]);
vec[i] = (float) d;
}
} | false | false | false | false | false | 0 |
TAES_ENCRYPT(bst128 in,u32* rkey_enc,bst128 counter){
bst128 out;
int i;
u32 tempcount;
/*set rkeys 1,5,9 using the backups*/
for(i=0;i<4;i++){
tempcount=SWAP(counter.t[i]);
rkey_enc[4+i]=rkey_enc[44+i]^tempcount;
rkey_enc[20+i]=rkey_enc[48+i]^tempcount;
rkey_enc[36+i]=rkey_enc[52+i]^t... | false | false | false | false | false | 0 |
defineDotEdges(pANTLR3_BASE_TREE_ADAPTOR adaptor, void * t, pANTLR3_STRING dotSpec)
{
// How many nodes are we talking about?
//
int nCount;
int i;
if (t == NULL)
{
// No tree, so do nothing
//
return;
}
// Count the nodes
//
nCount = adaptor->getChildCount(adaptor, t);
if (nCount == 0)
{
// This... | true | true | false | false | false | 1 |
DefineAccessor(String* name,
bool is_getter,
Object* fun,
PropertyAttributes attributes) {
ASSERT(fun->IsJSFunction() || fun->IsUndefined());
// Check access rights if needed.
if (IsAccessCheckNeeded(... | false | false | false | false | false | 0 |
generateKt(const Lorentz5Momentum& p1,
const Lorentz5Momentum& p2,
Energy pt) {
if ( (p1+p2).m2() <= ZERO ) {
cerr << "cannot boost ... " << ((p1+p2).m2()/GeV2) << "\n";
throw Veto();
}
Boost beta = (p1+p2).findBoostToCM();
Lorentz5Momentum p1c = p1;
if (beta.mag2() > Consta... | false | false | false | false | false | 0 |
rtx_equal_p (rtx x, rtx y)
{
int i;
int j;
enum rtx_code code;
const char *fmt;
if (x == y)
return 1;
if (x == 0 || y == 0)
return 0;
code = GET_CODE (x);
/* Rtx's of different codes cannot be equal. */
if (code != GET_CODE (y))
return 0;
/* (MULT:SI x y) and (MULT:HI x y) are NOT eq... | false | false | false | false | false | 0 |
opal_graph_destruct(opal_graph_t *graph)
{
opal_adjacency_list_t *aj_list;
while (false == opal_list_is_empty(graph->adjacency_list)) {
aj_list = (opal_adjacency_list_t *)opal_list_remove_first(graph->adjacency_list);
OBJ_RELEASE(aj_list);
}
OBJ_RELEASE(graph->adjacency_list);
graph... | false | false | false | false | false | 0 |
gbemol_mpd_init (GbemolMpd *obj)
{
obj->priv = g_new0 (GbemolMpdPrivate, 1);
/* Default values */
obj->status = NULL;
obj->priv->host = g_strdup ("localhost");
obj->priv->pass = NULL;
obj->priv->port = 6600;
obj->priv->timeout = 1.0;
obj->priv->connected = FALSE;
obj->priv->conn = NULL;
ob... | false | false | false | false | false | 0 |
mr_nick(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
struct Client *target_p = NULL;
char nick[NICKLEN];
char *s = NULL;
if (parc < 2 || EmptyString(parv[1]))
{
sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN),
me.name, EmptyString(parv[0]) ? "*" : ... | false | false | false | false | false | 0 |
g_box_consider_split(ConsiderSplitContext *context, int dimNum,
double rightLower, int minLeftCount,
double leftUpper, int maxLeftCount)
{
int leftCount,
rightCount;
float4 ratio,
overlap;
double range;
/*
* Calculate entries distribution ratio assuming most uniform distribution
* of co... | false | false | false | false | false | 0 |
alarm_list_window_rows_reordered (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer arg3,
gpointer data)
{
AlarmApplet *applet = (AlarmApplet *)data;
... | false | false | false | false | false | 0 |
ATL_dJIK0x0x5TN4x1x1_a1_bX
(const int M, const int N, const int K, const double alpha, const double * ATL_RESTRICT A, const int lda, const double * ATL_RESTRICT B, const int ldb, const double beta, double * ATL_RESTRICT C, const int ldc)
/*
* matmul with TA=T, TB=N, MB=0, NB=0, KB=5,
* lda=5, ldb=5, ldc=0, mu=4, ... | false | false | false | false | false | 0 |
tenm_collided_circle_segment2(double p_x, double p_y, double p_r,
double q_a_x, double q_a_y,
double q_b_x, double q_b_y)
{
if (tenm_point_nearer(p_x, p_y, q_a_x, q_a_y, p_r))
return 1;
if (tenm_point_nearer(p_x, p_y, q_b_x, q_b_y, p_r))
return 1;
... | false | false | false | false | false | 0 |
check_required_attribute(const string & attr)
{
map < string, XMLAttribute >::iterator i = attribute_table.find(attr);
if (i == attribute_table.end())
ddx_fatal_error(this, "Required attribute '%s' not found.",
attr.c_str());
return true;
} | false | false | false | false | false | 0 |
Verify() const {
if (Addr == 0) return true;
SmallVector<Instruction*, 8> Tmp(InstInputs.begin(), InstInputs.end());
if (!VerifySubExpr(Addr, Tmp))
return false;
if (!Tmp.empty()) {
errs() << "PHITransAddr contains extra instructions:\n";
for (unsigned i = 0, e = InstInputs.size(); i != e; ++i)
... | false | false | false | false | false | 0 |
Scale(double *p1, double *p2, double eventPos[2])
{
//Get the motion vector
double v[3];
v[0] = p2[0] - p1[0];
v[1] = p2[1] - p1[1];
v[2] = p2[2] - p1[2];
double *bounds = this->GetBounds();
// Compute the scale factor
double sf = vtkMath::Norm(v) /
sqrt( (bounds[1]-bounds[0])*(bounds[1]-bounds[0... | false | false | false | false | false | 0 |
Exists()
{
if (eExists == EXIST_UNKNOWN)
{
/* Consider that only the files whose extension ends up with one that is */
/* listed in CPL_VSIL_CURL_ALLOWED_EXTENSIONS exist on the server */
/* This can speeds up dramatically open experience, in case the server */
/* cannot return a... | false | false | false | false | false | 0 |
doConfigure()
{
if(this->CurrentState == Configuring)
{
// stop configure
doInterrupt();
return;
}
if(!prepareConfigure())
{
return;
}
this->enterState(Configuring);
bool ret = doConfigureInternal();
if(ret)
{
this->ConfigureNeeded = false;
}
if(ret && !this-... | false | false | false | false | false | 0 |
dce_v8_0_crtc_load_lut(struct drm_crtc *crtc)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
struct drm_device *dev = crtc->dev;
struct amdgpu_device *adev = dev->dev_private;
int i;
DRM_DEBUG_KMS("%d\n", amdgpu_crtc->crtc_id);
WREG32(mmINPUT_CSC_CONTROL + amdgpu_crtc->crtc_offset,
((INPUT_CS... | false | false | false | false | false | 0 |
compare_mode_sense(Microtek_Scanner *ms, int *match)
{
uint8_t data[20], comm[6] = { 0x1A, 0, 0, 0, 0, 0};
size_t lenp;
SANE_Status status;
int i;
DBG(23, ".compare_mode_sense %d...\n", ms->sfd);
if (ms->onepass) comm[4] = 0x13;
else if (ms->midtone_support) comm[4] = 0x0B;
else comm[4] = 0x0A;
lenp ... | false | false | false | false | false | 0 |
rstrdup(const char *s)
{
char *t;
#ifndef HAVE_STRDUP
int i;
#endif
if (s==NULL) return NULL;
#ifdef HAVE_STRDUP
t=strdup(s);
#else
t=malloc((strlen(s)+1)*sizeof(char));
#endif
if (t==NULL && rm_trap)
{
printf("Memory duplication error: Out of memory.\n");
exit(EXIT_FAILURE);
}
if (rm... | false | false | false | true | false | 1 |
fileName(const KUrl& url) const
{
return encode(url.fileName());
} | false | false | false | false | false | 0 |
PR_ErrorToString(PRErrorCode code, PRLanguageCode language)
{
/* static buffer only used if code is using inconsistent error message
* numbers, so just ignore the possible thread contention
*/
static char buffer[25];
const char *msg;
int offset;
PRErrorCode table_num;
struct PRErrorTa... | false | false | false | false | false | 0 |
dsp_calc_ea(Uint32 ea_mode, Uint32 *dst_addr)
{
Uint32 value, numreg, curreg;
value = (ea_mode >> 3) & BITMASK(3);
numreg = ea_mode & BITMASK(3);
switch (value) {
case 0:
/* (Rx)-Nx */
*dst_addr = dsp_core->registers[DSP_REG_R0+numreg];
dsp_update_rn(numreg, -dsp_core->registers[DSP_REG_N0+numreg]);
... | false | false | false | false | false | 0 |
change_nation(int newNationRecno)
{
err_when( newNationRecno && nation_array.is_deleted(newNationRecno) );
err_when( unit_mode == UNIT_MODE_REBEL ); // rebels do not change nation
//---------------------------------//
int oldAiUnit = ai_unit;
int oldNationRecno = nation_recno;
group_select_id = 0; // clear gr... | false | false | false | false | false | 0 |
doc_unref(Doc *d)
{
int refcount;
GSview *a = d->app;
if (d->refcount > 0)
d->refcount--;
refcount = d->refcount;
if (debug & DEBUG_DEV) {
char buf[MAXSTR];
snprintf(buf, sizeof(buf), "doc refcount=%d\n", refcount);
buf[sizeof(buf)-1]='\0';
app_msg_len_nolock(d->app, buf, (int)strlen(buf));
... | false | false | false | false | false | 0 |
insert_jmp_if_necessary(RfmBranch branch)
{
RfmStm label_stm;
RfmOperand op_label;
RfmStm jmp_stm;
RfmQuad quad;
if ((branch->branch_kind == RFM_BRANCH_TAKEN) ||
(branch->branch_kind == RFM_BRANCH_NOT_TAKEN)) {
if (branch->fork_block->next != branch->join_block) {
... | false | false | false | false | false | 0 |
save_cl_flags(void)
{
int indx;
long int moving_bit = 1;
cl_flags_bit_map = 0;
for ( indx = 0 ; indx < (number_of_cl_flags - 1) ; indx++ )
{
if ( *(cl_flags_list[indx].flag_var) )
{
cl_flags_bit_map |= moving_bit; /* The moving finger writes, */
}
moving_bit <<= 1; /*... | false | false | false | false | false | 0 |
write_silence(FILE *out, int samples)
{
int a;
for (a = 0;a < samples;a++)
if (fputc(0x80, out) == EOF)
return -1;
return a;
} | false | false | false | false | false | 0 |
publisher_retry(struct publisher_entry *pe, int delay, const char *msg)
{
struct pubdata *pd;
publisher_check(pe);
g_assert(NULL == pe->publish_ev);
g_assert(delay > 0);
pd = get_pubdata(pe->sha1);
if (pd != NULL) {
pd->next_enqueue = time_advance(tm_time(), UNSIGNED(delay));
dbmw_write(db_pubdata, pe->sha1... | false | false | false | false | false | 0 |
vidioc_s_input(struct file *file, void *fh, unsigned int input)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct av7110 *av7110 = (struct av7110 *)dev->ext_priv;
dprintk(2, "VIDIOC_S_INPUT: %d\n", input);
if (!av7110->analog_tuner_flags)
return input ? -EINVAL : 0;
if (input >= 4)
return -... | false | false | false | false | false | 0 |
dotconf_register_options(configfile_t *configfile, const configoption_t * options)
{
int num = configfile->config_option_count;
#define GROW_BY 10
/* resize memoryblock for options blockwise */
if (configfile->config_options == NULL)
configfile->config_options = malloc(sizeof(void *) * (GROW_BY + 1));
else
{... | false | false | false | false | true | 1 |
hybrid_chat_window_update_tips(HybridChatWindow *window)
{
GtkTreeModel *model;
GtkTreePath *path;
HybridConversation *conv;
HybridBuddy *buddy;
gchar *markup;
g_return_if_fail(window != NULL);
if (!IS_SYSTEM_CHAT(window)) {
return;
}
conv ... | false | false | false | false | false | 0 |
png_destroy_gamma_table(png_structp png_ptr)
{
png_free(png_ptr, png_ptr->gamma_table);
png_ptr->gamma_table = NULL;
if (png_ptr->gamma_16_table != NULL)
{
int i;
int istop = (1 << (8 - png_ptr->gamma_shift));
for (i = 0; i < istop; i++)
{
png_free(png_ptr, png_ptr->gamma_1... | false | false | false | false | false | 0 |
addCurrentConstraint()
{
TimeConstraint *ctr=NULL;
double weight;
QString tmp=weightLineEdit->text();
weight_sscanf(tmp, "%lf", &weight);
if(weight<100.0 || weight>100.0){
QMessageBox::warning(this, tr("FET information"),
tr("Invalid weight (percentage). It has to be 100"));
return;
}
QList<int> days;
... | false | false | false | false | false | 0 |
Bind()
{
if(this->FBOIndex!=0 && this->PreviousFBOIndex==-1)
{
this->Context->MakeCurrent();
GLint framebufferBinding;
glGetIntegerv(vtkgl::FRAMEBUFFER_BINDING_EXT,&framebufferBinding);
this->PreviousFBOIndex=framebufferBinding;
vtkgl::BindFramebufferEXT(vtkgl::FRAMEBUFFER_EXT, this->FBOIndex)... | false | false | false | false | false | 0 |
snd_at73c213_interrupt(int irq, void *dev_id)
{
struct snd_at73c213 *chip = dev_id;
struct snd_pcm_runtime *runtime = chip->substream->runtime;
u32 status;
int offset;
int block_size;
int next_period;
int retval = IRQ_NONE;
spin_lock(&chip->lock);
block_size = frames_to_bytes(runtime, runtime->period_size);
... | false | false | false | false | false | 0 |
set(int W, int H, const uchar *bits) {
delete b;
bitmap(new Fl_Bitmap(bits, W, H));
} | false | false | false | false | false | 0 |
check_hostaliases(int nhostaliases, char **hostaliases)
{
int i;
for (i = 0; i < nhostaliases; i++) {
if (check_hostname(hostaliases[i]) != GFARM_ERR_NO_ERROR)
return (APP_ERR_HOSTALIAS_IS_ALREADY_REGISERED);
}
return (GFARM_ERR_NO_ERROR);
} | false | false | false | false | false | 0 |
static_list_system (gamgi_window *window)
{
GtkWidget *dialog = window->dialog0;
gamgi_slist *slist = NULL;
GtkEntry *entry;
char system[GAMGI_ENGINE_TOKEN];
char lattice[GAMGI_ENGINE_TOKEN];
char **systems = gamgi_phys_symmetry_systems;
char **groups = gamgi_phys_symmetry_groups;
const char *name;
int number, n;
/***... | false | false | false | false | false | 0 |
isr_txrdy(SLMP_INFO * info)
{
if ( debug_level >= DEBUG_LEVEL_ISR )
printk("%s(%d):%s isr_txrdy() tx_count=%d\n",
__FILE__,__LINE__,info->device_name,info->tx_count);
if (info->params.mode != MGSL_MODE_ASYNC) {
/* disable TXRDY IRQ, enable IDLE IRQ */
info->ie0_value &= ~TXRDYE;
info->ie1_value |= IDLE;
... | false | false | false | false | false | 0 |
mono_type_is_enum_type (MonoType *type)
{
if (type->type == MONO_TYPE_VALUETYPE && type->data.klass->enumtype)
return TRUE;
if (type->type == MONO_TYPE_GENERICINST && type->data.generic_class->container_class->enumtype)
return TRUE;
return FALSE;
} | false | false | false | false | false | 0 |
gonzo_alias_delete_destination_sub(gonzo_ty *gp, string_ty *name)
{
gstate_ty *gstate_data;
size_t j;
//
// find the project in the gstate
//
trace(("gonzo_alias_delete_destination_sub(gp = %08lX, name = \"%s\")\n{\n",
(long)gp, name->str_text));
gstate_data = gonz... | false | false | false | false | false | 0 |
gfarm_sockaddr_to_string(struct sockaddr *addr, char *string, size_t size)
{
unsigned char *a;
#ifndef HAVE_SNPRINTF
char s[GFARM_SOCKADDR_STRLEN];
if (size <= 0)
return;
#endif
switch (addr->sa_family) {
case AF_INET:
a = (unsigned char *)
&((struct sockaddr_in *)addr)->sin_addr.s_addr;
#ifdef HAVE_SNP... | false | false | false | false | false | 0 |
yy_Ticks1()
{ int yypos0= yypos, yythunkpos0= yythunkpos;
yyprintf((stderr, "%s\n", "Ticks1")); if (!yymatchChar('`')) goto l92;
{ int yypos93= yypos, yythunkpos93= yythunkpos; if (!yymatchChar('`')) goto l93; goto l92;
l93:; yypos= yypos93; yythunkpos= yythunkpos93;
}
yyprintf((stderr, " ok %s @ %s... | false | false | false | false | false | 0 |
availablePlugins()
{
QStringList result;
const KService::List plugins = KServiceTypeTrader::self()->query("ThumbCreator");
for (KService::List::ConstIterator it = plugins.begin(); it != plugins.end(); ++it)
if (!result.contains((*it)->desktopEntryName()))
result.append((*it)->desktopEntr... | false | false | false | false | false | 0 |
GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1,
struct GNUNET_TIME_Relative a2)
{
struct GNUNET_TIME_Relative ret;
if (a2.rel_value >= a1.rel_value)
return GNUNET_TIME_UNIT_ZERO;
if (a1.rel_value == UINT64_MAX)
return GNUNET_TIME_UNIT_FOREVER_REL;
ret.rel_v... | false | false | false | false | false | 0 |
redraw_custum_statusline(wp)
win_T *wp;
{
int save_called_emsg = called_emsg;
called_emsg = FALSE;
win_redr_custom(wp, FALSE);
if (called_emsg)
set_string_option_direct((char_u *)"statusline", -1,
(char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL
? OPT_LOCAL : OPT_GLOBAL), SID_ERROR);
c... | false | false | false | false | false | 0 |
wait_press(int timeOutSecond)
{
while( mouse.left_press || mouse.any_click() || mouse.key_code ) // avoid repeat clicking
{
sys.yield();
mouse.get_event();
}
int rc=0;
unsigned int timeOutTime = misc.get_time() + timeOutSecond*1000;
while(1)
{
sys.yield();
mouse.get_event();
if( sys.debug_session )... | false | false | false | false | false | 0 |
gg_convert_image_to_bgr (const gGraphImagePtr img)
{
/* converting this image to BGR */
int x;
int y;
void *pixels;
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char *p_in;
unsigned char *p_out;
if (img->pixel_format == GG_PIXEL_RGB || img->pixel_format == GG... | false | false | false | false | false | 0 |
xmms_playlist_client_remove_entry (xmms_playlist_t *playlist,
const gchar *plname,
gint32 pos, xmms_error_t *err)
{
gboolean ret = FALSE;
xmmsv_coll_t *plcoll;
g_return_if_fail (playlist);
g_mutex_lock (playlist->mutex);
plcoll = xmms_playlist... | false | false | false | false | false | 0 |
l3dss1_dummy_return_result(struct PStack *st, int id, u_char *p, u_char nlen)
{ isdn_ctrl ic;
struct IsdnCardState *cs;
struct l3_process *pc = NULL;
if ((pc = l3dss1_search_dummy_proc(st, id)))
{ L3DelTimer(&pc->timer); /* remove timer */
cs = pc->st->l1.hardware;
ic.driver = cs->myid;
ic.command = ISDN_ST... | false | false | false | false | false | 0 |
gog_axis_view_render (GogView *view, GogViewAllocation const *bbox)
{
GSList *ptr;
(aview_parent_klass->render) (view, bbox);
/* Render every child except grid lines. Those are rendered
* before in gog_chart_view since we don't want to render them
* over axis. */
for (ptr = view->children ; ptr != NULL ; ptr ... | false | false | false | false | false | 0 |
decompose (Hep3Vector & boost, HepAxisAngle & rotation) const {
rotation = HepAxisAngle();
boost = boostVector();
} | false | false | false | false | false | 0 |
pad_file (FileHandle *fh, gsize num, goffset current_size)
{
gpointer buf;
gsize written;
gint res;
res = 0;
buf = g_malloc0 (PAD_BLOCK_SIZE);
for (written = 0; written < num; written += PAD_BLOCK_SIZE)
{
res = write_stream (fh, buf, MIN (num - written, PAD_BLOCK_SIZE), current_size + written);
... | false | false | false | false | false | 0 |
mtq_maxlen_get(MtQueue* mtq){{
#line 144 "./queue.scm"
{int ml=MTQ_MAXLEN(mtq);
if ((ml)<(0)){return (SCM_FALSE);} else {return (SCM_MAKE_INT(ml));}}}} | false | false | false | false | false | 0 |
is_token(char ch)
{
unsigned char uch = (unsigned char) ch;
if (uch > 0x7F)
return FALSE;
if (uch == ' ')
return FALSE;
if (is_tspecials(ch))
return FALSE;
return TRUE;
} | false | false | false | false | false | 0 |
af9013_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct af9013_state *state = fe->demodulator_priv;
int ret;
u8 tmp;
/*
* Return status from the cache if it is younger than 2000ms with the
* exception of last tune is done during 4000ms.
*/
if (time_is_after_jiffies(
state->read_status... | false | false | false | false | false | 0 |
_dxfFreeSimplificationDataStructure(SimpData *simp_data, float *vertex_data, float *old_positional_error)
{
if (simp_data->edge2index)
{
DXFree((Pointer) simp_data->edge2index);
simp_data->edge2index = NULL;
}
if (simp_data->index2edge)
{
DXFree((Pointer) simp_data->i... | false | false | false | false | false | 0 |
evas_common_rectangle_draw_do(const Cutout_Rects *reuse,
const Eina_Rectangle *clip,
RGBA_Image *dst, RGBA_Draw_Context *dc,
int x, int y, int w, int h)
{
Eina_Rectangle area;
Cutout_Rect *r;
int i;
if (!reuse)
{... | false | false | false | false | false | 0 |
g_udisks_mount_guess_content_type (GMount* base, gboolean force_rescan, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data)
{
GUDisksMount* mnt = G_UDISKS_MOUNT(base);
GFile* root = g_udisks_mount_get_root(base);
g_debug("guess content type");
if(root)
{
/* FIXME: th... | false | false | false | false | false | 0 |
cf_chksum_long_init()
{
int i, j;
uint crc;
for (i = 0; i < 256; i++) {
crc = i;
for (j = 8; j > 0; j--) {
if (crc & 1)
crc = (crc >> 1) ^ CRC32_POLYNOMIAL;
else
crc >>= 1;
}
CRCTable[i] = crc;
}
} | false | false | false | false | false | 0 |
generateFakeLabels(void)
{
UT_uint32 i;
//
// Start by generating 4 fake (pf_Frag_Strux* and fl_Layout pointers
//
// Jeeze gotta generate a fake void * pointer!! Try this hack.
//
for(i=0; i<4; i++)
{
DELETEP(m_pFakeLayout[i]);
m_pFakeSdh[i] = new pf_Frag_Strux_Block(NULL,0);
m_pFakeLayout[i] = new fl_La... | false | false | false | false | false | 0 |
countConnections()
{
int cnum = 0;
SingleList* list = _connections;
while (list) {
ConnectInfo* peer = (ConnectInfo*) list->data;
if (peer->state == PEER_CONNECTED) {
cnum++;
}
list = listSingleNext(list);
}
return cnum;
} | false | false | false | false | false | 0 |
detachThread(Thread *thread) {
ExecEnv *ee = thread->ee;
Object *jThread = ee->thread;
Object *group = INST_DATA(jThread, Object*, group_offset);
/* If there's an exception pending, it is uncaught */
if(exceptionOccurred0(ee))
uncaughtException();
/* Don't do anything if this is the ma... | false | false | false | false | false | 0 |
u8_reader(struct driver_data *drv_data)
{
while ((pxa2xx_spi_read(drv_data, SSSR) & SSSR_RNE)
&& (drv_data->rx < drv_data->rx_end)) {
*(u8 *)(drv_data->rx) = pxa2xx_spi_read(drv_data, SSDR);
++drv_data->rx;
}
return drv_data->rx == drv_data->rx_end;
} | false | false | false | false | false | 0 |
create_elements()
{
if (!_have_elements) {
for (RouterT::iterator x = _router->begin_elements(); x; ++x)
_elements.push_back(x);
if (_elements.size()) // sort by name
qsort(&_elements[0], _elements.size(), sizeof(ElementT *), element_name_compar);
_have_elements = true;
}
} | false | false | false | false | false | 0 |
ws_utf8_append_char(WsUtf8String *string, unsigned long ch)
{
unsigned char *d;
unsigned int num_bytes = WS_UTF8_ENC_TYPE(ch);
unsigned int len, i;
if (num_bytes == 0)
ws_fatal("ws_utf8_append_char(): 0x%lx is not a valid UTF-8 character",
ch);
d = ws_realloc(string->data,... | false | false | false | false | false | 0 |
fs_gl_bind_texture(int texture) {
if (g_current_texture == texture) {
return;
}
#ifdef TRACE
printf("glBindTexture %d\n", texture);
#endif
glBindTexture(GL_TEXTURE_2D, texture);
CHECK_GL_ERROR();
g_current_texture = texture;
} | false | false | false | false | false | 0 |
endElement(EndElementEvent *event)
{
SGMLApplication::EndElementEvent appEvent;
setString(appEvent.gi, event->name());
setLocation(appEvent.pos, event->location());
app_->endElement(appEvent);
delete event;
} | false | false | false | false | false | 0 |
gsb_file_load_currency ( const gchar **attribute_names,
const gchar **attribute_values )
{
gint i=0;
gint currency_number;
if ( !attribute_names[i] )
return;
currency_number = gsb_data_currency_new (NULL);
/* Default */
gsb_data_currency_set_floating_point ( curren... | false | false | false | false | false | 0 |
transport_set_vpd_ident(struct t10_vpd *vpd, unsigned char *page_83)
{
static const char hex_str[] = "0123456789abcdef";
int j = 0, i = 4; /* offset to start of the identifier */
/*
* The VPD Code Set (encoding)
*
* from spc3r23.pdf Section 7.6.3.1 Table 296
*/
vpd->device_identifier_code_set = (page_83[0]... | false | false | false | false | false | 0 |
BoyerMoore (char *query, int querylen, char *text, int textlen) {
#ifndef STANDALONE
Intlist_T hits = NULL;
#endif
int i, j, *good_suffix_shift, *bad_char_shift;
if (query_okay(query,querylen)) {
good_suffix_shift = precompute_good_suffix_shift(query,querylen);
bad_char_shift = precompute_bad_char_shift(... | false | false | false | false | false | 0 |
dbrpcinit(DBPROCESS * dbproc, const char rpcname[], DBSMALLINT options)
{
DBREMOTE_PROC **rpc;
int dbrpcrecompile = 0;
tdsdump_log(TDS_DBG_FUNC, "dbrpcinit(%p, %s, %d)\n", dbproc, rpcname, options);
CHECK_DBPROC();
DBPERROR_RETURN(IS_TDSDEAD(dbproc->tds_socket), SYBEDDNE);
CHECK_NULP(rpcname, "dbrpcinit", 2, FAI... | false | false | false | false | false | 0 |
search_module_table_by_mtgid_and_mtno(int mtg_id,
int mt_no)
{
Module_table *mdpt;
mdpt = module_head;
while (mdpt != NULL) {
if(search_mt_table_by_mtgid_and_mtno(mdpt->mt_head,
mtg_id,
mt_no) != NULL) {
return(mdpt);
} else {
mdpt = mdpt->next;
}
}
return... | false | false | false | false | false | 0 |
fill_always_executed_in (struct loop *loop, sbitmap contains_call)
{
basic_block bb = NULL, *bbs, last = NULL;
unsigned i;
edge e;
struct loop *inn_loop = loop;
if (!loop->header->aux)
{
bbs = get_loop_body_in_dom_order (loop);
for (i = 0; i < loop->num_nodes; i++)
{
edge_iterator ei;
... | false | false | false | false | false | 0 |
raise_exception(struct ast_channel *chan, const char *reason, int priority)
{
struct ast_datastore *ds = ast_channel_datastore_find(chan, &exception_store_info, NULL);
struct pbx_exception *exception = NULL;
if (!ds) {
ds = ast_datastore_alloc(&exception_store_info, NULL);
if (!ds)
return -1;
if (!(excepti... | false | false | false | false | false | 0 |
substring(int pos, int len) const
{
if (pos < 0)
pos += _r.length;
int pos2;
if (len < 0)
pos2 = _r.length + len;
else if (pos >= 0 && len >= _r.length) // avoid integer overflow
pos2 = _r.length;
else
pos2 = pos + len;
if (pos < 0)
pos = 0;
if (pos2 > _r.length)
pos2 = _r.length;
... | false | false | false | false | false | 0 |
perf_callchain_kernel(struct perf_callchain_entry *entry, struct pt_regs *regs)
{
if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
/* TODO: We don't support guest os callchain now */
return;
}
perf_callchain_store(entry, regs->ip);
dump_trace(NULL, regs, NULL, 0, &backtrace_ops, entry);
} | false | false | false | false | false | 0 |
gather_blocks_in_sese_region (basic_block entry, basic_block exit,
vec<basic_block> *bbs_p)
{
basic_block son;
for (son = first_dom_son (CDI_DOMINATORS, entry);
son;
son = next_dom_son (CDI_DOMINATORS, son))
{
bbs_p->safe_push (son);
if (son != exit)
gather_blocks_in_sese_re... | false | false | false | false | false | 0 |
strlencspn(const char *s, size_t len, const char *accept)
{
size_t i;
for (i = 0; i < len; ++i) {
/* likely we can do better by inlining this function
* but this works for now
*/
if (strchr(accept, s[i]) != NULL) {
return i;
}
}
return len;
} | false | false | false | false | false | 0 |
GetClientID (Window window)
/* This function returns the value of the session manager client ID property
* given a valid window handle. If no such property exists on a window then
* null is returned
*/
{
char *client_id = NULL;
Window client_leader;
XTextProperty tp;
Atom actual_type;
int actual... | false | false | false | false | false | 0 |
writeBlock(uint32_t *block, uint32_t value) {
uint32_t *limit=block+UTRIE2_DATA_BLOCK_LENGTH;
while(block<limit) {
*block++=value;
}
} | false | false | false | false | false | 0 |
FillRegexes()
{
wxListBox* list = XRCCTRL(*this, "lstRegex", wxListBox);
list->Clear();
for (size_t i = 0; i < m_Regexes.Count(); ++i)
{
RegExStruct& rs = m_Regexes[i];
list->Append(rs.desc);
}
list->SetSelection(m_SelectedRegex);
FillRegexDetails(m_SelectedRegex);
} | false | false | false | false | false | 0 |
process_sflag()
{
if (sflag) {
long n;
VALUE *args;
n = RARRAY(rb_argv)->len;
args = RARRAY(rb_argv)->ptr;
while (n > 0) {
VALUE v = *args++;
char *s = StringValuePtr(v);
char *p;
int hyphen = Qfalse;
if (s[0] != '-') break;
n--;
if (s[1] == '-' && s[2] == '\0') break;
... | true | true | false | true | true | 1 |
esl_keyhash_Lookup(const ESL_KEYHASH *kh, const char *key, esl_pos_t n, int *opt_index)
{
uint32_t val = jenkins_hash(key, n, kh->hashsize);
int idx;
for (idx = kh->hashtable[val]; idx != -1; idx = kh->nxt[idx])
if (strcmp(key, kh->smem + kh->key_offset[idx]) == 0)
{
if (opt_index != NULL) *op... | false | false | false | false | false | 0 |
OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert)
{
OCSP_SIGNATURE *sig;
if (!req->optionalSignature)
req->optionalSignature = OCSP_SIGNATURE_new();
sig = req->optionalSignature;
if (!sig) return 0;
if (!cert) return 1;
if (!sig->certs && !(sig->certs = sk_X509_new_null()))
return 0;
if(!sk_X509_push(s... | false | false | false | false | false | 0 |
print_report_draw_column ( GtkTableChild *child,
gint line_position )
{
gint column_position = 0;
gint i;
/* calculate the column position */
for (i=0 ; i<child -> left_attach ; i++)
column_position = column_position + columns_width[i];
/* draw the line */
cairo_move_to (cr, colum... | false | false | false | false | false | 0 |
get_proof_pattern( const Expr& pf, Expr& modE )
{
if( pf[0]==d_cnf_add_unit_str )
{
if( pf[2][0]==d_iff_mp_str )
{
if( pf[2][3][0]==d_eq_symm_str && pf[2][4][0]==d_if_lift_rule_str )
{
if( pf[2][3][4][0]==d_iff_mp_str )
{
if( pf[2][3][4][3][0]==d_var_intro_str... | false | false | false | false | false | 0 |
proc_anon_server_kx (gnutls_session_t session, opaque * data,
size_t _data_size)
{
int ret;
/* set auth_info */
if ((ret =
_gnutls_auth_info_set (session, GNUTLS_CRD_ANON,
sizeof (anon_auth_info_st), 1)) < 0)
{
gnutls_assert ();
return re... | false | false | false | false | false | 0 |
AddDescriptorToIsomOD(GF_IsomObjectDescriptor *od, GF_Descriptor *desc)
{
if (!od || !desc) return GF_BAD_PARAM;
//check if we can handle ContentClassif tags
if ( (desc->tag >= GF_ODF_OCI_BEGIN_TAG) &&
(desc->tag <= GF_ODF_OCI_END_TAG) ) {
return gf_list_add(od->OCIDescriptors, desc);
}
//or extension ...
i... | false | false | false | false | false | 0 |
FinalizeWalls()
{
for(size_t z = 0; z < m_zone.size(); z++ ) {
const size_t startZone = m_zone[z][0];
const size_t endZone = m_zone[z][1];// note: wall after endZone is not local
for( size_t pos = startZone; pos < endZone; pos++ ) {
if (m_wall[ pos ]) {
m_localWall[ pos ] = z;
m_wall... | 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.