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 |
|---|---|---|---|---|---|---|
velocity_mii_read ( struct mii_interface *mii, unsigned int reg ) {
struct velocity_nic *vlc =
container_of ( mii, struct velocity_nic, mii );
int timeout = VELOCITY_TIMEOUT_US;
int result;
DBGC2 ( vlc, "VELOCITY %p MII read reg %d\n", vlc, reg );
/* Disable autopolling before we can access MII */
velocity_au... | false | false | false | false | false | 0 |
HexPairValue(const char * code) {
int value = 0;
const char * pch = code;
for (;;) {
int digit = *pch++;
if (digit >= '0' && digit <= '9') {
value += digit - '0';
}
else if (digit >= 'A' && digit <= 'F') {
value += digit - 'A' + 10;
}
else if (digit >= 'a' && digit <= 'f') {
... | false | false | false | false | false | 0 |
fprint_bar(FILE * file, double value, int radius)
{
int i,c;
for (i=0; i<radius*2+1; i++) {
if (i==radius) c='|';
else if ((i<radius && value*radius<i-radius+0.25) ||
(i>radius && value*radius>i-radius-0.25)) c='*';
else if ((i<radius && value*radius<i-radius+0.75) ||
(i>radius && value*r... | false | false | false | false | false | 0 |
vmw_context_cotable(struct vmw_resource *ctx,
SVGACOTableType cotable_type)
{
if (cotable_type >= SVGA_COTABLE_DX10_MAX)
return ERR_PTR(-EINVAL);
return vmw_resource_reference
(container_of(ctx, struct vmw_user_context, res)->
cotables[cotable_type]);
} | false | false | false | false | false | 0 |
ip6_dns_writer (GKeyFile *file,
const char *keyfile_dir,
const char *uuid,
NMSetting *setting,
const char *key,
const GValue *value)
{
GPtrArray *array;
GByteArray *byte_array;
char **list;
int i, num = 0;
g_return_if_fail (G_VALUE_HO... | false | false | false | false | false | 0 |
setCairoColor(cairo_t *cr, const gchar *filter, const gchar *data)
{
VisuElement *ele;
gchar *tmp;
const gchar *name;
if (!filter)
name = data;
else
{
tmp = g_strdup_printf("%s"SPACER, filter);
name = data + strlen(tmp);
g_free(tmp);
}
ele = visu_element_lookup(name);
if (e... | false | false | false | false | false | 0 |
dropNames()
{
lengthNames_ = 0;
rowNames_ = std::vector<std::string> ();
columnNames_ = std::vector<std::string> ();
} | false | false | false | false | false | 0 |
_e_wid_focus_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
if (!obj) return;
if (!(wd = e_widget_data_get(obj))) return;
if (e_widget_focus_get(obj))
{
edje_object_signal_emit(wd->o_base, "e,state,focused", "e");
evas_object_focus_set(obj, EINA_TRUE);
}
else
{
edje_o... | false | false | false | false | false | 0 |
gst_pinch_set_property (GObject * object, guint prop_id, const GValue * value,
GParamSpec * pspec)
{
GstPinch *pinch;
GstGeometricTransform *gt;
gdouble v;
gt = GST_GEOMETRIC_TRANSFORM_CAST (object);
pinch = GST_PINCH_CAST (object);
GST_OBJECT_LOCK (gt);
switch (prop_id) {
case PROP_INTENSITY:
... | false | false | false | false | false | 0 |
krb5_crypto_get_checksum_type(krb5_context context,
krb5_crypto crypto,
krb5_cksumtype *type)
{
struct _krb5_checksum_type *ct = NULL;
if (crypto != NULL) {
ct = crypto->et->keyed_checksum;
if (ct == NULL)
ct = crypto->et->checksum;
}
... | false | false | false | false | false | 0 |
toXml() const
{
QDomDocument doc;
// Create the main description tag
QDomElement root = doc.createElement(m_RootTag);
doc.appendChild(root);
if (!toDomElement(&root, &doc)) {
LOG_ERROR_FOR("GenericDescription", "Unable to generate XML code");
}
return doc.toString(2);
} | false | false | false | false | false | 0 |
Ns_ListFree(Ns_List *lPtr, Ns_ElemVoidProc *freeProc)
{
Ns_List *nextPtr;
for (; lPtr != NULL; lPtr = nextPtr) {
nextPtr = lPtr->rest;
if (freeProc != NULL) {
(*freeProc) (lPtr->first);
}
ns_free(lPtr);
}
} | false | false | false | false | false | 0 |
get_params(struct opt_def *opt_defs, int argc, char **argv) {
char optlst[256] = { '\0' };
struct opt_def *opt_def_map[256];
size_t optlst_idx = 0;
struct opt_def *opt_l;
int ch;
memset( opt_def_map, 0, sizeof(opt_def_map) );
for( opt_l = opt_defs; opt_l && opt_l->optchr; ++opt_l ) {
if( opt_def_map[(unsigne... | true | true | false | false | true | 1 |
alloc_ip(struct ppp_t *ppp)
{
ppp->ses.ipv6 = ipdb_get_ipv6(&ppp->ses);
if (!ppp->ses.ipv6) {
if (gen_ipv6_item(&ppp->ses) < 0) {
log_ppp_warn("ppp: no free IPv6 address\n");
return IPV6CP_OPT_CLOSE;
}
}
if (!ppp->ses.ipv6->intf_id)
ppp->ses.ipv6->intf_id = generate_intf_id(ppp);
if (conf_check_exis... | false | false | false | false | false | 0 |
split_path(krb5_context context, const char *path, char **dirname_out,
char **filename_out)
{
krb5_error_code ret;
char *dirname, *filename;
*dirname_out = NULL;
*filename_out = NULL;
ret = k5_path_split(path, &dirname, &filename);
if (ret)
return ret;
if (*dirname == '\... | false | false | false | false | false | 0 |
utest_createScoreData(ESL_GETOPTS *go, ESL_RANDOMNESS *r )
{
char msg[] = "create MSVData unit test failed";
P7_HMM *hmm = NULL;
ESL_ALPHABET *abc = NULL;
P7_PROFILE *gm = NULL;
P7_OPROFILE *om = NULL;
P7_SCOREDATA *scoredata = NULL;
uint8_t s... | false | false | false | true | false | 1 |
sendCMER(int fd, int onOff)
{
char answer[100];
char cmd[64];
char * cmer = getAT_CMER(onOff);
if (cmer == NULL) {
return EXIT_NOK;
}
strcpy(cmd,cmer);
free(cmer);
strcat(cmd,"\r");
//sendSyncCommand(cmd, answer, sizeof(answer), NULL);
writeAtCommand (fd, cmd, answer, ... | true | true | false | false | false | 1 |
internal_syscall(struct tcb *tcp)
{
/*
* We must always trace a few critical system calls in order to
* correctly support following forks in the presence of tracing
* qualifiers.
*/
int (*func)();
if (tcp->scno < 0 || tcp->scno >= nsyscalls)
return 0;
func = sysent[tcp->scno].sys_func;
if (sys_exit ==... | false | false | false | false | false | 0 |
mmrot3_(register char *a, register char *b, register char *c, int mmkind, size_t size, size_t high, size_t low)
{
register int s;
if (mmkind >= 0) {
if (mmkind > 0) {
register char *t = a + high;
do {
s = A[0]; A[0] = B[0]; B[0] = C[0]; C[0] = s;
s = A[1]; A[1] = B[1]; B[1] = C[1]; C[1] = s... | false | false | false | false | false | 0 |
cogorc_convert_Y42B_AYUV (orc_uint64 * ORC_RESTRICT d1, int d1_stride, const orc_uint16 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, int n, int m)
{
OrcExecutor _ex, *ex = &_ex;
static volatile int p_inited = 0;
static OrcPro... | false | false | false | false | false | 0 |
fatal_error(const char* msg, cell tagged) {
if (factor_vm::fatal_erroring_p)
fa_diddly_atal_error();
factor_vm::fatal_erroring_p = true;
std::cout << "fatal_error: " << msg;
std::cout << ": " << (void*)tagged;
std::cout << std::endl;
abort();
} | false | false | false | false | false | 0 |
_HandleAuthChallengeOpcode(WorldPacket& recvPacket)
{
//Read Packet
uint32 sp, serverseed;
if(GetInstance()->GetConf()->client > CLIENT_TBC)
{
recvPacket >> sp;
}
recvPacket >> serverseed;
// Do stuff with the data
std::string acc = stringToUpper(GetInstance()->GetConf()->accname)... | false | false | false | false | false | 0 |
numColumns(void) const
{ return (model()==0)?0:((AplusModel*) model())->charLength(); } | false | false | false | false | false | 0 |
xlog_find_verify_cycle(
struct xlog *log,
xfs_daddr_t start_blk,
int nbblks,
uint stop_on_cycle_no,
xfs_daddr_t *new_blk)
{
xfs_daddr_t i, j;
uint cycle;
xfs_buf_t *bp;
xfs_daddr_t bufblks;
char *buf = NULL;
int error = 0;
/*
* Greedily allocate a buffer big enough to handle the full
* range of ba... | false | false | false | false | false | 0 |
indexOfChild(const FXWindow *window) const {
register FXint index=0;
if(!window || window->parent!=this) return -1;
while(window->prev){
window=window->prev;
index++;
}
return index;
} | false | false | false | false | false | 0 |
goo_canvas_item_model_set_child_properties_valist (GooCanvasItemModel *model,
GooCanvasItemModel *child,
va_list var_args)
{
g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model));
g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (child));
_goo_canvas_item_set_child_properties_internal ((GObject*... | false | false | false | false | false | 0 |
notify ()
{
// Send the result pointer through the pipe.
char char_send = 0;
ssize_t ret_val = ACE::send (this->pipe_.write_handle (),
&char_send,
sizeof (char_send));
if (ret_val < 0)
{
if (errno != EWOULDBLOCK)
#if 0
ACE_ERROR ((... | false | false | false | false | false | 0 |
avrcp_handle_set_player_value(struct avrcp_player *player,
struct avrcp_header *pdu,
uint8_t transaction)
{
uint16_t len = ntohs(pdu->params_len);
unsigned int i;
uint8_t *param;
if (len < 3 || len > 2 * pdu->params[0] + 1U)
goto err;
/*
* From sec. 5.7 of AVRCP 1.3 spec, we should igore non-exis... | false | false | false | false | false | 0 |
RP_ReadStream(RTPStream *ch)
{
u32 size, tot_size;
if (!ch->rtp_ch) return;
/*NOTE: A weird bug on windows wrt to select(): if both RTP and RTCP are in the same loop
there is a hudge packet drop on RTP. We therefore split RTP and RTCP reading, this is not a big
deal as the RTCP traffic is far less than RTP, and ... | false | false | false | false | false | 0 |
set_realm_hash(ioa_socket_handle s, u08bits *realm)
{
if(s) {
if(realm && realm[0]) {
s->realm_hash = string_hash(realm);
}
}
} | false | false | false | false | false | 0 |
search_for_transaction ( GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer *pointers )
{
gint current_number;
gtk_tree_model_get ( GTK_TREE_MODEL(model), iter,
META_TREE_POINTER_COLUMN, ¤t_number,
-1 );
... | false | false | false | false | false | 0 |
reselect(void)
{
MSMenuItem *smi=menuItem(selectedItem());
if (smi!=0&&smi->cascade()==MSTrue)
{
MSMenu *cas=smi->cascadedMenu();
if (cas!=0)
{
MSMenuItem *scmi=cas->menuItem(cas->selectedItem());
if (scmi!=0)
{
scmi->disarm();
cas->undrawSelectedItem();
cas->selectedItem(-1);
}... | false | false | false | false | false | 0 |
IoHttpParser_setRequestPath_givenSize_(void *data, const unsigned char * buffer, size_t bufferSize)
{
IoHttpParser *self = (IoHttpParser *)data;
if(bufferSize > MAX_REQUEST_PATH_LENGTH)
{
HttpParser *parser = PARSER(self);
HttpParser_setParseError_(parser, "requestPath is longer than the allowed length of %d b... | false | false | false | false | false | 0 |
FCEUI_ListBreakPoints(int (*callb)(int type, unsigned int A1, unsigned int A2,
void (*Handler)(X6502 *, int type, unsigned int A) ))
{
BPOINT *tmp;
tmp=BreakPoints;
while(tmp)
{
callb(tmp->type,tmp->A[0],tmp->A[1],tmp->Handler);
tmp=tmp->next;
}
return(1);
} | false | false | false | false | false | 0 |
handle_local_job_done (CS *c, Msg *_m)
{
JobLocalDoneMsg *m = dynamic_cast<JobLocalDoneMsg *>(_m);
if (!m)
return false;
trace() << "handle_local_job_done " << m->job_id << endl;
notify_monitors (new JobLocalDoneMsg( c->client_map[m->job_id] ) );
c->client_map.erase( m->job_id );
return true;
} | false | false | false | false | false | 0 |
gth_image_print_job_set_selected_zoom (GthImagePrintJob *self,
double zoom)
{
double x, y;
self->priv->selected->zoom = CLAMP (zoom, 0.0, 1.0);
self->priv->selected->image_box.width = self->priv->selected->maximized_box.width * self->priv->selected->zoom;
self->priv->selected->image_box.heigh... | false | false | false | false | false | 0 |
acpi_db_get_history_by_index(u32 cmd_num)
{
u32 i;
u16 history_index;
/* Search history buffer */
history_index = acpi_gbl_lo_history;
for (i = 0; i < acpi_gbl_num_history; i++) {
if (acpi_gbl_history_buffer[history_index].cmd_num == cmd_num) {
/* Found the command, return it */
return (acpi_gbl_histor... | false | false | false | false | false | 0 |
squid_rn_search_m(void *v_arg, struct squid_radix_node *head, void *m_arg)
{
register struct squid_radix_node *x;
register caddr_t v = v_arg, m = m_arg;
for (x = head; x->rn_b >= 0;) {
if ((x->rn_bmask & m[x->rn_off]) &&
(x->rn_bmask & v[x->rn_off]))
x = x->rn_r;
else
x = x->rn_l;
}
... | false | false | false | false | false | 0 |
gst_smart_encoder_change_state (GstElement * element, GstStateChange transition)
{
GstSmartEncoder *smart_encoder;
GstStateChangeReturn ret;
g_return_val_if_fail (GST_IS_SMART_ENCODER (element),
GST_STATE_CHANGE_FAILURE);
smart_encoder = GST_SMART_ENCODER (element);
switch (transition) {
case GST... | false | false | false | false | false | 0 |
StringToValue( wxVariant& variant, const wxString& text, int WXUNUSED(argFlags) ) const
{
int value = 0;
if ( text.CmpNoCase(wxPGGlobalVars->m_boolChoices[1].GetText()) == 0 ||
text.CmpNoCase(wxT("true")) == 0 ||
text.CmpNoCase(m_label) == 0 )
value = 1;
if ( text.length() == 0 )
... | false | false | false | false | false | 0 |
ajSeqTypeExit(void)
{
ajuint i;
ajStrDel(&seqtypeTmpstr);
ajRegFree(&seqtypeRegAny);
ajRegFree(&seqtypeRegAnyGap);
ajRegFree(&seqtypeRegDnaGap);
ajRegFree(&seqtypeRegNuc);
ajRegFree(&seqtypeRegNucGap);
ajRegFree(&seqtypeRegNucPure);
ajRegFree(&seqtypeRegProt);
ajRegFree(&seqtyp... | false | false | false | false | false | 0 |
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__)
{
Instance *inst;
inst = gcc->data;
if (inst->pager->invert)
e_gadcon_client_aspect_set(gcc,
inst->pager->ynum * inst->pager->zone->w,
inst->pager->xnum * inst->pager->zone-... | false | false | false | false | false | 0 |
ap_method_list_remove(ap_method_list_t *l,
const char *method)
{
int methnum;
char **methods;
/*
* If it's a known methods, either builtin or registered
* by a module, use the bitmask.
*/
methnum = ap_method_number_of(method);
l->method_mask |= ... | false | false | false | false | false | 0 |
blankLine(char *line)
{
int i;
for (i = 0; line[i] != '\n' && line[i] != EOS; i++)
{
if (isdigit(line[i]) || isspace(line[i]) || (line[i] == '*') ||
(line[i] == ':') || (line[i] == '.'))
;
else
{
return false;
}
}
return true;
} | false | false | false | false | false | 0 |
parse_dcb_entry(struct drm_device *dev, void *data, int idx, u8 *outp)
{
struct nouveau_drm *drm = nouveau_drm(dev);
struct dcb_table *dcb = &drm->vbios.dcb;
u32 conf = (dcb->version >= 0x20) ? ROM32(outp[4]) : ROM32(outp[6]);
u32 conn = ROM32(outp[0]);
bool ret;
if (apply_dcb_encoder_quirks(dev, idx, &conn, &co... | false | false | false | false | false | 0 |
drm_arm_vblank_event(struct drm_device *dev, unsigned int pipe,
struct drm_pending_vblank_event *e)
{
assert_spin_locked(&dev->event_lock);
e->pipe = pipe;
e->event.sequence = drm_vblank_count(dev, pipe);
list_add_tail(&e->base.link, &dev->vblank_event_list);
} | false | false | false | false | false | 0 |
mousePressEvent(QMouseEvent *ev)
{
QListWidgetItem *item = itemAt(ev->pos());
if (item && ev->button()== Qt::LeftButton && ev->x() > 30) {
emit activated("active", IpeQ(item->text()));
}
QListWidget::mousePressEvent(ev);
} | false | false | false | false | false | 0 |
parseProperties(String &inBuffer, String &outBuffer, PropertyMap &properties)
{
outBuffer.clear();
outBuffer.reserve(inBuffer.size());
SubStringRef subString(&inBuffer, 0);
size_t pos = subString.find("@property");
bool syntaxError = false;
while (pos != String::npos && !syntaxError)
{
//Copy what ... | false | false | false | false | false | 0 |
f_confirm(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
char_u *message;
char_u *buttons = NULL;
char_u buf[NUMBUFLEN];
char_u buf2[NUMBUFLEN];
int def = 1;
int type = VIM_GENERIC;
char_u *typestr;
int error = FA... | false | false | false | false | false | 0 |
add_connpt_name_i(struct fpga_model *model, int y, int x,
str16_t name_i, int warn_dup, int *conn_point_o)
{
struct fpga_tile *tile;
int i;
RC_CHECK(model);
tile = YX_TILE(model, y, x);
// All destinations for a connection point must be under
// one unique entry for that connection point, so we
// first have ... | false | false | false | false | false | 0 |
gst_mpdparser_parse_s_node (GQueue * queue, xmlNode * a_node)
{
GstSNode *new_s_node;
new_s_node = g_slice_new0 (GstSNode);
if (new_s_node == NULL) {
GST_WARNING ("Allocation of S node failed!");
return;
}
g_queue_push_tail (queue, new_s_node);
GST_LOG ("attributes of S node:");
gst_mpdparser_ge... | false | false | false | false | false | 0 |
init() {
int len, fr, to;
arr.clear();
z.clear();
counts.clear();
z.resize(N1);
counts.resize(M + 1, 1); // 1 pseudo count
counts[0] += N0;
for (int i = 0; i < N1; i++) {
fr = s[i]; to = s[i + 1];
len = to - fr;
arr.resize(len);
for (int j = fr; j < to; j++) {
arr[j - fr] = theta[hits[j].sid] * hi... | false | false | false | false | false | 0 |
CDB___memp_cmpr_coefficient(dbenv)
DB_ENV *dbenv;
{
u_int8_t ret = 0;
if(!dbenv || !dbenv->mp_cmpr_info) {
ret = default_cmpr_info.coefficient;
} else {
CDB___memp_cmpr_info_valid(dbenv, dbenv->mp_cmpr_info);
ret = dbenv->mp_cmpr_info->coefficient;
}
return (ret);
} | false | false | false | false | false | 0 |
odf_validation_error_message (GsfXMLIn *xin, xmlChar const **attrs)
{
static OOEnum const message_styles [] = {
{ "information", GNM_VALIDATION_STYLE_INFO },
{ "stop", GNM_VALIDATION_STYLE_STOP },
{ "warning", GNM_VALIDATION_STYLE_WARNING },
{ NULL, 0 },
};
OOParseState *state = (OOParseState *)xin-... | false | false | false | false | false | 0 |
folder_item_clean_local_files(FolderItem *item, gint days)
{
cm_return_if_fail(item != NULL);
cm_return_if_fail(item->folder != NULL);
if (FOLDER_TYPE(item->folder) == F_IMAP ||
FOLDER_TYPE(item->folder) == F_NEWS) {
GSList *msglist = folder_item_get_msg_list(item);
GSList *cur;
time_t t = time(NULL);
... | false | false | false | false | false | 0 |
mtrr_del_page(int reg, unsigned long base, unsigned long size)
{
int i, max;
mtrr_type ltype;
unsigned long lbase, lsize;
int error = -EINVAL;
if (!mtrr_enabled())
return -ENODEV;
max = num_var_ranges;
/* No CPU hotplug when we change MTRR entries */
get_online_cpus();
mutex_lock(&mtrr_mutex);
if (reg < 0... | false | false | false | false | false | 0 |
gfire_server_query_supports(const gchar *p_type)
{
if(!p_type)
return FALSE;
int i = 0;
for(; registeredDrivers[i].proto; i++)
{
if(g_strcmp0(registeredDrivers[i].proto, p_type) == 0)
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
possiblyContainsTrack(const KUrl & url) const
{
return url.url().contains( m_metaFactory->tablePrefix(), Qt::CaseInsensitive );
} | false | false | false | false | false | 0 |
_vala_usage_resource_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
UsageResource * self;
self = G_TYPE_CHECK_INSTANCE_CAST (object, USAGE_TYPE_RESOURCE, UsageResource);
switch (property_id) {
case USAGE_RESOURCE_NAME:
g_value_set_string (value, usage_resource_get_name (... | false | false | false | false | false | 0 |
push_deferring_access_checks (deferring_kind deferring)
{
/* For context like template instantiation, access checking
disabling applies to all nested context. */
if (deferred_access_no_check || deferring == dk_no_check)
deferred_access_no_check++;
else
{
deferred_access e = {NULL, deferring};
... | false | false | false | false | false | 0 |
avc_xperms_audit_required(u32 requested,
struct av_decision *avd,
struct extended_perms_decision *xpd,
u8 perm,
int result,
u32 *deniedp)
{
u32 denied, audited;
denied = requested & ~avd->allowed;
if (unlikely(denied)) {
audited = denied & avd->auditdeny;
if (audited && xpd) {
if (av... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
HistoryDlg *_t = static_cast<HistoryDlg *>(_o);
switch (_id) {
case 0: _t->openEvent((*reinterpret_cast< PsiEvent*(*)>(_a[1])));... | false | false | false | false | false | 0 |
integer_nonzerop (const_tree expr)
{
STRIP_NOPS (expr);
return ((TREE_CODE (expr) == INTEGER_CST
&& (TREE_INT_CST_LOW (expr) != 0
|| TREE_INT_CST_HIGH (expr) != 0))
|| (TREE_CODE (expr) == COMPLEX_CST
&& (integer_nonzerop (TREE_REALPART (expr))
|| integer_nonzerop (TREE_IMAGPART (expr))))... | false | false | false | false | false | 0 |
comparecase(const FXchar* s1,const FXchar* s2,FXint n){
register FXint c1,c2;
if(0<n){
do{
if((*s1 & 0x80) && (*s2 & 0x80)){
c1=Unicode::toLower(wc(s1)); s1+=wclen(s1);
c2=Unicode::toLower(wc(s2)); s2+=wclen(s2);
}
else{
c1=Ascii::toLower(*s1); s1+=1;
c2=Ascii... | false | false | false | false | false | 0 |
pf_tell(pfstate *pf) {
t1_data *td = pf->data;
size_t o = 0;
while (td != pf->curblock) {
o += td->length;
td = td->next;
}
return o + pf->offset;
} | false | false | false | false | false | 0 |
arrayIndexThenCheck()
{
if (!_settings->isEnabled("style"))
return;
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
if (Token::Match(tok, "%var% [ %var% ]")) {
const std::string& indexName(tok->strAt(2));
// skip array index..
tok = to... | false | false | false | false | false | 0 |
nilfs_attach_log_writer(struct super_block *sb, struct nilfs_root *root)
{
struct the_nilfs *nilfs = sb->s_fs_info;
int err;
if (nilfs->ns_writer) {
/*
* This happens if the filesystem was remounted
* read/write after nilfs_error degenerated it into a
* read-only mount.
*/
nilfs_detach_log_writer(sb... | false | false | false | false | false | 0 |
FoldAsn1Doc(unsigned int, int, int, WordList *[], Accessor &styler)
{
// No folding enabled, no reason to continue...
if( styler.GetPropertyInt("fold") == 0 )
return;
// No folding implemented: doesn't make sense for ASN.1
} | false | false | false | false | false | 0 |
vala_transform_scope_func (GHashTable *table,
G_GNUC_UNUSED gpointer user_data)
{
gchar *scope;
scope = g_hash_table_lookup (table, "Scope");
if (scope == NULL)
{
g_hash_table_insert (table, "Scope",
g_strdup_printf("public"));
}
} | false | false | false | false | false | 0 |
bluetooth_chooser_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
BluetoothChooser *self = BLUETOOTH_CHOOSER(object);
BluetoothChooserPrivate *priv = BLUETOOTH_CHOOSER_GET_PRIVATE(object);
switch (prop_id) {
case PROP_DEVICE_SELECTED:
g_value_take_string (value, bluetooth_... | false | false | false | false | false | 0 |
_evbuffer_incref_and_lock(struct evbuffer *buf)
{
EVBUFFER_LOCK(buf);
++buf->refcnt;
} | false | false | false | false | false | 0 |
InitOtherInput(void)
{
void *InputDPtr;
int t;
int x;
int attrib;
for(t=0,x=0;x<2;x++)
{
attrib=0;
InputDPtr=0;
switch(InputType[x])
{
case SI_POWERPADA:
case SI_POWERPADB:InputDPtr=&powerpadbuf[x];break;
case SI_GAMEPAD:InputDPtr=&JSreturn;break;
case SI_ARK... | false | false | false | false | false | 0 |
rtsx_pci_ms_suspend(struct platform_device *pdev, pm_message_t state)
{
struct realtek_pci_ms *host = platform_get_drvdata(pdev);
struct memstick_host *msh = host->msh;
dev_dbg(ms_dev(host), "--> %s\n", __func__);
memstick_suspend_host(msh);
return 0;
} | false | false | false | false | false | 0 |
MoveRGap(int RPos) {
int GapSize = RAllocated - RCount;
if (RGap == RPos)
return 1;
if (RPos < 0 || RPos > RCount)
return 0;
if (RGap < RPos) {
if (RPos - RGap == 1)
LL[RGap] = LL[RGap + GapSize];
else
memmove(LL + RGap,
LL + RGap... | false | false | false | false | false | 0 |
connect_remote(CLI *c) { /* connect remote host */
SOCKADDR_UNION addr;
SOCKADDR_LIST resolved_list, *address_list;
int fd, ind_try, ind_cur;
/* setup address_list */
if(c->opt->option.delayed_lookup) {
resolved_list.num=0;
if(!name2addrlist(&resolved_list,
c->opt->r... | false | true | false | false | false | 1 |
read_header(int cl, struct req * r)
{
size_t len, i;
char buf[2048];
char *b, *p;
i = 0;
while ((len = get_line(cl, buf, sizeof(buf))) > 0 && i < sizeof(r->header) - 1) {
b = buf;
while (isspace((int) *b) && *(b++) != '\0');
if (*b == '\0')
continue;
p = (char *) my_alloc... | true | true | false | false | false | 1 |
ok_read(BIO *b, char *out, int outl)
{
int ret=0,i,n;
BIO_OK_CTX *ctx;
if (out == NULL) return(0);
ctx=(BIO_OK_CTX *)b->ptr;
if ((ctx == NULL) || (b->next_bio == NULL) || (b->init == 0)) return(0);
while(outl > 0)
{
/* copy clean bytes to output buffer */
if (ctx->blockout)
{
i=ctx->buf_len-ctx->... | false | false | false | false | false | 0 |
defragment()
{
if (cacheAvail * cachePageSize() == cacheSize) {
return; // That was easy
}
kDebug(ksdcArea()) << "Defragmenting the shared cache";
// Just do a linear scan, and anytime there is free space, swap it
// with the pages to its right. In order to meet... | false | false | false | false | false | 0 |
tp_base_call_channel_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (object);
switch (property_id)
{
case PROP_INITIAL_AUDIO:
g_value_set_boolean (value, self->priv->initial_audio);
break;
... | false | false | false | false | false | 0 |
_PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt)
{
char buf[4096];
size_t cnt;
if (!filename)
return;
#ifdef HAVE_LIBZ
AH->FH = gzopen(filename, "rb");
#else
AH->FH = fopen(filename, PG_BINARY_R);
#endif
if (AH->FH == NULL)
die_horribly(AH, modulename, "could not open input file \"... | true | true | false | false | true | 1 |
_smart_clip_set(Evas_Object *obj,
Evas_Object *clip)
{
Eina_List *list;
Evas_Object *o;
if ((list = evas_object_smart_members_get(obj)))
{
EINA_LIST_FREE(list, o)
{
if (evas_object_data_get(o, "_elm_leaveme")) continue;
evas_object_clip_set(o, c... | false | false | false | false | false | 0 |
read()
{
//qDebug("CompressionHandler::read");
QByteArray b = incoming_buffer_.buffer();
incoming_buffer_.buffer().clear();
incoming_buffer_.reset();
return b;
} | false | false | false | false | false | 0 |
AppendVarBind(VarBindList *list)
{
AsnListNode *newNode;
VarBind *entry;
newNode = alloc_t(AsnListNode);
newNode->data = alloc_t(VarBind);
newNode->next = NULL;
if(list->last == NULL)
{
newNode->prev = NULL;
list->first = newNode;
list->last = newNode;
}
else
{
new... | false | false | false | false | false | 0 |
dumpTablespaces(PGconn *conn)
{
PGresult *res;
int i;
/*
* Get all tablespaces except built-in ones (which we assume are named
* pg_xxx)
*/
if (server_version >= 80200)
res = executeQuery(conn, "SELECT spcname, "
"pg_catalog.pg_get_userbyid(spcowner) AS spcowner, "
"spclocation, spcacl,... | false | false | false | false | false | 0 |
handler_set_tls(handler *h, const char *keyfile)
{
#if USE_SSL
static int init = 0;
if (!init)
{
SSL_load_error_strings();
SSLeay_add_all_algorithms();
SSL_library_init();
init = 1;
}
h->ctx = (SSL_CTX*)SSL_CTX_new(TLSv1_2_server_method());
if (!h->ctx)
{
printf("SSL new server context failed\n");
... | false | false | false | false | false | 0 |
cb_labelcolor_button(Fl_Button*, void*) {
Fl_Color val = tree->labelcolor();
if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel')
labelcolor_button->color(val); // update modified color to button
tree->labelcolor(val);
window->redraw(); // affects window (tree's label is out... | false | false | false | false | false | 0 |
find_prefix(mip, mode)
matchinf_T *mip;
int mode;
{
idx_T arridx = 0;
int len;
int wlen = 0;
int flen;
int c;
char_u *ptr;
idx_T lo, hi, m;
slang_T *slang = mip->mi_lp->lp_slang;
char_u *byts;
idx_T *idxs;
byts = slang->sl_pbyts;
if (byts == NULL)
return; ... | false | false | false | false | false | 0 |
setUnallocatableRegs(const MachineFunction &MF) {
BitVector AllocSet = TRI.getAllocatableSet(MF);
for (int R = AllocSet.find_first(); R != -1; R = AllocSet.find_next(R))
for (MCRegAliasIterator AI(R, &TRI, false); AI.isValid(); ++AI)
AllocSet.set(*AI);
AllocSet.set(Mips::ZERO);
AllocSet.set(Mips::ZE... | false | false | false | false | false | 0 |
selinux_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
{
u32 peer_secid = SECSID_NULL;
u16 family;
if (skb && skb->protocol == htons(ETH_P_IP))
family = PF_INET;
else if (skb && skb->protocol == htons(ETH_P_IPV6))
family = PF_INET6;
else if (sock)
family = sock->sk->sk_family;... | false | false | false | false | false | 0 |
hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size)
{
unsigned int new_allocated = buffer->allocated;
if (size > new_allocated)
{
while (size > new_allocated)
new_allocated += (new_allocated >> 1) + 8;
if (buffer->positions)
buffer->positions = realloc (buffer->positions, new_allocated... | false | false | false | false | false | 0 |
UpdateBounds ()
{
// This code might be off by a little thing because of miter limits.
list <Point>::const_iterator i = m_Points.begin (), end = m_Points.end ();
if (i == end)
return;
m_x0 = m_x1 = (*i).x;
m_y0 = m_y1 = (*i).y;
for (i++; i != end; i++) {
if ((*i).x < m_x0)
m_x0 = (*i).x;
else if ((*i).x ... | false | false | false | false | false | 0 |
usage(FILE *f, char *cmd)
{
fprintf(f, "\nUsage: %s [?hVv] [-i <interface>] <node name>|<macaddr>\n", cmd);
fprintf(f, " -? Show this usage message\n");
fprintf(f, " -h Show this usage message\n");
fprintf(f, " -V Show the version of moprc\n");
fprintf(f, " -i ... | false | false | false | false | false | 0 |
select_first_macct(struct w *widgets)
{
GtkTreePath *path;
GtkTreeIter iter;
GtkTreeModel *list_store;
gchar *macct=NULL;
path = gtk_tree_path_new_first();
list_store = gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->macct_treeview));
if( ! gtk_tree_model_get_iter(list_store, &iter, path) ... | false | false | false | false | false | 0 |
storeShadow(Value *Addr, uint64_t Size, uint64_t Align,
Value *Shadow, Instruction *Pos) {
if (AllocaInst *AI = dyn_cast<AllocaInst>(Addr)) {
llvm::DenseMap<AllocaInst *, AllocaInst *>::iterator i =
AllocaShadowMap.find(AI);
if (i != AllocaShadowMap.end()) {
IRBui... | false | false | false | false | false | 0 |
is_playing()
{
if (!impl) return false;
CL_MutexSection mutex_lock(&impl->mutex);
return impl->playing;
} | false | false | false | false | false | 0 |
init_thread_server()
{
int i;
quit_count = 0;
nmessage_count = 0;
barrier_count = 0;
master_barrier_msg_recvd = 0;
MPI_Comm_size(newcomm, &nprocs);
nactive = 0;
nactive_pardo = 0;
pardo_list_head = -1;
pardo_list_tail = -1;
init_msg_tag(); /* Initialize message tag gen... | false | false | false | false | false | 0 |
userTask(void)
{
if (myExercising && myCam != NULL && myLastExer.mSecSince() > 10000)
{
switch (myExerState) {
case CENTER:
myCam->panTilt(myCam->getMaxNegPan(), myCam->getMaxPosTilt());
myExerState = UP_LEFT;
myLastExer.setToNow();
break;
case UP_LEFT:
myCam->panTilt(myCam... | false | false | false | false | false | 0 |
resize( size_t nFrames, unsigned int nChannels )
{
nFrames_ = nFrames;
nChannels_ = nChannels;
size_ = nFrames_ * nChannels_;
if ( size_ > bufferSize_ ) {
if ( data_ ) free( data_ );
data_ = (StkFloat *) malloc( size_ * sizeof( StkFloat ) );
#if defined(_STK_DEBUG_)
if ( data_ == NULL ) {
std... | false | false | false | false | false | 0 |
get_num(char *a) {
int i;
unsigned long long sum = 0;
for (i = 0; i < N; i++) {
sum *= 10;
sum += a[i];
}
return sum;
} | false | false | false | false | false | 0 |
VisitCatchExtensionObject(CatchExtensionObject* node) {
ASSERT(!in_spilled_code());
// Call runtime routine to allocate the catch extension object and
// assign the exception value to the catch variable.
Comment cmnt(masm_, "[ CatchExtensionObject");
Load(node->key());
Load(node->value());
Result result =... | 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.