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 |
|---|---|---|---|---|---|---|
get_secindex(unsigned int shndx,
unsigned int sym_offs,
const Elf32_Word *symtab_shndx_start)
{
if (is_shndx_special(shndx))
return SPECIAL(shndx);
if (shndx != SHN_XINDEX)
return shndx;
return r(&symtab_shndx_start[sym_offs]);
} | false | false | false | false | false | 0 |
read_data_sectors_generic (void *p_user_data, void *p_buf, lsn_t i_lsn,
uint16_t i_blocksize, uint32_t i_blocks)
{
int rc;
if (0 > cdio_generic_lseek(p_user_data, i_blocksize*i_lsn, SEEK_SET))
return DRIVER_OP_ERROR;
rc = cdio_generic_read(p_user_data, p_buf, i_blocksize*i_blocks);... | false | false | false | false | false | 0 |
LI70__LOOP_DO_NAMED__loop()
{ VMB59 VMS59 VMV59
goto TTL;
TTL:;
{register object V414;
vs_base=vs_top;
(void) (*Lnk355)();
vs_top=sup;
V414= vs_base[0];
if(type_of((V414))==t_symbol){
goto T963;}
base[0]= ((object)VV[158]);
base[1]= (V414);
vs_top=(vs_base=base+0)+2;
(void) (*Lnk351)();
vs_top=sup;
goto... | false | false | false | false | false | 0 |
GetTypeRecordingBinaryOpStub(int key,
TRBinaryOpIC::TypeInfo type_info,
TRBinaryOpIC::TypeInfo result_type_info) {
TypeRecordingBinaryOpStub stub(key, type_info, result_type_info);
return stub.GetCode();
} | false | false | false | false | false | 0 |
ApplyFunction(const ExtendedOctree &tree, uint64_t iLODLevel,
bool (*brickFunc)(void* pData,
const UINT64VECTOR3& vBrickSize,
const UINT64VECTOR3& vBrickOffset,
... | false | false | false | false | false | 0 |
ga_service_resolver_attach(GaServiceResolver * resolver,
GaClient * client, GError ** error) {
GaServiceResolverPrivate *priv =
GA_SERVICE_RESOLVER_GET_PRIVATE(resolver);
g_assert(client != NULL);
g_object_ref(client);
priv->client = client;
priv->resolver =... | false | false | false | false | false | 0 |
ClearWindow() {
window_ = NULL;
if (!profiler_ && IsActive() && !RuntimeProfiler::IsEnabled()) Stop();
} | false | false | false | false | false | 0 |
lookup(KeySymbol const &key,
KeyModifier mod, KeySequence * seq) const
{
if (table.empty()) {
seq->reset();
return FuncRequest::unknown;
}
Table::const_iterator end = table.end();
for (Table::const_iterator cit = table.begin(); cit != end; ++cit) {
KeyModifier mask = cit->mod.second;
KeyModifier check ... | false | false | false | false | false | 0 |
cr_parser_set_sac_handler (CRParser * a_this, CRDocHandler * a_handler)
{
g_return_val_if_fail (a_this, CR_BAD_PARAM_ERROR);
if (PRIVATE (a_this)->sac_handler) {
cr_doc_handler_unref (PRIVATE (a_this)->sac_handler);
}
PRIVATE (a_this)->sac_handler = a_handler;
c... | false | false | false | false | false | 0 |
JS_ClearScriptTraps(JSContext *cx, JSScript *script)
{
JSRuntime *rt;
JSTrap *trap, *next;
uint32 sample;
rt = cx->runtime;
DBG_LOCK(rt);
for (trap = (JSTrap *)rt->trapList.next;
&trap->links != &rt->trapList;
trap = next) {
next = (JSTrap *)trap->links.next;
i... | false | false | false | false | false | 0 |
set_sensitive_camera(GtkWidget* buttonPerspective, gpointer data)
{
if(GTK_IS_WIDGET(buttonPerspective))
{
gboolean perspective = GTK_TOGGLE_BUTTON (buttonPerspective)->active;
GtkWidget* EntryZNear = (GtkWidget*)g_object_get_data(G_OBJECT (buttonPerspective), "EntryZNear");
GtkWidget* EntryZFar = g_object_get_... | false | false | false | false | false | 0 |
operator==(const PseudoJet & a, const PseudoJet & b) {
if (a.px() != b.px()) return false;
if (a.py() != b.py()) return false;
if (a.pz() != b.pz()) return false;
if (a.E () != b.E ()) return false;
if (a.user_index() != b.user_index()) return false;
if (a.cluster_hist_index() != b.cluster_hist_index(... | false | false | false | false | false | 0 |
dlopen_dlz_configure(dns_view_t *view, void *driverarg, void *dbdata) {
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
isc_result_t result;
UNUSED(driverarg);
if (cd->dlz_configure == NULL)
return (ISC_R_SUCCESS);
MAYBE_LOCK(cd);
cd->in_configure = ISC_TRUE;
result = cd->dlz_configure(view, cd->dbdata);
cd-... | false | false | false | false | false | 0 |
prep_get_row_bounds(MIPdesc *mip, int r_ind, double etol)
{
ROWinfo *rows = mip->mip_inf->rows;
int j, c_ind, *r_matbeg = mip->row_matbeg;
int *r_matind = mip->row_matind;
double *r_matval = mip->row_matval;
double *ub = mip->ub;
double *lb = mip->lb;
double a_val;
rows[r_ind].ub = r... | false | false | false | false | false | 0 |
skip_pragmat (LINE_T ** top, char **ch, int delim, BOOL_T whitespace)
{
LINE_T *u = *top;
char *v = *ch;
while (u != NO_LINE) {
while (v[0] != NULL_CHAR) {
if (is_bold (v, "PRAGMAT") && delim == BOLD_PRAGMAT_SYMBOL) {
*top = u;
*ch = &v[1];
return (A68_TRUE);
} else if (is_... | false | false | false | false | false | 0 |
findJump(float *data, int size, float *position, int minPoints)
{
int i;
int derSize;
float *der;
VimosBool status;
derSize = size - 1;
der = (float *) pil_malloc(derSize*sizeof(float));
for (i=0; i<derSize; i++) der[i] = fabs(data[i+1]-data[i]);
status = findPeak1D(der, derSize, positio... | false | false | false | false | false | 0 |
mincore_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
struct mm_walk *walk)
{
spinlock_t *ptl;
struct vm_area_struct *vma = walk->vma;
pte_t *ptep;
unsigned char *vec = walk->private;
int nr = (end - addr) >> PAGE_SHIFT;
if (pmd_trans_huge_lock(pmd, vma, &ptl) == 1) {
memset(vec, 1, nr);
sp... | false | false | false | false | false | 0 |
btrfs_mknod(struct inode *dir, struct dentry *dentry,
umode_t mode, dev_t rdev)
{
struct btrfs_trans_handle *trans;
struct btrfs_root *root = BTRFS_I(dir)->root;
struct inode *inode = NULL;
int err;
int drop_inode = 0;
u64 objectid;
u64 index = 0;
/*
* 2 for inode item and ref
* 2 for dir items
* 1 fo... | false | false | false | false | false | 0 |
compare_gnumeric_eigen_ev (const void *a, const void *b)
{
const gnumeric_eigen_ev_t *da = a;
const gnumeric_eigen_ev_t *db = b;
gnm_float ea = da->val;
gnm_float eb = db->val;
/* Compare first by magnitude (descending). */
if (gnm_abs (ea) > gnm_abs (eb))
return -1;
else if (gnm_abs (ea) < gnm_abs (eb))
r... | false | false | false | false | false | 0 |
ad7791_setup(struct ad7791_state *st,
struct ad7791_platform_data *pdata)
{
/* Set to poweron-reset default values */
st->mode = AD7791_MODE_BUFFER;
st->filter = AD7791_FILTER_RATE_16_6;
if (!pdata)
return 0;
if ((st->info->flags & AD7791_FLAG_HAS_BUFFER) && !pdata->buffered)
st->mode &= ~AD7791_MODE_BUFF... | false | false | false | false | false | 0 |
adjustMTU(PseudoTcpSocket *self)
{
PseudoTcpSocketPrivate *priv = self->priv;
// Determine our current mss level, so that we can adjust appropriately later
for (priv->msslevel = 0;
PACKET_MAXIMUMS[priv->msslevel + 1] > 0;
++priv->msslevel) {
if (((guint16)PACKET_MAXIMUMS[priv->msslevel]) <= pri... | false | false | false | false | false | 0 |
zzip_mem_disk_findfile(ZZIP_MEM_DISK * dir,
char *filename, ZZIP_MEM_ENTRY * after,
zzip_strcmp_fn_t compare)
{
ZZIP_MEM_ENTRY *entry = (! after ? dir->list : after->zz_next);
if (! compare)
compare = (zzip_strcmp_fn_t) (strcmp);
for (; entry; entry = en... | false | false | false | false | false | 0 |
stde_close(TermDocEnum *tde)
{
is_close(STDE(tde)->frq_in);
if (NULL != STDE(tde)->skip_in) {
is_close(STDE(tde)->skip_in);
}
free(tde);
} | false | false | false | false | false | 0 |
gt_tyrcountinfo_new(const Tyrindex *tyrindex,
const char *tyrindexname,
GtError *err)
{
size_t numofbytes;
void *tmp;
bool haserr = false;
Tyrcountinfo *tyrcountinfo;
gt_error_check(err);
tyrcountinfo = gt_malloc(sizeof *tyrcountinfo);
t... | false | false | false | false | false | 0 |
cmd_execs (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{
int r;
exec_check_process (sess);
if (sess->running_exec == NULL)
{
EMIT_SIGNAL (XP_TE_NOCHILD, sess, NULL, NULL, NULL, NULL, 0);
return FALSE;
}
r = kill (sess->running_exec->childpid, SIGSTOP);
if (r == -1)
PrintText (sess, "... | false | false | false | false | false | 0 |
ars_build_packet(struct ars_packet *pkt, unsigned char **packet, size_t *size)
{
size_t tot_size, offset = 0;
int j = 0;
if ((tot_size = ars_packet_size(pkt)) == 0) {
ars_set_error(pkt, "Total size 0 building the packet");
return -ARS_INVALID;
}
if ((*packet = malloc(tot_size)) == NULL) {
ars_set_error(pkt,... | false | false | false | false | false | 0 |
_credentials_updated_func (gpointer data, gpointer userdata)
{
SwService *service = SW_SERVICE (data);
SwServiceFacebookPrivate *priv = SW_SERVICE_FACEBOOK (service)->priv;
online_notify (FALSE, service);
/* Clean up pic_square to prevent avatar retrieving */
if (priv->pic_square){
g_free (priv->pic_squ... | false | false | false | false | false | 0 |
autohelperbarrierspat21(int trans, int move, int color, int action)
{
int a, b, c, d;
UNUSED(color);
UNUSED(action);
a = AFFINE_TRANSFORM(721, trans, move);
b = AFFINE_TRANSFORM(722, trans, move);
c = AFFINE_TRANSFORM(684, trans, move);
d = AFFINE_TRANSFORM(759, trans, move);
return !play_attack_defen... | false | false | false | false | false | 0 |
kirkwood_set_dco(void __iomem *io, unsigned long rate)
{
unsigned long value;
value = KIRKWOOD_DCO_CTL_OFFSET_0;
switch (rate) {
default:
case 44100:
value |= KIRKWOOD_DCO_CTL_FREQ_11;
break;
case 48000:
value |= KIRKWOOD_DCO_CTL_FREQ_12;
break;
case 96000:
value |= KIRKWOOD_DCO_CTL_FREQ_24;
break;
... | false | false | false | false | false | 0 |
protocol_name () const
{
const char* ret = "";
if (pn == protocol::tcp)
ret = "tcp";
if (pn == protocol::udp)
ret = "udp";
return ret;
} | false | false | false | false | false | 0 |
getcurwd(void)
{
String *t;
char buf[256];
buf[0] = 0;
getwd(buf, sizeof(buf));
t = tmpcstr(buf);
Strduplstr(&curwd, t);
freetmpstr(t);
if(curwd.n == 0)
warn(Wpwd);
else if(curwd.s[curwd.n-1] != '/')
Straddc(&curwd, '/');
} | true | true | false | false | true | 1 |
ssp_refresh_task(struct work_struct *work)
{
struct ssp_data *data = container_of((struct delayed_work *)work,
struct ssp_data, work_refresh);
dev_info(&data->spi->dev, "refreshing\n");
data->reset_cnt++;
if (ssp_initialize_mcu(data) >= 0) {
ssp_sync_available_sensors(data);
if (data->last_ap_state... | false | false | false | false | false | 0 |
glade_gtk_tool_item_post_create (GladeWidgetAdaptor *adaptor,
GObject *object,
GladeCreateReason reason)
{
GladeWidget *gitem = glade_widget_get_from_gobject (object);
if (GTK_IS_SEPARATOR_TOOL_ITEM (object)) return;
if (reason == GLADE_CREATE_USER &&
gtk_bin_get_child (GTK_BIN (obj... | false | false | false | false | false | 0 |
AddParticipant(const SystemAddress &systemAddress, RakNetGUID rakNetGUID)
{
// Relay the new connection to other systems.
RakNet::BitStream bs;
bs.Write((MessageID)ID_REMOTE_NEW_INCOMING_CONNECTION);
bs.Write((uint32_t)1);
bs.Write(systemAddress);
bs.Write(rakNetGUID);
bs.WriteCasted<uint16_t>(rakPeerInt... | false | false | false | false | false | 0 |
glade_editor_reset_selection_changed_cb (GtkTreeSelection *selection,
GtkTextView *desc_view)
{
GtkTreeIter iter;
GladeProperty *property = NULL;
GtkTreeModel *model = NULL;
GtkTextBuffer *text_buffer;
const gchar *message =
_("Select the properties that you want to reset to their default values");... | false | false | false | false | false | 0 |
Indent(cbStyledTextCtrl* stc, wxString &indent)const
{
if (stc->GetUseTabs())
indent << _T('\t'); // 1 tab
else
indent << wxString(_T(' '), stc->GetTabWidth()); // n spaces
} | false | false | false | false | false | 0 |
print()
{
#ifndef QT_NO_PRINTER
QPrinter printer;
printer.setFullPage(TRUE);
if ( printer.setup( this ) ) {
QPainter p( &printer );
Q3PaintDeviceMetrics metrics(p.device());
int dpix = metrics.logicalDpiX();
int dpiy = metrics.logicalDpiY();
const int margin = 72; // pt
QRect body(margin*d... | false | false | false | false | false | 0 |
arg_int_value(struct cmd_context *cmd, int a, const int32_t def)
{
return (_cmdline.arg_props[a].flags & ARG_GROUPABLE) ?
first_grouped_arg_int_value(cmd, a, def) : (arg_count(cmd, a) ? cmd->arg_values[a].i_value : def);
} | false | false | false | false | false | 0 |
openfiles(char **fin, char **fout,short verbose){ /* Open files */
#ifndef GXHEPS
int i;
if (*fin==NULL) {
*fin = (char *) malloc(sizeof(char)*150);
fgets(*fin,150,stdin);
printf(" Read infile = %s\n",*fin);
}
if(strcmp(*fin,"-")==0) infile=stdin;
else infile = fopen(*fin ,"rb");
if (infile... | false | false | true | false | true | 1 |
negate() {
if (isInt())
IntVal = 0 - IntVal;
else
getFpVal().changeSign();
} | false | false | false | false | false | 0 |
__iscsi_unbind_session(struct work_struct *work)
{
struct iscsi_cls_session *session =
container_of(work, struct iscsi_cls_session,
unbind_work);
struct Scsi_Host *shost = iscsi_session_to_shost(session);
struct iscsi_cls_host *ihost = shost->shost_data;
unsigned long flags;
unsigned int target_id;
I... | false | false | false | false | false | 0 |
update_titlebar_status(void)
{
unsigned long rawno;
MESSAGECACHE *mc;
COLOR_PAIR *lastc = NULL, *titlecolor;
if(ps_global->ttyo
&& (ps_global->ttyo->screen_rows - FOOTER_ROWS(ps_global)) < 1){
titlebar_is_dirty = 1;
return(0);
}
if(!as.stream || as.current_msg <= 0L || as.del_colu... | false | false | false | false | false | 0 |
snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
struct snd_soc_card *card = dapm->card;
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int reg = mc->reg;
un... | false | false | false | false | false | 0 |
RenderToJackPorts()
{
float coef = 1.f / 32768.f;
for (int port_index = 0; port_index < fNPorts; port_index++) {
if (fPortBuffer[port_index]) {
for (uint frame = 0; frame < fPeriodSize; frame++) {
fPortBuffer[port_index][frame] = float(fIntBuffer[port_... | false | false | false | false | false | 0 |
onCmdGetStringValue(FXObject*,FXSelector,void* ptr){
*((FXString*)ptr)=getText();
return 1;
} | false | false | false | false | false | 0 |
RefreshProperty( wxPGProperty* p )
{
wxPropertyGrid* grid = p->GetGrid();
if ( GetPage(m_selPage)->GetStatePtr() == p->GetParent()->GetParentState() )
grid->RefreshProperty(p);
} | false | false | false | false | false | 0 |
create_maps_plane(gchar* title)
{
GtkWidget *Win;
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *vboxall;
GtkWidget *vboxwin;
GtkWidget *button;
GtkWidget* entry;
if(!gridPlaneForPlanesMapped)
{
Message(_("Grid in plane is not defined "),_("Error"),TRUE);
return;
}
/* Principal Window */
... | false | false | false | false | false | 0 |
fm10k_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
{
struct fm10k_intfc *interface;
unsigned long flags;
interface = container_of(ptp, struct fm10k_intfc, ptp_caps);
write_lock_irqsave(&interface->systime_lock, flags);
interface->ptp_adjust += delta;
write_unlock_irqrestore(&interface->systime_lock, flags... | false | false | false | false | false | 0 |
ask_file_to_server(QString to, QString from, QString file_name)
{
File *file = new File(this);
file->name = file_name;
file->is_upload = false;
file->to = to;
file->from = from;
emit showLabelSignal(tr("Queueing ") + file->name + tr(" into file manager's queue..."));
// If files queue is em... | false | false | false | false | false | 0 |
check_and_run_traps(int sig)
{
/* I want it in rodata, not in bss.
* gcc 4.2.1 puts it in rodata only if it has { 0, 0 }
* initializer. But other compilers may still use bss.
* TODO: find more portable solution.
*/
static const struct timespec zero_timespec = { 0, 0 };
smalluint save_rcode;
int last_sig = 0... | false | false | false | false | false | 0 |
zzn3_timesi2(_MIPD_ zzn3 *u)
{
#ifdef MR_OS_THREADS
miracl *mr_mip=get_mip();
#endif
if (mr_mip->ERNUM) return;
MR_IN(224)
copy(u->a,mr_mip->w1);
nres_premult(_MIPP_ u->b,mr_mip->cnr,u->a);
nres_premult(_MIPP_ u->c,mr_mip->cnr,u->b);
copy(mr_mip->w1,u->c);
MR_OUT
} | false | false | false | false | false | 0 |
slink_remove(void *link)
{
slink_t *remove;
if (!link)
return set_errnull(EINVAL);
remove = link;
return remove->next;
} | false | false | false | false | false | 0 |
isContained ( ItemFiltrationSystem::Category cat, int id )
{
switch ( cat ) {
case Building: return isContained ( buildings, id );
case Vehicle: return isContained ( units, id );
case Object: return isContained ( objects, id );
case Terrain: return isContained ( terrain, id );
case Tech... | false | false | false | false | false | 0 |
dropEvent(QDropEvent* event) {
int toIndex = tabAt(event->pos());
const QMimeData *m = event->mimeData();
if(mimeIsAction(m, "part-reordering")) {
PartsBinPaletteWidget* bin = qobject_cast<PartsBinPaletteWidget*>(m_parent->widget(toIndex));
if(bin && bin->allowsChanges()) {
bin->currentView()->dropEventAu... | false | false | false | false | false | 0 |
init(
StrChooser* chooser, Style* s, StrChooserAction* a
) {
fchooser_ = chooser;
fbrowser_ = nil;
Resource::ref(a);
action_ = a;
style_ = new Style(s);
Resource::ref(style_);
style_->alias("StrChooser");
style_->alias("Dialog");
update_ = new ActionCallback(StrChooserImpl)(
thi... | false | false | false | false | false | 0 |
meta_theme_calc_geometry (MetaTheme *theme,
MetaFrameType type,
int text_height,
MetaFrameFlags flags,
int client_width,
... | false | false | false | false | false | 0 |
find_inheritance_children(Oid parentrelId, LOCKMODE lockmode)
{
List *list = NIL;
Relation relation;
HeapScanDesc scan;
ScanKeyData key[1];
HeapTuple inheritsTuple;
Oid inhrelid;
/*
* Can skip the scan if pg_class shows the relation has never had a
* subclass.
*/
if (!has_subclass(parentrelId))
re... | false | false | false | false | false | 0 |
elm_smart_scroller_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled)
{
API_ENTRY return;
if ((!sd->wheel_disabled) && (disabled))
evas_object_event_callback_del_full(sd->event_obj, EVAS_CALLBACK_MOUSE_WHEEL, _smart_event_wheel, sd);
else if ((sd->wheel_disabled) && (!disabled))
evas_object_eve... | false | false | false | false | false | 0 |
addParams(fxStr& msg, const Class2Params& params)
{
msg.append(fxStr::format("<%s, %s, %s, %s, %s>"
, (params.ln == LN_A4 ? "A4" : params.ln == LN_B4 ? "B4" : "INF")
, params.verticalResName()
, params.dataFormatName()
, params.bitRateName()
, params.scanlineTimeName()
));
} | false | false | false | false | false | 0 |
gf_rect_union(GF_Rect *rc1, GF_Rect *rc2)
{
if (!rc1->width || !rc1->height) {*rc1=*rc2; return;}
if (!rc2->width || !rc2->height) return;
if (rc2->x < rc1->x) { rc1->width += rc1->x - rc2->x; rc1->x = rc2->x; }
if (rc2->x + rc2->width > rc1->x+rc1->width) rc1->width = rc2->x + rc2->width - rc1->x;
if (rc2->y > r... | false | false | false | false | false | 0 |
appendOperator(const string &sequence, bool canBreakLine)
{
if (canBreakLine && isInLineBreak)
breakLine();
formattedLine.append(sequence);
if (maxCodeLength != string::npos)
{
// These compares reduce the frequency of function calls.
if (isOkToSplitFormattedLine())
updateFormattedLineSplitPointsOperator(s... | false | false | false | false | false | 0 |
__i915_gem_object_sync(struct drm_i915_gem_object *obj,
struct intel_engine_cs *to,
struct drm_i915_gem_request *from_req,
struct drm_i915_gem_request **to_req)
{
struct intel_engine_cs *from;
int ret;
from = i915_gem_request_get_ring(from_req);
if (to == from)
return 0;
if (i915_gem... | false | false | false | true | false | 1 |
CDB___crdel_delete_read(recbuf, argpp)
void *recbuf;
__crdel_delete_args **argpp;
{
__crdel_delete_args *argp;
u_int8_t *bp;
int ret;
ret = CDB___os_malloc(sizeof(__crdel_delete_args) +
sizeof(DB_TXN), NULL, &argp);
if (ret != 0)
return (ret);
argp->txnid = (DB_TXN *)&argp[1];
bp = recbuf;
memcpy(&arg... | false | false | false | false | false | 0 |
transfer_get_timeout(int i)
{
char xx[1024];
fclose(dcc[i].u.xfer->f);
if (strcmp(dcc[i].nick, "*users") == 0) {
int x, y = 0;
for (x = 0; x < dcc_total; x++)
if ((!egg_strcasecmp(dcc[x].nick, dcc[i].host)) &&
(dcc[x].type->flags & DCT_BOT))
y = x;
if (y != 0) {
dcc[y].... | false | false | false | false | false | 0 |
cliGameList_deinit(CliGameList *gl) {
int i;
Cgoban *cg;
assert(MAGIC(gl));
cg = gl->data->cg;
for (i = 0; i < gl->maxGames; ++i) {
if (gl->games[i].board) {
cliBoard_destroy(gl->games[i].board, FALSE);
gl->games[i].board = NULL;
}
str_deinit(&gl->games[i].wName);
str_deini... | false | false | false | false | false | 0 |
remember_web_was_spilled (struct web *web)
{
int i;
unsigned int found_size = 0;
int adjust;
web->spill_temp = 1;
/* From now on don't use reg_pref/alt_class (regno) anymore for
this web, but instead usable_regs. We can't use spill_temp for
this, as it might get reset later, when we are coalesced... | false | false | false | false | false | 0 |
parse_job_identifier(const char *id, u_long32 *job_id, u_long32 *ja_task_id)
{
char *copy = NULL;
DENTER(TOP_LAYER, "parse_job_identifier");
copy = strdup(id);
*job_id = atoi(strtok(copy, "."));
*ja_task_id = atoi(strtok(NULL, "."));
FREE(copy);
if(*job_id > 0 && *ja_task_id > 0) {
DRETURN... | false | false | false | false | true | 1 |
IsFormatIdxUsed(int format_code) {
int dateindex;
dateindex=BuiltInDateFormatIdx(format_code);
if (dateindex) {
/* fprintf(stderr,"Date idx %d is dirty\n",dateindex); */
return FormatIdxUsed[dateindex]==1;
}
else return 0;
} | false | false | false | false | true | 1 |
get_insert(Str key)
{
if (hash_.empty())
hash_.assign(8, -1);
int *b = &hash_[bucket(key.data(), key.length())], chain = 0;
while (*b >= 0 && os_[*b].v_.first != key) {
b = &os_[*b].next_;
++chain;
}
if (*b >= 0)
return os_[*b].v_.second;
else {
*b = n_;
if (n_ == capacity_)
grow(fals... | false | false | false | false | false | 0 |
glade_editor_table_realize (GtkWidget * widget)
{
GladeEditorTable *table = GLADE_EDITOR_TABLE (widget);
GList *list;
GladeEditorProperty *property;
GTK_WIDGET_CLASS (glade_editor_table_parent_class)->realize (widget);
/* Sync up properties, even if widget is NULL */
for (list = table->priv->properties; l... | false | false | false | false | false | 0 |
getMidpointRotations(Symmetry* symmetry)
{
SMolecule* mol = &symmetry->molecule;
gint nAtoms = mol->size(mol);
gint i,j, n;
gint degeneracy = symmetry->degeneracy;
Element rot;
int nR = 0;
for(i=0; i<nAtoms-1; i++)
{
SAtom* from = mol->get(mol,i);
Point3D posfrom = from->getPosition(from);
for(j=i+1; j<n... | false | false | false | false | false | 0 |
rcd_serial_reset_req(StonithPlugin * s, int request, const char * host)
{
struct pluginDevice* rcd;
int fd;
int sigbit;
struct itimerval timer;
const char * err;
ERRIFWRONGDEV(s,S_OOPS);
rcd = (struct pluginDevice *) s;
/* check that host matches */
if (strcasecmp(host, rcd->hostlist[0])) {
LOG(PIL_CRIT,... | false | false | false | false | false | 0 |
getIdRingPaths(OBMol &mol)
{
mol.UnsetFlag(OB_LSSR_MOL);
mol.DeleteData("LSSR");
std::vector<OBRing*> lssr = mol.GetLSSR();
std::vector< std::vector<unsigned long> > idPaths;
for (unsigned int i = 0; i < lssr.size(); ++i) {
OBRing *ring = lssr[i];
std::vector<unsigned long> idPath;
for (unsigned... | false | false | false | false | false | 0 |
_gp_coffgen_write_symbols(gp_object_type *object, char *table, FILE *fp)
{
gp_symbol_type *current;
char name[8];
current = object->symbols;
while(current != NULL) {
_gp_coffgen_addname(current->name, name, sizeof(name), table);
gp_fputvar(&name[0], 8, fp);
gp_fputl32(current->value, fp);
i... | false | false | false | false | false | 0 |
Tn_put(CTX ctx, kStmtExpr *stmt, size_t n, int alocal)
{
kTerm *tk = tkNN(stmt, n);
if(TT_(tk) == TT_FVAR) return Term_index(tk);
Tn_asm(ctx, stmt, n, alocal);
return alocal;
} | false | false | false | false | false | 0 |
G_DoPlayDemo(void)
{
skill_t skill;
int i, episode, map;
gameaction = ga_nothing;
demobuffer = demo_p = W_CacheLumpName(defdemoname, PU_STATIC);
skill = *demo_p++;
episode = *demo_p++;
map = *demo_p++;
for (i = 0; i < MAXPLAYERS; i++)
{
playeringame[i] = *demo_p++;
... | false | false | false | false | false | 0 |
forcedeth_link_status ( struct net_device *netdev )
{
struct forcedeth_private *priv = netdev_priv ( netdev );
void *ioaddr = priv->mmio_addr;
/* Clear the MII link change status by reading the MIIStatus register */
readl ( ioaddr + NvRegMIIStatus );
writel ( NVREG_MIISTAT_LINKCHANGE, ioaddr + NvRegMIIStatus );
... | false | false | false | false | false | 0 |
p_string(li_object *args) {
char *str;
int i;
str = li_allocate(li_null, li_length(args)+1, sizeof(char));
for (i = 0; args; i++, args = li_cdr(args)) {
if (!li_is_character(li_car(args))) {
free(str);
li_error("not a character", li_car(args));
}
str[i] =... | false | false | false | false | false | 0 |
display_status_line(void)
{
uint16_t current_room_object;
if (active_interface->is_status_line_available() == false)
return;
current_room_object = get_variable(0x10, false);
if (current_room_object != 0)
(void)zchar_to_z_ucs(
z_ucs_output_buffer,
Z_UCS_OUTPUT_BUFFER_SIZE,
(g... | false | false | false | false | false | 0 |
change_lock_sync(change::pointer cp)
{
if (cp->lock_magic != lock_magic())
change_lock_sync_forced(cp);
} | false | false | false | false | false | 0 |
evas_common_load_image_from_file(const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error)
{
if (!file)
{
*error = EVAS_LOAD_ERROR_GENERIC;
return NULL;
}
return (RGBA_Image *) evas_cache_image_request(eci, file, key, lo, error);
} | false | false | false | false | false | 0 |
ar9002_hw_is_cal_supported(struct ath_hw *ah,
struct ath9k_channel *chan,
enum ar9002_cal_types cal_type)
{
bool supported = false;
switch (ah->supp_cals & cal_type) {
case IQ_MISMATCH_CAL:
supported = true;
break;
case ADC_GAIN_CAL:
case ADC_DC_CAL:
/* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 on... | false | false | false | false | false | 0 |
check_constrained_delegation(krb5_context context,
krb5_kdc_configuration *config,
HDB *clientdb,
hdb_entry_ex *client,
hdb_entry_ex *server,
krb5_const_principal target)
{
const HDB_Ext_Constrained_delegation_acl *acl;
krb5_error_code ret;
size_t i;
/*
* co... | false | false | false | false | false | 0 |
rk808_rtc_readtime(struct device *dev, struct rtc_time *tm)
{
struct rk808_rtc *rk808_rtc = dev_get_drvdata(dev);
struct rk808 *rk808 = rk808_rtc->rk808;
u8 rtc_data[NUM_TIME_REGS];
int ret;
/* Force an update of the shadowed registers right now */
ret = regmap_update_bits(rk808->regmap, RK808_RTC_CTRL_REG,
... | false | false | false | false | false | 0 |
free_command_opts(struct command *cmd) {
struct command_opt *next;
next = cmd->opt;
while (next != NULL) {
struct command_opt *del = next;
next = del->next;
free(del);
}
cmd->opt = NULL;
} | false | false | false | false | false | 0 |
update_info (ActUser *user)
{
g_assert (G_IS_DBUS_PROXY (user->object_proxy));
if (user->get_all_call != NULL) {
g_cancellable_cancel (user->get_all_call);
g_object_unref (user->get_all_call);
}
user->get_all_call = g_cancellable_new ();
g_dbus_p... | false | false | false | false | false | 0 |
dc_parser_samples_foreach (dc_parser_t *parser, dc_sample_callback_t callback, void *userdata)
{
if (parser == NULL)
return DC_STATUS_UNSUPPORTED;
if (parser->vtable->samples_foreach == NULL)
return DC_STATUS_UNSUPPORTED;
return parser->vtable->samples_foreach (parser, callback, userdata);
} | false | false | false | false | false | 0 |
slaDrange (angle)
double angle;
/*
** - - - - - - - - - -
** s l a D r a n g e
** - - - - - - - - - -
**
** Normalize angle into range +/- pi.
**
** (double precision)
**
** Given:
** angle double the angle in radians
**
** The result is angle expressed in the +/- pi (double precision).
**
** ... | false | false | false | false | false | 0 |
ethr_get_main_thr_status(int *on)
{
ethr_ts_event *tsep = ethr_get_tse__();
if (!tsep)
*on = 0;
else {
if (tsep->iflgs & ETHR_TS_EV_MAIN_THR)
*on = 1;
else
*on = 0;
}
return 0;
} | false | false | false | false | false | 0 |
azx_single_send_cmd(struct hdac_bus *bus, u32 val)
{
struct azx *chip = bus_to_azx(bus);
unsigned int addr = azx_command_addr(val);
int timeout = 50;
bus->last_cmd[azx_command_addr(val)] = val;
while (timeout--) {
/* check ICB busy bit */
if (!((azx_readw(chip, IRS) & AZX_IRS_BUSY))) {
/* Clear IRV valid b... | false | false | false | false | false | 0 |
ClientBeginDeathmatch(edict_t * ent)
{
G_InitEdict(ent);
InitClientResp(ent->client);
//PG BUND - BEGIN
ent->client->resp.team = NOTEAM;
/*client->resp.last_killed_target = NULL;
client->resp.killed_teammates = 0;
client->resp.idletime = 0; - AQ2:TNG Slicer Moved this to InitClientResp */
ResetKills(ent... | false | false | false | false | false | 0 |
rfbAuthNewClient(rfbClientPtr cl)
{
int32_t securityType = rfbSecTypeInvalid;
if (!cl->screen->authPasswdData || cl->reverseConnection) {
/* chk if this condition is valid or not. */
securityType = rfbSecTypeNone;
} else if (cl->screen->authPasswdData) {
securityType = rfbSecTypeVncAuth;
}
... | false | false | false | false | false | 0 |
ber_special_alloc(size_t size, BerElement **ppBer)
{
void *mem = NULL;
/* starts out with a null buffer - will grow as needed */
*ppBer = ber_alloc_t(0);
/* Make sure mem size requested is aligned */
if (0 != ( size & 0x03 )) {
size += (sizeof(ber_int_t) - (size & 0x03));
}
mem = slapi_ch_malloc(size);
re... | false | false | false | false | false | 0 |
parseButtonEvent(FILE *f, unsigned int event, unsigned long int length)
{
char delim = ' ';
byte key = 0;
putchar('\n');
++indent;
print("on");
if (event & IdleToOverUp) {
putchar(delim);
printf("idleToOverUp");
delim = ',';
}
if (event & OverUpToIdle) {
putchar(delim);
printf("ove... | false | false | false | false | false | 0 |
src_int_to_float_array(int const * src, float * dest, int len)
{
assert (src && dest);
while (len--) dest[len] = (float)(src[len] * (1 / (32768. * 65536.)));
} | false | false | false | false | false | 0 |
xmlSecNodeSetAddList(xmlSecNodeSetPtr nset, xmlSecNodeSetPtr newNSet, xmlSecNodeSetOp op) {
xmlSecNodeSetPtr tmp1, tmp2;
xmlSecAssert2(newNSet != NULL, NULL);
tmp1 = xmlSecNodeSetCreate(newNSet->doc, NULL, xmlSecNodeSetList);
if(tmp1 == NULL) {
xmlSecError(XMLSEC_ERRORS_HERE,
... | false | false | false | false | false | 0 |
scriptableExtension( const DOM::NodeImpl *frame) {
const ConstFrameIt end = d->m_objects.constEnd();
for(ConstFrameIt it = d->m_objects.constBegin(); it != end; ++it )
if ((*it)->m_partContainerElement.data() == frame)
return (*it)->m_scriptable.data();
return 0L;
} | false | false | false | false | false | 0 |
insert(int pos0, int pos1, int pos2, QtSoapType *item)
{
if (order != 3) {
qWarning("Attempted to insert item at position (%i, %i, %i)"
" in %i-dimensional QtSoapArray.",
pos0, pos1, pos2, order);
return;
}
if (pos0 < 0 || pos0 >= siz0 || pos1 < 0 || pos1 >= siz1 || pos2 < 0 || pos2 >= siz2) {
qWa... | false | false | false | false | false | 0 |
Scan() {
if (tokens->next == NULL) {
return pt = tokens = NextToken();
} else {
pt = tokens = tokens->next;
return tokens;
}
} | false | false | false | false | false | 0 |
usb_dmac_desc_alloc(struct usb_dmac_chan *chan, unsigned int sg_len,
gfp_t gfp)
{
struct usb_dmac_desc *desc;
unsigned long flags;
desc = kzalloc(sizeof(*desc) + sg_len * sizeof(desc->sg[0]), gfp);
if (!desc)
return -ENOMEM;
desc->sg_allocated_len = sg_len;
INIT_LIST_HEAD(&desc->node);
spin_lock_i... | false | false | false | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.