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 |
|---|---|---|---|---|---|---|
tour1d_write_video(ggobid *gg)
{
displayd *dsp = gg->current_display;
splotd *sp = gg->current_splot;
GGobiData *d = dsp->d;
gint j;
gdouble rnge;
vartabled *vt;
gfloat ppval;
if (dsp->t1d_window != NULL && GTK_WIDGET_VISIBLE (dsp->t1d_window))
ppval = dsp->t1d.ppval;
else
ppval = 0.;
for ... | false | false | false | false | false | 0 |
utc_time()
{
_0RL_cd_99dff546ea0f9974_d0000000 _call_desc(_0RL_lcfn_99dff546ea0f9974_e0000000, "_get_utc_time", 14);
_invoke(_call_desc);
return _call_desc.result;
} | false | false | false | false | false | 0 |
jbig2_huffman_skip(Jbig2HuffmanState *hs)
{
int bits = hs->offset_bits & 7;
if (bits) {
bits = 8 - bits;
hs->offset_bits += bits;
hs->this_word = (hs->this_word << bits) |
(hs->next_word >> (32 - hs->offset_bits));
}
if (hs->offset_bits >= 32) {
Jbig2WordStream *ws = hs->ws;
hs->this_word... | false | false | false | false | false | 0 |
bcma_sprom_ext_available(struct bcma_bus *bus)
{
u32 chip_status;
u32 srom_control;
u32 present_mask;
if (bus->drv_cc.core->id.rev >= 31) {
if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM))
return false;
srom_control = bcma_read32(bus->drv_cc.core,
BCMA_CC_SROM_CONTROL);
return srom_control & ... | false | false | false | false | false | 0 |
npw_property_is_valid_restriction (const NPWProperty* prop)
{
const gchar *value;
switch (prop->restriction)
{
case NPW_FILENAME_RESTRICTION:
value = npw_property_get_value (prop);
/* First character should be letters, digit or "#$:%+,.=@^_`~" */
if (value == NULL) return TRUE;
if (!isalnum (*value) && (s... | false | false | false | false | false | 0 |
GetHeaderFromFile(LargeRAWFile_ptr pStreamFile, uint64_t iOffset, bool bIsBigEndian) {
uint64_t iStart = iOffset + DataBlock::GetHeaderFromFile(pStreamFile, iOffset, bIsBigEndian);
pStreamFile->SeekPos(iStart);
uint64_t ulDomainDimension;
pStreamFile->ReadData(ulDomainDimension, bIsBigEndian);
if (ulDomainD... | false | false | false | false | false | 0 |
getline(char *ptr, int len, char delim) {
if (x.getline(ptr,len,delim))
return true;
else
return false;
} | false | false | false | false | false | 0 |
GetSubMesh(uint16_t index) const
{
for(size_t i=0; i<subMeshes.size(); ++i)
if (subMeshes[i]->index == index)
return subMeshes[i];
return 0;
} | false | false | false | false | false | 0 |
krb5_db_get_key_data_kvno(context, count, data)
krb5_context context;
int count;
krb5_key_data * data;
{
int i, kvno;
/* Find last key version number */
for (kvno = i = 0; i < count; i++) {
if (kvno < data[i].key_data_kvno) {
kvno = data[i].ke... | false | false | false | false | false | 0 |
hnmatch_ip4(const char *pat)
{
int x1, x2, x3, x4, y1, y2, y3, y4;
unsigned long p, mask, a;
unsigned char *ha;
/* pattern is an IP QUAD address and a mask x.x.x.x/y.y.y.y */
if (sscanf(pat, "%d.%d.%d.%d/%d.%d.%d.%d",
&x1, &x2, &x3, &x4, &y1, &y2, &y3, &y4) < 8)
return 0;
p = (((unsigned long)x1<<24)+((uns... | false | false | false | false | false | 0 |
add_usecs( struct timeval* t, int64_t usecs )
{
t->tv_sec += usecs / 1000000L;
t->tv_usec += usecs % 1000000L;
if ( t->tv_usec >= 1000000L ) {
t->tv_sec += t->tv_usec / 1000000L;
t->tv_usec %= 1000000L;
}
} | false | false | false | false | false | 0 |
undoStep()
{
m_currentJob = 0;
if (m_undoState == MAKINGDIRS)
stepMakingDirectories();
if (m_undoState == MOVINGFILES || m_undoState == STATINGFILE)
stepMovingFiles();
if (m_undoState == REMOVINGLINKS)
stepRemovingLinks();
if (m_undoState == REMOVINGDIRS)
stepRemo... | false | false | false | false | false | 0 |
H5P__iterate_pclass_cb(void *_item, void *_key, void *_udata)
{
H5P_genprop_t *item = (H5P_genprop_t *)_item; /* Pointer to the property */
char *key = (char *)_key; /* Pointer to the property's name */
H5P_iter_pclass_ud_t *udata = (H5P_iter_pclass_ud_t *)_udata; /* Poin... | false | false | false | false | false | 0 |
mxser_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{
struct mxser_port *info = tty->driver_data;
unsigned long flags;
if (tty->index == MXSER_PORTS)
return -ENOIOCTLCMD;
if (test_bit(TTY_IO_ERROR, &tty->flags))
return -EIO;
spin_lock_irqsave(&info->slock, flags);
if (set & TIOC... | false | false | false | false | false | 0 |
InitializeXFonts()
{
static char str[32], here = 0;
int i,n;
char **FontNames;
FontNames = XListFonts( tkXDisplay(), "*", 10000, &n );
for( i=0; i<n; i++ )
{
sprintf( str, "%d", i );
Tcl_SetVar2( TCLInterp, "FontNames", str,FontNames[i], TCL_GLOBAL_ONLY );
}
... | false | false | false | false | false | 0 |
qlcnic_sriov_issue_bc_post(struct qlcnic_bc_trans *trans, u8 type)
{
struct qlcnic_vf_info *vf = trans->vf;
u32 pay_size, hdr_size;
u32 *hdr, *pay;
int ret;
u8 pci_func = trans->func_id;
if (__qlcnic_sriov_issue_bc_post(vf))
return -EBUSY;
if (type == QLC_BC_COMMAND) {
hdr = (u32 *)(trans->req_hdr + trans-... | false | false | false | false | false | 0 |
wayland_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
{
GstWaylandBufferPool *wpool = GST_WAYLAND_BUFFER_POOL_CAST (pool);
GstVideoInfo info;
GstCaps *caps;
if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL))
goto wrong_config;
if (caps == NULL)
goto no_c... | true | true | false | false | true | 1 |
diff_print_one_name_only(
const git_diff_delta *delta, float progress, void *data)
{
diff_print_info *pi = data;
git_buf *out = pi->buf;
GIT_UNUSED(progress);
if ((pi->flags & GIT_DIFF_SHOW_UNMODIFIED) == 0 &&
delta->status == GIT_DELTA_UNMODIFIED)
return 0;
git_buf_clear(out);
git_buf_puts(out, delta->ne... | false | false | false | false | false | 0 |
UpdateSettings()
{
if (!control)
return;
control->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
ConfigManager* cfgman = Manager::Get()->GetConfigManager(_T("message_manager"));
int size = cfgman->ReadInt(_T("/log_font_size"), platform::macosx ? 10 : 8);
wxFont def... | false | false | false | false | false | 0 |
dir_push_pattern_list (GList *stack, GFile *dir, GFile *file, gboolean ignore, GError **error)
{
char *content;
char *ptr;
DirPatternList *list = NULL;
guint line;
DirPattern *last = NULL;
if (!g_file_load_contents (file, NULL, &content, NULL, NULL, error))
{
return stack;
}
list = g_slice_new0(DirPatternL... | false | false | false | false | false | 0 |
toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
if (salign == STRUCTALIGN_DEFAULT)
buf->printf("align");
else
buf->printf("align (%d)", salign);
AttribDeclaration::toCBuffer(buf, hgs);
} | false | false | false | false | false | 0 |
netsys_killpg_all_subprocesses(value sig_v, value o_flag_v) {
#ifdef HAVE_POSIX_SIGNALS
struct sigchld_atom *atom;
int sig;
int o_flag;
int k,j;
pid_t pgid;
if (sigchld_list == NULL)
failwith("Netsys_posix.watch_subprocess: uninitialized");
sig = caml_convert_signal_number(Int_val(sig_v))... | false | false | false | false | false | 0 |
_gda_postgres_meta__index_cols (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc,
GdaMetaStore *store, GdaMetaContext *context, GError **error)
{
GdaDataModel *model, *concat;
GType index_oids_types[] = {G_TYPE_UINT, G_TYPE_NONE};
/* check correct postgres server version */
GdaPostgresReuseable *rdata... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
tiny::internal::Utf8CharacterStream stream(source1);
tiny::internal::Scanner scanner;
scanner.Initialize(&stream);
tiny::internal::Token::Value tok = scanner.Next();
while (tok != tiny::internal::Token::EOS) {
printf("%s\n", tiny::internal::Token::String(tok));
if (tok =... | false | false | false | false | false | 0 |
lastAddress() const
{
// ignore address 0 here
if (!_instrMap || _instrMap->count() == 0) return 0;
TraceInstrMap::ConstIterator it = _instrMap->constEnd();
--it;
return (*it).addr();
} | false | false | false | false | false | 0 |
Initialize(req, new, args, num_args)
Widget req;
Widget new;
ArgList args;
Cardinal *num_args;
{
ICLabelWidget iclw = (ICLabelWidget)new;
if (iclw->iclabel.label != NULL) {
iclw->iclabel.label = copyString(iclw->iclabel.label);
}
iclw->iclabel.width = 0;
} | false | false | false | false | false | 0 |
_gnutls_copy_ciphersuites (gnutls_session_t session,
opaque * ret_data, size_t ret_data_size,
int add_scsv)
{
int ret, i;
cipher_suite_st *cipher_suites;
uint16_t cipher_num;
int datalen, pos;
uint16_t loop_max;
ret = _gnutls_supported_ciphersuites_sort... | false | true | false | false | false | 1 |
EST2Genome_Data_clear(EST2Genome_Data *e2gd){
g_assert(e2gd);
if(EST2Genome_Data_get_Intron_Data(e2gd)){
Intron_Data_destroy(EST2Genome_Data_get_Intron_Data(e2gd));
EST2Genome_Data_get_Intron_Data(e2gd) = NULL;
}
Affine_Data_clear(&e2gd->ad);
return;
} | false | false | false | false | false | 0 |
cpl_mask_load_one(const char * filename,
cpl_size pnum,
cpl_size xtnum,
cpl_boolean do_window,
cpl_size llx,
cpl_size lly,
... | false | false | false | false | false | 0 |
registerNode(Node *newNode, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
delete newNode;
return NULL;
}
if(newNode==NULL) {
errorCode=U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
const UHashElement *old=uhash_find(nodes, newNode);
if(old!=NULL) {
delet... | false | false | false | false | false | 0 |
get_cached_tgt(krb5_context context, krb5_tkt_creds_context ctx,
const krb5_data *realm, krb5_creds **tgt_out)
{
krb5_creds mcreds;
krb5_error_code code;
krb5_principal tgtname = NULL;
krb5_flags flags = KRB5_TC_SUPPORTED_KTYPES | KRB5_TC_MATCH_SRV_NAMEONLY |
KRB5_TC_MATCH_TIMES;
... | false | false | false | false | false | 0 |
OnTitleFocusedOut (GtkEntry *entry, G_GNUC_UNUSED GdkEventFocus *event, Document *doc)
{
char const *txt = gtk_entry_get_text (entry);
if (txt && *txt == 0)
txt = NULL;
doc->SetTitle (txt);
doc->RenameViews ();
doc->SetDirty ();
return false;
} | false | false | false | false | false | 0 |
CopyHeaderLine_ (HeaderS *hSP, char *lineP, int first_char)
{
char *P;
P = hSP->dataP;
/* Check is there a mandatory record in input line: */
switch (first_char)
{
case 'H':
if (strstr (lineP, "HEADER") != lineP) return 0;
if (hSP->header_linesN >= MAXHEADERLINES) return -1;
hSP->header_linesN++;
P += hSP-... | false | false | false | false | false | 0 |
osm_gps_map_set_center (OsmGpsMap *map, float latitude, float longitude)
{
int pixel_x, pixel_y;
OsmGpsMapPrivate *priv;
GtkAllocation allocation;
g_return_if_fail (OSM_IS_GPS_MAP (map));
priv = map->priv;
gtk_widget_get_allocation(GTK_WIDGET(map), &allocation);
g_object_set(G_OBJECT(map),... | false | false | false | false | false | 0 |
process_phi_dst(container_node *p) {
for (node_iterator I = p->begin(), E = p->end(); I != E; ++I) {
node *n = *I;
process_op_dst(n);
}
} | false | false | false | false | false | 0 |
test_refs_rename__name_collision(void)
{
// can not rename a reference with the name of an existing reference
git_reference *looked_up_ref, *renamed_ref;
/* An existing reference... */
cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, packed_head_name));
/* Can not be renamed to the name of another existi... | false | false | false | false | false | 0 |
mob_check_hpinfo(struct map_session_data *sd, struct mob_data *md)
{
int flag = 0;
nullpo_retr(1, sd);
nullpo_retr(1, md);
flag = linkdb_exists( &md->dmglog, INT2PTR(sd->status.char_id) );
if(!flag && sd->hd)
flag = linkdb_exists( &md->dmglog, INT2PTR(-sd->hd->bl.id) );
if(!flag && sd->mcd)
flag = linkdb_ex... | false | false | false | false | false | 0 |
execute( vector< string > & argv,
string & out )
{
vector<string>::size_type i, len = argv.size();
for( i = 0; i < len; i++ )
{
if( caller->aliases.find( argv[i] ) == caller->aliases.end() )
out += "error: alias " + argv[i] + " not foun... | false | false | false | false | false | 0 |
wu_estimated_pfc(WORKUNIT &wu, DB_APP &app) {
double x = wu.rsc_fpops_est;
if (app.min_avg_pfc) {
x *= app.min_avg_pfc;
}
return x;
} | false | false | false | false | false | 0 |
on_container_available (GUPnPMediaCollection *self,
GUPnPDIDLLiteContainer *container,
G_GNUC_UNUSED gpointer user_data)
{
/* According to media format spec, there's only one container allowed;
* We allow any number of containers, but only the last one... | false | false | false | false | false | 0 |
ns_tag_directive(FILE *s)
{
printf("TAG ");
char *tag = (char*)malloc(BUFSIZ*sizeof(char));
s_separate_in_line(s);
/* [89] c-tag-handle ::= c-named-tag-handle | c-secondary-tag-handle | c-primary-tag-handle */
if (!fscanf(s, "%s", tag))
error("Malformed stream (in TAG directive)\n");
if (!*tag)
error("Coul... | false | false | false | false | false | 0 |
f_popcnt(int count, NUMBER **vals)
{
int bitval = 1;
/*
* parse args
*/
if (count == 2 && qiszero(vals[1])) {
bitval = 0;
}
/*
* count bit values
*/
if (qisint(vals[0])) {
return itoq(zpopcnt(vals[0]->num, bitval));
} else {
return itoq(zpopcnt(vals[0]->num, bitval) +
zpopcnt(vals[0]->den,... | false | false | false | false | false | 0 |
read_fortune_pos(uint32_t *pos, uint8_t *delim, const char *dat_path) {
FILE *fp;
struct fortune_dat_header dat_header;
uint32_t fortune_id, fortune_pos;
/* Open the dat file */
if ( (fp = fopen(dat_path, "r")) == NULL) {
fprintf(stderr, "Error opening fortune dat file %s\nfopen: %s\n", dat... | false | false | false | false | true | 1 |
stats_auth(struct Client *source_p)
{
const char *name, *host, *pass, *user, *classname;
struct AddressRec *arec;
struct ConfItem *aconf;
int i, port;
/* Oper only, if unopered, return ERR_NOPRIVS */
if((ConfigFileEntry.stats_i_oper_only == 2) && !IsOper(source_p))
sendto_one_numeric(source_p, ERR_NOPRIVILEGES... | false | false | false | false | false | 0 |
changeMainWindowSize()
{
int y = 0;
int x = 0;
if (ui->radioButtonVertical->isChecked()) {
y = 120;
this->setFixedSize(560+x, 360 + y);
ui->tabWidget->setFixedHeight(311 + y);
ui->tabWidget->setFixedWidth(561 + x);
ui->widgetSkinPreview->setFixedWidth(381 + x);
... | false | false | false | false | false | 0 |
disable_apply_button (IBusInputPadConfig *config)
{
GObject *o;
GtkWidget *apply_button;
g_return_if_fail (IBUS_IS_INPUT_PAD_CONFIG (config));
o = IBUS_INPUT_PAD_CONFIG_GET_CLASS (config)->get_apply_button (config);
g_return_if_fail (o != NULL && GTK_IS_WIDGET (o));
apply_button = GTK_WIDGET ... | false | false | false | false | false | 0 |
_tray_alpha_bg_create(const Evas_Object *obj)
{
Evas_Object *bg = NULL;
Evas_Coord ox, oy, ow, oh;
ELM_GENLIST_CHECK(obj) NULL;
ELM_GENLIST_DATA_GET(obj, sd);
evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
bg = evas_object_rectangle_add
(evas_object_evas_get(ELM_WIDGET_DATA(sd)->o... | false | false | false | false | false | 0 |
ho_bitmap_andnot (ho_bitmap * m_left, const ho_bitmap * m_right)
{
int i;
/*
* check sizes
*/
if (m_left->width != m_right->width || m_left->height != m_right->height)
return TRUE;
/*
* copy data
*/
for (i = 0; i < m_right->height * m_right->rowstride; i++)
m_left->data[i] &= ~m_righ... | false | false | false | false | false | 0 |
cx18_g_register(struct file *file, void *fh,
struct v4l2_dbg_register *reg)
{
struct cx18 *cx = fh2id(fh)->cx;
if (reg->reg & 0x3)
return -EINVAL;
if (reg->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
return -EINVAL;
reg->size = 4;
reg->val = cx18_read_enc(cx, reg->reg);
return 0;
} | false | false | false | false | false | 0 |
select_iclock(void)
{
struct mISDNclock *iclock, *bestclock = NULL, *lastclock = NULL;
int pri = -128;
list_for_each_entry(iclock, &iclock_list, list) {
if (iclock->pri > pri) {
pri = iclock->pri;
bestclock = iclock;
}
if (iclock_current == iclock)
lastclock = iclock;
}
if (lastclock && bestclock !... | false | false | false | false | false | 0 |
AcpiDbUnloadAcpiTable (
char *ObjectName)
{
ACPI_NAMESPACE_NODE *Node;
ACPI_STATUS Status;
/* Translate name to an Named object */
Node = AcpiDbConvertToNode (ObjectName);
if (!Node)
{
return;
}
Status = AcpiUnloadParentTable (ACPI_CAST_... | false | false | false | false | false | 0 |
gn_bmp_point_set(gn_bmp *bmp, int x, int y)
{
switch (bmp->type) {
case GN_BMP_NewOperatorLogo:
case GN_BMP_StartupLogo:
bmp->bitmap[((y / 8) * bmp->width) + x] |= 1 << (y % 8);
break;
/* Testing only! */
case GN_BMP_PictureMessage:
bmp->bitmap[9 * y + (x / 8)] |= 1 << (7 - (x % 8));
break;
case GN_BMP_E... | false | false | false | false | false | 0 |
DrawTextNoClip(PRectangle rc, Font &font, XYPOSITION ybase,
const char *s, int len,
ColourDesired fore, ColourDesired back)
{
SetFont(font);
hDC->SetTextForeground(wxColourFromCD(fore));
hDC->SetTextBackground(wxColourFromCD(back));
FillR... | false | false | false | false | false | 0 |
roll_stat(void) {
int a[4], i, j, k;
for (i = 0; i < 4; i++)
a[i] = (int)RANDOM()%6+1;
for (i = 0, j = 0, k = 7; i < 4; i++)
if (a[i] < k)
k = a[i],
j = i;
for (i = 0, k = 0; i < 4; i++) {
if (i != j)
k += a[i];
}
return k;
} | false | false | false | false | false | 0 |
strlen(const char* str) {
size_t i = 0;
while(*str++ != '\0' && ++i);
return i;
} | false | false | false | false | false | 0 |
traverse(const Shape& parent, bool tr, Renderer* r) const
{
double cond = 0.0;
if (mCondition->evaluate(&cond, 1, r) != 1) {
CfdgError::Error(mLocation, "Error evaluating if condition");
return;
}
if (cond) mThenBody.traverse(parent, tr, r);
else mElse... | false | false | false | false | false | 0 |
spi_dec_plat_unlock_modifiers (SpiDEController *controller, unsigned modifiers)
{
SpiDEControllerClass *klass;
klass = SPI_DEVICE_EVENT_CONTROLLER_GET_CLASS (controller);
if (klass->plat.unlock_modifiers)
return klass->plat.unlock_modifiers (controller, modifiers);
else
return FALSE;
} | false | false | false | false | false | 0 |
check_pubkey_algo (int algorithm, unsigned use)
{
gcry_err_code_t err = GPG_ERR_NO_ERROR;
gcry_pk_spec_t *pubkey;
gcry_module_t module;
REGISTER_DEFAULT_PUBKEYS;
ath_mutex_lock (&pubkeys_registered_lock);
module = _gcry_module_lookup_id (pubkeys_registered, algorithm);
if (module)
{
pubkey = (... | false | false | false | false | false | 0 |
regulator_disable(struct regulator *regulator)
{
struct regulator_dev *rdev = regulator->rdev;
int ret = 0;
if (regulator->always_on)
return 0;
mutex_lock(&rdev->mutex);
ret = _regulator_disable(rdev);
mutex_unlock(&rdev->mutex);
if (ret == 0 && rdev->supply)
regulator_disable(rdev->supply);
return ret;... | false | false | false | false | false | 0 |
extract_trimmed(const char *ptr, size_t len)
{
while (len && ptr[0] == ' ') {
ptr++; len--;
}
while (len && ptr[len - 1] == ' ') {
len--;
}
return git__substrdup(ptr, len);
} | false | false | false | false | false | 0 |
vivid_vid_cap_overlay(struct file *file, void *fh, unsigned i)
{
struct vivid_dev *dev = video_drvdata(file);
if (dev->multiplanar)
return -ENOTTY;
if (i && dev->fb_vbase_cap == NULL)
return -EINVAL;
if (i && dev->fb_cap.fmt.pixelformat != dev->fmt_cap->fourcc) {
dprintk(dev, 1, "mismatch between overlay a... | false | false | false | false | false | 0 |
early_make_pgtable(unsigned long address)
{
unsigned long physaddr = address - __PAGE_OFFSET;
unsigned long i;
pgdval_t pgd, *pgd_p;
pudval_t pud, *pud_p;
pmdval_t pmd, *pmd_p;
/* Invalid address or early pgt is done ? */
if (physaddr >= MAXMEM || read_cr3() != __pa_nodebug(early_level4_pgt))
return -1;
aga... | false | true | false | false | false | 1 |
smtp_auth_plain_check_454 (const gchar *response, GError **error)
{
if (g_str_has_prefix (response, "454"))
{
g_set_error (error,
GOA_ERROR,
GOA_ERROR_FAILED, /* TODO: more specific */
_("TLS not available"));
return TRUE;
}
return FALSE;... | false | false | false | false | false | 0 |
mouseLook( float dx, float dy)
{
// XTRACE();
if( (dx!=0) || (dy!=0))
{
_cameraYaw -= defaultAngleSensitivity * dx;
_cameraPitch += defaultAngleSensitivity * dy;
clampCamera();
}
} | false | false | false | false | false | 0 |
support_units_callback(Widget w, XtPointer client_data,
XtPointer call_data)
{
Widget wd;
XEvent *e = (XEvent*)call_data;
struct unit *punit =
player_unit_by_number(client_player(), (size_t) client_data);
if (NULL != punit) {
struct city *pcity = game_city_by_number(punit->homecity);
if (N... | false | false | false | false | false | 0 |
range_cmp_range1(struct range_range_t *range, /* execution range */
md_addr_t addr, /* address value */
counter_t icount, /* instruction count */
counter_t cycle) /* cycle count */
{
if (range->start.ptype != range->end.ptype)
panic("invalid range");
switch (range->start.ptype)
{
case pt_ad... | false | false | false | false | false | 0 |
ReduceGrain(bool extra) {
int noadjust=0;
for (int y=1; y<h-1; ++y)
for (int x=1; x<w-1; ++x) {
// check if central pixel is too bright
int max = (extra ?
MAX(tl[y*w+x-1],tl[y*w+x+1],tl[(y-1)*w+x],tl[(y+1)*w+x]) :
MAX(tl[y*w+x-1],tl[y*w+x+1],tl[(y-1)*w+x],
tl[(y+1)*w+x],tl[(y-1)*w+x-... | false | false | false | false | false | 0 |
load_contrprocinfo(int *lastcontrp)
{
static char *fn = "/proc/capi/controller";
struct contrprocinfo *list, *p, **pp;
char buf[4096];
FILE *fp;
int line = 0;
if (lastcontrp)
*lastcontrp = 0;
list = 0;
if ((fp = fopen_with_errmsg(fn, "r")) == NULL)
return 0;
while (fgets(buf,sizeof(buf),fp)) {
char *s, ... | false | false | false | false | false | 0 |
_e_fwin_free(E_Fwin *fwin)
{
if (!fwin) return; //safety
_e_fwin_page_free(fwin->cur_page);
if (fwin->zone)
evas_object_event_callback_del(fwin->zone->bg_event_object,
EVAS_CALLBACK_MOUSE_DOWN,
_e_fwin_zone_cb_mouse_down);
if (f... | false | false | false | false | false | 0 |
remote_burglary(x, y)
xchar x, y;
{
struct monst *shkp;
struct eshk *eshkp;
shkp = shop_keeper(*in_rooms(x, y, SHOPBASE));
if (!shkp || !inhishop(shkp))
return; /* shk died, teleported, changed levels... */
eshkp = ESHK(shkp);
if (!eshkp->billct && !eshkp->debit) /* bill is settled */
return;
if (ro... | false | false | false | false | false | 0 |
ahd_construct_ppr(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
u_int period, u_int offset, u_int bus_width,
u_int ppr_options)
{
/*
* Always request precompensation from
* the other target if we are running
* at paced syncrates.
*/
if (period <= AHD_SYNCRATE_PACED)
ppr_options |= MSG_EXT_PPR_... | false | false | false | false | false | 0 |
freeUnsetTraceVariable(Tcl_Interp *interp, XOTclObject *obj) {
int rc = TCL_OK;
obj->flags |= XOTCL_FREE_TRACE_VAR_CALLED;
if (obj->opt && obj->opt->volatileVarName) {
/*
Somebody destroys a volatile object manually while
the vartrace is still active. Destroying the object will
be a proble... | false | false | false | false | false | 0 |
check_desc_avail(struct adapter *adap, struct sge_txq *q,
struct sk_buff *skb, unsigned int ndesc,
unsigned int qid)
{
if (unlikely(!skb_queue_empty(&q->sendq))) {
addq_exit:__skb_queue_tail(&q->sendq, skb);
return 1;
}
if (unlikely(q->size - q->in_use < ndesc)) {
struct sge_qset *qs = txq_t... | false | false | false | false | false | 0 |
cpl_table_fill_column_window_float_complex(cpl_table *table,
const char *name,
cpl_size start,
cpl_size count,
... | false | false | false | false | false | 0 |
userrec_user(userrec **list, userrec **last, char *nick)
{
userrec *u, *lastchecked = NULL;
for(u=*list; u!=NULL; u=u->next)
{
if(User_isnick(u,nick))
{
/* found it. do a movetofront. */
userrec_movetofront(list,last,lastchecked,u);
return u;
}
lastchecked = u;
}
return NULL;
} | false | false | false | false | false | 0 |
diff(const RCP<const Symbol> &x) const
{
return mul(div(one, arg_), arg_->diff(x));
} | false | false | false | false | false | 0 |
camel_object_bag_destroy (CamelObjectBag *bag)
{
g_return_if_fail (bag != NULL);
g_return_if_fail (bag->reserved == NULL);
g_hash_table_destroy (bag->key_table);
g_hash_table_destroy (bag->object_table);
g_mutex_clear (&bag->mutex);
g_slice_free (CamelObjectBag, bag);
} | false | false | false | false | false | 0 |
list_available_plugins(const char *plugindir)
{
char path[1024], *pluginroot;
struct stat buf;
bool first = true;
if (!plugindir)
return;
if (!global_pluginroot)
pluginroot = ADDON_DIR;
else
pluginroot = global_pluginroot;
snprintf(path, sizeof(path), "%s/%s", pluginroot, plugindir);
DIR *dir = opendi... | false | false | false | false | false | 0 |
vvvvRegisterEncodingFromString(const std::string &s,
uint8_t OpSize) {
ENCODING("GR32", ENCODING_VVVV)
ENCODING("GR64", ENCODING_VVVV)
ENCODING("FR32", ENCODING_VVVV)
ENCODING("FR64", ENCODING_VVVV)
ENCODING("VR128",... | false | false | false | false | false | 0 |
sign_block(DATA_BLOCK& data_block, R_RSA_PRIVATE_KEY& key, DATA_BLOCK& signature) {
char md5_buf[MD5_LEN];
int retval;
DATA_BLOCK in_block;
md5_block(data_block.data, data_block.len, md5_buf);
in_block.data = (unsigned char*)md5_buf;
in_block.len = (unsigned int)strlen(md5_buf);
retval = en... | false | false | false | false | false | 0 |
grow ()
{
if (m_resource_count < m_resource_max) return true;
if (m_resource == 0)
{
m_resource = static_cast<XAP_Resource **>(g_try_malloc (8 * sizeof (XAP_Resource *)));
if (m_resource == 0) return false;
m_resource_max = 8;
return true;
}
XAP_Resource ** more = static_cast<XAP_Resource **>(g_try_... | false | false | false | false | false | 0 |
dynamic_client_authorize(UNUSED void *instance, REQUEST *request)
{
size_t length;
const char *value;
CONF_PAIR *cp;
RADCLIENT *c;
char buffer[2048];
/*
* Ensure we're only being called from the main thread,
* with fake packets.
*/
if ((request->packet->src_port != 0) || (request->packet->vps != NULL) ||
... | true | true | false | false | false | 1 |
computeTableChecksum(Guchar *data, int length) {
Guint checksum, word;
int i;
checksum = 0;
for (i = 0; i+3 < length; i += 4) {
word = ((data[i ] & 0xff) << 24) +
((data[i+1] & 0xff) << 16) +
((data[i+2] & 0xff) << 8) +
(data[i+3] & 0xff);
checksum += word;
}
if ... | false | false | false | false | false | 0 |
main (int argc, char **argv)
{
newline_t newline = ASCII_CR;
if (argc < 3)
{
print_help ();
return -1;
}
if (argc == 4 && !strcmp (argv[3], "--unix"))
newline = ASCII_LF;
return run_conv (argv[1], argv[2], newline);
} | false | false | false | false | false | 0 |
spidev_probe(struct spi_device *spi)
{
struct spidev_data *spidev;
int status;
unsigned long minor;
/*
* spidev should never be referenced in DT without a specific
* compatible string, it is a Linux implementation thing
* rather than a description of the hardware.
*/
if (spi->dev.of_node && !of_match_d... | false | false | false | false | false | 0 |
crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
const char * const passwd,
unsigned long long passwdlen,
unsigned long long opslimit,
... | false | false | false | false | false | 0 |
dav_fs_add_locknull_state(
dav_lockdb *lockdb,
const dav_resource *resource)
{
dav_buffer buf = { 0 };
apr_pool_t *p = lockdb->info->pool;
const char *dirpath;
const char *fname;
dav_error *err;
/* ### should test this result value... */
(void) dav_fs_dir_file_name(resource, &dirpat... | false | false | false | false | false | 0 |
json_reader_is_array (JsonReader *reader)
{
g_return_val_if_fail (JSON_IS_READER (reader), FALSE);
json_reader_return_val_if_error_set (reader, FALSE);
if (reader->priv->current_node == NULL)
return FALSE;
return JSON_NODE_HOLDS_ARRAY (reader->priv->current_node);
} | false | false | false | false | false | 0 |
f_searchpos(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
pos_T match_pos;
int lnum = 0;
int col = 0;
int n;
int flags = 0;
if (rettv_list_alloc(rettv) == FAIL)
return;
n = search_cmn(argvars, &match_pos, &flags);
if (n > 0)
{
lnum = match_pos.lnum;
col = mat... | false | false | false | false | false | 0 |
srv_redispatch_connect(struct session *s)
{
struct server *srv;
int conn_err;
/* We know that we don't have any connection pending, so we will
* try to get a new one, and wait in this state if it's queued
*/
redispatch:
conn_err = assign_server_and_queue(s);
srv = objt_server(s->target);
switch (conn_err) ... | false | false | false | false | false | 0 |
server_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
struct iovec *vector, int32_t count,
struct iatt *stbuf, struct iobref *iobref, dict_t *xdata)
{
gfs3_read_rsp rsp = {0,};
server_state_t *... | false | false | false | false | false | 0 |
pthread_key_destructor(void* data)
{
uint32_t tid = *((uint32_t*)data);
#if defined(VT_METR)
if (vt_is_alive && vt_metric_num() > 0 && VTThrdv[tid]->metv)
{
/* shut down metrics */
vt_metric_free(VTThrdv[tid]->metv, tid);
VTThrdv[tid]->metv = NULL;
}
#endif /* VT_METR */
if (tid == 0)
{
/*... | false | false | false | false | false | 0 |
dh_language_compare_by_name (const DhLanguage *language_a,
const gchar *language_name_b)
{
g_return_val_if_fail (language_a != NULL, -1);
g_return_val_if_fail (language_name_b != NULL, -1);
return strcmp (language_a->name, language_name_b);
} | false | false | false | false | false | 0 |
perform_an_assembly_pass (int argc, char ** argv)
{
int saw_a_file = 0;
#ifndef OBJ_MACH_O
flagword applicable;
#endif
need_pass_2 = 0;
#ifndef OBJ_MACH_O
/* Create the standard sections, and those the assembler uses
internally. */
text_section = subseg_new (TEXT_SECTION_NAME, 0);
data_section = sub... | false | false | false | false | false | 0 |
chk_col_access(const SPMAT *A)
#endif
{
int cnt_nz, j, row, idx;
SPROW *r;
row_elt *e;
if ( ! A )
error(E_NULL,"chk_col_access");
/* count nonzeros as we go down columns */
cnt_nz = 0;
for ( j = 0; j < A->n; j++ )
{
row = A->start_row[j];
idx = A->start_idx[j];
while ( row >= 0 )
... | false | false | false | true | false | 1 |
sn_Receive(){
/*
static bool reentry=false;
if (reentry)
return;
reentry=true;
*/
netTime=tSysTimeFloat();
// new_id=0;
sn_Connections[MAXCLIENTS+1].ping.Reset();
// create the ack messages (not required, is done on demand later)
/*
int i;
for(i=0;i<=MAXCLIE... | false | false | false | false | false | 0 |
open_file (state *st)
{
if (st->in)
{
fclose (st->in);
st->in = 0;
}
st->in = fopen (st->filename, "r");
if (!st->in)
{
char buf[1024];
sprintf (buf, "%s: %s", progname, st->filename);
perror (buf);
exit (1);
}
} | false | false | false | false | false | 0 |
getdictionarycode(void)
{
if (unpackcount!=8) return unpackbuf[unpackcount++];
else
{
/* unpackbytes */
L9BYTE d1=*dictptr++,d2;
unpackbuf[0]=d1>>3;
d2=*dictptr++;
unpackbuf[1]=((d2>>6) + (d1<<2)) & 0x1f;
d1=*dictptr++;
unpackbuf[2]=(d2>>1) & 0x1f;
unpackbuf[3]=((d1>>4) + (d2<<4)) & 0x1f;... | false | false | false | false | false | 0 |
bnx2x_schedule_iov_task(struct bnx2x *bp, enum bnx2x_iov_flag flag)
{
smp_mb__before_atomic();
set_bit(flag, &bp->iov_task_state);
smp_mb__after_atomic();
DP(BNX2X_MSG_IOV, "Scheduling iov task [Flag: %d]\n", flag);
queue_delayed_work(bnx2x_iov_wq, &bp->iov_task, 0);
} | false | false | false | false | false | 0 |
stacktrace_atom_lookup(const struct stacktrace *st, size_t len)
{
struct stackatom key;
struct stackatom *result;
STATIC_ASSERT(sizeof st->stack[0] == sizeof result->stack[0]);
if G_UNLIKELY(NULL == stack_atoms)
once_run(&stacktrace_atom_inited, stacktrace_atom_init);
key.stack = deconstify_pointer(st->stack)... | 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.