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 |
|---|---|---|---|---|---|---|
glade_project_read_comments (GladeProject *project, GladeXmlNode *root)
{
GladeProjectPrivate *priv = project->priv;
GladeXmlNode *node;
/* We only support comments before the root element */
for (node = glade_xml_node_prev_with_comments (root); node;
node = glade_xml_node_prev_with_comments (node))
... | false | false | false | false | false | 0 |
convert_iter_to_child_iter (PeasGtkPluginManagerView *view,
GtkTreeIter *iter)
{
if (!view->priv->show_builtin)
{
GtkTreeModel *model;
GtkTreeIter child_iter;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
gtk_tree_model_filter_convert_it... | false | false | false | false | false | 0 |
change_state_cb(GtkWidget *widget, gpointer user_data)
{
HybridAccount *account;
HybridModule *module;
HybridIMOps *im_ops;
HybridAccountMenuData *data;
data = (HybridAccountMenuData*)user_data;
account = data->account;
module = account->proto;
im_ops = modul... | false | false | false | false | false | 0 |
ur_string_map_get(ur_string_map* map, const ur_string_map_key_type key, ur_string_map_value_type *value) {
if(!ur_string_map_valid(map)) return 0;
else {
string_list_header* slh = get_string_list_header(map, key);
string_elem *elem = string_list_get(slh->list, key);
if(elem) {
if(value) *value=... | false | false | false | false | false | 0 |
doselect(Object o, Object whichone, int whattype, int fexcept)
{
char *cp;
int i;
/* whichone default: return first group member or first member of list
*/
if (!whichone) {
switch (whattype) {
case IS_SERIES:
if (fexcept)
return omitnumberedseries((Series)o, NULL);
else
return s... | false | false | false | false | false | 0 |
dump_llist(struct llist *list, void (*dump_func)(void *))
{
struct list_elem *el;
printf ("Dump of list at %p (length %d):\n", list, list->count);
for (el = list->head; NULL != el; el = el->next)
dump_func(el->data);
} | false | false | false | false | false | 0 |
left(void)
{
if (editorActivate()==MSTrue)
{
if (selectedColumn()>0)
{
clearSelection();
if (selectionMode()==MSMultiple)
{
lastBlock(selectedRow());
_selectionVector.append(selectedRow());
}
selectedColumn(selectedColumn()-1);
}
}
} | false | false | false | false | false | 0 |
soup_request_file_get_content_type (SoupRequest *request)
{
SoupRequestFile *file = SOUP_REQUEST_FILE (request);
if (!file->priv->mime_type)
return "application/octet-stream";
return file->priv->mime_type;
} | false | false | false | false | false | 0 |
stb0899_dvbs2_get_dmd_status(struct stb0899_state *state, int timeout)
{
int time = -10, lock = 0, uwp, csm;
u32 reg;
do {
reg = STB0899_READ_S2REG(STB0899_S2DEMOD, DMD_STATUS);
dprintk(state->verbose, FE_DEBUG, 1, "DMD_STATUS=[0x%02x]", reg);
if (STB0899_GETFIELD(IF_AGC_LOCK, reg))
dprintk(state->verbose,... | false | false | false | false | false | 0 |
qualifyCompoundTag (const statementInfo *const st,
const tokenInfo *const nameToken)
{
if (isType (nameToken, TOKEN_NAME))
{
const tagType type = declToTagType (st->declaration);
const boolean fileScoped = (boolean)
(!(isLanguage (Lang_java) ||
isLanguage (Lang_csharp) ||
isLanguage (Lan... | false | false | false | false | false | 0 |
isPad (asCell)
char *asCell;
{
char *i, *ext;
ext = NULL;
for(i = asCell; *i != (char)0; i++)
if (*i == '_') ext = i;
if (ext == NULL) return (FALSE);
if (strcmp (ext, "_sp")) return (FALSE);
return (TRUE);
} | false | false | false | false | false | 0 |
libsmtp_int_send_quoted_header (const char *header, char *libsmtp_int_data, unsigned int libsmtp_int_length,
struct libsmtp_session_struct *libsmtp_session)
{
/* These are the input buffer and the output buffer */
char libsmtp_int_ogroup[2056], libsmtp_int_obuffer[4];
unsigned char libsmtp_int_char;
//... | true | true | false | false | false | 1 |
GetAllChildren( ConstChildrenListType& output ) const
{
for ( IdentifierType i = 0; i < static_cast<IdentifierType>(this->GetNumberOfChildren()); i++ )
{
const DOMNode* node = this->GetChild( i );
output.push_back( node );
}
} | false | false | false | false | false | 0 |
prepareForJobSubmissions(fxStr& emsg)
{
if (senderName == "" && !setupSenderIdentity(from, emsg))
return (false);
/*
* Prepare documents for transmission.
*/
if (typeRules == NULL) {
typeRules = TypeRules::read(typeRulesFile);
if (!typeRules) {
emsg = NLS::TEXT("Unable to setup file typing... | false | false | false | false | false | 0 |
update_cbp_model(jxr_image_t image, int c1, int norig)
{
const int ndiff = 3;
struct cbp_model_s*hp_cbp_model = & (image->hp_cbp_model);
hp_cbp_model->count0[c1] += norig - ndiff;
SAT(hp_cbp_model->count0[c1]);
hp_cbp_model->count1[c1] += 16 - norig - ndiff;
SAT(hp_cbp_model->count1[c1]);
... | false | false | false | false | false | 0 |
subroutine_add_call_site(struct subroutine *sub,
const unsigned char *code,
unsigned long call_site)
{
unsigned long *new_tab;
int new_size;
new_size = (sub->nr_call_sites + 1) * sizeof(unsigned long);
new_tab = realloc(sub->call_sites, new_size);
if (!new_tab)
return warn("out of memory"), -ENO... | false | false | false | false | false | 0 |
sge_setup_qmaster(sge_gdi_ctx_class_t *ctx, char* anArgv[])
{
char err_str[1024];
const char *qualified_hostname = ctx->get_qualified_hostname(ctx);
const char *act_qmaster_file = ctx->get_act_qmaster_file(ctx);
DENTER(TOP_LAYER, "sge_setup_qmaster");
umask(022); /* this needs a better solution */
... | true | true | false | false | true | 1 |
panel_real_focus_out (IBusPanelService* base, const gchar* input_context_path) {
Panel * self;
gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
gchar* _tmp2_ = NULL;
self = (Panel*) base;
g_return_if_fail (input_context_path != NULL);
_tmp0_ = self->priv->m_use_global_engine;
if (_tmp0_) {
return;
}
_tmp1_... | false | false | false | false | false | 0 |
getDbgValue(MDNode *MDPtr, const Value *C, uint64_t Off,
DebugLoc DL, unsigned O) {
return new (Allocator) SDDbgValue(MDPtr, C, Off, DL, O);
} | false | false | false | false | false | 0 |
format_cpu_data(CpuMon *cpu, gchar *src_string, gchar *buf, gint size)
{
GkrellmChart *cp;
gchar c, *s;
gint len, sys, user, nice = 0, total, t;
if (!buf || size < 1)
return;
--size;
*buf = '\0';
if (!src_string)
return;
cp = cpu->chart;
sys = gkrellm_get_current_chartdata(cpu->sys_cd);
user = gkrel... | false | false | false | false | false | 0 |
knot_tsig_create_key(const char *name, int algorithm,
const char *b64secret, knot_tsig_key_t *key)
{
if (!name || !b64secret || !key) {
return KNOT_EINVAL;
}
knot_dname_t *dname;
dname = knot_dname_from_str(name);
if (!dname) {
return KNOT_ENOMEM;
}
knot_binary_t secret;
int resul... | false | false | false | false | false | 0 |
thrmgr_setactivetask(const char *filename, const char* cmd)
{
struct task_desc *desc;
pthread_once(&stats_tls_key_once, stats_tls_key_alloc);
desc = pthread_getspecific(stats_tls_key);
if(!desc)
return;
desc->filename = filename;
if(cmd) {
if(cmd == IDLE_TASK && desc->command == cmd)
return;
desc->comman... | false | false | false | false | false | 0 |
parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
int *lineno, int *offset, const char **text)
{
long hold;
PyObject *v;
_Py_IDENTIFIER(msg);
_Py_IDENTIFIER(filename);
_Py_IDENTIFIER(lineno);
_Py_IDENTIFIER(offset);
_Py_IDENTIFIER(text);
*me... | false | false | false | false | false | 0 |
Scm_MakeBignumFromDouble(double val)
{
int exponent, sign;
ScmObj mantissa, b;
if (val >= LONG_MIN && val <= LONG_MAX) {
return Scm_MakeBignumFromSI((long)val);
}
mantissa = Scm_DecodeFlonum(val, &exponent, &sign);
if (!SCM_NUMBERP(mantissa)) {
Scm_Error("can't convert %lf to a... | false | false | false | false | false | 0 |
appParamsUnsigned32_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx,
u_long * appParamsUnsigned32_val_ptr)
{
/** we should have a non-NULL pointer */
netsnmp_assert(NULL != appParamsUnsigned32_val_ptr);
DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsUnsigned32_get",
... | false | false | false | true | false | 1 |
pthread_stop_world()
{
#ifndef NACL
int i;
int n_live_threads;
int code;
#if DEBUG_THREADS
GC_printf1("Stopping the world from 0x%lx\n", pthread_self());
#endif
n_live_threads = GC_suspend_all();
if (GC_retry_signals) {
unsigned long wait_usecs = 0; /* Total wait since retry. */... | false | true | false | false | true | 1 |
free_sched_data(void *data)
{
struct sched_data *sched_data = (struct sched_data *) data;
if (sched_data) {
if (sched_data->itip) icalcomponent_free(sched_data->itip);
if (sched_data->force_send) free(sched_data->force_send);
free(sched_data);
}
} | false | false | false | false | false | 0 |
Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen) {
int i, j, k;
u32 data, datal, datar;
for (i = 0; i < 4; i++) {
for (j = 0; j < 256; j++)
ctx->S[i][j] = ORIG_S[i][j];
}
j = 0;
for (i = 0; i < N + 2; ++i) {
data = 0x00000000;
for (k = 0; k < 4; ++k) {
data = (data ... | false | false | false | false | false | 0 |
setObjectAt(int x, int y, Object &o)
{
if (x < 0 || x >= m_width || y < 0 || y >= m_height) {
kDebug() << "Inexistent place accessed: (" << x << ", " << y << ")";
return;
}
m_playfield[x * m_height + y] = o;
o.setCoordinates(x, y);
} | false | false | false | false | false | 0 |
flps_pieslice( int fill,
int x,
int y,
int w,
int h,
int t1,
int t2,
FL_COLOR col )
{
float sx = 1.0,
sy = ( float ) h / w;
flps_color( col );
flps_output( "... | false | false | false | false | false | 0 |
__place_get_placement_flags(
pl_flags_t *ret_flags, FvwmWindow *fw, window_style *pstyle,
initial_window_options_t *win_opts, int mode, pl_reason_t *reason)
{
Bool override_ppos;
Bool override_uspos;
Bool has_ppos = False;
Bool has_uspos = False;
/* Windows use the position hint if these conditions are met:
*... | false | false | false | false | false | 0 |
DrucChercheWindow ( TmpRectangleSource
)
rdsrec_list *TmpRectangleSource;
{
static rdsrecwin_list StaticWindowSource2;
if ( IsRdsOneWindow( TmpRectangleSource ) )
{
StaticWindowSource2.WINDOW = (rdswin_list *)TmpRectangleSource->USER;
StaticWindowSource... | false | false | false | false | false | 0 |
storeCompressedFrame(DcmOffsetList &offsetList,
Uint8 *compressedData,
Uint32 compressedLen,
Uint32 fragmentSize)
{
if (compressedData == NULL)
return EC_I... | false | false | false | false | false | 0 |
ExtractAnds(
void *theEnv,
struct lhsParseNode *andField,
int testInPatternNetwork,
struct expr **patternNetTest,
struct expr **joinNetTest)
{
struct expr *newPNTest, *newJNTest;
/*=================================================*/
/* Before starting, the subfield has no pattern or */
/* join ... | false | false | false | false | false | 0 |
tillToken (vString * const UNUSED (ident), objcToken what)
{
if (what == waitedToken)
toDoNext = comeAfter;
} | false | false | false | false | false | 0 |
statusbar_item_register(const char *name, const char *value,
STATUSBAR_FUNC func)
{
gpointer hkey, hvalue;
statusbar_need_recreate_items = TRUE;
if (value != NULL) {
if (g_hash_table_lookup_extended(sbar_item_defs,
name, &hkey, &hvalue)) {
g_hash_table_remove(sbar_item_defs, name);
g_free(hke... | false | false | false | false | false | 0 |
atc_pcm_playback_position(struct ct_atc *atc, struct ct_atc_pcm *apcm)
{
struct src *src = apcm->src;
u32 size, max_cisz;
int position;
if (!src)
return 0;
position = src->ops->get_ca(src);
if (position < apcm->vm_block->addr) {
dev_dbg(atc->card->dev,
"bad ca - ca=0x%08x, vba=0x%08x, vbs=0x%08x\n",
p... | false | false | false | false | false | 0 |
get_block(size_t size)
{
#ifdef HAVE_MMAP
void *ptr = NULL;
#ifndef MAP_ANON
ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, dpfd.fd, 0);
#else
ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
#endif
return ptr == MAP_FAILED ? NULL : ptr;
#else
return malloc(size);
#... | false | false | false | false | false | 0 |
instituteDestroyP ( void * instituteptr )
{
int id;
institute_t * i1 = ( institute_t * ) instituteptr;
xassert ( i1 );
id = i1->self;
if ( instituteptr ) free ( instituteptr );
reshRemove ( id, &instituteOps );
} | false | false | false | false | false | 0 |
fastaannotatecdna(gchar *cdna_path, gchar *protein_path){
register FastaDB *cdna_fdb, *protein_fdb;
register FastaDB_Seq *cdna = NULL, *protein = NULL;
register gint ret_val = 0, total;
register FastaDB_Mask mask = FastaDB_Mask_ID|FastaDB_Mask_SEQ;
register Sequence *rc_seq;
register gchar *prot... | false | false | false | false | false | 0 |
hostiles_close_one(hostiles_t which)
{
uint i = which;
g_assert(i < NUM_HOSTILES);
iprange_free(&hostile_db[i]);
} | false | false | false | false | false | 0 |
tree_child(struct tree *tree, const char *label) {
if (tree == NULL)
return NULL;
list_for_each(child, tree->children) {
if (streqv(label, child->label))
return child;
}
return NULL;
} | false | false | false | false | false | 0 |
debugInt(string debugString, int value) {
debugInt("DEBUG", debugString, value);
} | false | false | false | false | false | 0 |
SetColorTable( GDALColorTable *poCT )
{
if( !CheckForColorTable() )
return CE_Failure;
// no color tables on overviews.
if( poFile == NULL )
return CE_Failure;
try
{
/* -------------------------------------------------------------------- */
/* Are we trying to delete the col... | false | false | false | false | false | 0 |
searchc(cap, t_cmd)
cmdarg_T *cap;
int t_cmd;
{
int c = cap->nchar; /* char to search for */
int dir = cap->arg; /* TRUE for searching forward */
long count = cap->count1; /* repeat count */
static int lastc = NUL; /* last character searched for */
static int lastcdir; /* last direct... | false | false | false | false | false | 0 |
CopyAttribute(struct Attribute * attrib)
{
if(attrib)
return MkAttribute(__ecereFunction___ecereNameSpace__ecere__sys__CopyString(attrib->attr), CopyExpression(attrib->exp));
return (((void *)0));
} | false | false | false | false | false | 0 |
store_alist_res(LEX *lc, RES_ITEM *item, int index, int pass)
{
RES *res;
int count = item->default_value;
int i = 0;
alist *list;
if (pass == 2) {
if (count == 0) { /* always store in item->value */
i = 0;
if ((item->value)[i] == NULL) {
list = New(alis... | false | false | false | false | false | 0 |
_rtl_get_vht_highest_n_rate(struct ieee80211_hw *hw,
struct ieee80211_sta *sta)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_phy *rtlphy = &(rtlpriv->phy);
u8 hw_rate;
u16 tx_mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.tx_mcs_map);
if ((get_rf_type(rtlphy) == RF_2T2R) &&
(tx_mcs_map & 0x000... | false | false | false | false | false | 0 |
flush_meta() {
HASHHDR *whdrp;
int i, wsize;
this->MAGIC = HASHMAGIC;
this->VERSION = HASHVERSION;
this->H_CHARKEY = this->hash(CHARKEY, sizeof(CHARKEY));
FileHandle fp = this->fp;
whdrp = &this->hdr;
#ifdef OS_WIN
SetFilePointer(fp, 0, NULL, FILE_BEGIN);
DWORD bytesWrited;
if (!WriteFile(fp, whd... | false | false | false | false | false | 0 |
glusterd_get_slave (glusterd_volinfo_t *vol, const char *slaveurl, char **slavekey)
{
runner_t runner = {0,};
int n = 0;
int i = 0;
char **linearr = NULL;
glusterd_urltransform_init (&runner, "canonicalize");
dict_foreach (vol->gsync_slaves, _glusterd_urltransform_add_it... | false | false | false | false | false | 0 |
gth_string_list_join (GthStringList *list,
const char *separator)
{
GString *str;
GList *scan;
str = g_string_new ("");
for (scan = list->priv->list; scan; scan = scan->next) {
if (scan != list->priv->list)
g_string_append (str, separator);
g_string_append (str, (char *) scan->data);
}
retur... | false | false | false | false | false | 0 |
stkdmp (struct stck *stack) {
while (stack->pback) stack = stack->pback;
while (stack) {
if (stack->type==0) {
printf ("Operand: %s\n",stack->obj.strng);
}
else if (stack->type==1) {
printf ("Operator: %i \n",stack->obj.op);
}
else if (stack->type==2) printf ("Left paren '('\n");
... | false | false | false | false | false | 0 |
setupRigidBody(const btRigidBody::btRigidBodyConstructionInfo& constructionInfo)
{
m_internalType=CO_RIGID_BODY;
m_linearVelocity.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
m_angularVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
m_angularFactor.setValue(1,1,1);
m_linearFactor.setValue(1,1... | false | false | false | false | false | 0 |
activate()
{
if(cur_select_ == list_wb_.end()) return;
audio::play_wave (-1, 0);
//set_activate(false);
(*cur_select_)->set_activate(true);
on_activate_key();
} | false | false | false | false | false | 0 |
getTarget()
{
if (_withStack.empty()) {
return getObject(env.target());
}
return _withStack.back().object();
} | false | false | false | false | false | 0 |
ParseCloseTag(XMLTreeRoot *root,char *tag,
char *magick_unused(xml),ExceptionInfo *exception)
{
if ((root->node == (XMLTreeInfo *) NULL) ||
(root->node->tag == (char *) NULL) || (strcmp(tag,root->node->tag) != 0))
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionWarning,
"Pars... | false | false | false | false | false | 0 |
applyPattern(const UnicodeString& pattern,
UParseError& parseError,
UErrorCode& ec)
{
if(U_FAILURE(ec)) {
return;
}
// The pattern is broken up into segments. Each time a subformat
// is encountered, 4 segments are recorded. For exam... | false | false | false | false | false | 0 |
retrieve(QWeakPointer<StorageJob> wcaller, const QVariantMap ¶ms)
{
StorageJob *caller = wcaller.data();
if (!caller) {
return;
}
const QString clientName = caller->clientName();
initializeDb(caller);
QString valueGroup = params["group"].toString();
if (valueGroup.isEmpty()) {
... | false | false | false | false | false | 0 |
shadow_setup(char *name, gboolean do_switch)
{
const char *prompt = getenv("PS1");
const char *shell = getenv("SHELL");
char *new_prompt = get_shadow_prompt(name);
printf("Setting up shadow instance\n");
if (safe_str_eq(new_prompt, prompt)) {
/* nothing to do */
goto done;
} e... | false | false | false | false | true | 1 |
fr_command_zip_extract (FrCommand *comm,
const char *from_file,
GList *file_list,
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
gboolean junk_paths)
{
GList *scan;
fr_process_set_out_line_func (FR_COMMAND (comm)->process,
process_line__common,
com... | false | false | false | false | false | 0 |
activate_statue_trap(struct trap *trap, xchar x, xchar y, bool shatter)
{
struct monst *mtmp = NULL;
struct obj *otmp = sobj_at(STATUE, x, y);
int fail_reason;
/*
* Try to animate the first valid statue. Stop the loop when we
* actually create something or the failure cause is not because
... | false | false | false | false | false | 0 |
display_autoneg(struct writer * w, int advertised, int bithd, int bitfd, char *desc)
{
if (!((advertised & bithd) ||
(advertised & bitfd)))
return;
tag_start(w, "advertised", "Adv");
tag_attr(w, "type", "", desc);
if (bitfd != bithd) {
tag_attr(w, "hd", "HD", (advertised & bithd)?"yes":"no");
tag_attr(w, "... | false | false | false | false | false | 0 |
SetTextProperty(vtkTextProperty *p)
{
if ( this->TextProperty == p )
{
return;
}
if ( this->TextProperty )
{
this->TextProperty->UnRegister( this );
this->TextProperty = NULL;
}
this->TextProperty = p;
if (this->TextProperty)
{
this->TextProperty->Register(this);
this->Sc... | false | false | false | false | false | 0 |
Write (writer_t *wr, const void *data, Addr_t nbytes)
{
wr_buffer_t *bp = BufOf(wr);
if (wr->errFlg)
return;
ASSERT(bp->next+nbytes <= bp->top);
memcpy (bp->next, data, nbytes);
bp->next += nbytes;
} | false | true | false | false | false | 1 |
vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size,
enum dma_data_direction dma_dir, gfp_t gfp_flags)
{
struct vb2_dma_sg_conf *conf = alloc_ctx;
struct vb2_dma_sg_buf *buf;
struct sg_table *sgt;
int ret;
int num_pages;
DEFINE_DMA_ATTRS(attrs);
dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs);
if (WARN... | false | false | false | false | false | 0 |
firstLine(const QModelIndex &index) const
{
if (index.isValid())
return index.model()->data(index, Qt::DisplayRole).toString();
return QString();
} | false | false | false | false | false | 0 |
vartable_open (ggobid *gg)
{
GtkWidget *vbox, *hbox;
GSList *l;
GGobiData *d;
/*-- if used before we have data, bail out --*/
if (gg->d == NULL || g_slist_length (gg->d) == 0)
return;
/*-- if new datad's have been added, the user has to reopen the window --*/
if (gg... | false | false | false | false | false | 0 |
get_thread_status(int n, ThreadStat *status) {
THREAD t;
t = find_thread_by_number(n);
if (t == NULL)
return 0;
else {
status->number = t->number;
status->owner = t->vms->r->vm_uid;
status->sleeping = (t->queue == &sleep_q);
status->status = t->contextkind;
return 1;
}
} | false | false | false | false | false | 0 |
is_cjk_letter(UT_UCSChar c) const
{
if (!cjk_locale())
return 0;
return (c>0xff);
} | false | false | false | false | false | 0 |
fm_malloc(size_t req_size)
{
Fm_mem_src *src;
frame_errmsg = NULL;
if (top_frame == NULL)
src = NULL;
else
src = top_frame->src;
return(alloc_on_frame(top_frame, src, req_size));
} | false | false | false | false | false | 0 |
setkey_core (void *context, const unsigned char *key, unsigned int keylen, int with_phase2)
{
static int initialized;
static const char *selftest_failed;
RFC2268_context *ctx = context;
unsigned int i;
unsigned char *S, x;
int len;
int bits = keylen * 8;
if (!initialized)
{
initialized = 1;
... | false | false | false | false | false | 0 |
atp_reinit(struct work_struct *work)
{
struct atp *dev = container_of(work, struct atp, work);
int retval;
dprintk("appletouch: putting appletouch to sleep (reinit)\n");
atp_geyser_init(dev);
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
dev_err(&dev->intf->dev,
"atp_reinit: usb_submit_urb fai... | false | false | false | false | false | 0 |
sshv2_initialize_string_with_path (gftp_request * request, const char *path,
size_t *len, char **endpos)
{
char *ret, *tempstr;
size_t origlen;
origlen = *len;
if (*path == '/')
ret = sshv2_initialize_buffer_with_i18n_string (request, path, len);
else
{
tempst... | false | false | false | false | false | 0 |
fm_list_remove(FmList* list, gpointer data)
{
GList* l = ((GQueue*)list)->head;
for(;l; l=l->next)
{
if(l->data == data)
{
list->funcs->item_unref(data);
break;
}
}
if(l)
g_queue_delete_link((GQueue*)data, l);
} | false | false | false | false | false | 0 |
camel_nntp_stream_gets (CamelNNTPStream *is,
guchar **start,
guint *len,
GCancellable *cancellable,
GError **error)
{
gint max;
guchar *end;
g_return_val_if_fail (is != NULL, -1);
g_return_val_if_fail (start != NULL, -1... | false | false | false | false | false | 0 |
CreateLuminanceCIE1931LookupTable() {
uint16_t *result = new uint16_t [ 256 ];
for (int i = 0; i < 256; ++i)
result[i] = luminance_cie1931(i);
return result;
} | false | false | false | false | false | 0 |
jump_cond_zero(const char *label, int cond, int distance)
{
if (cond == COND_EQUAL)
{
fprintf(out, " jeq %s\n", label);
return 0;
}
else
if (cond == COND_NOT_EQUAL)
{
fprintf(out, " jne %s\n", label);
return 0;
}
return -1;
} | false | false | false | false | false | 0 |
gtkwidget_gtk_widget_style_get_property(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj widget_scm;
GtkWidget* widget;
ScmObj property_name_scm;
const gchar * property_name;
ScmObj SCM_SUBRARGS[2];
int SCM_i;
SCM_ENTER_SUBR("gtk-widget-style-get-property");
for (SCM_i=0; SCM_i<2; SCM_i++) {
SC... | false | false | false | false | false | 0 |
getElementText( NodeImpl* start, bool after )
{
QString ret; // nextSibling(), to go after e.g. </select>
for( NodeImpl* n = after ? start->nextSibling() : start->traversePreviousNode();
n != NULL;
n = after ? n->traverseNextNode() : n->traversePreviousNode()) {
if( n->isTe... | false | false | false | false | false | 0 |
addDisputedTriangles(GoGame *game, Sgf *sgf) {
int i;
for (i = 0; i < goBoard_area(game->board); ++i) {
if (game->flags[i] & GOGAMEFLAGS_DISPUTED)
sgf_addTriangle(sgf, goBoard_loc2Sgf(game->board, i));
}
} | false | false | false | false | false | 0 |
reserve(int want)
{
if (want < 0)
want = (_capacity > 0 ? _capacity * 2 : 4);
if (want <= _capacity)
return true;
void **new_l = new void*[want];
if (!new_l)
return false;
memcpy(new_l, _l, sizeof(void*) * _n);
delete[] _l;
_l = new_l;
_capacity = want;
return true;
} | false | false | false | false | false | 0 |
packet_id_net_print (const struct packet_id_net *pin, bool print_timestamp, struct gc_arena *gc)
{
struct buffer out = alloc_buf_gc (256, gc);
buf_printf (&out, "[ #" packet_id_format, (packet_id_print_type)pin->id);
if (print_timestamp && pin->time)
buf_printf (&out, " / time = (" packet_id_format ") %s",... | false | false | false | false | false | 0 |
skipblanks(ch,nextch)
int ch;
ifun0 nextch;
{
while(ch == ' ' || ch == '\t') {
ch = nextch();
}
return(ch);
} | false | false | false | false | false | 0 |
cfhsi_start_tx(struct cfhsi *cfhsi)
{
struct cfhsi_desc *desc = (struct cfhsi_desc *)cfhsi->tx_buf;
int len, res;
netdev_dbg(cfhsi->ndev, "%s.\n", __func__);
if (test_bit(CFHSI_SHUTDOWN, &cfhsi->bits))
return;
do {
/* Create HSI frame. */
len = cfhsi_tx_frm(desc, cfhsi);
if (!len) {
spin_lock_bh(&cfh... | false | false | false | false | false | 0 |
sci_remote_device_stopped_state_enter(struct sci_base_state_machine *sm)
{
struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
struct isci_host *ihost = idev->owning_port->owning_controller;
u32 prev_state;
/* If we are entering from the stopping state let the SCI User know that
* the stop ope... | false | false | false | false | false | 0 |
CDB_memp_fset(dbmfp, pgaddr, flags)
DB_MPOOLFILE *dbmfp;
void *pgaddr;
u_int32_t flags;
{
BH *bhp;
DB_ENV *dbenv;
DB_MPOOL *dbmp;
MCACHE *mc;
MPOOL *mp;
int ret;
dbmp = dbmfp->dbmp;
dbenv = dbmp->dbenv;
mp = dbmp->reginfo.primary;
PANIC_CHECK(dbenv);
/* Validate arguments. */
if (flags == 0)
return ... | false | false | false | false | false | 0 |
afs_fd_set_cloexec(int fd)
{
int flags;
flags = fcntl(fd, F_GETFD);
if (flags >= 0) {
flags |= FD_CLOEXEC;
if (fcntl(fd, F_SETFD, flags) >= 0)
return 0;
}
ECA_LOG_MSG(ECA_LOGGER::info, "unable to set FD_CLOEXEC: " +
std::string(strerror(errno)));
return -1;
} | false | false | false | false | false | 0 |
zzlDeleteRangeByRank(unsigned char *zl, unsigned int start, unsigned int end, unsigned long *deleted) {
unsigned int num = (end-start)+1;
if (deleted) *deleted = num;
zl = ziplistDeleteRange(zl,2*(start-1),2*num);
return zl;
} | false | false | false | false | false | 0 |
jas_strdup(const char *s)
{
int n;
char *p;
n = strlen(s) + 1;
if (!(p = jas_malloc(n * sizeof(char)))) {
return 0;
}
strcpy(p, s);
return p;
} | false | false | false | false | false | 0 |
gcr_certificate_renderer_get_property (GObject *obj, guint prop_id, GValue *value,
GParamSpec *pspec)
{
GcrCertificateRenderer *self = GCR_CERTIFICATE_RENDERER (obj);
switch (prop_id) {
case PROP_CERTIFICATE:
g_value_set_object (value, self->pv->opt_cert);
break;
case PROP_... | false | false | false | false | false | 0 |
FcCharSetPrint (const FcCharSet *c)
{
int i, j;
intptr_t *leaves = FcCharSetLeaves (c);
FcChar16 *numbers = FcCharSetNumbers (c);
#if 0
printf ("CharSet 0x%x\n", (intptr_t) c);
printf ("Leaves: +%d = 0x%x\n", c->leaves_offset, (intptr_t) leaves);
printf ("Numbers: +%d = 0x%x\n", c->numbers_of... | false | false | false | false | false | 0 |
UnlinkBinding(Binding **pblist, Binding *b, Binding *prev)
{
Binding *t;
if (!prev && b != *pblist)
{
for (t = *pblist; t && t != b; prev = t, t = t->NextBinding)
{
/* Find the previous binding in the list. */
}
if (t == NULL)
{
/* Binding not found */
return;
}
}
if (prev)
{
/* middle of... | false | false | false | false | false | 0 |
RegisterImageHelper(int type, wxBitmap& bmp)
{
if (! imgList) {
// assumes all images are the same size
imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), true);
imgTypeMap = new wxArrayInt;
}
int idx = imgList->Add(bmp);
// do we need to extend the mapping array?
w... | false | false | false | false | false | 0 |
findLastSelectableNode(NodeImpl *base)
{
NodeImpl *last = base;
// Look for last text/cdata node that has a renderer,
// or last childless replaced element
while ( last && !(last->renderer()
&& ((last->nodeType() == Node::TEXT_NODE || last->nodeType() == Node::CDATA_SECTION_NODE)
|| (last->renderer()->isRe... | false | false | false | false | false | 0 |
recompile_files (void)
{
file *f;
putenv (xstrdup ("COMPILER_PATH="));
putenv (xstrdup ("LIBRARY_PATH="));
while ((f = file_pop ()) != NULL)
{
char *line, *command;
FILE *stream = fopen (f->key, "r");
const char *const outname = frob_extension (f->key, ".rnw");
FILE *output = fopen... | false | false | false | false | false | 0 |
GetRange(
vtkInformation *info,
vtkQuadratureSchemeDefinition **dest,
int from,
int to,
int n)
{
vtkInformationQuadratureSchemeDefinitionVectorValue* base =
static_cast<vtkInformationQuadratureSchemeDefinitionVectorValue *>(this->GetAsObjectBase(info));
// Source vector ... | false | false | false | false | false | 0 |
processLocation(DILocation Loc) {
if (!Loc.Verify()) return;
DIDescriptor S(Loc.getScope());
if (S.isCompileUnit())
addCompileUnit(DICompileUnit(S));
else if (S.isSubprogram())
processSubprogram(DISubprogram(S));
else if (S.isLexicalBlock())
processLexicalBlock(DILexicalBlock(S));
else if (S.isL... | false | false | false | false | false | 0 |
bdrv_getlength(BlockDriverState *bs)
{
BlockDriver *drv = bs->drv;
if (!drv)
return -ENOMEDIUM;
if (!drv->bdrv_getlength) {
/* legacy mode */
return bs->total_sectors * SECTOR_SIZE;
}
return drv->bdrv_getlength(bs);
} | false | false | false | false | false | 0 |
pool_replace(void *old, void *new)
{
pool_cell_t *p;
if (NULL == new)
return NULL;
if (NULL == old)
return pool_add(new);
if (new == old)
return new;
p = memory_pool.head;
while (p)
{
if (p->value == old)
{
p->value = new;
if (p->prev)
p->prev->next = p->next;
... | false | false | false | false | false | 0 |
_gcry_log_printsxp (const char *text, gcry_sexp_t sexp)
{
int with_lf = 0;
if (text && *text)
{
if ((with_lf = !!strchr (text, '\n')))
log_debug ("%s", text);
else
log_debug ("%s: ", text);
}
if (sexp)
{
int any = 0;
int n_closing;
char *buf, *pend;
... | 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.