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 |
|---|---|---|---|---|---|---|
destroy(Solver* s, bool detach) {
if (s && detach) {
s->removePost(this);
while (saved_.size()>1) {
s->removeUndoWatch(uint32(saved_.size()-1), this);
saved_.pop_back();
}
}
PostPropagator::destroy(s, detach);
} | false | false | false | false | false | 0 |
removeRows(int row, int count, const QModelIndex &parent)
{
beginRemoveRows(parent, row, row+count);
for(int i = 0 ; i < count; ++i) {
UserCalendar *u = d->m_UserCalendars.at(row);
u->setData(Constants::Db_IsValid, 0);
d->m_RemovedCalendars.append(u);
d->m_UserCalendars.removeAt(... | false | false | false | false | false | 0 |
count_rtxs (rtx x)
{
enum rtx_code code = GET_CODE (x);
const char *fmt;
int i, ret = 1;
if (GET_RTX_CLASS (code) == '2'
|| GET_RTX_CLASS (code) == 'c')
{
rtx x0 = XEXP (x, 0);
rtx x1 = XEXP (x, 1);
if (x0 == x1)
return 1 + 2 * count_rtxs (x0);
if ((GET_RTX_CLASS (GET_CODE ... | false | false | false | false | false | 0 |
can_delete_label_p (label)
rtx label;
{
return (!LABEL_PRESERVE_P (label)
/* User declared labels must be preserved. */
&& LABEL_NAME (label) == 0
&& !in_expr_list_p (forced_labels, label)
&& !in_expr_list_p (label_value_list, label));
} | false | false | false | false | false | 0 |
check_authmethod_unspecified(const char **authmethod)
{
if (*authmethod == NULL || strlen(*authmethod) == 0)
{
authwarning = _("\nWARNING: enabling \"trust\" authentication for local connections\n"
"You can change this by editing pg_hba.conf or using the option -A, or\n"
"--auth-local and --auth-host, the ... | false | false | false | false | false | 0 |
Image_averageColor(Image *self)
{
int componentCount = self->componentCount;
uint8_t *d = (uint8_t *)UArray_bytes(self->byteArray);
int x, y, c;
long cs[4];
ColorStruct s;
cs[0] = 0;
cs[1] = 0;
cs[2] = 0;
cs[3] = 0;
for (y = 0; y < self->height; y ++)
{
for (x = 0; x < self->width; x ++)
{
int p =... | false | false | false | false | false | 0 |
epr_init_api(EPR_ELogLevel log_level,
EPR_FLogHandler log_handler,
EPR_FErrHandler err_handler)
{
if (epr_api.init_flag) {
return e_err_none;
}
epr_clear_err();
/* Determine endian order architecture */
if (epr_is_little_endian_order()) {
epr_api... | false | false | false | false | false | 0 |
generic_signal_v_retrace(bool value)
{
if (_mode == UI_GENERIC_MODE_GDC)
if (gdc != NULL)
gdc->v_retrace(value);
} | false | false | false | false | false | 0 |
CheckDeps(bool AllowBroken)
{
bool FixBroken = _config->FindB("APT::Get::Fix-Broken",false);
if (_error->PendingError() == true)
return false;
// Check that the system is OK
if (DCache->DelCount() != 0 || DCache->InstCount() != 0)
return _error->Error("Internal error, non-zero counts");
... | false | false | false | false | false | 0 |
fsm_extend(Relation rel, BlockNumber fsm_nblocks)
{
BlockNumber fsm_nblocks_now;
Page pg;
pg = (Page) palloc(BLCKSZ);
PageInit(pg, BLCKSZ, 0);
/*
* We use the relation extension lock to lock out other backends trying to
* extend the FSM at the same time. It also locks out extension of the
* main fork, unn... | false | false | false | false | false | 0 |
efreet_cache_util_names(const char *key)
{
if (util_cache_names_key && !strcmp(key, util_cache_names_key))
return util_cache_names;
if (!efreet_cache_check(&util_cache, efreet_desktop_util_cache_file(), EFREET_DESKTOP_UTILS_CACHE_MAJOR)) return NULL;
if (util_cache_names)
{
/* free prev... | false | false | false | false | false | 0 |
locate_soi_marker()
{
uint lastchar, thischar;
uint bytesleft;
lastchar = get_bits(8);
thischar = get_bits(8);
/* ok if it's a normal JPEG file without a special header */
if ((lastchar == 0xFF) && (thischar == M_SOI))
return;
bytesleft = 4096; //512;
for ( ; ; ) {
... | false | false | false | false | false | 0 |
SETNLE_EbR(bxInstruction_c *i)
{
Bit8u result_8 = !(getB_ZF() | (getB_SF() ^ getB_OF()));
BX_WRITE_8BIT_REGx(i->rm(), i->extend8bitL(), result_8);
} | false | false | false | false | false | 0 |
gd_add_crecip89(DIRFILE* D, const char* field_code, const char* in_field,
const double cdividend[2], int fragment_index) gd_nothrow
{
gd_entry_t E;
int error;
dtrace("%p, \"%s\", \"%s\", [%g, %g], %i", D, field_code, in_field,
cdividend[0], cdividend[1], fragment_index);
if (D->flags & GD_INVALID) {... | false | false | false | false | false | 0 |
PolyListCopy(PolyList *polylist)
{
PolyList *newpl;
Poly *newp;
Vertex *newvl;
int i, j;
Poly *op, *np;
if(polylist == NULL) return NULL;
newvl = OOGLNewNE(Vertex, polylist->n_verts, "PolyList verts");
newp = OOGLNewNE(Poly, polylist->n_polys, "PolyList polygons");
newpl = OOGLNewE(PolyList, "PolyLi... | false | false | false | false | false | 0 |
____lambda9_ (Block5Data* _data5_, GObject* s, GParamSpec* p) {
IndividualPropertiesTests * self;
FolksIndividual* ind = NULL;
GObject* _tmp0_ = NULL;
FolksIndividual* _tmp1_ = NULL;
FolksIndividual* _tmp2_ = NULL;
GeeSet* _tmp3_ = NULL;
GeeSet* _tmp4_ = NULL;
FolksEmailFieldDetails* _tmp5_ = NULL;
gboolean _t... | false | false | false | false | false | 0 |
iwl_mvm_event_frame_timeout_callback(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
const struct ieee80211_event *event)
{
struct iwl_fw_dbg_trigger_tlv *trig;
struct iwl_fw_dbg_trigger_ba *ba_trig;
if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_BA))
return;
trig = iwl_fw_dbg_get_tri... | false | false | false | false | false | 0 |
pthread_barrier_destroy (barrier)
pthread_barrier_t *barrier;
{
struct pthread_barrier *ibarrier;
int result = EBUSY;
ibarrier = (struct pthread_barrier *) barrier;
lll_lock (ibarrier->lock, ibarrier->private ^ FUTEX_PRIVATE_FLAG);
if (__builtin_expect (ibarrier->left == ibarrier->init_count, 1))
... | false | false | false | false | false | 0 |
add_conn(struct proxied_connection *conns) {
struct proxied_connection *new_conn, *last;
new_conn = (struct proxied_connection*)calloc(1, sizeof(struct proxied_connection));
if((last = last_conn(conns))) {
last->next = new_conn;
new_conn->prev = last;
} else {
new_conn->prev = NULL;
}
new_conn-... | false | false | false | false | false | 0 |
able_wall(game *g, point p)
{
return (g->m.ter(p.x, p.y) == t_wall_h || g->m.ter(p.x, p.y) == t_wall_v ||
g->m.ter(p.x, p.y) == t_wall_wood);
} | false | false | false | false | false | 0 |
output_aliases(struct depmod *depmod, FILE *out)
{
size_t i;
fputs("# Aliases extracted from modules themselves.\n", out);
for (i = 0; i < depmod->modules.count; i++) {
const struct mod *mod = depmod->modules.array[i];
struct kmod_list *l;
kmod_list_foreach(l, mod->info_list) {
const char *key = kmod_mod... | false | false | false | false | false | 0 |
gl_color_swatch_finalize (GObject *object)
{
glColorSwatch *this = GL_COLOR_SWATCH (object);
g_return_if_fail (object != NULL);
g_return_if_fail (GL_IS_COLOR_SWATCH (object));
g_free (this->priv);
G_OBJECT_CLASS (gl_color_swatch_parent_class)->finalize (object);
} | false | false | false | false | false | 0 |
neato_dequeue(void)
{
int i;
node_t *rv, *v;
if (Heapsize == 0)
return NULL;
rv = Heap[0];
i = --Heapsize;
v = Heap[i];
Heap[0] = v;
ND_heapindex(v) = 0;
if (i > 1)
heapdown(v);
ND_heapindex(rv) = -1;
return rv;
} | false | false | false | false | false | 0 |
PyFFGlyph_draw(PyObject *self, PyObject *args) {
PyObject *layer, *result, *pen;
RefChar *ref;
PyObject *tuple;
if ( !PyArg_ParseTuple(args,"O", &pen ) )
return( NULL );
layer = PyFF_Glyph_get_a_layer((PyFF_Glyph *) self,((PyFF_Glyph *) self)->layer);
result = PyFFLayer_draw( (PyFF_Layer *) la... | false | false | false | false | false | 0 |
spif_str_casecmp_with_ptr(spif_str_t self, spif_charptr_t other)
{
int c;
SPIF_OBJ_COMP_CHECK_NULL(self, other);
c = strcasecmp(SPIF_CHARPTR_C(SPIF_STR_STR(self)), SPIF_CHARPTR_C(other));
return SPIF_CMP_FROM_INT(c);
} | false | false | false | false | false | 0 |
mono_thread_abort (MonoObject *obj)
{
/* MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); */
/* handle_remove should be eventually called for this thread, too
g_free (jit_tls);*/
if ((mono_runtime_unhandled_exception_policy_get () == MONO_UNHANDLED_POLICY_LEGACY) ||
(obj->vtable->klass =... | false | false | false | false | false | 0 |
AcpiDmAddResourcesToNamespace (
ACPI_NAMESPACE_NODE *BufferNode,
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *NextOp;
/* Get to the ByteData list */
NextOp = Op->Common.Value.Arg;
NextOp = NextOp->Common.Next;
if (!NextOp)
{
return;
}
/* Set Node and Op... | false | false | false | false | false | 0 |
device_lookup(struct target *target, uint64_t lun)
{
struct scsi_lu *lu;
list_for_each_entry(lu, &target->device_list, device_siblings)
if (lu->lun == lun)
return lu;
return NULL;
} | false | false | false | false | false | 0 |
Towire(char *p)
{
char *q, *r, *s;
int curlen, len = BIG_BUFFER;
for (r = p, q = s = xmalloc(len); *r != '\0' ;) {
curlen = q - s;
if (curlen + 3 > len) {
len += BIG_BUFFER;
s = xrealloc(s, len);
q = s + curlen;
}
if (*r == '\n') {
if (r > p) {
if (*(r - 1) != '\r')
... | false | false | false | false | false | 0 |
RemoveFromAllQueues(ThrottledFileSocket* socket)
{
wxMutexLocker lock( m_sendLocker );
if (m_doRun) {
DoRemoveFromAllQueues(socket);
// And remove it from upload slots
RemoveFromStandardListNoLock(socket);
}
} | false | false | false | false | false | 0 |
event(QEvent *event)
{
if (event->type() == QEvent::ToolTip) {
if (validIndex(m_hoverIndex)) {
QString tt = tabToolTip(m_hoverIndex);
if (!tt.isEmpty()) {
QToolTip::showText(static_cast<QHelpEvent*>(event)->globalPos(), tt, this);
return true;
... | false | false | false | false | false | 0 |
next_runtime_abi_02_receiver_is_class_object (tree receiver)
{
if (TREE_CODE (receiver) == VAR_DECL
&& IS_CLASS (TREE_TYPE (receiver))
&& vec_safe_length (classrefs))
{
int count;
ident_data_tuple *ref;
/* The receiver is a variable created by build_class_reference_decl. */
FO... | false | false | false | false | false | 0 |
dconf_blame (gchar** args, int args_length1, GError** error) {
GDBusConnection* connection = NULL;
GDBusConnection* _tmp0_ = NULL;
GVariant* reply = NULL;
GDBusConnection* _tmp1_ = NULL;
GVariantType* _tmp2_ = NULL;
GVariantType* _tmp3_ = NULL;
GVariant* _tmp4_ = NULL;
GVariant* _tmp5_ = NULL;
GVariant* _tmp6_... | false | false | false | false | false | 0 |
nanoscope_get_metadata(GHashTable *hash)
{
static const struct {
gchar *key;
gchar *name;
gchar *unit;
}
metadata[] = {
{ "bias_volt[0]", "Bias", " mV" },
{ "scan_rate", "Scan rate", " Hz" },
{ "time", "Date", NULL },
};
GwyContainer *meta;
const ... | false | false | false | false | false | 0 |
OJPEGPrintDir(TIFF* tif, FILE* fd, long flags)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
uint8 m;
(void)flags;
assert(sp!=NULL);
if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGINTERCHANGEFORMAT))
fprintf(fd," JpegInterchangeFormat: " TIFF_UINT64_FORMAT "\n",(TIFF_UINT64_T)sp->jpeg_interchange_format);
if (TIFFField... | false | false | false | false | true | 1 |
count_records_in_cat(char *db_name, int cat_index)
{
GList *records;
GList *temp_list;
int count, num;
buf_rec *br;
jp_logf(JP_LOG_DEBUG, "count_records_in_cat\n");
count = 0;
num = jp_read_DB_files(db_name, &records);
if (-1 == num)
return 0;
for (temp_list = records; temp_list; te... | false | false | false | false | false | 0 |
retrieveSvg(ViewLayer::ViewLayerID viewLayerID, QHash<QString, QString> & svgHash, bool blackOnly, double dpi, double & factor)
{
if (m_viewID != ViewLayer::PCBView ||
(viewLayerID != ViewLayer::Copper0 && viewLayerID != ViewLayer::Copper1))
{
return PaletteItemBase::retrieveSvg(viewLayerID, svgHash, blackOnly... | false | false | false | false | false | 0 |
cg_cell_renderer_flags_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
CgCellRendererFlags *renderer;
CgCellRendererFlagsPrivate *priv;
g_return_if_fail (CG_IS_CELL_RENDE... | false | false | false | false | false | 0 |
rtw_recv_indicatepkt(struct adapter *padapter,
struct recv_frame *precv_frame)
{
struct recv_priv *precvpriv;
struct __queue *pfree_recv_queue;
struct sk_buff *skb;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
precvpriv = &(padapter->recvpriv);
pfree_recv_queue = &(precvpriv->free_recv_queue);
skb =... | false | false | false | false | false | 0 |
log_error( const char *fmt, ... )
{
va_list arg_ptr ;
va_start( arg_ptr, fmt ) ;
do_logv( JNLIB_LOG_ERROR, fmt, arg_ptr );
va_end(arg_ptr);
/* protect against counter overflow */
if( errorcount < 30000 )
errorcount++;
} | false | false | false | false | false | 0 |
parseMaterial(istream & fin, Material & material)
{
char buf[256];
vector<string> token;
unsigned int i = 0;
//cerr << "*** Material\n";
while (fin.getline(buf, sizeof(buf))) {
// Tokenize
token.clear();
tokenize(buf, token);
... | false | false | false | false | false | 0 |
c_param_end_write_collection(gs_param_list * plist, gs_param_name pkey,
gs_param_dict * pvalue)
{
gs_c_param_list *const cplist = (gs_c_param_list *)plist;
gs_c_param_list *dlist = (gs_c_param_list *) pvalue->list;
return c_param_write(cplist, pkey, pvalue->list,
... | false | false | false | false | false | 0 |
initializeCannaConnection(obj)
CannaObject obj;
{
char **warn = 0;
extern (*jrBeepFunc)();
if (nCannaContexts == 0) {
#ifdef KC_SETSERVERNAME
if (obj->canna.cannahost != NULL) {
wcKanjiControl((int)obj, KC_SETSERVERNAME, obj->canna.cannahost);
}
#endif /* KC_SETSERVERNAME */
#ifdef KC_SETINITFILENA... | false | false | false | false | false | 0 |
st_widget_unmap (ClutterActor *actor)
{
StWidget *self = ST_WIDGET (actor);
StWidgetPrivate *priv = self->priv;
CLUTTER_ACTOR_CLASS (st_widget_parent_class)->unmap (actor);
if (priv->track_hover && priv->hover)
st_widget_set_hover (self, FALSE);
} | false | false | false | false | false | 0 |
dmtcp_get_ckpt_dir()
{
static dmtcp::string *tmpdir = NULL;
if (tmpdir == NULL)
tmpdir = new dmtcp::string(dmtcp::UniquePid::getCkptDir());
return tmpdir->c_str();
} | false | false | false | false | false | 0 |
processLocaleProperty(const LocaleVariant &variant,
const std::string &error,
bool mustCall,
const ProcessLocalePropCB_t &result)
{
SE_LOG_DEBUG(NULL, "localed: got Locale property: %s... | false | false | false | false | false | 0 |
lgammafn_sign(double x, int *sgn)
{
double ans, y, sinpiy;
#ifdef NOMORE_FOR_THREADS
static double xmax = 0.;
static double dxrel = 0.;
if (xmax == 0) {/* initialize machine dependent constants _ONCE_ */
xmax = d1mach(2)/log(d1mach(2));/* = 2.533 e305 for IEEE double */
dxrel = sqrt (d1mach(4));/* ... | false | false | false | false | false | 0 |
alloc_vs(char *ip, char *port)
{
int size = strlen(port);
virtual_server_t *new;
new = (virtual_server_t *) MALLOC(sizeof(virtual_server_t));
if (!strcmp(ip, "group")) {
new->vsgname = (char *) MALLOC(size + 1);
memcpy(new->vsgname, port, size);
} else if (!strcmp(ip, "fwmark")) {
new->vfwmark = atoi(port)... | false | true | true | false | true | 1 |
write_file_3(File* filePtr)
{
write_book_mark( BOOK_MARK+201 );
if( !unit_array.write_file(filePtr) )
return 0;
write_book_mark( BOOK_MARK+202 );
if( !bullet_array.write_file(filePtr) )
return 0;
write_book_mark( BOOK_MARK+203 );
if( !site_array.write_file(filePtr) )
return 0;
write_book_mark( BOOK_M... | false | false | false | false | false | 0 |
ExecReScanHashJoin(HashJoinState *node)
{
/*
* In a multi-batch join, we currently have to do rescans the hard way,
* primarily because batch temp files may have already been released. But
* if it's a single-batch join, and there is no parameter change for the
* inner subnode, then we can just re-use the exist... | false | false | false | false | false | 0 |
gtk_plot3d_destroy (GtkObject *object)
{
GtkPlot3D *plot = GTK_PLOT3D(object);
gtk_psfont_unref();
if (plot->xy)
gtk_object_unref(GTK_OBJECT(plot->xy));
if (plot->xz)
gtk_object_unref(GTK_OBJECT(plot->xz));
if (plot->yx)
gtk_object_unref(GTK_OBJECT(plot->yx));
if (plot->yz)
gtk_object_unref... | false | false | false | false | false | 0 |
GetColorInfo(const char *name,ExceptionInfo *exception)
{
char
colorname[MaxTextExtent];
register char
*q;
register ColorInfo
*p;
LockSemaphoreInfo(color_semaphore);
if (color_list == (ColorInfo *) NULL)
(void) ReadColorConfigureFile(ColorFilename,0,exception);
UnlockSemaphoreInfo(color_s... | false | false | false | false | false | 0 |
shadow_draw_line(int x1, int x2, int y1,int y2)
{
int x,y,h;
float inc;
if (x2 < x1)
h = x2, x2 = x1, x1 = h;
if (y2 < y1)
h = y2, y2 = y1, y1 = h;
if (x2 - x1 < y2 - y1) {
inc = (float)(x2-x1)/(float)(y2-y1);
for (y = y1; y <= y2; y++) {
x = x1 + inc * (y - y1);
shadow_setpixel(x,y)... | false | false | false | false | false | 0 |
SetStatus(const std::string &Status)
{
if (!Status.length())
SetStatus (Url_Empty);
if (Status == "ToBeRetrieved")
SetStatus (Url_ToBeRetrieved);
else if (Status == ("Retrieved"))
SetStatus (Url_Retrieved);
else if (Status == ("CheckIfExists"))
SetStatus (Url_CheckIfExists);
else... | false | false | false | false | false | 0 |
GetText() {
Picture* pic = (Picture*)GetGraphic();
if (!pic) return nil;
Iterator i;
pic->First(i);
pic->Next(i);
if (_graph)
pic->Next(i);
if (pic->Done(i))
return nil;
else
return (TextGraphic*)pic->GetGraphic(i);
} | false | false | false | false | false | 0 |
jack_proxy_session_save_one(
bool queue,
const char * target,
const char * path,
void * callback_context,
void (* completion_callback)(
void * context,
const char * commandline))
{
bool ret;
dbus_bool_t dbus_bool;
dbus_uint32_t type;
DBusMessage * request_ptr;
struct jack_proxy_session_save_... | false | false | false | false | false | 0 |
powr1220_read_adc(struct device *dev, int ch_num)
{
struct powr1220_data *data = dev_get_drvdata(dev);
int reading;
int result;
int adc_range = 0;
mutex_lock(&data->update_lock);
if (time_after(jiffies, data->adc_last_updated[ch_num] + HZ) ||
!data->adc_valid[ch_num]) {
/*
* figure out if we need to use... | false | false | false | false | false | 0 |
cutFromParamValue(double t) {
double ot = 1.0 - t;
GLEPoint p_1_1(m_P2);
p_1_1.dotScalar(t);
p_1_1.addScalar(m_P1, ot);
GLEPoint p_0_1(m_P1);
p_0_1.dotScalar(t);
p_0_1.addScalar(m_P0, ot);
GLEPoint p_0_2(p_1_1);
p_0_2.dotScalar(t);
p_0_2.addScalar(p_0_1, ot);
m_P2.dotScalar(ot);
m_P2.addScalar(m_P3, t);
m_... | false | false | false | false | false | 0 |
gx_set_overprint_Separation(const gs_color_space * pcs, gs_state * pgs)
{
gs_devicen_color_map * pcmap = &pgs->color_component_map;
gx_device *dev = pgs->device;
cmm_dev_profile_t *dev_profile;
dev_proc(dev, get_profile)(dev, &(dev_profile));
if (pcmap->use_alt_cspace)
if (dev_profile-... | false | false | false | false | false | 0 |
setConnectionInfo( const ConnectionInfo &connectionInfo )
{
mName->setText( connectionInfo.name() );
mHost->setText( connectionInfo.host() );
mPort->setValue( connectionInfo.port() );
mBaseDn->setText( connectionInfo.baseDn() );
mUser->setText( connectionInfo.nobodyUser() );
mPassword->setText( connectionIn... | false | false | false | false | false | 0 |
gnc_period_select_set_date_common (GncPeriodSelect *period, const GDate *date)
{
GncPeriodSelectPrivate *priv;
priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
if (date)
{
if (priv->date_base)
g_date_free(priv->date_base);
priv->date_base = g_date_new_dmy(g_date_get_day(date),
... | false | false | false | false | false | 0 |
GetInfo( GtkWidget *widget, gpointer data )
{
iset=iframe-1;
switch(iset)
{
case 0:GetInfoGene() ; break;
case 1:GetInfoGeom() ;
geom_is_not_open();
TypeGeomOpen = 0;
WindowGeom = NULL;
break;
case 2:GetInfoBasis(); br... | false | false | false | false | false | 0 |
sconf_get_weight_ticket_urgency_priority(double *ticket, double *urgency, double *priority)
{
sge_mutex_lock("Sched_Conf_Lock", "", __LINE__, &pos.mutex);
if (pos.weight_ticket != -1 && pos.weight_urgency != -1 && pos.weight_priority != -1) {
const lListElem *sc_ep = lFirst(*(object_type_get_master_lis... | false | false | false | false | false | 0 |
readset(struct samphdr *hdr, void *cnt)
{
/*
** read header info
*/
if ( readin(ifd, (char *)hdr, sizeof(struct samphdr)) == 0)
return(0); /* EOF */
if (hdr->cntsize == 0)
return(1);
/*
** read counter contents
*/
if ( readin(ifd, (char *)cnt, hdr->cntsize) == 0)
return(0); /* EOF */
return(1... | false | false | false | false | false | 0 |
printCFP(const ConstantFP *CFP) {
bool ignored;
APFloat APF = APFloat(CFP->getValueAPF()); // copy
if (CFP->getType() == Type::getFloatTy(CFP->getContext()))
APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored);
Out << "ConstantFP::get(mod->getContext(), ";
Out << "APFloat(";
#if HAVE... | false | false | false | false | false | 0 |
onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
{
if (code > 0xff)
rb_raise(rb_eRangeError, "%u out of char range", code);
*buf = (UChar )(code & 0xff);
return 1;
} | false | false | false | false | false | 0 |
SQLInstallTranslatorEx (LPCSTR lpszTranslator, LPCSTR lpszPathIn,
LPSTR lpszPathOut, WORD cbPathOutMax, WORD * pcbPathOut, WORD fRequest,
LPDWORD lpdwUsageCount)
{
PCONFIG pCfg = NULL, pOdbcCfg = NULL;
BOOL retcode = FALSE;
CLEAR_ERROR ();
if (lpszPathIn && access (lpszPathIn, R_OK | W_OK | X_OK))
... | false | false | false | false | false | 0 |
JPEGPrintDir(TIFF* tif, FILE* fd, long flags)
{
JPEGState* sp = JState(tif);
assert(sp != NULL);
(void) flags;
if (TIFFFieldSet(tif,FIELD_JPEGTABLES))
fprintf(fd, " JPEG Tables: (%lu bytes)\n",
(unsigned long) sp->jpegtables_length);
if (sp->printdir)
(*sp->printdir)(tif, fd, flags);
} | false | false | false | false | false | 0 |
afuse_opendir(const char *path, struct fuse_file_info *fi)
{
DIR *dp;
char *root_name = alloca(strlen(path));
mount_list_t *mount;
char *real_path = alloca(max_path_out_len(path));
int retval;
BLOCK_SIGALRM;
switch (process_path(path, real_path, root_name, 1, &mount)) {
case PROC_PATH_FAILED:
retval = -ENXIO... | false | false | false | false | false | 0 |
Indomain_2(WamWord fdv_word, WamWord method_word)
{
WamWord word, tag_mask;
WamWord *fdv_adr;
Fd_Deref_Check_Fd_Var(fdv_word, word, tag_mask);
if (tag_mask == TAG_INT_MASK)
return TRUE;
fdv_adr = UnTag_FDV(word);
switch (Rd_Integer_Check(method_word))
{
case METHOD_MIN:
return Indomain... | false | false | false | false | false | 0 |
cx_edit_w_left_(void)
{
const char *line;
if (textline->curs > 0) {
line = USTR(textline->line);
while (textline->curs > 0 && line[textline->curs - 1] == ' ')
textline->curs--;
while (textline->curs > 0 && line[textline->curs - 1] != ' ')
textline->curs--;
edit_update_cursor();
}
} | false | false | false | false | false | 0 |
fcc_get_kdc_offset(krb5_context context, krb5_ccache id, krb5_deltat *kdc_offset)
{
krb5_error_code ret;
krb5_storage *sp = NULL;
int fd;
ret = init_fcc(context, id, "get-kdc-offset", &sp, &fd, kdc_offset);
if (sp)
krb5_storage_free(sp);
fcc_unlock(context, fd);
close(fd);
return ret;
... | false | false | false | false | false | 0 |
_z_factor_SQUFOF(unsigned long n)
{
unsigned long sqroot = z_intsqrt(n);
unsigned long p = sqroot;
unsigned long q = n - sqroot*sqroot;
if (q == 0)
{
return sqroot;
}
unsigned long l = 1 + 2*z_intsqrt(2*p);
unsigned long l2 = l/2;
unsigned long iq, pnext;
unsig... | false | false | false | false | false | 0 |
skip(void)
{
int i;
long n;
char buf[Bsize];
if(units == CHARS) {
for( ; count>0; count -=n) {
n = count<Bsize? count: Bsize;
if(!(n = tread(buf, n)))
return;
}
} else /*units == LINES*/ {
n = i = 0;
while(count > 0) {
if(!(n = tread(buf, Bsize)))
return;
for(i=0; i<n && count>0; i++)
... | true | true | false | false | false | 1 |
get_next_command(char *line, int linelen, int timeout)
{
struct timeval timeval;
fd_set rmask;
char *stop;
int p;
char c;
int rc;
*line = '\0';
p = 0;
c = 0;
while (TRUE)
{
VBOX_ONE_FD_MASK(&rmask, STDIN_FILENO);
timeval.tv_sec = timeout;
timeval.tv... | false | true | false | false | true | 1 |
main(int argc, char *argv[])
{
int opt;
int interface = -1;
int trigger=0;
int convert_bs = 0;
int poll_interval = 200; /* in ms */
char ifname_buf[255];
char *ifname;
struct ether_addr addr;
if (argc < 2)
{
return usage(stdout, argv[0]);
}
/* Look for MOPRC_INT... | false | false | false | false | false | 0 |
test_vlstring_type(void)
{
hid_t fid; /* HDF5 File IDs */
hid_t tid_vlstr;
H5T_cset_t cset;
H5T_str_t pad;
htri_t vl_str; /* Whether string is VL */
herr_t ret;
/* Output message about ... | false | false | false | false | false | 0 |
vl_pgm_insert(FILE* f, VlPgmImage const *im, void const *data)
{
vl_size bpp = vl_pgm_get_bpp (im) ;
vl_size data_size = vl_pgm_get_npixels (im) ;
size_t c ;
/* write preamble */
fprintf(f,
"P5\n%d\n%d\n%d\n",
(signed)im->width,
(signed)im->height,
(signed)im->max_valu... | false | false | false | false | false | 0 |
navigateLocalProtocol( khtml::ChildFrame* /*child*/, KParts::ReadOnlyPart *inPart,
const KUrl& url )
{
if (!qobject_cast<KHTMLPart*>(inPart))
return false;
KHTMLPart* p = static_cast<KHTMLPart*>(static_cast<KParts::ReadOnlyPart *>(inPart));
p->begin();
/... | false | false | false | false | false | 0 |
check_time (char *time)
{
static GRegex *re = NULL;
if (!re) {
if (NULL == (re = g_regex_new ("^[0-9]+(.[0-9]+)?$", G_REGEX_EXTENDED, 0,
NULL)))
return FALSE;
}
if (g_regex_match (re, time, 0, NULL))
return TRUE;
return FALSE;
} | false | false | false | false | false | 0 |
zput(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
os_ptr op1 = op - 1;
os_ptr op2 = op1 - 1;
byte *sdata;
uint ssize;
switch (r_type(op2)) {
case t_dictionary:
if (i_ctx_p->in_superexec == 0)
check_dict_write(*op2);
{
int code = idict_put(... | false | false | false | false | false | 0 |
history_get_time (hist)
HIST_ENTRY *hist;
{
char *ts;
time_t t;
if (hist == 0 || hist->timestamp == 0)
return 0;
ts = hist->timestamp;
if (ts[0] != history_comment_char)
return 0;
t = (time_t) atol (ts + 1); /* XXX - should use strtol() here */
return t;
} | false | false | false | false | false | 0 |
unit_flag_rule_name(enum unit_flag_id id)
{
fc_assert_ret_val(ARRAY_SIZE(flag_names) == F_USER_FLAG_1, NULL);
fc_assert_ret_val(id >= 0 && id < F_LAST, NULL);
if (id < F_USER_FLAG_1) {
return flag_names[id];
}
return user_flag_names[id - F_USER_FLAG_1];
} | false | false | false | false | false | 0 |
direct_thread_get_name( DirectThread *thread )
{
D_MAGIC_ASSERT( thread, DirectThread );
D_ASSERT( thread->name != NULL );
return thread->name;
} | false | false | false | false | false | 0 |
prefixItems(const std::string &content, std::string &result,
const std::string &prefix)
{
std::vector<std::string> entries;
cmGeneratorExpression::Split(content, entries);
const char *sep = "";
for(std::vector<std::string>::const_iterator ei = entries.begin();
ei != entries.end(); ... | false | false | false | false | false | 0 |
mmapForLinker (size_t bytes, nat flags, int fd)
{
void *map_addr = NULL;
void *result;
int pagesize, size;
static nat fixed = 0;
IF_DEBUG(linker, debugBelch("mmapForLinker: start\n"));
pagesize = getpagesize();
size = ROUND_UP(bytes, pagesize);
#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH... | false | false | false | false | false | 0 |
vmw_gmrid_man_put_node(struct ttm_mem_type_manager *man,
struct ttm_mem_reg *mem)
{
struct vmwgfx_gmrid_man *gman =
(struct vmwgfx_gmrid_man *)man->priv;
if (mem->mm_node) {
spin_lock(&gman->lock);
ida_remove(&gman->gmr_ida, mem->start);
gman->used_gmr_pages -= mem->num_pages;
spin_unlock(&gman->loc... | false | false | false | false | false | 0 |
clear()
{
// Set the selected cells to zero
ride->ride()->command->startLUW("Clear cells");
foreach (QModelIndex current, table->selectionModel()->selection().indexes()) {
setModelValue(current.row(), current.column(), (double)0.0);
}
ride->ride()->command->endLUW();
} | false | false | false | false | false | 0 |
pk_iso8601_to_datetime (const gchar *iso_date)
{
gboolean ret = FALSE;
guint retval;
guint d = 0;
guint m = 0;
guint y = 0;
GTimeVal time_val;
GDateTime *date = NULL;
if (iso_date == NULL || iso_date[0] == '\0')
goto out;
/* try to parse complete ISO8601 date */
if (g_strstr_len (iso_date, -1, " ") != NUL... | false | false | false | false | false | 0 |
insert_linked_type_at(Node *old, Node *new_node, int before = 1) {
Node *p = 0;
if (!first_linked_type) {
add_linked_type(new_node);
return;
}
if (!before) {
Setattr(new_node, "allegrocl:next_linked_type", Getattr(old, "allegrocl:next_linked_type"));
Setattr(old, "allegrocl:next_linked_type", ... | false | false | false | false | false | 0 |
nodeInduce(Agraph_t * g, Agraph_t * eg)
{
Agnode_t *n;
Agedge_t *e;
int e_cnt = 0;
for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
for (e = agfstout(eg, n); e; e = agnxtout(eg, e)) {
if (agsubnode(g, aghead(e), 0)) {
agsubedge(g, e, 1);
e_cnt++;
}
}
}
return e_cnt;
} | false | false | false | false | false | 0 |
GetAsPercents() const
{
double result;
std::vector<double> results;
std::vector<double>::const_iterator end = values_.end();
for( std::vector<double>::const_iterator i=values_.begin(); i!=end; ++i )
{
result = setAsPercent_ ? (*i) : (*i)/(max_-min_)*100.0;
results.push_back(std::min(100.0,std::max(0.0... | false | false | false | false | false | 0 |
tk_debug_show_sleep_time(struct seq_file *s, void *data)
{
unsigned int bin;
seq_puts(s, " time (secs) count\n");
seq_puts(s, "------------------------------\n");
for (bin = 0; bin < 32; bin++) {
if (sleep_time_bin[bin] == 0)
continue;
seq_printf(s, "%10u - %-10u %4u\n",
bin ? 1 << (bin - 1) :... | false | false | false | false | false | 0 |
psdf_get_image_params(gs_param_list * plist,
const psdf_image_param_names_t * pnames, psdf_image_params * params)
{
/* Skip AutoFilter for mono images. */
const gs_param_item_t *items =
(pnames->items[0].key == 0 ? pnames->items + 1 : pnames->items);
int code;
/*
* We must actual... | false | false | false | false | false | 0 |
nv_gotofile(cap)
cmdarg_T *cap;
{
char_u *ptr;
linenr_T lnum = -1;
if (text_locked())
{
clearopbeep(cap->oap);
text_locked_msg();
return;
}
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
{
clearop(cap->oap);
return;
}
#endif
ptr = grab_file_name(cap->count1, &lnum);
if (ptr... | false | false | false | false | false | 0 |
_isValidTradeDate(const MSDate& date_, const MSResourceHolidaySet& set_)
{
if(date_.isSet()==MSFalse) return MSFalse;
MSDay day=date_.weekDay();
if (day==MSDate::Saturday||day==MSDate::Sunday) return MSFalse;
else return (_isHoliday(date_,set_)==MSTrue)?MSFalse:MSTrue;
} | false | false | false | false | false | 0 |
ltc294x_write_regs(struct i2c_client *client,
enum ltc294x_reg reg, const u8 *buf, int num_regs)
{
int ret;
u8 reg_start = reg;
ret = i2c_smbus_write_i2c_block_data(client, reg_start, num_regs, buf);
if (ret < 0) {
dev_err(&client->dev, "ltc2941 write_reg failed!\n");
return ret;
}
dev_dbg(&client->dev, "%... | false | false | false | false | false | 0 |
flickcurl_photos_people_editCoords(flickcurl* fc, const char* photo_id,
const char* user_id,
int person_x, int person_y,
int person_w, int person_h)
{
xmlDocPtr doc = NULL;
xmlXPathContextPtr xpathCtx = NULL;
... | false | false | false | false | false | 0 |
ipa_prop_write_jump_functions (cgraph_node_set set)
{
struct cgraph_node *node;
struct output_block *ob;
unsigned int count = 0;
cgraph_node_set_iterator csi;
if (!ipa_node_params_vector)
return;
ob = create_output_block (LTO_section_jump_functions);
ob->cgraph_node = NULL;
for (csi = csi_start (s... | false | false | false | false | false | 0 |
router_addr_is_trusted_dir(uint32_t addr)
{
if (!trusted_dir_servers)
return 0;
SMARTLIST_FOREACH(trusted_dir_servers, trusted_dir_server_t *, ent,
if (ent->addr == addr)
return 1;
);
return 0;
} | 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.