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 |
|---|---|---|---|---|---|---|
cpumask_create(char *str, size_t len,
cpu_set_t *set, size_t setsize)
{
char *ptr = str;
char *ret = NULL;
int cpu;
for (cpu = cpuset_nbits(setsize) - 4; cpu >= 0; cpu -= 4) {
char val = 0;
if (len == (size_t) (ptr - str))
break;
if (CPU_ISSET_S(cpu, setsize, set))
val |= 1;
if (CPU_ISSET_S(cpu ... | false | false | false | false | true | 1 |
add_ip_checksums(unsigned long offset, unsigned long sum, unsigned long new)
{
unsigned long checksum;
sum = ~sum & 0xFFFF;
new = ~new & 0xFFFF;
if (offset & 1) {
/* byte swap the sum if it came from an odd offset
* since the computation is endian independant this
* works.
*/
new = ((new >> 8) & 0xff)... | false | false | false | false | false | 0 |
e_bindings_shutdown(void)
{
E_FREE_LIST(mouse_bindings, _e_bindings_mouse_free);
E_FREE_LIST(key_bindings, _e_bindings_key_free);
E_FREE_LIST(edge_bindings, _e_bindings_edge_free);
E_FREE_LIST(signal_bindings, _e_bindings_signal_free);
E_FREE_LIST(wheel_bindings, _e_bindings_wheel_free);
E_FREE_LIST(a... | false | false | false | false | false | 0 |
fmt_setup(void)
{
if (!formatstring && !(formatstring = html_inistr("format", (char *) 0)))
formatstring = sdefaultfmt;
} | false | false | false | false | false | 0 |
EvaluateValue(
vtkDataArray *scalars, int comp_no, vtkIdType id, vtkDataArray *lims,
int *AboveCount, int *BelowCount, int *InsideCount)
{
double value = 0.0;
if (comp_no < 0 && scalars)
{
// use magnitude.
int numComps = scalars->GetNumberOfComponents();
const double *tuple = scalars->GetTuple(... | false | false | false | false | false | 0 |
xmmsc_ipc_disconnect (xmmsc_ipc_t *ipc)
{
ipc->disconnect = true;
if (ipc->read_msg) {
xmms_ipc_msg_destroy (ipc->read_msg);
ipc->read_msg = NULL;
}
xmmsc_ipc_error_set (ipc, strdup ("Disconnected"));
if (ipc->disconnect_callback) {
ipc->disconnect_callback (ipc->disconnect_data);
}
} | false | false | false | false | false | 0 |
snd_intel8x0_setup_pcm_out(struct intel8x0 *chip,
struct snd_pcm_runtime *runtime)
{
unsigned int cnt;
int dbl = runtime->rate > 48000;
spin_lock_irq(&chip->reg_lock);
switch (chip->device_type) {
case DEVICE_ALI:
cnt = igetdword(chip, ICHREG(ALI_SCR));
cnt &= ~ICH_ALI_SC_PCM_246_MASK;
if (runtim... | false | false | false | false | false | 0 |
reset_found(void)
{
struct frame *frame;
struct table *table;
struct loop *loop;
for (frame = frames; frame; frame = frame->next) {
for (table = frame->tables; table; table = table->next)
table->found_row = NULL;
for (loop = frame->loops; loop; loop = loop->next)
loop->found = -1;
frame->found_ref = NU... | false | false | false | false | false | 0 |
show_rev(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct c4iw_dev *c4iw_dev = container_of(dev, struct c4iw_dev,
ibdev.dev);
PDBG("%s dev 0x%p\n", __func__, dev);
return sprintf(buf, "%d\n",
CHELSIO_CHIP_RELEASE(c4iw_dev->rdev.lldi.adapter_type));
} | false | false | false | false | false | 0 |
parse_quota(const char *s, uint64_t * quota)
{
*quota = strtoull(s, NULL, 10);
#ifdef DEBUG_XT_QUOTA
printf("Quota: %llu\n", *quota);
#endif
if (*quota == UINT64_MAX)
xtables_error(PARAMETER_PROBLEM, "quota invalid: '%s'\n", s);
else
return 1;
} | false | false | false | false | false | 0 |
return_value_type_to_string(const struct eci_return_value *retval)
{
if (retval->type == eci_return_value::retval_none)
return "-";
else if (retval->type == eci_return_value::retval_error)
return "e";
else if (retval->type == eci_return_value::retval_string)
return "s";
else if (retval->type == eci_... | false | false | false | false | false | 0 |
createPrivateNonConstGlobalForString(Module &M,
StringRef Str) {
Constant *StrConst = ConstantDataArray::getString(M.getContext(), Str);
return new GlobalVariable(M, StrConst->getType(), /*isConstant=*/false,
GlobalValue::Privat... | false | false | false | false | false | 0 |
iwl_mvm_add_int_sta_common(struct iwl_mvm *mvm,
struct iwl_mvm_int_sta *sta,
const u8 *addr,
u16 mac_id, u16 color)
{
struct iwl_mvm_add_sta_cmd cmd;
int ret;
u32 status;
lockdep_assert_held(&mvm->mutex);
memset(&cmd, 0, sizeof(cmd));
cmd.sta_id = sta->sta_id;
cmd.mac_id_n_color =... | false | true | false | false | false | 1 |
handle_irq_noise(struct b43legacy_wldev *dev)
{
struct b43legacy_phy *phy = &dev->phy;
u16 tmp;
u8 noise[4];
u8 i;
u8 j;
s32 average;
/* Bottom half of Link Quality calculation. */
B43legacy_WARN_ON(!dev->noisecalc.calculation_running);
if (dev->noisecalc.channel_at_start != phy->channel)
goto drop_calcula... | false | false | false | false | false | 0 |
IsAWhitespaceChar(const int ch) {
return (ch == ' ' || ch == '\t' || ch == '\r' ||
ch == '\n' || ch == '\f' || ch == '\0');
} | false | false | false | false | false | 0 |
normalize_dir(char *dir)
{
char *p = NULL;
int l = 0;
if (NULL == dir) {
return;
}
l = strlen(dir);
for (p = dir + l - 1; p && *p && (p > dir); p--) {
if ((' ' != *p) && ('\t' != *p) && ('/' != *p) && ('\\' != *p)) {
break;
}
}
*(p+1) = '\0';
} | false | false | false | false | false | 0 |
gst_chop_my_data_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstChopMyData *chopmydata;
GstFlowReturn ret;
chopmydata = GST_CHOP_MY_DATA (parent);
GST_DEBUG_OBJECT (chopmydata, "chain");
gst_adapter_push (chopmydata->adapter, buffer);
ret = gst_chop_my_data_process (chopmydata, FALSE);... | false | false | false | false | false | 0 |
item_space(dbp, h, indx)
DB *dbp;
PAGE *h;
int indx;
{
return (B_TYPE(GET_BKEYDATA(dbp, h, indx)->type) == B_KEYDATA ?
BKEYDATA_PSIZE(GET_BKEYDATA(dbp, h, indx)->len) :
BKEYDATA_PSIZE(GET_BOVERFLOW(dbp, h, indx)->tlen));
} | false | false | false | false | false | 0 |
bcma_core_chipcommon_init(struct bcma_drv_cc *cc)
{
u32 leddc_on = 10;
u32 leddc_off = 90;
if (cc->setup_done)
return;
bcma_core_chipcommon_early_init(cc);
if (cc->core->id.rev >= 20) {
u32 pullup = 0, pulldown = 0;
if (cc->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM43142) {
pullup = 0x402e0;
pulldo... | false | false | false | false | false | 0 |
matroska_aac_profile(char *codec_id)
{
static const char * const aac_profiles[] = { "MAIN", "LC", "SSR" };
int profile;
for (profile=0; profile<FF_ARRAY_ELEMS(aac_profiles); profile++)
if (strstr(codec_id, aac_profiles[profile]))
break;
return profile + 1;
} | false | false | false | false | false | 0 |
ds_strcat (struct dstring *s, char *t)
{
size_t len = s->len;
s->len += strlen (t);
if (ds_is_full (s))
ds_grow (s);
strcpy (s->content + len, t);
} | false | true | false | false | false | 1 |
end_line(char *p) // return pointer to NL of cur line
{
if (p < end - 1) {
p = memchr(p, '\n', end - p - 1);
if (!p)
return end - 1;
}
return p;
} | false | false | false | false | false | 0 |
print_inventory(struct fnode *a, const char *to_file, const char *hostname, const char *username, const char *remote_root)/*{{{*/
{
FILE *out;
if (to_file) {
out = fopen(to_file, "w");
} else {
out = NULL;
}
fprintf(out, "H %s\n", hostname);
fprintf(out, "U %s\n", username);
if (remote_root) {
... | false | false | false | false | false | 0 |
GetTransform(int i)
{
// we walk through the list in reverse order if InverseFlag is set
if (this->InverseFlag)
{
int j = this->NumberOfTransforms-i-1;
vtkTransformPair *tuple = &this->TransformList[j];
// if inverse is NULL, then get it from the forward transform
if (tuple->InverseTransform... | false | false | false | false | false | 0 |
mystrdup(char *s)
{
char *dup;
if (!s)
return 0;
if ((dup = MALLOC(strlen(s) + 1)) == NULL)
syserr("Not enough memory for strdup.");
strcpy(dup, s);
return dup;
} | false | true | false | false | false | 1 |
bytea_substring(Datum str,
int S,
int L,
bool length_not_specified)
{
int S1; /* adjusted start position */
int L1; /* adjusted substring length */
S1 = Max(S, 1);
if (length_not_specified)
{
/*
* Not passed a length - DatumGetByteaPSlice() grabs everything to the
* end of the strin... | false | false | false | false | false | 0 |
gt_template_option_parser_new(void *tool_arguments)
{
TemplateArguments *arguments = tool_arguments;
GtOptionParser *op;
GtOption *option;
gt_assert(arguments);
/* init */
op = gt_option_parser_new("[option ...] [file]", /* XXX */
"DESCRIBE YOUR TOOL IN ONE LINE HERE."); /* XXX ... | false | false | false | false | false | 0 |
gth_catalog_get_icon (GFile *file)
{
char *uri;
GIcon *icon;
uri = g_file_get_uri (file);
if (g_str_has_suffix (uri, ".catalog"))
icon = g_themed_icon_new ("file-catalog");
else
icon = g_themed_icon_new ("file-library");
g_free (uri);
return icon;
} | false | false | false | false | false | 0 |
writeAnimation(const Skeleton* pSkel,
const Animation* anim, SkeletonVersion ver)
{
writeChunkHeader(SKELETON_ANIMATION, calcAnimationSize(pSkel, anim, ver));
// char* name : Name of the animation
writeString(anim->getName());
// float length ... | false | false | false | false | false | 0 |
efx_ef10_sriov_alloc_vf_vswitching(struct efx_nic *efx)
{
struct efx_ef10_nic_data *nic_data = efx->nic_data;
unsigned int i;
int rc;
nic_data->vf = kcalloc(efx->vf_count, sizeof(struct ef10_vf),
GFP_KERNEL);
if (!nic_data->vf)
return -ENOMEM;
for (i = 0; i < efx->vf_count; i++) {
random_ether_add... | false | false | false | false | false | 0 |
daemonize(bool is_chdir, bool wait_sigusr1)
{
struct sigaction new_action;
new_action.sa_handler= sigusr1_handler;
sigemptyset(&new_action.sa_mask);
new_action.sa_flags= 0;
sigaction(SIGUSR1, &new_action, NULL);
parent_pid= getpid();
pid_t child= fork();
switch (child)
{
case -1:
return fals... | false | false | false | false | false | 0 |
dfs_file_write(struct file *file, const char __user *user_buf,
size_t count, loff_t *ppos)
{
unsigned long ubi_num = (unsigned long)file->private_data;
struct dentry *dent = file->f_path.dentry;
struct ubi_device *ubi;
struct ubi_debug_info *d;
size_t buf_size;
char buf[8] = {0};
int val;
ubi = ubi_ge... | false | false | false | false | false | 0 |
wind_utf8ucs4(const char *in, uint32_t *out, size_t *out_len)
{
const unsigned char *p;
size_t o = 0;
int ret;
for (p = (const unsigned char *)in; *p != '\0'; ++p) {
uint32_t u;
ret = utf8toutf32(&p, &u);
if (ret)
return ret;
if (out) {
if (o >= *out_len)
return WIND_ERR_OVERRUN;
... | false | false | false | false | false | 0 |
set_boxwidth()
{
c_token++;
if (END_OF_COMMAND) {
boxwidth = -1.0;
boxwidth_is_absolute = TRUE;
} else {
boxwidth = real_expression();
}
if (END_OF_COMMAND)
return;
else {
if (almost_equals(c_token, "a$bsolute"))
boxwidth_is_absolute = TRUE;
else if (almost_equals(c_token, "r$elative"... | false | false | false | false | false | 0 |
is_same(t0, t1)
Transform t0, t1;
{
int i, j, same = 1;
if (stringent) {
float factor, fepsilon;
Transform tt1, tt2;
Tm3Invert(t0, tt1);
Tm3Concat(t1,tt1,tt2);
/* is tt2 the identity, or a multiple of the identity? */
factor = tt2[0][0];
fepsilon = ABS(factor * epsilon);
for (i=0; i<4; ++i)
... | false | false | false | false | false | 0 |
string_append_dtostr (GString * string, gdouble value, guint precision)
{
gchar dstrbuf[G_ASCII_DTOSTR_BUF_SIZE] = { 0, };
gchar *dot;
guint len;
precision++;
if (value != 0.0)
value += 4.9 * pow (10.0, precision * -1.0);
g_ascii_dtostr (dstrbuf, G_ASCII_DTOSTR_BUF_SIZE, value);
dot = strchr (dstr... | false | false | false | false | false | 0 |
av_write_trailer(AVFormatContext *s)
{
int ret, i;
for(;;){
AVPacket pkt;
ret= av_interleave_packet(s, &pkt, NULL, 1);
if(ret<0) //FIXME cleanup needed for ret<0 ?
goto fail;
if(!ret)
break;
ret= s->oformat->write_packet(s, &pkt);
av_fre... | false | false | false | false | false | 0 |
callbackControls (Component *comp, int key)
{
char buf [256];
if (key == MOUSE_BUTTON_LEFT)
{
fplayer->rolleffect = 0;
fplayer->ruddereffect = 0;
fplayer->elevatoreffect = 0;
keyb_elev = 0;
keyb_roll = 0;
keyb_rudder = 0;
controls ++;
if (controls > 2) controls = 0;
if (control... | false | false | false | false | false | 0 |
get_filename( char* vfilename, char* filename, char* directive, char* tag, char* val, char* fn, int fnsize )
{
int vl, fl;
char* cp;
/* Used for the various commands that accept a file name.
** These commands accept two tags:
** virtual
** Gives a virtual path to a document on the ser... | false | false | false | false | false | 0 |
push_operand (rtx op, enum machine_mode mode)
{
unsigned int rounded_size = GET_MODE_SIZE (mode);
#ifdef PUSH_ROUNDING
rounded_size = PUSH_ROUNDING (rounded_size);
#endif
if (GET_CODE (op) != MEM)
return 0;
if (mode != VOIDmode && GET_MODE (op) != mode)
return 0;
op = XEXP (op, 0);
if (rounded_... | false | false | false | false | false | 0 |
_fd_writeable(slurm_fd_t fd)
{
struct pollfd ufds;
int write_timeout = 5000;
int rc, time_left;
struct timeval tstart;
char temp[2];
ufds.fd = fd;
ufds.events = POLLOUT;
gettimeofday(&tstart, NULL);
while (agent_shutdown == 0) {
time_left = write_timeout - _tot_wait(&tstart);
rc = poll(&ufds, 1, time_... | false | false | false | false | false | 0 |
GetPixelColor(long x,long y, bool bGetAlpha)
{
// RGBQUAD rgb={0,0,0,0};
RGBQUAD rgb=info.nBkgndColor; //<mpwolski>
if ((pDib==NULL)||(x<0)||(y<0)||
(x>=head.biWidth)||(y>=head.biHeight)){
if (info.nBkgndIndex >= 0){
if (head.biBitCount<24) return GetPaletteColor((BYTE)info.nBkgndIndex);
else return info.nB... | false | false | false | false | false | 0 |
showEntry(Entry *entry) {
switch (entry->kind) {
case ENTRY_KIND_CLASS:
printf("class:\n");
showClass(entry->u.classEntry.class, 10);
break;
case ENTRY_KIND_METHOD:
printf("method:\n");
indent(10);
printf("isPublic = %s",
entry->u.methodEntry.isPublic ? "yes" :... | false | false | false | false | false | 0 |
C_GetInfo(CK_INFO_PTR p)
{
if( ! initialized ) {
return CKR_CRYPTOKI_NOT_INITIALIZED;
}
log->log("C_GetInfo called\n");
ckInfo.manufacturerID[31] = ' ';
ckInfo.libraryDescription[31] = ' ';
*p = ckInfo;
return CKR_OK;
} | false | false | false | false | false | 0 |
rotate(int count)
{
int oldcode = code;
switch (count & 0x3)
{
case 1:
code ^= (code & SWAPXY) ? MIRRORY : MIRRORX;
code ^= SWAPXY;
break;
case 2:
code ^= (MIRRORX|MIRRORY);
break;
case 3:
code ^= (code & SWAPXY) ? MIRRORX : MIRRORY;
code ^= SWAPXY;
br... | false | false | false | false | false | 0 |
suspend_nvs_alloc(void)
{
struct nvs_page *entry;
list_for_each_entry(entry, &nvs_list, node) {
entry->data = (void *)__get_free_page(GFP_KERNEL);
if (!entry->data) {
suspend_nvs_free();
return -ENOMEM;
}
}
return 0;
} | false | false | false | false | false | 0 |
slotTabMoved(int from, int to)
{
/* called from Qt slot when Qt has moved the tab, so we only
need to adjust the m_tabNames list */
if (m_automaticResizeTabs) {
QString movedName = m_tabNames.takeAt(from);
m_tabNames.insert(to, movedName);
}
} | false | false | false | false | false | 0 |
netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter,
ulong off, void __iomem **addr)
{
crb_128M_2M_sub_block_map_t *m;
if ((off >= NETXEN_CRB_MAX) || (off < NETXEN_PCI_CRBSPACE))
return -EINVAL;
off -= NETXEN_PCI_CRBSPACE;
/*
* Try direct map
*/
m = &crb_128M_2M_map[CRB_BLK(off)].sub_block[CR... | false | false | false | false | false | 0 |
FindMatch(dir)
int dir;
{
register Bufpos *bp;
register char c = linebuf[curchar];
if (strchr(p_types, c) == NULL || backslashed(linebuf, curchar))
complain((char *)NULL);
if (dir == FORWARD)
f_char(1);
bp = m_paren(c, dir, YES, NO);
if (dir == FORWARD)
b_char(1);
if (bp != NULL)
SetDot(bp);
mp_error()... | false | false | false | false | false | 0 |
legal_getteximage_target(struct gl_context *ctx, GLenum target)
{
switch (target) {
case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
case GL_TEXTURE_3D:
return GL_TRUE;
case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
case GL... | false | false | false | false | false | 0 |
startSaving(const QString &fileName, int pages, double widthCm, double heightCm)
{
int err = 0;
m_mediaboxWidth = cm2Pt(widthCm);
m_mediaboxHeight = cm2Pt(heightCm);
if (m_outputFile) {
m_outputFile->close();
delete m_outputFile;
}
m_outputFile = new QFile(fileName, this);
... | false | false | false | false | false | 0 |
call(int code, char *label, char *mnemo, char *oper)
{
char *operand2;
register int cond;
register struct result *r;
cond = searchcond(8,oper,&operand2) << 3;
r=parse(operand2);
checktype(r,L_ABSOLUTE);
if (cond >=0 )
insert8 (0xc4 + cond );
else
insert8 (0xcd );
insert16 (r->value);
return 0;
} | false | false | false | false | false | 0 |
drbd_bm_init(struct drbd_device *device)
{
struct drbd_bitmap *b = device->bitmap;
WARN_ON(b != NULL);
b = kzalloc(sizeof(struct drbd_bitmap), GFP_KERNEL);
if (!b)
return -ENOMEM;
spin_lock_init(&b->bm_lock);
mutex_init(&b->bm_change);
init_waitqueue_head(&b->bm_io_wait);
device->bitmap = b;
return 0;
} | false | false | false | false | false | 0 |
row_get_prebuilt_insert_row(
/*========================*/
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL
handle */
{
ins_node_t* node;
dtuple_t* row;
dict_table_t* table = prebuilt->table;
ut_ad(prebuilt && table && prebuilt->trx);
if (prebuilt->ins_node == NULL) {
/* Not called before for ... | false | false | false | false | false | 0 |
Initialize(Handle<Object> target) {
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(WrappedContext::New);
constructor_template = Persistent<FunctionTemplate>::New(t);
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
constructor_template->SetClassName(String::NewSymbol(... | false | false | false | false | false | 0 |
cr_rgb_compute_from_percentage (CRRgb * a_this)
{
g_return_val_if_fail (a_this, CR_BAD_PARAM_ERROR);
if (a_this->is_percentage == FALSE)
return CR_OK;
a_this->red = a_this->red * 255 / 100;
a_this->green = a_this->green * 255 / 100;
a_this->blue = a_this->blue * ... | false | false | false | false | false | 0 |
utf_off2cells(off, max_off)
unsigned off;
unsigned max_off;
{
return (off + 1 < max_off && ScreenLines[off + 1] == 0) ? 2 : 1;
} | false | false | false | false | false | 0 |
OnListRender( wxTimerEvent& WXUNUSED(event) ) {
if (wxGetApp().GetDocument()->GetStatisticsCount()) {
m_PaintStatistics->m_full_repaint = true;
m_PaintStatistics->Refresh(false);
}
} | false | false | false | false | false | 0 |
GetNextNodeByProp (xmlNodePtr node, char const *Property, char const *Id)
{
char *txt;
while (node) {
txt = (char*) xmlGetProp (node, (xmlChar*) Property);
if (!strcmp (txt, Id))
break;
node = node->next;
}
return node;
} | false | false | false | false | false | 0 |
mcontour (header *hd)
/***** mcontour
contour plot with matrix and vector intput.
*****/
{ header *st=hd,*result,*hd1;
double *m,*mv,x[5];
int r,c,cv,dummy,i,j;
hd=getvalue(hd); if (error) return;
if (hd->type!=s_matrix || dimsof(hd)->c<2 || dimsof(hd)->r<2)
{ output("Contour needs a real matrix!\n"); error=81; r... | false | false | false | false | false | 0 |
pmdie(SIGNAL_ARGS)
{
int save_errno = errno;
PG_SETMASK(&BlockSig);
ereport(DEBUG2,
(errmsg_internal("postmaster received signal %d",
postgres_signal_arg)));
switch (postgres_signal_arg)
{
case SIGTERM:
/*
* Smart Shutdown:
*
* Wait for children to end their work, then shut down.
... | false | false | false | false | false | 0 |
jbig2_decode_generic_template0_unopt(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params,
Jbig2ArithState *as,
Jbig2Image *image,
Jbig2Arith... | false | false | false | false | false | 0 |
addAttributes(const DIE &Die) {
DIEAttrs Attrs = {};
collectAttributes(Die, Attrs);
hashAttributes(Attrs, Die.getTag());
} | false | false | false | false | false | 0 |
grain_convex_hull_area(GArray *vertices, gdouble dx, gdouble dy)
{
const GridPoint *a = &g_array_index(vertices, GridPoint, 0),
*b = &g_array_index(vertices, GridPoint, 1),
*c = &g_array_index(vertices, GridPoint, 2);
gdouble s = 0.0;
guint i;
g_return_val_if_fai... | false | false | false | false | false | 0 |
find_node(struct nes_cm_core *cm_core,
u16 rem_port, nes_addr_t rem_addr, u16 loc_port, nes_addr_t loc_addr)
{
unsigned long flags;
struct list_head *hte;
struct nes_cm_node *cm_node;
/* get a handle on the hte */
hte = &cm_core->connected_nodes;
/* walk list and find cm_node associated with this sessi... | false | false | false | false | false | 0 |
ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit)
{
const char *name = "?";
bool limited = FALSE;
bool wins = (txtwin != stdscr);
int result;
switch (flavor) {
case eGetStr:
name = wins ? "wgetstr" : "getstr";
break;
case eGetNStr:
limited = TRUE;
name = wins ? "wgetnstr... | false | false | false | false | false | 0 |
iosf_mbi_pci_write_mdr(u32 mcrx, u32 mcr, u32 mdr)
{
int result;
if (!mbi_pdev)
return -ENODEV;
result = pci_write_config_dword(mbi_pdev, MBI_MDR_OFFSET, mdr);
if (result < 0)
goto fail_write;
if (mcrx) {
result = pci_write_config_dword(mbi_pdev, MBI_MCRX_OFFSET,
mcrx);
if (result < 0)
goto fai... | false | false | false | false | false | 0 |
hasSameValue(ARMConstantPoolValue *ACPV) {
if (ACPV->Kind == Kind &&
ACPV->PCAdjust == PCAdjust &&
ACPV->Modifier == Modifier) {
if (ACPV->LabelId == LabelId)
return true;
// Two PC relative constpool entries containing the same GV address or
// external symbols. FIXME: What about blocka... | false | false | false | false | false | 0 |
log_message_level(int level, const char *fmt, ...)
{
int log_level = global.logLevel;
if( (level & log_level) && level != 0)
{
va_list ap;
char buf[1024];
int len;
char *msg;
/* strfcpy (buf + 4, "&LOG opennap ", sizeof(buf) - 4); */
snprintf(buf + 4, sizeof(buf) - 4, "&LOG %s ", global.ser... | true | true | false | false | true | 1 |
popup_split_lines(popup_info *pi, int flags)
{
int nlines, i, body_offset = 0;
int n_chars[POPUP_MAX_LINES];
char *p_str[POPUP_MAX_LINES];
gr_set_font(FONT1);
n_chars[0]=0;
nlines = split_str(pi->raw_text, 1000, n_chars, p_str, POPUP_MAX_LINES);
Assert(nlines >= 0 && nlines <= POPUP_MAX_LINES );
if ( flags &... | false | false | false | false | false | 0 |
save_channel_cache(bgav_input_context_t * ctx)
{
FILE * output = NULL;
char * filename;
char * path = NULL;
const char * language;
dvb_priv_t * priv;
int i, j;
struct stat st;
priv = ctx->priv;
filename = strrchr(priv->device_directory, '/');
filename++;
path = bgav_search_file_write(ctx... | false | false | false | false | false | 0 |
load_history(struct telnet_client_t *cln)
{
struct buffer_t *b = list_entry(cln->history_pos, typeof(*b), entry);
if (b->size < cln->cmdline_len) {
memset(temp_buf, '\b', cln->cmdline_len - b->size);
memset(temp_buf + cln->cmdline_len - b->size, ' ', cln->cmdline_len - b->size);
if (telnet_send(cln, temp_buf, (... | false | false | false | false | false | 0 |
ThouArtDefeated (void)
{
Uint32 now, delay;
SDL_Rect dst;
int h;
Me.status = TERMINATED;
SDL_ShowCursor (SDL_DISABLE);
ExplodeInfluencer ();
now = SDL_GetTicks();
while ( (delay=SDL_GetTicks() - now) < WAIT_AFTER_KILLED)
{
// bit of a dirty hack: get "slow motion effect" by fiddlig with F... | false | false | false | false | false | 0 |
H5Aopen_name(hid_t loc_id, const char *name)
{
H5G_loc_t loc; /* Object location */
H5A_t *attr = NULL; /* Attribute opened */
hid_t ret_value;
FUNC_ENTER_API(FAIL)
H5TRACE2("i", "i*s", loc_id, name);
/* check arguments */
if(H5I_ATTR == H5I_get_type(loc_id)... | false | false | false | false | false | 0 |
setMM(int N, MatrixT A, MatrixT B)
{
int i, j;
for(i=0;i<N;++i)
for(j=0;j<N;++j)
B[i][j] = A[i][j];
} | false | false | false | false | false | 0 |
gf_af_new(GF_Compositor *compositor, GF_AudioInterface *src, char *filter_name)
{
GF_AudioFilterItem *filter;
if (!src || !filter_name) return NULL;
GF_SAFEALLOC(filter, GF_AudioFilterItem);
filter->src = src;
filter->input.FetchFrame = gf_af_fetch_frame;
filter->input.ReleaseFrame = gf_af_release_frame;
filte... | false | false | false | true | false | 1 |
parse_text_identification_frame (ID3TagsWorking * work)
{
guchar encoding;
GArray *fields = NULL;
if (work->parse_size < 2)
return NULL;
encoding = work->parse_data[0];
parse_split_strings (encoding, (gchar *) work->parse_data + 1,
work->parse_size - 1, &fields);
if (fields) {
if (fields->le... | false | false | false | false | false | 0 |
InfHostOpenBufferedFile(PHINF InfHandle,
void *Buffer,
ULONG BufferSize,
LANGID LanguageId,
ULONG *ErrorLine)
{
INFSTATUS Status;
PINFCACHE Cache;
WCHAR *FileBuffer;
ULONG FileBufferSize;
*InfHandle = NULL;
*Err... | false | false | false | false | false | 0 |
unroll_hindexed(dtype, data, fl_idx, len, elts)
struct trdtype **dtype;
char **data;
int fl_idx;
int *len;
int *elts;
{
int i, j;
int count;
int savaddr;
int disp;
struct trdtype *savbuff;
struct trdtype *idxbuff;
count = (*dtype)->trd_count;
idxbuff = ++(*dtype);
*dtype += count;
savbuff = *d... | false | false | false | false | false | 0 |
set_nonblocking(int fd)
{
int flags = fcntl(fd, F_GETFL, 0);
if (flags < 0) return flags;
if (!(flags & O_NONBLOCK)) {
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
return -1;
}
}
return 0;
} | false | false | false | false | false | 0 |
restore(const dmtcp::vector<int>& fds,
ConnectionRewirer*)
{
JASSERT (fds.size()>0);
JTRACE ( "RGARG, RGARG, RGARG, RGARG" ) ( fds[0] ) ( id() );
for(size_t i=0; i<fds.size(); ++i)
{
int fd = fds[i];
int tempFd = _real_epoll_create ( _size ) ;
JASSERT ( tempFd >... | false | false | false | false | false | 0 |
closestPointOnLineSegment(
const Vector3& v0,
const Vector3& v1,
const Vector3& edgeDirection,
const float edgeLength,
const Vector3& point) {
debugAssert((v1 - v0).direction().fuzzyEq(edgeDirection));
debugAssert(fuzzyEq((v1 - v0).magnitude(), edgeLength));
// Vector towards the po... | false | false | false | false | false | 0 |
ExtractInternalReferences(JSObject* js_obj,
HeapEntry* entry) {
int length = js_obj->GetInternalFieldCount();
for (int i = 0; i < length; ++i) {
Object* o = js_obj->GetInternalField(i);
SetInternalReference(
js_obj, entry, i, o, js_obj->GetInternalField... | false | false | false | false | false | 0 |
ex_uminus_var(nodeType *p1)
{
nodeType *p;
long ngp, i;
long nlev;
int nmiss;
int gridID, zaxisID;
double missval;
gridID = p1->gridID;
zaxisID = p1->zaxisID;
nmiss = p1->nmiss;
missval = p1->missval;
ngp = gridInqSize(gridID);
nlev = zaxisInqSize(zaxisID);
p = (nodeType *) malloc(s... | false | false | false | false | false | 0 |
gtk_plot_canvas_ellipse_select(GtkPlotCanvas *canvas, GtkPlotCanvasChild *child, GtkAllocation area)
{
GdkGC *xor_gc = NULL;
GdkGCValues values;
gdk_gc_get_values(GTK_WIDGET(canvas)->style->fg_gc[0], &values);
values.function = GDK_INVERT;
values.foreground = GTK_WIDGET(canvas)->style->white;
values.subw... | false | false | false | false | false | 0 |
joe_iswalnum_(struct charmap *foo,int c)
{
if ((c>=0x30 && c<=0x39) || c==0x5F)
return 1;
else
return joe_iswalpha(foo,c);
} | false | false | false | false | false | 0 |
m88rs6000t_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
{
struct m88rs6000t_dev *dev = fe->tuner_priv;
dev_dbg(&dev->client->dev, "\n");
*frequency = 0; /* Zero-IF */
return 0;
} | false | false | false | false | false | 0 |
init_vn_nary_op_from_stmt (vn_nary_op_t vno, gimple stmt)
{
unsigned i;
vno->opcode = gimple_assign_rhs_code (stmt);
vno->length = gimple_num_ops (stmt) - 1;
vno->type = gimple_expr_type (stmt);
for (i = 0; i < vno->length; ++i)
vno->op[i] = gimple_op (stmt, i + 1);
if (vno->opcode == REALPART_EXPR
... | false | false | false | false | false | 0 |
xfs_dir2_block_removename(
xfs_da_args_t *args) /* directory operation args */
{
xfs_dir2_data_hdr_t *hdr; /* block header */
xfs_dir2_leaf_entry_t *blp; /* block leaf pointer */
struct xfs_buf *bp; /* block buffer */
xfs_dir2_block_tail_t *btp; /* block tail */
xfs_dir2_data_entry_t *dep; /* block data e... | false | false | false | false | false | 0 |
enterprise_add_realm (UmAccountDialog *self,
UmRealmObject *realm)
{
GtkTreeModel *model;
GtkTreeIter iter;
UmRealmCommon *common;
const gchar *realm_name;
gboolean match;
gboolean ret;
gchar *name;
common = um_realm_object_get_commo... | false | false | false | false | false | 0 |
pc_check_skillup(struct map_session_data *sd,int skill_num)
{
int skill_point,up_level;
struct skill_tree_entry *st;
nullpo_retr(0, sd);
st = pc_search_skilltree(&sd->s_class, skill_num);
if(st == NULL)
return 0;
skill_point = pc_calc_skillpoint(sd);
if(skill_point < 9)
up_level = 0;
else if(sd->status.... | false | false | false | false | false | 0 |
argus_change_bg_palette(int color, int data)
{
int r, g, b;
int ir, ig, ib;
r = (data >> 12) & 0x0f;
g = (data >> 8) & 0x0f;
b = (data >> 4) & 0x0f;
ir = (argus_palette_intensity >> 12) & 0x0f;
ig = (argus_palette_intensity >> 8) & 0x0f;
ib = (argus_palette_intensity >> 4) & 0x0f;
r = (r - ... | false | false | false | false | false | 0 |
programsMess (int argc, t_atom*argv) { // FUN
n=0;
delete [] programs;
programs = new GLuint[argc];
while(argc--){
if(argv->a_type == A_FLOAT)programs[n++] = static_cast<GLuint>(atom_getint(argv));
argv++;
}
setModified();
} | false | false | false | false | false | 0 |
ReadHead (istream& in, void* addr1, void* addr2,
void* addr3, void* addr4) {
if (!in.good()) {
cerr << "abnormal exit from ArrowMultiLineScript::ReadHead\n";
return -1;
}
else {
ArrowMultiLine* gs = *(ArrowMultiLine**)addr1;
gs->SetArrows(true, gs->Tail());
return 0;
... | false | false | false | false | false | 0 |
get_selected_items() const
{
std::vector<std::string> retval;
std::vector<CL_ListItem *>::const_iterator it;
for(it = items.begin(); it != items.end(); ++it)
if((*it)->selected)
retval.push_back((*it)->str);
return retval;
} | false | false | false | false | false | 0 |
TriggerPostponedEvents()
{
wxASSERT(m_bActive);
if (m_postponedReceive)
{
m_pControlSocket->LogMessage(::Debug_Verbose, _T("Executing postponed receive"));
m_postponedReceive = false;
OnReceive();
if (m_transferEndReason != none)
return;
}
if (m_postponedSend)
{
m_pControlSocket->LogMessage(::Debug_... | false | false | false | false | false | 0 |
stripe_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
dict_t *params)
{
stripe_private_t *priv = NULL;
stripe_local_t *local = NULL;
xlator_list_t *trav = NULL;
int32_t op_errno = 1;
VALIDATE_OR_GOTO (frame, err);
VALIDA... | false | false | false | false | false | 0 |
embBtreeEmblSV(const AjPStr idline, AjPList svlist)
{
AjPStr token = NULL;
AjPStr str = NULL;
AjPStr idstr = NULL;
AjPStr svstr = NULL;
ajStrAssignSubS(&embindexLine, idline, 5, -1);
ajStrTokenAssignC(&embindexHandle,embindexLine," \t\n\r;");
if(!ajStrTokenNextPars... | false | false | false | false | false | 0 |
twa_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds)
{
int retval = 1, found = 0, response_request_id;
TW_Response_Queue response_queue;
TW_Command_Full *full_command_packet = tw_dev->command_packet_virt[request_id];
if (twa_poll_status_gone(tw_dev, TW_STATUS_RESPONSE_QUEUE_EMPTY, seconds) =... | false | false | false | false | false | 0 |
nfs_iob_get_fh ( struct io_buffer *io_buf, struct nfs_fh *fh ) {
fh->size = oncrpc_iob_get_int ( io_buf );
if ( fh->size > 64 )
return sizeof ( uint32_t );
memcpy (fh->fh, io_buf->data, fh->size );
iob_pull ( io_buf, fh->size );
return fh->size + sizeof ( uint32_t );
} | false | true | false | false | false | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.