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 |
|---|---|---|---|---|---|---|
parseLength(const QChar *s, unsigned int l)
{
if (l == 0) {
return Length(1, Relative);
}
unsigned i = 0;
while (i < l && s[i].isSpace())
++i;
if (i < l && (s[i] == '+' || s[i] == '-'))
++i;
while (i < l && s[i].isDigit())
++i;
bool ok;
int r = QString::... | false | false | false | false | false | 0 |
image_cache_get(ImageWindow *imd)
{
gint success;
success = file_cache_get(image_get_cache(), imd->image_fd);
if (success)
{
g_assert(imd->image_fd->pixbuf);
image_change_pixbuf(imd, imd->image_fd->pixbuf, image_zoom_get(imd), FALSE);
}
// file_cache_dump(image_get_cache());
return success;
} | false | false | false | false | false | 0 |
tftp_send_error ( struct tftp_request *tftp, int errcode,
const char *errmsg ) {
struct tftp_error *err;
struct io_buffer *iobuf;
struct xfer_metadata meta = {
.dest = ( struct sockaddr * ) &tftp->peer,
};
size_t msglen;
DBGC2 ( tftp, "TFTP %p sending ERROR %d: %s\n", tftp, errcode,
errmsg );
/* Al... | false | false | false | false | false | 0 |
socket_destroy_wait_conn(struct IPC_WAIT_CONNECTION * wait_conn)
{
struct SOCKET_WAIT_CONN_PRIVATE * wc = wait_conn->ch_private;
if (wc != NULL) {
#if HB_IPC_METHOD == HB_IPC_SOCKET
if (wc->s >= 0) {
if (debug_level > 1) {
cl_log(LOG_DEBUG
, "%s: closing socket %d"
, __FUNCTION__, wc->s);
}
cl... | false | false | false | false | false | 0 |
installed(mail::imap &imapAccount)
{
next_cram_func=0;
currentCmd="STARTTLS";
#if HAVE_LIBCOURIERTLS
if (!myimap->socketEncrypted() &&
myimap->hasCapability("STARTTLS") &&
myLoginInfo.options.count("notls") == 0)
{
myimap->imapcmd((myimap->smap ? "\\SMAP1":"STARTTLS"),
"STARTTLS\r\n");
return;
... | false | false | false | false | false | 0 |
xs(char *buf, char *targ, int offs, int len)
{
int j, k, l;
j = 0;
l = 0;
for (k = 0; k < len; k++)
if ((buf[k + offs] != 0x20) || (buf[k + offs] != l))
l = targ[j++] = buf[k + offs];
if (l == 0x20)
j--;
targ[j] = 0;
} | false | false | false | false | false | 0 |
varsaux(tok,strom,typptr,endptr)
int tok;
truc *strom;
truc *typptr, *endptr;
{
truc obj;
int sflg;
int n = 0;
*typptr = zero; /* default type integer */
*endptr = voidsym;
if(tok != SYMBOLTOK) {
return(aERROR);
}
while(tok == SYMBOLTOK) {
obj = mksym(SymBuf,&sflg);
... | false | false | false | false | false | 0 |
marker_xtime_update_marks (xlator_t *this, marker_local_t *local)
{
GF_VALIDATE_OR_GOTO ("marker", this, out);
GF_VALIDATE_OR_GOTO (this->name, local, out);
if ((local->pid == GF_CLIENT_PID_GSYNCD) ||
(local->pid == GF_CLIENT_PID_DEFRAG))
goto out;
marker_ge... | false | false | false | false | false | 0 |
flash_dev_congested(void *data, int bits)
{
struct bcache_device *d = data;
struct request_queue *q;
struct cache *ca;
unsigned i;
int ret = 0;
for_each_cache(ca, d->c, i) {
q = bdev_get_queue(ca->bdev);
ret |= bdi_congested(q->backing_dev_info, bits);
}
return ret;
} | false | false | false | false | false | 0 |
SDL_gfxSetAlpha(SDL_Surface *src, Uint8 a)
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
const int alpha_offset = 0;
#else
const int alpha_offset = 3;
#endif
int i, j, row_skip;
Uint8 *pixels;
/* Check if we have a 32bit surface */
if ( (src==NULL) ||
(src->format==NULL) ||
(src->format->BytesPerPixel!=4) ) {
S... | false | false | false | false | false | 0 |
readFile(char *filename){
int fd;
char *data;
struct stat sbuf;
if (filename == NULL) {
fprintf(stderr, "Insert filename!\n");
exit(1);
}
if ((fd = open(filename, O_RDONLY)) == -1) {
perror("Error on opening file");
exit(1);
}
if (stat(filename, &sbuf) ... | false | false | false | false | false | 0 |
mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode)
{
int inexact, i, k, cnt;
mpfr_t tmp;
mp_limb_t tmpmant[MPFR_LIMBS_PER_LONG_DOUBLE];
mpfr_long_double_t x;
mpfr_exp_t exp;
int signd;
MPFR_SAVE_EXPO_DECL (expo);
/* Check for NAN */
if (MPFR_UNLIKELY (d != d))
{
MPFR_SET_NAN (r);
... | false | false | false | false | true | 1 |
add_name_hash(struct index_state *istate, struct cache_entry *ce)
{
ce->ce_flags &= ~CE_UNHASHED;
if (istate->name_hash_initialized)
hash_index_entry(istate, ce);
} | false | false | false | false | false | 0 |
dependents_link (GSList *deps)
{
GSList *ptr = deps;
/* put them back */
for (; ptr != NULL ; ptr = ptr->next) {
GnmDependent *dep = ptr->data;
if (dep->sheet->being_invalidated)
continue;
if (dep->sheet->deps != NULL && !dependent_is_linked (dep)) {
dependent_link (dep);
dependent_queue_recalc (dep)... | false | false | false | false | false | 0 |
read_file_list(const char *file_list,int *n,char **argv[])
{
char buf[MAX_PATH_LEN];
int len, nfiles;
char **files;
FILE *fh = fopen(file_list,"r");
if ( !fh )
{
fprintf(stderr,"%s: %s\n", file_list,strerror(errno));
return 1;
}
// Speed is not an issue here, determine ... | false | false | false | false | true | 1 |
session_free(struct session *s)
{
struct http_txn *txn = &s->txn;
struct proxy *fe = s->fe;
struct bref *bref, *back;
int i;
if (s->pend_pos)
pendconn_free(s->pend_pos);
if (s->srv) { /* there may be requests left pending in queue */
if (s->flags & SN_CURR_SESS) {
s->flags &= ~SN_CURR_SESS;
s->srv->cu... | false | false | false | false | false | 0 |
mcmalo0(mcmcxdef *cctx, ushort siz, mcmon *nump,
mcmon clinum, int noclitrans)
{
uchar *ret;
mcmcx1def *ctx = cctx->mcmcxgl; /* global context */
mcmon glb; /* global object number allocated */
MCMCLICTX(cctx);
MCMGLBCT... | false | false | false | false | false | 0 |
DrawPips(unsigned char *auchDest, int nStride, unsigned char *auchPip, int n)
{
int ix, iy, afPip[9];
afPip[0] = afPip[8] = (n == 2) || (n == 3) || (n == 4) || (n == 5) || (n == 6);
afPip[1] = afPip[7] = 0;
afPip[2] = afPip[6] = (n == 4) || (n == 5) || (n == 6);
afPip[3] = afPip[5] = n == 6;
af... | false | false | false | false | false | 0 |
aurora_draw_handle (cairo_t * cr,
const AuroraColors * colors,
const WidgetParameters * widget,
const HandleParameters * handle,
int x, int y, int width, int height)
{
AuroraRGB dark;
AuroraRGB light = colors->shade[2];
aurora_mix_color (&colors->shade[5], &colors->shade[6], 0.6, &dark);
... | false | false | false | false | false | 0 |
_dm_ioctl_unmangle_uuids(int type, struct dm_ioctl *dmi)
{
char buf[DM_UUID_LEN];
char *uuid = dmi->uuid;
if (uuid)
return _do_dm_ioctl_unmangle_string(uuid, "UUID", buf, sizeof(buf),
dm_get_name_mangling_mode());
return 1;
} | false | false | false | false | false | 0 |
RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// get the input and outpu... | false | false | false | false | false | 0 |
refdb_fs_backend__write_tail(
git_refdb_backend *_backend,
const git_reference *ref,
git_filebuf *file,
int update_reflog,
const git_signature *who,
const char *message,
const git_oid *old_id,
const char *old_target)
{
refdb_fs_backend *backend = (refdb_fs_backend *)_backend;
int error = 0, cmp = 0, should_wr... | false | false | false | false | false | 0 |
dht_do_rename (call_frame_t *frame)
{
dht_local_t *local = NULL;
xlator_t *dst_hashed = NULL;
xlator_t *src_cached = NULL;
xlator_t *dst_cached = NULL;
xlator_t *this = NULL;
xlator_t *rename_subvol = NULL;
local = frame->local;
this = fr... | false | false | false | false | false | 0 |
runCFinalizer(void *fn, void *ptr, void *env, StgWord flag)
{
if (flag)
((void (*)(void *, void *))fn)(env, ptr);
else
((void (*)(void *))fn)(ptr);
} | false | false | false | false | false | 0 |
plugins_call_init(server *srv) {
size_t i;
plugin **ps;
ps = srv->plugins.ptr;
/* fill slots */
srv->plugin_slots = calloc(PLUGIN_FUNC_SIZEOF, sizeof(ps));
for (i = 0; i < srv->plugins.used; i++) {
size_t j;
/* check which calls are supported */
plugin *p = ps[i];
#define PLUGIN_TO_SLOT(x, y) \
if (p... | false | false | false | false | true | 1 |
stats_report_page(){
HQuery url; /* URL for various branch links */
const char * zView = P("view"); /* Which view/report to show. */
const char *zUserName = P("user");
if(!zUserName) zUserName = P("u");
url_initialize(&url, "reports");
if(zUserName && *zUserName){
url_add_para... | false | false | false | false | false | 0 |
run()
{
if (!mInit) return;
if (isActiveTerm()) processSignal(SIGUSR2);
FbShellManager::instance()->createShell();
mRun = true;
FbIoDispatcher *io = (FbIoDispatcher*)IoDispatcher::instance();
while (mRun) {
io->poll();
#ifndef HAVE_SIGNALFD
pollSignal();
#endif
}
if (isActiveTerm()) processSignal(SIGUSR... | false | false | false | false | false | 0 |
fsp_open_session(const char *host,unsigned short port,const char *password)
{
FSP_SESSION *s;
int fd;
struct addrinfo hints,*res;
char port_s[6];
struct sockaddr_in *addrin;
FSP_LOCK *lock;
memset (&hints, 0, sizeof (hints));
/* fspd do not supports inet6 */
hints.ai_family = PF_INE... | true | true | false | false | true | 1 |
gdome_xml_el_getAttributeNodeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc)
{
Gdome_xml_Element *priv = (Gdome_xml_Element *)self;
GdomeNamedNodeMap *nnm;
GdomeAttr *ret;
g_return_val_if_fail (priv != NULL, NULL);
g_return_val_if_fail (GDOME_XML_IS_EL (pri... | false | false | false | false | false | 0 |
updateScheduledPressure(const SUnit *SU,
const std::vector<unsigned> &NewMaxPressure) {
const PressureDiff &PDiff = getPressureDiff(SU);
unsigned CritIdx = 0, CritEnd = RegionCriticalPSets.size();
for (PressureDiff::const_iterator I = PDiff.begin(), E = PDiff.end();
I != E; ++I) {
... | false | false | false | false | false | 0 |
prism2_plx_genesis_reset(local_info_t *local, int hcr)
{
unsigned char corsave;
struct hostap_plx_priv *hw_priv = local->hw_priv;
if (hw_priv->attr_mem == NULL) {
/* TMD7160 - COR at card's first I/O addr */
corsave = inb(hw_priv->cor_offset);
outb(corsave | COR_SRESET, hw_priv->cor_offset);
mdelay(10);
o... | false | false | false | false | false | 0 |
partial(unsigned int index) const {
// d/dx (k*f) = k*(df/dx)
const AbsFunction & fPrime = _constant*(_arg->partial(index));
return Derivative(& fPrime);
}
} | false | false | false | false | false | 0 |
mx_move(int n)
{
struct column *tmp;
while (n--) {
tmp = first;
first = first->next;
last->next = tmp;
last = last->next;
last->next = 0;
}
} | false | false | false | false | false | 0 |
clist_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
const gs_imager_state *pis, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
gx_device_clist_writer * const cdev =
&((gx_device_clist *)dev)->writer;
int code;
int rx, ry, rwidth, rheight;
cmd_rects_en... | false | false | false | false | false | 0 |
sensors_show(struct seq_file *seq, void *v)
{
struct adapter *adap = seq->private;
u32 param[7], val[7];
int ret;
/* Note that if the sensors haven't been initialized and turned on
* we'll get values of 0, so treat those as "<unknown>" ...
*/
param[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
FW_PARAMS_... | false | false | false | false | false | 0 |
agent_release_card_info (struct agent_card_info_s *info)
{
int i;
if (!info)
return;
xfree (info->serialno); info->serialno = NULL;
xfree (info->apptype); info->apptype = NULL;
xfree (info->disp_name); info->disp_name = NULL;
xfree (info->disp_lang); info->disp_lang = NULL;
xfree (info->pubkey_url);... | false | false | false | false | false | 0 |
update_asset(packetinfo *pi)
{
if (asset_lookup(pi) == SUCCESS) {
if (pi->asset != NULL) {
pi->asset->vlan = pi->vlan;
pi->asset->last_seen = pi->pheader->ts.tv_sec;
} else {
printf("\nBAD ERROR in update_asset\n");
}
} else {
add_asset(pi);
... | false | false | false | false | false | 0 |
server_shutdown(AN_main *pm, aisc_string passwd){
/** passwdcheck **/
if( strcmp(passwd, "ldfiojkherjkh") ) return 1;
printf("\narb_name_server: I got the shutdown message.\n");
/** shoot clients **/
aisc_broadcast(AN_global.server_communication, 0,
"SERVER SHUTDOWN BY ADMINISTRA... | false | false | false | false | false | 0 |
carl9170_op_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
struct carl9170_vif_info *vif_priv = (void *) vif->drv_priv;
struct ieee80211_vif *main_vif;
struct ar9170 *ar = hw->priv;
unsigned int id;
mutex_lock(&ar->mutex);
if (WARN_ON_ONCE(!vif_priv->active))
goto unlock;
ar->v... | false | false | false | false | false | 0 |
ar9300_compress_decision(struct ath_hw *ah,
int it,
int code,
int reference,
u8 *mptr,
u8 *word, int length, int mdata_size)
{
struct ath_common *common = ath9k_hw_common(ah);
const struct ar9300_eeprom *eep = NULL;
switch (code) {
case _CompressNone:
if (length != mdata_s... | false | false | false | false | false | 0 |
H5FL_fac_free(H5FL_fac_head_t *head, void *obj)
{
void *ret_value=NULL; /* Return value */
/* NOINIT OK here because this must be called after H5FL_fac_init -NAF */
FUNC_ENTER_NOAPI_NOINIT
/* Double check parameters */
HDassert(head);
HDassert(obj);
#ifdef H5FL_TRACK
{
H5FL_... | false | false | false | false | false | 0 |
free_root_bus_devs(struct pci_bus *bus)
{
struct pci_dev *dev;
while (!list_empty(&bus->devices)) {
dev = container_of(bus->devices.next, struct pci_dev,
bus_list);
dev_dbg(&dev->dev, "removing device\n");
pci_stop_and_remove_bus_device(dev);
}
} | false | false | false | false | false | 0 |
setSize(FREE_IMAGE_TYPE image_type, unsigned width, unsigned height, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask) {
if(_dib) {
FreeImage_Unload(_dib);
}
if((_dib = FreeImage_AllocateT(image_type, width, height, bpp, red_mask, green_mask, blue_mask)) == NULL)
return FALSE;
if... | false | false | false | false | false | 0 |
ShowSelectedProcesses(void)
{
const PROC * proc;
int seenCount;
int skippedCount;
int usefulRows;
struct timeval newScrollTime;
isShown = FALSE;
seenCount = 0;
skippedCount = 0;
/*
* If auto scrolling is enabled then see if we need to do that now.
*/
if (!isFrozen && (scrollSeconds > 0) && !DpyDoesSc... | true | true | false | false | false | 1 |
time_fit_plot (gnuplot_info *gi, const char *literal,
const DATASET *dset)
{
int yno = gi->list[1];
const double *yvar = dset->Z[yno];
FILE *fp = NULL;
char fitline[128] = {0};
PRN *prn;
int t, err = 0;
if (gi->x == NULL) {
return E_DATA;
}
err = graph_list_adjust_sample(gi->... | false | false | false | false | false | 0 |
ast_rtp_codecs_payloads_set_rtpmap_type_rate(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int pt,
char *mimetype, char *mimesubtype,
enum ast_rtp_options options,
unsigned int sample_rate)
{
unsigned int i;
int found = 0;
if (pt < 0 || pt >= AST_RTP_MAX_PT)
return -1; /* bogus ... | false | false | false | false | false | 0 |
SetThreadType(ThreadType_t typ,
DWORD dwIdle)
{
try
{
if( FromSameThread() )
{
throw "\n\tit is illegal for a thread to change its own type!\n";
}
m_mutex.Lock();
m_dwIdle = dwIdle;
if( m_type == typ ) {
m_mutex.Unlock();
return;
}
if( m_dwObjectCondition & ILLEGAL_USE_OF_... | false | false | false | false | false | 0 |
ubi_more_leb_change_data(struct ubi_device *ubi, struct ubi_volume *vol,
const void __user *buf, int count)
{
int err;
dbg_gen("write %d of %lld bytes, %lld already passed",
count, vol->upd_bytes, vol->upd_received);
if (ubi->ro_mode)
return -EROFS;
if (vol->upd_received + count > vol->upd_bytes)
c... | false | false | false | false | false | 0 |
create_thedron(ObjSynthObject *feature,
gdouble size,
gdouble aspect,
gdouble angle)
{
gdouble a, b, c, s, r, xp, xm, x, y, xc, yc;
gint xres, yres, i, j;
gdouble *z;
a = size*sqrt(aspect)*GWY_SQRT3/2.0;
b = size/sqrt(aspect);
c = cos(angle);
s =... | false | false | false | false | false | 0 |
_convertlv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
const char *name = NULL;
name = lv_convert_lv_dup(mem, lv);... | false | false | false | false | false | 0 |
gkd_gpg_agent_ops_clrpass (GkdGpgAgentCall *call, gchar *args)
{
GckSession *session;
gchar *id;
/* We don't answer this unless it's from the right terminal */
if (!call->terminal_ok) {
g_message ("received passphrase request from wrong terminal");
return gkd_gpg_agent_send_reply (call, FALSE, "113 Server Reso... | false | false | false | false | false | 0 |
SetObject(Object* object)
{
m_Object = object;
std::vector<ProxyInterface*>::iterator it = m_Interfaces.begin();
while(it != m_Interfaces.end())
{
(*it)->SetObject(m_Object);
it++;
}
} | false | false | false | false | false | 0 |
spl_recursive_it_get_method(zval **object_ptr, char *method, int method_len, const zend_literal *key TSRMLS_DC)
{
union _zend_function *function_handler;
spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(*object_ptr TSRMLS_CC);
long level = object->level;... | false | false | false | false | false | 0 |
fill_place_from_entry (const char *key,
const char *value,
GeocodePlace *place)
{
guint i;
for (i = 0; i < G_N_ELEMENTS (nominatim_to_place_map); i++) {
if (g_str_equal (key, nominatim_to_place_map[i].nominatim_attr)){
... | false | false | false | false | false | 0 |
_MkFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * declarationList, unsigned int errorOnOmit)
{
if(errorOnOmit)
{
struct Declarator * funcDecl = GetFuncDecl(declarator);
if(funcDecl && funcDecl->function.parameters)
{
st... | false | false | false | false | false | 0 |
xbaeSetCell(XbaeMatrixWidget mw, int row, int column, const String value,
Boolean update_text)
#else
xbaeSetCell(mw, row, column, value, update_text)
XbaeMatrixWidget mw;
int row;
int column;
const String value;
Boolean update_text;
#endif
{
if (row >= mw->matrix.rows || row < 0 ||
column >= mw-... | false | false | false | false | false | 0 |
test_list_concat ()
{
GList *foo = g_list_prepend (NULL, "foo");
GList *bar = g_list_prepend (NULL, "bar");
GList *list = g_list_concat (foo, bar);
if (g_list_length (list) != 2)
return FAILED ("Concat failed. #1");
if (strcmp (list->data, "foo"))
return FAILED ("Concat failed. #2");
if (strcmp (list->next... | false | false | false | false | false | 0 |
node_attach(node_t* parent, node_t* child) {
if (!parent || !child) return -1;
child->isLeaf = TRUE;
child->isRoot = FALSE;
child->parent = parent;
child->depth = parent->depth + 1;
if(parent->isLeaf == TRUE) {
parent->isLeaf = FALSE;
}
int res = node_list_add(parent->children, child);
if (res == 0) {
pare... | false | false | false | false | false | 0 |
plugin_init(gchar **error)
{
gchar *rcpath;
if (!check_plugin_version(MAKE_NUMERIC_VERSION(2,9,2,72),
VERSION_NUMERIC, _("Fetchinfo"), error))
return -1;
mail_receive_hook_id = hooks_register_hook(MAIL_RECEIVE_HOOKLIST, mail_receive_hook, NULL);
if (mail_receive_hook_id == (guint)-1) {
/* i18n: Possible e... | false | false | false | false | false | 0 |
IoXmlReader_moveToAttributeNs(IoXmlReader *self, IoObject *locals, IoMessage *m)
{
ENSURE_OPEN;
IoObject *localName, *namespaceURI;
COPY_ARG_TO(0, localName);
COPY_ARG_TO(1, namespaceURI);
int ret = xmlTextReaderMoveToAttributeNs(DATA(self)->reader, (xmlChar*)ENSURE_CSTRING(localName), (xmlChar*)ENSURE_CSTRING(nam... | false | false | false | false | false | 0 |
isLegalAddressingMode(const DataLayout &DL,
const AddrMode &AM, Type *Ty,
unsigned AS) const {
// Allows a signed-extended 11-bit immediate field.
if (AM.BaseOffs <= -(1LL << 13) || AM.BaseOffs >= (1LL << 13)-1)
... | false | false | false | false | false | 0 |
gg_svg_parse_style (struct gg_svg_group *group, struct gg_svg_shape *shape,
struct gg_svg_use *use, struct _xmlAttr *attr)
{
/* parsing SVG Style-related definitions */
struct gg_svg_style *style = NULL;
if (group != NULL)
style = &(group->style);
else if (use != NULL)
style = &(use->style);
els... | false | false | false | false | false | 0 |
request_create_wrap(int argc, char **argv)
{
struct request_create_options opt;
int ret;
int optidx = 0;
struct getargs args[] = {
{ "subject", 0, arg_string, NULL, "Subject DN", NULL },
{ "email", 0, arg_strings, NULL, "Email address in SubjectAltName", NULL },
{ "dnsname", 0, a... | false | false | false | false | false | 0 |
TXT_TableDrawer(TXT_UNCAST_ARG(table))
{
TXT_CAST_ARG(txt_table_t, table);
txt_widget_t *widget;
int i;
// Check the table's current selection points at something valid before
// drawing.
CheckValidSelection(table);
// Draw all cells
for (i=0; i<table->num_widgets; ++i)
{
... | false | false | false | false | false | 0 |
server_port_free(struct evdns_server_port *port)
{
EVUTIL_ASSERT(port);
EVUTIL_ASSERT(!port->refcnt);
EVUTIL_ASSERT(!port->pending_replies);
if (port->socket > 0) {
evutil_closesocket(port->socket);
port->socket = -1;
}
(void) event_del(&port->event);
event_debug_unassign(&port->event);
EVTHREAD_FREE_LOCK(p... | false | false | false | false | false | 0 |
ensBaseadaptorDel(EnsPBaseadaptor *Pba)
{
EnsPBaseadaptor pthis = NULL;
if (!Pba)
return;
#if defined(AJ_DEBUG) && AJ_DEBUG >= 1
if (ajDebugTest("ensBaseadaptorDel"))
ajDebug("ensBaseadaptorDel\n"
" *Pba %p\n",
*Pba);
#endif /* defined(AJ_DEBUG) && AJ_DEBUG... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Wait(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpa... | true | true | false | true | true | 1 |
____smiapp_read(struct smiapp_sensor *sensor, u16 reg,
u16 len, u32 *val)
{
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
struct i2c_msg msg;
unsigned char data[4];
u16 offset = reg;
int r;
msg.addr = client->addr;
msg.flags = 0;
msg.len = 2;
msg.buf = data;
/* high byte goes out ... | true | true | false | false | false | 1 |
protbase(const char *cp)
{
char *n = salloc(strlen(cp) + 1);
char *np = n;
while (*cp) {
if (cp[0] == ':' && cp[1] == '/' && cp[2] == '/') {
*np++ = *cp++;
*np++ = *cp++;
*np++ = *cp++;
} else if (cp[0] == '/')
break;
else
*np++ = *cp++;
}
*np = '\0';
return n;
} | false | false | false | false | false | 0 |
lbitset_and_cmp (bitset dst, bitset src1, bitset src2)
{
lbitset_elt *selt1 = LBITSET_HEAD (src1);
lbitset_elt *selt2 = LBITSET_HEAD (src2);
bool changed;
if (!selt2)
{
lbitset_weed (dst);
changed = !LBITSET_HEAD (dst);
lbitset_zero (dst);
return changed;
}
else if (!selt1)
... | false | false | false | false | false | 0 |
gst_decode_pad_set_blocked (GstDecodePad * dpad, gboolean blocked)
{
GstDecodeBin *dbin = dpad->dbin;
GstPad *opad;
DYN_LOCK (dbin);
GST_DEBUG_OBJECT (dpad, "blocking pad: %d", blocked);
opad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (dpad));
if (!opad)
goto out;
/* do not block if shutting d... | false | false | false | false | false | 0 |
set_magic(int difficulty, object *op, int max_magic, int flags) {
int i;
i = magic_from_difficulty(difficulty);
if ((flags>_ONLY_GOOD) && i < 0)
i = -i;
if (i > max_magic)
i = max_magic;
set_abs_magic(op, i);
if (i < 0)
SET_FLAG(op, FLAG_CURSED);
} | false | false | false | false | false | 0 |
ResolveGUIDToLFN() {
// check if path is already defined
if (!path_for_guid.empty()) return path_for_guid;
// check for guid in the attributes
if (guid.empty()) {
if (url.MetaDataOption("guid").empty()) {
if (url.Path().empty()) return "/";
return url.Path();
}
guid =... | false | false | false | false | false | 0 |
test_data_new (void)
{
TestData *d;
d = g_malloc0 (sizeof (TestData));
g_assert (d);
make_ssid_hashes ("foobar", NM_802_11_MODE_INFRA,
&d->foobar_infra_open,
&d->foobar_infra_wep,
&d->foobar_infra_wpa,
&d->foobar_infra_rsn,
... | false | false | false | false | false | 0 |
infosntoh(struct info *infos, unsigned int dim) {
unsigned int count = 0;
long int txTimeSec;
long int txTimeUsec;
long int rxTimeSec;
long int rxTimeUsec;
while (count < dim) {
infos[count].flowId = ntohl(infos[count].flowId);
infos[count].seqNum = ntohl(infos[count].seqNum);
infos[count].srcPort = ntohl(i... | false | false | false | false | false | 0 |
report_messages(struct Client *source_p)
{
struct DictionaryIter iter;
struct Message *msg;
struct alias_entry *amsg;
DICTIONARY_FOREACH(msg, &iter, cmd_dict)
{
s_assert(msg->cmd != NULL);
sendto_one_numeric(source_p, RPL_STATSCOMMANDS,
form_str(RPL_STATSCOMMANDS),
msg->cmd, msg->count,
... | false | false | false | false | false | 0 |
add_token (parser_env_ptr pe, char token)
{
pe->Token = token;
if ((token != EOS) || (*pe->token_tail != EOS))
{
*pe->token_tail = token;
pe->token_tail++;
}
} | false | false | false | false | false | 0 |
PR_ChangeFileDescNativeHandle(PRFileDesc *fd,
PRInt32 handle)
{
if (fd) fd->secret->md.osfd = handle;
} | false | false | false | false | false | 0 |
zxid_get_call_tgttok(zxid_conf* cf, zxid_ses* ses) {
if (!ses) {
ERR("Null session. %p", ses);
return 0;
}
return ses->call_tgttok;
} | false | false | false | false | false | 0 |
recursive_push(VALUE list, VALUE obj, VALUE paired_obj)
{
VALUE pair_list;
if (!paired_obj) {
rb_hash_aset(list, obj, Qtrue);
}
else if ((pair_list = rb_hash_lookup2(list, obj, Qundef)) == Qundef) {
rb_hash_aset(list, obj, paired_obj);
}
else {
if (TYPE(pair_list) != T_HASH){
VALUE othe... | false | false | false | false | false | 0 |
_dxfUninitPortHandle(tdmPortHandleP portHandle)
{
ENTRY(("_dxfUninitPortHandle(0x%x)",portHandle));
if (portHandle) {
portHandle->portFuncs = NULL ;
portHandle->echoFuncs = NULL ;
/*
* Don't free portHandle->private here cause it's
* done in DESTROY_WINDOW as PORT_CTX
*/
tdmFree(port... | false | false | false | false | false | 0 |
error_gen_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
dict_t *dict, int32_t flags, dict_t *xdata)
{
int op_errno = 0;
eg_t *egp = NULL;
int enable = 1;
egp = this->private;
enable = egp->enable[GF_FOP_FSETXATTR];
... | false | false | false | false | false | 0 |
expr_position_constructorC(expr_position_ty *to, char *fn, int ln)
{
trace(("expr_position_constructorC(to = %p)\n{\n", to));
to->pos_name = str_from_c(fn ? fn : "");
to->pos_line = ln;
trace(("%s:%d (ref cnt %ld)\n",
(to->pos_name ? to->pos_name->str_text : ""), to->pos_line,
(to->pos_n... | false | false | false | false | false | 0 |
gnumeric_leftb (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
const guchar *peek = (const guchar *)value_peek_string (argv[0]);
gnm_float count = argv[1] ? value_get_as_float (argv[1]) : 1.0;
int len = strlen (peek);
int icount, newlen;
if (count < 0)
return value_new_error_VALUE (ei->pos);
icount = (in... | false | false | false | false | false | 0 |
op_ld(uint32_t op, const struct opinfo *oi)
{
long src = op & 7;
long dst = (op >> 3) & 7;
DPRINTF(" %s ", oi->name);
print_reg(dst);
DPRINTF(", ");
print_reg(src);
put_reg(dst, get_reg(src));
} | false | false | false | false | false | 0 |
udlist_removeAll(udlist* head, void *key, const Comparable_vtable* key_method, BOOLEAN ordered, BOOLEAN destroy_data){
if(!head) return;
if(!head->root) return;
udlist_node *run = head->root;
size_t i = 0;
do{
for(i = 0; i < run->n_filled;){
if(ordered && key_method->compare(key, run->elements[i]) > 0) return... | false | false | false | false | false | 0 |
read_tuple_space(__isl_keep isl_stream *s,
struct vars *v, __isl_take isl_space *space, int rational, int comma,
__isl_give isl_space *(*read_el)(__isl_keep isl_stream *s,
struct vars *v, __isl_take isl_space *space, int rational,
void *user),
void *user)
{
struct isl_token *tok;
char *name = NULL;
isl_space ... | false | false | false | false | false | 0 |
verse_send_g_polygon_set_face_uint32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 value)
{
uint8 *buf;
unsigned int buffer_pos = 0;
VCMDBufHead *head;
head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
buf = ((VCMDBuffer10 *)head)->buf;
buffer_pos += vnp_raw_pack_uint8(&buf[buffer_... | false | false | false | false | false | 0 |
find_end_of_node(u64 start, u64 max_addr, u64 size)
{
u64 end = start + size;
while (end - start - mem_hole_size(start, end) < size) {
end += FAKE_NODE_MIN_SIZE;
if (end > max_addr) {
end = max_addr;
break;
}
}
return end;
} | false | false | false | false | false | 0 |
fn_gets_1(const gs_function_Sd_t * pfn, ulong offset, uint * samples)
{
SETUP_SAMPLES(1, ((offset & 7) + n + 7) >> 3);
for (i = 0; i < n; ++i) {
samples[i] = (*p >> (~offset & 7)) & 1;
if (!(++offset & 7))
p++;
}
return 0;
} | false | false | false | false | false | 0 |
wrap(const wchar_t *s)
{
for (;;)
{
const wchar_t *start;
const wchar_t *end;
int done;
while (*s && iswspace(*s))
++s;
start = s;
for (;;)
{
wchar_t c;
c = *s;
if (!c || c == '\n')
... | false | false | false | false | true | 1 |
menu_pipe_execute(ObMenu *self)
{
gchar *output;
GError *err = NULL;
if (!self->execute)
return;
if (self->entries) /* the entries are already created and cached */
return;
if (!g_spawn_command_line_sync(self->execute, &output, NULL, NULL, &err)) {
g_message(_("Failed to ex... | false | false | false | false | false | 0 |
terrain_by_identifier(const char identifier)
{
if (TERRAIN_UNKNOWN_IDENTIFIER == identifier) {
return T_UNKNOWN;
}
terrain_type_iterate(pterrain) {
if (pterrain->identifier == identifier) {
return pterrain;
}
} terrain_type_iterate_end;
return T_UNKNOWN;
} | false | false | false | false | false | 0 |
is_other(file_status status) {
return exists(status) &&
!is_regular_file(status) &&
!is_directory(status) &&
!is_symlink(status);
} | false | false | false | false | false | 0 |
check_object(struct object_entry *entry)
{
if (entry->in_pack) {
struct packed_git *p = entry->in_pack;
struct pack_window *w_curs = NULL;
const unsigned char *base_ref = NULL;
struct object_entry *base_entry;
unsigned long used, used_0;
unsigned int avail;
off_t ofs;
unsigned char *buf, c;
buf = us... | false | false | false | false | false | 0 |
transitionTimes(const Phase &phase, const QDateTime &start, const QDateTime &end) const
{
if (!data(true))
return QList<QDateTime>();
return d->d->data->transitionTimes(phase, start, end);
} | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
int N = mc_get_size_of_pattern_values_table();
unsigned int *values;
int i;
int k;
char *name;
if (argc < 2) {
fprintf(stderr, "Usage: ...\n");
exit(EXIT_FAILURE);
}
printf("\
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\\\n\
* This is ... | false | true | false | false | false | 1 |
xfs_extent_busy_clear(
struct xfs_mount *mp,
struct list_head *list,
bool do_discard)
{
struct xfs_extent_busy *busyp, *n;
struct xfs_perag *pag = NULL;
xfs_agnumber_t agno = NULLAGNUMBER;
list_for_each_entry_safe(busyp, n, list, list) {
if (busyp->agno != agno) {
if (pag) {
spin_unlock(&pag->pagb_l... | false | false | false | false | false | 0 |
amdlibLinearize(int n, double *y, double *wy)
{
double *x,*wx;
double a=0,b=0;
int i;
x=calloc(n,sizeof(double));
wx=calloc(n,sizeof(double));
for (i=0;i<n;i++)
{
x[i]=i;
wx[i]=1.0;
}
amdlibLinearFit(n,x,wx,y,wy,&a,&b);
for (i=0;i<n;i++)
{
y[i]=a+b*x... | false | false | false | false | false | 0 |
pick_offscreen_child (GdkWindow *offscreen_window,
double widget_x, double widget_y,
GocOffscreenBox *offscreen_box)
{
GtkAllocation child_area;
double x, y;
/* Check for child */
if (offscreen_box->child &&
gtk_widget_get_visible (offscreen_box->child)) {
to_child (offscreen_box, widget_x, ... | 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.