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 |
|---|---|---|---|---|---|---|
tail_recursion_args (actuals, formals)
tree actuals, formals;
{
tree a = actuals, f = formals;
int i;
rtx *argvec;
/* Check that number and types of actuals are compatible
with the formals. This is not always true in valid C code.
Also check that no formal needs to be addressable
and that ... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__gfx__drivers__OpenGLDisplayDriver_DisplaySize(struct __ecereNameSpace__ecere__com__Instance * display, int width, int height)
{
struct __ecereNameSpace__ecere__gfx__drivers__OGLDisplay * oglDisplay = ((struct __ecereNameSpace__ecere__gfx__Display *)(((char *)display + __ecereClass... | false | false | false | false | false | 0 |
vgacon_switch(struct vc_data *c)
{
int x = c->vc_cols * VGA_FONTWIDTH;
int y = c->vc_rows * c->vc_font.height;
int rows = screen_info.orig_video_lines * vga_default_font_height/
c->vc_font.height;
/*
* We need to save screen size here as it's the only way
* we can spot the screen has been resized and we need ... | false | false | false | false | false | 0 |
buffer_prepare(struct vb2_buffer *vb)
{
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
struct cx23885_dev *dev = vb->vb2_queue->drv_priv;
struct cx23885_buffer *buf = container_of(vbuf,
struct cx23885_buffer, vb);
struct sg_table *sgt = vb2_dma_sg_plane_desc(vb, 0);
unsigned lines = VBI_PAL_LINE_COUNT;
... | false | false | false | false | false | 0 |
ftpFailed(FtpStateData * ftpState, err_type error)
{
StoreEntry *entry = ftpState->entry;
if (entry->mem_obj->inmem_hi == 0)
ftpFailedErrorMessage(ftpState, error);
if (ftpState->data.fd > -1) {
comm_close(ftpState->data.fd);
ftpState->data.fd = -1;
}
comm_close(ftpState->ctrl.fd);
} | false | false | false | false | false | 0 |
custom_list_iter_n_children (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
CustomList *custom_list;
CustomRecord *parent_record;
g_return_val_if_fail (CUSTOM_IS_LIST (tree_model), -1);
custom_list = CUSTOM_LIST(tree_model);
if (!iter)
/* special case: if iter == NULL, return number of t... | false | false | false | false | false | 0 |
cleanup() {
if (fRegionFormat != NULL) {
delete fRegionFormat;
}
if (fFallbackRegionFormat != NULL) {
delete fFallbackRegionFormat;
}
if (fFallbackFormat != NULL) {
delete fFallbackFormat;
}
if (fLocaleDisplayNames != NULL) {
delete fLocaleDisplayNames;
}
... | false | false | false | false | false | 0 |
parse(const String &str, uint32_t &iresult,
uint32_t &fresult, const ArgContext &args)
{
uint32_t ivalue, fvalue;
if (!parse_saturating(str, ivalue, fvalue, args))
return false;
else if (status == status_range) {
args.error("out of range");
return false;
} else {
iresult = ivalue;
fresult = ... | false | false | false | false | false | 0 |
nssCKFWMechanism_GetWrapKeyLength
(
NSSCKFWMechanism *fwMechanism,
CK_MECHANISM_PTR pMechanism,
NSSCKFWSession *fwSession,
NSSCKFWObject *fwWrappingKeyObject,
NSSCKFWObject *fwKeyObject,
CK_RV *pError
)
{
NSSCKMDSession *mdSession;
NSSCKMDObject *mdWrappingKeyObject;
NSSCKMD... | false | false | false | false | false | 0 |
OrientationTypeToString(const OrientationType orientation_type)
{
const char *
orientation = "?";
switch (orientation_type)
{
case UndefinedOrientation:
orientation = "Unknown";
break;
case TopLeftOrientation:
orientation = "TopLeft";
break;
case TopRightOrientation:
... | false | false | false | false | false | 0 |
amb_module_init (void)
{
PRINTD (DBG_FLOW|DBG_INIT, "init_module");
// sanity check - cast needed as printk does not support %Zu
if (sizeof(amb_mem) != 4*16 + 4*12) {
PRINTK (KERN_ERR, "Fix amb_mem (is %lu words).",
(unsigned long) sizeof(amb_mem));
return -ENOMEM;
}
show_version();
am... | false | false | false | false | false | 0 |
gtk_frontend_init (Ekiga::ServiceCore &core,
int * /*argc*/,
char ** /*argv*/[])
{
bool result = false;
boost::shared_ptr<Ekiga::PresenceCore> presence_core = core.get<Ekiga::PresenceCore> ("presence-core");
boost::shared_ptr<Ekiga::ContactCore> contact_core = core.get<Ekiga::ContactCore> ("contact-cor... | false | false | false | false | false | 0 |
addTips( const QString &tipFile )
{
QString fileName = KStandardDirs::locate( "data", tipFile );
if ( fileName.isEmpty() ) {
kDebug() << "KTipDatabase::addTips: can't find '" << tipFile << "' in standard dirs";
return;
}
QFile file( fileName );
if ( !file.open( QIODevice::ReadOnly ) ) {
kDebug()... | false | false | false | false | false | 0 |
compositor_init_untransform(GF_Compositor *compositor, GF_Node *node)
{
Untransform tr;
if (Untransform_GetNode(node, &tr)) {
UntransformStack *stack;
GF_SAFEALLOC(stack, UntransformStack);
gf_node_set_private(node, stack);
gf_node_set_callback_function(node, TraverseUntransform);
stack->untr = tr;
gf_nod... | false | false | false | true | false | 1 |
get_pipe (GdaThreadWrapper *wrapper, GThread *thread)
{
Pipe *p = NULL;
g_rec_mutex_lock (&(wrapper->priv->rmutex));
if (wrapper->priv->pipes_hash)
p = g_hash_table_lookup (wrapper->priv->pipes_hash, thread);
g_rec_mutex_unlock (&(wrapper->priv->rmutex));
return p;
} | false | false | false | false | false | 0 |
da7213_alc_calib_auto(struct snd_soc_codec *codec)
{
u8 alc_ctrl1;
/* Begin auto calibration and wait for completion */
snd_soc_update_bits(codec, DA7213_ALC_CTRL1, DA7213_ALC_AUTO_CALIB_EN,
DA7213_ALC_AUTO_CALIB_EN);
do {
alc_ctrl1 = snd_soc_read(codec, DA7213_ALC_CTRL1);
} while (alc_ctrl1 & DA7213_ALC... | false | false | false | false | false | 0 |
setPaused(bool paused) {
if (m_movable) {
setText(!paused ? m_character : '?');
}
} | false | false | false | false | false | 0 |
perf_instruction_pointer(struct pt_regs *regs)
{
if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
return perf_guest_cbs->get_guest_ip();
return regs->ip + code_segment_base(regs);
} | false | false | false | false | false | 0 |
TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value)
{
enum TIFFReadDirEntryErr err;
if (direntry->tdir_count!=1)
return(TIFFReadDirEntryErrCount);
switch (direntry->tdir_type)
{
case TIFF_BYTE:
TIFFReadDirEntryCheckedByte(tif,direntry,value);
return(TIFFReadDirEntryErrOk);
case TIFF_SB... | false | false | false | false | false | 0 |
evemu_warn_about_incompatible_event(struct input_event *ev)
{
const int max_warnings = 3;
static int warned = 0;
if (++warned <= max_warnings) {
if (warned == 1)
error(WARNING, "You are trying to play events incompatbile with this device. "
"Is this the right device/recordings file?\n");
error(WARNING, ... | false | false | false | false | false | 0 |
static_value(const char* str) {
return static_value(str, str ? strlen(str) : 0);
} | false | false | false | false | false | 0 |
_12_serialized_setup_free(E_Randr_Serialized_Setup_12 *ss_12)
{
E_Randr_Serialized_Crtc *sc;
E_Randr_Edid_Hash *edid_hash;
if (!ss_12) return;
EINA_LIST_FREE (ss_12->crtcs, sc)
{
_serialized_crtc_free(sc);
}
EINA_LIST_FREE (ss_12->edid_hashes, edid_hash)
free(edid_hash);
fre... | false | false | false | false | false | 0 |
on_encoder_status_poll_timer(gpointer user_data)
{
GapCmeGlobalParams *gpp;
if(gap_debug)
{
printf("\n on_encoder_status_poll_timer: START\n");
}
gpp = (GapCmeGlobalParams *)user_data;
if(gpp)
{
p_remove_encoder_status_poll_timer(gpp);
gap_cme_gui_update_encoder_status(gpp);
if... | false | false | false | false | false | 0 |
gfarm_set_global_user_for_sharedsecret(void)
{
gfarm_error_t e;
char *local_user, *global_user;
/*
* Sharedsecret authentication requires to send a global user
* name when connecting to gfmd, which is determined by the
* local user account.
*/
local_user = gfarm_get_local_username();
e = gfarm_local_to_gl... | false | false | false | false | false | 0 |
merge_file_best_mode(
const git_merge_file_input *ancestor,
const git_merge_file_input *ours,
const git_merge_file_input *theirs)
{
/*
* If ancestor didn't exist and either ours or theirs is executable,
* assume executable. Otherwise, if any mode changed from the ancestor,
* use that one.
*/
if (GIT_MERGE... | false | false | false | false | false | 0 |
cbuf_is_empty (cbuf_t cb)
{
int used;
assert(cb != NULL);
cbuf_mutex_lock(cb);
assert(cbuf_is_valid(cb));
used = cb->used;
cbuf_mutex_unlock(cb);
return(used == 0);
} | false | false | false | false | false | 0 |
GMT_verify_time_step (GMT_LONG step, char unit) {
/* Return -1 if time step and/or unit look bad, 0 if OK. */
GMT_LONG retval = 0;
if (step < 0) {
fprintf (stderr, "GMT SYNTAX ERROR: time steps must be positive.\n");
return (-1);
}
switch (unit) {
case 'c':
case 'C':
if (step > 60) {
fprintf... | false | false | false | false | false | 0 |
paride_register(PIP * pr)
{
int k;
for (k = 0; k < MAX_PROTOS; k++)
if (protocols[k] && !strcmp(pr->name, protocols[k]->name)) {
printk("paride: %s protocol already registered\n",
pr->name);
return -1;
}
k = 0;
while ((k < MAX_PROTOS) && (protocols[k]))
k++;
if (k == MAX_PROTOS) {
printk("... | false | false | false | false | false | 0 |
RestoreMenuBackground(int backup_slot)
{
if (use_open_gl) {
#ifdef HAVE_LIBGL
int h = GameConfig.screen_height;
int w = GameConfig.screen_width;
// Stop any image batch being constructed,
// so that struct image does not get confused.
end_image_batch();
glDisable(GL_TEXTURE_2D);
glEnable(GL_TEXTURE_RE... | false | false | false | false | false | 0 |
anjuta_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
{
AnjutaView* view = ANJUTA_VIEW(widget);
AssistTip* assist_tip;
assist_tip = view->priv->sv->priv->assist_tip;
switch (event->keyval)
{
case GDK_KEY_Escape:
case GDK_KEY_Up:
case GDK_KEY_Down:
case GDK_KEY_P... | false | false | false | false | false | 0 |
get_dof_index(DOF_ADMIN *admin)
{
FUNCNAME("get_dof_index");
int dof = 0, i, ibit;
DEBUG_TEST_EXIT(admin, "no admin\n");
if (admin->first_hole < admin->dof_free_size) {
for (ibit = 0; ibit < DOF_FREE_SIZE; ibit++) {
if (admin->dof_free[admin->first_hole] & dof_free_bit[ibit]) {
admin->dof_fre... | false | false | false | false | false | 0 |
maybe_prescale_weights (nlspec *s)
{
double *coeff;
double crit;
coeff = copyvec(s->coeff, s->ncoeff);
if (coeff == NULL) {
return E_ALLOC;
}
crit = -1 * get_gmm_crit(coeff, s);
if (crit > 0 && !na(crit)) {
double m, lc = gmm_log_10(crit);
#if 0
fprintf(stderr, "maybe_preadjust_weigh... | false | false | false | false | false | 0 |
ipcache_testname(void)
{
wordlist *w = NULL;
debug(14, 1) ("Performing DNS Tests...\n");
if ((w = Config.dns_testname_list) == NULL)
return 1;
for (; w; w = w->next) {
if (gethostbyname(w->key) != NULL)
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
string_prepend (string *p, const char *s)
{
if (s != NULL && *s != '\0')
{
string_prependn (p, s, strlen (s));
}
} | false | false | false | false | false | 0 |
sendping_tail(void (*sp)(int), const void *pkt, int size_pkt)
{
int sz;
CLR((uint16_t)ntransmitted % MAX_DUP_CHK);
ntransmitted++;
/* sizeof(pingaddr) can be larger than real sa size, but I think
* it doesn't matter */
sz = xsendto(pingsock, pkt, size_pkt, &pingaddr.sa, sizeof(pingaddr));
if (sz != size_pkt)
... | false | false | false | false | false | 0 |
buildSurfaceScanRecord(DcmDirectoryRecord *record,
DcmFileFormat *fileformat,
const OFString &referencedFileID,
const OFFilename &sour... | false | false | false | false | false | 0 |
CanReadFile(const char *file)
{
// First check the extension
std::string filename = file;
if ( filename == "" )
{
itkDebugMacro(<< "No filename specified.");
return false;
}
this->AddSupportedWriteExtension(".png");
this->AddSupportedWriteExtension(".PNG");
this->AddSupportedReadExtensio... | false | false | false | false | true | 1 |
check_unowned_group ()
{
GFile *unowned = g_file_new_for_path (UNOWNED_GROUP_LOCAL_URI);
GFileInfo *info;
GError *error = NULL;
g_printf ("*** Checking for unowned group test... ");
info = g_file_query_info (unowned,
G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE ","
G_FI... | false | false | false | false | false | 0 |
Get_Term_Addr_From_Target(GTarget *gt)
{
GVarElt *g_elem = gt->g_elem;
if (gt->g_arg)
return gt->g_arg;
if (g_elem->size < 0)
return NULL;
if (g_elem->size == 0)
return (WamWord *) &g_elem->val;
return (WamWord *) g_elem->val;
} | false | false | false | false | false | 0 |
UpdateItemIndexDesk(List *list, int i, long desk)
{
Item *temp;
for(temp=list->head;temp!=NULL && temp->count!=i;temp=temp->next);
if (temp==NULL) return -1;
temp->Desk=desk;
return temp->count;
} | false | false | false | false | false | 0 |
_bdf_ceiling(double v)
#else
_bdf_ceiling(v)
double v;
#endif
{
short val, neg;
val = neg = 0;
if (v < 0) {
neg = 1;
while (v < -1.0) {
val++;
v += 1.0;
}
} else if (v > 0) {
while (v > 1.0) {
val++;
v -= 1.0;
}
... | false | false | false | false | false | 0 |
ldns_str2rdf_eui64(ldns_rdf **rd, const char *str)
{
unsigned int a, b, c, d, e, f, g, h;
uint8_t bytes[8];
int l;
if (sscanf(str, "%2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x%n",
&a, &b, &c, &d, &e, &f, &g, &h, &l) != 8 ||
l != (int)strlen(str) || /* more data to read */
strpbrk(str, "+-") /* signed hexes */
... | false | false | false | false | false | 0 |
update_status (GeoclueNetworkManager *self, gboolean do_signal)
{
GeoclueNetworkStatus old_status;
NMState state;
old_status = self->status;
if (nm_client_get_manager_running (self->client)) {
state = nm_client_get_state (self->client);
self->status = nmstate_to_geocluenetworkstatus (state);
cache_ap_mac (s... | false | false | false | false | false | 0 |
__log_error(unsigned int bank, bool threshold_err, u64 misc)
{
struct mce m;
u64 status;
rdmsrl(MSR_IA32_MCx_STATUS(bank), status);
if (!(status & MCI_STATUS_VAL))
return;
mce_setup(&m);
m.status = status;
m.bank = bank;
if (threshold_err)
m.misc = misc;
if (m.status & MCI_STATUS_ADDRV)
rdmsrl(MSR_I... | false | false | false | false | false | 0 |
testQString()
{
GdbProcess gdb("qstring");
gdb.execute("break qstring.cpp:5");
gdb.execute("run");
QVERIFY(gdb.execute("print s").contains("\"test string\""));
gdb.execute("next");
QVERIFY(gdb.execute("print s").contains("\"test stringx\""));
} | false | false | false | false | false | 0 |
new_administrator_main(void)
{
string_ty *s1;
string_ty *project_name;
project_ty *pp;
int recursive;
trace(("new_administrator_main()\n{\n"));
arglex();
string_list_ty wl;
project_name = 0;
recursive = 0;
while (arglex_token != arglex_token_eoln)
{
... | false | false | false | false | false | 0 |
button_clicked (GtkButton *button,
EFilterDatespec *fds)
{
EFilterDatespecPrivate *p = E_FILTER_DATESPEC_GET_PRIVATE (fds);
GtkWidget *content_area;
GtkWidget *toplevel;
GtkDialog *dialog;
GtkBuilder *builder;
/* XXX I think we're leaking the GtkBuilder. */
builder = gtk_builder_new ();
e_load_... | false | false | false | false | false | 0 |
alloc_degraded (GCVTable vtable, size_t size, gboolean for_mature)
{
GCObject *p;
if (!for_mature) {
sgen_client_degraded_allocation (size);
SGEN_ATOMIC_ADD_P (degraded_mode, size);
sgen_ensure_free_space (size);
} else {
if (sgen_need_major_collection (size))
sgen_perform_collection (size, GENERATION_OL... | false | false | false | false | false | 0 |
lrmd_send_command(lrmd_t * lrmd, const char *op, xmlNode * data, xmlNode ** output_data, int timeout, /* ms. defaults to 1000 if set to 0 */
enum lrmd_call_options options, gboolean expect_reply)
{ /* TODO we need to reduce usage of this boolean */
int rc = pcmk_ok;... | false | false | false | false | false | 0 |
__ecereRegisterModule_SettingsDialog(struct __ecereNameSpace__ecere__com__Instance * module)
{
struct __ecereNameSpace__ecere__com__Class * class;
class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "SettingsDialog", "ecere::gui::Window", sizeof(struct SettingsDialog), 0, __ecereConstructor_SettingsDialog, ... | false | false | false | false | false | 0 |
LocateNextItemStarting(struct Item *list,char *string)
{ struct Item *ip;
for (ip = list; (ip != NULL); ip=ip->next)
{
if (ip->name == NULL)
{
continue;
}
if (EDABORTMODE && ItemMatchesRegEx(ip->name,VEDITABORT))
{
Verbose("Aborting search, regex %s matches line\n",VEDITABORT)... | false | false | false | false | false | 0 |
logfs_open_area(struct logfs_area *area, size_t bytes)
{
struct super_block *sb = area->a_sb;
struct logfs_super *super = logfs_super(sb);
int err, closed = 0;
if (area->a_is_open && area->a_used_bytes + bytes <= super->s_segsize)
return 0;
if (area->a_is_open) {
u64 ofs = dev_ofs(sb, area->a_segno, area->a_... | false | false | false | false | false | 0 |
pixCopyRGBComponent(PIX *pixd,
PIX *pixs,
l_int32 comp)
{
l_int32 i, j, w, h, ws, hs, wd, hd, val;
l_int32 wpls, wpld;
l_uint32 *lines, *lined;
l_uint32 *datas, *datad;
PROCNAME("pixCopyRGBComponent");
if (!pixd && pixGetDepth(pixd) != 32)
retur... | false | false | false | false | false | 0 |
dwarf_add_AT_unsigned_const(Dwarf_P_Debug dbg,
Dwarf_P_Die ownerdie,
Dwarf_Half attr,
Dwarf_Unsigned value, Dwarf_Error * error)
{
Dwarf_P_Attribute new_attr = 0;
Dwarf_Half attr_form = 0;
Dwarf_Small size = 0;
if (dbg == NULL) {
_dwarf_p_error(NULL, error, DW_DLE_DBG_NULL);
re... | false | false | false | false | false | 0 |
dbind_gather_alloc_info_r (const char **type)
{
char t = **type;
(*type)++;
if (t == DBUS_TYPE_ARRAY)
{
switch (**type)
{
case DBUS_STRUCT_BEGIN_CHAR:
while (**type != DBUS_STRUCT_END_CHAR && **type != '\0') (*type)++;
if (**type != '\0') (*type)++;
... | false | false | false | false | false | 0 |
e_modapi_shutdown(E_Module *m __UNUSED__)
{
if (act)
{
e_action_predef_name_del("Screen", "Backlight Controls");
e_action_del("backlight");
act = NULL;
}
E_FREE_LIST(handlers, ecore_event_handler_del);
e_gadcon_provider_unregister(&_gadcon_class);
return 1;
} | false | false | false | false | false | 0 |
icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, std::string::const_iterator it2, std::string::const_iterator end2)
{
std::string::size_type sz = str.size();
if (pos > sz) pos = sz;
if (pos + n > sz) n = sz - pos;
TextIterator uit1(str.begin() + pos, str.begin() + pos + n, utf... | false | false | false | false | false | 0 |
skl_cldma_wait_interruptible(struct sst_dsp *ctx)
{
int ret = 0;
if (!wait_event_timeout(ctx->cl_dev.wait_queue,
ctx->cl_dev.wait_condition,
msecs_to_jiffies(SKL_WAIT_TIMEOUT))) {
dev_err(ctx->dev, "%s: Wait timeout\n", __func__);
ret = -EIO;
goto cleanup;
}
dev_dbg(ctx->dev, "%s: Event wake\n", __f... | false | false | false | false | false | 0 |
snprint_def_fast_io_fail(char * buff, int len, void * data)
{
if (!conf->fast_io_fail)
return 0;
if (conf->fast_io_fail == MP_FAST_IO_FAIL_OFF)
return snprintf(buff, len, "off");
if (conf->fast_io_fail == MP_FAST_IO_FAIL_ZERO)
return snprintf(buff, len, "0");
return snprintf(buff, len, "%d", conf->fast_io_fai... | false | false | false | false | false | 0 |
dom_tree_to_prox_data (xmlNodePtr node, struct billterm_pdata *pdata)
{
gboolean successful;
successful = dom_tree_generic_parse (node, prox_data_handlers_v2, pdata);
if (!successful)
PERR ("failed to parse billing term prox data");
return successful;
} | false | false | false | false | false | 0 |
run_all_tests()
{
mu_run_test(test_new_table);
mu_run_test(test_add_one_pair);
mu_run_test(test_add_several_pairs);
mu_run_test(test_null_key);
mu_run_test(test_mixed_keys);
mu_run_test(test_overwrite_key);
} | false | false | false | false | false | 0 |
init()
{
if (!m_game->isRunning()) {
kDebug() << "Game is not running, no information update";
return;
}
if (Preferences::whitePlayerHuman()) {
whiteNameLabel->setText(Preferences::whitePlayerName());
} else {
whiteNameLabel->setText(i18n("Computer (level %1)", Preferenc... | false | false | false | false | false | 0 |
createbddhnodetable( Length )
long Length;
{
bddhnodetable *HashTable;
bddhnode *Table;
if ( Length < 0 )
{
bdderror( BDD_HNODE_SIZE_ERROR, Length );
}
Length = (*funcbddhnodesize)( Length );
HashTable = allocbddhnodetable();
Table = allocbddhnode( Length );
HashTable->TABLE =... | false | false | false | false | false | 0 |
move_obstacle(obstacle *o, float newx, float newy)
{
level *lvl = curShip.AllLevels[o->pos.z];
if (!pos_inside_level(newx, newy, lvl))
return;
unglue_obstacle(lvl, o);
o->pos.x = newx;
o->pos.y = newy;
glue_obstacle(lvl, o);
} | false | false | false | false | false | 0 |
dvb_bt8xx_probe(struct bttv_sub_device *sub)
{
struct dvb_bt8xx_card *card;
struct pci_dev* bttv_pci_dev;
int ret;
if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
return -ENOMEM;
mutex_init(&card->lock);
card->bttv_nr = sub->core->nr;
strlcpy(card->card_name, sub->core->v4l2_dev.name, sizeo... | false | false | false | false | false | 0 |
FindValuedPieces(BitField &bf, const btPeer *proposer,
int initial) const
{
PEERNODE *p;
BitField bf_all_have = bf, bf_int_have = bf,
bf_others_have, bf_only_he_has = bf, *pbf_prefer;
for( p = m_head; p; p = p->next ){
if( !PEER_IS_SUCCESS(p->peer) || p->peer == proposer ) continue;
if( p->peer->Ne... | false | false | false | false | false | 0 |
drawButton(int x, int y, int w, int h, char *s, int font,
int fg,int bg)
{
ColorSpace cs;
int i,j;
if (s) {
j=stringWidth(font,s);
i=fontHeight(font);
} else {
j=16;
i=10;
}
if (w<0) w=j+10;
setColor(bg);
drawRect(x,y,w,h,true);
setColor(cs.darker(bg));
drawRect(x+1,y+1,w-2,... | false | false | false | false | false | 0 |
SCLoadGame(int option)
{
char *filename;
if (!SlotStatus[option])
{ // slot's empty...don't try and load
return false;
}
filename = SV_Filename(option);
G_LoadGame(filename);
free(filename);
MN_DeactivateMenu();
BorderNeedRefresh = true;
if (q... | false | false | false | false | false | 0 |
pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
int s, i;
uint8_t *pix3 = pix2 + line_size;
s = 0;
for(i=0;i<h;i++) {
s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
s += ab... | false | false | false | false | false | 0 |
_ptrToInterface(const char* id)
{
if( id == ::CosNotifyChannelAdmin::StructuredProxyPushSupplier::_PD_repoId )
return (::CosNotifyChannelAdmin::_impl_StructuredProxyPushSupplier*) this;
if( id == ::CosNotifyChannelAdmin::ProxySupplier::_PD_repoId )
return (::CosNotifyChannelAdmin::_impl_ProxySupplier*) this... | false | false | false | false | false | 0 |
running()
{
if (mProcess != NULL)
return mProcess->state() == QProcess::Running;
else return false;
} | false | false | false | false | false | 0 |
print_ioctl(FILE *fp, struct ioctl_desc *ioctls, char *prefix,
int cmd, void *ptr)
{
int index = _IOC_NR(cmd);
char *name = ioctls[index].name;
struct struct_desc *desc = ioctls[index].desc;
fprintf(fp,"%s%s(", prefix, name ? name : "UNKNOWN");
if (desc) {
print_struct(fp,desc,ptr... | false | false | false | false | false | 0 |
subsume_bt_literals(Literals clit, Context subst,
Topform d, Plist *gp)
{
if (clit == NULL)
return TRUE;
else {
BOOL subsumed = FALSE;
Literals dlit;
*gp = plist_prepend(*gp, NULL);
for (dlit=d->literals; !subsumed && dlit!=NULL; dlit=dlit->next) {
if (clit->sign == dlit->sign) {
Btm... | false | false | false | false | false | 0 |
odbc_get_v2state(const char *sqlstate, char *dest_state)
{
const struct s_v3to2map *pmap = v3to2map;
while (pmap->v3[0]) {
if (!strcasecmp(pmap->v3, sqlstate)) {
tds_strlcpy(dest_state, pmap->v2, 6);
return;
}
++pmap;
}
/* return the original if a v2 state is not found */
tds_strlcpy(dest_state, sqlst... | false | false | false | false | false | 0 |
snd_vt1724_get_gpio_data(struct snd_ice1712 *ice)
{
unsigned int data;
if (!ice->vt1720)
data = (unsigned int)inb(ICEREG1724(ice, GPIO_DATA_22));
else
data = 0;
data = (data << 16) | inw(ICEREG1724(ice, GPIO_DATA));
return data;
} | false | false | false | false | false | 0 |
psbfb_alloc(struct drm_device *dev, int aligned_size)
{
struct gtt_range *backing;
/* Begin by trying to use stolen memory backing */
backing = psb_gtt_alloc_range(dev, aligned_size, "fb", 1, PAGE_SIZE);
if (backing) {
drm_gem_private_object_init(dev, &backing->gem, aligned_size);
return backing;
}
return NUL... | false | false | false | false | false | 0 |
ChangeCurrent(size_t current)
{
m_current = current;
// as the current item changed, we shouldn't start editing it when the
// "slow click" timer expires as the click happened on another item
if ( m_renameTimer->IsRunning() )
m_renameTimer->Stop();
SendNotify(current, wxEVT_COMMAND_LIST_IT... | false | false | false | false | false | 0 |
tunnel_thread(void *thread_data) {
char *hostname, *pos;
char *thost = ((struct thread_arg_s *)thread_data)->target;
hostname = strdup(thost);
if ((pos = strchr(hostname, ':')) != NULL)
*pos = 0;
if (noproxy_match(hostname))
direct_tunnel(thread_data);
else
forward_tunnel(thread_data);
free(hostname);
... | false | false | false | false | false | 0 |
decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp,
pvolatilep, pmask, pand_mask)
tree exp;
HOST_WIDE_INT *pbitsize, *pbitpos;
enum machine_mode *pmode;
int *punsignedp, *pvolatilep;
tree *pmask;
tree *pand_mask;
{
tree and_mask = 0;
tree mask, inner, offset;
tree u... | false | false | false | false | false | 0 |
C_i_foreign_integer64_argumentp(C_word x)
{
double m;
if((x & C_FIXNUM_BIT) != 0 || (!C_immediatep(x) && C_block_header(x) == C_FLONUM_TAG))
return x;
barf(C_BAD_ARGUMENT_TYPE_NO_INTEGER_ERROR, NULL, x);
return C_SCHEME_UNDEFINED;
} | false | false | false | false | false | 0 |
r300_emit_bitblt_multi(drm_radeon_private_t *dev_priv,
drm_radeon_kcmd_buffer_t *cmdbuf)
{
u32 *cmd = drm_buffer_pointer_to_dword(cmdbuf->buffer, 0);
int count, ret;
RING_LOCALS;
count = (*cmd & RADEON_CP_PACKET_COUNT_MASK) >> 16;
if (*cmd & 0x8000) {
u32 offset;
u32 *cmd1 = drm_buffer_pointer_to_... | false | false | false | false | false | 0 |
static_dlist (int scope, gamgi_window *window)
{
gamgi_dlist *dlist = NULL;
switch (scope)
{
case STATIC_GAMGI:
dlist = gamgi_engine_dlist_layer_gamgi (NULL);
break;
case STATIC_WINDOW:
dlist = gamgi_engine_dlist_layer_window (window, NULL);
break;
case STATIC_BEFORE:
dlist = static_before;
break... | false | false | false | false | false | 0 |
cmpcbe_get_param_var(int entry, dtu_param_kind kind)
{
char *name;
char *buf;
if ((buf = calloc(BUFSIZE, sizeof(char))) == NULL) {
fatal("No room.\n");
}
switch(kind) {
case DTU_SIZE : name = "S"; break;
case DTU_NUMBER : name = "N"; break;
case DTU_SRC_OFFSET : name = "SO"; br... | false | false | false | false | false | 0 |
HPL_bcast_1ring
(
HPL_T_panel * PANEL,
int * IFLAG
)
#else
int HPL_bcast_1ring( PANEL, IFLAG )
HPL_T_panel * PANEL;
int * IFLAG;
#endif
{
/*
* .. Local Variables ..
*/
MPI_Comm comm;
int ... | false | false | false | false | false | 0 |
remove(unsigned startPos,unsigned numChars)
{
if (numChars>0&&startPos<length()&&length()>0)
{
MSStringBuffer *oldBuffer=_pBuffer;
setBuffer(_pBuffer->remove(startPos,numChars));
oldBuffer->removeRef();
}
return *this;
} | false | false | false | false | false | 0 |
e_font_fontconfig_name_get(const char *name, const char *style)
{
char buf[256];
if (!name) return NULL;
if (!style || style[0] == 0) return eina_stringshare_add(name);
snprintf(buf, 256, "%s"E_TOK_STYLE "%s", name, style);
return eina_stringshare_add(buf);
} | false | false | false | false | false | 0 |
tree_model_generator_finalize (GObject *object)
{
ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (object);
if (tree_model_generator->priv->child_model) {
g_signal_handlers_disconnect_matched (
tree_model_generator->priv->child_model,
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL,
tree_model_ge... | false | false | false | false | false | 0 |
sysGetLastErrorString(char *buf, int len)
{
if (errno == 0) {
return 0;
} else {
const char *s = strerror(errno);
int n = strlen(s);
if (n >= len) n = len - 1;
strncpy(buf, s, n);
buf[n] = '\0';
return n;
}
} | false | false | false | false | false | 0 |
ParsePenInfo(PEN_TYPE& ePen, BOOL QueryPrinter)
{
char* str;
DRIVER_ERROR err = SetPenInfo (str, QueryPrinter);
ERRCHECK;
if (*str != '$')
{
return BAD_DEVICE_ID;
}
// parse penID
PEN_TYPE temp_pen1;
// check pen1, assume it is black, pen2 is color
switch (str[1])
{... | false | false | false | false | false | 0 |
test_openssl_roundtrip (Test *test, gconstpointer unused)
{
const gchar *dekinfo;
guchar *encrypted, *decrypted;
gsize n_encrypted, n_decrypted;
GBytes *data;
int i;
guint num;
num = egg_armor_parse (test->input, parse_reference, test);
g_assert ("couldn't PEM block in reference data" && num == 1);
dekinfo =... | false | false | false | false | false | 0 |
setBasis ( const CoinWarmStartBasis & basis,
ClpSimplex * model)
{
// Say can't gurantee optimal basis etc
lastAlgorithm_=999;
// transform basis to status arrays
int iRow,iColumn;
int numberRows = model->numberRows();
int numberColumns = model->numberColumns();
if (!model->statusExists()) {
/*
... | false | false | false | false | false | 0 |
newMessages()
{
if (isClosing)
return;
size_t currentMessageCount=
server->server->getFolderIndexSize();
if (serverIndex.size() < currentMessageCount)
{
vector<size_t> newmessages;
size_t n;
for (n=serverIndex.size(); n<currentMessageCount; n++)
newmessages.push_back(n);
serverIndex.insert(serve... | false | false | false | false | false | 0 |
load(const std::string& path) {
std::lock_guard<std::mutex> lock(guard);
auto it = libs.find(path);
if (libs.end() == it) {
return it->second;
}
return (libs[path] = Library::loadFromFile(path));
} | false | false | false | false | false | 0 |
h10db_idx_write(struct bfile *bfp, const h10db_idx_t* array, int num)
{
int i;
for (i = 0;i < num;i++) {
if (h10db_idx_serialize(bfp, (h10db_idx_t*)&array[i], 1) != 0) {
return H10DBE_IDX_WRITE;
}
}
return 0;
} | false | false | false | false | false | 0 |
updateStatusBar( GenericCell * c )
{
if( c ) {
QString msg;
msg = tr( "(Cell %1x%2)" ).arg( c->getRow()).arg( c->getCol() );
emit sig_status( msg );
}
} | false | false | false | false | false | 0 |
mayBeMemoryDependent(const Instruction &I) {
return I.mayReadOrWriteMemory() || !isSafeToSpeculativelyExecute(&I);
} | false | false | false | false | false | 0 |
drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m)
{
struct drm_fb_cma *fb_cma = to_fb_cma(fb);
int i, n = drm_format_num_planes(fb->pixel_format);
seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height,
(char *)&fb->pixel_format);
for (i = 0; i < n; i++) {
seq_printf(m, " %d: offset=%d ... | false | false | false | false | false | 0 |
clutter_actor_set_natural_height_set (ClutterActor *self,
gboolean use_natural_height)
{
ClutterActorPrivate *priv = self->priv;
ClutterActorBox old = { 0, };
if (priv->natural_height_set == (use_natural_height != FALSE))
return;
clutter_actor_store_old_geometry ... | false | false | false | false | false | 0 |
_compare_path_table(const void *v1, const void *v2)
{
const struct isoent *p1, *p2;
const char *s1, *s2;
int cmp, l;
p1 = *((const struct isoent **)(uintptr_t)v1);
p2 = *((const struct isoent **)(uintptr_t)v2);
/* Compare parent directory number */
cmp = p1->parent->dir_number - p2->parent->dir_number;
if (cm... | false | false | false | false | false | 0 |
delete_confirm_callback ( widget, data )
GtkWidget *widget;
gpointer data;
{
TaskData *td = (TaskData *)data;
int ret, loop, tasknumber;
char msg[500];
if ( ( ret = taskDelete ( td->task, taskdir ) ) ) {
sprintf ( msg, "%s:\n%s",
gettext("Error deleting task"), taskErrorString ( ret ) );
create_c... | 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.