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 |
|---|---|---|---|---|---|---|
alps_report_semi_mt_data(struct psmouse *psmouse, int fingers)
{
struct alps_data *priv = psmouse->private;
struct input_dev *dev = psmouse->dev;
struct alps_fields *f = &priv->f;
/* Use st data when we don't have mt data */
if (fingers < 2) {
f->mt[0].x = f->st.x;
f->mt[0].y = f->st.y;
fingers = f->pressur... | false | false | false | false | false | 0 |
config_key() const
{
if(set()) {
string key(long_form());
if( key == "" )
key = short_form();
return key;
} else
return "";
} | false | false | false | false | false | 0 |
free_desktop_properties_base_init (FreeDesktopPropertiesIface * iface) {
static gboolean initialized = FALSE;
if (!initialized) {
initialized = TRUE;
g_signal_new ("properties_changed", TYPE_FREE_DESKTOP_PROPERTIES, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT, G_TYPE_NON... | false | false | false | false | false | 0 |
contains(const TPoint3D &point) const {
double dx=point.x-pBase.x;
double dy=point.y-pBase.y;
double dz=point.z-pBase.z;
if (abs(dx)<geometryEpsilon&&abs(dy)<geometryEpsilon&&abs(dz)<geometryEpsilon) return true;
// dx dy dz
//if -----------=-----------=-----------, point is inside the lin... | false | false | false | false | false | 0 |
gconf_value_steal_string (GConfValue *value)
{
char *string;
GConfRealValue *real;
g_return_val_if_fail (value != NULL, NULL);
g_return_val_if_fail (value->type == GCONF_VALUE_STRING, NULL);
real = REAL_VALUE (value);
string = real->d.string_data;
real->d.string_data = NULL;
return string;
} | false | false | false | false | false | 0 |
load_pam_auth_item(char *name, char **buf)
{
Vfs_directive *vd;
Vfs_handle *handle;
*buf = NULL;
if ((vd = vfs_lookup_item_type(ITEM_TYPE_LOCAL_PAM_AUTHENTICATE)) == NULL)
return(-1);
if (vfs_open(vd, &handle) == -1)
return(-1);
if (vfs_get(handle, name, (void *) buf, NULL) == -1) {
vfs_close... | false | false | false | false | false | 0 |
initialize_grammar()
{
nitems = 4;
maxitems = 300;
pitem = (bucket **) MALLOC(maxitems*sizeof(bucket *));
if (pitem == 0) no_space();
pitem[0] = 0;
pitem[1] = 0;
pitem[2] = 0;
pitem[3] = 0;
nmethods = 0;
nrules = 3;
maxrules = 100;
plhs = (bucket **) MALLOC(maxrules*sizeof(... | false | false | false | false | false | 0 |
dump_assoc(int idx)
{
assoc_t *a = assoc;
if (a == NULL) {
dprintf(idx, "%s\n", ASSOC_NOCHNAMES);
return;
}
dprintf(idx, " %s %s\n", ASSOC_CHAN, ASSOC_NAME);
for (; a && a->name[0]; a = a->next)
dprintf(idx, "%c%5d %s\n", (a->channel < GLOBAL_CHANS) ? ' ' : '*',
a->channel % GLOBAL_C... | false | false | false | false | false | 0 |
Cgetnameinfo(savp, salen, host, hostlen, serv, servlen, flags)
CONST void *savp;
size_t salen;
char *host;
size_t hostlen;
char *serv;
size_t servlen;
int flags;
{
struct addrinfo hints, *res;
char ho[NI_MAXHOST];
int gaierrno;
/* if the user is not interested in the hostname we don't do further checks... | false | false | false | false | false | 0 |
f_seek(File *f, long pos)
{
#ifdef FBUF
if (f->size > 0)
{
if (pos >= f->size) pos = f->size -1;
}
#endif
if (f->pos == pos) return;
f->pos = pos;
#ifdef FBUF
_f_read_pos(f, f->pos, 1);
#else
gzseek(f->fp, f->pos, SEEK_SET);
#endif
} | false | false | false | false | false | 0 |
clutter_model_insertv (ClutterModel *model,
guint row,
guint n_columns,
guint *columns,
GValue *values)
{
ClutterModelPrivate *priv;
ClutterModelIter *iter;
gint i;
gboolean resort = FALSE;
... | false | false | false | false | false | 0 |
type_line( head, fname, mal_line )
chain_list *head;
char *fname;
int mal_line;
{
char *type;
type = (char*) head->DATA;
if( strcasecmp( type, "H" ) == 0 ) return ( MAL_HEA );
if( strcasecmp( type, "S" ) == 0 ) return ( MAL_SIG );
if( strcasecmp( type, "I" ) == 0 ) return ( MAL_INS );
if( strca... | false | false | false | false | false | 0 |
run(Canvas * canvas, bool partialDraw)
{
if (!m_stats.animating)
outputPrep(canvas);
int reportAt = 250;
Shape dummy;
for (ASTbody::const_iterator cit = m_cfdg->mCFDGcontents.mBody.begin(),
endit = m_cfdg->mCFDGcontents.mBody.end(); cit != endit; ++cit)
{
const ASTrepl... | false | false | false | false | false | 0 |
wakeup_source_remove(struct wakeup_source *ws)
{
unsigned long flags;
if (WARN_ON(!ws))
return;
spin_lock_irqsave(&events_lock, flags);
list_del_rcu(&ws->entry);
spin_unlock_irqrestore(&events_lock, flags);
synchronize_srcu(&wakeup_srcu);
} | false | false | false | false | false | 0 |
cost_bitmap_or_node(BitmapOrPath *path, PlannerInfo *root)
{
Cost totalCost;
Selectivity selec;
ListCell *l;
/*
* We estimate OR selectivity on the assumption that the inputs are
* non-overlapping, since that's often the case in "x IN (list)" type
* situations. Of course, we clamp to 1.0 at the end.
*
... | false | false | false | false | false | 0 |
win_redr_status(wp)
WIN *wp;
{
int row;
int col;
char_u *p;
int len;
int fillchar;
if (wp->w_status_height) /* if there is a status line */
{
if (set_highlight('s') == OK) /* can highlight */
{
fillchar = ' ';
start_highlight();
}
else /* can't highlight, use '=' */
fillchar... | false | false | false | false | false | 0 |
spaces_left (void)
{
int i, j;
j = 0;
for (i = 0; i < hfieldsize * vfieldsize; i++) {
if (field[i].color == 0)
j++;
}
return j;
} | false | false | false | false | false | 0 |
free_hdb_entry(hdb_entry *data)
{
if((data)->principal) {
free_Principal((data)->principal);
free((data)->principal);
(data)->principal = NULL;
}
free_Keys(&(data)->keys);
free_Event(&(data)->created_by);
if((data)->modified_by) {
free_Event((data)->modified_by);
free((data)->modified_by);
(data)->modified_by = NULL;
}... | false | false | false | false | false | 0 |
embl_comment_key(line, key)
char *line;
char *key;
{
int indi, indj;
if(line==NULL) { key[0]='\0'; return(0); }
for(indi=indj=0;
line[indi]!=':'&&line[indi]!='\t'&&line[indi]!='\n'
&&line[indi]!='\0'&&line[indi]!='('; indi++, indj++)
key[indj] =... | false | false | false | false | false | 0 |
autosleep_store(struct kobject *kobj,
struct kobj_attribute *attr,
const char *buf, size_t n)
{
suspend_state_t state = decode_state(buf, n);
int error;
if (state == PM_SUSPEND_ON
&& strcmp(buf, "off") && strcmp(buf, "off\n"))
return -EINVAL;
error = pm_autosleep_set_state(state);
retu... | false | false | false | false | false | 0 |
str2bytes(char *str,unsigned char *buf, int *buflen)
{
int len = strlen(str);
int i;
unsigned char *ptr;
ptr = buf;
for (i=0; i < len; i++ ) {
if ( '0' <= str[i] && str[i] <= '9' ) {
*ptr = str[i]^0x30;
} else if ( 'a'<= s... | false | false | false | false | false | 0 |
globus_l_gram_job_manager_add_cache_info(
globus_gram_jobmanager_request_t * request)
{
char * out_file;
char * fname;
unsigned long timestamp;
FILE * file;
char * ... | false | false | false | false | true | 1 |
fs_nvram_clear(fs_nvram_t *fs, u_int offset, u_int len)
{
u_int i;
for (i = 0; i < len; i++) {
fs->write_byte(fs, offset + i, 0);
}
} | false | false | false | false | false | 0 |
isGroupable() const {
if (isResizable() && isMaximizable() && !winClient().isTransient())
return true;
return false;
} | false | false | false | false | false | 0 |
camel_folder_summary_set_next_uid (CamelFolderSummary *summary,
guint32 uid)
{
camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
summary->priv->nextuid = MAX (summary->priv->nextuid, uid);
camel_folder_summary_touch (summary);
camel_folder_summary_unlock (s... | false | false | false | false | false | 0 |
editorForeground(void)
{
if (fields().length()!=0)
{
return ((AplusSlotEntryField *)(MSWidget *)fields()(0))->editorForeground();
}
else
return server()->defaultForeground();
} | false | false | false | false | false | 0 |
buildin_mddelete(struct script_state *st)
{
struct map_session_data *sd = script_rid2sd(st);
int party_id = 0;
if(st->end>st->start+2)
party_id = conv_num(st,&(st->stack->stack_data[st->start+2]));
else if(sd)
party_id = sd->status.party_id;
if(party_id > 0) {
struct party *pt = party_search(party_id);
i... | false | false | false | false | false | 0 |
next_prime (uint32_t seed)
{
/* Make it definitely odd. */
seed |= 1;
while (!is_prime (seed))
seed += 2;
return seed;
} | false | false | false | false | false | 0 |
Update(uint32 diff)
{
m_updateTimer.Update(diff);
if (!m_updateTimer.Passed())
return;
for (uint8 i = 0; i < MAX_OPVP_ID; ++i)
if (m_scripts[i])
m_scripts[i]->Update(m_updateTimer.GetCurrent());
m_updateTimer.Reset();
} | false | false | false | false | false | 0 |
on_bfsok_clicked (GtkButton *button,
gpointer user_data)
{
gchar *filename;
tanstatpop();
filename=gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filselwin));
if (filselnr==FIGGC){
if (tanloadfigtab(filename)){
gchar *s... | false | false | false | false | false | 0 |
computeStyleChange(const Position &insertionPoint, CSSStyleDeclarationImpl *style)
{
assert(insertionPoint.notEmpty());
assert(style);
StyleChange styleChange;
QListIterator<CSSProperty*> it(*(style->values()));
while ( it.hasNext() ) {
CSSProperty *property = it.next();
#ifdef DEBUG_COMMA... | false | false | false | false | false | 0 |
_gnutls_epoch_set_compression (gnutls_session_t session,
int epoch_rel,
gnutls_compression_method_t comp_algo)
{
record_parameters_st *params;
int ret;
ret = _gnutls_epoch_get (session, epoch_rel, ¶ms);
if (ret < 0)
return gnutls_assert_val ... | false | false | false | false | false | 0 |
enableWrite(bool enable)
{
QMutexLocker locker(mutex());
d->enableWrite = enable;
QSocketNotifier *n = socketDevice()->writeNotifier();
if (n)
n->setEnabled(enable);
} | false | false | false | false | false | 0 |
data_src_load(xmlDocPtr doc, xmlNodePtr node, char * nodeID, data_src_t ** model) {
if (!xmlStrcmp(node->name, (const xmlChar *)nodeID)) {
int i;
xmlNodePtr cur;
*model = data_src_new();
for (cur = node->xmlChildrenNode; cur != NULL; cur = cur->next) {
for (i = 0; i < 3; i++) {
xml_load_int_array(d... | false | false | false | true | false | 1 |
Star(Frag a, bool nongreedy) {
int id = AllocInst(1);
if (id < 0)
return NoMatch();
inst_[id].InitAlt(0, 0);
PatchList::Patch(inst_, a.end, id);
if (nongreedy) {
inst_[id].out1_ = a.begin;
return Frag(id, PatchList::Mk(id << 1));
} else {
inst_[id].set_out(a.begin);
return Frag(id, Patch... | false | false | false | false | false | 0 |
error(char *x)
{
ERR_PRT((L"%s : %a", LD_NAME, x));
/* will eventually exit with error from gunzip() */
} | false | false | false | false | false | 0 |
ISOR_CanHandleURLInService(GF_InputService *plug, const char *url)
{
char szURL[2048], *sep;
ISOMReader *read = (ISOMReader *)plug->priv;
const char *this_url = gf_term_get_service_url(read->service);
if (!this_url || !url) return 0;
if (!strcmp(this_url, url)) return 1;
strcpy(szURL, this_url);
sep = strrchr(... | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Defer LOD Contruction: "
<< (this->DeferLODConstruction ? "On\n" : "Off\n");
os << indent << "Static : " << (this->Static ? "On\n" : "Off\n");
os << indent << "Collapse Dimension Ratio: " << this->Collaps... | false | false | false | false | false | 0 |
avdtp_set_state(struct avdtp *session,
avdtp_session_state_t new_state)
{
GSList *l;
struct audio_device *dev;
bdaddr_t src, dst;
avdtp_session_state_t old_state = session->state;
session->state = new_state;
avdtp_get_peers(session, &src, &dst);
dev = manager_get_device(&src, &dst, FALSE);
if (dev == NUL... | false | false | false | false | false | 0 |
of_iommu_get_ops(struct device_node *np)
{
struct of_iommu_node *node;
struct iommu_ops *ops = NULL;
spin_lock(&of_iommu_lock);
list_for_each_entry(node, &of_iommu_list, list)
if (node->np == np) {
ops = node->ops;
break;
}
spin_unlock(&of_iommu_lock);
return ops;
} | false | false | false | false | false | 0 |
gdl_dock_item_remove (GtkContainer *container,
GtkWidget *widget)
{
GdlDockItem *item;
gboolean was_visible;
g_return_if_fail (GDL_IS_DOCK_ITEM (container));
item = GDL_DOCK_ITEM (container);
if (item->priv && widget == item->priv->grip) {
gboolean grip_was_vis... | false | false | false | false | false | 0 |
gap_match_number(gint32 layer_idx, const char *pattern)
{
char l_digit_buff[128];
const char *l_ptr;
int l_idx;
gint32 l_num, l_range_start;
gboolean utf8_compliant;
utf8_compliant = g_utf8_validate(pattern, -1, NULL);
l_idx = 0;
l_num = -1; l_range_start = -1;
l_ptr =... | false | false | false | false | true | 1 |
handler_remove(HandlerBase *h)
{
QMutexLocker locker(g_event_mutex());
Q_ASSERT(g_event);
if(!g_event)
return;
int at = g_event->findHandlerItem(h);
Q_ASSERT(at != -1);
if(at == -1)
return;
QList<int> ids = g_event->handlers[at].ids;
g_event->handlers.removeAt(at);
// adjust handler positions within aske... | false | false | false | false | false | 0 |
edf_set_physical_maximum(int handle, int edfsignal, double phys_max)
{
if(handle<0)
{
return(-1);
}
if(handle>=EDFLIB_MAXFILES)
{
return(-1);
}
if(hdrlist[handle]==NULL)
{
return(-1);
}
if(!(hdrlist[handle]->writemode))
{
return(-1);
}
if(edfsignal<0)
{
return(-1);
... | false | false | false | false | false | 0 |
_mesa_BeginConditionalRender(GLuint queryId, GLenum mode)
{
struct gl_query_object *q = NULL;
GET_CURRENT_CONTEXT(ctx);
/* Section 2.14 (Conditional Rendering) of the OpenGL 3.0 spec says:
*
* "If BeginConditionalRender is called while conditional rendering is
* in progress, or if EndCondi... | false | false | false | false | false | 0 |
cmd_handler(cmd_parms* cmd, void* pcfg, int flag)
{
scgi_cfg *cfg = pcfg;
if (cmd->path == NULL) /* server command */
return "not a server command";
if (flag)
cfg->enabled = ENABLED;
else
cfg->enabled = DISABLED;
return NULL;
} | false | false | false | false | false | 0 |
IGDstartelt(void * d, const char * name, int l)
{
struct IGDdatas * datas = (struct IGDdatas *)d;
memcpy( datas->cureltname, name, l);
datas->cureltname[l] = '\0';
datas->level++;
if( (l==7) && !memcmp(name, "service", l) ) {
datas->tmp.controlurl[0] = '\0';
datas->tmp.eventsuburl[0] = '\0';
datas->tmp.scpdu... | false | true | false | false | false | 1 |
bna_bfi_rx_vlan_filter_set(struct bna_rxf *rxf, u8 block_idx)
{
struct bfi_enet_rx_vlan_req *req = &rxf->bfi_enet_cmd.vlan_req;
int i;
int j;
bfi_msgq_mhdr_set(req->mh, BFI_MC_ENET,
BFI_ENET_H2I_RX_VLAN_SET_REQ, 0, rxf->rx->rid);
req->mh.num_entries = htons(
bfi_msgq_num_cmd_entries(sizeof(struct bfi_enet_rx_... | false | false | false | false | false | 0 |
change_file_fingerprint_check(change::pointer cp, fstate_src_ty *src_data)
{
string_ty *path;
int same;
cstate_ty *cstate_data;
//
// Only useful in the 'being developed' and 'being integrated'
// states.
//
path = change_file_path(cp, src_data->file_name);
a... | false | false | false | false | false | 0 |
exception_type(int vector)
{
unsigned int mask;
if (WARN_ON(vector > 31 || vector == NMI_VECTOR))
return EXCPT_INTERRUPT;
mask = 1 << vector;
/* #DB is trap, as instruction watchpoints are handled elsewhere */
if (mask & ((1 << DB_VECTOR) | (1 << BP_VECTOR) | (1 << OF_VECTOR)))
return EXCPT_TRAP;
if (mask... | false | false | false | false | false | 0 |
is_builtin_qname(const char *QName)
{ if (iflag)
return 1;
if (QName)
{ if (*QName == '#') // reserved QNames
return 0;
if (*QName != '"')
return 1; // if the QName does not start with a ", it must be in the nsmap
const char *s = strchr(QName + 1, '"');
if (s)
{ size_t n = s - QName ... | false | false | false | false | false | 0 |
driver_get_keymap_entry( CoreInputDevice *device,
void *driver_data,
DFBInputDeviceKeymapEntry *entry )
{
#ifdef LINUX_INPUT_USE_FBDEV
LinuxInputData *data = (LinuxInputData*) driver_data;
int ... | false | false | false | false | false | 0 |
stringify_categories (GSList *categ_list)
{
GString *s;
GSList *l;
gchar *str;
s = g_string_new (NULL);
for (l = categ_list; l; l = l->next) {
g_string_append (s, l->data);
if (l->next != NULL)
g_string_append (s, ",");
}
str = s->str;
g_string_free (s, FALSE);
return str;
} | false | false | false | false | false | 0 |
cx25840_g_std(struct v4l2_subdev *sd, v4l2_std_id *std)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
v4l2_std_id stds[] = {
/* 0000 */ V4L2_STD_UNKNOWN,
/* 0001 */ V4L2_STD_NTSC_M,
/* 0010 */ V4L2_STD_NTSC_M_JP,
/* 0011 */ V4L2_STD_NTSC_443,
/* 0100 */ V4L2_STD_PAL,
/* 0101 */ V4L2_STD_PAL_M,
... | false | false | false | false | false | 0 |
dofindsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind)
{
/* since this function recurses, it could be driven to stack overflow. */
check_stack_depth();
root = findeq(root, ex, subs, isfind);
if (root && (root->flags & QTN_NOCHANGE) == 0 && root->valnode->type == QI_OPR)
{
int i;
for (i = 0; ... | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
try
{
int port = 8010;
if (argc > 1)
{
std::stringstream stream(argv[1]);
stream >> port;
if (port <= 0)
port = 8010;
std::cerr << "Port: " << port << '\n';
}
Sock soket(PF_I... | false | false | false | false | false | 0 |
go_date_conv_translate (double f,
const GODateConventions *src,
const GODateConventions *dst)
{
g_return_val_if_fail (src != NULL, f);
g_return_val_if_fail (dst != NULL, f);
if (!go_finite (f) || go_date_conv_equal (src, dst))
return f;
if (dst->use_1904) {
if (f < date_serial_19000228 + 1)
f += 1;
... | false | false | false | false | false | 0 |
win(int *a1, int *a2, int n)
{
int *wins = malloc(n*sizeof(int));
int i;
for (i = 0; i < n; ++i)
wins[i] = win_battle(a1[i], a2[i]);
return wins;
} | false | true | false | false | false | 1 |
files_are_all_directories (GList *files)
{
NautilusFile *file;
GList *l;
gboolean all_directories;
all_directories = TRUE;
for (l = files; l != NULL; l = l->next) {
file = NAUTILUS_FILE (l->data);
all_directories &= nautilus_file_is_directory (file);
}
return all_directories;
} | false | false | false | false | false | 0 |
Rivet_BuildConfDictionary ( Tcl_Interp* interp,
rivet_server_conf* rivet_conf)
{
apr_table_t* conf_tables[3];
Tcl_Obj* keyval_list = NULL;
Tcl_Obj* key_list[2];
int it;
Tcl_Obj* conf_dict = Tcl_NewObj();
static const char* s... | false | false | false | false | false | 0 |
main(int argc, char *argv[]) {
int num = FACT;
if (argc == 2) {
num = atoi(argv[1]);
}
//actual problem 16 code
big_int ans = bi_init("1");
big_int* inc = malloc(sizeof(big_int));
*inc = bi_init("1");
int i;
for(i = 1; i <= num; i++) {
bi_set_int(inc, i);
ans... | false | false | false | false | true | 1 |
sendExchangeArtefact( GenericLord * lord1, int item, GenericLord * lord2 )
{
if( lord1 && lord2) {
init( (uchar)SO_EXCH, (uchar)C_EXCH_ARTEFACT );
appendChar( (uchar)lord1->getId() );
appendInt( item );
appendChar( (uchar)lord2->getId() );
send();
}
} | false | false | false | false | false | 0 |
stv0900_set_mclk(struct stv0900_internal *intp, u32 mclk)
{
u32 m_div, clk_sel;
if (intp == NULL)
return STV0900_INVALID_HANDLE;
if (intp->errs)
return STV0900_I2C_ERROR;
dprintk("%s: Mclk set to %d, Quartz = %d\n", __func__, mclk,
intp->quartz);
clk_sel = ((stv0900_get_bits(intp, F0900_SELX1RATIO) == 1... | false | false | false | false | false | 0 |
asiliant_calc_dclk2(u32 *ppixclock, u8 *dclk2_m, u8 *dclk2_n, u8 *dclk2_div)
{
unsigned pixclock = *ppixclock;
unsigned Ftarget = 1000000 * (1000000 / pixclock);
unsigned n;
unsigned best_error = 0xffffffff;
unsigned best_m = 0xffffffff,
best_n = 0xffffffff;
unsigned ratio;
unsigned remainder;
unsigne... | false | false | false | false | false | 0 |
appendSpline(const std::vector<Vector> &v)
{
if (iSeg.empty())
iCP.push_back(v[0]);
assert(v[0] == iCP.back());
for (uint i = 1; i < v.size(); ++i)
iCP.push_back(v[i]);
Seg seg;
seg.iType = CurveSegment::ESpline;
seg.iLastCP = iCP.size() - 1;
seg.iMatrix = iM.size() - 1;
iSeg.push_back(seg);
} | false | false | false | false | false | 0 |
ensTranslationCalculateSliceEnd(EnsPTranslation translation)
{
EnsPFeature feature = NULL;
if (!translation)
return 0;
if (translation->SliceEnd)
return translation->SliceEnd;
feature = ensExonGetFeature(translation->Endexon);
if (ensFeatureGetStrand(feature) >= 0)
{
... | false | false | false | false | false | 0 |
hmac_alloc(auth_t **a, int key_len, int out_len) {
extern auth_type_t hmac;
uint8_t *pointer;
debug_print(mod_hmac, "allocating auth func with key length %d", key_len);
debug_print(mod_hmac, " tag length %d", out_len);
/*
* check key length - note that we don't support keys large... | false | false | false | false | false | 0 |
set_query(Set *set, SetValue data)
{
SetEntry *rover;
unsigned int index;
/* Look up the data by its hash key */
index = set->hash_func(data) % set->table_size;
/* Search this chain, until the corresponding entry is found */
rover = set->table[index];
while (rover != NULL) {
if (set->equal_func(data, rove... | false | false | false | false | false | 0 |
brcmf_pcie_isr_thread_v2(int irq, void *arg)
{
struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)arg;
u32 status;
devinfo->in_irq = true;
status = brcmf_pcie_read_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT);
brcmf_dbg(PCIE, "Enter %x\n", status);
if (status) {
brcmf_pcie_write_reg32(devinfo,... | false | false | false | false | false | 0 |
get_xml (GDataParsable *parsable, GString *xml_string)
{
GDataGDNamePrivate *priv = GDATA_GD_NAME (parsable)->priv;
#define OUTPUT_STRING_ELEMENT(E,F) \
if (priv->F != NULL) \
gdata_parser_string_append_escaped (xml_string, "<gd:" E ">", priv->F, "</gd:" E ">");
OUTPUT_STRING_ELEMENT ("givenName... | false | false | false | false | false | 0 |
read_handler(Element *e, void *thunk)
{
CheckUDPHeader *c = reinterpret_cast<CheckUDPHeader *>(e);
switch ((intptr_t)thunk) {
case 0: // drops
return String(c->_drops);
case 1: { // drop_details
StringAccum sa;
for (int i = 0; i < NREASONS; i++)
sa << c->_reason_drops[i] << '\t' << ... | false | false | false | false | false | 0 |
gwy_spectra_set_spectrum(GwySpectra *spectra,
guint i,
GwyDataLine *new_spectrum)
{
GwySpectrum *spec;
g_return_if_fail(GWY_IS_SPECTRA(spectra));
g_return_if_fail(GWY_IS_DATA_LINE(new_spectrum));
g_return_if_fail(i < spectra->spectra->len);
spec = ... | false | false | false | false | false | 0 |
genLoopkupTable()
{
int i;
int x, y;
for (i = 0; i < 256; i++) {
relClose(i, &x, &y);
close_table[i*2+0] = x;
close_table[i*2+1] = y;
relFar(i, 1, &x, &y);
far_p_table[i*2+0] = x;
far_p_table[i*2+1] = y;
relFar(i, -1, &x, &y);
far_n_table[i*2+0] = x;
far_n_table[i*2+1] = y;
}
lookup_initia... | false | false | false | false | false | 0 |
bemalbar() {
bool ret;
switch (art) {
case absort_feld:
case absort_fall:
ret = true; break;
case absort_semiglobal:
case absort_global:
case absort_nirgends:
ret = false; break;
default:
throw iFehler("%s",_("Data corruption."));
}
return ret;
} | false | false | false | false | false | 0 |
httpd_got_request( httpd_conn* hc )
{
char c;
for ( ; hc->checked_idx < hc->read_idx; ++hc->checked_idx )
{
c = hc->read_buf[hc->checked_idx];
switch ( hc->checked_state )
{
case CHST_FIRSTWORD:
switch ( c )
{
case ' ': case '\t':
hc->checked_state = CHST_FIRSTWS;
break;
case '\... | false | false | false | false | false | 0 |
lOverrideStrList(lList *lp0, lList *lp1, int nm, const char *str)
{
lListElem *ep;
const lDescr *dp0, *dp1;
bool overridden = false;
DENTER(CULL_LAYER, "lOverrideStrList");
if (!lp1 || !lp0) {
LERROR(LELISTNULL);
DRETURN(-1);
}
/* Check if the two lists are equal */
dp0 = lGetList... | false | false | false | false | false | 0 |
find(int ibucket, char *key, int keybytes, KeyValue *kv)
{
int ikey = buckets[ibucket];
if (ikey < 0) {
buckets[ibucket] = nunique;
maxdepth = MAX(maxdepth,1);
return -1;
}
int depth = 1;
while (ikey >= 0) {
int index = uniques[ikey].keyindex;
char *key2 = &kv->keydata[kv->keys[index]]... | false | false | false | false | false | 0 |
TCSP_GetAuditDigest_Internal(TCS_CONTEXT_HANDLE hContext, /* in */
UINT32 startOrdinal, /* in */
TPM_DIGEST *auditDigest, /* out */
UINT32 *counterValueSize, /* out */
BYTE **counterValue, /* out */
TSS_BOOL *more, /* out */
UINT32 *ordSize, /* out */
UINT... | false | false | false | false | false | 0 |
handleExec(poptContext con, char * longName, char shortName) {
int i;
i = con->numExecs - 1;
if (longName) {
while (i >= 0 && (!con->execs[i].longName ||
strcmp(con->execs[i].longName, longName))) i--;
} else {
while (i >= 0 &&
con->execs[i].shortName != shortName) i--;
}
if (i < 0... | false | false | false | false | false | 0 |
newAdapterObject(request_rec *r)
{
AdapterObject *self;
self = PyObject_New(AdapterObject, &Adapter_Type);
if (self == NULL)
return NULL;
self->result = HTTP_INTERNAL_SERVER_ERROR;
self->r = r;
self->bb = NULL;
self->config = (WSGIRequestConfig *)ap_get_module_config(r->request_... | false | false | false | false | false | 0 |
genExtractHalf(MachineInstr *MI,
BitTracker::RegisterRef RD, const BitTracker::RegisterCell &RC) {
RegHalf L;
// Check for halfword in low 16 bits, zeros elsewhere.
if (!matchHalf(RD.Reg, RC, 0, L) || !HBS::isZero(RC, 16, 16))
return false;
unsigned Opc = MI->getOpcode();
MachineBasicBlock &B = *MI... | false | false | false | false | false | 0 |
MultVectorImpl(Number alpha, const Vector &x,
Number beta, Vector &y) const
{
// A few sanity checks
DBG_ASSERT(NCols()==x.Dim());
DBG_ASSERT(NRows()==y.Dim());
// Take care of the y part of the addition
if ( beta!=0.0 ) {
y.Scal(beta);
}
el... | false | false | false | false | false | 0 |
efreet_desktop_string_list_join(Eina_List *list)
{
Eina_List *l;
const char *elem;
char *string;
size_t size, pos, len;
if (!list) return strdup("");
size = 1024;
string = malloc(size);
if (!string) return NULL;
pos = 0;
EINA_LIST_FOREACH(list, l, elem)
{
len = str... | false | false | false | false | false | 0 |
nfs4_legacy_state_init(struct net *net)
{
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
int i;
nn->reclaim_str_hashtbl = kmalloc(sizeof(struct list_head) *
CLIENT_HASH_SIZE, GFP_KERNEL);
if (!nn->reclaim_str_hashtbl)
return -ENOMEM;
for (i = 0; i < CLIENT_HASH_SIZE; i++)
INIT_LIST_HEAD(&nn->rec... | false | false | false | false | false | 0 |
set_default_email_from(conf_data_t * data)
{
struct passwd *pwd = NULL;
char *hostname = NULL;
int len = 0;
hostname = get_local_name();
if (!hostname || !hostname[0])
return;
pwd = getpwuid(getuid());
if (!pwd)
return;
len = strlen(hostname) + strlen(pwd->pw_name) + 2;
data->email_from = MALLOC(len);
... | false | false | false | false | false | 0 |
wl1271_init_templates_config(struct wl1271 *wl)
{
int ret, i;
size_t max_size;
/* send empty templates for fw memory reservation */
ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
wl->scan_templ_id_2_4, NULL,
WL1271_CMD_TEMPL_MAX_SIZE,
0, WL1271_RATE_AUTOMATIC);
if (ret < 0... | false | false | false | false | false | 0 |
resample_sinc_window (double x, double halfwidth, double scale)
{
double y;
if (x == 0)
return 1.0;
if (x < -halfwidth || x > halfwidth)
return 0.0;
y = sin (x * M_PI * scale) / (x * M_PI * scale) * scale;
x /= halfwidth;
y *= (1 - x * x) * (1 - x * x);
return y;
} | false | false | false | false | false | 0 |
getFieldVoid(
FlmField * pField)
{
FLMUINT uiSlot;
if( !pField)
{
return( NULL);
}
if( !m_uiFldTblOffset ||
pField > &(getFieldTable()[ m_uiFldTblOffset - 1]))
{
flmAssert( 0);
return( NULL);
}
uiSlot = (pField - getFieldTable()) + 1;
return( (void *)uiSlot);
} | false | false | false | false | false | 0 |
_DXSetSoftwareWindowActive(struct window *w, int active)
{
if (active)
{
if (! DXRegisterWindowHandlerWithCheckProc(w->handler, XChecker, w->dpy, (Pointer)w))
return ERROR;
w->active = 1;
}
else
{
if (w->cmap_installed)
{
XUninstallColormap(w->dpy, (Colormap)w->translation->cmap);
... | false | false | false | false | false | 0 |
Derivatives(int vtkNotUsed(subId),
double vtkNotUsed(pcoords)[3],
double *vtkNotUsed(values),
int dim, double *derivs)
{
int i, idx;
for (i=0; i<dim; i++)
{
idx = i*dim;
derivs[idx] = 0.0;
derivs[idx+... | false | false | false | false | false | 0 |
info_extract (struct EXTRACTOR_ExtractContext *ec,
uint32_t size)
{
void *data;
const struct infochunk *ichunk;
char songs[32];
if (size < 8)
return 0;
if (size >
ec->read (ec->cls,
&data,
size))
return 1;
ichunk = data;
if (0 != (ichunk->tvflags & DUAL_FLAG))
{
ADD (... | true | true | false | false | true | 1 |
F_math_load_value(ArgVal arg[])
{
Args2(X_Y(xy), INTEGER(a));
Inst_Printf("call_c", FAST "Math_Load_Value(%c(%ld),&X(%ld))", c, xy, a);
} | false | false | false | false | false | 0 |
DefaultInit(void)
{
AddAll();
UpdateData();
SetName("Random");
SetDelayFactor(DEFAULTDELAYFACTOR);
SetMinNote(36);
SetMaxNote(98);
srand( (unsigned)time( NULL ) );
} | false | false | false | false | false | 0 |
blkcg_drain_queue(struct request_queue *q)
{
lockdep_assert_held(q->queue_lock);
/*
* @q could be exiting and already have destroyed all blkgs as
* indicated by NULL root_blkg. If so, don't confuse policies.
*/
if (!q->root_blkg)
return;
blk_throtl_drain(q);
} | false | false | false | false | false | 0 |
authenticateBasicFixErrorHeader(auth_user_request_t * auth_user_request, HttpReply * rep, http_hdr_type type, request_t * request)
{
if (basicConfig->authenticate) {
debug(29, 9) ("authenticateFixErrorHeader: Sending type:%d header: 'Basic realm=\"%s\"'\n", type, basicConfig->basicAuthRealm);
httpHeaderPutStrf(&r... | false | false | false | false | false | 0 |
ght_create(unsigned int i_size)
{
ght_hash_table_t *p_ht;
int i=1;
if ( !(p_ht = (ght_hash_table_t*)malloc (sizeof(ght_hash_table_t))) )
{
perror("malloc");
return NULL;
}
/* Set the size of the hash table to the nearest 2^i higher then i_size */
p_ht->i_size = 1;
while(p_ht->i_size < ... | false | true | false | false | false | 1 |
has_timeout(Fl_Timeout_Handler cb, void *argp) {
for (Timeout* t = first_timeout; t; t = t->next)
if (t->cb == cb && t->arg == argp) return 1;
return 0;
} | false | false | false | false | false | 0 |
emitMSACBranchPseudo(MachineInstr *MI, MachineBasicBlock *BB,
unsigned BranchOp) const{
// $bb:
// vany_nonzero $rd, $ws
// =>
// $bb:
// bnz.b $ws, $tbb
// b $fbb
// $fbb:
// li $rd1, 0
// b $sink
// $tbb:
// li $rd2, 1
// $sink:
// $rd = phi($rd1, $fbb, $rd2, $tb... | false | false | false | false | false | 0 |
urlForbidden(AtomPtr url,
int (*handler)(int, AtomPtr, AtomPtr, AtomPtr, void*),
void *closure)
{
int forbidden = urlIsMatched(url->string, url->length,
forbiddenDomains, forbiddenRegex);
int code = 0;
AtomPtr message = NULL, headers = NULL;
i... | false | false | false | false | false | 0 |
xaccSplitGetCapGains(Split * split)
{
if (!split) return gnc_numeric_zero();
ENTER("(split=%p)", split);
if (GAINS_STATUS_UNKNOWN == split->gains)
xaccSplitDetermineGainStatus(split);
if ((split->gains & GAINS_STATUS_A_VDIRTY) ||
(split->gains_split &&
(split->gains_spl... | 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.