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 |
|---|---|---|---|---|---|---|
shade_next_patch(shade_coord_stream_t * cs, int BitsPerFlag,
patch_curve_t curve[4], gs_fixed_point interior[4] /* 0 for Coons patch */ )
{
int flag = shade_next_flag(cs, BitsPerFlag);
int num_colors, code;
if (flag < 0) {
if (!cs->is_eod(cs))
return_error(gs_error_rangecheck);
... | false | false | false | false | false | 0 |
getStream(const URL& url, const std::string& postdata,
bool namedCacheFile) const
{
std::auto_ptr<IOChannel> stream;
if (url.protocol() == "file") {
if (!postdata.empty()) {
log_error(_("POST data discarded while getting a stream "
"from file: uri"));
}
... | false | false | false | false | false | 0 |
Connect( CString hubname, CString server, CClient * client, bool sslconnect )
{
if ( server.IsEmpty() )
{
return;
}
if ( hubname.IsEmpty() )
{
hubname = server;
}
if ( !client )
{
m_Mutex.Lock();
client = (CClient*)GetHub(hubname,server);
m_Mutex.UnLock();
if ( client )
{
return;
}
cl... | false | false | false | false | false | 0 |
snd_mtpav_get_ISA(struct mtpav *mcard)
{
if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) {
snd_printk(KERN_ERR "MTVAP port 0x%lx is busy\n", port);
return -EBUSY;
}
mcard->port = port;
if (request_irq(irq, snd_mtpav_irqh, 0, "MOTU MTPAV", mcard)) {
snd_printk(KERN_ERR "MTVAP IRQ %d ... | false | false | false | false | false | 0 |
_close_space(id, workerId, cleanup)
int id, cleanup;
char *workerId;
{
if (cleanup)
_cleanup_queue(id, workerId);
return cnf_close(id);
} | false | false | false | false | false | 0 |
initialize_city_dialogs(void)
{
int i;
GdkColor orange = { 0, 65535, 32768, 0 }; /* not currently used */
GdkColor red = { 0, 65535, 0, 0 };
fc_assert_ret(!city_dialogs_have_been_initialised);
dialog_list = dialog_list_new();
init_citydlg_dimensions();
/* make the styles */
for (i = 0; i < NUM_INFO_... | false | false | false | false | false | 0 |
create_popup_win(gchar* label)
{
GtkWidget *MainFrame;
GtkWidget *Label;
GtkWidget *hbox = gtk_hbox_new(0,FALSE);
MainFrame = gtk_window_new (GTK_WINDOW_POPUP);
/* center it on the screen*/
gtk_window_set_position(GTK_WINDOW (MainFrame), GTK_WIN_POS_MOUSE);
/* set up key and mound button press to hid... | false | false | false | false | false | 0 |
comm_stop(void)
{
struct crda_request *req, *tmp;
cancel_work_sync(&comm_work);
mutex_lock(&crda_mutex);
if (!dl_list_empty(&crda_list)) {
dl_list_for_each_safe(req, tmp, &crda_list,
struct crda_request, list) {
dl_list_del(&req->list);
}
}
mutex_unlock(&crda_mutex);
mutex_destroy(&crda_mutex... | false | false | false | false | false | 0 |
srec_write_symbols (bfd *abfd)
{
/* Dump out the symbols of a bfd. */
int i;
int count = bfd_get_symcount (abfd);
if (count)
{
bfd_size_type len;
asymbol **table = bfd_get_outsymbols (abfd);
len = strlen (abfd->filename);
if (bfd_bwrite ("$$ ", (bfd_size_type) 3, abfd) != 3
|| ... | true | true | false | false | false | 1 |
gabufr_extract_msg_desc(gabufr_msg * msg, gaint parse_data) {
unsigned char * pos, * start, * end;
gabufr_varid * head, * current, * next;
gabufr_varinf * varinf;
if (msg == NULL) {
return NULL;
}
if (GABUFR_DEBUG || parse_data == GABUFR_NO_PARSE_DATA) {
printf("\n\n\n>>> start of message\n");
... | false | false | false | false | false | 0 |
slot_can_be_cleaned(const lien_back * back) {
return (back->status == STATUS_READY) // ready
/* Check autoclean */
&& (!back->testmode) // not test mode
&& (strnotempty(back->url_sav)) // filename exists
&& (HTTP_IS_OK(back->r.statuscode)) // HTTP "OK"
&& (back->r.size >= 0) // siz... | false | false | false | false | false | 0 |
recff_xpcall(jit_State *J, RecordFFData *rd)
{
if (J->maxslot >= 2) {
TValue argv0, argv1;
TRef tmp;
int errcode;
/* Swap function and traceback. */
tmp = J->base[0]; J->base[0] = J->base[1]; J->base[1] = tmp;
copyTV(J->L, &argv0, &rd->argv[0]);
copyTV(J->L, &argv1, &rd->argv[1]);
copy... | false | false | false | false | false | 0 |
USB_OTG_BSP_uDelay (const uint32_t usec) {
uint32_t count = 0;
const uint32_t utime = (120 * usec / 7);
do {
if ( ++count > utime ) {
return ;
}
} while (1);
} | false | false | false | false | false | 0 |
strace_read_rmdir(char * line, list_t * list) {
rmdir_item_t * op_item;
int retval;
char start_time[MAX_TIME_STRING];
char dur[MAX_TIME_STRING];
op_item = new_rmdir_item();
op_item->type = OP_RMDIR;
if ((retval = sscanf(line, "%d %s %*[^\"]\"%" QUOTE(MAX_STRING) "[^\"]\") = %d%*[^<]<%[^>]", &op_item->o.in... | true | true | false | false | true | 1 |
writeNoiseLevelData (HANDLE_SBR_ENV_DATA sbrEnvData, HANDLE_FDK_BITSTREAM hBitStream, INT coupling)
{
INT j, i, payloadBits = 0;
INT nNoiseEnvelopes = sbrEnvData->noOfEnvelopes > 1 ? 2 : 1;
for (i = 0; i < nNoiseEnvelopes; i++) {
switch (sbrEnvData->domain_vec_noise[i]) {
case FREQ:
if (coupling &&... | false | false | false | false | false | 0 |
read_awars(AW_root *awr,const char *awar_prefix){
char buffer[1024];
int x,y;
for (x = 0;x<size;x++){
if (x_description[x]){
for (y = 0;y<size;y++){
if (y_description[y]){
sprintf(buffer,"%s/B%s/B%s",awar_prefix,x_description[x],y_description[y]);
... | false | false | false | false | false | 0 |
visit(FunctionDecl* node)
{
IR* runtime_bind = NULL;
if (node->isAnonymous()) {
runtime_bind = &m_builder->push(OP_BIND);
}
IR& start_func = m_builder->push(OP_JMP, Operand(JMP_ADDR, 0));
Symbol* sym = NULL;
Function* func;
if (node->isMethod()) {
func = node->getMethod();
} else {
sym = node->getIdent... | false | false | false | false | false | 0 |
text_happiness_units(const struct city *pcity)
{
int mlmax = get_city_bonus(pcity, EFT_MARTIAL_LAW_MAX);
int uhcfac = get_city_bonus(pcity, EFT_UNHAPPY_FACTOR);
static struct astring str = ASTRING_INIT;
astr_clear(&str);
if (mlmax > 0) {
int mleach = get_city_bonus(pcity, EFT_MARTIAL_LAW_EACH);
if (... | false | false | false | false | false | 0 |
ev_chain(cli_events_t *ctx, struct cli_event *ev, union ev_val *val)
{
union ev_val *chain;
uint32_t siz = sizeof(*chain) * (ev->count + 1);
chain = cli_realloc(ev->u.v_chain, siz);
if (!chain) {
cli_event_error_oom(ctx, siz);
return;
}
ev->u.v_chain = chain;
ev->u.v_chain[ev->count] = *v... | false | false | false | false | false | 0 |
empty(struct hash * hash) {
if(hash != NULL) {
if(hash->content != NULL) {
while(hash->size > 0) {
--hash->size;
if(hash->content[hash->size].key != NULL)
free(hash->content[hash->size].key);
if(hash->content[hash->size].value != NULL)
free(hash->content[hash->size].value);
}
free(has... | false | false | false | false | false | 0 |
devNameFromOptions(const QStringList &options)
{
// Search options to find the device name
for ( QStringList::ConstIterator it = options.begin(); it != options.end(); ++it)
{
if( (*it).startsWith(QLatin1String("dev=")))
return (*it).mid(4);
}
return QString::fromLatin1("none");
} | false | false | false | false | false | 0 |
ipoib_neigh_hash_uninit(struct net_device *dev)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
int stopped;
ipoib_dbg(priv, "ipoib_neigh_hash_uninit\n");
init_completion(&priv->ntbl.deleted);
set_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags);
/* Stop GC if called at init fail need to cancel work */
stopped = tes... | false | false | false | false | false | 0 |
negprop_near_assign(int subterm_id, Term alpha, Term beta, int pos,
Mstate state)
{
if (VARIABLE(alpha))
Mstats.neg_near_assign_agone++;
else if (VARIABLE(ARG(alpha,pos)))
Mstats.neg_near_assign_egone++;
else {
int i;
int base_id = nterm_id(alpha);
int increment = int_power(Domain_size, (A... | false | false | false | false | false | 0 |
golden(double ax, double bx, double cx, double tol, double solve_tolf, double *xmin)
{
const double R=0.61803399;
const double C=(1.0-R);
mexPrintf("golden\n");
//mexEvalString("drawnow;");
double f1,f2,x0,x1,x2,x3;
int iter= 0, max_iter= 100;
x0=ax;
x3=cx;
if (fabs(cx-bx) > fabs(bx-ax))
{
x... | false | false | false | false | false | 0 |
match_capture (lua_State *L, const char *s, int level,
struct Capture *cap) {
int l = check_capture(L, level, cap);
size_t len = cap->capture[l].len;
if ((size_t)(cap->src_end-s) >= len &&
memcmp(cap->capture[l].init, s, len) == 0)
return s+len;
else return NULL;
} | false | false | false | false | false | 0 |
iom_nextbasket(IOM_ITERATOR iterator)
{
IomBasket ret=iterator->next_basket();
return ret.isNull() ? 0 : ret->getRef();
} | false | false | false | false | false | 0 |
exofs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
{
struct inode *inode;
int err;
inode_inc_link_count(dir);
inode = exofs_new_inode(dir, S_IFDIR | mode);
err = PTR_ERR(inode);
if (IS_ERR(inode))
goto out_dir;
inode->i_op = &exofs_dir_inode_operations;
inode->i_fop = &exofs_dir_operations... | false | false | false | false | false | 0 |
acm_suspend(struct usb_interface *intf, pm_message_t message)
{
struct acm *acm = usb_get_intfdata(intf);
int cnt;
spin_lock_irq(&acm->write_lock);
if (PMSG_IS_AUTO(message)) {
if (acm->transmitting) {
spin_unlock_irq(&acm->write_lock);
return -EBUSY;
}
}
cnt = acm->susp_count++;
spin_unlock_irq(&acm-... | false | false | false | false | false | 0 |
IsEqual(Array a, Array b)
{
int size;
Pointer valueA, valueB;
size = DXGetItemSize(a);
valueA = DXGetArrayData(a);
valueB = DXGetArrayData(b);
if (size <= 0 || !valueA || !valueB)
return 0;
if (memcmp(valueA, valueB, size) == 0)
return 1;
return 0;
} | false | false | false | false | false | 0 |
read_config_save_octet_string(char *saveto, u_char * str, size_t len)
{
int i;
u_char *cp;
/*
* is everything easily printable
*/
for (i = 0, cp = str; i < (int) len && cp &&
(isalpha(*cp) || isdigit(*cp) || *cp == ' '); cp++, i++);
if (len != 0 && i == (int... | false | false | false | false | false | 0 |
object_info_ego(struct ego_item *ego)
{
object_kind *kind = NULL;
object_type obj = { 0 };
int i;
for (i = 0; i < z_info->k_max; i++) {
kind = &k_info[i];
if (!kind->name)
continue;
if (kind->tval == ego->tval[0])
break;
}
obj.kind = kind;
obj.tval = kind->tval;
obj.sval = kind->sval;
obj.ego = e... | false | false | false | true | false | 1 |
gotquit()
/*
* QUIT
* from: <from_nuh>
* msg: :<leave message>
*
* Similar to gotpart, except it's global.
*/
{
chanrec *chan;
membrec *m;
userrec *u = NULL;
acctrec *a = NULL;
int split = 0;
char *p;
time_t now = time(NULL);
context;
/* store channel name and mode */
str_element(Server->chname,Server... | false | false | false | false | false | 0 |
get_header_decoded (const gchar *header_value,
const gchar *default_charset)
{
gchar *unfold, *decoded;
if (!header_value || !*header_value)
return NULL;
unfold = camel_header_unfold (header_value);
decoded = camel_header_decode_string (unfold, default_charset);
g_free (unfold);
return de... | false | false | false | false | false | 0 |
hso_create_net_device(struct usb_interface *interface,
int port_spec)
{
int result, i;
struct net_device *net;
struct hso_net *hso_net;
struct hso_device *hso_dev;
hso_dev = hso_create_device(interface, port_spec);
if (!hso_dev)
return NULL;
/* allocate our network device, then we can put in our privat... | false | false | false | false | false | 0 |
AdjustVolume( double increaseBy )
{
int volume = The::engineController()->volume() + (increaseBy * 100);
if (volume < 0)
volume = 0;
if (volume > 100)
volume = 100;
The::engineController()->setVolume( volume );
} | false | false | false | false | false | 0 |
joy_set_button_state(int button, int state)
{
if (!Joy_inited)
return;
if (state != joy_buttons[button].actual_state) {
// Button position physically changed.
joy_buttons[button].actual_state = state;
if ( state ) {
// went from up to down
joy_buttons[button].down_count++;
joy_buttons[button].do... | false | false | false | false | false | 0 |
Close()
{
if (fSocket > 0) {
jack_log("JackServerSocket::Close %s", fName);
shutdown(fSocket, SHUT_RDWR);
close(fSocket);
unlink(fName);
fSocket = -1;
return 0;
} else {
return -1;
}
}
} | false | false | false | false | false | 0 |
ajSeqstrCalcMolwt(const AjPStr seq)
{
/* source: www.expasy.org/tools/findmod/findmod_masses.html */
static double aa[26] =
{
89.0894, 132.6068, 121.1494, 133.0992, /* A-D */
147.1261, 165.1872, 75.0625, 155.1517, /* E-H */
131.1700, 131.1700, 146.1847, 131.1700, /* I-L */
... | false | false | false | false | false | 0 |
ccpu_set_context(void *src)
{
if( src )
{
CONTEXTCCPU context;
ccpuRegs *Regs = src;
context.accVal = Regs->accVal;
context.cmpVal = Regs->cmpVal;
context.pa0 = Regs->pa0;
context.cFlag = Regs->cFlag;
context.eRegPC = Regs->eRegPC;
context.eRegA = Regs->eRegA;
context.eRegB = Regs->eRegB... | false | false | false | false | false | 0 |
print_ignored_options (void)
{
while (!ignored_options.is_empty ())
{
const char *opt;
opt = ignored_options.pop ();
warning_at (UNKNOWN_LOCATION, 0,
"unrecognized command line option \"%s\"", opt);
}
} | false | false | false | false | false | 0 |
parse_app_info(PROJECT* p, FILE* in) {
char buf[256], path[MAXPATHLEN];
MIOFILE mf;
mf.init_file(in);
XML_PARSER xp(&mf);
while (!xp.get_tag()) {
if (xp.match_tag("app_info")) continue;
if (xp.match_tag("/app_info")) return 0;
if (xp.match_tag("file_info") || xp.match_tag("f... | false | false | false | false | false | 0 |
pack( char *& buffer, const VT_MPI_INT & bufferSize,
VT_MPI_INT & bufferPos )
{
DefRec_BaseS::pack( buffer, bufferSize, bufferPos );
// creator.length()
//
uint32_t creator_length = creator.length();
CALL_MPI( MPI_Pack( &creator_length, 1, MPI_UNSIGNED, buffer, bufferSize,
... | false | false | false | false | false | 0 |
gem_available_fences(int fd)
{
struct drm_i915_getparam gp;
int val;
gp.param = I915_PARAM_NUM_FENCES_AVAIL;
gp.value = &val;
if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp)))
return 0;
return val;
} | false | false | false | false | false | 0 |
gwy_enum_combo_box_set_model(GtkComboBox *combo,
GwyEnum *newenum)
{
GwyEnum *oldenum;
gint active = -1;
oldenum = g_object_get_qdata(G_OBJECT(combo), enum_quark);
if (oldenum) {
active = gwy_enum_combo_box_get_active(combo);
gwy_enum_freev(oldenum);
... | false | false | false | false | false | 0 |
anyExpr (func, expr)
long (*func) ();
chain_list *expr;
{
while ((expr = CDR (expr)))
if ((*func) (CAR (expr)))
return 1;
return 0;
} | false | false | false | false | false | 0 |
toIndex(String str)
{
assert(!str.isEmpty());
std::vector<String>::const_iterator it =
std::find(iStrings.begin(), iStrings.end(), str);
if (it != iStrings.end())
return (it - iStrings.begin());
iStrings.push_back(str);
return iStrings.size() - 1;
} | false | false | false | false | false | 0 |
editor_window_jumplist_add(EditorWin *win, size_t pos) {
Mark mark = text_mark_set(win->text->data, pos);
if (mark && win->jumplist)
ringbuf_add(win->jumplist, mark);
} | false | false | false | false | false | 0 |
NK7110_Initialise(struct gn_statemachine *state)
{
gn_data data;
char model[GN_MODEL_MAX_LENGTH+1];
gn_error err = GN_ERR_NONE;
bool connected = false;
unsigned int attempt = 0;
/* Copy in the phone info */
memcpy(&(state->driver), &driver_nokia_7110, sizeof(gn_driver));
if (!(DRVINSTANCE(state) = calloc(1, s... | true | true | false | false | false | 1 |
NsTclCacheFlushCmd(ClientData dummy, Tcl_Interp *interp, int argc, char **argv)
{
Cache *cachePtr;
Ns_Cache *cache;
Ns_Entry *entry;
if (argc != 2 && argc != 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
argv[0], " cache ?key?\"", NULL);
return TCL_ERROR;
}
if (GetCache... | false | false | false | false | false | 0 |
operator>> (unsigned int & num)
{
int r = fscanf(file_, " %u", &num);
if (r != 1)
close();
return *this;
} | false | false | false | false | false | 0 |
tag_make_default_color(TAGSTRING *buf, int maxlen)
{
if (maxlen <= (signed)sizeof (ht_tag_color)) return tag_error(buf, maxlen);
ht_tag_color tag;
tag.escape = '\e';
tag.magic = HT_TAG_COLOR;
tag.color = 0xffffffffU;
tag.flush(buf);
return buf + sizeof(tag);
} | false | false | false | false | false | 0 |
advOpSetToken()
{
tsh_put_it in ;
tsh_put_ot out ;
char *t ;
int dimmCtr;
/* send tuple name, priority, length */
if (!readn(newsock, (char *)&in, sizeof(tsh_put_it)))
{
return ;
}
in.proc_id = ntohl(in.proc_id);
if (guardf(in.... | false | false | false | false | false | 0 |
layout(const QRectF &screen_rect)
{
if (d->mHasSession)
return;
Q_FOREACH(const QString &controllerName, currentControllers()) {
QRectF rect = d->mThemeLoader->positionForWidget(controllerName, screen_rect);
setControllerRect(controllerName, rect);
}
} | false | false | false | false | false | 0 |
pointToSvgString(QPointF p, QPointF offset, double dpi, double printerScale)
{
QString point;
point += QString::number((p.x() - offset.x()) * dpi / printerScale);
point += ",";
point += QString::number((p.y() - offset.y()) * dpi / printerScale);
return point;
} | false | false | false | false | false | 0 |
SetFeature( OGRFeature *poFeature )
{
GetLayerDefn();
if (!poDS->IsReadWrite())
{
CPLError(CE_Failure, CPLE_AppDefined,
"Operation not available in read-only mode");
return OGRERR_FAILURE;
}
if (!poFeature->IsFieldSet(_ID_FIELD))
{
CPLError(CE_Failure, ... | false | false | false | false | false | 0 |
radeon_cp_buffers(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
struct drm_device_dma *dma = dev->dma;
int ret = 0;
struct drm_dma *d = data;
LOCK_TEST_WITH_RETURN(dev, file_priv);
/* Please don't send us buffers.
*/
if (d->send_count != 0) {
DRM_ERROR("Process %d trying to send %d buffe... | false | false | false | false | false | 0 |
ring_read(ringbuffy *rbuf, char *data, int count)
{
int diff, free, pos, rest;
if (count <=0 ) return 0;
pos = rbuf->read_pos;
rest = rbuf->size - pos;
diff = rbuf->write_pos - pos;
free = (diff >= 0) ? diff : rbuf->size+diff;
if ( rest <= 0 ) return 0;
if ( free < count ) count = free;
if ( count < rest... | false | true | false | false | false | 1 |
json_num(json_number *num, const struct json_token *tok)
{
static const void **go_num[] = {
[0 ... 255] = &&l_fail,
[48 ... 57] = &&l_loop,
['-'] = &&l_loop,
['+'] = &&l_loop,
['.'] = &&l_flt,
['e'] = &&l_exp,
['E'] = &&l_exp,
[' '] = &&l_break,
... | false | false | false | false | false | 0 |
readn(int fd, void *buf, size_t count) {
int done = 0;
int res;
while (count > 0) {
res = read(fd, (void *) &(((char *) buf)[done]), count);
if (res <= 0) { // 0 indicates EOF, and it should never happen here.
fprintf(stderr,"read() error. line: %d\n",__LINE__);
return -1;
} else {
done += res;
c... | false | false | false | false | false | 0 |
get_int_for_string(const gs_param_string *in_value,
const eprn_StringAndInt *table, int *out_value)
{
char *s;
int read; /* counter */
/* First we construct a properly NUL-terminated string */
s = (char *) malloc(in_value->size + 1);
if (s == NULL) {
eprintf1(ERRPREF
"Memory allocation failur... | false | true | false | false | true | 1 |
probe_grouped_clone(resource_t * rsc, node_t * node, pe_working_set_t * data_set)
{
node_t *running = NULL;
resource_t *top = uber_parent(rsc);
if (running == NULL && is_set(top->flags, pe_rsc_unique) == FALSE) {
/* Annoyingly we also need to check any other clone instances
* Clumsy, but i... | false | false | false | false | false | 0 |
gx_ht_alloc_client_order(gx_ht_order * porder, uint width, uint height,
uint num_levels, uint num_bits, gs_memory_t * mem)
{
gx_ht_order order;
int code;
order = *porder;
order.params.M = width, order.params.N = 0;
order.params.R = 1;
order.params.M1 = height, order.par... | false | false | false | false | false | 0 |
sr_allocate(SRdesc **sr, int n){
int k;
(*sr)->obj_max = (double *)malloc(DSIZE*n);
(*sr)->matval_max = (double *)malloc(DSIZE*n);
(*sr)->matind_max = (int *)malloc(ISIZE*n);
(*sr)->ratio_max = (double *)malloc(DSIZE*n);
(*sr)->reversed_max = (char *)malloc(CSIZE*n);
(*sr)->obj_min = (doubl... | false | true | false | false | false | 1 |
SetTermSpace(Index term_idx, const MatrixSpace& mat_space)
{
while (term_idx >= (Index)term_spaces_.size()) {
term_spaces_.push_back(NULL);
}
term_spaces_[term_idx] = &mat_space;
} | false | false | false | false | false | 0 |
wn_reopendb (ClientData clientData, Tcl_Interp *interp,
int argc, char *argv[]) {
if (argc != 1) {
interp -> result = "usage: reopendb";
return TCL_ERROR;
}
re_wninit ();
return TCL_OK;
} | false | false | false | false | false | 0 |
record_next_extent(extent_record* r)
{
btree* tree = r->tree;
UInt16 index = r->keyind +1;
UInt32 file_id;
UInt8 fork_type;
node_buf* buf = prepare_next(tree, r->node_index, &index);
if (!buf)
return ENOENT; // No (more) such file or directory
file_id = r->key.file_id;
fork_typ... | false | false | false | false | false | 0 |
SelectAdd(SDNode *N) {
SDLoc dl(N);
if (N->getValueType(0) != MVT::i32) {
return SelectCode(N);
}
// Identify nodes of the form: add(asr(...)).
SDNode* Src1 = N->getOperand(0).getNode();
if (Src1->getOpcode() != ISD::SRA || !Src1->hasOneUse()
|| Src1->getValueType(0) != MVT::i32) {
return Sele... | false | false | false | false | false | 0 |
dy_dualdegenout (int level)
/*
This routine backs out all restricted subproblems to the level given by the
parameter. The value of the involved dual variables is reset to 0 in dy_cbar,
and dy_ddegenset and dy_lp->degen are adjusted.
All variables involved in a restricted subproblem were at bound (hence,
zer... | false | false | false | false | false | 0 |
log_handler(const gchar * log_domain,
GLogLevelFlags log_level,
const gchar * message, gpointer user_data)
{
if (!params.gui_running) {
/* No GUI running: spit the message to the terminal */
g_print("\n\n*** %s: %s\n\n",
(log_level & G_LOG_FLAG_FATAL) ? "Error" : "Warning",
message);
} else {
/... | false | false | false | false | false | 0 |
eventheapinsert(struct event **heap, int heapsize, struct event *newevent)
#else /* not ANSI_DECLARATORS */
void eventheapinsert(heap, heapsize, newevent)
struct event **heap;
int heapsize;
struct event *newevent;
#endif /* not ANSI_DECLARATORS */
{
REAL eventx, eventy;
int eventnum;
int parent;
int notdone;
... | false | false | false | false | false | 0 |
jp2_start_compress(opj_jp2_t *jp2, struct opj_stream_private *cio,opj_image_t * p_image, struct opj_event_mgr * p_manager)
{
// preconditions
assert(jp2 != 00);
assert(cio != 00);
assert(p_manager != 00);
/* customization of the validation */
jp2_setup_encoding_validation (jp2);
/* validation of the pa... | false | false | false | false | false | 0 |
make_zc_uri(PyObject *self, PyObject *args)
{
char *hn;
int port;
char uri[HPMUD_BUFFER_SIZE];
enum HPMUD_RESULT result = HPMUD_R_OK;
int bytes_read = 0;
if (!PyArg_ParseTuple(args, "si", &hn, &port))
return NULL;
Py_BEGIN_ALLOW_THREADS
result = hpmud_make_mdns_uri(hn, port... | false | false | false | false | false | 0 |
find_next(void *v, loff_t *pos)
{
const char **fmt = v;
int start_index;
int last_index;
start_index = __stop___trace_bprintk_fmt - __start___trace_bprintk_fmt;
if (*pos < start_index)
return __start___trace_bprintk_fmt + *pos;
/*
* The __tracepoint_str section is treated the same as the
* __trace_printk... | false | false | false | false | false | 0 |
inet6_socket_parser(GHashTable *dict, const char* line)
{
struct Inet6SocketEntry *se;
int sock;
struct in6_addr addr;
se = g_malloc0(sizeof *se);
if(sscanf(line, "%*d: %*s %8x%8x%8x%8x:%4x %*x %*x:%*x %*x:%*x %*d %*d %*d %d",
&addr.s6_addr32[0], &addr.s6_addr32[1], &addr.s6_addr32[2],
&addr.s6_addr32[3]... | true | true | false | false | false | 1 |
print( std::ostream& os, const FunctionTable& functions,
const TermTable& terms ) const
{
os << '(';
functions.print_function( os, function() );
for( TermList::const_iterator ti = terms_.begin(); ti != terms_.end(); ++ti )
{
os << ' ';
terms.print_term( os, *ti );
}
os << ')';
} | false | false | false | false | false | 0 |
quad_inside(double p1x,double p1y,double p2x,double p2y,double p3x,double p3y,double p4x,double p4y,double px,double py) {
int s1, s2, s3;
// first, check if p inside triangle p1p2p3
s1 = sign(-p2x*p1y + px*p1y + p1x*p2y - px*p2y - p1x*py + p2x*py);
s2 = sign(-p3x*p2y + px*p2y + p2x*p3y - px*p3y - p2x*py... | false | false | false | false | false | 0 |
addNode(const SUnit *SU) {
unsigned SUSize = SethiUllmanNumbers.size();
if (SUnits->size() > SUSize)
SethiUllmanNumbers.resize(SUSize*2, 0);
CalcNodeSethiUllmanNumber(SU, SethiUllmanNumbers);
} | false | false | false | false | false | 0 |
createbackground ()
{
/* Create fancy dark red background */
int x, y;
XImage *img;
char *data;
#ifdef MITSHM
if (shm)
{
Shmcreatebackground ();
return;
}
#endif
if ((data = (char *) calloc ((MAPWIDTH + BitmapPad (dp)) * (MAPHEIGHT + 20) * 4, 1)) == NULL)
... | false | false | false | false | false | 0 |
xml_print_element(struct element *item, int level)
{
while (item) {
struct attribute *att;
indent(level);
printf("<%s", item->name);
for (att = item->atts; att; att = att->next)
printf(" %s=\"%s\"", att->name, att->value);
if (item->down) {
printf(">\n");
xml_print_element(item->down, level + 1);
... | false | false | false | false | false | 0 |
init() {
clear();
FILE* f = fopen(PROJECT_INIT_FILENAME, "r");
if (!f) return 0;
MIOFILE mf;
mf.init_file(f);
XML_PARSER xp(&mf);
while (!xp.get_tag()) {
if (xp.match_tag("/project_init")) break;
else if (xp.parse_str("name", name, sizeof(name))) continue;
else if (x... | false | false | false | false | false | 0 |
flush() {
#ifdef BOXX_BUGS
if (overlay_ && overlay_ != this && overlay_->shown()) {
// all drawing to windows hidden by overlay windows is ignored, fix this
XUnmapWindow(fl_display, fl_xid(overlay_));
Fl_Double_Window::flush(0);
XMapWindow(fl_display, fl_xid(overlay_));
return;
}
#endif
int er... | false | false | false | false | false | 0 |
pixSauvolaBinarize(PIX *pixs,
l_int32 whsize,
l_float32 factor,
l_int32 addborder,
PIX **ppixm,
PIX **ppixsd,
PIX **ppixth,
PIX **ppixd)
{
l_int32 w, h;
... | false | false | false | false | false | 0 |
F77_aloc(integer Len, const char *whence)
#endif
{
char *rv;
unsigned int uLen = (unsigned int) Len; /* for K&R C */
if (!(rv = (char*)malloc(uLen))) {
fprintf(stderr, "malloc(%u) failure in %s\n",
uLen, whence);
exit_(&memfailure);
}
return rv;
} | false | false | false | false | false | 0 |
in_from_reg(u8 reg, u8 nr)
{
return DIV_ROUND_CLOSEST(reg * scale_in[nr], 100);
} | false | false | false | false | false | 0 |
compareComplexAffix(const UnicodeString& affixPat,
const UnicodeString& text,
int32_t pos,
int8_t type,
UChar* currency) const
{
int32_t start =... | false | false | false | false | false | 0 |
rate_init(struct snd_pcm_plugin *plugin)
{
unsigned int channel;
struct rate_priv *data = (struct rate_priv *)plugin->extra_data;
data->pos = 0;
for (channel = 0; channel < plugin->src_format.channels; channel++) {
data->channels[channel].last_S1 = 0;
data->channels[channel].last_S2 = 0;
}
} | false | false | false | false | false | 0 |
gda_meta_store_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
GdaMetaStore *store;
const gchar *cnc_string;
store = GDA_META_STORE (object);
if (store->priv) {
switch (param_id) {
case PROP_CNC_STRING:
if (!store->priv->cnc) {
cnc_string ... | false | false | false | false | false | 0 |
DbExec(Ns_DbHandle *handle, char *sql)
{
sqlite3 *db = (sqlite3 *) handle->connection;
Context *contextPtr = NULL;
int status, rc;
char *err = NULL;
if (handle->verbose) {
Ns_Log(Notice, "nssqlite3: DbExec(%s), SQL = '%s'",
handle->datasour... | false | false | false | false | false | 0 |
storvsc_host_scan(struct work_struct *work)
{
struct storvsc_scan_work *wrk;
struct Scsi_Host *host;
struct scsi_device *sdev;
wrk = container_of(work, struct storvsc_scan_work, work);
host = wrk->host;
/*
* Before scanning the host, first check to see if any of the
* currrently known devices have been hot ... | false | false | false | false | false | 0 |
xrealloc (void *ptr, grub_size_t size)
{
ptr = realloc (ptr, size);
if (! ptr)
grub_util_error ("%s", _("out of memory"));
return ptr;
} | false | false | false | false | false | 0 |
pch_console_write(struct console *co, const char *s, unsigned int count)
{
struct eg20t_port *priv;
unsigned long flags;
int priv_locked = 1;
int port_locked = 1;
u8 ier;
priv = pch_uart_ports[co->index];
touch_nmi_watchdog();
local_irq_save(flags);
if (priv->port.sysrq) {
/* call to uart_handle_sysrq_cha... | false | false | false | false | false | 0 |
cx231xx_reg_mask_write(struct cx231xx *dev, u8 dev_addr, u8 size,
u16 register_address, u8 bit_start, u8 bit_end,
u32 value)
{
int status = 0;
u32 tmp;
u32 mask = 0;
int i;
if (bit_start > (size - 1) || bit_end > (size - 1))
return -1;
if (size == 8) {
status =
cx231xx_read_i2c_data(dev, d... | false | false | false | false | false | 0 |
delRights(callback &setCallback,
string &errorIdentifier,
vector<std::string> &errorRights,
string identifier) const
{
errorIdentifier="";
errorRights.clear();
if (isDestroyed(setCallback))
return;
if (!imapAccount.ready(setCallback))
return;
if (!imapAccount.hasCapability("ACL"))
{
mail::f... | false | false | false | false | false | 0 |
get_gz_error(gzFile *gzf)
{
int errnum;
const char *errmsg;
errmsg = gzerror(gzf, &errnum);
if (errnum == Z_ERRNO)
return strerror(errno);
else
return errmsg;
} | false | false | false | false | false | 0 |
get_connect_state(void)
{
struct stat st;
gchar buf[256];
gint state = TB_NORMAL;
static gint old_state;
switch (timer_button_type)
{
case TIMER_TYPE_NONE:
case TIMER_TYPE_SERVER:
break;
case TIMER_TYPE_PPP:
if (net_timed->up)
state = TB_ON;
else if (lock_directory && *lock_directory)
... | false | false | false | false | false | 0 |
recursive_scan_next_dir(struct recursive_scan *ctx)
{
recursive_scan_check(ctx);
if (ctx->directory) {
recursive_scan_readdir(ctx);
return FALSE;
} else if (slist_length(ctx->sub_dirs) > 0) {
char *dir;
dir = slist_shift(ctx->sub_dirs);
recursive_scan_opendir(ctx, dir);
HFREE_NULL(dir);
return FA... | false | false | false | false | false | 0 |
gt_hpol_processor_adjust_hlen_of_all_segments(
GtAlignedSegmentsPile *asp, char c, unsigned long r_hstart,
unsigned long coverage, unsigned long r_hlen, unsigned long r_supp,
unsigned long a_hlen, unsigned long a_supp, unsigned long clenmax,
bool allow_partial, bool allow_multiple, unsigned long s_hmin,... | false | false | false | false | false | 0 |
amdgpu_powerplay_init(struct amdgpu_device *adev)
{
int ret = 0;
struct amd_powerplay *amd_pp;
amd_pp = &(adev->powerplay);
if (adev->pp_enabled) {
#ifdef CONFIG_DRM_AMD_POWERPLAY
struct amd_pp_init *pp_init;
pp_init = kzalloc(sizeof(struct amd_pp_init), GFP_KERNEL);
if (pp_init == NULL)
return -ENOMEM... | false | false | false | false | false | 0 |
on_select_face (GtkTreeSelection *selection, GcpFontSel *fs)
{
GtkTreeModel *model;
GtkTreeIter iter;
char *name;
if (!gtk_tree_selection_get_selected (selection, &model, &iter))
return;
gtk_tree_model_get (model, &iter, 0, &name, -1);
PangoFontFace *face = fs->Faces[name];
g_free (name);
PangoFontDescription... | false | false | false | false | false | 0 |
btrfs_writepage_fixup_worker(struct btrfs_work *work)
{
struct btrfs_writepage_fixup *fixup;
struct btrfs_ordered_extent *ordered;
struct extent_state *cached_state = NULL;
struct page *page;
struct inode *inode;
u64 page_start;
u64 page_end;
int ret;
fixup = container_of(work, struct btrfs_writepage_fixup, w... | 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.