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 |
|---|---|---|---|---|---|---|
fstWriterEmitSectionHeader(void *ctx)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc)
{
unsigned long destlen;
unsigned char *dmem;
int rc;
destlen = xc->maxvalpos;
dmem = malloc(destlen);
rc = compress2(dmem, &destlen, xc->curval_mem, xc->maxvalpos, 9);
fputc(FST_BL_SKIP... | false | false | false | false | false | 0 |
ap_linexpr0_permute_dimensions_with(ap_linexpr0_t* expr,
ap_dimperm_t* perm)
{
if (expr==NULL) return;
switch(expr->discr){
case AP_LINEXPR_SPARSE:
{
size_t i;
for (i=0; i<expr->size; i++){
ap_dim_t dim = expr->p.linterm[i].dim;
if (dim==AP_DIM_MAX) continue;
expr->p.linterm[i].dim = pe... | false | false | false | false | false | 0 |
lash_config_dup(const lash_config_t * src_ptr)
{
lash_config_t * dst_ptr;
dst_ptr = lash_config_new();
if (dst_ptr == NULL)
{
return NULL;
}
ASSERT(src_ptr->key != NULL);
dst_ptr->key = strdup(src_ptr->key);
if (dst_ptr->key == NULL)
{
log_error("strdup() failed for config key '%s'", src_ptr->... | false | false | false | false | false | 0 |
setupVoices() { /* setup specified number of voices */
int i;
actVoices = 0; /* no voices are playing */
voices = realloc(voices, sizeof(voice) * voiceCount); /* allocate memory for voices */
for (i = 0; i < voiceCount; i++) {
setupVoice(voices + i);
}
} | false | false | false | false | false | 0 |
lgs8gxx_attach(const struct lgs8gxx_config *config,
struct i2c_adapter *i2c)
{
struct lgs8gxx_state *priv = NULL;
u8 data = 0;
dprintk("%s()\n", __func__);
if (config == NULL || i2c == NULL)
return NULL;
priv = kzalloc(sizeof(struct lgs8gxx_state), GFP_KERNEL);
if (priv == NULL)
goto error_out;
priv->co... | false | false | false | false | false | 0 |
system_init_flash(uint32_t ul_clk)
{
/* Set FWS for embedded Flash access according to operating frequency */
if (ul_clk < CHIP_FREQ_FWS_0) {
EFC0->EEFC_FMR = EEFC_FMR_FWS(0);
EFC1->EEFC_FMR = EEFC_FMR_FWS(0);
} else if (ul_clk < CHIP_FREQ_FWS_1) {
EFC0->EEFC_FMR = EEFC_FMR_FWS(1);
EFC1->EEFC_FMR = EEFC_FMR_... | false | false | false | false | false | 0 |
hasIndex(int row, int column, const QModelIndex &parent) const
{
if (parent.isValid()) return false;
if (column<0 || column>=columnCount()) return false;
if (row<0 || row>=rowCount(parent)) return false;
return true;
} | false | false | false | false | false | 0 |
setBlockDirection(qint32 value)
{
m_state.block_format.setLayoutDirection(Qt::LayoutDirection(value));
Qt::Alignment alignment = m_state.block_format.alignment();
if (alignment & Qt::AlignLeft) {
alignment |= Qt::AlignAbsolute;
m_state.block_format.setAlignment(alignment);
}
m_cursor.mergeBlockFormat(m_state.b... | false | false | false | false | false | 0 |
copyUrlsToCollection( const QMap<Meta::TrackPtr, KUrl> &sources,
const Transcoding::Configuration &configuration )
{
DEBUG_BLOCK
Q_UNUSED( configuration )
connect( m_handler, SIGNAL(copyTracksDone(bool)),
this, SLOT(copyOperationFinishe... | false | false | false | false | false | 0 |
publish_one(const char* publish_spec,
const char* ep,
CORBA::Boolean no_publish,
orbServer::EndpointList& published_eps)
{
OMNIORB_ASSERT(!strncmp(ep, "giop:unix:", 10));
CORBA::String_var to_add;
if (!strncmp(publish_spec, "giop:unix:", 10)) {
const char* file = publi... | false | false | false | false | false | 0 |
outflow_read (GtsObject ** o, GtsFile * fp)
{
GfsBoundary * b = GFS_BOUNDARY (*o);
GfsDomain * domain;
GfsVariable ** v;
if (GTS_OBJECT_CLASS (gfs_boundary_outflow_class ())->parent_class->read)
(* GTS_OBJECT_CLASS (gfs_boundary_outflow_class ())->parent_class->read)
(o, fp);
if (fp->type == GTS_E... | false | false | false | false | false | 0 |
autodetect_file_type ( gchar * filename,
gchar * pointeur_char )
{
gchar * extension;
gchar * type;
extension = strrchr ( filename, '.' );
if ( extension )
{
GSList * tmp = import_formats;
while ( tmp )
{
struct import_format * format = (struct import_fo... | false | false | false | false | false | 0 |
store_min_key(KEY_PART *key,
uchar **range_key,
uint *range_key_flag,
uint last_part)
{
SEL_ARG *key_tree= first();
uint res= key_tree->store_min(key[key_tree->part].store_length,
range_key, *range_key_flag);
*ra... | false | false | false | false | false | 0 |
_fd_lk_insert_and_merge (fd_lk_ctx_t *lk_ctx,
fd_lk_ctx_node_t *lock)
{
int32_t ret = -1;
int32_t i = 0;
fd_lk_ctx_node_t *entry = NULL;
fd_lk_ctx_node_t *t = NULL;
fd_lk_ctx_node_t *sum = NULL... | false | false | false | false | false | 0 |
evd_socket_deliver_async_result_error (EvdSocket *self,
GSimpleAsyncResult *res,
GError *error,
GAsyncReadyCallback callback,
gpointer ... | false | false | false | false | false | 0 |
assign_colors (void)
{
struct dlist *d;
while (WEBS(SELECT))
{
d = pop_list (&WEBS(SELECT));
colorize_one_web (DLIST_WEB (d), 1);
}
for (d = WEBS(COALESCED); d; d = d->next)
{
struct web *a = alias (DLIST_WEB (d));
DLIST_WEB (d)->color = a->color;
}
} | false | false | false | false | false | 0 |
move_internal(object *op, const char *params, int dir) {
if (*params != '\0') {
if (params[0] == 'f') {
if (!op->contr->fire_on) {
op->contr->fire_on = 1;
move_player(op, dir);
op->contr->fire_on = 0;
return;
}
}... | false | false | false | false | false | 0 |
clog_msg_msgid(struct ctlfile *ctf)
{
int n=ctlfile_searchfirst(ctf, COMCTLFILE_MSGID);
if (n >= 0)
clog_msg_str(ctf->lines[n]+1);
} | false | false | false | false | false | 0 |
queryServerByIndex(unsigned int index)
{
if (m_status == INVALID) {
error() << "called queryServerByIndex with invalid server list";
return;
}
if (index >= m_gameServers.size()) {
error() << "called queryServerByIndex with bad server index " << index;
return;
}
... | false | false | false | false | false | 0 |
send_data_frame (EvdWebsocketData *data,
const gchar *frame,
gsize frame_len,
EvdMessageType frame_type,
GError **error)
{
gsize bytes_sent;
gsize bytes_left;
GString *frag;
GOutputStream *stream;
gboolean re... | false | false | false | false | false | 0 |
barycentric_sort(struct reqtree *tree, int layer)
{
struct node_and_float T[tree->layer_size[layer]];
int i, j;
float v;
for (i = 0; i < tree->layer_size[layer]; i++) {
struct tree_node *node = tree->layers[layer][i];
T[i].node = node;
v = 0.0;
for (j = 0; j < node->nrequire; j++) {
v +=... | false | false | false | false | true | 1 |
cb_instance_sizelimit_set(void *arg, void *value, char *errorbuf, int phase, int apply)
{
cb_backend_instance * inst=(cb_backend_instance *) arg;
if (apply) {
slapi_rwlock_wrlock(inst->rwl_config_lock);
inst->sizelimit=(int) ((uintptr_t)value);
slapi_rwlock_unlock(inst->rwl_config_lock);... | false | false | false | false | false | 0 |
find_server_by_address(struct sockaddr_in * address)
{
struct afp_server *s;
for (s=server_base;s;s=s->next) {
if (bcmp(&s->address,address,sizeof(struct sockaddr_in))==0)
return s;
}
return NULL;
} | false | false | false | false | false | 0 |
explore_numeric_scope(pai, hostname, servname, res)
const struct addrinfo *pai;
const char *hostname;
const char *servname;
struct addrinfo **res;
{
#ifndef SCOPE_DELIMITER
return explore_numeric(pai, hostname, servname, res);
#else
const struct afd *afd;
struct addrinfo *cur;
int error;
char *cp, *hostname2 =... | false | false | false | false | false | 0 |
zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
{
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
char *classname;
int name_len;
if (exception != NULL) {
zend_get_object_classname(exception, &classname, &name_len TSRMLS_CC);
DTRACE_EXCEPTION_THROWN(classname);
} else {
... | false | false | false | false | false | 0 |
Clear(string const &Name, int const &Value)
{
char S[300];
snprintf(S,sizeof(S),"%i",Value);
Clear(Name, S);
} | false | false | false | false | false | 0 |
is_xsubstr_infer_bool(CdlTransaction transaction, CdlExpression expr, unsigned int index, bool goal, int level)
{
CYG_REPORT_FUNCNAMETYPE("is_xsubstr_infer_bool", "result %d");
CYG_REPORT_FUNCARG5XV(transaction, expr, index, goal, level);
bool result = false;
CdlSubexpression& subexpr = expr->sub_ex... | false | false | false | false | false | 0 |
parseShape( int propId, bool important )
{
Value *value = valueList->current();
ValueList *args = value->function->args;
QString fname = qString( value->function->name ).toLower();
//qDebug( "parseShape: fname: %d", fname.toLatin1().constData() );
if ( fname != "rect(" || !args )
return fals... | false | false | false | false | false | 0 |
updateEffectiveTime(int currentTime)
{
QGraphicsWidget *w = targetWidget();
if (w) {
const qreal delta = currentTime / qreal(duration());
QRectF newGeo;
newGeo.moveTopLeft(QPointF(m_startGeometry.left()*(1-delta) + m_targetGeometry.left()*(delta),
m_startGeometr... | false | false | false | false | false | 0 |
unedit (int argc, char **argv)
{
int local = 0;
int c;
int err;
if (argc == -1)
usage (unedit_usage);
optind = 0;
while ((c = getopt (argc, argv, "+lR")) != -1)
{
switch (c)
{
case 'l':
local = 1;
break;
case 'R':
local = 0;
break;
case '?':
default:
usage ... | false | false | false | false | false | 0 |
terminateFill(int FillStyle)
{
UNUSED(FillStyle);
if (!_pattern) {
cairo_new_path(_cr);
return;
}
cairo_set_source(_cr, _pattern);
cairo_fill(_cr);
// Surfaces are owned by const bitmap_info_cairo
if (cairo_pattern_get_type(_pattern) != CAIRO_PATTERN_TYPE_SURFACE) {
... | false | false | false | false | false | 0 |
sgettext(const char *msgid) {
const char *msgval = _(msgid);
char *found;
if (msgval == msgid)
if ( (found = strrchr (msgid, '|'))!=NULL )
msgval = found+1;
return (char *) msgval;
} | false | false | false | false | false | 0 |
filename_parse(char *filename, char *buffer, size_t len)
{
char *slash;
if (ast_strlen_zero(filename)) {
ast_log(LOG_WARNING, "No file name was provided for a file save option.\n");
} else if (filename[0] != '/') {
char *build;
build = ast_alloca(strlen(ast_config_AST_MONITOR_DIR) + strlen(filename) + 3);
sp... | false | false | false | false | false | 0 |
visitor_expr_do(
struct stmt *block,
struct stmt *stmt,
struct expr *expr,
int (*ev)(int, struct stmt *, struct stmt *, struct expr *)
)
{
int retval;
struct expr *ce;
retval = 0;
retval |= (*ev)(0, block, stmt, expr);
if (expr->expr0) {
retval |= visitor_expr_do(block, stmt, expr->expr0, ev);
}
if (expr... | false | false | false | false | false | 0 |
i40e_veb_link_event(struct i40e_veb *veb, bool link_up)
{
struct i40e_pf *pf;
int i;
if (!veb || !veb->pf)
return;
pf = veb->pf;
/* depth first... */
for (i = 0; i < I40E_MAX_VEB; i++)
if (pf->veb[i] && (pf->veb[i]->uplink_seid == veb->seid))
i40e_veb_link_event(pf->veb[i], link_up);
/* ... now the loc... | false | false | false | false | false | 0 |
SetUpperNode(void *Data,
TreeKind kind,
SemanticNode *upper)
{
if(Data != NULL){
switch(kind){
case NODE:
((SemanticNode *)Data)->parent = upper;
break;
case LEAF:
((SemanticLeaf *)Data)->parent = upper;
break;
case EMPTY:
break;
default:
fatal("Illegal... | false | false | false | false | false | 0 |
via_print_sdchc(struct via_crdr_mmc_host *host)
{
void __iomem *addrbase = host->sdhc_mmiobase;
pr_debug("SDC MMIO Registers:\n");
pr_debug("SDCONTROL=%08x, SDCMDARG=%08x, SDBUSMODE=%08x\n",
readl(addrbase + VIA_CRDR_SDCTRL),
readl(addrbase + VIA_CRDR_SDCARG),
readl(addrbase + VIA_CRDR_SDBUSMODE));
pr_deb... | false | false | false | false | false | 0 |
FindInterval(
uint16 *phoneSeq, int nPhoneSeq,
char selectStr[][ MAX_PHONE_SEQ_LEN * MAX_UTF8_SIZE + 1 ],
IntervalType selectInterval[], int nSelect,
int bArrBrkpt[], TreeDataType *ptd )
{
int end, begin, pho_id;
Phrase *p_phrase, *puserphrase, *pdictphrase;
UsedPhraseMode i_used_phrase;
uint16 new_phone... | false | false | false | false | false | 0 |
AddToGroup(PG_RadioButton* w) {
PG_RadioButton* list = my_groupFirst;
while(list->my_groupNext != NULL) {
list = list->my_groupNext;
}
list->my_groupNext = w;
w->my_groupFirst = my_groupFirst;
w->my_groupNext = NULL;
} | false | false | false | false | false | 0 |
status_open(struct view *view)
{
unsigned long prev_lineno = view->lineno;
reset_view(view);
if (!realloc_lines(view, view->line_size + 7))
return FALSE;
add_line_data(view, NULL, LINE_STAT_HEAD);
if (is_initial_commit())
string_copy(status_onbranch, "Initial commit");
else if (!*opt_head)
string_copy(st... | false | false | false | false | false | 0 |
gupnp_dlna_gst_video_information_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GUPnPDLNAGstVideoInformation *info =
... | false | false | false | false | false | 0 |
builtin_initialize(ScmObj *argv, int argc, ScmGeneric *gf)
{
ScmObj instance, initargs, ap;
ScmClass *klass;
SCM_ASSERT(argc == 2);
instance = argv[0];
initargs = argv[1];
if (Scm_Length(initargs) % 2) {
Scm_Error("initializer list is not even: %S", initargs);
}
klass = Scm_Class... | false | false | false | false | false | 0 |
add_btdev(struct btdev *btdev)
{
int i, index = -1;
for (i = 0; i < MAX_BTDEV_ENTRIES; i++) {
if (btdev_list[i] == NULL) {
index = i;
btdev_list[index] = btdev;
break;
}
}
return index;
} | false | false | false | false | false | 0 |
bjnp_get_scanner_mac_address ( int devno, char *mac_address )
{
/*
* send discover to scanner
*/
char cmd_buf[BJNP_CMD_MAX];
char resp_buf[BJNP_RESP_MAX];
int resp_len;
struct DISCOVER_RESPONSE *resp = (struct DISCOVER_RESPONSE * )&resp_buf;;
/* send job details command */
set_cmd_for_dev (devno, (str... | true | true | false | false | false | 1 |
copy_size_stub (XDR *xdr_in)
{
int r;
struct guestfs_copy_size_args args;
CLEANUP_FREE char *src = NULL;
CLEANUP_FREE char *dest = NULL;
int64_t size;
if (optargs_bitmask != 0) {
reply_with_error ("header optargs_bitmask field must be passed as 0 for calls that don't take optional arguments");
goto... | false | false | false | false | false | 0 |
stf_to_mband(gpointer dialog, struct stf *stf)
{
struct mband_dataset *mbds;
int ret;
mbds = gtk_object_get_data(GTK_OBJECT(dialog), "mbds");
if (mbds == NULL) {
mbds = mband_dataset_new();
d3_printf("mbds: %p\n", mbds);
mband_dataset_set_bands_by_string(mbds, P_STR(AP_BANDS_SETUP));
gtk_object_set_data_f... | false | false | false | false | false | 0 |
write_attributes (gnutls_pkcs12_bag_t bag, int elem,
ASN1_TYPE c2, const char *where)
{
int result;
char root[128];
/* If the bag attributes are empty, then write
* nothing to the attribute field.
*/
if (bag->element[elem].friendly_name == NULL &&
bag->element[elem].local_key_id.d... | false | false | false | false | false | 0 |
tg3_mdio_fini(struct tg3 *tp)
{
if (tg3_flag(tp, MDIOBUS_INITED)) {
tg3_flag_clear(tp, MDIOBUS_INITED);
mdiobus_unregister(tp->mdio_bus);
mdiobus_free(tp->mdio_bus);
}
} | false | false | false | false | false | 0 |
IsQuoteLine(int line, Accessor &styler) {
int style = styler.StyleAt(styler.LineStart(line)) & 31;
return ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE));
} | false | false | false | false | false | 0 |
BTDM_WifiAssociateNotify(struct rtw_adapter *padapter, u8 action)
{
if (!rtl8723a_BT_coexist(padapter))
return;
BTDM_WifiAssociateNotify8723A(padapter, action);
} | false | false | false | false | false | 0 |
adv_calc_railroad(const struct city *pcity,
const struct tile *ptile)
{
int goodness = -1;
fc_assert_ret_val(ptile != NULL, -1)
if (!is_ocean_tile(ptile)
&& player_knows_techs_with_flag(city_owner(pcity), TF_RAILROAD)
&& !tile_has_special(ptile, S_RAILROAD)) {
struct ... | false | false | false | false | false | 0 |
tp_connection_manager_dispose (GObject *object)
{
TpConnectionManager *self = TP_CONNECTION_MANAGER (object);
TpProxy *as_proxy = (TpProxy *) self;
if (self->priv->disposed)
goto finally;
self->priv->disposed = TRUE;
tp_dbus_daemon_cancel_name_owner_watch (as_proxy->dbus_daemon,
as_proxy->bus_nam... | false | false | false | false | false | 0 |
IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
if (tag->getName() == "SphereParams") {
fRadius = tag->getParam("Radius", "0").toFloat();
} else if (tag->getName() == "Center") {
if (tag->hasChildren())
fCenter.prcParse(tag->getFirstChild());
} else if (tag->getName() == "Wor... | false | false | false | false | false | 0 |
ekg_writef(int fd, const char *format, ...) {
char *text;
int textlen;
va_list ap;
int res;
if (fd == -1 || !format)
return -1;
va_start(ap, format);
text = vsaprintf(format, ap);
va_end(ap);
textlen = xstrlen(text);
debug_io("ekg_writef: %s\n", text ? textlen ? text: "[0LENGTH]":"[FAILED]");
if... | false | false | false | false | false | 0 |
evthread_notify_base_eventfd(struct event_base *base)
{
ev_uint64_t msg = 1;
int r;
do {
r = write(base->th_notify_fd[0], (void*) &msg, sizeof(msg));
} while (r < 0 && errno == EAGAIN);
return (r < 0) ? -1 : 0;
} | false | false | false | false | false | 0 |
close_framebuffer(void)
{
munmap(fbuffer, fix.smem_len);
close(fb_fd);
if(strcmp(consoledevice,"none")!=0) {
if (ioctl(con_fd, KDSETMODE, KD_TEXT) < 0)
perror("KDSETMODE");
if (last_vt >= 0)
if (ioctl(con_fd, VT_ACTIVATE, last_vt))
per... | false | false | false | false | false | 0 |
dup_element(FILE* in, const char* tag_name, char** pp) {
char buf[256], end_tag[256];
int retval;
sprintf(buf, "<%s>\n", tag_name);
sprintf(end_tag, "</%s>", tag_name);
char* p = strdup(buf);
while (fgets(buf, 256, in)) {
if (strstr(buf, end_tag)) {
sprintf(buf, "</%s>\n", ... | false | false | false | false | false | 0 |
activate (void)
{
m_Background.reset (Surface::fromScreen ());
SDL_Rect region;
region.x = 0;
region.y = 0;
region.w = m_Background->getWidth ();
region.h = m_Background->getHeight ();
m_ActiveState->redrawBackground (®ion, m_Background->toSDLSurface ());
SDL_Surface *blackBox =
... | false | false | false | false | false | 0 |
gtk_hotkey_info_bind (GtkHotkeyInfo* self, GError **error)
{
gboolean result;
g_return_val_if_fail (GTK_HOTKEY_IS_INFO (self), FALSE);
if (gtk_hotkey_info_is_bound(self)) {
g_set_error (error, GTK_HOTKEY_LISTENER_ERROR,
GTK_HOTKEY_LISTENER_ERROR_BIND,
"Can not bind hotkey '%s' with signature '%s'. ... | false | false | false | false | false | 0 |
creature_set_health(creature_t *creature, int health) {
if (health > creature_max_health(creature))
health = creature_max_health(creature);
if (health < 0)
health = 0;
creature->health = health;
return 1;
} | false | false | false | false | false | 0 |
match(const QString &number)
{
QContactDetailFilter l;
l.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, QContactPhoneNumber::FieldNumber);
l.setValue(number);
l.setMatchFlags(QContactFilter::MatchPhoneNumber);
return l;
} | false | false | false | false | false | 0 |
mousedev_limit_delta(int delta, int limit)
{
return delta > limit ? limit : (delta < -limit ? -limit : delta);
} | false | false | false | false | false | 0 |
ext2fs_extent_fix_parents(ext2_extent_handle_t handle)
{
int retval = 0;
int orig_height;
blk64_t start;
struct extent_path *path;
struct ext2fs_extent extent;
struct ext2_extent_info info;
EXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE);
if (!(handle->fs->flags & EXT2_FLAG_RW))
return EXT... | false | false | false | false | false | 0 |
singlestep (lua_State *L) {
global_State *g = G(L);
/*lua_checkmemory(L);*/
switch (g->gcstate) {
case GCSpause: {
markroot(L); /* start a new collection */
return 0;
}
case GCSpropagate: {
if (g->gray)
return propagatemark(g);
else { /* no more `gray' objects */
... | false | false | false | false | false | 0 |
outcode(unsigned int code, FILE * f1)
{
accum += code << bits;
bits += codesize;
while (bits >= 8)
{
buf[++buf[0]] = accum & 255;
accum >>= 8;
bits -= 8;
if (buf[0] == 255)
{
if (fwrite(buf, 1, 256, f1) != 256) return 1;
buf[0] = 0;
}
}
return 0;
} | false | false | false | false | false | 0 |
importNode( const Node & importedNode, bool deep )
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
int exceptioncode = 0;
NodeImpl *r = static_cast<DocumentImpl*>(impl)->importNode(importedNode.handle(), deep, exceptioncode);
if (exceptioncode)
throw DOMException(exceptioncode);
... | false | false | false | false | false | 0 |
patientUuid(const QModelIndex &index) const
{
QModelIndex idx = this->index(index.row(), Core::IPatient::Uid);
return data(idx).toString();
} | false | false | false | false | false | 0 |
intel_miptree_resolve_color(struct brw_context *brw,
struct intel_mipmap_tree *mt)
{
switch (mt->fast_clear_state) {
case INTEL_FAST_CLEAR_STATE_NO_MCS:
case INTEL_FAST_CLEAR_STATE_RESOLVED:
/* No resolve needed */
break;
case INTEL_FAST_CLEAR_STATE_UNRESOLVED:
cas... | false | false | false | false | false | 0 |
state_url(char ch)
{
if (ch == '?')
{
log_debug("url=" << token);
ev.onUrl(token);
token.clear();
token.reserve(32);
state = &HeaderParser::state_qparam;
return;
}
else if (ch == ' ' || ch == '\t')
{
... | false | false | false | false | false | 0 |
obligsym(fun,strom,symb)
truc fun;
truc *strom;
truc symb;
{
truc obj;
int tok, ret;
int sflg;
tok = skipeoltok(strom);
if(tok != SYMBOLTOK) {
/* genauere Fehlerbehandlung wuenschenswert */
ret = aERROR;
}
else {
sflg = lookupsym(SymBuf,&obj);
ret = (obj == symb ? sf... | false | false | false | false | false | 0 |
compute(vnl_vector<vcl_complex<double> > const &a)
{
// construct companion matrix
vnl_matrix<vcl_complex<double> > comp(N, N);
comp.fill(0);
for (unsigned i=0; i<N-1; ++i)
comp(i+1, i) = 1;
for (unsigned i=0; i<N; ++i)
comp(i, N-1) = -a[N-1-i];
// the eigenvalues of the companion matrix are the ro... | false | false | false | false | false | 0 |
mm_write_fr(struct fb_info *p, u8 reg, u8 data)
{
mm_write_ind(reg, data, 0x7a0, 0x7a1);
} | false | false | false | false | false | 0 |
gf_oci_event_get_start_time(OCIEvent *event, u8 *Hours, u8 *Minutes, u8 *Seconds, u8 *HundredSeconds, u8 *IsAbsoluteTime)
{
if (!event || !Hours || !Minutes || !Seconds || !HundredSeconds || !IsAbsoluteTime)
return GF_BAD_PARAM;
*IsAbsoluteTime = event->AbsoluteTimeFlag;
*Hours = event->StartingTime[0];
*Minute... | false | false | false | false | false | 0 |
ath6kl_add_new_sta(struct ath6kl_vif *vif, u8 *mac, u16 aid,
u8 *wpaie, size_t ielen, u8 keymgmt,
u8 ucipher, u8 auth, u8 apsd_info)
{
struct ath6kl *ar = vif->ar;
struct ath6kl_sta *sta;
u8 free_slot;
free_slot = aid - 1;
sta = &ar->sta_list[free_slot];
memcpy(sta->mac, mac, ETH_ALEN);
if ... | false | true | false | false | false | 1 |
swap_items(array const *ary, size_t a, size_t b)
{
if (ary->aligned) {
op_t tmp;
op_t *om = (op_t *) ary->m;
tmp = om[b];
om[b] = om[a];
om[a] = tmp;
} else if (NULL == ary->swap) {
char *x = cast_to_char_ptr(&ary->m[a * ary->s]);
char *y = cast_to_char_ptr(&ary->m[b * ary->s]);
/*
* Using SWAP()... | false | false | false | false | false | 0 |
showTabs() {
if (m_tabmode == INTERNAL || m_use_tabs) {
m_use_tabs = true;
return false; // nothing changed
}
m_use_tabs = true;
if (m_visible)
m_tab_container.show();
return true;
} | false | false | false | false | false | 0 |
dir_t_create(void)
{
dir_t *d = dir_t_create_empty();
if (!d) return(NULL);
if (dir_t_allocate_entry(d, DIR_T_RECORDS))
{
free(d);
return(NULL);
}
return(d);
} | false | false | false | false | false | 0 |
GetNextPolygon()
{
DDFRecord *poRecord;
/* -------------------------------------------------------------------- */
/* Read a record. */
/* -------------------------------------------------------------------- */
if( oDDFModule.GetFP() == NULL )
... | false | false | false | false | false | 0 |
DCC_gotxferconnection(dccrec *xfer_serv)
{
dccrec *d;
char s[MAXHOSTLENGTH], u[USERLEN], h[HOSTLEN], n1[50];
char *bf;
IP ip;
int sock;
u_short port;
context;
/* Got activity on an xfer server awaiting connection. Answer it. */
sock = net_accept(xfer_serv->socket,s,&ip,&port,1);
if(sock == -1 && (errno == E... | false | false | false | false | false | 0 |
tooltip(int type, int lno, const char *opt)
{
STATIC_STRBUF(sb);
strbuf_clear(sb);
if (lno > 0) {
if (type == 'I')
strbuf_puts(sb, "Included from");
else if (type == 'R')
strbuf_puts(sb, "Defined at");
else if (type == 'Y')
strbuf_puts(sb, "Used at");
else
strbuf_puts(sb, "Refered from");
strb... | false | false | false | false | false | 0 |
_sm_alloc_locals_segment(seg_manager_t *self, script_t *scr, int count)
{
if (!count) { /* No locals */
scr->locals_segment = 0;
scr->locals_block = NULL;
return NULL;
} else {
mem_obj_t *mobj;
local_variables_t *locals;
if (scr->locals_segment) {
mobj = self->heap[scr->locals_segment];
VERIFY(mobj... | false | false | false | true | false | 1 |
Reset()
{
SetWinner(TEAM_NONE);
SetStatus(STATUS_WAIT_QUEUE);
SetStartTime(0);
SetEndTime(0);
SetArenaType(ARENA_TYPE_NONE);
SetRated(false);
m_Events = 0;
// door-event2 is always 0
m_ActiveEvents[BG_EVENT_DOOR] = 0;
if (isArena())
{
m_ActiveEvents[ARENA_BUFF_EVENT... | false | false | false | false | false | 0 |
clpEntry_free(ClpEntry *ci) {
int i;
assert(MAGIC(ci));
if (ci->type == clpDtype_string) {
for (i = 0; i < ci->maxStrs; ++i)
str_deinit(&ci->storage.strList[i]);
wms_free(ci->storage.strList);
}
} | false | false | false | false | false | 0 |
azel_to_xy (GtkPolarView *p, gdouble az, gdouble el, gfloat *x, gfloat *y)
{
gdouble rel;
if (el < 0.0) {
/* FIXME: generate bug report */
*x = 0.0;
*y = 0.0;
return;
}
/* convert angles to radians */
az = de2ra*az;
el = de2ra*el;
/* radius @ el */
r... | false | false | false | false | false | 0 |
GetNumNormal(int32 &n) const
{
if (!isValid()) return false;
if (normDataFloat.size() != 0)
n = normDataFloat.size();
if (normDataDouble.size() != 0)
n = normDataDouble.size();
n = n / 3;
return true;
} | false | false | false | false | false | 0 |
tellIdentified( const QString &udi )
{
DEBUG_BLOCK
emit identified( deviceInfo( udi ) );
} | false | false | false | false | false | 0 |
bigswap(uint n)
{
const int islittleendian = 1;
return *(const uchar *)&islittleendian ? (n<<24) | (n>>24) | ((n>>8)&0xFF00) | ((n<<8)&0xFF0000) : n;
} | false | false | false | false | false | 0 |
QualityToCompression(double c) {
const double linear_c = (c < 0.75) ? c * (2. / 3.) : 2. * c - 1.;
// The file size roughly scales as pow(quantizer, 3.). Actually, the
// exponent is somewhere between 2.8 and 3.2, but we're mostly interested
// in the mid-quant range. So we scale the compressibility inversely t... | false | false | false | false | false | 0 |
cdf_read_sector_chain(const cdf_info_t *info, const cdf_header_t *h,
const cdf_sat_t *sat, const cdf_sat_t *ssat, const cdf_stream_t *sst,
cdf_secid_t sid, size_t len, cdf_stream_t *scn)
{
if (len < h->h_min_size_standard_stream)
return cdf_read_short_sector_chain(h, ssat, sst, sid, len,
scn);
else
... | false | false | false | false | false | 0 |
cmp_database_name(const void *item, void *data)
{
const dicod_database_t *db = item;
int rc;
if (!db->name)
return 1;
rc = strcmp(db->name, (const char*)data);
if (rc == 0 && !database_visible_p(db))
rc = 1;
return rc;
} | false | false | false | false | false | 0 |
pcf50633_free_irq(struct pcf50633 *pcf, int irq)
{
if (irq < 0 || irq >= PCF50633_NUM_IRQ)
return -EINVAL;
mutex_lock(&pcf->lock);
pcf->irq_handler[irq].handler = NULL;
mutex_unlock(&pcf->lock);
return 0;
} | false | false | false | false | false | 0 |
compareSpecificity(const Rule &r) const
{
unsigned i1 = action().partIndex();
unsigned i2 = r.action().partIndex();
if (i1 == i2)
return 0;
return i1 < i2 ? -1 : 1;
} | false | false | false | false | false | 0 |
brw_uncompact_instruction(struct brw_context *brw,
struct brw_instruction *dst,
struct brw_compact_instruction *src)
{
memset(dst, 0, sizeof(*dst));
dst->header.opcode = src->dw0.opcode;
dst->header.debug_control = src->dw0.debug_control;
set_uncompacted... | false | false | false | false | false | 0 |
pwm_freq_from_reg(u8 reg, u16 clkin)
{
unsigned long base_clock;
if (reg & 0x80) {
base_clock = clkin * 1000 / ((clkin == 48000) ? 384 : 256);
return base_clock / ((reg & 0x7f) + 1);
} else
return pwm_freq_cksel0[reg & 0x0f];
} | false | false | false | false | false | 0 |
poly17_init(void)
{
UINT32 i, x = 0;
UINT8 *p, *r;
/* allocate memory */
p = poly17 = auto_malloc(2 * (POLY17_SIZE + 1));
if (!poly17)
return;
r = rand17 = poly17 + POLY17_SIZE + 1;
/* generate the polynomial */
for (i = 0; i < POLY17_SIZE; i++)
{
/* store new values */
*p++ = x & ... | false | false | false | false | false | 0 |
S_hv_auxinit(pTHX_ HV *hv) {
struct xpvhv_aux *iter;
char *array;
PERL_ARGS_ASSERT_HV_AUXINIT;
if (!SvOOK(hv)) {
if (!HvARRAY(hv)) {
Newxz(array, PERL_HV_ARRAY_ALLOC_BYTES(HvMAX(hv) + 1)
+ sizeof(struct xpvhv_aux), char);
} else {
array = (char *... | false | false | false | false | false | 0 |
spk_s2uchar(char *start, char *dest)
{
int val;
val = simple_strtoul(skip_spaces(start), &start, 10);
if (*start == ',')
start++;
*dest = (u_char)val;
return start;
} | false | false | false | false | false | 0 |
screenshot(const std::string& filename) {
if(!open(filename)) return;
std::vector<char> buffer;
buffer.resize(display.width * display.height * components);
capture(buffer);
writeTGA(buffer);
close();
} | false | false | false | false | false | 0 |
copy_msg(char *buf, const char *msg)
{
char *cp = buf;
char c;
int wasspace = 1;
*cp++ = '\t';
while ((c = *msg++)) {
if (wasspace && isspace(c))
continue;
wasspace = isspace(c);
if (wasspace)
c = ' ';
*cp++ = c;
}
while (buf < cp && isspace(cp[-1]))
cp--;
*cp++ = '\n';
return cp - buf;
} | false | false | false | false | false | 0 |
median() const
{
if (!_len)
return 0.0;
if (_len % 2 == 0) // is it even? if so, be pedantic about the median -
{ // some books say don't bother for n>100
const MSIndexVector i=gradeUp();
unsigned n = _len / 2;
return (_pBuiltInOps->getAsNumber(_pElements,i(n-1))+_pBuil... | 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.