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 |
|---|---|---|---|---|---|---|
Freturn()
{
if((*brkbindPtr = *argStkPtr) == breaksym)
*brkmodePtr = errsym;
else {
*brkmodePtr = retsym;
}
return(breaksym);
} | false | false | false | false | false | 0 |
my_gettext (const char *src)
{
if (!src)
return "";
if (*src != '~')
return src;
src = dgettext (xml_domain ? : PACKAGE".theme", src + 1);
return src + (*src == '~');
} | false | false | false | false | false | 0 |
exo_icon_view_accessible_model_row_inserted (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer user_data)
{
ExoIconViewAccessiblePrivate *priv;
ExoIconV... | false | false | false | false | false | 0 |
AddCMP0018Flags(std::string &flags, cmTarget* target,
std::string const& lang,
const char *config)
{
int targetType = target->GetType();
bool shared = ((targetType == cmTarget::SHARED_LIBRARY) ||
(targetType == cmTarget... | false | false | false | false | false | 0 |
dw2_build_landing_pads (void)
{
int i;
eh_landing_pad lp;
int e_flags = EDGE_FALLTHRU;
/* If we're going to partition blocks, we need to be able to add
new landing pads later, which means that we need to hold on to
the post-landing-pad block. Prevent it from being merged away.
We'll remove this... | false | false | false | false | false | 0 |
PrintFstInfo(const FstClass &f, bool test_properties,
const string &arc_filter, const string &info_type,
bool pipe, bool verify) {
InfoArgs args(f, test_properties, arc_filter, info_type, pipe, verify);
Apply<Operation<InfoArgs> >("PrintFstInfo", f.ArcType(), &args);
} | false | false | false | false | false | 0 |
HpmfwupgFinishFirmwareUpload(struct ipmi_intf *intf,
struct HpmfwupgFinishFirmwareUploadCtx *pCtx,
struct HpmfwupgUpgradeCtx *pFwupgCtx, int option)
{
int rc = HPMFWUPG_SUCCESS;
struct ipmi_rs *rsp;
struct ipmi_rq req;
pCtx->req.picmgId = HPMFWUPG_PICMG_IDENTIFIER;
memset(&req, 0, sizeof(req));
req.msg.netfn ... | false | false | false | false | false | 0 |
XAP_makeGtkComboBoxText(GtkComboBox * combo, GType secondary)
{
GtkListStore * store;
if (secondary != G_TYPE_NONE) {
store = gtk_list_store_new(2, G_TYPE_STRING, secondary);
}
else {
store = gtk_list_store_new(1, G_TYPE_STRING);
}
gtk_combo_box_set_model(combo, GTK_TREE_MODEL(store));
gtk_cell_layout_clea... | false | false | false | false | false | 0 |
ExecutorStart(QueryDesc *queryDesc, int eflags, char relOrMat)
{
printf("execMain.c 125: ExecutorStart called\n");
if (ExecutorStart_hook)
(*ExecutorStart_hook) (queryDesc, eflags);
else
standard_ExecutorStart(queryDesc, eflags, relOrMat);
} | false | false | false | false | false | 0 |
dsvec_is_equiv(Dsvec *dsv_a, Dsvec *dsv_b,
int (*compar)(const void *, const void *))
{
if (dsvec_len(dsv_a) == dsvec_len(dsv_b)
&& dsvec_is_subset(dsv_a, dsv_b, compar))
return(1);
return(0);
} | false | false | false | false | false | 0 |
persistentOutput(PersistentOStream & os) const {
os << lxGrid_ << lqqGrid_ << pdfTable_
<< PDFFit_ << nxPoints_ << nqPoints_
<< rootName_ << boundary_;
} | false | false | false | false | false | 0 |
mp_add_d(const mp_int *a, mp_digit d, mp_int *b)
{
mp_int tmp;
mp_err res;
ARGCHK(a != NULL && b != NULL, MP_BADARG);
if((res = mp_init_copy(&tmp, a)) != MP_OKAY)
return res;
if(SIGN(&tmp) == ZPOS) {
if((res = s_mp_add_d(&tmp, d)) != MP_OKAY)
goto CLEANUP;
} else if(s_mp_cmp_d(&tmp, d) ... | false | false | false | false | false | 0 |
make_directory (const char *path)
{
struct stat statbuf;
if (stat (path, &statbuf)) {
if (errno == ENOENT) {
int mode;
if (getenv ("JACK_PROMISCUOUS_SERVER")) {
mode = 0777;
} else {
mode = 0700;
}
if (mkdir (path, mode) < 0){
jack_error ("cannot create %s directory (%s)\n",
... | false | false | false | false | false | 0 |
posix_mkdir(PyObject *self, PyObject *args, PyObject *kwargs)
{
path_t path;
int mode = 0777;
int dir_fd = DEFAULT_DIR_FD;
static char *keywords[] = {"path", "mode", "dir_fd", NULL};
PyObject *return_value = NULL;
int result;
memset(&path, 0, sizeof(path));
path.function_name = "mkdir";... | false | false | false | false | false | 0 |
strip_line (gchar * line, lookup_data * data)
{
gint count;
gchar priority[128], host_mx[128];
line = g_strdelimit (line, "\t\t", '\t');
count = sscanf (line, LOOKUP_FORMAT_MX, data->source, &(data)->ttl,
data->addr_type, priority, host_mx);
if (count == LOOKUP_NUM_ARGS) {
g_sprintf (data->recor... | false | false | false | false | false | 0 |
load_file(const char *n) {
if (img) {
img->release();
img = 0L;
}
if (fl_filename_isdir(n)) {
b->label("@fileopen"); // show a generic folder
b->labelsize(64);
b->labelcolor(FL_LIGHT2);
b->image(0);
b->redraw();
return;
}
img = Fl_Shared_Image::get(n);
if (!img) {
b->labe... | false | false | false | false | false | 0 |
vlv_write_infoframe(struct drm_encoder *encoder,
enum hdmi_infoframe_type type,
const void *frame, ssize_t len)
{
const uint32_t *data = frame;
struct drm_device *dev = encoder->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
i915_reg... | false | false | false | false | false | 0 |
drbd_recv(struct drbd_connection *connection, void *buf, size_t size)
{
int rv;
rv = drbd_recv_short(connection->data.socket, buf, size, 0);
if (rv < 0) {
if (rv == -ECONNRESET)
drbd_info(connection, "sock was reset by peer\n");
else if (rv != -ERESTARTSYS)
drbd_err(connection, "sock_recvmsg returned %d\... | false | false | false | false | false | 0 |
get_buffered_cstring(void)
{
string_t *str = new_string();
str->size = cbufidx;
str->type = str_char;
str->str.cstr = xmalloc(cbufidx+1);
memcpy(str->str.cstr, cbuffer, cbufidx);
str->str.cstr[cbufidx] = '\0';
if (!current_codepage || current_codepage == -1 || !win32) /* store as ANSI str... | false | false | false | false | false | 0 |
__smq_set_clear_dirty(struct smq_policy *mq, dm_oblock_t oblock, bool set)
{
struct entry *e;
e = h_lookup(&mq->table, oblock);
BUG_ON(!e);
del(mq, e);
e->dirty = set;
push(mq, e);
} | false | false | false | false | false | 0 |
Close()
{
#if MRPT_HAS_FTDI
ftdi_context *ctx = static_cast<ftdi_context *>(m_ftdi_context);
if (ctx->usb_dev)
{
ftdi_usb_close( ctx );
ctx->usb_dev = NULL;
}
// To assure this is as a "reset", re-init the ftdi context again:
ftdi_deinit( ctx );
ftdi_init( ctx );
m_readBuffer.clear();
#endif
} | false | false | false | false | false | 0 |
save_macro FCN((cmd,t))
CONST outer_char HUGE*cmd C0("Name of the ``at'' command to put first.")
outer_char HUGE*t C1("Text of the definition.")
{
eight_bits HUGE*p;
boolean replace_equals= BOOLEAN(STRCMP(cmd,"m")==0);
if(program==weave)return;
p= mp;
*mp++= '@';
while(*cmd)
*mp++= *cmd++;
*mp++= ' ';
while(*t)... | false | false | false | false | false | 0 |
open_sbuf( void )
{
isbinary_ = newline_added_ = false;
sfp = tmpfile();
if( !sfp )
{
show_strerror( 0, errno );
set_error_msg( "Cannot open temp file" );
return false;
}
return true;
} | false | false | false | false | true | 1 |
sreadHeaderPnm(const l_uint8 *cdata,
size_t size,
l_int32 *pw,
l_int32 *ph,
l_int32 *pd,
l_int32 *ptype,
l_int32 *pbps,
l_int32 *pspp)
{
l_int32 ret;
FILE *fp;... | false | false | false | false | false | 0 |
operator=(const wxFunctionParser& cpy)
{
*m_functionParser = *cpy.GetFunctionParser();
m_function = cpy.GetFunctionString();
m_variables = cpy.GetVariableString();
m_ok = cpy.Ok();
return *this;
} | false | false | false | false | false | 0 |
FScreenConfigureSLSSize(int width, int height)
{
unsigned long scr = DefaultScreen(disp);
int w = DisplayWidth(disp, scr);
int h = DisplayHeight(disp, scr);
if (width <= 1)
{
width = 1;
}
else if (width > w)
{
width = w;
}
if (height <= 1)
{
height = 1;
}
else if (height > h)
{
height = h;
}
if... | false | false | false | false | false | 0 |
tp_properties_mixin_finalize (GObject *obj)
{
TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj);
TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS (
G_OBJECT_GET_CLASS (obj));
TpPropertiesContext *ctx = &mixin->priv->context;
guint i;
for (i = 0; i <... | false | false | false | false | false | 0 |
CommandShowDice(char *UNUSED(sz))
{
if (ms.gs != GAME_PLAYING) {
outputl(_("The dice will not be rolled until a game is started."));
return;
}
if (ms.anDice[0] < 1)
outputf(_("%s has not yet rolled the dice.\n"), ap[ms.fMove].szName);
else
outputf(_("%s has rolled %d a... | false | false | false | false | false | 0 |
HCPencode_header(uint8 *p, comp_model_t model_type, model_info * m_info,
comp_coder_t coder_type, comp_info * c_info)
{
CONSTR(FUNC, "HCPencode_header"); /* for HERROR */
int32 ret_value=SUCCEED;
/* clear error stack and validate args */
HEclear();
if (p==NULL || m_info==NULL || c_i... | false | false | false | false | false | 0 |
exo_icon_chooser_model_get_iter (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreePath *path)
{
ExoIconChooserModel *model = EXO_ICON_CHOOSER_MODEL (tree_model);
GList *lp;
_exo_return_val_if_fail (EXO_IS_ICON_CHOOSER_MODEL (mod... | false | false | false | false | false | 0 |
fpga_find_iob(struct fpga_model* model, const char* sitename,
int* y, int* x, dev_type_idx_t* idx)
{
const char* name;
int i;
RC_CHECK(model);
for (i = 0; (name = fpga_enum_iob(model, i, y, x, idx)); i++) {
if (!strcmp(name, sitename))
return 0;
}
return -1;
} | false | false | false | false | false | 0 |
ajStrTrimStartC(AjPStr* Pstr, const char* txt)
{
AjPStr thys;
const char* cp;
size_t i;
if(!*Pstr)
*Pstr = ajStrNewResLenC("", 1, 0);
else if((*Pstr)->Use > 1)
ajStrGetuniqueStr(Pstr);
thys = *Pstr;
if(!thys->Len)
return ajFalse;
cp = thys->Ptr;
i = 0;
while... | false | false | false | false | false | 0 |
operator<< ( ostream& os, const vector<waStruct>& V ){
for ( size_t i=0; i < V.size(); ++i )
os << V[i];
return os;
} | false | false | false | false | false | 0 |
pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value)
{
int r;
if (pdev->type < 730)
return 0;
on_value /= 100;
off_value /= 100;
if (on_value < 0)
on_value = 0;
if (on_value > 0xff)
on_value = 0xff;
if (off_value < 0)
off_value = 0;
if (off_value > 0xff)
off_value = 0xff;
pdev->ctrl_b... | false | false | false | false | false | 0 |
ck_epoch_synchronize(struct ck_epoch_record *record)
{
struct ck_epoch *global = record->global;
struct ck_epoch_record *cr;
unsigned int delta, epoch, goal, i;
bool active;
/*
* Technically, we are vulnerable to an overflow in presence of
* multiple writers. Realistically, this will require 2^32 scans. You
... | false | false | false | false | false | 0 |
image_extract_subimage(void *ptr, struct image_tool_params *params)
{
const image_header_t *hdr = (const image_header_t *)ptr;
ulong file_data;
ulong file_len;
if (image_check_type(hdr, IH_TYPE_MULTI)) {
ulong idx = params->pflag;
ulong count;
/* get the number of data files present in the image */
count ... | false | false | false | false | false | 0 |
gt_firstcodes_accumulatecounts_flush(void *data)
{
GtFirstcodesinfo *fci = (GtFirstcodesinfo *) data;
if (fci->buf.nextfree > 0)
{
unsigned long foundindex, foundcode;
gt_assert(fci->allfirstcodes != NULL);
fci->codebuffer_total += fci->buf.nextfree;
gt_radixsort_inplace_sort(fci->radixsort_code... | false | false | false | false | false | 0 |
_timezone_check_argument(PyObject *dt, const char *meth)
{
if (dt == Py_None || PyDateTime_Check(dt))
return 0;
PyErr_Format(PyExc_TypeError, "%s(dt) argument must be a datetime instance"
" or None, not %.200s", meth, Py_TYPE(dt)->tp_name);
return -1;
} | false | false | false | false | false | 0 |
watchdog_ping(struct watchdog_device *wdd)
{
int err = 0;
mutex_lock(&wdd->lock);
if (test_bit(WDOG_UNREGISTERED, &wdd->status)) {
err = -ENODEV;
goto out_ping;
}
if (!watchdog_active(wdd))
goto out_ping;
if (wdd->ops->ping)
err = wdd->ops->ping(wdd); /* ping the watchdog */
else
err = wdd->ops->st... | false | false | false | false | false | 0 |
expandTabs( const char *text, int startIndent, int tabDist,
char nullSubsChar, int *newLen ) {
char * outStr, *outPtr;
const char *c;
int indent, len, outLen = 0;
/* rehearse the expansion to figure out length for output string */
indent = startIndent;
for ( c = text; *c != '\0'; c... | false | false | false | false | false | 0 |
lightcheck(int parent,int roomlight,rbool active)
/* This checks to see if anything contained in parent is a valid
room light */
/* active=1 means that we only want active lights;
active=0 indicates that extinguished light sources are okay. */
{
int i;
contloop(i,parent) {
if (tnoun(i) && good_li... | false | false | false | false | false | 0 |
init(SAMPLE_BUFFER* insample)
{
i.init(insample);
EFFECT_BASE::init(insample);
set_parameter(1, dtime_msec);
delay_index.resize(channels(), dtime * dnum - 1);
filled.resize(channels(), std::vector<bool> (dnum, false));
buffer.resize(channels(),
std::vector<SAMPLE_SPECS::sample_t> (dtime *... | false | false | false | false | false | 0 |
WriteCoderProperties(ISequentialOutStream *outStream)
{
const UInt32 kPropSize = 5;
Byte properties[kPropSize];
properties[0] = (_posStateBits * 5 + _numLiteralPosStateBits) * 9 + _numLiteralContextBits;
for (int i = 0; i < 4; i++)
properties[1 + i] = Byte(_dictionarySize >> (8 * i));
return WriteStream(... | false | false | false | false | false | 0 |
rb_mod_gt(mod, arg)
VALUE mod, arg;
{
if (mod == arg) return Qfalse;
return rb_mod_ge(mod, arg);
} | false | false | false | false | false | 0 |
b43_nphy_cal_rx_iq(struct b43_wldev *dev,
struct nphy_txgains target, u8 type, bool debug)
{
if (dev->phy.rev >= 7)
type = 0;
if (dev->phy.rev >= 3)
return b43_nphy_rev3_cal_rx_iq(dev, target, type, debug);
else
return b43_nphy_rev2_cal_rx_iq(dev, target, type, debug);
} | false | false | false | false | false | 0 |
callbacks_window_key_press_event (GtkWidget *widget, GdkEventKey *event)
{
switch(event->keyval) {
case GDK_Escape:
if (screen.tool == POINTER) {
snprintf(screen.statusbar.diststr, MAX_DISTLEN,
"No objects are currently selected");
callbacks_update_statusbar();
render_clear_selection_buffer (... | false | false | false | false | false | 0 |
ipmi_chassis_poh(struct ipmi_intf * intf)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t mins_per_count;
uint32_t count;
float minutes;
uint32_t days, hours;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_CHASSIS;
req.msg.cmd = 0xf;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lpri... | false | true | false | false | false | 1 |
isight_create_mixer(struct isight *isight)
{
static const struct snd_kcontrol_new gain_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Mic Capture Volume",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
SNDRV_CTL_ELEM_ACCESS_TLV_READ,
.info = isight_gain_info,
.get = isight_gain_get,
.put = isi... | false | false | false | false | false | 0 |
lfree(LINE *lp)
{
register BUFFER *bp;
register WINDOW *wp;
wp = wheadp;
while (wp != NULL) {
if (wp->w_linep == lp)
wp->w_linep = lp->l_fp;
if (wp->w_dotp == lp) {
wp->w_dotp = lp->l_fp;
wp->w_doto = 0;
}
if (wp->w_markp == lp) {
wp->w_markp = lp->l_fp;
wp->w_marko = 0;... | false | false | false | false | false | 0 |
q_key_state(Qt::KeyboardModifiers state)
{
KeyModifier k = NoModifier;
if (state & Qt::ControlModifier)
k |= ControlModifier;
if (state & Qt::ShiftModifier)
k |= ShiftModifier;
if (state & Qt::AltModifier)
k |= AltModifier;
#if defined(USE_MACOSX_PACKAGING) || defined(USE_META_KEYBINDING)
if (state & Qt::Met... | false | false | false | false | false | 0 |
sizeHint (const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
Q_UNUSED(option);
QFont baseFont = KGlobalSettings::generalFont();
QString trFontFamily = index.data(Qt::DisplayRole).toString();
QString fontFamily = fontFamilyTrMap[trFontFamily];
... | false | false | false | false | false | 0 |
playback_key( void )
{
int c;
if ( recording == ON || replaying == OFF )
{
return ( -1 );
}
if ( fscanf( rfp, "<%o>\n", &c ) == EOF )
{
close_record( );
c = -1;
}
return ( c );
} | false | false | false | false | false | 0 |
max8997_rtc_probe(struct platform_device *pdev)
{
struct max8997_dev *max8997 = dev_get_drvdata(pdev->dev.parent);
struct max8997_rtc_info *info;
int ret, virq;
info = devm_kzalloc(&pdev->dev, sizeof(struct max8997_rtc_info),
GFP_KERNEL);
if (!info)
return -ENOMEM;
mutex_init(&info->lock);
info->dev = &pd... | false | false | false | false | false | 0 |
hash_map_put(struct hash_map *map, const void *key, void *value)
{
struct hash_map_entry *ent;
struct list_head *bucket;
ent = hash_map_lookup_entry(map, key);
if (ent) {
ent->value = value;
return 0;
}
ent = malloc(sizeof(struct hash_map_entry));
if (!ent)
return -ENOMEM;
ent->key = key;
ent->value... | false | false | false | false | false | 0 |
bp__kv_copy(const bp__kv_t* source, bp__kv_t* target, int alloc) {
/* copy key fields */
if (alloc) {
target->value = malloc(source->length);
if (target->value == NULL) return BP_EALLOC;
memcpy(target->value, source->value, source->length);
target->allocated = 1;
} else {
target->value = sour... | false | true | false | false | false | 1 |
setOpacity(double v)
{
if (isTopLevel())
gtk_window_set_opacity(GTK_WINDOW(border), v);
} | false | false | false | false | false | 0 |
installed(imap &imapAccount)
{
if (imapAccount.getCapability("ACL") == "ACL")
{
/* ACL 1 */
string n=identifier;
if (n != "anyone" &&
n != "anonymous" &&
n != "authuser" &&
n != "owner" &&
n != "administrators")
{
if (strncmp(n.c_str(), "user=", 5))
{
callback.fail("Invalid... | false | false | false | false | false | 0 |
l3_tim_cb(void *data)
{
Evas_Object *ly, *ly2, *sc, *mb;
Eina_List *list, *l;
char buf[256];
int slx, sly;
evas_object_data_del(data, "timer");
ly = evas_object_data_get(data, "ly");
ly2 = evas_object_data_get(data, "ly2");
sc = evas_object_data_get(data, "sc");
elm_object_scroll_freeze_push... | false | false | false | false | false | 0 |
request_start(void)
{
// ---
DBC_REQUIRE(status() != engine_status_running);
// ---
ECA_LOG_MSG(ECA_LOGGER::user_objects, "Request start");
// --
// start the driver
driver_repp->start();
} | false | false | false | false | false | 0 |
preferences_dialog_set_system_font_label (PreferencesDialog* self, GtkButton* button) {
AppSettings* app_settings = NULL;
AppSettings* _tmp0_ = NULL;
gchar* label = NULL;
const gchar* _tmp1_ = NULL;
const gchar* _tmp2_ = NULL;
const gchar* _tmp3_ = NULL;
gchar* _tmp4_ = NULL;
GtkButton* _tmp5_ = NULL;
g_return... | false | false | false | false | false | 0 |
tg3_get_nvram_size(struct tg3 *tp)
{
u32 val;
if (tg3_flag(tp, NO_NVRAM) || tg3_nvram_read(tp, 0, &val) != 0)
return;
/* Selfboot format */
if (val != TG3_EEPROM_MAGIC) {
tg3_get_eeprom_size(tp);
return;
}
if (tg3_nvram_read(tp, 0xf0, &val) == 0) {
if (val != 0) {
/* This is confusing. We want to o... | false | false | false | false | false | 0 |
rfbHttpShutdownSockets(rfbScreenInfoPtr rfbScreen) {
if(rfbScreen->httpSock>-1) {
close(rfbScreen->httpSock);
FD_CLR(rfbScreen->httpSock,&rfbScreen->allFds);
rfbScreen->httpSock=-1;
}
if(rfbScreen->httpListenSock>-1) {
close(rfbScreen->httpListenSock);
FD_CLR(rfbScreen->httpListenSock,&rfbScreen->allF... | false | false | false | false | false | 0 |
ClearInfo()
{
if (s_convertgui) {
dynamic_cast<wxStaticBoxSizer*>(IDC_CURJOB)->GetStaticBox()->SetLabel(_("Waiting..."));
dynamic_cast<wxStaticText*>(s_convertgui->FindWindow(IDC_CONV_PROZENT))->SetLabel(wxEmptyString);
s_convertgui->m_pb_current->SetValue(0);
dynamic_cast<wxStaticText*>(s_convertgui->FindWind... | false | false | false | false | false | 0 |
Jte(const NEWIMAGE::volume<float>& ima,
const NEWIMAGE::volume<char> *mask) const
{
NEWMAT::ColumnVector tmp(1);
tmp.Release();
return(tmp);
} | false | false | false | false | false | 0 |
simo_combo_box_set_active_iter( SimoComboBox *combo_box,
GtkTreeIter *iter )
{
SimoComboBoxPrivate *mthis = combo_box->priv;
GValue value = {0};
gchar *text = 0;
if( mthis->current_path )
gtk_tree_path_free( mthis->current_path );
mthis->current_path = gtk_tree_model... | false | false | false | false | false | 0 |
collide( const CL_CollisionOutline &outline, bool remove_old_collision_info)
{
if( collision_info_collect && remove_old_collision_info )
{
collision_info.clear();
}
// bounding circle test.
float dist = minimum_enclosing_disc.position.distance(outline.get_minimum_enclosing_disc().position);
if( dist > (minim... | false | false | false | false | false | 0 |
run_dump_conns(void)
{
int i;
char path[1024];
struct file_map m;
struct conn_entry *e;
check_daemon();
snprintf(path, sizeof(path), DB_CN_FILE);
if (mmap_file(path, sizeof(struct conn_entry), &m))
{
fprintf(stderr, "Failed to open %s: %s\n", path, strerror(errno));
return 1;
}
for (i = 0; i < m.size; ... | true | true | false | false | true | 1 |
hr222_mic_boost_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
mutex_lock(&chip->mgr->mixer_mutex);
if (chip->mic_boost != ucontrol->value.integer.value[0]) {
changed = 1;
chip->mic_boost = ucontrol->valu... | false | false | false | false | false | 0 |
FuncTRIANGULIZE_LIST_GF2VECS( Obj self, Obj mat)
{
UInt i,len;
UInt width;
Obj row;
/* check argts */
len = LEN_PLIST(mat);
if (!len)
return TRY_NEXT_METHOD;
row = ELM_PLIST(mat,1);
if (!IS_MUTABLE_OBJ(row) || !IS_GF2VEC_REP(row))
return TRY_NEXT_METHOD;
width = LEN_GF2VEC(row);
if (width ==... | false | false | false | false | false | 0 |
nexttoken(char *cp)
{
for (;;) {
if (*cp == '\0')
return NULL;
if (*cp == '(') {
int nesting = 0;
while (*cp != '\0') {
switch (*cp++) {
case '(':
nesting++;
break;
case ')':
nesting--;
break;
}
if (nesting <= 0)
break;
}
} else if (blankchar(*cp & 0377) ... | false | false | false | false | false | 0 |
audacious_get_current_song(void) {
gchar *playlist_file;
gchar *uri;
gint pos;
song *s;
audacious_connect();
pos = (*gjaud_get_playlist_pos)(gjay->player_proxy);
playlist_file = (*gjaud_get_playlist_file)(gjay->player_proxy, pos);
if (playlist_file == NULL)
return NULL;
uri = g_filename_from_uri(... | false | false | false | false | false | 0 |
moveTo(ArPose poseTo, ArPose poseFrom,
bool doCumulative)
{
std::list<ArRangeDevice *>::iterator it;
ArSensorReading *son;
int i;
ArPose result = myEncoderTransform.doInvTransform(poseFrom);
// we need to get this one now because changing the encoder
// transform and global pose will change the l... | false | false | false | false | false | 0 |
gx_forward_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect,
gs_get_bits_params_t * params, gs_int_rect ** unread)
{
gx_device_forward * const fdev = (gx_device_forward *)dev;
gx_device *tdev = fdev->target;
dev_proc_get_bits_rectangle((*proc)) =
(tdev == 0 ? (tde... | false | false | false | false | false | 0 |
lpfc_fof_queue_destroy(struct lpfc_hba *phba)
{
/* Release FOF Event queue */
if (phba->sli4_hba.fof_eq != NULL) {
lpfc_sli4_queue_free(phba->sli4_hba.fof_eq);
phba->sli4_hba.fof_eq = NULL;
}
/* Release OAS Completion queue */
if (phba->sli4_hba.oas_cq != NULL) {
lpfc_sli4_queue_free(phba->sli4_hba.oas_cq);... | false | false | false | false | false | 0 |
stopModal(FXint value){
register FXInvocation* inv;
for(inv=invocation; inv; inv=inv->upper){
inv->done=TRUE;
inv->code=0;
if(inv->modality!=MODAL_FOR_NONE){
inv->code=value;
return;
}
}
} | false | false | false | false | false | 0 |
toUChar()
{
unsigned char ret = 0;
if( _attackWin ) {
ret |= 0x01;
}
if( _defenseWin ) {
ret |= 0x02;
}
if( _fled ) {
ret |= 0x04;
}
if( _surrendered ) {
ret |= 0x08;
}
return ret;
} | false | false | false | false | false | 0 |
gnm_go_data_scalar_get_markup (GODataScalar *dat)
{
PangoAttrList const *res = NULL;
GOFormat const *fmt = gnm_go_data_preferred_fmt (GO_DATA (dat));
if (fmt && go_format_is_markup (fmt))
res = go_format_get_markup (fmt);
go_format_unref (fmt);
return res;
} | false | false | false | false | false | 0 |
amitk_dial_update (AmitkDial *dial)
{
gfloat new_value;
g_return_if_fail (dial != NULL);
g_return_if_fail (AMITK_IS_DIAL (dial));
new_value = dial->adjustment->value;
if (new_value < dial->adjustment->lower)
new_value = dial->adjustment->lower;
if (new_value > dial->adjustment->upper)
new_va... | false | false | false | false | false | 0 |
sort_str(const char* haystack, const char* needle)
{
const char* r = haystack;
size_t nl = strlen(needle);
if (!strlen(haystack) || !nl)
return 0;
//printf("HAY %s %s\n", haystack, needle);
while ((r = strstr(r, needle)) != NULL)
{
//printf("r %50s %s %p\n", r, haystack, needle);
if (r =... | false | false | false | false | true | 1 |
regexp_test(JSContext *cx, uintN argc, jsval *vp)
{
if (!regexp_exec_sub(cx, JS_THIS_OBJECT(cx, vp), argc, vp + 2, JS_TRUE, vp))
return JS_FALSE;
if (*vp != JSVAL_TRUE)
*vp = JSVAL_FALSE;
return JS_TRUE;
} | false | false | false | false | false | 0 |
jsonp_dtostr(char *buffer, size_t size, double value)
{
int ret;
size_t length;
ret = snprintf(buffer, size, "%.17g", value);
if(ret < 0)
return -1;
length = (size_t)ret;
if(length >= size)
return -1;
#if JSON_HAVE_LOCALECONV
from_locale(buffer);
#endif
/* Make sure t... | false | false | false | false | false | 0 |
print_file_add_limits_to_line(char **line,
slurmdb_association_rec_t *assoc)
{
if (!assoc)
return SLURM_ERROR;
if (assoc->def_qos_id && (assoc->def_qos_id != NO_VAL)) {
char *tmp_char;
if (!g_qos_list)
g_qos_list = acct_storage_g_get_qos(
db_conn, my_uid, NULL);
if ((tmp_char = slurmdb_qos_str(g... | false | false | false | false | false | 0 |
new_l3_process(struct PStack *st, int cr)
{
struct l3_process *p, *np;
if (!(p = kmalloc(sizeof(struct l3_process), GFP_ATOMIC))) {
printk(KERN_ERR "HiSax can't get memory for cr %d\n", cr);
return (NULL);
}
if (!st->l3.proc)
st->l3.proc = p;
else {
np = st->l3.proc;
while (np->next)
np = np->next;
... | false | false | false | false | false | 0 |
NoSymbolBetween( ChewingData *pgdata, int begin, int end )
{
int i, nChi, k;
/* find the beginning index in the chiSymbolBuf */
for ( nChi = i = 0; i < pgdata->chiSymbolBufLen && nChi < begin; i++ )
/* it is Chinese word */
if ( pgdata->chiSymbolBuf[ i ].wch == (wchar_t) 0 )
nChi++;
for ( k = i + 1; k < pg... | false | false | false | false | false | 0 |
create(const UnicodeString& info, UParseError& perror, UErrorCode& status) {
if (U_FAILURE(status)) {
return NULL;
}
int32_t len = info.length();
if (len == 0) {
return NULL; // no error;
}
UChar* p = (UChar*)uprv_malloc(len * sizeof(UChar));
if (!p) {
statu... | false | false | false | false | false | 0 |
Realloc(const char *caller, const char *file, int line, void *ptrold, size_t size)
{
void *ptr = NULL;
int item = UNDEFID;
memInit();
if ( size > 0 )
{
ptr = realloc(ptrold, size);
if ( MEM_Debug )
{
memAccess++;
if ( ptr )
{
item = memListChangeEntry(ptrold, ptr, size, ca... | false | false | false | false | true | 1 |
_rtl8821ae_phy_txpower_training_by_path(struct ieee80211_hw *hw,
u8 bw, u8 channel, u8 path)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_phy *rtlphy = &rtlpriv->phy;
u8 i;
u32 power_level, data, offset;
if (path >= rtlphy->num_total_rfpath)
return;
data = 0;
if (path == RF90_PATH_A) {
... | false | false | false | false | false | 0 |
prepare_elf64_headers(struct crash_elf_data *ced,
void **addr, unsigned long *sz)
{
Elf64_Ehdr *ehdr;
Elf64_Phdr *phdr;
unsigned long nr_cpus = num_possible_cpus(), nr_phdr, elf_sz;
unsigned char *buf, *bufp;
unsigned int cpu;
unsigned long long notes_addr;
int ret;
/* extra phdr for vmcoreinfo elf note */
... | false | true | true | false | false | 1 |
sheet_get_cells_extent (Sheet const *sheet)
{
static GnmRange const dummy = { { 0,0 }, { 0,0 } };
struct sheet_extent_data closure;
g_return_val_if_fail (IS_SHEET (sheet), dummy);
closure.range.start.col = gnm_sheet_get_last_col (sheet);
closure.range.start.row = gnm_sheet_get_last_row (sheet);
closure.range.en... | false | false | false | false | false | 0 |
ResetRoamPoint (tdmInteractor I)
{
double x, y, z, nx, ny ;
DEFDATA(I,CursorData) ;
ENTRY(("ResetRoamPoint(0x%x)", I));
if (CDATA(view_coords_set))
{
/* canonical world has bounding box origin at center */
x = CDATA(to[0]) - PDATA(Ox) ;
y = CDATA(to[1]) - PDATA(Oy) ;
z = CDATA(to[2... | false | false | false | false | false | 0 |
encode(std::string s)
{
ostringstream o;
string::iterator b, e;
b=s.begin();
e=s.end();
while (b != e)
{
if (*b <= ' ' || *b >= 127 || *b == '%')
{
o << '%' << hex << setw(2) << setfill('0') <<
(int)(unsigned char)*b;
}
else
o << (char)*b;
++b;
}
return o.str();
} | false | false | false | false | false | 0 |
workspaceNames(void) const
{
if (isCDERunning()==MSTrue) return _pMWMWidget->workspaceNames();
return MSStringVector();
} | false | false | false | false | false | 0 |
ParseExpressionOrLabelledStatement(
bool* ok) {
// ExpressionStatement | LabelledStatement ::
// Expression ';'
// Identifier ':' Statement
Expression expr = ParseExpression(true, CHECK_OK);
if (peek() == i::Token::COLON && expr == kIdentifierExpression) {
Consume(i::Token::COLON);
return Par... | false | false | false | false | false | 0 |
atonev_ns_fetch(register atonev_susp_type susp, snd_list_type snd_list)
{
int cnt = 0; /* how many samples computed */
int togo;
int n;
sample_block_type out;
register sample_block_values_type out_ptr;
register sample_block_values_type out_ptr_reg;
register double cc_reg;
register doub... | false | false | false | false | false | 0 |
addLightSceneNode(ISceneNode* parent,
const core::vector3df& position, video::SColorf color, f32 range, s32 id)
{
if (!parent)
parent = this;
ILightSceneNode* node = new CLightSceneNode(parent, this, id, position, color, range);
node->drop();
return node;
} | false | false | false | false | false | 0 |
skd_cons_disk(struct skd_device *skdev)
{
int rc = 0;
struct gendisk *disk;
struct request_queue *q;
unsigned long flags;
disk = alloc_disk(SKD_MINORS_PER_DEVICE);
if (!disk) {
rc = -ENOMEM;
goto err_out;
}
skdev->disk = disk;
sprintf(disk->disk_name, DRV_NAME "%u", skdev->devno);
disk->major = skdev->... | false | false | false | false | true | 1 |
appendIterNormal(StyleObjIter &iter) const
{
if (styleSpec_->specs.size())
iter.append(&styleSpec_->specs, this);
if (use_)
use_->appendIter(iter);
} | false | false | false | false | false | 0 |
SetEnabled(bool b)
{
if (b)
{
setCursor(Qt::PointingHandCursor);
}
else
{
setCursor(Qt::ArrowCursor);
}
setEnabled(b);
} | false | false | false | false | false | 0 |
bitset_realloc(bitset_t *bs, unsigned long min_size)
{
unsigned long new_length;
unsigned char *new_bitset;
new_length = nearest_power(min_size);
new_bitset = (unsigned char *) cli_realloc(bs->bitset, new_length);
if (!new_bitset) {
return NULL;
}
bs->bitset = new_bitset;
memset(bs->bitset+bs->length, 0, ne... | false | false | false | false | false | 0 |
help_open(struct view *view)
{
char buf[SIZEOF_STR];
size_t bufpos;
int i;
if (view->lines > 0)
return TRUE;
add_line_text(view, "Quick reference for tig keybindings:", LINE_DEFAULT);
for (i = 0; i < ARRAY_SIZE(req_info); i++) {
const char *key;
if (req_info[i].request == REQ_NONE)
continue;
if (!... | 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.