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 |
|---|---|---|---|---|---|---|
ToggleHeader(int show)
{
/*
* check to see if we need to display the header...
*/
if(show){
UpdateHeader(0); /* figure bounds */
PaintHeader(COMPOSER_TOP_LINE, FALSE); /* draw it */
}
else{
/*
* set bounds for no header display
*/
curwp->w_toprow = Comp... | false | false | false | false | false | 0 |
H5Pget_version(hid_t plist_id, unsigned *super/*out*/, unsigned *freelist/*out*/,
unsigned *stab/*out*/, unsigned *shhdr/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "ixxxx", plist_id, super, fr... | false | false | false | false | false | 0 |
ftrace_write(unsigned long ip, const char *val, int size)
{
ip = text_ip_addr(ip);
if (probe_kernel_write((void *)ip, val, size))
return -EPERM;
return 0;
} | false | false | false | false | false | 0 |
IdentTableInsert(
IdentTable *pTable, /* The table into which we will insert */
const char *zId, /* Name of the identifiers */
int nId /* Length of the identifier name */
){
int h;
Ident *pId;
if( nId<=0 ){
nId = strlen(zId);
}
h = Hash(zId,nId) % IDENT_HASH_SIZE;
... | false | false | false | false | true | 1 |
operator()(const GraphEdge* ge1, const GraphEdge* ge2) const
{
const CanvasEdge* ce1 = ge1->canvasEdge();
const CanvasEdge* ce2 = ge2->canvasEdge();
// sort invisible edges (ie. without matching CanvasEdge) in front
if (!ce1) return true;
if (!ce2) return false;
QPolygon p1 = ce1->controlPoints();
QPol... | false | false | false | false | false | 0 |
smsc_ircc_hard_xmit_sir(struct sk_buff *skb,
struct net_device *dev)
{
struct smsc_ircc_cb *self;
unsigned long flags;
s32 speed;
pr_debug("%s\n", __func__);
IRDA_ASSERT(dev != NULL, return NETDEV_TX_OK;);
self = netdev_priv(dev);
IRDA_ASSERT(self != NULL, return NETDEV_TX_OK;);
netif_stop_queue(dev)... | false | false | false | false | false | 0 |
ReadGoodBacks()
{
UINT32 aGoodIndex;
if (m_NumPasses > 1)
{
aGoodIndex = m_FinderPos % kNumGoodBacks;
m_MatchDistances = m_OnePosMatchesArray[aGoodIndex].MatchDistances;
}
UINT32 aDistanceTmp[kMatchMaxLen + 1];
UINT32 aLen = m_MatchFinder.GetLongestMatch(aDistanceTmp);
for(UINT32 i = kMatchMinLen;... | false | false | false | false | true | 1 |
ahci_stop_fis_rx(struct ata_port *ap)
{
void __iomem *port_mmio = ahci_port_base(ap);
u32 tmp;
/* disable FIS reception */
tmp = readl(port_mmio + PORT_CMD);
tmp &= ~PORT_CMD_FIS_RX;
writel(tmp, port_mmio + PORT_CMD);
/* wait for completion, spec says 500ms, give it 1000 */
tmp = ata_wait_register(ap, port_mm... | false | false | false | false | false | 0 |
search_vomses(std::string path) {
std::vector<std::string> vomses_files;
if(is_file(path)) vomses_files.push_back(path);
else if(is_dir(path)) {
//if the path 'vomses' is a directory, search all of the files under this directory,
//i.e., 'vomses/voA' 'vomses/voB'
std::string path_header = path;
... | false | false | false | false | false | 0 |
BindSocket(int socketdescriptor, int port)
{
#ifndef VTK_SOCKET_FAKE_API
struct sockaddr_in server;
server.sin_family = AF_INET;
server.sin_addr.s_addr = INADDR_ANY;
server.sin_port = htons(port);
// Allow the socket to be bound to an address that is already in use
int opt=1;
int iErr=~vtkSocketErrorRetu... | false | false | false | false | false | 0 |
acpi_data_prop_read_single(struct acpi_device_data *data,
const char *propname,
enum dev_prop_type proptype, void *val)
{
const union acpi_object *obj;
int ret;
if (!val)
return -EINVAL;
if (proptype >= DEV_PROP_U8 && proptype <= DEV_PROP_U64) {
ret = acpi_data_get_property(data, propname,... | false | false | false | false | false | 0 |
ik_delete_pcb(ikpcb* pcb){
ikpage* p = pcb->cached_pages;
pcb->cached_pages = 0;
pcb->uncached_pages = 0;
while(p){
ik_munmap(p->base, pagesize);
p = p->next;
}
ik_munmap(pcb->cached_pages_base, pcb->cached_pages_size);
{
int i;
for(i=0; i<generation_count; i++){
ik_ptr_page* p = pcb... | false | false | false | false | false | 0 |
_getenv(K a) //lfop
{
S u=getenv(CSK(a));
K z; I c;
if(u) {c=strlen(u); U(z=newK(-3,c)) memcpy(kC(z),u,c);} //sic? Apparently you're not supposed to free(u=getenv())
else z=_n();
R z;
} | false | false | false | false | false | 0 |
meta_ui_new (Display *xdisplay,
Screen *screen)
{
GdkDisplay *gdisplay;
MetaUI *ui;
ui = g_new0 (MetaUI, 1);
ui->xdisplay = xdisplay;
ui->xscreen = screen;
gdisplay = gdk_x11_lookup_xdisplay (xdisplay);
g_assert (gdisplay == gdk_display_get_default ());
ui->frames = meta_frames_new (XSc... | false | false | false | false | false | 0 |
getGenreName(FXint id){
FXString name;
try {
GMQuery query(&db,"SELECT name FROM genres WHERE id == ?;");
query.setParameter(0,id);
query.execute();
query.getResult(0,name);
query.reset();
}
catch (FXCompileException &){
return FXString::null;
}
catch (FXExecuteException &){
... | false | false | false | false | false | 0 |
gdl_dock_notify_cb (GObject *object,
GParamSpec *pspec,
gpointer user_data)
{
GdlDock *dock;
gchar* long_name;
g_return_if_fail (object != NULL || GDL_IS_DOCK (object));
g_object_get (object, "long-name", &long_name, NULL);
if (long_name)
{
... | false | false | false | false | false | 0 |
configure()
{
int h;
if (bufW < 1 || bufH < 1)
return;
h = menuBarHeight();
if (isMenuBarVisible())
{
gtk_fixed_move(layout, GTK_WIDGET(menuBar), 0, 0);
if (h > 1)
gtk_widget_set_size_request(GTK_WIDGET(menuBar), width(), h);
gtk_fixed_move(layout, widget, 0, h);
gtk_widget_set_size_request(widg... | false | false | false | false | false | 0 |
tracked_creation (uintptr_t obj, ClassDesc *cd, uint64_t size, BackTrace *bt, uint64_t timestamp)
{
int i;
for (i = 0; i < num_tracked_objects; ++i) {
if (tracked_objects [i] != obj)
continue;
fprintf (outfile, "Object %p created (%s, %llu bytes) at %.3f secs.\n", (void*)obj, cd->name, (unsigned long long) siz... | false | false | false | false | false | 0 |
coda_iscontrol(const char *name, size_t length)
{
return ((CODA_CONTROLLEN == length) &&
(strncmp(name, CODA_CONTROL, CODA_CONTROLLEN) == 0));
} | false | false | false | false | false | 0 |
dy_dupbasis (int dst_basissze, basis_struct **p_dst_basis,
basis_struct *src_basis, int dst_statussze,
flags **p_dst_status, int src_statuslen, flags *src_status)
/*
This routine duplicates the basis and status passed in src_*, leaving a
copy in the basis and status pointed to by dst_*. Note that we're wor... | false | false | false | false | false | 0 |
isc_ratelimiter_setinterval(isc_ratelimiter_t *rl, isc_interval_t *interval) {
isc_result_t result = ISC_R_SUCCESS;
LOCK(&rl->lock);
rl->interval = *interval;
/*
* If the timer is currently running, change its rate.
*/
if (rl->state == isc_ratelimiter_ratelimited) {
result = isc_timer_reset(rl->timer, isc_ti... | false | false | false | false | false | 0 |
receive_notice (const std::string msg)
{
for (std::list<boost::shared_ptr<Ekiga::ChatObserver> >::iterator iter = observers.begin ();
iter != observers.end ();
++iter)
(*iter)->notice (msg);
} | false | false | false | false | false | 0 |
CreateLayer( const char * pszLayerName,
OGRSpatialReference *poSRS,
OGRwkbGeometryType eType,
char ** papszOptions )
{
/* -------------------------------------------------------------------- */
/* Verify we are in upda... | false | false | false | false | false | 0 |
LoadEventScripts()
{
LoadScripts(sEventScripts, "dbscripts_on_event");
std::set<uint32> eventIds; // Store possible event ids
CollectPossibleEventIds(eventIds);
// Then check if all scripts are in above list of possible script entries
for (ScriptMapMap::const_iterator ... | false | false | false | false | false | 0 |
lpfc_mbx_cmpl_local_config_link(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
{
struct lpfc_vport *vport = pmb->vport;
if (pmb->u.mb.mbxStatus)
goto out;
mempool_free(pmb, phba->mbox_mem_pool);
/* don't perform discovery for SLI4 loopback diagnostic test */
if ((phba->sli_rev == LPFC_SLI_REV4) &&
!(phba->hba... | false | false | false | false | false | 0 |
GameDescription(GameMode_t mode, GameMission_t mission)
{
switch (mission)
{
case doom:
if (mode == shareware)
return "swdoom";
else if (mode == registered)
return "regdoom";
else if (mode == retail)
return "ultdoom";
... | false | false | false | false | false | 0 |
fpi_imgdev_image_captured(struct fp_img_dev *imgdev, struct fp_img *img)
{
struct fp_print_data *print;
int r;
fp_dbg("");
if (imgdev->action_state != IMG_ACQUIRE_STATE_AWAIT_IMAGE) {
fp_dbg("ignoring due to current state %d", imgdev->action_state);
return;
}
if (imgdev->action_result) {
fp_dbg("not overw... | false | false | false | false | false | 0 |
idtoname_parse(struct cache_detail *cd, char *buf, int buflen)
{
struct ent ent, *res;
char *buf1, *bp;
int len;
int error = -EINVAL;
if (buf[buflen - 1] != '\n')
return (-EINVAL);
buf[buflen - 1]= '\0';
buf1 = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (buf1 == NULL)
return (-ENOMEM);
memset(&ent, 0, sizeof(en... | false | false | false | false | false | 0 |
dump_points_to_solution (FILE *file, struct pt_solution *pt)
{
if (pt->anything)
fprintf (file, ", points-to anything");
if (pt->nonlocal)
fprintf (file, ", points-to non-local");
if (pt->escaped)
fprintf (file, ", points-to escaped");
if (pt->ipa_escaped)
fprintf (file, ", points-to unit esc... | false | false | false | false | false | 0 |
pool_user_find_new(TDS_POOL * pool)
{
TDS_POOL_USER *puser;
int i;
/* first check for dead users to reuse */
for (i=0; i<pool->max_users; i++) {
puser = (TDS_POOL_USER *) & pool->users[i];
if (!puser->tds)
return puser;
}
/* did we exhaust the number of concurrent users? */
if (pool->max_users >= MAX_PO... | false | false | false | false | false | 0 |
as3935_sensor_sensitivity_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct as3935_state *st = iio_priv(dev_to_iio_dev(dev));
int val, ret;
ret = as3935_read(st, AS3935_AFE_GAIN, &val);
if (ret)
return ret;
val = (val & AS3935_AFE_MASK) >> 1;
return sprintf(buf, "%d\n", val... | false | false | false | false | false | 0 |
set_date (TrackerSparqlCursor *cursor,
gint column,
GrlMedia *media,
GrlKeyID key)
{
const gchar *str = tracker_sparql_cursor_get_string (cursor, column, NULL);
if (key == GRL_METADATA_KEY_CREATION_DATE
|| key == GRL_METADATA_KEY_MODIFICATIO... | false | false | false | false | false | 0 |
menuitem_clone(struct MenuItem *mi)
{
MenuItem *new_mi;
int i;
/* copy everything */
new_mi = (MenuItem *)safemalloc(sizeof(MenuItem));
memcpy(new_mi, mi, sizeof(MenuItem));
/* special treatment for a few parts */
MI_NEXT_ITEM(new_mi) = NULL;
MI_PREV_ITEM(new_mi) = NULL;
MI_WAS_DESELECTED(new_mi) = 0;
if (MI... | false | false | false | false | false | 0 |
test_event(int fd)
{
struct input_event ev[64];
int rd, i;
printf ("Testing events. Please, press CTRL-C to abort.\n");
while (1) {
rd = read(fd, ev, sizeof(ev));
if (rd < (int) sizeof(struct input_event)) {
perror("Error reading event");
return;
}
for (i = 0; i < rd / sizeof(struct input_event); i... | false | true | false | false | true | 1 |
mpd_songDup(mpd_Song * song) {
mpd_Song * ret = mpd_newSong();
if(song->file) ret->file = strdup(song->file);
if(song->artist) ret->artist = strdup(song->artist);
if(song->album) ret->album = strdup(song->album);
if(song->title) ret->title = strdup(song->title);
if(song->track) ret->track = strdup(song->track);
... | false | false | false | false | false | 0 |
handleExit(int code)
{
// qWarning("Got code %d",code);
if ( code>=0 )
return true;
else if ( code <= -100 )
{
switch (code)
{
case e_Fatal:
m_error.setError(e_Fatal, "fatal internal error");
return false;
case e_ExecStackUnderflow:
m_error.setError(e_ExecStackUnderflow, "stack overflow");
... | false | false | false | false | false | 0 |
ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// optional string name = 1;
if (has_name()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->name());
}
// optional .google.protobuf.MessageOptio... | false | false | false | false | false | 0 |
do_errlvl(gpasmVal r,
char *name,
int arity,
struct pnode *parms)
{
struct pnode *p;
state.lst.line.linetype = dir;
if (state.pass == 2) {
for (; parms; parms = TAIL(parms)) {
p = HEAD(parms);
if (p->tag == unop) {
... | false | false | false | false | false | 0 |
wl1273_fm_set_audio(struct wl1273_core *core, unsigned int new_mode)
{
int r = 0;
if (core->mode == WL1273_MODE_OFF ||
core->mode == WL1273_MODE_SUSPENDED)
return -EPERM;
if (core->mode == WL1273_MODE_RX && new_mode == WL1273_AUDIO_DIGITAL) {
r = wl1273_fm_write_cmd(core, WL1273_PCM_MODE_SET,
WL1273_... | false | false | false | false | false | 0 |
lgetenv(var)
char *var;
{
int a;
char *s;
a = cmd_decode(list_var_tables, var, &s);
if (a == EV_OK)
return (s);
s = getenv(var);
if (s != NULL && *s != '\0')
return (s);
a = cmd_decode(list_sysvar_tables, var, &s);
if (a == EV_OK)
return (s);
return (NULL);
} | false | false | false | false | false | 0 |
z8000_get_reg(int regnum)
{
switch( regnum )
{
case REG_PC:
case Z8000_PC: return PC;
case REG_SP:
case Z8000_NSP: return NSP;
case Z8000_FCW: return FCW;
case Z8000_PSAP: return PSAP;
case Z8000_REFRESH: return REFRESH;
case Z8000_IRQ_REQ: return IRQ_REQ;
case Z8000_IRQ_SRV:... | false | false | false | false | false | 0 |
CHECKOBJ<Corpse>(lua_State* L, int narg, bool error)
{
WorldObject* obj = CHECKOBJ<WorldObject>(L, narg, false);
TEST_OBJ(Corpse, obj, error, ToCorpse);
} | false | false | false | false | false | 0 |
attach_scanner (const char *devicename, struct sp15c **devp)
{
struct sp15c *dev;
int sfd;
DBG (15, "attach_scanner: %s\n", devicename);
for (dev = first_dev; dev; dev = dev->next)
{
if (strcmp (dev->sane.name, devicename) == 0)
{
if (devp)
{
*devp = dev;
... | false | false | false | false | false | 0 |
ubi_sysfs_init(struct ubi_device *ubi, int *ref)
{
int err;
ubi->dev.release = dev_release;
ubi->dev.devt = ubi->cdev.dev;
ubi->dev.class = &ubi_class;
ubi->dev.groups = ubi_dev_groups;
dev_set_name(&ubi->dev, UBI_NAME_STR"%d", ubi->ubi_num);
err = device_register(&ubi->dev);
if (err)
return err;
*ref = 1;... | false | false | false | false | false | 0 |
RepairClear(Viewer* viewer, boolean flag) {
if (_clear_to_repair && flag)
viewer->GetDamage()->Repair();
_clear_to_repair = false;
} | false | false | false | false | false | 0 |
tg3_ints_init(struct tg3 *tp)
{
if ((tg3_flag(tp, SUPPORT_MSI) || tg3_flag(tp, SUPPORT_MSIX)) &&
!tg3_flag(tp, TAGGED_STATUS)) {
/* All MSI supporting chips should support tagged
* status. Assert that this is the case.
*/
netdev_warn(tp->dev,
"MSI without TAGGED_STATUS? Not using MSI\n");
goto... | false | false | false | false | false | 0 |
getComponentLength (OOCTXT* pctxt, ASN1UINT itemBits)
{
OOCTXT lctxt;
ASN1UINT len, totalLen = 0;
int stat;
stat = initSubContext (&lctxt, pctxt);
if (stat != ASN_OK) return LOG_ASN1ERR (pctxt, stat);
stat = setPERBufferUsingCtxt (&lctxt, pctxt);
if (stat != ASN_OK) {
freeContext (&lctxt);
... | false | false | false | false | false | 0 |
gs_jpeg_set_colorspace(stream_DCT_state * st,
J_COLOR_SPACE colorspace)
{
if (setjmp(find_jmp_buf(st->data.common->exit_jmpbuf)))
return_error(gs_jpeg_log_error(st));
jpeg_set_colorspace(&st->data.compress->cinfo, colorspace);
return 0;
} | false | false | false | false | false | 0 |
snmp_oidsubtree_compare(const oid * in_name1,
size_t len1, const oid * in_name2, size_t len2)
{
int len = ((len1 < len2) ? len1 : len2);
return (snmp_oid_compare(in_name1, len1, in_name2, len));
} | false | false | false | false | false | 0 |
check_compression_method(guint16 method, guint16 flags)
{
return !(method != 8 && flags & 0x0008);
} | false | false | false | false | false | 0 |
write_new_config(void *_vpninfo, char *buf, int buflen)
{
struct openconnect_info *vpninfo = _vpninfo;
int config_fd;
int err;
config_fd = open(vpninfo->xmlconfig, O_WRONLY|O_TRUNC|O_CREAT, 0644);
if (config_fd < 0) {
err = errno;
fprintf(stderr, _("Failed to open %s for write: %s\n"),
vpninfo->xmlconfig, ... | false | false | false | false | true | 1 |
BlockPasteOver(int clipboard) {
// if there is existing selection, remove it's contents
if (CheckBlock())
{
BlockKill();
}
// paste text from clipboard
if (BlockPaste(clipboard))
{
// go to end of selection
SetPos(BE.Col, BE.Row);
// remove selection
... | false | false | false | false | false | 0 |
popup_delete_item_click_cb(GtkWidget *button, AoTasks *t)
{
AoTasksPrivate *priv = AO_TASKS_GET_PRIVATE(t);
GtkTreeIter iter;
GtkTreeModel *model;
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->tree));
gchar *filename;
gint line, start, end;
GeanyDocument *doc;
if (! gtk_tree_sel... | false | false | false | false | false | 0 |
bitprint(unsigned int st, int nbits) {
static char str[33];
int i, mask;
if (nbits > 32) {
nbits = 32;
}
for (i=0; i<nbits; i++) {
str[i] = '0';
}
str[nbits] = '\0';
mask = 1;
for (i=nbits-1; i>=0; i--) {
if (st & mask) {
str[i] = '1';
}
mask = mask << 1;
}
return str; /* take care to use or cop... | false | false | false | false | false | 0 |
fflush(FILE *stream)
{
#define VT_IOWRAP_THISFUNCNAME fflush
int ret;
uint64_t enter_time;
VT_IOWRAP_INIT_IOFUNC();
VT_IOWRAP_CHECK_TRACING1(ret, stream);
vt_cntl_msg(DBG_IO, stringify(VT_IOWRAP_THISFUNCNAME) ": %i",
stream != NULL ? fileno(stream) : -1);
... | false | false | false | false | false | 0 |
resetTrainingStatus()
{
if (!m_trainingLineCore || m_lines.length() == 0)
return;
m_trainingLineCore->reset();
m_currentLine = 0;
m_trainingLineCore->setReferenceLine(m_lines[0]);
} | false | false | false | false | false | 0 |
glade_gtk_notebook_insert_children (GtkWidget *notebook, NotebookChildren *nchildren)
{
gint i;
/*********************************************************
INSERT PAGES
*********************************************************/
for (i = 0; i < nchildren->pages; i++)
{
GtkWidget ... | false | false | false | false | false | 0 |
gsb_file_save_currency_link_part ( gulong iterator,
gulong *length_calculated,
gchar **file_content )
{
GSList *list_tmp;
list_tmp = gsb_data_currency_link_get_currency_link_list ();
while ( list_tmp )
{
gchar *new_string;
gint link_number;
g... | false | false | false | false | false | 0 |
process_gopt(struct fuse_opt_context *ctx, const char *arg, int iso)
{
unsigned sep;
const struct fuse_opt *opt = find_opt(ctx->opt, arg, &sep);
if (opt) {
for (; opt; opt = find_opt(opt + 1, arg, &sep)) {
int res;
if (sep && opt->template_opt[sep] == ' ' && !arg[sep])
... | false | false | false | false | false | 0 |
printStackMap() const {
object::SectionRef StackMapSection;
for (auto Sec : Obj->sections()) {
StringRef Name;
Sec.getName(Name);
if (Name == "__llvm_stackmaps") {
StackMapSection = Sec;
break;
}
}
if (StackMapSection == object::SectionRef())
return;
StringRef StackMapContent... | false | false | false | false | false | 0 |
DecrTupleDescRefCount(TupleDesc tupdesc)
{
Assert(tupdesc->tdrefcount > 0);
ResourceOwnerForgetTupleDesc(CurrentResourceOwner, tupdesc);
if (--tupdesc->tdrefcount == 0)
FreeTupleDesc(tupdesc);
} | false | false | false | false | false | 0 |
detab( char *line )
{
static char temp[ BUFSIZ ];
register char *s, *d;
int col;
col = 0; s = line; d = temp;
while ( *s )
if ( *s != '\t' )
*d++ = *s++, col++;
else
{
do {
*d++ = ' ';
col++;
} wh... | false | false | false | false | false | 0 |
rb_cvar_get(VALUE klass, ID id)
{
VALUE tmp, front = 0, target = 0;
st_data_t value;
tmp = klass;
CVAR_LOOKUP(&value, {if (!front) front = klass; target = klass;});
if (!target) {
rb_name_error(id,"uninitialized class variable %s in %s",
rb_id2name(id), rb_class2name(tmp));
}
if (f... | false | false | false | false | false | 0 |
WriteEffectCode(FCDObject* object, xmlNode* parentNode)
{
FCDEffectCode* effectCode = (FCDEffectCode*)object;
// Place the new element at the correct position in the XML.
// This is necessary for FX profiles.
xmlNode* includeAtNode = NULL;
for (xmlNode* n = parentNode->children; n != NULL; n = n->next)
{... | false | false | false | false | false | 0 |
skge_link_down(struct skge_port *skge)
{
skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_OFF);
netdev_link_down(skge->netdev);
DBG2(PFX "%s: Link is down.\n", skge->netdev->name);
} | false | false | false | false | false | 0 |
up(void)
{
myRobot->move(myDistance);
if (myInHeadingMode)
{
myInHeadingMode = false;
myHeading = myRobot->getTh();
}
} | false | false | false | false | false | 0 |
lastunlimited(Dimset* dimset)
{
int i,index;
for(index=-1,i=0;i<dimset->ndims;i++) {
Symbol* dim = dimset->dimsyms[i];
if(dim->dim.declsize == NC_UNLIMITED) index = i;
}
return index;
} | false | false | false | false | false | 0 |
adpt_show_info(struct seq_file *m, struct Scsi_Host *host)
{
struct adpt_device* d;
int id;
int chan;
adpt_hba* pHba;
int unit;
// Find HBA (host bus adapter) we are looking for
mutex_lock(&adpt_configuration_lock);
for (pHba = hba_chain; pHba; pHba = pHba->next) {
if (pHba->host == host) {
break; /* foun... | false | false | false | false | false | 0 |
sbrGetChannelPairElement (HANDLE_SBR_HEADER_DATA hHeaderData, /*!< Static control data */
HANDLE_SBR_FRAME_DATA hFrameDataLeft, /*!< Dynamic control data for first channel */
HANDLE_SBR_FRAME_DATA hFrameDataRight,/*!< Dynamic control data for second channel */
... | false | false | false | false | false | 0 |
init_backend (MonoBackend *backend)
{
#ifdef MONO_ARCH_NEED_GOT_VAR
backend->need_got_var = 1;
#endif
#ifdef MONO_ARCH_HAVE_CARD_TABLE_WBARRIER
backend->have_card_table_wb = 1;
#endif
#ifdef MONO_ARCH_HAVE_OP_GENERIC_CLASS_INIT
backend->have_op_generic_class_init = 1;
#endif
#ifdef MONO_ARCH_EMULATE_MUL_DIV
backend... | false | false | false | false | false | 0 |
ath10k_wmi_op_pull_peer_kick_ev(struct ath10k *ar, struct sk_buff *skb,
struct wmi_peer_kick_ev_arg *arg)
{
struct wmi_peer_sta_kickout_event *ev = (void *)skb->data;
if (skb->len < sizeof(*ev))
return -EPROTO;
skb_pull(skb, sizeof(*ev));
arg->mac_addr = ev->peer_macaddr.addr;
return 0;
} | false | false | false | false | false | 0 |
closeTimedoutClients(void) {
redisClient *c;
listNode *ln;
time_t now = time(NULL);
listRewind(server.clients);
while ((ln = listYield(server.clients)) != NULL) {
c = listNodeValue(ln);
if (server.maxidletime &&
!(c->flags & REDIS_SLAVE) && /* no timeout for slaves */... | false | false | false | false | false | 0 |
delete_entry(const char *entry) {
awt_assert(!parse_error);
mapping->cmap.erase(entry);
} | false | false | false | false | false | 0 |
slurpstring(void)
{
int got_one = 0;
char *sb = stringbase;
char *ap = argbase;
char *tmp = argbase; /* will return this if token found */
if (*sb == '!' || *sb == '$') { /* recognize ! as a token for shell */
switch (slrflag) { /* and $ as token for macro invoke */
case 0:
slrflag++;
stringbase++;
... | false | false | false | false | false | 0 |
search_separator(const char **ip, const char *ipe, const char *item, int direction)
{ uint slen = 0;
for (slen = 0; (*ip - ipe) * direction < 0; (*ip) += direction)
if((slen = gs_file_name_check_separator(*ip, ipe - *ip, item)) != 0)
break;
return slen;
} | false | false | false | false | false | 0 |
atl2_init_flash_opcode(struct atl2_hw *hw)
{
if (hw->flash_vendor >= ARRAY_SIZE(flash_table))
hw->flash_vendor = 0; /* ATMEL */
/* Init OP table */
ATL2_WRITE_REGB(hw, REG_SPI_FLASH_OP_PROGRAM,
flash_table[hw->flash_vendor].cmdPROGRAM);
ATL2_WRITE_REGB(hw, REG_SPI_FLASH_OP_SC_ERASE,
flash_table[hw->flash_ven... | false | false | false | false | false | 0 |
ExpandBSWAP(SDValue Op) {
EVT VT = Op.getValueType();
// Generate a byte wise shuffle mask for the BSWAP.
SmallVector<int, 16> ShuffleMask;
int ScalarSizeInBytes = VT.getScalarSizeInBits() / 8;
for (int I = 0, E = VT.getVectorNumElements(); I != E; ++I)
for (int J = ScalarSizeInBytes - 1; J >= 0; --J)
... | false | false | false | false | false | 0 |
floor_item_increase(int item, int num)
{
object_type *o_ptr = &o_list[item];
/* Apply */
num += o_ptr->number;
/* Bounds check */
if (num > 255) num = 255;
else if (num < 0) num = 0;
/* Un-apply */
num -= o_ptr->number;
/* Change the number */
o_ptr->number += num;
} | false | false | false | false | false | 0 |
gnumeric_getenv (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
char const *var = value_peek_string (argv[0]);
char const *val = getenv (var);
if (val)
return value_new_string (val);
else
return value_new_error_NA (ei->pos);
} | false | false | false | false | false | 0 |
jumpToEndOfLine()
{
QList<int> selection = selection_.getLines();
// Search the longest line in the selection
int max_length = 0;
foreach ( int line, selection ) {
int length = logData->getLineLength( line );
if ( length > max_length )
max_length = length;
}
horizon... | false | false | false | false | false | 0 |
isOverlappingCond(const Token * const cond1, const Token * const cond2, const std::set<std::string> &constFunctions)
{
if (!cond1 || !cond2)
return false;
// same expressions
if (isSameExpression(cond1,cond2,constFunctions))
return true;
// bitwise overlap for example 'x&7' and 'x==1'
... | false | false | false | false | false | 0 |
event_cache_remove_old(void)
{
event_cache_iterate(pdata) {
if (pdata->turn + game.server.event_cache.turns <= game.info.turn) {
event_cache_data_destroy(pdata);
}
} event_cache_iterate_end;
} | false | false | false | false | false | 0 |
GenerateMoc(const std::string& sourceFile,
const std::string& mocFileName)
{
const std::string mocFilePath = this->Builddir + mocFileName;
int sourceNewerThanMoc = 0;
bool success = cmsys::SystemTools::FileTimeCompare(sourceFile.c_str(),
... | false | false | false | false | false | 0 |
_back_crypt_crypto_op_value(attrcrypt_state_private *state_priv,
Slapi_Value *invalue, Slapi_Value **outvalue,
int encrypt)
{
int ret = -1;
char *in_data = NULL;
size_t in_size = 0;
char *out_data = NULL;
size_t out_size = 0;
struct berval ... | false | false | false | false | false | 0 |
gst_app_src_start (GstBaseSrc * bsrc)
{
GstAppSrc *appsrc = GST_APP_SRC_CAST (bsrc);
GstAppSrcPrivate *priv = appsrc->priv;
g_mutex_lock (&priv->mutex);
GST_DEBUG_OBJECT (appsrc, "starting");
priv->new_caps = FALSE;
priv->started = TRUE;
/* set the offset to -1 so that we always do a first seek. This is ... | false | false | false | false | false | 0 |
icmLuMonoBwd_curve (
icmLuMono *p, /* This */
double *out, /* Output value */
double *in /* Input value */
) {
icc *icp = p->icp;
int rv = 0;
/* Convert to device value through curve */
if ((rv = p->grayCurve->lookup_bwd(p->grayCurve,&out[0],&in[0])) > 1) {
sprintf(icp->err,"icc_lookup: Curve->lookup_bwd() f... | false | true | false | false | false | 1 |
VCLI_ReadResult(int fd, unsigned *status, char **ptr, double tmo)
{
char res[CLI_LINE0_LEN]; /* For NUL */
int i, j;
unsigned u, v, s;
char *p = NULL;
const char *err = "CLI communication error (hdr)";
if (status == NULL)
status = &s;
if (ptr != NULL)
*ptr = NULL;
do {
i = read_tmo(fd, res, CLI_LINE0_LEN... | false | false | false | false | true | 1 |
getNormFunc(
icc *icp,
// icProfileClassSignature psig, /* Profile signature to use */
icColorSpaceSignature csig, /* Colorspace to use. */
// int lutin, /* 0 if this is for a icSigLut16Type input, nz for output */
// icTagSignature tagSig, /* Tag signature involved (AtoB or B2A e... | false | false | false | false | false | 0 |
mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const {
const FXint SURROGATE_OFFSET=0x10000-(0xD800<<10)-0xDC00;
register const FXuchar *s=(const FXuchar*)src;
register FXwchar w;
if(nsrc<2) return -2;
wc=(s[0]<<8)|s[1];
if(wc==0xFEFF){
if(nsrc<4) return -4;
wc=(s[2]<<8)|s[3];
if(0xD800<=wc && ... | false | false | false | false | false | 0 |
clear_error_str(const char ***error_str)
{
if (NULL == *error_str) {
static const char *error_dummy;
*error_str = &error_dummy;
}
**error_str = NULL;
} | false | false | false | false | false | 0 |
plugin_db_file_get_db_file_by_name ( GWDBContext *context, GWDBFilePK ref, gchar *name) {
GWDBFile* file = NULL, *file_match = NULL;
GNode *folder = ref;
gint i = 0, nb = 0;
if ( context != NULL ) {
nb = g_node_n_children ( folder);
for ( i = 0; i < nb && file_match == NULL; i++ ) {
file = g_node_nth_child... | false | false | false | false | false | 0 |
sd_init_controls(struct gspca_dev *gspca_dev)
{
struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
gspca_dev->vdev.ctrl_handler = hdl;
v4l2_ctrl_handler_init(hdl, 3);
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
V4L2_CID_BRIGHTNESS, 0, 255, 1, 127);
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
V4L2_CID_CONTRAST, 0, ... | false | false | false | false | false | 0 |
clearAndDeleteChildRanges( )
{
// FIXME: Probably more efficient to prevent them from unlinking themselves?
foreach (SmartRange* r, m_childRanges)
r->removeText();
qDeleteAll(m_childRanges);
// i.e. this is probably already clear
m_childRanges.clear();
} | false | false | false | false | false | 0 |
homedir(void)
{
char *home;
home = GetEnv("CURL_HOME", FALSE);
if(home)
return home;
home = GetEnv("HOME", FALSE);
if(home)
return home;
#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
{
struct passwd *pw = getpwuid(geteuid());
if(pw) {
home = pw->pw_dir;
if(home && home[0])
... | false | false | false | false | false | 0 |
color_list_new_color_object(struct ColorList* color_list, Color* color){
struct dynvHandlerMap* handler_map;
if (color_list->params){
handler_map=dynv_system_get_handler_map(color_list->params);
}else{
handler_map=NULL;
}
struct ColorObject *color_object=color_object_new(handler_map);
if (handler_map) dynv_ha... | false | false | false | false | false | 0 |
random_last_name()
{
std::string lastname;
std::ifstream fin;
fin.open("data/NAMES_LAST");
if (!fin.is_open()) {
debugmsg("Could not open npc last names list (NAMES_LAST)");
return "";
}
int line = rng(1, 100); // TODO: Shouldn't assume 100 last names.
char buff[256];
for (int i = 0; i < line; i++)
fin.ge... | false | false | false | false | true | 1 |
R_DrawPlanes (void)
{
visplane_t* pl;
int light;
int x;
int stop;
int angle;
int lumpnum;
#ifdef RANGECHECK
if (ds_p - drawsegs > MAXDRAWSEGS)
I_Error ("R_DrawPlanes: drawsegs overflow (%i)",
ds_p - drawsegs);
if (lastvisplane - visplanes > MAXVISPL... | false | false | false | false | false | 0 |
sol_ipv6(void)
{
g_assert(sol_got);
return sol_ipv6_cached;
} | false | false | false | false | false | 0 |
coff_canonicalize_symtab (bfd *abfd, asymbol **alocation)
{
unsigned int counter;
coff_symbol_type *symbase;
coff_symbol_type **location = (coff_symbol_type **) alocation;
if (!bfd_coff_slurp_symbol_table (abfd))
return -1;
symbase = obj_symbols (abfd);
counter = bfd_get_symcount (abfd);
while (coun... | false | true | false | false | false | 1 |
EmitDarwinBCHeader(BitstreamWriter &Stream, const Triple &TT) {
unsigned CPUType = ~0U;
// Match x86_64-*, i[3-9]86-*, powerpc-*, powerpc64-*, arm-*, thumb-*,
// armv[0-9]-*, thumbv[0-9]-*, armv5te-*, or armv6t2-*. The CPUType is a magic
// number from /usr/include/mach/machine.h. It is ok to reproduce the
... | 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.