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 |
|---|---|---|---|---|---|---|
rhs_modpin_separable(struct expr_t *rhsx)
{
struct expr_t *catndp;
/* 1 bit ports never separable */
switch (rhsx->optyp) {
case ID: case GLBREF:
/* evan regs always separable */
break;
case PARTSEL:
break;
case LSB:
/* bsel not separable if array select */
if (rhsx->lu.x->lu.sy->el.enp->n_isa... | false | false | false | false | false | 0 |
setDefaults()
{
static char buff[100];
static const Fl_Menu_Item displayMenu[] = {
{"Transfer function", 0, (Fl_Callback *)chosendisplay_cb, (void *)TRANSFER_DSP},
{"Histogram", 0, (Fl_Callback *)chosendisplay_cb, (void *)HISTOGRAM_DSP},
{0}
};
dbgprintf("Setting up defaults for transfer panel\... | false | false | false | false | false | 0 |
IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
if (tag->getName() == "TextMaps") {
fTextMaps.setSize(tag->countChildren());
const pfPrcTag* child = tag->getFirstChild();
for (size_t i=0; i<fTextMaps.getSize(); i++) {
fTextMaps[i] = mgr->prcParseKey(child);
child ... | false | false | false | false | false | 0 |
print_sunrise_sunset(date_t todayGreg, int DST)
{
double xsunrise, xsunset;
int day_adj, status;
PrintGregDate (todayGreg);
status = suntime (&xsunrise, &xsunset, dayOfYear (todayGreg),
SUNRISE, SUNSET);
if (status & NO_SUNSET)
printf ("No sunset today.\n");
... | false | false | false | false | false | 0 |
next_group(unsigned char *group)
{
while (*group && *group!='=' && *group!=':')
++group;
if (*group=='=')
++group;
return group;
} | false | false | false | false | false | 0 |
jas_stream_gobble(jas_stream_t *stream, int n)
{
int m;
m = n;
for (m = n; m > 0; --m) {
if (jas_stream_getc(stream) == EOF) {
return n - m;
}
}
return n;
} | false | false | false | false | false | 0 |
remove_file(const char *service_id, const char *file)
{
gchar *pathname;
gboolean ret = FALSE;
pathname = g_strdup_printf("%s/%s/%s", STORAGEDIR, service_id, file);
if(pathname == NULL)
return FALSE;
if (g_file_test(pathname, G_FILE_TEST_EXISTS) == FALSE) {
ret = TRUE;
} else if (g_file_test(pathname, G_FIL... | false | false | false | false | false | 0 |
toPosition(int line,int col)
{
GtkTextIter iter;
if (line < 0) line=0;
if (col < 0) col=0;
gtk_text_buffer_get_end_iter(_buffer, &iter);
if (line > gtk_text_iter_get_line(&iter))
line = gtk_text_iter_get_line(&iter);
gtk_text_iter_set_line(&iter, line);
if (col > gtk_text_iter_get_line_offset(&iter))
c... | false | false | false | false | false | 0 |
balance_segment(photon_t **pbal, photon_t **porg,
const unsigned int index,
const unsigned int start,
const unsigned int end)
{
// Compute new median.
unsigned int median = 1;
while ((4 * median) <= (end - start + 1)) {
median += median;
}
if ((3 * median) <= (end - start + 1)) {
median += median;
me... | false | false | false | false | false | 0 |
ad799x_read_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir)
{
struct ad799x_state *st = iio_priv(indio_dev);
if (!(st->config & AD7998_ALERT_EN))
return 0;
if ((st->config >> AD799X_CHANNEL_SHIFT) & BIT(chan... | false | false | false | false | false | 0 |
read_conf_file(void)
{
const char *fn;
FILE *fp;
char buf[1024];
fn = anthy_conf_get_str("CONFFILE");
fp = fopen(fn, "r");
if (!fp){
anthy_log(0, "Failed to open %s\n", fn);
return ;
}
while(fgets(buf, 1024, fp)) {
if (buf[0] != '#') {
char var[1024], val[1024];
if (sscanf(buf, "... | false | false | false | false | false | 0 |
get_count(int *dim)
{
int i, size;
size = 1;
for (i = 0;; i++)
{
size *= dim[i];
if (size < 0)
{
size = (-size);
break;
}
}
return size;
} | false | false | false | false | false | 0 |
get_load_avg(
double loadv[],
int nelem
) {
char buffer[41];
int fd, count;
fd = open(LINUX_LOAD_SOURCE, O_RDONLY);
if (fd == -1) {
return -1;
}
count = read(fd, buffer, 40);
buffer[count] = '\0';
close(fd);
if (count <= 0) {
return -1;
}
count = sscanf(buffer, "%lf %lf %l... | false | false | false | false | false | 0 |
iiproto_param (pglobal, argc, argv, pvar, pinfo)
pointer pglobal;
int argc;
char **argv;
pointer pvar;
pointer pinfo;
{
struct sglobal *qglobal = (struct sglobal *) pglobal;
struct uuconf_proto_param **pqparam = (struct uuconf_proto_param **) pvar;
struct sinfo *qinfo = (struct sinfo *) p... | false | false | false | false | false | 0 |
choose_neighbour(int size, cdok_pos_t c)
{
int x = CDOK_POS_X(c);
int y = CDOK_POS_Y(c);
int xn = x + 1, yn = y + 1;
if (xn >= size || (x && (random() & 1)))
xn = x - 1;
if (yn >= size || (y && (random() & 1)))
yn = y - 1;
if (random() & 1)
return CDOK_POS(xn, y);
return CDOK_POS(x, yn);
} | false | false | false | false | false | 0 |
_ecore_con_ssl_server_shutdown_gnutls(Ecore_Con_Server *svr)
{
if (svr->session)
{
gnutls_bye(svr->session, GNUTLS_SHUT_RDWR);
gnutls_deinit(svr->session);
}
free(svr->cert_file);
svr->cert_file = NULL;
if (svr->cert)
gnutls_certificate_free_credentials(svr->cert);
svr->ce... | false | false | false | false | false | 0 |
SortBuffer(TCmpStruct * pWork, unsigned char * buffer_begin, unsigned char * buffer_end)
{
unsigned short * phash_to_index;
unsigned char * buffer_ptr;
unsigned short total_sum = 0;
unsigned long byte_pair_hash; // Hash value of the byte pair
unsigned short byte_pair_offs; ... | false | false | false | false | false | 0 |
mkp_scanner_new (MkpProject *project)
{
MkpScanner *scanner;
scanner = g_new0 (MkpScanner, 1);
mkp_mk_yylex_init(&scanner->scanner);
mkp_mk_yyset_extra (scanner, scanner->scanner);
scanner->project = project;
return scanner;
} | false | false | false | false | false | 0 |
udisks_daemon_launch_spawned_job (UDisksDaemon *daemon,
UDisksObject *object,
const gchar *job_operation,
uid_t job_started_by_uid,
GCancellable *cancellable,
... | false | false | false | false | false | 0 |
refreshDrugsBase()
{
d->m_initialized = false;
Q_EMIT drugsBaseIsAboutToChange();
// define is default drug sources (FR_AFSSAPS)
QString drugSource = settings()->value(Constants::S_SELECTED_DATABASE_FILENAME).toString();
if (drugSource == DrugsDB::Constants::DB_DEFAULT_IDENTIFIANT || drugSource.isE... | false | false | false | false | false | 0 |
radius_add_attribute(radius_packet *packet, uint8 type, const unsigned char *data, int len)
{
radius_attribute *attr;
if (packet->length + len > RADIUS_BUFFER_SIZE)
{
/*
* With remotely realistic data, this can never happen. But catch it
* just to make sure we don't overrun a buffer. We'll just skip adding
... | false | false | false | false | false | 0 |
dumptuples(Tuplesortstate *state, bool alltuples)
{
while (alltuples ||
(LACKMEM(state) && state->memtupcount > 1) ||
state->memtupcount >= state->memtupsize)
{
/*
* Dump the heap's frontmost entry, and sift up to remove it from the
* heap.
*/
Assert(state->memtupcount > 0);
WRITETUP(state, s... | false | false | false | false | false | 0 |
swf_mat_is_identity(GF_Matrix2D *mat)
{
if (mat->m[0] != FIX_ONE) return 0;
if (mat->m[4] != FIX_ONE) return 0;
if (mat->m[1]) return 0;
if (mat->m[2]) return 0;
if (mat->m[3]) return 0;
if (mat->m[5]) return 0;
return 1;
} | false | false | false | false | false | 0 |
setup(bool use_xidle)
{
ostringstream osstr;
osstr << "Setup " << use_xidle;
write_command(osstr.str());
} | false | false | false | false | false | 0 |
crmf_copy_cert_extension(PLArenaPool *poolp, CRMFCertExtension *inExtension)
{
PRBool isCritical;
SECOidTag id;
SECItem *data;
CRMFCertExtension *newExt;
PORT_Assert(inExtension != NULL);
if (inExtension == NULL) {
return NULL;
}
id = CRMF_... | false | false | false | false | false | 0 |
SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
::google::protobuf::uint8* raw_buffer = output->GetDirectBufferForNBytesAndAdvance(_cached_size_);
if (raw_buffer != NULL) {
DescriptorProto_ExtensionRange::SerializeWithCachedSizesToArray(raw_buffer);
return;
}
... | false | false | false | false | false | 0 |
AllowServerConnect(struct connectdata *conn, bool *connected)
{
struct SessionHandle *data = conn->data;
long timeout_ms;
CURLcode ret = CURLE_OK;
*connected = FALSE;
infof(data, "Preparing for accepting server on data port\n");
/* Save the time we start accepting server connect */
Curl_pgrsTime(data, T... | false | false | false | false | false | 0 |
nodeForUrl(const KUrl& _url) const // O(1), well, O(length of url as a string)
{
KUrl url = cleanupUrl(_url);
if (url == urlForNode(m_rootNode))
return m_rootNode;
return m_nodeHash.value(url);
} | false | false | false | false | false | 0 |
parse_hc_variant (const char *s)
{
int i;
check_for_state();
if (!strncmp(s, "hc", 2)) {
s += 2;
}
for (i=0; hc_version_strs[i] != NULL; i++) {
if (!strcmp(s, hc_version_strs[i])) {
state->ropts.hc_version = i;
return 0;
}
}
if (!strcmp(s, "4")) {
state->ropts.hc_version = ... | false | false | false | false | false | 0 |
output_cert(const CERTCertificate* cert, PRBool ascii, PRFileDesc *outfile) {
SECItem data;
PRInt32 num;
SECStatus rv = SECFailure;
data.data = cert->derCert.data;
data.len = cert->derCert.len;
if (ascii) {
PR_fprintf(outfile, "%s\n%s\n%s\n", NS_CERT_HEADER,
BTOA_DataToAsci... | false | false | false | false | false | 0 |
_e_fm2_region_free(E_Fm2_Region *rg)
{
E_Fm2_Icon *ic;
EINA_LIST_FREE(rg->list, ic)
ic->region = NULL;
free(rg);
} | false | false | false | false | false | 0 |
Devices_H_CountOpen(void)
{
int r = 0;
int i;
for (i = 0; i < 8; i++)
if (h_fp[i] != NULL)
r++;
return r;
} | false | false | false | false | false | 0 |
lto_output_toplevel_asms (void)
{
struct output_block *ob;
struct cgraph_asm_node *can;
char *section_name;
struct lto_output_stream *header_stream;
struct lto_asm_header header;
if (! cgraph_asm_nodes)
return;
ob = create_output_block (LTO_section_asm);
/* Make string 0 be a NULL string. */
s... | false | false | false | false | false | 0 |
CheckCallDriverV4(L9BYTE* Base,L9UINT32 Pos)
{
int i,j;
/* Look back for an assignment from a variable
* to list9[0], which is used to specify the
* driver call.
*/
for (i = 0; i < 2; i++)
{
int x = Pos - ((i+1)*3);
if ((Base[x] == 0x89) && (Base[x+1] == 0x00))
{
/* Get the variable bei... | false | false | false | false | false | 0 |
c8sectpfe_delete(struct c8sectpfe *c8sectpfe)
{
int i;
if (!c8sectpfe)
return;
for (i = 0; i < c8sectpfe->num_feeds; i++)
unregister_dvb(&c8sectpfe->demux[i]);
dvb_unregister_adapter(&c8sectpfe->adapter);
kfree(c8sectpfe);
} | false | false | false | false | false | 0 |
generate_uids_from_sequence (GPtrArray *uids,
guint32 begin_uid,
guint32 end_uid)
{
guint32 i;
for (i = begin_uid; i <= end_uid; i++)
g_ptr_array_add (uids, GUINT_TO_POINTER (i));
} | false | false | false | false | false | 0 |
tenEstimateThresholdSet(tenEstimateContext *tec,
double thresh, double soft) {
static const char me[]="tenEstimateThresholdSet";
if (!tec) {
biffAddf(TEN, "%s: got NULL pointer", me);
return 1;
}
if (!(AIR_EXISTS(thresh) && AIR_EXISTS(soft))) {
biffAddf(TEN, "%s: not both th... | false | false | false | false | false | 0 |
reg_loc_descriptor (rtx rtl, enum var_init_status initialized)
{
rtx regs;
if (REGNO (rtl) >= FIRST_PSEUDO_REGISTER)
return 0;
/* We only use "frame base" when we're sure we're talking about the
post-prologue local stack frame. We do this by *not* running
register elimination until this point, an... | false | false | false | false | false | 0 |
SetStyleAt(int position, char styleValue, char mask) {
styleValue &= mask;
char curVal = style.ValueAt(position);
if ((curVal & mask) != styleValue) {
style.SetValueAt(position, static_cast<char>((curVal & ~mask) | styleValue));
return true;
} else {
return false;
}
} | false | false | false | false | false | 0 |
audacious_get_tuple_field_data(DBusGProxy *proxy, gchar *field,
guint pos) {
GValue value = {0};
gchar *s = NULL;
org_atheme_audacious_song_tuple(proxy, pos, field, &value, &error);
g_clear_error(&error);
if (G_IS_VALUE(&value) == FALSE)
return NULL;
... | false | false | false | false | false | 0 |
peelInt() const {
if (is_empty()) return 0;
char buf[24];
bool started=false;
int j=0;
int i;
for (i=0;i<length();i++) {
if (started) {
if (isdigit(my_data->chars[i])) j++; //set coord
else break; //finished
}
else
if (isdigit(my_data->chars[i])) {
j++; star... | false | false | false | false | true | 1 |
configure(Vector<String> &conf, ErrorHandler *errh)
{
if (cp_va_kparse(conf, this, errh,
"SRC", cpkP+cpkM, cpIPAddress, &_src,
"DST", cpkP+cpkM, cpIPAddress, &_dst,
"IDENTIFIER", 0, cpUnsignedShort, &_icmp_id,
cpEnd) < 0)
return -1;
#if HAVE_FAST_CHECKSUM && FAST_CHECKSUM_ALIGNED
{... | false | false | false | false | false | 0 |
mono_dl_convert_flags (int flags)
{
int lflags = flags & MONO_DL_LOCAL? 0: RTLD_GLOBAL;
if (flags & MONO_DL_LAZY)
lflags |= RTLD_LAZY;
else
lflags |= RTLD_NOW;
return lflags;
} | false | false | false | false | false | 0 |
listing_source_line (unsigned int line)
{
if (listing)
{
new_frag ();
listing_tail->hll_line = line;
new_frag ();
}
} | false | false | false | false | false | 0 |
evd_peer_manager_cleanup_peers (EvdPeerManager *self)
{
if (g_timer_elapsed (self->priv->peer_cleanup_timer, NULL) <=
self->priv->peer_cleanup_interval)
return;
g_timer_start (self->priv->peer_cleanup_timer);
g_hash_table_foreach_remove (self->priv->peers,
evd_peer_manag... | false | false | false | false | false | 0 |
glade_gtk_action_post_create (GladeWidgetAdaptor *adaptor,
GObject *object,
GladeCreateReason reason)
{
GladeWidget *gwidget = glade_widget_get_from_gobject (object);
if (reason == GLADE_CREATE_REBUILD)
return;
if (!gtk_action_get_name (GTK_ACTION (object)))
glade_widget_proper... | false | false | false | false | false | 0 |
tip_back() const
{
static const char* back = "Back";
static const char* backto = "Back to ";
const char* backone = d_back.look_front();
if (!backone)
{
return back;
}
if (d_back_tip_ptr)
{
delete[] d_back_tip_ptr;
d_back_tip_ptr = 0;
}
d_back_tip_ptr = AiksaurusGTK_strConcat(backto, backone);
r... | false | false | false | false | false | 0 |
query_label(uint32_t mask, char *query, size_t size, int *allowed,
int *audited)
{
char buf[QUERY_LABEL_REPLY_LEN];
uint32_t allow, deny, audit, quiet;
int fd, ret, saved;
if (!mask || size <= AA_QUERY_CMD_LABEL_SIZE) {
errno = EINVAL;
return -1;
}
ret = pthread_once(&aafs_access_control, aafs_access_init... | true | true | false | false | true | 1 |
unit(Point3D* p)
{
gdouble len = length(p);
if(len != 0)
{
p->x /= len;
p->y /= len;
p->z /= len;
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
selinux_sem_semop(struct sem_array *sma,
struct sembuf *sops, unsigned nsops, int alter)
{
u32 perms;
if (alter)
perms = SEM__READ | SEM__WRITE;
else
perms = SEM__READ;
return ipc_has_perm(&sma->sem_perm, perms);
} | false | false | false | false | false | 0 |
vrrp_prio_handler(vector_t *strvec)
{
vrrp_rt *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
vrrp->effective_priority = vrrp->base_priority = atoi(vector_slot(strvec, 1));
if (VRRP_IS_BAD_PRIORITY(vrrp->base_priority)) {
log_message(LOG_INFO, "VRRP Error : Priority not valid !");
log_message(LOG_INFO,
" ... | false | false | false | false | false | 0 |
load_module(void)
{
int i;
ast_format_set(&slin_f.format, AST_FORMAT_SLINEAR, 0);
ast_format_set(&slin12_f.format, AST_FORMAT_SLINEAR12, 0);
ast_format_set(&slin16_f.format, AST_FORMAT_SLINEAR16, 0);
ast_format_set(&slin24_f.format, AST_FORMAT_SLINEAR24, 0);
ast_format_set(&slin32_f.format, AST_FORMAT_SLINEAR32, ... | false | false | false | false | false | 0 |
set_etypes (krb5_context context,
const char *name,
krb5_enctype **ret_enctypes)
{
char **etypes_str;
krb5_enctype *etypes = NULL;
etypes_str = krb5_config_get_strings(context, NULL, "libdefaults",
name, NULL);
if(etypes_str){
int i, j, k;
for(i = 0; etypes_str[i]; i++);
etypes = mal... | false | false | false | false | false | 0 |
verify_dir_is_empty_or_create(char *dirname)
{
switch (pg_check_dir(dirname))
{
case 0:
/*
* Does not exist, so create
*/
if (pg_mkdir_p(dirname, S_IRWXU) == -1)
{
fprintf(stderr,
_("%s: could not create directory \"%s\": %s\n"),
progname, dirname, strerror(errno));
disconnect_... | false | false | false | false | false | 0 |
free_pcolors(PCOLORS **colors)
{
if (*colors){
if ((*colors)->tbcp)
free_color_pair(&(*colors)->tbcp);
if ((*colors)->kncp)
free_color_pair(&(*colors)->kncp);
if ((*colors)->klcp)
free_color_pair(&(*colors)->klcp);
if ((*colors)->stcp)
free_color_pair(&(*colors)->stcp);
if ((*colors)->prcp)
... | false | false | false | false | false | 0 |
php_stream_ftp_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC)
{
php_stream *stream = NULL;
php_url *resource = NULL;
int result;
char tmp_line[512];
stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC);
if (!st... | false | false | false | false | false | 0 |
cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb)
{
struct cc2520_private *priv = hw->priv;
unsigned long flags;
int rc;
u8 status = 0;
rc = cc2520_cmd_strobe(priv, CC2520_CMD_SFLUSHTX);
if (rc)
goto err_tx;
rc = cc2520_write_txfifo(priv, skb->data, skb->len);
if (rc)
goto err_tx;
rc = cc2520_get... | false | false | false | false | false | 0 |
init_cpu_counters(struct hfi1_devdata *dd)
{
struct hfi1_pportdata *ppd;
int i;
ppd = (struct hfi1_pportdata *)(dd + 1);
for (i = 0; i < dd->num_pports; i++, ppd++) {
ppd->ibport_data.rc_acks = NULL;
ppd->ibport_data.rc_qacks = NULL;
ppd->ibport_data.rc_acks = alloc_percpu(u64);
ppd->ibport_data.rc_qacks =... | false | false | false | false | false | 0 |
parse_factors(struct webauth_context *ctx, apr_xml_elem *root,
const struct webauth_factors **result, time_t *expiration,
time_t *valid_threshold)
{
apr_xml_elem *child;
apr_array_header_t *factors = NULL;
const char **type, *content;
unsigned long value;
int s;
/* E... | false | false | false | false | false | 0 |
__rtl_set_wol(struct r8152 *tp, u32 wolopts)
{
u32 ocp_data;
ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG);
ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34);
ocp_data &= ~LINK_ON_WAKE_EN;
if (wolopts & WAKE_PHY)
ocp_data |= LINK_ON_WAKE_EN;
ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG34, ... | false | false | false | false | false | 0 |
compute_diff(VMG_ vm_val_t *val1, vm_val_t *val2)
{
/* the meaning of "subtract" depends on the type of the first operand */
switch(val1->typ)
{
case VM_LIST:
/*
* list constant - remove the second value from the list, using
* the static list subtraction method
... | false | false | false | false | false | 0 |
sge_get_com_error_flag(u_long32 progid, sge_gdi_stored_com_error_t error_type, bool reset_error_flag) {
bool ret_val = false;
DENTER(GDI_LAYER, "sge_get_com_error_flag");
sge_mutex_lock("general_communication_error_mutex",
SGE_FUNC, __LINE__, &general_communication_error_mutex);
/*
... | false | false | false | false | false | 0 |
qt2_read_bulk_callback(struct urb *urb)
{
struct usb_serial *serial = urb->context;
int status;
if (urb->status) {
dev_warn(&serial->dev->dev,
"%s - non-zero urb status: %i\n", __func__,
urb->status);
return;
}
qt2_process_read_urb(urb);
status = usb_submit_urb(urb, GFP_ATOMIC);
if (status != 0)
... | false | false | false | false | false | 0 |
open_all(void)
{
SIG_ENTITY *sig,*purge;
if (kernel == -1) kernel = open_kernel();
if (kernel < 0) return -1;
for (sig = entities; sig; sig = sig->next) {
sig->signaling = open_signaling(sig);
if (sig->signaling < 0) {
for (purge = entities; purge != sig; purge = purge->next)
close_signaling(p... | false | false | false | false | false | 0 |
__get_free_pages(gfp_t gfp_mask, unsigned int order)
{
struct page *page;
/*
* __get_free_pages() returns a 32-bit address, which cannot represent
* a highmem page
*/
VM_BUG_ON((gfp_mask & __GFP_HIGHMEM) != 0);
page = alloc_pages(gfp_mask, order);
if (!page)
return 0;
return (unsigned long) page_address... | false | false | false | false | false | 0 |
ptrace_get_debugreg(struct task_struct *tsk, int n)
{
struct thread_struct *thread = &tsk->thread;
unsigned long val = 0;
if (n < HBP_NUM) {
struct perf_event *bp = thread->ptrace_bps[n];
if (bp)
val = bp->hw.info.address;
} else if (n == 6) {
val = thread->debugreg6;
} else if (n == 7) {
val = thread... | false | false | false | false | false | 0 |
hostset_insert(hostset_t set, const char *hosts)
{
int i, n = 0;
hostlist_t hl = hostlist_create(hosts);
if (!hl)
return 0;
hostlist_uniq(hl);
LOCK_HOSTLIST(set->hl);
for (i = 0; i < hl->nranges; i++)
n += hostset_insert_range(set, hl->hr[i]);
UNLOCK_HOSTLIST(set->hl);
hostlist_destroy(hl);
return n;
} | false | false | false | false | false | 0 |
rawwopen()
{
struct rawheader rh;
int fd;
/*
** check if the file exists already
*/
if ( (fd = open(rawname, O_RDWR)) >= 0)
{
/*
** read and verify header record
*/
if ( read(fd, &rh, sizeof rh) < sizeof rh)
{
fprintf(stderr, "%s - cannot read header\n", rawname);
cleanstop(7);
}
if (rh.m... | false | false | false | false | false | 0 |
sub(int row,const HepSymMatrix &m1)
{
if(row <1 || row+m1.num_row()-1 > num_row() )
error("HepSymMatrix::sub: Index out of range");
HepMatrix::mcIter a = m1.m.begin();
HepMatrix::mIter b1 = m.begin() + (row+2)*(row-1)/2;
int rowsize=m1.num_row();
for(int irow=1; irow<=rowsize; ++irow) {
HepMatrix::mIt... | false | false | false | false | false | 0 |
tail_walk_str (const Tail *t,
TrieIndex s,
short *suffix_idx,
const TrieChar *str,
int len)
{
const TrieChar *suffix;
int i;
short j;
suffix = tail_get_suffix (t, s);
if (!suff... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
bool ok = true;
FILE *fout;
if(argc != 3) {
fprintf(stderr, "usage: %s infile.flac outfile.wav\n", argv[0]);
return 1;
}
if((fout = fopen(argv[2], "wb")) == NULL) {
fprintf(stderr, "ERROR: opening %s for output\n", argv[2]);
return 1;
}
OurDecoder decoder(fout);
if(!de... | false | false | false | false | true | 1 |
setValue(int id, const char* value)
{
xmlNode* el = getElementById(id);
if(el != NULL)
{
xmlSetProp(el, (xmlChar*)"value", (xmlChar*)value);
//this->setOverride(el, true);
//xmlSaveFormatFileEnc("-", doc, "UTF-8", 1); // debugging ;-)
}
else
std::cout << "error: element " << id << " not found!... | false | false | false | false | false | 0 |
mprSetItem(MprList *lp, int index, cvoid *item)
{
void *old;
int length;
mprAssert(lp);
mprAssert(lp->capacity >= 0);
mprAssert(lp->length >= 0);
mprAssert(index >= 0);
length = lp->length;
if (index >= length) {
length = index + 1;
}
lock(lp);
if (length > ... | false | false | false | true | false | 1 |
just_y(FXint& ty,FXint& iy,FXint th,FXint ih){
if((options&JUSTIFY_TOP) && (options&JUSTIFY_BOTTOM)){
if(options&ICON_ABOVE_TEXT){ iy=padtop+border; ty=height-padbottom-border-th; }
else if(options&ICON_BELOW_TEXT){ ty=padtop+border; iy=height-padbottom-border-ih; }
else{ iy=border+padtop; ty=border+padto... | false | false | false | false | false | 0 |
list_swapnodes(List_node *node0,List_node *node1) {
List_node *tmp;
if (node0->next == node1) {
node0->next = node1->next;
node1->next = node0;
tmp = node0->prev;
node0->prev = node1;
node1->prev = tmp;
} else if (node1->next == node0) {
node1->next = node0->next;
node0->next = node... | false | false | false | false | false | 0 |
showoccratios(const GtArrayuint64_t *uniquedistribution,
const GtArrayuint64_t *nonuniquedistribution,
const GtArrayuint64_t *nonuniquemultidistribution,
unsigned int outputmode,
const GtBitsequence *outputvector)
{
... | false | false | false | false | false | 0 |
diff_blame_line(const char *ref, const char *file, unsigned long lineno,
struct blame_header *header, struct blame_commit *commit)
{
char line_arg[SIZEOF_STR];
const char *blame_argv[] = {
"git", "blame", ENCODING_ARG, "-p", line_arg, ref, "--", file, NULL
};
struct io io;
bool ok = FALSE;
char *buf;
if (!s... | false | false | false | false | false | 0 |
concat_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t * retlen, const u_char * buf)
{
struct mtd_concat *concat = CONCAT(mtd);
int err = -EINVAL;
int i;
for (i = 0; i < concat->num_subdev; i++) {
struct mtd_info *subdev = concat->subdev[i];
size_t size, retsize;
if (to >= subdev->size) {
... | false | false | false | false | false | 0 |
_rtw_init_stainfo(struct sta_info *psta)
{
memset((u8 *)psta, 0, sizeof(struct sta_info));
spin_lock_init(&psta->lock);
INIT_LIST_HEAD(&psta->list);
INIT_LIST_HEAD(&psta->hash_list);
_rtw_init_queue(&psta->sleep_q);
psta->sleepq_len = 0;
_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
_rtw_init_sta_recv_priv(&... | false | false | false | false | false | 0 |
dw_mci_exynos_get_best_clksmpl(u8 candiates)
{
const u8 iter = 8;
u8 __c;
s8 i, loc = -1;
for (i = 0; i < iter; i++) {
__c = ror8(candiates, i);
if ((__c & 0xc7) == 0xc7) {
loc = i;
goto out;
}
}
for (i = 0; i < iter; i++) {
__c = ror8(candiates, i);
if ((__c & 0x83) == 0x83) {
loc = i;
go... | false | false | false | false | false | 0 |
handle_subscript(arg, rettv, evaluate, verbose)
char_u **arg;
typval_T *rettv;
int evaluate; /* do more than finding the end */
int verbose; /* give error messages */
{
int ret = OK;
dict_T *selfdict = NULL;
char_u *s;
int len;
typval_T functv;
while (ret == OK
&& (**ar... | false | false | false | false | false | 0 |
cuddZddChangeAux(
DdManager * zdd,
DdNode * P,
DdNode * zvar)
{
int top_var, level;
DdNode *res, *t, *e;
DdNode *base = DD_ONE(zdd);
DdNode *empty = DD_ZERO(zdd);
statLine(zdd);
if (P == empty)
return(empty);
if (P == base)
return(zvar);
/* Check cache. */
res = cuddCacheL... | false | false | false | false | false | 0 |
phase1(u16 *p1k, const u8 *tk, const u8 *ta, u32 iv32)
{
int i;
/* Initialize the 80 bits of P1K[] from IV32 and TA[0..5] */
p1k[0] = Lo16(iv32);
p1k[1] = Hi16(iv32);
p1k[2] = Mk16(ta[1], ta[0]); /* use TA[] as little-endian */
p1k[3] = Mk16(ta[3], ta[2]);
p1k[4] = Mk16(ta[5], ta[4]... | false | false | false | false | false | 0 |
IN_AXIb(bxInstruction_c *i)
{
unsigned port = i->Ib();
if (! allow_io(i, port, 2)) {
BX_DEBUG(("IN_AXIb: I/O access not allowed !"));
exception(BX_GP_EXCEPTION, 0, 0);
}
AX = BX_INP(port, 2);
} | false | false | false | false | false | 0 |
slset_contains(const struct slset *haystack, const void *needle)
{
struct slset_entry *i;
CHECK_FUNC_ADDR(haystack->compare);
for (i = haystack->first; i != NULL; i = i->next) {
int cmp = haystack->compare(i->data, needle);
if (cmp == 0) {
return true;
}
if (cmp > 0) {
/* already past element */
... | false | false | false | false | false | 0 |
ompfbe_mpi_task_write_pg_comm_module(fsbe_context *cx)
{
int total_pe;
Hmdf_table *p;
Pe_in_pg *pe_in_pg;
p = ompfbe_mpi_task_search_inner_hmdf_for_module(module_head);
total_pe = p->pe_num * p->pc_num * p->clustering_num;
ompfbe_iprintf(cx, "SUBROUTINE OSCAR_MPI_GEN_PG_COMM\n");
fsbe_prin... | false | false | false | false | false | 0 |
mca_pml_bfo_recv_request_recverrnotify(mca_pml_bfo_recv_request_t* recvreq,
mca_btl_base_tag_t tag, int status)
{
mca_btl_base_descriptor_t* des;
mca_pml_bfo_restart_hdr_t* restart;
ompi_proc_t* proc = (ompi_proc_t*)recvreq->req_recv.req_base.req_proc;
mca_bml... | false | false | false | false | false | 0 |
vorbis_pump_first_frame(stb_vorbis *f)
{
int len, right, left;
if (vorbis_decode_packet(f, &len, &left, &right))
vorbis_finish_frame(f, len, left, right);
} | false | false | false | false | false | 0 |
prepareToPlay()
{
if( d->realTrack )
d->realTrack->prepareToPlay();
} | false | false | false | false | false | 0 |
queue_vertical_redraw (GxFastMeter* fm, GdkWindow* win)
{
GdkRectangle rect;
if (!fm->pixbuf) {
return;
}
int height = gdk_pixbuf_get_height(fm->pixbuf);
int width = gdk_pixbuf_get_width(fm->pixbuf);
gint new_top = (gint)floor(height * fm->current_level);
rect.x = 0;
rect.width = width;
rect.height = ... | false | false | false | false | false | 0 |
pthread_timer_get_event(int handle)
{
struct pthread_timer *timer;
enum ast_timer_event res = AST_TIMING_EVENT_EXPIRED;
if (!(timer = find_timer(handle, 0))) {
return res;
}
ao2_lock(timer);
if (timer->continuous) {
res = AST_TIMING_EVENT_CONTINUOUS;
}
ao2_unlock(timer);
ao2_ref(timer, -1);
return res... | false | false | false | false | false | 0 |
ParseAddress(vAttr &adr, Barry::PostalAddress &address)
{
// RFC 2426, 3.2.1
address.Address3 = adr.GetValue(0); // PO Box
address.Address2 = adr.GetValue(1); // Extended address
address.Address1 = adr.GetValue(2); // Street address
address.City = adr.GetValue(3); // Locality (city)
address.Province = adr.Ge... | false | false | false | false | false | 0 |
_ecore_fps_debug_shutdown(void)
{
_ecore_fps_debug_init_count--;
if (_ecore_fps_debug_init_count > 0) return;
if (_ecore_fps_debug_fd >= 0)
{
char buf[4096];
const char *tmp;
int pid;
#ifndef HAVE_EVIL
tmp = "/tmp";
#else
tmp = (char *)evil_tmpdir_get ();
#endif /*... | false | false | false | false | false | 0 |
createNorm(uint32_t code) {
Norm *p;
uint32_t i;
i=utrie_get32(normTrie, (UChar32)code, NULL);
if(i!=0) {
p=norms+i;
} else {
/* allocate Norm */
p=allocNorm();
if(!utrie_set32(normTrie, (UChar32)code, (uint32_t)(p-norms))) {
fprintf(stderr, "error: too m... | false | false | false | false | false | 0 |
mlx4_hca_core_clock_update(struct mlx4_dev *dev)
{
struct mlx4_cmd_mailbox *mailbox;
__be32 *outbox;
int err;
mailbox = mlx4_alloc_cmd_mailbox(dev);
if (IS_ERR(mailbox)) {
mlx4_warn(dev, "hca_core_clock mailbox allocation failed\n");
return PTR_ERR(mailbox);
}
outbox = mailbox->buf;
err = mlx4_cmd_box(dev... | false | false | false | false | false | 0 |
my_handler(int signr, siginfo_t *siginfo, void *context)
{
int saved_errno = errno;
cri_info_t *info = cri_info_location(); // thread-specific
cri_checkpoint_info_init(info);
// Simply enter the PENDING state
// The thread will then wake up and run the callback(s)
if (cri_cmp_swap(&info->cr_st... | false | false | false | false | false | 0 |
shutdown_uinput(void) {
#ifdef UINPUT_OK
if (fd >= 0) {
if (db) {
rfbLog("shutdown_uinput called on fd=%d\n", fd);
}
ioctl(fd, UI_DEV_DESTROY);
close(fd);
fd = -1;
}
/* close direct injection files too: */
if (direct_rel_fd >= 0) close(direct_rel_fd);
if (direct_abs_fd >= 0) close(direct_abs_fd);
if... | false | false | false | false | false | 0 |
arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
rtx value, rtx model_rtx, rtx cond)
{
enum memmodel model = (enum memmodel) INTVAL (model_rtx);
enum machine_mode mode = GET_MODE (mem);
enum machine_mode wmode = (mode == DImode ? DImode : SImode);
rtx label, x;
arm_pre_atomi... | true | true | false | false | false | 1 |
surewarehk_rand_bytes(unsigned char *buf, int num)
{
int ret=0;
char msg[64]="ENGINE_rand_bytes";
if(!p_surewarehk_Rand_Bytes)
{
SUREWAREerr(SUREWARE_F_SUREWAREHK_RAND_BYTES,ENGINE_R_NOT_INITIALISED);
}
else
{
ret = p_surewarehk_Rand_Bytes(msg,buf, num);
surewarehk_error_handling(msg,SUREWARE_F_SUREWAREHK_... | false | false | false | false | false | 0 |
decode(XMLNode node) {
if(!node) return;
// A lot of TODOs
if((node.Size() == 0) && ((std::string)node).empty()) {
XMLNode href = node.Attribute("href");
if((bool)href) {
std::string id = href;
if(id[0] == '#') {
id = id.substr(1);
if(!id.empty()) {
// Looking for co... | 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.