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 |
|---|---|---|---|---|---|---|
NormalizeStatus(int flags)
{
String tmp;
if(flags & WORD_NORMALIZE_TOOLONG) tmp << "TOOLONG ";
if(flags & WORD_NORMALIZE_TOOSHORT) tmp << "TOOSHORT ";
if(flags & WORD_NORMALIZE_CAPITAL) tmp << "CAPITAL ";
if(flags & WORD_NORMALIZE_NUMBER) tmp << "NUMBER ";
if(flags & WORD_NORMALIZE_CONTROL) tmp << "CONTROL... | false | false | false | false | false | 0 |
dbConnect(char *host, char *user, char *passwd)
{
DBUG_ENTER("dbConnect");
if (verbose)
{
fprintf(stderr, "# Connecting to %s...\n", host ? host : "localhost");
}
mysql_init(&mysql_connection);
if (opt_compress)
mysql_options(&mysql_connection, MYSQL_OPT_COMPRESS, NullS);
#ifdef HAVE_OPENSSL
if (o... | false | false | false | false | false | 0 |
jisx0213_2000_2_decoder(const unsigned char *data)
{
ucs4_t u;
EMULATE_JISX0213_2000_DECODE_PLANE2(u, data[0], data[1])
TRYMAP_DEC(jisx0213_2_bmp, u, data[0], data[1]);
else TRYMAP_DEC(jisx0213_2_emp, u, data[0], data[1])
u |= 0x20000;
else
return MAP_UNMAPPABLE;
return u;
} | false | false | false | false | false | 0 |
e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
{
s32 ret_val;
u32 tipg;
u32 i = 0;
u16 reg_data, reg_data2;
reg_data = E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT;
ret_val =
e1000_write_kmrn_reg_80003es2lan(hw,
E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
reg_data);
if (ret_val)
... | false | false | false | false | false | 0 |
sift_up(int start, CELL ele)
{
register int parent, child, child_idx, child_added;
CELL elep;
child = start;
child_added = heap_index[child];
child_idx = astar_pts[child];
while (child > 1) {
parent = GET_PARENT(child);
elep = alt[astar_pts[parent]];
/* child smaller */
if (cmp_pnt(ele, e... | false | false | false | false | false | 0 |
RNSvdSolve(int m, int n,
const RNScalar *a, const RNScalar *b,
RNScalar *x, RNScalar eps)
{
// Allocate memory
int min = (m < n) ? m : n;
RNScalar *u = new RNScalar [ m * min ];
RNScalar *w = new RNScalar [ min ];
RNScalar *vt = new RNScalar [ min * n ];
assert(u && w && vt);
// Decompose matrix... | false | false | false | false | false | 0 |
v4l2_probe_mpeg(struct v4l2_handle *h)
{
struct ivtv_ioctl_codec codec;
int i;
/* check for v4l2 device */
for (i = 0; i < h->nfmts; i++) {
if (h->fmt[i].pixelformat == V4L2_PIX_FMT_MPEG) {
/* saa7134 sets this and deliveres a transport stream */
/* FIXME: v4l2 API needs some refinements for... | false | false | false | false | false | 0 |
cpl_table_or_selected_window(cpl_table *table,
cpl_size start, cpl_size count)
{
cpl_size i = start;
if (table == 0x0) {
cpl_error_set_(CPL_ERROR_NULL_INPUT);
return -1;
}
if (start < 0 || start >= table->nr) {
cpl_error_set_(CPL_ER... | false | false | false | false | false | 0 |
interpret_standby (void)
{
printf(" (");
switch(standby) {
case 0: printf("off");
break;
case 252: printf("21 minutes");
break;
case 253: printf("vendor-specific");
break;
case 254: printf("?reserved");
break;
case 255: printf("21 minutes + 15 seconds");
break;
default:
if (standby... | false | false | false | false | false | 0 |
bb_idx_is_contained (MonoSimpleBasicBlock *bb, int target)
{
return bb->start <= target && target < bb->end;
} | false | false | false | false | false | 0 |
jtagmkI_program_enable(PROGRAMMER * pgm)
{
unsigned char buf[1], resp[2];
if (PDATA(pgm)->prog_enabled)
return 0;
buf[0] = CMD_ENTER_PROGMODE;
if (verbose >= 2)
fprintf(stderr, "%s: jtagmkI_program_enable(): "
"Sending enter progmode command: ",
progname);
jtagmkI_send(pgm, buf, 1);
jta... | true | true | false | false | false | 1 |
getDeltaFPArray(double *arr, int maxLen) {
double x;
int n, i;
if ((n = nOps) > maxLen) {
n = maxLen;
}
x = 0;
for (i = 0; i < n; ++i) {
x += ops[i].num;
arr[i] = x;
}
return n;
} | false | false | false | false | false | 0 |
e_text_model_get_object_at_offset (ETextModel *model,
gint offset)
{
ETextModelClass *class;
g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1);
if (offset < 0 || offset >= e_text_model_get_text_length (model))
return -1;
class = E_TEXT_MODEL_GET_CLASS (model);
/* If an opt... | false | false | false | false | false | 0 |
print(const ExifData* pMetadata) const
{
std::ostringstream os;
write(os, pMetadata);
return os.str();
} | false | false | false | false | false | 0 |
initmap(int64_t nblocks, int *ag_size, int aggr_block_size)
{
int index, l2nl, n;
int64_t nb;
/*
* Initialize base information
*/
control_page->dn_l2nbperpage = log2shift(PSIZE / aggr_block_size);
control_page->dn_mapsize = control_page->dn_nfree = nblocks;
control_page->dn_maxlevel = BMAPSZTOLEV(nblocks);
... | false | false | false | false | false | 0 |
snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq)
{
int err;
struct snd_card *card = chip->card;
struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
snd_printdd(KERN_DEBUG "vxpocket assign resources: port = 0x%x, irq = %d\n", port, irq);
vxp->port = port;
sprintf(card->shortname, "Digig... | false | false | false | false | false | 0 |
encode_nfs_fh4(struct xdr_stream *xdr, const struct knfsd_fh *fh)
{
u32 length = fh->fh_size;
__be32 *p;
BUG_ON(length > NFS4_FHSIZE);
p = xdr_reserve_space(xdr, 4 + length);
xdr_encode_opaque(p, &fh->fh_base, length);
} | false | false | false | false | false | 0 |
roles() const
{
QHash<int, QByteArray> rectRoles = RectangleModel::roles();
rectRoles[IdRole] = "windowId";
rectRoles[ActiveRole] = "active";
rectRoles[IconRole] = "icon";
rectRoles[VisibleNameRole] = "visibleName";
return rectRoles;
} | false | false | false | false | false | 0 |
t4(void) {
int result;
isc_time_t expires;
isc_interval_t interval;
t_assert("isc_timer_reset", 4, T_REQUIRED, "%s", a4);
if (threaded) {
Tx_nfails = 0;
Tx_nprobs = 0;
Tx_nevents = 3;
Tx_seconds = T4_SECONDS;
Tx_nanoseconds = T4_NANOSECONDS;
isc_interval_set(&interval, T4_SECONDS, T4_NANOSECONDS);
... | false | false | false | false | false | 0 |
wasp_activate_prim( wasp_process process, wasp_list call ){
WASP_AP = NULL;
WASP_CP = NULL;
WASP_EP = NULL;
WASP_GP = NULL;
WASP_IP = NULL;
wasp_chain( call );
if( WASP_IP ){
//TEST: This permits a primitive to chain into a procedure that
// can pause.
wasp_vm v... | false | false | false | false | false | 0 |
dm_tree_next_child(void **handle,
const struct dm_tree_node *parent,
uint32_t inverted)
{
struct dm_list **dlink = (struct dm_list **) handle;
const struct dm_list *use_list;
if (inverted)
use_list = &parent->used_by;
else
use_list = &parent->uses;
if (!*dlink)
*dlink = dm_list_first(use_list);
... | false | false | false | false | false | 0 |
warning (no, mess)
int no;
char *mess;
{
switch (no)
{
case 1:
fprintf(stderr,"shape - warning: derived object not saved into derived object cache; no AtFS subdirectory\n");
return;
case 2:
fprintf(stderr,"shape - warning: target `%s' not remade because of errors\n", mess);
... | false | false | false | false | false | 0 |
gl_label_object_set_name (glLabelObject *object,
gchar *name)
{
gl_debug (DEBUG_LABEL, "START");
g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
g_free(object->priv->name);
object->priv->name = name;
gl_label_object_emit_changed (object);
gl_debug (DEBUG_LABEL, "END");
} | false | false | false | false | false | 0 |
slurp_file(const char *filename, off_t *r_size)
{
int fd;
char *buf;
off_t size, progress, err;
ssize_t result;
struct stat stats;
if (!filename) {
*r_size = 0;
return 0;
}
fd = open(filename, O_RDONLY | _O_BINARY);
if (fd < 0) {
die("Cannot open `%s': %s\n",
filename, strerror(errno));
}
result ... | false | false | false | false | false | 0 |
undockWindowButton()
{
Pages* page = (Pages*)tabWidget->currentWidget();
if (page) {
page->togglePageDocking();
}
} | false | false | false | false | false | 0 |
_nouveau_bo_mem_index(struct nouveau_bo *nvbo, unsigned index, void *mem, u8 sz)
{
struct ttm_dma_tt *dma_tt;
u8 *m = mem;
index *= sz;
if (m) {
/* kmap'd address, return the corresponding offset */
m += index;
} else {
/* DMA-API mapping, lookup the right address */
dma_tt = (struct ttm_dma_tt *)nvbo->b... | false | false | false | false | false | 0 |
gst_rtp_session_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstRtpSession *rtpsession;
GstRtpSessionPrivate *priv;
rtpsession = GST_RTP_SESSION (object);
priv = rtpsession->priv;
switch (prop_id) {
case PROP_BANDWIDTH:
g_object_set_property (G_OBJ... | false | false | false | false | false | 0 |
real_ldexp (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *op0, int exp)
{
*r = *op0;
switch (r->cl)
{
case rvc_zero:
case rvc_inf:
case rvc_nan:
break;
case rvc_normal:
exp += REAL_EXP (op0);
if (exp > MAX_EXP)
get_inf (r, r->sign);
else if (exp < -MAX_EXP)
get_zero (r, r... | false | false | false | false | false | 0 |
strbuf_reverse_substring(StrBuf *sb, int32_t sp, int32_t ep)
{
sp = normalize_strbuf_pos(sb, sp);
ep = normalize_strbuf_pos(sb, ep);
while (sp < ep) {
SWAP_INT32(sb->buf[sp], sb->buf[ep]);
sp++;
ep--;
}
} | false | false | false | false | false | 0 |
m68k_op_chk2cmp2_16_al(void)
{
if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
{
uint word2 = OPER_I_16();
uint compare = REG_DA[(word2 >> 12) & 15]&0xffff;
uint ea = EA_AL_16();
uint lower_bound = m68ki_read_16(ea);
uint upper_bound = m68ki_read_16(ea + 2);
if(!BIT_F(word2))
FLAG_C = MAKE_INT_16(compare) - MAKE... | false | false | false | false | false | 0 |
lengthOfRecord( DcmItem *item,
E_TransferSyntax oxfer,
E_EncodingType enctype )
{
Uint32 templen = 0;
if ( item != NULL )
{
templen = item->getLength( oxfer, enctype );
templen += 8; // for Tag and Length
... | false | false | false | false | false | 0 |
mono_remoting_marshal_init (void)
{
MonoClass *klass;
static gboolean module_initialized = FALSE;
static gboolean icalls_registered = FALSE;
if (module_initialized)
return;
byte_array_class = mono_array_class_get (mono_defaults.byte_class, 1);
#ifndef DISABLE_JIT
klass = mono_class_from_name (mono_defaults.... | false | false | false | false | false | 0 |
hf_render_info_copy (HFRenderInfo *hfi)
{
HFRenderInfo *res;
g_return_val_if_fail (hfi != NULL, NULL);
res = g_new (HFRenderInfo, 1);
res->sheet = hfi->sheet;
res->page = hfi->page;
res->pages = hfi->pages;
res->date_time = value_dup (hfi->date_time);
res->date_conv = hfi->date_conv;
res->page_area = hfi->pag... | false | false | false | false | false | 0 |
check_loader_threadsafety (GdkPixbufLoader *loader, gboolean *result)
{
GdkPixbufFormat *format;
gboolean ret_val = FALSE;
format = gdk_pixbuf_loader_get_format (loader);
if (format) {
ret_val = TRUE;
if (result)
/* FIXME: We should not be accessing this struct internals
* directly. Keep track of bug #46... | false | false | false | false | false | 0 |
iwl_pcie_txq_free_tfd(struct iwl_trans *trans, struct iwl_txq *txq)
{
struct iwl_tfd *tfd_tmp = txq->tfds;
/* rd_ptr is bounded by TFD_QUEUE_SIZE_MAX and
* idx is bounded by n_window
*/
int rd_ptr = txq->q.read_ptr;
int idx = get_cmd_index(&txq->q, rd_ptr);
lockdep_assert_held(&txq->lock);
/* We have only ... | false | false | false | false | false | 0 |
UnRegister() const ITK_NOEXCEPT_OR_THROW ITK_OVERRIDE
{
this->LightObject::UnRegister();
} | false | false | false | false | false | 0 |
ne_hash_remove(NE_HASH *hash, void *key)
{
NE_HASHNODE **node, *remove;
void *value = NULL;
node = _hash_lookup_node(hash, key, NULL);
if (*node)
{
remove = *node;
*node = remove->next;
value = remove->value;
free(remove);
hash->num--;
}
return value;
} | false | false | false | false | false | 0 |
i915_gem_restore_gtt_mappings(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_gem_object *obj;
struct i915_address_space *vm;
struct i915_vma *vma;
bool flush;
i915_check_and_clear_faults(dev);
/* First fill our portion of the GTT with scratch pages */
dev_priv-... | false | false | false | false | false | 0 |
read_handler(Element *e, void *thunk)
{
AggregateIP *aip = static_cast<AggregateIP *>(e);
switch ((intptr_t)thunk) {
case 0:
return NameInfo::revquery_int(NameInfo::T_IP_PROTO, e, aip->_f.proto());
case 1:
return String(aip->_f.bit_offset());
case 2:
return String(aip->_f.bit_length());
... | false | false | false | false | false | 0 |
MMC2and4Power(void) {
preg = 0;
latch0 = latch1 = 1;
Sync();
if (is10) {
SetReadHandler(0x6000, 0x7FFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
}
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0xA000, 0xFFFF, MMC2and4Write);
} | false | false | false | false | false | 0 |
FileManagerCallback()
{
if ( CConfig::Instance()->GetRecreateShareListTime() != 0 )
{
if ( m_tCreateShareListTimeout != 0 )
{
if ( time(0) > m_tCreateShareListTimeout )
{
CreateShareList();
m_tCreateShareListTimeout = time(0)+CConfig::Instance()->GetRecreateShareListTime()*60*60;
}
}
else
... | false | false | false | false | false | 0 |
processGetZoomResponse(void)
{
unsigned char buf[4];
char byte;
unsigned int valU;
int i;
// Make sure we have the correct number of bytes
if (myPacketBufLen != 10)
{
myPacketBufLen = 0;
return;
}
// remove the ascii encoding, and put into 2 bytes
for (i=0;i<4;i++)
{
byte = myPacketB... | false | false | false | false | false | 0 |
handleBottomOfBlock(int top, int bottom, MarginInfo& marginInfo)
{
// If our last flow was a self-collapsing block that cleared a float, then we don't
// collapse it with the bottom of the block.
if (!marginInfo.selfCollapsingBlockClearedFloat())
marginInfo.setAtBottomOfBlock(true);
// If we ca... | false | false | false | false | false | 0 |
sendfailmsg(int fd, const char *reason)
{
char buf[9];
int len;
len = strlen(reason);
if(len > 0xffff) len = 0xffff;
snprintf(buf, sizeof buf, "FAIL%04x", len);
if(writex(fd, buf, 8)) return -1;
return writex(fd, reason, len);
} | false | false | false | false | false | 0 |
_e_mod_action_fileman_cb(E_Object *obj,
const char *params)
{
E_Zone *zone = NULL;
if (obj)
{
if (obj->type == E_MANAGER_TYPE)
zone = e_util_zone_current_get((E_Manager *)obj);
else if (obj->type == E_CONTAINER_TYPE)
zone = e_util_zone_current_g... | false | false | false | false | false | 0 |
setCurrentDictionary(const int index) {
if ((0 <= index) && ((unsigned)index < translators.size())) {
currentTranslator = translators[index];
currentDict = index;
}
} | false | false | false | false | false | 0 |
parseIdString(const QString& idString, QString* managerName, QMap<QString, QString>* params, QString* engineIdString)
{
QStringList colonSplit = idString.split(QLatin1Char(':'));
QString prefix = colonSplit.value(0);
if (prefix != QLatin1String("qtorganizer") || colonSplit.size() != 4)
return false... | false | false | false | false | false | 0 |
getValue(int x, int y) {
x += m_X0;
y += m_Y0;
if (x < 0) x = 0;
if (x >= m_DW) x = m_DW-1;
if (y < 0) y = 0;
if (y >= m_DH) y = m_DH-1;
return m_Data[y*m_DW + x];
} | false | false | false | false | false | 0 |
net2280_irq(int irq, void *_dev)
{
struct net2280 *dev = _dev;
/* shared interrupt, not ours */
if ((dev->quirks & PLX_LEGACY) &&
(!(readl(&dev->regs->irqstat0) & BIT(INTA_ASSERTED))))
return IRQ_NONE;
spin_lock(&dev->lock);
/* handle disconnect, dma, and more */
handle_stat1_irqs(dev, readl(&dev->regs->i... | false | false | false | false | false | 0 |
score() const
{
// Balancing factors
// a = shot-balance
// b = water-balance
double a = 3;
double b = 0.5;
double score = (a * hits() - b * misses()) / (shots() + misses()) * 1000;
int res = static_cast<int>(score);
if (res <= 0) {
res = 1;
}
return res;
} | false | false | false | false | false | 0 |
__ecereMethod_Debugger_GdbExecRun(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct Debugger * __ecerePointer_Debugger = (struct Debugger *)(this ? (((char *)this) + __ecereClass_Debugger->offset) : 0);
;
__ecereMethod_Debugger_GdbTargetSet(this);
if(!__ecerePointer_Debugger->usingValgrind)
__ecerePointer... | false | false | false | true | false | 1 |
add_tag(ARTICLE *art)
{
if (no_alloc < no_tagged + 3) {
long i = no_alloc;
no_alloc = 2 * (no_alloc + 1);
tagged_articles =
(ARTICLE **)XtRealloc((char *)tagged_articles,
no_alloc * sizeof(ARTICLE*));
while (i < no_alloc)
tagged_articles[i++] = NULL;
}
tagged_articles[no_tagged++] = ar... | false | false | false | false | false | 0 |
cb_clear_clicked (G_GNUC_UNUSED GtkButton *button,
ConsolidateState *state)
{
g_return_if_fail (state != NULL);
if (state->cellrenderer->entry)
gnumeric_cell_renderer_expr_entry_editing_done (
GTK_CELL_EDITABLE (state->cellrenderer->entry),
state->cellrenderer);
gtk_list_store_clear (GTK_LIST_STORE(sta... | false | false | false | false | false | 0 |
build_q_value (log4cplus::tstring & q_str) const
{
q_str = convertIntegerToString(tv_usec / 1000);
size_t const len = q_str.length();
if (len <= 2)
q_str.insert (0, padding_zeros[q_str.length()]);
} | false | false | false | false | false | 0 |
gw_mail_window_box_get_file_path ( GtkWindow *w)
{
GtkCheckButton *chk_button = NULL;
gchar *text = NULL;
#ifdef GW_DEBUG_GUI_COMPONENT
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
#endif
if ( w != NULL )
{
chk_button = gtk_object_get_data ( GTK_OBJECT ( w), GW_REF_MAIL_WI... | false | false | false | false | false | 0 |
app_free(app_t **app)
{
g_assert(app != NULL && *app != NULL);
TRACE("app:%p", *app);
if ((*app)->cmdline)
g_free((*app)->cmdline);
if ((*app)->path)
g_free((*app)->path);
if ((*app)->icon)
g_free((*app)->icon);
free((*app));
(*app) = NULL;
} | false | false | false | false | false | 0 |
_tm6000_stop_audio_dma(struct snd_tm6000_card *chip)
{
struct tm6000_core *core = chip->core;
dprintk(1, "Stopping audio DMA\n");
/* Disables audio */
tm6000_set_reg_mask(core, TM6010_REQ07_RCC_ACTIVE_IF, 0x00, 0x40);
return 0;
} | false | false | false | false | false | 0 |
opal_crs_none_module_init(void)
{
/*
* If not a tool, and requesting C/R support print a warning.
*/
if( opal_crs_none_select_warning &&
!opal_cr_is_tool && opal_cr_is_enabled ) {
opal_show_help("help-opal-crs-none.txt", "none:select-warning",
true);
}
r... | false | false | false | false | false | 0 |
lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
{
MAILBOX_t *mb = &pmb->u.mb;
struct lpfc_vport *vport = pmb->vport;
struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
switch (mb->mbxStatus) {
case 0x0011:
case 0x0020:
lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
"0911 cmpl_unreg_v... | false | false | false | false | false | 0 |
PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
{
PyObject *name = filename ? PyString_FromString(filename) : NULL;
PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
Py_XDECREF(name);
return result;
} | false | false | false | false | false | 0 |
ensBaseadaptorRetrieveAllIdentifiers(
EnsPBaseadaptor ba,
const AjPStr tablename,
const AjPStr columnname,
AjPList identifiers)
{
ajuint *Pidentifier = NULL;
AjPSqlstatement sqls = NULL;
AjISqlrow sqli = NULL;
AjPSqlrow sqlr = NULL;
AjPStr statement = NULL;
EnsPDat... | false | false | false | false | false | 0 |
xaccTransSetDescription (Transaction *trans, const char *desc)
{
if (!trans || !desc) return;
xaccTransBeginEdit(trans);
CACHE_REPLACE(trans->description, desc);
qof_instance_set_dirty(QOF_INSTANCE(trans));
xaccTransCommitEdit(trans);
} | false | false | false | false | false | 0 |
adjust_weights (const gretl_matrix *rw,
gretl_matrix *wt, int a)
{
int k, n = gretl_vector_get_length(wt);
int t = a;
for (k=0; k<n; k++) {
wt->val[k] *= rw->val[t];
if (k < n - 1) {
t++;
while (na(rw->val[t])) t++;
}
}
} | false | false | false | false | false | 0 |
processMemAccess(Instruction *I) {
Value *Pointer = nullptr;
if (LoadInst *L = dyn_cast<LoadInst>(I))
Pointer = L->getPointerOperand();
else
Pointer = cast<StoreInst>(I)->getPointerOperand();
if (isa<Constant>(Pointer)) return false;
Constant *C = LVI->getConstant(Pointer, I->getParent(), I);
if (... | false | false | false | false | false | 0 |
SeedKmppSetClusterIndex(const Node *node, int value) const {
node->kmpp_cluster_index = value;
if (node->lower_node != 0) {
SeedKmppSetClusterIndex(node->lower_node, value);
SeedKmppSetClusterIndex(node->upper_node, value);
}
} | false | false | false | false | false | 0 |
wiener_map( unsigned int n )
{
static struct { unsigned int p_n, q_n; } t[] =
{ /* p q attack cost */
{ 512, 119 }, /* 9 x 10^17 */
{ 768, 145 }, /* 6 x 10^21 */
{ 1024, 165 }, /* 7 x 10^24 */
{ 1280, 183 }, /* 3 x 10^27 */
{ 1536, 198 }, /* 7 x 10^29 */
{ 1792, 212 }, /* 9 x 10^31 */
{ 2048, 225 ... | false | false | false | false | false | 0 |
expire_cb(struct mailbox *mailbox __attribute__((unused)),
struct index_record *record,
void *rock)
{
struct expire_rock *erock = (struct expire_rock *) rock;
erock->messages++;
/* otherwise, we're expiring messages by sent date */
if (record->gmtime < erock->expire_mark) {
erock->deleted... | false | false | false | false | false | 0 |
libmodmake_module(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj name_scm;
ScmSymbol* name;
ScmObj if_exists_scm = scm__rc.d1123[0];
ScmObj if_exists;
ScmObj SCM_SUBRARGS[1];
ScmObj SCM_OPTARGS = SCM_ARGREF(SCM_ARGCNT-1);
int SCM_i;
SCM_ENTER_SUBR("make-module");
for (SCM_i=0; SCM_i<1; SCM_i++)... | false | false | false | false | false | 0 |
hard_libcall_value (mode)
enum machine_mode mode;
{
return LIBCALL_VALUE (mode);
} | false | false | false | false | false | 0 |
_isIn( AxisAlignedBox &box )
{
// Always fail if not in the scene graph or box is null
if (!mIsInSceneGraph || box.isNull()) return false;
// Always succeed if AABB is infinite
if (box.isInfinite())
return true;
Vector3 center = mWorldAABB.getMaximum().midPoint( mWorldAABB.getMinimum() );
... | false | false | false | false | false | 0 |
parse_name_map(char *map, BOOL usernames)
{
struct idlist **idmap_ptr = usernames ? &uidmap : &gidmap;
struct idlist **idlist_ptr = usernames ? &uidlist : &gidlist;
char *colon, *cp = map + strlen(map);
union name_or_id noiu;
id_t id1;
uint16 flags;
/* Parse the list in reverse, so the order in the struct is ri... | false | false | false | false | false | 0 |
udc_irq(int irq, void *pdev)
{
struct udc *dev = pdev;
u32 reg;
u16 i;
u32 ep_irq;
irqreturn_t ret_val = IRQ_NONE;
spin_lock(&dev->lock);
/* check for ep irq */
reg = readl(&dev->regs->ep_irqsts);
if (reg) {
if (reg & AMD_BIT(UDC_EPINT_OUT_EP0))
ret_val |= udc_control_out_isr(dev);
if (reg & AMD_BIT(U... | false | false | false | false | false | 0 |
EV_ThingSpawn(byte * args, boolean fog)
{
int tid;
angle_t angle;
mobj_t *mobj;
mobj_t *newMobj;
mobj_t *fogMobj;
mobjtype_t moType;
int searcher;
boolean success;
fixed_t z;
success = false;
searcher = -1;
tid = args[0];
moType = TranslateThingType[args[1]];
if ... | false | false | false | false | false | 0 |
G_SerPortRead
(const INT16 dum_Handle, WORD16 G_FAR * Length, BYTE G_FAR Buffer[])
{
WORD16 length = 0,
rlength = 0;
INT32 iRetour,
timeout;
if (port_fd < 0)
{
return GE_HOST_PORT_CLOSE;
}
rlength = *Length;
if (g_iNbByteRead > 0)
{
if (g_iNbByteRead > rlength)
{
length = rlength;
} else
{
... | false | false | false | false | false | 0 |
set_var_from_num(Numeric num, NumericVar *dest)
{
int ndigits;
ndigits = NUMERIC_NDIGITS(num);
alloc_var(dest, ndigits);
dest->weight = NUMERIC_WEIGHT(num);
dest->sign = NUMERIC_SIGN(num);
dest->dscale = NUMERIC_DSCALE(num);
memcpy(dest->digits, NUMERIC_DIGITS(num), ndigits * sizeof(NumericDigit));
} | false | false | false | false | false | 0 |
assign(unsigned int *reg_hw_locations, reg *reg)
{
if (reg->file == GRF) {
reg->reg = reg_hw_locations[reg->reg];
}
} | false | false | false | false | false | 0 |
rtl8723a_phy_lc_calibrate(struct rtw_adapter *pAdapter)
{
struct hal_data_8723a *pHalData = GET_HAL_DATA(pAdapter);
struct mlme_ext_priv *pmlmeext = &pAdapter->mlmeextpriv;
bool bStartContTx = false, bSingleTone = false, bCarrierSuppression = false;
/* ignore IQK when continuous Tx */
if (bStartContTx || bSingleT... | false | false | false | false | false | 0 |
rs600_gpu_init(struct radeon_device *rdev)
{
r420_pipes_init(rdev);
/* Wait for mc idle */
if (rs600_mc_wait_for_idle(rdev))
dev_warn(rdev->dev, "Wait MC idle timeout before updating MC.\n");
} | false | false | false | false | false | 0 |
map_print_key(EditLine *el, el_action_t *map, const Char *in)
{
char outbuf[EL_BUFSIZ];
el_bindings_t *bp, *ep;
if (in[0] == '\0' || in[1] == '\0') {
(void) keymacro__decode_str(in, outbuf, sizeof(outbuf), "");
ep = &el->el_map.help[el->el_map.nfunc];
for (bp = el->el_map.help; bp < ep; bp++)
if (bp->func ... | true | true | false | false | false | 1 |
e_contact_store_iter_has_child (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), FALSE);
if (iter == NULL)
return TRUE;
return FALSE;
} | false | false | false | false | false | 0 |
ensGvsourceadaptorDel(EnsPGvsourceadaptor *Pgvsa)
{
EnsPGvsourceadaptor pthis = NULL;
if (!Pgvsa)
return;
#if defined(AJ_DEBUG) && AJ_DEBUG >= 1
if (ajDebugTest("ensGvsourceadaptorDel"))
ajDebug("ensGvsourceadaptorDel\n"
" *Pgvsa %p\n",
*Pgvsa);
#endif /* d... | false | false | false | false | false | 0 |
pvr2_ctrl_has_custom_symbols(struct pvr2_ctrl *cptr)
{
if (!cptr) return 0;
if (!cptr->info->val_to_sym) return 0;
if (!cptr->info->sym_to_val) return 0;
return !0;
} | false | false | false | false | false | 0 |
create_customscan_plan(PlannerInfo *root, CustomPath *best_path,
List *tlist, List *scan_clauses)
{
CustomScan *cplan;
RelOptInfo *rel = best_path->path.parent;
List *custom_plans = NIL;
ListCell *lc;
/* Recursively transform child paths. */
foreach(lc, best_path->custom_paths)
{
Plan *plan = ... | false | false | false | false | false | 0 |
PyvtkIncrementalOctreeNode_GetDistance2ToBoundary_s2(PyObject *self, PyObject *args)
{
vtkPythonArgs ap(self, args, "GetDistance2ToBoundary");
vtkObjectBase *vp = ap.GetSelfPointer(self, args);
vtkIncrementalOctreeNode *op = static_cast<vtkIncrementalOctreeNode *>(vp);
double temp0[3];
const int size0 = 3;
... | false | false | false | false | false | 0 |
minimumSizeHint() const
{
K_USING_KNUMINPUT_P(priv);
ensurePolished();
int w;
int h;
h = qMax(d->editSize.height(), priv->sliderSize.height());
// if in extra row, then count it here
if (priv->label && (priv->labelAlignment & (Qt::AlignBottom | Qt::AlignTop))) {
h += 4 + priv->la... | false | false | false | false | false | 0 |
GetConfigurationErrors() const
{
std::ostringstream errorMessage;
ProcessingsMap::const_iterator it;
for(it=BeginProcessings(); it!=EndProcessings(); it++)
{
if(it->second->IsConfigured()) continue;
errorMessage << "* Processing '" << it->first << "' is misconfigured:\n";
errorMessage << it->second-... | false | false | false | false | false | 0 |
handle_resp_for_user(struct fw_card *card, int generation, int source,
void *data, size_t length, int *rcode)
{
struct fw_device *device;
struct snd_efw *efw;
unsigned int i;
spin_lock_irq(&instances_lock);
for (i = 0; i < SNDRV_CARDS; i++) {
efw = instances[i];
if (efw == NULL)
continue;
device ... | false | false | false | false | false | 0 |
GetLabels() const
{
wxArrayString arr;
unsigned int i;
if ( this && IsOk() )
for ( i=0; i<GetCount(); i++ )
arr.push_back(GetLabel(i));
return arr;
} | false | false | false | false | false | 0 |
FreeUniquify(uniquify_t *unique) {
if (unique != NULL) {
myfree(unique->uniqueFirst, sizeof(int)*unique->nSeq);
myfree(unique->alnNext, sizeof(int)*unique->nSeq);
myfree(unique->alnToUniq, sizeof(int)*unique->nSeq);
myfree(unique->uniqueSeq, sizeof(char*)*unique->nSeq);
myfree(unique,sizeof(uniqui... | false | false | false | false | false | 0 |
index_build(Relation heapRelation,
Relation indexRelation,
IndexInfo *indexInfo,
bool isprimary)
{
RegProcedure procedure;
IndexBuildResult *stats;
Oid save_userid;
int save_sec_context;
int save_nestlevel;
/*
* sanity checks
*/
Assert(RelationIsValid(indexRelation));
Assert(PointerIsValid(i... | false | false | false | false | false | 0 |
globus_l_gass_copy_gass_transfer_cancel_callback(
void * callback_arg,
globus_gass_transfer_request_t request)
{
globus_gass_transfer_request_status_t status;
globus_object_t * err;
globus_i_gass_copy_cancel_t * cancel_info
= (globus_i_gass_copy_cancel_t *) callback_arg;... | false | false | false | false | false | 0 |
allocRNS(int len)
{
RNS rns = malloc(sizeof(*rns));
if (!rns) outOfMemory();
/* rns->bases = orgLen; */
/* rns->base = malloc(sizeof(*(rns->base))*orgLen); */
rns->bases = len;
rns->base = malloc(sizeof(*(rns->base))*len);
if (!rns->base) outOfMemory();
return rns;
} | false | false | false | true | false | 1 |
assignAllVar(std::vector<Usage> &usage)
{
for (std::size_t i = 0; i < usage.size(); ++i)
usage[i].assign = true;
} | false | false | false | false | false | 0 |
twiddler_exec(char *s)
{
int pid;
extern struct options option;
switch(pid=fork()) {
case -1: return -1;
case 0:
close(0);
close(1);
close(2); /* very rude! */
open(GPM_NULL_DEV,O_RDONLY);
open(option.consolename,O_WRONLY);
dup(1);
... | false | false | false | false | true | 1 |
MakeDelete()
{
for (int i = 0; i < 2; i++) {
if (evt[i]) {
evt[i]->sweep[1 - i] = NULL;
}
evt[i] = NULL;
}
AVLTree::MakeDelete();
} | false | false | false | false | false | 0 |
nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp)
{
struct nlm_lock *lock = &argp->lock;
if (!(p = xdr_decode_string_inplace(p, &lock->caller,
&lock->len, NLM_MAXSTRLEN)))
return 0;
argp->state = ntohl(*p++);
return xdr_argsize_check(rqstp, p);
} | false | false | false | false | false | 0 |
opcode_list_delete(opcode_list_ty *olp)
{
size_t j;
trace(("opcode_list_delete(olp = %08lX)\n{\n", (long)olp));
assert(olp);
assert(olp->reference_count >= 1);
olp->reference_count--;
if (olp->reference_count <= 0)
{
assert(olp->length <= olp->maximum);
for (j = 0; ... | false | false | false | false | false | 0 |
be_connect_hostname_event_cb(struct bufferevent *bev, short what, void *ctx)
{
int *got = ctx;
if (!*got) {
TT_BLATHER(("Got a bufferevent event %d", what));
*got = what;
if ((what & BEV_EVENT_CONNECTED) || (what & BEV_EVENT_ERROR)) {
++total_connected_or_failed;
TT_BLATHER(("Got %d connections or errors... | false | false | false | false | false | 0 |
set_to_docs_containing_word(SquatSearchIndex* index __attribute__((unused)),
SquatDocSet* set,
char const* data __attribute__((unused)),
int doc_count, char const* doc_list)
{
int i;
set->array_len = doc_count;
set->array_data = (int*)xmalloc(sizeof(int)*set->array_len);
i = (int)squat_... | false | false | false | false | false | 0 |
pv_get_context(str* name)
{
pv_context_t* pvc = pv_context_lst;
while(pvc)
{
if(pvc->name.len == name->len &&
strncmp(pvc->name.s, name->s, name->len) == 0)
{
return pvc;
}
pvc = pvc->next;
}
return 0;
} | 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.