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 |
|---|---|---|---|---|---|---|
GWEN_Gui_SetPasswdStore(GWEN_GUI *gui, GWEN_PASSWD_STORE *sto) {
if (gui) {
if (gui->passwdStore && gui->passwdStore!=sto)
GWEN_PasswordStore_free(gui->passwdStore);
gui->passwdStore=sto;
if (sto)
gui->flags|=GWEN_GUI_FLAGS_PERMPASSWORDS;
}
} | false | false | false | false | false | 0 |
pnm_copy_alpha(gx_device * pdev, const byte * data, int data_x,
int raster, gx_bitmap_id id, int x, int y, int width, int height,
gx_color_index color, int depth)
{
gx_device_pbm * const bdev = (gx_device_pbm *)pdev;
if (pdev->color_info.depth < 24 ||
(color >> 8) == (color & ... | false | false | false | false | false | 0 |
lotus_rldb_unref (LotusRLDB *rldb)
{
int i;
if (rldb->refcount-- > 1)
return;
if (rldb->lower) {
for (i = rldb->lower->len; --i >= 0; ) {
LotusRLDB *subrldb = g_ptr_array_index (rldb->lower, i);
lotus_rldb_unref (subrldb);
}
g_ptr_array_free (rldb->lower, TRUE);
}
g_free (rldb->dims);
if (rldb->... | false | false | false | false | false | 0 |
xpc_kthread_waitmsgs(struct xpc_partition *part, struct xpc_channel *ch)
{
int (*n_of_deliverable_payloads) (struct xpc_channel *) =
xpc_arch_ops.n_of_deliverable_payloads;
do {
/* deliver messages to their intended recipients */
while (n_of_deliverable_payloads(ch) > 0 &&
!(ch->flags & XPC_C_DISCONN... | false | false | false | false | false | 0 |
gen_insn_reserv (rtx def)
{
decl_t decl;
decl = create_node (sizeof (struct decl));
decl->mode = dm_insn_reserv;
decl->pos = 0;
DECL_INSN_RESERV (decl)->name
= check_name ((char *) XSTR (def, 0), decl->pos);
DECL_INSN_RESERV (decl)->default_latency = XINT (def, 1);
DECL_INSN_RESERV (decl)->condexp = ... | false | false | false | false | false | 0 |
CopyAndPredicateBlock(BBInfo &ToBBI, BBInfo &FromBBI,
SmallVectorImpl<MachineOperand> &Cond,
SmallSet<unsigned, 4> &Redefs,
bool IgnoreBr) {
MachineFunction &MF = *ToBBI.BB->getParent();
for (Mac... | false | false | false | false | false | 0 |
slotError( QObject *obj )
{
QNetworkReply *reply = qobject_cast<QNetworkReply*>( obj );
if( !reply )
return;
KUrl url = reply->request().url();
d->urlMap.remove( url );
reply->deleteLater();
} | false | false | false | false | false | 0 |
vrve2(v1,a1,f)
vari *v1, *a1;
double (*f)();
{ vari *v;
int i, n;
n = vitem(v1,0);
v = createvar("_vrvec",STHIDDEN,n,VDOUBLE);
if (lf_error) return(NULL);
for (i=0; i<n; i++) vassn(v,i,f(vitem(a1,i)));
deleteifhidden(v1,a1);
return(v);
} | false | false | false | false | false | 0 |
parse_float (char *string, int units, int horizontal)
{
double val;
char *end;
val = strtod (string, &end);
if (end == string)
malformed_float:
ERROR ((stderr, _("malformed float dimension: \"%s\""), string));
if (units)
{
switch (*end)
{
case 'c':
val *= 72 / 2.54;
break;
case 'p'... | false | false | false | false | false | 0 |
get_raid_type(char *name)
{
int i;
for (i = 0; i < ARRAY_SIZE(raid_types); i++)
if (!strcmp(raid_types[i].name, name))
return &raid_types[i];
return NULL;
} | false | false | false | false | false | 0 |
pop_back()
{
// this needs to remove the last entry in the vector
// and ALSO the associated map entry
size_type vit = size() - 1;
for ( map_iterator m = m_names.begin(); m != m_names.end(); ++m )
{
if( m->second == vit ) {
m_names.erase(m->first);
continue;
}
}
m_we... | false | false | false | false | false | 0 |
docall()
{
boolean error_flag = TRUE;
ndurp = FALSE;
linex += scan();
if (token[0] == 0) fferror("Function name expected");
else {
char symbol[100];
struct symb_descr *desc;
long value[SEQ_MAX_PARMS];
int i=0;
scansymb(symbol);
if (fieldx == 1) ffer... | false | false | false | false | false | 0 |
slapi_ch_bvecdup (struct berval** v)
{
struct berval** newberval = NULL;
if (v != NULL) {
size_t i = 0;
while (v[i] != NULL) ++i;
newberval = (struct berval**) slapi_ch_malloc ((i + 1) * sizeof (struct berval*));
newberval[i] = NULL;
while (i-- > 0) {
newberval[i] = slapi_ch_bvdup (v[i]);
}
}
... | false | false | false | false | false | 0 |
skipJunk()
{
IndexBaseType fp = -2;
if(m_file->atEnd())
{
fp = -1;
}
while((!m_lineBuffer.length()
|| (m_lineBuffer[0] != '[' && m_lineBuffer[0] != '1'))
&& !m_file->atEnd())
{
fp = m_file->pos();
skipLine();
}
if(fp == -2)
{
... | false | false | false | false | false | 0 |
inter_eval(
Tcl_Interp *interp,
struct action *action,
ExpState *esPtr)
{
int status;
if (action->iwrite) {
out("spawn_id",esPtr->name);
}
if (action->statement) {
status = Tcl_EvalObjEx(interp,action->statement,0);
} else {
expStdoutLogU("\r\n",1);
status = exp_interpreter(interp,... | false | false | false | true | false | 1 |
swBase64_decode(char *in, int inlen, unsigned char *out)
{
int i, j;
for (i = j = 0; i < inlen; i++)
{
int c;
int s = i % 4; /* from 8/gcd(6, 8) */
if (in[i] == '=')
{
return BASE64_OK;
}
if (in[i] < BASE64DE_FIRST || in[i] > BASE64DE_LAST || (c ... | false | false | false | false | false | 0 |
ocfs2_search_cache_tree(struct ocfs2_caching_info *ci,
sector_t block)
{
struct rb_node * n = ci->ci_cache.ci_tree.rb_node;
struct ocfs2_meta_cache_item *item = NULL;
while (n) {
item = rb_entry(n, struct ocfs2_meta_cache_item, c_node);
if (block < item->c_block)
n = n->rb_left;
else if (block > item->... | false | false | false | false | false | 0 |
update_inf(int __inf)
{
int min = _inf.get();
int max = _sup.get();
if (__inf <= max )
{
if (__inf > min)
{
for (int __i = __inf-1 ; __i >= min ; __i--)
remove(__i);
return true;
}
}
else
{
throw Contradiction(1);
}
return false;
} | false | false | false | false | false | 0 |
CDB_txn_prepare(txnp)
DB_TXN *txnp;
{
DBT xid;
DB_ENV *dbenv;
TXN_DETAIL *td;
int ret;
if ((ret = CDB___txn_check_running(txnp, &td)) != 0)
return (ret);
dbenv = txnp->mgrp->dbenv;
memset(&xid, 0, sizeof(xid));
xid.data = td->xid;
xid.size = sizeof(td->xid);
if (F_ISSET(dbenv, DB_ENV_LOGGING) &&
(re... | false | false | false | false | false | 0 |
gfs_clock_elapsed (GfsClock * t)
{
g_return_val_if_fail (t != NULL, 0.);
g_return_val_if_fail (t->start >= 0, 0.);
if (t->started == FALSE)
return (t->stop - t->start)/(gdouble) sysconf (_SC_CLK_TCK);
else {
struct tms tm;
if (times (&tm) == (clock_t) -1)
g_warning ("cannot read clock");
... | false | false | false | false | false | 0 |
sig_event_cb(bool&) {
if (sig_pipe.read() == 'x') {
close_impl(); // we must have picked up an external kill signal
// so we need an orderly close down
}
else write_error("Unknown value read from sig_pipe in MainWindow::sig_event_cb()\n");
} | false | false | false | false | false | 0 |
scm_c_make_string (size_t len, SCM chr)
#define FUNC_NAME NULL
{
char *dst;
SCM res = scm_i_make_string (len, &dst);
if (!SCM_UNBNDP (chr))
{
SCM_VALIDATE_CHAR (0, chr);
memset (dst, SCM_CHAR (chr), len);
}
return res;
} | false | false | false | false | false | 0 |
plpgsql_parse_tripwordtype(char *word)
{
Oid classOid;
HeapTuple classtup = NULL;
HeapTuple attrtup = NULL;
HeapTuple typetup = NULL;
Form_pg_class classStruct;
Form_pg_attribute attrStruct;
char *cp[4];
int i;
RangeVar *relvar;
MemoryContext oldCxt;
int result = T_ERROR;
/* Avoid memory leaks i... | true | true | false | false | false | 1 |
BSDP_next_path(BSDP *bsdp, C4_Score threshold){
register BSDP_Path *bsdp_path;
do {
if(!BSDP_path_validate(bsdp, threshold))
return NULL;
} while(BSDP_path_confirm(bsdp));
bsdp_path = BSDP_path_extract(bsdp);
bsdp->path_count++;
return bsdp_path;
} | false | false | false | false | false | 0 |
var_lookup_local(FuncState *fs, GCstr *n)
{
int i;
for (i = fs->nactvar-1; i >= 0; i--) {
if (n == strref(var_get(fs->ls, fs, i).name))
return (BCReg)i;
}
return (BCReg)-1; /* Not found. */
} | false | false | false | false | false | 0 |
eog_image_real_autorotate (EogImage *img)
{
static const EogTransformType lookup[8] = {EOG_TRANSFORM_NONE,
EOG_TRANSFORM_FLIP_HORIZONTAL,
EOG_TRANSFORM_ROT_180,
EOG_TRANSFORM_FLIP_VERTICAL,
EOG_TRANSFORM_TRANSPOSE,
EOG_TRANSFORM_ROT_90,
EOG_TRANSFORM_TRANSVER... | false | false | false | false | false | 0 |
oauth_free_array(int *argcp, char ***argvp) {
int i;
for (i=0;i<(*argcp);i++) {
free((*argvp)[i]);
}
if(*argvp) free(*argvp);
} | false | false | false | false | false | 0 |
handle_ipv6IpDefaultHopLimit(netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests)
{
u_long value;
int rc;
/*
*... | false | false | false | false | false | 0 |
AdvanceInternal(DlistElement **ple,int goback)
{
DlistElement *le;
void *result;
if (ple == NULL)
return NULL;
le = *ple;
if (le == NULL) return NULL;
result = le->Data;
if (goback) le = le->Previous;
else le = le->Next;
*ple = le;
return result;
} | false | false | false | false | false | 0 |
GetNxtBuf()
{
iNextBuf++;
if(iNextBuf >= MX_BUFFERS)
iNextBuf = 0;
return &_s_strbufs[MX_ONE_BUF * iNextBuf];
} | false | false | false | false | false | 0 |
_colorkey(SDL_Surface *src)
{
Uint32 key = 0;
#if (SDL_MINOR_VERSION == 3)
SDL_GetColorKey(src, &key);
#else
if (src)
{
key = src->format->colorkey;
}
#endif
return key;
} | false | false | false | false | false | 0 |
lak_check_hashed(
const char *hash,
const char *passwd,
void *rock)
{
int rc, clen;
LAK_HASH_ROCK *hrock = (LAK_HASH_ROCK *) rock;
EVP_MD_CTX mdctx;
const EVP_MD *md;
unsigned char digest[EVP_MAX_MD_SIZE];
char *cred;
md = EVP_get_digestbyname(hrock->mda);
if (!md)
return LAK_FAIL;
rc = lak_base64_decod... | true | true | false | false | false | 1 |
gog_box_plot_child_name_changed (GogObject const *obj, GogObject const *child)
{
if (GOG_IS_SERIES (child)) {
GogBoxPlot *model = GOG_BOX_PLOT (obj);
GogAxis *axis = model->base.axis[(model->vertical)? 0: 1];
gog_axis_bound_changed (axis, GOG_OBJECT (obj));
gog_object_emit_changed (GOG_OBJECT (axis), TRUE);
}... | false | false | false | false | false | 0 |
cb_fixup_name_wb (const char *name, GnmNamedExpr *nexpr, Workbook *wb)
{
GnmParsePos newpos = nexpr->pos;
if (!expr_name_is_active (nexpr))
return;
if (nexpr->pos.wb) {
newpos.wb = wb;
expr_name_set_pos (nexpr, &newpos);
}
} | false | false | false | false | false | 0 |
get_next_code(void) {
ILint i, t;
ILuint ret;
//20050102: Tests for IL_EOF were added because this function
//crashed sometimes if igetc() returned IL_EOF
//(for example "table-add-column-before-active.gif" included in the
//mozilla source package)
if (!nbits_left) {
if (navail_bytes <= 0) {
pbytes = byte... | false | false | false | false | true | 1 |
operand_uses_reg(struct operand *operand, enum machine_reg reg)
{
if (!operand_is_reg(operand))
return false;
return mach_reg(&operand->reg) == reg;
} | false | false | false | false | false | 0 |
sfvar_print_to_file(FILE *f, sfip_var_t *var)
{
if(!f) return;
if(!var || !var->head)
{
fprintf(f, "[no variable]\n");
return;
}
fprintf(f, "Name: %s\n", var->name);
if(var->mode == SFIP_LIST)
{
if(var->head->flags & SFIP_ANY)
fprintf(f, "\t%p: <any>\n"... | false | false | false | false | false | 0 |
gncOwnerGetCurrency (const GncOwner *owner)
{
if (!owner) return NULL;
switch (owner->type)
{
case GNC_OWNER_NONE:
case GNC_OWNER_UNDEFINED:
default:
return NULL;
case GNC_OWNER_CUSTOMER:
return gncCustomerGetCurrency (owner->owner.customer);
case GNC_OWNER_VENDOR:
... | false | false | false | false | false | 0 |
filter_real (GeditFileBrowserStore *model,
GtkTreeIter *iter,
GeditFileBrowserWidget *obj)
{
GSList *item;
FilterFunc *func;
for (item = obj->priv->filter_funcs; item; item = item->next)
{
func = (FilterFunc *) (item->data);
if (!func->func (obj, model, iter, func->user_data))
retur... | false | false | false | false | false | 0 |
gdi_open(gx_device *pdev)
{ /* Change the margins if necessary. */
const float *m = 0;
bool move_origin = true;
static const float m_a4[4] = { GDI_MARGINS_A4 };
static const float m_letter[4] = { GDI_MARGINS_LETTER };
m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? m_a4 :
... | false | false | false | false | false | 0 |
partInstrJump(TracePart* part)
{
static TracePartInstrJump* item = 0;
// shortcut if recently used
if (item &&
(item->instrJump()==this) &&
(item->part() == part)) return item;
for(item = _first; item; item = item->next())
if (item->part() == part)
return item;
... | false | false | false | false | false | 0 |
panel_mapped(GtkWidget *widget, GdkEvent *event, panel *p)
{
ENTER;
if (p->autohide) {
ah_stop(p);
ah_start(p);
}
RET(FALSE);
} | false | false | false | false | false | 0 |
stringReverse(const char *src)
{
char *dest;
l_int32 i, len;
PROCNAME("stringReverse");
if (!src)
return (char *)ERROR_PTR("src not defined", procName, NULL);
len = strlen(src);
if ((dest = (char *)CALLOC(len + 1, sizeof(char))) == NULL)
return (char *)ERROR_PTR("calloc fail for d... | false | false | false | false | false | 0 |
on_icon_loaded (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
GdkPixbuf *pixbuf;
pixbuf = gtk_icon_info_load_icon_finish (GTK_ICON_INFO (source), result, NULL);
finish_texture_load (user_data, pixbuf);
g_clear_object (&pixbuf);
} | false | false | false | false | false | 0 |
GeneratePre(std::ostream &sout, ModuleDescription &, int argc, char *argv[])
{
sout << "// This file was automatically generated by:" << std::endl;
sout << "// ";
for (int i = 0; i < argc; i++)
{
sout << " " << argv[i];
}
sout << std::endl;
sout << "//" << std::endl;
sout << "#include <cstdio>" ... | false | false | false | false | false | 0 |
widestGeometry(const GeometryCollection* gc) {
if (gc->isEmpty()) {
return gc;
}
const Geometry* widestGeometry=gc->getGeometryN(0);
// scan remaining geom components to see if any are wider
for(std::size_t i=1, n=gc->getNumGeometries(); i<n; i++) // start at 1
{
const Envelope *env1(gc->getGeometryN(i)->get... | false | false | false | false | false | 0 |
report_viewport_CB(Widget widget, XtPointer client_data, XtPointer calldata)
{
Widget w,s;
w = (Widget)client_data;
s = w;
while (s && !XtIsShell(s))
s = XtParent(s);
if (s)
XtInstallAllAccelerators(w,s);
} | false | false | false | false | false | 0 |
TypeCacheRelCallback(Datum arg, Oid relid)
{
HASH_SEQ_STATUS status;
TypeCacheEntry *typentry;
/* TypeCacheHash must exist, else this callback wouldn't be registered */
hash_seq_init(&status, TypeCacheHash);
while ((typentry = (TypeCacheEntry *) hash_seq_search(&status)) != NULL)
{
if (typentry->tupDesc == NUL... | false | false | false | false | false | 0 |
procheader_entries_from_str(const gchar *str)
{
HeaderEntry *entries = NULL, *he;
int numh = 0, i = 0;
gchar **names = NULL;
const gchar *s = str;
if (s == NULL) {
return NULL;
}
while (*s != '\0') {
if (*s == ' ') ++numh;
++s;
}
if (numh == 0) {
return NULL;
}
entries = g_new0(HeaderEntry, numh + 1... | false | false | false | false | false | 0 |
odm_SignalScaleMapping_92CSeries(struct dm_odm_t *pDM_Odm, s32 CurrSig)
{
s32 RetSig = 0;
if (CurrSig >= 51 && CurrSig <= 100)
RetSig = 100;
else if (CurrSig >= 41 && CurrSig <= 50)
RetSig = 80 + ((CurrSig - 40)*2);
else if (CurrSig >= 31 && CurrSig <= 40)
RetSig = 66 + (CurrSig - 30);
else if (CurrSig >= 2... | false | false | false | false | false | 0 |
ao_systray_set_property(GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
AoSystrayPrivate *priv = AO_SYSTRAY_GET_PRIVATE(object);
switch (prop_id)
{
case PROP_ENABLE_SYSTRAY:
priv->enable_systray = g_value_get_boolean(value);
#if GTK_CHECK_VERSION(2, 10, 0)
gtk_status_icon_... | false | false | false | false | false | 0 |
pcnet32_irq ( struct net_device *netdev, int action )
{
struct pcnet32_private *priv = netdev_priv ( netdev );
DBGP ( "pcnet32_irq\n" );
switch ( action ) {
case 0:
pcnet32_irq_disable ( priv );
break;
default:
pcnet32_irq_enable ( priv );
break;
}
} | false | false | false | false | false | 0 |
commitCommand( GameMap* map, Command& command )
{
if ( map == gamemap && map->getCurrentPlayer().isHuman() ) {
writer.printComment( command.getDescription() );
writer.printCommand( command.getCommandString() );
}
} | false | false | false | false | false | 0 |
invoke_selector(state_t *s, reg_t object, int selector_id, int noinvalid, int kfunct,
stack_ptr_t k_argp, int k_argc, /* Kernel function argp/argc */
const char *fname, int line, int argc, ...)
{
va_list argp;
int i;
int framesize = 2 + 1 * argc;
reg_t address;
int slc_type;
stack_ptr_t stackframe = k_argp + ... | false | false | false | false | false | 0 |
state_grow(json_parser *parser)
{
uint32_t newsize = parser->stack_size * 2;
void *ptr;
if (parser->config.max_nesting != 0)
return JSON_ERROR_NESTING_LIMIT;
ptr = parser_realloc(parser, parser->stack, newsize * sizeof(uint8_t));
if (!ptr)
return JSON_ERROR_NO_MEMORY;
parser->stack = (uint8_t *)ptr;
parser... | false | false | false | false | false | 0 |
close_notice(Widget gw)
{
NoticeWidget w = (NoticeWidget)gw;
XtCallbackList c_list = w->notice.callback;
if (c_list)
XtCallCallbackList((Widget)w, c_list, (XtPointer)NoticeReplyClose);
else
XtDestroyWidget((Widget)w);
} | false | false | false | false | false | 0 |
ath_mci_del_profile(struct ath_common *common,
struct ath_mci_profile *mci,
struct ath_mci_profile_info *entry)
{
if (!entry)
return;
DEC_PROF(mci, entry);
list_del(&entry->list);
kfree(entry);
} | false | false | false | false | false | 0 |
mdio_write(struct net_device *dev, int phy_id, int loc, int value)
{
unsigned int addr = dev->base_addr + MGMT;
u_int cmd = (0x05<<28)|(phy_id<<23)|(loc<<18)|(1<<17)|value;
int i;
mdio_sync(addr);
for (i = 31; i >= 0; i--) {
int dat = (cmd&(1<<i)) ? MDIO_DATA_WRITE1 : MDIO_DATA_WRITE0;
outb(dat, ... | false | false | false | false | false | 0 |
lotus_set_formats_cb (LotusState *state, const GnmSheetRange *r,
const guint8 *data, size_t len)
{
guint32 fmt;
GnmStyle *style;
char *fmt_string;
g_return_if_fail (len == 0 || len >= 4);
if (len == 0)
return;
#ifdef DEBUG_FORMAT
g_printerr ("Got format for %s!%s",
r->sheet->name_unquoted,
cellp... | false | false | false | false | false | 0 |
H5P__dxfr_xform_cmp(const void *_xform1, const void *_xform2, size_t UNUSED size)
{
const H5Z_data_xform_t * const *xform1 = (const H5Z_data_xform_t * const *)_xform1; /* Create local aliases for values */
const H5Z_data_xform_t * const *xform2 = (const H5Z_data_xform_t * const *)_xform2; /* Create local aliase... | false | false | false | false | false | 0 |
mg_set_leaf_id(struct scsi_cmnd *srb, struct rtsx_chip *chip)
{
int retval;
int i;
unsigned int lun = SCSI_LUN(srb);
u8 buf1[32], buf2[12];
if (scsi_bufflen(srb) < 12) {
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_INVALID_CMD_FIELD);
rtsx_trace(chip);
return STATUS_FAIL;
}
ms_cleanup_work(chip);
retval ... | false | false | false | false | false | 0 |
decContextDefault(decContext *context, Int kind) {
/* set defaults... */
context->digits=9; /* 9 digits */
context->emax=DEC_MAX_EMAX; /* 9-digit exponents */
context->emin=DEC_MIN_EMIN; /* .. balanced */
context->round=DEC_ROUND_HALF_UP; /* 0.5 rises */
context->traps=DEC_Errors; ... | false | false | false | false | false | 0 |
panel_above(const PANEL * pan)
{
T((T_CALLED("panel_above(%p)"), pan));
if (!pan)
{
/* if top and bottom are equal, we have no or only the pseudo panel;
if not, we return the panel above the pseudo panel */
returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above);
}
else
... | false | false | false | false | false | 0 |
gdl_dock_object_real_detach (GdlDockObject *object,
gboolean recursive)
{
GdlDockObject *parent;
GtkWidget *widget;
g_return_if_fail (object != NULL);
/* detach children */
if (recursive && gdl_dock_object_is_compound (object)) {
gtk_container_for... | false | false | false | false | false | 0 |
sort_tab_widget_refresh(SortTabWidget *self) {
g_return_if_fail(self);
_sort_tab_widget_page_selected(self, sort_tab_widget_get_instance(self));
} | false | false | false | false | false | 0 |
windows_refnum_last(void)
{
GSList *tmp;
int max;
max = -1;
for (tmp = windows; tmp != NULL; tmp = tmp->next) {
WINDOW_REC *rec = tmp->data;
if (rec->refnum > max)
max = rec->refnum;
}
return max;
} | false | false | false | false | false | 0 |
globus_gfs_ipc_destroy()
{
GlobusGFSName(globus_gfs_ipc_destroy);
GlobusGFSDebugEnter();
globus_mutex_destroy(&globus_l_ipc_mutex);
globus_cond_destroy(&globus_l_ipc_cond);
GlobusGFSDebugExit();
} | false | false | false | false | false | 0 |
SetFrequency(double Frequency,CText *p)
{
unsigned char Khz;
unsigned char TenKhz;
unsigned char OnehundredKhz;
unsigned char Mhz;
double RoundedFreq;
unsigned int frequency = (unsigned int) ((Frequency * 1e6) + .5);
Khz = (frequency % 10000) / 1000;
frequency /= 10000;
TenKhz = frequency % ... | false | false | false | false | false | 0 |
nfs4_alloc_lock_state(struct nfs4_state *state, fl_owner_t fl_owner)
{
struct nfs4_lock_state *lsp;
struct nfs_server *server = state->owner->so_server;
lsp = kzalloc(sizeof(*lsp), GFP_NOFS);
if (lsp == NULL)
return NULL;
nfs4_init_seqid_counter(&lsp->ls_seqid);
atomic_set(&lsp->ls_count, 1);
lsp->ls_state = ... | false | false | false | false | false | 0 |
has_file_name(git_index *index,
const git_index_entry *entry, size_t pos, int ok_to_replace)
{
int retval = 0;
size_t len = strlen(entry->path);
int stage = GIT_IDXENTRY_STAGE(entry);
const char *name = entry->path;
while (pos < index->entries.length) {
struct entry_internal *p = index->entries.contents[pos++... | false | false | false | false | false | 0 |
parseOneConfigFile (XML_Parser p) {
#define BUF_SIZE 0x1000
struct OptConfData *data = (struct OptConfData *)XML_GetUserData (p);
int status;
int fd;
if ((fd = open (data->name, O_RDONLY)) == -1) {
__driUtilMessage ("Can't open configuration file %s: %s.",
data->name, strerror (errno));
return;
... | false | true | false | false | true | 1 |
identifier_add (const char * string)
{
int code = identifier_code++ ;
if (!identifier_add_as (string, code)) return 0 ;
return code ;
} | false | false | false | false | false | 0 |
get_sec_attr(std::list<Arc::MessageAuth*> auths, const std::string& sid, const std::string& aid) {
for(std::list<Arc::MessageAuth*>::iterator a = auths.begin(); a != auths.end(); ++a) {
Arc::SecAttr* sa = (*a)->get(sid);
if(!sa) continue;
std::string str = sa->get(aid);
if(!str.empty... | false | false | false | false | false | 0 |
contact_mgmt_queue_add(const eb_account *ea, int action,
const char *new_group)
{
FILE *fp;
char buff[NAME_MAX];
snprintf(buff, NAME_MAX, "%s%ccontact_actions_queue",
config_dir, G_DIR_SEPARATOR);
fp = fopen(buff, "a");
if (!fp) {
perror(buff);
return;
}
fprintf(fp, "%s\t%d\t%s\t%s\t%s\n",
ea->ela ? ea... | false | false | false | false | false | 0 |
gm_text_buffer_enhancer_new (GtkTextBuffer* buffer)
{
GmTextBufferEnhancer* result = NULL;
GmTextBufferEnhancerPrivate* priv = NULL;
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
result
= (GmTextBufferEnhancer*)g_object_new(GM_TYPE_TEXT_BUFFER_ENHANCER, NULL);
priv = GM_TEXT_BUFFER_ENHANCE... | false | false | false | false | false | 0 |
input_disconnect_device(struct input_dev *dev)
{
struct input_handle *handle;
/*
* Mark device as going away. Note that we take dev->mutex here
* not to protect access to dev->going_away but rather to ensure
* that there are no threads in the middle of input_open_device()
*/
mutex_lock(&dev->mutex);
dev->g... | false | false | false | false | false | 0 |
CountBitsFromMask(ILuint Mask)
{
ILuint i, TestBit = 0x01, Count = 0;
ILboolean FoundBit = IL_FALSE;
for (i = 0; i < 32; i++, TestBit <<= 1) {
if (Mask & TestBit) {
if (!FoundBit)
FoundBit = IL_TRUE;
Count++;
}
else if (FoundBit)
return Count;
}
return Count;
} | false | false | false | false | false | 0 |
hash_foreach_iter(st_data_t key, st_data_t value, struct hash_foreach_arg *arg)
{
int status;
st_table *tbl;
tbl = RHASH(arg->hash)->ntbl;
if ((VALUE)key == Qundef) return ST_CONTINUE;
status = (*arg->func)((VALUE)key, (VALUE)value, arg->arg);
if (RHASH(arg->hash)->ntbl != tbl) {
rb_raise(rb_e... | false | false | false | false | false | 0 |
btrfs_wait_cache_io(struct btrfs_root *root,
struct btrfs_trans_handle *trans,
struct btrfs_block_group_cache *block_group,
struct btrfs_io_ctl *io_ctl,
struct btrfs_path *path, u64 offset)
{
int ret;
struct inode *inode = io_ctl->inode;
if (!inode)
return 0;
if (block_group)
root = root->fs_info-... | false | false | false | false | false | 0 |
exsltCryptoRc4DecryptFunction (xmlXPathParserContextPtr ctxt, int nargs) {
int key_len = 0, key_size = 0;
int str_len = 0, bin_len = 0, ret_len = 0;
xmlChar *key = NULL, *str = NULL, *padkey = NULL, *bin =
NULL, *ret = NULL;
xsltTransformContextPtr tctxt = NULL;
if (nargs != 2) {
xmlXPathSetArit... | false | true | false | false | false | 1 |
kill_undo(void)
{
n_free(prevstate);
prevstate = 0;
while(movelist) {
n_free(movelist->delta);
n_free(movelist->stackchunk);
LEremove(movelist);
}
move_index = 0;
#ifdef DEBUGGING
n_free(automap_undoslot.z_mem);
n_free(automap_undoslot.stackchunk);
automap_undoslot.z_mem = NULL;
automap_... | false | false | false | false | false | 0 |
cfunByNum(n,i) /* get ith constructor (0<=i<m) */
Name n; /* for enumerated datatype with a */
Int i; { /* representative cfun n */
if (cfunOf(n)==0)
return i==0 ? n : NIL;
else {
Addr a = name(n).code;
retur... | false | false | false | false | false | 0 |
print_term_length(struct term *t)
{
static FILE *tfp = NULL;
int i;
char s[MAX_BUF];
if (!tfp)
tfp = tmpfile();
rewind(tfp);
print_term(tfp, t);
fprintf(tfp, "%c", '\0'); /* end marker */
fflush(tfp);
rewind(tfp);
for (i = 0, s[i]=getc(tfp); s[i] && i < MAX_BUF; s[++i]=getc(tfp));
#if 0
p... | false | false | false | false | true | 1 |
addScore(float in)
{
if(game->gameMode != Global::HeroDead)
score += in;
} | false | false | false | false | false | 0 |
set_expiry(cached_resolve_t *resolve, time_t expires)
{
tor_assert(resolve && resolve->expire == 0);
if (!cached_resolve_pqueue)
cached_resolve_pqueue = smartlist_new();
resolve->expire = expires;
smartlist_pqueue_add(cached_resolve_pqueue,
_compare_cached_resolves_by_expiry,
... | false | false | false | false | false | 0 |
bn_lshift(bignum256 *a)
{
int i;
for (i = 8; i > 0; i--) {
a->val[i] = ((a->val[i] << 1) & 0x3FFFFFFF) | ((a->val[i - 1] & 0x20000000) >> 29);
}
a->val[0] = (a->val[0] << 1) & 0x3FFFFFFF;
} | false | false | false | false | false | 0 |
gzfile_write(struct gzfile *gz, Bytef *str, long len)
{
if (!(gz->z.flags & GZFILE_FLAG_HEADER_FINISHED)) {
gzfile_make_header(gz);
}
if (len > 0 || (gz->z.flags & GZFILE_FLAG_SYNC)) {
gz->crc = checksum_long(crc32, gz->crc, str, len);
zstream_run(&gz->z, str, len, (gz->z.flags & GZFILE_FLAG_SYNC)
... | false | false | false | false | false | 0 |
newTapeFileOK(QString& tapeFileName)
{
if (!isConfig()) doLoadTape(tapeFileName);
} | false | false | false | false | false | 0 |
put_text(window_textbuffer_t *dwin, char *buf, int len, int pos, int oldlen)
{
int diff = len - oldlen;
if (dwin->numchars + diff >= TBLINELEN)
return;
if (diff != 0 && pos + oldlen < dwin->numchars)
{
memmove(dwin->chars + pos + len,
dwin->chars + pos + oldle... | false | false | false | false | false | 0 |
lcdDisplay(void) {
char byte;
lcd_select();
if(displayType==DISPLAY_N1200){
lcdWrite(TYPE_CMD,0xB0);
lcdWrite(TYPE_CMD,0x10);
lcdWrite(TYPE_CMD,0x00);
uint16_t i,page;
for(page=0; page<RESY_B;page++) {
for(i=0; i<RESX; i++) {
if (GLOBAL(lcdmirror))
... | false | false | false | false | false | 0 |
firstRow()
{
GtkTreeIter iter;
if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL(store), &iter))
return NULL;
return iterToKey(&iter);
} | false | false | false | false | false | 0 |
put_set(_set *s)
{
int n = 0;
while (s != NULL) {
if (n % 4 == 0) fputc('\n', output_file);
fprintf(output_file, "(%.4f,%.4f)", s->p->x, s->p->y);
s = s->next;
n++;
}
fputc('\n', output_file);
} | false | false | false | false | false | 0 |
rfd_ftl_writesect(struct mtd_blktrans_dev *dev, u_long sector, char *buf)
{
struct partition *part = (struct partition*)dev;
u_long old_addr;
int i;
int rc = 0;
pr_debug("rfd_ftl_writesect(sector=0x%lx)\n", sector);
if (part->reserved_block == -1) {
rc = -EACCES;
goto err;
}
if (sector >= part->sector_co... | false | false | false | false | false | 0 |
lookup_header(const request_rec *r, const char *name)
{
int i;
const apr_array_header_t *hdrs_arr;
const apr_table_entry_t *hdrs;
hdrs_arr = apr_table_elts(r->headers_in);
hdrs = (apr_table_entry_t *) hdrs_arr->elts;
for (i = 0; i < hdrs_arr->nelts; ++i) {
if (hdrs[i].key != NULL && strcasecmp(hdrs[i].key... | false | false | false | false | false | 0 |
FindLevel( double dfLevel )
{
int nStart=0, nEnd=nLevelCount-1, nMiddle;
/* -------------------------------------------------------------------- */
/* Binary search to find the requested level. */
/* -------------------------------------------------------------------- */
while( nStar... | false | false | false | false | false | 0 |
aim_get_command_rendezvous(aim_session_t *sess, aim_conn_t *conn,
aim_frame_t *fr)
{
fu8_t rendhdr_raw[8];
aim_bstream_t rendhdr;
aim_bstream_init(&rendhdr, rendhdr_raw, sizeof(rendhdr_raw));
if (aim_bstream_recv(&rendhdr, conn->fd, 8) < 8) {
aim_conn_close(conn);
return -1;
}
aim_bstream_rewind(&rendhdr)... | false | false | false | false | false | 0 |
command_lines_stub (XDR *xdr_in)
{
char **r;
struct guestfs_command_lines_args args;
char **arguments;
if (optargs_bitmask != 0) {
reply_with_error ("header optargs_bitmask field must be passed as 0 for calls that don't take optional arguments");
goto done_no_free;
}
memset (&args, 0, sizeof args)... | false | false | false | false | false | 0 |
init_whole_project (Subversion *plugin, GtkWidget* project, gboolean active)
{
gboolean project_loaded;
project_loaded = (plugin->project_root_dir != NULL);
gtk_widget_set_sensitive(project, project_loaded);
if (project_loaded)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (project), active);
} | false | false | false | false | false | 0 |
get_partitions(char *dev, int fd, struct disk_desc *z) {
z->partno = 0;
if (!msdos_partition(dev, fd, 0, z)
&& !osf_partition(dev, fd, 0, z)
&& !sun_partition(dev, fd, 0, z)
&& !amiga_partition(dev, fd, 0, z)) {
do_warn(_(" %s: unrecognized partition table type\n"), dev);
return;
}
} | false | false | false | false | false | 0 |
rwlock_demo(int readers, int writers, work_t* works, int seconds) {
long i;
pthread_t *t;
rwlock_demo_header(readers, writers, works);
t = calloc(readers + writers, sizeof (pthread_t));
done = 0;
pthread_barrier_init(&start, NULL, readers + writers + 1);
for (i = 0; i < readers; ++i) {
... | 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.