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 |
|---|---|---|---|---|---|---|
pg_timezone_initialize(void)
{
/* Do we need to try to figure the timezone? */
if (pg_strcasecmp(GetConfigOption("timezone"), "UNKNOWN") == 0)
{
const char *def_tz;
/* Select setting */
def_tz = select_default_timezone();
/* Tell GUC about the value. Will redundantly call pg_tzset() */
SetConfigOption("ti... | false | false | false | false | false | 0 |
tpaw_irc_network_manager_finalize (GObject *object)
{
TpawIrcNetworkManager *self = TPAW_IRC_NETWORK_MANAGER (object);
if (self->priv->save_timer_id > 0)
{
g_source_remove (self->priv->save_timer_id);
}
if (self->priv->have_to_save)
{
irc_network_manager_file_save (self);
}
g_free... | false | false | false | false | false | 0 |
min_int_size (struct yytbl_data *tbl)
{
flex_uint32_t i, total_len;
flex_int32_t max = 0;
total_len = yytbl_calc_total_len (tbl);
for (i = 0; i < total_len; i++) {
flex_int32_t n;
n = abs (yytbl_data_geti (tbl, i));
if (n > max)
max = n;
}
if (max <= INT8_MAX)
return sizeof (flex_int8_t);
else if... | false | false | false | false | false | 0 |
lp_V (lua_State *L) {
TTree *tree = newleaf(L, TOpenCall);
luaL_argcheck(L, !lua_isnoneornil(L, 1), 1, "non-nil value expected");
tree->key = addtoktable(L, 1);
return 1;
} | false | false | false | false | false | 0 |
get_s(ByteIOContext *bc){
int64_t v = ff_get_v(bc) + 1;
if (v&1) return -(v>>1);
else return (v>>1);
} | false | false | false | false | false | 0 |
checkStyle(node_t * n, int *flagp)
{
char *style;
char **pstyle = 0;
int istyle = 0;
polygon_t *poly;
style = late_nnstring(n, N_style, "");
if (style[0]) {
char **pp;
char **qp;
char *p;
pp = pstyle = parse_style(style);
while ((p = *pp)) {
if (streq(p, "filled")) {
istyle |= FILLE... | false | false | false | false | false | 0 |
IoFile_justClose(IoFile *self)
{
FILE *stream = DATA(self)->stream;
if (stream)
{
if (stream != stdout && stream != stdin)
{
if (DATA(self)->flags == IOFILE_FLAGS_PIPE)
{
int exitStatus = pclose(stream);
#if !defined(_MSC_VER) && !defined(__MINGW32__) /* No sys/wait.h in mingw, therefore can't use WI... | false | false | false | false | false | 0 |
chunkpool_free2(struct chunkpool *ctx, cb_free *f)
{
while(ctx->chunk >= 0)
{
if(f != NULL)
{
do
{
ctx->chunk_pos -= ctx->chunk_size;
f((char*)ctx->chunks[ctx->chunk] + ctx->chunk_pos);
}
while(ctx->chunk_... | false | false | false | false | false | 0 |
project_manager_unload_gbf (ProjectManagerPlugin *pm_plugin)
{
AnjutaStatus *status;
if (anjuta_pm_project_is_open (pm_plugin->project))
{
IAnjutaDocumentManager *docman;
/* Close files that belong to this project (that are saved) */
docman = anjuta_shell_get_interface (ANJUTA_PLUGIN (pm_plugin)->shell,
... | false | false | false | false | false | 0 |
gst_camerabin_video_change_state (GstElement * element,
GstStateChange transition)
{
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GstCameraBinVideo *vid = GST_CAMERABIN_VIDEO (element);
GST_DEBUG_OBJECT (element, "changing state: %s -> %s",
gst_element_state_get_name (GST_STATE_TRANSITION_CURRE... | false | false | false | false | false | 0 |
make_policy() {
//EvalResult.node record the policy(in XMLNode) information about evaluation result.
//According to the developer's requirement, EvalResult.node can include rules(in XMLNode)
//that "Permit" or "Deny" the request tuple. In the existing code, it include all
//the original rules.
if(!polic... | false | false | false | false | false | 0 |
loadFromXML(const TiXmlElement *root)
{
// for(int i = 0; i < numTexUnits; i++)
// {
// glDeleteTextures(1, &texUnits[i].handle);
// }
delete[] texUnits;
if(string(root->Value()) != "Texture")
{
fprintf(stderr, "Unknown node type: %s (required: %s)\n", root->Value(), "Texture");
return -1;
}
if(roo... | false | false | false | false | false | 0 |
mimeData(const QModelIndexList &indexes) const
{
if(indexes.isEmpty())
return 0;
QMimeData *mimeDataPtr = new QMimeData();
QByteArray encodedData;
QDataStream stream(&encodedData, QIODevice::WriteOnly);
QList<int> rowIdList;
foreach(const QModelIndex &index, indexes)
{
if(!index.isValid() || index.column(... | false | false | false | false | false | 0 |
default_internal_arg_pointer (void)
{
/* If the reg that the virtual arg pointer will be translated into is
not a fixed reg or is the stack pointer, make a copy of the virtual
arg pointer, and address parms via the copy. The frame pointer is
considered fixed even though it is not marked as such. */
... | false | false | false | false | false | 0 |
read (::zmq_msg_t *msg_)
{
// If the identity was already sent, do nothing.
if (sent)
return false;
// Send the identity.
int rc = zmq_msg_init_size (msg_, options.identity.size ());
zmq_assert (rc == 0);
memcpy (zmq_msg_data (msg_), options.identity.c_str (),
options.identity... | false | false | false | false | false | 0 |
empathy_account_selector_dialog_dup_selected (
EmpathyAccountSelectorDialog *self)
{
GtkTreeSelection *selection;
GtkTreeIter iter;
GtkTreeModel *model;
TpAccount *account;
selection = gtk_tree_view_get_selection (
GTK_TREE_VIEW (self->priv->treeview));
if (!gtk_tree_selection_get_selected (sele... | false | false | false | false | false | 0 |
newLock(const char* type,
const fxStr& dir, const fxStr& device, mode_t mode)
{
fxStr pathname(dir);
if (type[0] == '+') { // SVR4-style lockfile names
#if defined(HAS_MKDEV) || (defined(major) && defined(minor))
/*
* SVR4-style lockfile names are of the form LK.xxx.yyy.zzz
* where xxx is the major d... | false | false | false | false | false | 0 |
gamgi_gtk_select_plane (GtkTreeStore *store,
GtkTreeIter *iter_parent, gamgi_plane *plane)
{
gamgi_dlist *dlist;
gamgi_direction *direction;
gamgi_atom *atom;
gamgi_orbital *orbital;
gamgi_text *text;
GtkTreeIter iter;
iter = gamgi_gtk_select_row (store, iter_parent, GAMGI_CAST_OBJECT plane);
dlist = plane->direction... | false | false | false | false | false | 0 |
rename_file(direntry_t *entry, MainParam_t *mp)
/* rename a messy DOS file to another messy DOS file */
{
int result;
Stream_t *targetDir;
char *shortname;
const char *longname;
Arg_t * arg = (Arg_t *) (mp->arg);
arg->entry = entry;
targetDir = mp->targetDir;
if (targetDir == entry->Dir){
arg->ch.ignore_en... | false | false | false | false | false | 0 |
go_pixbuf_load_attr (GOImage *image, xmlChar const *attr_name, xmlChar const *attr_value)
{
GOPixbuf *pixbuf = GO_PIXBUF (image);
g_return_if_fail (pixbuf);
if (!strcmp (attr_name, "rowstride")) {
long l = strtol (attr_value, NULL, 10);
g_return_if_fail (l > 0 && l < G_MAXINT);
pixbuf->rowstride = l;
}
} | false | false | false | false | false | 0 |
add_identity_to_sys (equation_system *sys, const char *line,
DATASET *dset)
{
identity **pident;
identity *ident;
int ni = sys->nidents;
int err = 0;
ident = parse_identity(line, dset, &err);
if (ident == NULL) return err;
/* connect the identity to the equation system */
pident... | false | false | false | false | false | 0 |
isModified() const
{
return ( _reader.is_open() && _delta.numEdits() );
} | false | false | false | false | false | 0 |
cdv_intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_encoder *encoder;
struct gma_crtc *gma... | false | false | false | false | false | 0 |
getversion(lenp)
int *lenp;
{
char *cp, *eol;
cp = Xstrchr(version, ' ');
while (*(++cp) == ' ');
if (lenp) {
if (!(eol = Xstrchr(cp, ' '))) eol = cp + strlen(cp);
*lenp = eol - cp;
}
return(cp);
} | false | false | false | false | false | 0 |
scbuf_dropper (scbuf_t cb, int len)
{
/* Discards exactly [len] bytes of unread data from [cb].
* Returns the number of bytes dropped.
*/
assert (cb != NULL);
assert (len > 0);
assert (len <= cb->used);
assert (scbuf_mutex_is_locked (cb));
cb->used -= len;
cb->i_out = (cb->i_out + len) % (c... | false | false | false | false | false | 0 |
sirf_usp_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{
struct sirf_usp *usp = snd_soc_dai_get_drvdata(dai);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
if (substream->stream == SNDRV_PCM_STREAM_PLAYB... | false | false | false | false | false | 0 |
PictureAllocColor(Display *dpy, Colormap cmap, XColor *c, int no_limit)
{
if (PStrictColorLimit && Pct != NULL)
{
no_limit = 0;
}
if (no_limit)
{
return Pcsi.alloc_color_no_limit(dpy, cmap, c);
}
else
{
return Pcsi.alloc_color(dpy, cmap, c);
}
return 0;
} | false | false | false | false | false | 0 |
spool_classic_default_startup_func(lList **answer_list,
const lListElem *rule, bool check)
{
bool ret = true;
const char *url;
DENTER(TOP_LAYER, "spool_classic_default_startup_func");
/* check spool directory */
url = lGetString(rule, SPR_url);
if (!sge_is_direct... | false | false | false | false | false | 0 |
ptf_errstr(int ptf_error_code)
{
const char *errmsg = MSG_ERROR_UNKNOWNERRORCODE;
DENTER(TOP_LAYER, "ptf_errstr");
switch (ptf_error_code) {
case PTF_ERROR_NONE:
errmsg = MSG_ERROR_NOERROROCCURED;
break;
case PTF_ERROR_INVALID_ARGUMENT:
errmsg = MSG_ERROR_INVALIDARGUMENT;
break... | false | false | false | false | false | 0 |
ftdi_elan_abandon_targets(struct usb_ftdi *ftdi)
{
int ed_number = 4;
mutex_lock(&ftdi->u132_lock);
while (ed_number-- > 0) {
struct u132_target *target = &ftdi->target[ed_number];
if (target->active == 1) {
target->condition_code = TD_DEVNOTRESP;
mutex_unlock(&ftdi->u132_lock);
ftdi_elan_do_callback(ft... | false | false | false | false | false | 0 |
initLanguages() {
QDir dir(FolderUtils::getApplicationSubFolderPath("translations"));
dir.cd("syntax");
QStringList nameFilters;
nameFilters << "*.xml";
QFileInfoList list = dir.entryInfoList(nameFilters, QDir::Files | QDir::NoSymLinks);
foreach (QFileInfo fileInfo, list) {
if (fileInfo.completeBaseName().compa... | false | false | false | false | false | 0 |
fossil_system(const char *zOrigCmd){
int rc;
#if defined(_WIN32)
/* On windows, we have to put double-quotes around the entire command.
** Who knows why - this is just the way windows works.
*/
char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
wchar_t *zUnicode = fossil_utf8_to_unicode(zNewCmd);
if( g.fSystemT... | false | false | false | false | true | 1 |
ar9003_hw_attach_ops(struct ath_hw *ah)
{
struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
struct ath_hw_ops *ops = ath9k_hw_ops(ah);
ar9003_hw_init_mode_regs(ah);
if (AR_SREV_9003_PCOEM(ah)) {
WARN_ON(!ah->iniPcieSerdes.ia_array);
WARN_ON(!ah->iniPcieSerdesLowPower.ia_array);
}
priv_ops->in... | false | false | false | false | false | 0 |
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
_conf->cfd = NULL;
E_FREE(cfdata);
} | false | false | false | false | false | 0 |
pvalStatementBlockAddStatement( pval *p, pval *statement)
{
if (!pvalCheckType(p, "pvalStatementBlockAddStatement", PV_STATEMENTBLOCK))
return;
p->u1.list = linku1(p->u1.list, statement);
} | false | false | false | false | false | 0 |
cpl_recipedefine_destroy(cpl_plugin * plugin)
{
cpl_recipe * recipe;
if (plugin == NULL) {
return cpl_error_set_mes... | false | false | false | false | false | 0 |
makeObject(const std::string &name, std::vector<boost::shared_ptr<Element> > &data)
{
// GNASH_REPORT_FUNCTION;
_type = OBJECT_AMF0;
if (name.size()) {
setName(name);
}
return makeObject(data);
} | false | false | false | false | false | 0 |
get_from_value(struct mailimf_single_fields * fields,
char ** from, int * is_addr)
{
struct mailimf_mailbox * mb;
if (fields->fld_from == NULL) {
* from = NULL;
* is_addr = 0;
return;
}
if (clist_isempty(fields->fld_from->frm_mb_list->mb_list)) {
* from = NULL;
* is_addr = 0;
ret... | false | false | false | false | false | 0 |
SQLEndTran(SQLSMALLINT handleType, SQLHANDLE handle, SQLSMALLINT completionType)
{
/*
* Do not call the exported SQLTransact(),
* because we may wind up calling a function with the same name implemented by the DM.
*/
tdsdump_log(TDS_DBG_FUNC, "SQLEndTran(%d, %p, %d)\n", handleType, handle, completionType);
sw... | false | false | false | false | false | 0 |
RegisterHit(struct tophit_s *h, double key,
double pvalue, float score, double motherp, float mothersc,
char *name, char *acc, char *desc,
int sqfrom, int sqto, int sqlen,
int hmmfrom, int hmmto, int hmmlen,
int domidx, int ndom,
struct fancyali_s *ali)
{
/* Check to see if list is fu... | false | false | false | false | false | 0 |
bool_button_toggled (GtkWidget *bool_button,
gpointer data)
{
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (bool_button)))
gtk_label_set_label (GTK_LABEL (gtk_bin_get_child (GTK_BIN (bool_button))),
_("T_rue"));
else
gtk_label_set_label (GTK_LABEL (gtk_bin_get_child (GTK_BIN (bool_button)... | false | false | false | false | false | 0 |
lookup_field_queue_p (tree derived, int ix, void *data)
{
tree binfo = BINFO_BASETYPE (derived, ix);
struct lookup_field_info *lfi = (struct lookup_field_info *) data;
/* Don't look for constructors or destructors in base classes. */
if (IDENTIFIER_CTOR_OR_DTOR_P (lfi->name))
return NULL_TREE;
/* If th... | false | false | false | false | false | 0 |
error_token_from_text ()
{
char *msg, *t;
int token_end, i;
t = shell_input_line;
i = shell_input_line_index;
token_end = 0;
msg = (char *)NULL;
if (i && t[i] == '\0')
i--;
while (i && (whitespace (t[i]) || t[i] == '\n'))
i--;
if (i)
token_end = i + 1;
while (i && (member (t[i], " \... | false | false | false | false | false | 0 |
NsBlockSignals(int debug)
{
sigset_t set;
/*
* Block SIGHUP, SIGPIPE, SIGTERM, and SIGINT. This mask is
* inherited by all subsequent threads so that only this
* thread will catch the signals in the sigwait() loop below.
* Unfortunately this makes it impossible to kill the
* server wit... | false | false | false | false | false | 0 |
_layout_line_align_get(Ctxt *c)
{
#ifdef BIDI_SUPPORT
if (c->align_auto && c->ln)
{
if (c->ln->items && c->ln->items->text_node &&
(c->ln->par->direction == EVAS_BIDI_DIRECTION_RTL))
{
/* Align right*/
return 1.0;
}
else
{
... | false | false | false | false | false | 0 |
child_of_zone(dns_name_t * name, dns_name_t * zone_name,
dns_name_t * child_name)
{
dns_namereln_t name_reln;
int orderp;
unsigned int nlabelsp;
name_reln = dns_name_fullcompare(name, zone_name, &orderp, &nlabelsp);
if (name_reln != dns_namereln_subdomain ||
dns_name_countlabels(name) <= dns_name_coun... | false | false | false | false | false | 0 |
HandlePeriodicTriggerSpell(bool apply, bool /*Real*/)
{
m_isPeriodic = apply;
Unit* target = GetTarget();
if (!apply)
{
switch (GetId())
{
case 66: // Invisibility
if (m_removeMode == AURA_REMOVE_BY_EXPIRE)
... | false | false | false | false | false | 0 |
HPCC_InitBuckets(int numPEs, int maxNumUpdates)
{
Bucket_Ptr Buckets;
int i;
Buckets = (Bucket_Ptr) malloc (numPEs * sizeof(Bucket_T));
for (i=0; i<numPEs; i++) {
Buckets[i].numUpdates = 0;
Buckets[i].updateList = NULL_UPDATE_PTR;
}
/* initialize memory pool for updates */
Update_Pool = HPCC_Poo... | false | true | false | false | false | 1 |
gGraphSetPen (const void *context, unsigned char red, unsigned char green,
unsigned char blue, unsigned char alpha, double width, int style)
{
/* creating a Color Pen */
double d_red = (double) red / 255.0;
double d_green = (double) green / 255.0;
double d_blue = (double) blue / 255.0;
double d_a... | false | false | false | false | false | 0 |
oc_huff_tree_unpack(oc_pack_buf *_opb,
oc_huff_node *_binodes,int _nbinodes){
oc_huff_node *binode;
long bits;
int nused;
if(_nbinodes<1)return TH_EBADHEADER;
binode=_binodes;
nused=0;
bits=oc_pack_read1(_opb);
if(oc_pack_bytes_left(_opb)<0)return TH_EBADHEADER;
/*Read an internal ... | false | false | false | false | false | 0 |
brasero_session_cfg_remove_flags (BraseroSessionCfg *session,
BraseroBurnFlag flags)
{
brasero_burn_session_remove_flag (BRASERO_BURN_SESSION (session), flags);
/* For this case reset all flags as some flags could
* be made available after the removal of one flag
* Example: After the removal of MULTI, FAST... | false | false | false | false | false | 0 |
_cgsem_init(cgsem_t *cgsem, const char *file, const char *func, const int line)
{
int ret;
if ((ret = sem_init(cgsem, 0, 0)))
quitfrom(1, file, func, line, "Failed to sem_init ret=%d errno=%d", ret, errno);
} | false | false | false | false | false | 0 |
gcr_system_prompt_close_async (GcrSystemPrompt *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GSimpleAsyncResult *res;
CallClosure *closure;
g_return_if_fail (GCR_SYSTEM_PROMPT (self))... | false | false | false | false | false | 0 |
e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
{
struct e1000_phy_info *phy = &hw->phy;
s32 ret_val;
u16 i = 0;
phy->addr = 1;
phy->reset_delay_us = 100;
phy->ops.power_up = e1000_power_up_phy_copper;
phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
/* We may need to do this twice - once for IG... | false | false | false | false | false | 0 |
SCR_DrawPause (void)
{
if (!scr_showpause->value) // turn off for screenshots
return;
if (!cl_paused->value)
return;
if (cls.key_dest == key_menu)
return;
SCR_DrawAlertMessagePicture("pause", true);
} | false | false | false | false | false | 0 |
ugly_dbg_app_estr(EXPSTR * es, CONSTRPTR s, STRPTR file, ULONG line)
{
BOOL ok = FALSE;
if (!es)
es_null("app_estr", file, line);
else if (!s)
s_null("app_estr", file, line);
else
{
/* faster, but maybe buggy */
size_t slen = strlen(s);
ok = TRUE;
if... | false | true | false | false | false | 1 |
onEvent(Event* const event) {
if (event->id() == WantItems::ID) {
/* we want gold to donate to priests */
WantItems* e = static_cast<WantItems*> (event);
for (map<unsigned char, Item>::iterator i = e->items().begin(); i != e->items().end(); ++i) {
if (i->second.name() == "gold piece")
i->second.want(i->se... | false | false | false | false | false | 0 |
dib8000_cfg_gpio(struct dib8000_state *st, u8 num, u8 dir, u8 val)
{
st->cfg.gpio_dir = dib8000_read_word(st, 1029);
st->cfg.gpio_dir &= ~(1 << num); /* reset the direction bit */
st->cfg.gpio_dir |= (dir & 0x1) << num; /* set the new direction */
dib8000_write_word(st, 1029, st->cfg.gpio_dir);
st->cfg.gpio_val =... | false | false | false | false | false | 0 |
askValue( const QString & value, bool & ok )
{
return QString::number( QInputDialog::getInteger( 0, "New item", "Enter new number: ", value.toInt(), _min, _max, 1, &ok ) );
} | false | false | false | false | false | 0 |
handleRead(memptr addr) {
addr -= getHWoffset();
if (addr >= getHWsize())
return 0;
int value = 0;
switch(addr) {
case 4: value = getDMAData() >> 8; break;
case 5: value = getDMAData(); break;
case 6: value = getDMAStatus() >> 8; break;
case 7: value = getDMAStatus(); break;
case 9: value = DMAaddr >> ... | false | false | false | false | false | 0 |
ustate_own_changes_list_free(void *that)
{
ustate_own_changes_list_ty *this_thing;
size_t j;
this_thing = (ustate_own_changes_list_ty *)that;
if (!this_thing)
return;
trace(("ustate_own_changes_list_free(this_thing = %08lX)\n{\n", (long)this_thing));
assert(this_thing->length <= this_thing->ma... | false | false | false | false | false | 0 |
bounds(int igroup, double *minmax, int iregion)
{
int groupbit = bitmask[igroup];
Region *region = domain->regions[iregion];
double extent[6];
extent[0] = extent[2] = extent[4] = BIG;
extent[1] = extent[3] = extent[5] = -BIG;
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
... | false | false | false | false | false | 0 |
valid_state(struct task_struct *curr, struct held_lock *this,
enum lock_usage_bit new_bit, enum lock_usage_bit bad_bit)
{
if (unlikely(hlock_class(this)->usage_mask & (1 << bad_bit)))
return print_usage_bug(curr, this, bad_bit, new_bit);
return 1;
} | false | false | false | false | false | 0 |
object_parse_bool_from_string(lListElem *this_elem, lList **answer_list,
int name, const char *string)
{
bool ret = true;
DENTER(OBJECT_LAYER, "object_parse_bool_from_string");
if (this_elem != NULL && string != NULL) {
int pos = lGetPosViaElem(this_elem, name, SGE_NO_ABORT... | false | false | false | false | false | 0 |
operator=(const DateFormat& other)
{
if (this != &other)
{
delete fCalendar;
delete fNumberFormat;
if(other.fCalendar) {
fCalendar = other.fCalendar->clone();
} else {
fCalendar = NULL;
}
if(other.fNumberFormat) {
fNumberFormat = (Num... | false | false | false | false | false | 0 |
gd_syncop_mgmt_commit_op (struct rpc_clnt *rpc, struct syncargs *args,
uuid_t my_uuid, uuid_t recv_uuid,
int op, dict_t *dict_out, dict_t *op_ctx)
{
glusterd_conf_t *conf = THIS->private;
gd1_mgmt_commit_op_req *req = NULL;
int ... | false | false | false | false | false | 0 |
gretl_list_array_new (int nlists, int nterms)
{
int **lists = NULL;
int i;
if (nlists < 0) {
return NULL;
}
lists = malloc(nlists * sizeof *lists);
if (lists != NULL) {
for (i=0; i<nlists; i++) {
lists[i] = gretl_list_new(nterms);
}
}
return lists;
} | false | true | false | false | false | 1 |
points(Length n) {
if (n >= 0)
return (n + 10)/20;
else
return (n - 10)/20;
} | false | false | false | false | false | 0 |
_dbus_org_bluez_device_set_property (orgbluezDevice* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
GError* error = NULL;
GVariantIter _arguments_iter;
gchar* name = NULL;
GVariant* _tmp178_;
GVariant* value = NULL;
GVariant* _tmp179_;
GDBusMessage* _reply_message;
GVariant* _reply;
GVariantB... | false | false | false | false | false | 0 |
cmd_set_repeat(int nrepeats)
{
game_command *cmd = &cmd_queue[prev_cmd_idx(cmd_tail)];
cmd->nrepeats = nrepeats;
if (nrepeats) repeating = TRUE;
else repeating = FALSE;
/* Redraw the state (later) */
p_ptr->redraw |= (PR_STATE);
} | false | false | false | false | false | 0 |
maven_write_byte( MatroxMavenData *mav,
MatroxDriverData *mdrv,
u8 reg,
u8 val )
{
MatroxDeviceData *mdev = mdrv->device_data;
if (mdev->g450_matrox) {
volatile u8 *mmio = mdrv->mmio_base;
mga_out_dac( m... | false | false | false | false | false | 0 |
FnCallStrCmp(struct FnCall *fp,struct Rlist *finalargs)
{
struct Rval rval;
char buffer[CF_BUFSIZE];
buffer[0] = '\0';
/* begin fn specific content */
SetFnCallReturnStatus("strcmp",FNCALL_SUCCESS,NULL,NULL);
if (strcmp(finalargs->item,finalargs->next->item) == 0)
{
strcpy(buffer,"any");
}
else... | false | false | false | false | false | 0 |
mono_type_get_underlying_type (MonoType *type)
{
if (type->type == MONO_TYPE_VALUETYPE && type->data.klass->enumtype && !type->byref)
return mono_class_enum_basetype (type->data.klass);
if (type->type == MONO_TYPE_GENERICINST && type->data.generic_class->container_class->enumtype && !type->byref)
return mono_clas... | false | false | false | false | false | 0 |
read_subframe_constant_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode)
{
FLAC__Subframe_Constant *subframe = &decoder->private_->frame.subframes[channel].data.constant;
FLAC__int32 x;
unsigned i;
FLAC__int32 *output = decoder->private_->output[channel];
decoder->private_-... | false | false | false | false | false | 0 |
_dxf_CullObjectHash(HashTable ht)
{
HashTable new = NULL;
if (! ht)
{
return NULL;
}
else
{
OHashP ptr;
new = DXCreateHash(sizeof(OHashS), NULL, NULL);
DXInitGetNextHashElement(ht);
while (NULL != (ptr = (OHashP)DXGetNextHashElement(ht)))
{
if (ptr->hit)
{
OHashS str;
str.key = ptr-... | false | false | false | false | false | 0 |
readData()
{
struct timeval start;
gettimeofday(&start, NULL);
struct timeval tv;
while (!*_termination_flag)
{
if (timeout_reached(&start, g_query_timeout_msec))
return IB_TIMEOUT;
tv.tv_sec = READ_TIMEOUT_USEC / 1000000;
tv.tv_usec = READ_TIMEOUT_USEC % 10000... | false | false | false | false | false | 0 |
font_info_table_dump_special_font_setup (FILE * stream,
struct a2ps_job * job)
{
struct font_info ** fonts;
int i;
fonts = (struct font_info **)
hash_dump (job->font_infos, NULL, NULL);
for (i = 0 ; fonts [i] ; i++)
if (!font_is_to_reencode (job, fonts [i]->key))
fprintf (stream, "/f%s /%s... | false | false | false | false | false | 0 |
allowed_class(const object *op) {
return op->stats.Dex > 0
&& op->stats.Str > 0
&& op->stats.Con > 0
&& op->stats.Int > 0
&& op->stats.Wis > 0
&& op->stats.Pow > 0
&& op->stats.Cha > 0;
} | false | false | false | false | false | 0 |
GetAverageColor(int c[3])
{
if(this->AverageCount)
{
c[0] = static_cast<int>(this->AverageColor[0] / this->AverageCount);
c[1] = static_cast<int>(this->AverageColor[1] / this->AverageCount);
c[2] = static_cast<int>(this->AverageColor[2] / this->AverageCount);
}
} | false | false | false | false | false | 0 |
dmar_acpi_insert_dev_scope(u8 device_number,
struct acpi_device *adev)
{
struct dmar_drhd_unit *dmaru;
struct acpi_dmar_hardware_unit *drhd;
struct acpi_dmar_device_scope *scope;
struct device *tmp;
int i;
struct acpi_dmar_pci_path *path;
for_each_drhd_unit(dmaru) {
drhd = container_of(dmaru->hdr,
... | false | false | false | false | false | 0 |
devm_regulator_unregister_supply_alias(struct device *dev, const char *id)
{
struct regulator_supply_alias_match match;
int rc;
match.dev = dev;
match.id = id;
rc = devres_release(dev, devm_regulator_destroy_supply_alias,
devm_regulator_match_supply_alias, &match);
if (rc != 0)
WARN_ON(rc);
} | false | false | false | false | false | 0 |
cp_build_function_call_vec (tree function, VEC(tree,gc) **params,
tsubst_flags_t complain)
{
tree fntype, fndecl;
int is_method;
tree original = function;
int nargs;
tree *argarray;
tree parm_types;
VEC(tree,gc) *allocated = NULL;
tree ret;
/* For Objective-C, convert any calls via a cast to O... | false | false | false | false | false | 0 |
configureLogger(Logger logger, const tstring& config)
{
// Remove all spaces from config
tstring configString;
remove_copy_if(config.begin(), config.end(),
string_append_iterator<tstring>(configString),
std::bind1st(std::equal_to<tchar>(), LOG4CPLUS_TEXT(' ')));
// "Tokenize" configStri... | false | false | false | false | false | 0 |
adaptFontSize(QPainter &painter, const QString &string, qreal width, qreal height, qreal maxFontSize, qreal minFontSize, AdaptFontSizeOptions flags)
{
qreal size = maxFontSize;
QRectF boundingRect;
bool done = false;
while (!done && size > minFontSize) {
QFont f = painter.font();
f.setP... | false | false | false | false | false | 0 |
OTF_RStream_closeSnapsBuffer( OTF_RStream* rstream ) {
int ret= 1;
if ( NULL != rstream->snapsBuffer ) {
ret&= OTF_RBuffer_close( rstream->snapsBuffer );
if( 0 == ret ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"closing snapshots buffer failed.\n",
__FUNCTION__, __FILE__, _... | false | false | false | false | false | 0 |
gnc_recurrence_new()
{
GncRecurrence *gr;
ENTER(" ");
gr = g_object_new(gnc_recurrence_get_type(), NULL);
LEAVE(" ");
return GTK_WIDGET(gr);
} | false | false | false | false | false | 0 |
krb5_salttype_to_string (krb5_context context,
krb5_enctype etype,
krb5_salttype stype,
char **string)
{
struct _krb5_encryption_type *e;
struct salt_type *st;
e = _krb5_find_enctype (etype);
if (e == NULL) {
krb5_set_error_message(context, KRB5_PROG_ETYPE_NOSUPP,
"encryption typ... | false | false | false | false | false | 0 |
__emit_membase(struct buffer *buf, unsigned char opc,
enum machine_reg base_reg, unsigned long disp,
unsigned char reg_opcode)
{
unsigned char mod, rm, mod_rm;
int needs_sib;
needs_sib = (base_reg == MACH_REG_ESP);
emit(buf, opc);
if (needs_sib)
rm = 0x04;
else
rm = x86_encode_reg(base_reg)... | false | false | false | false | false | 0 |
_mesa_GenQueries(GLsizei n, GLuint *ids)
{
GLuint first;
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGenQueries(%d)\n", n);
if (n < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGenQueriesARB(n < 0)");
return;
}
first = _mesa_HashFindFreeKeyBlock(ctx... | false | false | false | false | false | 0 |
bert_encoder_write(bert_encoder_t *encoder,const unsigned char *data,size_t length)
{
switch (encoder->mode)
{
case bert_mode_stream:
if (write(encoder->stream,data,length) < 0)
{
return BERT_ERRNO_WRITE;
}
break;
case bert_mode_buffer:
if ((encoder->buffer.index + length) > encoder->buffer.len... | false | true | false | false | false | 1 |
release_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
ReleaseData *data = user_data;
GError *error;
gboolean ret;
ret = FALSE;
error = NULL;
ret = polkit_authority_revoke_temporary_authorization_by_id_finish (data->permission->authority,
... | false | false | false | false | false | 0 |
SerializeSortedSCFGRule(const SortingSCFGRule& scfg, int sentence, const char* accessory){
stringstream output, outputinv;
output << scfg.source() << " ||| " << scfg.target() << " ||| " << scfg.align() << "||| " << scfg.weight();
outputinv << scfg.target() << " ||| " << scfg.source() << " ||| " << scfg.align... | false | false | false | false | false | 0 |
_entry_activated_cb(void *data,
Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
ELM_SPINNER_DATA_GET(data, sd);
_entry_value_apply(data);
evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
if (sd->delay) ecore_timer_del(sd->delay);
sd->delay = e... | false | false | false | false | false | 0 |
accel_set_param(glui32 index, glui32 val)
{
switch (index) {
case 0: classes_table = val; break;
case 1: indiv_prop_start = val; break;
case 2: class_metaclass = val; break;
case 3: object_metaclass = val; break;
case 4: routine_metaclass = val; break;
case 5: string_... | false | false | false | false | false | 0 |
png_verify_signature (mame_file *fp)
{
INT8 signature[8];
if (mame_fread (fp, signature, 8) != 8)
{
logerror("Unable to read PNG signature (EOF)\n");
return 0;
}
if (memcmp(signature, PNG_Signature, 8))
{
logerror("PNG signature mismatch found: %s expected: %s\n",signature,PNG_Signature);
r... | false | false | false | false | false | 0 |
calc_rhopot(long gridsize, long nlevel, double *pressure, field_t to, field_t sao, field_t rho)
{
/* pressure units: hPa */
/* to units: Celsius */
/* sao units: psu */
long i, levelID, offset;
double *rhoptr, *toptr, *saoptr;
for ( levelID = 0; levelID < nlevel; ++levelID )
{
... | false | false | false | false | false | 0 |
local_tz_offset(time_t date, bool current UNUSED)
{
struct tm *tm;
#if !HAVE_STRUCT_TM_TM_GMTOFF
struct tm local, gmt;
long offset;
#endif
tm = localtime(&date);
#if !HAVE_STRUCT_TM_TM_GMTOFF && HAVE_DECL_ALTZONE
if (current)
return (tm->tm_isdst > 0) ? -altzone : -timezone;
#endif
#if HA... | false | false | false | false | false | 0 |
kone_sysfs_write_settings(struct file *fp, struct kobject *kobj,
struct bin_attribute *attr, char *buf,
loff_t off, size_t count) {
struct device *dev =
container_of(kobj, struct device, kobj)->parent->parent;
struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
struct usb_device *usb_dev = inter... | false | true | false | false | false | 1 |
dbxout_type_fields (tree type)
{
tree tem;
/* Output the name, type, position (in bits), size (in bits) of each
field that we can support. */
for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
{
/* If on of the nodes is an error_mark or its type is then return early. */
if (tem ==... | false | false | false | false | false | 0 |
__ecereNameSpace__ecere__sys__IsPathInsideOf(char * path, char * of)
{
if(!path[0] || !of[0])
return 0x0;
else
{
char ofPart[274], ofRest[797];
char pathPart[274], pathRest[797];
strcpy(ofRest, of);
strcpy(pathRest, path);
for(; ofRest[0] && pathRest[0]; )
{
__ecereNameSpace__ecere__sys__SplitDirectory(ofRest, ofPart,... | 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.