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 |
|---|---|---|---|---|---|---|
read_netstring( FILE * f )
{
unsigned long len;
static char * buf = NULL;
static unsigned long buf_len = 0;
if ( fscanf( f, " %9lu", &len ) != 1 )
return NULL;
if ( fgetc( f ) != (int)'\t' )
return NULL;
if ( len > 1024 * 64 )
return NULL; /* sanity check */
if ( ... | false | true | false | false | true | 1 |
get_first_set(const pcre *code, const char *stringname, int *ovector)
{
const real_pcre *re = (const real_pcre *)code;
int entrysize;
char *first, *last;
uschar *entry;
if ((re->options & PCRE_DUPNAMES) == 0 && (re->flags & PCRE_JCHANGED) == 0)
return pcre_get_stringnumber(code, stringname);
entrysize = pcre_get_stri... | false | false | false | false | true | 1 |
multi_msg_eval_wing_squadmsg(int wingnum,int command,ai_info *aif, int player_num)
{
int idx;
ushort net_sig;
int subsys_type;
int sent_count;
// get the index of the sender
if(player_num == -1)
player_num = MY_NET_PLAYER_NUM;
// get the target information
if(aif->target_objnum == -1){
net_sig = 0;
} els... | false | false | false | false | false | 0 |
setDouble(double val, char *errorBuffer,
size_t errorBufferLen, bool doNotSet)
{
myValueSet = true;
if (!myIgnoreBounds && val < myMinDouble)
{
ArLog::log(ArLog::Normal, "ArConfigArg of %s: setDouble value %g below range [%g, %g]", getName(), val, myMinDouble, myMaxDouble);
if (errorBuffer != NUL... | false | false | false | false | false | 0 |
read_new_length (const guchar **at,
const guchar *end,
gsize *pkt_len)
{
guint8 c, c1;
guint32 val;
if (!read_byte (at, end, &c))
return FALSE;
if (c < 192) {
*pkt_len = c;
} else if (c >= 192 && c <= 223) {
if (!read_byte (at, end, &c1))
return FALSE;
*pkt_len = ((c -... | false | false | false | false | false | 0 |
r8712_init_drv_sw(struct _adapter *padapter)
{
if ((r8712_init_cmd_priv(&padapter->cmdpriv)) == _FAIL)
return _FAIL;
padapter->cmdpriv.padapter = padapter;
if ((r8712_init_evt_priv(&padapter->evtpriv)) == _FAIL)
return _FAIL;
if (r8712_init_mlme_priv(padapter) == _FAIL)
return _FAIL;
_r8712_init_xmit_priv(&p... | false | false | false | false | false | 0 |
matches_main_base (const char *path)
{
/* Cache the last query. */
static const char *last_path = NULL;
static int last_match = 0;
if (path != last_path)
{
const char *base;
int length = base_of_path (path, &base);
last_path = path;
last_match = (length == main_input_baselength
... | false | false | false | false | false | 0 |
DetectHardware(GtkWidget *W,gpointer Unused)
{
DIR *D;
struct dirent *Dir;
gchar DName[5][MAX_FNAME],Str[128];
gint i,N;
GtkWidget *Win,*VBox,*HBox,*Label,*Combo,*But;
D=opendir("/dev/"); N=0;
if (!D) return;
while ((Dir=readdir(D)))
{
if (!strncmp("ttyACM",Dir->d_name,6) || !strncmp("ttyUSB",Dir->d_name,6))
... | false | false | false | false | false | 0 |
bookmark_unset(unsigned id)
{
struct bookmark *bm, *prev = NULL;
for (bm = bookmarks; bm; bm = bm->next)
if (bm->id == id) {
locus_destroy(bm->view, bm->locus[0]);
locus_destroy(bm->view, bm->locus[1]);
if (prev)
prev->next = bm->next;
else
bookmarks = bm->next;
return;
}
} | false | false | false | false | false | 0 |
jswrap_process_memory() {
jsvGarbageCollect();
JsVar *obj = jsvNewWithFlags(JSV_OBJECT);
if (obj) {
unsigned int history = 0;
JsVar *historyVar = jsvObjectGetChild(execInfo.hiddenRoot, JSI_HISTORY_NAME, 0);
if (historyVar) {
history = (unsigned int)jsvCountJsVarsUsed(historyVar); // vars used to... | false | false | false | false | false | 0 |
callback(uint8_t type, uint16_t status,
uint8_t *rsp, size_t size, void *udata)
{
unsigned int i;
for (i = 0; i < size; i++) {
printf("%02x ", rsp[i]);
if ((i + 1) % 8 == 0)
printf(" ");
if ((i + 1) % 16 == 0)
printf("\n");
}
printf("\n");
__io_finished = 1;
} | false | false | false | false | false | 0 |
search_idle_cache_should_be_used(struct search_idle_host_state *h)
{
/*
* the expiration of HOST_STATE_FLAG_ADDR_AVAIL is already coped
* by search_idle_candidate_list_add()
*/
if ((h->flags & HOST_STATE_FLAG_ADDR_AVAIL) == 0)
return (1); /* IP address isn't resolvable, even */
return ((h->flags & HOST_STAT... | false | false | false | false | false | 0 |
yearInEra(const QDate &date) const
{
Q_D(const KCalendarSystem);
if (isValid(date)) {
return d->era(date).yearInEra(year(date));
}
return -1;
} | false | false | false | false | false | 0 |
uncached_dwarf_find_save_locs (struct dwarf_cursor *c)
{
dwarf_state_record_t sr;
int ret;
if ((ret = fetch_proc_info (c, c->ip, 1)) < 0)
return ret;
if ((ret = create_state_record_for (c, &sr, c->ip)) < 0)
return ret;
if ((ret = apply_reg_state (c, &sr.rs_current)) < 0)
return ret;
put_unwi... | false | false | false | false | false | 0 |
execl(const char *path, const char *arg, ...)
{
size_t argv_max = 1024;
const char **argv = alloca(argv_max * sizeof(const char *));
unsigned int i;
va_list args;
auto_apt_setup();
argv[0] = arg;
va_start(args, arg);
i = 0;
while (argv[i++] != NULL) {
if (i == argv_max) {
cons... | false | false | false | false | true | 1 |
zget_stdin(i_ctx_t *i_ctx_p, stream ** ps)
{
stream *s;
gx_io_device *iodev;
int code;
if (file_is_valid(s, &ref_stdin)) {
*ps = s;
return 0;
}
iodev = gs_findiodevice(imemory, (const byte *)"%stdin", 6);
iodev->state = i_ctx_p;
code = (*iodev->procs.open_device)(iodev, ... | false | false | false | false | false | 0 |
jp2_write_ftyp(
opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager
)
{
unsigned int i;
unsigned int l_ftyp_size = 16 + 4 * jp2->numcl;
unsigned char * l_ftyp_data, * l_current_data_ptr;
bool l_result;
// preconditions
assert(cio != 00);
as... | false | false | false | false | false | 0 |
test_patternm_destroy(struct cpssp *cpssp)
{
unsigned int i;
patternm_destroy(cpssp->comp_patternm);
sig_opt_rgb_destroy(cpssp->video_out);
for (i = 0; i < 16; i++) {
sig_match_destroy(cpssp->match_inout[i]);
}
for (i = 0; i < 8; i++) {
sig_boolean_destroy(cpssp->text_pm[i].result_in);
sig_string_destroy(... | false | false | false | false | false | 0 |
build_huffman(huffman *h, int *count)
{
int i,j,k=0,code;
// build size list for each symbol (from JPEG spec)
for (i=0; i < 16; ++i)
for (j=0; j < count[i]; ++j)
h->size[k++] = (uint8) (i+1);
h->size[k] = 0;
// compute actual symbols (from jpeg spec)
code = 0;
k = 0;
for(j=1; j <... | false | false | false | false | false | 0 |
gst_alaw_dec_class_init (GstALawDecClass * klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&alaw_dec_src_factory));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&ala... | false | false | false | false | false | 0 |
max517_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct max517_data *data;
struct iio_dev *indio_dev;
struct max517_platform_data *platform_data = client->dev.platform_data;
int chan;
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
if (!indio_dev)
return -ENOMEM;
da... | false | false | false | false | false | 0 |
interpolate_cc(gs_client_color *c,
const gs_client_color *c0, const gs_client_color *c1, double t, int n)
{
int i;
for (i = 0; i < n; i++)
c->paint.values[i] = c0->paint.values[i] * t + c1->paint.values[i] * (1 - t);
} | false | false | false | false | false | 0 |
Config_load(const char *config_file, const char *db_file)
{
int rc = 0;
tst_t *settings = NULL;
struct tagbstring SETTINGS_VAR = bsStatic("settings");
struct tagbstring MIMETYPES_VAR = bsStatic("mimetypes");
settings = Parse_config_file(config_file);
check(settings != NULL, "Error parsing confi... | false | false | false | false | false | 0 |
audio_exit(void)
{
struct channel *channel, *tmp;
pr_info("exit()\n");
list_for_each_entry_safe(channel, tmp, &dev_list, list) {
list_del(&channel->list);
snd_card_free(channel->card);
}
most_deregister_aim(&audio_aim);
} | false | false | false | false | false | 0 |
gretl_matrix_ols (const gretl_vector *y, const gretl_matrix *X,
gretl_vector *b, gretl_matrix *vcv,
gretl_vector *uhat, double *s2)
{
gretl_matrix *XTX = NULL;
int nasty = 0;
int k, T, err = 0;
if (gretl_is_null_matrix(y) ||
gretl_is_null_matrix(X) ||
gretl_is_null_matrix(b)) {
retu... | false | false | false | false | false | 0 |
operator=(
const RelativeDateTimeFormatter& other) {
if (this != &other) {
SharedObject::copyPtr(other.cache, cache);
SharedObject::copyPtr(other.numberFormat, numberFormat);
SharedObject::copyPtr(other.pluralRules, pluralRules);
}
return *this;
} | false | false | false | false | false | 0 |
matr_vector_seq(Matrix **A, int nmatrices, unsigned int maxrows,
Vector *w, Vector *z) {
int i;
Vector *tmp1, *tmp2, *ctmp;
if (!A || !w || !z) {
if (MATR_DEBUG_MODE) {
fprintf(stderr, "matr_vector_seq: null arguments.\n");
}
return;
}
tmp1 = vector_make_size(maxrows, z->type, z->c... | false | false | false | false | false | 0 |
readtags(struct ifd *dir, int seq, struct exiftags *t, int domkr)
{
int i;
if (debug) {
/* XXX Byte order info can be off for maker notes. */
if (dir->par && dir->par->tag != EXIF_T_UNKNOWN) {
printf("Processing %s directory, %d entries, "
"%s-endian\n",
dir->par->name, dir->num, dir->md.order =... | false | false | false | false | false | 0 |
mime_handler(struct rfc2045 *rfc))(struct rfc2045 *, FILE *)
{
const char *content_type, *dummy;
rfc2045_mimeinfo(rfc, &content_type, &dummy, &dummy);
if (strcmp(content_type, "multipart/alternative") == 0)
return ( &list_msg_mime_multipart_alternative);
if (strncmp(content_type, "multi... | false | false | false | false | false | 0 |
showCells ()
{
for( int i = 0; i < _height; i++ ) {
for( int j = 0; j < _width; j++ ) {
( (FightCell*)_genericFightCells[i][j] )->setEnabled( true );
}
}
update ();
} | false | false | false | false | false | 0 |
usc_RTCmd( struct mgsl_struct *info, u16 Cmd )
{
/* output command to CCAR in bits <15..11> */
/* preserve bits <10..7>, bits <6..0> must be zero */
outw( Cmd + info->loopback_bits, info->io_base + CCAR );
/* Read to flush write to CCAR */
if ( info->bus_type == MGSL_BUS_TYPE_PCI )
inw( info->io_base + CCAR );... | false | false | false | false | false | 0 |
stmmac_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *)dev_id;
struct stmmac_priv *priv = netdev_priv(dev);
if (priv->irq_wake)
pm_wakeup_event(priv->device, 0);
if (unlikely(!dev)) {
pr_err("%s: invalid dev pointer\n", __func__);
return IRQ_NONE;
}
/* To handle GMAC own ... | false | false | false | false | false | 0 |
resetHandlers()
{
if( !Private::handlerSet )
return;
Private::handlerSet = false;
#ifdef Q_OS_UNIX
sigset_t mask, omask;
sigemptyset( &mask );
sigaddset( &mask, SIGCHLD );
sigprocmask( SIG_BLOCK, &mask, &omask );
struct sigaction act;
sigaction( SIGCHLD, &Private::oldChildHandlerData, &act );
... | false | false | false | false | false | 0 |
get_secrets_cb (NMSecretAgent *self,
NMConnection *connection,
GHashTable *secrets,
GError *error,
gpointer user_data)
{
GetSecretsInfo *info = user_data;
if (error)
dbus_g_method_return_error (info->context, error);
else
dbus_g_method_return (info... | false | false | false | false | false | 0 |
routexname(struct sockaddr_storage *in)
{
char *cp;
static char line[MAXHOSTNAMELEN];
struct hostent *hp = NULL;
static char domain[MAXHOSTNAMELEN];
static int first = 1;
struct sockaddr_in *sin = (struct sockaddr_in *)in;
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)in;
if (first... | false | false | false | false | false | 0 |
min_of_the_max_uint(
uint (handler::*operator_func)(void) const) const
{
handler **file;
uint min_of_the_max= ((*m_file)->*operator_func)();
for (file= m_file+1; *file; file++)
{
uint tmp= ((*file)->*operator_func)();
set_if_smaller(min_of_the_max, tmp);
}
return min_of_the_m... | false | false | false | false | false | 0 |
gst_retinex_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
GstCaps * outcaps)
{
GstRetinex *retinex = GST_RETINEX (btrans);
CvSize size;
GstVideoInfo info;
gst_video_info_from_caps (&info, incaps);
size = cvSize (info.width, info.height);
/* If cvRGB is already allocated, it means there's a ca... | false | false | false | false | false | 0 |
vtkPythonGetValue(PyObject *o, double &a)
{
a = PyFloat_AsDouble(o);
return (a != -1.0f || !PyErr_Occurred());
} | false | false | false | false | false | 0 |
GetHostName(char * name, int size)
{
if (gethostname(name, size) == SOCKET_ERROR) {
jack_error("Can't get 'hostname' : %s", strerror(NET_ERROR_CODE));
strcpy(name, "default");
return SOCKET_ERROR;
}
return 0;
} | false | false | false | false | false | 0 |
gee_read_only_map_contains_all (GeeReadOnlyMap* self, GeeMap* map) {
gboolean result = FALSE;
GeeMap* _tmp0_ = NULL;
GeeMap* _tmp1_ = NULL;
gboolean _tmp2_ = FALSE;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (map != NULL, FALSE);
_tmp0_ = self->_map;
_tmp1_ = map;
_tmp2_ = gee_map_has_all... | false | false | false | false | false | 0 |
Clean_Erased_Clauses(void)
{
WamWord *b, *base;
DynScan *scan;
DynPInf *dyn, *dyn1, **prev;
DynCInf *clause, *clause1;
if (size_of_erased <= MAX_SIZE_BEFORE_CLEAN)
return;
base = Local_Stack;
for (b = B; b > base; b = BB(b))
{
scan = Get_Scan_Choice_Point(b);
if (scan == NULL)
conti... | false | false | false | false | false | 0 |
SetProperty(vtkVolumeProperty *property)
{
if( this->Property != property )
{
if (this->Property != NULL) {this->Property->UnRegister(this);}
this->Property = property;
if (this->Property != NULL)
{
this->Property->Register(this);
this->Property->UpdateMTimes();
}
this->Mo... | false | false | false | false | false | 0 |
snippets_browser_load (SnippetsBrowser *snippets_browser,
SnippetsDB *snippets_db,
SnippetsInteraction *snippets_interaction)
{
SnippetsBrowserPrivate *priv = NULL;
/* Assertions */
g_return_if_fail (ANJUTA_IS_SNIPPETS_BROWSER (snippets_browser));
g_return_if_fail (AN... | false | false | false | false | false | 0 |
L40(base0)
register object *base0;
{ register object *base=vs_base;
register object *sup=base+VM98; VC98
vs_check;
{object V898;
V898=(base[0]);
vs_top=sup;
goto TTL;
TTL:;
{register long V899;
V899= (long)0;
{object V900;
object V901;
V900= (V898);
V901= CMPcar((V900));
goto T2138;
T2138:;
if(!(((V900))=... | false | false | false | false | false | 0 |
zGetStopBlock(zStopSeq* ss, coor_t pos){
zStopBlock* block = zListMoveFirst(&ss->value);
while(block != NULL){
if((block->pos <= pos) && (block->pos + BLOCK_SIZE > pos)){
zListMoveCurrentToFirst(&ss->value);
return block;
}
block = zListMoveNext(&ss->value);
}
pos = (int)(pos/BLOCK_SIZE) * BLOCK_SIZE;
... | false | false | false | false | false | 0 |
ext2_mode_xlate(__u16 lmode)
{
mode_t mode = 0;
int i;
for (i=0; xlat_tbl[i].lmask; i++)
{
if (lmode & xlat_tbl[i].lmask)
mode |= xlat_tbl[i].mask;
}
return mode;
} | false | false | false | false | false | 0 |
isItemVisible(const FXFoldingItem* item) const {
if(!item){ fxerror("%s::isItemVisible: item is NULL.\n",getClassName()); }
return 0<pos_y+header->getHeight()+item->y+item->getHeight(this) && pos_y+header->getHeight()+item->y<viewport_h;
} | false | false | false | true | false | 1 |
pmem_init(void)
{
int error;
pmem_major = register_blkdev(0, "pmem");
if (pmem_major < 0)
return pmem_major;
error = nd_driver_register(&nd_pmem_driver);
if (error) {
unregister_blkdev(pmem_major, "pmem");
return error;
}
return 0;
} | false | false | false | false | false | 0 |
kmRay2IntersectTriangle(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, const kmVec2* p3, kmVec2* intersection, kmVec2* normal_out, kmScalar* distance_out) {
kmVec2 intersect;
kmVec2 final_intersect;
kmVec2 normal;
kmScalar distance = 10000.0f;
kmBool intersected = KM_FALSE;
if(kmRay2In... | false | false | false | false | false | 0 |
ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
struct ttm_buffer_object **new_obj)
{
struct ttm_buffer_object *fbo;
int ret;
fbo = kmalloc(sizeof(*fbo), GFP_KERNEL);
if (!fbo)
return -ENOMEM;
*fbo = *bo;
/**
* Fix up members that we shouldn't copy directly:
* TODO: Explicit member cop... | false | false | false | false | false | 0 |
urlsection(cmd_parms *cmd, void *mconfig, const char *arg)
{
const char *errmsg;
const char *endp = ap_strrchr_c(arg, '>');
int old_overrides = cmd->override;
char *old_path = cmd->path;
core_dir_config *conf;
ap_regex_t *r = NULL;
const command_rec *thiscmd = cmd->cmd;
ap_conf_vector_t ... | false | false | false | false | false | 0 |
findGenieTags (void) {
if (visitor == NULL) {
visitor = ctags_visitor_new();
}
ctags_visitor_parse_genie (visitor, getSourceFileName(), (CTagsEntryMaker) make_ctags_entry);
} | false | false | false | false | false | 0 |
gfs2_log_header_out(struct gfs2_log_header *lh,
struct gfs2_buffer_head *bh)
{
struct gfs2_log_header *str = (struct gfs2_log_header *)bh->b_data;
gfs2_meta_header_out_bh(&lh->lh_header, bh);
CPOUT_64(lh, str, lh_sequence);
CPOUT_32(lh, str, lh_flags);
CPOUT_32(lh, str, lh_tail);
CPOUT_32(lh, str, lh_blkno);... | false | false | false | false | false | 0 |
price_quote(struct obj *first_obj)
{
struct obj *otmp;
char buf[BUFSZ], price[40];
long cost;
int cnt = 0;
winid tmpwin;
struct monst *shkp = shop_keeper(inside_shop(u.ux, u.uy));
tmpwin = create_nhwindow(NHW_MENU);
putstr(tmpwin, 0, "Fine goods for sale:");
putstr(tmpwin, 0, "");
... | false | false | false | false | false | 0 |
usbhs_rcar2_hardware_exit(struct platform_device *pdev)
{
struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
if (priv->phy) {
phy_put(priv->phy);
priv->phy = NULL;
}
if (priv->usb_phy) {
usb_put_phy(priv->usb_phy);
priv->usb_phy = NULL;
}
return 0;
} | false | false | false | false | false | 0 |
ModFunction(
void *theEnv,
DATA_OBJECT_PTR result)
{
DATA_OBJECT item1, item2;
double fnum1, fnum2;
long lnum1, lnum2;
if (EnvArgCountCheck(theEnv,"mod",EXACTLY,2) == -1)
{
result->type = INTEGER;
result->value = (void *) EnvAddLong(theEnv,0L);
return;
}
if (EnvArgType... | false | false | false | false | false | 0 |
common_init(int argc,char* *argv)
{/*28:*/
#line 352 "common.w"
{char*cwebinputs=getenv("CWEBINPUTS");
at_h_path[0].name=at_i_path.name=NULL;
#ifdef CWEBHEADERS
at_h_path[0].name=CWEBHEADERS;
at_h_path[0].length=(int)strlen(CWEBHEADERS);
#endif
if(cwebinputs!=NULL)
{at_i_path.length=(int)strlen(cwebinputs);
at_i_path.n... | false | false | false | false | false | 0 |
task_cgroup_memory_create(stepd_step_rec_t *job)
{
int fstatus = SLURM_ERROR;
xcgroup_t memory_cg;
uint32_t jobid = job->jobid;
uint32_t stepid = job->stepid;
uid_t uid = job->uid;
gid_t gid = job->gid;
char* slurm_cgpath ;
/* create slurm root cg in this cg namespace */
slurm_cgpath = task_cgroup_create_s... | false | false | false | false | false | 0 |
_strstrip(char *String)
{
for (;*String != 0 && (*String == ' ' || *String == '\t'); String++);
if (*String == 0)
return String;
return _strrstrip(String);
} | false | false | false | false | false | 0 |
stats_print_diff(struct stats_file *file)
{
struct stats_record *begin, *end;
begin = get_begin(file);
begin = get_next(file, begin);
end = get_end(file);
printf("\n(begin + 1)\n");
printf("\t[%04d] ", get_index(file, begin));
stats_print_record(begin);
printf("end\n");
printf("\t[%04d] ", get_index(file, en... | false | false | false | false | false | 0 |
set_prop (struct dtv_property *props, int *n, guint32 cmd, guint32 data)
{
if (*n == NUM_DTV_PROPS) {
g_critical ("Index out of bounds");
} else {
props[*n].cmd = cmd;
props[(*n)++].u.data = data;
}
} | false | false | false | false | false | 0 |
searchUsingFunction(
qint64 (QuickFind::*search_function)() )
{
emit followDisabled();
int line = (quickFind_.*search_function)();
if ( line >= 0 ) {
LOG(logDEBUG) << "search " << line;
displayLine( line );
emit updateLineNumber( line );
}
} | false | false | false | false | false | 0 |
krealloc(const void *p, size_t new_size, gfp_t flags)
{
void *ret;
if (unlikely(!new_size)) {
kfree(p);
return ZERO_SIZE_PTR;
}
ret = __do_krealloc(p, new_size, flags);
if (ret && p != ret)
kfree(p);
return ret;
} | false | false | false | false | false | 0 |
_MemorySeekProc(fi_handle handle, long offset, int origin) {
FIMEMORYHEADER *mem_header = (FIMEMORYHEADER*)(((FIMEMORY*)handle)->data);
switch(origin) { //0 to filelen-1 are 'inside' the file
default:
case SEEK_SET: //can fseek() to 0-7FFFFFFF always
if( offset >= 0 ) {
mem_header->curpos = offset;
re... | false | false | false | false | false | 0 |
send_string(char *str)
{
if (bufferspace() < (sendchar_cwmode?5:1)*(int)strlen(str)+100)
return -1;
while(*str)
{
int c = (int)((unsigned char)*str);
if(sendchar_cwmode)
{
putcodeword( c|CODE_CW_ECHO );
send_cw_char(*str);
}
else
{
putcode... | false | false | false | false | false | 0 |
gom_account_miner_job_process_finish (GAsyncResult *res,
GError **error)
{
GSimpleAsyncResult *simple_res = G_SIMPLE_ASYNC_RESULT (res);
g_assert (g_simple_async_result_is_valid (res, NULL,
gom_account_miner_job_process_async));
i... | false | false | false | false | false | 0 |
send_tone(struct unistimsession *pte, uint16_t tone1, uint16_t tone2)
{
BUFFSEND;
if (!tone1) {
if (unistimdebug) {
ast_verb(0, "Sending Stream Based Tone Off\n");
}
memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_off,
sizeof(packet_send_stream_based_tone_off));
send_client(SIZE_HEADER +... | false | true | false | false | false | 1 |
operator<<(OutputCharStream &os,
SgmlFOTBuilder::Data data)
{
const Char *s = data.ptr;
size_t n = data.size;
for (; n > 0; n--, s++) {
switch (*s) {
case '&':
os << "&";
break;
case '<':
os << "<";
break;
case '>':
os << ">";
break;
case '... | false | false | false | false | false | 0 |
filter_driver_finalize (GObject *object)
{
CamelFilterDriverPrivate *priv;
struct _filter_rule *node;
priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (object);
/* close all folders that were opened for appending */
close_folders (CAMEL_FILTER_DRIVER (object));
g_hash_table_destroy (priv->folders);
g_hash_table_foreach... | false | false | false | false | false | 0 |
check_header(int target)
{
if(l_targets[target].written)
return;
if(l_targets[target].flags & LOG_HTML)
{
log_write_raw(target, "<!DOCTYPE HTML PUBLIC "
"\"-//W3C//DTD HTML 4.01 Transitional//EN\" "
"\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n");
log_write_raw(target, "<HTML>\n\t<HEAD>\n");
log... | false | false | false | false | false | 0 |
alloc_ringmemory(struct b43legacy_dmaring *ring)
{
/* GFP flags must match the flags in free_ringmemory()! */
ring->descbase = dma_zalloc_coherent(ring->dev->dev->dma_dev,
B43legacy_DMA_RINGMEMSIZE,
&(ring->dmabase), GFP_KERNEL);
if (!ring->descbase)
return -ENOMEM;
return 0;
} | false | false | false | false | false | 0 |
cb_photo_menu_select(GtkWidget *item,
GtkPositionType selected)
{
if (selected == 1) {
if (0 == browse_photo(gtk_widget_get_toplevel(clist)))
/* change photo canceled */
return;
}
if (selected==2) {
if (image) {
gtk_widget_destroy(i... | false | false | false | false | false | 0 |
rfftw_measure_runtime(fftw_plan plan,
fftw_real *in, int istride,
fftw_real *out, int ostride)
{
fftw_time begin, end, start;
double t, tmin;
int i, iter;
int n;
int repeat;
int howmany = plan->vector_size;
n = plan->n;
iter = 1;
for (;;) {
tmin = 1.0E1... | false | false | false | false | false | 0 |
auto_draw(Nv_data * dc, Tcl_Interp * interp)
{
const char *buf;
int autodraw;
char abuf[128];
buf = Tcl_GetVar(interp, "auto_draw", TCL_GLOBAL_ONLY);
if (buf != NULL) {
autodraw = atoi(buf);
sprintf(abuf, "%d", autodraw);
Tcl_SetResult(interp, abuf, TCL_VOLATILE);
}
return (TCL_OK);
} | true | true | false | false | true | 1 |
alloc_ctrl(struct ctrltype **where)
{
struct ctrltype *np;
struct ctrltype *result = (struct ctrltype *) malloc(sizeof(struct ctrltype));
if (!result)
nomem();
result->ctrl_next = (struct ctrltype *) 0;
result->ctrl_cond = (struct condition *) 0;
result->ctrl_string = (char *) 0;
result->ctrl_action = CT_AS... | false | false | false | false | false | 0 |
AllNotesOff ( int chan )
{
MIDITimedBigMessage msg;
// send a note off for every note on in the out_matrix
if ( out_matrix.GetChannelCount ( chan ) > 0 )
{
for ( int note = 0; note < 128; ++note )
{
while ( out_matrix.GetNoteCount ( chan, note ) > 0 )
{
... | false | false | false | false | false | 0 |
pc_setitemlimit(struct map_session_data *sd)
{
int i,j;
unsigned int now = (unsigned int)time(NULL);
unsigned int tick = gettick();
nullpo_retr(0, sd);
for(i = 0,j = 0; i < MAX_INVENTORY && j < sd->inventory_num; i++) {
if(sd->status.inventory[i].nameid <= 0)
continue;
j++;
if(sd->status.inventory[i].l... | false | false | false | false | false | 0 |
Lstring_char_p()
{
# line 53 "character.d"
int narg;
register object *DPPbase=vs_base;
#define c DPPbase[0]
narg = vs_top - vs_base;
check_arg(1);
# line 54 "character.d"
check_type_character(&c);
if (char_font(c) != 0 || char_bits(c) != 0)
{
vs_base[0] = Cnil;
vs_top = vs_base + 1;
return;
}
# l... | false | false | false | false | false | 0 |
usage(const char *const me, const struct option *const options,
const char *const short_options)
{
const struct option *opt;
printf("Usage: %s [options]", me);
for (opt = options; opt->name; opt++) {
const char *descr = opt->name + strlen(opt->name) + 1;
if (strchr(short_options, opt->val))
printf("\n ... | false | false | false | false | false | 0 |
panel_addto_filter_func (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer userdata)
{
PanelAddtoDialog *dialog;
PanelAddtoItemInfo *data;
dialog = (PanelAddtoDialog *) userdata;
if (!dialog->search_text || !dialog->search_text[0])
return TRUE;
gtk_tree_model_get (model, iter, COLUMN_DATA, &dat... | false | false | false | false | false | 0 |
BALCPProtect(DataSet &ds, Tag const & tag, IOD const & iod)
{
// \precondition
assert( ds.FindDataElement(tag) );
AnonymizeEvent ae;
ae.SetTag( tag );
this->InvokeEvent( ae );
bool canempty = CanEmptyTag( tag, iod );
if( !canempty )
{
DataElement copy;
copy = ds.GetDataElement( tag );
... | false | false | false | false | false | 0 |
expand_builtin_atomic_store (enum machine_mode mode, tree exp)
{
rtx mem, val;
enum memmodel model;
model = get_memmodel (CALL_EXPR_ARG (exp, 2));
if (model != MEMMODEL_RELAXED
&& model != MEMMODEL_SEQ_CST
&& model != MEMMODEL_RELEASE)
{
error ("invalid memory model for %<__atomic_store%>... | false | false | false | false | true | 1 |
gf_node_replace_child(GF_Node *node, GF_ChildNodeItem **container, s32 pos, GF_Node *newNode)
{
GF_ChildNodeItem *child, *prev;
u32 tag;
u32 cur_pos = 0;
child = *container;
prev = NULL;
while (child->next) {
if ((pos<0) || (cur_pos!=(u32)pos)) {
prev = child;
child = child->next;
cur_pos++;
contin... | false | false | false | false | false | 0 |
GetReplaceString( const char* sReplaceExp ) const
{
sstring szEmpty;
char *src = (char *)sReplaceExp;
char *buf = 0;
char c;
int no;
size_t len;
if( sReplaceExp == NULL )
{
regerror( REGERR_NULL_TO_REGSUB );
return szEmpty;
}
if ( *program != MAGIC)
{
regerror( REGERR_DAMAGED_REGEXP_REGSUB );
retu... | false | false | false | false | true | 1 |
knh_ResultSet_initColumn(CTX ctx, kResultSet *o, size_t column_size)
{
size_t i;
if(DP(o)->column_size != 0) {
for(i = 0; i < DP(o)->column_size; i++) {
KNH_FINALv(ctx, DP(o)->column[i].name);
}
KNH_FREE(ctx, DP(o)->column, sizeof(kDBschema) * DP(o)->column_size);
DP(o)->column = NULL;
if(DP(o)->qcur != ... | false | false | false | false | false | 0 |
merge_at(MergeState *ms, Py_ssize_t i)
{
sortslice ssa, ssb;
Py_ssize_t na, nb;
Py_ssize_t k;
assert(ms != NULL);
assert(ms->n >= 2);
assert(i >= 0);
assert(i == ms->n - 2 || i == ms->n - 3);
ssa = ms->pending[i].base;
na = ms->pending[i].len;
ssb = ms->pending[i+1].base;
n... | false | false | false | false | false | 0 |
openChain(char *chain, char *policy, struct xt_counters *ctr, char close)
{
closeChain();
strncpy(curChain, chain, XT_CHAIN_MAXNAMELEN);
curChain[XT_CHAIN_MAXNAMELEN] = '\0';
printf(" <chain ");
xmlAttrS("name", curChain);
if (strcmp(policy, "-") != 0)
xmlAttrS("policy", policy);
xmlAttrI("packet-count", ... | false | true | true | false | false | 1 |
TIM_GetITStatus(TIM_TypeDef* TIMx, uint16_t TIM_IT)
{
ITStatus bitstatus = RESET;
uint16_t itstatus = 0x0, itenable = 0x0;
/* Check the parameters */
assert_param(IS_TIM_ALL_PERIPH(TIMx));
assert_param(IS_TIM_GET_IT(TIM_IT));
itstatus = TIMx->SR & TIM_IT;
itenable = TIMx->DIER & TIM_IT;... | false | false | false | false | false | 0 |
EmitRun(const char* start, const char* limit,
ExpandEmitter* out) {
if (start < limit) {
out->Emit(start, (limit - start));
}
} | false | false | false | false | false | 0 |
snd_emux_create_effect(struct snd_emux_port *p)
{
int i;
p->effect = kcalloc(p->chset.max_channels,
sizeof(struct snd_emux_effect_table), GFP_KERNEL);
if (p->effect) {
for (i = 0; i < p->chset.max_channels; i++)
p->chset.channels[i].private = p->effect + i;
} else {
for (i = 0; i < p->chset.max_channe... | false | false | false | false | false | 0 |
jack_compute_new_latency (jack_engine_t *engine)
{
JSList *node;
JSList *reverse_list = NULL;
jack_event_t event;
event.type = LatencyCallback;
event.x.n = 0;
/* iterate over all clients in graph order, and emit
* capture latency callback.
* also builds up list in reverse graph order.
*/
for (node = eng... | false | false | false | false | false | 0 |
soap_s2bool(struct soap *soap, const char *s, bool *a)
{
const struct soap_code_map *map;
if (!s)
return soap->error;
map = soap_code(soap_codes_bool, s);
if (map)
*a = (bool)(map->code != 0);
else
{ long n;
if (soap_s2long(soap, s, &n) || n < 0 || n > 1)
return soap->error = SOAP_TYPE;
*a = (bool)(n !... | false | false | false | false | false | 0 |
linux_fremovexattr (const int fd,
const char *attrname,
struct hv *flags)
{
int ret;
char *q;
/* XXX: Other flags? */
q = qualify_attrname(attrname, flags);
if (q)
{
ret = fremovexattr(fd, q);
if (ret == -1)
ret = -errno;
free(q);
}
else
{
... | false | false | false | false | false | 0 |
imapx_job_manage_subscription_start (CamelIMAPXJob *job,
CamelIMAPXServer *is,
GCancellable *cancellable,
GError **error)
{
CamelIMAPXCommand *ic;
CamelIMAPXStore *store;
ManageSubscriptionsData *data;
gch... | false | false | false | false | false | 0 |
my_strnncoll_uca(CHARSET_INFO *cs,
my_uca_scanner_handler *scanner_handler,
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
my_uca_scanner sscanner;
my_uca_scanner tscanner;
int s_res;
in... | false | false | false | false | false | 0 |
gtksharp_widget_base_popup_menu (GtkWidget* widget)
{
GtkWidgetClass *klass = (GtkWidgetClass *) get_threshold_class (G_OBJECT (widget));
if (klass->popup_menu)
return (* klass->popup_menu) (widget);
return FALSE;
} | false | false | false | false | false | 0 |
ajStrTrimEndC(AjPStr* Pstr, const char* txt)
{
AjPStr thys;
const char* cp;
size_t i;
if(!*Pstr)
*Pstr = ajStrNewResLenC("", 1, 0);
else if((*Pstr)->Use > 1)
ajStrGetuniqueStr(Pstr);
thys = *Pstr;
if(!thys->Len)
return ajFalse;
cp = &thys->Ptr[thys->Len-1];
i = 0... | false | false | false | false | false | 0 |
pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data)
{
struct ifaddrs *ifa,
*l;
if (getifaddrs(&ifa) < 0)
return -1;
for (l = ifa; l; l = l->ifa_next)
run_ifaddr_callback(callback, cb_data,
l->ifa_addr, l->ifa_netmask);
freeifaddrs(ifa);
return 0;
} | false | true | false | false | false | 1 |
target_screen_changed_cb(GtkWidget* widget, GdkScreen* prev_screen, gpointer user_data)
{
GdkScreen* screen = gtk_widget_get_screen(widget);
if ( screen && (screen != prev_screen) ) {
track_screen( screen, EGE_COLOR_PROF_TRACKER(user_data) );
}
} | false | false | false | false | false | 0 |
OnCompilerFinished(cb_unused CodeBlocksEvent& event)
{
if (m_WaitingCompilerToFinish)
{
m_WaitingCompilerToFinish = false;
bool compilerFailed = false;
// only proceed if build succeeeded
if (m_pCompiler && m_pCompiler->GetExitCode() != 0)
{
AnnoyingDialog dlg... | 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.