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 |
|---|---|---|---|---|---|---|
range_error(ScmObj obj, int clamp, int *oor)
{
if (clamp == SCM_CLAMP_NONE && oor != NULL) {
*oor = TRUE;
} else {
Scm_Error("argument out of range: %S", obj);
}
} | false | false | false | false | false | 0 |
ft_bitmap_glyph_init( FT_BitmapGlyph glyph,
FT_GlyphSlot slot )
{
FT_Error error = FT_Err_Ok;
FT_Library library = FT_GLYPH(glyph)->library;
FT_Memory memory = library->memory;
if ( slot->format != ft_glyph_format_bitmap )
{
error = FT_Err_Invalid_Glyph... | false | false | false | false | false | 0 |
begin_import()
{
m_progress_bar->set_text("0");
m_progress_bar->set_fraction(0.0);
m_progress_connection = Glib::signal_idle().connect(sigc::mem_fun(*this, &Dialog_Import_CSV_Progress::on_idle_import));
} | false | false | false | false | false | 0 |
HandleForceMoveForward(bool apply, bool Real)
{
if (!Real)
return;
if (apply)
GetTarget()->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVE);
else
GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVE);
} | false | false | false | false | false | 0 |
UnitRandom ()
{
if (mRandProvider)
return mRandProvider->getRandomUnit();
else return asm_rand() / asm_rand_max();
} | false | false | false | false | false | 0 |
clip_dump(char *state, struct OVERLAY_CLIP *oc, int count)
{
int i;
fprintf(stderr,"clip: %s - %d clips\n",state,count);
for (i = 0; i < count; i++)
fprintf(stderr,"clip: %d: %dx%d+%d+%d\n",i,
oc[i].x2 - oc[i].x1,
oc[i].y2 - oc[i].y1,
oc[i].x1, oc[i].y1);
} | false | false | false | false | false | 0 |
undoCmd(void)
{
// do a user-atomic undo.
// return false if we can't.
PX_ChangeRecord * pcr;
if (!m_history.getUndo(&pcr))
return false;
UT_return_val_if_fail (pcr,false);
// the first undo record tells us whether it is
// a simple change or a glob. there are two kinds
// of globs: a multi-step change (d... | false | false | false | false | false | 0 |
get_tokval(const char* line, char **retdata) {
int i;
char tokval[ARGLEN];
for(i=0; i < ARGLEN && (*(line+i) != ')'); i++)
tokval[i] = *(line+i);
tokval[i] = '\0';
*retdata = strdup(tokval);
return i+1;
} | true | true | false | false | false | 1 |
setGameDir()
{
if(cursor.dir & DIR_LEFT) {
if(game.dir != DIR_LEFT) {
game.dir_changed = 1;
game.face = 0;
}
game.dir = DIR_LEFT;
} else if(cursor.dir & DIR_RIGHT) {
if(game.dir != DIR_RIGHT) {
game.dir_changed = 1;
game.face = 0;
}
game.dir = DIR_RIGHT;
}
} | false | false | false | false | false | 0 |
_bt_getbuf(Relation rel, BlockNumber blkno, int access)
{
Buffer buf;
if (blkno != P_NEW)
{
/* Read an existing block of the relation */
buf = ReadBuffer(rel, blkno);
LockBuffer(buf, access);
_bt_checkpage(rel, buf);
}
else
{
bool needLock;
Page page;
Assert(access == BT_WRITE);
/*
* Firs... | false | false | false | false | true | 1 |
getProfileName(const E_ApplicationProfile profile)
{
const char *result = "";
switch(profile)
{
case AP_GeneralPurpose:
result = "STD-GEN-CD/DVD-RAM";
break;
case AP_GeneralPurposeDVD:
result = "STD-GEN-DVD-JPEG/J2K";
break;
case AP_Gen... | false | false | false | false | false | 0 |
_gnutls_signature_algorithm_send_params (gnutls_session_t session,
opaque * data, size_t data_size)
{
int ret;
gnutls_protocol_t ver = gnutls_protocol_get_version (session);
/* this function sends the client extension data */
if (session->security_parameters.entity == G... | false | false | false | false | false | 0 |
autocomplete_doc_word(GeanyEditor *editor, gchar *root, gsize rootlen)
{
ScintillaObject *sci = editor->sci;
GSList *words, *node;
GString *str;
guint n_words = 0;
words = get_doc_words(sci, root, rootlen);
if (!words)
{
scintilla_send_message(sci, SCI_AUTOCCANCEL, 0, 0);
return FALSE;
}
str = g_string_s... | false | false | false | false | false | 0 |
intel_hdmi_detect(struct drm_connector *connector, bool force)
{
enum drm_connector_status status;
struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
struct drm_i915_private *dev_priv = to_i915(connector->dev);
bool live_status = false;
unsigned int try;
DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
... | false | false | false | false | false | 0 |
paging_test_plus3( void )
{
int r = 0;
r += paging_test_128_unlocked( 2 );
writeport_internal( 0x7ffd, 0x00 );
writeport_internal( 0x1ffd, 0x04 );
r += assert_16k_pages( 2, 5, 2, 0 );
TEST_ASSERT( memory_current_screen == 5 );
writeport_internal( 0x7ffd, 0x10 );
r += assert_16k_pages( 3, 5, 2, 0 );... | false | false | false | false | false | 0 |
lam_deregister_object(int deltype, char *delobj)
{
struct stat fstatus; /* registry file status */
int fd; /* registry file descriptor */
char obj[MAXPATHLEN]; /* object name */
char type; /* object type */
if (set_names("lam_deregister_object") == LAMERROR)
return;
if (lock_reg... | true | true | false | false | true | 1 |
sheet_objects_clear (Sheet const *sheet, GnmRange const *r, GType t,
GOUndo **pundo)
{
GSList *ptr, *next;
g_return_if_fail (IS_SHEET (sheet));
for (ptr = sheet->sheet_objects; ptr != NULL ; ptr = next ) {
GObject *obj = G_OBJECT (ptr->data);
next = ptr->next;
if ((t == G_TYPE_NONE && G_OBJECT_TYPE (o... | false | false | false | false | false | 0 |
check_cast (tree to_type, tree from)
{
tree from_type = get_canon_type (TREE_TYPE (from), false, false);
bool to_interesting_type, from_interesting_type;
enum cast_type cast = CT_NO_CAST;
to_type = get_canon_type (to_type, false, false);
if (!from_type || !to_type || from_type == to_type)
return cast;
... | false | false | false | false | false | 0 |
xfs_attr_put_listent(
xfs_attr_list_context_t *context,
int flags,
unsigned char *name,
int namelen,
int valuelen,
unsigned char *value)
{
struct attrlist *alist = (struct attrlist *)context->alist;
attrlist_ent_t *aep;
int arraytop;
ASSERT(!(context->flags & ATTR_KERNOVAL));
ASSERT(context->count >= 0);... | false | true | false | false | false | 1 |
flexcop_pci_dma_exit(struct flexcop_pci *fc_pci)
{
if (fc_pci->init_state & FC_PCI_DMA_INIT) {
flexcop_dma_free(&fc_pci->dma[0]);
flexcop_dma_free(&fc_pci->dma[1]);
}
fc_pci->init_state &= ~FC_PCI_DMA_INIT;
} | false | false | false | false | false | 0 |
gearman_packet_free(gearman_packet_st *packet)
{
#ifdef GEARMAN_PACKET_TRACE
fprintf(stderr, "%s PACKET %u\n", __func__, packet->_id);
custom_backtrace();
#endif
if (packet->args != packet->args_buffer and packet->args)
{
// Created with realloc
free(packet->args);
packet->args= NULL;
}
assert_... | false | false | false | false | false | 0 |
inf_gtk_browser_view_set_property(GObject* object,
guint prop_id,
const GValue* value,
GParamSpec* pspec)
{
InfGtkBrowserView* view;
view = INF_GTK_BROWSER_VIEW(object);
switch(prop_id)
{
case PROP_MODEL:
... | false | false | false | false | false | 0 |
encx24j600_regmap_writeable(struct device *dev, unsigned int reg)
{
if ((reg < 0x12) ||
((reg >= 0x14) && (reg < 0x1a)) ||
((reg >= 0x1c) && (reg < 0x36)) ||
((reg >= 0x40) && (reg < 0x4c)) ||
((reg >= 0x52) && (reg < 0x56)) ||
((reg >= 0x60) && (reg < 0x68)) ||
((reg >= 0x6c) && (reg < 0... | false | false | false | false | false | 0 |
restore_security_context(THD *thd,
Security_context *backup)
{
if (backup)
thd->security_ctx= backup;
} | false | false | false | false | false | 0 |
drawPolyline( QPainter *painter,
const QPointF *points, int pointCount, bool polylineSplitting )
{
bool doSplit = false;
if ( polylineSplitting )
{
const QPaintEngine *pe = painter->paintEngine();
if ( pe && pe->type() == QPaintEngine::Raster )
{
/*
Th... | false | false | false | false | false | 0 |
totable(value_t v, char *fname)
{
if (!ishashtable(v))
type_error(fname, "table", v);
return (htable_t*)cv_data((cvalue_t*)ptr(v));
} | false | false | false | false | false | 0 |
OSBase_CSProcessorProviderGetInstance( CMPIInstanceMI * mi,
const CMPIContext * ctx,
const CMPIResult * rslt,
const CMPIObjectPath * cop,
const char ** properties) {
const CMPIInstance * ci = NULL;
CMPIStatus rc = {CMPI_RC_OK, NULL};
_OSBASE_TRACE(1,("--- %s CM... | false | false | false | false | false | 0 |
tabSide(const QStyleOptionTab* tbOpt) const
{
switch (tbOpt->shape)
{
case QTabBar::RoundedEast:
case QTabBar::TriangularEast:
return East;
case QTabBar::RoundedWest:
case QTabBar::TriangularWest:
return West;
case QTabBar::RoundedNorth:
case QTabBar::TriangularNorth:
... | false | false | false | false | false | 0 |
dispatchHTMLEvent(int _id, bool canBubbleArg, bool cancelableArg)
{
int exceptioncode = 0;
EventImpl* const evt = new EventImpl(static_cast<EventImpl::EventId>(_id),canBubbleArg,cancelableArg);
evt->ref();
dispatchEvent(evt,exceptioncode,true);
bool ret = !evt->defaultPrevented();
evt->deref();
... | false | false | false | false | false | 0 |
dtmfActionsAdd( GtkWidget *psButton, gpointer pUserData ) {
GtkBuilder *psBuilder = NULL;
GtkWidget *psDialog = NULL;
GtkWidget *psNameEntry = NULL;
GtkWidget *psCallerEntry = NULL;
GtkWidget *psCalledEntry = NULL;
GtkWidget *psCodeEntry = NULL;
GtkWidget *psExecEntry = NULL;
struct sDtmf *psDtmf = NULL;
GErro... | false | false | false | false | false | 0 |
name_size(struct jfs_ea *ea)
{
if (is_os2_xattr(ea))
return ea->namelen + XATTR_OS2_PREFIX_LEN;
else
return ea->namelen;
} | false | false | false | false | false | 0 |
clone(void) const
{
AUDIO_IO_TONE* target = new AUDIO_IO_TONE();
for(int n = 0; n < number_of_params(); n++) {
target->set_parameter(n + 1, get_parameter(n + 1));
}
target->set_position_in_samples(position_in_samples());
if (ECA_AUDIO_POSITION::length_set())
target->ECA_AUDIO_POSITION::set_length_in... | false | false | false | false | false | 0 |
ttm_dma_pool_alloc_new_pages(struct dma_pool *pool,
struct list_head *d_pages,
unsigned count)
{
struct page **caching_array;
struct dma_page *dma_p;
struct page *p;
int r = 0;
unsigned i, cpages;
unsigned max_cpages = min(count,
(unsigned)(PAGE_SIZE/sizeof(struct page *)));
/* allocate array for p... | false | false | false | false | false | 0 |
set_error(int error_class, char *string)
{
git_error *error = &GIT_GLOBAL->error_t;
if (error->message != string)
git__free(error->message);
error->message = string;
error->klass = error_class;
GIT_GLOBAL->last_error = error;
} | false | false | false | false | false | 0 |
timerEvent( QTimerEvent * e )
{
if(e->timerId() == _dbTimerId)
{
QSqlDatabase db = QSqlDatabase::database(QSqlDatabase::defaultConnection,FALSE);
if(db.isOpen())
{
QSqlQuery qry("SELECT CURRENT_DATE;");
}
// if we are not connected then we have some problems!
}
} | false | false | false | false | false | 0 |
infgetw(INFILE * inpf)
{
/* TODO: handle expstr errors */
int ch = EOF;
BOOL wordread = FALSE;
STRPTR thisword = NULL;
BOOL ok = TRUE;
/* set function for normal chars */
BOOL(*isnc) (int ch) = inpf->is_nc;
if (isnc == NULL)
isnc = default_normch;
/* skip all white spaces */
infski... | false | false | false | false | false | 0 |
DoClean(CommandLine &)
{
std::string const archivedir = _config->FindDir("Dir::Cache::archives");
std::string const pkgcache = _config->FindFile("Dir::cache::pkgcache");
std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache");
if (_config->FindB("APT::Get::Simulate") == true)
{
... | false | false | false | false | false | 0 |
z_remove_precomp(unsigned long * n, unsigned long p, double pinv)
{
unsigned long quot, rem;
int exp = 0;
if (p == 2)
{
count_trail_zeros(exp, *n);
if (exp)
{
*n = ((*n)>>exp);
}
return exp;
}
quot = z_div2_precomp(*n, p, pinv);
rem = (*n) - quot*p;
... | false | false | false | false | false | 0 |
gfs2_glock_hold(struct gfs2_glock *gl)
{
GLOCK_BUG_ON(gl, __lockref_is_dead(&gl->gl_lockref));
lockref_get(&gl->gl_lockref);
} | false | false | false | false | false | 0 |
GifReadDimensions(FILE *file, DWORD *height, DWORD *width)
{
BYTE buff[4];
/* move to the image size position in the file header */
if(fseek(file, 6, SEEK_SET) != 0)
{
DEBUG_PRINT(("unable to seek to start of GIF file"));
return FALSE;
}
/* read width and height into a byte arr... | false | false | false | false | false | 0 |
__do_mdsplit(struct mod_t *smdp)
{
char s1[IDLEN];
struct sy_t *syp;
/* for master, version no. is highest of split off, else actual no. */
if (!smdp->msplit)
{
/* __splitting a module effects exactly one flattened inst. too */
/* flat inst counts and version numbers only kept in original master */
(smd... | true | true | false | false | false | 1 |
prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
GeglChant *self = GEGL_CHANT (operation);
/* If the src is NULL, and we previously used a source, clear what we have
* cached and directly link the input and output. We don't need a composite
* operation if we don't hav... | false | false | false | false | false | 0 |
node_child_add_callback(GtFeatureNode *parent,
GtFeatureNode *child,
void *data)
{
int had_err = 0;
unsigned long *id, *child_id;
ObserverCallbackInfo *info = (ObserverCallbackInfo*) data;
gt_assert(parent && child);
if ((id = node_ul_gt_h... | false | false | false | false | false | 0 |
ETen_B5_V_Init (HPDF_Encoder encoder)
{
HPDF_CMapEncoderAttr attr;
HPDF_STATUS ret;
if ((ret = HPDF_CMapEncoder_InitAttr (encoder)) != HPDF_OK)
return ret;
attr = (HPDF_CMapEncoderAttr)encoder->attr;
if ((ret = HPDF_CMapEncoder_AddCMap (encoder, CMAP_ARRAY_ETen_B5_H)) !=
HPD... | false | false | false | false | false | 0 |
getSelected() const
{
if( Owner )
{
return Owner->Selected == (IGUITreeViewNode*)this;
}
else
{
return false;
}
} | false | false | false | false | false | 0 |
SubstYInfo (CNet* nwa, CNet* nwb, CNet* nwc, Orientation orient){
CCnxn* ca = nwa->Cnxn();
CCnxn* cb = nwb->Cnxn();
CCnxn* cc = nwc->Cnxn();
Connector* shared = Shared(ca, cb);
Connector* conna = (ca->_lbConn == shared) ? ca->_rtConn : ca->_lbConn;
Connector* connb = (cb->_lbConn == shared) ? cb... | false | false | false | false | false | 0 |
I_Scale1x(int x1, int y1, int x2, int y2)
{
byte *bufp, *screenp;
int y;
int w = x2 - x1;
// Need to byte-copy from buffer into the screen buffer
bufp = src_buffer + y1 * SCREENWIDTH + x1;
screenp = (byte *) dest_buffer + y1 * dest_pitch + x1;
for (y=y1; y<y2; ++y)
{
memcp... | false | true | false | false | false | 1 |
load_module( Chuck_Env * env, f_ck_query query,
const char * name, const char * nspc )
{
Chuck_DLL * dll = NULL;
t_CKBOOL query_failed = FALSE;
// load osc
dll = new Chuck_DLL( name );
if( !dll->load( query ) || (query_failed = !dll->query()) ||
!type_engine_add_... | false | false | false | false | false | 0 |
clean_ttyname (char *tty)
{
char *res = tty;
if (strncmp (res, _PATH_DEV, strlen(_PATH_DEV)) == 0)
res += strlen(_PATH_DEV);
if (strncmp (res, "pty/", 4) == 0)
res += 4;
if (strncmp (res, "ptym/", 5) == 0)
res += 5;
return res;
} | false | false | false | false | false | 0 |
isInvariantLoad(AliasAnalysis *AA) const {
// If the instruction doesn't load at all, it isn't an invariant load.
if (!TID->mayLoad())
return false;
// If the instruction has lost its memoperands, conservatively assume that
// it may not be an invariant load.
if (memoperands_empty())
return false;
... | false | false | false | false | false | 0 |
tenEMBimodalParmNew() {
tenEMBimodalParm *biparm;
biparm = (tenEMBimodalParm*)calloc(1, sizeof(tenEMBimodalParm));
if (biparm) {
biparm->minProb = 0.0001;
biparm->minProb2 = 0.0001;
biparm->minDelta = 0.00001;
biparm->minFraction = 0.05; /* 5% */
biparm->minConfidence = 0.7;
biparm->maxI... | false | false | false | false | false | 0 |
dtmf_tx_init(dtmf_tx_state_t *s)
{
if (s == NULL)
{
if ((s = (dtmf_tx_state_t *) malloc(sizeof (*s))) == NULL)
return NULL;
}
if (!dtmf_tx_inited)
dtmf_tx_initialise();
tone_gen_init(&(s->tones), &dtmf_digit_tones[0]);
dtmf_tx_set_level(s, DEFAULT_DTMF_TX_LEVEL, 0);
... | false | false | false | false | false | 0 |
_set_ignore_ca_cert (GConfClient *client, const char *uuid, gboolean phase2)
{
char *key = NULL;
g_return_if_fail (uuid != NULL);
key = g_strdup_printf (APPLET_PREFS_PATH "/%s/%s",
phase2 ? "ignore-phase2-ca-cert" : "ignore-ca-cert",
uuid);
gconf_client_set_bool (cl... | false | false | false | false | false | 0 |
CreateRegularAntiprism(uint32_t numBaseEdges,double baseRadius,double height) {
return CreateCustomAntiprism(generateBase(numBaseEdges,baseRadius),generateShiftedBase(numBaseEdges,baseRadius),height);
} | false | false | false | false | false | 0 |
nm_agent_manager_get_agent_by_user (NMAgentManager *self, const char *username)
{
NMAgentManagerPrivate *priv = NM_AGENT_MANAGER_GET_PRIVATE (self);
GHashTableIter iter;
NMSecretAgent *agent;
g_hash_table_iter_init (&iter, priv->agents);
while (g_hash_table_iter_next (&iter, NULL, (gpointer) &agent)) {
if (g_st... | false | false | false | false | false | 0 |
signapex(void) {
dns_dbnode_t *node = NULL;
dns_fixedname_t fixed;
dns_name_t *name;
isc_result_t result;
dns_fixedname_init(&fixed);
name = dns_fixedname_name(&fixed);
result = dns_dbiterator_seek(gdbiter, gorigin);
check_result(result, "dns_dbiterator_seek()");
result = dns_dbiterator_current(gdbiter, &node... | false | false | false | false | false | 0 |
dtr( struct tnl_pipeline_stage *stage )
{
struct vertex_stage_data *store = VERTEX_STAGE_DATA(stage);
if (store) {
_mesa_vector4f_free( &store->eye );
_mesa_vector4f_free( &store->clip );
_mesa_vector4f_free( &store->proj );
_mesa_align_free( store->clipmask );
free(store);
st... | false | false | false | false | false | 0 |
operator-(const Systime st)
{
Systime temp;
temp._tv.tv_sec = _tv.tv_sec - st._tv.tv_sec;
temp._tv.tv_usec = _tv.tv_usec - st._tv.tv_usec;
temp._tp = localtime ((time_t *) &_tv.tv_sec);
return temp;
} | false | false | false | false | false | 0 |
status_reinit(unsigned cmask)
{
unsigned i;
if (cmask & FONT_CHANGE)
nullblank = *standard_font ? ' ' : CG_space;
if (cmask & (FONT_CHANGE | MODEL_CHANGE)) {
status_y = STATUS_Y;
if (!*descent)
++status_y;
}
if (cmask & MODEL_CHANGE) {
Replace(status_line,
(struct status_line *)XtCalloc(sizeof(st... | false | false | false | false | false | 0 |
avdtp_getconf_cmd(struct avdtp *session, uint8_t transaction,
struct seid_req *req, int size)
{
GSList *l;
struct avdtp_local_sep *sep = NULL;
int rsp_size;
uint8_t err;
uint8_t buf[1024];
uint8_t *ptr = buf;
if (size < (int) sizeof(struct seid_req)) {
error("Too short getconf request");
return FALSE;
... | false | false | false | false | false | 0 |
gamgi_io_token_size_check (const char *token, int length)
{
/***********************************************
* Check whether token is larger than max char *
* To disable this test make length = INT_MAX. *
***********************************************/
if (strlen (token) > length - 1) return FALSE;
return TRUE;
} | false | false | false | false | false | 0 |
TakeSnapshot(Handle<String> title,
HeapSnapshot::Type type,
ActivityControl* control) {
IsDeadCheck("v8::HeapProfiler::TakeSnapshot");
i::HeapSnapshot::Type internal_type = i::HeapSnapshot::kFull;
switch (type) {
cas... | false | false | false | false | false | 0 |
find_grain_value(GtkTreeModel *model,
GwyGrainValue *gvalue,
GtkTreeIter *iter)
{
GwyGrainValue *igvalue;
GtkTreeIter siter;
if (!find_grain_group(model, gwy_grain_value_get_group(gvalue), &siter)
|| !gtk_tree_model_iter_children(model, iter, &siter))
retur... | false | false | false | false | false | 0 |
se_BuildChatString( ePlayerNetID const * sender, ePlayerNetID const * receiver, tString const & message )
{
tColoredString console;
console << *sender;
console << tColoredString::ColorString(1,1,.5) << " --> ";
console << *receiver;
console << tColoredString::ColorString(1,1,.5) << ": ";
se_Appe... | false | false | false | false | false | 0 |
partition_hot_cold_basic_blocks (void)
{
vec<edge> crossing_edges;
if (n_basic_blocks <= NUM_FIXED_BLOCKS + 1)
return 0;
df_set_flags (DF_DEFER_INSN_RESCAN);
crossing_edges = find_rarely_executed_basic_blocks_and_crossing_edges ();
if (!crossing_edges.exists ())
return 0;
/* Make sure the source... | false | false | false | false | false | 0 |
__process_vpidrv_ev(i_tev_ndx tevpi)
{
register struct net_t *np;
register struct dltevlst_t *dlp;
register word32 *ap, *bp;
int32 ndx, evi;
struct teputv_t *tepvp;
i_tev_ndx *evtabi;
struct h_t *hp;
struct hrec_t *hrp;
tepvp = __tevtab[tevpi].tu.teputvp;
__tevtab[tevpi].tu.teputvp = NULL;
np = tepvp->np;... | false | false | false | false | false | 0 |
gdk_pixbuf__xbm_image_load_real (FILE *f,
XBMData *context,
GError **error)
{
guint w, h;
int x_hot, y_hot;
guchar *data, *ptr;
guchar *pixels;
guint row_stride;
int x, y;
int reg = 0; /* Quiet compiler */
int bits;
GdkPixbuf *pixbuf;
if (!read_bitmap_file_data (f, &w, &h, &data, &x_hot, &... | false | false | false | false | false | 0 |
scm_i_thread_wake_up ()
{
if (threads_initialized_p)
{
scm_i_thread *t;
scm_i_pthread_cond_broadcast (&wake_up_cond);
for (t = all_threads; t; t = t->next_thread)
scm_i_pthread_mutex_unlock (&t->heap_mutex);
scm_i_pthread_mutex_unlock (&thread_admin_mutex);
scm_enter_guile ((scm_t_... | false | false | false | false | false | 0 |
endSync(bool success)
{
// store changes persistently
flush();
if (success) {
string updatedRevision = databaseRevision();
m_metaNode->setProperty("databaseRevision", updatedRevision);
// flush both nodes, just in case; in practice, the properties
// end up in the same file ... | false | false | false | false | false | 0 |
_buildCacheFunctions(TYPEMAKER2_BUILDER *tb, TYPEMAKER2_TYPE *ty) {
GWEN_BUFFER *tbuf;
const char *s;
TYPEMAKER2_TYPEMANAGER *tym;
tym=Typemaker2_Builder_GetTypeManager(tb);
tbuf=GWEN_Buffer_new(0, 256, 0, 1);
/* public prototypes */
GWEN_Buffer_AppendString(tbuf, "/* cache functions */\n");
s=Typema... | false | false | false | false | false | 0 |
GetNativeInfo ( const TIFF_Manager & exif, XMP_Uns8 ifd, XMP_Uns16 id, TIFF_Manager::TagInfo * info )
{
bool haveExif = exif.GetTag ( ifd, id, info );
if ( haveExif ) {
XMP_Uns32 i;
char * chPtr;
XMP_Assert ( (info->dataPtr != 0) || (info->dataLen == 0) ); // Null pointer requires zero length.
bool isDa... | false | false | false | false | true | 1 |
tdelete(const string& url)
{
CURL *curl;
CURLcode res;
tbuffer = "HTTP delete error";
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
string sAuth = tid + ":" + ttoken;
curl_easy_setopt(curl, C... | false | false | false | false | false | 0 |
xkeyboard_layout_change(struct xkeyboard *xkeyboard)
{
START_FUNC
#ifdef ENABLE_XKB
guint newgroup;
XkbStateRec xkbState;
Display *disp=(Display *)gdk_x11_get_default_xdisplay();
XkbGetState(disp, XkbUseCoreKbd, &xkbState);
newgroup=(xkbState.group+1)%g_list_length(xkeyboard->groups);
if (XkbLockGroup(disp, XkbU... | false | false | false | false | false | 0 |
pingpong_draw_sprites( struct mame_bitmap *bitmap )
{
int offs;
for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
{
int sx,sy,flipx,flipy,color,schar;
sx = spriteram[offs + 3];
sy = 241 - spriteram[offs + 1];
flipx = spriteram[offs] & 0x40;
flipy = spriteram[offs] & 0x80;
color = spri... | false | false | false | false | false | 0 |
read(bool readProperties, Properties::ReadStyle propertiesStyle)
{
// Look for an ID3v2 tag
d->ID3v2Location = findID3v2();
if(d->ID3v2Location >= 0) {
d->tag.set(ID3v2Index, new ID3v2::Tag(this, d->ID3v2Location, d->ID3v2FrameFactory));
d->ID3v2OriginalSize = ID3v2Tag()->header()->completeTagSize();
... | false | false | false | false | false | 0 |
embPatBruteForce(const AjPStr seq, const AjPStr pat,
AjBool amino, AjBool carboxyl,
AjPList l, ajuint begin, ajuint mm, const AjPStr name)
{
const char *s;
const char *p;
ajuint sum;
ajuint len;
ajuint i;
ajuint count;
/*
// ajDebug("embPatBruteForce amino:%B carboxyl:%B ... | false | false | false | false | false | 0 |
sysfs_move_dir_ns(struct kobject *kobj, struct kobject *new_parent_kobj,
const void *new_ns)
{
struct kernfs_node *kn = kobj->sd;
struct kernfs_node *new_parent;
new_parent = new_parent_kobj && new_parent_kobj->sd ?
new_parent_kobj->sd : sysfs_root_kn;
return kernfs_rename_ns(kn, new_parent, kn->name, n... | false | false | false | false | false | 0 |
xmlSecGCryptNodeGetMpiValue(const xmlNodePtr cur) {
xmlSecBuffer buf;
gcry_mpi_t res = NULL;
gcry_error_t err;
int ret;
xmlSecAssert2(cur != NULL, NULL);
ret = xmlSecBufferInitialize(&buf, 128);
if(ret < 0) {
xmlSecError(XMLSEC_ERRORS_HERE,
NULL,
... | false | false | false | false | false | 0 |
vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags)
{
struct vb2_dc_buf *buf = buf_priv;
struct dma_buf *dbuf;
DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
exp_info.ops = &vb2_dc_dmabuf_ops;
exp_info.size = buf->size;
exp_info.flags = flags;
exp_info.priv = buf;
if (!buf->sgt_base)
buf->sgt_base = vb2_dc_get_ba... | false | false | false | false | false | 0 |
itemIcon( K3FileTreeViewItem *item, int gap ) const
{
QPixmap pix;
kDebug(250) << "Setting icon for column " << gap;
if( item )
{
/* Check if it is a branch root */
KFileTreeBranch *brnch = item->branch();
if( item == brnch->root() )
{
pix = brnch->pixmap();
if( m_wantOpenFolder... | false | false | false | false | false | 0 |
IsLinearApprox(SplinePoint *from, SplinePoint *to,
TPoint *mid, int cnt, int order2) {
bigreal vx, vy, slope;
int i;
vx = to->me.x-from->me.x; vy = to->me.y-from->me.y;
if ( vx==0 && vy==0 ) {
for ( i=0; i<cnt; ++i )
if ( mid[i].x != from->me.x || mid[i].y != from->me.y )
return( NULL );
} e... | false | false | false | false | false | 0 |
send_file_data(struct mg_connection *conn, struct file *filep,
int64_t offset, int64_t len) {
char buf[MG_BUF_LEN];
int to_read, num_read, num_written;
if (len > 0 && filep->membuf != NULL && filep->size > 0) {
if (len > filep->size - offset) {
len = filep->size - offs... | false | false | true | false | true | 1 |
my_wc_mb_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
if (s >= e)
return MY_CS_TOOSMALL;
if ((uint) wc < 0x80)
{
s[0]= (uchar) wc;
return 1;
}
if (!(code=func_uni_ksc5601_onechar(wc)))
return MY_CS_ILUNI;
if (s+2>e)
return ... | false | false | false | false | false | 0 |
do_main_class(void)
{
struct vm_object *loader = NULL;
if (use_system_classloader) {
loader = get_system_class_loader();
if (!loader)
return -1;
}
if (exception_occurred()) {
return -1;
}
struct vm_class *vmc = classloader_load(loader, classname);
if (!vmc) {
fprintf(stderr, "error: %s: could not l... | false | false | false | false | false | 0 |
evbuffer_add_reference(struct evbuffer *outbuf,
const void *data, size_t datlen,
evbuffer_ref_cleanup_cb cleanupfn, void *extra)
{
struct evbuffer_chain *chain;
struct evbuffer_chain_reference *info;
int result = -1;
chain = evbuffer_chain_new(sizeof(struct evbuffer_chain_reference));
if (!chain)
return... | false | false | false | false | false | 0 |
toolbox_debug_4byte(word32 addr)
{
word32 part1, part2;
/* If addr looks safe, use it */
if(addr > 0xbffc) {
return (word32)-1;
}
part1 = get_memory16_c(addr, 0);
part1 = (part1 >> 8) + ((part1 & 0xff) << 8);
part2 = get_memory16_c(addr+2, 0);
part2 = (part2 >> 8) + ((part2 & 0xff) << 8);
return (part1 <<... | false | false | false | false | false | 0 |
prefs_username_cb (GtkWidget *dialog, GtkEntry *entry)
{
int j;
gchar username[32], *namep;
strncpy (username, gtk_entry_get_text (entry), 31);
prefs_strip_special_chars (username);
for (j = num_highscores + 1; j > highscore_index; j--)
{
if (j >= MAX_HIGHSCORES) continue;
memcpy (scores + j, scores + j - 1, ... | false | false | false | false | false | 0 |
rtsx_pci_card_detect(struct work_struct *work)
{
struct delayed_work *dwork;
struct rtsx_pcr *pcr;
unsigned long flags;
unsigned int card_detect = 0, card_inserted, card_removed;
u32 irq_status;
dwork = to_delayed_work(work);
pcr = container_of(dwork, struct rtsx_pcr, carddet_work);
pcr_dbg(pcr, "--> %s\n", _... | false | false | false | false | false | 0 |
setting_match_prefix_base(const val_name_func_t name_fn,
const char *prefix, int *ind_result,
const char **matches, size_t max_matches,
size_t *pnum_matches)
{
const struct sset_val_name *name;
size_t len = strlen(prefix);
size_t num_ma... | false | false | false | false | false | 0 |
__vpitime_to_ticks(word64 *timp, p_vpi_time time_p,
struct mod_t *mdp)
{
word64 tim;
if (time_p->type == vpiScaledRealTime)
{
if (!__real_to_v64tim(&tim, time_p->real))
{
__vpi_err(1926, vpiError,
"vpiTimeVal type vpiScaledRealTime too large for 64 bit time - not converted");
*timp = 0ULL;... | true | true | false | false | false | 1 |
net_getsockport (int sok4, int sok6)
{
struct sockaddr_in addr;
int len = sizeof (addr);
if (getsockname (sok4, (struct sockaddr *)&addr, &len) == -1)
return -1;
return addr.sin_port;
} | false | false | false | false | false | 0 |
createbtrtransrel( BddSystem, MaxVar )
bddsystem *BddSystem;
bddvar MaxVar;
{
btrtransrel *TransRel;
setbddlocalsystem( BddSystem );
if ( MaxVar >= BDD_MAX_VAR )
{
btrerror( BTR_BAD_VAR_ERROR, MaxVar );
}
TransRel = allocbtrtransrel();
TransRel->BDD_SYSTEM = BddLocalSystem;
TransRel-... | false | false | false | false | false | 0 |
vxge_poll_vp_reset(unsigned long data)
{
struct vxgedev *vdev = (struct vxgedev *)data;
int i, j = 0;
for (i = 0; i < vdev->no_of_vpath; i++) {
if (test_bit(i, &vdev->vp_reset)) {
vxge_reset_vpath(vdev, i);
j++;
}
}
if (j && (vdev->config.intr_type != MSI_X)) {
vxge_hw_device_unmask_all(vdev->devh);
... | false | false | false | false | false | 0 |
vlistInqVarName(int vlistID, int varID, char *name)
{
int tableID;
int param;
int pdis, pcat, pnum;
vlist_t *vlistptr;
vlistptr = vlist_to_pointer(vlistID);
vlistCheckVarID(__func__, vlistID, varID);
if ( vlistptr->vars[varID].name == NULL )
{
param = vlistptr->vars[varID].param;
cdiDec... | false | true | false | false | false | 1 |
Horizontal_XOR_line_double(word x_pos,word y_pos,word width)
{
//On calcule la valeur initiale de dest:
byte* dest=y_pos*ZOOMY*VIDEO_LINE_WIDTH+x_pos*ZOOMX+Screen_pixels;
int x;
for (x=0;x<width*ZOOMX;x+=ZOOMX)
*(dest+x+VIDEO_LINE_WIDTH+1)=*(dest+x+VIDEO_LINE_WIDTH)=*(dest+x+1)=*(dest+x)=~*(dest+x);
} | false | false | false | false | false | 0 |
GetBytes ( void * pData, int iSize )
{
CSphReader::GetBytes ( pData, iSize );
BYTE * b = (BYTE*) pData;
for ( int i=0; i<iSize; i++ )
m_uCRC = (m_uCRC >> 8) ^ g_dSphinxCRC32 [ (m_uCRC ^ *b++) & 0xff ];
} | false | false | false | false | false | 0 |
globus_rls_client_lrc_exists(globus_rls_handle_t *h, char *key,
globus_rls_obj_type_t objtype)
{
static char *method = "lrc_exists";
globus_result_t r;
BUFFER b;
char obuf[BUFLEN];
if ((r = checkhandle(h)) != GLOBUS_SUCCESS)
return r;
if (!key || !*key)
return mkresult(GLOBUS_RLS_BADA... | false | false | false | false | false | 0 |
ui_keyok(struct dialogitem *item, int key)
{
struct okdata *ok = (struct okdata *) item->data;
switch (key) {
case UIKEY_LEFT:
if (ok->selected >= 1) {
ok->selected--;
uih->display = 1;
return 1;
}
case UIKEY_UP:
PREV();
return 1;
case UIKEY_RIGHT:
case UIKEY_TAB:
if (ok->sel... | false | false | false | false | false | 0 |
paren_used(struct Primblock *p)
#endif
{
Namep np;
p->parenused = 1;
if (!p->argsp && (np = p->namep) && np->vdim)
warn1("inappropriate operation on unsubscripted array %.50s",
np->fvarname);
} | false | false | false | false | false | 0 |
DumpLSRDelete(GF_SceneDumper *sdump, GF_Command *com)
{
char szID[1024];
GF_CommandField *f;
char *lsrns = sd_get_lsr_namespace(com->in_scene);
DUMP_IND(sdump);
fprintf(sdump->trace, "<%sDelete ref=\"%s\" ", lsrns, lsr_format_node_id(com->node, com->RouteID, szID));
f = (GF_CommandField *) gf_list_get(com->comman... | true | true | false | false | false | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.