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 |
|---|---|---|---|---|---|---|
GenerateRequest(const char* filename, bool if_der) {
BIO *out = BIO_new(BIO_s_file());
if(!out) {
CredentialLogger.msg(ERROR, "Can not create BIO for request");
LogError(); return false;
}
if (!(BIO_write_filename_User(out, filename))) {
CredentialLogger.msg(ERROR, "Can not set writabl... | false | false | false | false | false | 0 |
bnx2x_adv_to_eee(u32 modes, u32 shift)
{
u32 eee_adv = 0;
if (modes & ADVERTISED_100baseT_Full)
eee_adv |= SHMEM_EEE_100M_ADV;
if (modes & ADVERTISED_1000baseT_Full)
eee_adv |= SHMEM_EEE_1G_ADV;
if (modes & ADVERTISED_10000baseT_Full)
eee_adv |= SHMEM_EEE_10G_ADV;
return eee_adv << shift;
} | false | false | false | false | false | 0 |
cciss_getintinfo(ctlr_info_t *h, void __user *argp)
{
cciss_coalint_struct intinfo;
unsigned long flags;
if (!argp)
return -EINVAL;
spin_lock_irqsave(&h->lock, flags);
intinfo.delay = readl(&h->cfgtable->HostWrite.CoalIntDelay);
intinfo.count = readl(&h->cfgtable->HostWrite.CoalIntCount);
spin_unlock_irqresto... | false | false | false | false | false | 0 |
vcntl(uint cmd, va_list vargs)
{
switch (cmd) {
case FCNTL_MODS_CLEAR_DIRTY_RANGE: {
FileOfs o = va_arg(vargs, FileOfs);
FileOfs s = va_arg(vargs, FileOfs);
FileOfs ts, ms;
int e;
do {
if (!map_ofs(o, &o, &ms)) return EINVAL;
ts = (s < ms) ? s : ms;
e = FileLayer::cntl(cmd, o, ts);
if... | false | false | false | false | false | 0 |
gf_codec_new(GF_ObjectManager *odm, GF_ESD *base_layer, s32 PL, GF_Err *e)
{
GF_Codec *tmp;
GF_SAFEALLOC(tmp, GF_Codec);
if (! tmp) {
*e = GF_OUT_OF_MEM;
return NULL;
}
tmp->odm = odm;
if (PL<0) PL = 0xFF;
*e = Codec_Load(tmp, base_layer, PL);
if (*e) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CODEC, ("[Codec] Canno... | false | false | false | false | false | 0 |
xstrtoul(const char *nptr, char **endptr, int base)
{
unsigned long val;
errno = 0;
val = strtoul(nptr, endptr, base);
if ((val == ULONG_MAX && errno == ERANGE) || ((unsigned int)val != val))
error_loc("integer constant %s is too large\n", nptr);
return val;
} | false | false | false | false | false | 0 |
setPosition(int screen, int position)
{
if(screen < 0 || screen >= QApplication::desktop()->numScreens())
screen = 0;
if(position < 0 || position >= 9)
position = 0;
QRadioButton *button = mRadioButtons.at(screen * 9 + position);
if(button)
button->setChecked(true);
} | false | false | false | false | false | 0 |
load_next_image (State *app)
{
gpointer next;
gchar *image_path;
CoglHandle *cogl_texture;
GError *error = NULL;
/* don't do anything if already animating */
ClutterTimeline *timeline = clutter_state_get_timeline (app->transitions);
if (clutter_timeline_is_playing (timeline) == 1)
{
g_debug ("... | false | false | false | false | false | 0 |
midi_mt32_allstop(void)
{
byte buf[4];
int i;
buf[0] = 0x7b;
buf[1] = 0;
buf[2] = 0;
for (i = 0; i < 16; i++) {
midi_mt32_event((guint8)(0xb0 | i), 2, buf);
}
return 0;
} | false | false | false | false | false | 0 |
shorten_uuid(char *zDest, const char *zSrc){
int i;
for(i=0; i<10 && zSrc[i]<='9'; i++){}
memcpy(zDest, zSrc, 10);
if( i==10 && zSrc[i] ){
do{
zDest[i] = zSrc[i];
i++;
}while( zSrc[i-1]<='9' );
}else{
i = 10;
}
zDest[i] = 0;
} | false | false | false | false | false | 0 |
DEH_AddToHashtable(deh_substitution_t *sub)
{
int entry;
// if the hash table is more than 60% full, increase its size
if ((hash_table_entries * 10) / hash_table_length > 6)
{
IncreaseHashtable();
}
// find where to insert it
entry = strhash(sub->from_text) % hash_table_l... | false | false | false | false | false | 0 |
find_interlace(){
int i,j,flag = 0;
int pathflag=0;
Path *p,*q,*pslow,*qslow;
Path *pstart,*pend,*qstart,*qend;
pslow = path[0];
// qslow = path[1];
p = pslow->next;
// q = qslow->next;
while(p!=NULL){
qslow = path[1];
q = qslow->next;
while(q!=NULL){
if((p->nodes[0] == q->nodes[0] && p->nodes[1] == ... | false | false | false | false | false | 0 |
jack_client_handle_latency_callback (jack_client_t *client, jack_event_t *event, int is_driver)
{
jack_latency_callback_mode_t mode = (event->x.n==0) ? JackCaptureLatency : JackPlaybackLatency;
JSList *node;
jack_latency_range_t latency = { UINT32_MAX, 0 };
/* first setup all latency values of the ports.
* this ... | false | false | false | false | false | 0 |
CreateExactCoordinates(vtkDataArray* inArray, int)
{
// This method is just a dummy because we don't want a pure virtual.
// Subclasses that need it should define the real version.
vtkErrorMacro("vtkXMLWriter::CreateExactCoordinates should never be called.");
inArray->Register(0);
return inArray;
} | false | false | false | false | false | 0 |
FiconvSetupConversion(Display *dpy, FlocaleCharset *fc)
{
FlocaleCharset *my_fc = NULL;
if (!FiconvSupport)
{
return NULL;
}
if (!FiconvInitialized)
{
FiconvInit(dpy, "fvwm");
}
if (FLCIconvUtf8Charset == NULL)
{
return NULL;
}
if (fc == NULL)
{
my_fc = FLCIconvDefaultCharset;
if (my_fc == NUL... | false | false | false | false | false | 0 |
moblin_netbook_style_copy (GtkStyle *dest,
GtkStyle *src)
{
int i;
MoblinNetbookStyle *mb_dest = MOBLIN_NETBOOK_STYLE (dest);
MoblinNetbookStyle *mb_src = MOBLIN_NETBOOK_STYLE (src);
mb_dest->radius = mb_src->radius;
for (i = 0; i < 5; i++)
mb_dest->border_color[i] = mb_src->b... | false | false | false | false | false | 0 |
row_purge(
/*======*/
purge_node_t* node, /*!< in: row purge node */
que_thr_t* thr) /*!< in: query thread */
{
ibool updated_extern;
ut_ad(node);
ut_ad(thr);
node->undo_rec = trx_purge_fetch_next_rec(&node->roll_ptr,
&node->reservation,
node->heap);
if (!node->undo_rec) {
/* Purge completed... | false | false | false | false | false | 0 |
matchFile(FILE * in,const String & ext) {
Vector<String>::iterator extIt;
for ( extIt = fileExtensions.begin() ;
extIt != fileExtensions.end() ; extIt ++ ) {
if ( *extIt == ext ) {
break;
}
}
if ( extIt == fileExtensions.end() ) {
return false;
}
PosibErr<... | false | false | false | false | false | 0 |
xatexit_cleanup (void)
{
register struct xatexit *p;
register int n;
for (p = xatexit_head; p; p = p->next)
for (n = p->ind; --n >= 0;)
(*p->fns[n]) ();
} | false | false | false | false | false | 0 |
write_inode_now(struct inode *inode, int sync)
{
struct writeback_control wbc = {
.nr_to_write = LONG_MAX,
.sync_mode = sync ? WB_SYNC_ALL : WB_SYNC_NONE,
.range_start = 0,
.range_end = LLONG_MAX,
};
if (!mapping_cap_writeback_dirty(inode->i_mapping))
wbc.nr_to_write = 0;
might_sleep();
return writebac... | false | false | false | false | false | 0 |
commit_update_reads(struct schedule_state * s,
struct schedule_instruction * sinst){
unsigned int i;
for(i = 0; i < sinst->NumReadValues; ++i) {
struct reg_value * v = sinst->ReadValues[i];
assert(v->NumReaders > 0);
v->NumReaders--;
if (!v->NumReaders) {
if (v->Next) {
decrease_dependencies(s, v-... | false | false | false | false | false | 0 |
update_last_engine()
{
GtkTreeSelection *select;
const gchar *title;
const gchar *home;
const gchar *pre;
const gchar *post;
const gchar *glue;
const gchar *code;
LOG(LOG_DEBUG, "IN : update_last_engine()");
if(edited != TRUE)
goto END;
if(popup_active())
goto END;
title = gtk_entry_get_text(GTK_E... | false | false | false | false | false | 0 |
icon_clicked_cb (GtkWidget *button, GdkEventButton *event, MimeView *mimeview)
{
gint num;
MimeInfo *partinfo;
num = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button), "icon_number"));
partinfo = g_object_get_data(G_OBJECT(button), "partinfo");
if (event->button == 1) {
icon_selected(mimeview, num, ... | false | false | false | false | false | 0 |
ath6kl_cfg80211_ready(struct ath6kl_vif *vif)
{
struct ath6kl *ar = vif->ar;
if (!test_bit(WMI_READY, &ar->flag)) {
ath6kl_err("wmi is not ready\n");
return false;
}
if (!test_bit(WLAN_ENABLED, &vif->flags)) {
ath6kl_err("wlan disabled\n");
return false;
}
return true;
} | false | false | false | false | false | 0 |
hash_code (s, size)
char *s;
unsigned int size;
{
int c = 0;
while (*s)
{
c = c << 1 ^ (*s);
s++;
}
if (0 > c)
c = (-c);
return (c % size);
} | false | false | false | false | false | 0 |
return_append_str(char *dest, const char *s) {
/* Append text s to dest, and return new result. */
char *newloc;
size_t newlen;
/* This doesn't have buffer overflow vulnerabilities, because
we always allocate for enough space before appending. */
if (!dest) {
newloc = (char *) malloc(strlen(s))+1;
strcpy(ne... | false | false | false | false | true | 1 |
serial_echo_print(const char *p)
{
if (!serial_cons) {
return;
}
/* Now, do each character */
while (*p) {
WAIT_FOR_XMITR;
/* Send the character out. */
serial_echo_outb(*p, UART_TX);
if(*p==10) {
WAIT_FOR_XMITR;
serial_echo_outb(13, UART_TX);
}
p++;
}
} | false | false | false | false | false | 0 |
msm_phy_notify_disconnect(struct usb_phy *phy,
enum usb_device_speed speed)
{
struct msm_otg *motg = container_of(phy, struct msm_otg, phy);
int val;
if (motg->manual_pullup) {
val = ULPI_MISC_A_VBUSVLDEXT | ULPI_MISC_A_VBUSVLDEXTSEL;
usb_phy_io_write(phy, val, ULPI_CLR(ULPI_MISC_A));
}
/*
* Put the... | false | false | false | false | false | 0 |
i2f(int i, Float11* f)
{
f->sign = (i < 0);
if (f->sign)
i = -i;
f->exp = av_log2_16bit(i) + !!i;
f->mant = i? (i<<6) >> f->exp : 1<<5;
return f;
} | false | false | false | false | false | 0 |
pk_transaction_message_cb (PkBackend *backend,
PkMessage *item,
PkTransaction *transaction)
{
gboolean developer_mode;
gchar *details;
PkMessageEnum type;
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
/* get data */
g_object_get (item,
... | false | false | false | false | false | 0 |
framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
{
int ret;
int samples = pvt->samples; /* initial value */
/* Copy the last in jb timing info to the pvt */
ast_copy_flags(&pvt->f, f, AST_FRFLAG_HAS_TIMING_INFO);
pvt->f.ts = f->ts;
pvt->f.len = f->len;
pvt->f.seqno = f->seqno;
if (f->samples == 0) {
... | false | false | false | false | false | 0 |
f__cabs(double real, double imag)
#endif
{
double temp;
if(real < 0)
real = -real;
if(imag < 0)
imag = -imag;
if(imag > real){
temp = real;
real = imag;
imag = temp;
}
if((real+imag) == real)
return(real);
temp = imag/real;
temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/
return(temp);
} | false | false | false | false | false | 0 |
auth_ticket_register(void)
{
if(!client_tickets) {
client_tickets = xxrealloc(NULL, sizeof(char *));
client_tickets[0] = NULL;
}
debug(D_AUTH, "ticket: registered");
return auth_register("ticket", auth_ticket_assert, auth_ticket_accept);
} | false | false | false | false | false | 0 |
dsp3780I_WriteMsaCfg(unsigned short usDspBaseIO,
unsigned long ulMsaAddr, unsigned short usValue)
{
unsigned long flags;
PRINTK_4(TRACE_3780I,
"3780i::dsp3780i_WriteMsaCfg entry usDspBaseIO %x ulMsaAddr %lx usValue %x\n",
usDspBaseIO, ulMsaAddr, usValue);
spin_lock_irqsave(&dsp_lock, ... | false | false | false | false | false | 0 |
qla4xxx_abort_task(struct scsi_qla_host *ha, struct srb *srb)
{
uint32_t mbox_cmd[MBOX_REG_COUNT];
uint32_t mbox_sts[MBOX_REG_COUNT];
struct scsi_cmnd *cmd = srb->cmd;
int status = QLA_SUCCESS;
unsigned long flags = 0;
uint32_t index;
/*
* Send abort task command to ISP, so that the ISP will return
* reques... | false | false | false | false | false | 0 |
poppler_page_finalize (GObject *object)
{
PopplerPage *page = POPPLER_PAGE (object);
g_object_unref (page->document);
page->document = NULL;
if (page->text != NULL)
page->text->decRefCnt();
/* page->page is owned by the document */
G_OBJECT_CLASS (poppler_page_parent_class)->finalize (object);
} | false | false | false | false | false | 0 |
addFileOpen(const QString& s, bool utf8)
{
QMutableListIterator<DatabaseListEntry> i(m_databases);
DatabaseListEntry d;
d.m_path = s;
if(i.findNext(d))
{
DatabaseListEntry& e = i.previous();
e.m_utf8 = utf8;
if(e.m_state != EDBL_OPEN)
{
e.m_state = EDBL_O... | false | false | false | false | false | 0 |
bit_count (unsigned long value)
{
unsigned long count = 0;
while (value)
{
count++;
value &= value - 1; /* Clear the least-significant set bit. */
}
return count;
} | false | false | false | false | false | 0 |
jsfGetJSON(JsVar *var, JsVar *result, JSONFlags flags) {
assert(jsvIsString(result));
JsvStringIterator it;
jsvStringIteratorNew(&it, result, 0);
jsvStringIteratorGotoEnd(&it);
jsfGetJSONWithCallback(var, flags, (vcbprintf_callback)&jsvStringIteratorPrintfCallback, &it);
jsvStringIteratorFree(&it);
} | false | false | false | false | false | 0 |
sigdiff(double d1, double d2, double signf)
{
double diff = fabs(d1-d2);
if (diff == 0.0) return 0;
diff = diff / (fabs(d1) + fabs(d2));
if (diff < signf) return 0;
if (d1 > d2) return 1;
else return -1;
} | false | false | false | false | false | 0 |
set_FontName(MudProfile *profile, const gchar *candidate)
{
if (candidate && strcmp(profile->priv->preferences.FontName, candidate) == 0)
return FALSE;
if (candidate != NULL)
{
g_free(profile->priv->preferences.FontName);
profile->priv->preferences.FontName = g_strdup(candidate);
... | false | false | false | false | false | 0 |
check_for_results()
{
for (int i=0; i<probe_combi_array_length; i++)
{
if (probe_combi_stat_array[i])
mp_main->get_p_eval()->insert_in_result_list(probe_combi_stat_array[i]);
}
} | false | false | false | false | false | 0 |
_license_cnt(List license_list, char *lic_name)
{
int lic_cnt = 0;
ListIterator iter;
licenses_t *license_ptr;
if (license_list == NULL)
return lic_cnt;
iter = list_iterator_create(license_list);
if (!iter)
fatal("list_interator_create malloc failure");
while ((license_ptr = list_next(iter))) {
if (strcm... | false | false | false | false | false | 0 |
queryClose()
{
kDebug();
// TODO : Test si jeu en cours
if (m_onu && m_onu->dirty())
{
switch (KMessageBox::warningYesNoCancel(this,i18n("There are unsaved changes. What do you want to do?"),
i18n("Exit Anyway?"),
KGuiItem(i18n("Quit without saving")),
... | false | false | false | false | false | 0 |
makebmp(const char *step, const char *tempd, int w, int h, void *data) {
unsigned int tmp1=0, tmp2=0, tmp3=0, tmp4=0, y;
char *fname;
FILE *f;
if(!tempd) return;
if(!(fname = cli_gentemp(tempd))) return;
if(!(f = fopen(fname, "wb"))) {
cli_unlink(fname);
cli_dbgmsg("makebmp: failed to create ... | false | false | false | false | false | 0 |
assert_note_equal(git_note *note, char *message, git_oid *note_oid) {
git_blob *blob;
cl_assert_equal_s(git_note_message(note), message);
cl_assert(!git_oid_cmp(git_note_oid(note), note_oid));
cl_git_pass(git_blob_lookup(&blob, _repo, note_oid));
cl_assert_equal_s(git_note_message(note), (const char *)git_blob_r... | false | false | false | false | false | 0 |
kona_clk_setup(struct kona_clk *bcm_clk)
{
struct clk_init_data *init_data = &bcm_clk->init_data;
struct clk *clk = NULL;
switch (bcm_clk->type) {
case bcm_clk_peri:
if (peri_clk_setup(bcm_clk->u.data, init_data))
return NULL;
break;
default:
pr_err("%s: clock type %d invalid for %s\n", __func__,
(int... | false | false | false | false | false | 0 |
passthru_release_connection( PassThruServer *srvr, LDAP *ld, int dispose )
{
PassThruConnection *conn, *connprev;
PASSTHRU_ASSERT( srvr != NULL );
PASSTHRU_ASSERT( ld != NULL );
#ifdef PASSTHRU_VERBOSE_LOGGING
slapi_log_error( SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM,
"=> passthru_release_conn... | false | false | false | false | false | 0 |
_dxfCopyFaceNormalsAreasCompactness(Plane *plane, float *s_area, float *s_comp,
int *star0, int *star1, int val0, int val013,
Vertex *t_normal, float *t_area, float *t_comp)
{
register int i, i1;
int val01 = val0-1;
/* copy the normals of the faces and plug them into the
equations of the pla... | false | false | false | false | false | 0 |
load_data_ready (LoadData *load_data,
GList *files,
GError *error)
{
if (error != NULL) {
load_data_error (load_data, error);
load_data_free (load_data);
}
else if ((load_data->action != GTH_ACTION_LIST_CHILDREN)
&& g_file_equal ((GFile *) load_data->current->data, load_data->requested_folder->file... | false | false | false | false | false | 0 |
do_powm(void)
{
MPI a;
if( stackidx < 3 ) {
fputs("stack underflow\n", stderr);
return;
}
a= mpi_alloc(10);
mpi_powm( a, stack[stackidx-3], stack[stackidx-2], stack[stackidx-1] );
mpi_free(stack[stackidx-3]);
stack[stackidx-3] = a;
stackidx -= 2;
} | false | false | false | false | false | 0 |
do_get_string (const ustring& format) const throw ()
{
ustring result = _("(unknown)");
switch (value)
{
case S: result = _("s-block"); break;
case P: result = _("p-block"); break;
case D: result = _("d-block"); break;
case F: result = _("f-block"); break;
}
return format.empty () ? result : compose::ucompos... | false | false | false | false | false | 0 |
StoreToken(TokenInfo *token_info,char *string,
size_t max_token_length,char c)
{
register long
i;
if ((token_info->offset < 0) ||
((size_t) token_info->offset >= (max_token_length-1)))
return;
i=token_info->offset++;
string[i]=c;
if (token_info->state == IN_QUOTE)
return;
switch (token_... | false | false | false | false | false | 0 |
igb_release_nvm(struct e1000_hw *hw)
{
u32 eecd;
e1000_stop_nvm(hw);
eecd = rd32(E1000_EECD);
eecd &= ~E1000_EECD_REQ;
wr32(E1000_EECD, eecd);
} | false | false | false | false | false | 0 |
Save_log(Chk_log_type *log)
{
char *buf = NULL;
int len;
int status;
if(!log->file_ptr){
return REG_FAILURE;
}
if(log->num_entries > 0){
if(log->log_type == PARAM){
status = Log_to_columns(log, &buf, &len, REG_FALSE);
}
else{
/* 5th argument says we want all entries... | false | false | false | false | false | 0 |
copy_query_parameters(SAVED_QUERY_S *params)
{
SAVED_QUERY_S *sq;
sq = (SAVED_QUERY_S *)fs_get(sizeof(SAVED_QUERY_S));
memset((void *)sq, 0, sizeof(SAVED_QUERY_S));
if(params && params->qq)
sq->qq = cpystr(params->qq);
else
sq->qq = cpystr("");
if(params && params->cn)
sq->c... | false | false | false | false | false | 0 |
createMBlazeAsmBackend(const Target &T, StringRef TT) {
Triple TheTriple(TT);
if (TheTriple.isOSDarwin())
assert(0 && "Mac not supported on MBlaze");
if (TheTriple.isOSWindows())
assert(0 && "Windows not supported on MBlaze");
return new ELFMBlazeAsmBackend(T, TheTriple.getOS());
} | false | false | false | false | false | 0 |
unity_internal_deprecated_scope_impl_queue_search_for_type (UnityInternalDeprecatedScopeImpl* self, UnitySearchType search_type) {
UnitySearchType _tmp0_ = 0;
UnityProtocolChannelType _tmp1_ = 0;
UnitySearchType _tmp2_ = 0;
UnityProtocolChannelType channel_type = 0;
UnityProtocolChannelType _tmp3_ = 0;
GHashTable... | false | false | false | false | false | 0 |
x2sys_pick_fields (char *string, struct X2SYS_INFO *s)
{
/* Scan the -Fstring and select which columns to use and which order
* they should appear on output. Default is all columns and the same
* order as on input. Once this is set you can loop through i = 0:n_out_columns
* and use out_order[i] to get the orig... | false | false | false | false | false | 0 |
make_dummy_arg_array (Token *t)
/* List of tokens */
#else /* K&R style */
make_dummy_arg_array (t)
Token *t; /* List of tokens */
#endif /* HAVE_STDC */
{
unsigned i;
unsigned count;
Token *s;
ArgListElement *arglist;
ArgListHeader *alhead;
count = arg_count(t);
if(((alhead=new_arglistheader())
... | false | false | false | false | true | 1 |
Stats_sample(Stats *st, double s)
{
st->sum += s;
st->sumsq += s * s;
if(st->n == 0) {
st->min = s;
st->max = s;
} else {
if(st->min > s) st->min = s;
if(st->max < s) st->max = s;
}
st->n += 1;
} | false | false | false | false | false | 0 |
SplitPathVariable(const std::string & pathVariable) const
{
std::string content=pathVariable;
std::vector<std::string> result;
while (!content.empty())
{
size_t separatorPos = content.find(pathSeparator());
if (separatorPos == std::string::npos)
{
result.push_back(content);
break;
}
result.push_bac... | false | false | false | false | false | 0 |
convert(struct state *st)
{
int *p;
int i, j;
st->fast_from = calloc(1, sizeof(int)*((st->buffer_map->bytes_per_line/st->bpp_size)*(2*st->radius+st->speed+2) + 2*st->radius+st->speed+2));
if (st->fast_from == NULL) {
perror("distort");
exit(EXIT_FAILURE);
}
p = st->fast_from;
for (i = 0; i < 2*st->radius+st... | false | false | false | false | false | 0 |
removeAllItems()
{
// Delete all the items
QList<QLanguageItem*> items = languageItems();
for ( int i = 0 ; i < items.size() ; i++ )
{
itemRemoved(items[i]);
delete items[i];
}
updateWindowState();
} | false | false | false | false | false | 0 |
Reload(bool detectEncoding)
{
// keep current pos
const int pos = m_pControl ? m_pControl->GetCurrentPos() : 0;
const int pos2 = m_pControl2 ? m_pControl2->GetCurrentPos() : 0;
// call open
if (!Open(detectEncoding))
{
return false;
}
// Re-establish margin styles, width, etc
... | false | false | false | false | false | 0 |
underflow()
{
log_warn("underflow not supported in iconvstreambuf");
return traits_type::eof();
} | false | false | false | false | false | 0 |
poll() {
if (gui_http_state == GUI_HTTP_STATE_IDLE) return false;
static double last_time=0;
if (!gstate.clock_change && gstate.now-last_time < GUI_HTTP_POLL_PERIOD) return false;
last_time = gstate.now;
if (http_op.http_op_state == HTTP_STATE_DONE) {
gstate.http_ops->remove(&http_op);
... | false | false | false | false | false | 0 |
RegisterModuleItem(
void *theEnv,
char *theItem,
void *(*allocateFunction)(void *),
void (*freeFunction)(void *,void *),
void *(*bloadModuleReference)(void *,int),
void (*constructsToCModuleReference)(void *,FILE *,int,int,int),
void *(*findFunction)(void *,char *))
{
struct moduleItem *newMo... | false | false | false | false | false | 0 |
enum_audio(v4l2_audio &audio, bool init)
{
if (init)
memset(&audio, 0, sizeof(audio));
else
audio.index++;
return ioctl(VIDIOC_ENUMAUDIO, &audio) >= 0;
} | false | false | false | false | false | 0 |
emtof(const string& s) {
if (str_i_str(s, "sp") != -1) {
GLECoreFont* cfont = set_tex_font(p_fnt);
return atof(s.c_str()) * cfont->info.space*p_hei;
}
if (str_i_str(s, "em") != -1) {
return atof(s.c_str())*p_hei*0.75;
}
return atof(s.c_str());
} | false | false | false | false | false | 0 |
mount_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
MountOp *data = user_data;
if (data->callback != NULL)
data->callback (source_object, res, data->user_data);
mount_op_free (data);
} | false | false | false | false | false | 0 |
move_rename(const char * source, const char * target)
{
int err = 0;
do {
if (simulate_run()) {
err = EXDEV;
break;
}
if (::rename(source, target) != 0) {
err = errno;
break;
}
ff_log(FC_TRACE, 0, "move_rename() `%s'\t-> `%... | false | false | false | false | false | 0 |
flush_pending_lists (struct deps_desc *deps, rtx insn, int for_read,
int for_write)
{
if (for_write)
{
add_dependence_list_and_free (deps, insn, &deps->pending_read_insns,
1, REG_DEP_ANTI);
if (!deps->readonly)
{
free_EXPR_LIST_list (&deps->... | false | false | false | false | false | 0 |
xgbe_maybe_stop_tx_queue(struct xgbe_channel *channel,
struct xgbe_ring *ring, unsigned int count)
{
struct xgbe_prv_data *pdata = channel->pdata;
if (count > xgbe_tx_avail_desc(ring)) {
netif_info(pdata, drv, pdata->netdev,
"Tx queue stopped, not enough descriptors available\n");
netif_stop_subque... | false | false | false | false | false | 0 |
assemble_umode_buffer(void)
{
unsigned int idx = 0;
char *umode_buffer_ptr = umode_buffer;
for (; idx < (sizeof(user_modes) / sizeof(user_modes[0])); ++idx)
if (user_modes[idx])
*umode_buffer_ptr++ = idx;
*umode_buffer_ptr = '\0';
} | false | false | false | false | false | 0 |
reset_RGB(unsigned char **block_R, unsigned char **block_G,
unsigned char **block_B, int width, int height)
{
int i, j;
/* Reset everything to zero */
for (i = 0; i < height; i++) {
for (j = 0; j < width; j++) {
block_R[i][j] = block_G[i][j] = block_B[i][j] = 0;
... | false | false | false | false | false | 0 |
BinaryType(BinaryOperation* expr) {
Handle<Object> object = GetInfo(expr->id());
TypeInfo unknown = TypeInfo::Unknown();
if (!object->IsCode()) return unknown;
Handle<Code> code = Handle<Code>::cast(object);
if (code->is_binary_op_stub()) {
BinaryOpIC::TypeInfo type = static_cast<BinaryOpIC::TypeInfo>(
... | false | false | false | false | false | 0 |
list_append(list_t *list, void *data)
{
link_t *link;
if ((link = calloc(1, sizeof(link_t))) == NULL) {
fprintf(stderr, "Cannot allocate list link.\n");
return NULL;
}
link->data = data;
if (list->head == NULL) {
list->head = link;
} else {
list->tail->next = link;
}
list->tail = link;
list->length++;... | false | false | false | false | false | 0 |
setDataToUi()
{
categoryBackgroundButton->setColor(QColor(settings()->value(Constants::S_BACKGROUND_CATEGORIES).toString()));
categoryForegroundButton->setColor(QColor(settings()->value(Constants::S_FOREGROUND_CATEGORIES).toString()));
pmhBackgroundButton->setColor(QColor(settings()->value(Constants::S_BACK... | false | false | false | false | false | 0 |
InitBufferPoolAccess(void)
{
/*
* Allocate and zero local arrays of per-buffer info.
*/
PrivateRefCount = (int32 *) calloc(NBuffers, sizeof(int32));
if (!PrivateRefCount)
ereport(FATAL,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory")));
} | false | false | false | false | false | 0 |
G3d_longEncode(long *source, unsigned char *dst, int nofNums)
{
long *src, d;
int eltLength, nBytes;
unsigned char *dstStop, tmp;
eltLength = G3D_LONG_LENGTH;
nBytes = 8;
d = 1;
while (eltLength--) {
dstStop = dst + nofNums;
src = source;
while (dst != dstStop) {
tmp = ((*src++ /... | false | false | false | false | false | 0 |
adminfooter(GRSThttpBody *bp, char *dn, char *help_uri, char *dir_uri,
char *admin_file)
{
GRSThttpPrintf(bp, "<p><small>\n");
if (dn != NULL) GRSThttpPrintf(bp, "<hr>You are %s<br>\n", dn);
else GRSThttpPrintf(bp, "<hr>\n");
if (admin_file != NULL)
GRSThttpPrintf(bp, "<a ... | false | false | true | false | true | 1 |
gst_matroska_read_common_count_streams (GstMatroskaReadCommon * common,
gint * a, gint * v, gint * s)
{
gint i;
gint video_streams = 0, audio_streams = 0, subtitle_streams = 0;
for (i = 0; i < common->src->len; i++) {
GstMatroskaTrackContext *stream;
stream = g_ptr_array_index (common->src, i);
... | false | false | false | false | false | 0 |
Base256ToNum(const char *Str,unsigned long &Res,unsigned int Len)
{
if ((Str[0] & 0x80) == 0)
return false;
else
{
Res = Str[0] & 0x7F;
for(unsigned int i = 1; i < Len; ++i)
Res = (Res<<8) + Str[i];
return true;
}
} | false | false | false | false | false | 0 |
be_resume(struct be_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
int status;
status = be_setup(adapter);
if (status)
return status;
if (netif_running(netdev)) {
status = be_open(netdev);
if (status)
return status;
}
netif_device_attach(netdev);
return 0;
} | false | false | false | false | false | 0 |
try_set_attribute (GVfsBackend *backend,
GVfsJobSetAttribute *job,
const char *filename,
const char *attribute,
GFileAttributeType type,
gpointer value_p,
GFileQueryInfoFlags flags)
{
GVfsBackendSftp *op_backend = G_VFS_BACKEND_SFTP (backend);
GDataOutputStream *command;
if (strcmp ... | false | false | false | false | false | 0 |
dump_ies(unsigned char *iedata, int len)
{
int ielen;
int ie;
int x;
int found;
char interp[1024];
char tmp[1024];
if (len < 2)
return;
while(len > 2) {
ie = iedata[0];
ielen = iedata[1];
if (ielen + 2> len) {
snprintf(tmp, (int)sizeof(tmp), "Total IE length of %d bytes exceeds remaining frame length... | false | false | false | false | false | 0 |
Stage3end_indel_contains_known_splicesite (bool *leftp, bool *rightp, T this) {
/* indel + splice => requires gmap */
*leftp = Substring_contains_known_splicesite(this->substring1);
*rightp = Substring_contains_known_splicesite(this->substring2);
if (*leftp == true || *rightp == true) {
return true;
} el... | false | false | false | false | false | 0 |
pp_c_constant (c_pretty_printer *pp, tree e)
{
const enum tree_code code = TREE_CODE (e);
switch (code)
{
case INTEGER_CST:
{
tree type = TREE_TYPE (e);
if (type == boolean_type_node)
pp_c_bool_constant (pp, e);
else if (type == char_type_node)
pp_c_charact... | false | false | false | false | false | 0 |
parseARMArch(StringRef ArchName) {
unsigned ISA = ARM::parseArchISA(ArchName);
unsigned ENDIAN = ARM::parseArchEndian(ArchName);
Triple::ArchType arch = Triple::UnknownArch;
switch (ENDIAN) {
case ARM::EK_LITTLE: {
switch (ISA) {
case ARM::IK_ARM:
arch = Triple::arm;
break;
case ARM::... | false | false | false | false | false | 0 |
makeHorizontalCorridor(int row, int col1, int col2) {
for (int i = col1; i <= col2; i++) {
auto & t = _map[row][i];
t->setPassable(true);
t->setTerrain(TERRAIN::CORRIDOR);
}
if (rand() % 10) { // 10% chance of an item in the corridor
_impl.addItem(row, col1, 1, col2 - col1 + 1... | false | false | false | false | false | 0 |
cmd_resize_halftone(gx_device_halftone **ppdht, uint num_comp,
gs_memory_t * mem)
{
int code = cmd_create_dev_ht(ppdht, mem);
gx_device_halftone *pdht = *ppdht;
if (code < 0)
return code;
if (num_comp != pdht->num_comp) {
gx_ht_order_component *pcomp;
/*
... | false | false | false | false | false | 0 |
url_treeview_url_clicked_cb (GtkWidget *view, GdkEventButton *event,
gpointer data)
{
GtkTreeIter iter;
gchar *url;
GtkTreeSelection *sel;
GtkTreePath *path;
GtkTreeView *tree = GTK_TREE_VIEW (view);
if (!event || !gtk_tree_view_get_path_at_pos (tree, event->x, event->y, &path, 0, 0,... | false | false | false | false | false | 0 |
_interpolate_trigger (GstTimedValueControlSource * self, GSequenceIter * iter,
GstClockTime timestamp)
{
GstControlPoint *cp;
gint64 tolerance = ((GstTriggerControlSource *) self)->priv->tolerance;
gboolean found = FALSE;
cp = g_sequence_get (iter);
if (GST_CLOCK_DIFF (cp->timestamp, timestamp) <= tolera... | false | false | false | false | false | 0 |
gdk_pixbuf__pnm_image_stop_load (gpointer data,
GError **error)
{
PnmLoaderContext *context = (PnmLoaderContext *) data;
gboolean retval = TRUE;
g_return_val_if_fail (context != NULL, TRUE);
if (context->pixbuf)
g_object_unref (context->pixbuf);
#if 0
/* We should ignore trailing newlines and we can't
... | false | false | false | false | false | 0 |
SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine,
unsigned short adaptnum, unsigned short DDCdatatype, unsigned char *buffer,
unsigned int VBFlags2)
{
unsigned char sr1f, cr17=1;
unsigned short result;
if(adaptnum > 2)
return 0xFFFF;
if(DDCdatatype ... | false | false | false | false | false | 0 |
xdr_dis_datum_spec_record(xdrs, objp)
XDR *xdrs;
dis_datum_spec_record *objp;
{
if (!xdr_byte_u_long(xdrs, &objp->num_fixed_data)) {
return (FALSE);
}
if (!xdr_byte_u_long(xdrs, &objp->num_variable_data)) {
return (FALSE);
}
if (!xdr_var_array(xdrs, (char **)&objp->fixed_datum,
objp->num_fixed_data, objp->... | false | false | false | false | false | 0 |
UpdateArmor()
{
float value = 0.0f;
float bonus_armor = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
Unit* owner = GetOwner();
// hunter and warlock pets gain 35% of owner's armor value
if (owner && (getPetType() == HUNTER_PET || (getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)))
... | false | false | false | false | false | 0 |
scsih_target_reset(struct scsi_cmnd *scmd)
{
struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host);
struct MPT3SAS_DEVICE *sas_device_priv_data;
struct _sas_device *sas_device = NULL;
u16 handle;
int r;
struct scsi_target *starget = scmd->device->sdev_target;
struct MPT3SAS_TARGET *target_priv_data = star... | false | false | false | false | false | 0 |
is_loaded_eval(CdlEvalContext& context, CdlExpression expr, const CdlSubexpression& subexpr, CdlSimpleValue& result)
{
CYG_REPORT_FUNCNAME("is_loaded_eval");
CYG_REPORT_FUNCARG4XV(&context, expr, &subexpr, &result);
CYG_PRECONDITION_CLASSOC(context);
CYG_PRECONDITION_CLASSC(expr);
CdlSubexpression ... | 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.