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 |
|---|---|---|---|---|---|---|
InitVectorField(Object vfo)
{
char *str;
VectorField vf = NULL;
Class class;
vf = (struct vectorField *)DXAllocateZero(sizeof(struct vectorField));
if (! vf)
goto error;
class = DXGetObjectClass(vfo);
if (class == CLASS_GROUP)
class = DXGetGroupClass((Group)vfo);
switch(clas... | false | false | false | false | false | 0 |
elementtree_clear(PyObject *m)
{
elementtreestate *st = ET_STATE(m);
Py_CLEAR(st->parseerror_obj);
Py_CLEAR(st->deepcopy_obj);
Py_CLEAR(st->elementpath_obj);
return 0;
} | false | false | false | false | false | 0 |
fireWappon(projectile* obj)
{
if(firedWappon < 1 && !this->isDead()){
firedWappon = WAPPONREALOADTIME + 50/wappon;
obj->setSpeed(obj->getSpeed() + this->speed);
//obj->teleport((this->getPosition()) + obj->getSpeed().normalisedCopy()*this->wapponStartPosition);
obj->teleport(this->getPosition() + o... | false | false | false | false | false | 0 |
HandleRoutingChange(const cec_command &command)
{
if (command.parameters.size == 4)
{
CCECBusDevice *device = GetDevice(command.initiator);
if (device)
{
uint16_t iNewAddress = ((uint16_t)command.parameters[2] << 8) | ((uint16_t)command.parameters[3]);
device->SetActiveRoute(iNewAddress);
... | false | false | false | false | false | 0 |
tilemap_nb_find( int number )
{
int count = 0;
struct tilemap *tilemap;
tilemap = first_tilemap;
while( tilemap )
{
count++;
tilemap = tilemap->next;
}
number = (count-1)-number;
tilemap = first_tilemap;
while( number-- )
{
tilemap = tilemap->next;
}
return tilemap;
} | false | false | false | true | false | 1 |
scm_i_rehash (SCM table,
unsigned long (*hash_fn)(),
void *closure,
const char* func_name)
{
SCM buckets, new_buckets;
int i;
unsigned long old_size;
unsigned long new_size;
if (SCM_HASHTABLE_N_ITEMS (table) < SCM_HASHTABLE_LOWER (table))
{
/* rehashing is not triggered when i ... | false | false | false | false | false | 0 |
entangle_debug_setup(gboolean debug_app,
gboolean debug_gphoto)
{
entangle_debug_app = debug_app;
entangle_debug_gphoto = debug_gphoto;
#if GLIB_CHECK_VERSION(2, 31, 0)
if (debug_app || debug_gphoto) {
g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG,
... | false | false | false | false | false | 0 |
read_cas_url (gnutls_certificate_credentials_t res, const char *url)
{
int ret;
gnutls_x509_crt_t *xcrt_list = NULL;
gnutls_pkcs11_obj_t *pcrt_list = NULL;
unsigned int pcrt_list_size = 0;
/* FIXME: should we use login? */
ret =
gnutls_pkcs11_obj_list_import_url (NULL, &pcrt_list_size, url,
... | false | false | false | false | false | 0 |
BuildCursorGeometryWithoutHole()
{
this->ComputeAxes();
double bounds[6];
this->Image->GetBounds(bounds);
// Length of the principal diagonal.
const double pdLength = 20 * 0.5 * sqrt(
(bounds[1] - bounds[0])*(bounds[1] - bounds[0]) +
(bounds[3] - bounds[2])*(bounds[3] - bounds[2]) +
(bounds[5] -... | false | false | false | false | false | 0 |
tpci200_free_irq(struct ipack_device *dev)
{
struct slot_irq *slot_irq;
struct tpci200_board *tpci200;
tpci200 = check_slot(dev);
if (tpci200 == NULL)
return -EINVAL;
if (mutex_lock_interruptible(&tpci200->mutex))
return -ERESTARTSYS;
if (tpci200->slots[dev->slot].irq == NULL) {
mutex_unlock(&tpci200->mu... | false | false | false | false | false | 0 |
tp_presence_mixin_simple_presence_get_presences (
TpSvcConnectionInterfaceSimplePresence *iface,
const GArray *contacts,
DBusGMethodInvocation *context)
{
GObject *obj = (GObject *) iface;
TpBaseConnection *conn = TP_BASE_CONNECTION (obj);
TpHandleRepoIface *contact_repo = tp_base_connection_get_handl... | false | false | false | false | false | 0 |
jswrap_i2c_writeTo(JsVar *parent, JsVar *addressVar, JsVar *args) {
IOEventFlags device = jsiGetDeviceFromClass(parent);
if (!DEVICE_IS_I2C(device)) return;
bool sendStop = true;
int address = i2c_get_address(addressVar, &sendStop);
size_t l = (size_t)jsvIterateCallbackCount(args);
if (l+256 > jsuGetFreeS... | false | false | false | false | false | 0 |
gfire_got_preferences(gfire_data *p_gfire)
{
if(!p_gfire)
return;
gboolean fofs = gfire_preferences_get(p_gfire->prefs, 0x08);
if(purple_account_get_bool(purple_connection_get_account(p_gfire->gc), "show_fofs", TRUE) != fofs)
{
gfire_preferences_set(p_gfire->prefs, 0x08, purple_account_get_bool(purple_connect... | false | false | false | false | false | 0 |
migrate_parse_webdav_source (ParseData *parse_data)
{
if (parse_data->soup_uri->host != NULL)
g_key_file_set_string (
parse_data->key_file,
E_SOURCE_EXTENSION_AUTHENTICATION,
"Host", parse_data->soup_uri->host);
if (parse_data->soup_uri->port != 0)
g_key_file_set_integer (
parse_data->key_file,
E_... | false | false | false | false | false | 0 |
doPrint()
{
QPrinter *printer = loadPageSetup();
if (! d->printDialog)
d->printDialog = new QPrintDialog(printer, this);
QPrintDialog::PrintDialogOptions options = d->printDialog->enabledOptions();
options &= ~QPrintDialog::PrintSelection;
if (d->c->textCursor().hasSelection())
options |= QPrintDialog... | false | false | false | false | false | 0 |
put_buf(struct r1bio *r1_bio)
{
struct r1conf *conf = r1_bio->mddev->private;
int i;
for (i = 0; i < conf->raid_disks * 2; i++) {
struct bio *bio = r1_bio->bios[i];
if (bio->bi_end_io)
rdev_dec_pending(conf->mirrors[i].rdev, r1_bio->mddev);
}
mempool_free(r1_bio, conf->r1buf_pool);
lower_barrier(conf);
... | false | false | false | false | false | 0 |
search_alignment_direct( const ae_dna* chrom_1, const int32_t seed_1,
const ae_dna* chrom_2, const int32_t seed_2, const int16_t needed_score )
{
ae_vis_a_vis * best_alignment = NULL;
int16_t nb_diags = 2 * align_max_shift + 1;
ae_vis_a_vis * cur_vav = NULL;
... | false | false | false | false | false | 0 |
s5k5baf_hw_set_mirror(struct s5k5baf *state)
{
u16 flip = state->ctrls.vflip->val | (state->ctrls.vflip->val << 1);
s5k5baf_write(state, REG_P_PREV_MIRROR(0), flip);
if (state->streaming)
s5k5baf_hw_sync_cfg(state);
} | false | false | false | false | false | 0 |
gagt_debug (const char *function, const char *format, ...)
{
if (DEBUG_OUT)
{
fprintf (debugfile, "%s (", function);
if (format && strlen (format) > 0)
{
va_list ap;
va_start (ap, format);
vfprintf (debugfile, format, ap);
va_end (ap);
}
... | false | false | false | false | true | 1 |
gen_movqi (rtx operand0,
rtx operand1)
{
rtx _val = 0;
start_sequence ();
{
rtx operands[2];
operands[0] = operand0;
operands[1] = operand1;
#line 767 "../../src/gcc/config/aarch64/aarch64.md"
if (GET_CODE (operands[0]) == MEM && operands[1] != const0_rtx)
operands[1] = force_reg (QImode, ... | false | false | false | false | false | 0 |
esl_stopwatch_Create(void)
{
int status;
ESL_STOPWATCH *w = NULL;
ESL_ALLOC(w, sizeof(ESL_STOPWATCH));
w->elapsed = 0.;
w->user = 0.;
w->sys = 0.;
return w;
ERROR:
return NULL;
} | false | false | false | false | false | 0 |
xmlrpc_parse_value_va(xmlrpc_env * const envP,
xmlrpc_value * const value,
const char * const format,
va_list args) {
const char *format_copy;
va_list args_copy;
XMLRPC_ASSERT_ENV_OK(envP);
XMLRPC_ASSERT_VALUE_OK(value)... | false | false | false | true | false | 1 |
icq_convert_from_ucs2be(char *buf, int len) {
#ifdef HAVE_ICONV
char *ret, *ib, *ob;
size_t ibl, obl;
string_t text;
if (!buf || !len)
return NULL;
text = string_init(NULL);
string_append_raw(text, (char *) buf, len);
ib = text->str, ibl = len;
obl = 16 * ibl;
ob = ret = xmalloc(obl + 1);
iconv (ucs2be_... | false | false | false | false | false | 0 |
pixDebugFlipDetect(const char *filename,
PIX *pixs,
PIX *pixhm,
l_int32 enable)
{
PIX *pixt, *pixthm;
if (!enable) return;
/* Display with red dot at counted locations */
pixt = pixConvert1To4Cmap(pixs);
pixthm = pixMorphSe... | false | false | false | false | false | 0 |
checkFile(const QString &filename)
{
m_currentFilename = filename;
int i = m_currentFilename.lastIndexOf('/');
if (i != -1) {
m_currentFilename = m_currentFilename.mid(i + 1);
}
m_skip = true;
QFile file(filename);
if (!file.open(QIODevice::ReadOnly)) {
return false;
}
... | false | false | false | false | false | 0 |
split_div(__isl_take isl_set *set,
__isl_take isl_qpolynomial *qp, int div, isl_int min, isl_int max,
struct isl_split_periods_data *data)
{
for (; isl_int_le(min, max); isl_int_add_ui(min, min, 1)) {
isl_set *set_i = isl_set_copy(set);
isl_qpolynomial *qp_i = isl_qpolynomial_copy(qp);
if (set_div(set_i, qp_i... | false | false | false | false | false | 0 |
eina_list_append_relative_list(Eina_List *list,
const void *data,
Eina_List *relative)
{
Eina_List *new_l;
if ((!list) || (!relative))
return eina_list_append(list, data);
eina_error_set(0);
new_l = _eina_list_mempool_list_new(list);
if... | false | false | false | false | false | 0 |
eGetPage( void )
{
eCmdType ePage;
switch( GetSelection( ) )
{
case 0 : ePage = eCMD_OP; break;
case 1 : ePage = eCMD_DC; break;
case 2 : ePage = eCMD_AC; break;
case 3 : ePage = eCMD_TR; break;
case 4 : ePage = eCMD_FO; break;
default : ePage = eCMD_NONE;
}
return( ePage );
} | false | false | false | false | false | 0 |
qtrle_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
QtrleContext *s = avctx->priv_data;
int header, start_line;
int stream_ptr, height, row_ptr;
int has_palette = 0;
s->buf = buf;
s... | false | true | false | false | false | 1 |
bfusb_rx_submit(struct bfusb_data *data, struct urb *urb)
{
struct bfusb_data_scb *scb;
struct sk_buff *skb;
int err, pipe, size = HCI_MAX_FRAME_SIZE + 32;
BT_DBG("bfusb %p urb %p", data, urb);
if (!urb) {
urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb)
return -ENOMEM;
}
skb = bt_skb_alloc(size, GFP_ATOM... | false | true | false | false | false | 1 |
load_options(void)
{
const char *home = getenv("HOME");
const char *tigrc_user = getenv("TIGRC_USER");
const char *tigrc_system = getenv("TIGRC_SYSTEM");
char buf[SIZEOF_STR];
if (!tigrc_system)
tigrc_system = SYSCONFDIR "/tigrc";
load_option_file(tigrc_system);
if (!tigrc_user) {
if (!home || !string_form... | false | false | false | false | false | 0 |
w83977af_net_close(struct net_device *dev)
{
struct w83977af_ir *self;
int iobase;
__u8 set;
IRDA_ASSERT(dev != NULL, return -1;);
self = netdev_priv(dev);
IRDA_ASSERT(self != NULL, return 0;);
iobase = self->io.fir_base;
/* Stop device */
netif_stop_queue(dev);
/* Stop and remove instance of IrLAP ... | false | false | false | false | false | 0 |
vector_make_nsarray_data(Vector *v, int compact) {
unsigned int i;
if (!v) {
return;
}
v->nz = v->dim;
if (v->dim > 0) {
if (compact) {
v->data.nsarray.compact = (int *)malloc(sizeof(int)*v->dim);
if (!v->data.nsarray.compact) {
if (MATR_DEBUG_MODE) {
fprintf(stderr, "Unable to mal... | false | false | false | false | false | 0 |
needbrack(Token bracket) {
if (!match (bracket)) {
error ("%c expected", bracket == LBRACK ? '(' :
bracket == RBRACK ? ')' :
bracket == LBRACE ? '{' :
bracket == RBRACE ? '}' :
bracket == ... | false | false | false | false | false | 0 |
hybrid_confirm_show(const gchar *title, const gchar *text,
const gchar *btn_text, confirm_cb btn_callback, gpointer user_data)
{
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *action_area;
GdkPixbuf *pixbuf;
GtkWidget *image;
GtkWidget *la... | false | false | false | false | false | 0 |
deco16_tilemap_2_draw(struct mame_bitmap *bitmap, const struct rectangle *cliprect, int flags, UINT32 priority)
{
if (pf2_tilemap_8x8) tilemap_draw(bitmap,cliprect,pf2_tilemap_8x8,flags,priority);
if (pf2_tilemap_16x16) tilemap_draw(bitmap,cliprect,pf2_tilemap_16x16,flags,priority);
} | false | false | false | false | false | 0 |
vs_image_scale_lanczos_Y (const VSImage * dest, const VSImage * src,
uint8_t * tmpbuf, double sharpness, gboolean dither, int submethod,
double a, double sharpen)
{
switch (submethod) {
case 0:
default:
vs_image_scale_lanczos_Y_int16 (dest, src, tmpbuf, sharpness, dither, a,
sharpen);
... | false | false | false | false | false | 0 |
comparetup_index(const SortTuple *a, const SortTuple *b, Tuplesortstate *state)
{
/*
* This is similar to _bt_tuplecompare(), but we have already done the
* index_getattr calls for the first column, and we need to keep track of
* whether any null fields are present. Also see the special treatment
* for equal ... | false | false | false | false | false | 0 |
wall_11_move(tenm_object *my, double turn_per_frame)
{ double dx_temp;
double dy_temp;
/* sanity check */
if (my == NULL)
{
fprintf(stderr, "wall_11_move: my is NULL\n");
return 0;
}
if (turn_per_frame <= 0.5)
{
fprintf(stderr, "wall_11_move: strange turn_per_frame (%f)\n",
turn_... | false | false | false | false | false | 0 |
cl_commlib_get_connection_param(cl_com_handle_t* handle, int parameter, int* value) {
if (handle != NULL) {
switch(parameter) {
case HEARD_FROM_TIMEOUT:
*value = handle->last_heard_from_timeout;
break;
}
}
return CL_RETVAL_OK;
} | false | false | false | false | false | 0 |
lookup_id_mapping(gid, nidp)
unsigned gid, *nidp;
{
int i;
struct bucket *curr;
if (n_ids_mapped)
for (curr = id_map; curr; curr = curr->next) {
/* first bucket might not be totally full */
if (curr == id_map) {
i = n_ids_mapped % N_PER_BUCKET;
if (i == 0) i = N_PER_BUCKET;
} else
... | false | false | false | false | false | 0 |
create_poitype_tree (guint max_level)
{
guint i = 0;
guint j = 0;
if (mydebug > 20)
fprintf (stderr, "create_poitype_tree:\n");
/* insert base categories into tree */
for (i = 0; i < poi_type_list_max; i++)
{
if (strlen (poi_type_list[i].name) > 0)
{
if (poi_type_list[i].level == 0)
{
poitypetre... | false | false | false | false | false | 0 |
ves_icall_System_IO_MonoIO_FindClose (gpointer handle)
{
IncrementalFind *ifh = handle;
gint32 error;
if (FindClose (ifh->find_handle) == FALSE){
error = GetLastError ();
} else
error = ERROR_SUCCESS;
g_free (ifh->utf8_path);
g_free (ifh);
return error;
} | false | false | false | false | false | 0 |
rd_new_remdata(RemType type, char *remote_name, char *type_spec)
{
REMDATA_S *rd = NULL;
rd = (REMDATA_S *)fs_get(sizeof(*rd));
memset((void *)rd, 0, sizeof(*rd));
rd->type = type;
rd->access = NoExists;
if(remote_name)
rd->rn = cpystr(remote_name);
switch(rd->type){
case R... | false | false | false | false | false | 0 |
dbio_write_var(Var v)
{
int i;
dbio_write_num((int) v.type & TYPE_DB_MASK);
switch ((int) v.type) {
case TYPE_CLEAR:
case TYPE_NONE:
break;
case TYPE_STR:
dbio_write_string(v.v.str);
break;
case TYPE_OBJ:
case TYPE_ERR:
case TYPE_INT:
case TYPE_CATCH:
case TYPE_FINALLY:
... | false | false | false | false | false | 0 |
toXml() const
{
QString xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<!DOCTYPE FreeMedForms>\n"
"<DataPackServer>\n";
xml += Utils::GenericDescription::toXml();
xml += "</DataPackServer>\n";
return xml;
} | false | false | false | false | false | 0 |
ParseDirectives()
{
bool readDirective = false;
while(1) {
if(m_pScanner->empty())
break;
Token& token = m_pScanner->peek();
if(token.type != Token::DIRECTIVE)
break;
// we keep the directives from the last document if none are specified;
// but if any directives are specific, then we res... | false | false | false | false | false | 0 |
print_troff_ms_text(const printTableContent *cont, FILE *fout)
{
bool opt_tuples_only = cont->opt->tuples_only;
unsigned short opt_border = cont->opt->border;
unsigned int i;
const char *const * ptr;
if (cancel_pressed)
return;
if (opt_border > 2)
opt_border = 2;
if (cont->opt->start_table)
{
/* print... | false | false | false | false | false | 0 |
dbd_st_rows(SV *h, imp_sth_t *imp_sth)
{
dTHX;
PERL_UNUSED_VAR(h);
DBIh_SET_ERR_CHAR(h, imp_sth, 0, 1, "err msg", "12345", Nullch);
return -1;
} | false | false | false | false | false | 0 |
isValidProxy(const KUrl &u)
{
return u.isValid() && u.hasHost();
} | false | false | false | false | false | 0 |
snd_es1938_get_byte(struct es1938 *chip)
{
int i;
unsigned char v;
for (i = GET_LOOP_TIMEOUT; i; i--)
if ((v = inb(SLSB_REG(chip, STATUS))) & 0x80)
return inb(SLSB_REG(chip, READDATA));
dev_err(chip->card->dev, "get_byte timeout: status 0x02%x\n", v);
return -ENODEV;
} | false | false | false | false | false | 0 |
get_app_info_size(FILE *in, int *size)
{
unsigned char raw_header[LEN_RAW_DB_HEADER];
DBHeader dbh;
unsigned int offset;
record_header rh;
fseek(in, 0, SEEK_SET);
fread(raw_header, LEN_RAW_DB_HEADER, 1, in);
if (feof(in)) {
jp_logf(JP_LOG_WARN, "get_app_info_size(): %s\n", _("Error reading ... | true | true | false | false | false | 1 |
_dwarf_length_of_cu_header(Dwarf_Debug dbg, Dwarf_Unsigned offset,
Dwarf_Bool is_info)
{
int local_length_size = 0;
int local_extension_size = 0;
Dwarf_Unsigned length = 0;
Dwarf_Unsigned final_size = 0;
Dwarf_Small *cuptr =
is_info? dbg->de_debug_info.dss_data + offset:
dbg... | false | false | false | false | false | 0 |
arm_general_register_operand_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
#line 76 "../../src/gcc/config/arm/predicates.md"
{
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
return (REG_P (op)
&& (REGNO (op) <= LAST_ARM_REGNUM
|| REGNO (op) >= FIRST_PSEUDO_REGISTER));
} | false | false | false | false | false | 0 |
getAssumptions(vector<Expr>& assumptions)
{
if(d_dump) {
d_translator->dump(d_em->newLeafExpr(ASSUMPTIONS), true);
}
d_se->getAssumptions(assumptions);
} | false | false | false | false | false | 0 |
mos7840_get_serial_info(struct moschip_port *mos7840_port,
struct serial_struct __user *retinfo)
{
struct serial_struct tmp;
if (mos7840_port == NULL)
return -1;
if (!retinfo)
return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
tmp.type = PORT_16550A;
tmp.line = mos7840_port->port->minor;
tmp.port = mos... | false | false | false | false | false | 0 |
val_int()
{
DBUG_ASSERT(fixed == 1);
/*
Perform division using DECIMAL math if either of the operands has a
non-integer type
*/
if (args[0]->result_type() != INT_RESULT ||
args[1]->result_type() != INT_RESULT)
{
my_decimal tmp;
my_decimal *val0p= args[0]->val_decimal(&tmp);
if ((nul... | false | false | false | false | false | 0 |
bbox_continue(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
int npop = (r_has_type(op, t_string) ? 4 : 6);
int code = type1_callout_dispatch(i_ctx_p, bbox_continue, npop);
if (code == 0) {
op = osp; /* OtherSubrs might have altered it */
npop -= 4; /* nobbox_fill/stroke handles the rest */
... | false | false | false | false | false | 0 |
HasIndexedLookupInterceptor() {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ON_BAILOUT(isolate, "v8::Object::HasIndexedLookupInterceptor()",
return false);
return Utils::OpenHandle(this)->HasIndexedInterceptor();
} | false | false | false | false | false | 0 |
IncorporateType(const Type *Ty) {
// Check to see if we're already visited this type.
if (!VisitedTypes.insert(Ty).second)
return;
// If this is a structure or opaque type, add a name for the type.
if (((Ty->isStructTy() && cast<StructType>(Ty)->getNumElements())
|| Ty->isOp... | false | false | false | false | false | 0 |
cl_cvdverify(const char *file)
{
struct cl_engine *engine;
FILE *fs;
int ret;
if((fs = fopen(file, "rb")) == NULL) {
cli_errmsg("cl_cvdverify: Can't open file %s\n", file);
return CL_EOPEN;
}
if(!(engine = cl_engine_new())) {
cli_errmsg("cld_cvdverify: Can't create new engine\n");
fclose(fs);
ret... | false | false | false | false | false | 0 |
transfer_city_units(struct player *pplayer, struct player *pvictim,
struct unit_list *units, struct city *pcity,
struct city *exclude_city,
int kill_outside, bool verbose)
{
struct tile *ptile = pcity->tile;
int saved_id = pcity->id;
const char *name = city_name(pcity);
/* Transfer enemy units in ... | false | false | false | false | true | 1 |
cli_regcomp(regex_t *preg, const char *pattern, int cflags)
{
if (!strncmp(pattern, "(?i)", 4)) {
pattern += 4;
cflags |= REG_ICASE;
}
return cli_regcomp_real(preg, pattern, cflags);
} | false | false | false | false | false | 0 |
xdl_merge(mmfile_t *orig, mmfile_t *mf1, const char *name1,
mmfile_t *mf2, const char *name2,
xpparam_t const *xpp, int level, mmbuffer_t *result) {
xdchange_t *xscr1, *xscr2;
xdfenv_t xe1, xe2;
int status;
result->ptr = NULL;
result->size = 0;
if (xdl_do_diff(orig, mf1, xpp, &xe1) < 0 ||
xdl_do_diff(ori... | false | false | false | false | false | 0 |
hash_word_list(struct search_hash_buffer *shb, struct list_head *word_list)
{
struct skeyword *lcursor;
unsigned num_common = 0, num_valid = 0;
list_for_each_entry(lcursor, word_list, list)
{
size_t valid_chars = 0;
uint32_t w_len = lcursor->len;
tchar_t f_ch = lcursor->data[0];
if(!w_len)
continue;
... | false | false | false | false | false | 0 |
s_minicarp(const char *format, ...)
{
bool in_signal_handler = signal_in_handler();
va_list args;
/*
* This test duplicates the one in s_minilogv() but if we don't emit
* the message we don't want to emit the stacktrace afterwards either.
* Hence we need to know now.
*/
if G_UNLIKELY(logfile[LOG_STDERR].d... | false | false | false | false | false | 0 |
addPin(IOPIN *new_pin, unsigned int iPinNumber)
{
if (iPinNumber < mNumIopins) {
// If there is not a PinModule for this pin, then add one.
if (iopins[iPinNumber] == &AnInvalidPinModule)
iopins[iPinNumber] = new PinModule(this,iPinNumber);
iopins[iPinNumber]->setPin(new_pin);
}
else
{
printf(... | false | false | false | false | false | 0 |
usnic_vnic_res_spec_satisfied(const struct usnic_vnic_res_spec *min_spec,
struct usnic_vnic_res_spec *res_spec)
{
int found, i, j;
for (i = 0; i < USNIC_VNIC_RES_TYPE_MAX; i++) {
found = 0;
for (j = 0; j < USNIC_VNIC_RES_TYPE_MAX; j++) {
if (res_spec->resources[i].type !=
min_spec->resources[i].type... | false | false | false | false | false | 0 |
_doSetFixedOutputState(ArchiveHandle *AH)
{
/* Disable statement_timeout since restore is probably slow */
ahprintf(AH, "SET statement_timeout = 0;\n");
/* Likewise for lock_timeout */
ahprintf(AH, "SET lock_timeout = 0;\n");
/* Select the correct character set encoding */
ahprintf(AH, "SET client_encoding = '%... | false | false | false | false | false | 0 |
operator!=(const CPose3D &p1,const CPose3D &p2)
{
return (p1.m_coords!=p2.m_coords)||(p1.getRotationMatrix()!=p2.getRotationMatrix());
} | false | false | false | false | false | 0 |
removeManualAvatar(const Jid& j)
{
FileAvatar(this, j).removeFromDisk();
// TODO: Remove from caches. Maybe create a clearManualAvatar() which
// removes the file but doesn't remove the avatar from caches (since it'll
// be created again whenever the FileAvatar is requested)
emit avatarChanged(j);
} | false | false | false | false | false | 0 |
gt_rcr_decoder_new(const char *name, const GtEncseq *ref,
GtTimer *timer, GtError *err)
{
bool is_not_at_pageborder;
long pagesize = sysconf((int) _SC_PAGESIZE),
filepos;
GtRcrDecoder *rcr_dec;
gt_assert(name);
if (timer != NULL)
gt_timer_show_progress(timer, "ini... | false | false | false | false | false | 0 |
prepare_group_list(void)
{
FILE *fd;
int *idx;
int n;
int len, len1, len2;
/* open file to store group file names */
fd = fopen(group_list, "w");
if (fd == NULL)
G_fatal_error("Can't open any tempfiles");
/*
* build sorted index into group files
* so that all raster maps for... | false | false | false | false | true | 1 |
discrete_component_transfer_func (gint C, RsvgNodeComponentTransferFunc * user_data)
{
gint k;
if (!user_data->nbTableValues)
return C;
k = (C * user_data->nbTableValues) / 255;
return user_data->tableValues[k];
} | false | false | false | false | false | 0 |
SetEdgeLengthWeight( double w)
{
w = w < 0.0 ? 0.0 : ( w > 1.0 ? 1.0 : w);
if(w != this->EdgeLengthWeight)
{
this->EdgeLengthWeight = w;
this->RebuildStaticCosts = true;
this->Modified();
}
} | false | false | false | false | false | 0 |
create_pdf(char const* filename)
{
QPDF pdf;
// Start with an empty PDF that has no pages or non-required objects.
pdf.emptyPDF();
// Add an indirect object to contain a font descriptor for the
// built-in Helvetica font.
QPDFObjectHandle font = pdf.makeIndirectObject(
QPDFObjectHandle... | false | false | false | false | false | 0 |
sge_ctime(time_t i, dstring *buffer)
{
#ifdef HAS_LOCALTIME_R
struct tm tm_buffer;
#endif
struct tm *tm;
if (!i)
i = (time_t)sge_get_gmt();
#ifndef HAS_LOCALTIME_R
tm = localtime(&i);
#else
tm = (struct tm *)localtime_r(&i, &tm_buffer);
#endif
sge_dstring_sprintf(buffer, "%02d/%02d/%04d %02d:%... | false | false | false | false | false | 0 |
SortMoves (int ply)
/*****************************************************************************
*
* Sort criteria is as follows.
* 1. The move from the hash table
* 2. Captures as above.
* 3. Killers.
* 4. History.
* 5. Moves to the centre.
*
******************************************************... | false | false | false | false | false | 0 |
set_alternating_send(int rate)
{
if( rate <= 0 || rate > 100 || (sync_test_level != 0 && rate != 1) )
{
err_here();
// must not have any sync testing to enable alternating send
// tell_random_seed and crc checking must send data every frame
}
else
alternating_send_rate = rate;
} | false | false | false | false | false | 0 |
check_locale_name(const char *locale)
{
bool ret;
int category = LC_CTYPE;
char *save;
save = setlocale(category, NULL);
if (!save)
return false; /* should not happen; */
save = xstrdup(save);
ret = (setlocale(category, locale) != NULL);
setlocale(category, save);
free(save);
/* should we exit ... | false | false | false | false | false | 0 |
summary_compile_simplify_regexp(gchar *simplify_subject_regexp)
{
int err;
gchar buf[BUFFSIZE];
regex_t *preg = NULL;
preg = g_new0(regex_t, 1);
err = string_match_precompile(simplify_subject_regexp,
preg, REG_EXTENDED);
if (err) {
regerror(err, preg, buf, BUFFSIZE);
alertpanel_error(_("Regular ... | false | false | false | false | false | 0 |
cairo_MeasureString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, int length, GDIPCONST GpFont *font, GDIPCONST RectF *rc,
GDIPCONST GpStringFormat *format, RectF *boundingBox, int *codepointsFitted, int *linesFilled)
{
cairo_matrix_t SavedMatrix;
GpStringFormat *fmt;
GpStringDetailStruct *StringDetails;
... | false | false | false | false | false | 0 |
copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, DebugLoc DL,
unsigned DestReg, unsigned SrcReg,
bool KillSrc) const {
bool GPRDest = ARM::GPRRegClass.contains(DestReg);
bool GPRSrc = ARM::GPR... | false | false | false | false | false | 0 |
yy_HtmlAttribute()
{ int yypos0= yypos, yythunkpos0= yythunkpos;
yyprintf((stderr, "%s\n", "HtmlAttribute"));
{ int yypos1072= yypos, yythunkpos1072= yythunkpos; if (!yy_Alphanumeric()) goto l1073; goto l1072;
l1073:; yypos= yypos1072; yythunkpos= yythunkpos1072; if (!yymatchChar('-')) goto l1069;
}
l1... | false | false | false | false | false | 0 |
bd_select_playlist(BLURAY *bd, uint32_t playlist)
{
char *f_name = str_printf("%05d.mpls", playlist);
int result;
bd_mutex_lock(&bd->mutex);
if (bd->title_list) {
/* update current title */
unsigned i;
for (i = 0; i < bd->title_list->count; i++) {
if (playlist == bd... | false | false | false | false | false | 0 |
amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)
{
struct amdgpu_device *adev = amdgpu_get_adev(ttm->bdev);
struct amdgpu_ttm_tt *gtt = (void *)ttm;
unsigned pinned = 0, nents;
int r;
int write = !(gtt->userflags & AMDGPU_GEM_USERPTR_READONLY);
enum dma_data_direction direction = write ?
DMA_BIDIRECTIONAL : DMA_T... | false | false | false | false | false | 0 |
operator| (const Bits& A) const
{
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in or");
size_t len = rep.size();
Rep res( len );
for (int i=0; i<int(len); ++i)
res[i] = rep[i] | A.rep[i];
return Bits(res);
} | false | false | false | false | false | 0 |
load(const QString &name, const QVariantList &args, Plasma::Containment *containment)
{
const QString constraint = name.isEmpty() ? QString() : QString("[X-KDE-PluginInfo-Name] == '%1'").arg(name);
KService::List offers = KServiceTypeTrader::self()->query("Plasma/ToolBox", constraint);
if (!offers.isEmpty(... | false | false | false | false | false | 0 |
widget_realize_cb (GtkWidget *widget,
gpointer user_data)
{
GdkScreen *screen;
NautilusDesktopBackground *self = user_data;
screen = gtk_widget_get_screen (widget);
if (self->details->screen_size_handler > 0) {
g_signal_handler_disconnect (screen,
self->details->screen_size_h... | false | false | false | false | false | 0 |
print_pid_suid(struct text_object *obj, char *p, int p_max_size) {
#define SUIDNOTFOUND "Can't find the process saved set uid in '%s'"
char *begin, *end, *buf = NULL;
int bytes_read;
asprintf(&buf, PROCDIR "/%d/status", strtopid(obj->data.s));
strcpy(obj->data.s, buf);
free(buf);
buf = readfile(obj->data.s, &byt... | false | true | false | false | false | 1 |
_dl_name_match_p (const char *name, const struct link_map *map)
{
if (strcmp (name, map->l_name) == 0)
return 1;
struct libname_list *runp = map->l_libname;
while (runp != NULL)
if (strcmp (name, runp->name) == 0)
return 1;
else
runp = runp->next;
return 0;
} | false | false | false | false | false | 0 |
s5k4ecgx_config_gpio(int nr, int val, const char *name)
{
unsigned long flags = val ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW;
int ret;
if (!gpio_is_valid(nr))
return 0;
ret = gpio_request_one(nr, flags, name);
if (!ret)
gpio_export(nr, 0);
return ret;
} | false | false | false | false | false | 0 |
IsInsideSurface(double x[3])
{
// do a quick bounds check
if ( x[0] < this->Bounds[0] || x[0] > this->Bounds[1] ||
x[1] < this->Bounds[2] || x[1] > this->Bounds[3] ||
x[2] < this->Bounds[4] || x[2] > this->Bounds[5])
{
return 0;
}
// Perform in/out by shooting random rays. Multiple r... | false | false | false | false | false | 0 |
isNull() const
{
return d->_modeUid.isEmpty() && d->_formUid.isEmpty() && d->_emptyRootForms.isEmpty();
} | false | false | false | false | false | 0 |
crypto_cert_release(krb5_context context,
pkinit_cert_handle ch)
{
struct _pkinit_cert_data *cd = (struct _pkinit_cert_data *)ch;
if (cd == NULL || cd->magic != CERT_MAGIC)
return EINVAL;
free(cd);
return 0;
} | false | false | false | false | false | 0 |
reset(void) {
QMutexLocker locker(&mutex);
Space* rootSpace =
root->getStatus() == FAILED ? NULL :
root->getSpace(*na,curBest,c_d,a_d);
if (curBest != NULL) {
delete curBest;
curBest = new BestNode(NULL);
}
if (root) {
DisposeCursor dc(root,*na);
... | false | false | false | false | false | 0 |
dayofweek(int32_t year, int32_t mon, int32_t day) {
_assert_(true);
if (mon < 3) {
year--;
mon += 12;
}
return (day + ((8 + (13 * mon)) / 5) + (year + (year / 4) - (year / 100) + (year / 400))) % 7;
} | false | false | false | false | false | 0 |
ompfbe_upgrade_temp_var_pe_stms(Pe_statement *head)
{
Pe_statement *pe_stm;
Statement *stm;
for (pe_stm = head; pe_stm != NULL; pe_stm = pe_stm->next) {
/* traverse here */
for (stm = pe_stm->stm_head; stm != NULL; stm = stm->next) {
/* if (stm->ope == JUMP_KEI_OPE) */
... | false | false | false | false | false | 0 |
gf_xml_get_element_namespace(GF_Node *n)
{
u32 i, count;
if (n->sgprivate->tag==TAG_DOMFullNode) {
GF_DOMFullNode *elt = (GF_DOMFullNode *)n;
return elt->ns;
}
count = sizeof(xml_elements) / sizeof(struct xml_elt_def);
for (i=0; i<count; i++) {
if (n->sgprivate->tag==xml_elements[i].tag) return xml_elements... | false | false | false | false | false | 0 |
nodecompare(const void* a, const void* b)
/* Helper function for qsort. */
{ const Node* node1 = (const Node*)a;
const Node* node2 = (const Node*)b;
const double term1 = node1->distance;
const double term2 = node2->distance;
if (term1 < term2) return -1;
if (term1 > term2) return +1;
return 0;
} | 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.