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 |
|---|---|---|---|---|---|---|
Initialize(CPLXMLNode *config) {
CPLErr ret = CE_None;
if (ret == CE_None) {
const char *base_url = CPLGetXMLValue(config, "ServerURL", "");
if (base_url[0] != '\0') {
/* Try the old name */
base_url = CPLGetXMLValue(config, "ServerUrl", "");
}
if (base_u... | false | false | false | false | false | 0 |
parse_cshl (data, cfile)
struct data_string *data;
struct parse *cfile;
{
u_int8_t ibuf [128];
unsigned ilen = 0;
unsigned tlen = 0;
struct option_tag *sl = (struct option_tag *)0;
struct option_tag *next, **last = &sl;
enum dhcp_token token;
const char *val;
unsigned char *rvp;
do {
token = next_token (&... | false | false | false | false | false | 0 |
pf_compare_words (const sc_char *string, const sc_char *words)
{
sc_int word_posn, posn;
/* None expected, but skip leading space. */
for (word_posn = 0; sc_isspace (words[word_posn]) && words[word_posn] != NUL;)
word_posn++;
/* Match characters from words with the string at position. */
posn = 0;
whi... | false | false | false | false | false | 0 |
glade_gtk_combo_box_set_items (GObject *object, const GValue *value)
{
GtkComboBox *combo = GTK_COMBO_BOX (object);
GladeWidget *widget = glade_widget_get_from_gobject (object);
gchar **split;
gint i;
if (glade_project_get_format (widget->project) != GLADE_PROJECT_FORMAT_LIBGLADE)
return;
combo_ensure_mod... | false | false | false | false | false | 0 |
dconf_libdbus_1_get_message_body (DBusMessage *message,
GError **error)
{
GVariantBuilder builder;
const gchar *signature;
DBusMessageIter iter;
/* We support two types: strings and arrays of strings.
*
* It's very simple to detect if the message contains only thes... | false | false | false | false | false | 0 |
DeleteRvalItem(void *rval, char type)
{ struct Rlist *clist, *next = NULL;
Debug("DeleteRvalItem(%c)",type);
if (DEBUG)
{
ShowRval(stdout,rval,type);
}
Debug("\n");
if (rval == NULL)
{
Debug("DeleteRval NULL\n");
return;
}
switch(type)
{
case CF_SCALAR:
ThreadLock(cft_lock);
... | false | false | false | false | false | 0 |
_e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *borders, E_Menu *m)
{
E_Desk *desk = NULL;
Eina_List *l = NULL, *alt = NULL, *ico = NULL;
E_Border *bd;
E_Menu *subm;
E_Menu_Item *mi = NULL;
/* Deal with present desk first */
EINA_LIST_FOREACH(borders, l, bd)
{
if (bd->i... | false | false | false | false | false | 0 |
Perl_cop_store_label(pTHX_ COP *const cop, const char *label, STRLEN len,
U32 flags)
{
SV *labelsv;
PERL_ARGS_ASSERT_COP_STORE_LABEL;
if (flags & ~(SVf_UTF8))
Perl_croak(aTHX_ "panic: cop_store_label illegal flag bits 0x%" UVxf,
(UV)flags);
labelsv = newSVpvn_flags(label, len, SVs_TEMP);
... | false | false | false | false | false | 0 |
begin_image_command(byte *buf, uint buf_size, const gs_image_common_t *pic)
{
int i;
stream s;
const gs_color_space *ignore_pcs;
int code;
for (i = 0; i < gx_image_type_table_count; ++i)
if (gx_image_type_table[i] == pic->type)
break;
if (i >= gx_image_type_table_count)
... | false | false | false | false | false | 0 |
LoadContext(Register dst, int context_chain_length) {
if (context_chain_length > 0) {
// Move up the chain of contexts to the context containing the slot.
movq(dst, Operand(rsi, Context::SlotOffset(Context::CLOSURE_INDEX)));
// Load the function context (which is the incoming, outer context).
movq(dst... | false | false | false | false | false | 0 |
setArgusdflag(int value)
{
if (Argusdflag && !(value)) {
}
if (value) {
}
Argusdflag = value;
} | false | false | false | false | false | 0 |
add_single()
{
// remap atom if requested
if (remapflag) {
tagint imagetmp = ((tagint) IMGMAX << IMG2BITS) |
((tagint) IMGMAX << IMGBITS) | IMGMAX;
domain->remap(xone,imagetmp);
}
// if triclinic, convert to lamda coords (0-1)
double lamda[3],*coord;
if (triclinic) {
domain->x2lamda(xon... | false | false | false | false | false | 0 |
convert_polygon_set(state_t *s, reg_t poly_list, point_t start, point_t end, int opt)
/* Converts the SCI input data for pathfinding
** Parameters: (state_t *) s: The game state
** (reg_t) poly_list: Polygon list
** (point_t) start: The start point
** (point_t) end: The end point
** ... | false | false | false | false | false | 0 |
calculate_framerate_bitrate (guint8 frmrtq_postproc, guint8 bitrtq_postproc,
guint * framerate, guint * bitrate)
{
if (frmrtq_postproc == 0 && bitrtq_postproc == 31) {
*framerate = 0;
*bitrate = 0;
} else if (frmrtq_postproc == 0 && bitrtq_postproc == 30) {
*framerate = 2;
*bitrate = 1952;
} e... | false | false | false | false | false | 0 |
grid_to_degree(const char *units, long nvals, double *restrict values, const char *description)
{
if ( memcmp(units, "radian", 6) == 0 )
{
for ( long n = 0; n < nvals; ++n ) values[n] *= RAD2DEG;
}
else if ( memcmp(units, "degree", 6) == 0 )
{
/* No conversion necessary */
}
else
{... | false | false | false | false | false | 0 |
clear_text_window( )
{
int i, row, col;
get_cursor_position( &row, &col );
for ( i = status_size + 1; i <= screen_rows; i++ )
{
move_cursor( i, 1 );
clear_line( );
}
move_cursor( row, col );
} | false | false | false | false | false | 0 |
isi_camera_remove_device(struct soc_camera_device *icd)
{
dev_dbg(icd->parent, "Atmel ISI Camera driver detached from camera %d\n",
icd->devnum);
} | false | false | false | false | false | 0 |
luaL_argerror (lua_State *L, int narg, const char *extramsg) {
lua_Debug ar;
lua_getstack(L, 0, &ar);
lua_getinfo(L, "n", &ar);
if (ar.name == NULL)
ar.name = "?";
luaL_verror(L, "bad argument #%d to `%.50s' (%.100s)",
narg, ar.name, extramsg);
} | false | false | false | false | false | 0 |
ar5008_hw_ani_cache_ini_regs(struct ath_hw *ah)
{
struct ath9k_channel *chan = ah->curchan;
struct ar5416AniState *aniState = &chan->ani;
struct ath9k_ani_default *iniDef;
u32 val;
iniDef = &aniState->iniDef;
DBG2("ath9k: ver %d.%d chan %d Mhz/0x%x\n",
ah->hw_version.macVersion,
ah->hw_version.macRev,
cha... | false | false | false | false | false | 0 |
e_thumb_icon_file_set(Evas_Object *obj, const char *file, const char *key)
{
E_Thumb *eth;
eth = evas_object_data_get(obj, "e_thumbdata");
if (!eth) return;
eina_stringshare_replace(ð->file, file);
eina_stringshare_replace(ð->key, key);
E_FREE(eth->sort_id);
} | false | false | false | false | false | 0 |
pkix_pl_CRLEntry_Hashcode(
PKIX_PL_Object *object,
PKIX_UInt32 *pHashcode,
void *plContext)
{
SECItem *nssDate = NULL;
PKIX_PL_CRLEntry *crlEntry = NULL;
PKIX_UInt32 crlEntryHash;
PKIX_UInt32 hashValue;
PKIX_Int32 reasonCode = 0;
PKIX_ENTER(CRLENT... | false | false | false | false | false | 0 |
connect_model (EReflow *reflow,
EReflowModel *model)
{
if (reflow->model != NULL)
disconnect_model (reflow);
if (model == NULL)
return;
reflow->model = g_object_ref (model);
reflow->model_changed_id = g_signal_connect (
reflow->model, "model_changed",
G_CALLBACK (model_changed), reflow);
... | false | false | false | false | false | 0 |
closescript(void)
{
popallfiles();
if (parsefile->fd > 0) {
close(parsefile->fd);
parsefile->fd = 0;
}
} | false | false | false | false | false | 0 |
hdhomerun_pkt_read_var_length(struct hdhomerun_pkt_t *pkt)
{
size_t length;
if (pkt->pos + 1 > pkt->end) {
return (size_t)-1;
}
length = (size_t)*pkt->pos++;
if (length & 0x0080) {
if (pkt->pos + 1 > pkt->end) {
return (size_t)-1;
}
length &= 0x007F;
length |= (size_t)*pkt->pos++ << 7;
}
retur... | false | false | false | false | false | 0 |
__ipoib_get_net_dev_by_params(struct list_head *dev_list, u8 port,
u16 pkey_index,
const union ib_gid *gid,
const struct sockaddr *addr,
struct net_device **net_dev)
{
struct ipoib_dev_priv *priv;
int matches = 0;
*net_dev = NULL;
list_for_each_entry(priv, dev_list, list) {
if (priv->por... | false | false | false | false | false | 0 |
e_table_item_get_focused_column (ETableItem *eti)
{
gint cursor_col;
g_return_val_if_fail (eti != NULL, -1);
g_return_val_if_fail (E_IS_TABLE_ITEM (eti), -1);
g_object_get (
eti->selection,
"cursor_col", &cursor_col,
NULL);
return cursor_col;
} | false | false | false | false | false | 0 |
evd_socket_unwatch (EvdSocket *self, GError **error)
{
if (self->priv->poll_session == NULL
|| evd_poll_del (self->priv->poll,
self->priv->poll_session,
error))
{
return TRUE;
}
else
{
return FALSE;
}
} | false | false | false | false | false | 0 |
ct_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
struct ct_atc *atc = snd_pcm_substream_chip(substream);
struct ct_atc_pcm *apcm = substream->runtime->private_data;
int err;
err = snd_pcm_lib_malloc_pages(substream,
params_buffer_bytes(hw_params));
if (err... | false | false | false | false | false | 0 |
z_clear_attr( zword_t obj, zword_t bit )
{
zword_t objp;
zbyte_t value;
assert( O3_ATTRIBUTES == O4_ATTRIBUTES );
#ifdef STRICTZ
if ( obj == 0 )
{
report_strictz_error( STRZERR_CLEAR_ATTR, "@clear_attr called with object 0" );
return;
}
#endif
/* Get attribute address */
objp = g... | false | false | false | false | false | 0 |
mrf24j40_intstat_complete(void *context)
{
struct mrf24j40 *devrec = context;
u8 intstat = devrec->irq_buf[1];
enable_irq(devrec->spi->irq);
/* Check for TX complete */
if (intstat & BIT_TXNIF)
ieee802154_xmit_complete(devrec->hw, devrec->tx_skb, false);
/* Check for Rx */
if (intstat & BIT_RXIF)
mrf24j40... | false | false | false | false | false | 0 |
deleteHash(Hashtable* hTable)
{
if ( hTable == NULL ) {
return;
}
int32_t pos = -1;
const UHashElement* element = NULL;
while ( (element = hTable->nextElement(pos)) != NULL ) {
const UHashTok keyTok = element->key;
const UHashTok valueTok = element->value;
const Unic... | false | false | false | false | false | 0 |
check_one (mpz_srcptr a, unsigned long d, int want)
{
int got;
got = (mpz_divisible_2exp_p (a, d) != 0);
if (want != got)
{
printf ("mpz_divisible_2exp_p wrong\n");
printf (" expected %d got %d\n", want, got);
mpz_trace (" a", a);
printf (" d=%lu\n", d);
mp_trace_base... | false | false | false | false | false | 0 |
_e_wid_gradient_range_set(Evas_Object *o, Eina_Bool orientation,
int rf, int gf, int bf,
int rt, int gt, int bt,
int from, int to)
{
unsigned int *pixels, *p;
int x, r, g, b, v, t;
if (from < 0) from = 0;
if (from > 255) from = 2... | false | false | false | false | false | 0 |
defpoint(int off, ubyte *bsp_data)
{
int n;
int nverts = w(off+bsp_data+8);
int offset = w(off+bsp_data+16);
ubyte * normcount = off+bsp_data+20;
vec3d *src = vp(off+bsp_data+offset);
if(n_rays < nverts){
if(ray)vm_free(ray);
ray = (flash_beam*)vm_malloc(sizeof(flash_beam)*nverts);
n_rays = nverts;
}
{... | false | false | false | false | false | 0 |
hash_find_channels(char *name, aChannel *chptr)
{
aChannel *tmp;
u_int hashv, hv;
if (chptr == NULL)
{
aHashEntry *tmp3;
hashv = hash_channel_name(name, &hv, 1);
tmp3 = &channelTable[hashv];
chptr = (aChannel *) tmp3->list;
}
else
{
hv = chptr->hashv;
chptr = chptr->hnextch;
}
if... | false | false | false | false | false | 0 |
pull(int)
{
Packet *p = 0;
if (_rate.need_update(Timestamp::now())) {
if ((p = input(0).pull()))
_rate.update_with(p->length());
}
return p;
} | false | false | false | false | false | 0 |
DeleteModule(TModule *module){
GetLogger().GetStream(LOG_INFO) << "[SAORI Unique] DeleteModule " << endl;
if (!module) return;
SAORI_HANDLE handle=module->GetHandle();
if (!modules.count(handle)) return;
TUniqueModule *mod=modules[handle];
GetLogger().GetStream(LOG_INFO) << " loadcount=" << ... | false | false | false | false | false | 0 |
multiattrib_callback_response (GtkDialog *dialog,
gint arg1,
gpointer user_data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*)user_data;
switch (arg1) {
case GTK_RESPONSE_CLOSE:
case GTK_RESPONSE_DELETE_EVENT:
/* cut link from di... | false | false | false | false | false | 0 |
Button_Layer_up(void)
{
Hide_cursor();
if (Main_current_layer < (Main_backups->Pages->Nb_layers-1))
{
byte * tmp;
dword layer_flags;
// Backup with unchanged layers
Backup_layers(0);
// swap
tmp = Main_backups->Pages->Image[Main_current_layer];
Main_backups->Pa... | false | false | false | false | false | 0 |
remonte_con(locon_list *con_circuit, locon_list *con_plot,
chain_list *liste_plotsph, phfig_list *circuit_ph)
{
phcon_list * conph;
conph = cherche_conph_circuit(con_plot, liste_plotsph, circuit_ph);
if (NULL != conph)
remonter_uncon_instph(conph->INDEX, conph->NAME, ((loins_list * )con_plot->ROOT)->INSNAME, co... | false | false | false | false | false | 0 |
mace_config(struct net_device *dev, struct ifmap *map)
{
if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) {
if (map->port <= 2) {
dev->if_port = map->port;
netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]);
} else
return -EINVAL;
}
return 0;
} | false | false | false | false | false | 0 |
contacts_aliases_changed (TpConnection *connection,
const GPtrArray *alias_structs,
gpointer user_data G_GNUC_UNUSED,
GObject *weak_object G_GNUC_UNUSED)
{
guint i;
for (i = 0; i < alias_structs->len; i++)
{
GValueArray *pair =... | false | false | false | false | false | 0 |
show_mindeg_state(S)
struct linsys *S;
{ char *marks; /* unelim node numbers */
edge_id e_id;
int j;
int rcount;
struct region *r;
int rnum;
int snum;
struct supernode *s;
/* count regions */
for ( rnum = regionstart, rcount=0 ; rnum >= 0 ; rnum = r->next )
{ r = REG(rnum);
rcount++;
}
... | false | false | false | false | false | 0 |
navUkfSetHereAsPositionTarget(void) {
if (navUkfData.flowPosN != 0.0f && navUkfData.flowPosE != 0.0f) {
navUkfSetLocalPositionTarget(navUkfData.flowPosN, navUkfData.flowPosE);
} else {
navUkfSetGlobalPositionTarget(gpsData.lat, gpsData.lon);
}
} | false | false | false | false | false | 0 |
bn_add_1(u8 *d, u8 *a, u8 *b, u32 n)
{
u32 i;
u32 dig;
u8 c;
c = 0;
for (i = n - 1; i < n; i--) {
dig = a[i] + b[i] + c;
c = dig >> 8;
d[i] = dig;
}
return c;
} | false | false | false | false | false | 0 |
insertRow (int row, const QModelIndex &parent/* = QModelIndex ()*/)
{
// DBGOUT("entered");
beginInsertRows (parent, row, row);
bool ret = false;
Xmms2dPrefItem *parentItem;
if(!parent.isValid ())
parentItem = rootItem;
else
parentItem = static_cast<Xmms2dPrefItem *>(parent.internalPointer ());
if(parentIte... | false | false | false | false | false | 0 |
clear_graphics_4bit(
unsigned short page,
unsigned char left,
unsigned char top,
unsigned char right,
unsigned char bottom,
unsigned char attr
)
{
unsigned short cols;
unsigned short x;
unsigned short y;
unsigned long offset;
cols = var_get(vid_columns);
outw( 0x0005, 0x3ce); /* UMVGA->mode: read ... | false | false | false | false | false | 0 |
addAttribute(LLVMContext &C, unsigned Index,
StringRef Kind, StringRef Value) const {
llvm::AttrBuilder B;
B.addAttribute(Kind, Value);
return addAttributes(C, Index, AttributeSet::get(C, Index, B));
} | false | false | false | false | false | 0 |
find_str_in_list(list , elm)
char **list;
char *elm;
{
int i=0;
krb5_boolean found = FALSE;
if (!list) return found;
while (list[i] ){
if (!strcmp(list[i], elm)){
found = TRUE;
break;
}
i++;
}
return found;
} | false | false | false | false | false | 0 |
b43_ntab_read(struct b43_wldev *dev, u32 offset)
{
u32 type, value;
type = offset & B43_NTAB_TYPEMASK;
offset &= ~B43_NTAB_TYPEMASK;
B43_WARN_ON(offset > 0xFFFF);
switch (type) {
case B43_NTAB_8BIT:
b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset);
value = b43_phy_read(dev, B43_NPHY_TABLE_DATALO) & 0xFF;
b... | false | false | false | false | false | 0 |
falcon_write ( struct efab_nic *efab, efab_oword_t *value, unsigned int reg )
{
EFAB_REGDUMP ( "Writing register %x with " EFAB_OWORD_FMT "\n",
reg, EFAB_OWORD_VAL ( *value ) );
_falcon_writel ( efab, value->u32[0], reg + 0 );
_falcon_writel ( efab, value->u32[1], reg + 4 );
_falcon_writel ( efab, valu... | false | false | false | false | false | 0 |
OnDown(wxCommandEvent &/*event*/)
{
int i=idfavlist->GetSelection();
if(i<0)
return;
if((unsigned int)i>=idfavlist->GetCount()-1) //TODO: Perhaps more correct to define unsigned int j, set j=i, then do the comparison
return;
m_favdirs[i].alias=idalias->GetValue();
m_favdirs[i].path=i... | false | false | false | false | false | 0 |
gfs2_log_write(struct gfs2_sbd *sdp, struct page *page,
unsigned size, unsigned offset)
{
u64 blkno = gfs2_log_bmap(sdp);
struct bio *bio;
int ret;
bio = gfs2_log_get_bio(sdp, blkno);
ret = bio_add_page(bio, page, size, offset);
if (ret == 0) {
gfs2_log_flush_bio(sdp, WRITE);
bio = gfs2_log_alloc_bio(s... | false | false | false | false | false | 0 |
minimize_golden(double a, double b, double c,
double fa, double fb, double fc)
{
// Set up object to evaluate function as f(x)
// Note that *f_ takes a vector input - f converts a scalar to a vector
vnl_brent_minimizer_func f(*f_);
double m = 0.5*(a+c); // Midpoint ... | false | false | false | false | false | 0 |
set_game_path(const char *gamepath, const char *patchpath)
{
// Finish up external edits.
Shape_chooser::clear_editing_files();
// Set top-level path.
add_system_path("<GAME>", gamepath);
if (static_path)
g_free(static_path);
// Set up path to static.
static_path = g_strdup_printf("%s/static", game... | false | false | false | false | false | 0 |
unpoison_memory(unsigned long pfn)
{
struct page *page;
struct page *p;
int freeit = 0;
unsigned int nr_pages;
static DEFINE_RATELIMIT_STATE(unpoison_rs, DEFAULT_RATELIMIT_INTERVAL,
DEFAULT_RATELIMIT_BURST);
if (!pfn_valid(pfn))
return -ENXIO;
p = pfn_to_page(pfn);
page = compound_head(p);
if (!PageH... | false | false | false | false | false | 0 |
Clear(void)
{
if(META_DEBUG) METAIO_STREAM::cout << "MetaBlob: Clear" << METAIO_STREAM::endl;
MetaObject::Clear();
if(META_DEBUG) METAIO_STREAM::cout << "MetaBlob: Clear: m_NPoints" << METAIO_STREAM::endl;
// Delete the list of pointers to blobs.
PointListType::iterator it = m_PointList.begin();
while(it !=... | false | false | false | false | false | 0 |
dump_elf_symbols (ElfW(Sym) *symbols, int num_symbols, const char *strtab, void *load_addr)
{
int i;
for (i = 0; i < num_symbols; ++i) {
const char* sym;
sym = strtab + symbols [i].st_name;
if (!symbols [i].st_name || !symbols [i].st_size || (symbols [i].st_info & 0xf) != STT_FUNC)
continue;
//printf ("sy... | false | false | false | false | false | 0 |
getLocalizedFile( const ASCString& filename, const ASCString& nativeMessageLanguage )
{
ASCString lang = getLang();
if ( lang != nativeMessageLanguage && !lang.empty()) {
ASCString newfilename = filename + "." + lang;
if ( exist( newfilename ))
return newfilename;
else {
... | false | false | false | false | false | 0 |
slk_attroff ( const chtype attrs ) {
if ( slks == NULL )
return ERR;
slks->attrs &= ~( attrs & A_ATTRIBUTES );
return OK;
} | false | false | false | false | false | 0 |
icalrestriction_get_component_restriction(icalproperty_method method,
icalcomponent_kind component,
icalcomponent_kind subcomponent)
{
int i;
for(i = 0;
icalrestriction_component_records[i].restriction != ICAL_RESTRICTION_NONE;
i++){
if (method == icalrestriction_component_records[i].method ... | false | false | false | false | false | 0 |
m_users(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
static time_t last_used = 0;
if (last_used + ConfigFileEntry.pace_wait_simple > CurrentTime)
{
sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name);
return;
}
last_used = Curren... | false | false | false | false | false | 0 |
ib_alloc_fmr(struct ib_pd *pd,
int mr_access_flags,
struct ib_fmr_attr *fmr_attr)
{
struct ib_fmr *fmr;
if (!pd->device->alloc_fmr)
return ERR_PTR(-ENOSYS);
fmr = pd->device->alloc_fmr(pd, mr_access_flags, fmr_attr);
if (!IS_ERR(fmr)) {
fmr->device = pd->device;
fmr->pd = pd;
atomic_inc(... | false | false | false | false | false | 0 |
zmakeQ(QR,diag,Qout)
ZMAT *QR,*Qout;
ZVEC *diag;
{
static ZVEC *tmp1=ZVNULL,*tmp2=ZVNULL;
u_int i, limit;
Real beta, r_ii, tmp_val;
int j;
limit = min(QR->m,QR->n);
if ( ! QR || ! diag )
error(E_NULL,"zmakeQ");
if ( diag->dim < limit )
error(E_SIZES,"zmakeQ");
Qout = zm_resize(Qout,QR... | false | false | false | true | false | 1 |
tree_set_value(struct tree *tree, const char *value) {
char *v = NULL;
if (streqv(tree->value, value))
return 0;
if (value != NULL) {
v = strdup(value);
if (v == NULL)
return -1;
}
tree_store_value(tree, &v);
return 0;
} | false | false | false | false | false | 0 |
sv_flag_status_update_range (SheetView *sv, GnmRange const *range)
{
g_return_if_fail (IS_SHEET_VIEW (sv));
/* Force an update */
if (range == NULL) {
sv->selection_content_changed = TRUE;
sv->edit_pos_changed.location =
sv->edit_pos_changed.content =
sv->edit_pos_changed.style = TRUE;
return;
}
/* if... | false | false | false | false | false | 0 |
handle_message(struct fw_card *card, struct fw_request *request,
int tcode, int destination, int source,
int generation, unsigned long long offset,
void *data, size_t length, void *callback_data)
{
struct snd_dg00x *dg00x = callback_data;
__be32 *buf = (__be32 *)data;
if (offset == dg00x->async_ha... | false | false | false | false | false | 0 |
ep93xx_spi_cs_control(struct spi_device *spi, bool control)
{
struct ep93xx_spi_chip *chip = spi_get_ctldata(spi);
int value = (spi->mode & SPI_CS_HIGH) ? control : !control;
if (chip->ops && chip->ops->cs_control)
chip->ops->cs_control(spi, value);
} | false | false | false | false | false | 0 |
jeol_detect(const GwyFileDetectInfo *fileinfo, gboolean only_name)
{
if (only_name)
return 0;
if (fileinfo->buffer_len <= MAGIC_SIZE
|| memcmp(fileinfo->head, MAGIC, MAGIC_SIZE) != 0
|| fileinfo->file_size < JEOL_DATA_START)
return 0;
/* TODO: check it better, some TIFFs ca... | false | false | false | false | false | 0 |
add_to_request(Xdf_t *This, int ptr,
RawRequest_t *request, int *nr,
int direction, Compactify_t *compactify)
{
#if 0
if(direction == MT_WRITE) {
printf("writing %d: %d %d %d %d [%02x]\n",
ptr, This->current_track,
REC.head, REC.sector, REC.sizecode,
*(This->buffer + ptr * This-... | false | false | false | false | false | 0 |
hpsolb_(int n, double *t, int *iorder, int iheap)
{
int i, j, k;
double out, ddum;
int indxin, indxou;
--iorder;
--t;
if (iheap == 0) {
for (k = 2; k <= n; ++k) {
ddum = t[k];
indxin = iorder[k];
i = k;
L10:
if (i > 1) {
j = i / 2;
if (ddum < t[j]) {
t[i] = t[j]... | false | false | false | false | false | 0 |
MyCPUUsageCPUTimeNsLocked(double* cputime) {
static int cputime_fd = -1;
if (cputime_fd == -1) {
cputime_fd = open("/proc/self/cputime_ns", O_RDONLY);
if (cputime_fd < 0) {
cputime_fd = -1;
return false;
}
}
char buff[64];
memset(buff, 0, sizeof(buff));
if (pread(cputime_fd, buff, si... | false | false | false | false | false | 0 |
fontset_transsep(char *nfname, char *ofname, int n)
{
char *s;
strncpy(nfname, ofname, n);
if (nfname[n-1]!='\0')
nfname[n]='\0';
if (strchr(nfname, ','))
return 1;
s = nfname;
while ((s = strchr(nfname, FontSetSep)) != NULL){
*s = ',';
nfname = s;
}
return 0;
} | false | false | false | false | false | 0 |
CyaSSL_SetAllocators(CyaSSL_Malloc_cb mf,
CyaSSL_Free_cb ff,
CyaSSL_Realloc_cb rf)
{
int res = 0;
if (mf)
malloc_function = mf;
else
res = BAD_FUNC_ARG;
if (ff)
free_function = ff;
else
res = BAD_FUNC_ARG;
if (... | false | false | false | false | false | 0 |
hermite_weight(long n, double * hroot, double * weights)
{
/* calculate the weights for the hermite polynomial at the roots
using formula from Abramowitz and Stegun chapter 25.4.46 p.890 */
long i;
double hr2;
double numerator;
numerator = exp(0.6931471805599 * ( n-1.) + logfac(n)) / (n*n);
for (i = 0... | false | false | false | false | false | 0 |
go_plugin_loader_module_load_base (GOPluginLoader *loader, GOErrorInfo **err)
{
GOPluginLoaderModule *loader_module = GO_PLUGIN_LOADER_MODULE (loader);
gchar *full_module_file_name;
GModule *handle;
GOPluginModuleHeader const *go_plugin_header = NULL;
GOPluginModuleDepend const *go_plugin_depends = NULL;
GO_INIT... | false | false | false | false | false | 0 |
test_oauth1_authorizer_request_authorization_async_bad_credentials (OAuth1AuthorizerInteractiveAsyncData *data, gconstpointer user_data)
{
gdata_test_mock_server_start_trace (mock_server, "oauth1-authorizer-request-authorization-async-bad-credentials");
/* Check we're not authorised beforehand */
g_assert (gdata_au... | false | false | false | false | false | 0 |
main() {
char *s_test[100];
int i;
memset(s_test, 0, sizeof(s_test));
for (i = 0; i < 100; i++)
{
s_test[i] = (char *) calloc(1, 10);;
fprintf(stderr,
"Alloc %d position\n", i);
}
sm_dump(0);
for (i = 0; i < 100; i++)
{
if(s_test[i])
{
free(s_test[i]);
s_test[i] = NULL;
fp... | false | false | false | false | false | 0 |
print_method_body (Method *m, gboolean pre, gboolean unused_self)
{
out_printf(out, "{\n");
if (m->line_no > 0)
out_addline_outfile(out);
out_printf(out, "#define __GOB_FUNCTION__ \"%s::%s\"\n",
((Class *)class)->otype,
m->id);
if (pre)
print_preconditions(m);
if ( ! pre &&
unused_self &&
... | false | false | false | false | false | 0 |
GetTargetPhraseCollection(const Phrase& src) const
{
TargetPhraseCollection *ret = new TargetPhraseCollection();
std::vector< std::pair< Scores, TargetPhrase*> > trg;
// extract target phrases and their scores from suffix array
m_biSA->GetTargetPhrasesByLexicalWeight( src, trg);
std::vector< std::pair< Score... | false | false | false | false | false | 0 |
cb_instance_userpassword_set(void *arg, void *value, char *errorbuf, int phase, int apply)
{
cb_backend_instance * inst=(cb_backend_instance *) arg;
int rc=LDAP_SUCCESS;
if (apply) {
slapi_rwlock_wrlock(inst->rwl_config_lock);
if (( phase != CB_CONFIG_PHASE_INITIALIZATION ) &&
( phase != CB... | false | false | false | false | false | 0 |
GetGeneralOptions20( string & prefix,
string & language,
xmlNode * node )
{
xmlChar * value, * prop;
string tmp;
xmlNode * nodeValue;
size_t i;
// The prefix to be used by the error code for files not using a namespace.
// To avoid clashes with ot... | false | false | false | false | false | 0 |
GetPredicateLockStatusData(void)
{
PredicateLockData *data;
int i;
int els,
el;
HASH_SEQ_STATUS seqstat;
PREDICATELOCK *predlock;
data = (PredicateLockData *) palloc(sizeof(PredicateLockData));
/*
* To ensure consistency, take simultaneous locks on all partition locks
* in ascending order, then Ser... | false | false | false | false | false | 0 |
chirp_matrix_open(const char *host, const char *path, time_t stoptime)
{
int result, i;
char *line;
char *tmp;
struct chirp_matrix *matrix;
matrix = xxmalloc(sizeof(*matrix));
result = chirp_reli_getfile_buffer(host, path, &line, stoptime);
if(result < 0) {
debug(D_CHIRP, "matrix: could not create metadata ... | false | true | false | false | false | 1 |
computeIntersectsForChain(int start0, int end0,
const MonotoneChainEdge &mce, int start1, int end1,
SegmentIntersector &ei)
{
// terminating condition for the recursion
if (end0-start0==1 && end1-start1==1) {
ei.addIntersections(e, start0, mce.e, start1);
return;
}
const Coordinate& p00=pts->getAt(start0);
... | false | false | false | false | false | 0 |
jme_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct net_device *netdev = pci_get_drvdata(pdev);
struct jme_adapter *jme = netdev_priv(netdev);
if (!netif_running(netdev))
return 0;
atomic_dec(&jme->link_changing);
netif_device_detach(netdev);
netif_stop_queue(netdev);
jme_stop_... | false | false | false | false | false | 0 |
get_vaddr_frames(unsigned long start, unsigned int nr_frames,
bool write, bool force, struct frame_vector *vec)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
int ret = 0;
int err;
int locked;
if (nr_frames == 0)
return 0;
if (WARN_ON_ONCE(nr_frames > vec->nr_allocated))
nr_frames... | false | false | false | false | false | 0 |
sisusbcon_scroll_area(struct vc_data *c, struct sisusb_usb_data *sisusb,
int t, int b, int dir, int lines)
{
int cols = sisusb->sisusb_num_columns;
int length = ((b - t) * cols) * 2;
u16 eattr = c->vc_video_erase_char;
ssize_t written;
/* sisusb->lock is down */
/* Scroll an area which does not match the
... | false | false | false | false | false | 0 |
get_save_doc_type(void) const
{
if (orig_doc_type==SINGLE_PAGE)
if (djvm_dir->get_files_num()==1)
return SINGLE_PAGE;
else
return BUNDLED;
else if (orig_doc_type==INDIRECT)
return INDIRECT;
else if (orig_doc_type==OLD_BUNDLED || orig_doc_type==BUNDLED)
return BUNDLED;
e... | false | false | false | false | false | 0 |
write_netid_register (const char *transp)
{
list *l;
definition *def;
version_list *vp;
const char *sp;
char tmpbuf[32];
sp = "";
f_print (fout, "\n");
f_print (fout, "%s\tnconf = getnetconfigent (\"%s\");\n", sp, transp);
f_print (fout, "%s\tif (nconf == NULL) {\n", sp);
(void) sprintf (_errbuf, "... | false | false | false | false | false | 0 |
imapx_job_expunge_start (CamelIMAPXJob *job,
CamelIMAPXServer *is,
GCancellable *cancellable,
GError **error)
{
CamelIMAPXCommand *ic;
CamelFolder *folder;
gboolean success;
folder = camel_imapx_job_ref_folder (job);
g_return_val_if_fail (... | false | false | false | false | false | 0 |
getInstrCost(unsigned Opcode, Type *T1, Type *T2,
TargetTransformInfo::OperandValueKind Op1VK =
TargetTransformInfo::OK_AnyValue,
TargetTransformInfo::OperandValueKind Op2VK =
TargetTransformInfo::OK_AnyValu... | false | false | false | false | false | 0 |
get_bits (bitfile_t *bitfile, unsigned bits)
/*
* Get #'bits' bits from the given stream 'bitfile'.
*
* Return value:
* composed integer value
*
* Side effects:
* Buffer of 'bitfile' is modified.
*/
{
unsigned value = 0; /* input value */
while (bits--)
value = (unsigned) (value << 1) | get... | false | false | false | false | false | 0 |
CDB___lock_ohash(dbt)
const DBT *dbt;
{
if (dbt->size == sizeof(DB_LOCK_ILOCK))
FAST_HASH(dbt->data);
return (CDB___ham_func5(dbt->data, dbt->size));
} | false | false | false | false | false | 0 |
gupnp_didl_lite_container_set_total_deleted_child_count
(GUPnPDIDLLiteContainer *container,
guint count)
{
xmlNode *xml_node;
xmlNsPtr upnp_ns;
GUPnPXMLDoc *xml_doc;
char *str;
GUPn... | false | false | false | false | false | 0 |
depmod_symbol_add(struct depmod *depmod, const char *name,
uint64_t crc, const struct mod *owner)
{
size_t namelen;
int err;
struct symbol *sym;
if (name[0] == depmod->cfg->sym_prefix)
name++;
namelen = strlen(name) + 1;
sym = malloc(sizeof(struct symbol) + namelen);
if (sym == NULL)
return -ENOMEM;
... | false | true | true | false | false | 1 |
_pvs_single(struct cmd_context *cmd, struct volume_group *vg,
struct physical_volume *pv, void *handle)
{
struct pv_list *pvl;
int ret = ECMD_PROCESSED;
const char *vg_name = NULL;
struct volume_group *old_vg = vg;
char uuid[64] __attribute__((aligned(8)));
if (is_pv(pv) && !is_orphan(pv) && !vg) {
vg... | true | true | false | false | false | 1 |
sql_init (void)
{
sql_conn = mysql_init (NULL);
if (sql_conn == NULL) {
debug (LOG_ERR, "ERROR: out-of-memory.\n");
return -1;
}
if (mysql_real_connect (sql_conn, host, user, passwd, name, 0, NULL, 0)
== NULL) {
debug (LOG_ERR, "ERROR: faild to connect to database, error: "
"%s\n", mysql_error (sql_co... | false | false | false | false | false | 0 |
determineCalleeSaves(MachineFunction &MF,
BitVector &SavedRegs,
RegScavenger *RS) const {
TargetFrameLowering::determineCalleeSaves(MF, SavedRegs, RS);
XCoreFunctionInfo *XFI = MF.getInfo<XCoreFunctionInfo>();
const Mach... | false | false | false | false | false | 0 |
_hx509_request_to_pkcs10(hx509_context context,
const hx509_request req,
const hx509_private_key signer,
heim_octet_string *request)
{
CertificationRequest r;
heim_octet_string data, os;
int ret;
size_t size;
if (req->name == NULL) {
hx509_set_error_string(context, 0, EINVAL,
... | 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.